Clang-format tests, examples, libraries, benchmarks, etc.
diff --git a/bench/BenchSparseUtil.h b/bench/BenchSparseUtil.h
index 13981f6..663cd48 100644
--- a/bench/BenchSparseUtil.h
+++ b/bench/BenchSparseUtil.h
@@ -20,63 +20,51 @@
 #endif
 
 typedef SCALAR Scalar;
-typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrix;
-typedef Matrix<Scalar,Dynamic,1> DenseVector;
+typedef Matrix<Scalar, Dynamic, Dynamic> DenseMatrix;
+typedef Matrix<Scalar, Dynamic, 1> DenseVector;
 typedef SparseMatrix<Scalar> EigenSparseMatrix;
 
-void fillMatrix(float density, int rows, int cols,  EigenSparseMatrix& dst)
-{
-  dst.reserve(double(rows)*cols*density);
-  for(int j = 0; j < cols; j++)
-  {
-    for(int i = 0; i < rows; i++)
-    {
-      Scalar v = (internal::random<float>(0,1) < density) ? internal::random<Scalar>() : 0;
-      if (v!=0)
-        dst.insert(i,j) = v;
+void fillMatrix(float density, int rows, int cols, EigenSparseMatrix& dst) {
+  dst.reserve(double(rows) * cols * density);
+  for (int j = 0; j < cols; j++) {
+    for (int i = 0; i < rows; i++) {
+      Scalar v = (internal::random<float>(0, 1) < density) ? internal::random<Scalar>() : 0;
+      if (v != 0) dst.insert(i, j) = v;
     }
   }
   dst.finalize();
 }
 
-void fillMatrix2(int nnzPerCol, int rows, int cols,  EigenSparseMatrix& dst)
-{
-//   std::cout << "alloc " << nnzPerCol*cols << "\n";
-  dst.reserve(nnzPerCol*cols);
-  for(int j = 0; j < cols; j++)
-  {
+void fillMatrix2(int nnzPerCol, int rows, int cols, EigenSparseMatrix& dst) {
+  //   std::cout << "alloc " << nnzPerCol*cols << "\n";
+  dst.reserve(nnzPerCol * cols);
+  for (int j = 0; j < cols; j++) {
     std::set<int> aux;
-    for(int i = 0; i < nnzPerCol; i++)
-    {
-      int k = internal::random<int>(0,rows-1);
-      while (aux.find(k)!=aux.end())
-        k = internal::random<int>(0,rows-1);
+    for (int i = 0; i < nnzPerCol; i++) {
+      int k = internal::random<int>(0, rows - 1);
+      while (aux.find(k) != aux.end()) k = internal::random<int>(0, rows - 1);
       aux.insert(k);
 
-      dst.insert(k,j) = internal::random<Scalar>();
+      dst.insert(k, j) = internal::random<Scalar>();
     }
   }
   dst.finalize();
 }
 
-void eiToDense(const EigenSparseMatrix& src, DenseMatrix& dst)
-{
+void eiToDense(const EigenSparseMatrix& src, DenseMatrix& dst) {
   dst.setZero();
-  for (int j=0; j<src.cols(); ++j)
-    for (EigenSparseMatrix::InnerIterator it(src.derived(), j); it; ++it)
-      dst(it.index(),j) = it.value();
+  for (int j = 0; j < src.cols(); ++j)
+    for (EigenSparseMatrix::InnerIterator it(src.derived(), j); it; ++it) dst(it.index(), j) = it.value();
 }
 
 #ifndef NOGMM
 #include "gmm/gmm.h"
 typedef gmm::csc_matrix<Scalar> GmmSparse;
-typedef gmm::col_matrix< gmm::wsvector<Scalar> > GmmDynSparse;
-void eiToGmm(const EigenSparseMatrix& src, GmmSparse& dst)
-{
+typedef gmm::col_matrix<gmm::wsvector<Scalar> > GmmDynSparse;
+void eiToGmm(const EigenSparseMatrix& src, GmmSparse& dst) {
   GmmDynSparse tmp(src.rows(), src.cols());
-  for (int j=0; j<src.cols(); ++j)
-    for (EigenSparseMatrix::InnerIterator it(src.derived(), j); it; ++it)
-      tmp(it.index(),j) = it.value();
+  for (int j = 0; j < src.cols(); ++j)
+    for (EigenSparseMatrix::InnerIterator it(src.derived(), j); it; ++it) tmp(it.index(), j) = it.value();
   gmm::copy(tmp, dst);
 }
 #endif
@@ -85,12 +73,10 @@
 #include <boost/numeric/mtl/mtl.hpp>
 typedef mtl::compressed2D<Scalar, mtl::matrix::parameters<mtl::tag::col_major> > MtlSparse;
 typedef mtl::compressed2D<Scalar, mtl::matrix::parameters<mtl::tag::row_major> > MtlSparseRowMajor;
-void eiToMtl(const EigenSparseMatrix& src, MtlSparse& dst)
-{
+void eiToMtl(const EigenSparseMatrix& src, MtlSparse& dst) {
   mtl::matrix::inserter<MtlSparse> ins(dst);
-  for (int j=0; j<src.cols(); ++j)
-    for (EigenSparseMatrix::InnerIterator it(src.derived(), j); it; ++it)
-      ins[it.index()][j] = it.value();
+  for (int j = 0; j < src.cols(); ++j)
+    for (EigenSparseMatrix::InnerIterator it(src.derived(), j); it; ++it) ins[it.index()][j] = it.value();
 }
 #endif
 
@@ -98,20 +84,18 @@
 extern "C" {
 #include "cs.h"
 }
-void eiToCSparse(const EigenSparseMatrix& src, cs* &dst)
-{
-  cs* aux = cs_spalloc (0, 0, 1, 1, 1);
-  for (int j=0; j<src.cols(); ++j)
+void eiToCSparse(const EigenSparseMatrix& src, cs*& dst) {
+  cs* aux = cs_spalloc(0, 0, 1, 1, 1);
+  for (int j = 0; j < src.cols(); ++j)
     for (EigenSparseMatrix::InnerIterator it(src.derived(), j); it; ++it)
-      if (!cs_entry(aux, it.index(), j, it.value()))
-      {
+      if (!cs_entry(aux, it.index(), j, it.value())) {
         std::cout << "cs_entry error\n";
         exit(2);
       }
-   dst = cs_compress(aux);
-//    cs_spfree(aux);
+  dst = cs_compress(aux);
+  //    cs_spfree(aux);
 }
-#endif // CSPARSE
+#endif  // CSPARSE
 
 #ifndef NOUBLAS
 #include <boost/numeric/ublas/vector.hpp>
@@ -123,22 +107,18 @@
 #include <boost/numeric/ublas/vector_of_vector.hpp>
 #include <boost/numeric/ublas/operation.hpp>
 
-typedef boost::numeric::ublas::compressed_matrix<Scalar,boost::numeric::ublas::column_major> UBlasSparse;
+typedef boost::numeric::ublas::compressed_matrix<Scalar, boost::numeric::ublas::column_major> UBlasSparse;
 
-void eiToUblas(const EigenSparseMatrix& src, UBlasSparse& dst)
-{
+void eiToUblas(const EigenSparseMatrix& src, UBlasSparse& dst) {
   dst.resize(src.rows(), src.cols(), false);
-  for (int j=0; j<src.cols(); ++j)
-    for (EigenSparseMatrix::InnerIterator it(src.derived(), j); it; ++it)
-      dst(it.index(),j) = it.value();
+  for (int j = 0; j < src.cols(); ++j)
+    for (EigenSparseMatrix::InnerIterator it(src.derived(), j); it; ++it) dst(it.index(), j) = it.value();
 }
 
 template <typename EigenType, typename UblasType>
-void eiToUblasVec(const EigenType& src, UblasType& dst)
-{
+void eiToUblasVec(const EigenType& src, UblasType& dst) {
   dst.resize(src.size());
-  for (int j=0; j<src.size(); ++j)
-      dst[j] = src.coeff(j);
+  for (int j = 0; j < src.size(); ++j) dst[j] = src.coeff(j);
 }
 #endif
 
diff --git a/bench/BenchTimer.h b/bench/BenchTimer.h
index 8a0dbbe..0b8c63c 100644
--- a/bench/BenchTimer.h
+++ b/bench/BenchTimer.h
@@ -12,19 +12,19 @@
 #define EIGEN_BENCH_TIMERR_H
 
 #if defined(_WIN32) || defined(__CYGWIN__)
-# ifndef NOMINMAX
-#   define NOMINMAX
-#   define EIGEN_BT_UNDEF_NOMINMAX
-# endif
-# ifndef WIN32_LEAN_AND_MEAN
-#   define WIN32_LEAN_AND_MEAN
-#   define EIGEN_BT_UNDEF_WIN32_LEAN_AND_MEAN
-# endif
-# include <windows.h>
+#ifndef NOMINMAX
+#define NOMINMAX
+#define EIGEN_BT_UNDEF_NOMINMAX
+#endif
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#define EIGEN_BT_UNDEF_WIN32_LEAN_AND_MEAN
+#endif
+#include <windows.h>
 #elif defined(__APPLE__)
 #include <mach/mach_time.h>
 #else
-# include <unistd.h>
+#include <unistd.h>
 #endif
 
 static void escape(void *p) {
@@ -41,27 +41,20 @@
 
 #include <Eigen/Core>
 
-namespace Eigen
-{
+namespace Eigen {
 
-enum {
-  CPU_TIMER = 0,
-  REAL_TIMER = 1
-};
+enum { CPU_TIMER = 0, REAL_TIMER = 1 };
 
 /** Elapsed time timer keeping the best try.
-  *
-  * On POSIX platforms we use clock_gettime with CLOCK_PROCESS_CPUTIME_ID.
-  * On Windows we use QueryPerformanceCounter
-  *
-  * Important: on linux, you must link with -lrt
-  */
-class BenchTimer
-{
-public:
-
-  BenchTimer()
-  {
+ *
+ * On POSIX platforms we use clock_gettime with CLOCK_PROCESS_CPUTIME_ID.
+ * On Windows we use QueryPerformanceCounter
+ *
+ * Important: on linux, you must link with -lrt
+ */
+class BenchTimer {
+ public:
+  BenchTimer() {
 #if defined(_WIN32) || defined(__CYGWIN__)
     LARGE_INTEGER freq;
     QueryPerformanceFrequency(&freq);
@@ -72,69 +65,53 @@
 
   ~BenchTimer() {}
 
-  inline void reset()
-  {
+  inline void reset() {
     m_bests.fill(1e9);
     m_worsts.fill(0);
     m_totals.setZero();
   }
-  inline void start()
-  {
-    m_starts[CPU_TIMER]  = getCpuTime();
+  inline void start() {
+    m_starts[CPU_TIMER] = getCpuTime();
     m_starts[REAL_TIMER] = getRealTime();
   }
-  inline void stop()
-  {
+  inline void stop() {
     m_times[CPU_TIMER] = getCpuTime() - m_starts[CPU_TIMER];
     m_times[REAL_TIMER] = getRealTime() - m_starts[REAL_TIMER];
-    #if EIGEN_VERSION_AT_LEAST(2,90,0)
+#if EIGEN_VERSION_AT_LEAST(2, 90, 0)
     m_bests = m_bests.cwiseMin(m_times);
     m_worsts = m_worsts.cwiseMax(m_times);
-    #else
-    m_bests(0) = std::min(m_bests(0),m_times(0));
-    m_bests(1) = std::min(m_bests(1),m_times(1));
-    m_worsts(0) = std::max(m_worsts(0),m_times(0));
-    m_worsts(1) = std::max(m_worsts(1),m_times(1));
-    #endif
+#else
+    m_bests(0) = std::min(m_bests(0), m_times(0));
+    m_bests(1) = std::min(m_bests(1), m_times(1));
+    m_worsts(0) = std::max(m_worsts(0), m_times(0));
+    m_worsts(1) = std::max(m_worsts(1), m_times(1));
+#endif
     m_totals += m_times;
   }
 
   /** Return the elapsed time in seconds between the last start/stop pair
-    */
-  inline double value(int TIMER = CPU_TIMER) const
-  {
-    return m_times[TIMER];
-  }
+   */
+  inline double value(int TIMER = CPU_TIMER) const { return m_times[TIMER]; }
 
   /** Return the best elapsed time in seconds
-    */
-  inline double best(int TIMER = CPU_TIMER) const
-  {
-    return m_bests[TIMER];
-  }
+   */
+  inline double best(int TIMER = CPU_TIMER) const { return m_bests[TIMER]; }
 
   /** Return the worst elapsed time in seconds
-    */
-  inline double worst(int TIMER = CPU_TIMER) const
-  {
-    return m_worsts[TIMER];
-  }
+   */
+  inline double worst(int TIMER = CPU_TIMER) const { return m_worsts[TIMER]; }
 
   /** Return the total elapsed time in seconds.
-    */
-  inline double total(int TIMER = CPU_TIMER) const
-  {
-    return m_totals[TIMER];
-  }
+   */
+  inline double total(int TIMER = CPU_TIMER) const { return m_totals[TIMER]; }
 
-  inline double getCpuTime() const
-  {
+  inline double getCpuTime() const {
 #ifdef _WIN32
     LARGE_INTEGER query_ticks;
     QueryPerformanceCounter(&query_ticks);
-    return query_ticks.QuadPart/m_frequency;
+    return query_ticks.QuadPart / m_frequency;
 #elif __APPLE__
-    return double(mach_absolute_time())*1e-9;
+    return double(mach_absolute_time()) * 1e-9;
 #else
     timespec ts;
     clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts);
@@ -142,14 +119,13 @@
 #endif
   }
 
-  inline double getRealTime() const
-  {
+  inline double getRealTime() const {
 #ifdef _WIN32
     SYSTEMTIME st;
     GetSystemTime(&st);
     return (double)st.wSecond + 1.e-3 * (double)st.wMilliseconds;
 #elif __APPLE__
-    return double(mach_absolute_time())*1e-9;
+    return double(mach_absolute_time()) * 1e-9;
 #else
     timespec ts;
     clock_gettime(CLOCK_REALTIME, &ts);
@@ -157,7 +133,7 @@
 #endif
   }
 
-protected:
+ protected:
 #if defined(_WIN32) || defined(__CYGWIN__)
   double m_frequency;
 #endif
@@ -167,33 +143,34 @@
   Vector2d m_worsts;
   Vector2d m_totals;
 
-public:
+ public:
   EIGEN_MAKE_ALIGNED_OPERATOR_NEW
 };
 
-#define BENCH(TIMER,TRIES,REP,CODE) { \
-    TIMER.reset(); \
-    for(int uglyvarname1=0; uglyvarname1<TRIES; ++uglyvarname1){ \
-      TIMER.start(); \
-      for(int uglyvarname2=0; uglyvarname2<REP; ++uglyvarname2){ \
-        CODE; \
-      } \
-      TIMER.stop(); \
-      clobber(); \
-    } \
+#define BENCH(TIMER, TRIES, REP, CODE)                                 \
+  {                                                                    \
+    TIMER.reset();                                                     \
+    for (int uglyvarname1 = 0; uglyvarname1 < TRIES; ++uglyvarname1) { \
+      TIMER.start();                                                   \
+      for (int uglyvarname2 = 0; uglyvarname2 < REP; ++uglyvarname2) { \
+        CODE;                                                          \
+      }                                                                \
+      TIMER.stop();                                                    \
+      clobber();                                                       \
+    }                                                                  \
   }
 
-}
+}  // namespace Eigen
 
 // clean #defined tokens
 #ifdef EIGEN_BT_UNDEF_NOMINMAX
-# undef EIGEN_BT_UNDEF_NOMINMAX
-# undef NOMINMAX
+#undef EIGEN_BT_UNDEF_NOMINMAX
+#undef NOMINMAX
 #endif
 
 #ifdef EIGEN_BT_UNDEF_WIN32_LEAN_AND_MEAN
-# undef EIGEN_BT_UNDEF_WIN32_LEAN_AND_MEAN
-# undef WIN32_LEAN_AND_MEAN
+#undef EIGEN_BT_UNDEF_WIN32_LEAN_AND_MEAN
+#undef WIN32_LEAN_AND_MEAN
 #endif
 
-#endif // EIGEN_BENCH_TIMERR_H
+#endif  // EIGEN_BENCH_TIMERR_H
diff --git a/bench/BenchUtil.h b/bench/BenchUtil.h
index 8883a13..4adf0ac 100644
--- a/bench/BenchUtil.h
+++ b/bench/BenchUtil.h
@@ -18,54 +18,52 @@
 #include <boost/preprocessor/punctuation/comma.hpp>
 #include <boost/preprocessor/stringize.hpp>
 
-template<typename MatrixType> void initMatrix_random(MatrixType& mat) __attribute__((noinline));
-template<typename MatrixType> void initMatrix_random(MatrixType& mat)
-{
-  mat.setRandom();// = MatrixType::random(mat.rows(), mat.cols());
+template <typename MatrixType>
+void initMatrix_random(MatrixType& mat) __attribute__((noinline));
+template <typename MatrixType>
+void initMatrix_random(MatrixType& mat) {
+  mat.setRandom();  // = MatrixType::random(mat.rows(), mat.cols());
 }
 
-template<typename MatrixType> void initMatrix_identity(MatrixType& mat) __attribute__((noinline));
-template<typename MatrixType> void initMatrix_identity(MatrixType& mat)
-{
+template <typename MatrixType>
+void initMatrix_identity(MatrixType& mat) __attribute__((noinline));
+template <typename MatrixType>
+void initMatrix_identity(MatrixType& mat) {
   mat.setIdentity();
 }
 
 #ifndef __INTEL_COMPILER
-#define DISABLE_SSE_EXCEPTIONS()  { \
-  int aux; \
-  asm( \
-  "stmxcsr   %[aux]           \n\t" \
-  "orl       $32832, %[aux]   \n\t" \
-  "ldmxcsr   %[aux]           \n\t" \
-  : : [aux] "m" (aux)); \
-}
+#define DISABLE_SSE_EXCEPTIONS()          \
+  {                                       \
+    int aux;                              \
+    asm("stmxcsr   %[aux]           \n\t" \
+        "orl       $32832, %[aux]   \n\t" \
+        "ldmxcsr   %[aux]           \n\t" \
+        :                                 \
+        : [aux] "m"(aux));                \
+  }
 #else
-#define DISABLE_SSE_EXCEPTIONS()  
+#define DISABLE_SSE_EXCEPTIONS()
 #endif
 
 #ifdef BENCH_GMM
 #include <gmm/gmm.h>
 template <typename EigenMatrixType, typename GmmMatrixType>
-void eiToGmm(const EigenMatrixType& src, GmmMatrixType& dst)
-{
-  dst.resize(src.rows(),src.cols());
-  for (int j=0; j<src.cols(); ++j)
-    for (int i=0; i<src.rows(); ++i)
-      dst(i,j) = src.coeff(i,j);
+void eiToGmm(const EigenMatrixType& src, GmmMatrixType& dst) {
+  dst.resize(src.rows(), src.cols());
+  for (int j = 0; j < src.cols(); ++j)
+    for (int i = 0; i < src.rows(); ++i) dst(i, j) = src.coeff(i, j);
 }
 #endif
 
-
 #ifdef BENCH_GSL
 #include <gsl/gsl_matrix.h>
 #include <gsl/gsl_linalg.h>
 #include <gsl/gsl_eigen.h>
 template <typename EigenMatrixType>
-void eiToGsl(const EigenMatrixType& src, gsl_matrix** dst)
-{
-  for (int j=0; j<src.cols(); ++j)
-    for (int i=0; i<src.rows(); ++i)
-      gsl_matrix_set(*dst, i, j, src.coeff(i,j));
+void eiToGsl(const EigenMatrixType& src, gsl_matrix** dst) {
+  for (int j = 0; j < src.cols(); ++j)
+    for (int i = 0; i < src.rows(); ++i) gsl_matrix_set(*dst, i, j, src.coeff(i, j));
 }
 #endif
 
@@ -73,20 +71,16 @@
 #include <boost/numeric/ublas/matrix.hpp>
 #include <boost/numeric/ublas/vector.hpp>
 template <typename EigenMatrixType, typename UblasMatrixType>
-void eiToUblas(const EigenMatrixType& src, UblasMatrixType& dst)
-{
-  dst.resize(src.rows(),src.cols());
-  for (int j=0; j<src.cols(); ++j)
-    for (int i=0; i<src.rows(); ++i)
-      dst(i,j) = src.coeff(i,j);
+void eiToUblas(const EigenMatrixType& src, UblasMatrixType& dst) {
+  dst.resize(src.rows(), src.cols());
+  for (int j = 0; j < src.cols(); ++j)
+    for (int i = 0; i < src.rows(); ++i) dst(i, j) = src.coeff(i, j);
 }
 template <typename EigenType, typename UblasType>
-void eiToUblasVec(const EigenType& src, UblasType& dst)
-{
+void eiToUblasVec(const EigenType& src, UblasType& dst) {
   dst.resize(src.size());
-  for (int j=0; j<src.size(); ++j)
-      dst[j] = src.coeff(j);
+  for (int j = 0; j < src.size(); ++j) dst[j] = src.coeff(j);
 }
 #endif
 
-#endif // EIGEN_BENCH_UTIL_H
+#endif  // EIGEN_BENCH_UTIL_H
diff --git a/bench/analyze-blocking-sizes.cpp b/bench/analyze-blocking-sizes.cpp
index 6bc4aca..c436739 100644
--- a/bench/analyze-blocking-sizes.cpp
+++ b/bench/analyze-blocking-sizes.cpp
@@ -37,20 +37,17 @@
   return l;
 }
 
-uint16_t compact_size_triple(size_t k, size_t m, size_t n)
-{
+uint16_t compact_size_triple(size_t k, size_t m, size_t n) {
   return (log2_pot(k) << 8) | (log2_pot(m) << 4) | log2_pot(n);
 }
 
 // just a helper to store a triple of K,M,N sizes for matrix product
-struct size_triple_t
-{
+struct size_triple_t {
   uint16_t k, m, n;
   size_triple_t() : k(0), m(0), n(0) {}
   size_triple_t(size_t _k, size_t _m, size_t _n) : k(_k), m(_m), n(_n) {}
   size_triple_t(const size_triple_t& o) : k(o.k), m(o.m), n(o.n) {}
-  size_triple_t(uint16_t compact)
-  {
+  size_triple_t(uint16_t compact) {
     k = 1 << ((compact & 0xf00) >> 8);
     m = 1 << ((compact & 0x0f0) >> 4);
     n = 1 << ((compact & 0x00f) >> 0);
@@ -58,35 +55,23 @@
   bool is_cubic() const { return k == m && m == n; }
 };
 
-ostream& operator<<(ostream& s, const size_triple_t& t)
-{
-  return s << "(" << t.k << ", " << t.m << ", " << t.n << ")";
-}
+ostream& operator<<(ostream& s, const size_triple_t& t) { return s << "(" << t.k << ", " << t.m << ", " << t.n << ")"; }
 
-struct inputfile_entry_t
-{
+struct inputfile_entry_t {
   uint16_t product_size;
   uint16_t pot_block_size;
   size_triple_t nonpot_block_size;
   float gflops;
 };
 
-struct inputfile_t
-{
-  enum class type_t {
-    unknown,
-    all_pot_sizes,
-    default_sizes
-  };
+struct inputfile_t {
+  enum class type_t { unknown, all_pot_sizes, default_sizes };
 
   string filename;
   vector<inputfile_entry_t> entries;
   type_t type;
 
-  inputfile_t(const string& fname)
-    : filename(fname)
-    , type(type_t::unknown)
-  {
+  inputfile_t(const string& fname) : filename(fname), type(type_t::unknown) {
     ifstream stream(filename);
     if (!stream.is_open()) {
       cerr << "couldn't open input file: " << filename << endl;
@@ -111,27 +96,17 @@
         type = type_t::default_sizes;
         continue;
       }
-      
 
       if (type == type_t::unknown) {
         continue;
       }
-      switch(type) {
+      switch (type) {
         case type_t::all_pot_sizes: {
           unsigned int product_size, block_size;
           float gflops;
-          int sscanf_result =
-            sscanf(line.c_str(), "%x %x %f",
-                   &product_size,
-                   &block_size,
-                   &gflops);
-          if (3 != sscanf_result ||
-              !product_size ||
-              product_size > 0xfff ||
-              !block_size ||
-              block_size > 0xfff ||
-              !isfinite(gflops))
-          {
+          int sscanf_result = sscanf(line.c_str(), "%x %x %f", &product_size, &block_size, &gflops);
+          if (3 != sscanf_result || !product_size || product_size > 0xfff || !block_size || block_size > 0xfff ||
+              !isfinite(gflops)) {
             cerr << "ill-formed input file: " << filename << endl;
             cerr << "offending line:" << endl << line << endl;
             exit(1);
@@ -150,16 +125,8 @@
           unsigned int product_size;
           float gflops;
           int bk, bm, bn;
-          int sscanf_result =
-            sscanf(line.c_str(), "%x default(%d, %d, %d) %f",
-                   &product_size,
-                   &bk, &bm, &bn,
-                   &gflops);
-          if (5 != sscanf_result ||
-              !product_size ||
-              product_size > 0xfff ||
-              !isfinite(gflops))
-          {
+          int sscanf_result = sscanf(line.c_str(), "%x default(%d, %d, %d) %f", &product_size, &bk, &bm, &bn, &gflops);
+          if (5 != sscanf_result || !product_size || product_size > 0xfff || !isfinite(gflops)) {
             cerr << "ill-formed input file: " << filename << endl;
             cerr << "offending line:" << endl << line << endl;
             exit(1);
@@ -175,7 +142,7 @@
           entries.push_back(entry);
           break;
         }
-        
+
         default:
           break;
       }
@@ -192,27 +159,22 @@
   }
 };
 
-struct preprocessed_inputfile_entry_t
-{
+struct preprocessed_inputfile_entry_t {
   uint16_t product_size;
   uint16_t block_size;
 
   float efficiency;
 };
 
-bool lower_efficiency(const preprocessed_inputfile_entry_t& e1, const preprocessed_inputfile_entry_t& e2)
-{
+bool lower_efficiency(const preprocessed_inputfile_entry_t& e1, const preprocessed_inputfile_entry_t& e2) {
   return e1.efficiency < e2.efficiency;
 }
 
-struct preprocessed_inputfile_t
-{
+struct preprocessed_inputfile_t {
   string filename;
   vector<preprocessed_inputfile_entry_t> entries;
 
-  preprocessed_inputfile_t(const inputfile_t& inputfile)
-    : filename(inputfile.filename)
-  {
+  preprocessed_inputfile_t(const inputfile_t& inputfile) : filename(inputfile.filename) {
     if (inputfile.type != inputfile_t::type_t::all_pot_sizes) {
       abort();
     }
@@ -220,20 +182,16 @@
     auto it_first_with_given_product_size = it;
     while (it != inputfile.entries.end()) {
       ++it;
-      if (it == inputfile.entries.end() ||
-        it->product_size != it_first_with_given_product_size->product_size)
-      {
+      if (it == inputfile.entries.end() || it->product_size != it_first_with_given_product_size->product_size) {
         import_input_file_range_one_product_size(it_first_with_given_product_size, it);
         it_first_with_given_product_size = it;
       }
     }
   }
 
-private:
-  void import_input_file_range_one_product_size(
-    const vector<inputfile_entry_t>::const_iterator& begin,
-    const vector<inputfile_entry_t>::const_iterator& end)
-  {
+ private:
+  void import_input_file_range_one_product_size(const vector<inputfile_entry_t>::const_iterator& begin,
+                                                const vector<inputfile_entry_t>::const_iterator& end) {
     uint16_t product_size = begin->product_size;
     float max_gflops = 0.0f;
     for (auto it = begin; it != end; ++it) {
@@ -254,9 +212,7 @@
   }
 };
 
-void check_all_files_in_same_exact_order(
-       const vector<preprocessed_inputfile_t>& preprocessed_inputfiles)
-{
+void check_all_files_in_same_exact_order(const vector<preprocessed_inputfile_t>& preprocessed_inputfiles) {
   if (preprocessed_inputfiles.empty()) {
     return;
   }
@@ -266,11 +222,8 @@
 
   for (size_t i = 0; i < preprocessed_inputfiles.size(); i++) {
     if (preprocessed_inputfiles[i].entries.size() != num_entries) {
-      cerr << "these files have different number of entries: "
-           << preprocessed_inputfiles[i].filename
-           << " and "
-           << first_file.filename
-           << endl;
+      cerr << "these files have different number of entries: " << preprocessed_inputfiles[i].filename << " and "
+           << first_file.filename << endl;
       exit(1);
     }
   }
@@ -281,12 +234,8 @@
     for (size_t file_index = 0; file_index < preprocessed_inputfiles.size(); file_index++) {
       const preprocessed_inputfile_t& cur_file = preprocessed_inputfiles[file_index];
       if (cur_file.entries[entry_index].product_size != entry_product_size ||
-          cur_file.entries[entry_index].block_size != entry_block_size)
-      {
-        cerr << "entries not in same order between these files: "
-             << first_file.filename
-             << " and "
-             << cur_file.filename
+          cur_file.entries[entry_index].block_size != entry_block_size) {
+        cerr << "entries not in same order between these files: " << first_file.filename << " and " << cur_file.filename
              << endl;
         exit(1);
       }
@@ -294,10 +243,8 @@
   }
 }
 
-float efficiency_of_subset(
-        const vector<preprocessed_inputfile_t>& preprocessed_inputfiles,
-        const vector<size_t>& subset)
-{
+float efficiency_of_subset(const vector<preprocessed_inputfile_t>& preprocessed_inputfiles,
+                           const vector<size_t>& subset) {
   if (subset.size() <= 1) {
     return 1.0f;
   }
@@ -309,9 +256,7 @@
   uint16_t product_size = first_file.entries[0].product_size;
   while (entry_index < num_entries) {
     ++entry_index;
-    if (entry_index == num_entries ||
-        first_file.entries[entry_index].product_size != product_size)
-    {
+    if (entry_index == num_entries || first_file.entries[entry_index].product_size != product_size) {
       float efficiency_this_product_size = 0.0f;
       for (size_t e = first_entry_index_with_this_product_size; e < entry_index; e++) {
         float efficiency_this_entry = 1.0f;
@@ -331,10 +276,8 @@
   return efficiency;
 }
 
-void dump_table_for_subset(
-        const vector<preprocessed_inputfile_t>& preprocessed_inputfiles,
-        const vector<size_t>& subset)
-{
+void dump_table_for_subset(const vector<preprocessed_inputfile_t>& preprocessed_inputfiles,
+                           const vector<size_t>& subset) {
   const preprocessed_inputfile_t& first_file = preprocessed_inputfiles[subset[0]];
   const size_t num_entries = first_file.entries.size();
   size_t entry_index = 0;
@@ -359,9 +302,7 @@
   cout << "    static const unsigned short data[" << TableSize << "] = {";
   while (entry_index < num_entries) {
     ++entry_index;
-    if (entry_index == num_entries ||
-        first_file.entries[entry_index].product_size != product_size)
-    {
+    if (entry_index == num_entries || first_file.entries[entry_index].product_size != product_size) {
       float best_efficiency_this_product_size = 0.0f;
       uint16_t best_block_size_this_product_size = 0;
       for (size_t e = first_entry_index_with_this_product_size; e < entry_index; e++) {
@@ -397,10 +338,8 @@
   cout << "};" << endl;
 }
 
-float efficiency_of_partition(
-        const vector<preprocessed_inputfile_t>& preprocessed_inputfiles,
-        const vector<vector<size_t>>& partition)
-{
+float efficiency_of_partition(const vector<preprocessed_inputfile_t>& preprocessed_inputfiles,
+                              const vector<vector<size_t>>& partition) {
   float efficiency = 1.0f;
   for (auto s = partition.begin(); s != partition.end(); ++s) {
     efficiency = min(efficiency, efficiency_of_subset(preprocessed_inputfiles, *s));
@@ -408,8 +347,7 @@
   return efficiency;
 }
 
-void make_first_subset(size_t subset_size, vector<size_t>& out_subset, size_t set_size)
-{
+void make_first_subset(size_t subset_size, vector<size_t>& out_subset, size_t set_size) {
   assert(subset_size >= 1 && subset_size <= set_size);
   out_subset.resize(subset_size);
   for (size_t i = 0; i < subset_size; i++) {
@@ -417,13 +355,9 @@
   }
 }
 
-bool is_last_subset(const vector<size_t>& subset, size_t set_size)
-{
-  return subset[0] == set_size - subset.size();
-}
+bool is_last_subset(const vector<size_t>& subset, size_t set_size) { return subset[0] == set_size - subset.size(); }
 
-void next_subset(vector<size_t>& inout_subset, size_t set_size)
-{
+void next_subset(vector<size_t>& inout_subset, size_t set_size) {
   if (is_last_subset(inout_subset, set_size)) {
     cerr << "iterating past the last subset" << endl;
     abort();
@@ -444,9 +378,8 @@
 const size_t number_of_subsets_limit = 100;
 const size_t always_search_subsets_of_size_at_least = 2;
 
-bool is_number_of_subsets_feasible(size_t n, size_t p)
-{ 
-  assert(n>0 && p>0 && p<=n);
+bool is_number_of_subsets_feasible(size_t n, size_t p) {
+  assert(n > 0 && p > 0 && p <= n);
   uint64_t numerator = 1, denominator = 1;
   for (size_t i = 0; i < p; i++) {
     numerator *= n - i;
@@ -458,24 +391,20 @@
   return true;
 }
 
-size_t max_feasible_subset_size(size_t n)
-{
+size_t max_feasible_subset_size(size_t n) {
   assert(n > 0);
-  const size_t minresult = min<size_t>(n-1, always_search_subsets_of_size_at_least);
+  const size_t minresult = min<size_t>(n - 1, always_search_subsets_of_size_at_least);
   for (size_t p = 1; p <= n - 1; p++) {
-    if (!is_number_of_subsets_feasible(n, p+1)) {
+    if (!is_number_of_subsets_feasible(n, p + 1)) {
       return max(p, minresult);
     }
   }
   return n - 1;
 }
 
-void find_subset_with_efficiency_higher_than(
-       const vector<preprocessed_inputfile_t>& preprocessed_inputfiles,
-       float required_efficiency_to_beat,
-       vector<size_t>& inout_remainder,
-       vector<size_t>& out_subset)
-{
+void find_subset_with_efficiency_higher_than(const vector<preprocessed_inputfile_t>& preprocessed_inputfiles,
+                                             float required_efficiency_to_beat, vector<size_t>& inout_remainder,
+                                             vector<size_t>& out_subset) {
   out_subset.resize(0);
 
   if (required_efficiency_to_beat >= 1.0f) {
@@ -484,7 +413,6 @@
   }
 
   while (!inout_remainder.empty()) {
-
     vector<size_t> candidate_indices(inout_remainder.size());
     for (size_t i = 0; i < candidate_indices.size(); i++) {
       candidate_indices[i] = i;
@@ -493,20 +421,17 @@
     size_t candidate_indices_subset_size = max_feasible_subset_size(candidate_indices.size());
     while (candidate_indices_subset_size >= 1) {
       vector<size_t> candidate_indices_subset;
-      make_first_subset(candidate_indices_subset_size,
-                        candidate_indices_subset,
-                        candidate_indices.size());
+      make_first_subset(candidate_indices_subset_size, candidate_indices_subset, candidate_indices.size());
 
       vector<size_t> best_candidate_indices_subset;
       float best_efficiency = 0.0f;
       vector<size_t> trial_subset = out_subset;
       trial_subset.resize(out_subset.size() + candidate_indices_subset_size);
-      while (true)
-      {
+      while (true) {
         for (size_t i = 0; i < candidate_indices_subset_size; i++) {
           trial_subset[out_subset.size() + i] = inout_remainder[candidate_indices_subset[i]];
         }
-        
+
         float trial_efficiency = efficiency_of_subset(preprocessed_inputfiles, trial_subset);
         if (trial_efficiency > best_efficiency) {
           best_efficiency = trial_efficiency;
@@ -517,7 +442,7 @@
         }
         next_subset(candidate_indices_subset, candidate_indices.size());
       }
-       
+
       if (best_efficiency > required_efficiency_to_beat) {
         for (size_t i = 0; i < best_candidate_indices_subset.size(); i++) {
           candidate_indices[i] = candidate_indices[best_candidate_indices_subset[i]];
@@ -526,7 +451,7 @@
       }
       candidate_indices_subset_size--;
     }
-      
+
     size_t candidate_index = candidate_indices[0];
     auto candidate_iterator = inout_remainder.begin() + candidate_index;
     vector<size_t> trial_subset = out_subset;
@@ -542,11 +467,9 @@
   }
 }
 
-void find_partition_with_efficiency_higher_than(
-       const vector<preprocessed_inputfile_t>& preprocessed_inputfiles,
-       float required_efficiency_to_beat,
-       vector<vector<size_t>>& out_partition)
-{
+void find_partition_with_efficiency_higher_than(const vector<preprocessed_inputfile_t>& preprocessed_inputfiles,
+                                                float required_efficiency_to_beat,
+                                                vector<vector<size_t>>& out_partition) {
   out_partition.resize(0);
 
   vector<size_t> remainder;
@@ -556,25 +479,19 @@
 
   while (!remainder.empty()) {
     vector<size_t> new_subset;
-    find_subset_with_efficiency_higher_than(
-      preprocessed_inputfiles,
-      required_efficiency_to_beat,
-      remainder,
-      new_subset);
+    find_subset_with_efficiency_higher_than(preprocessed_inputfiles, required_efficiency_to_beat, remainder,
+                                            new_subset);
     out_partition.push_back(new_subset);
   }
 }
 
-void print_partition(
-       const vector<preprocessed_inputfile_t>& preprocessed_inputfiles,
-       const vector<vector<size_t>>& partition)
-{
+void print_partition(const vector<preprocessed_inputfile_t>& preprocessed_inputfiles,
+                     const vector<vector<size_t>>& partition) {
   float efficiency = efficiency_of_partition(preprocessed_inputfiles, partition);
-  cout << "Partition into " << partition.size() << " subsets for " << efficiency * 100.0f << "% efficiency"  << endl;
+  cout << "Partition into " << partition.size() << " subsets for " << efficiency * 100.0f << "% efficiency" << endl;
   for (auto subset = partition.begin(); subset != partition.end(); ++subset) {
-    cout << "  Subset " << (subset - partition.begin())
-         << ", efficiency " << efficiency_of_subset(preprocessed_inputfiles, *subset) * 100.0f << "%:"
-         << endl;
+    cout << "  Subset " << (subset - partition.begin()) << ", efficiency "
+         << efficiency_of_subset(preprocessed_inputfiles, *subset) * 100.0f << "%:" << endl;
     for (auto file = subset->begin(); file != subset->end(); ++file) {
       cout << "    " << preprocessed_inputfiles[*file].filename << endl;
     }
@@ -586,18 +503,18 @@
   cout << endl;
 }
 
-struct action_t
-{
-  virtual const char* invokation_name() const { abort(); return nullptr; }
+struct action_t {
+  virtual const char* invokation_name() const {
+    abort();
+    return nullptr;
+  }
   virtual void run(const vector<string>&) const { abort(); }
   virtual ~action_t() {}
 };
 
-struct partition_action_t : action_t
-{
+struct partition_action_t : action_t {
   virtual const char* invokation_name() const override { return "partition"; }
-  virtual void run(const vector<string>& input_filenames) const override
-  {
+  virtual void run(const vector<string>& input_filenames) const override {
     vector<preprocessed_inputfile_t> preprocessed_inputfiles;
 
     if (input_filenames.empty()) {
@@ -627,17 +544,12 @@
     float required_efficiency_to_beat = 0.0f;
     vector<vector<vector<size_t>>> partitions;
     cerr << "searching for partitions...\r" << flush;
-    while (true)
-    {
+    while (true) {
       vector<vector<size_t>> partition;
-      find_partition_with_efficiency_higher_than(
-        preprocessed_inputfiles,
-        required_efficiency_to_beat,
-        partition);
+      find_partition_with_efficiency_higher_than(preprocessed_inputfiles, required_efficiency_to_beat, partition);
       float actual_efficiency = efficiency_of_partition(preprocessed_inputfiles, partition);
-      cerr << "partition " << preprocessed_inputfiles.size() << " files into " << partition.size()
-           << " subsets for " << 100.0f * actual_efficiency
-           << " % efficiency"
+      cerr << "partition " << preprocessed_inputfiles.size() << " files into " << partition.size() << " subsets for "
+           << 100.0f * actual_efficiency << " % efficiency"
            << "                  \r" << flush;
       partitions.push_back(partition);
       if (partition.size() == preprocessed_inputfiles.size() || actual_efficiency == 1.0f) {
@@ -649,7 +561,7 @@
     while (true) {
       bool repeat = false;
       for (size_t i = 0; i < partitions.size() - 1; i++) {
-        if (partitions[i].size() >= partitions[i+1].size()) {
+        if (partitions[i].size() >= partitions[i + 1].size()) {
           partitions.erase(partitions.begin() + i);
           repeat = true;
           break;
@@ -665,8 +577,7 @@
   }
 };
 
-struct evaluate_defaults_action_t : action_t
-{
+struct evaluate_defaults_action_t : action_t {
   struct results_entry_t {
     uint16_t product_size;
     size_triple_t default_block_size;
@@ -675,30 +586,24 @@
     float best_pot_gflops;
     float default_efficiency;
   };
-  friend ostream& operator<<(ostream& s, const results_entry_t& entry)
-  {
-    return s
-      << "Product size " << size_triple_t(entry.product_size)
-      << ": default block size " << entry.default_block_size
-      << " -> " << entry.default_gflops
-      << " GFlop/s = " << entry.default_efficiency * 100.0f << " %"
-      << " of best POT block size " << size_triple_t(entry.best_pot_block_size)
-      << " -> " << entry.best_pot_gflops
-      << " GFlop/s" << dec;
+  friend ostream& operator<<(ostream& s, const results_entry_t& entry) {
+    return s << "Product size " << size_triple_t(entry.product_size) << ": default block size "
+             << entry.default_block_size << " -> " << entry.default_gflops
+             << " GFlop/s = " << entry.default_efficiency * 100.0f << " %"
+             << " of best POT block size " << size_triple_t(entry.best_pot_block_size) << " -> "
+             << entry.best_pot_gflops << " GFlop/s" << dec;
   }
   static bool lower_efficiency(const results_entry_t& e1, const results_entry_t& e2) {
     return e1.default_efficiency < e2.default_efficiency;
   }
   virtual const char* invokation_name() const override { return "evaluate-defaults"; }
-  void show_usage_and_exit() const
-  {
+  void show_usage_and_exit() const {
     cerr << "usage: " << invokation_name() << " default-sizes-data all-pot-sizes-data" << endl;
     cerr << "checks how well the performance with default sizes compares to the best "
          << "performance measured over all POT sizes." << endl;
     exit(1);
   }
-  virtual void run(const vector<string>& input_filenames) const override
-  {
+  virtual void run(const vector<string>& input_filenames) const override {
     if (input_filenames.size() != 2) {
       show_usage_and_exit();
     }
@@ -714,20 +619,17 @@
     }
     vector<results_entry_t> results;
     vector<results_entry_t> cubic_results;
-    
+
     uint16_t product_size = 0;
     auto it_all_pot_sizes = inputfile_all_pot_sizes.entries.begin();
     for (auto it_default_sizes = inputfile_default_sizes.entries.begin();
-         it_default_sizes != inputfile_default_sizes.entries.end();
-         ++it_default_sizes)
-    {
+         it_default_sizes != inputfile_default_sizes.entries.end(); ++it_default_sizes) {
       if (it_default_sizes->product_size == product_size) {
         continue;
       }
       product_size = it_default_sizes->product_size;
       while (it_all_pot_sizes != inputfile_all_pot_sizes.entries.end() &&
-             it_all_pot_sizes->product_size != product_size)
-      {
+             it_all_pot_sizes->product_size != product_size) {
         ++it_all_pot_sizes;
       }
       if (it_all_pot_sizes == inputfile_all_pot_sizes.entries.end()) {
@@ -735,10 +637,8 @@
       }
       uint16_t best_pot_block_size = 0;
       float best_pot_gflops = 0;
-      for (auto it = it_all_pot_sizes;
-           it != inputfile_all_pot_sizes.entries.end() && it->product_size == product_size;
-           ++it)
-      {
+      for (auto it = it_all_pot_sizes; it != inputfile_all_pot_sizes.entries.end() && it->product_size == product_size;
+           ++it) {
         if (it->gflops > best_pot_gflops) {
           best_pot_gflops = it->gflops;
           best_pot_block_size = it->pot_block_size;
@@ -766,7 +666,7 @@
     cout << endl;
 
     sort(results.begin(), results.end(), lower_efficiency);
-    
+
     const size_t n = min<size_t>(20, results.size());
     cout << n << " worst results:" << endl;
     for (size_t i = 0; i < n; i++) {
@@ -781,34 +681,30 @@
     cout << endl;
 
     sort(cubic_results.begin(), cubic_results.end(), lower_efficiency);
-    
+
     cout.precision(2);
     vector<float> a = {0.5f, 0.20f, 0.10f, 0.05f, 0.02f, 0.01f};
     for (auto it = a.begin(); it != a.end(); ++it) {
       size_t n = min(results.size() - 1, size_t(*it * results.size()));
       cout << (100.0f * n / (results.size() - 1))
-           << " % of product sizes have default efficiency <= "
-           << 100.0f * results[n].default_efficiency << " %" << endl;
+           << " % of product sizes have default efficiency <= " << 100.0f * results[n].default_efficiency << " %"
+           << endl;
     }
     cout.precision(default_precision);
   }
 };
 
-
-void show_usage_and_exit(int argc, char* argv[],
-                         const vector<unique_ptr<action_t>>& available_actions)
-{
+void show_usage_and_exit(int argc, char* argv[], const vector<unique_ptr<action_t>>& available_actions) {
   cerr << "usage: " << argv[0] << " <action> [options...] <input files...>" << endl;
   cerr << "available actions:" << endl;
   for (auto it = available_actions.begin(); it != available_actions.end(); ++it) {
     cerr << "  " << (*it)->invokation_name() << endl;
-  } 
+  }
   cerr << "the input files should each contain an output of benchmark-blocking-sizes" << endl;
   exit(1);
 }
 
-int main(int argc, char* argv[])
-{
+int main(int argc, char* argv[]) {
   cout.precision(default_precision);
   cerr.precision(default_precision);
 
diff --git a/bench/basicbenchmark.cpp b/bench/basicbenchmark.cpp
index a26ea85..dceb9fa 100644
--- a/bench/basicbenchmark.cpp
+++ b/bench/basicbenchmark.cpp
@@ -3,32 +3,31 @@
 #include "BenchUtil.h"
 #include "basicbenchmark.h"
 
-int main(int argc, char *argv[])
-{
+int main(int argc, char *argv[]) {
   DISABLE_SSE_EXCEPTIONS();
 
-  // this is the list of matrix type and size we want to bench:
-  // ((suffix) (matrix size) (number of iterations))
-  #define MODES ((3d)(3)(4000000)) ((4d)(4)(1000000)) ((Xd)(4)(1000000)) ((Xd)(20)(10000))
-//   #define MODES ((Xd)(20)(10000))
+// this is the list of matrix type and size we want to bench:
+// ((suffix) (matrix size) (number of iterations))
+#define MODES ((3d)(3)(4000000))((4d)(4)(1000000))((Xd)(4)(1000000))((Xd)(20)(10000))
+  //   #define MODES ((Xd)(20)(10000))
 
-  #define _GENERATE_HEADER(R,ARG,EL) << BOOST_PP_STRINGIZE(BOOST_PP_SEQ_HEAD(EL)) << "-" \
-    << BOOST_PP_STRINGIZE(BOOST_PP_SEQ_ELEM(1,EL)) << "x" \
-    << BOOST_PP_STRINGIZE(BOOST_PP_SEQ_ELEM(1,EL)) << "   /   "
+#define _GENERATE_HEADER(R, ARG, EL)           \
+  << BOOST_PP_STRINGIZE(BOOST_PP_SEQ_HEAD(EL)) \
+                        << "-"                 \
+                        << BOOST_PP_STRINGIZE(BOOST_PP_SEQ_ELEM(1,EL)) << "x" << BOOST_PP_STRINGIZE(BOOST_PP_SEQ_ELEM(1,EL)) << "   /   "
 
-  std::cout BOOST_PP_SEQ_FOR_EACH(_GENERATE_HEADER, ~, MODES ) << endl;
+  std::cout BOOST_PP_SEQ_FOR_EACH(_GENERATE_HEADER, ~, MODES) << endl;
 
   const int tries = 10;
 
-  #define _RUN_BENCH(R,ARG,EL) \
-    std::cout << ARG( \
-      BOOST_PP_CAT(Matrix, BOOST_PP_SEQ_HEAD(EL)) (\
-         BOOST_PP_SEQ_ELEM(1,EL),BOOST_PP_SEQ_ELEM(1,EL)), BOOST_PP_SEQ_ELEM(2,EL), tries) \
-    << "   ";
+#define _RUN_BENCH(R, ARG, EL)                                                                                      \
+  std::cout << ARG(BOOST_PP_CAT(Matrix, BOOST_PP_SEQ_HEAD(EL))(BOOST_PP_SEQ_ELEM(1, EL), BOOST_PP_SEQ_ELEM(1, EL)), \
+                   BOOST_PP_SEQ_ELEM(2, EL), tries)                                                                 \
+            << "   ";
 
-  BOOST_PP_SEQ_FOR_EACH(_RUN_BENCH, benchBasic<LazyEval>, MODES );
+  BOOST_PP_SEQ_FOR_EACH(_RUN_BENCH, benchBasic<LazyEval>, MODES);
   std::cout << endl;
-  BOOST_PP_SEQ_FOR_EACH(_RUN_BENCH, benchBasic<EarlyEval>, MODES );
+  BOOST_PP_SEQ_FOR_EACH(_RUN_BENCH, benchBasic<EarlyEval>, MODES);
   std::cout << endl;
 
   return 0;
diff --git a/bench/basicbenchmark.h b/bench/basicbenchmark.h
index 8059375..61ad153 100644
--- a/bench/basicbenchmark.h
+++ b/bench/basicbenchmark.h
@@ -2,55 +2,46 @@
 #ifndef EIGEN_BENCH_BASICBENCH_H
 #define EIGEN_BENCH_BASICBENCH_H
 
-enum {LazyEval, EarlyEval, OmpEval};
+enum { LazyEval, EarlyEval, OmpEval };
 
-template<int Mode, typename MatrixType>
+template <int Mode, typename MatrixType>
 void benchBasic_loop(const MatrixType& I, MatrixType& m, int iterations) __attribute__((noinline));
 
-template<int Mode, typename MatrixType>
-void benchBasic_loop(const MatrixType& I, MatrixType& m, int iterations)
-{
-  for(int a = 0; a < iterations; a++)
-  {
-    if (Mode==LazyEval)
-    {
+template <int Mode, typename MatrixType>
+void benchBasic_loop(const MatrixType& I, MatrixType& m, int iterations) {
+  for (int a = 0; a < iterations; a++) {
+    if (Mode == LazyEval) {
       asm("#begin_bench_loop LazyEval");
-      if (MatrixType::SizeAtCompileTime!=Eigen::Dynamic) asm("#fixedsize");
+      if (MatrixType::SizeAtCompileTime != Eigen::Dynamic) asm("#fixedsize");
       m = (I + 0.00005 * (m + m.lazyProduct(m))).eval();
-    }
-    else if (Mode==OmpEval)
-    {
+    } else if (Mode == OmpEval) {
       asm("#begin_bench_loop OmpEval");
-      if (MatrixType::SizeAtCompileTime!=Eigen::Dynamic) asm("#fixedsize");
+      if (MatrixType::SizeAtCompileTime != Eigen::Dynamic) asm("#fixedsize");
       m = (I + 0.00005 * (m + m.lazyProduct(m))).eval();
-    }
-    else
-    {
+    } else {
       asm("#begin_bench_loop EarlyEval");
-      if (MatrixType::SizeAtCompileTime!=Eigen::Dynamic) asm("#fixedsize");
+      if (MatrixType::SizeAtCompileTime != Eigen::Dynamic) asm("#fixedsize");
       m = I + 0.00005 * (m + m * m);
     }
     asm("#end_bench_loop");
   }
 }
 
-template<int Mode, typename MatrixType>
+template <int Mode, typename MatrixType>
 double benchBasic(const MatrixType& mat, int size, int tries) __attribute__((noinline));
 
-template<int Mode, typename MatrixType>
-double benchBasic(const MatrixType& mat, int iterations, int tries)
-{
+template <int Mode, typename MatrixType>
+double benchBasic(const MatrixType& mat, int iterations, int tries) {
   const int rows = mat.rows();
   const int cols = mat.cols();
 
-  MatrixType I(rows,cols);
-  MatrixType m(rows,cols);
+  MatrixType I(rows, cols);
+  MatrixType m(rows, cols);
 
   initMatrix_identity(I);
 
   Eigen::BenchTimer timer;
-  for(uint t=0; t<tries; ++t)
-  {
+  for (uint t = 0; t < tries; ++t) {
     initMatrix_random(m);
     timer.start();
     benchBasic_loop<Mode>(I, m, iterations);
@@ -60,4 +51,4 @@
   return timer.value();
 };
 
-#endif // EIGEN_BENCH_BASICBENCH_H
+#endif  // EIGEN_BENCH_BASICBENCH_H
diff --git a/bench/benchBlasGemm.cpp b/bench/benchBlasGemm.cpp
index cb086a5..a57966e 100644
--- a/bench/benchBlasGemm.cpp
+++ b/bench/benchBlasGemm.cpp
@@ -25,59 +25,47 @@
 #define CBLAS_GEMM cblas_dgemm
 #endif
 
-
-typedef Eigen::Matrix<Scalar,Eigen::Dynamic,Eigen::Dynamic> MyMatrix;
+typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic> MyMatrix;
 void bench_eigengemm(MyMatrix& mc, const MyMatrix& ma, const MyMatrix& mb, int nbloops);
 void check_product(int M, int N, int K);
 void check_product(void);
 
-int main(int argc, char *argv[])
-{
-  // disable SSE exceptions
-  #ifdef __GNUC__
+int main(int argc, char* argv[]) {
+// disable SSE exceptions
+#ifdef __GNUC__
   {
     int aux;
-    asm(
-    "stmxcsr   %[aux]           \n\t"
-    "orl       $32832, %[aux]   \n\t"
-    "ldmxcsr   %[aux]           \n\t"
-    : : [aux] "m" (aux));
+    asm("stmxcsr   %[aux]           \n\t"
+        "orl       $32832, %[aux]   \n\t"
+        "ldmxcsr   %[aux]           \n\t"
+        :
+        : [aux] "m"(aux));
   }
-  #endif
+#endif
 
-  int nbtries=1, nbloops=1, M, N, K;
+  int nbtries = 1, nbloops = 1, M, N, K;
 
-  if (argc==2)
-  {
-    if (std::string(argv[1])=="check")
+  if (argc == 2) {
+    if (std::string(argv[1]) == "check")
       check_product();
     else
       M = N = K = atoi(argv[1]);
-  }
-  else if ((argc==3) && (std::string(argv[1])=="auto"))
-  {
+  } else if ((argc == 3) && (std::string(argv[1]) == "auto")) {
     M = N = K = atoi(argv[2]);
-    nbloops = 1000000000/(M*M*M);
-    if (nbloops<1)
-      nbloops = 1;
+    nbloops = 1000000000 / (M * M * M);
+    if (nbloops < 1) nbloops = 1;
     nbtries = 6;
-  }
-  else if (argc==4)
-  {
+  } else if (argc == 4) {
     M = N = K = atoi(argv[1]);
     nbloops = atoi(argv[2]);
     nbtries = atoi(argv[3]);
-  }
-  else if (argc==6)
-  {
+  } else if (argc == 6) {
     M = atoi(argv[1]);
     N = atoi(argv[2]);
     K = atoi(argv[3]);
     nbloops = atoi(argv[4]);
     nbtries = atoi(argv[5]);
-  }
-  else
-  {
+  } else {
     std::cout << "Usage: " << argv[0] << " size  \n";
     std::cout << "Usage: " << argv[0] << " auto size\n";
     std::cout << "Usage: " << argv[0] << " size nbloops nbtries\n";
@@ -95,14 +83,13 @@
 
   double nbmad = double(M) * double(N) * double(K) * double(nbloops);
 
-  if (!(std::string(argv[1])=="auto"))
-    std::cout << M << " x " << N << " x " << K << "\n";
+  if (!(std::string(argv[1]) == "auto")) std::cout << M << " x " << N << " x " << K << "\n";
 
   Scalar alpha, beta;
-  MyMatrix ma(M,K), mb(K,N), mc(M,N);
-  ma = MyMatrix::Random(M,K);
-  mb = MyMatrix::Random(K,N);
-  mc = MyMatrix::Random(M,N);
+  MyMatrix ma(M, K), mb(K, N), mc(M, N);
+  ma = MyMatrix::Random(M, K);
+  mb = MyMatrix::Random(K, N);
+  mc = MyMatrix::Random(M, N);
 
   Eigen::BenchTimer timer;
 
@@ -112,108 +99,101 @@
 
   // bench cblas
   // ROWS_A, COLS_B, COLS_A, 1.0,  A, COLS_A, B, COLS_B, 0.0, C, COLS_B);
-  if (!(std::string(argv[1])=="auto"))
-  {
+  if (!(std::string(argv[1]) == "auto")) {
     timer.reset();
-    for (uint k=0 ; k<nbtries ; ++k)
-    {
-        timer.start();
-        for (uint j=0 ; j<nbloops ; ++j)
-              #ifdef EIGEN_DEFAULT_TO_ROW_MAJOR
-              CBLAS_GEMM(CblasRowMajor, CblasNoTrans, CblasNoTrans, M, N, K, alpha, ma.data(), K, mb.data(), N, beta, mc.data(), N);
-              #else
-              CBLAS_GEMM(CblasColMajor, CblasNoTrans, CblasNoTrans, M, N, K, alpha, ma.data(), M, mb.data(), K, beta, mc.data(), M);
-              #endif
-        timer.stop();
+    for (uint k = 0; k < nbtries; ++k) {
+      timer.start();
+      for (uint j = 0; j < nbloops; ++j)
+#ifdef EIGEN_DEFAULT_TO_ROW_MAJOR
+        CBLAS_GEMM(CblasRowMajor, CblasNoTrans, CblasNoTrans, M, N, K, alpha, ma.data(), K, mb.data(), N, beta,
+                   mc.data(), N);
+#else
+        CBLAS_GEMM(CblasColMajor, CblasNoTrans, CblasNoTrans, M, N, K, alpha, ma.data(), M, mb.data(), K, beta,
+                   mc.data(), M);
+#endif
+      timer.stop();
     }
-    if (!(std::string(argv[1])=="auto"))
-      std::cout << "cblas: " << timer.value() << " (" << 1e-3*floor(1e-6*nbmad/timer.value()) << " GFlops/s)\n";
+    if (!(std::string(argv[1]) == "auto"))
+      std::cout << "cblas: " << timer.value() << " (" << 1e-3 * floor(1e-6 * nbmad / timer.value()) << " GFlops/s)\n";
     else
-        std::cout << M << " : " << timer.value() << " ; " << 1e-3*floor(1e-6*nbmad/timer.value()) << "\n";
+      std::cout << M << " : " << timer.value() << " ; " << 1e-3 * floor(1e-6 * nbmad / timer.value()) << "\n";
   }
 
   // clear
-  ma = MyMatrix::Random(M,K);
-  mb = MyMatrix::Random(K,N);
-  mc = MyMatrix::Random(M,N);
+  ma = MyMatrix::Random(M, K);
+  mb = MyMatrix::Random(K, N);
+  mc = MyMatrix::Random(M, N);
 
   // eigen
-//   if (!(std::string(argv[1])=="auto"))
+  //   if (!(std::string(argv[1])=="auto"))
   {
-      timer.reset();
-      for (uint k=0 ; k<nbtries ; ++k)
-      {
-          timer.start();
-          bench_eigengemm(mc, ma, mb, nbloops);
-          timer.stop();
-      }
-      if (!(std::string(argv[1])=="auto"))
-        std::cout << "eigen : " << timer.value() << " (" << 1e-3*floor(1e-6*nbmad/timer.value()) << " GFlops/s)\n";
-      else
-        std::cout << M << " : " << timer.value() << " ; " << 1e-3*floor(1e-6*nbmad/timer.value()) << "\n";
+    timer.reset();
+    for (uint k = 0; k < nbtries; ++k) {
+      timer.start();
+      bench_eigengemm(mc, ma, mb, nbloops);
+      timer.stop();
+    }
+    if (!(std::string(argv[1]) == "auto"))
+      std::cout << "eigen : " << timer.value() << " (" << 1e-3 * floor(1e-6 * nbmad / timer.value()) << " GFlops/s)\n";
+    else
+      std::cout << M << " : " << timer.value() << " ; " << 1e-3 * floor(1e-6 * nbmad / timer.value()) << "\n";
   }
 
   std::cout << "l1: " << Eigen::l1CacheSize() << std::endl;
   std::cout << "l2: " << Eigen::l2CacheSize() << std::endl;
-  
 
   return 0;
 }
 
 using namespace Eigen;
 
-void bench_eigengemm(MyMatrix& mc, const MyMatrix& ma, const MyMatrix& mb, int nbloops)
-{
-  for (uint j=0 ; j<nbloops ; ++j)
-      mc.noalias() += ma * mb;
+void bench_eigengemm(MyMatrix& mc, const MyMatrix& ma, const MyMatrix& mb, int nbloops) {
+  for (uint j = 0; j < nbloops; ++j) mc.noalias() += ma * mb;
 }
 
-#define MYVERIFY(A,M) if (!(A)) { \
+#define MYVERIFY(A, M)                  \
+  if (!(A)) {                           \
     std::cout << "FAIL: " << M << "\n"; \
   }
-void check_product(int M, int N, int K)
-{
-  MyMatrix ma(M,K), mb(K,N), mc(M,N), maT(K,M), mbT(N,K), meigen(M,N), mref(M,N);
-  ma = MyMatrix::Random(M,K);
-  mb = MyMatrix::Random(K,N);
+void check_product(int M, int N, int K) {
+  MyMatrix ma(M, K), mb(K, N), mc(M, N), maT(K, M), mbT(N, K), meigen(M, N), mref(M, N);
+  ma = MyMatrix::Random(M, K);
+  mb = MyMatrix::Random(K, N);
   maT = ma.transpose();
   mbT = mb.transpose();
-  mc = MyMatrix::Random(M,N);
+  mc = MyMatrix::Random(M, N);
 
   MyMatrix::Scalar eps = 1e-4;
 
   meigen = mref = mc;
   CBLAS_GEMM(CblasColMajor, CblasNoTrans, CblasNoTrans, M, N, K, 1, ma.data(), M, mb.data(), K, 1, mref.data(), M);
   meigen += ma * mb;
-  MYVERIFY(meigen.isApprox(mref, eps),". * .");
+  MYVERIFY(meigen.isApprox(mref, eps), ". * .");
 
   meigen = mref = mc;
   CBLAS_GEMM(CblasColMajor, CblasTrans, CblasNoTrans, M, N, K, 1, maT.data(), K, mb.data(), K, 1, mref.data(), M);
   meigen += maT.transpose() * mb;
-  MYVERIFY(meigen.isApprox(mref, eps),"T * .");
+  MYVERIFY(meigen.isApprox(mref, eps), "T * .");
 
   meigen = mref = mc;
   CBLAS_GEMM(CblasColMajor, CblasTrans, CblasTrans, M, N, K, 1, maT.data(), K, mbT.data(), N, 1, mref.data(), M);
   meigen += (maT.transpose()) * (mbT.transpose());
-  MYVERIFY(meigen.isApprox(mref, eps),"T * T");
+  MYVERIFY(meigen.isApprox(mref, eps), "T * T");
 
   meigen = mref = mc;
   CBLAS_GEMM(CblasColMajor, CblasNoTrans, CblasTrans, M, N, K, 1, ma.data(), M, mbT.data(), N, 1, mref.data(), M);
   meigen += ma * mbT.transpose();
-  MYVERIFY(meigen.isApprox(mref, eps),". * T");
+  MYVERIFY(meigen.isApprox(mref, eps), ". * T");
 }
 
-void check_product(void)
-{
+void check_product(void) {
   int M, N, K;
-  for (uint i=0; i<1000; ++i)
-  {
-    M = internal::random<int>(1,64);
-    N = internal::random<int>(1,768);
-    K = internal::random<int>(1,768);
+  for (uint i = 0; i < 1000; ++i) {
+    M = internal::random<int>(1, 64);
+    N = internal::random<int>(1, 768);
+    K = internal::random<int>(1, 768);
     M = (0 + M) * 1;
     std::cout << M << " x " << N << " x " << K << "\n";
     check_product(M, N, K);
   }
 }
-
diff --git a/bench/benchCholesky.cpp b/bench/benchCholesky.cpp
index 0dc94e5..3d6655b 100644
--- a/bench/benchCholesky.cpp
+++ b/bench/benchCholesky.cpp
@@ -25,117 +25,100 @@
 typedef float Scalar;
 
 template <typename MatrixType>
-__attribute__ ((noinline)) void benchLLT(const MatrixType& m)
-{
+__attribute__((noinline)) void benchLLT(const MatrixType& m) {
   int rows = m.rows();
   int cols = m.cols();
 
   double cost = 0;
-  for (int j=0; j<rows; ++j)
-  {
-    int r = std::max(rows - j -1,0);
-    cost += 2*(r*j+r+j);
+  for (int j = 0; j < rows; ++j) {
+    int r = std::max(rows - j - 1, 0);
+    cost += 2 * (r * j + r + j);
   }
 
-  int repeats = (REPEAT*1000)/(rows*rows);
+  int repeats = (REPEAT * 1000) / (rows * rows);
 
   typedef typename MatrixType::Scalar Scalar;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> SquareMatrixType;
 
-  MatrixType a = MatrixType::Random(rows,cols);
-  SquareMatrixType covMat =  a * a.adjoint();
+  MatrixType a = MatrixType::Random(rows, cols);
+  SquareMatrixType covMat = a * a.adjoint();
 
   BenchTimer timerNoSqrt, timerSqrt;
 
   Scalar acc = 0;
-  int r = internal::random<int>(0,covMat.rows()-1);
-  int c = internal::random<int>(0,covMat.cols()-1);
-  for (int t=0; t<TRIES; ++t)
-  {
+  int r = internal::random<int>(0, covMat.rows() - 1);
+  int c = internal::random<int>(0, covMat.cols() - 1);
+  for (int t = 0; t < TRIES; ++t) {
     timerNoSqrt.start();
-    for (int k=0; k<repeats; ++k)
-    {
+    for (int k = 0; k < repeats; ++k) {
       LDLT<SquareMatrixType> cholnosqrt(covMat);
-      acc += cholnosqrt.matrixL().coeff(r,c);
+      acc += cholnosqrt.matrixL().coeff(r, c);
     }
     timerNoSqrt.stop();
   }
 
-  for (int t=0; t<TRIES; ++t)
-  {
+  for (int t = 0; t < TRIES; ++t) {
     timerSqrt.start();
-    for (int k=0; k<repeats; ++k)
-    {
+    for (int k = 0; k < repeats; ++k) {
       LLT<SquareMatrixType> chol(covMat);
-      acc += chol.matrixL().coeff(r,c);
+      acc += chol.matrixL().coeff(r, c);
     }
     timerSqrt.stop();
   }
 
-  if (MatrixType::RowsAtCompileTime==Dynamic)
+  if (MatrixType::RowsAtCompileTime == Dynamic)
     std::cout << "dyn   ";
   else
     std::cout << "fixed ";
-  std::cout << covMat.rows() << " \t"
-            << (timerNoSqrt.best()) / repeats << "s "
-            << "(" << 1e-9 * cost*repeats/timerNoSqrt.best() << " GFLOPS)\t"
-            << (timerSqrt.best()) / repeats << "s "
-            << "(" << 1e-9 * cost*repeats/timerSqrt.best() << " GFLOPS)\n";
+  std::cout << covMat.rows() << " \t" << (timerNoSqrt.best()) / repeats << "s "
+            << "(" << 1e-9 * cost * repeats / timerNoSqrt.best() << " GFLOPS)\t" << (timerSqrt.best()) / repeats << "s "
+            << "(" << 1e-9 * cost * repeats / timerSqrt.best() << " GFLOPS)\n";
 
-
-  #ifdef BENCH_GSL
-  if (MatrixType::RowsAtCompileTime==Dynamic)
-  {
+#ifdef BENCH_GSL
+  if (MatrixType::RowsAtCompileTime == Dynamic) {
     timerSqrt.reset();
 
-    gsl_matrix* gslCovMat = gsl_matrix_alloc(covMat.rows(),covMat.cols());
-    gsl_matrix* gslCopy = gsl_matrix_alloc(covMat.rows(),covMat.cols());
+    gsl_matrix* gslCovMat = gsl_matrix_alloc(covMat.rows(), covMat.cols());
+    gsl_matrix* gslCopy = gsl_matrix_alloc(covMat.rows(), covMat.cols());
 
     eiToGsl(covMat, &gslCovMat);
-    for (int t=0; t<TRIES; ++t)
-    {
+    for (int t = 0; t < TRIES; ++t) {
       timerSqrt.start();
-      for (int k=0; k<repeats; ++k)
-      {
-        gsl_matrix_memcpy(gslCopy,gslCovMat);
+      for (int k = 0; k < repeats; ++k) {
+        gsl_matrix_memcpy(gslCopy, gslCovMat);
         gsl_linalg_cholesky_decomp(gslCopy);
-        acc += gsl_matrix_get(gslCopy,r,c);
+        acc += gsl_matrix_get(gslCopy, r, c);
       }
       timerSqrt.stop();
     }
 
-    std::cout << " | \t"
-              << timerSqrt.value() * REPEAT / repeats << "s";
+    std::cout << " | \t" << timerSqrt.value() * REPEAT / repeats << "s";
 
     gsl_matrix_free(gslCovMat);
   }
-  #endif
+#endif
   std::cout << "\n";
   // make sure the compiler does not optimize too much
-  if (acc==123)
-    std::cout << acc;
+  if (acc == 123) std::cout << acc;
 }
 
-int main(int argc, char* argv[])
-{
-  const int dynsizes[] = {4,6,8,16,24,32,49,64,128,256,512,900,1500,0};
+int main(int argc, char* argv[]) {
+  const int dynsizes[] = {4, 6, 8, 16, 24, 32, 49, 64, 128, 256, 512, 900, 1500, 0};
   std::cout << "size            LDLT                            LLT";
-//   #ifdef BENCH_GSL
-//   std::cout << "       GSL (standard + double + ATLAS)  ";
-//   #endif
+  //   #ifdef BENCH_GSL
+  //   std::cout << "       GSL (standard + double + ATLAS)  ";
+  //   #endif
   std::cout << "\n";
-  for (int i=0; dynsizes[i]>0; ++i)
-    benchLLT(Matrix<Scalar,Dynamic,Dynamic>(dynsizes[i],dynsizes[i]));
+  for (int i = 0; dynsizes[i] > 0; ++i) benchLLT(Matrix<Scalar, Dynamic, Dynamic>(dynsizes[i], dynsizes[i]));
 
-  benchLLT(Matrix<Scalar,2,2>());
-  benchLLT(Matrix<Scalar,3,3>());
-  benchLLT(Matrix<Scalar,4,4>());
-  benchLLT(Matrix<Scalar,5,5>());
-  benchLLT(Matrix<Scalar,6,6>());
-  benchLLT(Matrix<Scalar,7,7>());
-  benchLLT(Matrix<Scalar,8,8>());
-  benchLLT(Matrix<Scalar,12,12>());
-  benchLLT(Matrix<Scalar,16,16>());
+  benchLLT(Matrix<Scalar, 2, 2>());
+  benchLLT(Matrix<Scalar, 3, 3>());
+  benchLLT(Matrix<Scalar, 4, 4>());
+  benchLLT(Matrix<Scalar, 5, 5>());
+  benchLLT(Matrix<Scalar, 6, 6>());
+  benchLLT(Matrix<Scalar, 7, 7>());
+  benchLLT(Matrix<Scalar, 8, 8>());
+  benchLLT(Matrix<Scalar, 12, 12>());
+  benchLLT(Matrix<Scalar, 16, 16>());
   return 0;
 }
-
diff --git a/bench/benchEigenSolver.cpp b/bench/benchEigenSolver.cpp
index dd78c7e..8398777 100644
--- a/bench/benchEigenSolver.cpp
+++ b/bench/benchEigenSolver.cpp
@@ -31,34 +31,31 @@
 typedef SCALAR Scalar;
 
 template <typename MatrixType>
-__attribute__ ((noinline)) void benchEigenSolver(const MatrixType& m)
-{
+__attribute__((noinline)) void benchEigenSolver(const MatrixType& m) {
   int rows = m.rows();
   int cols = m.cols();
 
-  int stdRepeats = std::max(1,int((REPEAT*1000)/(rows*rows*sqrt(rows))));
+  int stdRepeats = std::max(1, int((REPEAT * 1000) / (rows * rows * sqrt(rows))));
   int saRepeats = stdRepeats * 4;
 
   typedef typename MatrixType::Scalar Scalar;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> SquareMatrixType;
 
-  MatrixType a = MatrixType::Random(rows,cols);
-  SquareMatrixType covMat =  a * a.adjoint();
+  MatrixType a = MatrixType::Random(rows, cols);
+  SquareMatrixType covMat = a * a.adjoint();
 
   BenchTimer timerSa, timerStd;
 
   Scalar acc = 0;
-  int r = internal::random<int>(0,covMat.rows()-1);
-  int c = internal::random<int>(0,covMat.cols()-1);
+  int r = internal::random<int>(0, covMat.rows() - 1);
+  int c = internal::random<int>(0, covMat.cols() - 1);
   {
     SelfAdjointEigenSolver<SquareMatrixType> ei(covMat);
-    for (int t=0; t<TRIES; ++t)
-    {
+    for (int t = 0; t < TRIES; ++t) {
       timerSa.start();
-      for (int k=0; k<saRepeats; ++k)
-      {
+      for (int k = 0; k < saRepeats; ++k) {
         ei.compute(covMat);
-        acc += ei.eigenvectors().coeff(r,c);
+        acc += ei.eigenvectors().coeff(r, c);
       }
       timerSa.stop();
     }
@@ -66,107 +63,94 @@
 
   {
     EigenSolver<SquareMatrixType> ei(covMat);
-    for (int t=0; t<TRIES; ++t)
-    {
+    for (int t = 0; t < TRIES; ++t) {
       timerStd.start();
-      for (int k=0; k<stdRepeats; ++k)
-      {
+      for (int k = 0; k < stdRepeats; ++k) {
         ei.compute(covMat);
-        acc += ei.eigenvectors().coeff(r,c);
+        acc += ei.eigenvectors().coeff(r, c);
       }
       timerStd.stop();
     }
   }
 
-  if (MatrixType::RowsAtCompileTime==Dynamic)
+  if (MatrixType::RowsAtCompileTime == Dynamic)
     std::cout << "dyn   ";
   else
     std::cout << "fixed ";
-  std::cout << covMat.rows() << " \t"
-            << timerSa.value() * REPEAT / saRepeats << "s \t"
+  std::cout << covMat.rows() << " \t" << timerSa.value() * REPEAT / saRepeats << "s \t"
             << timerStd.value() * REPEAT / stdRepeats << "s";
 
-  #ifdef BENCH_GMM
-  if (MatrixType::RowsAtCompileTime==Dynamic)
-  {
+#ifdef BENCH_GMM
+  if (MatrixType::RowsAtCompileTime == Dynamic) {
     timerSa.reset();
     timerStd.reset();
 
-    gmm::dense_matrix<Scalar> gmmCovMat(covMat.rows(),covMat.cols());
-    gmm::dense_matrix<Scalar> eigvect(covMat.rows(),covMat.cols());
+    gmm::dense_matrix<Scalar> gmmCovMat(covMat.rows(), covMat.cols());
+    gmm::dense_matrix<Scalar> eigvect(covMat.rows(), covMat.cols());
     std::vector<Scalar> eigval(covMat.rows());
     eiToGmm(covMat, gmmCovMat);
-    for (int t=0; t<TRIES; ++t)
-    {
+    for (int t = 0; t < TRIES; ++t) {
       timerSa.start();
-      for (int k=0; k<saRepeats; ++k)
-      {
+      for (int k = 0; k < saRepeats; ++k) {
         gmm::symmetric_qr_algorithm(gmmCovMat, eigval, eigvect);
-        acc += eigvect(r,c);
+        acc += eigvect(r, c);
       }
       timerSa.stop();
     }
     // the non-selfadjoint solver does not compute the eigen vectors
-//     for (int t=0; t<TRIES; ++t)
-//     {
-//       timerStd.start();
-//       for (int k=0; k<stdRepeats; ++k)
-//       {
-//         gmm::implicit_qr_algorithm(gmmCovMat, eigval, eigvect);
-//         acc += eigvect(r,c);
-//       }
-//       timerStd.stop();
-//     }
+    //     for (int t=0; t<TRIES; ++t)
+    //     {
+    //       timerStd.start();
+    //       for (int k=0; k<stdRepeats; ++k)
+    //       {
+    //         gmm::implicit_qr_algorithm(gmmCovMat, eigval, eigvect);
+    //         acc += eigvect(r,c);
+    //       }
+    //       timerStd.stop();
+    //     }
 
-    std::cout << " | \t"
-              << timerSa.value() * REPEAT / saRepeats << "s"
+    std::cout << " | \t" << timerSa.value() * REPEAT / saRepeats << "s"
               << /*timerStd.value() * REPEAT / stdRepeats << "s"*/ "   na   ";
   }
-  #endif
+#endif
 
-  #ifdef BENCH_GSL
-  if (MatrixType::RowsAtCompileTime==Dynamic)
-  {
+#ifdef BENCH_GSL
+  if (MatrixType::RowsAtCompileTime == Dynamic) {
     timerSa.reset();
     timerStd.reset();
 
-    gsl_matrix* gslCovMat = gsl_matrix_alloc(covMat.rows(),covMat.cols());
-    gsl_matrix* gslCopy = gsl_matrix_alloc(covMat.rows(),covMat.cols());
-    gsl_matrix* eigvect = gsl_matrix_alloc(covMat.rows(),covMat.cols());
-    gsl_vector* eigval  = gsl_vector_alloc(covMat.rows());
+    gsl_matrix* gslCovMat = gsl_matrix_alloc(covMat.rows(), covMat.cols());
+    gsl_matrix* gslCopy = gsl_matrix_alloc(covMat.rows(), covMat.cols());
+    gsl_matrix* eigvect = gsl_matrix_alloc(covMat.rows(), covMat.cols());
+    gsl_vector* eigval = gsl_vector_alloc(covMat.rows());
     gsl_eigen_symmv_workspace* eisymm = gsl_eigen_symmv_alloc(covMat.rows());
-    
-    gsl_matrix_complex* eigvectz = gsl_matrix_complex_alloc(covMat.rows(),covMat.cols());
-    gsl_vector_complex* eigvalz  = gsl_vector_complex_alloc(covMat.rows());
+
+    gsl_matrix_complex* eigvectz = gsl_matrix_complex_alloc(covMat.rows(), covMat.cols());
+    gsl_vector_complex* eigvalz = gsl_vector_complex_alloc(covMat.rows());
     gsl_eigen_nonsymmv_workspace* einonsymm = gsl_eigen_nonsymmv_alloc(covMat.rows());
-    
+
     eiToGsl(covMat, &gslCovMat);
-    for (int t=0; t<TRIES; ++t)
-    {
+    for (int t = 0; t < TRIES; ++t) {
       timerSa.start();
-      for (int k=0; k<saRepeats; ++k)
-      {
-        gsl_matrix_memcpy(gslCopy,gslCovMat);
+      for (int k = 0; k < saRepeats; ++k) {
+        gsl_matrix_memcpy(gslCopy, gslCovMat);
         gsl_eigen_symmv(gslCopy, eigval, eigvect, eisymm);
-        acc += gsl_matrix_get(eigvect,r,c);
+        acc += gsl_matrix_get(eigvect, r, c);
       }
       timerSa.stop();
     }
-    for (int t=0; t<TRIES; ++t)
-    {
+    for (int t = 0; t < TRIES; ++t) {
       timerStd.start();
-      for (int k=0; k<stdRepeats; ++k)
-      {
-        gsl_matrix_memcpy(gslCopy,gslCovMat);
+      for (int k = 0; k < stdRepeats; ++k) {
+        gsl_matrix_memcpy(gslCopy, gslCovMat);
         gsl_eigen_nonsymmv(gslCopy, eigvalz, eigvectz, einonsymm);
-        acc += GSL_REAL(gsl_matrix_complex_get(eigvectz,r,c));
+        acc += GSL_REAL(gsl_matrix_complex_get(eigvectz, r, c));
       }
       timerStd.stop();
     }
 
-    std::cout << " | \t"
-              << timerSa.value() * REPEAT / saRepeats << "s \t"
-              << timerStd.value() * REPEAT / stdRepeats << "s";
+    std::cout << " | \t" << timerSa.value() * REPEAT / saRepeats << "s \t" << timerStd.value() * REPEAT / stdRepeats
+              << "s";
 
     gsl_matrix_free(gslCovMat);
     gsl_vector_free(gslCopy);
@@ -177,36 +161,32 @@
     gsl_eigen_symmv_free(eisymm);
     gsl_eigen_nonsymmv_free(einonsymm);
   }
-  #endif
+#endif
 
   std::cout << "\n";
-  
+
   // make sure the compiler does not optimize too much
-  if (acc==123)
-    std::cout << acc;
+  if (acc == 123) std::cout << acc;
 }
 
-int main(int argc, char* argv[])
-{
-  const int dynsizes[] = {4,6,8,12,16,24,32,64,128,256,512,0};
+int main(int argc, char* argv[]) {
+  const int dynsizes[] = {4, 6, 8, 12, 16, 24, 32, 64, 128, 256, 512, 0};
   std::cout << "size            selfadjoint       generic";
-  #ifdef BENCH_GMM
+#ifdef BENCH_GMM
   std::cout << "        GMM++          ";
-  #endif
-  #ifdef BENCH_GSL
+#endif
+#ifdef BENCH_GSL
   std::cout << "       GSL (double + ATLAS)  ";
-  #endif
+#endif
   std::cout << "\n";
-  for (uint i=0; dynsizes[i]>0; ++i)
-    benchEigenSolver(Matrix<Scalar,Dynamic,Dynamic>(dynsizes[i],dynsizes[i]));
+  for (uint i = 0; dynsizes[i] > 0; ++i) benchEigenSolver(Matrix<Scalar, Dynamic, Dynamic>(dynsizes[i], dynsizes[i]));
 
-  benchEigenSolver(Matrix<Scalar,2,2>());
-  benchEigenSolver(Matrix<Scalar,3,3>());
-  benchEigenSolver(Matrix<Scalar,4,4>());
-  benchEigenSolver(Matrix<Scalar,6,6>());
-  benchEigenSolver(Matrix<Scalar,8,8>());
-  benchEigenSolver(Matrix<Scalar,12,12>());
-  benchEigenSolver(Matrix<Scalar,16,16>());
+  benchEigenSolver(Matrix<Scalar, 2, 2>());
+  benchEigenSolver(Matrix<Scalar, 3, 3>());
+  benchEigenSolver(Matrix<Scalar, 4, 4>());
+  benchEigenSolver(Matrix<Scalar, 6, 6>());
+  benchEigenSolver(Matrix<Scalar, 8, 8>());
+  benchEigenSolver(Matrix<Scalar, 12, 12>());
+  benchEigenSolver(Matrix<Scalar, 16, 16>());
   return 0;
 }
-
diff --git a/bench/benchFFT.cpp b/bench/benchFFT.cpp
index 3eb1a1a..3c33e77 100644
--- a/bench/benchFFT.cpp
+++ b/bench/benchFFT.cpp
@@ -19,13 +19,21 @@
 using namespace Eigen;
 using namespace std;
 
-
 template <typename T>
 string nameof();
 
-template <> string nameof<float>() {return "float";}
-template <> string nameof<double>() {return "double";}
-template <> string nameof<long double>() {return "long double";}
+template <>
+string nameof<float>() {
+  return "float";
+}
+template <>
+string nameof<double>() {
+  return "double";
+}
+template <>
+string nameof<long double>() {
+  return "long double";
+}
 
 #ifndef TYPE
 #define TYPE float
@@ -41,75 +49,69 @@
 using namespace Eigen;
 
 template <typename T>
-void bench(int nfft,bool fwd,bool unscaled=false, bool halfspec=false)
-{
-    typedef typename NumTraits<T>::Real Scalar;
-    typedef typename std::complex<Scalar> Complex;
-    int nits = NDATA/nfft;
-    vector<T> inbuf(nfft);
-    vector<Complex > outbuf(nfft);
-    FFT< Scalar > fft;
+void bench(int nfft, bool fwd, bool unscaled = false, bool halfspec = false) {
+  typedef typename NumTraits<T>::Real Scalar;
+  typedef typename std::complex<Scalar> Complex;
+  int nits = NDATA / nfft;
+  vector<T> inbuf(nfft);
+  vector<Complex> outbuf(nfft);
+  FFT<Scalar> fft;
 
-    if (unscaled) {
-        fft.SetFlag(fft.Unscaled);
-        cout << "unscaled ";
-    }
-    if (halfspec) {
-        fft.SetFlag(fft.HalfSpectrum);
-        cout << "halfspec ";
-    }
+  if (unscaled) {
+    fft.SetFlag(fft.Unscaled);
+    cout << "unscaled ";
+  }
+  if (halfspec) {
+    fft.SetFlag(fft.HalfSpectrum);
+    cout << "halfspec ";
+  }
 
+  std::fill(inbuf.begin(), inbuf.end(), 0);
+  fft.fwd(outbuf, inbuf);
 
-    std::fill(inbuf.begin(),inbuf.end(),0);
-    fft.fwd( outbuf , inbuf);
-
-    BenchTimer timer;
-    timer.reset();
-    for (int k=0;k<8;++k) {
-        timer.start();
-        if (fwd)
-            for(int i = 0; i < nits; i++)
-                fft.fwd( outbuf , inbuf);
-        else
-            for(int i = 0; i < nits; i++)
-                fft.inv(inbuf,outbuf);
-        timer.stop();
-    }
-
-    cout << nameof<Scalar>() << " ";
-    double mflops = 5.*nfft*log2((double)nfft) / (1e6 * timer.value() / (double)nits );
-    if ( NumTraits<T>::IsComplex ) {
-        cout << "complex";
-    }else{
-        cout << "real   ";
-        mflops /= 2;
-    }
-
-
+  BenchTimer timer;
+  timer.reset();
+  for (int k = 0; k < 8; ++k) {
+    timer.start();
     if (fwd)
-        cout << " fwd";
+      for (int i = 0; i < nits; i++) fft.fwd(outbuf, inbuf);
     else
-        cout << " inv";
+      for (int i = 0; i < nits; i++) fft.inv(inbuf, outbuf);
+    timer.stop();
+  }
 
-    cout << " NFFT=" << nfft << "  " << (double(1e-6*nfft*nits)/timer.value()) << " MS/s  " << mflops << "MFLOPS\n";
+  cout << nameof<Scalar>() << " ";
+  double mflops = 5. * nfft * log2((double)nfft) / (1e6 * timer.value() / (double)nits);
+  if (NumTraits<T>::IsComplex) {
+    cout << "complex";
+  } else {
+    cout << "real   ";
+    mflops /= 2;
+  }
+
+  if (fwd)
+    cout << " fwd";
+  else
+    cout << " inv";
+
+  cout << " NFFT=" << nfft << "  " << (double(1e-6 * nfft * nits) / timer.value()) << " MS/s  " << mflops << "MFLOPS\n";
 }
 
-int main(int argc,char ** argv)
-{
-    bench<complex<float> >(NFFT,true);
-    bench<complex<float> >(NFFT,false);
-    bench<float>(NFFT,true);
-    bench<float>(NFFT,false);
-    bench<float>(NFFT,false,true);
-    bench<float>(NFFT,false,true,true);
+int main(int argc, char** argv) {
+  bench<complex<float> >(NFFT, true);
+  bench<complex<float> >(NFFT, false);
+  bench<float>(NFFT, true);
+  bench<float>(NFFT, false);
+  bench<float>(NFFT, false, true);
+  bench<float>(NFFT, false, true, true);
 
-    bench<complex<double> >(NFFT,true);
-    bench<complex<double> >(NFFT,false);
-    bench<double>(NFFT,true);
-    bench<double>(NFFT,false);
-    bench<complex<long double> >(NFFT,true);
-    bench<complex<long double> >(NFFT,false);
-    bench<long double>(NFFT,true);
-    bench<long double>(NFFT,false);
-    return 0;
+  bench<complex<double> >(NFFT, true);
+  bench<complex<double> >(NFFT, false);
+  bench<double>(NFFT, true);
+  bench<double>(NFFT, false);
+  bench<complex<long double> >(NFFT, true);
+  bench<complex<long double> >(NFFT, false);
+  bench<long double>(NFFT, true);
+  bench<long double>(NFFT, false);
+  return 0;
 }
diff --git a/bench/benchGeometry.cpp b/bench/benchGeometry.cpp
index 6e16c03..67c16a9 100644
--- a/bench/benchGeometry.cpp
+++ b/bench/benchGeometry.cpp
@@ -11,124 +11,110 @@
 #define REPEAT 1000000
 #endif
 
-enum func_opt
-{
-    TV,
-    TMATV,
-    TMATVMAT,
+enum func_opt {
+  TV,
+  TMATV,
+  TMATVMAT,
 };
 
-
 template <class res, class arg1, class arg2, int opt>
 struct func;
 
 template <class res, class arg1, class arg2>
-struct func<res, arg1, arg2, TV>
-{
-    static EIGEN_DONT_INLINE res run( arg1& a1, arg2& a2 )
-    {
-	asm ("");
-	return a1 * a2;
-    }
+struct func<res, arg1, arg2, TV> {
+  static EIGEN_DONT_INLINE res run(arg1& a1, arg2& a2) {
+    asm("");
+    return a1 * a2;
+  }
 };
 
 template <class res, class arg1, class arg2>
-struct func<res, arg1, arg2, TMATV>
-{
-    static EIGEN_DONT_INLINE res run( arg1& a1, arg2& a2 )
-    {
-	asm ("");
-	return a1.matrix() * a2;
-    }
+struct func<res, arg1, arg2, TMATV> {
+  static EIGEN_DONT_INLINE res run(arg1& a1, arg2& a2) {
+    asm("");
+    return a1.matrix() * a2;
+  }
 };
 
 template <class res, class arg1, class arg2>
-struct func<res, arg1, arg2, TMATVMAT>
-{
-    static EIGEN_DONT_INLINE res run( arg1& a1, arg2& a2 )
-    {
-	asm ("");
-	return res(a1.matrix() * a2.matrix());
-    }
+struct func<res, arg1, arg2, TMATVMAT> {
+  static EIGEN_DONT_INLINE res run(arg1& a1, arg2& a2) {
+    asm("");
+    return res(a1.matrix() * a2.matrix());
+  }
 };
 
 template <class func, class arg1, class arg2>
-struct test_transform
-{
-    static void run()
-    {
-	arg1 a1;
-	a1.setIdentity();
-	arg2 a2;
-	a2.setIdentity();
+struct test_transform {
+  static void run() {
+    arg1 a1;
+    a1.setIdentity();
+    arg2 a2;
+    a2.setIdentity();
 
-	BenchTimer timer;
-	timer.reset();
-	for (int k=0; k<10; ++k)
-	{
-	    timer.start();
-	    for (int k=0; k<REPEAT; ++k)
-		a2 = func::run( a1, a2 );
-	    timer.stop();
-	}
-	cout << setprecision(4) << fixed << timer.value() << "s  " << endl;;
+    BenchTimer timer;
+    timer.reset();
+    for (int k = 0; k < 10; ++k) {
+      timer.start();
+      for (int k = 0; k < REPEAT; ++k) a2 = func::run(a1, a2);
+      timer.stop();
     }
+    cout << setprecision(4) << fixed << timer.value() << "s  " << endl;
+    ;
+  }
 };
 
+#define run_vec(op, scalar, mode, option, vsize)                                   \
+  std::cout << #scalar << "\t " << #mode << "\t " << #option << " " << #vsize " "; \
+  {                                                                                \
+    typedef Transform<scalar, 3, mode, option> Trans;                              \
+    typedef Matrix<scalar, vsize, 1, option> Vec;                                  \
+    typedef func<Vec, Trans, Vec, op> Func;                                        \
+    test_transform<Func, Trans, Vec>::run();                                       \
+  }
 
-#define run_vec( op, scalar, mode, option, vsize ) \
-    std::cout << #scalar << "\t " << #mode << "\t " << #option << " " << #vsize " "; \
-    {\
-	typedef Transform<scalar, 3, mode, option> Trans;\
-	typedef Matrix<scalar, vsize, 1, option> Vec;\
-	typedef func<Vec,Trans,Vec,op> Func;\
-	test_transform< Func, Trans, Vec >::run();\
-    }
+#define run_trans(op, scalar, mode, option)                            \
+  std::cout << #scalar << "\t " << #mode << "\t " << #option << "   "; \
+  {                                                                    \
+    typedef Transform<scalar, 3, mode, option> Trans;                  \
+    typedef func<Trans, Trans, Trans, op> Func;                        \
+    test_transform<Func, Trans, Trans>::run();                         \
+  }
 
-#define run_trans( op, scalar, mode, option ) \
-    std::cout << #scalar << "\t " << #mode << "\t " << #option << "   "; \
-    {\
-	typedef Transform<scalar, 3, mode, option> Trans;\
-	typedef func<Trans,Trans,Trans,op> Func;\
-	test_transform< Func, Trans, Trans >::run();\
-    }
+int main(int argc, char* argv[]) {
+  cout << "vec = trans * vec" << endl;
+  run_vec(TV, float, Isometry, AutoAlign, 3);
+  run_vec(TV, float, Isometry, DontAlign, 3);
+  run_vec(TV, float, Isometry, AutoAlign, 4);
+  run_vec(TV, float, Isometry, DontAlign, 4);
+  run_vec(TV, float, Projective, AutoAlign, 4);
+  run_vec(TV, float, Projective, DontAlign, 4);
+  run_vec(TV, double, Isometry, AutoAlign, 3);
+  run_vec(TV, double, Isometry, DontAlign, 3);
+  run_vec(TV, double, Isometry, AutoAlign, 4);
+  run_vec(TV, double, Isometry, DontAlign, 4);
+  run_vec(TV, double, Projective, AutoAlign, 4);
+  run_vec(TV, double, Projective, DontAlign, 4);
 
-int main(int argc, char* argv[])
-{
-    cout << "vec = trans * vec" << endl;
-    run_vec(TV, float,  Isometry, AutoAlign, 3);
-    run_vec(TV, float,  Isometry, DontAlign, 3);
-    run_vec(TV, float,  Isometry, AutoAlign, 4);
-    run_vec(TV, float,  Isometry, DontAlign, 4);
-    run_vec(TV, float,  Projective, AutoAlign, 4);
-    run_vec(TV, float,  Projective, DontAlign, 4);
-    run_vec(TV, double, Isometry, AutoAlign, 3);
-    run_vec(TV, double, Isometry, DontAlign, 3);
-    run_vec(TV, double, Isometry, AutoAlign, 4);
-    run_vec(TV, double, Isometry, DontAlign, 4);
-    run_vec(TV, double, Projective, AutoAlign, 4);
-    run_vec(TV, double, Projective, DontAlign, 4);
+  cout << "vec = trans.matrix() * vec" << endl;
+  run_vec(TMATV, float, Isometry, AutoAlign, 4);
+  run_vec(TMATV, float, Isometry, DontAlign, 4);
+  run_vec(TMATV, double, Isometry, AutoAlign, 4);
+  run_vec(TMATV, double, Isometry, DontAlign, 4);
 
-    cout << "vec = trans.matrix() * vec" << endl;
-    run_vec(TMATV, float,  Isometry, AutoAlign, 4);
-    run_vec(TMATV, float,  Isometry, DontAlign, 4);
-    run_vec(TMATV, double, Isometry, AutoAlign, 4);
-    run_vec(TMATV, double, Isometry, DontAlign, 4);
+  cout << "trans = trans1 * trans" << endl;
+  run_trans(TV, float, Isometry, AutoAlign);
+  run_trans(TV, float, Isometry, DontAlign);
+  run_trans(TV, double, Isometry, AutoAlign);
+  run_trans(TV, double, Isometry, DontAlign);
+  run_trans(TV, float, Projective, AutoAlign);
+  run_trans(TV, float, Projective, DontAlign);
+  run_trans(TV, double, Projective, AutoAlign);
+  run_trans(TV, double, Projective, DontAlign);
 
-    cout << "trans = trans1 * trans" << endl;
-    run_trans(TV, float,  Isometry, AutoAlign);
-    run_trans(TV, float,  Isometry, DontAlign);
-    run_trans(TV, double, Isometry, AutoAlign);
-    run_trans(TV, double, Isometry, DontAlign);
-    run_trans(TV, float,  Projective, AutoAlign);
-    run_trans(TV, float,  Projective, DontAlign);
-    run_trans(TV, double, Projective, AutoAlign);
-    run_trans(TV, double, Projective, DontAlign);
-
-    cout << "trans = trans1.matrix() * trans.matrix()" << endl;
-    run_trans(TMATVMAT, float,  Isometry, AutoAlign);
-    run_trans(TMATVMAT, float,  Isometry, DontAlign);
-    run_trans(TMATVMAT, double, Isometry, AutoAlign);
-    run_trans(TMATVMAT, double, Isometry, DontAlign);
+  cout << "trans = trans1.matrix() * trans.matrix()" << endl;
+  run_trans(TMATVMAT, float, Isometry, AutoAlign);
+  run_trans(TMATVMAT, float, Isometry, DontAlign);
+  run_trans(TMATVMAT, double, Isometry, AutoAlign);
+  run_trans(TMATVMAT, double, Isometry, DontAlign);
 }
-
diff --git a/bench/benchVecAdd.cpp b/bench/benchVecAdd.cpp
index ce8e1e9..509c642 100644
--- a/bench/benchVecAdd.cpp
+++ b/bench/benchVecAdd.cpp
@@ -14,122 +14,118 @@
 
 typedef float Scalar;
 
-__attribute__ ((noinline)) void benchVec(Scalar* a, Scalar* b, Scalar* c, int size);
-__attribute__ ((noinline)) void benchVec(MatrixXf& a, MatrixXf& b, MatrixXf& c);
-__attribute__ ((noinline)) void benchVec(VectorXf& a, VectorXf& b, VectorXf& c);
+__attribute__((noinline)) void benchVec(Scalar* a, Scalar* b, Scalar* c, int size);
+__attribute__((noinline)) void benchVec(MatrixXf& a, MatrixXf& b, MatrixXf& c);
+__attribute__((noinline)) void benchVec(VectorXf& a, VectorXf& b, VectorXf& c);
 
-int main(int argc, char* argv[])
-{
-    int size = SIZE * 8;
-    int size2 = size * size;
-    Scalar* a = internal::aligned_new<Scalar>(size2);
-    Scalar* b = internal::aligned_new<Scalar>(size2+4)+1;
-    Scalar* c = internal::aligned_new<Scalar>(size2); 
-    
-    for (int i=0; i<size; ++i)
-    {
-        a[i] = b[i] = c[i] = 0;
-    }
-    
-    BenchTimer timer;
-    
-    timer.reset();
-    for (int k=0; k<10; ++k)
-    {
+int main(int argc, char* argv[]) {
+  int size = SIZE * 8;
+  int size2 = size * size;
+  Scalar* a = internal::aligned_new<Scalar>(size2);
+  Scalar* b = internal::aligned_new<Scalar>(size2 + 4) + 1;
+  Scalar* c = internal::aligned_new<Scalar>(size2);
+
+  for (int i = 0; i < size; ++i) {
+    a[i] = b[i] = c[i] = 0;
+  }
+
+  BenchTimer timer;
+
+  timer.reset();
+  for (int k = 0; k < 10; ++k) {
+    timer.start();
+    benchVec(a, b, c, size2);
+    timer.stop();
+  }
+  std::cout << timer.value() << "s  " << (double(size2 * REPEAT) / timer.value()) / (1024. * 1024. * 1024.)
+            << " GFlops\n";
+  return 0;
+  for (int innersize = size; innersize > 2; --innersize) {
+    if (size2 % innersize == 0) {
+      int outersize = size2 / innersize;
+      MatrixXf ma = Map<MatrixXf>(a, innersize, outersize);
+      MatrixXf mb = Map<MatrixXf>(b, innersize, outersize);
+      MatrixXf mc = Map<MatrixXf>(c, innersize, outersize);
+      timer.reset();
+      for (int k = 0; k < 3; ++k) {
         timer.start();
-        benchVec(a, b, c, size2);
+        benchVec(ma, mb, mc);
         timer.stop();
+      }
+      std::cout << innersize << " x " << outersize << "  " << timer.value() << "s   "
+                << (double(size2 * REPEAT) / timer.value()) / (1024. * 1024. * 1024.) << " GFlops\n";
     }
-    std::cout << timer.value() << "s  " << (double(size2*REPEAT)/timer.value())/(1024.*1024.*1024.) << " GFlops\n";
-    return 0;
-    for (int innersize = size; innersize>2 ; --innersize)
-    {
-        if (size2%innersize==0)
-        {
-            int outersize = size2/innersize;
-            MatrixXf ma = Map<MatrixXf>(a, innersize, outersize );
-            MatrixXf mb = Map<MatrixXf>(b, innersize, outersize );
-            MatrixXf mc = Map<MatrixXf>(c, innersize, outersize );
-            timer.reset();
-            for (int k=0; k<3; ++k)
-            {
-                timer.start();
-                benchVec(ma, mb, mc);
-                timer.stop();
-            }
-            std::cout << innersize << " x " << outersize << "  " << timer.value() << "s   " << (double(size2*REPEAT)/timer.value())/(1024.*1024.*1024.) << " GFlops\n";
-        }
-    }
-    
-    VectorXf va = Map<VectorXf>(a, size2);
-    VectorXf vb = Map<VectorXf>(b, size2);
-    VectorXf vc = Map<VectorXf>(c, size2);
-    timer.reset();
-    for (int k=0; k<3; ++k)
-    {
-        timer.start();
-        benchVec(va, vb, vc);
-        timer.stop();
-    }
-    std::cout << timer.value() << "s   " << (double(size2*REPEAT)/timer.value())/(1024.*1024.*1024.) << " GFlops\n";
+  }
 
-    return 0;
+  VectorXf va = Map<VectorXf>(a, size2);
+  VectorXf vb = Map<VectorXf>(b, size2);
+  VectorXf vc = Map<VectorXf>(c, size2);
+  timer.reset();
+  for (int k = 0; k < 3; ++k) {
+    timer.start();
+    benchVec(va, vb, vc);
+    timer.stop();
+  }
+  std::cout << timer.value() << "s   " << (double(size2 * REPEAT) / timer.value()) / (1024. * 1024. * 1024.)
+            << " GFlops\n";
+
+  return 0;
 }
 
-void benchVec(MatrixXf& a, MatrixXf& b, MatrixXf& c)
-{
-    for (int k=0; k<REPEAT; ++k)
-        a = a + b;
+void benchVec(MatrixXf& a, MatrixXf& b, MatrixXf& c) {
+  for (int k = 0; k < REPEAT; ++k) a = a + b;
 }
 
-void benchVec(VectorXf& a, VectorXf& b, VectorXf& c)
-{
-    for (int k=0; k<REPEAT; ++k)
-        a = a + b;
+void benchVec(VectorXf& a, VectorXf& b, VectorXf& c) {
+  for (int k = 0; k < REPEAT; ++k) a = a + b;
 }
 
-void benchVec(Scalar* a, Scalar* b, Scalar* c, int size)
-{
-    typedef internal::packet_traits<Scalar>::type PacketScalar;
-    const int PacketSize = internal::packet_traits<Scalar>::size;
-    PacketScalar a0, a1, a2, a3, b0, b1, b2, b3;
-    for (int k=0; k<REPEAT; ++k)
-        for (int i=0; i<size; i+=PacketSize*8)
-        {
-//             a0 = internal::pload(&a[i]);
-//             b0 = internal::pload(&b[i]);
-//             a1 = internal::pload(&a[i+1*PacketSize]);
-//             b1 = internal::pload(&b[i+1*PacketSize]);
-//             a2 = internal::pload(&a[i+2*PacketSize]);
-//             b2 = internal::pload(&b[i+2*PacketSize]);
-//             a3 = internal::pload(&a[i+3*PacketSize]);
-//             b3 = internal::pload(&b[i+3*PacketSize]);
-//             internal::pstore(&a[i], internal::padd(a0, b0));
-//             a0 = internal::pload(&a[i+4*PacketSize]);
-//             b0 = internal::pload(&b[i+4*PacketSize]);
-//             
-//             internal::pstore(&a[i+1*PacketSize], internal::padd(a1, b1));
-//             a1 = internal::pload(&a[i+5*PacketSize]);
-//             b1 = internal::pload(&b[i+5*PacketSize]);
-//             
-//             internal::pstore(&a[i+2*PacketSize], internal::padd(a2, b2));
-//             a2 = internal::pload(&a[i+6*PacketSize]);
-//             b2 = internal::pload(&b[i+6*PacketSize]);
-//             
-//             internal::pstore(&a[i+3*PacketSize], internal::padd(a3, b3));
-//             a3 = internal::pload(&a[i+7*PacketSize]);
-//             b3 = internal::pload(&b[i+7*PacketSize]);
-//             
-//             internal::pstore(&a[i+4*PacketSize], internal::padd(a0, b0));
-//             internal::pstore(&a[i+5*PacketSize], internal::padd(a1, b1));
-//             internal::pstore(&a[i+6*PacketSize], internal::padd(a2, b2));
-//             internal::pstore(&a[i+7*PacketSize], internal::padd(a3, b3));
-            
-            internal::pstore(&a[i+2*PacketSize], internal::padd(internal::ploadu(&a[i+2*PacketSize]), internal::ploadu(&b[i+2*PacketSize])));
-            internal::pstore(&a[i+3*PacketSize], internal::padd(internal::ploadu(&a[i+3*PacketSize]), internal::ploadu(&b[i+3*PacketSize])));
-            internal::pstore(&a[i+4*PacketSize], internal::padd(internal::ploadu(&a[i+4*PacketSize]), internal::ploadu(&b[i+4*PacketSize])));
-            internal::pstore(&a[i+5*PacketSize], internal::padd(internal::ploadu(&a[i+5*PacketSize]), internal::ploadu(&b[i+5*PacketSize])));
-            internal::pstore(&a[i+6*PacketSize], internal::padd(internal::ploadu(&a[i+6*PacketSize]), internal::ploadu(&b[i+6*PacketSize])));
-            internal::pstore(&a[i+7*PacketSize], internal::padd(internal::ploadu(&a[i+7*PacketSize]), internal::ploadu(&b[i+7*PacketSize])));
-        }
+void benchVec(Scalar* a, Scalar* b, Scalar* c, int size) {
+  typedef internal::packet_traits<Scalar>::type PacketScalar;
+  const int PacketSize = internal::packet_traits<Scalar>::size;
+  PacketScalar a0, a1, a2, a3, b0, b1, b2, b3;
+  for (int k = 0; k < REPEAT; ++k)
+    for (int i = 0; i < size; i += PacketSize * 8) {
+      //             a0 = internal::pload(&a[i]);
+      //             b0 = internal::pload(&b[i]);
+      //             a1 = internal::pload(&a[i+1*PacketSize]);
+      //             b1 = internal::pload(&b[i+1*PacketSize]);
+      //             a2 = internal::pload(&a[i+2*PacketSize]);
+      //             b2 = internal::pload(&b[i+2*PacketSize]);
+      //             a3 = internal::pload(&a[i+3*PacketSize]);
+      //             b3 = internal::pload(&b[i+3*PacketSize]);
+      //             internal::pstore(&a[i], internal::padd(a0, b0));
+      //             a0 = internal::pload(&a[i+4*PacketSize]);
+      //             b0 = internal::pload(&b[i+4*PacketSize]);
+      //
+      //             internal::pstore(&a[i+1*PacketSize], internal::padd(a1, b1));
+      //             a1 = internal::pload(&a[i+5*PacketSize]);
+      //             b1 = internal::pload(&b[i+5*PacketSize]);
+      //
+      //             internal::pstore(&a[i+2*PacketSize], internal::padd(a2, b2));
+      //             a2 = internal::pload(&a[i+6*PacketSize]);
+      //             b2 = internal::pload(&b[i+6*PacketSize]);
+      //
+      //             internal::pstore(&a[i+3*PacketSize], internal::padd(a3, b3));
+      //             a3 = internal::pload(&a[i+7*PacketSize]);
+      //             b3 = internal::pload(&b[i+7*PacketSize]);
+      //
+      //             internal::pstore(&a[i+4*PacketSize], internal::padd(a0, b0));
+      //             internal::pstore(&a[i+5*PacketSize], internal::padd(a1, b1));
+      //             internal::pstore(&a[i+6*PacketSize], internal::padd(a2, b2));
+      //             internal::pstore(&a[i+7*PacketSize], internal::padd(a3, b3));
+
+      internal::pstore(&a[i + 2 * PacketSize], internal::padd(internal::ploadu(&a[i + 2 * PacketSize]),
+                                                              internal::ploadu(&b[i + 2 * PacketSize])));
+      internal::pstore(&a[i + 3 * PacketSize], internal::padd(internal::ploadu(&a[i + 3 * PacketSize]),
+                                                              internal::ploadu(&b[i + 3 * PacketSize])));
+      internal::pstore(&a[i + 4 * PacketSize], internal::padd(internal::ploadu(&a[i + 4 * PacketSize]),
+                                                              internal::ploadu(&b[i + 4 * PacketSize])));
+      internal::pstore(&a[i + 5 * PacketSize], internal::padd(internal::ploadu(&a[i + 5 * PacketSize]),
+                                                              internal::ploadu(&b[i + 5 * PacketSize])));
+      internal::pstore(&a[i + 6 * PacketSize], internal::padd(internal::ploadu(&a[i + 6 * PacketSize]),
+                                                              internal::ploadu(&b[i + 6 * PacketSize])));
+      internal::pstore(&a[i + 7 * PacketSize], internal::padd(internal::ploadu(&a[i + 7 * PacketSize]),
+                                                              internal::ploadu(&b[i + 7 * PacketSize])));
+    }
 }
diff --git a/bench/bench_gemm.cpp b/bench/bench_gemm.cpp
index 78ca1cd..e01bdb8 100644
--- a/bench/bench_gemm.cpp
+++ b/bench/bench_gemm.cpp
@@ -3,7 +3,7 @@
 // icpc bench_gemm.cpp -I .. -O3 -DNDEBUG -lrt -openmp  && OMP_NUM_THREADS=2  ./a.out
 
 // Compilation options:
-// 
+//
 // -DSCALAR=std::complex<double>
 // -DSCALARA=double or -DSCALARB=double
 // -DHAVE_BLAS
@@ -14,7 +14,6 @@
 #include <bench/BenchTimer.h>
 #include <Eigen/Core>
 
-
 using namespace std;
 using namespace Eigen;
 
@@ -45,15 +44,15 @@
 
 typedef SCALAR Scalar;
 typedef NumTraits<Scalar>::Real RealScalar;
-typedef Matrix<SCALARA,Dynamic,Dynamic,opt_A> A;
-typedef Matrix<SCALARB,Dynamic,Dynamic,opt_B> B;
-typedef Matrix<Scalar,Dynamic,Dynamic> C;
-typedef Matrix<RealScalar,Dynamic,Dynamic> M;
+typedef Matrix<SCALARA, Dynamic, Dynamic, opt_A> A;
+typedef Matrix<SCALARB, Dynamic, Dynamic, opt_B> B;
+typedef Matrix<Scalar, Dynamic, Dynamic> C;
+typedef Matrix<RealScalar, Dynamic, Dynamic> M;
 
 #ifdef HAVE_BLAS
 
 extern "C" {
-  #include <Eigen/src/misc/blas.h>
+#include <Eigen/src/misc/blas.h>
 }
 
 static float fone = 1;
@@ -65,7 +64,7 @@
 static std::complex<double> cdone = 1;
 static std::complex<double> cdzero = 0;
 static char notrans = 'N';
-static char trans = 'T';  
+static char trans = 'T';
 static char nonunit = 'N';
 static char lower = 'L';
 static char right = 'R';
@@ -83,60 +82,61 @@
 const char transB = notrans;
 #endif
 
-template<typename A,typename B>
-void blas_gemm(const A& a, const B& b, MatrixXf& c)
-{
-  int M = c.rows(); int N = c.cols(); int K = a.cols();
-  int lda = a.outerStride(); int ldb = b.outerStride(); int ldc = c.rows();
+template <typename A, typename B>
+void blas_gemm(const A& a, const B& b, MatrixXf& c) {
+  int M = c.rows();
+  int N = c.cols();
+  int K = a.cols();
+  int lda = a.outerStride();
+  int ldb = b.outerStride();
+  int ldc = c.rows();
 
-  sgemm_(&transA,&transB,&M,&N,&K,&fone,
-         const_cast<float*>(a.data()),&lda,
-         const_cast<float*>(b.data()),&ldb,&fone,
-         c.data(),&ldc);
+  sgemm_(&transA, &transB, &M, &N, &K, &fone, const_cast<float*>(a.data()), &lda, const_cast<float*>(b.data()), &ldb,
+         &fone, c.data(), &ldc);
 }
 
-template<typename A,typename B>
-void blas_gemm(const A& a, const B& b, MatrixXd& c)
-{
-  int M = c.rows(); int N = c.cols(); int K = a.cols();
-  int lda = a.outerStride(); int ldb = b.outerStride(); int ldc = c.rows();
+template <typename A, typename B>
+void blas_gemm(const A& a, const B& b, MatrixXd& c) {
+  int M = c.rows();
+  int N = c.cols();
+  int K = a.cols();
+  int lda = a.outerStride();
+  int ldb = b.outerStride();
+  int ldc = c.rows();
 
-  dgemm_(&transA,&transB,&M,&N,&K,&done,
-         const_cast<double*>(a.data()),&lda,
-         const_cast<double*>(b.data()),&ldb,&done,
-         c.data(),&ldc);
+  dgemm_(&transA, &transB, &M, &N, &K, &done, const_cast<double*>(a.data()), &lda, const_cast<double*>(b.data()), &ldb,
+         &done, c.data(), &ldc);
 }
 
-template<typename A,typename B>
-void blas_gemm(const A& a, const B& b, MatrixXcf& c)
-{
-  int M = c.rows(); int N = c.cols(); int K = a.cols();
-  int lda = a.outerStride(); int ldb = b.outerStride(); int ldc = c.rows();
+template <typename A, typename B>
+void blas_gemm(const A& a, const B& b, MatrixXcf& c) {
+  int M = c.rows();
+  int N = c.cols();
+  int K = a.cols();
+  int lda = a.outerStride();
+  int ldb = b.outerStride();
+  int ldc = c.rows();
 
-  cgemm_(&transA,&transB,&M,&N,&K,(float*)&cfone,
-         const_cast<float*>((const float*)a.data()),&lda,
-         const_cast<float*>((const float*)b.data()),&ldb,(float*)&cfone,
-         (float*)c.data(),&ldc);
+  cgemm_(&transA, &transB, &M, &N, &K, (float*)&cfone, const_cast<float*>((const float*)a.data()), &lda,
+         const_cast<float*>((const float*)b.data()), &ldb, (float*)&cfone, (float*)c.data(), &ldc);
 }
 
-template<typename A,typename B>
-void blas_gemm(const A& a, const B& b, MatrixXcd& c)
-{
-  int M = c.rows(); int N = c.cols(); int K = a.cols();
-  int lda = a.outerStride(); int ldb = b.outerStride(); int ldc = c.rows();
+template <typename A, typename B>
+void blas_gemm(const A& a, const B& b, MatrixXcd& c) {
+  int M = c.rows();
+  int N = c.cols();
+  int K = a.cols();
+  int lda = a.outerStride();
+  int ldb = b.outerStride();
+  int ldc = c.rows();
 
-  zgemm_(&transA,&transB,&M,&N,&K,(double*)&cdone,
-         const_cast<double*>((const double*)a.data()),&lda,
-         const_cast<double*>((const double*)b.data()),&ldb,(double*)&cdone,
-         (double*)c.data(),&ldc);
+  zgemm_(&transA, &transB, &M, &N, &K, (double*)&cdone, const_cast<double*>((const double*)a.data()), &lda,
+         const_cast<double*>((const double*)b.data()), &ldb, (double*)&cdone, (double*)c.data(), &ldc);
 }
 
-
-
 #endif
 
-void matlab_cplx_cplx(const M& ar, const M& ai, const M& br, const M& bi, M& cr, M& ci)
-{
+void matlab_cplx_cplx(const M& ar, const M& ai, const M& br, const M& bi, M& cr, M& ci) {
   cr.noalias() += ar * br;
   cr.noalias() -= ai * bi;
   ci.noalias() += ar * bi;
@@ -144,33 +144,27 @@
   // [cr ci] += [ar ai] * br + [-ai ar] * bi
 }
 
-void matlab_real_cplx(const M& a, const M& br, const M& bi, M& cr, M& ci)
-{
+void matlab_real_cplx(const M& a, const M& br, const M& bi, M& cr, M& ci) {
   cr.noalias() += a * br;
   ci.noalias() += a * bi;
 }
 
-void matlab_cplx_real(const M& ar, const M& ai, const M& b, M& cr, M& ci)
-{
+void matlab_cplx_real(const M& ar, const M& ai, const M& b, M& cr, M& ci) {
   cr.noalias() += ar * b;
   ci.noalias() += ai * b;
 }
 
-
-
-template<typename A, typename B, typename C>
-EIGEN_DONT_INLINE void gemm(const A& a, const B& b, C& c)
-{
+template <typename A, typename B, typename C>
+EIGEN_DONT_INLINE void gemm(const A& a, const B& b, C& c) {
   c.noalias() += a * b;
 }
 
-int main(int argc, char ** argv)
-{
+int main(int argc, char** argv) {
   std::ptrdiff_t l1 = internal::queryL1CacheSize();
   std::ptrdiff_t l2 = internal::queryTopLevelCacheSize();
-  std::cout << "L1 cache size     = " << (l1>0 ? l1/1024 : -1) << " KB\n";
-  std::cout << "L2/L3 cache size  = " << (l2>0 ? l2/1024 : -1) << " KB\n";
-  typedef internal::gebp_traits<Scalar,Scalar> Traits;
+  std::cout << "L1 cache size     = " << (l1 > 0 ? l1 / 1024 : -1) << " KB\n";
+  std::cout << "L2/L3 cache size  = " << (l2 > 0 ? l2 / 1024 : -1) << " KB\n";
+  typedef internal::gebp_traits<Scalar, Scalar> Traits;
   std::cout << "Register blocking = " << Traits::mr << " x " << Traits::nr << "\n";
 
   int rep = 1;    // number of repetitions per try
@@ -180,196 +174,220 @@
   int m = s;
   int n = s;
   int p = s;
-  int cache_size1=-1, cache_size2=l2, cache_size3 = 0;
+  int cache_size1 = -1, cache_size2 = l2, cache_size3 = 0;
 
   bool need_help = false;
-  for (int i=1; i<argc;)
-  {
-    if(argv[i][0]=='-')
-    {
-      if(argv[i][1]=='s')
-      {
+  for (int i = 1; i < argc;) {
+    if (argv[i][0] == '-') {
+      if (argv[i][1] == 's') {
         ++i;
         s = atoi(argv[i++]);
         m = n = p = s;
-        if(argv[i][0]!='-')
-        {
+        if (argv[i][0] != '-') {
           n = atoi(argv[i++]);
           p = atoi(argv[i++]);
         }
-      }
-      else if(argv[i][1]=='c')
-      {
+      } else if (argv[i][1] == 'c') {
         ++i;
         cache_size1 = atoi(argv[i++]);
-        if(argv[i][0]!='-')
-        {
+        if (argv[i][0] != '-') {
           cache_size2 = atoi(argv[i++]);
-          if(argv[i][0]!='-')
-            cache_size3 = atoi(argv[i++]);
+          if (argv[i][0] != '-') cache_size3 = atoi(argv[i++]);
         }
-      }
-      else if(argv[i][1]=='t')
-      {
+      } else if (argv[i][1] == 't') {
         tries = atoi(argv[++i]);
         ++i;
-      }
-      else if(argv[i][1]=='p')
-      {
+      } else if (argv[i][1] == 'p') {
         ++i;
         rep = atoi(argv[i++]);
       }
-    }
-    else
-    {
+    } else {
       need_help = true;
       break;
     }
   }
 
-  if(need_help)
-  {
+  if (need_help) {
     std::cout << argv[0] << " -s <matrix sizes> -c <cache sizes> -t <nb tries> -p <nb repeats>\n";
     std::cout << "   <matrix sizes> : size\n";
     std::cout << "   <matrix sizes> : rows columns depth\n";
     return 1;
   }
 
-#if EIGEN_VERSION_AT_LEAST(3,2,90)
-  if(cache_size1>0)
-    setCpuCacheSizes(cache_size1,cache_size2,cache_size3);
+#if EIGEN_VERSION_AT_LEAST(3, 2, 90)
+  if (cache_size1 > 0) setCpuCacheSizes(cache_size1, cache_size2, cache_size3);
 #endif
-  
-  A a(m,p); a.setRandom();
-  B b(p,n); b.setRandom();
-  C c(m,n); c.setOnes();
+
+  A a(m, p);
+  a.setRandom();
+  B b(p, n);
+  b.setRandom();
+  C c(m, n);
+  c.setOnes();
   C rc = c;
 
   std::cout << "Matrix sizes = " << m << "x" << p << " * " << p << "x" << n << "\n";
   std::ptrdiff_t mc(m), nc(n), kc(p);
-  internal::computeProductBlockingSizes<Scalar,Scalar>(kc, mc, nc);
+  internal::computeProductBlockingSizes<Scalar, Scalar>(kc, mc, nc);
   std::cout << "blocking size (mc x kc) = " << mc << " x " << kc << " x " << nc << "\n";
 
   C r = c;
 
-  // check the parallel product is correct
-  #if defined EIGEN_HAS_OPENMP
+// check the parallel product is correct
+#if defined EIGEN_HAS_OPENMP
   Eigen::initParallel();
   int procs = omp_get_max_threads();
-  if(procs>1)
-  {
-    #ifdef HAVE_BLAS
-    blas_gemm(a,b,r);
-    #else
+  if (procs > 1) {
+#ifdef HAVE_BLAS
+    blas_gemm(a, b, r);
+#else
     omp_set_num_threads(1);
     r.noalias() += a * b;
     omp_set_num_threads(procs);
-    #endif
+#endif
     c.noalias() += a * b;
-    if(!r.isApprox(c)) std::cerr << "Warning, your parallel product is crap!\n\n";
+    if (!r.isApprox(c)) std::cerr << "Warning, your parallel product is crap!\n\n";
   }
-  #elif defined HAVE_BLAS
-    blas_gemm(a,b,r);
-    c.noalias() += a * b;
-    if(!r.isApprox(c)) {
-      std::cout << (r  - c).norm()/r.norm() << "\n";
+#elif defined HAVE_BLAS
+  blas_gemm(a, b, r);
+  c.noalias() += a * b;
+  if (!r.isApprox(c)) {
+    std::cout << (r - c).norm() / r.norm() << "\n";
+    std::cerr << "Warning, your product is crap!\n\n";
+  }
+#else
+  if (1. * m * n * p < 2000. * 2000 * 2000) {
+    gemm(a, b, c);
+    r.noalias() += a.cast<Scalar>().lazyProduct(b.cast<Scalar>());
+    if (!r.isApprox(c)) {
+      std::cout << (r - c).norm() / r.norm() << "\n";
       std::cerr << "Warning, your product is crap!\n\n";
     }
-  #else
-    if(1.*m*n*p<2000.*2000*2000)
-    {
-      gemm(a,b,c);
-      r.noalias() += a.cast<Scalar>() .lazyProduct( b.cast<Scalar>() );
-      if(!r.isApprox(c)) {
-        std::cout << (r  - c).norm()/r.norm() << "\n";
-        std::cerr << "Warning, your product is crap!\n\n";
-      }
-    }
-  #endif
+  }
+#endif
 
-  #ifdef HAVE_BLAS
+#ifdef HAVE_BLAS
   BenchTimer tblas;
   c = rc;
-  BENCH(tblas, tries, rep, blas_gemm(a,b,c));
-  std::cout << "blas  cpu         " << tblas.best(CPU_TIMER)/rep  << "s  \t" << (double(m)*n*p*rep*2/tblas.best(CPU_TIMER))*1e-9  <<  " GFLOPS \t(" << tblas.total(CPU_TIMER)  << "s)\n";
-  std::cout << "blas  real        " << tblas.best(REAL_TIMER)/rep << "s  \t" << (double(m)*n*p*rep*2/tblas.best(REAL_TIMER))*1e-9 <<  " GFLOPS \t(" << tblas.total(REAL_TIMER) << "s)\n";
-  #endif
+  BENCH(tblas, tries, rep, blas_gemm(a, b, c));
+  std::cout << "blas  cpu         " << tblas.best(CPU_TIMER) / rep << "s  \t"
+            << (double(m) * n * p * rep * 2 / tblas.best(CPU_TIMER)) * 1e-9 << " GFLOPS \t(" << tblas.total(CPU_TIMER)
+            << "s)\n";
+  std::cout << "blas  real        " << tblas.best(REAL_TIMER) / rep << "s  \t"
+            << (double(m) * n * p * rep * 2 / tblas.best(REAL_TIMER)) * 1e-9 << " GFLOPS \t(" << tblas.total(REAL_TIMER)
+            << "s)\n";
+#endif
 
   // warm start
-  if(b.norm()+a.norm()==123.554) std::cout << "\n";
+  if (b.norm() + a.norm() == 123.554) std::cout << "\n";
 
   BenchTimer tmt;
   c = rc;
-  BENCH(tmt, tries, rep, gemm(a,b,c));
-  std::cout << "eigen cpu         " << tmt.best(CPU_TIMER)/rep  << "s  \t" << (double(m)*n*p*rep*2/tmt.best(CPU_TIMER))*1e-9  <<  " GFLOPS \t(" << tmt.total(CPU_TIMER)  << "s)\n";
-  std::cout << "eigen real        " << tmt.best(REAL_TIMER)/rep << "s  \t" << (double(m)*n*p*rep*2/tmt.best(REAL_TIMER))*1e-9 <<  " GFLOPS \t(" << tmt.total(REAL_TIMER) << "s)\n";
+  BENCH(tmt, tries, rep, gemm(a, b, c));
+  std::cout << "eigen cpu         " << tmt.best(CPU_TIMER) / rep << "s  \t"
+            << (double(m) * n * p * rep * 2 / tmt.best(CPU_TIMER)) * 1e-9 << " GFLOPS \t(" << tmt.total(CPU_TIMER)
+            << "s)\n";
+  std::cout << "eigen real        " << tmt.best(REAL_TIMER) / rep << "s  \t"
+            << (double(m) * n * p * rep * 2 / tmt.best(REAL_TIMER)) * 1e-9 << " GFLOPS \t(" << tmt.total(REAL_TIMER)
+            << "s)\n";
 
-  #ifdef EIGEN_HAS_OPENMP
-  if(procs>1)
-  {
+#ifdef EIGEN_HAS_OPENMP
+  if (procs > 1) {
     BenchTimer tmono;
     omp_set_num_threads(1);
     Eigen::setNbThreads(1);
     c = rc;
-    BENCH(tmono, tries, rep, gemm(a,b,c));
-    std::cout << "eigen mono cpu    " << tmono.best(CPU_TIMER)/rep  << "s  \t" << (double(m)*n*p*rep*2/tmono.best(CPU_TIMER))*1e-9  <<  " GFLOPS \t(" << tmono.total(CPU_TIMER)  << "s)\n";
-    std::cout << "eigen mono real   " << tmono.best(REAL_TIMER)/rep << "s  \t" << (double(m)*n*p*rep*2/tmono.best(REAL_TIMER))*1e-9 <<  " GFLOPS \t(" << tmono.total(REAL_TIMER) << "s)\n";
-    std::cout << "mt speed up x" << tmono.best(CPU_TIMER) / tmt.best(REAL_TIMER)  << " => " << (100.0*tmono.best(CPU_TIMER) / tmt.best(REAL_TIMER))/procs << "%\n";
+    BENCH(tmono, tries, rep, gemm(a, b, c));
+    std::cout << "eigen mono cpu    " << tmono.best(CPU_TIMER) / rep << "s  \t"
+              << (double(m) * n * p * rep * 2 / tmono.best(CPU_TIMER)) * 1e-9 << " GFLOPS \t(" << tmono.total(CPU_TIMER)
+              << "s)\n";
+    std::cout << "eigen mono real   " << tmono.best(REAL_TIMER) / rep << "s  \t"
+              << (double(m) * n * p * rep * 2 / tmono.best(REAL_TIMER)) * 1e-9 << " GFLOPS \t("
+              << tmono.total(REAL_TIMER) << "s)\n";
+    std::cout << "mt speed up x" << tmono.best(CPU_TIMER) / tmt.best(REAL_TIMER) << " => "
+              << (100.0 * tmono.best(CPU_TIMER) / tmt.best(REAL_TIMER)) / procs << "%\n";
   }
-  #endif
-  
-  if(1.*m*n*p<30*30*30)
-  {
+#endif
+
+  if (1. * m * n * p < 30 * 30 * 30) {
     BenchTimer tmt;
     c = rc;
-    BENCH(tmt, tries, rep, c.noalias()+=a.lazyProduct(b));
-    std::cout << "lazy cpu         " << tmt.best(CPU_TIMER)/rep  << "s  \t" << (double(m)*n*p*rep*2/tmt.best(CPU_TIMER))*1e-9  <<  " GFLOPS \t(" << tmt.total(CPU_TIMER)  << "s)\n";
-    std::cout << "lazy real        " << tmt.best(REAL_TIMER)/rep << "s  \t" << (double(m)*n*p*rep*2/tmt.best(REAL_TIMER))*1e-9 <<  " GFLOPS \t(" << tmt.total(REAL_TIMER) << "s)\n";
+    BENCH(tmt, tries, rep, c.noalias() += a.lazyProduct(b));
+    std::cout << "lazy cpu         " << tmt.best(CPU_TIMER) / rep << "s  \t"
+              << (double(m) * n * p * rep * 2 / tmt.best(CPU_TIMER)) * 1e-9 << " GFLOPS \t(" << tmt.total(CPU_TIMER)
+              << "s)\n";
+    std::cout << "lazy real        " << tmt.best(REAL_TIMER) / rep << "s  \t"
+              << (double(m) * n * p * rep * 2 / tmt.best(REAL_TIMER)) * 1e-9 << " GFLOPS \t(" << tmt.total(REAL_TIMER)
+              << "s)\n";
   }
-  
-  #ifdef DECOUPLED
-  if((NumTraits<A::Scalar>::IsComplex) && (NumTraits<B::Scalar>::IsComplex))
-  {
-    M ar(m,p); ar.setRandom();
-    M ai(m,p); ai.setRandom();
-    M br(p,n); br.setRandom();
-    M bi(p,n); bi.setRandom();
-    M cr(m,n); cr.setRandom();
-    M ci(m,n); ci.setRandom();
-    
+
+#ifdef DECOUPLED
+  if ((NumTraits<A::Scalar>::IsComplex) && (NumTraits<B::Scalar>::IsComplex)) {
+    M ar(m, p);
+    ar.setRandom();
+    M ai(m, p);
+    ai.setRandom();
+    M br(p, n);
+    br.setRandom();
+    M bi(p, n);
+    bi.setRandom();
+    M cr(m, n);
+    cr.setRandom();
+    M ci(m, n);
+    ci.setRandom();
+
     BenchTimer t;
-    BENCH(t, tries, rep, matlab_cplx_cplx(ar,ai,br,bi,cr,ci));
-    std::cout << "\"matlab\" cpu    " << t.best(CPU_TIMER)/rep  << "s  \t" << (double(m)*n*p*rep*2/t.best(CPU_TIMER))*1e-9  <<  " GFLOPS \t(" << t.total(CPU_TIMER)  << "s)\n";
-    std::cout << "\"matlab\" real   " << t.best(REAL_TIMER)/rep << "s  \t" << (double(m)*n*p*rep*2/t.best(REAL_TIMER))*1e-9 <<  " GFLOPS \t(" << t.total(REAL_TIMER) << "s)\n";
+    BENCH(t, tries, rep, matlab_cplx_cplx(ar, ai, br, bi, cr, ci));
+    std::cout << "\"matlab\" cpu    " << t.best(CPU_TIMER) / rep << "s  \t"
+              << (double(m) * n * p * rep * 2 / t.best(CPU_TIMER)) * 1e-9 << " GFLOPS \t(" << t.total(CPU_TIMER)
+              << "s)\n";
+    std::cout << "\"matlab\" real   " << t.best(REAL_TIMER) / rep << "s  \t"
+              << (double(m) * n * p * rep * 2 / t.best(REAL_TIMER)) * 1e-9 << " GFLOPS \t(" << t.total(REAL_TIMER)
+              << "s)\n";
   }
-  if((!NumTraits<A::Scalar>::IsComplex) && (NumTraits<B::Scalar>::IsComplex))
-  {
-    M a(m,p);  a.setRandom();
-    M br(p,n); br.setRandom();
-    M bi(p,n); bi.setRandom();
-    M cr(m,n); cr.setRandom();
-    M ci(m,n); ci.setRandom();
-    
+  if ((!NumTraits<A::Scalar>::IsComplex) && (NumTraits<B::Scalar>::IsComplex)) {
+    M a(m, p);
+    a.setRandom();
+    M br(p, n);
+    br.setRandom();
+    M bi(p, n);
+    bi.setRandom();
+    M cr(m, n);
+    cr.setRandom();
+    M ci(m, n);
+    ci.setRandom();
+
     BenchTimer t;
-    BENCH(t, tries, rep, matlab_real_cplx(a,br,bi,cr,ci));
-    std::cout << "\"matlab\" cpu    " << t.best(CPU_TIMER)/rep  << "s  \t" << (double(m)*n*p*rep*2/t.best(CPU_TIMER))*1e-9  <<  " GFLOPS \t(" << t.total(CPU_TIMER)  << "s)\n";
-    std::cout << "\"matlab\" real   " << t.best(REAL_TIMER)/rep << "s  \t" << (double(m)*n*p*rep*2/t.best(REAL_TIMER))*1e-9 <<  " GFLOPS \t(" << t.total(REAL_TIMER) << "s)\n";
+    BENCH(t, tries, rep, matlab_real_cplx(a, br, bi, cr, ci));
+    std::cout << "\"matlab\" cpu    " << t.best(CPU_TIMER) / rep << "s  \t"
+              << (double(m) * n * p * rep * 2 / t.best(CPU_TIMER)) * 1e-9 << " GFLOPS \t(" << t.total(CPU_TIMER)
+              << "s)\n";
+    std::cout << "\"matlab\" real   " << t.best(REAL_TIMER) / rep << "s  \t"
+              << (double(m) * n * p * rep * 2 / t.best(REAL_TIMER)) * 1e-9 << " GFLOPS \t(" << t.total(REAL_TIMER)
+              << "s)\n";
   }
-  if((NumTraits<A::Scalar>::IsComplex) && (!NumTraits<B::Scalar>::IsComplex))
-  {
-    M ar(m,p); ar.setRandom();
-    M ai(m,p); ai.setRandom();
-    M b(p,n);  b.setRandom();
-    M cr(m,n); cr.setRandom();
-    M ci(m,n); ci.setRandom();
-    
+  if ((NumTraits<A::Scalar>::IsComplex) && (!NumTraits<B::Scalar>::IsComplex)) {
+    M ar(m, p);
+    ar.setRandom();
+    M ai(m, p);
+    ai.setRandom();
+    M b(p, n);
+    b.setRandom();
+    M cr(m, n);
+    cr.setRandom();
+    M ci(m, n);
+    ci.setRandom();
+
     BenchTimer t;
-    BENCH(t, tries, rep, matlab_cplx_real(ar,ai,b,cr,ci));
-    std::cout << "\"matlab\" cpu    " << t.best(CPU_TIMER)/rep  << "s  \t" << (double(m)*n*p*rep*2/t.best(CPU_TIMER))*1e-9  <<  " GFLOPS \t(" << t.total(CPU_TIMER)  << "s)\n";
-    std::cout << "\"matlab\" real   " << t.best(REAL_TIMER)/rep << "s  \t" << (double(m)*n*p*rep*2/t.best(REAL_TIMER))*1e-9 <<  " GFLOPS \t(" << t.total(REAL_TIMER) << "s)\n";
+    BENCH(t, tries, rep, matlab_cplx_real(ar, ai, b, cr, ci));
+    std::cout << "\"matlab\" cpu    " << t.best(CPU_TIMER) / rep << "s  \t"
+              << (double(m) * n * p * rep * 2 / t.best(CPU_TIMER)) * 1e-9 << " GFLOPS \t(" << t.total(CPU_TIMER)
+              << "s)\n";
+    std::cout << "\"matlab\" real   " << t.best(REAL_TIMER) / rep << "s  \t"
+              << (double(m) * n * p * rep * 2 / t.best(REAL_TIMER)) * 1e-9 << " GFLOPS \t(" << t.total(REAL_TIMER)
+              << "s)\n";
   }
-  #endif
+#endif
 
   return 0;
 }
-
diff --git a/bench/bench_move_semantics.cpp b/bench/bench_move_semantics.cpp
index 323d804..8b7341a 100644
--- a/bench/bench_move_semantics.cpp
+++ b/bench/bench_move_semantics.cpp
@@ -16,23 +16,20 @@
 #include <utility>
 
 template <typename MatrixType>
-void copy_matrix(MatrixType& m)
-{
+void copy_matrix(MatrixType& m) {
   MatrixType tmp(m);
   m = tmp;
 }
 
 template <typename MatrixType>
-void move_matrix(MatrixType&& m)
-{
+void move_matrix(MatrixType&& m) {
   MatrixType tmp(std::move(m));
   m = std::move(tmp);
 }
 
-template<typename Scalar>
-void bench(const std::string& label)
-{
-  using MatrixType = Eigen::Matrix<Eigen::MovableScalar<Scalar>,1,10>;
+template <typename Scalar>
+void bench(const std::string& label) {
+  using MatrixType = Eigen::Matrix<Eigen::MovableScalar<Scalar>, 1, 10>;
   Eigen::BenchTimer t;
 
   int tries = 10;
@@ -42,16 +39,14 @@
   MatrixType dest;
 
   BENCH(t, tries, rep, copy_matrix(data));
-  std::cout << label << " copy semantics: " << 1e3*t.best(Eigen::CPU_TIMER) << " ms" << std::endl;
+  std::cout << label << " copy semantics: " << 1e3 * t.best(Eigen::CPU_TIMER) << " ms" << std::endl;
 
   BENCH(t, tries, rep, move_matrix(std::move(data)));
-  std::cout << label << " move semantics: " << 1e3*t.best(Eigen::CPU_TIMER) << " ms" << std::endl;
+  std::cout << label << " move semantics: " << 1e3 * t.best(Eigen::CPU_TIMER) << " ms" << std::endl;
 }
 
-int main()
-{
+int main() {
   bench<float>("float");
   bench<double>("double");
   return 0;
 }
-
diff --git a/bench/bench_norm.cpp b/bench/bench_norm.cpp
index 592f25d..fb53b85 100644
--- a/bench/bench_norm.cpp
+++ b/bench/bench_norm.cpp
@@ -5,79 +5,64 @@
 using namespace Eigen;
 using namespace std;
 
-template<typename T>
-EIGEN_DONT_INLINE typename T::Scalar sqsumNorm(T& v)
-{
+template <typename T>
+EIGEN_DONT_INLINE typename T::Scalar sqsumNorm(T& v) {
   return v.norm();
 }
 
-template<typename T>
-EIGEN_DONT_INLINE typename T::Scalar stableNorm(T& v)
-{
+template <typename T>
+EIGEN_DONT_INLINE typename T::Scalar stableNorm(T& v) {
   return v.stableNorm();
 }
 
-template<typename T>
-EIGEN_DONT_INLINE typename T::Scalar hypotNorm(T& v)
-{
+template <typename T>
+EIGEN_DONT_INLINE typename T::Scalar hypotNorm(T& v) {
   return v.hypotNorm();
 }
 
-template<typename T>
-EIGEN_DONT_INLINE typename T::Scalar blueNorm(T& v)
-{
+template <typename T>
+EIGEN_DONT_INLINE typename T::Scalar blueNorm(T& v) {
   return v.blueNorm();
 }
 
-template<typename T>
-EIGEN_DONT_INLINE typename T::Scalar lapackNorm(T& v)
-{
+template <typename T>
+EIGEN_DONT_INLINE typename T::Scalar lapackNorm(T& v) {
   typedef typename T::Scalar Scalar;
   int n = v.size();
   Scalar scale = 0;
   Scalar ssq = 1;
-  for (int i=0;i<n;++i)
-  {
+  for (int i = 0; i < n; ++i) {
     Scalar ax = std::abs(v.coeff(i));
-    if (scale >= ax)
-    {
-      ssq += numext::abs2(ax/scale);
-    }
-    else
-    {
-      ssq = Scalar(1) + ssq * numext::abs2(scale/ax);
+    if (scale >= ax) {
+      ssq += numext::abs2(ax / scale);
+    } else {
+      ssq = Scalar(1) + ssq * numext::abs2(scale / ax);
       scale = ax;
     }
   }
   return scale * std::sqrt(ssq);
 }
 
-template<typename T>
-EIGEN_DONT_INLINE typename T::Scalar twopassNorm(T& v)
-{
+template <typename T>
+EIGEN_DONT_INLINE typename T::Scalar twopassNorm(T& v) {
   typedef typename T::Scalar Scalar;
   Scalar s = v.array().abs().maxCoeff();
-  return s*(v/s).norm();
+  return s * (v / s).norm();
 }
 
-template<typename T>
-EIGEN_DONT_INLINE typename T::Scalar bl2passNorm(T& v)
-{
+template <typename T>
+EIGEN_DONT_INLINE typename T::Scalar bl2passNorm(T& v) {
   return v.stableNorm();
 }
 
-template<typename T>
-EIGEN_DONT_INLINE typename T::Scalar divacNorm(T& v)
-{
-  int n =v.size() / 2;
-  for (int i=0;i<n;++i)
-    v(i) = v(2*i)*v(2*i) + v(2*i+1)*v(2*i+1);
-  n = n/2;
-  while (n>0)
-  {
-    for (int i=0;i<n;++i)
-      v(i) = v(2*i) + v(2*i+1);
-    n = n/2;
+template <typename T>
+EIGEN_DONT_INLINE typename T::Scalar divacNorm(T& v) {
+  int n = v.size() / 2;
+  for (int i = 0; i < n; ++i) v(i) = v(2 * i) * v(2 * i) + v(2 * i + 1) * v(2 * i + 1);
+  n = n / 2;
+  while (n > 0) {
+    for (int i = 0; i < n; ++i) v(i) = v(2 * i) + v(2 * i + 1);
+    n = n / 2;
   }
   return std::sqrt(v(0));
 }
@@ -85,61 +70,61 @@
 namespace Eigen {
 namespace internal {
 #ifdef EIGEN_VECTORIZE
-Packet4f plt(const Packet4f& a, Packet4f& b) { return _mm_cmplt_ps(a,b); }
-Packet2d plt(const Packet2d& a, Packet2d& b) { return _mm_cmplt_pd(a,b); }
+Packet4f plt(const Packet4f& a, Packet4f& b) { return _mm_cmplt_ps(a, b); }
+Packet2d plt(const Packet2d& a, Packet2d& b) { return _mm_cmplt_pd(a, b); }
 
-Packet4f pandnot(const Packet4f& a, Packet4f& b) { return _mm_andnot_ps(a,b); }
-Packet2d pandnot(const Packet2d& a, Packet2d& b) { return _mm_andnot_pd(a,b); }
+Packet4f pandnot(const Packet4f& a, Packet4f& b) { return _mm_andnot_ps(a, b); }
+Packet2d pandnot(const Packet2d& a, Packet2d& b) { return _mm_andnot_pd(a, b); }
 #endif
-}
-}
+}  // namespace internal
+}  // namespace Eigen
 
-template<typename T>
-EIGEN_DONT_INLINE typename T::Scalar pblueNorm(const T& v)
-{
-  #ifndef EIGEN_VECTORIZE
+template <typename T>
+EIGEN_DONT_INLINE typename T::Scalar pblueNorm(const T& v) {
+#ifndef EIGEN_VECTORIZE
   return v.blueNorm();
-  #else
+#else
   typedef typename T::Scalar Scalar;
 
   static int nmax = 0;
   static Scalar b1, b2, s1m, s2m, overfl, rbig, relerr;
   int n;
 
-  if(nmax <= 0)
-  {
+  if (nmax <= 0) {
     int nbig, ibeta, it, iemin, iemax, iexp;
     Scalar abig, eps;
 
-    nbig  = NumTraits<int>::highest();          // largest integer
-    ibeta = std::numeric_limits<Scalar>::radix; // NumTraits<Scalar>::Base;                    // base for floating-point numbers
-    it    = NumTraits<Scalar>::digits();        // NumTraits<Scalar>::Mantissa;                // number of base-beta digits in mantissa
+    nbig = NumTraits<int>::highest();            // largest integer
+    ibeta = std::numeric_limits<Scalar>::radix;  // NumTraits<Scalar>::Base;                    // base for
+                                                 // floating-point numbers
+    it = NumTraits<Scalar>::digits();  // NumTraits<Scalar>::Mantissa;                // number of base-beta digits in
+                                       // mantissa
     iemin = NumTraits<Scalar>::min_exponent();  // minimum exponent
     iemax = NumTraits<Scalar>::max_exponent();  // maximum exponent
-    rbig  = NumTraits<Scalar>::highest();       // largest floating-point number
+    rbig = NumTraits<Scalar>::highest();        // largest floating-point number
 
     // Check the basic machine-dependent constants.
-    if(iemin > 1 - 2*it || 1+it>iemax || (it==2 && ibeta<5)
-      || (it<=4 && ibeta <= 3 ) || it<2)
-    {
+    if (iemin > 1 - 2 * it || 1 + it > iemax || (it == 2 && ibeta < 5) || (it <= 4 && ibeta <= 3) || it < 2) {
       eigen_assert(false && "the algorithm cannot be guaranteed on this computer");
     }
-    iexp  = -((1-iemin)/2);
-    b1    = std::pow(ibeta, iexp);  // lower boundary of midrange
-    iexp  = (iemax + 1 - it)/2;
-    b2    = std::pow(ibeta,iexp);   // upper boundary of midrange
+    iexp = -((1 - iemin) / 2);
+    b1 = std::pow(ibeta, iexp);  // lower boundary of midrange
+    iexp = (iemax + 1 - it) / 2;
+    b2 = std::pow(ibeta, iexp);  // upper boundary of midrange
 
-    iexp  = (2-iemin)/2;
-    s1m   = std::pow(ibeta,iexp);   // scaling factor for lower range
-    iexp  = - ((iemax+it)/2);
-    s2m   = std::pow(ibeta,iexp);   // scaling factor for upper range
+    iexp = (2 - iemin) / 2;
+    s1m = std::pow(ibeta, iexp);  // scaling factor for lower range
+    iexp = -((iemax + it) / 2);
+    s2m = std::pow(ibeta, iexp);  // scaling factor for upper range
 
-    overfl  = rbig*s2m;          // overflow boundary for abig
-    eps     = std::pow(ibeta, 1-it);
-    relerr  = std::sqrt(eps);      // tolerance for neglecting asml
-    abig    = 1.0/eps - 1.0;
-    if (Scalar(nbig)>abig)  nmax = abig;  // largest safe n
-    else                    nmax = nbig;
+    overfl = rbig * s2m;  // overflow boundary for abig
+    eps = std::pow(ibeta, 1 - it);
+    relerr = std::sqrt(eps);  // tolerance for neglecting asml
+    abig = 1.0 / eps - 1.0;
+    if (Scalar(nbig) > abig)
+      nmax = abig;  // largest safe n
+    else
+      nmax = nbig;
   }
 
   typedef typename internal::packet_traits<Scalar>::type Packet;
@@ -149,108 +134,103 @@
   Packet pabig = internal::pset1<Packet>(Scalar(0));
   Packet ps2m = internal::pset1<Packet>(s2m);
   Packet ps1m = internal::pset1<Packet>(s1m);
-  Packet pb2  = internal::pset1<Packet>(b2);
-  Packet pb1  = internal::pset1<Packet>(b1);
-  for(int j=0; j<v.size(); j+=ps)
-  {
+  Packet pb2 = internal::pset1<Packet>(b2);
+  Packet pb1 = internal::pset1<Packet>(b1);
+  for (int j = 0; j < v.size(); j += ps) {
     Packet ax = internal::pabs(v.template packet<Aligned>(j));
-    Packet ax_s2m = internal::pmul(ax,ps2m);
-    Packet ax_s1m = internal::pmul(ax,ps1m);
-    Packet maskBig = internal::plt(pb2,ax);
-    Packet maskSml = internal::plt(ax,pb1);
+    Packet ax_s2m = internal::pmul(ax, ps2m);
+    Packet ax_s1m = internal::pmul(ax, ps1m);
+    Packet maskBig = internal::plt(pb2, ax);
+    Packet maskSml = internal::plt(ax, pb1);
 
-//     Packet maskMed = internal::pand(maskSml,maskBig);
-//     Packet scale = internal::pset1(Scalar(0));
-//     scale = internal::por(scale, internal::pand(maskBig,ps2m));
-//     scale = internal::por(scale, internal::pand(maskSml,ps1m));
-//     scale = internal::por(scale, internal::pandnot(internal::pset1(Scalar(1)),maskMed));
-//     ax = internal::pmul(ax,scale);
-//     ax = internal::pmul(ax,ax);
-//     pabig = internal::padd(pabig, internal::pand(maskBig, ax));
-//     pasml = internal::padd(pasml, internal::pand(maskSml, ax));
-//     pamed = internal::padd(pamed, internal::pandnot(ax,maskMed));
+    //     Packet maskMed = internal::pand(maskSml,maskBig);
+    //     Packet scale = internal::pset1(Scalar(0));
+    //     scale = internal::por(scale, internal::pand(maskBig,ps2m));
+    //     scale = internal::por(scale, internal::pand(maskSml,ps1m));
+    //     scale = internal::por(scale, internal::pandnot(internal::pset1(Scalar(1)),maskMed));
+    //     ax = internal::pmul(ax,scale);
+    //     ax = internal::pmul(ax,ax);
+    //     pabig = internal::padd(pabig, internal::pand(maskBig, ax));
+    //     pasml = internal::padd(pasml, internal::pand(maskSml, ax));
+    //     pamed = internal::padd(pamed, internal::pandnot(ax,maskMed));
 
-
-    pabig = internal::padd(pabig, internal::pand(maskBig, internal::pmul(ax_s2m,ax_s2m)));
-    pasml = internal::padd(pasml, internal::pand(maskSml, internal::pmul(ax_s1m,ax_s1m)));
-    pamed = internal::padd(pamed, internal::pandnot(internal::pmul(ax,ax),internal::pand(maskSml,maskBig)));
+    pabig = internal::padd(pabig, internal::pand(maskBig, internal::pmul(ax_s2m, ax_s2m)));
+    pasml = internal::padd(pasml, internal::pand(maskSml, internal::pmul(ax_s1m, ax_s1m)));
+    pamed = internal::padd(pamed, internal::pandnot(internal::pmul(ax, ax), internal::pand(maskSml, maskBig)));
   }
   Scalar abig = internal::predux(pabig);
   Scalar asml = internal::predux(pasml);
   Scalar amed = internal::predux(pamed);
-  if(abig > Scalar(0))
-  {
+  if (abig > Scalar(0)) {
     abig = std::sqrt(abig);
-    if(abig > overfl)
-    {
+    if (abig > overfl) {
       eigen_assert(false && "overflow");
       return rbig;
     }
-    if(amed > Scalar(0))
-    {
-      abig = abig/s2m;
+    if (amed > Scalar(0)) {
+      abig = abig / s2m;
       amed = std::sqrt(amed);
-    }
-    else
-    {
-      return abig/s2m;
+    } else {
+      return abig / s2m;
     }
 
-  }
-  else if(asml > Scalar(0))
-  {
-    if (amed > Scalar(0))
-    {
+  } else if (asml > Scalar(0)) {
+    if (amed > Scalar(0)) {
       abig = std::sqrt(amed);
       amed = std::sqrt(asml) / s1m;
+    } else {
+      return std::sqrt(asml) / s1m;
     }
-    else
-    {
-      return std::sqrt(asml)/s1m;
-    }
-  }
-  else
-  {
+  } else {
     return std::sqrt(amed);
   }
   asml = std::min(abig, amed);
   abig = std::max(abig, amed);
-  if(asml <= abig*relerr)
+  if (asml <= abig * relerr)
     return abig;
   else
-    return abig * std::sqrt(Scalar(1) + numext::abs2(asml/abig));
-  #endif
+    return abig * std::sqrt(Scalar(1) + numext::abs2(asml / abig));
+#endif
 }
 
-#define BENCH_PERF(NRM) { \
-  float af = 0; double ad = 0; std::complex<float> ac = 0; \
-  Eigen::BenchTimer tf, td, tcf; tf.reset(); td.reset(); tcf.reset();\
-  for (int k=0; k<tries; ++k) { \
-    tf.start(); \
-    for (int i=0; i<iters; ++i) { af += NRM(vf); } \
-    tf.stop(); \
-  } \
-  for (int k=0; k<tries; ++k) { \
-    td.start(); \
-    for (int i=0; i<iters; ++i) { ad += NRM(vd); } \
-    td.stop(); \
-  } \
-  /*for (int k=0; k<std::max(1,tries/3); ++k) { \
-    tcf.start(); \
-    for (int i=0; i<iters; ++i) { ac += NRM(vcf); } \
-    tcf.stop(); \
-  } */\
-  std::cout << #NRM << "\t" << tf.value() << "   " << td.value() <<  "    " << tcf.value() << "\n"; \
-}
+#define BENCH_PERF(NRM)                                                                              \
+  {                                                                                                  \
+    float af = 0;                                                                                    \
+    double ad = 0;                                                                                   \
+    std::complex<float> ac = 0;                                                                      \
+    Eigen::BenchTimer tf, td, tcf;                                                                   \
+    tf.reset();                                                                                      \
+    td.reset();                                                                                      \
+    tcf.reset();                                                                                     \
+    for (int k = 0; k < tries; ++k) {                                                                \
+      tf.start();                                                                                    \
+      for (int i = 0; i < iters; ++i) {                                                              \
+        af += NRM(vf);                                                                               \
+      }                                                                                              \
+      tf.stop();                                                                                     \
+    }                                                                                                \
+    for (int k = 0; k < tries; ++k) {                                                                \
+      td.start();                                                                                    \
+      for (int i = 0; i < iters; ++i) {                                                              \
+        ad += NRM(vd);                                                                               \
+      }                                                                                              \
+      td.stop();                                                                                     \
+    }                                                                                                \
+    /*for (int k=0; k<std::max(1,tries/3); ++k) {                                                    \
+      tcf.start();                                                                                   \
+      for (int i=0; i<iters; ++i) { ac += NRM(vcf); }                                                \
+      tcf.stop();                                                                                    \
+    } */                                                                                             \
+    std::cout << #NRM << "\t" << tf.value() << "   " << td.value() << "    " << tcf.value() << "\n"; \
+  }
 
-void check_accuracy(double basef, double based, int s)
-{
+void check_accuracy(double basef, double based, int s) {
   double yf = basef * std::abs(internal::random<double>());
   double yd = based * std::abs(internal::random<double>());
   VectorXf vf = VectorXf::Ones(s) * yf;
   VectorXd vd = VectorXd::Ones(s) * yd;
 
-  std::cout << "reference\t" << std::sqrt(double(s))*yf << "\t" << std::sqrt(double(s))*yd << "\n";
+  std::cout << "reference\t" << std::sqrt(double(s)) * yf << "\t" << std::sqrt(double(s)) * yd << "\n";
   std::cout << "sqsumNorm\t" << sqsumNorm(vf) << "\t" << sqsumNorm(vd) << "\n";
   std::cout << "hypotNorm\t" << hypotNorm(vf) << "\t" << hypotNorm(vd) << "\n";
   std::cout << "blueNorm\t" << blueNorm(vf) << "\t" << blueNorm(vd) << "\n";
@@ -260,34 +240,38 @@
   std::cout << "bl2passNorm\t" << bl2passNorm(vf) << "\t" << bl2passNorm(vd) << "\n";
 }
 
-void check_accuracy_var(int ef0, int ef1, int ed0, int ed1, int s)
-{
+void check_accuracy_var(int ef0, int ef1, int ed0, int ed1, int s) {
   VectorXf vf(s);
   VectorXd vd(s);
-  for (int i=0; i<s; ++i)
-  {
-    vf[i] = std::abs(internal::random<double>()) * std::pow(double(10), internal::random<int>(ef0,ef1));
-    vd[i] = std::abs(internal::random<double>()) * std::pow(double(10), internal::random<int>(ed0,ed1));
+  for (int i = 0; i < s; ++i) {
+    vf[i] = std::abs(internal::random<double>()) * std::pow(double(10), internal::random<int>(ef0, ef1));
+    vd[i] = std::abs(internal::random<double>()) * std::pow(double(10), internal::random<int>(ed0, ed1));
   }
 
-  //std::cout << "reference\t" << internal::sqrt(double(s))*yf << "\t" << internal::sqrt(double(s))*yd << "\n";
-  std::cout << "sqsumNorm\t"  << sqsumNorm(vf)  << "\t" << sqsumNorm(vd)  << "\t" << sqsumNorm(vf.cast<long double>()) << "\t" << sqsumNorm(vd.cast<long double>()) << "\n";
-  std::cout << "hypotNorm\t"  << hypotNorm(vf)  << "\t" << hypotNorm(vd)  << "\t" << hypotNorm(vf.cast<long double>()) << "\t" << hypotNorm(vd.cast<long double>()) << "\n";
-  std::cout << "blueNorm\t"   << blueNorm(vf)   << "\t" << blueNorm(vd)   << "\t" << blueNorm(vf.cast<long double>()) << "\t" << blueNorm(vd.cast<long double>()) << "\n";
-  std::cout << "pblueNorm\t"  << pblueNorm(vf)  << "\t" << pblueNorm(vd)  << "\t" << blueNorm(vf.cast<long double>()) << "\t" << blueNorm(vd.cast<long double>()) << "\n";
-  std::cout << "lapackNorm\t" << lapackNorm(vf) << "\t" << lapackNorm(vd) << "\t" << lapackNorm(vf.cast<long double>()) << "\t" << lapackNorm(vd.cast<long double>()) << "\n";
-  std::cout << "twopassNorm\t" << twopassNorm(vf) << "\t" << twopassNorm(vd) << "\t" << twopassNorm(vf.cast<long double>()) << "\t" << twopassNorm(vd.cast<long double>()) << "\n";
-//   std::cout << "bl2passNorm\t" << bl2passNorm(vf) << "\t" << bl2passNorm(vd) << "\t" << bl2passNorm(vf.cast<long double>()) << "\t" << bl2passNorm(vd.cast<long double>()) << "\n";
+  // std::cout << "reference\t" << internal::sqrt(double(s))*yf << "\t" << internal::sqrt(double(s))*yd << "\n";
+  std::cout << "sqsumNorm\t" << sqsumNorm(vf) << "\t" << sqsumNorm(vd) << "\t" << sqsumNorm(vf.cast<long double>())
+            << "\t" << sqsumNorm(vd.cast<long double>()) << "\n";
+  std::cout << "hypotNorm\t" << hypotNorm(vf) << "\t" << hypotNorm(vd) << "\t" << hypotNorm(vf.cast<long double>())
+            << "\t" << hypotNorm(vd.cast<long double>()) << "\n";
+  std::cout << "blueNorm\t" << blueNorm(vf) << "\t" << blueNorm(vd) << "\t" << blueNorm(vf.cast<long double>()) << "\t"
+            << blueNorm(vd.cast<long double>()) << "\n";
+  std::cout << "pblueNorm\t" << pblueNorm(vf) << "\t" << pblueNorm(vd) << "\t" << blueNorm(vf.cast<long double>())
+            << "\t" << blueNorm(vd.cast<long double>()) << "\n";
+  std::cout << "lapackNorm\t" << lapackNorm(vf) << "\t" << lapackNorm(vd) << "\t" << lapackNorm(vf.cast<long double>())
+            << "\t" << lapackNorm(vd.cast<long double>()) << "\n";
+  std::cout << "twopassNorm\t" << twopassNorm(vf) << "\t" << twopassNorm(vd) << "\t"
+            << twopassNorm(vf.cast<long double>()) << "\t" << twopassNorm(vd.cast<long double>()) << "\n";
+  //   std::cout << "bl2passNorm\t" << bl2passNorm(vf) << "\t" << bl2passNorm(vd) << "\t" << bl2passNorm(vf.cast<long
+  //   double>()) << "\t" << bl2passNorm(vd.cast<long double>()) << "\n";
 }
 
-int main(int argc, char** argv)
-{
+int main(int argc, char** argv) {
   int tries = 10;
   int iters = 100000;
   double y = 1.1345743233455785456788e12 * internal::random<double>();
   VectorXf v = VectorXf::Ones(1024) * y;
 
-// return 0;
+  // return 0;
   int s = 10000;
   double basef_ok = 1.1345743233455785456788e15;
   double based_ok = 1.1345743233455785456788e95;
@@ -310,22 +294,20 @@
   check_accuracy(basef_over, based_over, s);
 
   std::cerr << "\nVarying (over):\n";
-  for (int k=0; k<1; ++k)
-  {
-    check_accuracy_var(20,27,190,302,s);
+  for (int k = 0; k < 1; ++k) {
+    check_accuracy_var(20, 27, 190, 302, s);
     std::cout << "\n";
   }
 
   std::cerr << "\nVarying (under):\n";
-  for (int k=0; k<1; ++k)
-  {
-    check_accuracy_var(-27,20,-302,-190,s);
+  for (int k = 0; k < 1; ++k) {
+    check_accuracy_var(-27, 20, -302, -190, s);
     std::cout << "\n";
   }
 
   y = 1;
   std::cout.precision(4);
-  int s1 = 1024*1024*32;
+  int s1 = 1024 * 1024 * 32;
   std::cerr << "Performance (out of cache, " << s1 << "):\n";
   {
     int iters = 1;
diff --git a/bench/bench_reverse.cpp b/bench/bench_reverse.cpp
index 1e69ca1..bf24982 100644
--- a/bench/bench_reverse.cpp
+++ b/bench/bench_reverse.cpp
@@ -15,70 +15,62 @@
 typedef double Scalar;
 
 template <typename MatrixType>
-__attribute__ ((noinline)) void bench_reverse(const MatrixType& m)
-{
+__attribute__((noinline)) void bench_reverse(const MatrixType& m) {
   int rows = m.rows();
   int cols = m.cols();
   int size = m.size();
 
-  int repeats = (REPEAT*1000)/size;
-  MatrixType a = MatrixType::Random(rows,cols);
-  MatrixType b = MatrixType::Random(rows,cols);
+  int repeats = (REPEAT * 1000) / size;
+  MatrixType a = MatrixType::Random(rows, cols);
+  MatrixType b = MatrixType::Random(rows, cols);
 
   BenchTimer timerB, timerH, timerV;
 
   Scalar acc = 0;
-  int r = internal::random<int>(0,rows-1);
-  int c = internal::random<int>(0,cols-1);
-  for (int t=0; t<TRIES; ++t)
-  {
+  int r = internal::random<int>(0, rows - 1);
+  int c = internal::random<int>(0, cols - 1);
+  for (int t = 0; t < TRIES; ++t) {
     timerB.start();
-    for (int k=0; k<repeats; ++k)
-    {
+    for (int k = 0; k < repeats; ++k) {
       asm("#begin foo");
       b = a.reverse();
       asm("#end foo");
-      acc += b.coeff(r,c);
+      acc += b.coeff(r, c);
     }
     timerB.stop();
   }
 
-  if (MatrixType::RowsAtCompileTime==Dynamic)
+  if (MatrixType::RowsAtCompileTime == Dynamic)
     std::cout << "dyn   ";
   else
     std::cout << "fixed ";
-  std::cout << rows << " x " << cols << " \t"
-            << (timerB.value() * REPEAT) / repeats << "s "
-            << "(" << 1e-6 * size*repeats/timerB.value() << " MFLOPS)\t";
+  std::cout << rows << " x " << cols << " \t" << (timerB.value() * REPEAT) / repeats << "s "
+            << "(" << 1e-6 * size * repeats / timerB.value() << " MFLOPS)\t";
 
   std::cout << "\n";
   // make sure the compiler does not optimize too much
-  if (acc==123)
-    std::cout << acc;
+  if (acc == 123) std::cout << acc;
 }
 
-int main(int argc, char* argv[])
-{
-  const int dynsizes[] = {4,6,8,16,24,32,49,64,128,256,512,900,0};
+int main(int argc, char* argv[]) {
+  const int dynsizes[] = {4, 6, 8, 16, 24, 32, 49, 64, 128, 256, 512, 900, 0};
   std::cout << "size            no sqrt                           standard";
-//   #ifdef BENCH_GSL
-//   std::cout << "       GSL (standard + double + ATLAS)  ";
-//   #endif
+  //   #ifdef BENCH_GSL
+  //   std::cout << "       GSL (standard + double + ATLAS)  ";
+  //   #endif
   std::cout << "\n";
-  for (uint i=0; dynsizes[i]>0; ++i)
-  {
-    bench_reverse(Matrix<Scalar,Dynamic,Dynamic>(dynsizes[i],dynsizes[i]));
-    bench_reverse(Matrix<Scalar,Dynamic,1>(dynsizes[i]*dynsizes[i]));
+  for (uint i = 0; dynsizes[i] > 0; ++i) {
+    bench_reverse(Matrix<Scalar, Dynamic, Dynamic>(dynsizes[i], dynsizes[i]));
+    bench_reverse(Matrix<Scalar, Dynamic, 1>(dynsizes[i] * dynsizes[i]));
   }
-//   bench_reverse(Matrix<Scalar,2,2>());
-//   bench_reverse(Matrix<Scalar,3,3>());
-//   bench_reverse(Matrix<Scalar,4,4>());
-//   bench_reverse(Matrix<Scalar,5,5>());
-//   bench_reverse(Matrix<Scalar,6,6>());
-//   bench_reverse(Matrix<Scalar,7,7>());
-//   bench_reverse(Matrix<Scalar,8,8>());
-//   bench_reverse(Matrix<Scalar,12,12>());
-//   bench_reverse(Matrix<Scalar,16,16>());
+  //   bench_reverse(Matrix<Scalar,2,2>());
+  //   bench_reverse(Matrix<Scalar,3,3>());
+  //   bench_reverse(Matrix<Scalar,4,4>());
+  //   bench_reverse(Matrix<Scalar,5,5>());
+  //   bench_reverse(Matrix<Scalar,6,6>());
+  //   bench_reverse(Matrix<Scalar,7,7>());
+  //   bench_reverse(Matrix<Scalar,8,8>());
+  //   bench_reverse(Matrix<Scalar,12,12>());
+  //   bench_reverse(Matrix<Scalar,16,16>());
   return 0;
 }
-
diff --git a/bench/bench_sum.cpp b/bench/bench_sum.cpp
index a3d925e..a5390b2 100644
--- a/bench/bench_sum.cpp
+++ b/bench/bench_sum.cpp
@@ -3,15 +3,13 @@
 using namespace Eigen;
 using namespace std;
 
-int main() 
-{
-  typedef Matrix<SCALAR,Eigen::Dynamic,1> Vec;
+int main() {
+  typedef Matrix<SCALAR, Eigen::Dynamic, 1> Vec;
   Vec v(SIZE);
   v.setZero();
   v[0] = 1;
   v[1] = 2;
-  for(int i = 0; i < 1000000; i++)
-  {
+  for (int i = 0; i < 1000000; i++) {
     v.coeffRef(0) += v.sum() * SCALAR(1e-20);
   }
   cout << v.sum() << endl;
diff --git a/bench/benchmark-blocking-sizes.cpp b/bench/benchmark-blocking-sizes.cpp
index 827be28..8c94a79 100644
--- a/bench/benchmark-blocking-sizes.cpp
+++ b/bench/benchmark-blocking-sizes.cpp
@@ -59,14 +59,12 @@
 static_assert(maxsize < (minsize << 16), "maxsize must be less than (minsize<<16)");
 
 // just a helper to store a triple of K,M,N sizes for matrix product
-struct size_triple_t
-{
+struct size_triple_t {
   size_t k, m, n;
   size_triple_t() : k(0), m(0), n(0) {}
   size_triple_t(size_t _k, size_t _m, size_t _n) : k(_k), m(_m), n(_n) {}
   size_triple_t(const size_triple_t& o) : k(o.k), m(o.m), n(o.n) {}
-  size_triple_t(uint16_t compact)
-  {
+  size_triple_t(uint16_t compact) {
     k = 1 << ((compact & 0xf00) >> 8);
     m = 1 << ((compact & 0x0f0) >> 4);
     n = 1 << ((compact & 0x00f) >> 0);
@@ -82,50 +80,35 @@
 // Convert between size tripes and a compact form fitting in 12 bits
 // where each size, which must be a POT, is encoded as its log2, on 4 bits
 // so the largest representable size is 2^15 == 32k  ... big enough.
-uint16_t compact_size_triple(size_t k, size_t m, size_t n)
-{
+uint16_t compact_size_triple(size_t k, size_t m, size_t n) {
   return (log2_pot(k) << 8) | (log2_pot(m) << 4) | log2_pot(n);
 }
 
-uint16_t compact_size_triple(const size_triple_t& t)
-{
-  return compact_size_triple(t.k, t.m, t.n);
-}
+uint16_t compact_size_triple(const size_triple_t& t) { return compact_size_triple(t.k, t.m, t.n); }
 
 // A single benchmark. Initially only contains benchmark params.
 // Then call run(), which stores the result in the gflops field.
-struct benchmark_t
-{
+struct benchmark_t {
   uint16_t compact_product_size;
   uint16_t compact_block_size;
   bool use_default_block_size;
   float gflops;
-  benchmark_t()
-    : compact_product_size(0)
-    , compact_block_size(0)
-    , use_default_block_size(false)
-    , gflops(0)
-  {
-  }
-  benchmark_t(size_t pk, size_t pm, size_t pn,
-              size_t bk, size_t bm, size_t bn)
-    : compact_product_size(compact_size_triple(pk, pm, pn))
-    , compact_block_size(compact_size_triple(bk, bm, bn))
-    , use_default_block_size(false)
-    , gflops(0)
-  {}
+  benchmark_t() : compact_product_size(0), compact_block_size(0), use_default_block_size(false), gflops(0) {}
+  benchmark_t(size_t pk, size_t pm, size_t pn, size_t bk, size_t bm, size_t bn)
+      : compact_product_size(compact_size_triple(pk, pm, pn)),
+        compact_block_size(compact_size_triple(bk, bm, bn)),
+        use_default_block_size(false),
+        gflops(0) {}
   benchmark_t(size_t pk, size_t pm, size_t pn)
-    : compact_product_size(compact_size_triple(pk, pm, pn))
-    , compact_block_size(0)
-    , use_default_block_size(true)
-    , gflops(0)
-  {}
+      : compact_product_size(compact_size_triple(pk, pm, pn)),
+        compact_block_size(0),
+        use_default_block_size(true),
+        gflops(0) {}
 
   void run();
 };
 
-ostream& operator<<(ostream& s, const benchmark_t& b)
-{
+ostream& operator<<(ostream& s, const benchmark_t& b) {
   s << hex << b.compact_product_size << dec;
   if (b.use_default_block_size) {
     size_triple_t t(b.compact_product_size);
@@ -141,17 +124,14 @@
 
 // We sort first by increasing benchmark parameters,
 // then by decreasing performance.
-bool operator<(const benchmark_t& b1, const benchmark_t& b2)
-{ 
+bool operator<(const benchmark_t& b1, const benchmark_t& b2) {
   return b1.compact_product_size < b2.compact_product_size ||
-           (b1.compact_product_size == b2.compact_product_size && (
-             (b1.compact_block_size < b2.compact_block_size || (
-               b1.compact_block_size == b2.compact_block_size &&
-                 b1.gflops > b2.gflops))));
+         (b1.compact_product_size == b2.compact_product_size &&
+          ((b1.compact_block_size < b2.compact_block_size ||
+            (b1.compact_block_size == b2.compact_block_size && b1.gflops > b2.gflops))));
 }
 
-void benchmark_t::run()
-{
+void benchmark_t::run() {
   size_triple_t productsizes(compact_product_size);
 
   if (use_default_block_size) {
@@ -168,26 +148,22 @@
   // set up the matrix pool
 
   const size_t combined_three_matrices_sizes =
-    sizeof(Scalar) *
-      (productsizes.k * productsizes.m +
-       productsizes.k * productsizes.n +
-       productsizes.m * productsizes.n);
+      sizeof(Scalar) *
+      (productsizes.k * productsizes.m + productsizes.k * productsizes.n + productsizes.m * productsizes.n);
 
   // 64 M is large enough that nobody has a cache bigger than that,
   // while still being small enough that everybody has this much RAM,
   // so conveniently we don't need to special-case platforms here.
   const size_t unlikely_large_cache_size = 64 << 20;
 
-  const size_t working_set_size =
-    min_working_set_size ? min_working_set_size : unlikely_large_cache_size;
+  const size_t working_set_size = min_working_set_size ? min_working_set_size : unlikely_large_cache_size;
 
-  const size_t matrix_pool_size =
-    1 + working_set_size / combined_three_matrices_sizes;
+  const size_t matrix_pool_size = 1 + working_set_size / combined_three_matrices_sizes;
 
-  MatrixType *lhs = new MatrixType[matrix_pool_size];
-  MatrixType *rhs = new MatrixType[matrix_pool_size];
-  MatrixType *dst = new MatrixType[matrix_pool_size];
-  
+  MatrixType* lhs = new MatrixType[matrix_pool_size];
+  MatrixType* rhs = new MatrixType[matrix_pool_size];
+  MatrixType* dst = new MatrixType[matrix_pool_size];
+
   for (size_t i = 0; i < matrix_pool_size; i++) {
     lhs[i] = MatrixType::Zero(productsizes.m, productsizes.k);
     rhs[i] = MatrixType::Zero(productsizes.k, productsizes.n);
@@ -200,7 +176,6 @@
   float time_per_iter = 0.0f;
   size_t matrix_index = 0;
   while (true) {
-
     double starttime = timer.getCpuTime();
     for (int i = 0; i < iters_at_a_time; i++) {
       dst[matrix_index].noalias() = lhs[matrix_index] * rhs[matrix_index];
@@ -228,8 +203,7 @@
   gflops = 2e-9 * productsizes.k * productsizes.m * productsizes.n / time_per_iter;
 }
 
-void print_cpuinfo()
-{
+void print_cpuinfo() {
 #ifdef __linux__
   cout << "contents of /proc/cpuinfo:" << endl;
   string line;
@@ -249,33 +223,30 @@
 }
 
 template <typename T>
-string type_name()
-{
+string type_name() {
   return "unknown";
 }
 
-template<>
-string type_name<float>()
-{
+template <>
+string type_name<float>() {
   return "float";
 }
 
-template<>
-string type_name<double>()
-{
+template <>
+string type_name<double>() {
   return "double";
 }
 
-struct action_t
-{
-  virtual const char* invokation_name() const { abort(); return nullptr; }
+struct action_t {
+  virtual const char* invokation_name() const {
+    abort();
+    return nullptr;
+  }
   virtual void run() const { abort(); }
   virtual ~action_t() {}
 };
 
-void show_usage_and_exit(int /*argc*/, char* argv[],
-                         const vector<unique_ptr<action_t>>& available_actions)
-{
+void show_usage_and_exit(int /*argc*/, char* argv[], const vector<unique_ptr<action_t>>& available_actions) {
   cerr << "usage: " << argv[0] << " <action> [options...]" << endl << endl;
   cerr << "available actions:" << endl << endl;
   for (auto it = available_actions.begin(); it != available_actions.end(); ++it) {
@@ -293,11 +264,10 @@
   cerr << "       avoid warm caches." << endl;
   exit(1);
 }
-     
-float measure_clock_speed()
-{
+
+float measure_clock_speed() {
   cerr << "Measuring clock speed...                              \r" << flush;
-          
+
   vector<float> all_gflops;
   for (int i = 0; i < 8; i++) {
     benchmark_t b(1024, 1024, 1024);
@@ -315,14 +285,12 @@
   return result;
 }
 
-struct human_duration_t
-{
+struct human_duration_t {
   int seconds;
   human_duration_t(int s) : seconds(s) {}
 };
 
-ostream& operator<<(ostream& s, const human_duration_t& d)
-{
+ostream& operator<<(ostream& s, const human_duration_t& d) {
   int remainder = d.seconds;
   if (remainder > 3600) {
     int hours = remainder / 3600;
@@ -342,8 +310,7 @@
 
 const char session_filename[] = "/data/local/tmp/benchmark-blocking-sizes-session.data";
 
-void serialize_benchmarks(const char* filename, const vector<benchmark_t>& benchmarks, size_t first_benchmark_to_run)
-{
+void serialize_benchmarks(const char* filename, const vector<benchmark_t>& benchmarks, size_t first_benchmark_to_run) {
   FILE* file = fopen(filename, "w");
   if (!file) {
     cerr << "Could not open file " << filename << " for writing." << endl;
@@ -358,8 +325,7 @@
   fclose(file);
 }
 
-bool deserialize_benchmarks(const char* filename, vector<benchmark_t>& benchmarks, size_t& first_benchmark_to_run)
-{
+bool deserialize_benchmarks(const char* filename, vector<benchmark_t>& benchmarks, size_t& first_benchmark_to_run) {
   FILE* file = fopen(filename, "r");
   if (!file) {
     return false;
@@ -382,11 +348,7 @@
   return true;
 }
 
-void try_run_some_benchmarks(
-  vector<benchmark_t>& benchmarks,
-  double time_start,
-  size_t& first_benchmark_to_run)
-{
+void try_run_some_benchmarks(vector<benchmark_t>& benchmarks, double time_start, size_t& first_benchmark_to_run) {
   if (first_benchmark_to_run == benchmarks.size()) {
     return;
   }
@@ -402,9 +364,7 @@
     time_now = timer.getRealTime();
 
     // We check clock speed every minute and at the end.
-    if (benchmark_index == benchmarks.size() ||
-        time_now > time_last_clock_speed_measurement + 60.0f)
-    {
+    if (benchmark_index == benchmarks.size() || time_now > time_last_clock_speed_measurement + 60.0f) {
       time_last_clock_speed_measurement = time_now;
 
       // Ensure that clock speed is as expected
@@ -425,8 +385,7 @@
         // which invalidates all benchmark results collected so far.
         // Either way, we better restart all over again now.
         if (benchmark_index) {
-          cerr << "Restarting at " << 100.0f * ratio_done
-               << " % because clock speed increased.          " << endl;
+          cerr << "Restarting at " << 100.0f * ratio_done << " % because clock speed increased.          " << endl;
         }
         max_clock_speed = current_clock_speed;
         first_benchmark_to_run = 0;
@@ -436,12 +395,9 @@
       bool rerun_last_tests = false;
 
       if (current_clock_speed < (1 - clock_speed_tolerance) * max_clock_speed) {
-        cerr << "Measurements completed so far: "
-             << 100.0f * ratio_done
-             << " %                             " << endl;
-        cerr << "Clock speed seems to be only "
-             << current_clock_speed/max_clock_speed
-             << " times what it used to be." << endl;
+        cerr << "Measurements completed so far: " << 100.0f * ratio_done << " %                             " << endl;
+        cerr << "Clock speed seems to be only " << current_clock_speed / max_clock_speed << " times what it used to be."
+             << endl;
 
         unsigned int seconds_to_sleep_if_lower_clock_speed = 1;
 
@@ -454,9 +410,8 @@
             exit(2);
           }
           rerun_last_tests = true;
-          cerr << "Sleeping "
-               << seconds_to_sleep_if_lower_clock_speed
-               << " s...                                   \r" << endl;
+          cerr << "Sleeping " << seconds_to_sleep_if_lower_clock_speed << " s...                                   \r"
+               << endl;
           sleep(seconds_to_sleep_if_lower_clock_speed);
           current_clock_speed = measure_clock_speed();
           seconds_to_sleep_if_lower_clock_speed *= 2;
@@ -464,8 +419,7 @@
       }
 
       if (rerun_last_tests) {
-        cerr << "Redoing the last "
-             << 100.0f * float(benchmark_index - first_benchmark_to_run) / benchmarks.size()
+        cerr << "Redoing the last " << 100.0f * float(benchmark_index - first_benchmark_to_run) / benchmarks.size()
              << " % because clock speed had been low.   " << endl;
         return;
       }
@@ -486,8 +440,7 @@
     // Display progress info on stderr
     if (time_now > time_last_progress_update + 1.0f) {
       time_last_progress_update = time_now;
-      cerr << "Measurements... " << 100.0f * ratio_done
-           << " %, ETA "
+      cerr << "Measurements... " << 100.0f * ratio_done << " %, ETA "
            << human_duration_t(float(time_now - time_start) * (1.0f - ratio_done) / ratio_done)
            << "                          \r" << flush;
     }
@@ -498,19 +451,15 @@
   }
 }
 
-void run_benchmarks(vector<benchmark_t>& benchmarks)
-{
+void run_benchmarks(vector<benchmark_t>& benchmarks) {
   size_t first_benchmark_to_run;
   vector<benchmark_t> deserialized_benchmarks;
   bool use_deserialized_benchmarks = false;
   if (deserialize_benchmarks(session_filename, deserialized_benchmarks, first_benchmark_to_run)) {
-    cerr << "Found serialized session with "
-         << 100.0f * first_benchmark_to_run / deserialized_benchmarks.size()
+    cerr << "Found serialized session with " << 100.0f * first_benchmark_to_run / deserialized_benchmarks.size()
          << " % already done" << endl;
-    if (deserialized_benchmarks.size() == benchmarks.size() &&
-        first_benchmark_to_run > 0 &&
-        first_benchmark_to_run < benchmarks.size())
-    {
+    if (deserialized_benchmarks.size() == benchmarks.size() && first_benchmark_to_run > 0 &&
+        first_benchmark_to_run < benchmarks.size()) {
       use_deserialized_benchmarks = true;
     }
   }
@@ -531,15 +480,13 @@
   for (int i = 0; i < 4; i++) {
     max_clock_speed = max(max_clock_speed, measure_clock_speed());
   }
-  
+
   double time_start = 0.0;
   while (first_benchmark_to_run < benchmarks.size()) {
     if (first_benchmark_to_run == 0) {
       time_start = timer.getRealTime();
     }
-    try_run_some_benchmarks(benchmarks,
-                            time_start,
-                            first_benchmark_to_run);
+    try_run_some_benchmarks(benchmarks, time_start, first_benchmark_to_run);
   }
 
   // Sort timings by increasing benchmark parameters, and decreasing gflops.
@@ -550,10 +497,8 @@
   // Collect best (i.e. now first) results for each parameter values.
   vector<benchmark_t> best_benchmarks;
   for (auto it = benchmarks.begin(); it != benchmarks.end(); ++it) {
-    if (best_benchmarks.empty() ||
-        best_benchmarks.back().compact_product_size != it->compact_product_size ||
-        best_benchmarks.back().compact_block_size != it->compact_block_size)
-    {
+    if (best_benchmarks.empty() || best_benchmarks.back().compact_product_size != it->compact_product_size ||
+        best_benchmarks.back().compact_block_size != it->compact_block_size) {
       best_benchmarks.push_back(*it);
     }
   }
@@ -562,11 +507,9 @@
   benchmarks = best_benchmarks;
 }
 
-struct measure_all_pot_sizes_action_t : action_t
-{
+struct measure_all_pot_sizes_action_t : action_t {
   virtual const char* invokation_name() const { return "all-pot-sizes"; }
-  virtual void run() const
-  {
+  virtual void run() const {
     vector<benchmark_t> benchmarks;
     for (int repetition = 0; repetition < measurement_repetitions; repetition++) {
       for (size_t ksize = minsize; ksize <= maxsize; ksize *= 2) {
@@ -593,11 +536,9 @@
   }
 };
 
-struct measure_default_sizes_action_t : action_t
-{
+struct measure_default_sizes_action_t : action_t {
   virtual const char* invokation_name() const { return "default-sizes"; }
-  virtual void run() const
-  {
+  virtual void run() const {
     vector<benchmark_t> benchmarks;
     for (int repetition = 0; repetition < measurement_repetitions; repetition++) {
       for (size_t ksize = minsize; ksize <= maxsize; ksize *= 2) {
@@ -618,8 +559,7 @@
   }
 };
 
-int main(int argc, char* argv[])
-{
+int main(int argc, char* argv[]) {
   double time_start = timer.getRealTime();
   cout.precision(4);
   cerr.precision(4);
@@ -647,7 +587,7 @@
   for (int i = 2; i < argc; i++) {
     if (argv[i] == strstr(argv[i], "--min-working-set-size=")) {
       const char* equals_sign = strchr(argv[i], '=');
-      min_working_set_size = strtoul(equals_sign+1, nullptr, 10);
+      min_working_set_size = strtoul(equals_sign + 1, nullptr, 10);
     } else {
       cerr << "unrecognized option: " << argv[i] << endl << endl;
       show_usage_and_exit(argc, argv, available_actions);
@@ -657,7 +597,7 @@
   print_cpuinfo();
 
   cout << "benchmark parameters:" << endl;
-  cout << "pointer size: " << 8*sizeof(void*) << " bits" << endl;
+  cout << "pointer size: " << 8 * sizeof(void*) << " bits" << endl;
   cout << "scalar type: " << type_name<Scalar>() << endl;
   cout << "packet size: " << internal::packet_traits<MatrixType::Scalar>::size << endl;
   cout << "minsize = " << minsize << endl;
diff --git a/bench/benchmark.cpp b/bench/benchmark.cpp
index c721b90..93e18b6 100644
--- a/bench/benchmark.cpp
+++ b/bench/benchmark.cpp
@@ -19,21 +19,18 @@
 #define SCALAR double
 #endif
 
-int main(int argc, char *argv[])
-{
-    Matrix<SCALAR,MATSIZE,MATSIZE> I = Matrix<SCALAR,MATSIZE,MATSIZE>::Ones();
-    Matrix<SCALAR,MATSIZE,MATSIZE> m;
-    for(int i = 0; i < MATSIZE; i++)
-        for(int j = 0; j < MATSIZE; j++)
-        {
-            m(i,j) = (i+MATSIZE*j);
-        }
-    asm("#begin");
-    for(int a = 0; a < REPEAT; a++)
-    {
-        m = Matrix<SCALAR,MATSIZE,MATSIZE>::Ones() + 0.00005 * (m + (m*m));
+int main(int argc, char *argv[]) {
+  Matrix<SCALAR, MATSIZE, MATSIZE> I = Matrix<SCALAR, MATSIZE, MATSIZE>::Ones();
+  Matrix<SCALAR, MATSIZE, MATSIZE> m;
+  for (int i = 0; i < MATSIZE; i++)
+    for (int j = 0; j < MATSIZE; j++) {
+      m(i, j) = (i + MATSIZE * j);
     }
-    asm("#end");
-    cout << m << endl;
-    return 0;
+  asm("#begin");
+  for (int a = 0; a < REPEAT; a++) {
+    m = Matrix<SCALAR, MATSIZE, MATSIZE>::Ones() + 0.00005 * (m + (m * m));
+  }
+  asm("#end");
+  cout << m << endl;
+  return 0;
 }
diff --git a/bench/benchmarkSlice.cpp b/bench/benchmarkSlice.cpp
index c5b89c5..584137b 100644
--- a/bench/benchmarkSlice.cpp
+++ b/bench/benchmarkSlice.cpp
@@ -15,23 +15,21 @@
 #define SCALAR float
 #endif
 
-int main(int argc, char *argv[])
-{
+int main(int argc, char *argv[]) {
   typedef Matrix<SCALAR, Eigen::Dynamic, Eigen::Dynamic> Mat;
   Mat m(100, 100);
   m.setRandom();
 
-  for(int a = 0; a < REPEAT; a++)
-  {
+  for (int a = 0; a < REPEAT; a++) {
     int r, c, nr, nc;
-    r = Eigen::internal::random<int>(0,10);
-    c = Eigen::internal::random<int>(0,10);
-    nr = Eigen::internal::random<int>(50,80);
-    nc = Eigen::internal::random<int>(50,80);
-    m.block(r,c,nr,nc) += Mat::Ones(nr,nc);
-    m.block(r,c,nr,nc) *= SCALAR(10);
-    m.block(r,c,nr,nc) -= Mat::constant(nr,nc,10);
-    m.block(r,c,nr,nc) /= SCALAR(10);
+    r = Eigen::internal::random<int>(0, 10);
+    c = Eigen::internal::random<int>(0, 10);
+    nr = Eigen::internal::random<int>(50, 80);
+    nc = Eigen::internal::random<int>(50, 80);
+    m.block(r, c, nr, nc) += Mat::Ones(nr, nc);
+    m.block(r, c, nr, nc) *= SCALAR(10);
+    m.block(r, c, nr, nc) -= Mat::constant(nr, nc, 10);
+    m.block(r, c, nr, nc) /= SCALAR(10);
   }
   cout << m[0] << endl;
   return 0;
diff --git a/bench/benchmarkX.cpp b/bench/benchmarkX.cpp
index 8e4b60c..eff9318 100644
--- a/bench/benchmarkX.cpp
+++ b/bench/benchmarkX.cpp
@@ -19,18 +19,16 @@
 #define REPEAT 100
 #endif
 
-int main(int argc, char *argv[])
-{
-	MATTYPE I = MATTYPE::Ones(MATSIZE,MATSIZE);
-	MATTYPE m(MATSIZE,MATSIZE);
-	for(int i = 0; i < MATSIZE; i++) for(int j = 0; j < MATSIZE; j++)
-	{
-		m(i,j) = (i+j+1)/(MATSIZE*MATSIZE);
-	}
-	for(int a = 0; a < REPEAT; a++)
-	{
-		m = I + 0.0001 * (m + m*m);
-	}
-	cout << m(0,0) << endl;
-	return 0;
+int main(int argc, char *argv[]) {
+  MATTYPE I = MATTYPE::Ones(MATSIZE, MATSIZE);
+  MATTYPE m(MATSIZE, MATSIZE);
+  for (int i = 0; i < MATSIZE; i++)
+    for (int j = 0; j < MATSIZE; j++) {
+      m(i, j) = (i + j + 1) / (MATSIZE * MATSIZE);
+    }
+  for (int a = 0; a < REPEAT; a++) {
+    m = I + 0.0001 * (m + m * m);
+  }
+  cout << m(0, 0) << endl;
+  return 0;
 }
diff --git a/bench/benchmarkXcwise.cpp b/bench/benchmarkXcwise.cpp
index 6243743..f0c4977 100644
--- a/bench/benchmarkXcwise.cpp
+++ b/bench/benchmarkXcwise.cpp
@@ -18,18 +18,15 @@
 #define REPEAT 1000
 #endif
 
-int main(int argc, char *argv[])
-{
-	VECTYPE I = VECTYPE::Ones(VECSIZE);
-	VECTYPE m(VECSIZE,1);
-	for(int i = 0; i < VECSIZE; i++)
-	{
-		m[i] = 0.1 * i/VECSIZE;
-	}
-	for(int a = 0; a < REPEAT; a++)
-	{
-		m = VECTYPE::Ones(VECSIZE) + 0.00005 * (m.cwise().square() + m/4);
-	}
-	cout << m[0] << endl;
-	return 0;
+int main(int argc, char *argv[]) {
+  VECTYPE I = VECTYPE::Ones(VECSIZE);
+  VECTYPE m(VECSIZE, 1);
+  for (int i = 0; i < VECSIZE; i++) {
+    m[i] = 0.1 * i / VECSIZE;
+  }
+  for (int a = 0; a < REPEAT; a++) {
+    m = VECTYPE::Ones(VECSIZE) + 0.00005 * (m.cwise().square() + m / 4);
+  }
+  cout << m[0] << endl;
+  return 0;
 }
diff --git a/bench/btl/actions/action_aat_product.hh b/bench/btl/actions/action_aat_product.hh
index aa5b35c..2de1740 100644
--- a/bench/btl/actions/action_aat_product.hh
+++ b/bench/btl/actions/action_aat_product.hh
@@ -28,101 +28,80 @@
 
 using namespace std;
 
-template<class Interface>
+template <class Interface>
 class Action_aat_product {
-
-public :
-
+ public:
   // Ctor
 
-  Action_aat_product( int size ):_size(size)
-  {
+  Action_aat_product(int size) : _size(size) {
     MESSAGE("Action_aat_product Ctor");
 
     // STL matrix and vector initialization
 
-    init_matrix<pseudo_random>(A_stl,_size);
-    init_matrix<null_function>(X_stl,_size);
-    init_matrix<null_function>(resu_stl,_size);
+    init_matrix<pseudo_random>(A_stl, _size);
+    init_matrix<null_function>(X_stl, _size);
+    init_matrix<null_function>(resu_stl, _size);
 
     // generic matrix and vector initialization
 
-    Interface::matrix_from_stl(A_ref,A_stl);
-    Interface::matrix_from_stl(X_ref,X_stl);
+    Interface::matrix_from_stl(A_ref, A_stl);
+    Interface::matrix_from_stl(X_ref, X_stl);
 
-    Interface::matrix_from_stl(A,A_stl);
-    Interface::matrix_from_stl(X,X_stl);
-
+    Interface::matrix_from_stl(A, A_stl);
+    Interface::matrix_from_stl(X, X_stl);
   }
 
   // invalidate copy ctor
 
-  Action_aat_product( const  Action_aat_product & )
-  {
+  Action_aat_product(const Action_aat_product&) {
     INFOS("illegal call to Action_aat_product Copy Ctor");
     exit(0);
   }
 
   // Dtor
 
-  ~Action_aat_product( void ){
-
+  ~Action_aat_product(void) {
     MESSAGE("Action_aat_product Dtor");
 
     // deallocation
 
-    Interface::free_matrix(A,_size);
-    Interface::free_matrix(X,_size);
+    Interface::free_matrix(A, _size);
+    Interface::free_matrix(X, _size);
 
-    Interface::free_matrix(A_ref,_size);
-    Interface::free_matrix(X_ref,_size);
-
+    Interface::free_matrix(A_ref, _size);
+    Interface::free_matrix(X_ref, _size);
   }
 
   // action name
 
-  static inline std::string name( void )
-  {
-    return "aat_"+Interface::name();
+  static inline std::string name(void) { return "aat_" + Interface::name(); }
+
+  double nb_op_base(void) { return double(_size) * double(_size) * double(_size); }
+
+  inline void initialize(void) {
+    Interface::copy_matrix(A_ref, A, _size);
+    Interface::copy_matrix(X_ref, X, _size);
   }
 
-  double nb_op_base( void ){
-    return double(_size)*double(_size)*double(_size);
-  }
+  inline void calculate(void) { Interface::aat_product(A, X, _size); }
 
-  inline void initialize( void ){
-
-    Interface::copy_matrix(A_ref,A,_size);
-    Interface::copy_matrix(X_ref,X,_size);
-
-  }
-
-  inline void calculate( void ) {
-
-      Interface::aat_product(A,X,_size);
-
-  }
-
-  void check_result( void ){
-    if (_size>128) return;
+  void check_result(void) {
+    if (_size > 128) return;
     // calculation check
 
-    Interface::matrix_to_stl(X,resu_stl);
+    Interface::matrix_to_stl(X, resu_stl);
 
-    STL_interface<typename Interface::real_type>::aat_product(A_stl,X_stl,_size);
+    STL_interface<typename Interface::real_type>::aat_product(A_stl, X_stl, _size);
 
-    typename Interface::real_type error=
-      STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl);
+    typename Interface::real_type error = STL_interface<typename Interface::real_type>::norm_diff(X_stl, resu_stl);
 
-    if (error>1.e-6){
+    if (error > 1.e-6) {
       INFOS("WRONG CALCULATION...residual=" << error);
       exit(1);
     }
-
   }
 
-private :
-
+ private:
   typename Interface::stl_matrix A_stl;
   typename Interface::stl_matrix X_stl;
   typename Interface::stl_matrix resu_stl;
@@ -133,13 +112,7 @@
   typename Interface::gene_matrix A;
   typename Interface::gene_matrix X;
 
-
   int _size;
-
 };
 
-
 #endif
-
-
-
diff --git a/bench/btl/actions/action_ata_product.hh b/bench/btl/actions/action_ata_product.hh
index 04364fe..0447ab3 100644
--- a/bench/btl/actions/action_ata_product.hh
+++ b/bench/btl/actions/action_ata_product.hh
@@ -28,101 +28,80 @@
 
 using namespace std;
 
-template<class Interface>
+template <class Interface>
 class Action_ata_product {
-
-public :
-
+ public:
   // Ctor
 
-  Action_ata_product( int size ):_size(size)
-  {
+  Action_ata_product(int size) : _size(size) {
     MESSAGE("Action_ata_product Ctor");
 
     // STL matrix and vector initialization
 
-    init_matrix<pseudo_random>(A_stl,_size);
-    init_matrix<null_function>(X_stl,_size);
-    init_matrix<null_function>(resu_stl,_size);
+    init_matrix<pseudo_random>(A_stl, _size);
+    init_matrix<null_function>(X_stl, _size);
+    init_matrix<null_function>(resu_stl, _size);
 
     // generic matrix and vector initialization
 
-    Interface::matrix_from_stl(A_ref,A_stl);
-    Interface::matrix_from_stl(X_ref,X_stl);
+    Interface::matrix_from_stl(A_ref, A_stl);
+    Interface::matrix_from_stl(X_ref, X_stl);
 
-    Interface::matrix_from_stl(A,A_stl);
-    Interface::matrix_from_stl(X,X_stl);
-
+    Interface::matrix_from_stl(A, A_stl);
+    Interface::matrix_from_stl(X, X_stl);
   }
 
   // invalidate copy ctor
 
-  Action_ata_product( const  Action_ata_product & )
-  {
+  Action_ata_product(const Action_ata_product&) {
     INFOS("illegal call to Action_ata_product Copy Ctor");
     exit(0);
   }
 
   // Dtor
 
-  ~Action_ata_product( void ){
-
+  ~Action_ata_product(void) {
     MESSAGE("Action_ata_product Dtor");
 
     // deallocation
 
-    Interface::free_matrix(A,_size);
-    Interface::free_matrix(X,_size);
+    Interface::free_matrix(A, _size);
+    Interface::free_matrix(X, _size);
 
-    Interface::free_matrix(A_ref,_size);
-    Interface::free_matrix(X_ref,_size);
-
+    Interface::free_matrix(A_ref, _size);
+    Interface::free_matrix(X_ref, _size);
   }
 
   // action name
 
-  static inline std::string name( void )
-  {
-    return "ata_"+Interface::name();
+  static inline std::string name(void) { return "ata_" + Interface::name(); }
+
+  double nb_op_base(void) { return 2.0 * _size * _size * _size; }
+
+  inline void initialize(void) {
+    Interface::copy_matrix(A_ref, A, _size);
+    Interface::copy_matrix(X_ref, X, _size);
   }
 
-  double nb_op_base( void ){
-    return 2.0*_size*_size*_size;
-  }
+  inline void calculate(void) { Interface::ata_product(A, X, _size); }
 
-  inline void initialize( void ){
-
-    Interface::copy_matrix(A_ref,A,_size);
-    Interface::copy_matrix(X_ref,X,_size);
-
-  }
-
-  inline void calculate( void ) {
-
-      Interface::ata_product(A,X,_size);
-
-  }
-
-  void check_result( void ){
-    if (_size>128) return;
+  void check_result(void) {
+    if (_size > 128) return;
     // calculation check
 
-    Interface::matrix_to_stl(X,resu_stl);
+    Interface::matrix_to_stl(X, resu_stl);
 
-    STL_interface<typename Interface::real_type>::ata_product(A_stl,X_stl,_size);
+    STL_interface<typename Interface::real_type>::ata_product(A_stl, X_stl, _size);
 
-    typename Interface::real_type error=
-      STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl);
+    typename Interface::real_type error = STL_interface<typename Interface::real_type>::norm_diff(X_stl, resu_stl);
 
-    if (error>1.e-6){
+    if (error > 1.e-6) {
       INFOS("WRONG CALCULATION...residual=" << error);
       exit(1);
     }
-
   }
 
-private :
-
+ private:
   typename Interface::stl_matrix A_stl;
   typename Interface::stl_matrix X_stl;
   typename Interface::stl_matrix resu_stl;
@@ -133,13 +112,7 @@
   typename Interface::gene_matrix A;
   typename Interface::gene_matrix X;
 
-
   int _size;
-
 };
 
-
 #endif
-
-
-
diff --git a/bench/btl/actions/action_atv_product.hh b/bench/btl/actions/action_atv_product.hh
index a823451..93c2e1c 100644
--- a/bench/btl/actions/action_atv_product.hh
+++ b/bench/btl/actions/action_atv_product.hh
@@ -28,87 +28,79 @@
 
 using namespace std;
 
-template<class Interface>
+template <class Interface>
 class Action_atv_product {
-
-public :
-
-  Action_atv_product( int size ) : _size(size)
-  {
+ public:
+  Action_atv_product(int size) : _size(size) {
     MESSAGE("Action_atv_product Ctor");
 
     // STL matrix and vector initialization
 
-    init_matrix<pseudo_random>(A_stl,_size);
-    init_vector<pseudo_random>(B_stl,_size);
-    init_vector<null_function>(X_stl,_size);
-    init_vector<null_function>(resu_stl,_size);
+    init_matrix<pseudo_random>(A_stl, _size);
+    init_vector<pseudo_random>(B_stl, _size);
+    init_vector<null_function>(X_stl, _size);
+    init_vector<null_function>(resu_stl, _size);
 
     // generic matrix and vector initialization
 
-    Interface::matrix_from_stl(A_ref,A_stl);
-    Interface::vector_from_stl(B_ref,B_stl);
-    Interface::vector_from_stl(X_ref,X_stl);
+    Interface::matrix_from_stl(A_ref, A_stl);
+    Interface::vector_from_stl(B_ref, B_stl);
+    Interface::vector_from_stl(X_ref, X_stl);
 
-    Interface::matrix_from_stl(A,A_stl);
-    Interface::vector_from_stl(B,B_stl);
-    Interface::vector_from_stl(X,X_stl);
+    Interface::matrix_from_stl(A, A_stl);
+    Interface::vector_from_stl(B, B_stl);
+    Interface::vector_from_stl(X, X_stl);
   }
 
   // invalidate copy ctor
-  Action_atv_product( const  Action_atv_product & )
-  {
+  Action_atv_product(const Action_atv_product&) {
     INFOS("illegal call to Action_atv_product Copy Ctor");
     exit(1);
   }
 
-  ~Action_atv_product( void )
-  {
+  ~Action_atv_product(void) {
     MESSAGE("Action_atv_product Dtor");
 
-    Interface::free_matrix(A,_size);
+    Interface::free_matrix(A, _size);
     Interface::free_vector(B);
     Interface::free_vector(X);
 
-    Interface::free_matrix(A_ref,_size);
+    Interface::free_matrix(A_ref, _size);
     Interface::free_vector(B_ref);
     Interface::free_vector(X_ref);
   }
 
   static inline std::string name() { return "atv_" + Interface::name(); }
 
-  double nb_op_base( void ) { return 2.0*_size*_size; }
+  double nb_op_base(void) { return 2.0 * _size * _size; }
 
-  inline void initialize( void ){
-    Interface::copy_matrix(A_ref,A,_size);
-    Interface::copy_vector(B_ref,B,_size);
-    Interface::copy_vector(X_ref,X,_size);
+  inline void initialize(void) {
+    Interface::copy_matrix(A_ref, A, _size);
+    Interface::copy_vector(B_ref, B, _size);
+    Interface::copy_vector(X_ref, X, _size);
   }
 
-  BTL_DONT_INLINE void calculate( void ) {
+  BTL_DONT_INLINE void calculate(void) {
     BTL_ASM_COMMENT("begin atv");
-    Interface::atv_product(A,B,X,_size);
+    Interface::atv_product(A, B, X, _size);
     BTL_ASM_COMMENT("end atv");
   }
 
-  void check_result( void )
-  {
-    if (_size>128) return;
-    Interface::vector_to_stl(X,resu_stl);
+  void check_result(void) {
+    if (_size > 128) return;
+    Interface::vector_to_stl(X, resu_stl);
 
-    STL_interface<typename Interface::real_type>::atv_product(A_stl,B_stl,X_stl,_size);
+    STL_interface<typename Interface::real_type>::atv_product(A_stl, B_stl, X_stl, _size);
 
-    typename Interface::real_type error=
-      STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl);
+    typename Interface::real_type error = STL_interface<typename Interface::real_type>::norm_diff(X_stl, resu_stl);
 
-    if (error>1.e-6){
+    if (error > 1.e-6) {
       INFOS("WRONG CALCULATION...residual=" << error);
       exit(1);
     }
   }
 
-private :
-
+ private:
   typename Interface::stl_matrix A_stl;
   typename Interface::stl_vector B_stl;
   typename Interface::stl_vector X_stl;
@@ -122,13 +114,7 @@
   typename Interface::gene_vector B;
   typename Interface::gene_vector X;
 
-
   int _size;
-
 };
 
-
 #endif
-
-
-
diff --git a/bench/btl/actions/action_axpby.hh b/bench/btl/actions/action_axpby.hh
index dadd0cc..e74cbd8 100644
--- a/bench/btl/actions/action_axpby.hh
+++ b/bench/btl/actions/action_axpby.hh
@@ -27,38 +27,34 @@
 
 using namespace std;
 
-template<class Interface>
+template <class Interface>
 class Action_axpby {
-
-public :
-
+ public:
   // Ctor
-  Action_axpby( int size ):_alpha(0.5),_beta(0.95),_size(size)
-  {
+  Action_axpby(int size) : _alpha(0.5), _beta(0.95), _size(size) {
     MESSAGE("Action_axpby Ctor");
 
     // STL vector initialization
-    init_vector<pseudo_random>(X_stl,_size);
-    init_vector<pseudo_random>(Y_stl,_size);
-    init_vector<null_function>(resu_stl,_size);
+    init_vector<pseudo_random>(X_stl, _size);
+    init_vector<pseudo_random>(Y_stl, _size);
+    init_vector<null_function>(resu_stl, _size);
 
     // generic matrix and vector initialization
-    Interface::vector_from_stl(X_ref,X_stl);
-    Interface::vector_from_stl(Y_ref,Y_stl);
+    Interface::vector_from_stl(X_ref, X_stl);
+    Interface::vector_from_stl(Y_ref, Y_stl);
 
-    Interface::vector_from_stl(X,X_stl);
-    Interface::vector_from_stl(Y,Y_stl);
+    Interface::vector_from_stl(X, X_stl);
+    Interface::vector_from_stl(Y, Y_stl);
   }
 
   // invalidate copy ctor
-  Action_axpby( const  Action_axpby & )
-  {
+  Action_axpby(const Action_axpby&) {
     INFOS("illegal call to Action_axpby Copy Ctor");
     exit(1);
   }
 
   // Dtor
-  ~Action_axpby( void ){
+  ~Action_axpby(void) {
     MESSAGE("Action_axpby Dtor");
 
     // deallocation
@@ -70,44 +66,37 @@
   }
 
   // action name
-  static inline std::string name( void )
-  {
-    return "axpby_"+Interface::name();
+  static inline std::string name(void) { return "axpby_" + Interface::name(); }
+
+  double nb_op_base(void) { return 3.0 * _size; }
+
+  inline void initialize(void) {
+    Interface::copy_vector(X_ref, X, _size);
+    Interface::copy_vector(Y_ref, Y, _size);
   }
 
-  double nb_op_base( void ){
-    return 3.0*_size;
-  }
-
-  inline void initialize( void ){
-    Interface::copy_vector(X_ref,X,_size);
-    Interface::copy_vector(Y_ref,Y,_size);
-  }
-
-  inline void calculate( void ) {
+  inline void calculate(void) {
     BTL_ASM_COMMENT("mybegin axpby");
-    Interface::axpby(_alpha,X,_beta,Y,_size);
+    Interface::axpby(_alpha, X, _beta, Y, _size);
     BTL_ASM_COMMENT("myend axpby");
   }
 
-  void check_result( void ){
-    if (_size>128) return;
+  void check_result(void) {
+    if (_size > 128) return;
     // calculation check
-    Interface::vector_to_stl(Y,resu_stl);
+    Interface::vector_to_stl(Y, resu_stl);
 
-    STL_interface<typename Interface::real_type>::axpby(_alpha,X_stl,_beta,Y_stl,_size);
+    STL_interface<typename Interface::real_type>::axpby(_alpha, X_stl, _beta, Y_stl, _size);
 
-    typename Interface::real_type error=
-      STL_interface<typename Interface::real_type>::norm_diff(Y_stl,resu_stl);
+    typename Interface::real_type error = STL_interface<typename Interface::real_type>::norm_diff(Y_stl, resu_stl);
 
-    if (error>1.e-6){
+    if (error > 1.e-6) {
       INFOS("WRONG CALCULATION...residual=" << error);
       exit(2);
     }
   }
 
-private :
-
+ private:
   typename Interface::stl_vector X_stl;
   typename Interface::stl_vector Y_stl;
   typename Interface::stl_vector resu_stl;
diff --git a/bench/btl/actions/action_axpy.hh b/bench/btl/actions/action_axpy.hh
index 261be4c..073f364 100644
--- a/bench/btl/actions/action_axpy.hh
+++ b/bench/btl/actions/action_axpy.hh
@@ -28,46 +28,39 @@
 
 using namespace std;
 
-template<class Interface>
+template <class Interface>
 class Action_axpy {
-
-public :
-
+ public:
   // Ctor
 
-  Action_axpy( int size ):_coef(1.0),_size(size)
-  {
+  Action_axpy(int size) : _coef(1.0), _size(size) {
     MESSAGE("Action_axpy Ctor");
 
     // STL vector initialization
 
-    init_vector<pseudo_random>(X_stl,_size);
-    init_vector<pseudo_random>(Y_stl,_size);
-    init_vector<null_function>(resu_stl,_size);
+    init_vector<pseudo_random>(X_stl, _size);
+    init_vector<pseudo_random>(Y_stl, _size);
+    init_vector<null_function>(resu_stl, _size);
 
     // generic matrix and vector initialization
 
-    Interface::vector_from_stl(X_ref,X_stl);
-    Interface::vector_from_stl(Y_ref,Y_stl);
+    Interface::vector_from_stl(X_ref, X_stl);
+    Interface::vector_from_stl(Y_ref, Y_stl);
 
-    Interface::vector_from_stl(X,X_stl);
-    Interface::vector_from_stl(Y,Y_stl);
-
-
+    Interface::vector_from_stl(X, X_stl);
+    Interface::vector_from_stl(Y, Y_stl);
   }
 
   // invalidate copy ctor
 
-  Action_axpy( const  Action_axpy & )
-  {
+  Action_axpy(const Action_axpy&) {
     INFOS("illegal call to Action_axpy Copy Ctor");
     exit(1);
   }
 
   // Dtor
 
-  ~Action_axpy( void ){
-
+  ~Action_axpy(void) {
     MESSAGE("Action_axpy Dtor");
 
     // deallocation
@@ -81,46 +74,38 @@
 
   // action name
 
-  static inline std::string name( void )
-  {
-    return "axpy_"+Interface::name();
+  static inline std::string name(void) { return "axpy_" + Interface::name(); }
+
+  double nb_op_base(void) { return 2.0 * _size; }
+
+  inline void initialize(void) {
+    Interface::copy_vector(X_ref, X, _size);
+    Interface::copy_vector(Y_ref, Y, _size);
   }
 
-  double nb_op_base( void ){
-    return 2.0*_size;
-  }
-
-  inline void initialize( void ){
-    Interface::copy_vector(X_ref,X,_size);
-    Interface::copy_vector(Y_ref,Y,_size);
-  }
-
-  inline void calculate( void ) {
+  inline void calculate(void) {
     BTL_ASM_COMMENT("mybegin axpy");
-    Interface::axpy(_coef,X,Y,_size);
+    Interface::axpy(_coef, X, Y, _size);
     BTL_ASM_COMMENT("myend axpy");
   }
 
-  void check_result( void ){
-    if (_size>128) return;
+  void check_result(void) {
+    if (_size > 128) return;
     // calculation check
 
-    Interface::vector_to_stl(Y,resu_stl);
+    Interface::vector_to_stl(Y, resu_stl);
 
-    STL_interface<typename Interface::real_type>::axpy(_coef,X_stl,Y_stl,_size);
+    STL_interface<typename Interface::real_type>::axpy(_coef, X_stl, Y_stl, _size);
 
-    typename Interface::real_type error=
-      STL_interface<typename Interface::real_type>::norm_diff(Y_stl,resu_stl);
+    typename Interface::real_type error = STL_interface<typename Interface::real_type>::norm_diff(Y_stl, resu_stl);
 
-    if (error>1.e-6){
+    if (error > 1.e-6) {
       INFOS("WRONG CALCULATION...residual=" << error);
       exit(0);
     }
-
   }
 
-private :
-
+ private:
   typename Interface::stl_vector X_stl;
   typename Interface::stl_vector Y_stl;
   typename Interface::stl_vector resu_stl;
diff --git a/bench/btl/actions/action_cholesky.hh b/bench/btl/actions/action_cholesky.hh
index 5f66d11..c2ac1c2 100644
--- a/bench/btl/actions/action_cholesky.hh
+++ b/bench/btl/actions/action_cholesky.hh
@@ -27,93 +27,75 @@
 
 using namespace std;
 
-template<class Interface>
+template <class Interface>
 class Action_cholesky {
-
-public :
-
+ public:
   // Ctor
 
-  Action_cholesky( int size ):_size(size)
-  {
+  Action_cholesky(int size) : _size(size) {
     MESSAGE("Action_cholesky Ctor");
 
     // STL mat/vec initialization
-    init_matrix_symm<pseudo_random>(X_stl,_size);
-    init_matrix<null_function>(C_stl,_size);
+    init_matrix_symm<pseudo_random>(X_stl, _size);
+    init_matrix<null_function>(C_stl, _size);
 
     // make sure X is invertible
-    for (int i=0; i<_size; ++i)
-      X_stl[i][i] = std::abs(X_stl[i][i]) * 1e2 + 100;
+    for (int i = 0; i < _size; ++i) X_stl[i][i] = std::abs(X_stl[i][i]) * 1e2 + 100;
 
     // generic matrix and vector initialization
-    Interface::matrix_from_stl(X_ref,X_stl);
-    Interface::matrix_from_stl(X,X_stl);
-    Interface::matrix_from_stl(C,C_stl);
+    Interface::matrix_from_stl(X_ref, X_stl);
+    Interface::matrix_from_stl(X, X_stl);
+    Interface::matrix_from_stl(C, C_stl);
 
     _cost = 0;
-    for (int j=0; j<_size; ++j)
-    {
-      double r = std::max(_size - j -1,0);
-      _cost += 2*(r*j+r+j);
+    for (int j = 0; j < _size; ++j) {
+      double r = std::max(_size - j - 1, 0);
+      _cost += 2 * (r * j + r + j);
     }
   }
 
   // invalidate copy ctor
 
-  Action_cholesky( const  Action_cholesky & )
-  {
+  Action_cholesky(const Action_cholesky&) {
     INFOS("illegal call to Action_cholesky Copy Ctor");
     exit(1);
   }
 
   // Dtor
 
-  ~Action_cholesky( void ){
-
+  ~Action_cholesky(void) {
     MESSAGE("Action_cholesky Dtor");
 
     // deallocation
-    Interface::free_matrix(X_ref,_size);
-    Interface::free_matrix(X,_size);
-    Interface::free_matrix(C,_size);
+    Interface::free_matrix(X_ref, _size);
+    Interface::free_matrix(X, _size);
+    Interface::free_matrix(C, _size);
   }
 
   // action name
 
-  static inline std::string name( void )
-  {
-    return "cholesky_"+Interface::name();
-  }
+  static inline std::string name(void) { return "cholesky_" + Interface::name(); }
 
-  double nb_op_base( void ){
-    return _cost;
-  }
+  double nb_op_base(void) { return _cost; }
 
-  inline void initialize( void ){
-    Interface::copy_matrix(X_ref,X,_size);
-  }
+  inline void initialize(void) { Interface::copy_matrix(X_ref, X, _size); }
 
-  inline void calculate( void ) {
-      Interface::cholesky(X,C,_size);
-  }
+  inline void calculate(void) { Interface::cholesky(X, C, _size); }
 
-  void check_result( void ){
+  void check_result(void) {
     // calculation check
-//     STL_interface<typename Interface::real_type>::cholesky(X_stl,C_stl,_size);
-//
-//     typename Interface::real_type error=
-//       STL_interface<typename Interface::real_type>::norm_diff(C_stl,resu_stl);
-//
-//     if (error>1.e-6){
-//       INFOS("WRONG CALCULATION...residual=" << error);
-//       exit(0);
-//     }
-
+    //     STL_interface<typename Interface::real_type>::cholesky(X_stl,C_stl,_size);
+    //
+    //     typename Interface::real_type error=
+    //       STL_interface<typename Interface::real_type>::norm_diff(C_stl,resu_stl);
+    //
+    //     if (error>1.e-6){
+    //       INFOS("WRONG CALCULATION...residual=" << error);
+    //       exit(0);
+    //     }
   }
 
-private :
-
+ private:
   typename Interface::stl_matrix X_stl;
   typename Interface::stl_matrix C_stl;
 
diff --git a/bench/btl/actions/action_ger.hh b/bench/btl/actions/action_ger.hh
index dc766ef..d46dd0a 100644
--- a/bench/btl/actions/action_ger.hh
+++ b/bench/btl/actions/action_ger.hh
@@ -23,91 +23,78 @@
 
 using namespace std;
 
-template<class Interface>
+template <class Interface>
 class Action_ger {
-
-public :
-
+ public:
   // Ctor
-  BTL_DONT_INLINE Action_ger( int size ):_size(size)
-  {
+  BTL_DONT_INLINE Action_ger(int size) : _size(size) {
     MESSAGE("Action_ger Ctor");
 
     // STL matrix and vector initialization
     typename Interface::stl_matrix tmp;
-    init_matrix<pseudo_random>(A_stl,_size);
-    init_vector<pseudo_random>(B_stl,_size);
-    init_vector<pseudo_random>(X_stl,_size);
-    init_vector<null_function>(resu_stl,_size);
+    init_matrix<pseudo_random>(A_stl, _size);
+    init_vector<pseudo_random>(B_stl, _size);
+    init_vector<pseudo_random>(X_stl, _size);
+    init_vector<null_function>(resu_stl, _size);
 
     // generic matrix and vector initialization
-    Interface::matrix_from_stl(A_ref,A_stl);
-    Interface::matrix_from_stl(A,A_stl);
-    Interface::vector_from_stl(B_ref,B_stl);
-    Interface::vector_from_stl(B,B_stl);
-    Interface::vector_from_stl(X_ref,X_stl);
-    Interface::vector_from_stl(X,X_stl);
+    Interface::matrix_from_stl(A_ref, A_stl);
+    Interface::matrix_from_stl(A, A_stl);
+    Interface::vector_from_stl(B_ref, B_stl);
+    Interface::vector_from_stl(B, B_stl);
+    Interface::vector_from_stl(X_ref, X_stl);
+    Interface::vector_from_stl(X, X_stl);
   }
 
   // invalidate copy ctor
-  Action_ger( const  Action_ger & )
-  {
+  Action_ger(const Action_ger&) {
     INFOS("illegal call to Action_ger Copy Ctor");
     exit(1);
   }
 
   // Dtor
-  BTL_DONT_INLINE ~Action_ger( void ){
+  BTL_DONT_INLINE ~Action_ger(void) {
     MESSAGE("Action_ger Dtor");
-    Interface::free_matrix(A,_size);
+    Interface::free_matrix(A, _size);
     Interface::free_vector(B);
     Interface::free_vector(X);
-    Interface::free_matrix(A_ref,_size);
+    Interface::free_matrix(A_ref, _size);
     Interface::free_vector(B_ref);
     Interface::free_vector(X_ref);
-
   }
 
   // action name
-  static inline std::string name( void )
-  {
-    return "ger_" + Interface::name();
+  static inline std::string name(void) { return "ger_" + Interface::name(); }
+
+  double nb_op_base(void) { return 2.0 * _size * _size; }
+
+  BTL_DONT_INLINE void initialize(void) {
+    Interface::copy_matrix(A_ref, A, _size);
+    Interface::copy_vector(B_ref, B, _size);
+    Interface::copy_vector(X_ref, X, _size);
   }
 
-  double nb_op_base( void ){
-    return 2.0*_size*_size;
-  }
-
-  BTL_DONT_INLINE  void initialize( void ){
-    Interface::copy_matrix(A_ref,A,_size);
-    Interface::copy_vector(B_ref,B,_size);
-    Interface::copy_vector(X_ref,X,_size);
-  }
-
-  BTL_DONT_INLINE void calculate( void ) {
+  BTL_DONT_INLINE void calculate(void) {
     BTL_ASM_COMMENT("#begin ger");
-    Interface::ger(A,B,X,_size);
+    Interface::ger(A, B, X, _size);
     BTL_ASM_COMMENT("end ger");
   }
 
-  BTL_DONT_INLINE void check_result( void ){
+  BTL_DONT_INLINE void check_result(void) {
     // calculation check
-    Interface::vector_to_stl(X,resu_stl);
+    Interface::vector_to_stl(X, resu_stl);
 
-    STL_interface<typename Interface::real_type>::ger(A_stl,B_stl,X_stl,_size);
+    STL_interface<typename Interface::real_type>::ger(A_stl, B_stl, X_stl, _size);
 
-    typename Interface::real_type error=
-      STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl);
+    typename Interface::real_type error = STL_interface<typename Interface::real_type>::norm_diff(X_stl, resu_stl);
 
-    if (error>1.e-3){
+    if (error > 1.e-3) {
       INFOS("WRONG CALCULATION...residual=" << error);
-//       exit(0);
+      //       exit(0);
     }
-
   }
 
-private :
-
+ private:
   typename Interface::stl_matrix A_stl;
   typename Interface::stl_vector B_stl;
   typename Interface::stl_vector X_stl;
@@ -124,5 +111,4 @@
   int _size;
 };
 
-
 #endif
diff --git a/bench/btl/actions/action_hessenberg.hh b/bench/btl/actions/action_hessenberg.hh
index 2100ebd..c364bfc 100644
--- a/bench/btl/actions/action_hessenberg.hh
+++ b/bench/btl/actions/action_hessenberg.hh
@@ -27,94 +27,77 @@
 
 using namespace std;
 
-template<class Interface>
+template <class Interface>
 class Action_hessenberg {
-
-public :
-
+ public:
   // Ctor
 
-  Action_hessenberg( int size ):_size(size)
-  {
+  Action_hessenberg(int size) : _size(size) {
     MESSAGE("Action_hessenberg Ctor");
 
     // STL vector initialization
-    init_matrix<pseudo_random>(X_stl,_size);
+    init_matrix<pseudo_random>(X_stl, _size);
 
-    init_matrix<null_function>(C_stl,_size);
-    init_matrix<null_function>(resu_stl,_size);
+    init_matrix<null_function>(C_stl, _size);
+    init_matrix<null_function>(resu_stl, _size);
 
     // generic matrix and vector initialization
-    Interface::matrix_from_stl(X_ref,X_stl);
-    Interface::matrix_from_stl(X,X_stl);
-    Interface::matrix_from_stl(C,C_stl);
+    Interface::matrix_from_stl(X_ref, X_stl);
+    Interface::matrix_from_stl(X, X_stl);
+    Interface::matrix_from_stl(C, C_stl);
 
     _cost = 0;
-    for (int j=0; j<_size-2; ++j)
-    {
-      double r = std::max(0,_size-j-1);
-      double b = std::max(0,_size-j-2);
-      _cost += 6 + 3*b + r*r*4 + r*_size*4;
+    for (int j = 0; j < _size - 2; ++j) {
+      double r = std::max(0, _size - j - 1);
+      double b = std::max(0, _size - j - 2);
+      _cost += 6 + 3 * b + r * r * 4 + r * _size * 4;
     }
   }
 
   // invalidate copy ctor
 
-  Action_hessenberg( const  Action_hessenberg & )
-  {
+  Action_hessenberg(const Action_hessenberg&) {
     INFOS("illegal call to Action_hessenberg Copy Ctor");
     exit(1);
   }
 
   // Dtor
 
-  ~Action_hessenberg( void ){
-
+  ~Action_hessenberg(void) {
     MESSAGE("Action_hessenberg Dtor");
 
     // deallocation
-    Interface::free_matrix(X_ref,_size);
-    Interface::free_matrix(X,_size);
-    Interface::free_matrix(C,_size);
+    Interface::free_matrix(X_ref, _size);
+    Interface::free_matrix(X, _size);
+    Interface::free_matrix(C, _size);
   }
 
   // action name
 
-  static inline std::string name( void )
-  {
-    return "hessenberg_"+Interface::name();
-  }
+  static inline std::string name(void) { return "hessenberg_" + Interface::name(); }
 
-  double nb_op_base( void ){
-    return _cost;
-  }
+  double nb_op_base(void) { return _cost; }
 
-  inline void initialize( void ){
-    Interface::copy_matrix(X_ref,X,_size);
-  }
+  inline void initialize(void) { Interface::copy_matrix(X_ref, X, _size); }
 
-  inline void calculate( void ) {
-      Interface::hessenberg(X,C,_size);
-  }
+  inline void calculate(void) { Interface::hessenberg(X, C, _size); }
 
-  void check_result( void ){
+  void check_result(void) {
     // calculation check
-    Interface::matrix_to_stl(C,resu_stl);
+    Interface::matrix_to_stl(C, resu_stl);
 
-//     STL_interface<typename Interface::real_type>::hessenberg(X_stl,C_stl,_size);
-//
-//     typename Interface::real_type error=
-//       STL_interface<typename Interface::real_type>::norm_diff(C_stl,resu_stl);
-//
-//     if (error>1.e-6){
-//       INFOS("WRONG CALCULATION...residual=" << error);
-//       exit(0);
-//     }
-
+    //     STL_interface<typename Interface::real_type>::hessenberg(X_stl,C_stl,_size);
+    //
+    //     typename Interface::real_type error=
+    //       STL_interface<typename Interface::real_type>::norm_diff(C_stl,resu_stl);
+    //
+    //     if (error>1.e-6){
+    //       INFOS("WRONG CALCULATION...residual=" << error);
+    //       exit(0);
+    //     }
   }
 
-private :
-
+ private:
   typename Interface::stl_matrix X_stl;
   typename Interface::stl_matrix C_stl;
   typename Interface::stl_matrix resu_stl;
@@ -127,97 +110,81 @@
   double _cost;
 };
 
-template<class Interface>
+template <class Interface>
 class Action_tridiagonalization {
-
-public :
-
+ public:
   // Ctor
 
-  Action_tridiagonalization( int size ):_size(size)
-  {
+  Action_tridiagonalization(int size) : _size(size) {
     MESSAGE("Action_tridiagonalization Ctor");
 
     // STL vector initialization
-    init_matrix<pseudo_random>(X_stl,_size);
-    
-    for(int i=0; i<_size; ++i)
-    {
-      for(int j=0; j<i; ++j)
-        X_stl[i][j] = X_stl[j][i];
+    init_matrix<pseudo_random>(X_stl, _size);
+
+    for (int i = 0; i < _size; ++i) {
+      for (int j = 0; j < i; ++j) X_stl[i][j] = X_stl[j][i];
     }
-    
-    init_matrix<null_function>(C_stl,_size);
-    init_matrix<null_function>(resu_stl,_size);
+
+    init_matrix<null_function>(C_stl, _size);
+    init_matrix<null_function>(resu_stl, _size);
 
     // generic matrix and vector initialization
-    Interface::matrix_from_stl(X_ref,X_stl);
-    Interface::matrix_from_stl(X,X_stl);
-    Interface::matrix_from_stl(C,C_stl);
+    Interface::matrix_from_stl(X_ref, X_stl);
+    Interface::matrix_from_stl(X, X_stl);
+    Interface::matrix_from_stl(C, C_stl);
 
     _cost = 0;
-    for (int j=0; j<_size-2; ++j)
-    {
-      double r = std::max(0,_size-j-1);
-      double b = std::max(0,_size-j-2);
-      _cost += 6. + 3.*b + r*r*8.;
+    for (int j = 0; j < _size - 2; ++j) {
+      double r = std::max(0, _size - j - 1);
+      double b = std::max(0, _size - j - 2);
+      _cost += 6. + 3. * b + r * r * 8.;
     }
   }
 
   // invalidate copy ctor
 
-  Action_tridiagonalization( const  Action_tridiagonalization & )
-  {
+  Action_tridiagonalization(const Action_tridiagonalization&) {
     INFOS("illegal call to Action_tridiagonalization Copy Ctor");
     exit(1);
   }
 
   // Dtor
 
-  ~Action_tridiagonalization( void ){
-
+  ~Action_tridiagonalization(void) {
     MESSAGE("Action_tridiagonalization Dtor");
 
     // deallocation
-    Interface::free_matrix(X_ref,_size);
-    Interface::free_matrix(X,_size);
-    Interface::free_matrix(C,_size);
+    Interface::free_matrix(X_ref, _size);
+    Interface::free_matrix(X, _size);
+    Interface::free_matrix(C, _size);
   }
 
   // action name
 
-  static inline std::string name( void ) { return "tridiagonalization_"+Interface::name(); }
+  static inline std::string name(void) { return "tridiagonalization_" + Interface::name(); }
 
-  double nb_op_base( void ){
-    return _cost;
-  }
+  double nb_op_base(void) { return _cost; }
 
-  inline void initialize( void ){
-    Interface::copy_matrix(X_ref,X,_size);
-  }
+  inline void initialize(void) { Interface::copy_matrix(X_ref, X, _size); }
 
-  inline void calculate( void ) {
-      Interface::tridiagonalization(X,C,_size);
-  }
+  inline void calculate(void) { Interface::tridiagonalization(X, C, _size); }
 
-  void check_result( void ){
+  void check_result(void) {
     // calculation check
-    Interface::matrix_to_stl(C,resu_stl);
+    Interface::matrix_to_stl(C, resu_stl);
 
-//     STL_interface<typename Interface::real_type>::tridiagonalization(X_stl,C_stl,_size);
-//
-//     typename Interface::real_type error=
-//       STL_interface<typename Interface::real_type>::norm_diff(C_stl,resu_stl);
-//
-//     if (error>1.e-6){
-//       INFOS("WRONG CALCULATION...residual=" << error);
-//       exit(0);
-//     }
-
+    //     STL_interface<typename Interface::real_type>::tridiagonalization(X_stl,C_stl,_size);
+    //
+    //     typename Interface::real_type error=
+    //       STL_interface<typename Interface::real_type>::norm_diff(C_stl,resu_stl);
+    //
+    //     if (error>1.e-6){
+    //       INFOS("WRONG CALCULATION...residual=" << error);
+    //       exit(0);
+    //     }
   }
 
-private :
-
+ private:
   typename Interface::stl_matrix X_stl;
   typename Interface::stl_matrix C_stl;
   typename Interface::stl_matrix resu_stl;
diff --git a/bench/btl/actions/action_lu_decomp.hh b/bench/btl/actions/action_lu_decomp.hh
index 2448e82..46fad91 100644
--- a/bench/btl/actions/action_lu_decomp.hh
+++ b/bench/btl/actions/action_lu_decomp.hh
@@ -27,88 +27,72 @@
 
 using namespace std;
 
-template<class Interface>
+template <class Interface>
 class Action_lu_decomp {
-
-public :
-
+ public:
   // Ctor
 
-  Action_lu_decomp( int size ):_size(size)
-  {
+  Action_lu_decomp(int size) : _size(size) {
     MESSAGE("Action_lu_decomp Ctor");
 
     // STL vector initialization
-    init_matrix<pseudo_random>(X_stl,_size);
+    init_matrix<pseudo_random>(X_stl, _size);
 
-    init_matrix<null_function>(C_stl,_size);
-    init_matrix<null_function>(resu_stl,_size);
+    init_matrix<null_function>(C_stl, _size);
+    init_matrix<null_function>(resu_stl, _size);
 
     // generic matrix and vector initialization
-    Interface::matrix_from_stl(X_ref,X_stl);
-    Interface::matrix_from_stl(X,X_stl);
-    Interface::matrix_from_stl(C,C_stl);
+    Interface::matrix_from_stl(X_ref, X_stl);
+    Interface::matrix_from_stl(X, X_stl);
+    Interface::matrix_from_stl(C, C_stl);
 
-    _cost = 2.0*size*size*size/3.0 + size*size;
+    _cost = 2.0 * size * size * size / 3.0 + size * size;
   }
 
   // invalidate copy ctor
 
-  Action_lu_decomp( const  Action_lu_decomp & )
-  {
+  Action_lu_decomp(const Action_lu_decomp&) {
     INFOS("illegal call to Action_lu_decomp Copy Ctor");
     exit(1);
   }
 
   // Dtor
 
-  ~Action_lu_decomp( void ){
-
+  ~Action_lu_decomp(void) {
     MESSAGE("Action_lu_decomp Dtor");
 
     // deallocation
-    Interface::free_matrix(X_ref,_size);
-    Interface::free_matrix(X,_size);
-    Interface::free_matrix(C,_size);
+    Interface::free_matrix(X_ref, _size);
+    Interface::free_matrix(X, _size);
+    Interface::free_matrix(C, _size);
   }
 
   // action name
 
-  static inline std::string name( void )
-  {
-    return "complete_lu_decomp_"+Interface::name();
-  }
+  static inline std::string name(void) { return "complete_lu_decomp_" + Interface::name(); }
 
-  double nb_op_base( void ){
-    return _cost;
-  }
+  double nb_op_base(void) { return _cost; }
 
-  inline void initialize( void ){
-    Interface::copy_matrix(X_ref,X,_size);
-  }
+  inline void initialize(void) { Interface::copy_matrix(X_ref, X, _size); }
 
-  inline void calculate( void ) {
-      Interface::lu_decomp(X,C,_size);
-  }
+  inline void calculate(void) { Interface::lu_decomp(X, C, _size); }
 
-  void check_result( void ){
+  void check_result(void) {
     // calculation check
-    Interface::matrix_to_stl(C,resu_stl);
+    Interface::matrix_to_stl(C, resu_stl);
 
-//     STL_interface<typename Interface::real_type>::lu_decomp(X_stl,C_stl,_size);
-//
-//     typename Interface::real_type error=
-//       STL_interface<typename Interface::real_type>::norm_diff(C_stl,resu_stl);
-//
-//     if (error>1.e-6){
-//       INFOS("WRONG CALCULATION...residual=" << error);
-//       exit(0);
-//     }
-
+    //     STL_interface<typename Interface::real_type>::lu_decomp(X_stl,C_stl,_size);
+    //
+    //     typename Interface::real_type error=
+    //       STL_interface<typename Interface::real_type>::norm_diff(C_stl,resu_stl);
+    //
+    //     if (error>1.e-6){
+    //       INFOS("WRONG CALCULATION...residual=" << error);
+    //       exit(0);
+    //     }
   }
 
-private :
-
+ private:
   typename Interface::stl_matrix X_stl;
   typename Interface::stl_matrix C_stl;
   typename Interface::stl_matrix resu_stl;
diff --git a/bench/btl/actions/action_lu_solve.hh b/bench/btl/actions/action_lu_solve.hh
index 5a81e63..afc640c 100644
--- a/bench/btl/actions/action_lu_solve.hh
+++ b/bench/btl/actions/action_lu_solve.hh
@@ -1,14 +1,14 @@
 //=====================================================
 // File   :  action_lu_solve.hh
-// Author :  L. Plagne <laurent.plagne@edf.fr)>        
+// Author :  L. Plagne <laurent.plagne@edf.fr)>
 // Copyright (C) EDF R&D,  lun sep 30 14:23:19 CEST 2002
 //=====================================================
-// 
+//
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
 // as published by the Free Software Foundation; either version 2
 // of the License, or (at your option) any later version.
-// 
+//
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -16,7 +16,7 @@
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-// 
+//
 #ifndef ACTION_LU_SOLVE
 #define ACTION_LU_SOLVE
 #include "utilities.h"
@@ -28,33 +28,25 @@
 
 using namespace std;
 
-template<class Interface>
-class Action_lu_solve 
-{
+template <class Interface>
+class Action_lu_solve {
+ public:
+  static inline std::string name(void) { return "lu_solve_" + Interface::name(); }
 
-public :
-
-  static inline std::string name( void )
-  {
-    return "lu_solve_"+Interface::name();
-  }
-  
-  static double nb_op_base(int size){
-    return 2.0*size*size*size/3.0;  // questionable but not really important
+  static double nb_op_base(int size) {
+    return 2.0 * size * size * size / 3.0;  // questionable but not really important
   }
 
-
-  static double calculate( int nb_calc, int size ) {
-
+  static double calculate(int nb_calc, int size) {
     // STL matrix and vector initialization
-    
+
     typename Interface::stl_matrix A_stl;
     typename Interface::stl_vector B_stl;
     typename Interface::stl_vector X_stl;
 
-    init_matrix<pseudo_random>(A_stl,size);
-    init_vector<pseudo_random>(B_stl,size);
-    init_vector<null_function>(X_stl,size);
+    init_matrix<pseudo_random>(A_stl, size);
+    init_vector<pseudo_random>(B_stl, size);
+    init_vector<null_function>(X_stl, size);
 
     // generic matrix and vector initialization
 
@@ -62,18 +54,18 @@
     typename Interface::gene_vector B;
     typename Interface::gene_vector X;
 
-    typename Interface::gene_matrix LU; 
+    typename Interface::gene_matrix LU;
 
-    Interface::matrix_from_stl(A,A_stl);
-    Interface::vector_from_stl(B,B_stl);
-    Interface::vector_from_stl(X,X_stl);
-    Interface::matrix_from_stl(LU,A_stl);
-  
+    Interface::matrix_from_stl(A, A_stl);
+    Interface::vector_from_stl(B, B_stl);
+    Interface::vector_from_stl(X, X_stl);
+    Interface::matrix_from_stl(LU, A_stl);
+
     // local variable :
 
-    typename Interface::Pivot_Vector pivot; // pivot vector
-    Interface::new_Pivot_Vector(pivot,size);
-    
+    typename Interface::Pivot_Vector pivot;  // pivot vector
+    Interface::new_Pivot_Vector(pivot, size);
+
     // timer utilities
 
     Portable_Timer chronos;
@@ -81,56 +73,48 @@
     // time measurement
 
     chronos.start();
-    
-    for (int ii=0;ii<nb_calc;ii++){
 
+    for (int ii = 0; ii < nb_calc; ii++) {
       // LU factorization
-      Interface::copy_matrix(A,LU,size);
-      Interface::LU_factor(LU,pivot,size);
-      
+      Interface::copy_matrix(A, LU, size);
+      Interface::LU_factor(LU, pivot, size);
+
       // LU solve
 
-      Interface::LU_solve(LU,pivot,B,X,size);
-
+      Interface::LU_solve(LU, pivot, B, X, size);
     }
 
     // Time stop
 
     chronos.stop();
 
-    double time=chronos.user_time();
-  
+    double time = chronos.user_time();
+
     // check result :
 
     typename Interface::stl_vector B_new_stl(size);
-    Interface::vector_to_stl(X,X_stl);
+    Interface::vector_to_stl(X, X_stl);
 
-    STL_interface<typename Interface::real_type>::matrix_vector_product(A_stl,X_stl,B_new_stl,size); 
-  
-    typename Interface::real_type error=
-      STL_interface<typename Interface::real_type>::norm_diff(B_stl,B_new_stl);
-    
-    if (error>1.e-5){
+    STL_interface<typename Interface::real_type>::matrix_vector_product(A_stl, X_stl, B_new_stl, size);
+
+    typename Interface::real_type error = STL_interface<typename Interface::real_type>::norm_diff(B_stl, B_new_stl);
+
+    if (error > 1.e-5) {
       INFOS("WRONG CALCULATION...residual=" << error);
       STL_interface<typename Interface::real_type>::display_vector(B_stl);
       STL_interface<typename Interface::real_type>::display_vector(B_new_stl);
       exit(0);
     }
-    
+
     // deallocation and return time
-    
-    Interface::free_matrix(A,size);
+
+    Interface::free_matrix(A, size);
     Interface::free_vector(B);
     Interface::free_vector(X);
     Interface::free_Pivot_Vector(pivot);
 
     return time;
   }
-
 };
-  
 
 #endif
-
-
-
diff --git a/bench/btl/actions/action_matrix_matrix_product.hh b/bench/btl/actions/action_matrix_matrix_product.hh
index f65ee05..a66d477 100644
--- a/bench/btl/actions/action_matrix_matrix_product.hh
+++ b/bench/btl/actions/action_matrix_matrix_product.hh
@@ -28,103 +28,83 @@
 
 using namespace std;
 
-template<class Interface>
+template <class Interface>
 class Action_matrix_matrix_product {
-
-public :
-
+ public:
   // Ctor
 
-  Action_matrix_matrix_product( int size ):_size(size)
-  {
+  Action_matrix_matrix_product(int size) : _size(size) {
     MESSAGE("Action_matrix_matrix_product Ctor");
 
     // STL matrix and vector initialization
 
-    init_matrix<pseudo_random>(A_stl,_size);
-    init_matrix<pseudo_random>(B_stl,_size);
-    init_matrix<null_function>(X_stl,_size);
-    init_matrix<null_function>(resu_stl,_size);
+    init_matrix<pseudo_random>(A_stl, _size);
+    init_matrix<pseudo_random>(B_stl, _size);
+    init_matrix<null_function>(X_stl, _size);
+    init_matrix<null_function>(resu_stl, _size);
 
     // generic matrix and vector initialization
 
-    Interface::matrix_from_stl(A_ref,A_stl);
-    Interface::matrix_from_stl(B_ref,B_stl);
-    Interface::matrix_from_stl(X_ref,X_stl);
+    Interface::matrix_from_stl(A_ref, A_stl);
+    Interface::matrix_from_stl(B_ref, B_stl);
+    Interface::matrix_from_stl(X_ref, X_stl);
 
-    Interface::matrix_from_stl(A,A_stl);
-    Interface::matrix_from_stl(B,B_stl);
-    Interface::matrix_from_stl(X,X_stl);
-
+    Interface::matrix_from_stl(A, A_stl);
+    Interface::matrix_from_stl(B, B_stl);
+    Interface::matrix_from_stl(X, X_stl);
   }
 
   // invalidate copy ctor
 
-  Action_matrix_matrix_product( const  Action_matrix_matrix_product & )
-  {
+  Action_matrix_matrix_product(const Action_matrix_matrix_product&) {
     INFOS("illegal call to Action_matrix_matrix_product Copy Ctor");
     exit(0);
   }
 
   // Dtor
 
-  ~Action_matrix_matrix_product( void ){
-
+  ~Action_matrix_matrix_product(void) {
     MESSAGE("Action_matrix_matrix_product Dtor");
 
     // deallocation
 
-    Interface::free_matrix(A,_size);
-    Interface::free_matrix(B,_size);
-    Interface::free_matrix(X,_size);
+    Interface::free_matrix(A, _size);
+    Interface::free_matrix(B, _size);
+    Interface::free_matrix(X, _size);
 
-    Interface::free_matrix(A_ref,_size);
-    Interface::free_matrix(B_ref,_size);
-    Interface::free_matrix(X_ref,_size);
-
+    Interface::free_matrix(A_ref, _size);
+    Interface::free_matrix(B_ref, _size);
+    Interface::free_matrix(X_ref, _size);
   }
 
   // action name
 
-  static inline std::string name( void )
-  {
-    return "matrix_matrix_"+Interface::name();
+  static inline std::string name(void) { return "matrix_matrix_" + Interface::name(); }
+
+  double nb_op_base(void) { return 2.0 * _size * _size * _size; }
+
+  inline void initialize(void) {
+    Interface::copy_matrix(A_ref, A, _size);
+    Interface::copy_matrix(B_ref, B, _size);
+    Interface::copy_matrix(X_ref, X, _size);
   }
 
-  double nb_op_base( void ){
-    return 2.0*_size*_size*_size;
-  }
+  inline void calculate(void) { Interface::matrix_matrix_product(A, B, X, _size); }
 
-  inline void initialize( void ){
-
-    Interface::copy_matrix(A_ref,A,_size);
-    Interface::copy_matrix(B_ref,B,_size);
-    Interface::copy_matrix(X_ref,X,_size);
-
-  }
-
-  inline void calculate( void ) {
-      Interface::matrix_matrix_product(A,B,X,_size);
-  }
-
-  void check_result( void ){
-
+  void check_result(void) {
     // calculation check
-    if (_size<200)
-    {
-      Interface::matrix_to_stl(X,resu_stl);
-      STL_interface<typename Interface::real_type>::matrix_matrix_product(A_stl,B_stl,X_stl,_size);
-      typename Interface::real_type error=
-        STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl);
-      if (error>1.e-6){
+    if (_size < 200) {
+      Interface::matrix_to_stl(X, resu_stl);
+      STL_interface<typename Interface::real_type>::matrix_matrix_product(A_stl, B_stl, X_stl, _size);
+      typename Interface::real_type error = STL_interface<typename Interface::real_type>::norm_diff(X_stl, resu_stl);
+      if (error > 1.e-6) {
         INFOS("WRONG CALCULATION...residual=" << error);
         exit(1);
       }
     }
   }
 
-private :
-
+ private:
   typename Interface::stl_matrix A_stl;
   typename Interface::stl_matrix B_stl;
   typename Interface::stl_matrix X_stl;
@@ -138,13 +118,7 @@
   typename Interface::gene_matrix B;
   typename Interface::gene_matrix X;
 
-
   int _size;
-
 };
 
-
 #endif
-
-
-
diff --git a/bench/btl/actions/action_matrix_matrix_product_bis.hh b/bench/btl/actions/action_matrix_matrix_product_bis.hh
index 29c10a6..c02dfb3 100644
--- a/bench/btl/actions/action_matrix_matrix_product_bis.hh
+++ b/bench/btl/actions/action_matrix_matrix_product_bis.hh
@@ -29,31 +29,23 @@
 
 using namespace std;
 
-template<class Interface>
+template <class Interface>
 class Action_matrix_matrix_product_bis {
+ public:
+  static inline std::string name(void) { return "matrix_matrix_" + Interface::name(); }
 
-public :
+  static double nb_op_base(int size) { return 2.0 * size * size * size; }
 
-  static inline std::string name( void )
-  {
-    return "matrix_matrix_"+Interface::name();
-  }
-
-  static double nb_op_base(int size){
-    return 2.0*size*size*size;
-  }
-
-  static double calculate( int nb_calc, int size ) {
-
+  static double calculate(int nb_calc, int size) {
     // STL matrix and vector initialization
 
     typename Interface::stl_matrix A_stl;
     typename Interface::stl_matrix B_stl;
     typename Interface::stl_matrix X_stl;
 
-    init_matrix<pseudo_random>(A_stl,size);
-    init_matrix<pseudo_random>(B_stl,size);
-    init_matrix<null_function>(X_stl,size);
+    init_matrix<pseudo_random>(A_stl, size);
+    init_matrix<pseudo_random>(B_stl, size);
+    init_matrix<null_function>(X_stl, size);
 
     // generic matrix and vector initialization
 
@@ -65,15 +57,13 @@
     typename Interface::gene_matrix B;
     typename Interface::gene_matrix X;
 
+    Interface::matrix_from_stl(A_ref, A_stl);
+    Interface::matrix_from_stl(B_ref, B_stl);
+    Interface::matrix_from_stl(X_ref, X_stl);
 
-    Interface::matrix_from_stl(A_ref,A_stl);
-    Interface::matrix_from_stl(B_ref,B_stl);
-    Interface::matrix_from_stl(X_ref,X_stl);
-
-    Interface::matrix_from_stl(A,A_stl);
-    Interface::matrix_from_stl(B,B_stl);
-    Interface::matrix_from_stl(X,X_stl);
-
+    Interface::matrix_from_stl(A, A_stl);
+    Interface::matrix_from_stl(B, B_stl);
+    Interface::matrix_from_stl(X, X_stl);
 
     // STL_timer utilities
 
@@ -84,15 +74,12 @@
     chronos.start_baseline(nb_calc);
 
     do {
-
-      Interface::copy_matrix(A_ref,A,size);
-      Interface::copy_matrix(B_ref,B,size);
-      Interface::copy_matrix(X_ref,X,size);
-
+      Interface::copy_matrix(A_ref, A, size);
+      Interface::copy_matrix(B_ref, B, size);
+      Interface::copy_matrix(X_ref, X, size);
 
       //      Interface::matrix_matrix_product(A,B,X,size); This line must be commented !!!!
-    }
-    while(chronos.check());
+    } while (chronos.check());
 
     chronos.report(true);
 
@@ -101,52 +88,44 @@
     chronos.start(nb_calc);
 
     do {
+      Interface::copy_matrix(A_ref, A, size);
+      Interface::copy_matrix(B_ref, B, size);
+      Interface::copy_matrix(X_ref, X, size);
 
-      Interface::copy_matrix(A_ref,A,size);
-      Interface::copy_matrix(B_ref,B,size);
-      Interface::copy_matrix(X_ref,X,size);
-
-      Interface::matrix_matrix_product(A,B,X,size); // here it is not commented !!!!
-    }
-    while(chronos.check());
+      Interface::matrix_matrix_product(A, B, X, size);  // here it is not commented !!!!
+    } while (chronos.check());
 
     chronos.report(true);
 
-    double time=chronos.calculated_time/2000.0;
+    double time = chronos.calculated_time / 2000.0;
 
     // calculation check
 
     typename Interface::stl_matrix resu_stl(size);
 
-    Interface::matrix_to_stl(X,resu_stl);
+    Interface::matrix_to_stl(X, resu_stl);
 
-    STL_interface<typename Interface::real_type>::matrix_matrix_product(A_stl,B_stl,X_stl,size);
+    STL_interface<typename Interface::real_type>::matrix_matrix_product(A_stl, B_stl, X_stl, size);
 
-    typename Interface::real_type error=
-      STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl);
+    typename Interface::real_type error = STL_interface<typename Interface::real_type>::norm_diff(X_stl, resu_stl);
 
-    if (error>1.e-6){
+    if (error > 1.e-6) {
       INFOS("WRONG CALCULATION...residual=" << error);
       exit(1);
     }
 
     // deallocation and return time
 
-    Interface::free_matrix(A,size);
-    Interface::free_matrix(B,size);
-    Interface::free_matrix(X,size);
+    Interface::free_matrix(A, size);
+    Interface::free_matrix(B, size);
+    Interface::free_matrix(X, size);
 
-    Interface::free_matrix(A_ref,size);
-    Interface::free_matrix(B_ref,size);
-    Interface::free_matrix(X_ref,size);
+    Interface::free_matrix(A_ref, size);
+    Interface::free_matrix(B_ref, size);
+    Interface::free_matrix(X_ref, size);
 
     return time;
   }
-
 };
 
-
 #endif
-
-
-
diff --git a/bench/btl/actions/action_matrix_vector_product.hh b/bench/btl/actions/action_matrix_vector_product.hh
index 8bab79d..002f876 100644
--- a/bench/btl/actions/action_matrix_vector_product.hh
+++ b/bench/btl/actions/action_matrix_vector_product.hh
@@ -28,106 +28,88 @@
 
 using namespace std;
 
-template<class Interface>
+template <class Interface>
 class Action_matrix_vector_product {
-
-public :
-
+ public:
   // Ctor
 
-  BTL_DONT_INLINE Action_matrix_vector_product( int size ):_size(size)
-  {
+  BTL_DONT_INLINE Action_matrix_vector_product(int size) : _size(size) {
     MESSAGE("Action_matrix_vector_product Ctor");
 
     // STL matrix and vector initialization
 
-    init_matrix<pseudo_random>(A_stl,_size);
-    init_vector<pseudo_random>(B_stl,_size);
-    init_vector<null_function>(X_stl,_size);
-    init_vector<null_function>(resu_stl,_size);
+    init_matrix<pseudo_random>(A_stl, _size);
+    init_vector<pseudo_random>(B_stl, _size);
+    init_vector<null_function>(X_stl, _size);
+    init_vector<null_function>(resu_stl, _size);
 
     // generic matrix and vector initialization
 
-    Interface::matrix_from_stl(A_ref,A_stl);
-    Interface::matrix_from_stl(A,A_stl);
-    Interface::vector_from_stl(B_ref,B_stl);
-    Interface::vector_from_stl(B,B_stl);
-    Interface::vector_from_stl(X_ref,X_stl);
-    Interface::vector_from_stl(X,X_stl);
-
+    Interface::matrix_from_stl(A_ref, A_stl);
+    Interface::matrix_from_stl(A, A_stl);
+    Interface::vector_from_stl(B_ref, B_stl);
+    Interface::vector_from_stl(B, B_stl);
+    Interface::vector_from_stl(X_ref, X_stl);
+    Interface::vector_from_stl(X, X_stl);
   }
 
   // invalidate copy ctor
 
-  Action_matrix_vector_product( const  Action_matrix_vector_product & )
-  {
+  Action_matrix_vector_product(const Action_matrix_vector_product&) {
     INFOS("illegal call to Action_matrix_vector_product Copy Ctor");
     exit(1);
   }
 
   // Dtor
 
-  BTL_DONT_INLINE ~Action_matrix_vector_product( void ){
-
+  BTL_DONT_INLINE ~Action_matrix_vector_product(void) {
     MESSAGE("Action_matrix_vector_product Dtor");
 
     // deallocation
 
-    Interface::free_matrix(A,_size);
+    Interface::free_matrix(A, _size);
     Interface::free_vector(B);
     Interface::free_vector(X);
 
-    Interface::free_matrix(A_ref,_size);
+    Interface::free_matrix(A_ref, _size);
     Interface::free_vector(B_ref);
     Interface::free_vector(X_ref);
-
   }
 
   // action name
 
-  static inline std::string name( void )
-  {
-    return "matrix_vector_" + Interface::name();
+  static inline std::string name(void) { return "matrix_vector_" + Interface::name(); }
+
+  double nb_op_base(void) { return 2.0 * _size * _size; }
+
+  BTL_DONT_INLINE void initialize(void) {
+    Interface::copy_matrix(A_ref, A, _size);
+    Interface::copy_vector(B_ref, B, _size);
+    Interface::copy_vector(X_ref, X, _size);
   }
 
-  double nb_op_base( void ){
-    return 2.0*_size*_size;
+  BTL_DONT_INLINE void calculate(void) {
+    BTL_ASM_COMMENT("#begin matrix_vector_product");
+    Interface::matrix_vector_product(A, B, X, _size);
+    BTL_ASM_COMMENT("end matrix_vector_product");
   }
 
-  BTL_DONT_INLINE  void initialize( void ){
-
-    Interface::copy_matrix(A_ref,A,_size);
-    Interface::copy_vector(B_ref,B,_size);
-    Interface::copy_vector(X_ref,X,_size);
-
-  }
-
-  BTL_DONT_INLINE void calculate( void ) {
-      BTL_ASM_COMMENT("#begin matrix_vector_product");
-      Interface::matrix_vector_product(A,B,X,_size);
-      BTL_ASM_COMMENT("end matrix_vector_product");
-  }
-
-  BTL_DONT_INLINE void check_result( void ){
-
+  BTL_DONT_INLINE void check_result(void) {
     // calculation check
 
-    Interface::vector_to_stl(X,resu_stl);
+    Interface::vector_to_stl(X, resu_stl);
 
-    STL_interface<typename Interface::real_type>::matrix_vector_product(A_stl,B_stl,X_stl,_size);
+    STL_interface<typename Interface::real_type>::matrix_vector_product(A_stl, B_stl, X_stl, _size);
 
-    typename Interface::real_type error=
-      STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl);
+    typename Interface::real_type error = STL_interface<typename Interface::real_type>::norm_diff(X_stl, resu_stl);
 
-    if (error>1.e-5){
+    if (error > 1.e-5) {
       INFOS("WRONG CALCULATION...residual=" << error);
       exit(0);
     }
-
   }
 
-private :
-
+ private:
   typename Interface::stl_matrix A_stl;
   typename Interface::stl_vector B_stl;
   typename Interface::stl_vector X_stl;
@@ -141,13 +123,7 @@
   typename Interface::gene_vector B;
   typename Interface::gene_vector X;
 
-
   int _size;
-
 };
 
-
 #endif
-
-
-
diff --git a/bench/btl/actions/action_partial_lu.hh b/bench/btl/actions/action_partial_lu.hh
index 770ea1d..400e3ff 100644
--- a/bench/btl/actions/action_partial_lu.hh
+++ b/bench/btl/actions/action_partial_lu.hh
@@ -27,90 +27,73 @@
 
 using namespace std;
 
-template<class Interface>
+template <class Interface>
 class Action_partial_lu {
-
-public :
-
+ public:
   // Ctor
 
-  Action_partial_lu( int size ):_size(size)
-  {
+  Action_partial_lu(int size) : _size(size) {
     MESSAGE("Action_partial_lu Ctor");
 
     // STL vector initialization
-    init_matrix<pseudo_random>(X_stl,_size);
-    init_matrix<null_function>(C_stl,_size);
+    init_matrix<pseudo_random>(X_stl, _size);
+    init_matrix<null_function>(C_stl, _size);
 
     // make sure X is invertible
-    for (int i=0; i<_size; ++i)
-      X_stl[i][i] = X_stl[i][i] * 1e2 + 1;
+    for (int i = 0; i < _size; ++i) X_stl[i][i] = X_stl[i][i] * 1e2 + 1;
 
     // generic matrix and vector initialization
-    Interface::matrix_from_stl(X_ref,X_stl);
-    Interface::matrix_from_stl(X,X_stl);
-    Interface::matrix_from_stl(C,C_stl);
+    Interface::matrix_from_stl(X_ref, X_stl);
+    Interface::matrix_from_stl(X, X_stl);
+    Interface::matrix_from_stl(C, C_stl);
 
-    _cost = 2.0*size*size*size/3.0 + size*size;
+    _cost = 2.0 * size * size * size / 3.0 + size * size;
   }
 
   // invalidate copy ctor
 
-  Action_partial_lu( const  Action_partial_lu & )
-  {
+  Action_partial_lu(const Action_partial_lu&) {
     INFOS("illegal call to Action_partial_lu Copy Ctor");
     exit(1);
   }
 
   // Dtor
 
-  ~Action_partial_lu( void ){
-
+  ~Action_partial_lu(void) {
     MESSAGE("Action_partial_lu Dtor");
 
     // deallocation
-    Interface::free_matrix(X_ref,_size);
-    Interface::free_matrix(X,_size);
-    Interface::free_matrix(C,_size);
+    Interface::free_matrix(X_ref, _size);
+    Interface::free_matrix(X, _size);
+    Interface::free_matrix(C, _size);
   }
 
   // action name
 
-  static inline std::string name( void )
-  {
-    return "partial_lu_decomp_"+Interface::name();
-  }
+  static inline std::string name(void) { return "partial_lu_decomp_" + Interface::name(); }
 
-  double nb_op_base( void ){
-    return _cost;
-  }
+  double nb_op_base(void) { return _cost; }
 
-  inline void initialize( void ){
-    Interface::copy_matrix(X_ref,X,_size);
-  }
+  inline void initialize(void) { Interface::copy_matrix(X_ref, X, _size); }
 
-  inline void calculate( void ) {
-      Interface::partial_lu_decomp(X,C,_size);
-  }
+  inline void calculate(void) { Interface::partial_lu_decomp(X, C, _size); }
 
-  void check_result( void ){
+  void check_result(void) {
     // calculation check
-//     Interface::matrix_to_stl(C,resu_stl);
+    //     Interface::matrix_to_stl(C,resu_stl);
 
-//     STL_interface<typename Interface::real_type>::lu_decomp(X_stl,C_stl,_size);
-//
-//     typename Interface::real_type error=
-//       STL_interface<typename Interface::real_type>::norm_diff(C_stl,resu_stl);
-//
-//     if (error>1.e-6){
-//       INFOS("WRONG CALCULATION...residual=" << error);
-//       exit(0);
-//     }
-
+    //     STL_interface<typename Interface::real_type>::lu_decomp(X_stl,C_stl,_size);
+    //
+    //     typename Interface::real_type error=
+    //       STL_interface<typename Interface::real_type>::norm_diff(C_stl,resu_stl);
+    //
+    //     if (error>1.e-6){
+    //       INFOS("WRONG CALCULATION...residual=" << error);
+    //       exit(0);
+    //     }
   }
 
-private :
-
+ private:
   typename Interface::stl_matrix X_stl;
   typename Interface::stl_matrix C_stl;
 
diff --git a/bench/btl/actions/action_rot.hh b/bench/btl/actions/action_rot.hh
index df822a6..7cc3c61 100644
--- a/bench/btl/actions/action_rot.hh
+++ b/bench/btl/actions/action_rot.hh
@@ -23,37 +23,33 @@
 
 using namespace std;
 
-template<class Interface>
+template <class Interface>
 class Action_rot {
-
-public :
-
+ public:
   // Ctor
-  BTL_DONT_INLINE Action_rot( int size ):_size(size)
-  {
+  BTL_DONT_INLINE Action_rot(int size) : _size(size) {
     MESSAGE("Action_rot Ctor");
 
     // STL matrix and vector initialization
     typename Interface::stl_matrix tmp;
-    init_vector<pseudo_random>(A_stl,_size);
-    init_vector<pseudo_random>(B_stl,_size);
+    init_vector<pseudo_random>(A_stl, _size);
+    init_vector<pseudo_random>(B_stl, _size);
 
     // generic matrix and vector initialization
-    Interface::vector_from_stl(A_ref,A_stl);
-    Interface::vector_from_stl(A,A_stl);
-    Interface::vector_from_stl(B_ref,B_stl);
-    Interface::vector_from_stl(B,B_stl);
+    Interface::vector_from_stl(A_ref, A_stl);
+    Interface::vector_from_stl(A, A_stl);
+    Interface::vector_from_stl(B_ref, B_stl);
+    Interface::vector_from_stl(B, B_stl);
   }
 
   // invalidate copy ctor
-  Action_rot( const  Action_rot & )
-  {
+  Action_rot(const Action_rot&) {
     INFOS("illegal call to Action_rot Copy Ctor");
     exit(1);
   }
 
   // Dtor
-  BTL_DONT_INLINE ~Action_rot( void ){
+  BTL_DONT_INLINE ~Action_rot(void) {
     MESSAGE("Action_rot Dtor");
     Interface::free_vector(A);
     Interface::free_vector(B);
@@ -62,44 +58,37 @@
   }
 
   // action name
-  static inline std::string name( void )
-  {
-    return "rot_" + Interface::name();
+  static inline std::string name(void) { return "rot_" + Interface::name(); }
+
+  double nb_op_base(void) { return 6.0 * _size; }
+
+  BTL_DONT_INLINE void initialize(void) {
+    Interface::copy_vector(A_ref, A, _size);
+    Interface::copy_vector(B_ref, B, _size);
   }
 
-  double nb_op_base( void ){
-    return 6.0*_size;
-  }
-
-  BTL_DONT_INLINE  void initialize( void ){
-    Interface::copy_vector(A_ref,A,_size);
-    Interface::copy_vector(B_ref,B,_size);
-  }
-
-  BTL_DONT_INLINE void calculate( void ) {
+  BTL_DONT_INLINE void calculate(void) {
     BTL_ASM_COMMENT("#begin rot");
-    Interface::rot(A,B,0.5,0.6,_size);
+    Interface::rot(A, B, 0.5, 0.6, _size);
     BTL_ASM_COMMENT("end rot");
   }
 
-  BTL_DONT_INLINE void check_result( void ){
+  BTL_DONT_INLINE void check_result(void) {
     // calculation check
-//     Interface::vector_to_stl(X,resu_stl);
+    //     Interface::vector_to_stl(X,resu_stl);
 
-//     STL_interface<typename Interface::real_type>::rot(A_stl,B_stl,X_stl,_size);
+    //     STL_interface<typename Interface::real_type>::rot(A_stl,B_stl,X_stl,_size);
 
-//     typename Interface::real_type error=
-//       STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl);
+    //     typename Interface::real_type error=
+    //       STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl);
 
-//     if (error>1.e-3){
-//       INFOS("WRONG CALCULATION...residual=" << error);
-//       exit(0);
-//     }
-
+    //     if (error>1.e-3){
+    //       INFOS("WRONG CALCULATION...residual=" << error);
+    //       exit(0);
+    //     }
   }
 
-private :
-
+ private:
   typename Interface::stl_vector A_stl;
   typename Interface::stl_vector B_stl;
 
@@ -112,5 +101,4 @@
   int _size;
 };
 
-
 #endif
diff --git a/bench/btl/actions/action_symv.hh b/bench/btl/actions/action_symv.hh
index a32b9df..d8b38551 100644
--- a/bench/btl/actions/action_symv.hh
+++ b/bench/btl/actions/action_symv.hh
@@ -28,95 +28,80 @@
 
 using namespace std;
 
-template<class Interface>
+template <class Interface>
 class Action_symv {
-
-public :
-
+ public:
   // Ctor
 
-  BTL_DONT_INLINE Action_symv( int size ):_size(size)
-  {
+  BTL_DONT_INLINE Action_symv(int size) : _size(size) {
     MESSAGE("Action_symv Ctor");
 
     // STL matrix and vector initialization
-    init_matrix_symm<pseudo_random>(A_stl,_size);
-    init_vector<pseudo_random>(B_stl,_size);
-    init_vector<null_function>(X_stl,_size);
-    init_vector<null_function>(resu_stl,_size);
+    init_matrix_symm<pseudo_random>(A_stl, _size);
+    init_vector<pseudo_random>(B_stl, _size);
+    init_vector<null_function>(X_stl, _size);
+    init_vector<null_function>(resu_stl, _size);
 
     // generic matrix and vector initialization
-    Interface::matrix_from_stl(A_ref,A_stl);
-    Interface::matrix_from_stl(A,A_stl);
-    Interface::vector_from_stl(B_ref,B_stl);
-    Interface::vector_from_stl(B,B_stl);
-    Interface::vector_from_stl(X_ref,X_stl);
-    Interface::vector_from_stl(X,X_stl);
-
+    Interface::matrix_from_stl(A_ref, A_stl);
+    Interface::matrix_from_stl(A, A_stl);
+    Interface::vector_from_stl(B_ref, B_stl);
+    Interface::vector_from_stl(B, B_stl);
+    Interface::vector_from_stl(X_ref, X_stl);
+    Interface::vector_from_stl(X, X_stl);
   }
 
   // invalidate copy ctor
 
-  Action_symv( const  Action_symv & )
-  {
+  Action_symv(const Action_symv&) {
     INFOS("illegal call to Action_symv Copy Ctor");
     exit(1);
   }
 
   // Dtor
-  BTL_DONT_INLINE ~Action_symv( void ){
-    Interface::free_matrix(A,_size);
+  BTL_DONT_INLINE ~Action_symv(void) {
+    Interface::free_matrix(A, _size);
     Interface::free_vector(B);
     Interface::free_vector(X);
-    Interface::free_matrix(A_ref,_size);
+    Interface::free_matrix(A_ref, _size);
     Interface::free_vector(B_ref);
     Interface::free_vector(X_ref);
   }
 
   // action name
 
-  static inline std::string name( void )
-  {
-    return "symv_" + Interface::name();
+  static inline std::string name(void) { return "symv_" + Interface::name(); }
+
+  double nb_op_base(void) { return 2.0 * _size * _size; }
+
+  BTL_DONT_INLINE void initialize(void) {
+    Interface::copy_matrix(A_ref, A, _size);
+    Interface::copy_vector(B_ref, B, _size);
+    Interface::copy_vector(X_ref, X, _size);
   }
 
-  double nb_op_base( void ){
-    return 2.0*_size*_size;
+  BTL_DONT_INLINE void calculate(void) {
+    BTL_ASM_COMMENT("#begin symv");
+    Interface::symv(A, B, X, _size);
+    BTL_ASM_COMMENT("end symv");
   }
 
-  BTL_DONT_INLINE  void initialize( void ){
-
-    Interface::copy_matrix(A_ref,A,_size);
-    Interface::copy_vector(B_ref,B,_size);
-    Interface::copy_vector(X_ref,X,_size);
-
-  }
-
-  BTL_DONT_INLINE void calculate( void ) {
-      BTL_ASM_COMMENT("#begin symv");
-      Interface::symv(A,B,X,_size);
-      BTL_ASM_COMMENT("end symv");
-  }
-
-  BTL_DONT_INLINE void check_result( void ){
-    if (_size>128) return;
+  BTL_DONT_INLINE void check_result(void) {
+    if (_size > 128) return;
     // calculation check
-    Interface::vector_to_stl(X,resu_stl);
+    Interface::vector_to_stl(X, resu_stl);
 
-    STL_interface<typename Interface::real_type>::symv(A_stl,B_stl,X_stl,_size);
+    STL_interface<typename Interface::real_type>::symv(A_stl, B_stl, X_stl, _size);
 
-    typename Interface::real_type error=
-      STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl);
+    typename Interface::real_type error = STL_interface<typename Interface::real_type>::norm_diff(X_stl, resu_stl);
 
-    if (error>1.e-5){
+    if (error > 1.e-5) {
       INFOS("WRONG CALCULATION...residual=" << error);
       exit(0);
     }
-
   }
 
-private :
-
+ private:
   typename Interface::stl_matrix A_stl;
   typename Interface::stl_vector B_stl;
   typename Interface::stl_vector X_stl;
@@ -130,10 +115,7 @@
   typename Interface::gene_vector B;
   typename Interface::gene_vector X;
 
-
   int _size;
-
 };
 
-
 #endif
diff --git a/bench/btl/actions/action_syr2.hh b/bench/btl/actions/action_syr2.hh
index 7c6712b..3355faa 100644
--- a/bench/btl/actions/action_syr2.hh
+++ b/bench/btl/actions/action_syr2.hh
@@ -28,89 +28,77 @@
 
 using namespace std;
 
-template<class Interface>
+template <class Interface>
 class Action_syr2 {
-
-public :
-
+ public:
   // Ctor
 
-  BTL_DONT_INLINE Action_syr2( int size ):_size(size)
-  {
+  BTL_DONT_INLINE Action_syr2(int size) : _size(size) {
     // STL matrix and vector initialization
     typename Interface::stl_matrix tmp;
-    init_matrix<pseudo_random>(A_stl,_size);
-    init_vector<pseudo_random>(B_stl,_size);
-    init_vector<pseudo_random>(X_stl,_size);
-    init_vector<null_function>(resu_stl,_size);
+    init_matrix<pseudo_random>(A_stl, _size);
+    init_vector<pseudo_random>(B_stl, _size);
+    init_vector<pseudo_random>(X_stl, _size);
+    init_vector<null_function>(resu_stl, _size);
 
     // generic matrix and vector initialization
-    Interface::matrix_from_stl(A_ref,A_stl);
-    Interface::matrix_from_stl(A,A_stl);
-    Interface::vector_from_stl(B_ref,B_stl);
-    Interface::vector_from_stl(B,B_stl);
-    Interface::vector_from_stl(X_ref,X_stl);
-    Interface::vector_from_stl(X,X_stl);
+    Interface::matrix_from_stl(A_ref, A_stl);
+    Interface::matrix_from_stl(A, A_stl);
+    Interface::vector_from_stl(B_ref, B_stl);
+    Interface::vector_from_stl(B, B_stl);
+    Interface::vector_from_stl(X_ref, X_stl);
+    Interface::vector_from_stl(X, X_stl);
   }
 
   // invalidate copy ctor
-  Action_syr2( const  Action_syr2 & )
-  {
+  Action_syr2(const Action_syr2&) {
     INFOS("illegal call to Action_syr2 Copy Ctor");
     exit(1);
   }
 
   // Dtor
-  BTL_DONT_INLINE ~Action_syr2( void ){
-    Interface::free_matrix(A,_size);
+  BTL_DONT_INLINE ~Action_syr2(void) {
+    Interface::free_matrix(A, _size);
     Interface::free_vector(B);
     Interface::free_vector(X);
-    Interface::free_matrix(A_ref,_size);
+    Interface::free_matrix(A_ref, _size);
     Interface::free_vector(B_ref);
     Interface::free_vector(X_ref);
   }
 
   // action name
 
-  static inline std::string name( void )
-  {
-    return "syr2_" + Interface::name();
+  static inline std::string name(void) { return "syr2_" + Interface::name(); }
+
+  double nb_op_base(void) { return 2.0 * _size * _size; }
+
+  BTL_DONT_INLINE void initialize(void) {
+    Interface::copy_matrix(A_ref, A, _size);
+    Interface::copy_vector(B_ref, B, _size);
+    Interface::copy_vector(X_ref, X, _size);
   }
 
-  double nb_op_base( void ){
-    return 2.0*_size*_size;
+  BTL_DONT_INLINE void calculate(void) {
+    BTL_ASM_COMMENT("#begin syr2");
+    Interface::syr2(A, B, X, _size);
+    BTL_ASM_COMMENT("end syr2");
   }
 
-  BTL_DONT_INLINE  void initialize( void ){
-    Interface::copy_matrix(A_ref,A,_size);
-    Interface::copy_vector(B_ref,B,_size);
-    Interface::copy_vector(X_ref,X,_size);
-  }
-
-  BTL_DONT_INLINE void calculate( void ) {
-      BTL_ASM_COMMENT("#begin syr2");
-      Interface::syr2(A,B,X,_size);
-      BTL_ASM_COMMENT("end syr2");
-  }
-
-  BTL_DONT_INLINE void check_result( void ){
+  BTL_DONT_INLINE void check_result(void) {
     // calculation check
-    Interface::vector_to_stl(X,resu_stl);
+    Interface::vector_to_stl(X, resu_stl);
 
-    STL_interface<typename Interface::real_type>::syr2(A_stl,B_stl,X_stl,_size);
+    STL_interface<typename Interface::real_type>::syr2(A_stl, B_stl, X_stl, _size);
 
-    typename Interface::real_type error=
-      STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl);
+    typename Interface::real_type error = STL_interface<typename Interface::real_type>::norm_diff(X_stl, resu_stl);
 
-    if (error>1.e-3){
+    if (error > 1.e-3) {
       INFOS("WRONG CALCULATION...residual=" << error);
-//       exit(0);
+      //       exit(0);
     }
-
   }
 
-private :
-
+ private:
   typename Interface::stl_matrix A_stl;
   typename Interface::stl_vector B_stl;
   typename Interface::stl_vector X_stl;
@@ -124,10 +112,7 @@
   typename Interface::gene_vector B;
   typename Interface::gene_vector X;
 
-
   int _size;
-
 };
 
-
 #endif
diff --git a/bench/btl/actions/action_trisolve.hh b/bench/btl/actions/action_trisolve.hh
index d6f0b47..6751a20 100644
--- a/bench/btl/actions/action_trisolve.hh
+++ b/bench/btl/actions/action_trisolve.hh
@@ -27,100 +27,82 @@
 
 using namespace std;
 
-template<class Interface>
+template <class Interface>
 class Action_trisolve {
-
-public :
-
+ public:
   // Ctor
 
-  Action_trisolve( int size ):_size(size)
-  {
+  Action_trisolve(int size) : _size(size) {
     MESSAGE("Action_trisolve Ctor");
 
     // STL vector initialization
-    init_matrix<pseudo_random>(L_stl,_size);
-    init_vector<pseudo_random>(B_stl,_size);
-    init_vector<null_function>(X_stl,_size);
-    for (int j=0; j<_size; ++j)
-    {
-      for (int i=0; i<j; ++i)
-        L_stl[j][i] = 0;
+    init_matrix<pseudo_random>(L_stl, _size);
+    init_vector<pseudo_random>(B_stl, _size);
+    init_vector<null_function>(X_stl, _size);
+    for (int j = 0; j < _size; ++j) {
+      for (int i = 0; i < j; ++i) L_stl[j][i] = 0;
       L_stl[j][j] += 3;
     }
 
-    init_vector<null_function>(resu_stl,_size);
+    init_vector<null_function>(resu_stl, _size);
 
     // generic matrix and vector initialization
-    Interface::matrix_from_stl(L,L_stl);
-    Interface::vector_from_stl(X,X_stl);
-    Interface::vector_from_stl(B,B_stl);
+    Interface::matrix_from_stl(L, L_stl);
+    Interface::vector_from_stl(X, X_stl);
+    Interface::vector_from_stl(B, B_stl);
 
     _cost = 0;
-    for (int j=0; j<_size; ++j)
-    {
-      _cost += 2*j + 1;
+    for (int j = 0; j < _size; ++j) {
+      _cost += 2 * j + 1;
     }
   }
 
   // invalidate copy ctor
 
-  Action_trisolve( const  Action_trisolve & )
-  {
+  Action_trisolve(const Action_trisolve&) {
     INFOS("illegal call to Action_trisolve Copy Ctor");
     exit(1);
   }
 
   // Dtor
 
-  ~Action_trisolve( void ){
-
+  ~Action_trisolve(void) {
     MESSAGE("Action_trisolve Dtor");
 
     // deallocation
-    Interface::free_matrix(L,_size);
+    Interface::free_matrix(L, _size);
     Interface::free_vector(B);
     Interface::free_vector(X);
   }
 
   // action name
 
-  static inline std::string name( void )
-  {
-    return "trisolve_vector_"+Interface::name();
+  static inline std::string name(void) { return "trisolve_vector_" + Interface::name(); }
+
+  double nb_op_base(void) { return _cost; }
+
+  inline void initialize(void) {
+    // Interface::copy_vector(X_ref,X,_size);
   }
 
-  double nb_op_base( void ){
-    return _cost;
-  }
+  inline void calculate(void) { Interface::trisolve_lower(L, B, X, _size); }
 
-  inline void initialize( void ){
-    //Interface::copy_vector(X_ref,X,_size);
-  }
-
-  inline void calculate( void ) {
-      Interface::trisolve_lower(L,B,X,_size);
-  }
-
-  void check_result(){
-    if (_size>128) return;
+  void check_result() {
+    if (_size > 128) return;
     // calculation check
-    Interface::vector_to_stl(X,resu_stl);
+    Interface::vector_to_stl(X, resu_stl);
 
-    STL_interface<typename Interface::real_type>::trisolve_lower(L_stl,B_stl,X_stl,_size);
+    STL_interface<typename Interface::real_type>::trisolve_lower(L_stl, B_stl, X_stl, _size);
 
-    typename Interface::real_type error=
-      STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl);
+    typename Interface::real_type error = STL_interface<typename Interface::real_type>::norm_diff(X_stl, resu_stl);
 
-    if (error>1.e-4){
+    if (error > 1.e-4) {
       INFOS("WRONG CALCULATION...residual=" << error);
       exit(2);
-    } //else INFOS("CALCULATION OK...residual=" << error);
-
+    }  // else INFOS("CALCULATION OK...residual=" << error);
   }
 
-private :
-
+ private:
   typename Interface::stl_matrix L_stl;
   typename Interface::stl_vector X_stl;
   typename Interface::stl_vector B_stl;
diff --git a/bench/btl/actions/action_trisolve_matrix.hh b/bench/btl/actions/action_trisolve_matrix.hh
index 0fc2bb9..cf55aae 100644
--- a/bench/btl/actions/action_trisolve_matrix.hh
+++ b/bench/btl/actions/action_trisolve_matrix.hh
@@ -28,118 +28,97 @@
 
 using namespace std;
 
-template<class Interface>
+template <class Interface>
 class Action_trisolve_matrix {
-
-public :
-
+ public:
   // Ctor
 
-  Action_trisolve_matrix( int size ):_size(size)
-  {
+  Action_trisolve_matrix(int size) : _size(size) {
     MESSAGE("Action_trisolve_matrix Ctor");
 
     // STL matrix and vector initialization
 
-    init_matrix<pseudo_random>(A_stl,_size);
-    init_matrix<pseudo_random>(B_stl,_size);
-    init_matrix<null_function>(X_stl,_size);
-    init_matrix<null_function>(resu_stl,_size);
+    init_matrix<pseudo_random>(A_stl, _size);
+    init_matrix<pseudo_random>(B_stl, _size);
+    init_matrix<null_function>(X_stl, _size);
+    init_matrix<null_function>(resu_stl, _size);
 
-    for (int j=0; j<_size; ++j)
-    {
-      for (int i=0; i<j; ++i)
-        A_stl[j][i] = 0;
+    for (int j = 0; j < _size; ++j) {
+      for (int i = 0; i < j; ++i) A_stl[j][i] = 0;
       A_stl[j][j] += 3;
     }
 
     // generic matrix and vector initialization
 
-    Interface::matrix_from_stl(A_ref,A_stl);
-    Interface::matrix_from_stl(B_ref,B_stl);
-    Interface::matrix_from_stl(X_ref,X_stl);
+    Interface::matrix_from_stl(A_ref, A_stl);
+    Interface::matrix_from_stl(B_ref, B_stl);
+    Interface::matrix_from_stl(X_ref, X_stl);
 
-    Interface::matrix_from_stl(A,A_stl);
-    Interface::matrix_from_stl(B,B_stl);
-    Interface::matrix_from_stl(X,X_stl);
+    Interface::matrix_from_stl(A, A_stl);
+    Interface::matrix_from_stl(B, B_stl);
+    Interface::matrix_from_stl(X, X_stl);
 
     _cost = 0;
-    for (int j=0; j<_size; ++j)
-    {
-      _cost += 2*j + 1;
+    for (int j = 0; j < _size; ++j) {
+      _cost += 2 * j + 1;
     }
     _cost *= _size;
   }
 
   // invalidate copy ctor
 
-  Action_trisolve_matrix( const  Action_trisolve_matrix & )
-  {
+  Action_trisolve_matrix(const Action_trisolve_matrix&) {
     INFOS("illegal call to Action_trisolve_matrix Copy Ctor");
     exit(0);
   }
 
   // Dtor
 
-  ~Action_trisolve_matrix( void ){
-
+  ~Action_trisolve_matrix(void) {
     MESSAGE("Action_trisolve_matrix Dtor");
 
     // deallocation
 
-    Interface::free_matrix(A,_size);
-    Interface::free_matrix(B,_size);
-    Interface::free_matrix(X,_size);
+    Interface::free_matrix(A, _size);
+    Interface::free_matrix(B, _size);
+    Interface::free_matrix(X, _size);
 
-    Interface::free_matrix(A_ref,_size);
-    Interface::free_matrix(B_ref,_size);
-    Interface::free_matrix(X_ref,_size);
-
+    Interface::free_matrix(A_ref, _size);
+    Interface::free_matrix(B_ref, _size);
+    Interface::free_matrix(X_ref, _size);
   }
 
   // action name
 
-  static inline std::string name( void )
-  {
-    return "trisolve_matrix_"+Interface::name();
+  static inline std::string name(void) { return "trisolve_matrix_" + Interface::name(); }
+
+  double nb_op_base(void) { return _cost; }
+
+  inline void initialize(void) {
+    Interface::copy_matrix(A_ref, A, _size);
+    Interface::copy_matrix(B_ref, B, _size);
+    Interface::copy_matrix(X_ref, X, _size);
   }
 
-  double nb_op_base( void ){
-    return _cost;
-  }
+  inline void calculate(void) { Interface::trisolve_lower_matrix(A, B, X, _size); }
 
-  inline void initialize( void ){
-
-    Interface::copy_matrix(A_ref,A,_size);
-    Interface::copy_matrix(B_ref,B,_size);
-    Interface::copy_matrix(X_ref,X,_size);
-
-  }
-
-  inline void calculate( void ) {
-      Interface::trisolve_lower_matrix(A,B,X,_size);
-  }
-
-  void check_result( void ){
-
+  void check_result(void) {
     // calculation check
 
-//     Interface::matrix_to_stl(X,resu_stl);
-//
-//     STL_interface<typename Interface::real_type>::matrix_matrix_product(A_stl,B_stl,X_stl,_size);
-//
-//     typename Interface::real_type error=
-//       STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl);
-//
-//     if (error>1.e-6){
-//       INFOS("WRONG CALCULATION...residual=" << error);
-// //       exit(1);
-//     }
-
+    //     Interface::matrix_to_stl(X,resu_stl);
+    //
+    //     STL_interface<typename Interface::real_type>::matrix_matrix_product(A_stl,B_stl,X_stl,_size);
+    //
+    //     typename Interface::real_type error=
+    //       STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl);
+    //
+    //     if (error>1.e-6){
+    //       INFOS("WRONG CALCULATION...residual=" << error);
+    // //       exit(1);
+    //     }
   }
 
-private :
-
+ private:
   typename Interface::stl_matrix A_stl;
   typename Interface::stl_matrix B_stl;
   typename Interface::stl_matrix X_stl;
@@ -155,11 +134,6 @@
 
   int _size;
   double _cost;
-
 };
 
-
 #endif
-
-
-
diff --git a/bench/btl/actions/action_trmm.hh b/bench/btl/actions/action_trmm.hh
index 8f78138..8c0b25f 100644
--- a/bench/btl/actions/action_trmm.hh
+++ b/bench/btl/actions/action_trmm.hh
@@ -28,118 +28,97 @@
 
 using namespace std;
 
-template<class Interface>
+template <class Interface>
 class Action_trmm {
-
-public :
-
+ public:
   // Ctor
 
-  Action_trmm( int size ):_size(size)
-  {
+  Action_trmm(int size) : _size(size) {
     MESSAGE("Action_trmm Ctor");
 
     // STL matrix and vector initialization
 
-    init_matrix<pseudo_random>(A_stl,_size);
-    init_matrix<pseudo_random>(B_stl,_size);
-    init_matrix<null_function>(X_stl,_size);
-    init_matrix<null_function>(resu_stl,_size);
+    init_matrix<pseudo_random>(A_stl, _size);
+    init_matrix<pseudo_random>(B_stl, _size);
+    init_matrix<null_function>(X_stl, _size);
+    init_matrix<null_function>(resu_stl, _size);
 
-    for (int j=0; j<_size; ++j)
-    {
-      for (int i=0; i<j; ++i)
-        A_stl[j][i] = 0;
+    for (int j = 0; j < _size; ++j) {
+      for (int i = 0; i < j; ++i) A_stl[j][i] = 0;
       A_stl[j][j] += 3;
     }
 
     // generic matrix and vector initialization
 
-    Interface::matrix_from_stl(A_ref,A_stl);
-    Interface::matrix_from_stl(B_ref,B_stl);
-    Interface::matrix_from_stl(X_ref,X_stl);
+    Interface::matrix_from_stl(A_ref, A_stl);
+    Interface::matrix_from_stl(B_ref, B_stl);
+    Interface::matrix_from_stl(X_ref, X_stl);
 
-    Interface::matrix_from_stl(A,A_stl);
-    Interface::matrix_from_stl(B,B_stl);
-    Interface::matrix_from_stl(X,X_stl);
+    Interface::matrix_from_stl(A, A_stl);
+    Interface::matrix_from_stl(B, B_stl);
+    Interface::matrix_from_stl(X, X_stl);
 
     _cost = 0;
-    for (int j=0; j<_size; ++j)
-    {
-      _cost += 2*j + 1;
+    for (int j = 0; j < _size; ++j) {
+      _cost += 2 * j + 1;
     }
     _cost *= _size;
   }
 
   // invalidate copy ctor
 
-  Action_trmm( const  Action_trmm & )
-  {
+  Action_trmm(const Action_trmm&) {
     INFOS("illegal call to Action_trmm Copy Ctor");
     exit(0);
   }
 
   // Dtor
 
-  ~Action_trmm( void ){
-
+  ~Action_trmm(void) {
     MESSAGE("Action_trmm Dtor");
 
     // deallocation
 
-    Interface::free_matrix(A,_size);
-    Interface::free_matrix(B,_size);
-    Interface::free_matrix(X,_size);
+    Interface::free_matrix(A, _size);
+    Interface::free_matrix(B, _size);
+    Interface::free_matrix(X, _size);
 
-    Interface::free_matrix(A_ref,_size);
-    Interface::free_matrix(B_ref,_size);
-    Interface::free_matrix(X_ref,_size);
-
+    Interface::free_matrix(A_ref, _size);
+    Interface::free_matrix(B_ref, _size);
+    Interface::free_matrix(X_ref, _size);
   }
 
   // action name
 
-  static inline std::string name( void )
-  {
-    return "trmm_"+Interface::name();
+  static inline std::string name(void) { return "trmm_" + Interface::name(); }
+
+  double nb_op_base(void) { return _cost; }
+
+  inline void initialize(void) {
+    Interface::copy_matrix(A_ref, A, _size);
+    Interface::copy_matrix(B_ref, B, _size);
+    Interface::copy_matrix(X_ref, X, _size);
   }
 
-  double nb_op_base( void ){
-    return _cost;
-  }
+  inline void calculate(void) { Interface::trmm(A, B, X, _size); }
 
-  inline void initialize( void ){
-
-    Interface::copy_matrix(A_ref,A,_size);
-    Interface::copy_matrix(B_ref,B,_size);
-    Interface::copy_matrix(X_ref,X,_size);
-
-  }
-
-  inline void calculate( void ) {
-      Interface::trmm(A,B,X,_size);
-  }
-
-  void check_result( void ){
-
+  void check_result(void) {
     // calculation check
 
-//     Interface::matrix_to_stl(X,resu_stl);
-//
-//     STL_interface<typename Interface::real_type>::matrix_matrix_product(A_stl,B_stl,X_stl,_size);
-//
-//     typename Interface::real_type error=
-//       STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl);
-//
-//     if (error>1.e-6){
-//       INFOS("WRONG CALCULATION...residual=" << error);
-// //       exit(1);
-//     }
-
+    //     Interface::matrix_to_stl(X,resu_stl);
+    //
+    //     STL_interface<typename Interface::real_type>::matrix_matrix_product(A_stl,B_stl,X_stl,_size);
+    //
+    //     typename Interface::real_type error=
+    //       STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl);
+    //
+    //     if (error>1.e-6){
+    //       INFOS("WRONG CALCULATION...residual=" << error);
+    // //       exit(1);
+    //     }
   }
 
-private :
-
+ private:
   typename Interface::stl_matrix A_stl;
   typename Interface::stl_matrix B_stl;
   typename Interface::stl_matrix X_stl;
@@ -155,11 +134,6 @@
 
   int _size;
   double _cost;
-
 };
 
-
 #endif
-
-
-
diff --git a/bench/btl/actions/basic_actions.hh b/bench/btl/actions/basic_actions.hh
index 62442f0..e2e1f1c 100644
--- a/bench/btl/actions/basic_actions.hh
+++ b/bench/btl/actions/basic_actions.hh
@@ -18,4 +18,3 @@
 #include "action_rot.hh"
 
 // #include "action_lu_solve.hh"
-
diff --git a/bench/btl/data/mean.cxx b/bench/btl/data/mean.cxx
index c567ef3..fe4b453 100644
--- a/bench/btl/data/mean.cxx
+++ b/bench/btl/data/mean.cxx
@@ -1,14 +1,14 @@
 //=====================================================
 // File   :  mean.cxx
-// Author :  L. Plagne <laurent.plagne@edf.fr)>        
+// Author :  L. Plagne <laurent.plagne@edf.fr)>
 // Copyright (C) EDF R&D,  lun sep 30 14:23:15 CEST 2002
 //=====================================================
-// 
+//
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
 // as published by the Free Software Foundation; either version 2
 // of the License, or (at your option) any later version.
-// 
+//
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -16,7 +16,7 @@
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-// 
+//
 #include "utilities.h"
 #include <vector>
 #include <string>
@@ -28,155 +28,138 @@
 
 using namespace std;
 
-double mean_calc(const vector<int> & tab_sizes, const vector<double> & tab_mflops, const int size_min, const int size_max);
+double mean_calc(const vector<int> &tab_sizes, const vector<double> &tab_mflops, const int size_min,
+                 const int size_max);
 
-class Lib_Mean{
-
-public:
-  Lib_Mean( void ):_lib_name(),_mean_in_cache(),_mean_out_of_cache(){
+class Lib_Mean {
+ public:
+  Lib_Mean(void) : _lib_name(), _mean_in_cache(), _mean_out_of_cache() {
     MESSAGE("Lib_mean Default Ctor");
     MESSAGE("!!! should not be used");
     exit(0);
   }
-  Lib_Mean(const string & name, const double & mic, const double & moc):_lib_name(name),_mean_in_cache(mic),_mean_out_of_cache(moc){
+  Lib_Mean(const string &name, const double &mic, const double &moc)
+      : _lib_name(name), _mean_in_cache(mic), _mean_out_of_cache(moc) {
     MESSAGE("Lib_mean Ctor");
   }
-  Lib_Mean(const Lib_Mean & lm):_lib_name(lm._lib_name),_mean_in_cache(lm._mean_in_cache),_mean_out_of_cache(lm._mean_out_of_cache){
+  Lib_Mean(const Lib_Mean &lm)
+      : _lib_name(lm._lib_name), _mean_in_cache(lm._mean_in_cache), _mean_out_of_cache(lm._mean_out_of_cache) {
     MESSAGE("Lib_mean Copy Ctor");
   }
-  ~Lib_Mean( void ){
-    MESSAGE("Lib_mean Dtor");
-  }
-    
+  ~Lib_Mean(void) { MESSAGE("Lib_mean Dtor"); }
+
   double _mean_in_cache;
   double _mean_out_of_cache;
   string _lib_name;
 
-  bool operator < ( const Lib_Mean &right) const 
-  {
-    //return ( this->_mean_out_of_cache > right._mean_out_of_cache) ;
-    return ( this->_mean_in_cache > right._mean_in_cache) ;
+  bool operator<(const Lib_Mean &right) const {
+    // return ( this->_mean_out_of_cache > right._mean_out_of_cache) ;
+    return (this->_mean_in_cache > right._mean_in_cache);
   }
+};
 
-}; 
-
-
-int main( int argc , char *argv[] )
-{
-
-  if (argc<6){
+int main(int argc, char *argv[]) {
+  if (argc < 6) {
     INFOS("!!! Error ... usage : main what mic Mic moc Moc filename1 finename2...");
     exit(0);
   }
   INFOS(argc);
 
-  int min_in_cache=atoi(argv[2]);
-  int max_in_cache=atoi(argv[3]);
-  int min_out_of_cache=atoi(argv[4]);
-  int max_out_of_cache=atoi(argv[5]);
+  int min_in_cache = atoi(argv[2]);
+  int max_in_cache = atoi(argv[3]);
+  int min_out_of_cache = atoi(argv[4]);
+  int max_out_of_cache = atoi(argv[5]);
 
+  multiset<Lib_Mean> s_lib_mean;
 
-  multiset<Lib_Mean> s_lib_mean ;
+  for (int i = 6; i < argc; i++) {
+    string filename = argv[i];
 
-  for (int i=6;i<argc;i++){
-    
-    string filename=argv[i];
-    
     INFOS(filename);
 
-    double mic=0;
-    double moc=0;
+    double mic = 0;
+    double moc = 0;
 
     {
-      
       vector<int> tab_sizes;
       vector<double> tab_mflops;
 
-      read_xy_file(filename,tab_sizes,tab_mflops);
+      read_xy_file(filename, tab_sizes, tab_mflops);
 
-      mic=mean_calc(tab_sizes,tab_mflops,min_in_cache,max_in_cache);
-      moc=mean_calc(tab_sizes,tab_mflops,min_out_of_cache,max_out_of_cache);
+      mic = mean_calc(tab_sizes, tab_mflops, min_in_cache, max_in_cache);
+      moc = mean_calc(tab_sizes, tab_mflops, min_out_of_cache, max_out_of_cache);
 
-      Lib_Mean cur_lib_mean(filename,mic,moc);
-      
-      s_lib_mean.insert(cur_lib_mean);	
+      Lib_Mean cur_lib_mean(filename, mic, moc);
 
-    }   
-           
+      s_lib_mean.insert(cur_lib_mean);
+    }
   }
 
-
-  cout << "<TABLE BORDER CELLPADDING=2>" << endl ;
-  cout << "  <TR>" << endl ;
-  cout << "    <TH ALIGN=CENTER> " << argv[1] << " </TH>" << endl ;
-  cout << "    <TH ALIGN=CENTER> <a href=""#mean_marker""> in cache <BR> mean perf <BR> Mflops </a></TH>" << endl ;
-  cout << "    <TH ALIGN=CENTER> in cache <BR> % best </TH>" << endl ;
-  cout << "    <TH ALIGN=CENTER> <a href=""#mean_marker""> out of cache <BR> mean perf <BR> Mflops </a></TH>" << endl ;
-  cout << "    <TH ALIGN=CENTER> out of cache <BR> % best </TH>" << endl ;
-  cout << "    <TH ALIGN=CENTER> details </TH>" << endl ;
-  cout << "    <TH ALIGN=CENTER> comments </TH>" << endl ;
-  cout << "  </TR>" << endl ;
+  cout << "<TABLE BORDER CELLPADDING=2>" << endl;
+  cout << "  <TR>" << endl;
+  cout << "    <TH ALIGN=CENTER> " << argv[1] << " </TH>" << endl;
+  cout << "    <TH ALIGN=CENTER> <a href="
+          "#mean_marker"
+          "> in cache <BR> mean perf <BR> Mflops </a></TH>"
+       << endl;
+  cout << "    <TH ALIGN=CENTER> in cache <BR> % best </TH>" << endl;
+  cout << "    <TH ALIGN=CENTER> <a href="
+          "#mean_marker"
+          "> out of cache <BR> mean perf <BR> Mflops </a></TH>"
+       << endl;
+  cout << "    <TH ALIGN=CENTER> out of cache <BR> % best </TH>" << endl;
+  cout << "    <TH ALIGN=CENTER> details </TH>" << endl;
+  cout << "    <TH ALIGN=CENTER> comments </TH>" << endl;
+  cout << "  </TR>" << endl;
 
   multiset<Lib_Mean>::iterator is = s_lib_mean.begin();
-  Lib_Mean best(*is);  
-  
+  Lib_Mean best(*is);
 
-  for (is=s_lib_mean.begin(); is!=s_lib_mean.end() ; is++){
-
-    cout << "  <TR>" << endl ;
-    cout << "     <TD> " << is->_lib_name << " </TD>" << endl ;
-    cout << "     <TD> " << is->_mean_in_cache << " </TD>" << endl ;
-    cout << "     <TD> " << 100*(is->_mean_in_cache/best._mean_in_cache) << " </TD>" << endl ;
-    cout << "     <TD> " << is->_mean_out_of_cache << " </TD>" << endl ;
-    cout << "     <TD> " << 100*(is->_mean_out_of_cache/best._mean_out_of_cache) << " </TD>" << endl ;
-    cout << "     <TD> " << 
-      "<a href=\"#"<<is->_lib_name<<"_"<<argv[1]<<"\">snippet</a>/" 
-      "<a href=\"#"<<is->_lib_name<<"_flags\">flags</a>  </TD>" << endl ;
-    cout << "     <TD> " << 
-      "<a href=\"#"<<is->_lib_name<<"_comments\">click here</a>  </TD>" << endl ;
-    cout << "  </TR>" << endl ;
-  
+  for (is = s_lib_mean.begin(); is != s_lib_mean.end(); is++) {
+    cout << "  <TR>" << endl;
+    cout << "     <TD> " << is->_lib_name << " </TD>" << endl;
+    cout << "     <TD> " << is->_mean_in_cache << " </TD>" << endl;
+    cout << "     <TD> " << 100 * (is->_mean_in_cache / best._mean_in_cache) << " </TD>" << endl;
+    cout << "     <TD> " << is->_mean_out_of_cache << " </TD>" << endl;
+    cout << "     <TD> " << 100 * (is->_mean_out_of_cache / best._mean_out_of_cache) << " </TD>" << endl;
+    cout << "     <TD> "
+         << "<a href=\"#" << is->_lib_name << "_" << argv[1]
+         << "\">snippet</a>/"
+            "<a href=\"#"
+         << is->_lib_name << "_flags\">flags</a>  </TD>" << endl;
+    cout << "     <TD> "
+         << "<a href=\"#" << is->_lib_name << "_comments\">click here</a>  </TD>" << endl;
+    cout << "  </TR>" << endl;
   }
 
-  cout << "</TABLE>" << endl ;
+  cout << "</TABLE>" << endl;
 
-  ofstream output_file ("../order_lib",ios::out) ;
-  
-  for (is=s_lib_mean.begin(); is!=s_lib_mean.end() ; is++){
-    output_file << is->_lib_name << endl ;
+  ofstream output_file("../order_lib", ios::out);
+
+  for (is = s_lib_mean.begin(); is != s_lib_mean.end(); is++) {
+    output_file << is->_lib_name << endl;
   }
 
   output_file.close();
-
 }
 
-double mean_calc(const vector<int> & tab_sizes, const vector<double> & tab_mflops, const int size_min, const int size_max){
-  
-  int size=tab_sizes.size();
-  int nb_sample=0;
-  double mean=0.0;
+double mean_calc(const vector<int> &tab_sizes, const vector<double> &tab_mflops, const int size_min,
+                 const int size_max) {
+  int size = tab_sizes.size();
+  int nb_sample = 0;
+  double mean = 0.0;
 
-  for (int i=0;i<size;i++){
-    
-    
-    if ((tab_sizes[i]>=size_min)&&(tab_sizes[i]<=size_max)){
-      
+  for (int i = 0; i < size; i++) {
+    if ((tab_sizes[i] >= size_min) && (tab_sizes[i] <= size_max)) {
       nb_sample++;
-      mean+=tab_mflops[i];
-
+      mean += tab_mflops[i];
     }
-
-    
   }
 
-  if (nb_sample==0){
+  if (nb_sample == 0) {
     INFOS("no data for mean calculation");
     return 0.0;
   }
 
-  return mean/nb_sample;
+  return mean / nb_sample;
 }
-
-  
-
-
diff --git a/bench/btl/data/regularize.cxx b/bench/btl/data/regularize.cxx
index eea2b8b..51e2edf 100644
--- a/bench/btl/data/regularize.cxx
+++ b/bench/btl/data/regularize.cxx
@@ -1,14 +1,14 @@
 //=====================================================
 // File   :  regularize.cxx
-// Author :  L. Plagne <laurent.plagne@edf.fr)>        
+// Author :  L. Plagne <laurent.plagne@edf.fr)>
 // Copyright (C) EDF R&D,  lun sep 30 14:23:15 CEST 2002
 //=====================================================
-// 
+//
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
 // as published by the Free Software Foundation; either version 2
 // of the License, or (at your option) any later version.
-// 
+//
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -16,7 +16,7 @@
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-// 
+//
 #include "utilities.h"
 #include <vector>
 #include <string>
@@ -27,99 +27,82 @@
 
 using namespace std;
 
-void read_xy_file(const string & filename, vector<int> & tab_sizes, vector<double> & tab_mflops);
-void regularize_curve(const string & filename,
-		      const vector<double> & tab_mflops, 
-		      const vector<int> & tab_sizes, 
-		      int start_cut_size, int stop_cut_size);
+void read_xy_file(const string &filename, vector<int> &tab_sizes, vector<double> &tab_mflops);
+void regularize_curve(const string &filename, const vector<double> &tab_mflops, const vector<int> &tab_sizes,
+                      int start_cut_size, int stop_cut_size);
 /////////////////////////////////////////////////////////////////////////////////////////////////
 
-int main( int argc , char *argv[] )
-{
-
+int main(int argc, char *argv[]) {
   // input data
 
-  if (argc<4){
+  if (argc < 4) {
     INFOS("!!! Error ... usage : main filename start_cut_size stop_cut_size regularize_filename");
     exit(0);
   }
   INFOS(argc);
 
-  int start_cut_size=atoi(argv[2]);
-  int stop_cut_size=atoi(argv[3]);
+  int start_cut_size = atoi(argv[2]);
+  int stop_cut_size = atoi(argv[3]);
 
-  string filename=argv[1];
-  string regularize_filename=argv[4];
-  
+  string filename = argv[1];
+  string regularize_filename = argv[4];
+
   INFOS(filename);
-  INFOS("start_cut_size="<<start_cut_size);
+  INFOS("start_cut_size=" << start_cut_size);
 
   vector<int> tab_sizes;
   vector<double> tab_mflops;
 
-  read_xy_file(filename,tab_sizes,tab_mflops);
+  read_xy_file(filename, tab_sizes, tab_mflops);
 
   // regularizeing
 
-  regularize_curve(regularize_filename,tab_mflops,tab_sizes,start_cut_size,stop_cut_size);
-  
-
+  regularize_curve(regularize_filename, tab_mflops, tab_sizes, start_cut_size, stop_cut_size);
 }
 
 //////////////////////////////////////////////////////////////////////////////////////
 
-void regularize_curve(const string & filename,
-		      const vector<double> & tab_mflops, 
-		      const vector<int> & tab_sizes, 
-		      int start_cut_size, int stop_cut_size)
-{
-  int size=tab_mflops.size();
-  ofstream output_file (filename.c_str(),ios::out) ;
+void regularize_curve(const string &filename, const vector<double> &tab_mflops, const vector<int> &tab_sizes,
+                      int start_cut_size, int stop_cut_size) {
+  int size = tab_mflops.size();
+  ofstream output_file(filename.c_str(), ios::out);
 
-  int i=0;
+  int i = 0;
 
-  while(tab_sizes[i]<start_cut_size){
-    
-    output_file << tab_sizes[i] << " " <<  tab_mflops[i] << endl ;
+  while (tab_sizes[i] < start_cut_size) {
+    output_file << tab_sizes[i] << " " << tab_mflops[i] << endl;
     i++;
-
-  }
-    
-  output_file << endl ;
-
-  while(tab_sizes[i]<stop_cut_size){
-    
-    i++;
-
   }
 
-  while(i<size){
-    
-    output_file << tab_sizes[i] << " " <<  tab_mflops[i] << endl ;
-    i++;
+  output_file << endl;
 
+  while (tab_sizes[i] < stop_cut_size) {
+    i++;
+  }
+
+  while (i < size) {
+    output_file << tab_sizes[i] << " " << tab_mflops[i] << endl;
+    i++;
   }
 
   output_file.close();
-
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-void read_xy_file(const string & filename, vector<int> & tab_sizes, vector<double> & tab_mflops){
+void read_xy_file(const string &filename, vector<int> &tab_sizes, vector<double> &tab_mflops) {
+  ifstream input_file(filename.c_str(), ios::in);
 
-  ifstream input_file (filename.c_str(),ios::in) ;
-
-  if (!input_file){
-    INFOS("!!! Error opening "<<filename);
+  if (!input_file) {
+    INFOS("!!! Error opening " << filename);
     exit(0);
   }
-  
-  int nb_point=0;
-  int size=0;
-  double mflops=0;
 
-  while (input_file >> size >> mflops ){
+  int nb_point = 0;
+  int size = 0;
+  double mflops = 0;
+
+  while (input_file >> size >> mflops) {
     nb_point++;
     tab_sizes.push_back(size);
     tab_mflops.push_back(mflops);
@@ -128,4 +111,3 @@
 
   input_file.close();
 }
-
diff --git a/bench/btl/data/smooth.cxx b/bench/btl/data/smooth.cxx
index e5270cc..b0a2d96 100644
--- a/bench/btl/data/smooth.cxx
+++ b/bench/btl/data/smooth.cxx
@@ -1,14 +1,14 @@
 //=====================================================
 // File   :  smooth.cxx
-// Author :  L. Plagne <laurent.plagne@edf.fr)>        
+// Author :  L. Plagne <laurent.plagne@edf.fr)>
 // Copyright (C) EDF R&D,  lun sep 30 14:23:15 CEST 2002
 //=====================================================
-// 
+//
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
 // as published by the Free Software Foundation; either version 2
 // of the License, or (at your option) any later version.
-// 
+//
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -16,7 +16,7 @@
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-// 
+//
 #include "utilities.h"
 #include <vector>
 #include <deque>
@@ -28,165 +28,133 @@
 
 using namespace std;
 
-void read_xy_file(const string & filename, vector<int> & tab_sizes, vector<double> & tab_mflops);
-void write_xy_file(const string & filename, vector<int> & tab_sizes, vector<double> & tab_mflops);
-void smooth_curve(const vector<double> & tab_mflops, vector<double> & smooth_tab_mflops,int window_half_width);
-void centered_smooth_curve(const vector<double> & tab_mflops, vector<double> & smooth_tab_mflops,int window_half_width);
+void read_xy_file(const string &filename, vector<int> &tab_sizes, vector<double> &tab_mflops);
+void write_xy_file(const string &filename, vector<int> &tab_sizes, vector<double> &tab_mflops);
+void smooth_curve(const vector<double> &tab_mflops, vector<double> &smooth_tab_mflops, int window_half_width);
+void centered_smooth_curve(const vector<double> &tab_mflops, vector<double> &smooth_tab_mflops, int window_half_width);
 
 /////////////////////////////////////////////////////////////////////////////////////////////////
 
-int main( int argc , char *argv[] )
-{
-
+int main(int argc, char *argv[]) {
   // input data
 
-  if (argc<3){
+  if (argc < 3) {
     INFOS("!!! Error ... usage : main filename window_half_width smooth_filename");
     exit(0);
   }
   INFOS(argc);
 
-  int window_half_width=atoi(argv[2]);
+  int window_half_width = atoi(argv[2]);
 
-  string filename=argv[1];
-  string smooth_filename=argv[3];
-  
+  string filename = argv[1];
+  string smooth_filename = argv[3];
+
   INFOS(filename);
-  INFOS("window_half_width="<<window_half_width);
+  INFOS("window_half_width=" << window_half_width);
 
   vector<int> tab_sizes;
   vector<double> tab_mflops;
 
-  read_xy_file(filename,tab_sizes,tab_mflops);
+  read_xy_file(filename, tab_sizes, tab_mflops);
 
   // smoothing
 
   vector<double> smooth_tab_mflops;
 
-  //smooth_curve(tab_mflops,smooth_tab_mflops,window_half_width);
-  centered_smooth_curve(tab_mflops,smooth_tab_mflops,window_half_width);
+  // smooth_curve(tab_mflops,smooth_tab_mflops,window_half_width);
+  centered_smooth_curve(tab_mflops, smooth_tab_mflops, window_half_width);
 
   // output result
 
-  write_xy_file(smooth_filename,tab_sizes,smooth_tab_mflops);
-  
-
+  write_xy_file(smooth_filename, tab_sizes, smooth_tab_mflops);
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-template<class VECTOR>
-double weighted_mean(const VECTOR & data)
-{
+template <class VECTOR>
+double weighted_mean(const VECTOR &data) {
+  double mean = 0.0;
 
-  double mean=0.0;
-  
-  for (int i=0 ; i<data.size() ; i++){
-
-    mean+=data[i];
-
+  for (int i = 0; i < data.size(); i++) {
+    mean += data[i];
   }
 
-  return mean/double(data.size()) ;
-
-}    
-
-
-
+  return mean / double(data.size());
+}
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
+void smooth_curve(const vector<double> &tab_mflops, vector<double> &smooth_tab_mflops, int window_half_width) {
+  int window_width = 2 * window_half_width + 1;
 
-void smooth_curve(const vector<double> & tab_mflops, vector<double> & smooth_tab_mflops,int window_half_width){
-  
-  int window_width=2*window_half_width+1;
-
-  int size=tab_mflops.size();
+  int size = tab_mflops.size();
 
   vector<double> sample(window_width);
-  
-  for (int i=0 ; i < size ; i++){
-    
-    for ( int j=0 ; j < window_width ; j++ ){
-      
-      int shifted_index=i+j-window_half_width;
-      if (shifted_index<0) shifted_index=0;
-      if (shifted_index>size-1) shifted_index=size-1;
-      sample[j]=tab_mflops[shifted_index];
-      
+
+  for (int i = 0; i < size; i++) {
+    for (int j = 0; j < window_width; j++) {
+      int shifted_index = i + j - window_half_width;
+      if (shifted_index < 0) shifted_index = 0;
+      if (shifted_index > size - 1) shifted_index = size - 1;
+      sample[j] = tab_mflops[shifted_index];
     }
 
     smooth_tab_mflops.push_back(weighted_mean(sample));
-
   }
-
 }
 
-void centered_smooth_curve(const vector<double> & tab_mflops, vector<double> & smooth_tab_mflops,int window_half_width){
-  
-  int max_window_width=2*window_half_width+1;
+void centered_smooth_curve(const vector<double> &tab_mflops, vector<double> &smooth_tab_mflops, int window_half_width) {
+  int max_window_width = 2 * window_half_width + 1;
 
-  int size=tab_mflops.size();
+  int size = tab_mflops.size();
 
-  
-  for (int i=0 ; i < size ; i++){
-
+  for (int i = 0; i < size; i++) {
     deque<double> sample;
 
-    
     sample.push_back(tab_mflops[i]);
 
-    for ( int j=1 ; j <= window_half_width ; j++ ){
-      
-      int before=i-j;
-      int after=i+j;
-      
-      if ((before>=0)&&(after<size)) // inside of the vector
-	{ 
-	  sample.push_front(tab_mflops[before]);
-	  sample.push_back(tab_mflops[after]);
-	}
+    for (int j = 1; j <= window_half_width; j++) {
+      int before = i - j;
+      int after = i + j;
+
+      if ((before >= 0) && (after < size))  // inside of the vector
+      {
+        sample.push_front(tab_mflops[before]);
+        sample.push_back(tab_mflops[after]);
+      }
     }
-    
+
     smooth_tab_mflops.push_back(weighted_mean(sample));
-    
+  }
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+void write_xy_file(const string &filename, vector<int> &tab_sizes, vector<double> &tab_mflops) {
+  ofstream output_file(filename.c_str(), ios::out);
+
+  for (int i = 0; i < tab_sizes.size(); i++) {
+    output_file << tab_sizes[i] << " " << tab_mflops[i] << endl;
   }
 
-}
-
-
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void write_xy_file(const string & filename, vector<int> & tab_sizes, vector<double> & tab_mflops){
-
-  ofstream output_file (filename.c_str(),ios::out) ;
-  
-  for (int i=0 ; i < tab_sizes.size() ; i++)
-    {
-      output_file << tab_sizes[i] << " " <<  tab_mflops[i] << endl ;
-    }
-  
   output_file.close();
-
 }
 
-
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-void read_xy_file(const string & filename, vector<int> & tab_sizes, vector<double> & tab_mflops){
+void read_xy_file(const string &filename, vector<int> &tab_sizes, vector<double> &tab_mflops) {
+  ifstream input_file(filename.c_str(), ios::in);
 
-  ifstream input_file (filename.c_str(),ios::in) ;
-
-  if (!input_file){
-    INFOS("!!! Error opening "<<filename);
+  if (!input_file) {
+    INFOS("!!! Error opening " << filename);
     exit(0);
   }
-  
-  int nb_point=0;
-  int size=0;
-  double mflops=0;
 
-  while (input_file >> size >> mflops ){
+  int nb_point = 0;
+  int size = 0;
+  double mflops = 0;
+
+  while (input_file >> size >> mflops) {
     nb_point++;
     tab_sizes.push_back(size);
     tab_mflops.push_back(mflops);
@@ -195,4 +163,3 @@
 
   input_file.close();
 }
-
diff --git a/bench/btl/generic_bench/bench.hh b/bench/btl/generic_bench/bench.hh
index 0732940..cb3c359 100644
--- a/bench/btl/generic_bench/bench.hh
+++ b/bench/btl/generic_bench/bench.hh
@@ -33,19 +33,17 @@
 // #include "timers/x86_perf_analyzer.hh"
 // #include "timers/STL_perf_analyzer.hh"
 #ifdef HAVE_MKL
-extern "C" void cblas_saxpy(const int, const float, const float*, const int, float *, const int);
+extern "C" void cblas_saxpy(const int, const float, const float *, const int, float *, const int);
 #endif
 using namespace std;
 
-template <template<class> class Perf_Analyzer, class Action>
-BTL_DONT_INLINE void bench( int size_min, int size_max, int nb_point )
-{
-  if (BtlConfig::skipAction(Action::name()))
-    return;
+template <template <class> class Perf_Analyzer, class Action>
+BTL_DONT_INLINE void bench(int size_min, int size_max, int nb_point) {
+  if (BtlConfig::skipAction(Action::name())) return;
 
-  string filename="bench_"+Action::name()+".dat";
+  string filename = "bench_" + Action::name() + ".dat";
 
-  INFOS("starting " <<filename);
+  INFOS("starting " << filename);
 
   // utilities
 
@@ -53,7 +51,7 @@
   std::vector<int> tab_sizes(nb_point);
 
   // matrices and vector size calculations
-  size_lin_log(nb_point,size_min,size_max,tab_sizes);
+  size_lin_log(nb_point, size_min, size_max, tab_sizes);
 
   std::vector<int> oldSizes;
   std::vector<double> oldFlops;
@@ -62,29 +60,26 @@
 
   // loop on matrix size
   Perf_Analyzer<Action> perf_action;
-  for (int i=nb_point-1;i>=0;i--)
-  {
-    //INFOS("size=" <<tab_sizes[i]<<"   ("<<nb_point-i<<"/"<<nb_point<<")");
-    std::cout << " " << "size = " << tab_sizes[i] << "  " << std::flush;
+  for (int i = nb_point - 1; i >= 0; i--) {
+    // INFOS("size=" <<tab_sizes[i]<<"   ("<<nb_point-i<<"/"<<nb_point<<")");
+    std::cout << " "
+              << "size = " << tab_sizes[i] << "  " << std::flush;
 
     BTL_DISABLE_SSE_EXCEPTIONS();
-    #ifdef HAVE_MKL
+#ifdef HAVE_MKL
     {
       float dummy;
-      cblas_saxpy(1,0,&dummy,1,&dummy,1);
+      cblas_saxpy(1, 0, &dummy, 1, &dummy, 1);
     }
-    #endif
+#endif
 
     tab_mflops[i] = perf_action.eval_mflops(tab_sizes[i]);
     std::cout << tab_mflops[i];
-    
-    if (hasOldResults)
-    {
-      while (oldi>=0 && oldSizes[oldi]>tab_sizes[i])
-        --oldi;
-      if (oldi>=0 && oldSizes[oldi]==tab_sizes[i])
-      {
-        if (oldFlops[oldi]<tab_mflops[i])
+
+    if (hasOldResults) {
+      while (oldi >= 0 && oldSizes[oldi] > tab_sizes[i]) --oldi;
+      if (oldi >= 0 && oldSizes[oldi] == tab_sizes[i]) {
+        if (oldFlops[oldi] < tab_mflops[i])
           std::cout << "\t > ";
         else
           std::cout << "\t < ";
@@ -92,48 +87,38 @@
       }
       --oldi;
     }
-    std::cout << " MFlops    (" << nb_point-i << "/" << nb_point << ")" << std::endl;
+    std::cout << " MFlops    (" << nb_point - i << "/" << nb_point << ")" << std::endl;
   }
 
-  if (!BtlConfig::Instance.overwriteResults)
-  {
-    if (hasOldResults)
-    {
+  if (!BtlConfig::Instance.overwriteResults) {
+    if (hasOldResults) {
       // merge the two data
       std::vector<int> newSizes;
       std::vector<double> newFlops;
-      unsigned int i=0;
-      unsigned int j=0;
-      while (i<tab_sizes.size() && j<oldSizes.size())
-      {
-        if (tab_sizes[i] == oldSizes[j])
-        {
+      unsigned int i = 0;
+      unsigned int j = 0;
+      while (i < tab_sizes.size() && j < oldSizes.size()) {
+        if (tab_sizes[i] == oldSizes[j]) {
           newSizes.push_back(tab_sizes[i]);
           newFlops.push_back(std::max(tab_mflops[i], oldFlops[j]));
           ++i;
           ++j;
-        }
-        else if (tab_sizes[i] < oldSizes[j])
-        {
+        } else if (tab_sizes[i] < oldSizes[j]) {
           newSizes.push_back(tab_sizes[i]);
           newFlops.push_back(tab_mflops[i]);
           ++i;
-        }
-        else
-        {
+        } else {
           newSizes.push_back(oldSizes[j]);
           newFlops.push_back(oldFlops[j]);
           ++j;
         }
       }
-      while (i<tab_sizes.size())
-      {
+      while (i < tab_sizes.size()) {
         newSizes.push_back(tab_sizes[i]);
         newFlops.push_back(tab_mflops[i]);
         ++i;
       }
-      while (j<oldSizes.size())
-      {
+      while (j < oldSizes.size()) {
         newSizes.push_back(oldSizes[j]);
         newFlops.push_back(oldFlops[j]);
         ++j;
@@ -144,25 +129,21 @@
   }
 
   // dump the result in a file  :
-  dump_xy_file(tab_sizes,tab_mflops,filename);
-
+  dump_xy_file(tab_sizes, tab_mflops, filename);
 }
 
 // default Perf Analyzer
 
 template <class Action>
-BTL_DONT_INLINE void bench( int size_min, int size_max, int nb_point ){
-
+BTL_DONT_INLINE void bench(int size_min, int size_max, int nb_point) {
   // if the rdtsc is not available :
-  bench<Portable_Perf_Analyzer,Action>(size_min,size_max,nb_point);
+  bench<Portable_Perf_Analyzer, Action>(size_min, size_max, nb_point);
   // if the rdtsc is available :
-//    bench<Mixed_Perf_Analyzer,Action>(size_min,size_max,nb_point);
-
+  //    bench<Mixed_Perf_Analyzer,Action>(size_min,size_max,nb_point);
 
   // Only for small problem size. Otherwise it will be too long
-//   bench<X86_Perf_Analyzer,Action>(size_min,size_max,nb_point);
-//   bench<STL_Perf_Analyzer,Action>(size_min,size_max,nb_point);
-
+  //   bench<X86_Perf_Analyzer,Action>(size_min,size_max,nb_point);
+  //   bench<STL_Perf_Analyzer,Action>(size_min,size_max,nb_point);
 }
 
 #endif
diff --git a/bench/btl/generic_bench/btl.hh b/bench/btl/generic_bench/btl.hh
index 706b00f..9ed5248 100644
--- a/bench/btl/generic_bench/btl.hh
+++ b/bench/btl/generic_bench/btl.hh
@@ -39,7 +39,7 @@
 #endif
 
 #if (defined __GNUC__)
-#define BTL_ASM_COMMENT(X)  asm("#" X)
+#define BTL_ASM_COMMENT(X) asm("#" X)
 #else
 #define BTL_ASM_COMMENT(X)
 #endif
@@ -47,164 +47,131 @@
 #ifdef __SSE__
 #include "xmmintrin.h"
 // This enables flush to zero (FTZ) and denormals are zero (DAZ) modes:
-#define BTL_DISABLE_SSE_EXCEPTIONS()  { _mm_setcsr(_mm_getcsr() | 0x8040); }
+#define BTL_DISABLE_SSE_EXCEPTIONS() \
+  { _mm_setcsr(_mm_getcsr() | 0x8040); }
 #else
 #define BTL_DISABLE_SSE_EXCEPTIONS()
 #endif
 
 /** Enhanced std::string
-*/
-class BtlString : public std::string
-{
-public:
-    BtlString() : std::string() {}
-    BtlString(const BtlString& str) : std::string(static_cast<const std::string&>(str)) {}
-    BtlString(const std::string& str) : std::string(str) {}
-    BtlString(const char* str) : std::string(str) {}
+ */
+class BtlString : public std::string {
+ public:
+  BtlString() : std::string() {}
+  BtlString(const BtlString& str) : std::string(static_cast<const std::string&>(str)) {}
+  BtlString(const std::string& str) : std::string(str) {}
+  BtlString(const char* str) : std::string(str) {}
 
-    operator const char* () const { return c_str(); }
+  operator const char*() const { return c_str(); }
 
-    void trim( bool left = true, bool right = true )
-    {
-        int lspaces, rspaces, len = length(), i;
-        lspaces = rspaces = 0;
+  void trim(bool left = true, bool right = true) {
+    int lspaces, rspaces, len = length(), i;
+    lspaces = rspaces = 0;
 
-        if ( left )
-            for (i=0; i<len && (at(i)==' '||at(i)=='\t'||at(i)=='\r'||at(i)=='\n'); ++lspaces,++i);
+    if (left)
+      for (i = 0; i < len && (at(i) == ' ' || at(i) == '\t' || at(i) == '\r' || at(i) == '\n'); ++lspaces, ++i)
+        ;
 
-        if ( right && lspaces < len )
-            for(i=len-1; i>=0 && (at(i)==' '||at(i)=='\t'||at(i)=='\r'||at(i)=='\n'); rspaces++,i--);
+    if (right && lspaces < len)
+      for (i = len - 1; i >= 0 && (at(i) == ' ' || at(i) == '\t' || at(i) == '\r' || at(i) == '\n'); rspaces++, i--)
+        ;
 
-        *this = substr(lspaces, len-lspaces-rspaces);
-    }
+    *this = substr(lspaces, len - lspaces - rspaces);
+  }
 
-    std::vector<BtlString> split( const BtlString& delims = "\t\n ") const
-    {
-        std::vector<BtlString> ret;
-        unsigned int numSplits = 0;
-        size_t start, pos;
-        start = 0;
-        do
-        {
-            pos = find_first_of(delims, start);
-            if (pos == start)
-            {
-                ret.push_back("");
-                start = pos + 1;
-            }
-            else if (pos == npos)
-                ret.push_back( substr(start) );
-            else
-            {
-                ret.push_back( substr(start, pos - start) );
-                start = pos + 1;
-            }
-            //start = find_first_not_of(delims, start);
-            ++numSplits;
-        } while (pos != npos);
-        return ret;
-    }
+  std::vector<BtlString> split(const BtlString& delims = "\t\n ") const {
+    std::vector<BtlString> ret;
+    unsigned int numSplits = 0;
+    size_t start, pos;
+    start = 0;
+    do {
+      pos = find_first_of(delims, start);
+      if (pos == start) {
+        ret.push_back("");
+        start = pos + 1;
+      } else if (pos == npos)
+        ret.push_back(substr(start));
+      else {
+        ret.push_back(substr(start, pos - start));
+        start = pos + 1;
+      }
+      // start = find_first_not_of(delims, start);
+      ++numSplits;
+    } while (pos != npos);
+    return ret;
+  }
 
-    bool endsWith(const BtlString& str) const
-    {
-        if(str.size()>this->size())
-            return false;
-        return this->substr(this->size()-str.size(),str.size()) == str;
-    }
-    bool contains(const BtlString& str) const
-    {
-        return this->find(str)<this->size();
-    }
-    bool beginsWith(const BtlString& str) const
-    {
-        if(str.size()>this->size())
-            return false;
-        return this->substr(0,str.size()) == str;
-    }
+  bool endsWith(const BtlString& str) const {
+    if (str.size() > this->size()) return false;
+    return this->substr(this->size() - str.size(), str.size()) == str;
+  }
+  bool contains(const BtlString& str) const { return this->find(str) < this->size(); }
+  bool beginsWith(const BtlString& str) const {
+    if (str.size() > this->size()) return false;
+    return this->substr(0, str.size()) == str;
+  }
 
-    BtlString toLowerCase( void )
-    {
-        std::transform(begin(), end(), begin(), static_cast<int(*)(int)>(::tolower) );
-        return *this;
-    }
-    BtlString toUpperCase( void )
-    {
-        std::transform(begin(), end(), begin(), static_cast<int(*)(int)>(::toupper) );
-        return *this;
-    }
+  BtlString toLowerCase(void) {
+    std::transform(begin(), end(), begin(), static_cast<int (*)(int)>(::tolower));
+    return *this;
+  }
+  BtlString toUpperCase(void) {
+    std::transform(begin(), end(), begin(), static_cast<int (*)(int)>(::toupper));
+    return *this;
+  }
 
-    /** Case insensitive comparison.
-    */
-    bool isEquiv(const BtlString& str) const
-    {
-        BtlString str0 = *this;
-        str0.toLowerCase();
-        BtlString str1 = str;
-        str1.toLowerCase();
-        return str0 == str1;
-    }
+  /** Case insensitive comparison.
+   */
+  bool isEquiv(const BtlString& str) const {
+    BtlString str0 = *this;
+    str0.toLowerCase();
+    BtlString str1 = str;
+    str1.toLowerCase();
+    return str0 == str1;
+  }
 
-    /** Decompose the current string as a path and a file.
-        For instance: "dir1/dir2/file.ext" leads to path="dir1/dir2/" and filename="file.ext"
-    */
-    void decomposePathAndFile(BtlString& path, BtlString& filename) const
-    {
-        std::vector<BtlString> elements = this->split("/\\");
-        path = "";
-        filename = elements.back();
-        elements.pop_back();
-        if (this->at(0)=='/')
-            path = "/";
-        for (unsigned int i=0 ; i<elements.size() ; ++i)
-            path += elements[i] + "/";
-    }
+  /** Decompose the current string as a path and a file.
+      For instance: "dir1/dir2/file.ext" leads to path="dir1/dir2/" and filename="file.ext"
+  */
+  void decomposePathAndFile(BtlString& path, BtlString& filename) const {
+    std::vector<BtlString> elements = this->split("/\\");
+    path = "";
+    filename = elements.back();
+    elements.pop_back();
+    if (this->at(0) == '/') path = "/";
+    for (unsigned int i = 0; i < elements.size(); ++i) path += elements[i] + "/";
+  }
 };
 
-class BtlConfig
-{
-public:
-  BtlConfig()
-    : overwriteResults(false), checkResults(true), realclock(false), tries(DEFAULT_NB_TRIES)
-  {
-    char * _config;
-    _config = getenv ("BTL_CONFIG");
-    if (_config!=NULL)
-    {
+class BtlConfig {
+ public:
+  BtlConfig() : overwriteResults(false), checkResults(true), realclock(false), tries(DEFAULT_NB_TRIES) {
+    char* _config;
+    _config = getenv("BTL_CONFIG");
+    if (_config != NULL) {
       std::vector<BtlString> config = BtlString(_config).split(" \t\n");
-      for (unsigned int i = 0; i<config.size(); i++)
-      {
-        if (config[i].beginsWith("-a"))
-        {
-          if (i+1==config.size())
-          {
+      for (unsigned int i = 0; i < config.size(); i++) {
+        if (config[i].beginsWith("-a")) {
+          if (i + 1 == config.size()) {
             std::cerr << "error processing option: " << config[i] << "\n";
             exit(2);
           }
-          Instance.m_selectedActionNames = config[i+1].split(":");
+          Instance.m_selectedActionNames = config[i + 1].split(":");
 
           i += 1;
-        }
-        else if (config[i].beginsWith("-t"))
-        {
-          if (i+1==config.size())
-          {
+        } else if (config[i].beginsWith("-t")) {
+          if (i + 1 == config.size()) {
             std::cerr << "error processing option: " << config[i] << "\n";
             exit(2);
           }
-          Instance.tries = atoi(config[i+1].c_str());
+          Instance.tries = atoi(config[i + 1].c_str());
 
           i += 1;
-        }
-        else if (config[i].beginsWith("--overwrite"))
-        {
+        } else if (config[i].beginsWith("--overwrite")) {
           Instance.overwriteResults = true;
-        }
-        else if (config[i].beginsWith("--nocheck"))
-        {
+        } else if (config[i].beginsWith("--nocheck")) {
           Instance.checkResults = false;
-        }
-        else if (config[i].beginsWith("--real"))
-        {
+        } else if (config[i].beginsWith("--real")) {
           Instance.realclock = true;
         }
       }
@@ -213,15 +180,12 @@
     BTL_DISABLE_SSE_EXCEPTIONS();
   }
 
-  BTL_DONT_INLINE static bool skipAction(const std::string& _name)
-  {
-    if (Instance.m_selectedActionNames.empty())
-      return false;
+  BTL_DONT_INLINE static bool skipAction(const std::string& _name) {
+    if (Instance.m_selectedActionNames.empty()) return false;
 
     BtlString name(_name);
-    for (unsigned int i=0; i<Instance.m_selectedActionNames.size(); ++i)
-      if (name.contains(Instance.m_selectedActionNames[i]))
-        return false;
+    for (unsigned int i = 0; i < Instance.m_selectedActionNames.size(); ++i)
+      if (name.contains(Instance.m_selectedActionNames[i])) return false;
 
     return true;
   }
@@ -232,11 +196,10 @@
   bool realclock;
   int tries;
 
-protected:
+ protected:
   std::vector<BtlString> m_selectedActionNames;
 };
 
-#define BTL_MAIN \
-  BtlConfig BtlConfig::Instance
+#define BTL_MAIN BtlConfig BtlConfig::Instance
 
-#endif // BTL_HH
+#endif  // BTL_HH
diff --git a/bench/btl/generic_bench/init/init_function.hh b/bench/btl/generic_bench/init/init_function.hh
index e467cb6..740ffe2 100644
--- a/bench/btl/generic_bench/init/init_function.hh
+++ b/bench/btl/generic_bench/init/init_function.hh
@@ -1,14 +1,14 @@
 //=====================================================
 // File   :  init_function.hh
-// Author :  L. Plagne <laurent.plagne@edf.fr)>        
+// Author :  L. Plagne <laurent.plagne@edf.fr)>
 // Copyright (C) EDF R&D,  lun sep 30 14:23:18 CEST 2002
 //=====================================================
-// 
+//
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
 // as published by the Free Software Foundation; either version 2
 // of the License, or (at your option) any later version.
-// 
+//
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -16,39 +16,20 @@
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-// 
+//
 #ifndef INIT_FUNCTION_HH
 #define INIT_FUNCTION_HH
 
-double simple_function(int index)
-{
-  return index;
-}
+double simple_function(int index) { return index; }
 
-double simple_function(int index_i, int index_j)
-{
-  return index_i+index_j;
-}
+double simple_function(int index_i, int index_j) { return index_i + index_j; }
 
-double pseudo_random(int /*index*/)
-{
-  return std::rand()/double(RAND_MAX);
-}
+double pseudo_random(int /*index*/) { return std::rand() / double(RAND_MAX); }
 
-double pseudo_random(int /*index_i*/, int /*index_j*/)
-{
-  return std::rand()/double(RAND_MAX);
-}
+double pseudo_random(int /*index_i*/, int /*index_j*/) { return std::rand() / double(RAND_MAX); }
 
+double null_function(int /*index*/) { return 0.0; }
 
-double null_function(int /*index*/)
-{
-  return 0.0;
-}
-
-double null_function(int /*index_i*/, int /*index_j*/)
-{
-  return 0.0;
-}
+double null_function(int /*index_i*/, int /*index_j*/) { return 0.0; }
 
 #endif
diff --git a/bench/btl/generic_bench/init/init_matrix.hh b/bench/btl/generic_bench/init/init_matrix.hh
index 6382d30..1a4aa5d 100644
--- a/bench/btl/generic_bench/init/init_matrix.hh
+++ b/bench/btl/generic_bench/init/init_matrix.hh
@@ -24,38 +24,35 @@
 //            resize() method
 //            [] operator for setting element
 //            value_type defined
-template<double init_function(int,int), class Vector>
-BTL_DONT_INLINE void init_row(Vector & X, int size, int row){
-
+template <double init_function(int, int), class Vector>
+BTL_DONT_INLINE void init_row(Vector& X, int size, int row) {
   X.resize(size);
 
-  for (unsigned int j=0;j<X.size();j++){
-    X[j]=typename Vector::value_type(init_function(row,j));
+  for (unsigned int j = 0; j < X.size(); j++) {
+    X[j] = typename Vector::value_type(init_function(row, j));
   }
 }
 
-
 // Matrix is a Vector of Vector
 // The Matrix class must satisfy the following part of STL vector concept :
 //            resize() method
 //            [] operator for setting rows
-template<double init_function(int,int),class Vector>
-BTL_DONT_INLINE void init_matrix(Vector &  A, int size){
+template <double init_function(int, int), class Vector>
+BTL_DONT_INLINE void init_matrix(Vector& A, int size) {
   A.resize(size);
-  for (unsigned int row=0; row<A.size() ; row++){
-    init_row<init_function>(A[row],size,row);
+  for (unsigned int row = 0; row < A.size(); row++) {
+    init_row<init_function>(A[row], size, row);
   }
 }
 
-template<double init_function(int,int),class Matrix>
-BTL_DONT_INLINE void init_matrix_symm(Matrix&  A, int size){
+template <double init_function(int, int), class Matrix>
+BTL_DONT_INLINE void init_matrix_symm(Matrix& A, int size) {
   A.resize(size);
-  for (unsigned int row=0; row<A.size() ; row++)
-    A[row].resize(size);
-  for (unsigned int row=0; row<A.size() ; row++){
-    A[row][row] = init_function(row,row);
-    for (unsigned int col=0; col<row ; col++){
-      double x = init_function(row,col);
+  for (unsigned int row = 0; row < A.size(); row++) A[row].resize(size);
+  for (unsigned int row = 0; row < A.size(); row++) {
+    A[row][row] = init_function(row, row);
+    for (unsigned int col = 0; col < row; col++) {
+      double x = init_function(row, col);
       A[row][col] = A[col][row] = x;
     }
   }
diff --git a/bench/btl/generic_bench/init/init_vector.hh b/bench/btl/generic_bench/init/init_vector.hh
index 518e87d..d4576a4 100644
--- a/bench/btl/generic_bench/init/init_vector.hh
+++ b/bench/btl/generic_bench/init/init_vector.hh
@@ -24,13 +24,12 @@
 //            resize() method
 //            [] operator for setting element
 //            value_type defined
-template<double init_function(int), class Vector>
-void init_vector(Vector & X, int size){
-
+template <double init_function(int), class Vector>
+void init_vector(Vector& X, int size) {
   X.resize(size);
 
-  for (unsigned int i=0;i<X.size();i++){
-    X[i]=typename Vector::value_type(init_function(i));
+  for (unsigned int i = 0; i < X.size(); i++) {
+    X[i] = typename Vector::value_type(init_function(i));
   }
 }
 
diff --git a/bench/btl/generic_bench/static/bench_static.hh b/bench/btl/generic_bench/static/bench_static.hh
index 23b55ec..9c2ab22 100644
--- a/bench/btl/generic_bench/static/bench_static.hh
+++ b/bench/btl/generic_bench/static/bench_static.hh
@@ -32,14 +32,11 @@
 
 using namespace std;
 
+template <template <class> class Perf_Analyzer, template <class> class Action, template <class, int> class Interface>
+BTL_DONT_INLINE void bench_static(void) {
+  if (BtlConfig::skipAction(Action<Interface<REAL_TYPE, 10> >::name())) return;
 
-template <template<class> class Perf_Analyzer, template<class> class Action, template<class,int> class Interface>
-BTL_DONT_INLINE  void bench_static(void)
-{
-  if (BtlConfig::skipAction(Action<Interface<REAL_TYPE,10> >::name()))
-    return;
-
-  string filename = "bench_" + Action<Interface<REAL_TYPE,10> >::name() + ".dat";
+  string filename = "bench_" + Action<Interface<REAL_TYPE, 10> >::name() + ".dat";
 
   INFOS("starting " << filename);
 
@@ -48,33 +45,17 @@
   std::vector<double> tab_mflops;
   std::vector<double> tab_sizes;
 
-  static_size_generator<max_size,Perf_Analyzer,Action,Interface>::go(tab_sizes,tab_mflops);
+  static_size_generator<max_size, Perf_Analyzer, Action, Interface>::go(tab_sizes, tab_mflops);
 
-  dump_xy_file(tab_sizes,tab_mflops,filename);
+  dump_xy_file(tab_sizes, tab_mflops, filename);
 }
 
 // default Perf Analyzer
-template <template<class> class Action, template<class,int> class Interface>
-BTL_DONT_INLINE  void bench_static(void)
-{
-  bench_static<Portable_Perf_Analyzer,Action,Interface>();
-  //bench_static<Mixed_Perf_Analyzer,Action,Interface>();
-  //bench_static<X86_Perf_Analyzer,Action,Interface>();
+template <template <class> class Action, template <class, int> class Interface>
+BTL_DONT_INLINE void bench_static(void) {
+  bench_static<Portable_Perf_Analyzer, Action, Interface>();
+  // bench_static<Mixed_Perf_Analyzer,Action,Interface>();
+  // bench_static<X86_Perf_Analyzer,Action,Interface>();
 }
 
 #endif
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/bench/btl/generic_bench/static/intel_bench_fixed_size.hh b/bench/btl/generic_bench/static/intel_bench_fixed_size.hh
index b4edcbc..3da4b2f 100644
--- a/bench/btl/generic_bench/static/intel_bench_fixed_size.hh
+++ b/bench/btl/generic_bench/static/intel_bench_fixed_size.hh
@@ -1,14 +1,14 @@
 //=====================================================
 // File   :  intel_bench_fixed_size.hh
-// Author :  L. Plagne <laurent.plagne@edf.fr)>        
+// Author :  L. Plagne <laurent.plagne@edf.fr)>
 // Copyright (C) EDF R&D,  mar déc 3 18:59:37 CET 2002
 //=====================================================
-// 
+//
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
 // as published by the Free Software Foundation; either version 2
 // of the License, or (at your option) any later version.
-// 
+//
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -16,7 +16,7 @@
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-// 
+//
 #ifndef _BENCH_FIXED_SIZE_HH_
 #define _BENCH_FIXED_SIZE_HH_
 
@@ -24,43 +24,37 @@
 #include "function_time.hh"
 
 template <class Action>
-double bench_fixed_size(int size, unsigned long long  & nb_calc,unsigned long long & nb_init)
-{
-  
+double bench_fixed_size(int size, unsigned long long& nb_calc, unsigned long long& nb_init) {
   Action action(size);
-  
-  double time_baseline=time_init(nb_init,action);
+
+  double time_baseline = time_init(nb_init, action);
 
   while (time_baseline < MIN_TIME) {
-
-    //INFOS("nb_init="<<nb_init);
-    //INFOS("time_baseline="<<time_baseline);
-    nb_init*=2;
-    time_baseline=time_init(nb_init,action);
+    // INFOS("nb_init="<<nb_init);
+    // INFOS("time_baseline="<<time_baseline);
+    nb_init *= 2;
+    time_baseline = time_init(nb_init, action);
   }
-  
-  time_baseline=time_baseline/(double(nb_init));
-  
-  double time_action=time_calculate(nb_calc,action);
-  
+
+  time_baseline = time_baseline / (double(nb_init));
+
+  double time_action = time_calculate(nb_calc, action);
+
   while (time_action < MIN_TIME) {
-    
-    nb_calc*=2;
-    time_action=time_calculate(nb_calc,action);
+    nb_calc *= 2;
+    time_action = time_calculate(nb_calc, action);
   }
 
-  INFOS("nb_init="<<nb_init);
-  INFOS("nb_calc="<<nb_calc);
-  
-  
-  time_action=time_action/(double(nb_calc));
-  
+  INFOS("nb_init=" << nb_init);
+  INFOS("nb_calc=" << nb_calc);
+
+  time_action = time_action / (double(nb_calc));
+
   action.check_result();
-  
-  time_action=time_action-time_baseline;
 
-  return action.nb_op_base()/(time_action*1000000.0);
+  time_action = time_action - time_baseline;
 
+  return action.nb_op_base() / (time_action * 1000000.0);
 }
 
 #endif
diff --git a/bench/btl/generic_bench/static/static_size_generator.hh b/bench/btl/generic_bench/static/static_size_generator.hh
index dd02df3..80ced49 100644
--- a/bench/btl/generic_bench/static/static_size_generator.hh
+++ b/bench/btl/generic_bench/static/static_size_generator.hh
@@ -1,14 +1,14 @@
 //=====================================================
 // File   :  static_size_generator.hh
-// Author :  L. Plagne <laurent.plagne@edf.fr)>        
+// Author :  L. Plagne <laurent.plagne@edf.fr)>
 // Copyright (C) EDF R&D,  mar déc 3 18:59:36 CET 2002
 //=====================================================
-// 
+//
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
 // as published by the Free Software Foundation; either version 2
 // of the License, or (at your option) any later version.
-// 
+//
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -16,42 +16,37 @@
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-// 
+//
 #ifndef _STATIC_SIZE_GENERATOR_HH
 #define _STATIC_SIZE_GENERATOR_HH
 #include <vector>
 
 using namespace std;
 
-//recursive generation of statically defined matrix and vector sizes
+// recursive generation of statically defined matrix and vector sizes
 
-template <int SIZE,template<class> class Perf_Analyzer, template<class> class Action, template<class,int> class Interface> 
-struct static_size_generator{
-  static void go(vector<double> & tab_sizes, vector<double> & tab_mflops)
-  {
+template <int SIZE, template <class> class Perf_Analyzer, template <class> class Action,
+          template <class, int> class Interface>
+struct static_size_generator {
+  static void go(vector<double>& tab_sizes, vector<double>& tab_mflops) {
     tab_sizes.push_back(SIZE);
     std::cout << tab_sizes.back() << " \t" << std::flush;
-    Perf_Analyzer<Action<Interface<REAL_TYPE,SIZE> > > perf_action;
+    Perf_Analyzer<Action<Interface<REAL_TYPE, SIZE> > > perf_action;
     tab_mflops.push_back(perf_action.eval_mflops(SIZE));
     std::cout << tab_mflops.back() << " MFlops" << std::endl;
-    static_size_generator<SIZE-1,Perf_Analyzer,Action,Interface>::go(tab_sizes,tab_mflops);
+    static_size_generator<SIZE - 1, Perf_Analyzer, Action, Interface>::go(tab_sizes, tab_mflops);
   };
 };
 
-//recursion end
+// recursion end
 
-template <template<class> class Perf_Analyzer, template<class> class Action, template<class,int> class Interface> 
-struct static_size_generator<1,Perf_Analyzer,Action,Interface>{  
-  static  void go(vector<double> & tab_sizes, vector<double> & tab_mflops)
-  {
+template <template <class> class Perf_Analyzer, template <class> class Action, template <class, int> class Interface>
+struct static_size_generator<1, Perf_Analyzer, Action, Interface> {
+  static void go(vector<double>& tab_sizes, vector<double>& tab_mflops) {
     tab_sizes.push_back(1);
-    Perf_Analyzer<Action<Interface<REAL_TYPE,1> > > perf_action;
+    Perf_Analyzer<Action<Interface<REAL_TYPE, 1> > > perf_action;
     tab_mflops.push_back(perf_action.eval_mflops(1));
   };
 };
 
 #endif
-  
-  
-  
-  
diff --git a/bench/btl/generic_bench/timers/STL_perf_analyzer.hh b/bench/btl/generic_bench/timers/STL_perf_analyzer.hh
index c9f894b..6815437 100644
--- a/bench/btl/generic_bench/timers/STL_perf_analyzer.hh
+++ b/bench/btl/generic_bench/timers/STL_perf_analyzer.hh
@@ -1,14 +1,14 @@
 //=====================================================
 // File   :  STL_perf_analyzer.hh
-// Author :  L. Plagne <laurent.plagne@edf.fr)>        
+// Author :  L. Plagne <laurent.plagne@edf.fr)>
 // Copyright (C) EDF R&D,  mar déc 3 18:59:35 CET 2002
 //=====================================================
-// 
+//
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
 // as published by the Free Software Foundation; either version 2
 // of the License, or (at your option) any later version.
-// 
+//
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -16,42 +16,35 @@
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-// 
+//
 #ifndef _STL_PERF_ANALYSER_HH
 #define _STL_PERF_ANALYSER_HH
 
 #include "STL_timer.hh"
 #include "bench_parameter.hh"
 
-template<class ACTION>
-class STL_Perf_Analyzer{
-public:  
-  STL_Perf_Analyzer(unsigned long long nb_sample=DEFAULT_NB_SAMPLE):_nb_sample(nb_sample),_chronos()
-  {
+template <class ACTION>
+class STL_Perf_Analyzer {
+ public:
+  STL_Perf_Analyzer(unsigned long long nb_sample = DEFAULT_NB_SAMPLE) : _nb_sample(nb_sample), _chronos() {
     MESSAGE("STL_Perf_Analyzer Ctor");
-  }; 
-  STL_Perf_Analyzer( const STL_Perf_Analyzer & ){
+  };
+  STL_Perf_Analyzer(const STL_Perf_Analyzer&) {
     INFOS("Copy Ctor not implemented");
     exit(0);
   };
-  ~STL_Perf_Analyzer( void ){
-    MESSAGE("STL_Perf_Analyzer Dtor");
-  };
-  
-  
-  inline double eval_mflops(int size)
-  {
+  ~STL_Perf_Analyzer(void) { MESSAGE("STL_Perf_Analyzer Dtor"); };
 
+  inline double eval_mflops(int size) {
     ACTION action(size);
 
     _chronos.start_baseline(_nb_sample);
-      
-    do {
 
+    do {
       action.initialize();
     } while (_chronos.check());
 
-    double baseline_time=_chronos.get_time();
+    double baseline_time = _chronos.get_time();
 
     _chronos.start(_nb_sample);
     do {
@@ -59,24 +52,19 @@
       action.calculate();
     } while (_chronos.check());
 
-    double calculate_time=_chronos.get_time();
+    double calculate_time = _chronos.get_time();
 
-    double corrected_time=calculate_time-baseline_time;
-    
-    //    cout << size <<" "<<baseline_time<<" "<<calculate_time<<" "<<corrected_time<<" "<<action.nb_op_base() << endl;    
-    
-    return action.nb_op_base()/(corrected_time*1000000.0);
-    //return action.nb_op_base()/(calculate_time*1000000.0);
-    
+    double corrected_time = calculate_time - baseline_time;
+
+    //    cout << size <<" "<<baseline_time<<" "<<calculate_time<<" "<<corrected_time<<" "<<action.nb_op_base() << endl;
+
+    return action.nb_op_base() / (corrected_time * 1000000.0);
+    // return action.nb_op_base()/(calculate_time*1000000.0);
   }
-private:
 
+ private:
   STL_Timer _chronos;
   unsigned long long _nb_sample;
-
-  
 };
 
-  
-  
 #endif
diff --git a/bench/btl/generic_bench/timers/STL_timer.hh b/bench/btl/generic_bench/timers/STL_timer.hh
index 19c54e9..274f900 100644
--- a/bench/btl/generic_bench/timers/STL_timer.hh
+++ b/bench/btl/generic_bench/timers/STL_timer.hh
@@ -1,14 +1,14 @@
 //=====================================================
 // File   :  STL_Timer.hh
-// Author :  L. Plagne <laurent.plagne@edf.fr)>        
+// Author :  L. Plagne <laurent.plagne@edf.fr)>
 // Copyright (C) EDF R&D,  mar déc 3 18:59:35 CET 2002
 //=====================================================
-// 
+//
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
 // as published by the Free Software Foundation; either version 2
 // of the License, or (at your option) any later version.
-// 
+//
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -16,7 +16,7 @@
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-// 
+//
 // STL Timer Class. Adapted (L.P.) from the timer class by Musser et Al
 // described int the Book : STL Tutorial and reference guide.
 // Define a timer class for analyzing algorithm performance.
@@ -28,10 +28,10 @@
 using namespace std;
 
 class STL_Timer {
-public:
-  STL_Timer(){ baseline = false; };  // Default constructor
+ public:
+  STL_Timer() { baseline = false; };  // Default constructor
   // Start a series of r trials:
-  void start(unsigned int r){
+  void start(unsigned int r) {
     reps = r;
     count = 0;
     iterations.clear();
@@ -39,30 +39,28 @@
     initial = time(0);
   };
   // Start a series of r trials to determine baseline time:
-  void start_baseline(unsigned int r)
-  {
+  void start_baseline(unsigned int r) {
     baseline = true;
     start(r);
   }
   // Returns true if the trials have been completed, else false
-  bool check()
-  {
+  bool check() {
     ++count;
     final = time(0);
     if (initial < final) {
-      iterations.push_back(count);  
+      iterations.push_back(count);
       initial = final;
       count = 0;
     }
     return (iterations.size() < reps);
   };
   // Returns the results for external use
-  double get_time( void )
-  {
+  double get_time(void) {
     sort(iterations.begin(), iterations.end());
-    return 1.0/iterations[reps/2];
+    return 1.0 / iterations[reps / 2];
   };
-private:
+
+ private:
   unsigned int reps;  // Number of trials
   // For storing loop iterations of a trial
   vector<long> iterations;
@@ -72,7 +70,6 @@
   unsigned long count;
   // true if this is a baseline computation, false otherwise
   bool baseline;
-  // For recording the baseline time 
+  // For recording the baseline time
   double baseline_time;
 };
-
diff --git a/bench/btl/generic_bench/timers/mixed_perf_analyzer.hh b/bench/btl/generic_bench/timers/mixed_perf_analyzer.hh
index e190236..8f89154 100644
--- a/bench/btl/generic_bench/timers/mixed_perf_analyzer.hh
+++ b/bench/btl/generic_bench/timers/mixed_perf_analyzer.hh
@@ -1,14 +1,14 @@
 //=====================================================
 // File   :  mixed_perf_analyzer.hh
-// Author :  L. Plagne <laurent.plagne@edf.fr)>        
+// Author :  L. Plagne <laurent.plagne@edf.fr)>
 // Copyright (C) EDF R&D,  mar déc 3 18:59:36 CET 2002
 //=====================================================
-// 
+//
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
 // as published by the Free Software Foundation; either version 2
 // of the License, or (at your option) any later version.
-// 
+//
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -16,7 +16,7 @@
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-// 
+//
 #ifndef _MIXED_PERF_ANALYSER_HH
 #define _MIXED_PERF_ANALYSER_HH
 
@@ -25,49 +25,34 @@
 
 // choose portable perf analyzer for long calculations and x86 analyser for short ones
 
-
-template<class Action>
-class Mixed_Perf_Analyzer{
-  
-public:  
-  Mixed_Perf_Analyzer( void ):_x86pa(),_ppa(),_use_ppa(true)
-  {
-    MESSAGE("Mixed_Perf_Analyzer Ctor");
-  }; 
-  Mixed_Perf_Analyzer( const Mixed_Perf_Analyzer & ){
+template <class Action>
+class Mixed_Perf_Analyzer {
+ public:
+  Mixed_Perf_Analyzer(void) : _x86pa(), _ppa(), _use_ppa(true) { MESSAGE("Mixed_Perf_Analyzer Ctor"); };
+  Mixed_Perf_Analyzer(const Mixed_Perf_Analyzer&) {
     INFOS("Copy Ctor not implemented");
     exit(0);
   };
-  ~Mixed_Perf_Analyzer( void ){
-    MESSAGE("Mixed_Perf_Analyzer Dtor");
-  };
-    
-  
-  inline double eval_mflops(int size)
-  {
+  ~Mixed_Perf_Analyzer(void) { MESSAGE("Mixed_Perf_Analyzer Dtor"); };
 
-    double result=0.0;
-    if (_use_ppa){      
-      result=_ppa.eval_mflops(size);
-      if (_ppa.get_nb_calc()>DEFAULT_NB_SAMPLE){_use_ppa=false;}      
-    }
-    else{      
-      result=_x86pa.eval_mflops(size);
+  inline double eval_mflops(int size) {
+    double result = 0.0;
+    if (_use_ppa) {
+      result = _ppa.eval_mflops(size);
+      if (_ppa.get_nb_calc() > DEFAULT_NB_SAMPLE) {
+        _use_ppa = false;
+      }
+    } else {
+      result = _x86pa.eval_mflops(size);
     }
 
     return result;
   }
 
-private:
-
+ private:
   Portable_Perf_Analyzer<Action> _ppa;
   X86_Perf_Analyzer<Action> _x86pa;
   bool _use_ppa;
-
 };
 
 #endif
-
-  
-    
-  
diff --git a/bench/btl/generic_bench/timers/portable_perf_analyzer.hh b/bench/btl/generic_bench/timers/portable_perf_analyzer.hh
index 5e579fb..67393d7 100644
--- a/bench/btl/generic_bench/timers/portable_perf_analyzer.hh
+++ b/bench/btl/generic_bench/timers/portable_perf_analyzer.hh
@@ -25,38 +25,33 @@
 #include "timers/portable_timer.hh"
 
 template <class Action>
-class Portable_Perf_Analyzer{
-public:
-  Portable_Perf_Analyzer( ):_nb_calc(0), m_time_action(0), _chronos(){
-    MESSAGE("Portable_Perf_Analyzer Ctor");
-  };
-  Portable_Perf_Analyzer( const Portable_Perf_Analyzer & ){
+class Portable_Perf_Analyzer {
+ public:
+  Portable_Perf_Analyzer() : _nb_calc(0), m_time_action(0), _chronos() { MESSAGE("Portable_Perf_Analyzer Ctor"); };
+  Portable_Perf_Analyzer(const Portable_Perf_Analyzer&) {
     INFOS("Copy Ctor not implemented");
     exit(0);
   };
-  ~Portable_Perf_Analyzer(){
-    MESSAGE("Portable_Perf_Analyzer Dtor");
-  };
+  ~Portable_Perf_Analyzer() { MESSAGE("Portable_Perf_Analyzer Dtor"); };
 
-  BTL_DONT_INLINE double eval_mflops(int size)
-  {
+  BTL_DONT_INLINE double eval_mflops(int size) {
     Action action(size);
 
-//     action.initialize();
-//     time_action = time_calculate(action);
-    while (m_time_action < MIN_TIME)
-    {
-      if(_nb_calc==0) _nb_calc = 1;
-      else            _nb_calc *= 2;
+    //     action.initialize();
+    //     time_action = time_calculate(action);
+    while (m_time_action < MIN_TIME) {
+      if (_nb_calc == 0)
+        _nb_calc = 1;
+      else
+        _nb_calc *= 2;
       action.initialize();
       m_time_action = time_calculate(action);
     }
 
     // optimize
-    for (int i=1; i<BtlConfig::Instance.tries; ++i)
-    {
+    for (int i = 1; i < BtlConfig::Instance.tries; ++i) {
       Action _action(size);
-      std::cout << " " << _action.nb_op_base()*_nb_calc/(m_time_action*1e6) << " ";
+      std::cout << " " << _action.nb_op_base() * _nb_calc / (m_time_action * 1e6) << " ";
       _action.initialize();
       m_time_action = std::min(m_time_action, time_calculate(_action));
     }
@@ -64,40 +59,31 @@
     double time_action = m_time_action / (double(_nb_calc));
 
     // check
-    if (BtlConfig::Instance.checkResults && size<128)
-    {
+    if (BtlConfig::Instance.checkResults && size < 128) {
       action.initialize();
       action.calculate();
       action.check_result();
     }
-    return action.nb_op_base()/(time_action*1e6);
+    return action.nb_op_base() / (time_action * 1e6);
   }
 
-  BTL_DONT_INLINE double time_calculate(Action & action)
-  {
+  BTL_DONT_INLINE double time_calculate(Action& action) {
     // time measurement
     action.calculate();
     _chronos.start();
-    for (unsigned int ii=0;ii<_nb_calc;ii++)
-    {
+    for (unsigned int ii = 0; ii < _nb_calc; ii++) {
       action.calculate();
     }
     _chronos.stop();
     return _chronos.user_time();
   }
 
-  unsigned long long get_nb_calc()
-  {
-    return _nb_calc;
-  }
+  unsigned long long get_nb_calc() { return _nb_calc; }
 
-
-private:
+ private:
   unsigned long long _nb_calc;
   double m_time_action;
   Portable_Timer _chronos;
-
 };
 
-#endif //_PORTABLE_PERF_ANALYZER_HH
-
+#endif  //_PORTABLE_PERF_ANALYZER_HH
diff --git a/bench/btl/generic_bench/timers/portable_perf_analyzer_old.hh b/bench/btl/generic_bench/timers/portable_perf_analyzer_old.hh
index fce3781..7733d4e 100644
--- a/bench/btl/generic_bench/timers/portable_perf_analyzer_old.hh
+++ b/bench/btl/generic_bench/timers/portable_perf_analyzer_old.hh
@@ -24,93 +24,74 @@
 #include "timers/portable_timer.hh"
 
 template <class Action>
-class Portable_Perf_Analyzer{
-public:
-  Portable_Perf_Analyzer( void ):_nb_calc(1),_nb_init(1),_chronos(){
-    MESSAGE("Portable_Perf_Analyzer Ctor");
-  };
-  Portable_Perf_Analyzer( const Portable_Perf_Analyzer & ){
+class Portable_Perf_Analyzer {
+ public:
+  Portable_Perf_Analyzer(void) : _nb_calc(1), _nb_init(1), _chronos() { MESSAGE("Portable_Perf_Analyzer Ctor"); };
+  Portable_Perf_Analyzer(const Portable_Perf_Analyzer&) {
     INFOS("Copy Ctor not implemented");
     exit(0);
   };
-  ~Portable_Perf_Analyzer( void ){
-    MESSAGE("Portable_Perf_Analyzer Dtor");
-  };
+  ~Portable_Perf_Analyzer(void) { MESSAGE("Portable_Perf_Analyzer Dtor"); };
 
-
-
-  inline double eval_mflops(int size)
-  {
-
+  inline double eval_mflops(int size) {
     Action action(size);
 
-//     double time_baseline = time_init(action);
-//     while (time_baseline < MIN_TIME_INIT)
-//     {
-//       _nb_init *= 2;
-//       time_baseline = time_init(action);
-//     }
-//
-//     // optimize
-//     for (int i=1; i<NB_TRIES; ++i)
-//       time_baseline = std::min(time_baseline, time_init(action));
-//
-//     time_baseline = time_baseline/(double(_nb_init));
+    //     double time_baseline = time_init(action);
+    //     while (time_baseline < MIN_TIME_INIT)
+    //     {
+    //       _nb_init *= 2;
+    //       time_baseline = time_init(action);
+    //     }
+    //
+    //     // optimize
+    //     for (int i=1; i<NB_TRIES; ++i)
+    //       time_baseline = std::min(time_baseline, time_init(action));
+    //
+    //     time_baseline = time_baseline/(double(_nb_init));
 
     double time_action = time_calculate(action);
-    while (time_action < MIN_TIME)
-    {
+    while (time_action < MIN_TIME) {
       _nb_calc *= 2;
       time_action = time_calculate(action);
     }
 
     // optimize
-    for (int i=1; i<NB_TRIES; ++i)
-      time_action = std::min(time_action, time_calculate(action));
+    for (int i = 1; i < NB_TRIES; ++i) time_action = std::min(time_action, time_calculate(action));
 
-//     INFOS("size="<<size);
-//     INFOS("_nb_init="<<_nb_init);
-//     INFOS("_nb_calc="<<_nb_calc);
+    //     INFOS("size="<<size);
+    //     INFOS("_nb_init="<<_nb_init);
+    //     INFOS("_nb_calc="<<_nb_calc);
 
     time_action = time_action / (double(_nb_calc));
 
     action.check_result();
 
-
     double time_baseline = time_init(action);
-    for (int i=1; i<NB_TRIES; ++i)
-      time_baseline = std::min(time_baseline, time_init(action));
-    time_baseline = time_baseline/(double(_nb_init));
+    for (int i = 1; i < NB_TRIES; ++i) time_baseline = std::min(time_baseline, time_init(action));
+    time_baseline = time_baseline / (double(_nb_init));
 
-
-
-//     INFOS("time_baseline="<<time_baseline);
-//     INFOS("time_action="<<time_action);
+    //     INFOS("time_baseline="<<time_baseline);
+    //     INFOS("time_action="<<time_action);
 
     time_action = time_action - time_baseline;
 
-//     INFOS("time_corrected="<<time_action);
+    //     INFOS("time_corrected="<<time_action);
 
-    return action.nb_op_base()/(time_action*1000000.0);
+    return action.nb_op_base() / (time_action * 1000000.0);
   }
 
-  inline double time_init(Action & action)
-  {
+  inline double time_init(Action& action) {
     // time measurement
     _chronos.start();
-    for (int ii=0; ii<_nb_init; ii++)
-      action.initialize();
+    for (int ii = 0; ii < _nb_init; ii++) action.initialize();
     _chronos.stop();
     return _chronos.user_time();
   }
 
-
-  inline double time_calculate(Action & action)
-  {
+  inline double time_calculate(Action& action) {
     // time measurement
     _chronos.start();
-    for (int ii=0;ii<_nb_calc;ii++)
-    {
+    for (int ii = 0; ii < _nb_calc; ii++) {
       action.initialize();
       action.calculate();
     }
@@ -118,17 +99,12 @@
     return _chronos.user_time();
   }
 
-  unsigned long long get_nb_calc( void )
-  {
-    return _nb_calc;
-  }
+  unsigned long long get_nb_calc(void) { return _nb_calc; }
 
-
-private:
+ private:
   unsigned long long _nb_calc;
   unsigned long long _nb_init;
   Portable_Timer _chronos;
-
 };
 
-#endif //_PORTABLE_PERF_ANALYZER_HH
+#endif  //_PORTABLE_PERF_ANALYZER_HH
diff --git a/bench/btl/generic_bench/timers/portable_timer.hh b/bench/btl/generic_bench/timers/portable_timer.hh
index c199811..f7c3f5c 100644
--- a/bench/btl/generic_bench/timers/portable_timer.hh
+++ b/bench/btl/generic_bench/timers/portable_timer.hh
@@ -27,10 +27,8 @@
 
 #include <time.h>
 
-
 #define USEC_IN_SEC 1000000
 
-
 //  timer  -------------------------------------------------------------------//
 
 //  A timer object measures CPU time.
@@ -44,90 +42,66 @@
 #define hr_timer
 #endif*/
 
- class Portable_Timer
- {
-  public:
-
-   typedef struct {
+class Portable_Timer {
+ public:
+  typedef struct {
     LARGE_INTEGER start;
     LARGE_INTEGER stop;
-   } stopWatch;
+  } stopWatch;
 
+  Portable_Timer() {
+    startVal.QuadPart = 0;
+    stopVal.QuadPart = 0;
+    QueryPerformanceFrequency(&frequency);
+  }
 
-   Portable_Timer()
-   {
-	 startVal.QuadPart = 0;
-	 stopVal.QuadPart = 0;
-	 QueryPerformanceFrequency(&frequency);
-   }
+  void start() { QueryPerformanceCounter(&startVal); }
 
-   void start() { QueryPerformanceCounter(&startVal); }
+  void stop() { QueryPerformanceCounter(&stopVal); }
 
-   void stop() { QueryPerformanceCounter(&stopVal); }
+  double elapsed() {
+    LARGE_INTEGER time;
+    time.QuadPart = stopVal.QuadPart - startVal.QuadPart;
+    return LIToSecs(time);
+  }
 
-   double elapsed() {
-	 LARGE_INTEGER time;
-     time.QuadPart = stopVal.QuadPart - startVal.QuadPart;
-     return LIToSecs(time);
-   }
-
-   double user_time() { return elapsed(); }
-
+  double user_time() { return elapsed(); }
 
  private:
+  double LIToSecs(LARGE_INTEGER& L) { return ((double)L.QuadPart / (double)frequency.QuadPart); }
 
-   double LIToSecs(LARGE_INTEGER& L) {
-     return ((double)L.QuadPart /(double)frequency.QuadPart) ;
-   }
+  LARGE_INTEGER startVal;
+  LARGE_INTEGER stopVal;
+  LARGE_INTEGER frequency;
 
-   LARGE_INTEGER startVal;
-   LARGE_INTEGER stopVal;
-   LARGE_INTEGER frequency;
-
-
- }; // Portable_Timer
+};  // Portable_Timer
 
 #elif defined(__APPLE__)
 #include <CoreServices/CoreServices.h>
 #include <mach/mach_time.h>
 
-
-class Portable_Timer
-{
+class Portable_Timer {
  public:
+  Portable_Timer() {}
 
-  Portable_Timer()
-  {
+  void start() {
+    m_start_time = double(mach_absolute_time()) * 1e-9;
+    ;
   }
 
-  void start()
-  {
-    m_start_time = double(mach_absolute_time())*1e-9;;
-
+  void stop() {
+    m_stop_time = double(mach_absolute_time()) * 1e-9;
+    ;
   }
 
-  void stop()
-  {
-    m_stop_time = double(mach_absolute_time())*1e-9;;
+  double elapsed() { return user_time(); }
 
-  }
+  double user_time() { return m_stop_time - m_start_time; }
 
-  double elapsed()
-  {
-    return  user_time();
-  }
-
-  double user_time()
-  {
-    return m_stop_time - m_start_time;
-  }
-
-
-private:
-
+ private:
   double m_stop_time, m_start_time;
 
-}; // Portable_Timer (Apple)
+};  // Portable_Timer (Apple)
 
 #else
 
@@ -136,51 +110,33 @@
 #include <unistd.h>
 #include <sys/times.h>
 
-class Portable_Timer
-{
+class Portable_Timer {
  public:
+  Portable_Timer() { m_clkid = BtlConfig::Instance.realclock ? CLOCK_REALTIME : CLOCK_PROCESS_CPUTIME_ID; }
 
-  Portable_Timer()
-  {
-    m_clkid = BtlConfig::Instance.realclock ? CLOCK_REALTIME : CLOCK_PROCESS_CPUTIME_ID;
-  }
+  Portable_Timer(int clkid) : m_clkid(clkid) {}
 
-  Portable_Timer(int clkid) : m_clkid(clkid)
-  {}
-
-  void start()
-  {
+  void start() {
     timespec ts;
     clock_gettime(m_clkid, &ts);
     m_start_time = double(ts.tv_sec) + 1e-9 * double(ts.tv_nsec);
-
   }
 
-  void stop()
-  {
+  void stop() {
     timespec ts;
     clock_gettime(m_clkid, &ts);
     m_stop_time = double(ts.tv_sec) + 1e-9 * double(ts.tv_nsec);
-
   }
 
-  double elapsed()
-  {
-    return  user_time();
-  }
+  double elapsed() { return user_time(); }
 
-  double user_time()
-  {
-    return m_stop_time - m_start_time;
-  }
+  double user_time() { return m_stop_time - m_start_time; }
 
-
-private:
-
+ private:
   int m_clkid;
   double m_stop_time, m_start_time;
 
-}; // Portable_Timer (Linux)
+};  // Portable_Timer (Linux)
 
 #endif
 
diff --git a/bench/btl/generic_bench/timers/x86_perf_analyzer.hh b/bench/btl/generic_bench/timers/x86_perf_analyzer.hh
index 37ea21d..a169373 100644
--- a/bench/btl/generic_bench/timers/x86_perf_analyzer.hh
+++ b/bench/btl/generic_bench/timers/x86_perf_analyzer.hh
@@ -23,38 +23,30 @@
 #include "x86_timer.hh"
 #include "bench_parameter.hh"
 
-template<class ACTION>
-class X86_Perf_Analyzer{
-public:
-  X86_Perf_Analyzer( unsigned long long nb_sample=DEFAULT_NB_SAMPLE):_nb_sample(nb_sample),_chronos()
-  {
+template <class ACTION>
+class X86_Perf_Analyzer {
+ public:
+  X86_Perf_Analyzer(unsigned long long nb_sample = DEFAULT_NB_SAMPLE) : _nb_sample(nb_sample), _chronos() {
     MESSAGE("X86_Perf_Analyzer Ctor");
     _chronos.find_frequency();
   };
-  X86_Perf_Analyzer( const X86_Perf_Analyzer & ){
+  X86_Perf_Analyzer(const X86_Perf_Analyzer&) {
     INFOS("Copy Ctor not implemented");
     exit(0);
   };
-  ~X86_Perf_Analyzer( void ){
-    MESSAGE("X86_Perf_Analyzer Dtor");
-  };
+  ~X86_Perf_Analyzer(void) { MESSAGE("X86_Perf_Analyzer Dtor"); };
 
-
-  inline double eval_mflops(int size)
-  {
-
+  inline double eval_mflops(int size) {
     ACTION action(size);
 
-    int nb_loop=5;
-    double calculate_time=0.0;
-    double baseline_time=0.0;
+    int nb_loop = 5;
+    double calculate_time = 0.0;
+    double baseline_time = 0.0;
 
-    for (int j=0 ; j < nb_loop ; j++){
-
+    for (int j = 0; j < nb_loop; j++) {
       _chronos.clear();
 
-      for(int i=0 ; i < _nb_sample  ; i++)
-      {
+      for (int i = 0; i < _nb_sample; i++) {
         _chronos.start();
         action.initialize();
         action.calculate();
@@ -62,47 +54,38 @@
         _chronos.add_get_click();
       }
 
-      calculate_time += double(_chronos.get_shortest_clicks())/_chronos.frequency();
+      calculate_time += double(_chronos.get_shortest_clicks()) / _chronos.frequency();
 
-      if (j==0) action.check_result();
+      if (j == 0) action.check_result();
 
       _chronos.clear();
 
-      for(int i=0 ; i < _nb_sample  ; i++)
-      {
+      for (int i = 0; i < _nb_sample; i++) {
         _chronos.start();
         action.initialize();
         _chronos.stop();
         _chronos.add_get_click();
-
       }
 
-      baseline_time+=double(_chronos.get_shortest_clicks())/_chronos.frequency();
-
+      baseline_time += double(_chronos.get_shortest_clicks()) / _chronos.frequency();
     }
 
-    double corrected_time = (calculate_time-baseline_time)/double(nb_loop);
+    double corrected_time = (calculate_time - baseline_time) / double(nb_loop);
 
+    //     INFOS("_nb_sample="<<_nb_sample);
+    //     INFOS("baseline_time="<<baseline_time);
+    //     INFOS("calculate_time="<<calculate_time);
+    //     INFOS("corrected_time="<<corrected_time);
 
-//     INFOS("_nb_sample="<<_nb_sample);
-//     INFOS("baseline_time="<<baseline_time);
-//     INFOS("calculate_time="<<calculate_time);
-//     INFOS("corrected_time="<<corrected_time);
+    //    cout << size <<" "<<baseline_time<<" "<<calculate_time<<" "<<corrected_time<<" "<<action.nb_op_base() << endl;
 
-//    cout << size <<" "<<baseline_time<<" "<<calculate_time<<" "<<corrected_time<<" "<<action.nb_op_base() << endl;
-
-    return action.nb_op_base()/(corrected_time*1000000.0);
-    //return action.nb_op_base()/(calculate_time*1000000.0);
+    return action.nb_op_base() / (corrected_time * 1000000.0);
+    // return action.nb_op_base()/(calculate_time*1000000.0);
   }
 
-private:
-
+ private:
   X86_Timer _chronos;
   unsigned long long _nb_sample;
-
-
 };
 
-
-
 #endif
diff --git a/bench/btl/generic_bench/timers/x86_timer.hh b/bench/btl/generic_bench/timers/x86_timer.hh
index cfb5ee8..b54485b 100644
--- a/bench/btl/generic_bench/timers/x86_timer.hh
+++ b/bench/btl/generic_bench/timers/x86_timer.hh
@@ -1,14 +1,14 @@
 //=====================================================
 // File   :  x86_timer.hh
-// Author :  L. Plagne <laurent.plagne@edf.fr)>        
+// Author :  L. Plagne <laurent.plagne@edf.fr)>
 // Copyright (C) EDF R&D,  mar d�c 3 18:59:35 CET 2002
 //=====================================================
-// 
+//
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
 // as published by the Free Software Foundation; either version 2
 // of the License, or (at your option) any later version.
-// 
+//
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -16,7 +16,7 @@
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-// 
+//
 #ifndef _X86_TIMER_HH
 #define _X86_TIMER_HH
 
@@ -24,7 +24,7 @@
 #include <sys/resource.h>
 #include <unistd.h>
 #include <sys/times.h>
-//#include "system_time.h"
+// #include "system_time.h"
 #define u32 unsigned int
 #include <asm/msr.h>
 #include "utilities.h"
@@ -34,213 +34,143 @@
 #include <iostream>
 
 // frequence de la becanne en Hz
-//#define FREQUENCY 648000000
-//#define FREQUENCY 1400000000
+// #define FREQUENCY 648000000
+// #define FREQUENCY 1400000000
 #define FREQUENCY 1695000000
 
 using namespace std;
 
-
 class X86_Timer {
+ public:
+  X86_Timer(void) : _frequency(FREQUENCY), _nb_sample(0) { MESSAGE("X86_Timer Default Ctor"); }
 
-public :
+  inline void start(void) { rdtsc(_click_start.n32[0], _click_start.n32[1]); }
 
-  X86_Timer( void ):_frequency(FREQUENCY),_nb_sample(0)
-  {
-    MESSAGE("X86_Timer Default Ctor");    
-  }
+  inline void stop(void) { rdtsc(_click_stop.n32[0], _click_stop.n32[1]); }
 
-  inline void start( void ){
+  inline double frequency(void) { return _frequency; }
 
-    rdtsc(_click_start.n32[0],_click_start.n32[1]);
+  double get_elapsed_time_in_second(void) { return (_click_stop.n64 - _click_start.n64) / double(FREQUENCY); }
 
-  }
+  unsigned long long get_click(void) { return (_click_stop.n64 - _click_start.n64); }
 
-
-  inline void stop( void ){
-
-    rdtsc(_click_stop.n32[0],_click_stop.n32[1]);
-
-  }
-  
-
-  inline double frequency( void ){
-    return _frequency;
-  }
-
-  double get_elapsed_time_in_second( void ){
-
-    return (_click_stop.n64-_click_start.n64)/double(FREQUENCY);
-
-
-  }    
-
-  unsigned long long  get_click( void ){
-    
-    return (_click_stop.n64-_click_start.n64);
-
-  }    
-
-  inline void find_frequency( void ){
-
+  inline void find_frequency(void) {
     time_t initial, final;
-    int dummy=2;
+    int dummy = 2;
 
     initial = time(0);
     start();
     do {
-      dummy+=2;
-    }
-    while(time(0)==initial);
+      dummy += 2;
+    } while (time(0) == initial);
     // On est au debut d'un cycle d'une seconde !!!
     initial = time(0);
     start();
     do {
-      dummy+=2;
-    }
-    while(time(0)==initial);
-    final=time(0);
+      dummy += 2;
+    } while (time(0) == initial);
+    final = time(0);
     stop();
     //    INFOS("fine grained time : "<<  get_elapsed_time_in_second());
     //  INFOS("coarse grained time : "<<  final-initial);
-    _frequency=_frequency*get_elapsed_time_in_second()/double(final-initial);
-    ///  INFOS("CPU frequency : "<<  _frequency);        
-
+    _frequency = _frequency * get_elapsed_time_in_second() / double(final - initial);
+    ///  INFOS("CPU frequency : "<<  _frequency);
   }
 
-  void  add_get_click( void ){
-       
+  void add_get_click(void) {
     _nb_sample++;
     _counted_clicks[get_click()]++;
     fill_history_clicks();
+  }
 
-  }    
+  void dump_statistics(string filemane) {
+    ofstream outfile(filemane.c_str(), ios::out);
 
-  void dump_statistics(string filemane){
-    
-    ofstream outfile (filemane.c_str(),ios::out) ;
+    std::map<unsigned long long, unsigned long long>::iterator itr;
+    for (itr = _counted_clicks.begin(); itr != _counted_clicks.end(); itr++) {
+      outfile << (*itr).first << "  " << (*itr).second << endl;
+    }
 
-    std::map<unsigned long long , unsigned long long>::iterator itr;
-    for(itr=_counted_clicks.begin() ; itr!=_counted_clicks.end()  ; itr++)
-      {      
-      outfile  << (*itr).first << "  " << (*itr).second << endl ;       
-      }      
-    
     outfile.close();
-
   }
 
-  void dump_history(string filemane){
-    
-    ofstream outfile (filemane.c_str(),ios::out) ;
+  void dump_history(string filemane) {
+    ofstream outfile(filemane.c_str(), ios::out);
 
+    for (int i = 0; i < _history_mean_clicks.size(); i++) {
+      outfile << i << " " << _history_mean_clicks[i] << " " << _history_shortest_clicks[i] << " "
+              << _history_most_occured_clicks[i] << endl;
+    }
 
-
-    for(int i=0 ; i<_history_mean_clicks.size() ; i++)
-      {      
-	outfile  << i << " " 
-		 << _history_mean_clicks[i] << " " 
-		 << _history_shortest_clicks[i] << " " 
-		 << _history_most_occured_clicks[i] << endl ;
-      }      
-    
     outfile.close();
-
-  }
-     
-
-
-  double get_mean_clicks( void ){
-    
-    std::map<unsigned long long,unsigned long long>::iterator itr;
-    
-    unsigned long long mean_clicks=0;
-
-    for(itr=_counted_clicks.begin() ; itr!=_counted_clicks.end()  ; itr++)
-      {      
-	
-	mean_clicks+=(*itr).second*(*itr).first;
-      }      
-
-    return mean_clicks/double(_nb_sample);
-
   }
 
-  double get_shortest_clicks( void ){
-    
-    return double((*_counted_clicks.begin()).first);
+  double get_mean_clicks(void) {
+    std::map<unsigned long long, unsigned long long>::iterator itr;
 
+    unsigned long long mean_clicks = 0;
+
+    for (itr = _counted_clicks.begin(); itr != _counted_clicks.end(); itr++) {
+      mean_clicks += (*itr).second * (*itr).first;
+    }
+
+    return mean_clicks / double(_nb_sample);
   }
 
-  void fill_history_clicks( void ){
+  double get_shortest_clicks(void) { return double((*_counted_clicks.begin()).first); }
 
+  void fill_history_clicks(void) {
     _history_mean_clicks.push_back(get_mean_clicks());
     _history_shortest_clicks.push_back(get_shortest_clicks());
     _history_most_occured_clicks.push_back(get_most_occured_clicks());
-
   }
 
+  double get_most_occured_clicks(void) {
+    unsigned long long moc = 0;
+    unsigned long long max_occurence = 0;
 
-  double get_most_occured_clicks( void ){
+    std::map<unsigned long long, unsigned long long>::iterator itr;
 
-    unsigned long long moc=0;
-    unsigned long long max_occurence=0;
+    for (itr = _counted_clicks.begin(); itr != _counted_clicks.end(); itr++) {
+      if (max_occurence <= (*itr).second) {
+        max_occurence = (*itr).second;
+        moc = (*itr).first;
+      }
+    }
 
-    std::map<unsigned long long,unsigned long long>::iterator itr;
-
-    for(itr=_counted_clicks.begin() ; itr!=_counted_clicks.end()  ; itr++)
-      {      
-	
-	if (max_occurence<=(*itr).second){
-	  max_occurence=(*itr).second;
-	  moc=(*itr).first;
-	}
-      }      
-    
-    return double(moc);    
-
+    return double(moc);
   }
-  
-  void clear( void )
-  {
+
+  void clear(void) {
     _counted_clicks.clear();
 
     _history_mean_clicks.clear();
     _history_shortest_clicks.clear();
     _history_most_occured_clicks.clear();
 
-    _nb_sample=0;
+    _nb_sample = 0;
   }
 
-
-    
-private :
-  
-  union
-  {
-    unsigned long int n32[2] ;
-    unsigned long long n64 ;
+ private:
+  union {
+    unsigned long int n32[2];
+    unsigned long long n64;
   } _click_start;
 
-  union
-  {
-    unsigned long int n32[2] ;
-    unsigned long long n64 ;
+  union {
+    unsigned long int n32[2];
+    unsigned long long n64;
   } _click_stop;
 
-  double _frequency ;
+  double _frequency;
 
-  map<unsigned long long,unsigned long long> _counted_clicks;
+  map<unsigned long long, unsigned long long> _counted_clicks;
 
   vector<double> _history_mean_clicks;
   vector<double> _history_shortest_clicks;
   vector<double> _history_most_occured_clicks;
 
   unsigned long long _nb_sample;
-
-  
-
 };
 
-
 #endif
diff --git a/bench/btl/generic_bench/utils/size_lin_log.hh b/bench/btl/generic_bench/utils/size_lin_log.hh
index bbc9f54..4432914 100644
--- a/bench/btl/generic_bench/utils/size_lin_log.hh
+++ b/bench/btl/generic_bench/utils/size_lin_log.hh
@@ -1,14 +1,14 @@
 //=====================================================
 // File   :  size_lin_log.hh
-// Author :  L. Plagne <laurent.plagne@edf.fr)>        
+// Author :  L. Plagne <laurent.plagne@edf.fr)>
 // Copyright (C) EDF R&D,  mar déc 3 18:59:37 CET 2002
 //=====================================================
-// 
+//
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
 // as published by the Free Software Foundation; either version 2
 // of the License, or (at your option) any later version.
-// 
+//
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -16,55 +16,41 @@
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-// 
+//
 #ifndef SIZE_LIN_LOG
 #define SIZE_LIN_LOG
 
 #include "size_log.hh"
 
-template<class Vector>
-void size_lin_log(const int nb_point, const int /*size_min*/, const int size_max, Vector & X)
-{
-  int ten=10;
-  int nine=9;
+template <class Vector>
+void size_lin_log(const int nb_point, const int /*size_min*/, const int size_max, Vector& X) {
+  int ten = 10;
+  int nine = 9;
 
   X.resize(nb_point);
 
-  if (nb_point>ten){
-
-    for (int i=0;i<nine;i++){
-      
-      X[i]=i+1;
-
+  if (nb_point > ten) {
+    for (int i = 0; i < nine; i++) {
+      X[i] = i + 1;
     }
 
     Vector log_size;
-    size_log(nb_point-nine,ten,size_max,log_size);
+    size_log(nb_point - nine, ten, size_max, log_size);
 
-    for (int i=0;i<nb_point-nine;i++){
-      
-      X[i+nine]=log_size[i];
-
+    for (int i = 0; i < nb_point - nine; i++) {
+      X[i + nine] = log_size[i];
     }
-  }
-  else{
-
-    for (int i=0;i<nb_point;i++){
-      
-      X[i]=i+1;
-
+  } else {
+    for (int i = 0; i < nb_point; i++) {
+      X[i] = i + 1;
     }
   }
 
- //  for (int i=0;i<nb_point;i++){
-    
-//        INFOS("computed sizes : X["<<i<<"]="<<X[i]);
-    
-//   }
+  //  for (int i=0;i<nb_point;i++){
 
+  //        INFOS("computed sizes : X["<<i<<"]="<<X[i]);
+
+  //   }
 }
-  
+
 #endif
-    
-
-
diff --git a/bench/btl/generic_bench/utils/size_log.hh b/bench/btl/generic_bench/utils/size_log.hh
index 68945e7..0928cf7 100644
--- a/bench/btl/generic_bench/utils/size_log.hh
+++ b/bench/btl/generic_bench/utils/size_log.hh
@@ -1,14 +1,14 @@
 //=====================================================
 // File   :  size_log.hh
-// Author :  L. Plagne <laurent.plagne@edf.fr)>        
+// Author :  L. Plagne <laurent.plagne@edf.fr)>
 // Copyright (C) EDF R&D,  lun sep 30 14:23:17 CEST 2002
 //=====================================================
-// 
+//
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
 // as published by the Free Software Foundation; either version 2
 // of the License, or (at your option) any later version.
-// 
+//
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -16,7 +16,7 @@
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-// 
+//
 #ifndef SIZE_LOG
 #define SIZE_LOG
 
@@ -25,30 +25,26 @@
 //            resize() method
 //            [] operator for setting element
 // the vector element are int compatible.
-template<class Vector>
-void size_log(const int nb_point, const int size_min, const int size_max, Vector & X)
-{
+template <class Vector>
+void size_log(const int nb_point, const int size_min, const int size_max, Vector& X) {
   X.resize(nb_point);
 
-  float ls_min=log(float(size_min));
-  float ls_max=log(float(size_max));
+  float ls_min = log(float(size_min));
+  float ls_max = log(float(size_max));
 
-  float ls=0.0;
+  float ls = 0.0;
 
-  float delta_ls=(ls_max-ls_min)/(float(nb_point-1));
+  float delta_ls = (ls_max - ls_min) / (float(nb_point - 1));
 
-  int size=0;
+  int size = 0;
 
-  for (int i=0;i<nb_point;i++){
+  for (int i = 0; i < nb_point; i++) {
+    ls = ls_min + float(i) * delta_ls;
 
-    ls = ls_min + float(i)*delta_ls ;
-    
-    size=int(exp(ls)); 
+    size = int(exp(ls));
 
-    X[i]=size;
+    X[i] = size;
   }
-
 }
 
-
 #endif
diff --git a/bench/btl/generic_bench/utils/utilities.h b/bench/btl/generic_bench/utils/utilities.h
index d2330d0..352d61a 100644
--- a/bench/btl/generic_bench/utils/utilities.h
+++ b/bench/btl/generic_bench/utils/utilities.h
@@ -9,82 +9,120 @@
 
 /* ---  Definition macros file to print information if _DEBUG_ is defined --- */
 
-# ifndef UTILITIES_H
-# define UTILITIES_H
+#ifndef UTILITIES_H
+#define UTILITIES_H
 
-# include <stdlib.h>
-//# include <iostream> ok for gcc3.01
-# include <iostream>
+#include <stdlib.h>
+// # include <iostream> ok for gcc3.01
+#include <iostream>
 
 /* ---  INFOS is always defined (without _DEBUG_): to be used for warnings, with release version --- */
 
-# define HEREWEARE cout<<flush ; cerr << __FILE__ << " [" << __LINE__ << "] : " << flush ;
-# define INFOS(chain) {HEREWEARE ; cerr << chain << endl ;}
-# define PYSCRIPT(chain) {cout<<flush ; cerr << "---PYSCRIPT--- " << chain << endl ;}
+#define HEREWEARE \
+  cout << flush;  \
+  cerr << __FILE__ << " [" << __LINE__ << "] : " << flush;
+#define INFOS(chain)       \
+  {                        \
+    HEREWEARE;             \
+    cerr << chain << endl; \
+  }
+#define PYSCRIPT(chain)                         \
+  {                                             \
+    cout << flush;                              \
+    cerr << "---PYSCRIPT--- " << chain << endl; \
+  }
 
 /* --- To print date and time of compilation of current source on stdout --- */
 
-# if defined ( __GNUC__ )
-# define COMPILER		"g++" ;
-# elif defined ( __sun )
-# define COMPILER		"CC" ;
-# elif defined ( __KCC )
-# define COMPILER		"KCC" ;
-# elif defined ( __PGI )
-# define COMPILER		"pgCC" ;
-# else
-# define COMPILER		"undefined" ;
-# endif
+#if defined(__GNUC__)
+#define COMPILER "g++";
+#elif defined(__sun)
+#define COMPILER "CC";
+#elif defined(__KCC)
+#define COMPILER "KCC";
+#elif defined(__PGI)
+#define COMPILER "pgCC";
+#else
+#define COMPILER "undefined";
+#endif
 
-# ifdef INFOS_COMPILATION
-# error INFOS_COMPILATION already defined
-# endif
-# define INFOS_COMPILATION	{\
-					cerr << flush;\
-					cout << __FILE__ ;\
-					cout << " [" << __LINE__ << "] : " ;\
-					cout << "COMPILED with " << COMPILER ;\
-					cout << ", " << __DATE__ ; \
-					cout << " at " << __TIME__ << endl ;\
-					cout << "\n\n" ;\
-					cout << flush ;\
-				}
+#ifdef INFOS_COMPILATION
+#error INFOS_COMPILATION already defined
+#endif
+#define INFOS_COMPILATION                 \
+  {                                       \
+    cerr << flush;                        \
+    cout << __FILE__;                     \
+    cout << " [" << __LINE__ << "] : ";   \
+    cout << "COMPILED with " << COMPILER; \
+    cout << ", " << __DATE__;             \
+    cout << " at " << __TIME__ << endl;   \
+    cout << "\n\n";                       \
+    cout << flush;                        \
+  }
 
-# ifdef _DEBUG_
+#ifdef _DEBUG_
 
 /* --- the following MACROS are useful at debug time --- */
 
-# define HERE cout<<flush ; cerr << "- Trace " << __FILE__ << " [" << __LINE__ << "] : " << flush ;
-# define SCRUTE(var) HERE ; cerr << #var << "=" << var << endl ;
-# define MESSAGE(chain) {HERE ; cerr << chain << endl ;}
-# define INTERRUPTION(code) HERE ; cerr << "INTERRUPTION return code= " << code << endl ; exit(code) ;
+#define HERE     \
+  cout << flush; \
+  cerr << "- Trace " << __FILE__ << " [" << __LINE__ << "] : " << flush;
+#define SCRUTE(var) \
+  HERE;             \
+  cerr << #var << "=" << var << endl;
+#define MESSAGE(chain)     \
+  {                        \
+    HERE;                  \
+    cerr << chain << endl; \
+  }
+#define INTERRUPTION(code)                              \
+  HERE;                                                 \
+  cerr << "INTERRUPTION return code= " << code << endl; \
+  exit(code);
 
-# ifndef ASSERT
-# define ASSERT(condition) if (!(condition)){ HERE ; cerr << "CONDITION " << #condition << " NOT VERIFIED"<< endl ; INTERRUPTION(1) ;}
-# endif /* ASSERT */
+#ifndef ASSERT
+#define ASSERT(condition)                                          \
+  if (!(condition)) {                                              \
+    HERE;                                                          \
+    cerr << "CONDITION " << #condition << " NOT VERIFIED" << endl; \
+    INTERRUPTION(1);                                               \
+  }
+#endif /* ASSERT */
 
-#define REPERE cout<<flush ; cerr << "   --------------" << endl << flush ;
-#define BEGIN_OF(chain) {REPERE ; HERE ; cerr << "Begin of: " << chain << endl ; REPERE ; }
-#define END_OF(chain) {REPERE ; HERE ; cerr << "Normal end of: " << chain << endl ; REPERE ; }
+#define REPERE   \
+  cout << flush; \
+  cerr << "   --------------" << endl << flush;
+#define BEGIN_OF(chain)                    \
+  {                                        \
+    REPERE;                                \
+    HERE;                                  \
+    cerr << "Begin of: " << chain << endl; \
+    REPERE;                                \
+  }
+#define END_OF(chain)                           \
+  {                                             \
+    REPERE;                                     \
+    HERE;                                       \
+    cerr << "Normal end of: " << chain << endl; \
+    REPERE;                                     \
+  }
 
+#else /* ifdef _DEBUG_*/
 
+#define HERE
+#define SCRUTE(var)
+#define MESSAGE(chain)
+#define INTERRUPTION(code)
 
-# else /* ifdef _DEBUG_*/
-
-# define HERE
-# define SCRUTE(var)
-# define MESSAGE(chain)
-# define INTERRUPTION(code)
-
-# ifndef ASSERT
-# define ASSERT(condition)
-# endif /* ASSERT */
+#ifndef ASSERT
+#define ASSERT(condition)
+#endif /* ASSERT */
 
 #define REPERE
 #define BEGIN_OF(chain)
 #define END_OF(chain)
 
+#endif /* ifdef _DEBUG_*/
 
-# endif /* ifdef _DEBUG_*/
-
-# endif /* ifndef UTILITIES_H */
+#endif /* ifndef UTILITIES_H */
diff --git a/bench/btl/generic_bench/utils/xy_file.hh b/bench/btl/generic_bench/utils/xy_file.hh
index 0492faf..e34e302 100644
--- a/bench/btl/generic_bench/utils/xy_file.hh
+++ b/bench/btl/generic_bench/utils/xy_file.hh
@@ -1,14 +1,14 @@
 //=====================================================
 // File   :  dump_file_x_y.hh
-// Author :  L. Plagne <laurent.plagne@edf.fr)>        
+// Author :  L. Plagne <laurent.plagne@edf.fr)>
 // Copyright (C) EDF R&D,  lun sep 30 14:23:20 CEST 2002
 //=====================================================
-// 
+//
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
 // as published by the Free Software Foundation; either version 2
 // of the License, or (at your option) any later version.
-// 
+//
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -16,7 +16,7 @@
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-// 
+//
 #ifndef XY_FILE_HH
 #define XY_FILE_HH
 #include <fstream>
@@ -25,24 +25,22 @@
 #include <vector>
 using namespace std;
 
-bool read_xy_file(const std::string & filename, std::vector<int> & tab_sizes,
-                  std::vector<double> & tab_mflops, bool quiet = false)
-{
+bool read_xy_file(const std::string& filename, std::vector<int>& tab_sizes, std::vector<double>& tab_mflops,
+                  bool quiet = false) {
+  std::ifstream input_file(filename.c_str(), std::ios::in);
 
-  std::ifstream input_file (filename.c_str(),std::ios::in);
-
-  if (!input_file){
+  if (!input_file) {
     if (!quiet) {
-      INFOS("!!! Error opening "<<filename);
+      INFOS("!!! Error opening " << filename);
     }
     return false;
   }
 
-  int nb_point=0;
-  int size=0;
-  double mflops=0;
+  int nb_point = 0;
+  int size = 0;
+  double mflops = 0;
 
-  while (input_file >> size >> mflops ){
+  while (input_file >> size >> mflops) {
     nb_point++;
     tab_sizes.push_back(size);
     tab_mflops.push_back(mflops);
@@ -60,16 +58,14 @@
 
 using namespace std;
 
-template<class Vector_A, class Vector_B>
-void dump_xy_file(const Vector_A & X, const Vector_B & Y, const std::string & filename){
-  
-  ofstream outfile (filename.c_str(),ios::out) ;
-  int size=X.size();
-  
-  for (int i=0;i<size;i++)
-    outfile << X[i] << " " << Y[i] << endl;
+template <class Vector_A, class Vector_B>
+void dump_xy_file(const Vector_A& X, const Vector_B& Y, const std::string& filename) {
+  ofstream outfile(filename.c_str(), ios::out);
+  int size = X.size();
+
+  for (int i = 0; i < size; i++) outfile << X[i] << " " << Y[i] << endl;
 
   outfile.close();
-} 
+}
 
 #endif
diff --git a/bench/btl/libs/BLAS/blas.h b/bench/btl/libs/BLAS/blas.h
index 28f3a4e..6cf56ef 100644
--- a/bench/btl/libs/BLAS/blas.h
+++ b/bench/btl/libs/BLAS/blas.h
@@ -11,664 +11,534 @@
 typedef unsigned long BLASULONG;
 #endif
 
-int    BLASFUNC(xerbla)(const char *, int *info, int);
+int BLASFUNC(xerbla)(const char *, int *info, int);
 
-float  BLASFUNC(sdot)  (int *, float  *, int *, float  *, int *);
-float  BLASFUNC(sdsdot)(int *, float  *,        float  *, int *, float  *, int *);
+float BLASFUNC(sdot)(int *, float *, int *, float *, int *);
+float BLASFUNC(sdsdot)(int *, float *, float *, int *, float *, int *);
 
-double BLASFUNC(dsdot) (int *, float  *, int *, float  *, int *);
-double BLASFUNC(ddot)  (int *, double *, int *, double *, int *);
-double BLASFUNC(qdot)  (int *, double *, int *, double *, int *);
+double BLASFUNC(dsdot)(int *, float *, int *, float *, int *);
+double BLASFUNC(ddot)(int *, double *, int *, double *, int *);
+double BLASFUNC(qdot)(int *, double *, int *, double *, int *);
 
 #if defined(F_INTERFACE_GFORT) && !defined(__64BIT__)
-int   BLASFUNC(cdotu)  (int *, float  * , int *, float  *,  int *);
-int   BLASFUNC(cdotc)  (int *, float  *,  int *, float  *,  int *);
-void  BLASFUNC(zdotu)  (double *, int *, double  *, int *, double  *, int *);
-void  BLASFUNC(zdotc)  (double *, int *, double  *, int *, double  *, int *);
-void  BLASFUNC(xdotu)  (double *, int *, double  *, int *, double  *, int *);
-void  BLASFUNC(xdotc)  (double *, int *, double  *, int *, double  *, int *);
-#elif  defined(F_INTERFACE_F2C) || \
-     defined(F_INTERFACE_PGI) || \
-     defined(F_INTERFACE_GFORT) || \
+int BLASFUNC(cdotu)(int *, float *, int *, float *, int *);
+int BLASFUNC(cdotc)(int *, float *, int *, float *, int *);
+void BLASFUNC(zdotu)(double *, int *, double *, int *, double *, int *);
+void BLASFUNC(zdotc)(double *, int *, double *, int *, double *, int *);
+void BLASFUNC(xdotu)(double *, int *, double *, int *, double *, int *);
+void BLASFUNC(xdotc)(double *, int *, double *, int *, double *, int *);
+#elif defined(F_INTERFACE_F2C) || defined(F_INTERFACE_PGI) || defined(F_INTERFACE_GFORT) || \
     (defined(F_INTERFACE_PATHSCALE) && defined(__64BIT__))
-void  BLASFUNC(cdotu)  (float *,  int *, float  * , int *, float  *,  int *);
-void  BLASFUNC(cdotc)  (float *,  int *, float  *,  int *, float  *,  int *);
-void  BLASFUNC(zdotu)  (double *, int *, double  *, int *, double  *, int *);
-void  BLASFUNC(zdotc)  (double *, int *, double  *, int *, double  *, int *);
-void  BLASFUNC(xdotu)  (double *, int *, double  *, int *, double  *, int *);
-void  BLASFUNC(xdotc)  (double *, int *, double  *, int *, double  *, int *);
+void BLASFUNC(cdotu)(float *, int *, float *, int *, float *, int *);
+void BLASFUNC(cdotc)(float *, int *, float *, int *, float *, int *);
+void BLASFUNC(zdotu)(double *, int *, double *, int *, double *, int *);
+void BLASFUNC(zdotc)(double *, int *, double *, int *, double *, int *);
+void BLASFUNC(xdotu)(double *, int *, double *, int *, double *, int *);
+void BLASFUNC(xdotc)(double *, int *, double *, int *, double *, int *);
 #else
-std::complex<float>   BLASFUNC(cdotu)  (int *, float  *, int *, float  *, int *);
-std::complex<float>   BLASFUNC(cdotc)  (int *, float  *, int *, float  *, int *);
-std::complex<double>  BLASFUNC(zdotu)  (int *, double  *, int *, double  *, int *);
-std::complex<double>  BLASFUNC(zdotc)  (int *, double  *, int *, double  *, int *);
-double  BLASFUNC(xdotu)  (int *, double  *, int *, double  *, int *);
-double  BLASFUNC(xdotc)  (int *, double  *, int *, double  *, int *);
+std::complex<float> BLASFUNC(cdotu)(int *, float *, int *, float *, int *);
+std::complex<float> BLASFUNC(cdotc)(int *, float *, int *, float *, int *);
+std::complex<double> BLASFUNC(zdotu)(int *, double *, int *, double *, int *);
+std::complex<double> BLASFUNC(zdotc)(int *, double *, int *, double *, int *);
+double BLASFUNC(xdotu)(int *, double *, int *, double *, int *);
+double BLASFUNC(xdotc)(int *, double *, int *, double *, int *);
 #endif
 
-int  BLASFUNC(cdotuw)  (int *, float  *, int *, float  *, int *, float*);
-int  BLASFUNC(cdotcw)  (int *, float  *, int *, float  *, int *, float*);
-int  BLASFUNC(zdotuw)  (int *, double  *, int *, double  *, int *, double*);
-int  BLASFUNC(zdotcw)  (int *, double  *, int *, double  *, int *, double*);
+int BLASFUNC(cdotuw)(int *, float *, int *, float *, int *, float *);
+int BLASFUNC(cdotcw)(int *, float *, int *, float *, int *, float *);
+int BLASFUNC(zdotuw)(int *, double *, int *, double *, int *, double *);
+int BLASFUNC(zdotcw)(int *, double *, int *, double *, int *, double *);
 
-int    BLASFUNC(saxpy) (int *, float  *, float  *, int *, float  *, int *);
-int    BLASFUNC(daxpy) (int *, double *, double *, int *, double *, int *);
-int    BLASFUNC(qaxpy) (int *, double *, double *, int *, double *, int *);
-int    BLASFUNC(caxpy) (int *, float  *, float  *, int *, float  *, int *);
-int    BLASFUNC(zaxpy) (int *, double *, double *, int *, double *, int *);
-int    BLASFUNC(xaxpy) (int *, double *, double *, int *, double *, int *);
-int    BLASFUNC(caxpyc)(int *, float  *, float  *, int *, float  *, int *);
-int    BLASFUNC(zaxpyc)(int *, double *, double *, int *, double *, int *);
-int    BLASFUNC(xaxpyc)(int *, double *, double *, int *, double *, int *);
+int BLASFUNC(saxpy)(int *, float *, float *, int *, float *, int *);
+int BLASFUNC(daxpy)(int *, double *, double *, int *, double *, int *);
+int BLASFUNC(qaxpy)(int *, double *, double *, int *, double *, int *);
+int BLASFUNC(caxpy)(int *, float *, float *, int *, float *, int *);
+int BLASFUNC(zaxpy)(int *, double *, double *, int *, double *, int *);
+int BLASFUNC(xaxpy)(int *, double *, double *, int *, double *, int *);
+int BLASFUNC(caxpyc)(int *, float *, float *, int *, float *, int *);
+int BLASFUNC(zaxpyc)(int *, double *, double *, int *, double *, int *);
+int BLASFUNC(xaxpyc)(int *, double *, double *, int *, double *, int *);
 
-int    BLASFUNC(scopy) (int *, float  *, int *, float  *, int *);
-int    BLASFUNC(dcopy) (int *, double *, int *, double *, int *);
-int    BLASFUNC(qcopy) (int *, double *, int *, double *, int *);
-int    BLASFUNC(ccopy) (int *, float  *, int *, float  *, int *);
-int    BLASFUNC(zcopy) (int *, double *, int *, double *, int *);
-int    BLASFUNC(xcopy) (int *, double *, int *, double *, int *);
+int BLASFUNC(scopy)(int *, float *, int *, float *, int *);
+int BLASFUNC(dcopy)(int *, double *, int *, double *, int *);
+int BLASFUNC(qcopy)(int *, double *, int *, double *, int *);
+int BLASFUNC(ccopy)(int *, float *, int *, float *, int *);
+int BLASFUNC(zcopy)(int *, double *, int *, double *, int *);
+int BLASFUNC(xcopy)(int *, double *, int *, double *, int *);
 
-int    BLASFUNC(sswap) (int *, float  *, int *, float  *, int *);
-int    BLASFUNC(dswap) (int *, double *, int *, double *, int *);
-int    BLASFUNC(qswap) (int *, double *, int *, double *, int *);
-int    BLASFUNC(cswap) (int *, float  *, int *, float  *, int *);
-int    BLASFUNC(zswap) (int *, double *, int *, double *, int *);
-int    BLASFUNC(xswap) (int *, double *, int *, double *, int *);
+int BLASFUNC(sswap)(int *, float *, int *, float *, int *);
+int BLASFUNC(dswap)(int *, double *, int *, double *, int *);
+int BLASFUNC(qswap)(int *, double *, int *, double *, int *);
+int BLASFUNC(cswap)(int *, float *, int *, float *, int *);
+int BLASFUNC(zswap)(int *, double *, int *, double *, int *);
+int BLASFUNC(xswap)(int *, double *, int *, double *, int *);
 
-float  BLASFUNC(sasum) (int *, float  *, int *);
-float  BLASFUNC(scasum)(int *, float  *, int *);
-double BLASFUNC(dasum) (int *, double *, int *);
-double BLASFUNC(qasum) (int *, double *, int *);
+float BLASFUNC(sasum)(int *, float *, int *);
+float BLASFUNC(scasum)(int *, float *, int *);
+double BLASFUNC(dasum)(int *, double *, int *);
+double BLASFUNC(qasum)(int *, double *, int *);
 double BLASFUNC(dzasum)(int *, double *, int *);
 double BLASFUNC(qxasum)(int *, double *, int *);
 
-int    BLASFUNC(isamax)(int *, float  *, int *);
-int    BLASFUNC(idamax)(int *, double *, int *);
-int    BLASFUNC(iqamax)(int *, double *, int *);
-int    BLASFUNC(icamax)(int *, float  *, int *);
-int    BLASFUNC(izamax)(int *, double *, int *);
-int    BLASFUNC(ixamax)(int *, double *, int *);
+int BLASFUNC(isamax)(int *, float *, int *);
+int BLASFUNC(idamax)(int *, double *, int *);
+int BLASFUNC(iqamax)(int *, double *, int *);
+int BLASFUNC(icamax)(int *, float *, int *);
+int BLASFUNC(izamax)(int *, double *, int *);
+int BLASFUNC(ixamax)(int *, double *, int *);
 
-int    BLASFUNC(ismax) (int *, float  *, int *);
-int    BLASFUNC(idmax) (int *, double *, int *);
-int    BLASFUNC(iqmax) (int *, double *, int *);
-int    BLASFUNC(icmax) (int *, float  *, int *);
-int    BLASFUNC(izmax) (int *, double *, int *);
-int    BLASFUNC(ixmax) (int *, double *, int *);
+int BLASFUNC(ismax)(int *, float *, int *);
+int BLASFUNC(idmax)(int *, double *, int *);
+int BLASFUNC(iqmax)(int *, double *, int *);
+int BLASFUNC(icmax)(int *, float *, int *);
+int BLASFUNC(izmax)(int *, double *, int *);
+int BLASFUNC(ixmax)(int *, double *, int *);
 
-int    BLASFUNC(isamin)(int *, float  *, int *);
-int    BLASFUNC(idamin)(int *, double *, int *);
-int    BLASFUNC(iqamin)(int *, double *, int *);
-int    BLASFUNC(icamin)(int *, float  *, int *);
-int    BLASFUNC(izamin)(int *, double *, int *);
-int    BLASFUNC(ixamin)(int *, double *, int *);
+int BLASFUNC(isamin)(int *, float *, int *);
+int BLASFUNC(idamin)(int *, double *, int *);
+int BLASFUNC(iqamin)(int *, double *, int *);
+int BLASFUNC(icamin)(int *, float *, int *);
+int BLASFUNC(izamin)(int *, double *, int *);
+int BLASFUNC(ixamin)(int *, double *, int *);
 
-int    BLASFUNC(ismin)(int *, float  *, int *);
-int    BLASFUNC(idmin)(int *, double *, int *);
-int    BLASFUNC(iqmin)(int *, double *, int *);
-int    BLASFUNC(icmin)(int *, float  *, int *);
-int    BLASFUNC(izmin)(int *, double *, int *);
-int    BLASFUNC(ixmin)(int *, double *, int *);
+int BLASFUNC(ismin)(int *, float *, int *);
+int BLASFUNC(idmin)(int *, double *, int *);
+int BLASFUNC(iqmin)(int *, double *, int *);
+int BLASFUNC(icmin)(int *, float *, int *);
+int BLASFUNC(izmin)(int *, double *, int *);
+int BLASFUNC(ixmin)(int *, double *, int *);
 
-float  BLASFUNC(samax) (int *, float  *, int *);
-double BLASFUNC(damax) (int *, double *, int *);
-double BLASFUNC(qamax) (int *, double *, int *);
-float  BLASFUNC(scamax)(int *, float  *, int *);
+float BLASFUNC(samax)(int *, float *, int *);
+double BLASFUNC(damax)(int *, double *, int *);
+double BLASFUNC(qamax)(int *, double *, int *);
+float BLASFUNC(scamax)(int *, float *, int *);
 double BLASFUNC(dzamax)(int *, double *, int *);
 double BLASFUNC(qxamax)(int *, double *, int *);
 
-float  BLASFUNC(samin) (int *, float  *, int *);
-double BLASFUNC(damin) (int *, double *, int *);
-double BLASFUNC(qamin) (int *, double *, int *);
-float  BLASFUNC(scamin)(int *, float  *, int *);
+float BLASFUNC(samin)(int *, float *, int *);
+double BLASFUNC(damin)(int *, double *, int *);
+double BLASFUNC(qamin)(int *, double *, int *);
+float BLASFUNC(scamin)(int *, float *, int *);
 double BLASFUNC(dzamin)(int *, double *, int *);
 double BLASFUNC(qxamin)(int *, double *, int *);
 
-float  BLASFUNC(smax)  (int *, float  *, int *);
-double BLASFUNC(dmax)  (int *, double *, int *);
-double BLASFUNC(qmax)  (int *, double *, int *);
-float  BLASFUNC(scmax) (int *, float  *, int *);
-double BLASFUNC(dzmax) (int *, double *, int *);
-double BLASFUNC(qxmax) (int *, double *, int *);
+float BLASFUNC(smax)(int *, float *, int *);
+double BLASFUNC(dmax)(int *, double *, int *);
+double BLASFUNC(qmax)(int *, double *, int *);
+float BLASFUNC(scmax)(int *, float *, int *);
+double BLASFUNC(dzmax)(int *, double *, int *);
+double BLASFUNC(qxmax)(int *, double *, int *);
 
-float  BLASFUNC(smin)  (int *, float  *, int *);
-double BLASFUNC(dmin)  (int *, double *, int *);
-double BLASFUNC(qmin)  (int *, double *, int *);
-float  BLASFUNC(scmin) (int *, float  *, int *);
-double BLASFUNC(dzmin) (int *, double *, int *);
-double BLASFUNC(qxmin) (int *, double *, int *);
+float BLASFUNC(smin)(int *, float *, int *);
+double BLASFUNC(dmin)(int *, double *, int *);
+double BLASFUNC(qmin)(int *, double *, int *);
+float BLASFUNC(scmin)(int *, float *, int *);
+double BLASFUNC(dzmin)(int *, double *, int *);
+double BLASFUNC(qxmin)(int *, double *, int *);
 
-int    BLASFUNC(sscal) (int *,  float  *, float  *, int *);
-int    BLASFUNC(dscal) (int *,  double *, double *, int *);
-int    BLASFUNC(qscal) (int *,  double *, double *, int *);
-int    BLASFUNC(cscal) (int *,  float  *, float  *, int *);
-int    BLASFUNC(zscal) (int *,  double *, double *, int *);
-int    BLASFUNC(xscal) (int *,  double *, double *, int *);
-int    BLASFUNC(csscal)(int *,  float  *, float  *, int *);
-int    BLASFUNC(zdscal)(int *,  double *, double *, int *);
-int    BLASFUNC(xqscal)(int *,  double *, double *, int *);
+int BLASFUNC(sscal)(int *, float *, float *, int *);
+int BLASFUNC(dscal)(int *, double *, double *, int *);
+int BLASFUNC(qscal)(int *, double *, double *, int *);
+int BLASFUNC(cscal)(int *, float *, float *, int *);
+int BLASFUNC(zscal)(int *, double *, double *, int *);
+int BLASFUNC(xscal)(int *, double *, double *, int *);
+int BLASFUNC(csscal)(int *, float *, float *, int *);
+int BLASFUNC(zdscal)(int *, double *, double *, int *);
+int BLASFUNC(xqscal)(int *, double *, double *, int *);
 
-float  BLASFUNC(snrm2) (int *, float  *, int *);
-float  BLASFUNC(scnrm2)(int *, float  *, int *);
+float BLASFUNC(snrm2)(int *, float *, int *);
+float BLASFUNC(scnrm2)(int *, float *, int *);
 
-double BLASFUNC(dnrm2) (int *, double *, int *);
-double BLASFUNC(qnrm2) (int *, double *, int *);
+double BLASFUNC(dnrm2)(int *, double *, int *);
+double BLASFUNC(qnrm2)(int *, double *, int *);
 double BLASFUNC(dznrm2)(int *, double *, int *);
 double BLASFUNC(qxnrm2)(int *, double *, int *);
 
-int    BLASFUNC(srot)  (int *, float  *, int *, float  *, int *, float  *, float  *);
-int    BLASFUNC(drot)  (int *, double *, int *, double *, int *, double *, double *);
-int    BLASFUNC(qrot)  (int *, double *, int *, double *, int *, double *, double *);
-int    BLASFUNC(csrot) (int *, float  *, int *, float  *, int *, float  *, float  *);
-int    BLASFUNC(zdrot) (int *, double *, int *, double *, int *, double *, double *);
-int    BLASFUNC(xqrot) (int *, double *, int *, double *, int *, double *, double *);
+int BLASFUNC(srot)(int *, float *, int *, float *, int *, float *, float *);
+int BLASFUNC(drot)(int *, double *, int *, double *, int *, double *, double *);
+int BLASFUNC(qrot)(int *, double *, int *, double *, int *, double *, double *);
+int BLASFUNC(csrot)(int *, float *, int *, float *, int *, float *, float *);
+int BLASFUNC(zdrot)(int *, double *, int *, double *, int *, double *, double *);
+int BLASFUNC(xqrot)(int *, double *, int *, double *, int *, double *, double *);
 
-int    BLASFUNC(srotg) (float  *, float  *, float  *, float  *);
-int    BLASFUNC(drotg) (double *, double *, double *, double *);
-int    BLASFUNC(qrotg) (double *, double *, double *, double *);
-int    BLASFUNC(crotg) (float  *, float  *, float  *, float  *);
-int    BLASFUNC(zrotg) (double *, double *, double *, double *);
-int    BLASFUNC(xrotg) (double *, double *, double *, double *);
+int BLASFUNC(srotg)(float *, float *, float *, float *);
+int BLASFUNC(drotg)(double *, double *, double *, double *);
+int BLASFUNC(qrotg)(double *, double *, double *, double *);
+int BLASFUNC(crotg)(float *, float *, float *, float *);
+int BLASFUNC(zrotg)(double *, double *, double *, double *);
+int BLASFUNC(xrotg)(double *, double *, double *, double *);
 
-int    BLASFUNC(srotmg)(float  *, float  *, float  *, float  *, float  *);
-int    BLASFUNC(drotmg)(double *, double *, double *, double *, double *);
+int BLASFUNC(srotmg)(float *, float *, float *, float *, float *);
+int BLASFUNC(drotmg)(double *, double *, double *, double *, double *);
 
-int    BLASFUNC(srotm) (int *, float  *, int *, float  *, int *, float  *);
-int    BLASFUNC(drotm) (int *, double *, int *, double *, int *, double *);
-int    BLASFUNC(qrotm) (int *, double *, int *, double *, int *, double *);
+int BLASFUNC(srotm)(int *, float *, int *, float *, int *, float *);
+int BLASFUNC(drotm)(int *, double *, int *, double *, int *, double *);
+int BLASFUNC(qrotm)(int *, double *, int *, double *, int *, double *);
 
 /* Level 2 routines */
 
-int BLASFUNC(sger)(int *,    int *, float *,  float *, int *,
-		   float *,  int *, float *,  int *);
-int BLASFUNC(dger)(int *,    int *, double *, double *, int *,
-		   double *, int *, double *, int *);
-int BLASFUNC(qger)(int *,    int *, double *, double *, int *,
-		   double *, int *, double *, int *);
-int BLASFUNC(cgeru)(int *,    int *, float *,  float *, int *,
-		    float *,  int *, float *,  int *);
-int BLASFUNC(cgerc)(int *,    int *, float *,  float *, int *,
-		    float *,  int *, float *,  int *);
-int BLASFUNC(zgeru)(int *,    int *, double *, double *, int *,
-		    double *, int *, double *, int *);
-int BLASFUNC(zgerc)(int *,    int *, double *, double *, int *,
-		    double *, int *, double *, int *);
-int BLASFUNC(xgeru)(int *,    int *, double *, double *, int *,
-		    double *, int *, double *, int *);
-int BLASFUNC(xgerc)(int *,    int *, double *, double *, int *,
-		    double *, int *, double *, int *);
+int BLASFUNC(sger)(int *, int *, float *, float *, int *, float *, int *, float *, int *);
+int BLASFUNC(dger)(int *, int *, double *, double *, int *, double *, int *, double *, int *);
+int BLASFUNC(qger)(int *, int *, double *, double *, int *, double *, int *, double *, int *);
+int BLASFUNC(cgeru)(int *, int *, float *, float *, int *, float *, int *, float *, int *);
+int BLASFUNC(cgerc)(int *, int *, float *, float *, int *, float *, int *, float *, int *);
+int BLASFUNC(zgeru)(int *, int *, double *, double *, int *, double *, int *, double *, int *);
+int BLASFUNC(zgerc)(int *, int *, double *, double *, int *, double *, int *, double *, int *);
+int BLASFUNC(xgeru)(int *, int *, double *, double *, int *, double *, int *, double *, int *);
+int BLASFUNC(xgerc)(int *, int *, double *, double *, int *, double *, int *, double *, int *);
 
-int BLASFUNC(sgemv)(char *, int *, int *, float  *, float  *, int *,
-		    float  *, int *, float  *, float  *, int *);
-int BLASFUNC(dgemv)(char *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
-int BLASFUNC(qgemv)(char *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
-int BLASFUNC(cgemv)(char *, int *, int *, float  *, float  *, int *,
-		    float  *, int *, float  *, float  *, int *);
-int BLASFUNC(zgemv)(char *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
-int BLASFUNC(xgemv)(char *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
+int BLASFUNC(sgemv)(char *, int *, int *, float *, float *, int *, float *, int *, float *, float *, int *);
+int BLASFUNC(dgemv)(char *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
+int BLASFUNC(qgemv)(char *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
+int BLASFUNC(cgemv)(char *, int *, int *, float *, float *, int *, float *, int *, float *, float *, int *);
+int BLASFUNC(zgemv)(char *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
+int BLASFUNC(xgemv)(char *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
 
-int BLASFUNC(strsv) (char *, char *, char *, int *, float  *, int *,
-		     float  *, int *);
-int BLASFUNC(dtrsv) (char *, char *, char *, int *, double *, int *,
-		     double *, int *);
-int BLASFUNC(qtrsv) (char *, char *, char *, int *, double *, int *,
-		     double *, int *);
-int BLASFUNC(ctrsv) (char *, char *, char *, int *, float  *, int *,
-		     float  *, int *);
-int BLASFUNC(ztrsv) (char *, char *, char *, int *, double *, int *,
-		     double *, int *);
-int BLASFUNC(xtrsv) (char *, char *, char *, int *, double *, int *,
-		     double *, int *);
+int BLASFUNC(strsv)(char *, char *, char *, int *, float *, int *, float *, int *);
+int BLASFUNC(dtrsv)(char *, char *, char *, int *, double *, int *, double *, int *);
+int BLASFUNC(qtrsv)(char *, char *, char *, int *, double *, int *, double *, int *);
+int BLASFUNC(ctrsv)(char *, char *, char *, int *, float *, int *, float *, int *);
+int BLASFUNC(ztrsv)(char *, char *, char *, int *, double *, int *, double *, int *);
+int BLASFUNC(xtrsv)(char *, char *, char *, int *, double *, int *, double *, int *);
 
-int BLASFUNC(stpsv) (char *, char *, char *, int *, float  *, float  *, int *);
-int BLASFUNC(dtpsv) (char *, char *, char *, int *, double *, double *, int *);
-int BLASFUNC(qtpsv) (char *, char *, char *, int *, double *, double *, int *);
-int BLASFUNC(ctpsv) (char *, char *, char *, int *, float  *, float  *, int *);
-int BLASFUNC(ztpsv) (char *, char *, char *, int *, double *, double *, int *);
-int BLASFUNC(xtpsv) (char *, char *, char *, int *, double *, double *, int *);
+int BLASFUNC(stpsv)(char *, char *, char *, int *, float *, float *, int *);
+int BLASFUNC(dtpsv)(char *, char *, char *, int *, double *, double *, int *);
+int BLASFUNC(qtpsv)(char *, char *, char *, int *, double *, double *, int *);
+int BLASFUNC(ctpsv)(char *, char *, char *, int *, float *, float *, int *);
+int BLASFUNC(ztpsv)(char *, char *, char *, int *, double *, double *, int *);
+int BLASFUNC(xtpsv)(char *, char *, char *, int *, double *, double *, int *);
 
-int BLASFUNC(strmv) (char *, char *, char *, int *, float  *, int *,
-		     float  *, int *);
-int BLASFUNC(dtrmv) (char *, char *, char *, int *, double *, int *,
-		     double *, int *);
-int BLASFUNC(qtrmv) (char *, char *, char *, int *, double *, int *,
-		     double *, int *);
-int BLASFUNC(ctrmv) (char *, char *, char *, int *, float  *, int *,
-		     float  *, int *);
-int BLASFUNC(ztrmv) (char *, char *, char *, int *, double *, int *,
-		     double *, int *);
-int BLASFUNC(xtrmv) (char *, char *, char *, int *, double *, int *,
-		     double *, int *);
+int BLASFUNC(strmv)(char *, char *, char *, int *, float *, int *, float *, int *);
+int BLASFUNC(dtrmv)(char *, char *, char *, int *, double *, int *, double *, int *);
+int BLASFUNC(qtrmv)(char *, char *, char *, int *, double *, int *, double *, int *);
+int BLASFUNC(ctrmv)(char *, char *, char *, int *, float *, int *, float *, int *);
+int BLASFUNC(ztrmv)(char *, char *, char *, int *, double *, int *, double *, int *);
+int BLASFUNC(xtrmv)(char *, char *, char *, int *, double *, int *, double *, int *);
 
-int BLASFUNC(stpmv) (char *, char *, char *, int *, float  *, float  *, int *);
-int BLASFUNC(dtpmv) (char *, char *, char *, int *, double *, double *, int *);
-int BLASFUNC(qtpmv) (char *, char *, char *, int *, double *, double *, int *);
-int BLASFUNC(ctpmv) (char *, char *, char *, int *, float  *, float  *, int *);
-int BLASFUNC(ztpmv) (char *, char *, char *, int *, double *, double *, int *);
-int BLASFUNC(xtpmv) (char *, char *, char *, int *, double *, double *, int *);
+int BLASFUNC(stpmv)(char *, char *, char *, int *, float *, float *, int *);
+int BLASFUNC(dtpmv)(char *, char *, char *, int *, double *, double *, int *);
+int BLASFUNC(qtpmv)(char *, char *, char *, int *, double *, double *, int *);
+int BLASFUNC(ctpmv)(char *, char *, char *, int *, float *, float *, int *);
+int BLASFUNC(ztpmv)(char *, char *, char *, int *, double *, double *, int *);
+int BLASFUNC(xtpmv)(char *, char *, char *, int *, double *, double *, int *);
 
-int BLASFUNC(stbmv) (char *, char *, char *, int *, int *, float  *, int *, float  *, int *);
-int BLASFUNC(dtbmv) (char *, char *, char *, int *, int *, double *, int *, double *, int *);
-int BLASFUNC(qtbmv) (char *, char *, char *, int *, int *, double *, int *, double *, int *);
-int BLASFUNC(ctbmv) (char *, char *, char *, int *, int *, float  *, int *, float  *, int *);
-int BLASFUNC(ztbmv) (char *, char *, char *, int *, int *, double *, int *, double *, int *);
-int BLASFUNC(xtbmv) (char *, char *, char *, int *, int *, double *, int *, double *, int *);
+int BLASFUNC(stbmv)(char *, char *, char *, int *, int *, float *, int *, float *, int *);
+int BLASFUNC(dtbmv)(char *, char *, char *, int *, int *, double *, int *, double *, int *);
+int BLASFUNC(qtbmv)(char *, char *, char *, int *, int *, double *, int *, double *, int *);
+int BLASFUNC(ctbmv)(char *, char *, char *, int *, int *, float *, int *, float *, int *);
+int BLASFUNC(ztbmv)(char *, char *, char *, int *, int *, double *, int *, double *, int *);
+int BLASFUNC(xtbmv)(char *, char *, char *, int *, int *, double *, int *, double *, int *);
 
-int BLASFUNC(stbsv) (char *, char *, char *, int *, int *, float  *, int *, float  *, int *);
-int BLASFUNC(dtbsv) (char *, char *, char *, int *, int *, double *, int *, double *, int *);
-int BLASFUNC(qtbsv) (char *, char *, char *, int *, int *, double *, int *, double *, int *);
-int BLASFUNC(ctbsv) (char *, char *, char *, int *, int *, float  *, int *, float  *, int *);
-int BLASFUNC(ztbsv) (char *, char *, char *, int *, int *, double *, int *, double *, int *);
-int BLASFUNC(xtbsv) (char *, char *, char *, int *, int *, double *, int *, double *, int *);
+int BLASFUNC(stbsv)(char *, char *, char *, int *, int *, float *, int *, float *, int *);
+int BLASFUNC(dtbsv)(char *, char *, char *, int *, int *, double *, int *, double *, int *);
+int BLASFUNC(qtbsv)(char *, char *, char *, int *, int *, double *, int *, double *, int *);
+int BLASFUNC(ctbsv)(char *, char *, char *, int *, int *, float *, int *, float *, int *);
+int BLASFUNC(ztbsv)(char *, char *, char *, int *, int *, double *, int *, double *, int *);
+int BLASFUNC(xtbsv)(char *, char *, char *, int *, int *, double *, int *, double *, int *);
 
-int BLASFUNC(ssymv) (char *, int *, float  *, float *, int *,
-		     float  *, int *, float *, float *, int *);
-int BLASFUNC(dsymv) (char *, int *, double  *, double *, int *,
-		     double  *, int *, double *, double *, int *);
-int BLASFUNC(qsymv) (char *, int *, double  *, double *, int *,
-		     double  *, int *, double *, double *, int *);
-int BLASFUNC(csymv) (char *, int *, float  *, float *, int *,
-		     float  *, int *, float *, float *, int *);
-int BLASFUNC(zsymv) (char *, int *, double  *, double *, int *,
-		     double  *, int *, double *, double *, int *);
-int BLASFUNC(xsymv) (char *, int *, double  *, double *, int *,
-		     double  *, int *, double *, double *, int *);
+int BLASFUNC(ssymv)(char *, int *, float *, float *, int *, float *, int *, float *, float *, int *);
+int BLASFUNC(dsymv)(char *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
+int BLASFUNC(qsymv)(char *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
+int BLASFUNC(csymv)(char *, int *, float *, float *, int *, float *, int *, float *, float *, int *);
+int BLASFUNC(zsymv)(char *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
+int BLASFUNC(xsymv)(char *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
 
-int BLASFUNC(sspmv) (char *, int *, float  *, float *,
-		     float  *, int *, float *, float *, int *);
-int BLASFUNC(dspmv) (char *, int *, double  *, double *,
-		     double  *, int *, double *, double *, int *);
-int BLASFUNC(qspmv) (char *, int *, double  *, double *,
-		     double  *, int *, double *, double *, int *);
-int BLASFUNC(cspmv) (char *, int *, float  *, float *,
-		     float  *, int *, float *, float *, int *);
-int BLASFUNC(zspmv) (char *, int *, double  *, double *,
-		     double  *, int *, double *, double *, int *);
-int BLASFUNC(xspmv) (char *, int *, double  *, double *,
-		     double  *, int *, double *, double *, int *);
+int BLASFUNC(sspmv)(char *, int *, float *, float *, float *, int *, float *, float *, int *);
+int BLASFUNC(dspmv)(char *, int *, double *, double *, double *, int *, double *, double *, int *);
+int BLASFUNC(qspmv)(char *, int *, double *, double *, double *, int *, double *, double *, int *);
+int BLASFUNC(cspmv)(char *, int *, float *, float *, float *, int *, float *, float *, int *);
+int BLASFUNC(zspmv)(char *, int *, double *, double *, double *, int *, double *, double *, int *);
+int BLASFUNC(xspmv)(char *, int *, double *, double *, double *, int *, double *, double *, int *);
 
-int BLASFUNC(ssyr) (char *, int *, float   *, float  *, int *,
-		    float  *, int *);
-int BLASFUNC(dsyr) (char *, int *, double  *, double *, int *,
-		    double *, int *);
-int BLASFUNC(qsyr) (char *, int *, double  *, double *, int *,
-		    double *, int *);
-int BLASFUNC(csyr) (char *, int *, float   *, float  *, int *,
-		    float  *, int *);
-int BLASFUNC(zsyr) (char *, int *, double  *, double *, int *,
-		    double *, int *);
-int BLASFUNC(xsyr) (char *, int *, double  *, double *, int *,
-		    double *, int *);
+int BLASFUNC(ssyr)(char *, int *, float *, float *, int *, float *, int *);
+int BLASFUNC(dsyr)(char *, int *, double *, double *, int *, double *, int *);
+int BLASFUNC(qsyr)(char *, int *, double *, double *, int *, double *, int *);
+int BLASFUNC(csyr)(char *, int *, float *, float *, int *, float *, int *);
+int BLASFUNC(zsyr)(char *, int *, double *, double *, int *, double *, int *);
+int BLASFUNC(xsyr)(char *, int *, double *, double *, int *, double *, int *);
 
-int BLASFUNC(ssyr2) (char *, int *, float   *,
-		     float  *, int *, float  *, int *, float  *, int *);
-int BLASFUNC(dsyr2) (char *, int *, double  *,
-		     double *, int *, double *, int *, double *, int *);
-int BLASFUNC(qsyr2) (char *, int *, double  *,
-		     double *, int *, double *, int *, double *, int *);
-int BLASFUNC(csyr2) (char *, int *, float   *,
-		     float  *, int *, float  *, int *, float  *, int *);
-int BLASFUNC(zsyr2) (char *, int *, double  *,
-		     double *, int *, double *, int *, double *, int *);
-int BLASFUNC(xsyr2) (char *, int *, double  *,
-		     double *, int *, double *, int *, double *, int *);
+int BLASFUNC(ssyr2)(char *, int *, float *, float *, int *, float *, int *, float *, int *);
+int BLASFUNC(dsyr2)(char *, int *, double *, double *, int *, double *, int *, double *, int *);
+int BLASFUNC(qsyr2)(char *, int *, double *, double *, int *, double *, int *, double *, int *);
+int BLASFUNC(csyr2)(char *, int *, float *, float *, int *, float *, int *, float *, int *);
+int BLASFUNC(zsyr2)(char *, int *, double *, double *, int *, double *, int *, double *, int *);
+int BLASFUNC(xsyr2)(char *, int *, double *, double *, int *, double *, int *, double *, int *);
 
-int BLASFUNC(sspr) (char *, int *, float   *, float  *, int *,
-		    float  *);
-int BLASFUNC(dspr) (char *, int *, double  *, double *, int *,
-		    double *);
-int BLASFUNC(qspr) (char *, int *, double  *, double *, int *,
-		    double *);
-int BLASFUNC(cspr) (char *, int *, float   *, float  *, int *,
-		    float  *);
-int BLASFUNC(zspr) (char *, int *, double  *, double *, int *,
-		    double *);
-int BLASFUNC(xspr) (char *, int *, double  *, double *, int *,
-		    double *);
+int BLASFUNC(sspr)(char *, int *, float *, float *, int *, float *);
+int BLASFUNC(dspr)(char *, int *, double *, double *, int *, double *);
+int BLASFUNC(qspr)(char *, int *, double *, double *, int *, double *);
+int BLASFUNC(cspr)(char *, int *, float *, float *, int *, float *);
+int BLASFUNC(zspr)(char *, int *, double *, double *, int *, double *);
+int BLASFUNC(xspr)(char *, int *, double *, double *, int *, double *);
 
-int BLASFUNC(sspr2) (char *, int *, float   *,
-		     float  *, int *, float  *, int *, float  *);
-int BLASFUNC(dspr2) (char *, int *, double  *,
-		     double *, int *, double *, int *, double *);
-int BLASFUNC(qspr2) (char *, int *, double  *,
-		     double *, int *, double *, int *, double *);
-int BLASFUNC(cspr2) (char *, int *, float   *,
-		     float  *, int *, float  *, int *, float  *);
-int BLASFUNC(zspr2) (char *, int *, double  *,
-		     double *, int *, double *, int *, double *);
-int BLASFUNC(xspr2) (char *, int *, double  *,
-		     double *, int *, double *, int *, double *);
+int BLASFUNC(sspr2)(char *, int *, float *, float *, int *, float *, int *, float *);
+int BLASFUNC(dspr2)(char *, int *, double *, double *, int *, double *, int *, double *);
+int BLASFUNC(qspr2)(char *, int *, double *, double *, int *, double *, int *, double *);
+int BLASFUNC(cspr2)(char *, int *, float *, float *, int *, float *, int *, float *);
+int BLASFUNC(zspr2)(char *, int *, double *, double *, int *, double *, int *, double *);
+int BLASFUNC(xspr2)(char *, int *, double *, double *, int *, double *, int *, double *);
 
-int BLASFUNC(cher) (char *, int *, float   *, float  *, int *,
-		    float  *, int *);
-int BLASFUNC(zher) (char *, int *, double  *, double *, int *,
-		    double *, int *);
-int BLASFUNC(xher) (char *, int *, double  *, double *, int *,
-		    double *, int *);
+int BLASFUNC(cher)(char *, int *, float *, float *, int *, float *, int *);
+int BLASFUNC(zher)(char *, int *, double *, double *, int *, double *, int *);
+int BLASFUNC(xher)(char *, int *, double *, double *, int *, double *, int *);
 
-int BLASFUNC(chpr) (char *, int *, float   *, float  *, int *, float  *);
-int BLASFUNC(zhpr) (char *, int *, double  *, double *, int *, double *);
-int BLASFUNC(xhpr) (char *, int *, double  *, double *, int *, double *);
+int BLASFUNC(chpr)(char *, int *, float *, float *, int *, float *);
+int BLASFUNC(zhpr)(char *, int *, double *, double *, int *, double *);
+int BLASFUNC(xhpr)(char *, int *, double *, double *, int *, double *);
 
-int BLASFUNC(cher2) (char *, int *, float   *,
-		     float  *, int *, float  *, int *, float  *, int *);
-int BLASFUNC(zher2) (char *, int *, double  *,
-		     double *, int *, double *, int *, double *, int *);
-int BLASFUNC(xher2) (char *, int *, double  *,
-		     double *, int *, double *, int *, double *, int *);
+int BLASFUNC(cher2)(char *, int *, float *, float *, int *, float *, int *, float *, int *);
+int BLASFUNC(zher2)(char *, int *, double *, double *, int *, double *, int *, double *, int *);
+int BLASFUNC(xher2)(char *, int *, double *, double *, int *, double *, int *, double *, int *);
 
-int BLASFUNC(chpr2) (char *, int *, float   *,
-		     float  *, int *, float  *, int *, float  *);
-int BLASFUNC(zhpr2) (char *, int *, double  *,
-		     double *, int *, double *, int *, double *);
-int BLASFUNC(xhpr2) (char *, int *, double  *,
-		     double *, int *, double *, int *, double *);
+int BLASFUNC(chpr2)(char *, int *, float *, float *, int *, float *, int *, float *);
+int BLASFUNC(zhpr2)(char *, int *, double *, double *, int *, double *, int *, double *);
+int BLASFUNC(xhpr2)(char *, int *, double *, double *, int *, double *, int *, double *);
 
-int BLASFUNC(chemv) (char *, int *, float  *, float *, int *,
-		     float  *, int *, float *, float *, int *);
-int BLASFUNC(zhemv) (char *, int *, double  *, double *, int *,
-		     double  *, int *, double *, double *, int *);
-int BLASFUNC(xhemv) (char *, int *, double  *, double *, int *,
-		     double  *, int *, double *, double *, int *);
+int BLASFUNC(chemv)(char *, int *, float *, float *, int *, float *, int *, float *, float *, int *);
+int BLASFUNC(zhemv)(char *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
+int BLASFUNC(xhemv)(char *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
 
-int BLASFUNC(chpmv) (char *, int *, float  *, float *,
-		     float  *, int *, float *, float *, int *);
-int BLASFUNC(zhpmv) (char *, int *, double  *, double *,
-		     double  *, int *, double *, double *, int *);
-int BLASFUNC(xhpmv) (char *, int *, double  *, double *,
-		     double  *, int *, double *, double *, int *);
+int BLASFUNC(chpmv)(char *, int *, float *, float *, float *, int *, float *, float *, int *);
+int BLASFUNC(zhpmv)(char *, int *, double *, double *, double *, int *, double *, double *, int *);
+int BLASFUNC(xhpmv)(char *, int *, double *, double *, double *, int *, double *, double *, int *);
 
-int BLASFUNC(snorm)(char *, int *, int *, float  *, int *);
+int BLASFUNC(snorm)(char *, int *, int *, float *, int *);
 int BLASFUNC(dnorm)(char *, int *, int *, double *, int *);
-int BLASFUNC(cnorm)(char *, int *, int *, float  *, int *);
+int BLASFUNC(cnorm)(char *, int *, int *, float *, int *);
 int BLASFUNC(znorm)(char *, int *, int *, double *, int *);
 
-int BLASFUNC(sgbmv)(char *, int *, int *, int *, int *, float  *, float  *, int *,
-		    float  *, int *, float  *, float  *, int *);
-int BLASFUNC(dgbmv)(char *, int *, int *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
-int BLASFUNC(qgbmv)(char *, int *, int *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
-int BLASFUNC(cgbmv)(char *, int *, int *, int *, int *, float  *, float  *, int *,
-		    float  *, int *, float  *, float  *, int *);
-int BLASFUNC(zgbmv)(char *, int *, int *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
-int BLASFUNC(xgbmv)(char *, int *, int *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
+int BLASFUNC(sgbmv)(char *, int *, int *, int *, int *, float *, float *, int *, float *, int *, float *, float *,
+                    int *);
+int BLASFUNC(dgbmv)(char *, int *, int *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                    int *);
+int BLASFUNC(qgbmv)(char *, int *, int *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                    int *);
+int BLASFUNC(cgbmv)(char *, int *, int *, int *, int *, float *, float *, int *, float *, int *, float *, float *,
+                    int *);
+int BLASFUNC(zgbmv)(char *, int *, int *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                    int *);
+int BLASFUNC(xgbmv)(char *, int *, int *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                    int *);
 
-int BLASFUNC(ssbmv)(char *, int *, int *, float  *, float  *, int *,
-		    float  *, int *, float  *, float  *, int *);
-int BLASFUNC(dsbmv)(char *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
-int BLASFUNC(qsbmv)(char *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
-int BLASFUNC(csbmv)(char *, int *, int *, float  *, float  *, int *,
-		    float  *, int *, float  *, float  *, int *);
-int BLASFUNC(zsbmv)(char *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
-int BLASFUNC(xsbmv)(char *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
+int BLASFUNC(ssbmv)(char *, int *, int *, float *, float *, int *, float *, int *, float *, float *, int *);
+int BLASFUNC(dsbmv)(char *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
+int BLASFUNC(qsbmv)(char *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
+int BLASFUNC(csbmv)(char *, int *, int *, float *, float *, int *, float *, int *, float *, float *, int *);
+int BLASFUNC(zsbmv)(char *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
+int BLASFUNC(xsbmv)(char *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
 
-int BLASFUNC(chbmv)(char *, int *, int *, float  *, float  *, int *,
-		    float  *, int *, float  *, float  *, int *);
-int BLASFUNC(zhbmv)(char *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
-int BLASFUNC(xhbmv)(char *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
+int BLASFUNC(chbmv)(char *, int *, int *, float *, float *, int *, float *, int *, float *, float *, int *);
+int BLASFUNC(zhbmv)(char *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
+int BLASFUNC(xhbmv)(char *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
 
 /* Level 3 routines */
 
-int BLASFUNC(sgemm)(char *, char *, int *, int *, int *, float *,
-	   float  *, int *, float  *, int *, float  *, float  *, int *);
-int BLASFUNC(dgemm)(char *, char *, int *, int *, int *, double *,
-	   double *, int *, double *, int *, double *, double *, int *);
-int BLASFUNC(qgemm)(char *, char *, int *, int *, int *, double *,
-	   double *, int *, double *, int *, double *, double *, int *);
-int BLASFUNC(cgemm)(char *, char *, int *, int *, int *, float *,
-	   float  *, int *, float  *, int *, float  *, float  *, int *);
-int BLASFUNC(zgemm)(char *, char *, int *, int *, int *, double *,
-	   double *, int *, double *, int *, double *, double *, int *);
-int BLASFUNC(xgemm)(char *, char *, int *, int *, int *, double *,
-	   double *, int *, double *, int *, double *, double *, int *);
+int BLASFUNC(sgemm)(char *, char *, int *, int *, int *, float *, float *, int *, float *, int *, float *, float *,
+                    int *);
+int BLASFUNC(dgemm)(char *, char *, int *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                    int *);
+int BLASFUNC(qgemm)(char *, char *, int *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                    int *);
+int BLASFUNC(cgemm)(char *, char *, int *, int *, int *, float *, float *, int *, float *, int *, float *, float *,
+                    int *);
+int BLASFUNC(zgemm)(char *, char *, int *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                    int *);
+int BLASFUNC(xgemm)(char *, char *, int *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                    int *);
 
-int BLASFUNC(cgemm3m)(char *, char *, int *, int *, int *, float *,
-	   float  *, int *, float  *, int *, float  *, float  *, int *);
-int BLASFUNC(zgemm3m)(char *, char *, int *, int *, int *, double *,
-	   double *, int *, double *, int *, double *, double *, int *);
-int BLASFUNC(xgemm3m)(char *, char *, int *, int *, int *, double *,
-	   double *, int *, double *, int *, double *, double *, int *);
+int BLASFUNC(cgemm3m)(char *, char *, int *, int *, int *, float *, float *, int *, float *, int *, float *, float *,
+                      int *);
+int BLASFUNC(zgemm3m)(char *, char *, int *, int *, int *, double *, double *, int *, double *, int *, double *,
+                      double *, int *);
+int BLASFUNC(xgemm3m)(char *, char *, int *, int *, int *, double *, double *, int *, double *, int *, double *,
+                      double *, int *);
 
-int BLASFUNC(sge2mm)(char *, char *, char *, int *, int *,
-		     float *, float  *, int *, float  *, int *,
-		     float *, float  *, int *);
-int BLASFUNC(dge2mm)(char *, char *, char *, int *, int *,
-		     double *, double  *, int *, double  *, int *,
-		     double *, double  *, int *);
-int BLASFUNC(cge2mm)(char *, char *, char *, int *, int *,
-		     float *, float  *, int *, float  *, int *,
-		     float *, float  *, int *);
-int BLASFUNC(zge2mm)(char *, char *, char *, int *, int *,
-		     double *, double  *, int *, double  *, int *,
-		     double *, double  *, int *);
+int BLASFUNC(sge2mm)(char *, char *, char *, int *, int *, float *, float *, int *, float *, int *, float *, float *,
+                     int *);
+int BLASFUNC(dge2mm)(char *, char *, char *, int *, int *, double *, double *, int *, double *, int *, double *,
+                     double *, int *);
+int BLASFUNC(cge2mm)(char *, char *, char *, int *, int *, float *, float *, int *, float *, int *, float *, float *,
+                     int *);
+int BLASFUNC(zge2mm)(char *, char *, char *, int *, int *, double *, double *, int *, double *, int *, double *,
+                     double *, int *);
 
-int BLASFUNC(strsm)(char *, char *, char *, char *, int *, int *,
-	   float *,  float *, int *, float *, int *);
-int BLASFUNC(dtrsm)(char *, char *, char *, char *, int *, int *,
-	   double *,  double *, int *, double *, int *);
-int BLASFUNC(qtrsm)(char *, char *, char *, char *, int *, int *,
-	   double *,  double *, int *, double *, int *);
-int BLASFUNC(ctrsm)(char *, char *, char *, char *, int *, int *,
-	   float *,  float *, int *, float *, int *);
-int BLASFUNC(ztrsm)(char *, char *, char *, char *, int *, int *,
-	   double *,  double *, int *, double *, int *);
-int BLASFUNC(xtrsm)(char *, char *, char *, char *, int *, int *,
-	   double *,  double *, int *, double *, int *);
+int BLASFUNC(strsm)(char *, char *, char *, char *, int *, int *, float *, float *, int *, float *, int *);
+int BLASFUNC(dtrsm)(char *, char *, char *, char *, int *, int *, double *, double *, int *, double *, int *);
+int BLASFUNC(qtrsm)(char *, char *, char *, char *, int *, int *, double *, double *, int *, double *, int *);
+int BLASFUNC(ctrsm)(char *, char *, char *, char *, int *, int *, float *, float *, int *, float *, int *);
+int BLASFUNC(ztrsm)(char *, char *, char *, char *, int *, int *, double *, double *, int *, double *, int *);
+int BLASFUNC(xtrsm)(char *, char *, char *, char *, int *, int *, double *, double *, int *, double *, int *);
 
-int BLASFUNC(strmm)(char *, char *, char *, char *, int *, int *,
-	   float *,  float *, int *, float *, int *);
-int BLASFUNC(dtrmm)(char *, char *, char *, char *, int *, int *,
-	   double *,  double *, int *, double *, int *);
-int BLASFUNC(qtrmm)(char *, char *, char *, char *, int *, int *,
-	   double *,  double *, int *, double *, int *);
-int BLASFUNC(ctrmm)(char *, char *, char *, char *, int *, int *,
-	   float *,  float *, int *, float *, int *);
-int BLASFUNC(ztrmm)(char *, char *, char *, char *, int *, int *,
-	   double *,  double *, int *, double *, int *);
-int BLASFUNC(xtrmm)(char *, char *, char *, char *, int *, int *,
-	   double *,  double *, int *, double *, int *);
+int BLASFUNC(strmm)(char *, char *, char *, char *, int *, int *, float *, float *, int *, float *, int *);
+int BLASFUNC(dtrmm)(char *, char *, char *, char *, int *, int *, double *, double *, int *, double *, int *);
+int BLASFUNC(qtrmm)(char *, char *, char *, char *, int *, int *, double *, double *, int *, double *, int *);
+int BLASFUNC(ctrmm)(char *, char *, char *, char *, int *, int *, float *, float *, int *, float *, int *);
+int BLASFUNC(ztrmm)(char *, char *, char *, char *, int *, int *, double *, double *, int *, double *, int *);
+int BLASFUNC(xtrmm)(char *, char *, char *, char *, int *, int *, double *, double *, int *, double *, int *);
 
-int BLASFUNC(ssymm)(char *, char *, int *, int *, float  *, float  *, int *,
-	   float  *, int *, float  *, float  *, int *);
-int BLASFUNC(dsymm)(char *, char *, int *, int *, double *, double *, int *,
-	   double *, int *, double *, double *, int *);
-int BLASFUNC(qsymm)(char *, char *, int *, int *, double *, double *, int *,
-	   double *, int *, double *, double *, int *);
-int BLASFUNC(csymm)(char *, char *, int *, int *, float  *, float  *, int *,
-	   float  *, int *, float  *, float  *, int *);
-int BLASFUNC(zsymm)(char *, char *, int *, int *, double *, double *, int *,
-	   double *, int *, double *, double *, int *);
-int BLASFUNC(xsymm)(char *, char *, int *, int *, double *, double *, int *,
-	   double *, int *, double *, double *, int *);
+int BLASFUNC(ssymm)(char *, char *, int *, int *, float *, float *, int *, float *, int *, float *, float *, int *);
+int BLASFUNC(dsymm)(char *, char *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                    int *);
+int BLASFUNC(qsymm)(char *, char *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                    int *);
+int BLASFUNC(csymm)(char *, char *, int *, int *, float *, float *, int *, float *, int *, float *, float *, int *);
+int BLASFUNC(zsymm)(char *, char *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                    int *);
+int BLASFUNC(xsymm)(char *, char *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                    int *);
 
-int BLASFUNC(csymm3m)(char *, char *, int *, int *, float  *, float  *, int *,
-	   float  *, int *, float  *, float  *, int *);
-int BLASFUNC(zsymm3m)(char *, char *, int *, int *, double *, double *, int *,
-	   double *, int *, double *, double *, int *);
-int BLASFUNC(xsymm3m)(char *, char *, int *, int *, double *, double *, int *,
-	   double *, int *, double *, double *, int *);
+int BLASFUNC(csymm3m)(char *, char *, int *, int *, float *, float *, int *, float *, int *, float *, float *, int *);
+int BLASFUNC(zsymm3m)(char *, char *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                      int *);
+int BLASFUNC(xsymm3m)(char *, char *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                      int *);
 
-int BLASFUNC(ssyrk)(char *, char *, int *, int *, float  *, float  *, int *,
-	   float  *, float  *, int *);
-int BLASFUNC(dsyrk)(char *, char *, int *, int *, double *, double *, int *,
-	   double *, double *, int *);
-int BLASFUNC(qsyrk)(char *, char *, int *, int *, double *, double *, int *,
-	   double *, double *, int *);
-int BLASFUNC(csyrk)(char *, char *, int *, int *, float  *, float  *, int *,
-	   float  *, float  *, int *);
-int BLASFUNC(zsyrk)(char *, char *, int *, int *, double *, double *, int *,
-	   double *, double *, int *);
-int BLASFUNC(xsyrk)(char *, char *, int *, int *, double *, double *, int *,
-	   double *, double *, int *);
+int BLASFUNC(ssyrk)(char *, char *, int *, int *, float *, float *, int *, float *, float *, int *);
+int BLASFUNC(dsyrk)(char *, char *, int *, int *, double *, double *, int *, double *, double *, int *);
+int BLASFUNC(qsyrk)(char *, char *, int *, int *, double *, double *, int *, double *, double *, int *);
+int BLASFUNC(csyrk)(char *, char *, int *, int *, float *, float *, int *, float *, float *, int *);
+int BLASFUNC(zsyrk)(char *, char *, int *, int *, double *, double *, int *, double *, double *, int *);
+int BLASFUNC(xsyrk)(char *, char *, int *, int *, double *, double *, int *, double *, double *, int *);
 
-int BLASFUNC(ssyr2k)(char *, char *, int *, int *, float  *, float  *, int *,
-	   float *, int *, float  *, float  *, int *);
-int BLASFUNC(dsyr2k)(char *, char *, int *, int *, double *, double *, int *,
-	   double*, int *, double *, double *, int *);
-int BLASFUNC(qsyr2k)(char *, char *, int *, int *, double *, double *, int *,
-	   double*, int *, double *, double *, int *);
-int BLASFUNC(csyr2k)(char *, char *, int *, int *, float  *, float  *, int *,
-	   float *, int *, float  *, float  *, int *);
-int BLASFUNC(zsyr2k)(char *, char *, int *, int *, double *, double *, int *,
-	   double*, int *, double *, double *, int *);
-int BLASFUNC(xsyr2k)(char *, char *, int *, int *, double *, double *, int *,
-	   double*, int *, double *, double *, int *);
+int BLASFUNC(ssyr2k)(char *, char *, int *, int *, float *, float *, int *, float *, int *, float *, float *, int *);
+int BLASFUNC(dsyr2k)(char *, char *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                     int *);
+int BLASFUNC(qsyr2k)(char *, char *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                     int *);
+int BLASFUNC(csyr2k)(char *, char *, int *, int *, float *, float *, int *, float *, int *, float *, float *, int *);
+int BLASFUNC(zsyr2k)(char *, char *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                     int *);
+int BLASFUNC(xsyr2k)(char *, char *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                     int *);
 
-int BLASFUNC(chemm)(char *, char *, int *, int *, float  *, float  *, int *,
-	   float  *, int *, float  *, float  *, int *);
-int BLASFUNC(zhemm)(char *, char *, int *, int *, double *, double *, int *,
-	   double *, int *, double *, double *, int *);
-int BLASFUNC(xhemm)(char *, char *, int *, int *, double *, double *, int *,
-	   double *, int *, double *, double *, int *);
+int BLASFUNC(chemm)(char *, char *, int *, int *, float *, float *, int *, float *, int *, float *, float *, int *);
+int BLASFUNC(zhemm)(char *, char *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                    int *);
+int BLASFUNC(xhemm)(char *, char *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                    int *);
 
-int BLASFUNC(chemm3m)(char *, char *, int *, int *, float  *, float  *, int *,
-	   float  *, int *, float  *, float  *, int *);
-int BLASFUNC(zhemm3m)(char *, char *, int *, int *, double *, double *, int *,
-	   double *, int *, double *, double *, int *);
-int BLASFUNC(xhemm3m)(char *, char *, int *, int *, double *, double *, int *,
-	   double *, int *, double *, double *, int *);
+int BLASFUNC(chemm3m)(char *, char *, int *, int *, float *, float *, int *, float *, int *, float *, float *, int *);
+int BLASFUNC(zhemm3m)(char *, char *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                      int *);
+int BLASFUNC(xhemm3m)(char *, char *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                      int *);
 
-int BLASFUNC(cherk)(char *, char *, int *, int *, float  *, float  *, int *,
-	   float  *, float  *, int *);
-int BLASFUNC(zherk)(char *, char *, int *, int *, double *, double *, int *,
-	   double *, double *, int *);
-int BLASFUNC(xherk)(char *, char *, int *, int *, double *, double *, int *,
-	   double *, double *, int *);
+int BLASFUNC(cherk)(char *, char *, int *, int *, float *, float *, int *, float *, float *, int *);
+int BLASFUNC(zherk)(char *, char *, int *, int *, double *, double *, int *, double *, double *, int *);
+int BLASFUNC(xherk)(char *, char *, int *, int *, double *, double *, int *, double *, double *, int *);
 
-int BLASFUNC(cher2k)(char *, char *, int *, int *, float  *, float  *, int *,
-	   float *, int *, float  *, float  *, int *);
-int BLASFUNC(zher2k)(char *, char *, int *, int *, double *, double *, int *,
-	   double*, int *, double *, double *, int *);
-int BLASFUNC(xher2k)(char *, char *, int *, int *, double *, double *, int *,
-	   double*, int *, double *, double *, int *);
-int BLASFUNC(cher2m)(char *, char *, char *, int *, int *, float  *, float  *, int *,
-	   float *, int *, float  *, float  *, int *);
-int BLASFUNC(zher2m)(char *, char *, char *, int *, int *, double *, double *, int *,
-	   double*, int *, double *, double *, int *);
-int BLASFUNC(xher2m)(char *, char *, char *, int *, int *, double *, double *, int *,
-	   double*, int *, double *, double *, int *);
+int BLASFUNC(cher2k)(char *, char *, int *, int *, float *, float *, int *, float *, int *, float *, float *, int *);
+int BLASFUNC(zher2k)(char *, char *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                     int *);
+int BLASFUNC(xher2k)(char *, char *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                     int *);
+int BLASFUNC(cher2m)(char *, char *, char *, int *, int *, float *, float *, int *, float *, int *, float *, float *,
+                     int *);
+int BLASFUNC(zher2m)(char *, char *, char *, int *, int *, double *, double *, int *, double *, int *, double *,
+                     double *, int *);
+int BLASFUNC(xher2m)(char *, char *, char *, int *, int *, double *, double *, int *, double *, int *, double *,
+                     double *, int *);
 
-int BLASFUNC(sgemt)(char *, int *, int *, float  *, float  *, int *,
-		    float  *, int *);
-int BLASFUNC(dgemt)(char *, int *, int *, double *, double *, int *,
-		    double *, int *);
-int BLASFUNC(cgemt)(char *, int *, int *, float  *, float  *, int *,
-		    float  *, int *);
-int BLASFUNC(zgemt)(char *, int *, int *, double *, double *, int *,
-		    double *, int *);
+int BLASFUNC(sgemt)(char *, int *, int *, float *, float *, int *, float *, int *);
+int BLASFUNC(dgemt)(char *, int *, int *, double *, double *, int *, double *, int *);
+int BLASFUNC(cgemt)(char *, int *, int *, float *, float *, int *, float *, int *);
+int BLASFUNC(zgemt)(char *, int *, int *, double *, double *, int *, double *, int *);
 
-int BLASFUNC(sgema)(char *, char *, int *, int *, float  *,
-		    float  *, int *, float *, float  *, int *, float *, int *);
-int BLASFUNC(dgema)(char *, char *, int *, int *, double *,
-		    double *, int *, double*, double *, int *, double*, int *);
-int BLASFUNC(cgema)(char *, char *, int *, int *, float  *,
-		    float  *, int *, float *, float  *, int *, float *, int *);
-int BLASFUNC(zgema)(char *, char *, int *, int *, double *,
-		    double *, int *, double*, double *, int *, double*, int *);
+int BLASFUNC(sgema)(char *, char *, int *, int *, float *, float *, int *, float *, float *, int *, float *, int *);
+int BLASFUNC(dgema)(char *, char *, int *, int *, double *, double *, int *, double *, double *, int *, double *,
+                    int *);
+int BLASFUNC(cgema)(char *, char *, int *, int *, float *, float *, int *, float *, float *, int *, float *, int *);
+int BLASFUNC(zgema)(char *, char *, int *, int *, double *, double *, int *, double *, double *, int *, double *,
+                    int *);
 
-int BLASFUNC(sgems)(char *, char *, int *, int *, float  *,
-		    float  *, int *, float *, float  *, int *, float *, int *);
-int BLASFUNC(dgems)(char *, char *, int *, int *, double *,
-		    double *, int *, double*, double *, int *, double*, int *);
-int BLASFUNC(cgems)(char *, char *, int *, int *, float  *,
-		    float  *, int *, float *, float  *, int *, float *, int *);
-int BLASFUNC(zgems)(char *, char *, int *, int *, double *,
-		    double *, int *, double*, double *, int *, double*, int *);
+int BLASFUNC(sgems)(char *, char *, int *, int *, float *, float *, int *, float *, float *, int *, float *, int *);
+int BLASFUNC(dgems)(char *, char *, int *, int *, double *, double *, int *, double *, double *, int *, double *,
+                    int *);
+int BLASFUNC(cgems)(char *, char *, int *, int *, float *, float *, int *, float *, float *, int *, float *, int *);
+int BLASFUNC(zgems)(char *, char *, int *, int *, double *, double *, int *, double *, double *, int *, double *,
+                    int *);
 
-int BLASFUNC(sgetf2)(int *, int *, float  *, int *, int *, int *);
+int BLASFUNC(sgetf2)(int *, int *, float *, int *, int *, int *);
 int BLASFUNC(dgetf2)(int *, int *, double *, int *, int *, int *);
 int BLASFUNC(qgetf2)(int *, int *, double *, int *, int *, int *);
-int BLASFUNC(cgetf2)(int *, int *, float  *, int *, int *, int *);
+int BLASFUNC(cgetf2)(int *, int *, float *, int *, int *, int *);
 int BLASFUNC(zgetf2)(int *, int *, double *, int *, int *, int *);
 int BLASFUNC(xgetf2)(int *, int *, double *, int *, int *, int *);
 
-int BLASFUNC(sgetrf)(int *, int *, float  *, int *, int *, int *);
+int BLASFUNC(sgetrf)(int *, int *, float *, int *, int *, int *);
 int BLASFUNC(dgetrf)(int *, int *, double *, int *, int *, int *);
 int BLASFUNC(qgetrf)(int *, int *, double *, int *, int *, int *);
-int BLASFUNC(cgetrf)(int *, int *, float  *, int *, int *, int *);
+int BLASFUNC(cgetrf)(int *, int *, float *, int *, int *, int *);
 int BLASFUNC(zgetrf)(int *, int *, double *, int *, int *, int *);
 int BLASFUNC(xgetrf)(int *, int *, double *, int *, int *, int *);
 
-int BLASFUNC(slaswp)(int *, float  *, int *, int *, int *, int *, int *);
+int BLASFUNC(slaswp)(int *, float *, int *, int *, int *, int *, int *);
 int BLASFUNC(dlaswp)(int *, double *, int *, int *, int *, int *, int *);
 int BLASFUNC(qlaswp)(int *, double *, int *, int *, int *, int *, int *);
-int BLASFUNC(claswp)(int *, float  *, int *, int *, int *, int *, int *);
+int BLASFUNC(claswp)(int *, float *, int *, int *, int *, int *, int *);
 int BLASFUNC(zlaswp)(int *, double *, int *, int *, int *, int *, int *);
 int BLASFUNC(xlaswp)(int *, double *, int *, int *, int *, int *, int *);
 
-int BLASFUNC(sgetrs)(char *, int *, int *, float  *, int *, int *, float  *, int *, int *);
+int BLASFUNC(sgetrs)(char *, int *, int *, float *, int *, int *, float *, int *, int *);
 int BLASFUNC(dgetrs)(char *, int *, int *, double *, int *, int *, double *, int *, int *);
 int BLASFUNC(qgetrs)(char *, int *, int *, double *, int *, int *, double *, int *, int *);
-int BLASFUNC(cgetrs)(char *, int *, int *, float  *, int *, int *, float  *, int *, int *);
+int BLASFUNC(cgetrs)(char *, int *, int *, float *, int *, int *, float *, int *, int *);
 int BLASFUNC(zgetrs)(char *, int *, int *, double *, int *, int *, double *, int *, int *);
 int BLASFUNC(xgetrs)(char *, int *, int *, double *, int *, int *, double *, int *, int *);
 
-int BLASFUNC(sgesv)(int *, int *, float  *, int *, int *, float *, int *, int *);
-int BLASFUNC(dgesv)(int *, int *, double *, int *, int *, double*, int *, int *);
-int BLASFUNC(qgesv)(int *, int *, double *, int *, int *, double*, int *, int *);
-int BLASFUNC(cgesv)(int *, int *, float  *, int *, int *, float *, int *, int *);
-int BLASFUNC(zgesv)(int *, int *, double *, int *, int *, double*, int *, int *);
-int BLASFUNC(xgesv)(int *, int *, double *, int *, int *, double*, int *, int *);
+int BLASFUNC(sgesv)(int *, int *, float *, int *, int *, float *, int *, int *);
+int BLASFUNC(dgesv)(int *, int *, double *, int *, int *, double *, int *, int *);
+int BLASFUNC(qgesv)(int *, int *, double *, int *, int *, double *, int *, int *);
+int BLASFUNC(cgesv)(int *, int *, float *, int *, int *, float *, int *, int *);
+int BLASFUNC(zgesv)(int *, int *, double *, int *, int *, double *, int *, int *);
+int BLASFUNC(xgesv)(int *, int *, double *, int *, int *, double *, int *, int *);
 
-int BLASFUNC(spotf2)(char *, int *, float  *, int *, int *);
+int BLASFUNC(spotf2)(char *, int *, float *, int *, int *);
 int BLASFUNC(dpotf2)(char *, int *, double *, int *, int *);
 int BLASFUNC(qpotf2)(char *, int *, double *, int *, int *);
-int BLASFUNC(cpotf2)(char *, int *, float  *, int *, int *);
+int BLASFUNC(cpotf2)(char *, int *, float *, int *, int *);
 int BLASFUNC(zpotf2)(char *, int *, double *, int *, int *);
 int BLASFUNC(xpotf2)(char *, int *, double *, int *, int *);
 
-int BLASFUNC(spotrf)(char *, int *, float  *, int *, int *);
+int BLASFUNC(spotrf)(char *, int *, float *, int *, int *);
 int BLASFUNC(dpotrf)(char *, int *, double *, int *, int *);
 int BLASFUNC(qpotrf)(char *, int *, double *, int *, int *);
-int BLASFUNC(cpotrf)(char *, int *, float  *, int *, int *);
+int BLASFUNC(cpotrf)(char *, int *, float *, int *, int *);
 int BLASFUNC(zpotrf)(char *, int *, double *, int *, int *);
 int BLASFUNC(xpotrf)(char *, int *, double *, int *, int *);
 
-int BLASFUNC(slauu2)(char *, int *, float  *, int *, int *);
+int BLASFUNC(slauu2)(char *, int *, float *, int *, int *);
 int BLASFUNC(dlauu2)(char *, int *, double *, int *, int *);
 int BLASFUNC(qlauu2)(char *, int *, double *, int *, int *);
-int BLASFUNC(clauu2)(char *, int *, float  *, int *, int *);
+int BLASFUNC(clauu2)(char *, int *, float *, int *, int *);
 int BLASFUNC(zlauu2)(char *, int *, double *, int *, int *);
 int BLASFUNC(xlauu2)(char *, int *, double *, int *, int *);
 
-int BLASFUNC(slauum)(char *, int *, float  *, int *, int *);
+int BLASFUNC(slauum)(char *, int *, float *, int *, int *);
 int BLASFUNC(dlauum)(char *, int *, double *, int *, int *);
 int BLASFUNC(qlauum)(char *, int *, double *, int *, int *);
-int BLASFUNC(clauum)(char *, int *, float  *, int *, int *);
+int BLASFUNC(clauum)(char *, int *, float *, int *, int *);
 int BLASFUNC(zlauum)(char *, int *, double *, int *, int *);
 int BLASFUNC(xlauum)(char *, int *, double *, int *, int *);
 
-int BLASFUNC(strti2)(char *, char *, int *, float  *, int *, int *);
+int BLASFUNC(strti2)(char *, char *, int *, float *, int *, int *);
 int BLASFUNC(dtrti2)(char *, char *, int *, double *, int *, int *);
 int BLASFUNC(qtrti2)(char *, char *, int *, double *, int *, int *);
-int BLASFUNC(ctrti2)(char *, char *, int *, float  *, int *, int *);
+int BLASFUNC(ctrti2)(char *, char *, int *, float *, int *, int *);
 int BLASFUNC(ztrti2)(char *, char *, int *, double *, int *, int *);
 int BLASFUNC(xtrti2)(char *, char *, int *, double *, int *, int *);
 
-int BLASFUNC(strtri)(char *, char *, int *, float  *, int *, int *);
+int BLASFUNC(strtri)(char *, char *, int *, float *, int *, int *);
 int BLASFUNC(dtrtri)(char *, char *, int *, double *, int *, int *);
 int BLASFUNC(qtrtri)(char *, char *, int *, double *, int *, int *);
-int BLASFUNC(ctrtri)(char *, char *, int *, float  *, int *, int *);
+int BLASFUNC(ctrtri)(char *, char *, int *, float *, int *, int *);
 int BLASFUNC(ztrtri)(char *, char *, int *, double *, int *, int *);
 int BLASFUNC(xtrtri)(char *, char *, int *, double *, int *, int *);
 
-int BLASFUNC(spotri)(char *, int *, float  *, int *, int *);
+int BLASFUNC(spotri)(char *, int *, float *, int *, int *);
 int BLASFUNC(dpotri)(char *, int *, double *, int *, int *);
 int BLASFUNC(qpotri)(char *, int *, double *, int *, int *);
-int BLASFUNC(cpotri)(char *, int *, float  *, int *, int *);
+int BLASFUNC(cpotri)(char *, int *, float *, int *, int *);
 int BLASFUNC(zpotri)(char *, int *, double *, int *, int *);
 int BLASFUNC(xpotri)(char *, int *, double *, int *, int *);
 
diff --git a/bench/btl/libs/BLAS/blas_interface.hh b/bench/btl/libs/BLAS/blas_interface.hh
index 6510546..bb77303 100644
--- a/bench/btl/libs/BLAS/blas_interface.hh
+++ b/bench/btl/libs/BLAS/blas_interface.hh
@@ -22,24 +22,27 @@
 
 #include <c_interface_base.h>
 #include <complex>
-extern "C"
-{
+extern "C" {
 #include "blas.h"
 
-  // Cholesky Factorization
+// Cholesky Factorization
 //   void spotrf_(const char* uplo, const int* n, float *a, const int* ld, int* info);
 //   void dpotrf_(const char* uplo, const int* n, double *a, const int* ld, int* info);
-  void ssytrd_(char *uplo, const int *n, float *a, const int *lda, float *d, float *e, float *tau, float *work, int *lwork, int *info );
-  void dsytrd_(char *uplo, const int *n, double *a, const int *lda, double *d, double *e, double *tau, double *work, int *lwork, int *info );
-  void sgehrd_( const int *n, int *ilo, int *ihi, float *a, const int *lda, float *tau, float *work, int *lwork, int *info );
-  void dgehrd_( const int *n, int *ilo, int *ihi, double *a, const int *lda, double *tau, double *work, int *lwork, int *info );
+void ssytrd_(char *uplo, const int *n, float *a, const int *lda, float *d, float *e, float *tau, float *work,
+             int *lwork, int *info);
+void dsytrd_(char *uplo, const int *n, double *a, const int *lda, double *d, double *e, double *tau, double *work,
+             int *lwork, int *info);
+void sgehrd_(const int *n, int *ilo, int *ihi, float *a, const int *lda, float *tau, float *work, int *lwork,
+             int *info);
+void dgehrd_(const int *n, int *ilo, int *ihi, double *a, const int *lda, double *tau, double *work, int *lwork,
+             int *info);
 
-  // LU row pivoting
+// LU row pivoting
 //   void dgetrf_( int *m, int *n, double *a, int *lda, int *ipiv, int *info );
 //   void sgetrf_(const int* m, const int* n, float *a, const int* ld, int* ipivot, int* info);
-  // LU full pivoting
-  void sgetc2_(const int* n, float *a, const int *lda, int *ipiv, int *jpiv, int*info );
-  void dgetc2_(const int* n, double *a, const int *lda, int *ipiv, int *jpiv, int*info );
+// LU full pivoting
+void sgetc2_(const int *n, float *a, const int *lda, int *ipiv, int *jpiv, int *info);
+void dgetc2_(const int *n, double *a, const int *lda, int *ipiv, int *jpiv, int *info);
 #ifdef HAS_LAPACK
 #endif
 }
@@ -47,12 +50,11 @@
 #define MAKE_STRING2(S) #S
 #define MAKE_STRING(S) MAKE_STRING2(S)
 
-#define CAT2(A,B) A##B
-#define CAT(A,B) CAT2(A,B)
+#define CAT2(A, B) A##B
+#define CAT(A, B) CAT2(A, B)
 
-
-template<class real> class blas_interface;
-
+template <class real>
+class blas_interface;
 
 static char notrans = 'N';
 static char trans = 'T';
@@ -62,22 +64,16 @@
 static char left = 'L';
 static int intone = 1;
 
-
-
-#define SCALAR        float
+#define SCALAR float
 #define SCALAR_PREFIX s
 #include "blas_interface_impl.hh"
 #undef SCALAR
 #undef SCALAR_PREFIX
 
-
-#define SCALAR        double
+#define SCALAR double
 #define SCALAR_PREFIX d
 #include "blas_interface_impl.hh"
 #undef SCALAR
 #undef SCALAR_PREFIX
 
 #endif
-
-
-
diff --git a/bench/btl/libs/BLAS/blas_interface_impl.hh b/bench/btl/libs/BLAS/blas_interface_impl.hh
index 9e0a649..ba33bec 100644
--- a/bench/btl/libs/BLAS/blas_interface_impl.hh
+++ b/bench/btl/libs/BLAS/blas_interface_impl.hh
@@ -1,116 +1,109 @@
 
-#define BLAS_FUNC(NAME) CAT(CAT(SCALAR_PREFIX,NAME),_)
+#define BLAS_FUNC(NAME) CAT(CAT(SCALAR_PREFIX, NAME), _)
 
-template<> class blas_interface<SCALAR> : public c_interface_base<SCALAR>
-{
-
-public :
-  
+template <>
+class blas_interface<SCALAR> : public c_interface_base<SCALAR> {
+ public:
   static SCALAR fone;
   static SCALAR fzero;
 
-  static inline std::string name()
-  {
-    return MAKE_STRING(CBLASNAME);
+  static inline std::string name() { return MAKE_STRING(CBLASNAME); }
+
+  static inline void matrix_vector_product(gene_matrix& A, gene_vector& B, gene_vector& X, int N) {
+    BLAS_FUNC(gemv)(&notrans, &N, &N, &fone, A, &N, B, &intone, &fzero, X, &intone);
   }
 
-  static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){
-    BLAS_FUNC(gemv)(&notrans,&N,&N,&fone,A,&N,B,&intone,&fzero,X,&intone);
+  static inline void symv(gene_matrix& A, gene_vector& B, gene_vector& X, int N) {
+    BLAS_FUNC(symv)(&lower, &N, &fone, A, &N, B, &intone, &fzero, X, &intone);
   }
 
-  static inline void symv(gene_matrix & A, gene_vector & B, gene_vector & X, int N){
-    BLAS_FUNC(symv)(&lower, &N,&fone,A,&N,B,&intone,&fzero,X,&intone);
+  static inline void syr2(gene_matrix& A, gene_vector& B, gene_vector& X, int N) {
+    BLAS_FUNC(syr2)(&lower, &N, &fone, B, &intone, X, &intone, A, &N);
   }
 
-  static inline void syr2(gene_matrix & A, gene_vector & B, gene_vector & X, int N){
-    BLAS_FUNC(syr2)(&lower,&N,&fone,B,&intone,X,&intone,A,&N);
+  static inline void ger(gene_matrix& A, gene_vector& X, gene_vector& Y, int N) {
+    BLAS_FUNC(ger)(&N, &N, &fone, X, &intone, Y, &intone, A, &N);
   }
 
-  static inline void ger(gene_matrix & A, gene_vector & X, gene_vector & Y, int N){
-    BLAS_FUNC(ger)(&N,&N,&fone,X,&intone,Y,&intone,A,&N);
+  static inline void rot(gene_vector& A, gene_vector& B, SCALAR c, SCALAR s, int N) {
+    BLAS_FUNC(rot)(&N, A, &intone, B, &intone, &c, &s);
   }
 
-  static inline void rot(gene_vector & A,  gene_vector & B, SCALAR c, SCALAR s, int N){
-    BLAS_FUNC(rot)(&N,A,&intone,B,&intone,&c,&s);
+  static inline void atv_product(gene_matrix& A, gene_vector& B, gene_vector& X, int N) {
+    BLAS_FUNC(gemv)(&trans, &N, &N, &fone, A, &N, B, &intone, &fzero, X, &intone);
   }
 
-  static inline void atv_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){
-    BLAS_FUNC(gemv)(&trans,&N,&N,&fone,A,&N,B,&intone,&fzero,X,&intone);
+  static inline void matrix_matrix_product(gene_matrix& A, gene_matrix& B, gene_matrix& X, int N) {
+    BLAS_FUNC(gemm)(&notrans, &notrans, &N, &N, &N, &fone, A, &N, B, &N, &fzero, X, &N);
   }
 
-  static inline void matrix_matrix_product(gene_matrix & A, gene_matrix & B, gene_matrix & X, int N){
-    BLAS_FUNC(gemm)(&notrans,&notrans,&N,&N,&N,&fone,A,&N,B,&N,&fzero,X,&N);
+  static inline void transposed_matrix_matrix_product(gene_matrix& A, gene_matrix& B, gene_matrix& X, int N) {
+    BLAS_FUNC(gemm)(&notrans, &notrans, &N, &N, &N, &fone, A, &N, B, &N, &fzero, X, &N);
   }
 
-  static inline void transposed_matrix_matrix_product(gene_matrix & A, gene_matrix & B, gene_matrix & X, int N){
-    BLAS_FUNC(gemm)(&notrans,&notrans,&N,&N,&N,&fone,A,&N,B,&N,&fzero,X,&N);
+  static inline void ata_product(gene_matrix& A, gene_matrix& X, int N) {
+    BLAS_FUNC(syrk)(&lower, &trans, &N, &N, &fone, A, &N, &fzero, X, &N);
   }
 
-  static inline void ata_product(gene_matrix & A, gene_matrix & X, int N){
-    BLAS_FUNC(syrk)(&lower,&trans,&N,&N,&fone,A,&N,&fzero,X,&N);
+  static inline void aat_product(gene_matrix& A, gene_matrix& X, int N) {
+    BLAS_FUNC(syrk)(&lower, &notrans, &N, &N, &fone, A, &N, &fzero, X, &N);
   }
 
-  static inline void aat_product(gene_matrix & A, gene_matrix & X, int N){
-    BLAS_FUNC(syrk)(&lower,&notrans,&N,&N,&fone,A,&N,&fzero,X,&N);
+  static inline void axpy(SCALAR coef, const gene_vector& X, gene_vector& Y, int N) {
+    BLAS_FUNC(axpy)(&N, &coef, X, &intone, Y, &intone);
   }
 
-  static inline void axpy(SCALAR coef, const gene_vector & X, gene_vector & Y, int N){
-    BLAS_FUNC(axpy)(&N,&coef,X,&intone,Y,&intone);
+  static inline void axpby(SCALAR a, const gene_vector& X, SCALAR b, gene_vector& Y, int N) {
+    BLAS_FUNC(scal)(&N, &b, Y, &intone);
+    BLAS_FUNC(axpy)(&N, &a, X, &intone, Y, &intone);
   }
 
-  static inline void axpby(SCALAR a, const gene_vector & X, SCALAR b, gene_vector & Y, int N){
-    BLAS_FUNC(scal)(&N,&b,Y,&intone);
-    BLAS_FUNC(axpy)(&N,&a,X,&intone,Y,&intone);
-  }
-
-  static inline void cholesky(const gene_matrix & X, gene_matrix & C, int N){
-    int N2 = N*N;
+  static inline void cholesky(const gene_matrix& X, gene_matrix& C, int N) {
+    int N2 = N * N;
     BLAS_FUNC(copy)(&N2, X, &intone, C, &intone);
     char uplo = 'L';
     int info = 0;
     BLAS_FUNC(potrf)(&uplo, &N, C, &N, &info);
-    if(info!=0) std::cerr << "potrf_ error " << info << "\n";
+    if (info != 0) std::cerr << "potrf_ error " << info << "\n";
   }
 
-  static inline void partial_lu_decomp(const gene_matrix & X, gene_matrix & C, int N){
-    int N2 = N*N;
+  static inline void partial_lu_decomp(const gene_matrix& X, gene_matrix& C, int N) {
+    int N2 = N * N;
     BLAS_FUNC(copy)(&N2, X, &intone, C, &intone);
     int info = 0;
-    int * ipiv = (int*)alloca(sizeof(int)*N);
+    int* ipiv = (int*)alloca(sizeof(int) * N);
     BLAS_FUNC(getrf)(&N, &N, C, &N, ipiv, &info);
-    if(info!=0) std::cerr << "getrf_ error " << info << "\n";
+    if (info != 0) std::cerr << "getrf_ error " << info << "\n";
   }
-  
-  static inline void trisolve_lower(const gene_matrix & L, const gene_vector& B, gene_vector & X, int N){
+
+  static inline void trisolve_lower(const gene_matrix& L, const gene_vector& B, gene_vector& X, int N) {
     BLAS_FUNC(copy)(&N, B, &intone, X, &intone);
     BLAS_FUNC(trsv)(&lower, &notrans, &nonunit, &N, L, &N, X, &intone);
   }
 
-  static inline void trisolve_lower_matrix(const gene_matrix & L, const gene_matrix& B, gene_matrix & X, int N){
+  static inline void trisolve_lower_matrix(const gene_matrix& L, const gene_matrix& B, gene_matrix& X, int N) {
     BLAS_FUNC(copy)(&N, B, &intone, X, &intone);
     BLAS_FUNC(trsm)(&right, &lower, &notrans, &nonunit, &N, &N, &fone, L, &N, X, &N);
   }
 
-  static inline void trmm(gene_matrix & A, gene_matrix & B, gene_matrix & /*X*/, int N){
-    BLAS_FUNC(trmm)(&left, &lower, &notrans,&nonunit, &N,&N,&fone,A,&N,B,&N);
+  static inline void trmm(gene_matrix& A, gene_matrix& B, gene_matrix& /*X*/, int N) {
+    BLAS_FUNC(trmm)(&left, &lower, &notrans, &nonunit, &N, &N, &fone, A, &N, B, &N);
   }
 
-  #ifdef HAS_LAPACK
+#ifdef HAS_LAPACK
 
-  static inline void lu_decomp(const gene_matrix & X, gene_matrix & C, int N){
-    int N2 = N*N;
+  static inline void lu_decomp(const gene_matrix& X, gene_matrix& C, int N) {
+    int N2 = N * N;
     BLAS_FUNC(copy)(&N2, X, &intone, C, &intone);
     int info = 0;
-    int * ipiv = (int*)alloca(sizeof(int)*N);
-    int * jpiv = (int*)alloca(sizeof(int)*N);
+    int* ipiv = (int*)alloca(sizeof(int) * N);
+    int* jpiv = (int*)alloca(sizeof(int) * N);
     BLAS_FUNC(getc2)(&N, C, &N, ipiv, jpiv, &info);
   }
 
-
-
-  static inline void hessenberg(const gene_matrix & X, gene_matrix & C, int N){
+  static inline void hessenberg(const gene_matrix& X, gene_matrix& C, int N) {
     {
-      int N2 = N*N;
+      int N2 = N * N;
       int inc = 1;
       BLAS_FUNC(copy)(&N2, X, &inc, C, &inc);
     }
@@ -118,29 +111,28 @@
     int ilo = 1;
     int ihi = N;
     int bsize = 64;
-    int worksize = N*bsize;
-    SCALAR* d = new SCALAR[N+worksize];
-    BLAS_FUNC(gehrd)(&N, &ilo, &ihi, C, &N, d, d+N, &worksize, &info);
+    int worksize = N * bsize;
+    SCALAR* d = new SCALAR[N + worksize];
+    BLAS_FUNC(gehrd)(&N, &ilo, &ihi, C, &N, d, d + N, &worksize, &info);
     delete[] d;
   }
 
-  static inline void tridiagonalization(const gene_matrix & X, gene_matrix & C, int N){
+  static inline void tridiagonalization(const gene_matrix& X, gene_matrix& C, int N) {
     {
-      int N2 = N*N;
+      int N2 = N * N;
       int inc = 1;
       BLAS_FUNC(copy)(&N2, X, &inc, C, &inc);
     }
     char uplo = 'U';
     int info = 0;
     int bsize = 64;
-    int worksize = N*bsize;
-    SCALAR* d = new SCALAR[3*N+worksize];
-    BLAS_FUNC(sytrd)(&uplo, &N, C, &N, d, d+N, d+2*N, d+3*N, &worksize, &info);
+    int worksize = N * bsize;
+    SCALAR* d = new SCALAR[3 * N + worksize];
+    BLAS_FUNC(sytrd)(&uplo, &N, C, &N, d, d + N, d + 2 * N, d + 3 * N, &worksize, &info);
     delete[] d;
   }
-  
-  #endif // HAS_LAPACK
 
+#endif  // HAS_LAPACK
 };
 
 SCALAR blas_interface<SCALAR>::fone = SCALAR(1);
diff --git a/bench/btl/libs/BLAS/c_interface_base.h b/bench/btl/libs/BLAS/c_interface_base.h
index de61380..afe1d2a 100644
--- a/bench/btl/libs/BLAS/c_interface_base.h
+++ b/bench/btl/libs/BLAS/c_interface_base.h
@@ -5,69 +5,57 @@
 #include "utilities.h"
 #include <vector>
 
-template<class real> class c_interface_base
-{
-
-public:
-
-  typedef real                      real_type;
-  typedef std::vector<real>         stl_vector;
-  typedef std::vector<stl_vector >  stl_matrix;
+template <class real>
+class c_interface_base {
+ public:
+  typedef real real_type;
+  typedef std::vector<real> stl_vector;
+  typedef std::vector<stl_vector> stl_matrix;
 
   typedef real* gene_matrix;
   typedef real* gene_vector;
 
-  static void free_matrix(gene_matrix & A, int /*N*/){
-    delete[] A;
-  }
+  static void free_matrix(gene_matrix& A, int /*N*/) { delete[] A; }
 
-  static void free_vector(gene_vector & B){
-    delete[] B;
-  }
+  static void free_vector(gene_vector& B) { delete[] B; }
 
-  static inline void matrix_from_stl(gene_matrix & A, stl_matrix & A_stl){
+  static inline void matrix_from_stl(gene_matrix& A, stl_matrix& A_stl) {
     int N = A_stl.size();
-    A = new real[N*N];
-    for (int j=0;j<N;j++)
-      for (int i=0;i<N;i++)
-        A[i+N*j] = A_stl[j][i];
+    A = new real[N * N];
+    for (int j = 0; j < N; j++)
+      for (int i = 0; i < N; i++) A[i + N * j] = A_stl[j][i];
   }
 
-  static inline void vector_from_stl(gene_vector & B, stl_vector & B_stl){
+  static inline void vector_from_stl(gene_vector& B, stl_vector& B_stl) {
     int N = B_stl.size();
     B = new real[N];
-    for (int i=0;i<N;i++)
-      B[i] = B_stl[i];
+    for (int i = 0; i < N; i++) B[i] = B_stl[i];
   }
 
-  static inline void vector_to_stl(gene_vector & B, stl_vector & B_stl){
+  static inline void vector_to_stl(gene_vector& B, stl_vector& B_stl) {
     int N = B_stl.size();
-    for (int i=0;i<N;i++)
-      B_stl[i] = B[i];
+    for (int i = 0; i < N; i++) B_stl[i] = B[i];
   }
 
-  static inline void matrix_to_stl(gene_matrix & A, stl_matrix & A_stl){
+  static inline void matrix_to_stl(gene_matrix& A, stl_matrix& A_stl) {
     int N = A_stl.size();
-    for (int j=0;j<N;j++){
+    for (int j = 0; j < N; j++) {
       A_stl[j].resize(N);
-      for (int i=0;i<N;i++)
-        A_stl[j][i] = A[i+N*j];
+      for (int i = 0; i < N; i++) A_stl[j][i] = A[i + N * j];
     }
   }
 
-  static inline void copy_vector(const gene_vector & source, gene_vector & cible, int N){
-    for (int i=0;i<N;i++)
-      cible[i]=source[i];
+  static inline void copy_vector(const gene_vector& source, gene_vector& cible, int N) {
+    for (int i = 0; i < N; i++) cible[i] = source[i];
   }
 
-  static inline void copy_matrix(const gene_matrix & source, gene_matrix & cible, int N){
-    for (int j=0;j<N;j++){
-      for (int i=0;i<N;i++){
-        cible[i+N*j] = source[i+N*j];
+  static inline void copy_matrix(const gene_matrix& source, gene_matrix& cible, int N) {
+    for (int j = 0; j < N; j++) {
+      for (int i = 0; i < N; i++) {
+        cible[i + N * j] = source[i + N * j];
       }
     }
   }
-
 };
 
 #endif
diff --git a/bench/btl/libs/BLAS/main.cpp b/bench/btl/libs/BLAS/main.cpp
index fd99149..a58fd73 100644
--- a/bench/btl/libs/BLAS/main.cpp
+++ b/bench/btl/libs/BLAS/main.cpp
@@ -33,41 +33,37 @@
 
 BTL_MAIN;
 
-int main()
-{
+int main() {
+  bench<Action_axpy<blas_interface<REAL_TYPE> > >(MIN_AXPY, MAX_AXPY, NB_POINT);
+  bench<Action_axpby<blas_interface<REAL_TYPE> > >(MIN_AXPY, MAX_AXPY, NB_POINT);
 
-  bench<Action_axpy<blas_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
-  bench<Action_axpby<blas_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
+  bench<Action_matrix_vector_product<blas_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
+  bench<Action_atv_product<blas_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
+  bench<Action_symv<blas_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
+  bench<Action_syr2<blas_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
 
-  bench<Action_matrix_vector_product<blas_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
-  bench<Action_atv_product<blas_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
-  bench<Action_symv<blas_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
-  bench<Action_syr2<blas_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
+  bench<Action_ger<blas_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
+  bench<Action_rot<blas_interface<REAL_TYPE> > >(MIN_AXPY, MAX_AXPY, NB_POINT);
 
-  bench<Action_ger<blas_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
-  bench<Action_rot<blas_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
+  bench<Action_matrix_matrix_product<blas_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  bench<Action_ata_product<blas_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  bench<Action_aat_product<blas_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
 
-  bench<Action_matrix_matrix_product<blas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-  bench<Action_ata_product<blas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-  bench<Action_aat_product<blas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+  bench<Action_trisolve<blas_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  bench<Action_trisolve_matrix<blas_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
 
-  bench<Action_trisolve<blas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-  bench<Action_trisolve_matrix<blas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+  bench<Action_trmm<blas_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
 
-  bench<Action_trmm<blas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+  bench<Action_cholesky<blas_interface<REAL_TYPE> > >(MIN_LU, MAX_LU, NB_POINT);
+  bench<Action_partial_lu<blas_interface<REAL_TYPE> > >(MIN_LU, MAX_LU, NB_POINT);
 
-  bench<Action_cholesky<blas_interface<REAL_TYPE> > >(MIN_LU,MAX_LU,NB_POINT);
-  bench<Action_partial_lu<blas_interface<REAL_TYPE> > >(MIN_LU,MAX_LU,NB_POINT);
+#ifdef HAS_LAPACK
+  //   bench<Action_lu_decomp<blas_interface<REAL_TYPE> > >(MIN_LU,MAX_LU,NB_POINT);
+  bench<Action_hessenberg<blas_interface<REAL_TYPE> > >(MIN_LU, MAX_LU, NB_POINT);
+  bench<Action_tridiagonalization<blas_interface<REAL_TYPE> > >(MIN_LU, MAX_LU, NB_POINT);
+#endif
 
-  #ifdef HAS_LAPACK
-//   bench<Action_lu_decomp<blas_interface<REAL_TYPE> > >(MIN_LU,MAX_LU,NB_POINT);
-  bench<Action_hessenberg<blas_interface<REAL_TYPE> > >(MIN_LU,MAX_LU,NB_POINT);
-  bench<Action_tridiagonalization<blas_interface<REAL_TYPE> > >(MIN_LU,MAX_LU,NB_POINT);
-  #endif
-
-  //bench<Action_lu_solve<blas_LU_solve_interface<REAL_TYPE> > >(MIN_LU,MAX_LU,NB_POINT);
+  // bench<Action_lu_solve<blas_LU_solve_interface<REAL_TYPE> > >(MIN_LU,MAX_LU,NB_POINT);
 
   return 0;
 }
-
-
diff --git a/bench/btl/libs/STL/STL_interface.hh b/bench/btl/libs/STL/STL_interface.hh
index 5b391c6..4a59253 100644
--- a/bench/btl/libs/STL/STL_interface.hh
+++ b/bench/btl/libs/STL/STL_interface.hh
@@ -25,223 +25,178 @@
 
 using namespace std;
 
-template<class real>
-class STL_interface{
+template <class real>
+class STL_interface {
+ public:
+  typedef real real_type;
 
-public :
-
-  typedef real real_type ;
-
-  typedef std::vector<real>  stl_vector;
-  typedef std::vector<stl_vector > stl_matrix;
+  typedef std::vector<real> stl_vector;
+  typedef std::vector<stl_vector> stl_matrix;
 
   typedef stl_matrix gene_matrix;
 
   typedef stl_vector gene_vector;
 
-  static inline std::string name( void )
-  {
-    return "STL";
-  }
+  static inline std::string name(void) { return "STL"; }
 
-  static void free_matrix(gene_matrix & /*A*/, int /*N*/){}
+  static void free_matrix(gene_matrix& /*A*/, int /*N*/) {}
 
-  static void free_vector(gene_vector & /*B*/){}
+  static void free_vector(gene_vector& /*B*/) {}
 
-  static inline void matrix_from_stl(gene_matrix & A, stl_matrix & A_stl){
-    A = A_stl;
-  }
+  static inline void matrix_from_stl(gene_matrix& A, stl_matrix& A_stl) { A = A_stl; }
 
-  static inline void vector_from_stl(gene_vector & B, stl_vector & B_stl){
-    B = B_stl;
-  }
+  static inline void vector_from_stl(gene_vector& B, stl_vector& B_stl) { B = B_stl; }
 
-  static inline void vector_to_stl(gene_vector & B, stl_vector & B_stl){
-    B_stl = B ;
-  }
+  static inline void vector_to_stl(gene_vector& B, stl_vector& B_stl) { B_stl = B; }
 
+  static inline void matrix_to_stl(gene_matrix& A, stl_matrix& A_stl) { A_stl = A; }
 
-  static inline void matrix_to_stl(gene_matrix & A, stl_matrix & A_stl){
-    A_stl = A ;
-  }
-
-  static inline void copy_vector(const gene_vector & source, gene_vector & cible, int N){
-    for (int i=0;i<N;i++){
-      cible[i]=source[i];
+  static inline void copy_vector(const gene_vector& source, gene_vector& cible, int N) {
+    for (int i = 0; i < N; i++) {
+      cible[i] = source[i];
     }
   }
 
-
-  static inline void copy_matrix(const gene_matrix & source, gene_matrix & cible, int N){
-    for (int i=0;i<N;i++)
-      for (int j=0;j<N;j++)
-        cible[i][j]=source[i][j];
+  static inline void copy_matrix(const gene_matrix& source, gene_matrix& cible, int N) {
+    for (int i = 0; i < N; i++)
+      for (int j = 0; j < N; j++) cible[i][j] = source[i][j];
   }
 
-  static inline void ata_product(const gene_matrix & A, gene_matrix & X, int N)
-  {
+  static inline void ata_product(const gene_matrix& A, gene_matrix& X, int N) {
     real somme;
-    for (int j=0;j<N;j++){
-      for (int i=0;i<N;i++){
-        somme=0.0;
-        if(i>=j)
-        {
-        for (int k=0;k<N;k++)
-          somme += A[i][k]*A[j][k];
-        X[j][i]=somme;
-	}
-      }
-    }
-  }
-
-  static inline void aat_product(const gene_matrix & A, gene_matrix & X, int N)
-  {
-    real somme;
-    for (int j=0;j<N;j++){
-      for (int i=0;i<N;i++){
-        somme=0.0;
-        if(i>=j)
-        {
-          for (int k=0;k<N;k++){
-            somme+=A[k][i]*A[k][j];
-          }
-          X[j][i]=somme;
+    for (int j = 0; j < N; j++) {
+      for (int i = 0; i < N; i++) {
+        somme = 0.0;
+        if (i >= j) {
+          for (int k = 0; k < N; k++) somme += A[i][k] * A[j][k];
+          X[j][i] = somme;
         }
       }
     }
   }
 
-
-  static inline void matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int N)
-  {
+  static inline void aat_product(const gene_matrix& A, gene_matrix& X, int N) {
     real somme;
-    for (int j=0;j<N;j++){
-      for (int i=0;i<N;i++){
-        somme=0.0;
-        for (int k=0;k<N;k++)
-          somme+=A[k][i]*B[j][k];
-        X[j][i]=somme;
+    for (int j = 0; j < N; j++) {
+      for (int i = 0; i < N; i++) {
+        somme = 0.0;
+        if (i >= j) {
+          for (int k = 0; k < N; k++) {
+            somme += A[k][i] * A[k][j];
+          }
+          X[j][i] = somme;
+        }
       }
     }
   }
 
-  static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N)
-  {
+  static inline void matrix_matrix_product(const gene_matrix& A, const gene_matrix& B, gene_matrix& X, int N) {
     real somme;
-    for (int i=0;i<N;i++){
-      somme=0.0;
-      for (int j=0;j<N;j++)
-        somme+=A[j][i]*B[j];
-      X[i]=somme;
+    for (int j = 0; j < N; j++) {
+      for (int i = 0; i < N; i++) {
+        somme = 0.0;
+        for (int k = 0; k < N; k++) somme += A[k][i] * B[j][k];
+        X[j][i] = somme;
+      }
     }
   }
 
-  static inline void symv(gene_matrix & A, gene_vector & B, gene_vector & X, int N)
-  {
-    for (int j=0; j<N; ++j)
-      X[j] = 0;
-    for (int j=0; j<N; ++j)
-    {
+  static inline void matrix_vector_product(gene_matrix& A, gene_vector& B, gene_vector& X, int N) {
+    real somme;
+    for (int i = 0; i < N; i++) {
+      somme = 0.0;
+      for (int j = 0; j < N; j++) somme += A[j][i] * B[j];
+      X[i] = somme;
+    }
+  }
+
+  static inline void symv(gene_matrix& A, gene_vector& B, gene_vector& X, int N) {
+    for (int j = 0; j < N; ++j) X[j] = 0;
+    for (int j = 0; j < N; ++j) {
       real t1 = B[j];
       real t2 = 0;
       X[j] += t1 * A[j][j];
-      for (int i=j+1; i<N; ++i) {
+      for (int i = j + 1; i < N; ++i) {
         X[i] += t1 * A[j][i];
         t2 += A[j][i] * B[i];
       }
       X[j] += t2;
     }
   }
-  
-  static inline void syr2(gene_matrix & A, gene_vector & B, gene_vector & X, int N)
-  {
-    for (int j=0; j<N; ++j)
-    {
-      for (int i=j; i<N; ++i)
-        A[j][i] += B[i]*X[j] + B[j]*X[i];
+
+  static inline void syr2(gene_matrix& A, gene_vector& B, gene_vector& X, int N) {
+    for (int j = 0; j < N; ++j) {
+      for (int i = j; i < N; ++i) A[j][i] += B[i] * X[j] + B[j] * X[i];
     }
   }
 
-  static inline void ger(gene_matrix & A, gene_vector & X, gene_vector & Y, int N)
-  {
-    for (int j=0; j<N; ++j)
-    {
-      for (int i=j; i<N; ++i)
-        A[j][i] += X[i]*Y[j];
+  static inline void ger(gene_matrix& A, gene_vector& X, gene_vector& Y, int N) {
+    for (int j = 0; j < N; ++j) {
+      for (int i = j; i < N; ++i) A[j][i] += X[i] * Y[j];
     }
   }
 
-  static inline void atv_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N)
-  {
+  static inline void atv_product(gene_matrix& A, gene_vector& B, gene_vector& X, int N) {
     real somme;
-    for (int i=0;i<N;i++){
+    for (int i = 0; i < N; i++) {
       somme = 0.0;
-      for (int j=0;j<N;j++)
-        somme += A[i][j]*B[j];
+      for (int j = 0; j < N; j++) somme += A[i][j] * B[j];
       X[i] = somme;
     }
   }
 
-  static inline void axpy(real coef, const gene_vector & X, gene_vector & Y, int N){
-    for (int i=0;i<N;i++)
-      Y[i]+=coef*X[i];
+  static inline void axpy(real coef, const gene_vector& X, gene_vector& Y, int N) {
+    for (int i = 0; i < N; i++) Y[i] += coef * X[i];
   }
 
-  static inline void axpby(real a, const gene_vector & X, real b, gene_vector & Y, int N){
-    for (int i=0;i<N;i++)
-      Y[i] = a*X[i] + b*Y[i];
+  static inline void axpby(real a, const gene_vector& X, real b, gene_vector& Y, int N) {
+    for (int i = 0; i < N; i++) Y[i] = a * X[i] + b * Y[i];
   }
 
-  static inline void trisolve_lower(const gene_matrix & L, const gene_vector & B, gene_vector & X, int N){
-    copy_vector(B,X,N);
-    for(int i=0; i<N; ++i)
-    {
+  static inline void trisolve_lower(const gene_matrix& L, const gene_vector& B, gene_vector& X, int N) {
+    copy_vector(B, X, N);
+    for (int i = 0; i < N; ++i) {
       X[i] /= L[i][i];
       real tmp = X[i];
-      for (int j=i+1; j<N; ++j)
-        X[j] -= tmp * L[i][j];
+      for (int j = i + 1; j < N; ++j) X[j] -= tmp * L[i][j];
     }
   }
 
-  static inline real norm_diff(const stl_vector & A, const stl_vector & B)
-  {
-    int N=A.size();
-    real somme=0.0;
-    real somme2=0.0;
+  static inline real norm_diff(const stl_vector& A, const stl_vector& B) {
+    int N = A.size();
+    real somme = 0.0;
+    real somme2 = 0.0;
 
-    for (int i=0;i<N;i++){
-      real diff=A[i]-B[i];
-      somme+=diff*diff;
-      somme2+=A[i]*A[i];
+    for (int i = 0; i < N; i++) {
+      real diff = A[i] - B[i];
+      somme += diff * diff;
+      somme2 += A[i] * A[i];
     }
-    return somme/somme2;
+    return somme / somme2;
   }
 
-  static inline real norm_diff(const stl_matrix & A, const stl_matrix & B)
-  {
-    int N=A[0].size();
-    real somme=0.0;
-    real somme2=0.0;
+  static inline real norm_diff(const stl_matrix& A, const stl_matrix& B) {
+    int N = A[0].size();
+    real somme = 0.0;
+    real somme2 = 0.0;
 
-    for (int i=0;i<N;i++){
-      for (int j=0;j<N;j++){
-        real diff=A[i][j] - B[i][j];
-        somme += diff*diff;
-        somme2 += A[i][j]*A[i][j];
+    for (int i = 0; i < N; i++) {
+      for (int j = 0; j < N; j++) {
+        real diff = A[i][j] - B[i][j];
+        somme += diff * diff;
+        somme2 += A[i][j] * A[i][j];
       }
     }
 
-    return somme/somme2;
+    return somme / somme2;
   }
 
-  static inline void display_vector(const stl_vector & A)
-  {
-    int N=A.size();
-    for (int i=0;i<N;i++){
-      INFOS("A["<<i<<"]="<<A[i]<<endl);
+  static inline void display_vector(const stl_vector& A) {
+    int N = A.size();
+    for (int i = 0; i < N; i++) {
+      INFOS("A[" << i << "]=" << A[i] << endl);
     }
   }
-
 };
 
 #endif
diff --git a/bench/btl/libs/STL/main.cpp b/bench/btl/libs/STL/main.cpp
index 4e73328..772f484 100644
--- a/bench/btl/libs/STL/main.cpp
+++ b/bench/btl/libs/STL/main.cpp
@@ -24,19 +24,16 @@
 
 BTL_MAIN;
 
-int main()
-{
-  bench<Action_axpy<STL_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
-  bench<Action_axpby<STL_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
-  bench<Action_matrix_vector_product<STL_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
-  bench<Action_atv_product<STL_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
-  bench<Action_symv<STL_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
-  bench<Action_syr2<STL_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
-  bench<Action_matrix_matrix_product<STL_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-  bench<Action_ata_product<STL_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-  bench<Action_aat_product<STL_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+int main() {
+  bench<Action_axpy<STL_interface<REAL_TYPE> > >(MIN_AXPY, MAX_AXPY, NB_POINT);
+  bench<Action_axpby<STL_interface<REAL_TYPE> > >(MIN_AXPY, MAX_AXPY, NB_POINT);
+  bench<Action_matrix_vector_product<STL_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
+  bench<Action_atv_product<STL_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
+  bench<Action_symv<STL_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
+  bench<Action_syr2<STL_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
+  bench<Action_matrix_matrix_product<STL_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  bench<Action_ata_product<STL_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  bench<Action_aat_product<STL_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
 
   return 0;
 }
-
-
diff --git a/bench/btl/libs/blaze/blaze_interface.hh b/bench/btl/libs/blaze/blaze_interface.hh
index 7b418f6..cd0f30a 100644
--- a/bench/btl/libs/blaze/blaze_interface.hh
+++ b/bench/btl/libs/blaze/blaze_interface.hh
@@ -25,117 +25,102 @@
 
 #include <vector>
 
-template<class real>
+template <class real>
 class blaze_interface {
+ public:
+  typedef real real_type;
 
-public :
+  typedef std::vector<real> stl_vector;
+  typedef std::vector<stl_vector> stl_matrix;
 
-  typedef real real_type ;
-
-  typedef std::vector<real>        stl_vector;
-  typedef std::vector<stl_vector > stl_matrix;
-
-  typedef blaze::DynamicMatrix<real,blaze::columnMajor>  gene_matrix;
-  typedef blaze::DynamicVector<real>  gene_vector;
+  typedef blaze::DynamicMatrix<real, blaze::columnMajor> gene_matrix;
+  typedef blaze::DynamicVector<real> gene_vector;
 
   static inline std::string name() { return "blaze"; }
 
-  static void free_matrix(gene_matrix & A, int N){
-    return ;
-  }
+  static void free_matrix(gene_matrix& A, int N) { return; }
 
-  static void free_vector(gene_vector & B){
-    return ;
-  }
+  static void free_vector(gene_vector& B) { return; }
 
-  static inline void matrix_from_stl(gene_matrix & A, stl_matrix & A_stl){
+  static inline void matrix_from_stl(gene_matrix& A, stl_matrix& A_stl) {
     A.resize(A_stl[0].size(), A_stl.size());
 
-    for (int j=0; j<A_stl.size() ; j++){
-      for (int i=0; i<A_stl[j].size() ; i++){
-        A(i,j) = A_stl[j][i];
+    for (int j = 0; j < A_stl.size(); j++) {
+      for (int i = 0; i < A_stl[j].size(); i++) {
+        A(i, j) = A_stl[j][i];
       }
     }
   }
 
-  static inline void vector_from_stl(gene_vector & B, stl_vector & B_stl){
+  static inline void vector_from_stl(gene_vector& B, stl_vector& B_stl) {
     B.resize(B_stl.size());
-    for (int i=0; i<B_stl.size() ; i++){
+    for (int i = 0; i < B_stl.size(); i++) {
       B[i] = B_stl[i];
     }
   }
 
-  static inline void vector_to_stl(gene_vector & B, stl_vector & B_stl){
-    for (int i=0; i<B_stl.size() ; i++){
+  static inline void vector_to_stl(gene_vector& B, stl_vector& B_stl) {
+    for (int i = 0; i < B_stl.size(); i++) {
       B_stl[i] = B[i];
     }
   }
 
-  static inline void matrix_to_stl(gene_matrix & A, stl_matrix & A_stl){
-    int N=A_stl.size();
-    for (int j=0;j<N;j++){
+  static inline void matrix_to_stl(gene_matrix& A, stl_matrix& A_stl) {
+    int N = A_stl.size();
+    for (int j = 0; j < N; j++) {
       A_stl[j].resize(N);
-      for (int i=0;i<N;i++){
-        A_stl[j][i] = A(i,j);
+      for (int i = 0; i < N; i++) {
+        A_stl[j][i] = A(i, j);
       }
     }
   }
 
-  static EIGEN_DONT_INLINE void matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int N){
-    X = (A*B);
+  static EIGEN_DONT_INLINE void matrix_matrix_product(const gene_matrix& A, const gene_matrix& B, gene_matrix& X,
+                                                      int N) {
+    X = (A * B);
   }
 
-  static EIGEN_DONT_INLINE void transposed_matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int N){
-    X = (trans(A)*trans(B));
+  static EIGEN_DONT_INLINE void transposed_matrix_matrix_product(const gene_matrix& A, const gene_matrix& B,
+                                                                 gene_matrix& X, int N) {
+    X = (trans(A) * trans(B));
   }
 
-  static EIGEN_DONT_INLINE void ata_product(const gene_matrix & A, gene_matrix & X, int N){
-    X = (trans(A)*A);
+  static EIGEN_DONT_INLINE void ata_product(const gene_matrix& A, gene_matrix& X, int N) { X = (trans(A) * A); }
+
+  static EIGEN_DONT_INLINE void aat_product(const gene_matrix& A, gene_matrix& X, int N) { X = (A * trans(A)); }
+
+  static EIGEN_DONT_INLINE void matrix_vector_product(gene_matrix& A, gene_vector& B, gene_vector& X, int N) {
+    X = (A * B);
   }
 
-  static EIGEN_DONT_INLINE void aat_product(const gene_matrix & A, gene_matrix & X, int N){
-    X = (A*trans(A));
+  static EIGEN_DONT_INLINE void atv_product(gene_matrix& A, gene_vector& B, gene_vector& X, int N) {
+    X = (trans(A) * B);
   }
 
-  static EIGEN_DONT_INLINE void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){
-    X = (A*B);
+  static EIGEN_DONT_INLINE void axpy(const real coef, const gene_vector& X, gene_vector& Y, int N) { Y += coef * X; }
+
+  static EIGEN_DONT_INLINE void axpby(real a, const gene_vector& X, real b, gene_vector& Y, int N) {
+    Y = a * X + b * Y;
   }
 
-  static EIGEN_DONT_INLINE void atv_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){
-    X = (trans(A)*B);
-  }
+  //   static inline void cholesky(const gene_matrix & X, gene_matrix & C, int N){
+  //     C = X;
+  //     recursive_cholesky(C);
+  //   }
 
-  static EIGEN_DONT_INLINE void axpy(const real coef, const gene_vector & X, gene_vector & Y, int N){
-    Y += coef * X;
-  }
+  //   static inline void lu_decomp(const gene_matrix & X, gene_matrix & R, int N){
+  //     R = X;
+  //     std::vector<int> ipvt(N);
+  //     lu_factor(R, ipvt);
+  //   }
 
-  static EIGEN_DONT_INLINE void axpby(real a, const gene_vector & X, real b, gene_vector & Y, int N){
-    Y = a*X + b*Y;
-  }
+  //   static inline void trisolve_lower(const gene_matrix & L, const gene_vector& B, gene_vector & X, int N){
+  //     X = lower_trisolve(L, B);
+  //   }
 
-//   static inline void cholesky(const gene_matrix & X, gene_matrix & C, int N){
-//     C = X;
-//     recursive_cholesky(C);
-//   }
+  static inline void copy_matrix(const gene_matrix& source, gene_matrix& cible, int N) { cible = source; }
 
-//   static inline void lu_decomp(const gene_matrix & X, gene_matrix & R, int N){
-//     R = X;
-//     std::vector<int> ipvt(N);
-//     lu_factor(R, ipvt);
-//   }
-
-//   static inline void trisolve_lower(const gene_matrix & L, const gene_vector& B, gene_vector & X, int N){
-//     X = lower_trisolve(L, B);
-//   }
-
-  static inline void copy_matrix(const gene_matrix & source, gene_matrix & cible, int N){
-    cible = source;
-  }
-
-  static inline void copy_vector(const gene_vector & source, gene_vector & cible, int N){
-    cible = source;
-  }
-
+  static inline void copy_vector(const gene_vector& source, gene_vector& cible, int N) { cible = source; }
 };
 
 #endif
diff --git a/bench/btl/libs/blaze/main.cpp b/bench/btl/libs/blaze/main.cpp
index ccae0cb..7d9e784 100644
--- a/bench/btl/libs/blaze/main.cpp
+++ b/bench/btl/libs/blaze/main.cpp
@@ -22,19 +22,15 @@
 
 BTL_MAIN;
 
-int main()
-{
+int main() {
+  bench<Action_axpy<blaze_interface<REAL_TYPE> > >(MIN_AXPY, MAX_AXPY, NB_POINT);
+  bench<Action_axpby<blaze_interface<REAL_TYPE> > >(MIN_AXPY, MAX_AXPY, NB_POINT);
 
-  bench<Action_axpy<blaze_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
-  bench<Action_axpby<blaze_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
-
-  bench<Action_matrix_vector_product<blaze_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
-  bench<Action_atv_product<blaze_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
-  bench<Action_matrix_matrix_product<blaze_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-  bench<Action_ata_product<blaze_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-  bench<Action_aat_product<blaze_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+  bench<Action_matrix_vector_product<blaze_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
+  bench<Action_atv_product<blaze_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
+  bench<Action_matrix_matrix_product<blaze_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  bench<Action_ata_product<blaze_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  bench<Action_aat_product<blaze_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
 
   return 0;
 }
-
-
diff --git a/bench/btl/libs/blitz/blitz_LU_solve_interface.hh b/bench/btl/libs/blitz/blitz_LU_solve_interface.hh
index dcb9f56..955c816 100644
--- a/bench/btl/libs/blitz/blitz_LU_solve_interface.hh
+++ b/bench/btl/libs/blitz/blitz_LU_solve_interface.hh
@@ -1,14 +1,14 @@
 //=====================================================
 // File   :  blitz_LU_solve_interface.hh
-// Author :  L. Plagne <laurent.plagne@edf.fr)>        
+// Author :  L. Plagne <laurent.plagne@edf.fr)>
 // Copyright (C) EDF R&D,  lun sep 30 14:23:31 CEST 2002
 //=====================================================
-// 
+//
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
 // as published by the Free Software Foundation; either version 2
 // of the License, or (at your option) any later version.
-// 
+//
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -16,7 +16,7 @@
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-// 
+//
 #ifndef BLITZ_LU_SOLVE_INTERFACE_HH
 #define BLITZ_LU_SOLVE_INTERFACE_HH
 
@@ -25,168 +25,136 @@
 
 BZ_USING_NAMESPACE(blitz)
 
-template<class real>
-class blitz_LU_solve_interface : public blitz_interface<real>
-{
-
-public :
-
+template <class real>
+class blitz_LU_solve_interface : public blitz_interface<real> {
+ public:
   typedef typename blitz_interface<real>::gene_matrix gene_matrix;
   typedef typename blitz_interface<real>::gene_vector gene_vector;
 
-  typedef blitz::Array<int,1> Pivot_Vector;
+  typedef blitz::Array<int, 1> Pivot_Vector;
 
-  inline static void new_Pivot_Vector(Pivot_Vector & pivot,int N)
-  {
+  inline static void new_Pivot_Vector(Pivot_Vector &pivot, int N) { pivot.resize(N); }
 
-    pivot.resize(N);
+  inline static void free_Pivot_Vector(Pivot_Vector &pivot) { return; }
 
-  }
+  static inline real matrix_vector_product_sliced(const gene_matrix &A, gene_vector B, int row, int col_start,
+                                                  int col_end) {
+    real somme = 0.;
 
-  inline static void free_Pivot_Vector(Pivot_Vector & pivot)
-  {
-    
-    return;
-
-  }
-
-
-  static inline real matrix_vector_product_sliced(const gene_matrix & A, gene_vector B, int row, int col_start, int col_end)
-  {
-    
-    real somme=0.;
-    
-    for (int j=col_start ; j<col_end+1 ; j++){
-	
-	somme+=A(row,j)*B(j);
-	
+    for (int j = col_start; j < col_end + 1; j++) {
+      somme += A(row, j) * B(j);
     }
 
     return somme;
-
   }
 
+  static inline real matrix_matrix_product_sliced(gene_matrix &A, int row, int col_start, int col_end, gene_matrix &B,
+                                                  int row_shift, int col) {
+    real somme = 0.;
 
-
-
-  static inline real matrix_matrix_product_sliced(gene_matrix & A, int row, int col_start, int col_end, gene_matrix & B, int row_shift, int col )
-  {
-    
-    real somme=0.;
-    
-    for (int j=col_start ; j<col_end+1 ; j++){
-	
-	somme+=A(row,j)*B(j+row_shift,col);
-	
+    for (int j = col_start; j < col_end + 1; j++) {
+      somme += A(row, j) * B(j + row_shift, col);
     }
 
     return somme;
-
   }
 
-  inline static void LU_factor(gene_matrix & LU, Pivot_Vector & pivot, int N)
-  {
-
-    ASSERT( LU.rows()==LU.cols() ) ;
-    int index_max = 0 ;
-    real big = 0. ;
-    real theSum = 0. ;
-    real dum = 0. ;
+  inline static void LU_factor(gene_matrix &LU, Pivot_Vector &pivot, int N) {
+    ASSERT(LU.rows() == LU.cols());
+    int index_max = 0;
+    real big = 0.;
+    real theSum = 0.;
+    real dum = 0.;
     // Get the implicit scaling information :
-    gene_vector ImplicitScaling( N ) ;
-    for( int i=0; i<N; i++ ) {
-      big = 0. ;
-      for( int j=0; j<N; j++ ) {
-	if( abs( LU( i, j ) )>=big ) big = abs( LU( i, j ) ) ;
+    gene_vector ImplicitScaling(N);
+    for (int i = 0; i < N; i++) {
+      big = 0.;
+      for (int j = 0; j < N; j++) {
+        if (abs(LU(i, j)) >= big) big = abs(LU(i, j));
       }
-      if( big==0. ) {
-	INFOS( "blitz_LU_factor::Singular matrix" ) ;
-	exit( 0 ) ;
+      if (big == 0.) {
+        INFOS("blitz_LU_factor::Singular matrix");
+        exit(0);
       }
-      ImplicitScaling( i ) = 1./big ;
+      ImplicitScaling(i) = 1. / big;
     }
     // Loop over columns of Crout's method :
-    for( int j=0; j<N; j++ ) {
-      for( int i=0; i<j; i++ ) {
-	theSum = LU( i, j ) ;
-	theSum -= matrix_matrix_product_sliced(LU, i, 0, i-1, LU, 0, j) ;
-	//	theSum -= sum( LU( i, Range( fromStart, i-1 ) )*LU( Range( fromStart, i-1 ), j ) ) ;
-	LU( i, j ) = theSum ;
+    for (int j = 0; j < N; j++) {
+      for (int i = 0; i < j; i++) {
+        theSum = LU(i, j);
+        theSum -= matrix_matrix_product_sliced(LU, i, 0, i - 1, LU, 0, j);
+        //	theSum -= sum( LU( i, Range( fromStart, i-1 ) )*LU( Range( fromStart, i-1 ), j ) ) ;
+        LU(i, j) = theSum;
       }
-      
+
       // Search for the largest pivot element :
-      big = 0. ;
-      for( int i=j; i<N; i++ ) {
-	theSum = LU( i, j ) ;
-	theSum -= matrix_matrix_product_sliced(LU, i, 0, j-1, LU, 0, j) ;
-	//	theSum -= sum( LU( i, Range( fromStart, j-1 ) )*LU( Range( fromStart, j-1 ), j ) ) ;
-	LU( i, j ) = theSum ;
-	if( (ImplicitScaling( i )*abs( theSum ))>=big ) {
-	  dum = ImplicitScaling( i )*abs( theSum ) ;
-	  big = dum ;
-	  index_max = i ;
-	}
+      big = 0.;
+      for (int i = j; i < N; i++) {
+        theSum = LU(i, j);
+        theSum -= matrix_matrix_product_sliced(LU, i, 0, j - 1, LU, 0, j);
+        //	theSum -= sum( LU( i, Range( fromStart, j-1 ) )*LU( Range( fromStart, j-1 ), j ) ) ;
+        LU(i, j) = theSum;
+        if ((ImplicitScaling(i) * abs(theSum)) >= big) {
+          dum = ImplicitScaling(i) * abs(theSum);
+          big = dum;
+          index_max = i;
+        }
       }
       // Interchanging rows and the scale factor :
-      if( j!=index_max ) {
-	for( int k=0; k<N; k++ ) {
-	  dum = LU( index_max, k ) ;
-	  LU( index_max, k ) = LU( j, k ) ;
-	  LU( j, k ) = dum ;
-	}
-	ImplicitScaling( index_max ) = ImplicitScaling( j ) ;
+      if (j != index_max) {
+        for (int k = 0; k < N; k++) {
+          dum = LU(index_max, k);
+          LU(index_max, k) = LU(j, k);
+          LU(j, k) = dum;
+        }
+        ImplicitScaling(index_max) = ImplicitScaling(j);
       }
-      pivot( j ) = index_max ;
-      if ( LU( j, j )==0. ) LU( j, j ) = 1.e-20 ;
+      pivot(j) = index_max;
+      if (LU(j, j) == 0.) LU(j, j) = 1.e-20;
       // Divide by the pivot element :
-      if( j<N ) {
-	dum = 1./LU( j, j ) ;
-	for( int i=j+1; i<N; i++ ) LU( i, j ) *= dum ;
+      if (j < N) {
+        dum = 1. / LU(j, j);
+        for (int i = j + 1; i < N; i++) LU(i, j) *= dum;
       }
     }
-
   }
 
-  inline static void LU_solve(const gene_matrix & LU, const Pivot_Vector pivot, gene_vector &B, gene_vector X, int N)
-  {
-
+  inline static void LU_solve(const gene_matrix &LU, const Pivot_Vector pivot, gene_vector &B, gene_vector X, int N) {
     // Pour conserver le meme header, on travaille sur X, copie du second-membre B
-    X = B.copy() ;
-    ASSERT( LU.rows()==LU.cols() ) ;
-    firstIndex indI ;
+    X = B.copy();
+    ASSERT(LU.rows() == LU.cols());
+    firstIndex indI;
     // Forward substitution :
-    int ii = 0 ;
-    real theSum = 0. ;
-    for( int i=0; i<N; i++ ) {
-      int ip = pivot( i ) ;
-      theSum = X( ip ) ;
+    int ii = 0;
+    real theSum = 0.;
+    for (int i = 0; i < N; i++) {
+      int ip = pivot(i);
+      theSum = X(ip);
       //      theSum = B( ip ) ;
-      X( ip ) = X( i ) ;
+      X(ip) = X(i);
       //      B( ip ) = B( i ) ;
-      if( ii ) {
-	theSum -= matrix_vector_product_sliced(LU, X, i, ii-1, i-1) ;
-	//	theSum -= sum( LU( i, Range( ii-1, i-1 ) )*X( Range( ii-1, i-1 ) ) ) ;
-	//	theSum -= sum( LU( i, Range( ii-1, i-1 ) )*B( Range( ii-1, i-1 ) ) ) ;
-      } else if( theSum ) {
-	ii = i+1 ;
+      if (ii) {
+        theSum -= matrix_vector_product_sliced(LU, X, i, ii - 1, i - 1);
+        //	theSum -= sum( LU( i, Range( ii-1, i-1 ) )*X( Range( ii-1, i-1 ) ) ) ;
+        //	theSum -= sum( LU( i, Range( ii-1, i-1 ) )*B( Range( ii-1, i-1 ) ) ) ;
+      } else if (theSum) {
+        ii = i + 1;
       }
-      X( i ) = theSum ;
+      X(i) = theSum;
       //      B( i ) = theSum ;
     }
     // Backsubstitution :
-    for( int i=N-1; i>=0; i-- ) {
-      theSum = X( i ) ;
+    for (int i = N - 1; i >= 0; i--) {
+      theSum = X(i);
       //      theSum = B( i ) ;
-      theSum -= matrix_vector_product_sliced(LU, X, i, i+1, N) ;
+      theSum -= matrix_vector_product_sliced(LU, X, i, i + 1, N);
       //      theSum -= sum( LU( i, Range( i+1, toEnd ) )*X( Range( i+1, toEnd ) ) ) ;
       //      theSum -= sum( LU( i, Range( i+1, toEnd ) )*B( Range( i+1, toEnd ) ) ) ;
       // Store a component of the solution vector :
-      X( i ) = theSum/LU( i, i ) ;
+      X(i) = theSum / LU(i, i);
       //      B( i ) = theSum/LU( i, i ) ;
     }
-
   }
-
 };
 
 #endif
diff --git a/bench/btl/libs/blitz/blitz_interface.hh b/bench/btl/libs/blitz/blitz_interface.hh
index a67c47c..b0750c0 100644
--- a/bench/btl/libs/blitz/blitz_interface.hh
+++ b/bench/btl/libs/blitz/blitz_interface.hh
@@ -30,118 +30,108 @@
 
 BZ_USING_NAMESPACE(blitz)
 
-template<class real>
-class blitz_interface{
+template <class real>
+class blitz_interface {
+ public:
+  typedef real real_type;
 
-public :
+  typedef std::vector<real> stl_vector;
+  typedef std::vector<stl_vector> stl_matrix;
 
-  typedef real real_type ;
-
-  typedef std::vector<real>  stl_vector;
-  typedef std::vector<stl_vector > stl_matrix;
-
-  typedef blitz::Array<real, 2>  gene_matrix;
-  typedef blitz::Array<real, 1>  gene_vector;
-//   typedef blitz::Matrix<real, blitz::ColumnMajor>  gene_matrix;
-//   typedef blitz::Vector<real> gene_vector;
+  typedef blitz::Array<real, 2> gene_matrix;
+  typedef blitz::Array<real, 1> gene_vector;
+  //   typedef blitz::Matrix<real, blitz::ColumnMajor>  gene_matrix;
+  //   typedef blitz::Vector<real> gene_vector;
 
   static inline std::string name() { return "blitz"; }
 
-  static void free_matrix(gene_matrix & A, int N){}
+  static void free_matrix(gene_matrix& A, int N) {}
 
-  static void free_vector(gene_vector & B){}
+  static void free_vector(gene_vector& B) {}
 
-  static inline void matrix_from_stl(gene_matrix & A, stl_matrix & A_stl){
-    A.resize(A_stl[0].size(),A_stl.size());
-    for (int j=0; j<A_stl.size() ; j++){
-      for (int i=0; i<A_stl[j].size() ; i++){
-        A(i,j)=A_stl[j][i];
+  static inline void matrix_from_stl(gene_matrix& A, stl_matrix& A_stl) {
+    A.resize(A_stl[0].size(), A_stl.size());
+    for (int j = 0; j < A_stl.size(); j++) {
+      for (int i = 0; i < A_stl[j].size(); i++) {
+        A(i, j) = A_stl[j][i];
       }
     }
   }
 
-  static inline void vector_from_stl(gene_vector & B, stl_vector & B_stl){
+  static inline void vector_from_stl(gene_vector& B, stl_vector& B_stl) {
     B.resize(B_stl.size());
-    for (int i=0; i<B_stl.size() ; i++){
-      B(i)=B_stl[i];
+    for (int i = 0; i < B_stl.size(); i++) {
+      B(i) = B_stl[i];
     }
   }
 
-  static inline void vector_to_stl(gene_vector & B, stl_vector & B_stl){
-    for (int i=0; i<B_stl.size() ; i++){
-      B_stl[i]=B(i);
+  static inline void vector_to_stl(gene_vector& B, stl_vector& B_stl) {
+    for (int i = 0; i < B_stl.size(); i++) {
+      B_stl[i] = B(i);
     }
   }
 
-  static inline void matrix_to_stl(gene_matrix & A, stl_matrix & A_stl){
-    int N=A_stl.size();
-    for (int j=0;j<N;j++){
+  static inline void matrix_to_stl(gene_matrix& A, stl_matrix& A_stl) {
+    int N = A_stl.size();
+    for (int j = 0; j < N; j++) {
       A_stl[j].resize(N);
-      for (int i=0;i<N;i++)
-        A_stl[j][i] = A(i,j);
+      for (int i = 0; i < N; i++) A_stl[j][i] = A(i, j);
     }
   }
 
-  static inline void matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int N)
-  {
+  static inline void matrix_matrix_product(const gene_matrix& A, const gene_matrix& B, gene_matrix& X, int N) {
     firstIndex i;
     secondIndex j;
     thirdIndex k;
-    X = sum(A(i,k) * B(k,j), k);
+    X = sum(A(i, k) * B(k, j), k);
   }
 
-  static inline void ata_product(const gene_matrix & A, gene_matrix & X, int N)
-  {
+  static inline void ata_product(const gene_matrix& A, gene_matrix& X, int N) {
     firstIndex i;
     secondIndex j;
     thirdIndex k;
-    X = sum(A(k,i) * A(k,j), k);
+    X = sum(A(k, i) * A(k, j), k);
   }
 
-  static inline void aat_product(const gene_matrix & A, gene_matrix & X, int N)
-  {
+  static inline void aat_product(const gene_matrix& A, gene_matrix& X, int N) {
     firstIndex i;
     secondIndex j;
     thirdIndex k;
-    X = sum(A(i,k) * A(j,k), k);
+    X = sum(A(i, k) * A(j, k), k);
   }
 
-  static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N)
-  {
+  static inline void matrix_vector_product(gene_matrix& A, gene_vector& B, gene_vector& X, int N) {
     firstIndex i;
     secondIndex j;
-    X = sum(A(i,j)*B(j),j);
+    X = sum(A(i, j) * B(j), j);
   }
 
-  static inline void atv_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N)
-  {
+  static inline void atv_product(gene_matrix& A, gene_vector& B, gene_vector& X, int N) {
     firstIndex i;
     secondIndex j;
-    X = sum(A(j,i) * B(j),j);
+    X = sum(A(j, i) * B(j), j);
   }
 
-  static inline void axpy(const real coef, const gene_vector & X, gene_vector & Y, int N)
-  {
+  static inline void axpy(const real coef, const gene_vector& X, gene_vector& Y, int N) {
     firstIndex i;
     Y = Y(i) + coef * X(i);
-    //Y += coef * X;
+    // Y += coef * X;
   }
 
-  static inline void copy_matrix(const gene_matrix & source, gene_matrix & cible, int N){
+  static inline void copy_matrix(const gene_matrix& source, gene_matrix& cible, int N) {
     cible = source;
-    //cible.template operator=<gene_matrix>(source);
-//     for (int i=0;i<N;i++){
-//       for (int j=0;j<N;j++){
-//         cible(i,j)=source(i,j);
-//       }
-//     }
+    // cible.template operator=<gene_matrix>(source);
+    //     for (int i=0;i<N;i++){
+    //       for (int j=0;j<N;j++){
+    //         cible(i,j)=source(i,j);
+    //       }
+    //     }
   }
 
-  static inline void copy_vector(const gene_vector & source, gene_vector & cible, int N){
-    //cible.template operator=<gene_vector>(source);
+  static inline void copy_vector(const gene_vector& source, gene_vector& cible, int N) {
+    // cible.template operator=<gene_vector>(source);
     cible = source;
   }
-
 };
 
 #endif
diff --git a/bench/btl/libs/blitz/btl_blitz.cpp b/bench/btl/libs/blitz/btl_blitz.cpp
index 16d2b59..b1cc8f0 100644
--- a/bench/btl/libs/blitz/btl_blitz.cpp
+++ b/bench/btl/libs/blitz/btl_blitz.cpp
@@ -31,21 +31,17 @@
 
 BTL_MAIN;
 
-int main()
-{
+int main() {
+  bench<Action_matrix_vector_product<blitz_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
+  bench<Action_atv_product<blitz_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
 
-  bench<Action_matrix_vector_product<blitz_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
-  bench<Action_atv_product<blitz_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
+  bench<Action_matrix_matrix_product<blitz_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  bench<Action_ata_product<blitz_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  bench<Action_aat_product<blitz_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
 
-  bench<Action_matrix_matrix_product<blitz_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-  bench<Action_ata_product<blitz_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-  bench<Action_aat_product<blitz_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+  bench<Action_axpy<blitz_interface<REAL_TYPE> > >(MIN_AXPY, MAX_AXPY, NB_POINT);
 
-  bench<Action_axpy<blitz_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
-
-  //bench<Action_lu_solve<blitz_LU_solve_interface<REAL_TYPE> > >(MIN_LU,MAX_LU,NB_POINT);
+  // bench<Action_lu_solve<blitz_LU_solve_interface<REAL_TYPE> > >(MIN_LU,MAX_LU,NB_POINT);
 
   return 0;
 }
-
-
diff --git a/bench/btl/libs/blitz/btl_tiny_blitz.cpp b/bench/btl/libs/blitz/btl_tiny_blitz.cpp
index 9fddde7..a7911bc 100644
--- a/bench/btl/libs/blitz/btl_tiny_blitz.cpp
+++ b/bench/btl/libs/blitz/btl_tiny_blitz.cpp
@@ -26,13 +26,10 @@
 
 BTL_MAIN;
 
-int main()
-{
-  bench_static<Action_axpy,tiny_blitz_interface>();
-  bench_static<Action_matrix_matrix_product,tiny_blitz_interface>();
-  bench_static<Action_matrix_vector_product,tiny_blitz_interface>();
+int main() {
+  bench_static<Action_axpy, tiny_blitz_interface>();
+  bench_static<Action_matrix_matrix_product, tiny_blitz_interface>();
+  bench_static<Action_matrix_vector_product, tiny_blitz_interface>();
 
   return 0;
 }
-
-
diff --git a/bench/btl/libs/blitz/tiny_blitz_interface.hh b/bench/btl/libs/blitz/tiny_blitz_interface.hh
index 6b26db7..daad14e 100644
--- a/bench/btl/libs/blitz/tiny_blitz_interface.hh
+++ b/bench/btl/libs/blitz/tiny_blitz_interface.hh
@@ -30,77 +30,62 @@
 
 BZ_USING_NAMESPACE(blitz)
 
-template<class real, int SIZE>
-class tiny_blitz_interface
-{
+template <class real, int SIZE>
+class tiny_blitz_interface {
+ public:
+  typedef real real_type;
 
-public :
+  typedef std::vector<real> stl_vector;
+  typedef std::vector<stl_vector> stl_matrix;
 
-  typedef real real_type ;
-
-  typedef std::vector<real>  stl_vector;
-  typedef std::vector<stl_vector > stl_matrix;
-
-  typedef TinyVector<real,SIZE> gene_vector;
-  typedef TinyMatrix<real,SIZE,SIZE> gene_matrix;
+  typedef TinyVector<real, SIZE> gene_vector;
+  typedef TinyMatrix<real, SIZE, SIZE> gene_matrix;
 
   static inline std::string name() { return "tiny_blitz"; }
 
-  static void free_matrix(gene_matrix & A, int N){}
+  static void free_matrix(gene_matrix& A, int N) {}
 
-  static void free_vector(gene_vector & B){}
+  static void free_vector(gene_vector& B) {}
 
-  static inline void matrix_from_stl(gene_matrix & A, stl_matrix & A_stl){
-    for (int j=0; j<A_stl.size() ; j++)
-      for (int i=0; i<A_stl[j].size() ; i++)
-        A(i,j)=A_stl[j][i];
+  static inline void matrix_from_stl(gene_matrix& A, stl_matrix& A_stl) {
+    for (int j = 0; j < A_stl.size(); j++)
+      for (int i = 0; i < A_stl[j].size(); i++) A(i, j) = A_stl[j][i];
   }
 
-  static inline void vector_from_stl(gene_vector & B, stl_vector & B_stl){
-    for (int i=0; i<B_stl.size() ; i++)
-      B(i) = B_stl[i];
+  static inline void vector_from_stl(gene_vector& B, stl_vector& B_stl) {
+    for (int i = 0; i < B_stl.size(); i++) B(i) = B_stl[i];
   }
 
-  static inline void vector_to_stl(gene_vector & B, stl_vector & B_stl){
-    for (int i=0; i<B_stl.size() ; i++)
-      B_stl[i] = B(i);
+  static inline void vector_to_stl(gene_vector& B, stl_vector& B_stl) {
+    for (int i = 0; i < B_stl.size(); i++) B_stl[i] = B(i);
   }
 
-  static inline void matrix_to_stl(gene_matrix & A, stl_matrix & A_stl){
+  static inline void matrix_to_stl(gene_matrix& A, stl_matrix& A_stl) {
     int N = A_stl.size();
-    for (int j=0;j<N;j++)
-    {
+    for (int j = 0; j < N; j++) {
       A_stl[j].resize(N);
-      for (int i=0;i<N;i++)
-        A_stl[j][i] = A(i,j);
+      for (int i = 0; i < N; i++) A_stl[j][i] = A(i, j);
     }
   }
 
-  static inline void copy_matrix(const gene_matrix & source, gene_matrix & cible, int N){
-    for (int j=0;j<N;j++)
-      for (int i=0;i<N;i++)
-        cible(i,j) = source(i,j);
+  static inline void copy_matrix(const gene_matrix& source, gene_matrix& cible, int N) {
+    for (int j = 0; j < N; j++)
+      for (int i = 0; i < N; i++) cible(i, j) = source(i, j);
   }
 
-  static inline void copy_vector(const gene_vector & source, gene_vector & cible, int N){
-    for (int i=0;i<N;i++){
+  static inline void copy_vector(const gene_vector& source, gene_vector& cible, int N) {
+    for (int i = 0; i < N; i++) {
       cible(i) = source(i);
     }
   }
 
-  static inline void matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int N){
-    X = product(A,B);
+  static inline void matrix_matrix_product(const gene_matrix& A, const gene_matrix& B, gene_matrix& X, int N) {
+    X = product(A, B);
   }
 
-  static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){
-    X = product(A,B);
-  }
+  static inline void matrix_vector_product(gene_matrix& A, gene_vector& B, gene_vector& X, int N) { X = product(A, B); }
 
-  static inline void axpy(const real coef, const gene_vector & X, gene_vector & Y, int N){
-    Y += coef * X;
-  }
-
+  static inline void axpy(const real coef, const gene_vector& X, gene_vector& Y, int N) { Y += coef * X; }
 };
 
-
 #endif
diff --git a/bench/btl/libs/eigen2/btl_tiny_eigen2.cpp b/bench/btl/libs/eigen2/btl_tiny_eigen2.cpp
index d1515be..b70e35d 100644
--- a/bench/btl/libs/eigen2/btl_tiny_eigen2.cpp
+++ b/bench/btl/libs/eigen2/btl_tiny_eigen2.cpp
@@ -30,17 +30,13 @@
 
 BTL_MAIN;
 
-int main()
-{
-
-  bench_static<Action_axpy,eigen2_interface>();
-  bench_static<Action_matrix_matrix_product,eigen2_interface>();
-  bench_static<Action_matrix_vector_product,eigen2_interface>();
-  bench_static<Action_atv_product,eigen2_interface>();
-  bench_static<Action_cholesky,eigen2_interface>();
-  bench_static<Action_trisolve,eigen2_interface>();
+int main() {
+  bench_static<Action_axpy, eigen2_interface>();
+  bench_static<Action_matrix_matrix_product, eigen2_interface>();
+  bench_static<Action_matrix_vector_product, eigen2_interface>();
+  bench_static<Action_atv_product, eigen2_interface>();
+  bench_static<Action_cholesky, eigen2_interface>();
+  bench_static<Action_trisolve, eigen2_interface>();
 
   return 0;
 }
-
-
diff --git a/bench/btl/libs/eigen2/eigen2_interface.hh b/bench/btl/libs/eigen2/eigen2_interface.hh
index 1deabda..013deca 100644
--- a/bench/btl/libs/eigen2/eigen2_interface.hh
+++ b/bench/btl/libs/eigen2/eigen2_interface.hh
@@ -27,142 +27,133 @@
 
 using namespace Eigen;
 
-template<class real, int SIZE=Dynamic>
-class eigen2_interface
-{
-
-public :
-
-  enum {IsFixedSize = (SIZE!=Dynamic)};
+template <class real, int SIZE = Dynamic>
+class eigen2_interface {
+ public:
+  enum { IsFixedSize = (SIZE != Dynamic) };
 
   typedef real real_type;
 
   typedef std::vector<real> stl_vector;
   typedef std::vector<stl_vector> stl_matrix;
 
-  typedef Eigen::Matrix<real,SIZE,SIZE> gene_matrix;
-  typedef Eigen::Matrix<real,SIZE,1> gene_vector;
+  typedef Eigen::Matrix<real, SIZE, SIZE> gene_matrix;
+  typedef Eigen::Matrix<real, SIZE, 1> gene_vector;
 
-  static inline std::string name( void )
-  {
-    #if defined(EIGEN_VECTORIZE_SSE)
-    if (SIZE==Dynamic) return "eigen2"; else return "tiny_eigen2";
-    #elif defined(EIGEN_VECTORIZE_ALTIVEC) || defined(EIGEN_VECTORIZE_VSX)
-    if (SIZE==Dynamic) return "eigen2"; else return "tiny_eigen2";
-    #else
-    if (SIZE==Dynamic) return "eigen2_novec"; else return "tiny_eigen2_novec";
-    #endif
+  static inline std::string name(void) {
+#if defined(EIGEN_VECTORIZE_SSE)
+    if (SIZE == Dynamic)
+      return "eigen2";
+    else
+      return "tiny_eigen2";
+#elif defined(EIGEN_VECTORIZE_ALTIVEC) || defined(EIGEN_VECTORIZE_VSX)
+    if (SIZE == Dynamic)
+      return "eigen2";
+    else
+      return "tiny_eigen2";
+#else
+    if (SIZE == Dynamic)
+      return "eigen2_novec";
+    else
+      return "tiny_eigen2_novec";
+#endif
   }
 
-  static void free_matrix(gene_matrix & A, int N) {}
+  static void free_matrix(gene_matrix& A, int N) {}
 
-  static void free_vector(gene_vector & B) {}
+  static void free_vector(gene_vector& B) {}
 
-  static BTL_DONT_INLINE void matrix_from_stl(gene_matrix & A, stl_matrix & A_stl){
+  static BTL_DONT_INLINE void matrix_from_stl(gene_matrix& A, stl_matrix& A_stl) {
     A.resize(A_stl[0].size(), A_stl.size());
 
-    for (int j=0; j<A_stl.size() ; j++){
-      for (int i=0; i<A_stl[j].size() ; i++){
-        A.coeffRef(i,j) = A_stl[j][i];
+    for (int j = 0; j < A_stl.size(); j++) {
+      for (int i = 0; i < A_stl[j].size(); i++) {
+        A.coeffRef(i, j) = A_stl[j][i];
       }
     }
   }
 
-  static BTL_DONT_INLINE  void vector_from_stl(gene_vector & B, stl_vector & B_stl){
-    B.resize(B_stl.size(),1);
+  static BTL_DONT_INLINE void vector_from_stl(gene_vector& B, stl_vector& B_stl) {
+    B.resize(B_stl.size(), 1);
 
-    for (int i=0; i<B_stl.size() ; i++){
+    for (int i = 0; i < B_stl.size(); i++) {
       B.coeffRef(i) = B_stl[i];
     }
   }
 
-  static BTL_DONT_INLINE  void vector_to_stl(gene_vector & B, stl_vector & B_stl){
-    for (int i=0; i<B_stl.size() ; i++){
+  static BTL_DONT_INLINE void vector_to_stl(gene_vector& B, stl_vector& B_stl) {
+    for (int i = 0; i < B_stl.size(); i++) {
       B_stl[i] = B.coeff(i);
     }
   }
 
-  static BTL_DONT_INLINE  void matrix_to_stl(gene_matrix & A, stl_matrix & A_stl){
-    int N=A_stl.size();
+  static BTL_DONT_INLINE void matrix_to_stl(gene_matrix& A, stl_matrix& A_stl) {
+    int N = A_stl.size();
 
-    for (int j=0;j<N;j++){
+    for (int j = 0; j < N; j++) {
       A_stl[j].resize(N);
-      for (int i=0;i<N;i++){
-        A_stl[j][i] = A.coeff(i,j);
+      for (int i = 0; i < N; i++) {
+        A_stl[j][i] = A.coeff(i, j);
       }
     }
   }
 
-  static inline void matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int N){
-    X = (A*B).lazy();
+  static inline void matrix_matrix_product(const gene_matrix& A, const gene_matrix& B, gene_matrix& X, int N) {
+    X = (A * B).lazy();
   }
 
-  static inline void transposed_matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int N){
-    X = (A.transpose()*B.transpose()).lazy();
+  static inline void transposed_matrix_matrix_product(const gene_matrix& A, const gene_matrix& B, gene_matrix& X,
+                                                      int N) {
+    X = (A.transpose() * B.transpose()).lazy();
   }
 
-  static inline void ata_product(const gene_matrix & A, gene_matrix & X, int N){
-    X = (A.transpose()*A).lazy();
+  static inline void ata_product(const gene_matrix& A, gene_matrix& X, int N) { X = (A.transpose() * A).lazy(); }
+
+  static inline void aat_product(const gene_matrix& A, gene_matrix& X, int N) { X = (A * A.transpose()).lazy(); }
+
+  static inline void matrix_vector_product(const gene_matrix& A, const gene_vector& B, gene_vector& X, int N) {
+    X = (A * B) /*.lazy()*/;
   }
 
-  static inline void aat_product(const gene_matrix & A, gene_matrix & X, int N){
-    X = (A*A.transpose()).lazy();
+  static inline void atv_product(gene_matrix& A, gene_vector& B, gene_vector& X, int N) {
+    X = (A.transpose() * B) /*.lazy()*/;
   }
 
-  static inline void matrix_vector_product(const gene_matrix & A, const gene_vector & B, gene_vector & X, int N){
-    X = (A*B)/*.lazy()*/;
-  }
+  static inline void axpy(real coef, const gene_vector& X, gene_vector& Y, int N) { Y += coef * X; }
 
-  static inline void atv_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){
-    X = (A.transpose()*B)/*.lazy()*/;
-  }
+  static inline void axpby(real a, const gene_vector& X, real b, gene_vector& Y, int N) { Y = a * X + b * Y; }
 
-  static inline void axpy(real coef, const gene_vector & X, gene_vector & Y, int N){
-    Y += coef * X;
-  }
+  static inline void copy_matrix(const gene_matrix& source, gene_matrix& cible, int N) { cible = source; }
 
-  static inline void axpby(real a, const gene_vector & X, real b, gene_vector & Y, int N){
-    Y = a*X + b*Y;
-  }
+  static inline void copy_vector(const gene_vector& source, gene_vector& cible, int N) { cible = source; }
 
-  static inline void copy_matrix(const gene_matrix & source, gene_matrix & cible, int N){
-    cible = source;
-  }
-
-  static inline void copy_vector(const gene_vector & source, gene_vector & cible, int N){
-    cible = source;
-  }
-
-  static inline void trisolve_lower(const gene_matrix & L, const gene_vector& B, gene_vector& X, int N){
+  static inline void trisolve_lower(const gene_matrix& L, const gene_vector& B, gene_vector& X, int N) {
     X = L.template marked<LowerTriangular>().solveTriangular(B);
   }
 
-  static inline void trisolve_lower_matrix(const gene_matrix & L, const gene_matrix& B, gene_matrix& X, int N){
+  static inline void trisolve_lower_matrix(const gene_matrix& L, const gene_matrix& B, gene_matrix& X, int N) {
     X = L.template marked<LowerTriangular>().solveTriangular(B);
   }
 
-  static inline void cholesky(const gene_matrix & X, gene_matrix & C, int N){
+  static inline void cholesky(const gene_matrix& X, gene_matrix& C, int N) {
     C = X.llt().matrixL();
-//     C = X;
-//     Cholesky<gene_matrix>::computeInPlace(C);
-//     Cholesky<gene_matrix>::computeInPlaceBlock(C);
+    //     C = X;
+    //     Cholesky<gene_matrix>::computeInPlace(C);
+    //     Cholesky<gene_matrix>::computeInPlaceBlock(C);
   }
 
-  static inline void lu_decomp(const gene_matrix & X, gene_matrix & C, int N){
+  static inline void lu_decomp(const gene_matrix& X, gene_matrix& C, int N) {
     C = X.lu().matrixLU();
-//     C = X.inverse();
+    //     C = X.inverse();
   }
 
-  static inline void tridiagonalization(const gene_matrix & X, gene_matrix & C, int N){
+  static inline void tridiagonalization(const gene_matrix& X, gene_matrix& C, int N) {
     C = Tridiagonalization<gene_matrix>(X).packedMatrix();
   }
 
-  static inline void hessenberg(const gene_matrix & X, gene_matrix & C, int N){
+  static inline void hessenberg(const gene_matrix& X, gene_matrix& C, int N) {
     C = HessenbergDecomposition<gene_matrix>(X).packedMatrix();
   }
-
-
-
 };
 
 #endif
diff --git a/bench/btl/libs/eigen2/main_adv.cpp b/bench/btl/libs/eigen2/main_adv.cpp
index fe33689..337b4c8 100644
--- a/bench/btl/libs/eigen2/main_adv.cpp
+++ b/bench/btl/libs/eigen2/main_adv.cpp
@@ -27,18 +27,15 @@
 
 BTL_MAIN;
 
-int main()
-{
-  bench<Action_trisolve<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-  bench<Action_trisolve_matrix<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-  bench<Action_cholesky<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-  bench<Action_lu_decomp<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-//   bench<Action_partial_lu<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+int main() {
+  bench<Action_trisolve<eigen2_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  bench<Action_trisolve_matrix<eigen2_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  bench<Action_cholesky<eigen2_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  bench<Action_lu_decomp<eigen2_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  //   bench<Action_partial_lu<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
 
-  bench<Action_hessenberg<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-  bench<Action_tridiagonalization<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+  bench<Action_hessenberg<eigen2_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  bench<Action_tridiagonalization<eigen2_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
 
   return 0;
 }
-
-
diff --git a/bench/btl/libs/eigen2/main_linear.cpp b/bench/btl/libs/eigen2/main_linear.cpp
index c17d16c..6f9a894 100644
--- a/bench/btl/libs/eigen2/main_linear.cpp
+++ b/bench/btl/libs/eigen2/main_linear.cpp
@@ -22,13 +22,9 @@
 
 BTL_MAIN;
 
-int main()
-{
+int main() {
+  bench<Action_axpy<eigen2_interface<REAL_TYPE> > >(MIN_AXPY, MAX_AXPY, NB_POINT);
+  bench<Action_axpby<eigen2_interface<REAL_TYPE> > >(MIN_AXPY, MAX_AXPY, NB_POINT);
 
-  bench<Action_axpy<eigen2_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
-  bench<Action_axpby<eigen2_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
-  
   return 0;
 }
-
-
diff --git a/bench/btl/libs/eigen2/main_matmat.cpp b/bench/btl/libs/eigen2/main_matmat.cpp
index cd9dc9c..37ce401 100644
--- a/bench/btl/libs/eigen2/main_matmat.cpp
+++ b/bench/btl/libs/eigen2/main_matmat.cpp
@@ -22,14 +22,11 @@
 
 BTL_MAIN;
 
-int main()
-{
-  bench<Action_matrix_matrix_product<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-//   bench<Action_ata_product<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-  bench<Action_aat_product<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-//   bench<Action_trmm<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+int main() {
+  bench<Action_matrix_matrix_product<eigen2_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  //   bench<Action_ata_product<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+  bench<Action_aat_product<eigen2_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  //   bench<Action_trmm<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
 
   return 0;
 }
-
-
diff --git a/bench/btl/libs/eigen2/main_vecmat.cpp b/bench/btl/libs/eigen2/main_vecmat.cpp
index 8b66cd2..99472d8 100644
--- a/bench/btl/libs/eigen2/main_vecmat.cpp
+++ b/bench/btl/libs/eigen2/main_vecmat.cpp
@@ -22,15 +22,12 @@
 
 BTL_MAIN;
 
-int main()
-{
-  bench<Action_matrix_vector_product<eigen2_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
-  bench<Action_atv_product<eigen2_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
-//   bench<Action_symv<eigen2_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
-//   bench<Action_syr2<eigen2_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
-//   bench<Action_ger<eigen2_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
+int main() {
+  bench<Action_matrix_vector_product<eigen2_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
+  bench<Action_atv_product<eigen2_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
+  //   bench<Action_symv<eigen2_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
+  //   bench<Action_syr2<eigen2_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
+  //   bench<Action_ger<eigen2_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
 
   return 0;
 }
-
-
diff --git a/bench/btl/libs/eigen3/btl_tiny_eigen3.cpp b/bench/btl/libs/eigen3/btl_tiny_eigen3.cpp
index d1515be..b70e35d 100644
--- a/bench/btl/libs/eigen3/btl_tiny_eigen3.cpp
+++ b/bench/btl/libs/eigen3/btl_tiny_eigen3.cpp
@@ -30,17 +30,13 @@
 
 BTL_MAIN;
 
-int main()
-{
-
-  bench_static<Action_axpy,eigen2_interface>();
-  bench_static<Action_matrix_matrix_product,eigen2_interface>();
-  bench_static<Action_matrix_vector_product,eigen2_interface>();
-  bench_static<Action_atv_product,eigen2_interface>();
-  bench_static<Action_cholesky,eigen2_interface>();
-  bench_static<Action_trisolve,eigen2_interface>();
+int main() {
+  bench_static<Action_axpy, eigen2_interface>();
+  bench_static<Action_matrix_matrix_product, eigen2_interface>();
+  bench_static<Action_matrix_vector_product, eigen2_interface>();
+  bench_static<Action_atv_product, eigen2_interface>();
+  bench_static<Action_cholesky, eigen2_interface>();
+  bench_static<Action_trisolve, eigen2_interface>();
 
   return 0;
 }
-
-
diff --git a/bench/btl/libs/eigen3/eigen3_interface.hh b/bench/btl/libs/eigen3/eigen3_interface.hh
index 2e302d0..6035561 100644
--- a/bench/btl/libs/eigen3/eigen3_interface.hh
+++ b/bench/btl/libs/eigen3/eigen3_interface.hh
@@ -24,219 +24,201 @@
 
 using namespace Eigen;
 
-template<class real, int SIZE=Dynamic>
-class eigen3_interface
-{
-
-public :
-
-  enum {IsFixedSize = (SIZE!=Dynamic)};
+template <class real, int SIZE = Dynamic>
+class eigen3_interface {
+ public:
+  enum { IsFixedSize = (SIZE != Dynamic) };
 
   typedef real real_type;
 
   typedef std::vector<real> stl_vector;
   typedef std::vector<stl_vector> stl_matrix;
 
-  typedef Eigen::Matrix<real,SIZE,SIZE> gene_matrix;
-  typedef Eigen::Matrix<real,SIZE,1> gene_vector;
+  typedef Eigen::Matrix<real, SIZE, SIZE> gene_matrix;
+  typedef Eigen::Matrix<real, SIZE, 1> gene_vector;
 
-  static inline std::string name( void )
-  {
-    return EIGEN_MAKESTRING(BTL_PREFIX);
-  }
+  static inline std::string name(void) { return EIGEN_MAKESTRING(BTL_PREFIX); }
 
-  static void free_matrix(gene_matrix & /*A*/, int /*N*/) {}
+  static void free_matrix(gene_matrix& /*A*/, int /*N*/) {}
 
-  static void free_vector(gene_vector & /*B*/) {}
+  static void free_vector(gene_vector& /*B*/) {}
 
-  static BTL_DONT_INLINE void matrix_from_stl(gene_matrix & A, stl_matrix & A_stl){
+  static BTL_DONT_INLINE void matrix_from_stl(gene_matrix& A, stl_matrix& A_stl) {
     A.resize(A_stl[0].size(), A_stl.size());
 
-    for (unsigned int j=0; j<A_stl.size() ; j++){
-      for (unsigned int i=0; i<A_stl[j].size() ; i++){
-        A.coeffRef(i,j) = A_stl[j][i];
+    for (unsigned int j = 0; j < A_stl.size(); j++) {
+      for (unsigned int i = 0; i < A_stl[j].size(); i++) {
+        A.coeffRef(i, j) = A_stl[j][i];
       }
     }
   }
 
-  static BTL_DONT_INLINE  void vector_from_stl(gene_vector & B, stl_vector & B_stl){
-    B.resize(B_stl.size(),1);
+  static BTL_DONT_INLINE void vector_from_stl(gene_vector& B, stl_vector& B_stl) {
+    B.resize(B_stl.size(), 1);
 
-    for (unsigned int i=0; i<B_stl.size() ; i++){
+    for (unsigned int i = 0; i < B_stl.size(); i++) {
       B.coeffRef(i) = B_stl[i];
     }
   }
 
-  static BTL_DONT_INLINE  void vector_to_stl(gene_vector & B, stl_vector & B_stl){
-    for (unsigned int i=0; i<B_stl.size() ; i++){
+  static BTL_DONT_INLINE void vector_to_stl(gene_vector& B, stl_vector& B_stl) {
+    for (unsigned int i = 0; i < B_stl.size(); i++) {
       B_stl[i] = B.coeff(i);
     }
   }
 
-  static BTL_DONT_INLINE  void matrix_to_stl(gene_matrix & A, stl_matrix & A_stl){
-    int  N=A_stl.size();
+  static BTL_DONT_INLINE void matrix_to_stl(gene_matrix& A, stl_matrix& A_stl) {
+    int N = A_stl.size();
 
-    for (int j=0;j<N;j++){
+    for (int j = 0; j < N; j++) {
       A_stl[j].resize(N);
-      for (int i=0;i<N;i++){
-        A_stl[j][i] = A.coeff(i,j);
+      for (int i = 0; i < N; i++) {
+        A_stl[j][i] = A.coeff(i, j);
       }
     }
   }
 
-  static inline void matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int  /*N*/){
-    X.noalias() = A*B;
+  static inline void matrix_matrix_product(const gene_matrix& A, const gene_matrix& B, gene_matrix& X, int /*N*/) {
+    X.noalias() = A * B;
   }
 
-  static inline void transposed_matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int  /*N*/){
-    X.noalias() = A.transpose()*B.transpose();
+  static inline void transposed_matrix_matrix_product(const gene_matrix& A, const gene_matrix& B, gene_matrix& X,
+                                                      int /*N*/) {
+    X.noalias() = A.transpose() * B.transpose();
   }
 
-  static inline void ata_product(const gene_matrix & A, gene_matrix & X, int  /*N*/){
-    //X.noalias() = A.transpose()*A;
+  static inline void ata_product(const gene_matrix& A, gene_matrix& X, int /*N*/) {
+    // X.noalias() = A.transpose()*A;
     X.template triangularView<Lower>().setZero();
     X.template selfadjointView<Lower>().rankUpdate(A.transpose());
   }
 
-  static inline void aat_product(const gene_matrix & A, gene_matrix & X, int  /*N*/){
+  static inline void aat_product(const gene_matrix& A, gene_matrix& X, int /*N*/) {
     X.template triangularView<Lower>().setZero();
     X.template selfadjointView<Lower>().rankUpdate(A);
   }
 
-  static inline void matrix_vector_product(const gene_matrix & A, const gene_vector & B, gene_vector & X, int  /*N*/){
-    X.noalias() = A*B;
+  static inline void matrix_vector_product(const gene_matrix& A, const gene_vector& B, gene_vector& X, int /*N*/) {
+    X.noalias() = A * B;
   }
 
-  static inline void symv(const gene_matrix & A, const gene_vector & B, gene_vector & X, int  /*N*/){
+  static inline void symv(const gene_matrix& A, const gene_vector& B, gene_vector& X, int /*N*/) {
     X.noalias() = (A.template selfadjointView<Lower>() * B);
-//     internal::product_selfadjoint_vector<real,0,LowerTriangularBit,false,false>(N,A.data(),N, B.data(), 1, X.data(), 1);
+    //     internal::product_selfadjoint_vector<real,0,LowerTriangularBit,false,false>(N,A.data(),N, B.data(), 1,
+    //     X.data(), 1);
   }
 
-  template<typename Dest, typename Src> static void triassign(Dest& dst, const Src& src)
-  {
+  template <typename Dest, typename Src>
+  static void triassign(Dest& dst, const Src& src) {
     typedef typename Dest::Scalar Scalar;
     typedef typename internal::packet_traits<Scalar>::type Packet;
-    const int PacketSize = sizeof(Packet)/sizeof(Scalar);
+    const int PacketSize = sizeof(Packet) / sizeof(Scalar);
     int size = dst.cols();
-    for(int j=0; j<size; j+=1)
-    {
-//       const int alignedEnd = alignedStart + ((innerSize-alignedStart) & ~packetAlignedMask);
-      Scalar* A0 = dst.data() + j*dst.stride();
+    for (int j = 0; j < size; j += 1) {
+      //       const int alignedEnd = alignedStart + ((innerSize-alignedStart) & ~packetAlignedMask);
+      Scalar* A0 = dst.data() + j * dst.stride();
       int starti = j;
       int alignedEnd = starti;
-      int alignedStart = (starti) + internal::first_aligned(&A0[starti], size-starti);
-      alignedEnd = alignedStart + ((size-alignedStart)/(2*PacketSize))*(PacketSize*2);
+      int alignedStart = (starti) + internal::first_aligned(&A0[starti], size - starti);
+      alignedEnd = alignedStart + ((size - alignedStart) / (2 * PacketSize)) * (PacketSize * 2);
 
       // do the non-vectorizable part of the assignment
-      for (int index = starti; index<alignedStart ; ++index)
-      {
-        if(Dest::Flags&RowMajorBit)
+      for (int index = starti; index < alignedStart; ++index) {
+        if (Dest::Flags & RowMajorBit)
           dst.copyCoeff(j, index, src);
         else
           dst.copyCoeff(index, j, src);
       }
 
       // do the vectorizable part of the assignment
-      for (int index = alignedStart; index<alignedEnd; index+=PacketSize)
-      {
-        if(Dest::Flags&RowMajorBit)
+      for (int index = alignedStart; index < alignedEnd; index += PacketSize) {
+        if (Dest::Flags & RowMajorBit)
           dst.template copyPacket<Src, Aligned, Unaligned>(j, index, src);
         else
           dst.template copyPacket<Src, Aligned, Unaligned>(index, j, src);
       }
 
       // do the non-vectorizable part of the assignment
-      for (int index = alignedEnd; index<size; ++index)
-      {
-        if(Dest::Flags&RowMajorBit)
+      for (int index = alignedEnd; index < size; ++index) {
+        if (Dest::Flags & RowMajorBit)
           dst.copyCoeff(j, index, src);
         else
           dst.copyCoeff(index, j, src);
       }
-      //dst.col(j).tail(N-j) = src.col(j).tail(N-j);
+      // dst.col(j).tail(N-j) = src.col(j).tail(N-j);
     }
   }
 
-  static EIGEN_DONT_INLINE void syr2(gene_matrix & A,  gene_vector & X, gene_vector & Y, int  N){
-    // internal::product_selfadjoint_rank2_update<real,0,LowerTriangularBit>(N,A.data(),N, X.data(), 1, Y.data(), 1, -1);
-    for(int j=0; j<N; ++j)
-      A.col(j).tail(N-j) += X[j] * Y.tail(N-j) + Y[j] * X.tail(N-j);
+  static EIGEN_DONT_INLINE void syr2(gene_matrix& A, gene_vector& X, gene_vector& Y, int N) {
+    // internal::product_selfadjoint_rank2_update<real,0,LowerTriangularBit>(N,A.data(),N, X.data(), 1, Y.data(), 1,
+    // -1);
+    for (int j = 0; j < N; ++j) A.col(j).tail(N - j) += X[j] * Y.tail(N - j) + Y[j] * X.tail(N - j);
   }
 
-  static EIGEN_DONT_INLINE void ger(gene_matrix & A,  gene_vector & X, gene_vector & Y, int  N){
-    for(int j=0; j<N; ++j)
-      A.col(j) += X * Y[j];
+  static EIGEN_DONT_INLINE void ger(gene_matrix& A, gene_vector& X, gene_vector& Y, int N) {
+    for (int j = 0; j < N; ++j) A.col(j) += X * Y[j];
   }
 
-  static EIGEN_DONT_INLINE void rot(gene_vector & A,  gene_vector & B, real c, real s, int  /*N*/){
-    internal::apply_rotation_in_the_plane(A, B, JacobiRotation<real>(c,s));
+  static EIGEN_DONT_INLINE void rot(gene_vector& A, gene_vector& B, real c, real s, int /*N*/) {
+    internal::apply_rotation_in_the_plane(A, B, JacobiRotation<real>(c, s));
   }
 
-  static inline void atv_product(gene_matrix & A, gene_vector & B, gene_vector & X, int  /*N*/){
-    X.noalias() = (A.transpose()*B);
+  static inline void atv_product(gene_matrix& A, gene_vector& B, gene_vector& X, int /*N*/) {
+    X.noalias() = (A.transpose() * B);
   }
 
-  static inline void axpy(real coef, const gene_vector & X, gene_vector & Y, int  /*N*/){
-    Y += coef * X;
-  }
+  static inline void axpy(real coef, const gene_vector& X, gene_vector& Y, int /*N*/) { Y += coef * X; }
 
-  static inline void axpby(real a, const gene_vector & X, real b, gene_vector & Y, int  /*N*/){
-    Y = a*X + b*Y;
-  }
+  static inline void axpby(real a, const gene_vector& X, real b, gene_vector& Y, int /*N*/) { Y = a * X + b * Y; }
 
-  static EIGEN_DONT_INLINE void copy_matrix(const gene_matrix & source, gene_matrix & cible, int  /*N*/){
+  static EIGEN_DONT_INLINE void copy_matrix(const gene_matrix& source, gene_matrix& cible, int /*N*/) {
     cible = source;
   }
 
-  static EIGEN_DONT_INLINE void copy_vector(const gene_vector & source, gene_vector & cible, int  /*N*/){
+  static EIGEN_DONT_INLINE void copy_vector(const gene_vector& source, gene_vector& cible, int /*N*/) {
     cible = source;
   }
 
-  static inline void trisolve_lower(const gene_matrix & L, const gene_vector& B, gene_vector& X, int  /*N*/){
+  static inline void trisolve_lower(const gene_matrix& L, const gene_vector& B, gene_vector& X, int /*N*/) {
     X = L.template triangularView<Lower>().solve(B);
   }
 
-  static inline void trisolve_lower_matrix(const gene_matrix & L, const gene_matrix& B, gene_matrix& X, int  /*N*/){
+  static inline void trisolve_lower_matrix(const gene_matrix& L, const gene_matrix& B, gene_matrix& X, int /*N*/) {
     X = L.template triangularView<Upper>().solve(B);
   }
 
-  static inline void trmm(const gene_matrix & L, const gene_matrix& B, gene_matrix& X, int  /*N*/){
+  static inline void trmm(const gene_matrix& L, const gene_matrix& B, gene_matrix& X, int /*N*/) {
     X.noalias() = L.template triangularView<Lower>() * B;
   }
 
-  static inline void cholesky(const gene_matrix & X, gene_matrix & C, int  /*N*/){
+  static inline void cholesky(const gene_matrix& X, gene_matrix& C, int /*N*/) {
     C = X;
-    internal::llt_inplace<real,Lower>::blocked(C);
-    //C = X.llt().matrixL();
-//     C = X;
-//     Cholesky<gene_matrix>::computeInPlace(C);
-//     Cholesky<gene_matrix>::computeInPlaceBlock(C);
+    internal::llt_inplace<real, Lower>::blocked(C);
+    // C = X.llt().matrixL();
+    //     C = X;
+    //     Cholesky<gene_matrix>::computeInPlace(C);
+    //     Cholesky<gene_matrix>::computeInPlaceBlock(C);
   }
 
-  static inline void lu_decomp(const gene_matrix & X, gene_matrix & C, int  /*N*/){
-    C = X.fullPivLu().matrixLU();
-  }
+  static inline void lu_decomp(const gene_matrix& X, gene_matrix& C, int /*N*/) { C = X.fullPivLu().matrixLU(); }
 
-  static inline void partial_lu_decomp(const gene_matrix & X, gene_matrix & C, int  N){
-    Matrix<DenseIndex,1,Dynamic> piv(N);
+  static inline void partial_lu_decomp(const gene_matrix& X, gene_matrix& C, int N) {
+    Matrix<DenseIndex, 1, Dynamic> piv(N);
     DenseIndex nb;
     C = X;
-    internal::partial_lu_inplace(C,piv,nb);
-//     C = X.partialPivLu().matrixLU();
+    internal::partial_lu_inplace(C, piv, nb);
+    //     C = X.partialPivLu().matrixLU();
   }
 
-  static inline void tridiagonalization(const gene_matrix & X, gene_matrix & C, int  N){
-    typename Tridiagonalization<gene_matrix>::CoeffVectorType aux(N-1);
+  static inline void tridiagonalization(const gene_matrix& X, gene_matrix& C, int N) {
+    typename Tridiagonalization<gene_matrix>::CoeffVectorType aux(N - 1);
     C = X;
     internal::tridiagonalization_inplace(C, aux);
   }
 
-  static inline void hessenberg(const gene_matrix & X, gene_matrix & C, int  /*N*/){
+  static inline void hessenberg(const gene_matrix& X, gene_matrix& C, int /*N*/) {
     C = HessenbergDecomposition<gene_matrix>(X).packedMatrix();
   }
-
-
-
 };
 
 #endif
diff --git a/bench/btl/libs/eigen3/main_adv.cpp b/bench/btl/libs/eigen3/main_adv.cpp
index 9586535..5edaf4b 100644
--- a/bench/btl/libs/eigen3/main_adv.cpp
+++ b/bench/btl/libs/eigen3/main_adv.cpp
@@ -27,18 +27,15 @@
 
 BTL_MAIN;
 
-int main()
-{
-  bench<Action_trisolve<eigen3_interface<REAL_TYPE> > >(MIN_LU,MAX_LU,NB_POINT);
-  bench<Action_trisolve_matrix<eigen3_interface<REAL_TYPE> > >(MIN_LU,MAX_LU,NB_POINT);
-  bench<Action_cholesky<eigen3_interface<REAL_TYPE> > >(MIN_LU,MAX_LU,NB_POINT);
-//   bench<Action_lu_decomp<eigen3_interface<REAL_TYPE> > >(MIN_LU,MAX_LU,NB_POINT);
-  bench<Action_partial_lu<eigen3_interface<REAL_TYPE> > >(MIN_LU,MAX_LU,NB_POINT);
+int main() {
+  bench<Action_trisolve<eigen3_interface<REAL_TYPE> > >(MIN_LU, MAX_LU, NB_POINT);
+  bench<Action_trisolve_matrix<eigen3_interface<REAL_TYPE> > >(MIN_LU, MAX_LU, NB_POINT);
+  bench<Action_cholesky<eigen3_interface<REAL_TYPE> > >(MIN_LU, MAX_LU, NB_POINT);
+  //   bench<Action_lu_decomp<eigen3_interface<REAL_TYPE> > >(MIN_LU,MAX_LU,NB_POINT);
+  bench<Action_partial_lu<eigen3_interface<REAL_TYPE> > >(MIN_LU, MAX_LU, NB_POINT);
 
-//   bench<Action_hessenberg<eigen3_interface<REAL_TYPE> > >(MIN_LU,MAX_LU,NB_POINT);
-  bench<Action_tridiagonalization<eigen3_interface<REAL_TYPE> > >(MIN_LU,MAX_LU,NB_POINT);
+  //   bench<Action_hessenberg<eigen3_interface<REAL_TYPE> > >(MIN_LU,MAX_LU,NB_POINT);
+  bench<Action_tridiagonalization<eigen3_interface<REAL_TYPE> > >(MIN_LU, MAX_LU, NB_POINT);
 
   return 0;
 }
-
-
diff --git a/bench/btl/libs/eigen3/main_linear.cpp b/bench/btl/libs/eigen3/main_linear.cpp
index e8538b7..7209574 100644
--- a/bench/btl/libs/eigen3/main_linear.cpp
+++ b/bench/btl/libs/eigen3/main_linear.cpp
@@ -22,14 +22,10 @@
 
 BTL_MAIN;
 
-int main()
-{
+int main() {
+  bench<Action_axpy<eigen3_interface<REAL_TYPE> > >(MIN_AXPY, MAX_AXPY, NB_POINT);
+  bench<Action_axpby<eigen3_interface<REAL_TYPE> > >(MIN_AXPY, MAX_AXPY, NB_POINT);
+  bench<Action_rot<eigen3_interface<REAL_TYPE> > >(MIN_AXPY, MAX_AXPY, NB_POINT);
 
-  bench<Action_axpy<eigen3_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
-  bench<Action_axpby<eigen3_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
-  bench<Action_rot<eigen3_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
-  
   return 0;
 }
-
-
diff --git a/bench/btl/libs/eigen3/main_matmat.cpp b/bench/btl/libs/eigen3/main_matmat.cpp
index 052810a..67b6e76 100644
--- a/bench/btl/libs/eigen3/main_matmat.cpp
+++ b/bench/btl/libs/eigen3/main_matmat.cpp
@@ -22,14 +22,11 @@
 
 BTL_MAIN;
 
-int main()
-{
-  bench<Action_matrix_matrix_product<eigen3_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-  bench<Action_ata_product<eigen3_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-  bench<Action_aat_product<eigen3_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-  bench<Action_trmm<eigen3_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+int main() {
+  bench<Action_matrix_matrix_product<eigen3_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  bench<Action_ata_product<eigen3_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  bench<Action_aat_product<eigen3_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  bench<Action_trmm<eigen3_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
 
   return 0;
 }
-
-
diff --git a/bench/btl/libs/eigen3/main_vecmat.cpp b/bench/btl/libs/eigen3/main_vecmat.cpp
index 0dda444..11e8e66 100644
--- a/bench/btl/libs/eigen3/main_vecmat.cpp
+++ b/bench/btl/libs/eigen3/main_vecmat.cpp
@@ -22,15 +22,12 @@
 
 BTL_MAIN;
 
-int main()
-{
-  bench<Action_matrix_vector_product<eigen3_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
-  bench<Action_atv_product<eigen3_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
-  bench<Action_symv<eigen3_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
-  bench<Action_syr2<eigen3_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
-  bench<Action_ger<eigen3_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
+int main() {
+  bench<Action_matrix_vector_product<eigen3_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
+  bench<Action_atv_product<eigen3_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
+  bench<Action_symv<eigen3_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
+  bench<Action_syr2<eigen3_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
+  bench<Action_ger<eigen3_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
 
   return 0;
 }
-
-
diff --git a/bench/btl/libs/gmm/gmm_LU_solve_interface.hh b/bench/btl/libs/gmm/gmm_LU_solve_interface.hh
index dcb9f56..955c816 100644
--- a/bench/btl/libs/gmm/gmm_LU_solve_interface.hh
+++ b/bench/btl/libs/gmm/gmm_LU_solve_interface.hh
@@ -1,14 +1,14 @@
 //=====================================================
 // File   :  blitz_LU_solve_interface.hh
-// Author :  L. Plagne <laurent.plagne@edf.fr)>        
+// Author :  L. Plagne <laurent.plagne@edf.fr)>
 // Copyright (C) EDF R&D,  lun sep 30 14:23:31 CEST 2002
 //=====================================================
-// 
+//
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
 // as published by the Free Software Foundation; either version 2
 // of the License, or (at your option) any later version.
-// 
+//
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -16,7 +16,7 @@
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-// 
+//
 #ifndef BLITZ_LU_SOLVE_INTERFACE_HH
 #define BLITZ_LU_SOLVE_INTERFACE_HH
 
@@ -25,168 +25,136 @@
 
 BZ_USING_NAMESPACE(blitz)
 
-template<class real>
-class blitz_LU_solve_interface : public blitz_interface<real>
-{
-
-public :
-
+template <class real>
+class blitz_LU_solve_interface : public blitz_interface<real> {
+ public:
   typedef typename blitz_interface<real>::gene_matrix gene_matrix;
   typedef typename blitz_interface<real>::gene_vector gene_vector;
 
-  typedef blitz::Array<int,1> Pivot_Vector;
+  typedef blitz::Array<int, 1> Pivot_Vector;
 
-  inline static void new_Pivot_Vector(Pivot_Vector & pivot,int N)
-  {
+  inline static void new_Pivot_Vector(Pivot_Vector &pivot, int N) { pivot.resize(N); }
 
-    pivot.resize(N);
+  inline static void free_Pivot_Vector(Pivot_Vector &pivot) { return; }
 
-  }
+  static inline real matrix_vector_product_sliced(const gene_matrix &A, gene_vector B, int row, int col_start,
+                                                  int col_end) {
+    real somme = 0.;
 
-  inline static void free_Pivot_Vector(Pivot_Vector & pivot)
-  {
-    
-    return;
-
-  }
-
-
-  static inline real matrix_vector_product_sliced(const gene_matrix & A, gene_vector B, int row, int col_start, int col_end)
-  {
-    
-    real somme=0.;
-    
-    for (int j=col_start ; j<col_end+1 ; j++){
-	
-	somme+=A(row,j)*B(j);
-	
+    for (int j = col_start; j < col_end + 1; j++) {
+      somme += A(row, j) * B(j);
     }
 
     return somme;
-
   }
 
+  static inline real matrix_matrix_product_sliced(gene_matrix &A, int row, int col_start, int col_end, gene_matrix &B,
+                                                  int row_shift, int col) {
+    real somme = 0.;
 
-
-
-  static inline real matrix_matrix_product_sliced(gene_matrix & A, int row, int col_start, int col_end, gene_matrix & B, int row_shift, int col )
-  {
-    
-    real somme=0.;
-    
-    for (int j=col_start ; j<col_end+1 ; j++){
-	
-	somme+=A(row,j)*B(j+row_shift,col);
-	
+    for (int j = col_start; j < col_end + 1; j++) {
+      somme += A(row, j) * B(j + row_shift, col);
     }
 
     return somme;
-
   }
 
-  inline static void LU_factor(gene_matrix & LU, Pivot_Vector & pivot, int N)
-  {
-
-    ASSERT( LU.rows()==LU.cols() ) ;
-    int index_max = 0 ;
-    real big = 0. ;
-    real theSum = 0. ;
-    real dum = 0. ;
+  inline static void LU_factor(gene_matrix &LU, Pivot_Vector &pivot, int N) {
+    ASSERT(LU.rows() == LU.cols());
+    int index_max = 0;
+    real big = 0.;
+    real theSum = 0.;
+    real dum = 0.;
     // Get the implicit scaling information :
-    gene_vector ImplicitScaling( N ) ;
-    for( int i=0; i<N; i++ ) {
-      big = 0. ;
-      for( int j=0; j<N; j++ ) {
-	if( abs( LU( i, j ) )>=big ) big = abs( LU( i, j ) ) ;
+    gene_vector ImplicitScaling(N);
+    for (int i = 0; i < N; i++) {
+      big = 0.;
+      for (int j = 0; j < N; j++) {
+        if (abs(LU(i, j)) >= big) big = abs(LU(i, j));
       }
-      if( big==0. ) {
-	INFOS( "blitz_LU_factor::Singular matrix" ) ;
-	exit( 0 ) ;
+      if (big == 0.) {
+        INFOS("blitz_LU_factor::Singular matrix");
+        exit(0);
       }
-      ImplicitScaling( i ) = 1./big ;
+      ImplicitScaling(i) = 1. / big;
     }
     // Loop over columns of Crout's method :
-    for( int j=0; j<N; j++ ) {
-      for( int i=0; i<j; i++ ) {
-	theSum = LU( i, j ) ;
-	theSum -= matrix_matrix_product_sliced(LU, i, 0, i-1, LU, 0, j) ;
-	//	theSum -= sum( LU( i, Range( fromStart, i-1 ) )*LU( Range( fromStart, i-1 ), j ) ) ;
-	LU( i, j ) = theSum ;
+    for (int j = 0; j < N; j++) {
+      for (int i = 0; i < j; i++) {
+        theSum = LU(i, j);
+        theSum -= matrix_matrix_product_sliced(LU, i, 0, i - 1, LU, 0, j);
+        //	theSum -= sum( LU( i, Range( fromStart, i-1 ) )*LU( Range( fromStart, i-1 ), j ) ) ;
+        LU(i, j) = theSum;
       }
-      
+
       // Search for the largest pivot element :
-      big = 0. ;
-      for( int i=j; i<N; i++ ) {
-	theSum = LU( i, j ) ;
-	theSum -= matrix_matrix_product_sliced(LU, i, 0, j-1, LU, 0, j) ;
-	//	theSum -= sum( LU( i, Range( fromStart, j-1 ) )*LU( Range( fromStart, j-1 ), j ) ) ;
-	LU( i, j ) = theSum ;
-	if( (ImplicitScaling( i )*abs( theSum ))>=big ) {
-	  dum = ImplicitScaling( i )*abs( theSum ) ;
-	  big = dum ;
-	  index_max = i ;
-	}
+      big = 0.;
+      for (int i = j; i < N; i++) {
+        theSum = LU(i, j);
+        theSum -= matrix_matrix_product_sliced(LU, i, 0, j - 1, LU, 0, j);
+        //	theSum -= sum( LU( i, Range( fromStart, j-1 ) )*LU( Range( fromStart, j-1 ), j ) ) ;
+        LU(i, j) = theSum;
+        if ((ImplicitScaling(i) * abs(theSum)) >= big) {
+          dum = ImplicitScaling(i) * abs(theSum);
+          big = dum;
+          index_max = i;
+        }
       }
       // Interchanging rows and the scale factor :
-      if( j!=index_max ) {
-	for( int k=0; k<N; k++ ) {
-	  dum = LU( index_max, k ) ;
-	  LU( index_max, k ) = LU( j, k ) ;
-	  LU( j, k ) = dum ;
-	}
-	ImplicitScaling( index_max ) = ImplicitScaling( j ) ;
+      if (j != index_max) {
+        for (int k = 0; k < N; k++) {
+          dum = LU(index_max, k);
+          LU(index_max, k) = LU(j, k);
+          LU(j, k) = dum;
+        }
+        ImplicitScaling(index_max) = ImplicitScaling(j);
       }
-      pivot( j ) = index_max ;
-      if ( LU( j, j )==0. ) LU( j, j ) = 1.e-20 ;
+      pivot(j) = index_max;
+      if (LU(j, j) == 0.) LU(j, j) = 1.e-20;
       // Divide by the pivot element :
-      if( j<N ) {
-	dum = 1./LU( j, j ) ;
-	for( int i=j+1; i<N; i++ ) LU( i, j ) *= dum ;
+      if (j < N) {
+        dum = 1. / LU(j, j);
+        for (int i = j + 1; i < N; i++) LU(i, j) *= dum;
       }
     }
-
   }
 
-  inline static void LU_solve(const gene_matrix & LU, const Pivot_Vector pivot, gene_vector &B, gene_vector X, int N)
-  {
-
+  inline static void LU_solve(const gene_matrix &LU, const Pivot_Vector pivot, gene_vector &B, gene_vector X, int N) {
     // Pour conserver le meme header, on travaille sur X, copie du second-membre B
-    X = B.copy() ;
-    ASSERT( LU.rows()==LU.cols() ) ;
-    firstIndex indI ;
+    X = B.copy();
+    ASSERT(LU.rows() == LU.cols());
+    firstIndex indI;
     // Forward substitution :
-    int ii = 0 ;
-    real theSum = 0. ;
-    for( int i=0; i<N; i++ ) {
-      int ip = pivot( i ) ;
-      theSum = X( ip ) ;
+    int ii = 0;
+    real theSum = 0.;
+    for (int i = 0; i < N; i++) {
+      int ip = pivot(i);
+      theSum = X(ip);
       //      theSum = B( ip ) ;
-      X( ip ) = X( i ) ;
+      X(ip) = X(i);
       //      B( ip ) = B( i ) ;
-      if( ii ) {
-	theSum -= matrix_vector_product_sliced(LU, X, i, ii-1, i-1) ;
-	//	theSum -= sum( LU( i, Range( ii-1, i-1 ) )*X( Range( ii-1, i-1 ) ) ) ;
-	//	theSum -= sum( LU( i, Range( ii-1, i-1 ) )*B( Range( ii-1, i-1 ) ) ) ;
-      } else if( theSum ) {
-	ii = i+1 ;
+      if (ii) {
+        theSum -= matrix_vector_product_sliced(LU, X, i, ii - 1, i - 1);
+        //	theSum -= sum( LU( i, Range( ii-1, i-1 ) )*X( Range( ii-1, i-1 ) ) ) ;
+        //	theSum -= sum( LU( i, Range( ii-1, i-1 ) )*B( Range( ii-1, i-1 ) ) ) ;
+      } else if (theSum) {
+        ii = i + 1;
       }
-      X( i ) = theSum ;
+      X(i) = theSum;
       //      B( i ) = theSum ;
     }
     // Backsubstitution :
-    for( int i=N-1; i>=0; i-- ) {
-      theSum = X( i ) ;
+    for (int i = N - 1; i >= 0; i--) {
+      theSum = X(i);
       //      theSum = B( i ) ;
-      theSum -= matrix_vector_product_sliced(LU, X, i, i+1, N) ;
+      theSum -= matrix_vector_product_sliced(LU, X, i, i + 1, N);
       //      theSum -= sum( LU( i, Range( i+1, toEnd ) )*X( Range( i+1, toEnd ) ) ) ;
       //      theSum -= sum( LU( i, Range( i+1, toEnd ) )*B( Range( i+1, toEnd ) ) ) ;
       // Store a component of the solution vector :
-      X( i ) = theSum/LU( i, i ) ;
+      X(i) = theSum / LU(i, i);
       //      B( i ) = theSum/LU( i, i ) ;
     }
-
   }
-
 };
 
 #endif
diff --git a/bench/btl/libs/gmm/gmm_interface.hh b/bench/btl/libs/gmm/gmm_interface.hh
index 3ea303c..2da5a89 100644
--- a/bench/btl/libs/gmm/gmm_interface.hh
+++ b/bench/btl/libs/gmm/gmm_interface.hh
@@ -23,122 +23,101 @@
 
 using namespace gmm;
 
-template<class real>
+template <class real>
 class gmm_interface {
+ public:
+  typedef real real_type;
 
-public :
-
-  typedef real real_type ;
-
-  typedef std::vector<real>  stl_vector;
-  typedef std::vector<stl_vector > stl_matrix;
+  typedef std::vector<real> stl_vector;
+  typedef std::vector<stl_vector> stl_matrix;
 
   typedef gmm::dense_matrix<real> gene_matrix;
   typedef stl_vector gene_vector;
 
-  static inline std::string name( void )
-  {
-    return "gmm";
-  }
+  static inline std::string name(void) { return "gmm"; }
 
-  static void free_matrix(gene_matrix & A, int N){
-    return ;
-  }
+  static void free_matrix(gene_matrix& A, int N) { return; }
 
-  static void free_vector(gene_vector & B){
-    return ;
-  }
+  static void free_vector(gene_vector& B) { return; }
 
-  static inline void matrix_from_stl(gene_matrix & A, stl_matrix & A_stl){
-    A.resize(A_stl[0].size(),A_stl.size());
+  static inline void matrix_from_stl(gene_matrix& A, stl_matrix& A_stl) {
+    A.resize(A_stl[0].size(), A_stl.size());
 
-    for (int j=0; j<A_stl.size() ; j++){
-      for (int i=0; i<A_stl[j].size() ; i++){
-        A(i,j) = A_stl[j][i];
+    for (int j = 0; j < A_stl.size(); j++) {
+      for (int i = 0; i < A_stl[j].size(); i++) {
+        A(i, j) = A_stl[j][i];
       }
     }
   }
 
-  static inline void vector_from_stl(gene_vector & B, stl_vector & B_stl){
-    B = B_stl;
-  }
+  static inline void vector_from_stl(gene_vector& B, stl_vector& B_stl) { B = B_stl; }
 
-  static inline void vector_to_stl(gene_vector & B, stl_vector & B_stl){
-    B_stl = B;
-  }
+  static inline void vector_to_stl(gene_vector& B, stl_vector& B_stl) { B_stl = B; }
 
-  static inline void matrix_to_stl(gene_matrix & A, stl_matrix & A_stl){
-    int N=A_stl.size();
+  static inline void matrix_to_stl(gene_matrix& A, stl_matrix& A_stl) {
+    int N = A_stl.size();
 
-    for (int j=0;j<N;j++){
+    for (int j = 0; j < N; j++) {
       A_stl[j].resize(N);
-      for (int i=0;i<N;i++){
-        A_stl[j][i] = A(i,j);
+      for (int i = 0; i < N; i++) {
+        A_stl[j][i] = A(i, j);
       }
     }
   }
 
-  static inline void matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int N){
-    gmm::mult(A,B, X);
+  static inline void matrix_matrix_product(const gene_matrix& A, const gene_matrix& B, gene_matrix& X, int N) {
+    gmm::mult(A, B, X);
   }
 
-  static inline void transposed_matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int N){
-    gmm::mult(gmm::transposed(A),gmm::transposed(B), X);
+  static inline void transposed_matrix_matrix_product(const gene_matrix& A, const gene_matrix& B, gene_matrix& X,
+                                                      int N) {
+    gmm::mult(gmm::transposed(A), gmm::transposed(B), X);
   }
 
-  static inline void ata_product(const gene_matrix & A, gene_matrix & X, int N){
-    gmm::mult(gmm::transposed(A),A, X);
+  static inline void ata_product(const gene_matrix& A, gene_matrix& X, int N) { gmm::mult(gmm::transposed(A), A, X); }
+
+  static inline void aat_product(const gene_matrix& A, gene_matrix& X, int N) { gmm::mult(A, gmm::transposed(A), X); }
+
+  static inline void matrix_vector_product(gene_matrix& A, gene_vector& B, gene_vector& X, int N) {
+    gmm::mult(A, B, X);
   }
 
-  static inline void aat_product(const gene_matrix & A, gene_matrix & X, int N){
-    gmm::mult(A,gmm::transposed(A), X);
+  static inline void atv_product(gene_matrix& A, gene_vector& B, gene_vector& X, int N) {
+    gmm::mult(gmm::transposed(A), B, X);
   }
 
-  static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){
-    gmm::mult(A,B,X);
+  static inline void axpy(const real coef, const gene_vector& X, gene_vector& Y, int N) {
+    gmm::add(gmm::scaled(X, coef), Y);
   }
 
-  static inline void atv_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){
-    gmm::mult(gmm::transposed(A),B,X);
+  static inline void axpby(real a, const gene_vector& X, real b, gene_vector& Y, int N) {
+    gmm::add(gmm::scaled(X, a), gmm::scaled(Y, b), Y);
   }
 
-  static inline void axpy(const real coef, const gene_vector & X, gene_vector & Y, int N){
-    gmm::add(gmm::scaled(X,coef), Y);
-  }
+  static inline void copy_matrix(const gene_matrix& source, gene_matrix& cible, int N) { gmm::copy(source, cible); }
 
-  static inline void axpby(real a, const gene_vector & X, real b, gene_vector & Y, int N){
-    gmm::add(gmm::scaled(X,a), gmm::scaled(Y,b), Y);
-  }
+  static inline void copy_vector(const gene_vector& source, gene_vector& cible, int N) { gmm::copy(source, cible); }
 
-  static inline void copy_matrix(const gene_matrix & source, gene_matrix & cible, int N){
-    gmm::copy(source,cible);
-  }
-
-  static inline void copy_vector(const gene_vector & source, gene_vector & cible, int N){
-    gmm::copy(source,cible);
-  }
-
-  static inline void trisolve_lower(const gene_matrix & L, const gene_vector& B, gene_vector & X, int N){
-    gmm::copy(B,X);
+  static inline void trisolve_lower(const gene_matrix& L, const gene_vector& B, gene_vector& X, int N) {
+    gmm::copy(B, X);
     gmm::lower_tri_solve(L, X, false);
   }
 
-  static inline void partial_lu_decomp(const gene_matrix & X, gene_matrix & R, int N){
-    gmm::copy(X,R);
+  static inline void partial_lu_decomp(const gene_matrix& X, gene_matrix& R, int N) {
+    gmm::copy(X, R);
     std::vector<int> ipvt(N);
     gmm::lu_factor(R, ipvt);
   }
 
-  static inline void hessenberg(const gene_matrix & X, gene_matrix & R, int N){
-    gmm::copy(X,R);
-    gmm::Hessenberg_reduction(R,X,false);
+  static inline void hessenberg(const gene_matrix& X, gene_matrix& R, int N) {
+    gmm::copy(X, R);
+    gmm::Hessenberg_reduction(R, X, false);
   }
 
-  static inline void tridiagonalization(const gene_matrix & X, gene_matrix & R, int N){
-    gmm::copy(X,R);
-    gmm::Householder_tridiagonalization(R,X,false);
+  static inline void tridiagonalization(const gene_matrix& X, gene_matrix& R, int N) {
+    gmm::copy(X, R);
+    gmm::Householder_tridiagonalization(R, X, false);
   }
-
 };
 
 #endif
diff --git a/bench/btl/libs/gmm/main.cpp b/bench/btl/libs/gmm/main.cpp
index 1f0c051..1d23e53 100644
--- a/bench/btl/libs/gmm/main.cpp
+++ b/bench/btl/libs/gmm/main.cpp
@@ -24,28 +24,24 @@
 
 BTL_MAIN;
 
-int main()
-{
+int main() {
+  bench<Action_axpy<gmm_interface<REAL_TYPE> > >(MIN_AXPY, MAX_AXPY, NB_POINT);
+  bench<Action_axpby<gmm_interface<REAL_TYPE> > >(MIN_AXPY, MAX_AXPY, NB_POINT);
 
-  bench<Action_axpy<gmm_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
-  bench<Action_axpby<gmm_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
+  bench<Action_matrix_vector_product<gmm_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
+  bench<Action_atv_product<gmm_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
 
-  bench<Action_matrix_vector_product<gmm_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
-  bench<Action_atv_product<gmm_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
+  bench<Action_matrix_matrix_product<gmm_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  //   bench<Action_ata_product<gmm_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+  //   bench<Action_aat_product<gmm_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
 
-  bench<Action_matrix_matrix_product<gmm_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-//   bench<Action_ata_product<gmm_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-//   bench<Action_aat_product<gmm_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+  bench<Action_trisolve<gmm_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  // bench<Action_lu_solve<blitz_LU_solve_interface<REAL_TYPE> > >(MIN_LU,MAX_LU,NB_POINT);
 
-  bench<Action_trisolve<gmm_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-  //bench<Action_lu_solve<blitz_LU_solve_interface<REAL_TYPE> > >(MIN_LU,MAX_LU,NB_POINT);
+  bench<Action_partial_lu<gmm_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
 
-  bench<Action_partial_lu<gmm_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-  
-  bench<Action_hessenberg<gmm_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-  bench<Action_tridiagonalization<gmm_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+  bench<Action_hessenberg<gmm_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  bench<Action_tridiagonalization<gmm_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
 
   return 0;
 }
-
-
diff --git a/bench/btl/libs/mtl4/main.cpp b/bench/btl/libs/mtl4/main.cpp
index 96fcfb9..8629ad8 100644
--- a/bench/btl/libs/mtl4/main.cpp
+++ b/bench/btl/libs/mtl4/main.cpp
@@ -24,23 +24,19 @@
 
 BTL_MAIN;
 
-int main()
-{
+int main() {
+  bench<Action_axpy<mtl4_interface<REAL_TYPE> > >(MIN_AXPY, MAX_AXPY, NB_POINT);
+  bench<Action_axpby<mtl4_interface<REAL_TYPE> > >(MIN_AXPY, MAX_AXPY, NB_POINT);
 
-  bench<Action_axpy<mtl4_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
-  bench<Action_axpby<mtl4_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
+  bench<Action_matrix_vector_product<mtl4_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
+  bench<Action_atv_product<mtl4_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
+  bench<Action_matrix_matrix_product<mtl4_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  //   bench<Action_ata_product<mtl4_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+  //   bench<Action_aat_product<mtl4_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
 
-  bench<Action_matrix_vector_product<mtl4_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
-  bench<Action_atv_product<mtl4_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
-  bench<Action_matrix_matrix_product<mtl4_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-//   bench<Action_ata_product<mtl4_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-//   bench<Action_aat_product<mtl4_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-
-  bench<Action_trisolve<mtl4_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-//   bench<Action_cholesky<mtl4_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-//   bench<Action_lu_decomp<mtl4_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+  bench<Action_trisolve<mtl4_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  //   bench<Action_cholesky<mtl4_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+  //   bench<Action_lu_decomp<mtl4_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
 
   return 0;
 }
-
-
diff --git a/bench/btl/libs/mtl4/mtl4_LU_solve_interface.hh b/bench/btl/libs/mtl4/mtl4_LU_solve_interface.hh
index dcb9f56..955c816 100644
--- a/bench/btl/libs/mtl4/mtl4_LU_solve_interface.hh
+++ b/bench/btl/libs/mtl4/mtl4_LU_solve_interface.hh
@@ -1,14 +1,14 @@
 //=====================================================
 // File   :  blitz_LU_solve_interface.hh
-// Author :  L. Plagne <laurent.plagne@edf.fr)>        
+// Author :  L. Plagne <laurent.plagne@edf.fr)>
 // Copyright (C) EDF R&D,  lun sep 30 14:23:31 CEST 2002
 //=====================================================
-// 
+//
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
 // as published by the Free Software Foundation; either version 2
 // of the License, or (at your option) any later version.
-// 
+//
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -16,7 +16,7 @@
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-// 
+//
 #ifndef BLITZ_LU_SOLVE_INTERFACE_HH
 #define BLITZ_LU_SOLVE_INTERFACE_HH
 
@@ -25,168 +25,136 @@
 
 BZ_USING_NAMESPACE(blitz)
 
-template<class real>
-class blitz_LU_solve_interface : public blitz_interface<real>
-{
-
-public :
-
+template <class real>
+class blitz_LU_solve_interface : public blitz_interface<real> {
+ public:
   typedef typename blitz_interface<real>::gene_matrix gene_matrix;
   typedef typename blitz_interface<real>::gene_vector gene_vector;
 
-  typedef blitz::Array<int,1> Pivot_Vector;
+  typedef blitz::Array<int, 1> Pivot_Vector;
 
-  inline static void new_Pivot_Vector(Pivot_Vector & pivot,int N)
-  {
+  inline static void new_Pivot_Vector(Pivot_Vector &pivot, int N) { pivot.resize(N); }
 
-    pivot.resize(N);
+  inline static void free_Pivot_Vector(Pivot_Vector &pivot) { return; }
 
-  }
+  static inline real matrix_vector_product_sliced(const gene_matrix &A, gene_vector B, int row, int col_start,
+                                                  int col_end) {
+    real somme = 0.;
 
-  inline static void free_Pivot_Vector(Pivot_Vector & pivot)
-  {
-    
-    return;
-
-  }
-
-
-  static inline real matrix_vector_product_sliced(const gene_matrix & A, gene_vector B, int row, int col_start, int col_end)
-  {
-    
-    real somme=0.;
-    
-    for (int j=col_start ; j<col_end+1 ; j++){
-	
-	somme+=A(row,j)*B(j);
-	
+    for (int j = col_start; j < col_end + 1; j++) {
+      somme += A(row, j) * B(j);
     }
 
     return somme;
-
   }
 
+  static inline real matrix_matrix_product_sliced(gene_matrix &A, int row, int col_start, int col_end, gene_matrix &B,
+                                                  int row_shift, int col) {
+    real somme = 0.;
 
-
-
-  static inline real matrix_matrix_product_sliced(gene_matrix & A, int row, int col_start, int col_end, gene_matrix & B, int row_shift, int col )
-  {
-    
-    real somme=0.;
-    
-    for (int j=col_start ; j<col_end+1 ; j++){
-	
-	somme+=A(row,j)*B(j+row_shift,col);
-	
+    for (int j = col_start; j < col_end + 1; j++) {
+      somme += A(row, j) * B(j + row_shift, col);
     }
 
     return somme;
-
   }
 
-  inline static void LU_factor(gene_matrix & LU, Pivot_Vector & pivot, int N)
-  {
-
-    ASSERT( LU.rows()==LU.cols() ) ;
-    int index_max = 0 ;
-    real big = 0. ;
-    real theSum = 0. ;
-    real dum = 0. ;
+  inline static void LU_factor(gene_matrix &LU, Pivot_Vector &pivot, int N) {
+    ASSERT(LU.rows() == LU.cols());
+    int index_max = 0;
+    real big = 0.;
+    real theSum = 0.;
+    real dum = 0.;
     // Get the implicit scaling information :
-    gene_vector ImplicitScaling( N ) ;
-    for( int i=0; i<N; i++ ) {
-      big = 0. ;
-      for( int j=0; j<N; j++ ) {
-	if( abs( LU( i, j ) )>=big ) big = abs( LU( i, j ) ) ;
+    gene_vector ImplicitScaling(N);
+    for (int i = 0; i < N; i++) {
+      big = 0.;
+      for (int j = 0; j < N; j++) {
+        if (abs(LU(i, j)) >= big) big = abs(LU(i, j));
       }
-      if( big==0. ) {
-	INFOS( "blitz_LU_factor::Singular matrix" ) ;
-	exit( 0 ) ;
+      if (big == 0.) {
+        INFOS("blitz_LU_factor::Singular matrix");
+        exit(0);
       }
-      ImplicitScaling( i ) = 1./big ;
+      ImplicitScaling(i) = 1. / big;
     }
     // Loop over columns of Crout's method :
-    for( int j=0; j<N; j++ ) {
-      for( int i=0; i<j; i++ ) {
-	theSum = LU( i, j ) ;
-	theSum -= matrix_matrix_product_sliced(LU, i, 0, i-1, LU, 0, j) ;
-	//	theSum -= sum( LU( i, Range( fromStart, i-1 ) )*LU( Range( fromStart, i-1 ), j ) ) ;
-	LU( i, j ) = theSum ;
+    for (int j = 0; j < N; j++) {
+      for (int i = 0; i < j; i++) {
+        theSum = LU(i, j);
+        theSum -= matrix_matrix_product_sliced(LU, i, 0, i - 1, LU, 0, j);
+        //	theSum -= sum( LU( i, Range( fromStart, i-1 ) )*LU( Range( fromStart, i-1 ), j ) ) ;
+        LU(i, j) = theSum;
       }
-      
+
       // Search for the largest pivot element :
-      big = 0. ;
-      for( int i=j; i<N; i++ ) {
-	theSum = LU( i, j ) ;
-	theSum -= matrix_matrix_product_sliced(LU, i, 0, j-1, LU, 0, j) ;
-	//	theSum -= sum( LU( i, Range( fromStart, j-1 ) )*LU( Range( fromStart, j-1 ), j ) ) ;
-	LU( i, j ) = theSum ;
-	if( (ImplicitScaling( i )*abs( theSum ))>=big ) {
-	  dum = ImplicitScaling( i )*abs( theSum ) ;
-	  big = dum ;
-	  index_max = i ;
-	}
+      big = 0.;
+      for (int i = j; i < N; i++) {
+        theSum = LU(i, j);
+        theSum -= matrix_matrix_product_sliced(LU, i, 0, j - 1, LU, 0, j);
+        //	theSum -= sum( LU( i, Range( fromStart, j-1 ) )*LU( Range( fromStart, j-1 ), j ) ) ;
+        LU(i, j) = theSum;
+        if ((ImplicitScaling(i) * abs(theSum)) >= big) {
+          dum = ImplicitScaling(i) * abs(theSum);
+          big = dum;
+          index_max = i;
+        }
       }
       // Interchanging rows and the scale factor :
-      if( j!=index_max ) {
-	for( int k=0; k<N; k++ ) {
-	  dum = LU( index_max, k ) ;
-	  LU( index_max, k ) = LU( j, k ) ;
-	  LU( j, k ) = dum ;
-	}
-	ImplicitScaling( index_max ) = ImplicitScaling( j ) ;
+      if (j != index_max) {
+        for (int k = 0; k < N; k++) {
+          dum = LU(index_max, k);
+          LU(index_max, k) = LU(j, k);
+          LU(j, k) = dum;
+        }
+        ImplicitScaling(index_max) = ImplicitScaling(j);
       }
-      pivot( j ) = index_max ;
-      if ( LU( j, j )==0. ) LU( j, j ) = 1.e-20 ;
+      pivot(j) = index_max;
+      if (LU(j, j) == 0.) LU(j, j) = 1.e-20;
       // Divide by the pivot element :
-      if( j<N ) {
-	dum = 1./LU( j, j ) ;
-	for( int i=j+1; i<N; i++ ) LU( i, j ) *= dum ;
+      if (j < N) {
+        dum = 1. / LU(j, j);
+        for (int i = j + 1; i < N; i++) LU(i, j) *= dum;
       }
     }
-
   }
 
-  inline static void LU_solve(const gene_matrix & LU, const Pivot_Vector pivot, gene_vector &B, gene_vector X, int N)
-  {
-
+  inline static void LU_solve(const gene_matrix &LU, const Pivot_Vector pivot, gene_vector &B, gene_vector X, int N) {
     // Pour conserver le meme header, on travaille sur X, copie du second-membre B
-    X = B.copy() ;
-    ASSERT( LU.rows()==LU.cols() ) ;
-    firstIndex indI ;
+    X = B.copy();
+    ASSERT(LU.rows() == LU.cols());
+    firstIndex indI;
     // Forward substitution :
-    int ii = 0 ;
-    real theSum = 0. ;
-    for( int i=0; i<N; i++ ) {
-      int ip = pivot( i ) ;
-      theSum = X( ip ) ;
+    int ii = 0;
+    real theSum = 0.;
+    for (int i = 0; i < N; i++) {
+      int ip = pivot(i);
+      theSum = X(ip);
       //      theSum = B( ip ) ;
-      X( ip ) = X( i ) ;
+      X(ip) = X(i);
       //      B( ip ) = B( i ) ;
-      if( ii ) {
-	theSum -= matrix_vector_product_sliced(LU, X, i, ii-1, i-1) ;
-	//	theSum -= sum( LU( i, Range( ii-1, i-1 ) )*X( Range( ii-1, i-1 ) ) ) ;
-	//	theSum -= sum( LU( i, Range( ii-1, i-1 ) )*B( Range( ii-1, i-1 ) ) ) ;
-      } else if( theSum ) {
-	ii = i+1 ;
+      if (ii) {
+        theSum -= matrix_vector_product_sliced(LU, X, i, ii - 1, i - 1);
+        //	theSum -= sum( LU( i, Range( ii-1, i-1 ) )*X( Range( ii-1, i-1 ) ) ) ;
+        //	theSum -= sum( LU( i, Range( ii-1, i-1 ) )*B( Range( ii-1, i-1 ) ) ) ;
+      } else if (theSum) {
+        ii = i + 1;
       }
-      X( i ) = theSum ;
+      X(i) = theSum;
       //      B( i ) = theSum ;
     }
     // Backsubstitution :
-    for( int i=N-1; i>=0; i-- ) {
-      theSum = X( i ) ;
+    for (int i = N - 1; i >= 0; i--) {
+      theSum = X(i);
       //      theSum = B( i ) ;
-      theSum -= matrix_vector_product_sliced(LU, X, i, i+1, N) ;
+      theSum -= matrix_vector_product_sliced(LU, X, i, i + 1, N);
       //      theSum -= sum( LU( i, Range( i+1, toEnd ) )*X( Range( i+1, toEnd ) ) ) ;
       //      theSum -= sum( LU( i, Range( i+1, toEnd ) )*B( Range( i+1, toEnd ) ) ) ;
       // Store a component of the solution vector :
-      X( i ) = theSum/LU( i, i ) ;
+      X(i) = theSum / LU(i, i);
       //      B( i ) = theSum/LU( i, i ) ;
     }
-
   }
-
 };
 
 #endif
diff --git a/bench/btl/libs/mtl4/mtl4_interface.hh b/bench/btl/libs/mtl4/mtl4_interface.hh
index 3795ac6..fa5636f 100644
--- a/bench/btl/libs/mtl4/mtl4_interface.hh
+++ b/bench/btl/libs/mtl4/mtl4_interface.hh
@@ -25,120 +25,100 @@
 
 using namespace mtl;
 
-template<class real>
+template <class real>
 class mtl4_interface {
+ public:
+  typedef real real_type;
 
-public :
-
-  typedef real real_type ;
-
-  typedef std::vector<real>  stl_vector;
-  typedef std::vector<stl_vector > stl_matrix;
+  typedef std::vector<real> stl_vector;
+  typedef std::vector<stl_vector> stl_matrix;
 
   typedef mtl::dense2D<real, mtl::matrix::parameters<mtl::tag::col_major> > gene_matrix;
-  typedef mtl::dense_vector<real>  gene_vector;
+  typedef mtl::dense_vector<real> gene_vector;
 
   static inline std::string name() { return "mtl4"; }
 
-  static void free_matrix(gene_matrix & A, int N){
-    return ;
-  }
+  static void free_matrix(gene_matrix& A, int N) { return; }
 
-  static void free_vector(gene_vector & B){
-    return ;
-  }
+  static void free_vector(gene_vector& B) { return; }
 
-  static inline void matrix_from_stl(gene_matrix & A, stl_matrix & A_stl){
+  static inline void matrix_from_stl(gene_matrix& A, stl_matrix& A_stl) {
     A.change_dim(A_stl[0].size(), A_stl.size());
 
-    for (int j=0; j<A_stl.size() ; j++){
-      for (int i=0; i<A_stl[j].size() ; i++){
-        A(i,j) = A_stl[j][i];
+    for (int j = 0; j < A_stl.size(); j++) {
+      for (int i = 0; i < A_stl[j].size(); i++) {
+        A(i, j) = A_stl[j][i];
       }
     }
   }
 
-  static inline void vector_from_stl(gene_vector & B, stl_vector & B_stl){
+  static inline void vector_from_stl(gene_vector& B, stl_vector& B_stl) {
     B.change_dim(B_stl.size());
-    for (int i=0; i<B_stl.size() ; i++){
+    for (int i = 0; i < B_stl.size(); i++) {
       B[i] = B_stl[i];
     }
   }
 
-  static inline void vector_to_stl(gene_vector & B, stl_vector & B_stl){
-    for (int i=0; i<B_stl.size() ; i++){
+  static inline void vector_to_stl(gene_vector& B, stl_vector& B_stl) {
+    for (int i = 0; i < B_stl.size(); i++) {
       B_stl[i] = B[i];
     }
   }
 
-  static inline void matrix_to_stl(gene_matrix & A, stl_matrix & A_stl){
-    int N=A_stl.size();
-    for (int j=0;j<N;j++){
+  static inline void matrix_to_stl(gene_matrix& A, stl_matrix& A_stl) {
+    int N = A_stl.size();
+    for (int j = 0; j < N; j++) {
       A_stl[j].resize(N);
-      for (int i=0;i<N;i++){
-        A_stl[j][i] = A(i,j);
+      for (int i = 0; i < N; i++) {
+        A_stl[j][i] = A(i, j);
       }
     }
   }
 
-  static inline void matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int N){
-    X = (A*B);
-//     morton_dense<double, doppled_64_row_mask> C(N,N);
-//     C = B;
-//     X = (A*C);
+  static inline void matrix_matrix_product(const gene_matrix& A, const gene_matrix& B, gene_matrix& X, int N) {
+    X = (A * B);
+    //     morton_dense<double, doppled_64_row_mask> C(N,N);
+    //     C = B;
+    //     X = (A*C);
   }
 
-  static inline void transposed_matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int N){
-    X = (trans(A)*trans(B));
+  static inline void transposed_matrix_matrix_product(const gene_matrix& A, const gene_matrix& B, gene_matrix& X,
+                                                      int N) {
+    X = (trans(A) * trans(B));
   }
 
-//   static inline void ata_product(const gene_matrix & A, gene_matrix & X, int N){
-//     X = (trans(A)*A);
-//   }
+  //   static inline void ata_product(const gene_matrix & A, gene_matrix & X, int N){
+  //     X = (trans(A)*A);
+  //   }
 
-  static inline void aat_product(const gene_matrix & A, gene_matrix & X, int N){
-    X = (A*trans(A));
-  }
+  static inline void aat_product(const gene_matrix& A, gene_matrix& X, int N) { X = (A * trans(A)); }
 
-  static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){
-    X = (A*B);
-  }
+  static inline void matrix_vector_product(gene_matrix& A, gene_vector& B, gene_vector& X, int N) { X = (A * B); }
 
-  static inline void atv_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){
-    X = (trans(A)*B);
-  }
+  static inline void atv_product(gene_matrix& A, gene_vector& B, gene_vector& X, int N) { X = (trans(A) * B); }
 
-  static inline void axpy(const real coef, const gene_vector & X, gene_vector & Y, int N){
-    Y += coef * X;
-  }
+  static inline void axpy(const real coef, const gene_vector& X, gene_vector& Y, int N) { Y += coef * X; }
 
-  static inline void axpby(real a, const gene_vector & X, real b, gene_vector & Y, int N){
-    Y = a*X + b*Y;
-  }
+  static inline void axpby(real a, const gene_vector& X, real b, gene_vector& Y, int N) { Y = a * X + b * Y; }
 
-//   static inline void cholesky(const gene_matrix & X, gene_matrix & C, int N){
-//     C = X;
-//     recursive_cholesky(C);
-//   }
+  //   static inline void cholesky(const gene_matrix & X, gene_matrix & C, int N){
+  //     C = X;
+  //     recursive_cholesky(C);
+  //   }
 
-//   static inline void lu_decomp(const gene_matrix & X, gene_matrix & R, int N){
-//     R = X;
-//     std::vector<int> ipvt(N);
-//     lu_factor(R, ipvt);
-//   }
+  //   static inline void lu_decomp(const gene_matrix & X, gene_matrix & R, int N){
+  //     R = X;
+  //     std::vector<int> ipvt(N);
+  //     lu_factor(R, ipvt);
+  //   }
 
-  static inline void trisolve_lower(const gene_matrix & L, const gene_vector& B, gene_vector & X, int N){
+  static inline void trisolve_lower(const gene_matrix& L, const gene_vector& B, gene_vector& X, int N) {
     X = lower_trisolve(L, B);
   }
 
-  static inline void copy_matrix(const gene_matrix & source, gene_matrix & cible, int N){
-    cible = source;
-  }
+  static inline void copy_matrix(const gene_matrix& source, gene_matrix& cible, int N) { cible = source; }
 
-  static inline void copy_vector(const gene_vector & source, gene_vector & cible, int N){
-    cible = source;
-  }
-
+  static inline void copy_vector(const gene_vector& source, gene_vector& cible, int N) { cible = source; }
 };
 
 #endif
diff --git a/bench/btl/libs/tensors/main_linear.cpp b/bench/btl/libs/tensors/main_linear.cpp
index e257f1e..5d99b09 100644
--- a/bench/btl/libs/tensors/main_linear.cpp
+++ b/bench/btl/libs/tensors/main_linear.cpp
@@ -14,10 +14,9 @@
 
 BTL_MAIN;
 
-int main()
-{
-  bench<Action_axpy<tensor_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
-  bench<Action_axpby<tensor_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
+int main() {
+  bench<Action_axpy<tensor_interface<REAL_TYPE> > >(MIN_AXPY, MAX_AXPY, NB_POINT);
+  bench<Action_axpby<tensor_interface<REAL_TYPE> > >(MIN_AXPY, MAX_AXPY, NB_POINT);
 
   return 0;
 }
diff --git a/bench/btl/libs/tensors/main_matmat.cpp b/bench/btl/libs/tensors/main_matmat.cpp
index 675fcfc..f2b80df 100644
--- a/bench/btl/libs/tensors/main_matmat.cpp
+++ b/bench/btl/libs/tensors/main_matmat.cpp
@@ -13,9 +13,8 @@
 
 BTL_MAIN;
 
-int main()
-{
-  bench<Action_matrix_matrix_product<tensor_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+int main() {
+  bench<Action_matrix_matrix_product<tensor_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
 
   return 0;
 }
diff --git a/bench/btl/libs/tensors/main_vecmat.cpp b/bench/btl/libs/tensors/main_vecmat.cpp
index 1af00c8..fae2c55 100644
--- a/bench/btl/libs/tensors/main_vecmat.cpp
+++ b/bench/btl/libs/tensors/main_vecmat.cpp
@@ -13,9 +13,8 @@
 
 BTL_MAIN;
 
-int main()
-{
-  bench<Action_matrix_vector_product<tensor_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
+int main() {
+  bench<Action_matrix_vector_product<tensor_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
 
   return 0;
 }
diff --git a/bench/btl/libs/tensors/tensor_interface.hh b/bench/btl/libs/tensors/tensor_interface.hh
index 97b8e0f..3ff8e94 100644
--- a/bench/btl/libs/tensors/tensor_interface.hh
+++ b/bench/btl/libs/tensors/tensor_interface.hh
@@ -15,89 +15,82 @@
 
 using namespace Eigen;
 
-template<class real>
-class tensor_interface
-{
-public :
+template <class real>
+class tensor_interface {
+ public:
   typedef real real_type;
-  typedef typename Eigen::Tensor<real,2>::Index Index;
+  typedef typename Eigen::Tensor<real, 2>::Index Index;
 
   typedef std::vector<real> stl_vector;
   typedef std::vector<stl_vector> stl_matrix;
 
-  typedef Eigen::Tensor<real,2> gene_matrix;
-  typedef Eigen::Tensor<real,1> gene_vector;
+  typedef Eigen::Tensor<real, 2> gene_matrix;
+  typedef Eigen::Tensor<real, 1> gene_vector;
 
+  static inline std::string name(void) { return EIGEN_MAKESTRING(BTL_PREFIX); }
 
-  static inline std::string name( void )
-  {
-    return EIGEN_MAKESTRING(BTL_PREFIX);
-  }
+  static void free_matrix(gene_matrix& /*A*/, int /*N*/) {}
 
-  static void free_matrix(gene_matrix & /*A*/, int /*N*/) {}
+  static void free_vector(gene_vector& /*B*/) {}
 
-  static void free_vector(gene_vector & /*B*/) {}
+  static BTL_DONT_INLINE void matrix_from_stl(gene_matrix& A, stl_matrix& A_stl) {
+    A.resize(Eigen::array<Index, 2>(A_stl[0].size(), A_stl.size()));
 
-  static BTL_DONT_INLINE void matrix_from_stl(gene_matrix & A, stl_matrix & A_stl){
-    A.resize(Eigen::array<Index,2>(A_stl[0].size(), A_stl.size()));
-
-    for (unsigned int j=0; j<A_stl.size() ; j++){
-      for (unsigned int i=0; i<A_stl[j].size() ; i++){
-        A.coeffRef(Eigen::array<Index,2>(i,j)) = A_stl[j][i];
+    for (unsigned int j = 0; j < A_stl.size(); j++) {
+      for (unsigned int i = 0; i < A_stl[j].size(); i++) {
+        A.coeffRef(Eigen::array<Index, 2>(i, j)) = A_stl[j][i];
       }
     }
   }
 
-  static BTL_DONT_INLINE  void vector_from_stl(gene_vector & B, stl_vector & B_stl){
+  static BTL_DONT_INLINE void vector_from_stl(gene_vector& B, stl_vector& B_stl) {
     B.resize(B_stl.size());
 
-    for (unsigned int i=0; i<B_stl.size() ; i++){
+    for (unsigned int i = 0; i < B_stl.size(); i++) {
       B.coeffRef(i) = B_stl[i];
     }
   }
 
-  static BTL_DONT_INLINE  void vector_to_stl(gene_vector & B, stl_vector & B_stl){
-    for (unsigned int i=0; i<B_stl.size() ; i++){
+  static BTL_DONT_INLINE void vector_to_stl(gene_vector& B, stl_vector& B_stl) {
+    for (unsigned int i = 0; i < B_stl.size(); i++) {
       B_stl[i] = B.coeff(i);
     }
   }
 
-  static BTL_DONT_INLINE  void matrix_to_stl(gene_matrix & A, stl_matrix & A_stl){
-    int  N=A_stl.size();
+  static BTL_DONT_INLINE void matrix_to_stl(gene_matrix& A, stl_matrix& A_stl) {
+    int N = A_stl.size();
 
-    for (int j=0;j<N;j++){
+    for (int j = 0; j < N; j++) {
       A_stl[j].resize(N);
-      for (int i=0;i<N;i++){
-        A_stl[j][i] = A.coeff(Eigen::array<Index,2>(i,j));
+      for (int i = 0; i < N; i++) {
+        A_stl[j][i] = A.coeff(Eigen::array<Index, 2>(i, j));
       }
     }
   }
 
-  static inline void matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int  /*N*/){
+  static inline void matrix_matrix_product(const gene_matrix& A, const gene_matrix& B, gene_matrix& X, int /*N*/) {
     typedef typename Eigen::Tensor<real_type, 1>::DimensionPair DimPair;
     const Eigen::array<DimPair, 1> dims(DimPair(1, 0));
-    X/*.noalias()*/ = A.contract(B, dims);
+    X /*.noalias()*/ = A.contract(B, dims);
   }
 
-  static inline void matrix_vector_product(const gene_matrix & A, const gene_vector & B, gene_vector & X, int  /*N*/){
+  static inline void matrix_vector_product(const gene_matrix& A, const gene_vector& B, gene_vector& X, int /*N*/) {
     typedef typename Eigen::Tensor<real_type, 1>::DimensionPair DimPair;
     const Eigen::array<DimPair, 1> dims(DimPair(1, 0));
-    X/*.noalias()*/ = A.contract(B, dims);
+    X /*.noalias()*/ = A.contract(B, dims);
   }
 
-  static inline void axpy(real coef, const gene_vector & X, gene_vector & Y, int  /*N*/){
-    Y += X.constant(coef) * X;
+  static inline void axpy(real coef, const gene_vector& X, gene_vector& Y, int /*N*/) { Y += X.constant(coef) * X; }
+
+  static inline void axpby(real a, const gene_vector& X, real b, gene_vector& Y, int /*N*/) {
+    Y = X.constant(a) * X + Y.constant(b) * Y;
   }
 
-  static inline void axpby(real a, const gene_vector & X, real b, gene_vector & Y, int  /*N*/){
-    Y = X.constant(a)*X + Y.constant(b)*Y;
-  }
-
-  static EIGEN_DONT_INLINE void copy_matrix(const gene_matrix & source, gene_matrix & cible, int  /*N*/){
+  static EIGEN_DONT_INLINE void copy_matrix(const gene_matrix& source, gene_matrix& cible, int /*N*/) {
     cible = source;
   }
 
-  static EIGEN_DONT_INLINE void copy_vector(const gene_vector & source, gene_vector & cible, int  /*N*/){
+  static EIGEN_DONT_INLINE void copy_vector(const gene_vector& source, gene_vector& cible, int /*N*/) {
     cible = source;
   }
 };
diff --git a/bench/btl/libs/tvmet/main.cpp b/bench/btl/libs/tvmet/main.cpp
index 633215c..aa0f337 100644
--- a/bench/btl/libs/tvmet/main.cpp
+++ b/bench/btl/libs/tvmet/main.cpp
@@ -27,14 +27,11 @@
 
 BTL_MAIN;
 
-int main()
-{
-  bench_static<Action_axpy,tvmet_interface>();
-  bench_static<Action_matrix_matrix_product,tvmet_interface>();
-  bench_static<Action_matrix_vector_product,tvmet_interface>();
-  bench_static<Action_atv_product,tvmet_interface>();
+int main() {
+  bench_static<Action_axpy, tvmet_interface>();
+  bench_static<Action_matrix_matrix_product, tvmet_interface>();
+  bench_static<Action_matrix_vector_product, tvmet_interface>();
+  bench_static<Action_atv_product, tvmet_interface>();
 
   return 0;
 }
-
-
diff --git a/bench/btl/libs/tvmet/tvmet_interface.hh b/bench/btl/libs/tvmet/tvmet_interface.hh
index b441ada..3d12e6c 100644
--- a/bench/btl/libs/tvmet/tvmet_interface.hh
+++ b/bench/btl/libs/tvmet/tvmet_interface.hh
@@ -28,77 +28,59 @@
 
 using namespace tvmet;
 
-template<class real, int SIZE>
-class tvmet_interface{
+template <class real, int SIZE>
+class tvmet_interface {
+ public:
+  typedef real real_type;
 
-public :
+  typedef std::vector<real> stl_vector;
+  typedef std::vector<stl_vector> stl_matrix;
 
-  typedef real real_type ;
-
-  typedef std::vector<real>  stl_vector;
-  typedef std::vector<stl_vector > stl_matrix;
-
-  typedef Vector<real,SIZE> gene_vector;
-  typedef Matrix<real,SIZE,SIZE> gene_matrix;
+  typedef Vector<real, SIZE> gene_vector;
+  typedef Matrix<real, SIZE, SIZE> gene_matrix;
 
   static inline std::string name() { return "tiny_tvmet"; }
 
-  static void free_matrix(gene_matrix & A, int N){}
+  static void free_matrix(gene_matrix& A, int N) {}
 
-  static void free_vector(gene_vector & B){}
+  static void free_vector(gene_vector& B) {}
 
-  static inline void matrix_from_stl(gene_matrix & A, stl_matrix & A_stl){
-    for (int j=0; j<A_stl.size() ; j++)
-      for (int i=0; i<A_stl[j].size() ; i++)
-        A(i,j) = A_stl[j][i];
+  static inline void matrix_from_stl(gene_matrix& A, stl_matrix& A_stl) {
+    for (int j = 0; j < A_stl.size(); j++)
+      for (int i = 0; i < A_stl[j].size(); i++) A(i, j) = A_stl[j][i];
   }
 
-  static inline void vector_from_stl(gene_vector & B, stl_vector & B_stl){
-    for (int i=0; i<B_stl.size() ; i++)
-      B[i]=B_stl[i];
+  static inline void vector_from_stl(gene_vector& B, stl_vector& B_stl) {
+    for (int i = 0; i < B_stl.size(); i++) B[i] = B_stl[i];
   }
 
-  static inline void vector_to_stl(gene_vector & B, stl_vector & B_stl){
-    for (int i=0; i<B_stl.size() ; i++){
-      B_stl[i]=B[i];
+  static inline void vector_to_stl(gene_vector& B, stl_vector& B_stl) {
+    for (int i = 0; i < B_stl.size(); i++) {
+      B_stl[i] = B[i];
     }
   }
 
-  static inline void matrix_to_stl(gene_matrix & A, stl_matrix & A_stl){
+  static inline void matrix_to_stl(gene_matrix& A, stl_matrix& A_stl) {
     int N = A_stl.size();
-    for (int j=0;j<N;j++){
+    for (int j = 0; j < N; j++) {
       A_stl[j].resize(N);
-      for (int i=0;i<N;i++)
-        A_stl[j][i] = A(i,j);
+      for (int i = 0; i < N; i++) A_stl[j][i] = A(i, j);
     }
   }
 
+  static inline void copy_matrix(const gene_matrix& source, gene_matrix& cible, int N) { cible = source; }
 
-  static inline void copy_matrix(const gene_matrix & source, gene_matrix & cible, int N){
-    cible = source;
+  static inline void copy_vector(const gene_vector& source, gene_vector& cible, int N) { cible = source; }
+
+  static inline void matrix_matrix_product(const gene_matrix& A, const gene_matrix& B, gene_matrix& X, int N) {
+    X = prod(A, B);
   }
 
-  static inline void copy_vector(const gene_vector & source, gene_vector & cible, int N){
-    cible = source;
-  }
+  static inline void matrix_vector_product(gene_matrix& A, gene_vector& B, gene_vector& X, int N) { X = prod(A, B); }
 
-  static inline void matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int N){
-    X = prod(A,B);
-  }
+  static inline void atv_product(gene_matrix& A, gene_vector& B, gene_vector& X, int N) { X = prod(trans(A), B); }
 
-  static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){
-    X = prod(A,B);
-  }
-
-  static inline void atv_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){
-    X = prod(trans(A),B);
-  }
-
-  static inline void axpy(const real coef, const gene_vector & X, gene_vector & Y, int N){
-    Y+=coef*X;
-  }
-
+  static inline void axpy(const real coef, const gene_vector& X, gene_vector& Y, int N) { Y += coef * X; }
 };
 
-
 #endif
diff --git a/bench/btl/libs/ublas/main.cpp b/bench/btl/libs/ublas/main.cpp
index e2e77ee..bd135f3 100644
--- a/bench/btl/libs/ublas/main.cpp
+++ b/bench/btl/libs/ublas/main.cpp
@@ -24,21 +24,18 @@
 
 BTL_MAIN;
 
-int main()
-{
-  bench<Action_axpy<ublas_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
-  bench<Action_axpby<ublas_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
+int main() {
+  bench<Action_axpy<ublas_interface<REAL_TYPE> > >(MIN_AXPY, MAX_AXPY, NB_POINT);
+  bench<Action_axpby<ublas_interface<REAL_TYPE> > >(MIN_AXPY, MAX_AXPY, NB_POINT);
 
-  bench<Action_matrix_vector_product<ublas_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
-  bench<Action_atv_product<ublas_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
+  bench<Action_matrix_vector_product<ublas_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
+  bench<Action_atv_product<ublas_interface<REAL_TYPE> > >(MIN_MV, MAX_MV, NB_POINT);
 
-  bench<Action_matrix_matrix_product<ublas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-//   bench<Action_ata_product<ublas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-//   bench<Action_aat_product<ublas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+  bench<Action_matrix_matrix_product<ublas_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
+  //   bench<Action_ata_product<ublas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+  //   bench<Action_aat_product<ublas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
 
-  bench<Action_trisolve<ublas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+  bench<Action_trisolve<ublas_interface<REAL_TYPE> > >(MIN_MM, MAX_MM, NB_POINT);
 
   return 0;
 }
-
-
diff --git a/bench/btl/libs/ublas/ublas_interface.hh b/bench/btl/libs/ublas/ublas_interface.hh
index f59b7cf..3b7105c 100644
--- a/bench/btl/libs/ublas/ublas_interface.hh
+++ b/bench/btl/libs/ublas/ublas_interface.hh
@@ -28,114 +28,98 @@
 using namespace boost::numeric;
 
 template <class real>
-class ublas_interface{
-
-public :
-
-  typedef real real_type ;
+class ublas_interface {
+ public:
+  typedef real real_type;
 
   typedef std::vector<real> stl_vector;
   typedef std::vector<stl_vector> stl_matrix;
 
-  typedef typename boost::numeric::ublas::matrix<real,boost::numeric::ublas::column_major> gene_matrix;
+  typedef typename boost::numeric::ublas::matrix<real, boost::numeric::ublas::column_major> gene_matrix;
   typedef typename boost::numeric::ublas::vector<real> gene_vector;
 
-  static inline std::string name( void ) { return "ublas"; }
+  static inline std::string name(void) { return "ublas"; }
 
-  static void free_matrix(gene_matrix & A, int N) {}
+  static void free_matrix(gene_matrix& A, int N) {}
 
-  static void free_vector(gene_vector & B) {}
+  static void free_vector(gene_vector& B) {}
 
-  static inline void matrix_from_stl(gene_matrix & A, stl_matrix & A_stl){
-    A.resize(A_stl.size(),A_stl[0].size());
-    for (int j=0; j<A_stl.size() ; j++)
-      for (int i=0; i<A_stl[j].size() ; i++)
-        A(i,j)=A_stl[j][i];
+  static inline void matrix_from_stl(gene_matrix& A, stl_matrix& A_stl) {
+    A.resize(A_stl.size(), A_stl[0].size());
+    for (int j = 0; j < A_stl.size(); j++)
+      for (int i = 0; i < A_stl[j].size(); i++) A(i, j) = A_stl[j][i];
   }
 
-  static inline void vector_from_stl(gene_vector & B, stl_vector & B_stl){
+  static inline void vector_from_stl(gene_vector& B, stl_vector& B_stl) {
     B.resize(B_stl.size());
-    for (int i=0; i<B_stl.size() ; i++)
-      B(i)=B_stl[i];
+    for (int i = 0; i < B_stl.size(); i++) B(i) = B_stl[i];
   }
 
-  static inline void vector_to_stl(gene_vector & B, stl_vector & B_stl){
-    for (int i=0; i<B_stl.size() ; i++)
-      B_stl[i]=B(i);
+  static inline void vector_to_stl(gene_vector& B, stl_vector& B_stl) {
+    for (int i = 0; i < B_stl.size(); i++) B_stl[i] = B(i);
   }
 
-  static inline void matrix_to_stl(gene_matrix & A, stl_matrix & A_stl){
-    int N=A_stl.size();
-    for (int j=0;j<N;j++)
-    {
+  static inline void matrix_to_stl(gene_matrix& A, stl_matrix& A_stl) {
+    int N = A_stl.size();
+    for (int j = 0; j < N; j++) {
       A_stl[j].resize(N);
-      for (int i=0;i<N;i++)
-        A_stl[j][i]=A(i,j);
+      for (int i = 0; i < N; i++) A_stl[j][i] = A(i, j);
     }
   }
 
-  static inline void copy_vector(const gene_vector & source, gene_vector & cible, int N){
-    for (int i=0;i<N;i++){
+  static inline void copy_vector(const gene_vector& source, gene_vector& cible, int N) {
+    for (int i = 0; i < N; i++) {
       cible(i) = source(i);
     }
   }
 
-  static inline void copy_matrix(const gene_matrix & source, gene_matrix & cible, int N){
-    for (int i=0;i<N;i++){
-      for (int j=0;j<N;j++){
-        cible(i,j) = source(i,j);
+  static inline void copy_matrix(const gene_matrix& source, gene_matrix& cible, int N) {
+    for (int i = 0; i < N; i++) {
+      for (int j = 0; j < N; j++) {
+        cible(i, j) = source(i, j);
       }
     }
   }
 
-  static inline void matrix_vector_product_slow(gene_matrix & A, gene_vector & B, gene_vector & X, int N){
-    X =  prod(A,B);
+  static inline void matrix_vector_product_slow(gene_matrix& A, gene_vector& B, gene_vector& X, int N) {
+    X = prod(A, B);
   }
 
-  static inline void matrix_matrix_product_slow(gene_matrix & A, gene_matrix & B, gene_matrix & X, int N){
-    X =  prod(A,B);
+  static inline void matrix_matrix_product_slow(gene_matrix& A, gene_matrix& B, gene_matrix& X, int N) {
+    X = prod(A, B);
   }
 
-  static inline void axpy_slow(const real coef, const gene_vector & X, gene_vector & Y, int N){
-    Y+=coef*X;
-  }
+  static inline void axpy_slow(const real coef, const gene_vector& X, gene_vector& Y, int N) { Y += coef * X; }
 
   // alias free assignments
 
-  static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){
-    X.assign(prod(A,B));
+  static inline void matrix_vector_product(gene_matrix& A, gene_vector& B, gene_vector& X, int N) {
+    X.assign(prod(A, B));
   }
 
-  static inline void atv_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){
-    X.assign(prod(trans(A),B));
+  static inline void atv_product(gene_matrix& A, gene_vector& B, gene_vector& X, int N) { X.assign(prod(trans(A), B)); }
+
+  static inline void matrix_matrix_product(gene_matrix& A, gene_matrix& B, gene_matrix& X, int N) {
+    X.assign(prod(A, B));
   }
 
-  static inline void matrix_matrix_product(gene_matrix & A, gene_matrix & B, gene_matrix & X, int N){
-    X.assign(prod(A,B));
-  }
+  static inline void axpy(const real coef, const gene_vector& X, gene_vector& Y, int N) { Y.plus_assign(coef * X); }
 
-  static inline void axpy(const real coef, const gene_vector & X, gene_vector & Y, int N){
-    Y.plus_assign(coef*X);
-  }
+  static inline void axpby(real a, const gene_vector& X, real b, gene_vector& Y, int N) { Y = a * X + b * Y; }
 
-  static inline void axpby(real a, const gene_vector & X, real b, gene_vector & Y, int N){
-    Y = a*X + b*Y;
-  }
-
-  static inline void ata_product(gene_matrix & A, gene_matrix & X, int N){
+  static inline void ata_product(gene_matrix& A, gene_matrix& X, int N) {
     // X =  prod(trans(A),A);
-    X.assign(prod(trans(A),A));
+    X.assign(prod(trans(A), A));
   }
 
-  static inline void aat_product(gene_matrix & A, gene_matrix & X, int N){
+  static inline void aat_product(gene_matrix& A, gene_matrix& X, int N) {
     // X =  prod(A,trans(A));
-    X.assign(prod(A,trans(A)));
+    X.assign(prod(A, trans(A)));
   }
 
-  static inline void trisolve_lower(const gene_matrix & L, const gene_vector& B, gene_vector & X, int N){
-    X = solve(L, B, ublas::lower_tag ());
+  static inline void trisolve_lower(const gene_matrix& L, const gene_vector& B, gene_vector& X, int N) {
+    X = solve(L, B, ublas::lower_tag());
   }
-
 };
 
 #endif
diff --git a/bench/check_cache_queries.cpp b/bench/check_cache_queries.cpp
index 029d44c..eab1c7a 100644
--- a/bench/check_cache_queries.cpp
+++ b/bench/check_cache_queries.cpp
@@ -6,31 +6,30 @@
 using namespace Eigen;
 using namespace std;
 
-#define DUMP_CPUID(CODE) {\
-  int abcd[4]; \
-  abcd[0] = abcd[1] = abcd[2] = abcd[3] = 0;\
-  EIGEN_CPUID(abcd, CODE, 0); \
-  std::cout << "The code " << CODE << " gives " \
-              << (int*)(abcd[0]) << " " << (int*)(abcd[1]) << " " \
-              << (int*)(abcd[2]) << " " << (int*)(abcd[3]) << " " << std::endl; \
+#define DUMP_CPUID(CODE)                                                                              \
+  {                                                                                                   \
+    int abcd[4];                                                                                      \
+    abcd[0] = abcd[1] = abcd[2] = abcd[3] = 0;                                                        \
+    EIGEN_CPUID(abcd, CODE, 0);                                                                       \
+    std::cout << "The code " << CODE << " gives " << (int*)(abcd[0]) << " " << (int*)(abcd[1]) << " " \
+              << (int*)(abcd[2]) << " " << (int*)(abcd[3]) << " " << std::endl;                       \
   }
-  
-int main()
-{
+
+int main() {
   cout << "Eigen's L1    = " << internal::queryL1CacheSize() << endl;
   cout << "Eigen's L2/L3 = " << internal::queryTopLevelCacheSize() << endl;
   int l1, l2, l3;
   internal::queryCacheSizes(l1, l2, l3);
   cout << "Eigen's L1, L2, L3       = " << l1 << " " << l2 << " " << l3 << endl;
-  
-  #ifdef EIGEN_CPUID
+
+#ifdef EIGEN_CPUID
 
   int abcd[4];
   int string[8];
   char* string_char = (char*)(string);
 
   // vendor ID
-  EIGEN_CPUID(abcd,0x0,0);
+  EIGEN_CPUID(abcd, 0x0, 0);
   string[0] = abcd[1];
   string[1] = abcd[3];
   string[2] = abcd[2];
@@ -42,32 +41,30 @@
 
   internal::queryCacheSizes_intel_codes(l1, l2, l3);
   cout << "Eigen's intel codes L1, L2, L3 = " << l1 << " " << l2 << " " << l3 << endl;
-  if(max_funcs>=4)
-  {
+  if (max_funcs >= 4) {
     internal::queryCacheSizes_intel_direct(l1, l2, l3);
     cout << "Eigen's intel direct L1, L2, L3 = " << l1 << " " << l2 << " " << l3 << endl;
   }
   internal::queryCacheSizes_amd(l1, l2, l3);
   cout << "Eigen's amd L1, L2, L3         = " << l1 << " " << l2 << " " << l3 << endl;
   cout << endl;
-  
+
   // dump Intel direct method
-  if(max_funcs>=4)
-  {
+  if (max_funcs >= 4) {
     l1 = l2 = l3 = 0;
     int cache_id = 0;
     int cache_type = 0;
     do {
       abcd[0] = abcd[1] = abcd[2] = abcd[3] = 0;
-      EIGEN_CPUID(abcd,0x4,cache_id);
-      cache_type  = (abcd[0] & 0x0F) >> 0;
-      int cache_level = (abcd[0] & 0xE0) >> 5;  // A[7:5]
-      int ways        = (abcd[1] & 0xFFC00000) >> 22; // B[31:22]
-      int partitions  = (abcd[1] & 0x003FF000) >> 12; // B[21:12]
-      int line_size   = (abcd[1] & 0x00000FFF) >>  0; // B[11:0]
-      int sets        = (abcd[2]);                    // C[31:0]
-      int cache_size = (ways+1) * (partitions+1) * (line_size+1) * (sets+1);
-      
+      EIGEN_CPUID(abcd, 0x4, cache_id);
+      cache_type = (abcd[0] & 0x0F) >> 0;
+      int cache_level = (abcd[0] & 0xE0) >> 5;        // A[7:5]
+      int ways = (abcd[1] & 0xFFC00000) >> 22;        // B[31:22]
+      int partitions = (abcd[1] & 0x003FF000) >> 12;  // B[21:12]
+      int line_size = (abcd[1] & 0x00000FFF) >> 0;    // B[11:0]
+      int sets = (abcd[2]);                           // C[31:0]
+      int cache_size = (ways + 1) * (partitions + 1) * (line_size + 1) * (sets + 1);
+
       cout << "cache[" << cache_id << "].type       = " << cache_type << "\n";
       cout << "cache[" << cache_id << "].level      = " << cache_level << "\n";
       cout << "cache[" << cache_id << "].ways       = " << ways << "\n";
@@ -75,15 +72,14 @@
       cout << "cache[" << cache_id << "].line_size  = " << line_size << "\n";
       cout << "cache[" << cache_id << "].sets       = " << sets << "\n";
       cout << "cache[" << cache_id << "].size       = " << cache_size << "\n";
-      
+
       cache_id++;
-    } while(cache_type>0 && cache_id<16);
+    } while (cache_type > 0 && cache_id < 16);
   }
-  
+
   // dump everything
-  std::cout << endl <<"Raw dump:" << endl;
-  for(int i=0; i<max_funcs; ++i)
-    DUMP_CPUID(i);
+  std::cout << endl << "Raw dump:" << endl;
+  for (int i = 0; i < max_funcs; ++i) DUMP_CPUID(i);
 
   DUMP_CPUID(0x80000000);
   DUMP_CPUID(0x80000001);
@@ -94,8 +90,8 @@
   DUMP_CPUID(0x80000006);
   DUMP_CPUID(0x80000007);
   DUMP_CPUID(0x80000008);
-  #else
+#else
   cout << "EIGEN_CPUID is not defined" << endl;
-  #endif
+#endif
   return 0;
 }
diff --git a/bench/dense_solvers.cpp b/bench/dense_solvers.cpp
index 11c755b..ef9ecb7 100644
--- a/bench/dense_solvers.cpp
+++ b/bench/dense_solvers.cpp
@@ -7,68 +7,62 @@
 #include <sstream>
 using namespace Eigen;
 
-std::map<std::string,Array<float,1,8,DontAlign|RowMajor> > results;
+std::map<std::string, Array<float, 1, 8, DontAlign | RowMajor> > results;
 std::vector<std::string> labels;
 std::vector<Array2i> sizes;
 
-template<typename Solver,typename MatrixType>
-EIGEN_DONT_INLINE
-void compute_norm_equation(Solver &solver, const MatrixType &A) {
-  if(A.rows()!=A.cols())
-    solver.compute(A.transpose()*A);
+template <typename Solver, typename MatrixType>
+EIGEN_DONT_INLINE void compute_norm_equation(Solver &solver, const MatrixType &A) {
+  if (A.rows() != A.cols())
+    solver.compute(A.transpose() * A);
   else
     solver.compute(A);
 }
 
-template<typename Solver,typename MatrixType>
-EIGEN_DONT_INLINE
-void compute(Solver &solver, const MatrixType &A) {
+template <typename Solver, typename MatrixType>
+EIGEN_DONT_INLINE void compute(Solver &solver, const MatrixType &A) {
   solver.compute(A);
 }
 
-template<typename Scalar,int Size>
-void bench(int id, int rows, int size = Size)
-{
-  typedef Matrix<Scalar,Dynamic,Size> Mat;
-  typedef Matrix<Scalar,Dynamic,Dynamic> MatDyn;
-  typedef Matrix<Scalar,Size,Size> MatSquare;
-  Mat A(rows,size);
+template <typename Scalar, int Size>
+void bench(int id, int rows, int size = Size) {
+  typedef Matrix<Scalar, Dynamic, Size> Mat;
+  typedef Matrix<Scalar, Dynamic, Dynamic> MatDyn;
+  typedef Matrix<Scalar, Size, Size> MatSquare;
+  Mat A(rows, size);
   A.setRandom();
-  if(rows==size)
-    A = A*A.adjoint();
+  if (rows == size) A = A * A.adjoint();
   BenchTimer t_llt, t_ldlt, t_lu, t_fplu, t_qr, t_cpqr, t_cod, t_fpqr, t_jsvd, t_bdcsvd;
 
   int tries = 5;
-  int rep = 1000/size;
-  if(rep==0) rep = 1;
-//   rep = rep*rep;
-  
+  int rep = 1000 / size;
+  if (rep == 0) rep = 1;
+  //   rep = rep*rep;
+
   LLT<MatSquare> llt(size);
   LDLT<MatSquare> ldlt(size);
   PartialPivLU<MatSquare> lu(size);
-  FullPivLU<MatSquare> fplu(size,size);
-  HouseholderQR<Mat> qr(A.rows(),A.cols());
-  ColPivHouseholderQR<Mat> cpqr(A.rows(),A.cols());
-  CompleteOrthogonalDecomposition<Mat> cod(A.rows(),A.cols());
-  FullPivHouseholderQR<Mat> fpqr(A.rows(),A.cols());
-  JacobiSVD<MatDyn, ComputeThinU|ComputeThinV> jsvd(A.rows(),A.cols());
-  BDCSVD<MatDyn, ComputeThinU|ComputeThinV> bdcsvd(A.rows(),A.cols());
-  
-  BENCH(t_llt, tries, rep, compute_norm_equation(llt,A));
-  BENCH(t_ldlt, tries, rep, compute_norm_equation(ldlt,A));
-  BENCH(t_lu, tries, rep, compute_norm_equation(lu,A));
-  if(size<=1000)
-    BENCH(t_fplu, tries, rep, compute_norm_equation(fplu,A));
-  BENCH(t_qr, tries, rep, compute(qr,A));
-  BENCH(t_cpqr, tries, rep, compute(cpqr,A));
-  BENCH(t_cod, tries, rep, compute(cod,A));
-  if(size*rows<=10000000)
-    BENCH(t_fpqr, tries, rep, compute(fpqr,A));
-  if(size<500) // JacobiSVD is really too slow for too large matrices
+  FullPivLU<MatSquare> fplu(size, size);
+  HouseholderQR<Mat> qr(A.rows(), A.cols());
+  ColPivHouseholderQR<Mat> cpqr(A.rows(), A.cols());
+  CompleteOrthogonalDecomposition<Mat> cod(A.rows(), A.cols());
+  FullPivHouseholderQR<Mat> fpqr(A.rows(), A.cols());
+  JacobiSVD<MatDyn, ComputeThinU | ComputeThinV> jsvd(A.rows(), A.cols());
+  BDCSVD<MatDyn, ComputeThinU | ComputeThinV> bdcsvd(A.rows(), A.cols());
+
+  BENCH(t_llt, tries, rep, compute_norm_equation(llt, A));
+  BENCH(t_ldlt, tries, rep, compute_norm_equation(ldlt, A));
+  BENCH(t_lu, tries, rep, compute_norm_equation(lu, A));
+  if (size <= 1000) BENCH(t_fplu, tries, rep, compute_norm_equation(fplu, A));
+  BENCH(t_qr, tries, rep, compute(qr, A));
+  BENCH(t_cpqr, tries, rep, compute(cpqr, A));
+  BENCH(t_cod, tries, rep, compute(cod, A));
+  if (size * rows <= 10000000) BENCH(t_fpqr, tries, rep, compute(fpqr, A));
+  if (size < 500)  // JacobiSVD is really too slow for too large matrices
     BENCH(t_jsvd, tries, rep, jsvd.compute(A));
-//   if(size*rows<=20000000)
-    BENCH(t_bdcsvd, tries, rep, bdcsvd.compute(A));
-  
+  //   if(size*rows<=20000000)
+  BENCH(t_bdcsvd, tries, rep, bdcsvd.compute(A));
+
   results["LLT"][id] = t_llt.best();
   results["LDLT"][id] = t_ldlt.best();
   results["PartialPivLU"][id] = t_lu.best();
@@ -81,9 +75,7 @@
   results["BDCSVD"][id] = t_bdcsvd.best();
 }
 
-
-int main()
-{
+int main() {
   labels.push_back("LLT");
   labels.push_back("LDLT");
   labels.push_back("PartialPivLU");
@@ -95,48 +87,48 @@
   labels.push_back("JacobiSVD");
   labels.push_back("BDCSVD");
 
-  for(int i=0; i<labels.size(); ++i)
-    results[labels[i]].fill(-1);
+  for (int i = 0; i < labels.size(); ++i) results[labels[i]].fill(-1);
 
   const int small = 8;
-  sizes.push_back(Array2i(small,small));
-  sizes.push_back(Array2i(100,100));
-  sizes.push_back(Array2i(1000,1000));
-  sizes.push_back(Array2i(4000,4000));
-  sizes.push_back(Array2i(10000,small));
-  sizes.push_back(Array2i(10000,100));
-  sizes.push_back(Array2i(10000,1000));
-  sizes.push_back(Array2i(10000,4000));
+  sizes.push_back(Array2i(small, small));
+  sizes.push_back(Array2i(100, 100));
+  sizes.push_back(Array2i(1000, 1000));
+  sizes.push_back(Array2i(4000, 4000));
+  sizes.push_back(Array2i(10000, small));
+  sizes.push_back(Array2i(10000, 100));
+  sizes.push_back(Array2i(10000, 1000));
+  sizes.push_back(Array2i(10000, 4000));
 
   using namespace std;
 
-  for(int k=0; k<sizes.size(); ++k)
-  {
+  for (int k = 0; k < sizes.size(); ++k) {
     cout << sizes[k](0) << "x" << sizes[k](1) << "...\n";
-    bench<float,Dynamic>(k,sizes[k](0),sizes[k](1));
+    bench<float, Dynamic>(k, sizes[k](0), sizes[k](1));
   }
 
   cout.width(32);
   cout << "solver/size";
   cout << "  ";
-  for(int k=0; k<sizes.size(); ++k)
-  {
+  for (int k = 0; k < sizes.size(); ++k) {
     std::stringstream ss;
     ss << sizes[k](0) << "x" << sizes[k](1);
-    cout.width(10); cout << ss.str(); cout << " ";
+    cout.width(10);
+    cout << ss.str();
+    cout << " ";
   }
   cout << endl;
 
-
-  for(int i=0; i<labels.size(); ++i)
-  {
-    cout.width(32); cout << labels[i]; cout << "  ";
-    ArrayXf r = (results[labels[i]]*100000.f).floor()/100.f;
-    for(int k=0; k<sizes.size(); ++k)
-    {
+  for (int i = 0; i < labels.size(); ++i) {
+    cout.width(32);
+    cout << labels[i];
+    cout << "  ";
+    ArrayXf r = (results[labels[i]] * 100000.f).floor() / 100.f;
+    for (int k = 0; k < sizes.size(); ++k) {
       cout.width(10);
-      if(r(k)>=1e6)  cout << "-";
-      else           cout << r(k);
+      if (r(k) >= 1e6)
+        cout << "-";
+      else
+        cout << r(k);
       cout << " ";
     }
     cout << endl;
@@ -145,25 +137,20 @@
   // HTML output
   cout << "<table class=\"manual\">" << endl;
   cout << "<tr><th>solver/size</th>" << endl;
-  for(int k=0; k<sizes.size(); ++k)
-    cout << "  <th>" << sizes[k](0) << "x" << sizes[k](1) << "</th>";
+  for (int k = 0; k < sizes.size(); ++k) cout << "  <th>" << sizes[k](0) << "x" << sizes[k](1) << "</th>";
   cout << "</tr>" << endl;
-  for(int i=0; i<labels.size(); ++i)
-  {
+  for (int i = 0; i < labels.size(); ++i) {
     cout << "<tr";
-    if(i%2==1) cout << " class=\"alt\"";
+    if (i % 2 == 1) cout << " class=\"alt\"";
     cout << "><td>" << labels[i] << "</td>";
-    ArrayXf r = (results[labels[i]]*100000.f).floor()/100.f;
-    for(int k=0; k<sizes.size(); ++k)
-    {
-      if(r(k)>=1e6) cout << "<td>-</td>";
-      else
-      {
+    ArrayXf r = (results[labels[i]] * 100000.f).floor() / 100.f;
+    for (int k = 0; k < sizes.size(); ++k) {
+      if (r(k) >= 1e6)
+        cout << "<td>-</td>";
+      else {
         cout << "<td>" << r(k);
-        if(i>0)
-          cout << " (x" << numext::round(10.f*results[labels[i]](k)/results["LLT"](k))/10.f << ")";
-        if(i<4 && sizes[k](0)!=sizes[k](1))
-          cout << " <sup><a href=\"#note_ls\">*</a></sup>";
+        if (i > 0) cout << " (x" << numext::round(10.f * results[labels[i]](k) / results["LLT"](k)) / 10.f << ")";
+        if (i < 4 && sizes[k](0) != sizes[k](1)) cout << " <sup><a href=\"#note_ls\">*</a></sup>";
         cout << "</td>";
       }
     }
@@ -171,14 +158,15 @@
   }
   cout << "</table>" << endl;
 
-//   cout << "LLT                             (ms)  " << (results["LLT"]*1000.).format(fmt) << "\n";
-//   cout << "LDLT                             (%)  " << (results["LDLT"]/results["LLT"]).format(fmt) << "\n";
-//   cout << "PartialPivLU                     (%)  " << (results["PartialPivLU"]/results["LLT"]).format(fmt) << "\n";
-//   cout << "FullPivLU                        (%)  " << (results["FullPivLU"]/results["LLT"]).format(fmt) << "\n";
-//   cout << "HouseholderQR                    (%)  " << (results["HouseholderQR"]/results["LLT"]).format(fmt) << "\n";
-//   cout << "ColPivHouseholderQR              (%)  " << (results["ColPivHouseholderQR"]/results["LLT"]).format(fmt) << "\n";
-//   cout << "CompleteOrthogonalDecomposition  (%)  " << (results["CompleteOrthogonalDecomposition"]/results["LLT"]).format(fmt) << "\n";
-//   cout << "FullPivHouseholderQR             (%)  " << (results["FullPivHouseholderQR"]/results["LLT"]).format(fmt) << "\n";
-//   cout << "JacobiSVD                        (%)  " << (results["JacobiSVD"]/results["LLT"]).format(fmt) << "\n";
-//   cout << "BDCSVD                           (%)  " << (results["BDCSVD"]/results["LLT"]).format(fmt) << "\n";
+  //   cout << "LLT                             (ms)  " << (results["LLT"]*1000.).format(fmt) << "\n";
+  //   cout << "LDLT                             (%)  " << (results["LDLT"]/results["LLT"]).format(fmt) << "\n";
+  //   cout << "PartialPivLU                     (%)  " << (results["PartialPivLU"]/results["LLT"]).format(fmt) << "\n";
+  //   cout << "FullPivLU                        (%)  " << (results["FullPivLU"]/results["LLT"]).format(fmt) << "\n";
+  //   cout << "HouseholderQR                    (%)  " << (results["HouseholderQR"]/results["LLT"]).format(fmt) <<
+  //   "\n"; cout << "ColPivHouseholderQR              (%)  " <<
+  //   (results["ColPivHouseholderQR"]/results["LLT"]).format(fmt) << "\n"; cout << "CompleteOrthogonalDecomposition (%)
+  //   " << (results["CompleteOrthogonalDecomposition"]/results["LLT"]).format(fmt) << "\n"; cout <<
+  //   "FullPivHouseholderQR             (%)  " << (results["FullPivHouseholderQR"]/results["LLT"]).format(fmt) << "\n";
+  //   cout << "JacobiSVD                        (%)  " << (results["JacobiSVD"]/results["LLT"]).format(fmt) << "\n";
+  //   cout << "BDCSVD                           (%)  " << (results["BDCSVD"]/results["LLT"]).format(fmt) << "\n";
 }
diff --git a/bench/eig33.cpp b/bench/eig33.cpp
index f003d8a..25df142 100644
--- a/bench/eig33.cpp
+++ b/bench/eig33.cpp
@@ -9,25 +9,25 @@
 
 // The computeRoots function included in this is based on materials
 // covered by the following copyright and license:
-// 
+//
 // Geometric Tools, LLC
 // Copyright (c) 1998-2010
 // Distributed under the Boost Software License, Version 1.0.
-// 
+//
 // Permission is hereby granted, free of charge, to any person or organization
 // obtaining a copy of the software and accompanying documentation covered by
 // this license (the "Software") to use, reproduce, display, distribute,
 // execute, and transmit the Software, and to prepare derivative works of the
 // Software, and to permit third-parties to whom the Software is furnished to
 // do so, all subject to the following:
-// 
+//
 // The copyright notices in the Software and this entire statement, including
 // the above license grant, this restriction and the following disclaimer,
 // must be included in all copies of the Software, in whole or in part, and
 // all derivative works of the Software, unless such copies or derivative
 // works are solely in the form of machine-executable object code generated by
 // a source language processor.
-// 
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
@@ -45,151 +45,145 @@
 using namespace Eigen;
 using namespace std;
 
-template<typename Matrix, typename Roots>
-inline void computeRoots(const Matrix& m, Roots& roots)
-{
+template <typename Matrix, typename Roots>
+inline void computeRoots(const Matrix& m, Roots& roots) {
   typedef typename Matrix::Scalar Scalar;
-  const Scalar s_inv3 = 1.0/3.0;
+  const Scalar s_inv3 = 1.0 / 3.0;
   const Scalar s_sqrt3 = std::sqrt(Scalar(3.0));
 
   // The characteristic equation is x^3 - c2*x^2 + c1*x - c0 = 0.  The
   // eigenvalues are the roots to this equation, all guaranteed to be
   // real-valued, because the matrix is symmetric.
-  Scalar c0 = m(0,0)*m(1,1)*m(2,2) + Scalar(2)*m(0,1)*m(0,2)*m(1,2) - m(0,0)*m(1,2)*m(1,2) - m(1,1)*m(0,2)*m(0,2) - m(2,2)*m(0,1)*m(0,1);
-  Scalar c1 = m(0,0)*m(1,1) - m(0,1)*m(0,1) + m(0,0)*m(2,2) - m(0,2)*m(0,2) + m(1,1)*m(2,2) - m(1,2)*m(1,2);
-  Scalar c2 = m(0,0) + m(1,1) + m(2,2);
+  Scalar c0 = m(0, 0) * m(1, 1) * m(2, 2) + Scalar(2) * m(0, 1) * m(0, 2) * m(1, 2) - m(0, 0) * m(1, 2) * m(1, 2) -
+              m(1, 1) * m(0, 2) * m(0, 2) - m(2, 2) * m(0, 1) * m(0, 1);
+  Scalar c1 = m(0, 0) * m(1, 1) - m(0, 1) * m(0, 1) + m(0, 0) * m(2, 2) - m(0, 2) * m(0, 2) + m(1, 1) * m(2, 2) -
+              m(1, 2) * m(1, 2);
+  Scalar c2 = m(0, 0) + m(1, 1) + m(2, 2);
 
   // Construct the parameters used in classifying the roots of the equation
   // and in solving the equation for the roots in closed form.
-  Scalar c2_over_3 = c2*s_inv3;
-  Scalar a_over_3 = (c1 - c2*c2_over_3)*s_inv3;
-  if (a_over_3 > Scalar(0))
-    a_over_3 = Scalar(0);
+  Scalar c2_over_3 = c2 * s_inv3;
+  Scalar a_over_3 = (c1 - c2 * c2_over_3) * s_inv3;
+  if (a_over_3 > Scalar(0)) a_over_3 = Scalar(0);
 
-  Scalar half_b = Scalar(0.5)*(c0 + c2_over_3*(Scalar(2)*c2_over_3*c2_over_3 - c1));
+  Scalar half_b = Scalar(0.5) * (c0 + c2_over_3 * (Scalar(2) * c2_over_3 * c2_over_3 - c1));
 
-  Scalar q = half_b*half_b + a_over_3*a_over_3*a_over_3;
-  if (q > Scalar(0))
-    q = Scalar(0);
+  Scalar q = half_b * half_b + a_over_3 * a_over_3 * a_over_3;
+  if (q > Scalar(0)) q = Scalar(0);
 
   // Compute the eigenvalues by solving for the roots of the polynomial.
   Scalar rho = std::sqrt(-a_over_3);
-  Scalar theta = std::atan2(std::sqrt(-q),half_b)*s_inv3;
+  Scalar theta = std::atan2(std::sqrt(-q), half_b) * s_inv3;
   Scalar cos_theta = std::cos(theta);
   Scalar sin_theta = std::sin(theta);
-  roots(2) = c2_over_3 + Scalar(2)*rho*cos_theta;
-  roots(0) = c2_over_3 - rho*(cos_theta + s_sqrt3*sin_theta);
-  roots(1) = c2_over_3 - rho*(cos_theta - s_sqrt3*sin_theta);
+  roots(2) = c2_over_3 + Scalar(2) * rho * cos_theta;
+  roots(0) = c2_over_3 - rho * (cos_theta + s_sqrt3 * sin_theta);
+  roots(1) = c2_over_3 - rho * (cos_theta - s_sqrt3 * sin_theta);
 }
 
-template<typename Matrix, typename Vector>
-void eigen33(const Matrix& mat, Matrix& evecs, Vector& evals)
-{
+template <typename Matrix, typename Vector>
+void eigen33(const Matrix& mat, Matrix& evecs, Vector& evals) {
   typedef typename Matrix::Scalar Scalar;
   // Scale the matrix so its entries are in [-1,1].  The scaling is applied
   // only when at least one matrix entry has magnitude larger than 1.
 
-  Scalar shift = mat.trace()/3;
+  Scalar shift = mat.trace() / 3;
   Matrix scaledMat = mat;
   scaledMat.diagonal().array() -= shift;
-  Scalar scale = scaledMat.cwiseAbs()/*.template triangularView<Lower>()*/.maxCoeff();
-  scale = std::max(scale,Scalar(1));
-  scaledMat/=scale;
+  Scalar scale = scaledMat.cwiseAbs() /*.template triangularView<Lower>()*/.maxCoeff();
+  scale = std::max(scale, Scalar(1));
+  scaledMat /= scale;
 
   // Compute the eigenvalues
-//   scaledMat.setZero();
-  computeRoots(scaledMat,evals);
+  //   scaledMat.setZero();
+  computeRoots(scaledMat, evals);
 
   // compute the eigen vectors
   // **here we assume 3 different eigenvalues**
 
   // "optimized version" which appears to be slower with gcc!
-//     Vector base;
-//     Scalar alpha, beta;
-//     base <<   scaledMat(1,0) * scaledMat(2,1),
-//               scaledMat(1,0) * scaledMat(2,0),
-//              -scaledMat(1,0) * scaledMat(1,0);
-//     for(int k=0; k<2; ++k)
-//     {
-//       alpha = scaledMat(0,0) - evals(k);
-//       beta  = scaledMat(1,1) - evals(k);
-//       evecs.col(k) = (base + Vector(-beta*scaledMat(2,0), -alpha*scaledMat(2,1), alpha*beta)).normalized();
-//     }
-//     evecs.col(2) = evecs.col(0).cross(evecs.col(1)).normalized();
+  //     Vector base;
+  //     Scalar alpha, beta;
+  //     base <<   scaledMat(1,0) * scaledMat(2,1),
+  //               scaledMat(1,0) * scaledMat(2,0),
+  //              -scaledMat(1,0) * scaledMat(1,0);
+  //     for(int k=0; k<2; ++k)
+  //     {
+  //       alpha = scaledMat(0,0) - evals(k);
+  //       beta  = scaledMat(1,1) - evals(k);
+  //       evecs.col(k) = (base + Vector(-beta*scaledMat(2,0), -alpha*scaledMat(2,1), alpha*beta)).normalized();
+  //     }
+  //     evecs.col(2) = evecs.col(0).cross(evecs.col(1)).normalized();
 
-//   // naive version
-//   Matrix tmp;
-//   tmp = scaledMat;
-//   tmp.diagonal().array() -= evals(0);
-//   evecs.col(0) = tmp.row(0).cross(tmp.row(1)).normalized();
-// 
-//   tmp = scaledMat;
-//   tmp.diagonal().array() -= evals(1);
-//   evecs.col(1) = tmp.row(0).cross(tmp.row(1)).normalized();
-// 
-//   tmp = scaledMat;
-//   tmp.diagonal().array() -= evals(2);
-//   evecs.col(2) = tmp.row(0).cross(tmp.row(1)).normalized();
-  
+  //   // naive version
+  //   Matrix tmp;
+  //   tmp = scaledMat;
+  //   tmp.diagonal().array() -= evals(0);
+  //   evecs.col(0) = tmp.row(0).cross(tmp.row(1)).normalized();
+  //
+  //   tmp = scaledMat;
+  //   tmp.diagonal().array() -= evals(1);
+  //   evecs.col(1) = tmp.row(0).cross(tmp.row(1)).normalized();
+  //
+  //   tmp = scaledMat;
+  //   tmp.diagonal().array() -= evals(2);
+  //   evecs.col(2) = tmp.row(0).cross(tmp.row(1)).normalized();
+
   // a more stable version:
-  if((evals(2)-evals(0))<=Eigen::NumTraits<Scalar>::epsilon())
-  {
+  if ((evals(2) - evals(0)) <= Eigen::NumTraits<Scalar>::epsilon()) {
     evecs.setIdentity();
-  }
-  else
-  {
+  } else {
     Matrix tmp;
     tmp = scaledMat;
-    tmp.diagonal ().array () -= evals (2);
-    evecs.col (2) = tmp.row (0).cross (tmp.row (1)).normalized ();
-    
+    tmp.diagonal().array() -= evals(2);
+    evecs.col(2) = tmp.row(0).cross(tmp.row(1)).normalized();
+
     tmp = scaledMat;
-    tmp.diagonal ().array () -= evals (1);
-    evecs.col(1) = tmp.row (0).cross(tmp.row (1));
+    tmp.diagonal().array() -= evals(1);
+    evecs.col(1) = tmp.row(0).cross(tmp.row(1));
     Scalar n1 = evecs.col(1).norm();
-    if(n1<=Eigen::NumTraits<Scalar>::epsilon())
+    if (n1 <= Eigen::NumTraits<Scalar>::epsilon())
       evecs.col(1) = evecs.col(2).unitOrthogonal();
     else
       evecs.col(1) /= n1;
-    
+
     // make sure that evecs[1] is orthogonal to evecs[2]
     evecs.col(1) = evecs.col(2).cross(evecs.col(1).cross(evecs.col(2))).normalized();
     evecs.col(0) = evecs.col(2).cross(evecs.col(1));
   }
-  
+
   // Rescale back to the original size.
   evals *= scale;
-  evals.array()+=shift;
+  evals.array() += shift;
 }
 
-int main()
-{
+int main() {
   BenchTimer t;
   int tries = 10;
   int rep = 400000;
   typedef Matrix3d Mat;
   typedef Vector3d Vec;
-  Mat A = Mat::Random(3,3);
+  Mat A = Mat::Random(3, 3);
   A = A.adjoint() * A;
-//   Mat Q = A.householderQr().householderQ();
-//   A = Q * Vec(2.2424567,2.2424566,7.454353).asDiagonal() * Q.transpose();
+  //   Mat Q = A.householderQr().householderQ();
+  //   A = Q * Vec(2.2424567,2.2424566,7.454353).asDiagonal() * Q.transpose();
 
   SelfAdjointEigenSolver<Mat> eig(A);
   BENCH(t, tries, rep, eig.compute(A));
   std::cout << "Eigen iterative:  " << t.best() << "s\n";
-  
+
   BENCH(t, tries, rep, eig.computeDirect(A));
   std::cout << "Eigen direct   :  " << t.best() << "s\n";
 
   Mat evecs;
   Vec evals;
-  BENCH(t, tries, rep, eigen33(A,evecs,evals));
+  BENCH(t, tries, rep, eigen33(A, evecs, evals));
   std::cout << "Direct: " << t.best() << "s\n\n";
 
-//   std::cerr << "Eigenvalue/eigenvector diffs:\n";
-//   std::cerr << (evals - eig.eigenvalues()).transpose() << "\n";
-//   for(int k=0;k<3;++k)
-//     if(evecs.col(k).dot(eig.eigenvectors().col(k))<0)
-//       evecs.col(k) = -evecs.col(k);
-//   std::cerr << evecs - eig.eigenvectors() << "\n\n";
+  //   std::cerr << "Eigenvalue/eigenvector diffs:\n";
+  //   std::cerr << (evals - eig.eigenvalues()).transpose() << "\n";
+  //   for(int k=0;k<3;++k)
+  //     if(evecs.col(k).dot(eig.eigenvectors().col(k))<0)
+  //       evecs.col(k) = -evecs.col(k);
+  //   std::cerr << evecs - eig.eigenvectors() << "\n\n";
 }
diff --git a/bench/geometry.cpp b/bench/geometry.cpp
index b187a51..35eee88 100644
--- a/bench/geometry.cpp
+++ b/bench/geometry.cpp
@@ -16,105 +16,100 @@
 
 typedef SCALAR Scalar;
 typedef NumTraits<Scalar>::Real RealScalar;
-typedef Matrix<RealScalar,Dynamic,Dynamic> A;
-typedef Matrix</*Real*/Scalar,Dynamic,Dynamic> B;
-typedef Matrix<Scalar,Dynamic,Dynamic> C;
-typedef Matrix<RealScalar,Dynamic,Dynamic> M;
+typedef Matrix<RealScalar, Dynamic, Dynamic> A;
+typedef Matrix</*Real*/ Scalar, Dynamic, Dynamic> B;
+typedef Matrix<Scalar, Dynamic, Dynamic> C;
+typedef Matrix<RealScalar, Dynamic, Dynamic> M;
 
-template<typename Transformation, typename Data>
-EIGEN_DONT_INLINE void transform(const Transformation& t, Data& data)
-{
+template <typename Transformation, typename Data>
+EIGEN_DONT_INLINE void transform(const Transformation& t, Data& data) {
   EIGEN_ASM_COMMENT("begin");
   data = t * data;
   EIGEN_ASM_COMMENT("end");
 }
 
-template<typename Scalar, typename Data>
-EIGEN_DONT_INLINE void transform(const Quaternion<Scalar>& t, Data& data)
-{
+template <typename Scalar, typename Data>
+EIGEN_DONT_INLINE void transform(const Quaternion<Scalar>& t, Data& data) {
   EIGEN_ASM_COMMENT("begin quat");
-  for(int i=0;i<data.cols();++i)
-    data.col(i) = t * data.col(i);
+  for (int i = 0; i < data.cols(); ++i) data.col(i) = t * data.col(i);
   EIGEN_ASM_COMMENT("end quat");
 }
 
-template<typename T> struct ToRotationMatrixWrapper
-{
-  enum {Dim = T::Dim};
+template <typename T>
+struct ToRotationMatrixWrapper {
+  enum { Dim = T::Dim };
   typedef typename T::Scalar Scalar;
   ToRotationMatrixWrapper(const T& o) : object(o) {}
   T object;
 };
 
-template<typename QType, typename Data>
-EIGEN_DONT_INLINE void transform(const ToRotationMatrixWrapper<QType>& t, Data& data)
-{
+template <typename QType, typename Data>
+EIGEN_DONT_INLINE void transform(const ToRotationMatrixWrapper<QType>& t, Data& data) {
   EIGEN_ASM_COMMENT("begin quat via mat");
   data = t.object.toRotationMatrix() * data;
   EIGEN_ASM_COMMENT("end quat via mat");
 }
 
-template<typename Scalar, int Dim, typename Data>
-EIGEN_DONT_INLINE void transform(const Transform<Scalar,Dim,Projective>& t, Data& data)
-{
-  data = (t * data.colwise().homogeneous()).template block<Dim,Data::ColsAtCompileTime>(0,0);
+template <typename Scalar, int Dim, typename Data>
+EIGEN_DONT_INLINE void transform(const Transform<Scalar, Dim, Projective>& t, Data& data) {
+  data = (t * data.colwise().homogeneous()).template block<Dim, Data::ColsAtCompileTime>(0, 0);
 }
 
-template<typename T> struct get_dim { enum { Dim = T::Dim }; };
-template<typename S, int R, int C, int O, int MR, int MC>
-struct get_dim<Matrix<S,R,C,O,MR,MC> > { enum { Dim = R }; };
+template <typename T>
+struct get_dim {
+  enum { Dim = T::Dim };
+};
+template <typename S, int R, int C, int O, int MR, int MC>
+struct get_dim<Matrix<S, R, C, O, MR, MC> > {
+  enum { Dim = R };
+};
 
-template<typename Transformation, int N>
-struct bench_impl
-{
-  static EIGEN_DONT_INLINE void run(const Transformation& t)
-  {
-    Matrix<typename Transformation::Scalar,get_dim<Transformation>::Dim,N> data;
+template <typename Transformation, int N>
+struct bench_impl {
+  static EIGEN_DONT_INLINE void run(const Transformation& t) {
+    Matrix<typename Transformation::Scalar, get_dim<Transformation>::Dim, N> data;
     data.setRandom();
-    bench_impl<Transformation,N-1>::run(t);
+    bench_impl<Transformation, N - 1>::run(t);
     BenchTimer timer;
-    BENCH(timer,10,100000,transform(t,data));
+    BENCH(timer, 10, 100000, transform(t, data));
     cout.width(9);
     cout << timer.best() << " ";
   }
 };
 
-
-template<typename Transformation>
-struct bench_impl<Transformation,0>
-{
+template <typename Transformation>
+struct bench_impl<Transformation, 0> {
   static EIGEN_DONT_INLINE void run(const Transformation&) {}
 };
 
-template<typename Transformation>
-EIGEN_DONT_INLINE void bench(const std::string& msg, const Transformation& t)
-{
+template <typename Transformation>
+EIGEN_DONT_INLINE void bench(const std::string& msg, const Transformation& t) {
   cout << msg << " ";
-  bench_impl<Transformation,SIZE>::run(t);
+  bench_impl<Transformation, SIZE>::run(t);
   std::cout << "\n";
 }
 
-int main(int argc, char ** argv)
-{
-  Matrix<Scalar,3,4> mat34; mat34.setRandom();
-  Transform<Scalar,3,Isometry> iso3(mat34);
-  Transform<Scalar,3,Affine> aff3(mat34);
-  Transform<Scalar,3,AffineCompact> caff3(mat34);
-  Transform<Scalar,3,Projective> proj3(mat34);
-  Quaternion<Scalar> quat;quat.setIdentity();
+int main(int argc, char** argv) {
+  Matrix<Scalar, 3, 4> mat34;
+  mat34.setRandom();
+  Transform<Scalar, 3, Isometry> iso3(mat34);
+  Transform<Scalar, 3, Affine> aff3(mat34);
+  Transform<Scalar, 3, AffineCompact> caff3(mat34);
+  Transform<Scalar, 3, Projective> proj3(mat34);
+  Quaternion<Scalar> quat;
+  quat.setIdentity();
   ToRotationMatrixWrapper<Quaternion<Scalar> > quatmat(quat);
-  Matrix<Scalar,3,3> mat33; mat33.setRandom();
-  
+  Matrix<Scalar, 3, 3> mat33;
+  mat33.setRandom();
+
   cout.precision(4);
-  std::cout
-     << "N          ";
-  for(int i=0;i<SIZE;++i)
-  {
+  std::cout << "N          ";
+  for (int i = 0; i < SIZE; ++i) {
     cout.width(9);
-    cout << i+1 << " ";
+    cout << i + 1 << " ";
   }
   cout << "\n";
-  
+
   bench("matrix 3x3", mat33);
   bench("quaternion", quat);
   bench("quat-mat  ", quatmat);
@@ -123,4 +118,3 @@
   bench("c affine3 ", caff3);
   bench("proj3     ", proj3);
 }
-
diff --git a/bench/perf_monitoring/gemm.cpp b/bench/perf_monitoring/gemm.cpp
index 804139d..25ad2fb 100644
--- a/bench/perf_monitoring/gemm.cpp
+++ b/bench/perf_monitoring/gemm.cpp
@@ -1,12 +1,5 @@
 #include "gemm_common.h"
 
-EIGEN_DONT_INLINE
-void gemm(const Mat &A, const Mat &B, Mat &C)
-{
-  C.noalias() += A * B;
-}
+EIGEN_DONT_INLINE void gemm(const Mat &A, const Mat &B, Mat &C) { C.noalias() += A * B; }
 
-int main(int argc, char **argv)
-{
-  return main_gemm(argc, argv, gemm);
-}
+int main(int argc, char **argv) { return main_gemm(argc, argv, gemm); }
diff --git a/bench/perf_monitoring/gemm_common.h b/bench/perf_monitoring/gemm_common.h
index 30dbc0d..9afd6f8 100644
--- a/bench/perf_monitoring/gemm_common.h
+++ b/bench/perf_monitoring/gemm_common.h
@@ -12,56 +12,50 @@
 
 typedef SCALAR Scalar;
 
-typedef Matrix<Scalar,Dynamic,Dynamic> Mat;
+typedef Matrix<Scalar, Dynamic, Dynamic> Mat;
 
-template<typename Func>
-EIGEN_DONT_INLINE
-double bench(long m, long n, long k, const Func& f)
-{
-  Mat A(m,k);
-  Mat B(k,n);
-  Mat C(m,n);
+template <typename Func>
+EIGEN_DONT_INLINE double bench(long m, long n, long k, const Func& f) {
+  Mat A(m, k);
+  Mat B(k, n);
+  Mat C(m, n);
   A.setRandom();
   B.setRandom();
   C.setZero();
-  
+
   BenchTimer t;
-  
-  double up = 1e8*4/sizeof(Scalar);
+
+  double up = 1e8 * 4 / sizeof(Scalar);
   double tm0 = 4, tm1 = 10;
-  if(NumTraits<Scalar>::IsComplex)
-  {
+  if (NumTraits<Scalar>::IsComplex) {
     up /= 4;
     tm0 = 2;
     tm1 = 4;
   }
-  
+
   double flops = 2. * m * n * k;
-  long rep = std::max(1., std::min(100., up/flops) );
-  long tries = std::max(tm0, std::min(tm1, up/flops) );
-  
-  BENCH(t, tries, rep, f(A,B,C));
-  
+  long rep = std::max(1., std::min(100., up / flops));
+  long tries = std::max(tm0, std::min(tm1, up / flops));
+
+  BENCH(t, tries, rep, f(A, B, C));
+
   return 1e-9 * rep * flops / t.best();
 }
 
-template<typename Func>
-int main_gemm(int argc, char **argv, const Func& f)
-{
+template <typename Func>
+int main_gemm(int argc, char** argv, const Func& f) {
   std::vector<double> results;
-  
+
   std::string filename = std::string("gemm_settings.txt");
-  if(argc>1)
-    filename = std::string(argv[1]);
+  if (argc > 1) filename = std::string(argv[1]);
   std::ifstream settings(filename);
   long m, n, k;
-  while(settings >> m >> n >> k)
-  {
-    //std::cerr << "  Testing " << m << " " << n << " " << k << std::endl;
-    results.push_back( bench(m, n, k, f) );
+  while (settings >> m >> n >> k) {
+    // std::cerr << "  Testing " << m << " " << n << " " << k << std::endl;
+    results.push_back(bench(m, n, k, f));
   }
-  
+
   std::cout << RowVectorXd::Map(results.data(), results.size());
-  
+
   return 0;
 }
diff --git a/bench/perf_monitoring/gemv.cpp b/bench/perf_monitoring/gemv.cpp
index 82e5ab9..b28a8b8 100644
--- a/bench/perf_monitoring/gemv.cpp
+++ b/bench/perf_monitoring/gemv.cpp
@@ -1,12 +1,5 @@
 #include "gemv_common.h"
 
-EIGEN_DONT_INLINE
-void gemv(const Mat &A, const Vec &B, Vec &C)
-{
-  C.noalias() += A * B;
-}
+EIGEN_DONT_INLINE void gemv(const Mat &A, const Vec &B, Vec &C) { C.noalias() += A * B; }
 
-int main(int argc, char **argv)
-{
-  return main_gemv(argc, argv, gemv);
-}
+int main(int argc, char **argv) { return main_gemv(argc, argv, gemv); }
diff --git a/bench/perf_monitoring/gemv_common.h b/bench/perf_monitoring/gemv_common.h
index cc32577..102fa71 100644
--- a/bench/perf_monitoring/gemv_common.h
+++ b/bench/perf_monitoring/gemv_common.h
@@ -13,14 +13,12 @@
 
 typedef SCALAR Scalar;
 
-typedef Matrix<Scalar,Dynamic,Dynamic> Mat;
-typedef Matrix<Scalar,Dynamic,1>       Vec;
+typedef Matrix<Scalar, Dynamic, Dynamic> Mat;
+typedef Matrix<Scalar, Dynamic, 1> Vec;
 
-template<typename Func>
-EIGEN_DONT_INLINE
-double bench(long m, long n, Func &f)
-{
-  Mat A(m,n);
+template <typename Func>
+EIGEN_DONT_INLINE double bench(long m, long n, Func &f) {
+  Mat A(m, n);
   Vec B(n);
   Vec C(m);
   A.setRandom();
@@ -29,38 +27,34 @@
 
   BenchTimer t;
 
-  double up = 1e8/sizeof(Scalar);
+  double up = 1e8 / sizeof(Scalar);
   double tm0 = 4, tm1 = 10;
-  if(NumTraits<Scalar>::IsComplex)
-  {
+  if (NumTraits<Scalar>::IsComplex) {
     up /= 4;
     tm0 = 2;
     tm1 = 4;
   }
 
   double flops = 2. * m * n;
-  long rep = std::max(1., std::min(100., up/flops) );
-  long tries = std::max(tm0, std::min(tm1, up/flops) );
+  long rep = std::max(1., std::min(100., up / flops));
+  long tries = std::max(tm0, std::min(tm1, up / flops));
 
-  BENCH(t, tries, rep, f(A,B,C));
+  BENCH(t, tries, rep, f(A, B, C));
 
   return 1e-9 * rep * flops / t.best();
 }
 
-template<typename Func>
-int main_gemv(int argc, char **argv, Func& f)
-{
+template <typename Func>
+int main_gemv(int argc, char **argv, Func &f) {
   std::vector<double> results;
 
   std::string filename = std::string("gemv_settings.txt");
-  if(argc>1)
-    filename = std::string(argv[1]);
+  if (argc > 1) filename = std::string(argv[1]);
   std::ifstream settings(filename);
   long m, n;
-  while(settings >> m >> n)
-  {
-    //std::cerr << "  Testing " << m << " " << n << std::endl;
-    results.push_back( bench(m, n, f) );
+  while (settings >> m >> n) {
+    // std::cerr << "  Testing " << m << " " << n << std::endl;
+    results.push_back(bench(m, n, f));
   }
 
   std::cout << RowVectorXd::Map(results.data(), results.size());
diff --git a/bench/perf_monitoring/gemvt.cpp b/bench/perf_monitoring/gemvt.cpp
index fe94576..5900c52 100644
--- a/bench/perf_monitoring/gemvt.cpp
+++ b/bench/perf_monitoring/gemvt.cpp
@@ -1,12 +1,5 @@
 #include "gemv_common.h"
 
-EIGEN_DONT_INLINE
-void gemv(const Mat &A, Vec &B, const Vec &C)
-{
-  B.noalias() += A.transpose() * C;
-}
+EIGEN_DONT_INLINE void gemv(const Mat &A, Vec &B, const Vec &C) { B.noalias() += A.transpose() * C; }
 
-int main(int argc, char **argv)
-{
-  return main_gemv(argc, argv, gemv);
-}
+int main(int argc, char **argv) { return main_gemv(argc, argv, gemv); }
diff --git a/bench/perf_monitoring/lazy_gemm.cpp b/bench/perf_monitoring/lazy_gemm.cpp
index 7733060..3454c19 100644
--- a/bench/perf_monitoring/lazy_gemm.cpp
+++ b/bench/perf_monitoring/lazy_gemm.cpp
@@ -11,91 +11,105 @@
 
 typedef SCALAR Scalar;
 
-template<typename MatA, typename MatB, typename MatC>
-EIGEN_DONT_INLINE
-void lazy_gemm(const MatA &A, const MatB &B, MatC &C)
-{
-//   escape((void*)A.data());
-//   escape((void*)B.data());
+template <typename MatA, typename MatB, typename MatC>
+EIGEN_DONT_INLINE void lazy_gemm(const MatA &A, const MatB &B, MatC &C) {
+  //   escape((void*)A.data());
+  //   escape((void*)B.data());
   C.noalias() += A.lazyProduct(B);
-//   escape((void*)C.data());
+  //   escape((void*)C.data());
 }
 
-template<int m, int n, int k, int TA>
-EIGEN_DONT_INLINE
-double bench()
-{
-  typedef Matrix<Scalar,m,k,TA> MatA;
-  typedef Matrix<Scalar,k,n> MatB;
-  typedef Matrix<Scalar,m,n> MatC;
+template <int m, int n, int k, int TA>
+EIGEN_DONT_INLINE double bench() {
+  typedef Matrix<Scalar, m, k, TA> MatA;
+  typedef Matrix<Scalar, k, n> MatB;
+  typedef Matrix<Scalar, m, n> MatC;
 
-  MatA A(m,k);
-  MatB B(k,n);
-  MatC C(m,n);
+  MatA A(m, k);
+  MatB B(k, n);
+  MatC C(m, n);
   A.setRandom();
   B.setRandom();
   C.setZero();
 
   BenchTimer t;
 
-  double up = 1e7*4/sizeof(Scalar);
+  double up = 1e7 * 4 / sizeof(Scalar);
   double tm0 = 10, tm1 = 20;
 
   double flops = 2. * m * n * k;
-  long rep = std::max(10., std::min(10000., up/flops) );
-  long tries = std::max(tm0, std::min(tm1, up/flops) );
+  long rep = std::max(10., std::min(10000., up / flops));
+  long tries = std::max(tm0, std::min(tm1, up / flops));
 
-  BENCH(t, tries, rep, lazy_gemm(A,B,C));
+  BENCH(t, tries, rep, lazy_gemm(A, B, C));
 
   return 1e-9 * rep * flops / t.best();
 }
 
-template<int m, int n, int k>
-double bench_t(int t)
-{
-  if(t)
-    return bench<m,n,k,RowMajor>();
+template <int m, int n, int k>
+double bench_t(int t) {
+  if (t)
+    return bench<m, n, k, RowMajor>();
   else
-    return bench<m,n,k,0>();
+    return bench<m, n, k, 0>();
 }
 
-EIGEN_DONT_INLINE
-double bench_mnk(int m, int n, int k, int t)
-{
-  int id = m*10000 + n*100 + k;
-  switch(id) {
-    case  10101 : return bench_t< 1, 1, 1>(t); break;
-    case  20202 : return bench_t< 2, 2, 2>(t); break;
-    case  30303 : return bench_t< 3, 3, 3>(t); break;
-    case  40404 : return bench_t< 4, 4, 4>(t); break;
-    case  50505 : return bench_t< 5, 5, 5>(t); break;
-    case  60606 : return bench_t< 6, 6, 6>(t); break;
-    case  70707 : return bench_t< 7, 7, 7>(t); break;
-    case  80808 : return bench_t< 8, 8, 8>(t); break;
-    case  90909 : return bench_t< 9, 9, 9>(t); break;
-    case 101010 : return bench_t<10,10,10>(t); break;
-    case 111111 : return bench_t<11,11,11>(t); break;
-    case 121212 : return bench_t<12,12,12>(t); break;
+EIGEN_DONT_INLINE double bench_mnk(int m, int n, int k, int t) {
+  int id = m * 10000 + n * 100 + k;
+  switch (id) {
+    case 10101:
+      return bench_t<1, 1, 1>(t);
+      break;
+    case 20202:
+      return bench_t<2, 2, 2>(t);
+      break;
+    case 30303:
+      return bench_t<3, 3, 3>(t);
+      break;
+    case 40404:
+      return bench_t<4, 4, 4>(t);
+      break;
+    case 50505:
+      return bench_t<5, 5, 5>(t);
+      break;
+    case 60606:
+      return bench_t<6, 6, 6>(t);
+      break;
+    case 70707:
+      return bench_t<7, 7, 7>(t);
+      break;
+    case 80808:
+      return bench_t<8, 8, 8>(t);
+      break;
+    case 90909:
+      return bench_t<9, 9, 9>(t);
+      break;
+    case 101010:
+      return bench_t<10, 10, 10>(t);
+      break;
+    case 111111:
+      return bench_t<11, 11, 11>(t);
+      break;
+    case 121212:
+      return bench_t<12, 12, 12>(t);
+      break;
   }
   return 0;
 }
 
-int main(int argc, char **argv)
-{
+int main(int argc, char **argv) {
   std::vector<double> results;
-  
+
   std::string filename = std::string("lazy_gemm_settings.txt");
-  if(argc>1)
-    filename = std::string(argv[1]);
+  if (argc > 1) filename = std::string(argv[1]);
   std::ifstream settings(filename);
   long m, n, k, t;
-  while(settings >> m >> n >> k >> t)
-  {
-    //std::cerr << "  Testing " << m << " " << n << " " << k << std::endl;
-    results.push_back( bench_mnk(m, n, k, t) );
+  while (settings >> m >> n >> k >> t) {
+    // std::cerr << "  Testing " << m << " " << n << " " << k << std::endl;
+    results.push_back(bench_mnk(m, n, k, t));
   }
-  
+
   std::cout << RowVectorXd::Map(results.data(), results.size());
-  
+
   return 0;
 }
diff --git a/bench/perf_monitoring/llt.cpp b/bench/perf_monitoring/llt.cpp
index d55b7d8..0103b00 100644
--- a/bench/perf_monitoring/llt.cpp
+++ b/bench/perf_monitoring/llt.cpp
@@ -1,15 +1,10 @@
 #include "gemm_common.h"
 #include <Eigen/Cholesky>
 
-EIGEN_DONT_INLINE
-void llt(const Mat &A, const Mat &B, Mat &C)
-{
+EIGEN_DONT_INLINE void llt(const Mat &A, const Mat &B, Mat &C) {
   C = A;
   C.diagonal().array() += 1000;
   Eigen::internal::llt_inplace<Mat::Scalar, Lower>::blocked(C);
 }
 
-int main(int argc, char **argv)
-{
-  return main_gemm(argc, argv, llt);
-}
+int main(int argc, char **argv) { return main_gemm(argc, argv, llt); }
diff --git a/bench/perf_monitoring/trmv_lo.cpp b/bench/perf_monitoring/trmv_lo.cpp
index 3fabb6e..fd6eaf3 100644
--- a/bench/perf_monitoring/trmv_lo.cpp
+++ b/bench/perf_monitoring/trmv_lo.cpp
@@ -1,12 +1,5 @@
 #include "gemv_common.h"
 
-EIGEN_DONT_INLINE
-void trmv(const Mat &A, const Vec &B, Vec &C)
-{
-  C.noalias() += A.triangularView<Lower>() * B;
-}
+EIGEN_DONT_INLINE void trmv(const Mat &A, const Vec &B, Vec &C) { C.noalias() += A.triangularView<Lower>() * B; }
 
-int main(int argc, char **argv)
-{
-  return main_gemv(argc, argv, trmv);
-}
+int main(int argc, char **argv) { return main_gemv(argc, argv, trmv); }
diff --git a/bench/perf_monitoring/trmv_lot.cpp b/bench/perf_monitoring/trmv_lot.cpp
index 32e085a..abbe003 100644
--- a/bench/perf_monitoring/trmv_lot.cpp
+++ b/bench/perf_monitoring/trmv_lot.cpp
@@ -1,12 +1,7 @@
 #include "gemv_common.h"
 
-EIGEN_DONT_INLINE
-void trmv(const Mat &A, Vec &B, const Vec &C)
-{
+EIGEN_DONT_INLINE void trmv(const Mat &A, Vec &B, const Vec &C) {
   B.noalias() += A.transpose().triangularView<Lower>() * C;
 }
 
-int main(int argc, char **argv)
-{
-  return main_gemv(argc, argv, trmv);
-}
+int main(int argc, char **argv) { return main_gemv(argc, argv, trmv); }
diff --git a/bench/perf_monitoring/trmv_up.cpp b/bench/perf_monitoring/trmv_up.cpp
index c58e471..989a3f7 100644
--- a/bench/perf_monitoring/trmv_up.cpp
+++ b/bench/perf_monitoring/trmv_up.cpp
@@ -1,12 +1,5 @@
 #include "gemv_common.h"
 
-EIGEN_DONT_INLINE
-void trmv(const Mat &A, const Vec &B, Vec &C)
-{
-  C.noalias() += A.triangularView<Upper>() * B;
-}
+EIGEN_DONT_INLINE void trmv(const Mat &A, const Vec &B, Vec &C) { C.noalias() += A.triangularView<Upper>() * B; }
 
-int main(int argc, char **argv)
-{
-  return main_gemv(argc, argv, trmv);
-}
+int main(int argc, char **argv) { return main_gemv(argc, argv, trmv); }
diff --git a/bench/perf_monitoring/trmv_upt.cpp b/bench/perf_monitoring/trmv_upt.cpp
index 511e008..82092d7 100644
--- a/bench/perf_monitoring/trmv_upt.cpp
+++ b/bench/perf_monitoring/trmv_upt.cpp
@@ -1,12 +1,7 @@
 #include "gemv_common.h"
 
-EIGEN_DONT_INLINE
-void trmv(const Mat &A, Vec &B, const Vec &C)
-{
+EIGEN_DONT_INLINE void trmv(const Mat &A, Vec &B, const Vec &C) {
   B.noalias() += A.transpose().triangularView<Upper>() * C;
 }
 
-int main(int argc, char **argv)
-{
-  return main_gemv(argc, argv, trmv);
-}
+int main(int argc, char **argv) { return main_gemv(argc, argv, trmv); }
diff --git a/bench/product_threshold.cpp b/bench/product_threshold.cpp
index dd6d15a..f96713c 100644
--- a/bench/product_threshold.cpp
+++ b/bench/product_threshold.cpp
@@ -8,136 +8,157 @@
 
 #define END 9
 
-template<int S> struct map_size { enum { ret = S }; };
-template<>  struct map_size<10> { enum { ret = 20 }; };
-template<>  struct map_size<11> { enum { ret = 50 }; };
-template<>  struct map_size<12> { enum { ret = 100 }; };
-template<>  struct map_size<13> { enum { ret = 300 }; };
+template <int S>
+struct map_size {
+  enum { ret = S };
+};
+template <>
+struct map_size<10> {
+  enum { ret = 20 };
+};
+template <>
+struct map_size<11> {
+  enum { ret = 50 };
+};
+template <>
+struct map_size<12> {
+  enum { ret = 100 };
+};
+template <>
+struct map_size<13> {
+  enum { ret = 300 };
+};
 
-template<int M, int N,int K> struct alt_prod
-{
+template <int M, int N, int K>
+struct alt_prod {
   enum {
-    ret = M==1 && N==1 ? InnerProduct
-        : K==1 ? OuterProduct
-        : M==1 ? GemvProduct
-        : N==1 ? GemvProduct
-        : GemmProduct
+    ret = M == 1 && N == 1 ? InnerProduct
+          : K == 1         ? OuterProduct
+          : M == 1         ? GemvProduct
+          : N == 1         ? GemvProduct
+                           : GemmProduct
   };
 };
-        
-void print_mode(int mode)
-{
-  if(mode==InnerProduct) std::cout << "i";
-  if(mode==OuterProduct) std::cout << "o";
-  if(mode==CoeffBasedProductMode) std::cout << "c";
-  if(mode==LazyCoeffBasedProductMode) std::cout << "l";
-  if(mode==GemvProduct) std::cout << "v";
-  if(mode==GemmProduct) std::cout << "m";
+
+void print_mode(int mode) {
+  if (mode == InnerProduct) std::cout << "i";
+  if (mode == OuterProduct) std::cout << "o";
+  if (mode == CoeffBasedProductMode) std::cout << "c";
+  if (mode == LazyCoeffBasedProductMode) std::cout << "l";
+  if (mode == GemvProduct) std::cout << "v";
+  if (mode == GemmProduct) std::cout << "m";
 }
 
-template<int Mode, typename Lhs, typename Rhs, typename Res>
-EIGEN_DONT_INLINE void prod(const Lhs& a, const Rhs& b, Res& c)
-{
-  c.noalias() += typename ProductReturnType<Lhs,Rhs,Mode>::Type(a,b);
+template <int Mode, typename Lhs, typename Rhs, typename Res>
+EIGEN_DONT_INLINE void prod(const Lhs& a, const Rhs& b, Res& c) {
+  c.noalias() += typename ProductReturnType<Lhs, Rhs, Mode>::Type(a, b);
 }
 
-template<int M, int N, int K, typename Scalar, int Mode>
-EIGEN_DONT_INLINE void bench_prod()
-{
-  typedef Matrix<Scalar,M,K> Lhs; Lhs a; a.setRandom();
-  typedef Matrix<Scalar,K,N> Rhs; Rhs b; b.setRandom();
-  typedef Matrix<Scalar,M,N> Res; Res c; c.setRandom();
+template <int M, int N, int K, typename Scalar, int Mode>
+EIGEN_DONT_INLINE void bench_prod() {
+  typedef Matrix<Scalar, M, K> Lhs;
+  Lhs a;
+  a.setRandom();
+  typedef Matrix<Scalar, K, N> Rhs;
+  Rhs b;
+  b.setRandom();
+  typedef Matrix<Scalar, M, N> Res;
+  Res c;
+  c.setRandom();
 
   BenchTimer t;
-  double n = 2.*double(M)*double(N)*double(K);
-  int rep = 100000./n;
+  double n = 2. * double(M) * double(N) * double(K);
+  int rep = 100000. / n;
   rep /= 2;
-  if(rep<1) rep = 1;
+  if (rep < 1) rep = 1;
   do {
     rep *= 2;
     t.reset();
-    BENCH(t,1,rep,prod<CoeffBasedProductMode>(a,b,c));
-  } while(t.best()<0.1);
-  
+    BENCH(t, 1, rep, prod<CoeffBasedProductMode>(a, b, c));
+  } while (t.best() < 0.1);
+
   t.reset();
-  BENCH(t,5,rep,prod<Mode>(a,b,c));
+  BENCH(t, 5, rep, prod<Mode>(a, b, c));
 
   print_mode(Mode);
-  std::cout << int(1e-6*n*rep/t.best()) << "\t";
+  std::cout << int(1e-6 * n * rep / t.best()) << "\t";
 }
 
-template<int N> struct print_n;
-template<int M, int N, int K> struct loop_on_m;
-template<int M, int N, int K, typename Scalar, int Mode> struct loop_on_n;
+template <int N>
+struct print_n;
+template <int M, int N, int K>
+struct loop_on_m;
+template <int M, int N, int K, typename Scalar, int Mode>
+struct loop_on_n;
 
-template<int M, int N, int K>
-struct loop_on_k
-{
-  static void run()
-  {
+template <int M, int N, int K>
+struct loop_on_k {
+  static void run() {
     std::cout << "K=" << K << "\t";
     print_n<N>::run();
     std::cout << "\n";
 
-    loop_on_m<M,N,K>::run();
+    loop_on_m<M, N, K>::run();
     std::cout << "\n\n";
 
-    loop_on_k<M,N,K+1>::run();
+    loop_on_k<M, N, K + 1>::run();
   }
 };
 
-template<int M, int N>
-struct loop_on_k<M,N,END> { static void run(){} };
+template <int M, int N>
+struct loop_on_k<M, N, END> {
+  static void run() {}
+};
 
-
-template<int M, int N, int K>
-struct loop_on_m
-{
-  static void run()
-  {
+template <int M, int N, int K>
+struct loop_on_m {
+  static void run() {
     std::cout << M << "f\t";
-    loop_on_n<M,N,K,float,CoeffBasedProductMode>::run();
-    std::cout << "\n";
-    
-    std::cout << M << "f\t";
-    loop_on_n<M,N,K,float,-1>::run();
+    loop_on_n<M, N, K, float, CoeffBasedProductMode>::run();
     std::cout << "\n";
 
-    loop_on_m<M+1,N,K>::run();
+    std::cout << M << "f\t";
+    loop_on_n<M, N, K, float, -1>::run();
+    std::cout << "\n";
+
+    loop_on_m<M + 1, N, K>::run();
   }
 };
 
-template<int N, int K>
-struct loop_on_m<END,N,K> { static void run(){} };
+template <int N, int K>
+struct loop_on_m<END, N, K> {
+  static void run() {}
+};
 
-template<int M, int N, int K, typename Scalar, int Mode>
-struct loop_on_n
-{
-  static void run()
-  {
-    bench_prod<M,N,K,Scalar,Mode==-1? alt_prod<M,N,K>::ret : Mode>();
-    
-    loop_on_n<M,N+1,K,Scalar,Mode>::run();
+template <int M, int N, int K, typename Scalar, int Mode>
+struct loop_on_n {
+  static void run() {
+    bench_prod<M, N, K, Scalar, Mode == -1 ? alt_prod<M, N, K>::ret : Mode>();
+
+    loop_on_n<M, N + 1, K, Scalar, Mode>::run();
   }
 };
 
-template<int M, int K, typename Scalar, int Mode>
-struct loop_on_n<M,END,K,Scalar,Mode> { static void run(){} };
+template <int M, int K, typename Scalar, int Mode>
+struct loop_on_n<M, END, K, Scalar, Mode> {
+  static void run() {}
+};
 
-template<int N> struct print_n
-{
-  static void run()
-  {
+template <int N>
+struct print_n {
+  static void run() {
     std::cout << map_size<N>::ret << "\t";
-    print_n<N+1>::run();
+    print_n<N + 1>::run();
   }
 };
 
-template<> struct print_n<END> { static void run(){} };
+template <>
+struct print_n<END> {
+  static void run() {}
+};
 
-int main()
-{
-  loop_on_k<1,1,1>::run();
-  
-  return 0; 
+int main() {
+  loop_on_k<1, 1, 1>::run();
+
+  return 0;
 }
diff --git a/bench/quat_slerp.cpp b/bench/quat_slerp.cpp
index bffb3bf..408f308 100644
--- a/bench/quat_slerp.cpp
+++ b/bench/quat_slerp.cpp
@@ -5,237 +5,211 @@
 using namespace Eigen;
 using namespace std;
 
-
-
-template<typename Q>
-EIGEN_DONT_INLINE Q nlerp(const Q& a, const Q& b, typename Q::Scalar t)
-{
-  return Q((a.coeffs() * (1.0-t) + b.coeffs() * t).normalized());
+template <typename Q>
+EIGEN_DONT_INLINE Q nlerp(const Q& a, const Q& b, typename Q::Scalar t) {
+  return Q((a.coeffs() * (1.0 - t) + b.coeffs() * t).normalized());
 }
 
-template<typename Q>
-EIGEN_DONT_INLINE Q slerp_eigen(const Q& a, const Q& b, typename Q::Scalar t)
-{
-  return a.slerp(t,b);
+template <typename Q>
+EIGEN_DONT_INLINE Q slerp_eigen(const Q& a, const Q& b, typename Q::Scalar t) {
+  return a.slerp(t, b);
 }
 
-template<typename Q>
-EIGEN_DONT_INLINE Q slerp_legacy(const Q& a, const Q& b, typename Q::Scalar t)
-{
+template <typename Q>
+EIGEN_DONT_INLINE Q slerp_legacy(const Q& a, const Q& b, typename Q::Scalar t) {
   typedef typename Q::Scalar Scalar;
   static const Scalar one = Scalar(1) - dummy_precision<Scalar>();
   Scalar d = a.dot(b);
   Scalar absD = internal::abs(d);
-  if (absD>=one)
-    return a;
+  if (absD >= one) return a;
 
   // theta is the angle between the 2 quaternions
   Scalar theta = std::acos(absD);
   Scalar sinTheta = internal::sin(theta);
 
-  Scalar scale0 = internal::sin( ( Scalar(1) - t ) * theta) / sinTheta;
-  Scalar scale1 = internal::sin( ( t * theta) ) / sinTheta;
-  if (d<0)
-    scale1 = -scale1;
+  Scalar scale0 = internal::sin((Scalar(1) - t) * theta) / sinTheta;
+  Scalar scale1 = internal::sin((t * theta)) / sinTheta;
+  if (d < 0) scale1 = -scale1;
 
   return Q(scale0 * a.coeffs() + scale1 * b.coeffs());
 }
 
-template<typename Q>
-EIGEN_DONT_INLINE Q slerp_legacy_nlerp(const Q& a, const Q& b, typename Q::Scalar t)
-{
+template <typename Q>
+EIGEN_DONT_INLINE Q slerp_legacy_nlerp(const Q& a, const Q& b, typename Q::Scalar t) {
   typedef typename Q::Scalar Scalar;
   static const Scalar one = Scalar(1) - epsilon<Scalar>();
   Scalar d = a.dot(b);
   Scalar absD = internal::abs(d);
-  
+
   Scalar scale0;
   Scalar scale1;
-  
-  if (absD>=one)
-  {
+
+  if (absD >= one) {
     scale0 = Scalar(1) - t;
     scale1 = t;
-  }
-  else
-  {
+  } else {
     // theta is the angle between the 2 quaternions
     Scalar theta = std::acos(absD);
     Scalar sinTheta = internal::sin(theta);
 
-    scale0 = internal::sin( ( Scalar(1) - t ) * theta) / sinTheta;
-    scale1 = internal::sin( ( t * theta) ) / sinTheta;
-    if (d<0)
-      scale1 = -scale1;
+    scale0 = internal::sin((Scalar(1) - t) * theta) / sinTheta;
+    scale1 = internal::sin((t * theta)) / sinTheta;
+    if (d < 0) scale1 = -scale1;
   }
 
   return Q(scale0 * a.coeffs() + scale1 * b.coeffs());
 }
 
-template<typename T>
-inline T sin_over_x(T x)
-{
-  if (T(1) + x*x == T(1))
+template <typename T>
+inline T sin_over_x(T x) {
+  if (T(1) + x * x == T(1))
     return T(1);
   else
-    return std::sin(x)/x;
+    return std::sin(x) / x;
 }
 
-template<typename Q>
-EIGEN_DONT_INLINE Q slerp_rw(const Q& a, const Q& b, typename Q::Scalar t)
-{
+template <typename Q>
+EIGEN_DONT_INLINE Q slerp_rw(const Q& a, const Q& b, typename Q::Scalar t) {
   typedef typename Q::Scalar Scalar;
-  
+
   Scalar d = a.dot(b);
   Scalar theta;
-  if (d<0.0)
-    theta = /*M_PI -*/ Scalar(2)*std::asin( (a.coeffs()+b.coeffs()).norm()/2 );
+  if (d < 0.0)
+    theta = /*M_PI -*/ Scalar(2) * std::asin((a.coeffs() + b.coeffs()).norm() / 2);
   else
-    theta = Scalar(2)*std::asin( (a.coeffs()-b.coeffs()).norm()/2 );
-  
+    theta = Scalar(2) * std::asin((a.coeffs() - b.coeffs()).norm() / 2);
+
   // theta is the angle between the 2 quaternions
-//   Scalar theta = std::acos(absD);
+  //   Scalar theta = std::acos(absD);
   Scalar sinOverTheta = sin_over_x(theta);
 
-  Scalar scale0 = (Scalar(1)-t)*sin_over_x( ( Scalar(1) - t ) * theta) / sinOverTheta;
-  Scalar scale1 = t * sin_over_x( ( t * theta) ) / sinOverTheta;
-  if (d<0)
-    scale1 = -scale1;
+  Scalar scale0 = (Scalar(1) - t) * sin_over_x((Scalar(1) - t) * theta) / sinOverTheta;
+  Scalar scale1 = t * sin_over_x((t * theta)) / sinOverTheta;
+  if (d < 0) scale1 = -scale1;
 
   return Quaternion<Scalar>(scale0 * a.coeffs() + scale1 * b.coeffs());
 }
 
-template<typename Q>
-EIGEN_DONT_INLINE Q slerp_gael(const Q& a, const Q& b, typename Q::Scalar t)
-{
+template <typename Q>
+EIGEN_DONT_INLINE Q slerp_gael(const Q& a, const Q& b, typename Q::Scalar t) {
   typedef typename Q::Scalar Scalar;
-  
+
   Scalar d = a.dot(b);
   Scalar theta;
-//   theta = Scalar(2) * atan2((a.coeffs()-b.coeffs()).norm(),(a.coeffs()+b.coeffs()).norm());
-//   if (d<0.0)
-//     theta = M_PI-theta;
-  
-  if (d<0.0)
-    theta = /*M_PI -*/ Scalar(2)*std::asin( (-a.coeffs()-b.coeffs()).norm()/2 );
+  //   theta = Scalar(2) * atan2((a.coeffs()-b.coeffs()).norm(),(a.coeffs()+b.coeffs()).norm());
+  //   if (d<0.0)
+  //     theta = M_PI-theta;
+
+  if (d < 0.0)
+    theta = /*M_PI -*/ Scalar(2) * std::asin((-a.coeffs() - b.coeffs()).norm() / 2);
   else
-    theta = Scalar(2)*std::asin( (a.coeffs()-b.coeffs()).norm()/2 );
-  
-  
+    theta = Scalar(2) * std::asin((a.coeffs() - b.coeffs()).norm() / 2);
+
   Scalar scale0;
   Scalar scale1;
-  if(theta*theta-Scalar(6)==-Scalar(6))
-  {
+  if (theta * theta - Scalar(6) == -Scalar(6)) {
     scale0 = Scalar(1) - t;
     scale1 = t;
-  }
-  else
-  {
+  } else {
     Scalar sinTheta = std::sin(theta);
-    scale0 = internal::sin( ( Scalar(1) - t ) * theta) / sinTheta;
-    scale1 = internal::sin( ( t * theta) ) / sinTheta;
-    if (d<0)
-      scale1 = -scale1;
+    scale0 = internal::sin((Scalar(1) - t) * theta) / sinTheta;
+    scale1 = internal::sin((t * theta)) / sinTheta;
+    if (d < 0) scale1 = -scale1;
   }
 
   return Quaternion<Scalar>(scale0 * a.coeffs() + scale1 * b.coeffs());
 }
 
-int main()
-{
+int main() {
   typedef double RefScalar;
   typedef float TestScalar;
-  
-  typedef Quaternion<RefScalar>  Qd;
+
+  typedef Quaternion<RefScalar> Qd;
   typedef Quaternion<TestScalar> Qf;
-  
-  unsigned int g_seed = (unsigned int) time(NULL);
+
+  unsigned int g_seed = (unsigned int)time(NULL);
   std::cout << g_seed << "\n";
-//   g_seed = 1259932496;
+  //   g_seed = 1259932496;
   srand(g_seed);
-  
-  Matrix<RefScalar,Dynamic,1> maxerr(7);
+
+  Matrix<RefScalar, Dynamic, 1> maxerr(7);
   maxerr.setZero();
-  
-  Matrix<RefScalar,Dynamic,1> avgerr(7);
+
+  Matrix<RefScalar, Dynamic, 1> avgerr(7);
   avgerr.setZero();
-  
-  cout << "double=>float=>double       nlerp        eigen        legacy(snap)         legacy(nlerp)        rightway         gael's criteria\n";
-  
+
+  cout << "double=>float=>double       nlerp        eigen        legacy(snap)         legacy(nlerp)        rightway    "
+          "     gael's criteria\n";
+
   int rep = 100;
   int iters = 40;
-  for (int w=0; w<rep; ++w)
-  {
+  for (int w = 0; w < rep; ++w) {
     Qf a, b;
     a.coeffs().setRandom();
     a.normalize();
     b.coeffs().setRandom();
     b.normalize();
-    
+
     Qf c[6];
-    
+
     Qd ar(a.cast<RefScalar>());
     Qd br(b.cast<RefScalar>());
     Qd cr;
-    
-    
-    
+
     cout.precision(8);
     cout << std::scientific;
-    for (int i=0; i<iters; ++i)
-    {
+    for (int i = 0; i < iters; ++i) {
       RefScalar t = 0.65;
-      cr = slerp_rw(ar,br,t);
-      
+      cr = slerp_rw(ar, br, t);
+
       Qf refc = cr.cast<TestScalar>();
-      c[0] = nlerp(a,b,t);
-      c[1] = slerp_eigen(a,b,t);
-      c[2] = slerp_legacy(a,b,t);
-      c[3] = slerp_legacy_nlerp(a,b,t);
-      c[4] = slerp_rw(a,b,t);
-      c[5] = slerp_gael(a,b,t);
-      
+      c[0] = nlerp(a, b, t);
+      c[1] = slerp_eigen(a, b, t);
+      c[2] = slerp_legacy(a, b, t);
+      c[3] = slerp_legacy_nlerp(a, b, t);
+      c[4] = slerp_rw(a, b, t);
+      c[5] = slerp_gael(a, b, t);
+
       VectorXd err(7);
-      err[0] = (cr.coeffs()-refc.cast<RefScalar>().coeffs()).norm();
-//       std::cout << err[0] << "    ";
-      for (int k=0; k<6; ++k)
-      {
-        err[k+1] = (c[k].coeffs()-refc.coeffs()).norm();
-//         std::cout << err[k+1] << "    ";
+      err[0] = (cr.coeffs() - refc.cast<RefScalar>().coeffs()).norm();
+      //       std::cout << err[0] << "    ";
+      for (int k = 0; k < 6; ++k) {
+        err[k + 1] = (c[k].coeffs() - refc.coeffs()).norm();
+        //         std::cout << err[k+1] << "    ";
       }
       maxerr = maxerr.cwise().max(err);
       avgerr += err;
-//       std::cout << "\n";
+      //       std::cout << "\n";
       b = cr.cast<TestScalar>();
       br = cr;
     }
-//     std::cout << "\n";
+    //     std::cout << "\n";
   }
-  avgerr /= RefScalar(rep*iters);
+  avgerr /= RefScalar(rep * iters);
   cout << "\n\nAccuracy:\n"
        << "  max: " << maxerr.transpose() << "\n";
   cout << "  avg: " << avgerr.transpose() << "\n";
-  
+
   // perf bench
-  Quaternionf a,b;
+  Quaternionf a, b;
   a.coeffs().setRandom();
   a.normalize();
   b.coeffs().setRandom();
   b.normalize();
-  //b = a;
+  // b = a;
   float s = 0.65;
-    
-  #define BENCH(FUNC) {\
-    BenchTimer t; \
-    for(int k=0; k<2; ++k) {\
-      t.start(); \
-      for(int i=0; i<1000000; ++i) \
-        FUNC(a,b,s); \
-      t.stop(); \
-    } \
+
+#define BENCH(FUNC)                                           \
+  {                                                           \
+    BenchTimer t;                                             \
+    for (int k = 0; k < 2; ++k) {                             \
+      t.start();                                              \
+      for (int i = 0; i < 1000000; ++i) FUNC(a, b, s);        \
+      t.stop();                                               \
+    }                                                         \
     cout << "  " << #FUNC << " => \t " << t.value() << "s\n"; \
   }
-  
+
   cout << "\nSpeed:\n" << std::fixed;
   BENCH(nlerp);
   BENCH(slerp_eigen);
@@ -244,4 +218,3 @@
   BENCH(slerp_rw);
   BENCH(slerp_gael);
 }
-
diff --git a/bench/quatmul.cpp b/bench/quatmul.cpp
index 8d9d792..217c09c 100644
--- a/bench/quatmul.cpp
+++ b/bench/quatmul.cpp
@@ -3,45 +3,42 @@
 #include <Eigen/Geometry>
 #include <bench/BenchTimer.h>
 
-using namespace Eigen; 
+using namespace Eigen;
 
-template<typename Quat>
-EIGEN_DONT_INLINE void quatmul_default(const Quat& a, const Quat& b, Quat& c)
-{
+template <typename Quat>
+EIGEN_DONT_INLINE void quatmul_default(const Quat& a, const Quat& b, Quat& c) {
   c = a * b;
 }
 
-template<typename Quat>
-EIGEN_DONT_INLINE void quatmul_novec(const Quat& a, const Quat& b, Quat& c)
-{
-  c = internal::quat_product<0, Quat, Quat, typename Quat::Scalar, Aligned>::run(a,b);
+template <typename Quat>
+EIGEN_DONT_INLINE void quatmul_novec(const Quat& a, const Quat& b, Quat& c) {
+  c = internal::quat_product<0, Quat, Quat, typename Quat::Scalar, Aligned>::run(a, b);
 }
 
-template<typename Quat> void bench(const std::string& label)
-{
+template <typename Quat>
+void bench(const std::string& label) {
   int tries = 10;
   int rep = 1000000;
   BenchTimer t;
-  
+
   Quat a(4, 1, 2, 3);
   Quat b(2, 3, 4, 5);
   Quat c;
-  
+
   std::cout.precision(3);
-  
-  BENCH(t, tries, rep, quatmul_default(a,b,c));
-  std::cout << label << " default " << 1e3*t.best(CPU_TIMER) << "ms  \t" << 1e-6*double(rep)/(t.best(CPU_TIMER)) << " M mul/s\n";
-  
-  BENCH(t, tries, rep, quatmul_novec(a,b,c));
-  std::cout << label << " novec   " << 1e3*t.best(CPU_TIMER) << "ms  \t" << 1e-6*double(rep)/(t.best(CPU_TIMER)) << " M mul/s\n";
+
+  BENCH(t, tries, rep, quatmul_default(a, b, c));
+  std::cout << label << " default " << 1e3 * t.best(CPU_TIMER) << "ms  \t" << 1e-6 * double(rep) / (t.best(CPU_TIMER))
+            << " M mul/s\n";
+
+  BENCH(t, tries, rep, quatmul_novec(a, b, c));
+  std::cout << label << " novec   " << 1e3 * t.best(CPU_TIMER) << "ms  \t" << 1e-6 * double(rep) / (t.best(CPU_TIMER))
+            << " M mul/s\n";
 }
 
-int main()
-{
+int main() {
   bench<Quaternionf>("float ");
   bench<Quaterniond>("double");
 
   return 0;
-
 }
-
diff --git a/bench/sparse_cholesky.cpp b/bench/sparse_cholesky.cpp
index ecb2267..26d483a 100644
--- a/bench/sparse_cholesky.cpp
+++ b/bench/sparse_cholesky.cpp
@@ -3,7 +3,17 @@
 #include <iostream>
 #include <Eigen/Sparse>
 
-// g++ -DSIZE=10000 -DDENSITY=0.001  sparse_cholesky.cpp -I.. -DDENSEMATRI -O3 -g0 -DNDEBUG   -DNBTRIES=1 -I /home/gael/Coding/LinearAlgebra/taucs_full/src/ -I/home/gael/Coding/LinearAlgebra/taucs_full/build/linux/  -L/home/gael/Coding/LinearAlgebra/taucs_full/lib/linux/ -ltaucs /home/gael/Coding/LinearAlgebra/GotoBLAS/libgoto.a -lpthread -I /home/gael/Coding/LinearAlgebra/SuiteSparse/CHOLMOD/Include/ $CHOLLIB -I /home/gael/Coding/LinearAlgebra/SuiteSparse/UFconfig/ /home/gael/Coding/LinearAlgebra/SuiteSparse/CCOLAMD/Lib/libccolamd.a   /home/gael/Coding/LinearAlgebra/SuiteSparse/CHOLMOD/Lib/libcholmod.a -lmetis /home/gael/Coding/LinearAlgebra/SuiteSparse/AMD/Lib/libamd.a  /home/gael/Coding/LinearAlgebra/SuiteSparse/CAMD/Lib/libcamd.a   /home/gael/Coding/LinearAlgebra/SuiteSparse/CCOLAMD/Lib/libccolamd.a  /home/gael/Coding/LinearAlgebra/SuiteSparse/COLAMD/Lib/libcolamd.a -llapack && ./a.out
+// g++ -DSIZE=10000 -DDENSITY=0.001  sparse_cholesky.cpp -I.. -DDENSEMATRI -O3 -g0 -DNDEBUG   -DNBTRIES=1 -I
+// /home/gael/Coding/LinearAlgebra/taucs_full/src/ -I/home/gael/Coding/LinearAlgebra/taucs_full/build/linux/
+// -L/home/gael/Coding/LinearAlgebra/taucs_full/lib/linux/ -ltaucs /home/gael/Coding/LinearAlgebra/GotoBLAS/libgoto.a
+// -lpthread -I /home/gael/Coding/LinearAlgebra/SuiteSparse/CHOLMOD/Include/ $CHOLLIB -I
+// /home/gael/Coding/LinearAlgebra/SuiteSparse/UFconfig/
+// /home/gael/Coding/LinearAlgebra/SuiteSparse/CCOLAMD/Lib/libccolamd.a
+// /home/gael/Coding/LinearAlgebra/SuiteSparse/CHOLMOD/Lib/libcholmod.a -lmetis
+// /home/gael/Coding/LinearAlgebra/SuiteSparse/AMD/Lib/libamd.a
+// /home/gael/Coding/LinearAlgebra/SuiteSparse/CAMD/Lib/libcamd.a
+// /home/gael/Coding/LinearAlgebra/SuiteSparse/CCOLAMD/Lib/libccolamd.a
+// /home/gael/Coding/LinearAlgebra/SuiteSparse/COLAMD/Lib/libcolamd.a -llapack && ./a.out
 
 #define NOGMM
 #define NOMTL
@@ -30,52 +40,47 @@
 #define NBTRIES 10
 #endif
 
-#define BENCH(X) \
-  timer.reset(); \
-  for (int _j=0; _j<NBTRIES; ++_j) { \
-    timer.start(); \
-    for (int _k=0; _k<REPEAT; ++_k) { \
-        X  \
-  } timer.stop(); }
+#define BENCH(X)                          \
+  timer.reset();                          \
+  for (int _j = 0; _j < NBTRIES; ++_j) {  \
+    timer.start();                        \
+    for (int _k = 0; _k < REPEAT; ++_k) { \
+      X                                   \
+    }                                     \
+    timer.stop();                         \
+  }
 
 // typedef SparseMatrix<Scalar,UpperTriangular> EigenSparseTriMatrix;
-typedef SparseMatrix<Scalar,SelfAdjoint|LowerTriangular> EigenSparseSelfAdjointMatrix;
+typedef SparseMatrix<Scalar, SelfAdjoint | LowerTriangular> EigenSparseSelfAdjointMatrix;
 
-void fillSpdMatrix(float density, int rows, int cols,  EigenSparseSelfAdjointMatrix& dst)
-{
-  dst.startFill(rows*cols*density);
-  for(int j = 0; j < cols; j++)
-  {
-    dst.fill(j,j) = internal::random<Scalar>(10,20);
-    for(int i = j+1; i < rows; i++)
-    {
-      Scalar v = (internal::random<float>(0,1) < density) ? internal::random<Scalar>() : 0;
-      if (v!=0)
-        dst.fill(i,j) = v;
+void fillSpdMatrix(float density, int rows, int cols, EigenSparseSelfAdjointMatrix& dst) {
+  dst.startFill(rows * cols * density);
+  for (int j = 0; j < cols; j++) {
+    dst.fill(j, j) = internal::random<Scalar>(10, 20);
+    for (int i = j + 1; i < rows; i++) {
+      Scalar v = (internal::random<float>(0, 1) < density) ? internal::random<Scalar>() : 0;
+      if (v != 0) dst.fill(i, j) = v;
     }
-
   }
   dst.endFill();
 }
 
 #include <Eigen/Cholesky>
 
-template<int Backend>
-void doEigen(const char* name, const EigenSparseSelfAdjointMatrix& sm1, int flags = 0)
-{
+template <int Backend>
+void doEigen(const char* name, const EigenSparseSelfAdjointMatrix& sm1, int flags = 0) {
   std::cout << name << "..." << std::flush;
   BenchTimer timer;
   timer.start();
-  SparseLLT<EigenSparseSelfAdjointMatrix,Backend> chol(sm1, flags);
+  SparseLLT<EigenSparseSelfAdjointMatrix, Backend> chol(sm1, flags);
   timer.stop();
   std::cout << ":\t" << timer.value() << endl;
 
   std::cout << "  nnz: " << sm1.nonZeros() << " => " << chol.matrixL().nonZeros() << "\n";
-//   std::cout << "sparse\n" << chol.matrixL() << "%\n";
+  //   std::cout << "sparse\n" << chol.matrixL() << "%\n";
 }
 
-int main(int argc, char *argv[])
-{
+int main(int argc, char* argv[]) {
   int rows = SIZE;
   int cols = SIZE;
   float density = DENSITY;
@@ -86,27 +91,26 @@
 
   bool densedone = false;
 
-  //for (float density = DENSITY; density>=MINDENSITY; density*=0.5)
-//   float density = 0.5;
+  // for (float density = DENSITY; density>=MINDENSITY; density*=0.5)
+  //   float density = 0.5;
   {
     EigenSparseSelfAdjointMatrix sm1(rows, cols);
     std::cout << "Generate sparse matrix (might take a while)...\n";
     fillSpdMatrix(density, rows, cols, sm1);
     std::cout << "DONE\n\n";
 
-    // dense matrices
-    #ifdef DENSEMATRIX
-    if (!densedone)
-    {
+// dense matrices
+#ifdef DENSEMATRIX
+    if (!densedone) {
       densedone = true;
-      std::cout << "Eigen Dense\t" << density*100 << "%\n";
-      DenseMatrix m1(rows,cols);
+      std::cout << "Eigen Dense\t" << density * 100 << "%\n";
+      DenseMatrix m1(rows, cols);
       eiToDense(sm1, m1);
       m1 = (m1 + m1.transpose()).eval();
       m1.diagonal() *= 0.5;
 
-//       BENCH(LLT<DenseMatrix> chol(m1);)
-//       std::cout << "dense:\t" << timer.value() << endl;
+      //       BENCH(LLT<DenseMatrix> chol(m1);)
+      //       std::cout << "dense:\t" << timer.value() << endl;
 
       BenchTimer timer;
       timer.start();
@@ -114,27 +118,27 @@
       timer.stop();
       std::cout << "dense:\t" << timer.value() << endl;
       int count = 0;
-      for (int j=0; j<cols; ++j)
-        for (int i=j; i<rows; ++i)
-          if (!internal::isMuchSmallerThan(internal::abs(chol.matrixL()(i,j)), 0.1))
-            count++;
-      std::cout << "dense: " << "nnz = " << count << "\n";
-//       std::cout << "dense:\n" << m1 << "\n\n" << chol.matrixL() << endl;
+      for (int j = 0; j < cols; ++j)
+        for (int i = j; i < rows; ++i)
+          if (!internal::isMuchSmallerThan(internal::abs(chol.matrixL()(i, j)), 0.1)) count++;
+      std::cout << "dense: "
+                << "nnz = " << count << "\n";
+      //       std::cout << "dense:\n" << m1 << "\n\n" << chol.matrixL() << endl;
     }
-    #endif
+#endif
 
     // eigen sparse matrices
     doEigen<Eigen::DefaultBackend>("Eigen/Sparse", sm1, Eigen::IncompleteFactorization);
 
-    #ifdef EIGEN_CHOLMOD_SUPPORT
+#ifdef EIGEN_CHOLMOD_SUPPORT
     doEigen<Eigen::Cholmod>("Eigen/Cholmod", sm1, Eigen::IncompleteFactorization);
-    #endif
+#endif
 
-    #ifdef EIGEN_TAUCS_SUPPORT
+#ifdef EIGEN_TAUCS_SUPPORT
     doEigen<Eigen::Taucs>("Eigen/Taucs", sm1, Eigen::IncompleteFactorization);
-    #endif
+#endif
 
-    #if 0
+#if 0
     // TAUCS
     {
       taucs_ccs_matrix A = sm1.asTaucsMatrix();
@@ -153,7 +157,7 @@
     }
 
     // CHOLMOD
-    #ifdef EIGEN_CHOLMOD_SUPPORT
+#ifdef EIGEN_CHOLMOD_SUPPORT
     {
       cholmod_common c;
       cholmod_start (&c);
@@ -202,15 +206,10 @@
 //             std::cout << chol->values.s[i] << " ";
 //       }
     }
-    #endif
+#endif
 
-    #endif
-
-
-
+#endif
   }
 
-
   return 0;
 }
-
diff --git a/bench/sparse_dense_product.cpp b/bench/sparse_dense_product.cpp
index f3f5194..5e977b0 100644
--- a/bench/sparse_dense_product.cpp
+++ b/bench/sparse_dense_product.cpp
@@ -1,8 +1,9 @@
 
-//g++ -O3 -g0 -DNDEBUG  sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
-//g++ -O3 -g0 -DNDEBUG  sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
-// -DNOGMM -DNOMTL -DCSPARSE
-// -I /home/gael/Coding/LinearAlgebra/CSparse/Include/ /home/gael/Coding/LinearAlgebra/CSparse/Lib/libcsparse.a
+// g++ -O3 -g0 -DNDEBUG  sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 &&
+// ./a.out g++ -O3 -g0 -DNDEBUG  sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05
+// -DSIZE=2000 && ./a.out
+//  -DNOGMM -DNOMTL -DCSPARSE
+//  -I /home/gael/Coding/LinearAlgebra/CSparse/Include/ /home/gael/Coding/LinearAlgebra/CSparse/Lib/libcsparse.a
 #ifndef SIZE
 #define SIZE 650000
 #endif
@@ -25,163 +26,160 @@
 #define NBTRIES 10
 #endif
 
-#define BENCH(X) \
-  timer.reset(); \
-  for (int _j=0; _j<NBTRIES; ++_j) { \
-    timer.start(); \
-    for (int _k=0; _k<REPEAT; ++_k) { \
-        X  \
-  } timer.stop(); }
-
+#define BENCH(X)                          \
+  timer.reset();                          \
+  for (int _j = 0; _j < NBTRIES; ++_j) {  \
+    timer.start();                        \
+    for (int _k = 0; _k < REPEAT; ++_k) { \
+      X                                   \
+    }                                     \
+    timer.stop();                         \
+  }
 
 #ifdef CSPARSE
-cs* cs_sorted_multiply(const cs* a, const cs* b)
-{
-  cs* A = cs_transpose (a, 1) ;
-  cs* B = cs_transpose (b, 1) ;
-  cs* D = cs_multiply (B,A) ;   /* D = B'*A' */
-  cs_spfree (A) ;
-  cs_spfree (B) ;
-  cs_dropzeros (D) ;      /* drop zeros from D */
-  cs* C = cs_transpose (D, 1) ;   /* C = D', so that C is sorted */
-  cs_spfree (D) ;
+cs* cs_sorted_multiply(const cs* a, const cs* b) {
+  cs* A = cs_transpose(a, 1);
+  cs* B = cs_transpose(b, 1);
+  cs* D = cs_multiply(B, A); /* D = B'*A' */
+  cs_spfree(A);
+  cs_spfree(B);
+  cs_dropzeros(D);            /* drop zeros from D */
+  cs* C = cs_transpose(D, 1); /* C = D', so that C is sorted */
+  cs_spfree(D);
   return C;
 }
 #endif
 
-int main(int argc, char *argv[])
-{
+int main(int argc, char* argv[]) {
   int rows = SIZE;
   int cols = SIZE;
   float density = DENSITY;
 
-  EigenSparseMatrix sm1(rows,cols);
+  EigenSparseMatrix sm1(rows, cols);
   DenseVector v1(cols), v2(cols);
   v1.setRandom();
 
   BenchTimer timer;
-  for (float density = DENSITY; density>=MINDENSITY; density*=0.5)
-  {
-    //fillMatrix(density, rows, cols, sm1);
+  for (float density = DENSITY; density >= MINDENSITY; density *= 0.5) {
+    // fillMatrix(density, rows, cols, sm1);
     fillMatrix2(7, rows, cols, sm1);
 
-    // dense matrices
-    #ifdef DENSEMATRIX
+// dense matrices
+#ifdef DENSEMATRIX
     {
-      std::cout << "Eigen Dense\t" << density*100 << "%\n";
-      DenseMatrix m1(rows,cols);
+      std::cout << "Eigen Dense\t" << density * 100 << "%\n";
+      DenseMatrix m1(rows, cols);
       eiToDense(sm1, m1);
 
       timer.reset();
       timer.start();
-      for (int k=0; k<REPEAT; ++k)
-        v2 = m1 * v1;
+      for (int k = 0; k < REPEAT; ++k) v2 = m1 * v1;
       timer.stop();
-      std::cout << "   a * v:\t" << timer.best() << "  " << double(REPEAT)/timer.best() << " * / sec " << endl;
+      std::cout << "   a * v:\t" << timer.best() << "  " << double(REPEAT) / timer.best() << " * / sec " << endl;
 
       timer.reset();
       timer.start();
-      for (int k=0; k<REPEAT; ++k)
-        v2 = m1.transpose() * v1;
+      for (int k = 0; k < REPEAT; ++k) v2 = m1.transpose() * v1;
       timer.stop();
       std::cout << "   a' * v:\t" << timer.best() << endl;
     }
-    #endif
+#endif
 
     // eigen sparse matrices
     {
-      std::cout << "Eigen sparse\t" << sm1.nonZeros()/float(sm1.rows()*sm1.cols())*100 << "%\n";
+      std::cout << "Eigen sparse\t" << sm1.nonZeros() / float(sm1.rows() * sm1.cols()) * 100 << "%\n";
 
       BENCH(asm("#myc"); v2 = sm1 * v1; asm("#myd");)
-      std::cout << "   a * v:\t" << timer.best()/REPEAT << "  " << double(REPEAT)/timer.best(REAL_TIMER) << " * / sec " << endl;
+      std::cout << "   a * v:\t" << timer.best() / REPEAT << "  " << double(REPEAT) / timer.best(REAL_TIMER)
+                << " * / sec " << endl;
 
+      BENCH({
+        asm("#mya");
+        v2 = sm1.transpose() * v1;
+        asm("#myb");
+      })
 
-      BENCH( { asm("#mya"); v2 = sm1.transpose() * v1; asm("#myb"); })
-
-      std::cout << "   a' * v:\t" << timer.best()/REPEAT << endl;
+      std::cout << "   a' * v:\t" << timer.best() / REPEAT << endl;
     }
 
-//     {
-//       DynamicSparseMatrix<Scalar> m1(sm1);
-//       std::cout << "Eigen dyn-sparse\t" << m1.nonZeros()/float(m1.rows()*m1.cols())*100 << "%\n";
-//
-//       BENCH(for (int k=0; k<REPEAT; ++k) v2 = m1 * v1;)
-//       std::cout << "   a * v:\t" << timer.value() << endl;
-//
-//       BENCH(for (int k=0; k<REPEAT; ++k) v2 = m1.transpose() * v1;)
-//       std::cout << "   a' * v:\t" << timer.value() << endl;
-//     }
+    //     {
+    //       DynamicSparseMatrix<Scalar> m1(sm1);
+    //       std::cout << "Eigen dyn-sparse\t" << m1.nonZeros()/float(m1.rows()*m1.cols())*100 << "%\n";
+    //
+    //       BENCH(for (int k=0; k<REPEAT; ++k) v2 = m1 * v1;)
+    //       std::cout << "   a * v:\t" << timer.value() << endl;
+    //
+    //       BENCH(for (int k=0; k<REPEAT; ++k) v2 = m1.transpose() * v1;)
+    //       std::cout << "   a' * v:\t" << timer.value() << endl;
+    //     }
 
-    // GMM++
-    #ifndef NOGMM
+// GMM++
+#ifndef NOGMM
     {
-      std::cout << "GMM++ sparse\t" << density*100 << "%\n";
-      //GmmDynSparse  gmmT3(rows,cols);
-      GmmSparse m1(rows,cols);
+      std::cout << "GMM++ sparse\t" << density * 100 << "%\n";
+      // GmmDynSparse  gmmT3(rows,cols);
+      GmmSparse m1(rows, cols);
       eiToGmm(sm1, m1);
 
       std::vector<Scalar> gmmV1(cols), gmmV2(cols);
-      Map<Matrix<Scalar,Dynamic,1> >(&gmmV1[0], cols) = v1;
-      Map<Matrix<Scalar,Dynamic,1> >(&gmmV2[0], cols) = v2;
+      Map<Matrix<Scalar, Dynamic, 1> >(&gmmV1[0], cols) = v1;
+      Map<Matrix<Scalar, Dynamic, 1> >(&gmmV2[0], cols) = v2;
 
-      BENCH( asm("#myx"); gmm::mult(m1, gmmV1, gmmV2); asm("#myy"); )
+      BENCH(asm("#myx"); gmm::mult(m1, gmmV1, gmmV2); asm("#myy");)
       std::cout << "   a * v:\t" << timer.value() << endl;
 
-      BENCH( gmm::mult(gmm::transposed(m1), gmmV1, gmmV2); )
+      BENCH(gmm::mult(gmm::transposed(m1), gmmV1, gmmV2);)
       std::cout << "   a' * v:\t" << timer.value() << endl;
     }
-    #endif
-    
-    #ifndef NOUBLAS
+#endif
+
+#ifndef NOUBLAS
     {
-      std::cout << "ublas sparse\t" << density*100 << "%\n";
-      UBlasSparse m1(rows,cols);
+      std::cout << "ublas sparse\t" << density * 100 << "%\n";
+      UBlasSparse m1(rows, cols);
       eiToUblas(sm1, m1);
-      
+
       boost::numeric::ublas::vector<Scalar> uv1, uv2;
-      eiToUblasVec(v1,uv1);
-      eiToUblasVec(v2,uv2);
+      eiToUblasVec(v1, uv1);
+      eiToUblasVec(v2, uv2);
 
-//       std::vector<Scalar> gmmV1(cols), gmmV2(cols);
-//       Map<Matrix<Scalar,Dynamic,1> >(&gmmV1[0], cols) = v1;
-//       Map<Matrix<Scalar,Dynamic,1> >(&gmmV2[0], cols) = v2;
+      //       std::vector<Scalar> gmmV1(cols), gmmV2(cols);
+      //       Map<Matrix<Scalar,Dynamic,1> >(&gmmV1[0], cols) = v1;
+      //       Map<Matrix<Scalar,Dynamic,1> >(&gmmV2[0], cols) = v2;
 
-      BENCH( uv2 = boost::numeric::ublas::prod(m1, uv1); )
+      BENCH(uv2 = boost::numeric::ublas::prod(m1, uv1);)
       std::cout << "   a * v:\t" << timer.value() << endl;
 
-//       BENCH( boost::ublas::prod(gmm::transposed(m1), gmmV1, gmmV2); )
-//       std::cout << "   a' * v:\t" << timer.value() << endl;
+      //       BENCH( boost::ublas::prod(gmm::transposed(m1), gmmV1, gmmV2); )
+      //       std::cout << "   a' * v:\t" << timer.value() << endl;
     }
-    #endif
+#endif
 
-    // MTL4
-    #ifndef NOMTL
+// MTL4
+#ifndef NOMTL
     {
-      std::cout << "MTL4\t" << density*100 << "%\n";
-      MtlSparse m1(rows,cols);
+      std::cout << "MTL4\t" << density * 100 << "%\n";
+      MtlSparse m1(rows, cols);
       eiToMtl(sm1, m1);
       mtl::dense_vector<Scalar> mtlV1(cols, 1.0);
       mtl::dense_vector<Scalar> mtlV2(cols, 1.0);
 
       timer.reset();
       timer.start();
-      for (int k=0; k<REPEAT; ++k)
-        mtlV2 = m1 * mtlV1;
+      for (int k = 0; k < REPEAT; ++k) mtlV2 = m1 * mtlV1;
       timer.stop();
       std::cout << "   a * v:\t" << timer.value() << endl;
 
       timer.reset();
       timer.start();
-      for (int k=0; k<REPEAT; ++k)
-        mtlV2 = trans(m1) * mtlV1;
+      for (int k = 0; k < REPEAT; ++k) mtlV2 = trans(m1) * mtlV1;
       timer.stop();
       std::cout << "   a' * v:\t" << timer.value() << endl;
     }
-    #endif
+#endif
 
     std::cout << "\n\n";
   }
 
   return 0;
 }
-
diff --git a/bench/sparse_lu.cpp b/bench/sparse_lu.cpp
index 5c75001..f074e55 100644
--- a/bench/sparse_lu.cpp
+++ b/bench/sparse_lu.cpp
@@ -30,47 +30,49 @@
 #define NBTRIES 10
 #endif
 
-#define BENCH(X) \
-  timer.reset(); \
-  for (int _j=0; _j<NBTRIES; ++_j) { \
-    timer.start(); \
-    for (int _k=0; _k<REPEAT; ++_k) { \
-        X  \
-  } timer.stop(); }
+#define BENCH(X)                          \
+  timer.reset();                          \
+  for (int _j = 0; _j < NBTRIES; ++_j) {  \
+    timer.start();                        \
+    for (int _k = 0; _k < REPEAT; ++_k) { \
+      X                                   \
+    }                                     \
+    timer.stop();                         \
+  }
 
-typedef Matrix<Scalar,Dynamic,1> VectorX;
+typedef Matrix<Scalar, Dynamic, 1> VectorX;
 
 #include <Eigen/LU>
 
-template<int Backend>
-void doEigen(const char* name, const EigenSparseMatrix& sm1, const VectorX& b, VectorX& x, int flags = 0)
-{
+template <int Backend>
+void doEigen(const char* name, const EigenSparseMatrix& sm1, const VectorX& b, VectorX& x, int flags = 0) {
   std::cout << name << "..." << std::flush;
-  BenchTimer timer; timer.start();
-  SparseLU<EigenSparseMatrix,Backend> lu(sm1, flags);
+  BenchTimer timer;
+  timer.start();
+  SparseLU<EigenSparseMatrix, Backend> lu(sm1, flags);
   timer.stop();
   if (lu.succeeded())
     std::cout << ":\t" << timer.value() << endl;
-  else
-  {
+  else {
     std::cout << ":\t FAILED" << endl;
     return;
   }
 
   bool ok;
-  timer.reset(); timer.start();
-  ok = lu.solve(b,&x);
+  timer.reset();
+  timer.start();
+  ok = lu.solve(b, &x);
   timer.stop();
   if (ok)
     std::cout << "  solve:\t" << timer.value() << endl;
   else
-    std::cout << "  solve:\t" << " FAILED" << endl;
+    std::cout << "  solve:\t"
+              << " FAILED" << endl;
 
-  //std::cout << x.transpose() << "\n";
+  // std::cout << x.transpose() << "\n";
 }
 
-int main(int argc, char *argv[])
-{
+int main(int argc, char* argv[]) {
   int rows = SIZE;
   int cols = SIZE;
   float density = DENSITY;
@@ -81,19 +83,18 @@
 
   bool densedone = false;
 
-  //for (float density = DENSITY; density>=MINDENSITY; density*=0.5)
-//   float density = 0.5;
+  // for (float density = DENSITY; density>=MINDENSITY; density*=0.5)
+  //   float density = 0.5;
   {
     EigenSparseMatrix sm1(rows, cols);
     fillMatrix(density, rows, cols, sm1);
 
-    // dense matrices
-    #ifdef DENSEMATRIX
-    if (!densedone)
-    {
+// dense matrices
+#ifdef DENSEMATRIX
+    if (!densedone) {
       densedone = true;
-      std::cout << "Eigen Dense\t" << density*100 << "%\n";
-      DenseMatrix m1(rows,cols);
+      std::cout << "Eigen Dense\t" << density * 100 << "%\n";
+      DenseMatrix m1(rows, cols);
       eiToDense(sm1, m1);
 
       BenchTimer timer;
@@ -104,29 +105,27 @@
 
       timer.reset();
       timer.start();
-      lu.solve(b,&x);
+      lu.solve(b, &x);
       timer.stop();
       std::cout << "  solve:\t" << timer.value() << endl;
-//       std::cout << b.transpose() << "\n";
-//       std::cout << x.transpose() << "\n";
+      //       std::cout << b.transpose() << "\n";
+      //       std::cout << x.transpose() << "\n";
     }
-    #endif
+#endif
 
-    #ifdef EIGEN_UMFPACK_SUPPORT
+#ifdef EIGEN_UMFPACK_SUPPORT
     x.setZero();
     doEigen<Eigen::UmfPack>("Eigen/UmfPack (auto)", sm1, b, x, 0);
-    #endif
+#endif
 
-    #ifdef EIGEN_SUPERLU_SUPPORT
+#ifdef EIGEN_SUPERLU_SUPPORT
     x.setZero();
     doEigen<Eigen::SuperLU>("Eigen/SuperLU (nat)", sm1, b, x, Eigen::NaturalOrdering);
-//     doEigen<Eigen::SuperLU>("Eigen/SuperLU (MD AT+A)", sm1, b, x, Eigen::MinimumDegree_AT_PLUS_A);
-//     doEigen<Eigen::SuperLU>("Eigen/SuperLU (MD ATA)", sm1, b, x, Eigen::MinimumDegree_ATA);
+    //     doEigen<Eigen::SuperLU>("Eigen/SuperLU (MD AT+A)", sm1, b, x, Eigen::MinimumDegree_AT_PLUS_A);
+    //     doEigen<Eigen::SuperLU>("Eigen/SuperLU (MD ATA)", sm1, b, x, Eigen::MinimumDegree_ATA);
     doEigen<Eigen::SuperLU>("Eigen/SuperLU (COLAMD)", sm1, b, x, Eigen::ColApproxMinimumDegree);
-    #endif
-
+#endif
   }
 
   return 0;
 }
-
diff --git a/bench/sparse_product.cpp b/bench/sparse_product.cpp
index d2fc44f..cf91080 100644
--- a/bench/sparse_product.cpp
+++ b/bench/sparse_product.cpp
@@ -1,8 +1,9 @@
 
-//g++ -O3 -g0 -DNDEBUG  sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
-//g++ -O3 -g0 -DNDEBUG  sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
-// -DNOGMM -DNOMTL -DCSPARSE
-// -I /home/gael/Coding/LinearAlgebra/CSparse/Include/ /home/gael/Coding/LinearAlgebra/CSparse/Lib/libcsparse.a
+// g++ -O3 -g0 -DNDEBUG  sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 &&
+// ./a.out g++ -O3 -g0 -DNDEBUG  sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05
+// -DSIZE=2000 && ./a.out
+//  -DNOGMM -DNOMTL -DCSPARSE
+//  -I /home/gael/Coding/LinearAlgebra/CSparse/Include/ /home/gael/Coding/LinearAlgebra/CSparse/Lib/libcsparse.a
 
 #include <typeinfo>
 
@@ -27,13 +28,15 @@
 #define NBTRIES 1
 #endif
 
-#define BENCH(X) \
-  timer.reset(); \
-  for (int _j=0; _j<NBTRIES; ++_j) { \
-    timer.start(); \
-    for (int _k=0; _k<REPEAT; ++_k) { \
-        X  \
-  } timer.stop(); }
+#define BENCH(X)                          \
+  timer.reset();                          \
+  for (int _j = 0; _j < NBTRIES; ++_j) {  \
+    timer.start();                        \
+    for (int _k = 0; _k < REPEAT; ++_k) { \
+      X                                   \
+    }                                     \
+    timer.stop();                         \
+  }
 
 // #ifdef MKL
 //
@@ -59,33 +62,30 @@
 //
 // #endif
 
-
 #ifdef CSPARSE
-cs* cs_sorted_multiply(const cs* a, const cs* b)
-{
-//   return cs_multiply(a,b);
+cs* cs_sorted_multiply(const cs* a, const cs* b) {
+  //   return cs_multiply(a,b);
 
   cs* A = cs_transpose(a, 1);
   cs* B = cs_transpose(b, 1);
-  cs* D = cs_multiply(B,A);   /* D = B'*A' */
-  cs_spfree (A) ;
-  cs_spfree (B) ;
-  cs_dropzeros (D) ;      /* drop zeros from D */
-  cs* C = cs_transpose (D, 1) ;   /* C = D', so that C is sorted */
-  cs_spfree (D) ;
+  cs* D = cs_multiply(B, A); /* D = B'*A' */
+  cs_spfree(A);
+  cs_spfree(B);
+  cs_dropzeros(D);            /* drop zeros from D */
+  cs* C = cs_transpose(D, 1); /* C = D', so that C is sorted */
+  cs_spfree(D);
   return C;
 
-//   cs* A = cs_transpose(a, 1);
-//   cs* C = cs_transpose(A, 1);
-//   return C;
+  //   cs* A = cs_transpose(a, 1);
+  //   cs* C = cs_transpose(A, 1);
+  //   return C;
 }
 
-cs* cs_sorted_multiply2(const cs* a, const cs* b)
-{
-  cs* D = cs_multiply(a,b);
-  cs* E = cs_transpose(D,1);
+cs* cs_sorted_multiply2(const cs* a, const cs* b) {
+  cs* D = cs_multiply(a, b);
+  cs* E = cs_transpose(D, 1);
   cs_spfree(D);
-  cs* C = cs_transpose(E,1);
+  cs* C = cs_transpose(E, 1);
   cs_spfree(E);
   return C;
 }
@@ -93,231 +93,218 @@
 
 void bench_sort();
 
-int main(int argc, char *argv[])
-{
-//   bench_sort();
+int main(int argc, char* argv[]) {
+  //   bench_sort();
 
   int rows = SIZE;
   int cols = SIZE;
   float density = DENSITY;
 
-  EigenSparseMatrix sm1(rows,cols), sm2(rows,cols), sm3(rows,cols), sm4(rows,cols);
+  EigenSparseMatrix sm1(rows, cols), sm2(rows, cols), sm3(rows, cols), sm4(rows, cols);
 
   BenchTimer timer;
-  for (int nnzPerCol = NNZPERCOL; nnzPerCol>1; nnzPerCol/=1.1)
-  {
+  for (int nnzPerCol = NNZPERCOL; nnzPerCol > 1; nnzPerCol /= 1.1) {
     sm1.setZero();
     sm2.setZero();
     fillMatrix2(nnzPerCol, rows, cols, sm1);
     fillMatrix2(nnzPerCol, rows, cols, sm2);
-//     std::cerr << "filling OK\n";
+    //     std::cerr << "filling OK\n";
 
-    // dense matrices
-    #ifdef DENSEMATRIX
+// dense matrices
+#ifdef DENSEMATRIX
     {
       std::cout << "Eigen Dense\t" << nnzPerCol << "%\n";
-      DenseMatrix m1(rows,cols), m2(rows,cols), m3(rows,cols);
+      DenseMatrix m1(rows, cols), m2(rows, cols), m3(rows, cols);
       eiToDense(sm1, m1);
       eiToDense(sm2, m2);
 
       timer.reset();
       timer.start();
-      for (int k=0; k<REPEAT; ++k)
-        m3 = m1 * m2;
+      for (int k = 0; k < REPEAT; ++k) m3 = m1 * m2;
       timer.stop();
       std::cout << "   a * b:\t" << timer.value() << endl;
 
       timer.reset();
       timer.start();
-      for (int k=0; k<REPEAT; ++k)
-        m3 = m1.transpose() * m2;
+      for (int k = 0; k < REPEAT; ++k) m3 = m1.transpose() * m2;
       timer.stop();
       std::cout << "   a' * b:\t" << timer.value() << endl;
 
       timer.reset();
       timer.start();
-      for (int k=0; k<REPEAT; ++k)
-        m3 = m1.transpose() * m2.transpose();
+      for (int k = 0; k < REPEAT; ++k) m3 = m1.transpose() * m2.transpose();
       timer.stop();
       std::cout << "   a' * b':\t" << timer.value() << endl;
 
       timer.reset();
       timer.start();
-      for (int k=0; k<REPEAT; ++k)
-        m3 = m1 * m2.transpose();
+      for (int k = 0; k < REPEAT; ++k) m3 = m1 * m2.transpose();
       timer.stop();
       std::cout << "   a * b':\t" << timer.value() << endl;
     }
-    #endif
+#endif
 
     // eigen sparse matrices
     {
-      std::cout << "Eigen sparse\t" << sm1.nonZeros()/(float(sm1.rows())*float(sm1.cols()))*100 << "% * "
-                << sm2.nonZeros()/(float(sm2.rows())*float(sm2.cols()))*100 << "%\n";
+      std::cout << "Eigen sparse\t" << sm1.nonZeros() / (float(sm1.rows()) * float(sm1.cols())) * 100 << "% * "
+                << sm2.nonZeros() / (float(sm2.rows()) * float(sm2.cols())) * 100 << "%\n";
 
-      BENCH(sm3 = sm1 * sm2; )
+      BENCH(sm3 = sm1 * sm2;)
       std::cout << "   a * b:\t" << timer.value() << endl;
 
-//       BENCH(sm3 = sm1.transpose() * sm2; )
-//       std::cout << "   a' * b:\t" << timer.value() << endl;
-// //
-//       BENCH(sm3 = sm1.transpose() * sm2.transpose(); )
-//       std::cout << "   a' * b':\t" << timer.value() << endl;
-// //
-//       BENCH(sm3 = sm1 * sm2.transpose(); )
-//       std::cout << "   a * b' :\t" << timer.value() << endl;
+      //       BENCH(sm3 = sm1.transpose() * sm2; )
+      //       std::cout << "   a' * b:\t" << timer.value() << endl;
+      // //
+      //       BENCH(sm3 = sm1.transpose() * sm2.transpose(); )
+      //       std::cout << "   a' * b':\t" << timer.value() << endl;
+      // //
+      //       BENCH(sm3 = sm1 * sm2.transpose(); )
+      //       std::cout << "   a * b' :\t" << timer.value() << endl;
 
-
-//       std::cout << "\n";
-//
-//       BENCH( sm3._experimentalNewProduct(sm1, sm2); )
-//       std::cout << "   a * b:\t" << timer.value() << endl;
-//
-//       BENCH(sm3._experimentalNewProduct(sm1.transpose(),sm2); )
-//       std::cout << "   a' * b:\t" << timer.value() << endl;
-// //
-//       BENCH(sm3._experimentalNewProduct(sm1.transpose(),sm2.transpose()); )
-//       std::cout << "   a' * b':\t" << timer.value() << endl;
-// //
-//       BENCH(sm3._experimentalNewProduct(sm1, sm2.transpose());)
-//       std::cout << "   a * b' :\t" << timer.value() << endl;
+      //       std::cout << "\n";
+      //
+      //       BENCH( sm3._experimentalNewProduct(sm1, sm2); )
+      //       std::cout << "   a * b:\t" << timer.value() << endl;
+      //
+      //       BENCH(sm3._experimentalNewProduct(sm1.transpose(),sm2); )
+      //       std::cout << "   a' * b:\t" << timer.value() << endl;
+      // //
+      //       BENCH(sm3._experimentalNewProduct(sm1.transpose(),sm2.transpose()); )
+      //       std::cout << "   a' * b':\t" << timer.value() << endl;
+      // //
+      //       BENCH(sm3._experimentalNewProduct(sm1, sm2.transpose());)
+      //       std::cout << "   a * b' :\t" << timer.value() << endl;
     }
 
-    // eigen dyn-sparse matrices
-    /*{
-      DynamicSparseMatrix<Scalar> m1(sm1), m2(sm2), m3(sm3);
-      std::cout << "Eigen dyn-sparse\t" << m1.nonZeros()/(float(m1.rows())*float(m1.cols()))*100 << "% * "
-                << m2.nonZeros()/(float(m2.rows())*float(m2.cols()))*100 << "%\n";
+// eigen dyn-sparse matrices
+/*{
+  DynamicSparseMatrix<Scalar> m1(sm1), m2(sm2), m3(sm3);
+  std::cout << "Eigen dyn-sparse\t" << m1.nonZeros()/(float(m1.rows())*float(m1.cols()))*100 << "% * "
+            << m2.nonZeros()/(float(m2.rows())*float(m2.cols()))*100 << "%\n";
 
 //       timer.reset();
 //       timer.start();
-      BENCH(for (int k=0; k<REPEAT; ++k) m3 = m1 * m2;)
+  BENCH(for (int k=0; k<REPEAT; ++k) m3 = m1 * m2;)
 //       timer.stop();
-      std::cout << "   a * b:\t" << timer.value() << endl;
+  std::cout << "   a * b:\t" << timer.value() << endl;
 //       std::cout << sm3 << "\n";
 
-      timer.reset();
-      timer.start();
+  timer.reset();
+  timer.start();
 //       std::cerr << "transpose...\n";
 //       EigenSparseMatrix sm4 = sm1.transpose();
 //       std::cout << sm4.nonZeros() << " == " << sm1.nonZeros() << "\n";
 //       exit(1);
 //       std::cerr << "transpose OK\n";
 //       std::cout << sm1 << "\n\n" << sm1.transpose() << "\n\n" << sm4.transpose() << "\n\n";
-      BENCH(for (int k=0; k<REPEAT; ++k) m3 = m1.transpose() * m2;)
+  BENCH(for (int k=0; k<REPEAT; ++k) m3 = m1.transpose() * m2;)
 //       timer.stop();
-      std::cout << "   a' * b:\t" << timer.value() << endl;
+  std::cout << "   a' * b:\t" << timer.value() << endl;
 
 //       timer.reset();
 //       timer.start();
-      BENCH( for (int k=0; k<REPEAT; ++k) m3 = m1.transpose() * m2.transpose(); )
+  BENCH( for (int k=0; k<REPEAT; ++k) m3 = m1.transpose() * m2.transpose(); )
 //       timer.stop();
-      std::cout << "   a' * b':\t" << timer.value() << endl;
+  std::cout << "   a' * b':\t" << timer.value() << endl;
 
 //       timer.reset();
 //       timer.start();
-      BENCH( for (int k=0; k<REPEAT; ++k) m3 = m1 * m2.transpose(); )
+  BENCH( for (int k=0; k<REPEAT; ++k) m3 = m1 * m2.transpose(); )
 //       timer.stop();
-      std::cout << "   a * b' :\t" << timer.value() << endl;
-    }*/
+  std::cout << "   a * b' :\t" << timer.value() << endl;
+}*/
 
-    // CSparse
-    #ifdef CSPARSE
+// CSparse
+#ifdef CSPARSE
     {
       std::cout << "CSparse \t" << nnzPerCol << "%\n";
       cs *m1, *m2, *m3;
       eiToCSparse(sm1, m1);
       eiToCSparse(sm2, m2);
 
-      BENCH(
-      {
+      BENCH({
         m3 = cs_sorted_multiply(m1, m2);
-        if (!m3)
-        {
+        if (!m3) {
           std::cerr << "cs_multiply failed\n";
         }
-//         cs_print(m3, 0);
+        //         cs_print(m3, 0);
         cs_spfree(m3);
-      }
-      );
-//       timer.stop();
+      });
+      //       timer.stop();
       std::cout << "   a * b:\t" << timer.value() << endl;
 
-//       BENCH( { m3 = cs_sorted_multiply2(m1, m2); cs_spfree(m3); } );
-//       std::cout << "   a * b:\t" << timer.value() << endl;
+      //       BENCH( { m3 = cs_sorted_multiply2(m1, m2); cs_spfree(m3); } );
+      //       std::cout << "   a * b:\t" << timer.value() << endl;
     }
-    #endif
+#endif
 
-    #ifndef NOUBLAS
+#ifndef NOUBLAS
     {
       std::cout << "ublas\t" << nnzPerCol << "%\n";
-      UBlasSparse m1(rows,cols), m2(rows,cols), m3(rows,cols);
+      UBlasSparse m1(rows, cols), m2(rows, cols), m3(rows, cols);
       eiToUblas(sm1, m1);
       eiToUblas(sm2, m2);
 
       BENCH(boost::numeric::ublas::prod(m1, m2, m3););
       std::cout << "   a * b:\t" << timer.value() << endl;
     }
-    #endif
+#endif
 
-    // GMM++
-    #ifndef NOGMM
+// GMM++
+#ifndef NOGMM
     {
       std::cout << "GMM++ sparse\t" << nnzPerCol << "%\n";
-      GmmDynSparse  gmmT3(rows,cols);
-      GmmSparse m1(rows,cols), m2(rows,cols), m3(rows,cols);
+      GmmDynSparse gmmT3(rows, cols);
+      GmmSparse m1(rows, cols), m2(rows, cols), m3(rows, cols);
       eiToGmm(sm1, m1);
       eiToGmm(sm2, m2);
 
       BENCH(gmm::mult(m1, m2, gmmT3););
       std::cout << "   a * b:\t" << timer.value() << endl;
 
-//       BENCH(gmm::mult(gmm::transposed(m1), m2, gmmT3););
-//       std::cout << "   a' * b:\t" << timer.value() << endl;
-//
-//       if (rows<500)
-//       {
-//         BENCH(gmm::mult(gmm::transposed(m1), gmm::transposed(m2), gmmT3););
-//         std::cout << "   a' * b':\t" << timer.value() << endl;
-//
-//         BENCH(gmm::mult(m1, gmm::transposed(m2), gmmT3););
-//         std::cout << "   a * b':\t" << timer.value() << endl;
-//       }
-//       else
-//       {
-//         std::cout << "   a' * b':\t" << "forever" << endl;
-//         std::cout << "   a * b':\t" << "forever" << endl;
-//       }
+      //       BENCH(gmm::mult(gmm::transposed(m1), m2, gmmT3););
+      //       std::cout << "   a' * b:\t" << timer.value() << endl;
+      //
+      //       if (rows<500)
+      //       {
+      //         BENCH(gmm::mult(gmm::transposed(m1), gmm::transposed(m2), gmmT3););
+      //         std::cout << "   a' * b':\t" << timer.value() << endl;
+      //
+      //         BENCH(gmm::mult(m1, gmm::transposed(m2), gmmT3););
+      //         std::cout << "   a * b':\t" << timer.value() << endl;
+      //       }
+      //       else
+      //       {
+      //         std::cout << "   a' * b':\t" << "forever" << endl;
+      //         std::cout << "   a * b':\t" << "forever" << endl;
+      //       }
     }
-    #endif
+#endif
 
-    // MTL4
-    #ifndef NOMTL
+// MTL4
+#ifndef NOMTL
     {
       std::cout << "MTL4\t" << nnzPerCol << "%\n";
-      MtlSparse m1(rows,cols), m2(rows,cols), m3(rows,cols);
+      MtlSparse m1(rows, cols), m2(rows, cols), m3(rows, cols);
       eiToMtl(sm1, m1);
       eiToMtl(sm2, m2);
 
       BENCH(m3 = m1 * m2;);
       std::cout << "   a * b:\t" << timer.value() << endl;
 
-//       BENCH(m3 = trans(m1) * m2;);
-//       std::cout << "   a' * b:\t" << timer.value() << endl;
-//
-//       BENCH(m3 = trans(m1) * trans(m2););
-//       std::cout << "  a' * b':\t" << timer.value() << endl;
-//
-//       BENCH(m3 = m1 * trans(m2););
-//       std::cout << "   a * b' :\t" << timer.value() << endl;
+      //       BENCH(m3 = trans(m1) * m2;);
+      //       std::cout << "   a' * b:\t" << timer.value() << endl;
+      //
+      //       BENCH(m3 = trans(m1) * trans(m2););
+      //       std::cout << "  a' * b':\t" << timer.value() << endl;
+      //
+      //       BENCH(m3 = m1 * trans(m2););
+      //       std::cout << "   a * b' :\t" << timer.value() << endl;
     }
-    #endif
+#endif
 
     std::cout << "\n\n";
   }
 
   return 0;
 }
-
-
-
diff --git a/bench/sparse_randomsetter.cpp b/bench/sparse_randomsetter.cpp
index c433742..d550174 100644
--- a/bench/sparse_randomsetter.cpp
+++ b/bench/sparse_randomsetter.cpp
@@ -30,97 +30,96 @@
 #define NBTRIES 10
 #endif
 
-#define BENCH(X) \
-  timer.reset(); \
-  for (int _j=0; _j<NBTRIES; ++_j) { \
-    timer.start(); \
-    for (int _k=0; _k<REPEAT; ++_k) { \
-        X  \
-  } timer.stop(); }
-
+#define BENCH(X)                          \
+  timer.reset();                          \
+  for (int _j = 0; _j < NBTRIES; ++_j) {  \
+    timer.start();                        \
+    for (int _k = 0; _k < REPEAT; ++_k) { \
+      X                                   \
+    }                                     \
+    timer.stop();                         \
+  }
 
 static double rtime;
 static double nentries;
 
-template<typename SetterType>
-void dostuff(const char* name, EigenSparseMatrix& sm1)
-{
+template <typename SetterType>
+void dostuff(const char* name, EigenSparseMatrix& sm1) {
   int rows = sm1.rows();
   int cols = sm1.cols();
   sm1.setZero();
   BenchTimer t;
   SetterType* set1 = new SetterType(sm1);
-  t.reset(); t.start();
-  for (int k=0; k<nentries; ++k)
-    (*set1)(internal::random<int>(0,rows-1),internal::random<int>(0,cols-1)) += 1;
+  t.reset();
+  t.start();
+  for (int k = 0; k < nentries; ++k)
+    (*set1)(internal::random<int>(0, rows - 1), internal::random<int>(0, cols - 1)) += 1;
   t.stop();
-  std::cout << "std::map =>      \t" << t.value()-rtime
-            << " nnz=" << set1->nonZeros() << std::flush;
+  std::cout << "std::map =>      \t" << t.value() - rtime << " nnz=" << set1->nonZeros() << std::flush;
 
   // getchar();
 
-  t.reset(); t.start(); delete set1; t.stop();
+  t.reset();
+  t.start();
+  delete set1;
+  t.stop();
   std::cout << "  back: \t" << t.value() << "\n";
 }
-    
-int main(int argc, char *argv[])
-{
+
+int main(int argc, char* argv[]) {
   int rows = SIZE;
   int cols = SIZE;
   float density = DENSITY;
 
-  EigenSparseMatrix sm1(rows,cols), sm2(rows,cols);
+  EigenSparseMatrix sm1(rows, cols), sm2(rows, cols);
 
-
-  nentries = rows*cols*density;
+  nentries = rows * cols * density;
   std::cout << "n = " << nentries << "\n";
   int dummy;
   BenchTimer t;
 
-  t.reset(); t.start();
-  for (int k=0; k<nentries; ++k)
-    dummy = internal::random<int>(0,rows-1) + internal::random<int>(0,cols-1);
+  t.reset();
+  t.start();
+  for (int k = 0; k < nentries; ++k) dummy = internal::random<int>(0, rows - 1) + internal::random<int>(0, cols - 1);
   t.stop();
   rtime = t.value();
   std::cout << "rtime = " << rtime << " (" << dummy << ")\n\n";
   const int Bits = 6;
-  for (;;)
-  {
-    dostuff<RandomSetter<EigenSparseMatrix,StdMapTraits,Bits> >("std::map     ", sm1);
-    dostuff<RandomSetter<EigenSparseMatrix,GnuHashMapTraits,Bits> >("gnu::hash_map", sm1);
-    dostuff<RandomSetter<EigenSparseMatrix,GoogleDenseHashMapTraits,Bits> >("google::dense", sm1);
-    dostuff<RandomSetter<EigenSparseMatrix,GoogleSparseHashMapTraits,Bits> >("google::sparse", sm1);
+  for (;;) {
+    dostuff<RandomSetter<EigenSparseMatrix, StdMapTraits, Bits> >("std::map     ", sm1);
+    dostuff<RandomSetter<EigenSparseMatrix, GnuHashMapTraits, Bits> >("gnu::hash_map", sm1);
+    dostuff<RandomSetter<EigenSparseMatrix, GoogleDenseHashMapTraits, Bits> >("google::dense", sm1);
+    dostuff<RandomSetter<EigenSparseMatrix, GoogleSparseHashMapTraits, Bits> >("google::sparse", sm1);
 
-//     {
-//       RandomSetter<EigenSparseMatrix,GnuHashMapTraits,Bits> set1(sm1);
-//       t.reset(); t.start();
-//       for (int k=0; k<n; ++k)
-//         set1(internal::random<int>(0,rows-1),internal::random<int>(0,cols-1)) += 1;
-//       t.stop();
-//       std::cout << "gnu::hash_map => \t" << t.value()-rtime
-//                 << " nnz=" << set1.nonZeros() << "\n";getchar();
-//     }
-//     {
-//       RandomSetter<EigenSparseMatrix,GoogleDenseHashMapTraits,Bits> set1(sm1);
-//       t.reset(); t.start();
-//       for (int k=0; k<n; ++k)
-//         set1(internal::random<int>(0,rows-1),internal::random<int>(0,cols-1)) += 1;
-//       t.stop();
-//       std::cout << "google::dense => \t" << t.value()-rtime
-//                 << " nnz=" << set1.nonZeros() << "\n";getchar();
-//     }
-//     {
-//       RandomSetter<EigenSparseMatrix,GoogleSparseHashMapTraits,Bits> set1(sm1);
-//       t.reset(); t.start();
-//       for (int k=0; k<n; ++k)
-//         set1(internal::random<int>(0,rows-1),internal::random<int>(0,cols-1)) += 1;
-//       t.stop();
-//       std::cout << "google::sparse => \t" << t.value()-rtime
-//                 << " nnz=" << set1.nonZeros() << "\n";getchar();
-//     }
+    //     {
+    //       RandomSetter<EigenSparseMatrix,GnuHashMapTraits,Bits> set1(sm1);
+    //       t.reset(); t.start();
+    //       for (int k=0; k<n; ++k)
+    //         set1(internal::random<int>(0,rows-1),internal::random<int>(0,cols-1)) += 1;
+    //       t.stop();
+    //       std::cout << "gnu::hash_map => \t" << t.value()-rtime
+    //                 << " nnz=" << set1.nonZeros() << "\n";getchar();
+    //     }
+    //     {
+    //       RandomSetter<EigenSparseMatrix,GoogleDenseHashMapTraits,Bits> set1(sm1);
+    //       t.reset(); t.start();
+    //       for (int k=0; k<n; ++k)
+    //         set1(internal::random<int>(0,rows-1),internal::random<int>(0,cols-1)) += 1;
+    //       t.stop();
+    //       std::cout << "google::dense => \t" << t.value()-rtime
+    //                 << " nnz=" << set1.nonZeros() << "\n";getchar();
+    //     }
+    //     {
+    //       RandomSetter<EigenSparseMatrix,GoogleSparseHashMapTraits,Bits> set1(sm1);
+    //       t.reset(); t.start();
+    //       for (int k=0; k<n; ++k)
+    //         set1(internal::random<int>(0,rows-1),internal::random<int>(0,cols-1)) += 1;
+    //       t.stop();
+    //       std::cout << "google::sparse => \t" << t.value()-rtime
+    //                 << " nnz=" << set1.nonZeros() << "\n";getchar();
+    //     }
     std::cout << "\n\n";
   }
 
   return 0;
 }
-
diff --git a/bench/sparse_setter.cpp b/bench/sparse_setter.cpp
index a9f0b11..148b140 100644
--- a/bench/sparse_setter.cpp
+++ b/bench/sparse_setter.cpp
@@ -1,8 +1,9 @@
 
-//g++ -O3 -g0 -DNDEBUG  sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
-//g++ -O3 -g0 -DNDEBUG  sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
-// -DNOGMM -DNOMTL -DCSPARSE
-// -I /home/gael/Coding/LinearAlgebra/CSparse/Include/ /home/gael/Coding/LinearAlgebra/CSparse/Lib/libcsparse.a
+// g++ -O3 -g0 -DNDEBUG  sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 &&
+// ./a.out g++ -O3 -g0 -DNDEBUG  sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05
+// -DSIZE=2000 && ./a.out
+//  -DNOGMM -DNOMTL -DCSPARSE
+//  -I /home/gael/Coding/LinearAlgebra/CSparse/Include/ /home/gael/Coding/LinearAlgebra/CSparse/Lib/libcsparse.a
 #ifndef SIZE
 #define SIZE 100000
 #endif
@@ -33,13 +34,15 @@
 #define CHECK_MEM
 // #define CHECK_MEM  std/**/::cout << "check mem\n"; getchar();
 
-#define BENCH(X) \
-  timer.reset(); \
-  for (int _j=0; _j<NBTRIES; ++_j) { \
-    timer.start(); \
-    for (int _k=0; _k<REPEAT; ++_k) { \
-        X  \
-  } timer.stop(); }
+#define BENCH(X)                          \
+  timer.reset();                          \
+  for (int _j = 0; _j < NBTRIES; ++_j) {  \
+    timer.start();                        \
+    for (int _k = 0; _k < REPEAT; ++_k) { \
+      X                                   \
+    }                                     \
+    timer.stop();                         \
+  }
 
 typedef std::vector<Vector2i> Coordinates;
 typedef std::vector<float> Values;
@@ -58,8 +61,7 @@
 EIGEN_DONT_INLINE Scalar* setrand_ublas_genvec(const Coordinates& coords, const Values& vals);
 EIGEN_DONT_INLINE Scalar* setrand_mtl(const Coordinates& coords, const Values& vals);
 
-int main(int argc, char *argv[])
-{
+int main(int argc, char* argv[]) {
   int rows = SIZE;
   int cols = SIZE;
   bool fullyrand = true;
@@ -67,137 +69,127 @@
   BenchTimer timer;
   Coordinates coords;
   Values values;
-  if(fullyrand)
-  {
+  if (fullyrand) {
     Coordinates pool;
-    pool.reserve(cols*NBPERROW);
-    std::cerr << "fill pool" << "\n";
-    for (int i=0; i<cols*NBPERROW; )
-    {
-//       DynamicSparseMatrix<int> stencil(SIZE,SIZE);
-      Vector2i ij(internal::random<int>(0,rows-1),internal::random<int>(0,cols-1));
-//       if(stencil.coeffRef(ij.x(), ij.y())==0)
+    pool.reserve(cols * NBPERROW);
+    std::cerr << "fill pool"
+              << "\n";
+    for (int i = 0; i < cols * NBPERROW;) {
+      //       DynamicSparseMatrix<int> stencil(SIZE,SIZE);
+      Vector2i ij(internal::random<int>(0, rows - 1), internal::random<int>(0, cols - 1));
+      //       if(stencil.coeffRef(ij.x(), ij.y())==0)
       {
-//         stencil.coeffRef(ij.x(), ij.y()) = 1;
+        //         stencil.coeffRef(ij.x(), ij.y()) = 1;
         pool.push_back(ij);
-
       }
       ++i;
     }
-    std::cerr << "pool ok" << "\n";
-    int n = cols*NBPERROW*KK;
+    std::cerr << "pool ok"
+              << "\n";
+    int n = cols * NBPERROW * KK;
     coords.reserve(n);
     values.reserve(n);
-    for (int i=0; i<n; ++i)
-    {
-      int i = internal::random<int>(0,pool.size());
+    for (int i = 0; i < n; ++i) {
+      int i = internal::random<int>(0, pool.size());
       coords.push_back(pool[i]);
       values.push_back(internal::random<Scalar>());
     }
+  } else {
+    for (int j = 0; j < cols; ++j)
+      for (int i = 0; i < NBPERROW; ++i) {
+        coords.push_back(Vector2i(internal::random<int>(0, rows - 1), j));
+        values.push_back(internal::random<Scalar>());
+      }
   }
-  else
-  {
-    for (int j=0; j<cols; ++j)
-    for (int i=0; i<NBPERROW; ++i)
-    {
-      coords.push_back(Vector2i(internal::random<int>(0,rows-1),j));
-      values.push_back(internal::random<Scalar>());
-    }
-  }
-  std::cout << "nnz = " << coords.size()  << "\n";
+  std::cout << "nnz = " << coords.size() << "\n";
   CHECK_MEM
+// dense matrices
+#ifdef DENSEMATRIX
+  {
+    BENCH(setrand_eigen_dense(coords, values);)
+    std::cout << "Eigen Dense\t" << timer.value() << "\n";
+  }
+#endif
 
-    // dense matrices
-    #ifdef DENSEMATRIX
-    {
-      BENCH(setrand_eigen_dense(coords,values);)
-      std::cout << "Eigen Dense\t" << timer.value() << "\n";
-    }
-    #endif
+  // eigen sparse matrices
+  //     if (!fullyrand)
+  //     {
+  //       BENCH(setinnerrand_eigen(coords,values);)
+  //       std::cout << "Eigen fillrand\t" << timer.value() << "\n";
+  //     }
+  {
+    BENCH(setrand_eigen_dynamic(coords, values);)
+    std::cout << "Eigen dynamic\t" << timer.value() << "\n";
+  }
+  //     {
+  //       BENCH(setrand_eigen_compact(coords,values);)
+  //       std::cout << "Eigen compact\t" << timer.value() << "\n";
+  //     }
+  {
+    BENCH(setrand_eigen_sumeq(coords, values);)
+    std::cout << "Eigen sumeq\t" << timer.value() << "\n";
+  }
+  {
+    //       BENCH(setrand_eigen_gnu_hash(coords,values);)
+    //       std::cout << "Eigen std::map\t" << timer.value() << "\n";
+  }
+  {
+    BENCH(setrand_scipy(coords, values);)
+    std::cout << "scipy\t" << timer.value() << "\n";
+  }
+#ifndef NOGOOGLE
+  {
+    BENCH(setrand_eigen_google_dense(coords, values);)
+    std::cout << "Eigen google dense\t" << timer.value() << "\n";
+  }
+  {
+    BENCH(setrand_eigen_google_sparse(coords, values);)
+    std::cout << "Eigen google sparse\t" << timer.value() << "\n";
+  }
+#endif
 
-    // eigen sparse matrices
-//     if (!fullyrand)
-//     {
-//       BENCH(setinnerrand_eigen(coords,values);)
-//       std::cout << "Eigen fillrand\t" << timer.value() << "\n";
-//     }
-    {
-      BENCH(setrand_eigen_dynamic(coords,values);)
-      std::cout << "Eigen dynamic\t" << timer.value() << "\n";
-    }
-//     {
-//       BENCH(setrand_eigen_compact(coords,values);)
-//       std::cout << "Eigen compact\t" << timer.value() << "\n";
-//     }
-    {
-      BENCH(setrand_eigen_sumeq(coords,values);)
-      std::cout << "Eigen sumeq\t" << timer.value() << "\n";
-    }
-    {
-//       BENCH(setrand_eigen_gnu_hash(coords,values);)
-//       std::cout << "Eigen std::map\t" << timer.value() << "\n";
-    }
-    {
-      BENCH(setrand_scipy(coords,values);)
-      std::cout << "scipy\t" << timer.value() << "\n";
-    }
-    #ifndef NOGOOGLE
-    {
-      BENCH(setrand_eigen_google_dense(coords,values);)
-      std::cout << "Eigen google dense\t" << timer.value() << "\n";
-    }
-    {
-      BENCH(setrand_eigen_google_sparse(coords,values);)
-      std::cout << "Eigen google sparse\t" << timer.value() << "\n";
-    }
-    #endif
+#ifndef NOUBLAS
+  {
+      //       BENCH(setrand_ublas_mapped(coords,values);)
+      //       std::cout << "ublas mapped\t" << timer.value() << "\n";
+  } {
+    BENCH(setrand_ublas_genvec(coords, values);)
+    std::cout << "ublas vecofvec\t" << timer.value() << "\n";
+  }
+/*{
+  timer.reset();
+  timer.start();
+  for (int k=0; k<REPEAT; ++k)
+    setrand_ublas_compressed(coords,values);
+  timer.stop();
+  std::cout << "ublas comp\t" << timer.value() << "\n";
+}
+{
+  timer.reset();
+  timer.start();
+  for (int k=0; k<REPEAT; ++k)
+    setrand_ublas_coord(coords,values);
+  timer.stop();
+  std::cout << "ublas coord\t" << timer.value() << "\n";
+}*/
+#endif
 
-    #ifndef NOUBLAS
-    {
-//       BENCH(setrand_ublas_mapped(coords,values);)
-//       std::cout << "ublas mapped\t" << timer.value() << "\n";
-    }
-    {
-      BENCH(setrand_ublas_genvec(coords,values);)
-      std::cout << "ublas vecofvec\t" << timer.value() << "\n";
-    }
-    /*{
-      timer.reset();
-      timer.start();
-      for (int k=0; k<REPEAT; ++k)
-        setrand_ublas_compressed(coords,values);
-      timer.stop();
-      std::cout << "ublas comp\t" << timer.value() << "\n";
-    }
-    {
-      timer.reset();
-      timer.start();
-      for (int k=0; k<REPEAT; ++k)
-        setrand_ublas_coord(coords,values);
-      timer.stop();
-      std::cout << "ublas coord\t" << timer.value() << "\n";
-    }*/
-    #endif
-
-
-    // MTL4
-    #ifndef NOMTL
-    {
-      BENCH(setrand_mtl(coords,values));
-      std::cout << "MTL\t" << timer.value() << "\n";
-    }
-    #endif
+// MTL4
+#ifndef NOMTL
+  {
+    BENCH(setrand_mtl(coords, values));
+    std::cout << "MTL\t" << timer.value() << "\n";
+  }
+#endif
 
   return 0;
 }
 
-EIGEN_DONT_INLINE Scalar* setinnerrand_eigen(const Coordinates& coords, const Values& vals)
-{
+EIGEN_DONT_INLINE Scalar* setinnerrand_eigen(const Coordinates& coords, const Values& vals) {
   using namespace Eigen;
-  SparseMatrix<Scalar> mat(SIZE,SIZE);
-  //mat.startFill(2000000/*coords.size()*/);
-  for (int i=0; i<coords.size(); ++i)
-  {
+  SparseMatrix<Scalar> mat(SIZE, SIZE);
+  // mat.startFill(2000000/*coords.size()*/);
+  for (int i = 0; i < coords.size(); ++i) {
     mat.insert(coords[i].x(), coords[i].y()) = vals[i];
   }
   mat.finalize();
@@ -205,13 +197,11 @@
   return 0;
 }
 
-EIGEN_DONT_INLINE Scalar* setrand_eigen_dynamic(const Coordinates& coords, const Values& vals)
-{
+EIGEN_DONT_INLINE Scalar* setrand_eigen_dynamic(const Coordinates& coords, const Values& vals) {
   using namespace Eigen;
-  DynamicSparseMatrix<Scalar> mat(SIZE,SIZE);
-  mat.reserve(coords.size()/10);
-  for (int i=0; i<coords.size(); ++i)
-  {
+  DynamicSparseMatrix<Scalar> mat(SIZE, SIZE);
+  mat.reserve(coords.size() / 10);
+  for (int i = 0; i < coords.size(); ++i) {
     mat.coeffRef(coords[i].x(), coords[i].y()) += vals[i];
   }
   mat.finalize();
@@ -219,17 +209,14 @@
   return &mat.coeffRef(coords[0].x(), coords[0].y());
 }
 
-EIGEN_DONT_INLINE Scalar* setrand_eigen_sumeq(const Coordinates& coords, const Values& vals)
-{
+EIGEN_DONT_INLINE Scalar* setrand_eigen_sumeq(const Coordinates& coords, const Values& vals) {
   using namespace Eigen;
-  int n = coords.size()/KK;
-  DynamicSparseMatrix<Scalar> mat(SIZE,SIZE);
-  for (int j=0; j<KK; ++j)
-  {
-    DynamicSparseMatrix<Scalar> aux(SIZE,SIZE);
+  int n = coords.size() / KK;
+  DynamicSparseMatrix<Scalar> mat(SIZE, SIZE);
+  for (int j = 0; j < KK; ++j) {
+    DynamicSparseMatrix<Scalar> aux(SIZE, SIZE);
     mat.reserve(n);
-    for (int i=j*n; i<(j+1)*n; ++i)
-    {
+    for (int i = j * n; i < (j + 1) * n; ++i) {
       aux.insert(coords[i].x(), coords[i].y()) += vals[i];
     }
     aux.finalize();
@@ -238,13 +225,11 @@
   return &mat.coeffRef(coords[0].x(), coords[0].y());
 }
 
-EIGEN_DONT_INLINE Scalar* setrand_eigen_compact(const Coordinates& coords, const Values& vals)
-{
+EIGEN_DONT_INLINE Scalar* setrand_eigen_compact(const Coordinates& coords, const Values& vals) {
   using namespace Eigen;
-  DynamicSparseMatrix<Scalar> setter(SIZE,SIZE);
-  setter.reserve(coords.size()/10);
-  for (int i=0; i<coords.size(); ++i)
-  {
+  DynamicSparseMatrix<Scalar> setter(SIZE, SIZE);
+  setter.reserve(coords.size() / 10);
+  for (int i = 0; i < coords.size(); ++i) {
     setter.coeffRef(coords[i].x(), coords[i].y()) += vals[i];
   }
   SparseMatrix<Scalar> mat = setter;
@@ -252,14 +237,12 @@
   return &mat.coeffRef(coords[0].x(), coords[0].y());
 }
 
-EIGEN_DONT_INLINE Scalar* setrand_eigen_gnu_hash(const Coordinates& coords, const Values& vals)
-{
+EIGEN_DONT_INLINE Scalar* setrand_eigen_gnu_hash(const Coordinates& coords, const Values& vals) {
   using namespace Eigen;
-  SparseMatrix<Scalar> mat(SIZE,SIZE);
+  SparseMatrix<Scalar> mat(SIZE, SIZE);
   {
-    RandomSetter<SparseMatrix<Scalar>, StdMapTraits > setter(mat);
-    for (int i=0; i<coords.size(); ++i)
-    {
+    RandomSetter<SparseMatrix<Scalar>, StdMapTraits> setter(mat);
+    for (int i = 0; i < coords.size(); ++i) {
       setter(coords[i].x(), coords[i].y()) += vals[i];
     }
     CHECK_MEM;
@@ -268,148 +251,126 @@
 }
 
 #ifndef NOGOOGLE
-EIGEN_DONT_INLINE Scalar* setrand_eigen_google_dense(const Coordinates& coords, const Values& vals)
-{
+EIGEN_DONT_INLINE Scalar* setrand_eigen_google_dense(const Coordinates& coords, const Values& vals) {
   using namespace Eigen;
-  SparseMatrix<Scalar> mat(SIZE,SIZE);
+  SparseMatrix<Scalar> mat(SIZE, SIZE);
   {
     RandomSetter<SparseMatrix<Scalar>, GoogleDenseHashMapTraits> setter(mat);
-    for (int i=0; i<coords.size(); ++i)
-      setter(coords[i].x(), coords[i].y()) += vals[i];
+    for (int i = 0; i < coords.size(); ++i) setter(coords[i].x(), coords[i].y()) += vals[i];
     CHECK_MEM;
   }
   return &mat.coeffRef(coords[0].x(), coords[0].y());
 }
 
-EIGEN_DONT_INLINE Scalar* setrand_eigen_google_sparse(const Coordinates& coords, const Values& vals)
-{
+EIGEN_DONT_INLINE Scalar* setrand_eigen_google_sparse(const Coordinates& coords, const Values& vals) {
   using namespace Eigen;
-  SparseMatrix<Scalar> mat(SIZE,SIZE);
+  SparseMatrix<Scalar> mat(SIZE, SIZE);
   {
     RandomSetter<SparseMatrix<Scalar>, GoogleSparseHashMapTraits> setter(mat);
-    for (int i=0; i<coords.size(); ++i)
-      setter(coords[i].x(), coords[i].y()) += vals[i];
+    for (int i = 0; i < coords.size(); ++i) setter(coords[i].x(), coords[i].y()) += vals[i];
     CHECK_MEM;
   }
   return &mat.coeffRef(coords[0].x(), coords[0].y());
 }
 #endif
 
-
 template <class T>
-void coo_tocsr(const int n_row,
-               const int n_col,
-               const int nnz,
-               const Coordinates Aij,
-               const Values Ax,
-                     int Bp[],
-                     int Bj[],
-                     T Bx[])
-{
-    //compute number of non-zero entries per row of A coo_tocsr
-    std::fill(Bp, Bp + n_row, 0);
+void coo_tocsr(const int n_row, const int n_col, const int nnz, const Coordinates Aij, const Values Ax, int Bp[],
+               int Bj[], T Bx[]) {
+  // compute number of non-zero entries per row of A coo_tocsr
+  std::fill(Bp, Bp + n_row, 0);
 
-    for (int n = 0; n < nnz; n++){
-        Bp[Aij[n].x()]++;
-    }
+  for (int n = 0; n < nnz; n++) {
+    Bp[Aij[n].x()]++;
+  }
 
-    //cumsum the nnz per row to get Bp[]
-    for(int i = 0, cumsum = 0; i < n_row; i++){
-        int temp = Bp[i];
-        Bp[i] = cumsum;
-        cumsum += temp;
-    }
-    Bp[n_row] = nnz;
+  // cumsum the nnz per row to get Bp[]
+  for (int i = 0, cumsum = 0; i < n_row; i++) {
+    int temp = Bp[i];
+    Bp[i] = cumsum;
+    cumsum += temp;
+  }
+  Bp[n_row] = nnz;
 
-    //write Aj,Ax into Bj,Bx
-    for(int n = 0; n < nnz; n++){
-        int row  = Aij[n].x();
-        int dest = Bp[row];
+  // write Aj,Ax into Bj,Bx
+  for (int n = 0; n < nnz; n++) {
+    int row = Aij[n].x();
+    int dest = Bp[row];
 
-        Bj[dest] = Aij[n].y();
-        Bx[dest] = Ax[n];
+    Bj[dest] = Aij[n].y();
+    Bx[dest] = Ax[n];
 
-        Bp[row]++;
-    }
+    Bp[row]++;
+  }
 
-    for(int i = 0, last = 0; i <= n_row; i++){
-        int temp = Bp[i];
-        Bp[i]  = last;
-        last   = temp;
-    }
+  for (int i = 0, last = 0; i <= n_row; i++) {
+    int temp = Bp[i];
+    Bp[i] = last;
+    last = temp;
+  }
 
-    //now Bp,Bj,Bx form a CSR representation (with possible duplicates)
+  // now Bp,Bj,Bx form a CSR representation (with possible duplicates)
 }
 
-template< class T1, class T2 >
-bool kv_pair_less(const std::pair<T1,T2>& x, const std::pair<T1,T2>& y){
-    return x.first < y.first;
-}
-
-
-template<class I, class T>
-void csr_sort_indices(const I n_row,
-                      const I Ap[],
-                            I Aj[],
-                            T Ax[])
-{
-    std::vector< std::pair<I,T> > temp;
-
-    for(I i = 0; i < n_row; i++){
-        I row_start = Ap[i];
-        I row_end   = Ap[i+1];
-
-        temp.clear();
-
-        for(I jj = row_start; jj < row_end; jj++){
-            temp.push_back(std::make_pair(Aj[jj],Ax[jj]));
-        }
-
-        std::sort(temp.begin(),temp.end(),kv_pair_less<I,T>);
-
-        for(I jj = row_start, n = 0; jj < row_end; jj++, n++){
-            Aj[jj] = temp[n].first;
-            Ax[jj] = temp[n].second;
-        }
-    }
+template <class T1, class T2>
+bool kv_pair_less(const std::pair<T1, T2>& x, const std::pair<T1, T2>& y) {
+  return x.first < y.first;
 }
 
 template <class I, class T>
-void csr_sum_duplicates(const I n_row,
-                        const I n_col,
-                              I Ap[],
-                              I Aj[],
-                              T Ax[])
-{
-    I nnz = 0;
-    I row_end = 0;
-    for(I i = 0; i < n_row; i++){
-        I jj = row_end;
-        row_end = Ap[i+1];
-        while( jj < row_end ){
-            I j = Aj[jj];
-            T x = Ax[jj];
-            jj++;
-            while( jj < row_end && Aj[jj] == j ){
-                x += Ax[jj];
-                jj++;
-            }
-            Aj[nnz] = j;
-            Ax[nnz] = x;
-            nnz++;
-        }
-        Ap[i+1] = nnz;
+void csr_sort_indices(const I n_row, const I Ap[], I Aj[], T Ax[]) {
+  std::vector<std::pair<I, T> > temp;
+
+  for (I i = 0; i < n_row; i++) {
+    I row_start = Ap[i];
+    I row_end = Ap[i + 1];
+
+    temp.clear();
+
+    for (I jj = row_start; jj < row_end; jj++) {
+      temp.push_back(std::make_pair(Aj[jj], Ax[jj]));
     }
+
+    std::sort(temp.begin(), temp.end(), kv_pair_less<I, T>);
+
+    for (I jj = row_start, n = 0; jj < row_end; jj++, n++) {
+      Aj[jj] = temp[n].first;
+      Ax[jj] = temp[n].second;
+    }
+  }
 }
 
-EIGEN_DONT_INLINE Scalar* setrand_scipy(const Coordinates& coords, const Values& vals)
-{
+template <class I, class T>
+void csr_sum_duplicates(const I n_row, const I n_col, I Ap[], I Aj[], T Ax[]) {
+  I nnz = 0;
+  I row_end = 0;
+  for (I i = 0; i < n_row; i++) {
+    I jj = row_end;
+    row_end = Ap[i + 1];
+    while (jj < row_end) {
+      I j = Aj[jj];
+      T x = Ax[jj];
+      jj++;
+      while (jj < row_end && Aj[jj] == j) {
+        x += Ax[jj];
+        jj++;
+      }
+      Aj[nnz] = j;
+      Ax[nnz] = x;
+      nnz++;
+    }
+    Ap[i + 1] = nnz;
+  }
+}
+
+EIGEN_DONT_INLINE Scalar* setrand_scipy(const Coordinates& coords, const Values& vals) {
   using namespace Eigen;
-  SparseMatrix<Scalar> mat(SIZE,SIZE);
+  SparseMatrix<Scalar> mat(SIZE, SIZE);
   mat.resizeNonZeros(coords.size());
-//   std::cerr << "setrand_scipy...\n";
-  coo_tocsr<Scalar>(SIZE,SIZE, coords.size(), coords, vals, mat._outerIndexPtr(), mat._innerIndexPtr(), mat._valuePtr());
-//   std::cerr << "coo_tocsr ok\n";
+  //   std::cerr << "setrand_scipy...\n";
+  coo_tocsr<Scalar>(SIZE, SIZE, coords.size(), coords, vals, mat._outerIndexPtr(), mat._innerIndexPtr(),
+                    mat._valuePtr());
+  //   std::cerr << "coo_tocsr ok\n";
 
   csr_sort_indices(SIZE, mat._outerIndexPtr(), mat._innerIndexPtr(), mat._valuePtr());
 
@@ -420,21 +381,18 @@
   return &mat.coeffRef(coords[0].x(), coords[0].y());
 }
 
-
 #ifndef NOUBLAS
-EIGEN_DONT_INLINE Scalar* setrand_ublas_mapped(const Coordinates& coords, const Values& vals)
-{
+EIGEN_DONT_INLINE Scalar* setrand_ublas_mapped(const Coordinates& coords, const Values& vals) {
   using namespace boost;
   using namespace boost::numeric;
   using namespace boost::numeric::ublas;
-  mapped_matrix<Scalar> aux(SIZE,SIZE);
-  for (int i=0; i<coords.size(); ++i)
-  {
+  mapped_matrix<Scalar> aux(SIZE, SIZE);
+  for (int i = 0; i < coords.size(); ++i) {
     aux(coords[i].x(), coords[i].y()) += vals[i];
   }
   CHECK_MEM;
   compressed_matrix<Scalar> mat(aux);
-  return 0;// &mat(coords[0].x(), coords[0].y());
+  return 0;  // &mat(coords[0].x(), coords[0].y());
 }
 /*EIGEN_DONT_INLINE Scalar* setrand_ublas_coord(const Coordinates& coords, const Values& vals)
 {
@@ -461,25 +419,22 @@
   }
   return 0;//&mat(coords[0].x(), coords[0].y());
 }*/
-EIGEN_DONT_INLINE Scalar* setrand_ublas_genvec(const Coordinates& coords, const Values& vals)
-{
+EIGEN_DONT_INLINE Scalar* setrand_ublas_genvec(const Coordinates& coords, const Values& vals) {
   using namespace boost;
   using namespace boost::numeric;
   using namespace boost::numeric::ublas;
 
-//   ublas::vector<coordinate_vector<Scalar> > foo;
-  generalized_vector_of_vector<Scalar, row_major, ublas::vector<coordinate_vector<Scalar> > > aux(SIZE,SIZE);
-  for (int i=0; i<coords.size(); ++i)
-  {
+  //   ublas::vector<coordinate_vector<Scalar> > foo;
+  generalized_vector_of_vector<Scalar, row_major, ublas::vector<coordinate_vector<Scalar> > > aux(SIZE, SIZE);
+  for (int i = 0; i < coords.size(); ++i) {
     aux(coords[i].x(), coords[i].y()) += vals[i];
   }
   CHECK_MEM;
-  compressed_matrix<Scalar,row_major> mat(aux);
-  return 0;//&mat(coords[0].x(), coords[0].y());
+  compressed_matrix<Scalar, row_major> mat(aux);
+  return 0;  //&mat(coords[0].x(), coords[0].y());
 }
 #endif
 
 #ifndef NOMTL
 EIGEN_DONT_INLINE void setrand_mtl(const Coordinates& coords, const Values& vals);
 #endif
-
diff --git a/bench/sparse_transpose.cpp b/bench/sparse_transpose.cpp
index c9aacf5..183b353 100644
--- a/bench/sparse_transpose.cpp
+++ b/bench/sparse_transpose.cpp
@@ -1,7 +1,9 @@
 
-//g++ -O3 -g0 -DNDEBUG  sparse_transpose.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
-// -DNOGMM -DNOMTL
-// -DCSPARSE -I /home/gael/Coding/LinearAlgebra/CSparse/Include/ /home/gael/Coding/LinearAlgebra/CSparse/Lib/libcsparse.a
+// g++ -O3 -g0 -DNDEBUG  sparse_transpose.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000
+// && ./a.out
+//  -DNOGMM -DNOMTL
+//  -DCSPARSE -I /home/gael/Coding/LinearAlgebra/CSparse/Include/
+//  /home/gael/Coding/LinearAlgebra/CSparse/Lib/libcsparse.a
 
 #ifndef SIZE
 #define SIZE 10000
@@ -25,80 +27,82 @@
 #define NBTRIES 10
 #endif
 
-#define BENCH(X) \
-  timer.reset(); \
-  for (int _j=0; _j<NBTRIES; ++_j) { \
-    timer.start(); \
-    for (int _k=0; _k<REPEAT; ++_k) { \
-        X  \
-  } timer.stop(); }
+#define BENCH(X)                          \
+  timer.reset();                          \
+  for (int _j = 0; _j < NBTRIES; ++_j) {  \
+    timer.start();                        \
+    for (int _k = 0; _k < REPEAT; ++_k) { \
+      X                                   \
+    }                                     \
+    timer.stop();                         \
+  }
 
-int main(int argc, char *argv[])
-{
+int main(int argc, char *argv[]) {
   int rows = SIZE;
   int cols = SIZE;
   float density = DENSITY;
 
-  EigenSparseMatrix sm1(rows,cols), sm3(rows,cols);
+  EigenSparseMatrix sm1(rows, cols), sm3(rows, cols);
 
   BenchTimer timer;
-  for (float density = DENSITY; density>=MINDENSITY; density*=0.5)
-  {
+  for (float density = DENSITY; density >= MINDENSITY; density *= 0.5) {
     fillMatrix(density, rows, cols, sm1);
 
-    // dense matrices
-    #ifdef DENSEMATRIX
+// dense matrices
+#ifdef DENSEMATRIX
     {
-      DenseMatrix m1(rows,cols), m3(rows,cols);
+      DenseMatrix m1(rows, cols), m3(rows, cols);
       eiToDense(sm1, m1);
-      BENCH(for (int k=0; k<REPEAT; ++k) m3 = m1.transpose();)
+      BENCH(for (int k = 0; k < REPEAT; ++k) m3 = m1.transpose();)
       std::cout << "  Eigen dense:\t" << timer.value() << endl;
     }
-    #endif
+#endif
 
-    std::cout << "Non zeros: " << sm1.nonZeros()/float(sm1.rows()*sm1.cols())*100 << "%\n";
+    std::cout << "Non zeros: " << sm1.nonZeros() / float(sm1.rows() * sm1.cols()) * 100 << "%\n";
 
     // eigen sparse matrices
     {
-      BENCH(for (int k=0; k<REPEAT; ++k) sm3 = sm1.transpose();)
+      BENCH(for (int k = 0; k < REPEAT; ++k) sm3 = sm1.transpose();)
       std::cout << "  Eigen:\t" << timer.value() << endl;
     }
 
-    // CSparse
-    #ifdef CSPARSE
+// CSparse
+#ifdef CSPARSE
     {
       cs *m1, *m3;
       eiToCSparse(sm1, m1);
 
-      BENCH(for (int k=0; k<REPEAT; ++k) { m3 = cs_transpose(m1,1); cs_spfree(m3);})
+      BENCH(for (int k = 0; k < REPEAT; ++k) {
+        m3 = cs_transpose(m1, 1);
+        cs_spfree(m3);
+      })
       std::cout << "  CSparse:\t" << timer.value() << endl;
     }
-    #endif
+#endif
 
-    // GMM++
-    #ifndef NOGMM
+// GMM++
+#ifndef NOGMM
     {
-      GmmDynSparse  gmmT3(rows,cols);
-      GmmSparse m1(rows,cols), m3(rows,cols);
+      GmmDynSparse gmmT3(rows, cols);
+      GmmSparse m1(rows, cols), m3(rows, cols);
       eiToGmm(sm1, m1);
-      BENCH(for (int k=0; k<REPEAT; ++k) gmm::copy(gmm::transposed(m1),m3);)
+      BENCH(for (int k = 0; k < REPEAT; ++k) gmm::copy(gmm::transposed(m1), m3);)
       std::cout << "  GMM:\t\t" << timer.value() << endl;
     }
-    #endif
+#endif
 
-    // MTL4
-    #ifndef NOMTL
+// MTL4
+#ifndef NOMTL
     {
-      MtlSparse m1(rows,cols), m3(rows,cols);
+      MtlSparse m1(rows, cols), m3(rows, cols);
       eiToMtl(sm1, m1);
-      BENCH(for (int k=0; k<REPEAT; ++k) m3 = trans(m1);)
+      BENCH(for (int k = 0; k < REPEAT; ++k) m3 = trans(m1);)
       std::cout << "  MTL4:\t\t" << timer.value() << endl;
     }
-    #endif
+#endif
 
     std::cout << "\n\n";
   }
 
   return 0;
 }
-
diff --git a/bench/sparse_trisolver.cpp b/bench/sparse_trisolver.cpp
index 13f4f0a..6f53ba9 100644
--- a/bench/sparse_trisolver.cpp
+++ b/bench/sparse_trisolver.cpp
@@ -1,8 +1,9 @@
 
-//g++ -O3 -g0 -DNDEBUG  sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
-//g++ -O3 -g0 -DNDEBUG  sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
-// -DNOGMM -DNOMTL
-// -I /home/gael/Coding/LinearAlgebra/CSparse/Include/ /home/gael/Coding/LinearAlgebra/CSparse/Lib/libcsparse.a
+// g++ -O3 -g0 -DNDEBUG  sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 &&
+// ./a.out g++ -O3 -g0 -DNDEBUG  sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05
+// -DSIZE=2000 && ./a.out
+//  -DNOGMM -DNOMTL
+//  -I /home/gael/Coding/LinearAlgebra/CSparse/Include/ /home/gael/Coding/LinearAlgebra/CSparse/Lib/libcsparse.a
 
 #ifndef SIZE
 #define SIZE 10000
@@ -26,163 +27,158 @@
 #define NBTRIES 10
 #endif
 
-#define BENCH(X) \
-  timer.reset(); \
-  for (int _j=0; _j<NBTRIES; ++_j) { \
-    timer.start(); \
-    for (int _k=0; _k<REPEAT; ++_k) { \
-        X  \
-  } timer.stop(); }
+#define BENCH(X)                          \
+  timer.reset();                          \
+  for (int _j = 0; _j < NBTRIES; ++_j) {  \
+    timer.start();                        \
+    for (int _k = 0; _k < REPEAT; ++_k) { \
+      X                                   \
+    }                                     \
+    timer.stop();                         \
+  }
 
-typedef SparseMatrix<Scalar,UpperTriangular> EigenSparseTriMatrix;
-typedef SparseMatrix<Scalar,RowMajorBit|UpperTriangular> EigenSparseTriMatrixRow;
+typedef SparseMatrix<Scalar, UpperTriangular> EigenSparseTriMatrix;
+typedef SparseMatrix<Scalar, RowMajorBit | UpperTriangular> EigenSparseTriMatrixRow;
 
-void fillMatrix(float density, int rows, int cols,  EigenSparseTriMatrix& dst)
-{
-  dst.startFill(rows*cols*density);
-  for(int j = 0; j < cols; j++)
-  {
-    for(int i = 0; i < j; i++)
-    {
-      Scalar v = (internal::random<float>(0,1) < density) ? internal::random<Scalar>() : 0;
-      if (v!=0)
-        dst.fill(i,j) = v;
+void fillMatrix(float density, int rows, int cols, EigenSparseTriMatrix &dst) {
+  dst.startFill(rows * cols * density);
+  for (int j = 0; j < cols; j++) {
+    for (int i = 0; i < j; i++) {
+      Scalar v = (internal::random<float>(0, 1) < density) ? internal::random<Scalar>() : 0;
+      if (v != 0) dst.fill(i, j) = v;
     }
-    dst.fill(j,j) = internal::random<Scalar>();
+    dst.fill(j, j) = internal::random<Scalar>();
   }
   dst.endFill();
 }
 
-int main(int argc, char *argv[])
-{
+int main(int argc, char *argv[]) {
   int rows = SIZE;
   int cols = SIZE;
   float density = DENSITY;
   BenchTimer timer;
-  #if 1
-  EigenSparseTriMatrix sm1(rows,cols);
-  typedef Matrix<Scalar,Dynamic,1> DenseVector;
+#if 1
+  EigenSparseTriMatrix sm1(rows, cols);
+  typedef Matrix<Scalar, Dynamic, 1> DenseVector;
   DenseVector b = DenseVector::Random(cols);
   DenseVector x = DenseVector::Random(cols);
 
   bool densedone = false;
 
-  for (float density = DENSITY; density>=MINDENSITY; density*=0.5)
-  {
+  for (float density = DENSITY; density >= MINDENSITY; density *= 0.5) {
     EigenSparseTriMatrix sm1(rows, cols);
     fillMatrix(density, rows, cols, sm1);
 
-    // dense matrices
-    #ifdef DENSEMATRIX
-    if (!densedone)
-    {
+// dense matrices
+#ifdef DENSEMATRIX
+    if (!densedone) {
       densedone = true;
-      std::cout << "Eigen Dense\t" << density*100 << "%\n";
-      DenseMatrix m1(rows,cols);
-      Matrix<Scalar,Dynamic,Dynamic,Dynamic,Dynamic,RowMajorBit> m2(rows,cols);
+      std::cout << "Eigen Dense\t" << density * 100 << "%\n";
+      DenseMatrix m1(rows, cols);
+      Matrix<Scalar, Dynamic, Dynamic, Dynamic, Dynamic, RowMajorBit> m2(rows, cols);
       eiToDense(sm1, m1);
       m2 = m1;
 
       BENCH(x = m1.marked<UpperTriangular>().solveTriangular(b);)
       std::cout << "   colmajor^-1 * b:\t" << timer.value() << endl;
-//       std::cerr << x.transpose() << "\n";
+      //       std::cerr << x.transpose() << "\n";
 
       BENCH(x = m2.marked<UpperTriangular>().solveTriangular(b);)
       std::cout << "   rowmajor^-1 * b:\t" << timer.value() << endl;
-//       std::cerr << x.transpose() << "\n";
+      //       std::cerr << x.transpose() << "\n";
     }
-    #endif
+#endif
 
     // eigen sparse matrices
     {
-      std::cout << "Eigen sparse\t" << density*100 << "%\n";
+      std::cout << "Eigen sparse\t" << density * 100 << "%\n";
       EigenSparseTriMatrixRow sm2 = sm1;
 
       BENCH(x = sm1.solveTriangular(b);)
       std::cout << "   colmajor^-1 * b:\t" << timer.value() << endl;
-//       std::cerr << x.transpose() << "\n";
+      //       std::cerr << x.transpose() << "\n";
 
       BENCH(x = sm2.solveTriangular(b);)
       std::cout << "   rowmajor^-1 * b:\t" << timer.value() << endl;
-//       std::cerr << x.transpose() << "\n";
+      //       std::cerr << x.transpose() << "\n";
 
-//       x = b;
-//       BENCH(sm1.inverseProductInPlace(x);)
-//       std::cout << "   colmajor^-1 * b:\t" << timer.value() << " (inplace)" << endl;
-//       std::cerr << x.transpose() << "\n";
-//
-//       x = b;
-//       BENCH(sm2.inverseProductInPlace(x);)
-//       std::cout << "   rowmajor^-1 * b:\t" << timer.value() << " (inplace)" << endl;
-//       std::cerr << x.transpose() << "\n";
+      //       x = b;
+      //       BENCH(sm1.inverseProductInPlace(x);)
+      //       std::cout << "   colmajor^-1 * b:\t" << timer.value() << " (inplace)" << endl;
+      //       std::cerr << x.transpose() << "\n";
+      //
+      //       x = b;
+      //       BENCH(sm2.inverseProductInPlace(x);)
+      //       std::cout << "   rowmajor^-1 * b:\t" << timer.value() << " (inplace)" << endl;
+      //       std::cerr << x.transpose() << "\n";
     }
 
-
-
-    // CSparse
-    #ifdef CSPARSE
+// CSparse
+#ifdef CSPARSE
     {
-      std::cout << "CSparse \t" << density*100 << "%\n";
+      std::cout << "CSparse \t" << density * 100 << "%\n";
       cs *m1;
       eiToCSparse(sm1, m1);
 
-      BENCH(x = b; if (!cs_lsolve (m1, x.data())){std::cerr << "cs_lsolve failed\n"; break;}; )
+      BENCH(x = b; if (!cs_lsolve(m1, x.data())) {
+        std::cerr << "cs_lsolve failed\n";
+        break;
+      };)
       std::cout << "   colmajor^-1 * b:\t" << timer.value() << endl;
     }
-    #endif
+#endif
 
-    // GMM++
-    #ifndef NOGMM
+// GMM++
+#ifndef NOGMM
     {
-      std::cout << "GMM++ sparse\t" << density*100 << "%\n";
-      GmmSparse m1(rows,cols);
+      std::cout << "GMM++ sparse\t" << density * 100 << "%\n";
+      GmmSparse m1(rows, cols);
       gmm::csr_matrix<Scalar> m2;
       eiToGmm(sm1, m1);
-      gmm::copy(m1,m2);
+      gmm::copy(m1, m2);
       std::vector<Scalar> gmmX(cols), gmmB(cols);
-      Map<Matrix<Scalar,Dynamic,1> >(&gmmX[0], cols) = x;
-      Map<Matrix<Scalar,Dynamic,1> >(&gmmB[0], cols) = b;
+      Map<Matrix<Scalar, Dynamic, 1> >(&gmmX[0], cols) = x;
+      Map<Matrix<Scalar, Dynamic, 1> >(&gmmB[0], cols) = b;
 
       gmmX = gmmB;
       BENCH(gmm::upper_tri_solve(m1, gmmX, false);)
       std::cout << "   colmajor^-1 * b:\t" << timer.value() << endl;
-//       std::cerr << Map<Matrix<Scalar,Dynamic,1> >(&gmmX[0], cols).transpose() << "\n";
+      //       std::cerr << Map<Matrix<Scalar,Dynamic,1> >(&gmmX[0], cols).transpose() << "\n";
 
       gmmX = gmmB;
       BENCH(gmm::upper_tri_solve(m2, gmmX, false);)
       timer.stop();
       std::cout << "   rowmajor^-1 * b:\t" << timer.value() << endl;
-//       std::cerr << Map<Matrix<Scalar,Dynamic,1> >(&gmmX[0], cols).transpose() << "\n";
+      //       std::cerr << Map<Matrix<Scalar,Dynamic,1> >(&gmmX[0], cols).transpose() << "\n";
     }
-    #endif
+#endif
 
-    // MTL4
-    #ifndef NOMTL
+// MTL4
+#ifndef NOMTL
     {
-      std::cout << "MTL4\t" << density*100 << "%\n";
-      MtlSparse m1(rows,cols);
-      MtlSparseRowMajor m2(rows,cols);
+      std::cout << "MTL4\t" << density * 100 << "%\n";
+      MtlSparse m1(rows, cols);
+      MtlSparseRowMajor m2(rows, cols);
       eiToMtl(sm1, m1);
       m2 = m1;
       mtl::dense_vector<Scalar> x(rows, 1.0);
       mtl::dense_vector<Scalar> b(rows, 1.0);
 
-      BENCH(x = mtl::upper_trisolve(m1,b);)
+      BENCH(x = mtl::upper_trisolve(m1, b);)
       std::cout << "   colmajor^-1 * b:\t" << timer.value() << endl;
-//       std::cerr << x << "\n";
+      //       std::cerr << x << "\n";
 
-      BENCH(x = mtl::upper_trisolve(m2,b);)
+      BENCH(x = mtl::upper_trisolve(m2, b);)
       std::cout << "   rowmajor^-1 * b:\t" << timer.value() << endl;
-//       std::cerr << x << "\n";
+      //       std::cerr << x << "\n";
     }
-    #endif
-
+#endif
 
     std::cout << "\n\n";
   }
-  #endif
+#endif
 
-  #if 0
+#if 0
     // bench small matrices (in-place versus return bye value)
     {
       timer.reset();
@@ -213,8 +209,7 @@
       }
       std::cout << "4x4 IP :\t" << timer.value() << endl;
     }
-  #endif
+#endif
 
   return 0;
 }
-
diff --git a/bench/spbench/sp_solver.cpp b/bench/spbench/sp_solver.cpp
index 75821a6..42b1239 100644
--- a/bench/spbench/sp_solver.cpp
+++ b/bench/spbench/sp_solver.cpp
@@ -9,7 +9,7 @@
 #include <Eigen/IterativeLinearSolvers>
 #include <Eigen/LU>
 #include <unsupported/Eigen/SparseExtra>
-//#include <Eigen/SparseLU>
+// #include <Eigen/SparseLU>
 #include <Eigen/SuperLUSupport>
 // #include <unsupported/Eigen/src/IterativeSolvers/Scaling.h>
 #include <bench/BenchTimer.h>
@@ -17,109 +17,113 @@
 using namespace std;
 using namespace Eigen;
 
-int main(int argc, char **args)
-{
-  SparseMatrix<double, ColMajor> A; 
+int main(int argc, char **args) {
+  SparseMatrix<double, ColMajor> A;
   typedef SparseMatrix<double, ColMajor>::Index Index;
   typedef Matrix<double, Dynamic, Dynamic> DenseMatrix;
   typedef Matrix<double, Dynamic, 1> DenseRhs;
   VectorXd b, x, tmp;
-  BenchTimer timer,totaltime; 
-  //SparseLU<SparseMatrix<double, ColMajor> >   solver;
-//   SuperLU<SparseMatrix<double, ColMajor> >   solver;
-  ConjugateGradient<SparseMatrix<double, ColMajor>, Lower,IncompleteCholesky<double,Lower> > solver; 
-  ifstream matrix_file; 
+  BenchTimer timer, totaltime;
+  // SparseLU<SparseMatrix<double, ColMajor> >   solver;
+  //   SuperLU<SparseMatrix<double, ColMajor> >   solver;
+  ConjugateGradient<SparseMatrix<double, ColMajor>, Lower, IncompleteCholesky<double, Lower> > solver;
+  ifstream matrix_file;
   string line;
-  int  n;
+  int n;
   // Set parameters
-//   solver.iparm(IPARM_THREAD_NBR) = 4;
+  //   solver.iparm(IPARM_THREAD_NBR) = 4;
   /* Fill the matrix with sparse matrix stored in Matrix-Market coordinate column-oriented format */
   if (argc < 2) assert(false && "please, give the matrix market file ");
-  
+
   timer.start();
   totaltime.start();
   loadMarket(A, args[1]);
   cout << "End charging matrix " << endl;
-  bool iscomplex=false, isvector=false;
+  bool iscomplex = false, isvector = false;
   int sym;
   getMarketHeader(args[1], sym, iscomplex, isvector);
-  if (iscomplex) { cout<< " Not for complex matrices \n"; return -1; }
-  if (isvector) { cout << "The provided file is not a matrix file\n"; return -1;}
-  if (sym != 0) { // symmetric matrices, only the lower part is stored
-    SparseMatrix<double, ColMajor> temp; 
+  if (iscomplex) {
+    cout << " Not for complex matrices \n";
+    return -1;
+  }
+  if (isvector) {
+    cout << "The provided file is not a matrix file\n";
+    return -1;
+  }
+  if (sym != 0) {  // symmetric matrices, only the lower part is stored
+    SparseMatrix<double, ColMajor> temp;
     temp = A;
     A = temp.selfadjointView<Lower>();
   }
   timer.stop();
-  
+
   n = A.cols();
   // ====== TESTS FOR SPARSE TUTORIAL ======
-//   cout<< "OuterSize " << A.outerSize() << " inner " << A.innerSize() << endl; 
-//   SparseMatrix<double, RowMajor> mat1(A); 
-//   SparseMatrix<double, RowMajor> mat2;
-//   cout << " norm of A " << mat1.norm() << endl; ;
-//   PermutationMatrix<Dynamic, Dynamic, int> perm(n);
-//   perm.resize(n,1);
-//   perm.indices().setLinSpaced(n, 0, n-1);
-//   mat2 = perm * mat1;
-//   mat.subrows();
-//   mat2.resize(n,n); 
-//   mat2.reserve(10);
-//   mat2.setConstant();
-//   std::cout<< "NORM " << mat1.squaredNorm()<< endl;  
+  //   cout<< "OuterSize " << A.outerSize() << " inner " << A.innerSize() << endl;
+  //   SparseMatrix<double, RowMajor> mat1(A);
+  //   SparseMatrix<double, RowMajor> mat2;
+  //   cout << " norm of A " << mat1.norm() << endl; ;
+  //   PermutationMatrix<Dynamic, Dynamic, int> perm(n);
+  //   perm.resize(n,1);
+  //   perm.indices().setLinSpaced(n, 0, n-1);
+  //   mat2 = perm * mat1;
+  //   mat.subrows();
+  //   mat2.resize(n,n);
+  //   mat2.reserve(10);
+  //   mat2.setConstant();
+  //   std::cout<< "NORM " << mat1.squaredNorm()<< endl;
 
-  cout<< "Time to load the matrix " << timer.value() <<endl;
+  cout << "Time to load the matrix " << timer.value() << endl;
   /* Fill the right hand side */
 
-//   solver.set_restart(374);
+  //   solver.set_restart(374);
   if (argc > 2)
     loadMarketVector(b, args[2]);
-  else 
-  {
+  else {
     b.resize(n);
     tmp.resize(n);
-//       tmp.setRandom();
-    for (int i = 0; i < n; i++) tmp(i) = i; 
-    b = A * tmp ;
+    //       tmp.setRandom();
+    for (int i = 0; i < n; i++) tmp(i) = i;
+    b = A * tmp;
   }
-//   Scaling<SparseMatrix<double> > scal; 
-//   scal.computeRef(A);
-//   b = scal.LeftScaling().cwiseProduct(b);
+  //   Scaling<SparseMatrix<double> > scal;
+  //   scal.computeRef(A);
+  //   b = scal.LeftScaling().cwiseProduct(b);
 
   /* Compute the factorization */
-  cout<< "Starting the factorization "<< endl; 
+  cout << "Starting the factorization " << endl;
   timer.reset();
-  timer.start(); 
-  cout<< "Size of Input Matrix "<< b.size()<<"\n\n";
-  cout<< "Rows and columns "<< A.rows() <<" " <<A.cols() <<"\n";
+  timer.start();
+  cout << "Size of Input Matrix " << b.size() << "\n\n";
+  cout << "Rows and columns " << A.rows() << " " << A.cols() << "\n";
   solver.compute(A);
-//   solver.analyzePattern(A);
-//   solver.factorize(A);
+  //   solver.analyzePattern(A);
+  //   solver.factorize(A);
   if (solver.info() != Success) {
-    std::cout<< "The solver failed \n";
-    return -1; 
+    std::cout << "The solver failed \n";
+    return -1;
   }
-  timer.stop(); 
-  float time_comp = timer.value(); 
-  cout <<" Compute Time " << time_comp<< endl; 
-  
+  timer.stop();
+  float time_comp = timer.value();
+  cout << " Compute Time " << time_comp << endl;
+
   timer.reset();
   timer.start();
   x = solver.solve(b);
-//   x = scal.RightScaling().cwiseProduct(x);
+  //   x = scal.RightScaling().cwiseProduct(x);
   timer.stop();
-  float time_solve = timer.value(); 
-  cout<< " Time to solve " << time_solve << endl; 
- 
+  float time_solve = timer.value();
+  cout << " Time to solve " << time_solve << endl;
+
   /* Check the accuracy */
-  VectorXd tmp2 = b - A*x;
-  double tempNorm = tmp2.norm()/b.norm();
-  cout << "Relative norm of the computed solution : " << tempNorm <<"\n";
-//   cout << "Iterations : " << solver.iterations() << "\n"; 
-  
+  VectorXd tmp2 = b - A * x;
+  double tempNorm = tmp2.norm() / b.norm();
+  cout << "Relative norm of the computed solution : " << tempNorm << "\n";
+  //   cout << "Iterations : " << solver.iterations() << "\n";
+
   totaltime.stop();
   cout << "Total time " << totaltime.value() << "\n";
-//  std::cout<<x.transpose()<<"\n";
-  
+  //  std::cout<<x.transpose()<<"\n";
+
   return 0;
 }
diff --git a/bench/spbench/spbenchsolver.cpp b/bench/spbench/spbenchsolver.cpp
index 9d2e381..0bb3c3a 100644
--- a/bench/spbench/spbenchsolver.cpp
+++ b/bench/spbench/spbenchsolver.cpp
@@ -1,82 +1,78 @@
 #include <bench/spbench/spbenchsolver.h>
 
-void bench_printhelp()
-{
-    cout<< " \nbenchsolver : performs a benchmark of all the solvers available in Eigen \n\n";
-    cout<< " MATRIX FOLDER : \n";
-    cout<< " The matrices for the benchmark should be collected in a folder specified with an environment variable EIGEN_MATRIXDIR \n";
-    cout<< " The matrices are stored using the matrix market coordinate format \n";
-    cout<< " The matrix and associated right-hand side (rhs) files are named respectively as MatrixName.mtx and MatrixName_b.mtx.\n";
-    cout<< " If the rhs does not exist, a random one is generated. \n";
-    cout<< " If a true solution exists, it should be named as MatrixName_x.mtx ; it will be used to compute the norm of the error \n";
-    cout<< " relative to the computed solutions. \n";
-    cout<< " If a matrix is SPD, the matrix should be named as MatrixName_SPD.mtx (then use MatrixName_SPD_b.mtx \n";
-    cout<< " and MatrixName_SPD_x.mtx for the rhs and the true solution).\n\n";
-    cout<< " OPTIONS : \n"; 
-    cout<< " -h or --help \n    print this help and return\n\n";
-    cout<< " -d matrixdir \n    Use matrixdir as the matrix folder instead of the one specified in the environment variable EIGEN_MATRIXDIR\n\n"; 
-    cout<< " -o outputfile.xml \n    Output the statistics to a xml file \n\n";
-    cout<< " --eps <RelErr> Sets the relative tolerance for iterative solvers (default 1e-08) \n\n";
-    cout<< " --maxits <MaxIts> Sets the maximum number of iterations (default 1000) \n\n";
+void bench_printhelp() {
+  cout << " \nbenchsolver : performs a benchmark of all the solvers available in Eigen \n\n";
+  cout << " MATRIX FOLDER : \n";
+  cout << " The matrices for the benchmark should be collected in a folder specified with an environment variable "
+          "EIGEN_MATRIXDIR \n";
+  cout << " The matrices are stored using the matrix market coordinate format \n";
+  cout << " The matrix and associated right-hand side (rhs) files are named respectively as MatrixName.mtx and "
+          "MatrixName_b.mtx.\n";
+  cout << " If the rhs does not exist, a random one is generated. \n";
+  cout << " If a true solution exists, it should be named as MatrixName_x.mtx ; it will be used to compute the norm of "
+          "the error \n";
+  cout << " relative to the computed solutions. \n";
+  cout << " If a matrix is SPD, the matrix should be named as MatrixName_SPD.mtx (then use MatrixName_SPD_b.mtx \n";
+  cout << " and MatrixName_SPD_x.mtx for the rhs and the true solution).\n\n";
+  cout << " OPTIONS : \n";
+  cout << " -h or --help \n    print this help and return\n\n";
+  cout << " -d matrixdir \n    Use matrixdir as the matrix folder instead of the one specified in the environment "
+          "variable EIGEN_MATRIXDIR\n\n";
+  cout << " -o outputfile.xml \n    Output the statistics to a xml file \n\n";
+  cout << " --eps <RelErr> Sets the relative tolerance for iterative solvers (default 1e-08) \n\n";
+  cout << " --maxits <MaxIts> Sets the maximum number of iterations (default 1000) \n\n";
 }
 
-int main(int argc, char ** args)
-{
-  
-  bool help = ( get_options(argc, args, "-h") || get_options(argc, args, "--help") );
-  if(help) {
+int main(int argc, char** args) {
+  bool help = (get_options(argc, args, "-h") || get_options(argc, args, "--help"));
+  if (help) {
     bench_printhelp();
     return 0;
   }
 
   // Get the location of the test matrices
   string matrix_dir;
-  if (!get_options(argc, args, "-d", &matrix_dir))
-  {
-    if(getenv("EIGEN_MATRIXDIR") == NULL){
-      std::cerr << "Please, specify the location of the matrices with -d mat_folder or the environment variable EIGEN_MATRIXDIR \n";
+  if (!get_options(argc, args, "-d", &matrix_dir)) {
+    if (getenv("EIGEN_MATRIXDIR") == NULL) {
+      std::cerr << "Please, specify the location of the matrices with -d mat_folder or the environment variable "
+                   "EIGEN_MATRIXDIR \n";
       std::cerr << " Run with --help to see the list of all the available options \n";
       return -1;
     }
     matrix_dir = getenv("EIGEN_MATRIXDIR");
   }
-     
+
   std::ofstream statbuf;
-  string statFile ;
-  
+  string statFile;
+
   // Get the file to write the statistics
   bool statFileExists = get_options(argc, args, "-o", &statFile);
-  if(statFileExists)
-  {
+  if (statFileExists) {
     statbuf.open(statFile.c_str(), std::ios::out);
-    if(statbuf.good()){
-      statFileExists = true; 
+    if (statbuf.good()) {
+      statFileExists = true;
       printStatheader(statbuf);
       statbuf.close();
-    }
-    else
+    } else
       std::cerr << "Unable to open the provided file for writing... \n";
-  }       
-  
+  }
+
   // Get the maximum number of iterations and the tolerance
-  int maxiters = 1000; 
-  double tol = 1e-08; 
-  string inval; 
-  if (get_options(argc, args, "--eps", &inval))
-    tol = atof(inval.c_str()); 
-  if(get_options(argc, args, "--maxits", &inval))
-    maxiters = atoi(inval.c_str()); 
-  
-  string current_dir; 
+  int maxiters = 1000;
+  double tol = 1e-08;
+  string inval;
+  if (get_options(argc, args, "--eps", &inval)) tol = atof(inval.c_str());
+  if (get_options(argc, args, "--maxits", &inval)) maxiters = atoi(inval.c_str());
+
+  string current_dir;
   // Test the real-arithmetics matrices
-  Browse_Matrices<double>(matrix_dir, statFileExists, statFile,maxiters, tol);
-  
+  Browse_Matrices<double>(matrix_dir, statFileExists, statFile, maxiters, tol);
+
   // Test the complex-arithmetics matrices
-  Browse_Matrices<std::complex<double> >(matrix_dir, statFileExists, statFile, maxiters, tol); 
-  
-  if(statFileExists)
-  {
-    statbuf.open(statFile.c_str(), std::ios::app); 
+  Browse_Matrices<std::complex<double> >(matrix_dir, statFileExists, statFile, maxiters, tol);
+
+  if (statFileExists) {
+    statbuf.open(statFile.c_str(), std::ios::app);
     statbuf << "</BENCH> \n";
     cout << "\n Output written in " << statFile << " ...\n";
     statbuf.close();
@@ -84,5 +80,3 @@
 
   return 0;
 }
-
-      
diff --git a/bench/spbench/spbenchsolver.h b/bench/spbench/spbenchsolver.h
index 8f59d10..811a056 100644
--- a/bench/spbench/spbenchsolver.h
+++ b/bench/spbench/spbenchsolver.h
@@ -7,7 +7,6 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-
 #include <iostream>
 #include <fstream>
 #include <Eigen/SparseCore>
@@ -54,520 +53,513 @@
 #endif
 
 // CONSTANTS
-#define EIGEN_UMFPACK  10
-#define EIGEN_KLU  11
-#define EIGEN_SUPERLU  20
-#define EIGEN_PASTIX  30
-#define EIGEN_PARDISO  40
+#define EIGEN_UMFPACK 10
+#define EIGEN_KLU 11
+#define EIGEN_SUPERLU 20
+#define EIGEN_PASTIX 30
+#define EIGEN_PARDISO 40
 #define EIGEN_SPARSELU_COLAMD 50
 #define EIGEN_SPARSELU_METIS 51
-#define EIGEN_BICGSTAB  60
-#define EIGEN_BICGSTAB_ILUT  61
+#define EIGEN_BICGSTAB 60
+#define EIGEN_BICGSTAB_ILUT 61
 #define EIGEN_GMRES 70
 #define EIGEN_GMRES_ILUT 71
-#define EIGEN_SIMPLICIAL_LDLT  80
-#define EIGEN_CHOLMOD_LDLT  90
-#define EIGEN_PASTIX_LDLT  100
-#define EIGEN_PARDISO_LDLT  110
-#define EIGEN_SIMPLICIAL_LLT  120
-#define EIGEN_CHOLMOD_SUPERNODAL_LLT  130
-#define EIGEN_CHOLMOD_SIMPLICIAL_LLT  140
-#define EIGEN_PASTIX_LLT  150
-#define EIGEN_PARDISO_LLT  160
-#define EIGEN_CG  170
-#define EIGEN_CG_PRECOND  180
+#define EIGEN_SIMPLICIAL_LDLT 80
+#define EIGEN_CHOLMOD_LDLT 90
+#define EIGEN_PASTIX_LDLT 100
+#define EIGEN_PARDISO_LDLT 110
+#define EIGEN_SIMPLICIAL_LLT 120
+#define EIGEN_CHOLMOD_SUPERNODAL_LLT 130
+#define EIGEN_CHOLMOD_SIMPLICIAL_LLT 140
+#define EIGEN_PASTIX_LLT 150
+#define EIGEN_PARDISO_LLT 160
+#define EIGEN_CG 170
+#define EIGEN_CG_PRECOND 180
 
 using namespace Eigen;
-using namespace std; 
-
+using namespace std;
 
 // Global variables for input parameters
-int MaximumIters; // Maximum number of iterations
-double RelErr; // Relative error of the computed solution
-double best_time_val; // Current best time overall solvers 
-int best_time_id; //  id of the best solver for the current system 
+int MaximumIters;      // Maximum number of iterations
+double RelErr;         // Relative error of the computed solution
+double best_time_val;  // Current best time overall solvers
+int best_time_id;      //  id of the best solver for the current system
 
-template<typename T> inline typename NumTraits<T>::Real test_precision() { return NumTraits<T>::dummy_precision(); }
-template<> inline float test_precision<float>() { return 1e-3f; }                                                             
-template<> inline double test_precision<double>() { return 1e-6; }                                                            
-template<> inline float test_precision<std::complex<float> >() { return test_precision<float>(); }
-template<> inline double test_precision<std::complex<double> >() { return test_precision<double>(); }
+template <typename T>
+inline typename NumTraits<T>::Real test_precision() {
+  return NumTraits<T>::dummy_precision();
+}
+template <>
+inline float test_precision<float>() {
+  return 1e-3f;
+}
+template <>
+inline double test_precision<double>() {
+  return 1e-6;
+}
+template <>
+inline float test_precision<std::complex<float> >() {
+  return test_precision<float>();
+}
+template <>
+inline double test_precision<std::complex<double> >() {
+  return test_precision<double>();
+}
 
-void printStatheader(std::ofstream& out)
-{
+void printStatheader(std::ofstream& out) {
   // Print XML header
-  // NOTE It would have been much easier to write these XML documents using external libraries like tinyXML or Xerces-C++.
-  
+  // NOTE It would have been much easier to write these XML documents using external libraries like tinyXML or
+  // Xerces-C++.
+
   out << "<?xml version='1.0' encoding='UTF-8'?> \n";
-  out << "<?xml-stylesheet type='text/xsl' href='#stylesheet' ?> \n"; 
+  out << "<?xml-stylesheet type='text/xsl' href='#stylesheet' ?> \n";
   out << "<!DOCTYPE BENCH  [\n<!ATTLIST xsl:stylesheet\n id\t ID  #REQUIRED>\n]>";
-  out << "\n\n<!-- Generated by the Eigen library -->\n"; 
-  
-  out << "\n<BENCH> \n" ; //root XML element 
+  out << "\n\n<!-- Generated by the Eigen library -->\n";
+
+  out << "\n<BENCH> \n";  // root XML element
   // Print the xsl style section
-  printBenchStyle(out); 
-  // List all available solvers 
+  printBenchStyle(out);
+  // List all available solvers
   out << " <AVAILSOLVER> \n";
 #ifdef EIGEN_UMFPACK_SUPPORT
-  out <<"  <SOLVER ID='" << EIGEN_UMFPACK << "'>\n"; 
+  out << "  <SOLVER ID='" << EIGEN_UMFPACK << "'>\n";
   out << "   <TYPE> LU </TYPE> \n";
-  out << "   <PACKAGE> UMFPACK </PACKAGE> \n"; 
-  out << "  </SOLVER> \n"; 
+  out << "   <PACKAGE> UMFPACK </PACKAGE> \n";
+  out << "  </SOLVER> \n";
 #endif
 #ifdef EIGEN_KLU_SUPPORT
-  out <<"  <SOLVER ID='" << EIGEN_KLU << "'>\n";
+  out << "  <SOLVER ID='" << EIGEN_KLU << "'>\n";
   out << "   <TYPE> LU </TYPE> \n";
   out << "   <PACKAGE> KLU </PACKAGE> \n";
   out << "  </SOLVER> \n";
 #endif
 #ifdef EIGEN_SUPERLU_SUPPORT
-  out <<"  <SOLVER ID='" << EIGEN_SUPERLU << "'>\n"; 
+  out << "  <SOLVER ID='" << EIGEN_SUPERLU << "'>\n";
   out << "   <TYPE> LU </TYPE> \n";
-  out << "   <PACKAGE> SUPERLU </PACKAGE> \n"; 
-  out << "  </SOLVER> \n"; 
+  out << "   <PACKAGE> SUPERLU </PACKAGE> \n";
+  out << "  </SOLVER> \n";
 #endif
 #ifdef EIGEN_CHOLMOD_SUPPORT
-  out <<"  <SOLVER ID='" << EIGEN_CHOLMOD_SIMPLICIAL_LLT << "'>\n"; 
+  out << "  <SOLVER ID='" << EIGEN_CHOLMOD_SIMPLICIAL_LLT << "'>\n";
   out << "   <TYPE> LLT SP</TYPE> \n";
   out << "   <PACKAGE> CHOLMOD </PACKAGE> \n";
-  out << "  </SOLVER> \n"; 
-  
-  out <<"  <SOLVER ID='" << EIGEN_CHOLMOD_SUPERNODAL_LLT << "'>\n"; 
+  out << "  </SOLVER> \n";
+
+  out << "  <SOLVER ID='" << EIGEN_CHOLMOD_SUPERNODAL_LLT << "'>\n";
   out << "   <TYPE> LLT</TYPE> \n";
   out << "   <PACKAGE> CHOLMOD </PACKAGE> \n";
   out << "  </SOLVER> \n";
-  
-  out <<"  <SOLVER ID='" << EIGEN_CHOLMOD_LDLT << "'>\n"; 
+
+  out << "  <SOLVER ID='" << EIGEN_CHOLMOD_LDLT << "'>\n";
   out << "   <TYPE> LDLT </TYPE> \n";
-  out << "   <PACKAGE> CHOLMOD </PACKAGE> \n";  
-  out << "  </SOLVER> \n"; 
+  out << "   <PACKAGE> CHOLMOD </PACKAGE> \n";
+  out << "  </SOLVER> \n";
 #endif
 #ifdef EIGEN_PARDISO_SUPPORT
-  out <<"  <SOLVER ID='" << EIGEN_PARDISO << "'>\n"; 
+  out << "  <SOLVER ID='" << EIGEN_PARDISO << "'>\n";
   out << "   <TYPE> LU </TYPE> \n";
-  out << "   <PACKAGE> PARDISO </PACKAGE> \n"; 
-  out << "  </SOLVER> \n"; 
-  
-  out <<"  <SOLVER ID='" << EIGEN_PARDISO_LLT << "'>\n"; 
+  out << "   <PACKAGE> PARDISO </PACKAGE> \n";
+  out << "  </SOLVER> \n";
+
+  out << "  <SOLVER ID='" << EIGEN_PARDISO_LLT << "'>\n";
   out << "   <TYPE> LLT </TYPE> \n";
-  out << "   <PACKAGE> PARDISO </PACKAGE> \n"; 
-  out << "  </SOLVER> \n"; 
-  
-  out <<"  <SOLVER ID='" << EIGEN_PARDISO_LDLT << "'>\n"; 
+  out << "   <PACKAGE> PARDISO </PACKAGE> \n";
+  out << "  </SOLVER> \n";
+
+  out << "  <SOLVER ID='" << EIGEN_PARDISO_LDLT << "'>\n";
   out << "   <TYPE> LDLT </TYPE> \n";
-  out << "   <PACKAGE> PARDISO </PACKAGE> \n"; 
-  out << "  </SOLVER> \n"; 
+  out << "   <PACKAGE> PARDISO </PACKAGE> \n";
+  out << "  </SOLVER> \n";
 #endif
 #ifdef EIGEN_PASTIX_SUPPORT
-  out <<"  <SOLVER ID='" << EIGEN_PASTIX << "'>\n"; 
+  out << "  <SOLVER ID='" << EIGEN_PASTIX << "'>\n";
   out << "   <TYPE> LU </TYPE> \n";
-  out << "   <PACKAGE> PASTIX </PACKAGE> \n"; 
-  out << "  </SOLVER> \n"; 
-  
-  out <<"  <SOLVER ID='" << EIGEN_PASTIX_LLT << "'>\n"; 
+  out << "   <PACKAGE> PASTIX </PACKAGE> \n";
+  out << "  </SOLVER> \n";
+
+  out << "  <SOLVER ID='" << EIGEN_PASTIX_LLT << "'>\n";
   out << "   <TYPE> LLT </TYPE> \n";
-  out << "   <PACKAGE> PASTIX </PACKAGE> \n"; 
-  out << "  </SOLVER> \n"; 
-  
-  out <<"  <SOLVER ID='" << EIGEN_PASTIX_LDLT << "'>\n"; 
+  out << "   <PACKAGE> PASTIX </PACKAGE> \n";
+  out << "  </SOLVER> \n";
+
+  out << "  <SOLVER ID='" << EIGEN_PASTIX_LDLT << "'>\n";
   out << "   <TYPE> LDLT </TYPE> \n";
-  out << "   <PACKAGE> PASTIX </PACKAGE> \n"; 
-  out << "  </SOLVER> \n"; 
+  out << "   <PACKAGE> PASTIX </PACKAGE> \n";
+  out << "  </SOLVER> \n";
 #endif
-  
-  out <<"  <SOLVER ID='" << EIGEN_BICGSTAB << "'>\n"; 
+
+  out << "  <SOLVER ID='" << EIGEN_BICGSTAB << "'>\n";
   out << "   <TYPE> BICGSTAB </TYPE> \n";
-  out << "   <PACKAGE> EIGEN </PACKAGE> \n"; 
-  out << "  </SOLVER> \n"; 
-  
-  out <<"  <SOLVER ID='" << EIGEN_BICGSTAB_ILUT << "'>\n"; 
+  out << "   <PACKAGE> EIGEN </PACKAGE> \n";
+  out << "  </SOLVER> \n";
+
+  out << "  <SOLVER ID='" << EIGEN_BICGSTAB_ILUT << "'>\n";
   out << "   <TYPE> BICGSTAB_ILUT </TYPE> \n";
-  out << "   <PACKAGE> EIGEN </PACKAGE> \n"; 
-  out << "  </SOLVER> \n"; 
-  
-  out <<"  <SOLVER ID='" << EIGEN_GMRES_ILUT << "'>\n"; 
+  out << "   <PACKAGE> EIGEN </PACKAGE> \n";
+  out << "  </SOLVER> \n";
+
+  out << "  <SOLVER ID='" << EIGEN_GMRES_ILUT << "'>\n";
   out << "   <TYPE> GMRES_ILUT </TYPE> \n";
-  out << "   <PACKAGE> EIGEN </PACKAGE> \n"; 
-  out << "  </SOLVER> \n"; 
-  
-  out <<"  <SOLVER ID='" << EIGEN_SIMPLICIAL_LDLT << "'>\n"; 
+  out << "   <PACKAGE> EIGEN </PACKAGE> \n";
+  out << "  </SOLVER> \n";
+
+  out << "  <SOLVER ID='" << EIGEN_SIMPLICIAL_LDLT << "'>\n";
   out << "   <TYPE> LDLT </TYPE> \n";
-  out << "   <PACKAGE> EIGEN </PACKAGE> \n"; 
-  out << "  </SOLVER> \n"; 
-  
-  out <<"  <SOLVER ID='" << EIGEN_SIMPLICIAL_LLT << "'>\n"; 
+  out << "   <PACKAGE> EIGEN </PACKAGE> \n";
+  out << "  </SOLVER> \n";
+
+  out << "  <SOLVER ID='" << EIGEN_SIMPLICIAL_LLT << "'>\n";
   out << "   <TYPE> LLT </TYPE> \n";
-  out << "   <PACKAGE> EIGEN </PACKAGE> \n"; 
-  out << "  </SOLVER> \n"; 
-  
-  out <<"  <SOLVER ID='" << EIGEN_CG << "'>\n"; 
+  out << "   <PACKAGE> EIGEN </PACKAGE> \n";
+  out << "  </SOLVER> \n";
+
+  out << "  <SOLVER ID='" << EIGEN_CG << "'>\n";
   out << "   <TYPE> CG </TYPE> \n";
-  out << "   <PACKAGE> EIGEN </PACKAGE> \n"; 
-  out << "  </SOLVER> \n"; 
-  
-  out <<"  <SOLVER ID='" << EIGEN_SPARSELU_COLAMD << "'>\n"; 
+  out << "   <PACKAGE> EIGEN </PACKAGE> \n";
+  out << "  </SOLVER> \n";
+
+  out << "  <SOLVER ID='" << EIGEN_SPARSELU_COLAMD << "'>\n";
   out << "   <TYPE> LU_COLAMD </TYPE> \n";
-  out << "   <PACKAGE> EIGEN </PACKAGE> \n"; 
-  out << "  </SOLVER> \n"; 
-  
+  out << "   <PACKAGE> EIGEN </PACKAGE> \n";
+  out << "  </SOLVER> \n";
+
 #ifdef EIGEN_METIS_SUPPORT
-  out <<"  <SOLVER ID='" << EIGEN_SPARSELU_METIS << "'>\n"; 
+  out << "  <SOLVER ID='" << EIGEN_SPARSELU_METIS << "'>\n";
   out << "   <TYPE> LU_METIS </TYPE> \n";
-  out << "   <PACKAGE> EIGEN </PACKAGE> \n"; 
-  out << "  </SOLVER> \n"; 
+  out << "   <PACKAGE> EIGEN </PACKAGE> \n";
+  out << "  </SOLVER> \n";
 #endif
-  out << " </AVAILSOLVER> \n"; 
-  
+  out << " </AVAILSOLVER> \n";
 }
 
-
-template<typename Solver, typename Scalar>
-void call_solver(Solver &solver, const int solver_id, const typename Solver::MatrixType& A, const Matrix<Scalar, Dynamic, 1>& b, const Matrix<Scalar, Dynamic, 1>& refX,std::ofstream& statbuf)
-{
-  
+template <typename Solver, typename Scalar>
+void call_solver(Solver& solver, const int solver_id, const typename Solver::MatrixType& A,
+                 const Matrix<Scalar, Dynamic, 1>& b, const Matrix<Scalar, Dynamic, 1>& refX, std::ofstream& statbuf) {
   double total_time;
   double compute_time;
-  double solve_time; 
+  double solve_time;
   double rel_error;
-  Matrix<Scalar, Dynamic, 1> x; 
-  BenchTimer timer; 
+  Matrix<Scalar, Dynamic, 1> x;
+  BenchTimer timer;
   timer.reset();
   timer.start();
-  solver.compute(A); 
-  if (solver.info() != Success)
-  {
+  solver.compute(A);
+  if (solver.info() != Success) {
     std::cerr << "Solver failed ... \n";
     return;
   }
   timer.stop();
   compute_time = timer.value();
-  statbuf << "    <TIME>\n"; 
+  statbuf << "    <TIME>\n";
   statbuf << "     <COMPUTE> " << timer.value() << "</COMPUTE>\n";
-  std::cout<< "COMPUTE TIME : " << timer.value() <<std::endl; 
-    
+  std::cout << "COMPUTE TIME : " << timer.value() << std::endl;
+
   timer.reset();
   timer.start();
-  x = solver.solve(b); 
-  if (solver.info() == NumericalIssue)
-  {
+  x = solver.solve(b);
+  if (solver.info() == NumericalIssue) {
     std::cerr << "Solver failed ... \n";
     return;
   }
   timer.stop();
   solve_time = timer.value();
-  statbuf << "     <SOLVE> " << timer.value() << "</SOLVE>\n"; 
-  std::cout<< "SOLVE TIME : " << timer.value() <<std::endl; 
-  
+  statbuf << "     <SOLVE> " << timer.value() << "</SOLVE>\n";
+  std::cout << "SOLVE TIME : " << timer.value() << std::endl;
+
   total_time = solve_time + compute_time;
-  statbuf << "     <TOTAL> " << total_time << "</TOTAL>\n"; 
-  std::cout<< "TOTAL TIME : " << total_time <<std::endl; 
-  statbuf << "    </TIME>\n"; 
-  
+  statbuf << "     <TOTAL> " << total_time << "</TOTAL>\n";
+  std::cout << "TOTAL TIME : " << total_time << std::endl;
+  statbuf << "    </TIME>\n";
+
   // Verify the relative error
-  if(refX.size() != 0)
-    rel_error = (refX - x).norm()/refX.norm();
-  else 
-  {
+  if (refX.size() != 0)
+    rel_error = (refX - x).norm() / refX.norm();
+  else {
     // Compute the relative residual norm
-    Matrix<Scalar, Dynamic, 1> temp; 
-    temp = A * x; 
-    rel_error = (b-temp).norm()/b.norm();
+    Matrix<Scalar, Dynamic, 1> temp;
+    temp = A * x;
+    rel_error = (b - temp).norm() / b.norm();
   }
-  statbuf << "    <ERROR> " << rel_error << "</ERROR>\n"; 
-  std::cout<< "REL. ERROR : " << rel_error << "\n\n" ;
-  if ( rel_error <= RelErr )
-  {
+  statbuf << "    <ERROR> " << rel_error << "</ERROR>\n";
+  std::cout << "REL. ERROR : " << rel_error << "\n\n";
+  if (rel_error <= RelErr) {
     // check the best time if convergence
-    if(!best_time_val || (best_time_val > total_time))
-    {
+    if (!best_time_val || (best_time_val > total_time)) {
       best_time_val = total_time;
       best_time_id = solver_id;
     }
   }
 }
 
-template<typename Solver, typename Scalar>
-void call_directsolver(Solver& solver, const int solver_id, const typename Solver::MatrixType& A, const Matrix<Scalar, Dynamic, 1>& b, const Matrix<Scalar, Dynamic, 1>& refX, std::string& statFile)
-{
-    std::ofstream statbuf(statFile.c_str(), std::ios::app);
-    statbuf << "   <SOLVER_STAT ID='" << solver_id <<"'>\n"; 
-    call_solver(solver, solver_id, A, b, refX,statbuf);
-    statbuf << "   </SOLVER_STAT>\n";
-    statbuf.close();
-}
-
-template<typename Solver, typename Scalar>
-void call_itersolver(Solver &solver, const int solver_id, const typename Solver::MatrixType& A, const Matrix<Scalar, Dynamic, 1>& b, const Matrix<Scalar, Dynamic, 1>& refX, std::string& statFile)
-{
-  solver.setTolerance(RelErr); 
-  solver.setMaxIterations(MaximumIters);
-  
+template <typename Solver, typename Scalar>
+void call_directsolver(Solver& solver, const int solver_id, const typename Solver::MatrixType& A,
+                       const Matrix<Scalar, Dynamic, 1>& b, const Matrix<Scalar, Dynamic, 1>& refX,
+                       std::string& statFile) {
   std::ofstream statbuf(statFile.c_str(), std::ios::app);
-  statbuf << " <SOLVER_STAT ID='" << solver_id <<"'>\n"; 
-  call_solver(solver, solver_id, A, b, refX,statbuf); 
-  statbuf << "   <ITER> "<< solver.iterations() << "</ITER>\n";
-  statbuf << " </SOLVER_STAT>\n";
-  std::cout << "ITERATIONS : " << solver.iterations() <<"\n\n\n"; 
-  
+  statbuf << "   <SOLVER_STAT ID='" << solver_id << "'>\n";
+  call_solver(solver, solver_id, A, b, refX, statbuf);
+  statbuf << "   </SOLVER_STAT>\n";
+  statbuf.close();
 }
 
+template <typename Solver, typename Scalar>
+void call_itersolver(Solver& solver, const int solver_id, const typename Solver::MatrixType& A,
+                     const Matrix<Scalar, Dynamic, 1>& b, const Matrix<Scalar, Dynamic, 1>& refX,
+                     std::string& statFile) {
+  solver.setTolerance(RelErr);
+  solver.setMaxIterations(MaximumIters);
+
+  std::ofstream statbuf(statFile.c_str(), std::ios::app);
+  statbuf << " <SOLVER_STAT ID='" << solver_id << "'>\n";
+  call_solver(solver, solver_id, A, b, refX, statbuf);
+  statbuf << "   <ITER> " << solver.iterations() << "</ITER>\n";
+  statbuf << " </SOLVER_STAT>\n";
+  std::cout << "ITERATIONS : " << solver.iterations() << "\n\n\n";
+}
 
 template <typename Scalar>
-void SelectSolvers(const SparseMatrix<Scalar>&A, unsigned int sym, Matrix<Scalar, Dynamic, 1>& b, const Matrix<Scalar, Dynamic, 1>& refX, std::string& statFile)
-{
-  typedef SparseMatrix<Scalar, ColMajor> SpMat; 
+void SelectSolvers(const SparseMatrix<Scalar>& A, unsigned int sym, Matrix<Scalar, Dynamic, 1>& b,
+                   const Matrix<Scalar, Dynamic, 1>& refX, std::string& statFile) {
+  typedef SparseMatrix<Scalar, ColMajor> SpMat;
   // First, deal with Nonsymmetric and symmetric matrices
-  best_time_id = 0; 
+  best_time_id = 0;
   best_time_val = 0.0;
-  //UMFPACK
-  #ifdef EIGEN_UMFPACK_SUPPORT
+// UMFPACK
+#ifdef EIGEN_UMFPACK_SUPPORT
   {
-    cout << "Solving with UMFPACK LU ... \n"; 
-    UmfPackLU<SpMat> solver; 
-    call_directsolver(solver, EIGEN_UMFPACK, A, b, refX,statFile); 
+    cout << "Solving with UMFPACK LU ... \n";
+    UmfPackLU<SpMat> solver;
+    call_directsolver(solver, EIGEN_UMFPACK, A, b, refX, statFile);
   }
-  #endif
-  //KLU
-  #ifdef EIGEN_KLU_SUPPORT
+#endif
+// KLU
+#ifdef EIGEN_KLU_SUPPORT
   {
     cout << "Solving with KLU LU ... \n";
     KLU<SpMat> solver;
-    call_directsolver(solver, EIGEN_KLU, A, b, refX,statFile);
+    call_directsolver(solver, EIGEN_KLU, A, b, refX, statFile);
   }
-  #endif
-    //SuperLU
-  #ifdef EIGEN_SUPERLU_SUPPORT
+#endif
+  // SuperLU
+#ifdef EIGEN_SUPERLU_SUPPORT
   {
-    cout << "\nSolving with SUPERLU ... \n"; 
+    cout << "\nSolving with SUPERLU ... \n";
     SuperLU<SpMat> solver;
-    call_directsolver(solver, EIGEN_SUPERLU, A, b, refX,statFile); 
+    call_directsolver(solver, EIGEN_SUPERLU, A, b, refX, statFile);
   }
-  #endif
-    
-   // PaStix LU
-  #ifdef EIGEN_PASTIX_SUPPORT
-  {
-    cout << "\nSolving with PASTIX LU ... \n"; 
-    PastixLU<SpMat> solver; 
-    call_directsolver(solver, EIGEN_PASTIX, A, b, refX,statFile) ;
-  }
-  #endif
+#endif
 
-   //PARDISO LU
-  #ifdef EIGEN_PARDISO_SUPPORT
+  // PaStix LU
+#ifdef EIGEN_PASTIX_SUPPORT
   {
-    cout << "\nSolving with PARDISO LU ... \n"; 
-    PardisoLU<SpMat>  solver; 
-    call_directsolver(solver, EIGEN_PARDISO, A, b, refX,statFile);
+    cout << "\nSolving with PASTIX LU ... \n";
+    PastixLU<SpMat> solver;
+    call_directsolver(solver, EIGEN_PASTIX, A, b, refX, statFile);
   }
-  #endif
-  
+#endif
+
+  // PARDISO LU
+#ifdef EIGEN_PARDISO_SUPPORT
+  {
+    cout << "\nSolving with PARDISO LU ... \n";
+    PardisoLU<SpMat> solver;
+    call_directsolver(solver, EIGEN_PARDISO, A, b, refX, statFile);
+  }
+#endif
+
   // Eigen SparseLU METIS
   cout << "\n Solving with Sparse LU AND COLAMD ... \n";
-  SparseLU<SpMat, COLAMDOrdering<int> >   solver;
-  call_directsolver(solver, EIGEN_SPARSELU_COLAMD, A, b, refX, statFile); 
-  // Eigen SparseLU METIS
-  #ifdef EIGEN_METIS_SUPPORT
+  SparseLU<SpMat, COLAMDOrdering<int> > solver;
+  call_directsolver(solver, EIGEN_SPARSELU_COLAMD, A, b, refX, statFile);
+// Eigen SparseLU METIS
+#ifdef EIGEN_METIS_SUPPORT
   {
     cout << "\n Solving with Sparse LU AND METIS ... \n";
-    SparseLU<SpMat, MetisOrdering<int> >   solver;
-    call_directsolver(solver, EIGEN_SPARSELU_METIS, A, b, refX, statFile); 
+    SparseLU<SpMat, MetisOrdering<int> > solver;
+    call_directsolver(solver, EIGEN_SPARSELU_METIS, A, b, refX, statFile);
   }
-  #endif
-  
-  //BiCGSTAB
+#endif
+
+  // BiCGSTAB
   {
-    cout << "\nSolving with BiCGSTAB ... \n"; 
-    BiCGSTAB<SpMat> solver; 
-    call_itersolver(solver, EIGEN_BICGSTAB, A, b, refX,statFile);
+    cout << "\nSolving with BiCGSTAB ... \n";
+    BiCGSTAB<SpMat> solver;
+    call_itersolver(solver, EIGEN_BICGSTAB, A, b, refX, statFile);
   }
-  //BiCGSTAB+ILUT
+  // BiCGSTAB+ILUT
   {
-    cout << "\nSolving with BiCGSTAB and ILUT ... \n"; 
-    BiCGSTAB<SpMat, IncompleteLUT<Scalar> > solver; 
-    call_itersolver(solver, EIGEN_BICGSTAB_ILUT, A, b, refX,statFile); 
+    cout << "\nSolving with BiCGSTAB and ILUT ... \n";
+    BiCGSTAB<SpMat, IncompleteLUT<Scalar> > solver;
+    call_itersolver(solver, EIGEN_BICGSTAB_ILUT, A, b, refX, statFile);
   }
-  
-   
-  //GMRES
-//   {
-//     cout << "\nSolving with GMRES ... \n"; 
-//     GMRES<SpMat> solver; 
-//     call_itersolver(solver, EIGEN_GMRES, A, b, refX,statFile); 
-//   }
-  //GMRES+ILUT
+
+  // GMRES
+  //   {
+  //     cout << "\nSolving with GMRES ... \n";
+  //     GMRES<SpMat> solver;
+  //     call_itersolver(solver, EIGEN_GMRES, A, b, refX,statFile);
+  //   }
+  // GMRES+ILUT
   {
-    cout << "\nSolving with GMRES and ILUT ... \n"; 
-    GMRES<SpMat, IncompleteLUT<Scalar> > solver; 
-    call_itersolver(solver, EIGEN_GMRES_ILUT, A, b, refX,statFile);
+    cout << "\nSolving with GMRES and ILUT ... \n";
+    GMRES<SpMat, IncompleteLUT<Scalar> > solver;
+    call_itersolver(solver, EIGEN_GMRES_ILUT, A, b, refX, statFile);
   }
-  
+
   // Hermitian and not necessarily positive-definites
-  if (sym != NonSymmetric)
-  {
+  if (sym != NonSymmetric) {
     // Internal Cholesky
     {
-      cout << "\nSolving with Simplicial LDLT ... \n"; 
+      cout << "\nSolving with Simplicial LDLT ... \n";
       SimplicialLDLT<SpMat, Lower> solver;
-      call_directsolver(solver, EIGEN_SIMPLICIAL_LDLT, A, b, refX,statFile); 
+      call_directsolver(solver, EIGEN_SIMPLICIAL_LDLT, A, b, refX, statFile);
     }
-    
-    // CHOLMOD
-    #ifdef EIGEN_CHOLMOD_SUPPORT
+
+// CHOLMOD
+#ifdef EIGEN_CHOLMOD_SUPPORT
     {
-      cout << "\nSolving with CHOLMOD LDLT ... \n"; 
+      cout << "\nSolving with CHOLMOD LDLT ... \n";
       CholmodDecomposition<SpMat, Lower> solver;
       solver.setMode(CholmodLDLt);
-       call_directsolver(solver,EIGEN_CHOLMOD_LDLT, A, b, refX,statFile);
+      call_directsolver(solver, EIGEN_CHOLMOD_LDLT, A, b, refX, statFile);
     }
-    #endif
-    
-    //PASTIX LLT
-    #ifdef EIGEN_PASTIX_SUPPORT
+#endif
+
+// PASTIX LLT
+#ifdef EIGEN_PASTIX_SUPPORT
     {
-      cout << "\nSolving with PASTIX LDLT ... \n"; 
-      PastixLDLT<SpMat, Lower> solver; 
-      call_directsolver(solver,EIGEN_PASTIX_LDLT, A, b, refX,statFile); 
+      cout << "\nSolving with PASTIX LDLT ... \n";
+      PastixLDLT<SpMat, Lower> solver;
+      call_directsolver(solver, EIGEN_PASTIX_LDLT, A, b, refX, statFile);
     }
-    #endif
-    
-    //PARDISO LLT
-    #ifdef EIGEN_PARDISO_SUPPORT
+#endif
+
+// PARDISO LLT
+#ifdef EIGEN_PARDISO_SUPPORT
     {
-      cout << "\nSolving with PARDISO LDLT ... \n"; 
-      PardisoLDLT<SpMat, Lower> solver; 
-      call_directsolver(solver,EIGEN_PARDISO_LDLT, A, b, refX,statFile); 
+      cout << "\nSolving with PARDISO LDLT ... \n";
+      PardisoLDLT<SpMat, Lower> solver;
+      call_directsolver(solver, EIGEN_PARDISO_LDLT, A, b, refX, statFile);
     }
-    #endif
+#endif
   }
 
-   // Now, symmetric POSITIVE DEFINITE matrices
-  if (sym == SPD)
-  {
-    
-    //Internal Sparse Cholesky
+  // Now, symmetric POSITIVE DEFINITE matrices
+  if (sym == SPD) {
+    // Internal Sparse Cholesky
     {
-      cout << "\nSolving with SIMPLICIAL LLT ... \n"; 
-      SimplicialLLT<SpMat, Lower> solver; 
-      call_directsolver(solver,EIGEN_SIMPLICIAL_LLT, A, b, refX,statFile); 
+      cout << "\nSolving with SIMPLICIAL LLT ... \n";
+      SimplicialLLT<SpMat, Lower> solver;
+      call_directsolver(solver, EIGEN_SIMPLICIAL_LLT, A, b, refX, statFile);
     }
-    
-    // CHOLMOD
-    #ifdef EIGEN_CHOLMOD_SUPPORT
+
+// CHOLMOD
+#ifdef EIGEN_CHOLMOD_SUPPORT
     {
       // CholMOD SuperNodal LLT
-      cout << "\nSolving with CHOLMOD LLT (Supernodal)... \n"; 
+      cout << "\nSolving with CHOLMOD LLT (Supernodal)... \n";
       CholmodDecomposition<SpMat, Lower> solver;
       solver.setMode(CholmodSupernodalLLt);
-       call_directsolver(solver,EIGEN_CHOLMOD_SUPERNODAL_LLT, A, b, refX,statFile);
+      call_directsolver(solver, EIGEN_CHOLMOD_SUPERNODAL_LLT, A, b, refX, statFile);
       // CholMod Simplicial LLT
-      cout << "\nSolving with CHOLMOD LLT (Simplicial) ... \n"; 
+      cout << "\nSolving with CHOLMOD LLT (Simplicial) ... \n";
       solver.setMode(CholmodSimplicialLLt);
-      call_directsolver(solver,EIGEN_CHOLMOD_SIMPLICIAL_LLT, A, b, refX,statFile);
+      call_directsolver(solver, EIGEN_CHOLMOD_SIMPLICIAL_LLT, A, b, refX, statFile);
     }
-    #endif
-    
-    //PASTIX LLT
-    #ifdef EIGEN_PASTIX_SUPPORT
+#endif
+
+// PASTIX LLT
+#ifdef EIGEN_PASTIX_SUPPORT
     {
-      cout << "\nSolving with PASTIX LLT ... \n"; 
-      PastixLLT<SpMat, Lower> solver; 
-      call_directsolver(solver,EIGEN_PASTIX_LLT, A, b, refX,statFile);
+      cout << "\nSolving with PASTIX LLT ... \n";
+      PastixLLT<SpMat, Lower> solver;
+      call_directsolver(solver, EIGEN_PASTIX_LLT, A, b, refX, statFile);
     }
-    #endif
-    
-    //PARDISO LLT
-    #ifdef EIGEN_PARDISO_SUPPORT
+#endif
+
+// PARDISO LLT
+#ifdef EIGEN_PARDISO_SUPPORT
     {
-      cout << "\nSolving with PARDISO LLT ... \n"; 
-      PardisoLLT<SpMat, Lower> solver; 
-      call_directsolver(solver,EIGEN_PARDISO_LLT, A, b, refX,statFile); 
+      cout << "\nSolving with PARDISO LLT ... \n";
+      PardisoLLT<SpMat, Lower> solver;
+      call_directsolver(solver, EIGEN_PARDISO_LLT, A, b, refX, statFile);
     }
-    #endif
-    
+#endif
+
     // Internal CG
     {
-      cout << "\nSolving with CG ... \n"; 
-      ConjugateGradient<SpMat, Lower> solver; 
-      call_itersolver(solver,EIGEN_CG, A, b, refX,statFile);
+      cout << "\nSolving with CG ... \n";
+      ConjugateGradient<SpMat, Lower> solver;
+      call_itersolver(solver, EIGEN_CG, A, b, refX, statFile);
     }
-    //CG+IdentityPreconditioner
-//     {
-//       cout << "\nSolving with CG and IdentityPreconditioner ... \n"; 
-//       ConjugateGradient<SpMat, Lower, IdentityPreconditioner> solver; 
-//       call_itersolver(solver,EIGEN_CG_PRECOND, A, b, refX,statFile);
-//     }
-  } // End SPD matrices 
+    // CG+IdentityPreconditioner
+    //     {
+    //       cout << "\nSolving with CG and IdentityPreconditioner ... \n";
+    //       ConjugateGradient<SpMat, Lower, IdentityPreconditioner> solver;
+    //       call_itersolver(solver,EIGEN_CG_PRECOND, A, b, refX,statFile);
+    //     }
+  }  // End SPD matrices
 }
 
-/* Browse all the matrices available in the specified folder 
+/* Browse all the matrices available in the specified folder
  * and solve the associated linear system.
  * The results of each solve are printed in the standard output
  * and optionally in the provided html file
  */
 template <typename Scalar>
-void Browse_Matrices(const string folder, bool statFileExists, std::string& statFile, int maxiters, double tol)
-{
-  MaximumIters = maxiters; // Maximum number of iterations, global variable 
-  RelErr = tol;  //Relative residual error  as stopping criterion for iterative solvers
+void Browse_Matrices(const string folder, bool statFileExists, std::string& statFile, int maxiters, double tol) {
+  MaximumIters = maxiters;  // Maximum number of iterations, global variable
+  RelErr = tol;             // Relative residual error  as stopping criterion for iterative solvers
   MatrixMarketIterator<Scalar> it(folder);
-  for ( ; it; ++it)
-  {
-    //print the infos for this linear system 
-    if(statFileExists)
-    {
+  for (; it; ++it) {
+    // print the infos for this linear system
+    if (statFileExists) {
       std::ofstream statbuf(statFile.c_str(), std::ios::app);
       statbuf << "<LINEARSYSTEM> \n";
       statbuf << "   <MATRIX> \n";
-      statbuf << "     <NAME> " << it.matname() << " </NAME>\n"; 
-      statbuf << "     <SIZE> " << it.matrix().rows() << " </SIZE>\n"; 
+      statbuf << "     <NAME> " << it.matname() << " </NAME>\n";
+      statbuf << "     <SIZE> " << it.matrix().rows() << " </SIZE>\n";
       statbuf << "     <ENTRIES> " << it.matrix().nonZeros() << "</ENTRIES>\n";
-      if (it.sym()!=NonSymmetric)
-      {
-        statbuf << "     <SYMMETRY> Symmetric </SYMMETRY>\n" ; 
-        if (it.sym() == SPD) 
-          statbuf << "     <POSDEF> YES </POSDEF>\n"; 
-        else 
-          statbuf << "     <POSDEF> NO </POSDEF>\n"; 
-          
-      }
-      else
-      {
-        statbuf << "     <SYMMETRY> NonSymmetric </SYMMETRY>\n" ; 
-        statbuf << "     <POSDEF> NO </POSDEF>\n"; 
+      if (it.sym() != NonSymmetric) {
+        statbuf << "     <SYMMETRY> Symmetric </SYMMETRY>\n";
+        if (it.sym() == SPD)
+          statbuf << "     <POSDEF> YES </POSDEF>\n";
+        else
+          statbuf << "     <POSDEF> NO </POSDEF>\n";
+
+      } else {
+        statbuf << "     <SYMMETRY> NonSymmetric </SYMMETRY>\n";
+        statbuf << "     <POSDEF> NO </POSDEF>\n";
       }
       statbuf << "   </MATRIX> \n";
       statbuf.close();
     }
-    
-    cout<< "\n\n===================================================== \n";
-    cout<< " ======  SOLVING WITH MATRIX " << it.matname() << " ====\n";
-    cout<< " =================================================== \n\n";
+
+    cout << "\n\n===================================================== \n";
+    cout << " ======  SOLVING WITH MATRIX " << it.matname() << " ====\n";
+    cout << " =================================================== \n\n";
     Matrix<Scalar, Dynamic, 1> refX;
-    if(it.hasrefX()) refX = it.refX();
-    // Call all suitable solvers for this linear system 
+    if (it.hasrefX()) refX = it.refX();
+    // Call all suitable solvers for this linear system
     SelectSolvers<Scalar>(it.matrix(), it.sym(), it.rhs(), refX, statFile);
-    
-    if(statFileExists)
-    {
+
+    if (statFileExists) {
       std::ofstream statbuf(statFile.c_str(), std::ios::app);
-      statbuf << "  <BEST_SOLVER ID='"<< best_time_id
-              << "'></BEST_SOLVER>\n"; 
-      statbuf << " </LINEARSYSTEM> \n"; 
+      statbuf << "  <BEST_SOLVER ID='" << best_time_id << "'></BEST_SOLVER>\n";
+      statbuf << " </LINEARSYSTEM> \n";
       statbuf.close();
     }
-  } 
-} 
-
-bool get_options(int argc, char **args, string option, string* value=0)
-{
-  int idx = 1, found=false; 
-  while (idx<argc && !found){
-    if (option.compare(args[idx]) == 0){
-      found = true; 
-      if(value) *value = args[idx+1];
-    }
-    idx+=2;
   }
-  return found; 
+}
+
+bool get_options(int argc, char** args, string option, string* value = 0) {
+  int idx = 1, found = false;
+  while (idx < argc && !found) {
+    if (option.compare(args[idx]) == 0) {
+      found = true;
+      if (value) *value = args[idx + 1];
+    }
+    idx += 2;
+  }
+  return found;
 }
diff --git a/bench/spbench/spbenchstyle.h b/bench/spbench/spbenchstyle.h
index f6a9817..3f51402 100644
--- a/bench/spbench/spbenchstyle.h
+++ b/bench/spbench/spbenchstyle.h
@@ -10,8 +10,7 @@
 #ifndef SPBENCHSTYLE_H
 #define SPBENCHSTYLE_H
 
-void printBenchStyle(std::ofstream& out)
-{
+void printBenchStyle(std::ofstream& out) {
   out << "<xsl:stylesheet id='stylesheet' version='1.0' \
       xmlns:xsl='http://www.w3.org/1999/XSL/Transform' >\n \
       <xsl:template match='xsl:stylesheet' />\n \
@@ -23,7 +22,7 @@
           </style>\n \
         </head>\n \
         <body>";
-  out<<"<table border='1' width='100%' height='100%'>\n \
+  out << "<table border='1' width='100%' height='100%'>\n \
         <TR> <!-- Write the table header -->\n \
         <TH>Matrix</TH> <TH>N</TH> <TH> NNZ</TH>  <TH> Sym</TH>  <TH> SPD</TH> <TH> </TH>\n \
           <xsl:for-each select='BENCH/AVAILSOLVER/SOLVER'>\n \
@@ -36,8 +35,8 @@
             </TH>\n \
           </xsl:for-each>\n \
         </TR>";
-        
-  out<<"  <xsl:for-each select='BENCH/LINEARSYSTEM'>\n \
+
+  out << "  <xsl:for-each select='BENCH/LINEARSYSTEM'>\n \
           <TR> <!-- print statistics for one linear system-->\n \
             <TH rowspan='4'> <xsl:value-of select='MATRIX/NAME' /> </TH>\n \
             <TD rowspan='4'> <xsl:value-of select='MATRIX/SIZE' /> </TD>\n \
@@ -50,7 +49,7 @@
               <TD> <xsl:value-of select='TIME/COMPUTE' /> </TD>\n \
             </xsl:for-each>\n \
           </TR>";
-  out<<"  <TR>\n \
+  out << "  <TR>\n \
             <TH> Solve Time </TH>\n \
             <xsl:for-each select='SOLVER_STAT'>\n \
               <xsl:sort select='@ID' data-type='number'/>\n \
@@ -71,7 +70,7 @@
               </xsl:choose>\n \
             </xsl:for-each>\n \
           </TR>";
-  out<<"  <TR>\n \
+  out << "  <TR>\n \
               <TH> Error </TH>\n \
               <xsl:for-each select='SOLVER_STAT'>\n \
                 <xsl:sort select='@ID' data-type='number'/>\n \
@@ -89,7 +88,6 @@
     </html>\n \
   </xsl:template>\n \
   </xsl:stylesheet>\n\n";
-  
 }
 
 #endif
diff --git a/bench/spbench/test_sparseLU.cpp b/bench/spbench/test_sparseLU.cpp
index a4cade6..02dcb3c 100644
--- a/bench/spbench/test_sparseLU.cpp
+++ b/bench/spbench/test_sparseLU.cpp
@@ -14,41 +14,43 @@
 using namespace std;
 using namespace Eigen;
 
-int main(int argc, char **args)
-{
-//   typedef complex<double> scalar; 
-  typedef double scalar; 
-  SparseMatrix<scalar, ColMajor> A; 
+int main(int argc, char **args) {
+  //   typedef complex<double> scalar;
+  typedef double scalar;
+  SparseMatrix<scalar, ColMajor> A;
   typedef SparseMatrix<scalar, ColMajor>::Index Index;
   typedef Matrix<scalar, Dynamic, Dynamic> DenseMatrix;
   typedef Matrix<scalar, Dynamic, 1> DenseRhs;
   Matrix<scalar, Dynamic, 1> b, x, tmp;
-//   SparseLU<SparseMatrix<scalar, ColMajor>, AMDOrdering<int> >   solver;
-// #ifdef EIGEN_METIS_SUPPORT
-//   SparseLU<SparseMatrix<scalar, ColMajor>, MetisOrdering<int> > solver; 
-//   std::cout<< "ORDERING : METIS\n"; 
-// #else
-  SparseLU<SparseMatrix<scalar, ColMajor>, COLAMDOrdering<int> >  solver;
-  std::cout<< "ORDERING : COLAMD\n"; 
-// #endif
-  
-  ifstream matrix_file; 
+  //   SparseLU<SparseMatrix<scalar, ColMajor>, AMDOrdering<int> >   solver;
+  // #ifdef EIGEN_METIS_SUPPORT
+  //   SparseLU<SparseMatrix<scalar, ColMajor>, MetisOrdering<int> > solver;
+  //   std::cout<< "ORDERING : METIS\n";
+  // #else
+  SparseLU<SparseMatrix<scalar, ColMajor>, COLAMDOrdering<int> > solver;
+  std::cout << "ORDERING : COLAMD\n";
+  // #endif
+
+  ifstream matrix_file;
   string line;
-  int  n;
-  BenchTimer timer; 
-  
+  int n;
+  BenchTimer timer;
+
   // Set parameters
   /* Fill the matrix with sparse matrix stored in Matrix-Market coordinate column-oriented format */
   if (argc < 2) assert(false && "please, give the matrix market file ");
   loadMarket(A, args[1]);
   cout << "End charging matrix " << endl;
-  bool iscomplex=false, isvector=false;
+  bool iscomplex = false, isvector = false;
   int sym;
   getMarketHeader(args[1], sym, iscomplex, isvector);
-//   if (iscomplex) { cout<< " Not for complex matrices \n"; return -1; }
-  if (isvector) { cout << "The provided file is not a matrix file\n"; return -1;}
-  if (sym != 0) { // symmetric matrices, only the lower part is stored
-    SparseMatrix<scalar, ColMajor> temp; 
+  //   if (iscomplex) { cout<< " Not for complex matrices \n"; return -1; }
+  if (isvector) {
+    cout << "The provided file is not a matrix file\n";
+    return -1;
+  }
+  if (sym != 0) {  // symmetric matrices, only the lower part is stored
+    SparseMatrix<scalar, ColMajor> temp;
     temp = A;
     A = temp.selfadjointView<Lower>();
   }
@@ -57,37 +59,36 @@
 
   if (argc > 2)
     loadMarketVector(b, args[2]);
-  else 
-  {
+  else {
     b.resize(n);
     tmp.resize(n);
-//       tmp.setRandom();
-    for (int i = 0; i < n; i++) tmp(i) = i; 
-    b = A * tmp ;
+    //       tmp.setRandom();
+    for (int i = 0; i < n; i++) tmp(i) = i;
+    b = A * tmp;
   }
 
   /* Compute the factorization */
-//   solver.isSymmetric(true);
-  timer.start(); 
-//   solver.compute(A);
-  solver.analyzePattern(A); 
-  timer.stop(); 
+  //   solver.isSymmetric(true);
+  timer.start();
+  //   solver.compute(A);
+  solver.analyzePattern(A);
+  timer.stop();
   cout << "Time to analyze " << timer.value() << std::endl;
-  timer.reset(); 
-  timer.start(); 
-  solver.factorize(A); 
-  timer.stop(); 
+  timer.reset();
+  timer.start();
+  solver.factorize(A);
+  timer.stop();
   cout << "Factorize Time " << timer.value() << std::endl;
-  timer.reset(); 
-  timer.start(); 
+  timer.reset();
+  timer.start();
   x = solver.solve(b);
   timer.stop();
-  cout << "solve time " << timer.value() << std::endl; 
+  cout << "solve time " << timer.value() << std::endl;
   /* Check the accuracy */
-  Matrix<scalar, Dynamic, 1> tmp2 = b - A*x;
-  scalar tempNorm = tmp2.norm()/b.norm();
-  cout << "Relative norm of the computed solution : " << tempNorm <<"\n";
-  cout << "Number of nonzeros in the factor : " << solver.nnzL() + solver.nnzU() << std::endl; 
-  
+  Matrix<scalar, Dynamic, 1> tmp2 = b - A * x;
+  scalar tempNorm = tmp2.norm() / b.norm();
+  cout << "Relative norm of the computed solution : " << tempNorm << "\n";
+  cout << "Number of nonzeros in the factor : " << solver.nnzL() + solver.nnzU() << std::endl;
+
   return 0;
 }
diff --git a/bench/spmv.cpp b/bench/spmv.cpp
index 959bab0..c17dcb1 100644
--- a/bench/spmv.cpp
+++ b/bench/spmv.cpp
@@ -1,5 +1,7 @@
 
-//g++-4.4 -DNOMTL  -Wl,-rpath /usr/local/lib/oski -L /usr/local/lib/oski/ -l oski -l oski_util -l oski_util_Tid  -DOSKI -I ~/Coding/LinearAlgebra/mtl4/  spmv.cpp  -I .. -O2 -DNDEBUG -lrt  -lm -l oski_mat_CSC_Tid  -loskilt && ./a.out r200000 c200000 n100 t1 p1
+// g++-4.4 -DNOMTL  -Wl,-rpath /usr/local/lib/oski -L /usr/local/lib/oski/ -l oski -l oski_util -l oski_util_Tid  -DOSKI
+// -I ~/Coding/LinearAlgebra/mtl4/  spmv.cpp  -I .. -O2 -DNDEBUG -lrt  -lm -l oski_mat_CSC_Tid  -loskilt && ./a.out
+// r200000 c200000 n100 t1 p1
 
 #define SCALAR double
 
@@ -8,7 +10,7 @@
 #include "BenchTimer.h"
 #include "BenchSparseUtil.h"
 
-#define SPMV_BENCH(CODE) BENCH(t,tries,repeats,CODE);
+#define SPMV_BENCH(CODE) BENCH(t, tries, repeats, CODE);
 
 // #ifdef MKL
 //
@@ -34,8 +36,7 @@
 //
 // #endif
 
-int main(int argc, char *argv[])
-{
+int main(int argc, char *argv[]) {
   int size = 10000;
   int rows = size;
   int cols = size;
@@ -44,106 +45,93 @@
   int repeats = 2;
 
   bool need_help = false;
-  for(int i = 1; i < argc; i++)
-  {
-    if(argv[i][0] == 'r')
-    {
-      rows = atoi(argv[i]+1);
-    }
-    else if(argv[i][0] == 'c')
-    {
-      cols = atoi(argv[i]+1);
-    }
-    else if(argv[i][0] == 'n')
-    {
-      nnzPerCol = atoi(argv[i]+1);
-    }
-    else if(argv[i][0] == 't')
-    {
-      tries = atoi(argv[i]+1);
-    }
-    else if(argv[i][0] == 'p')
-    {
-      repeats = atoi(argv[i]+1);
-    }
-    else
-    {
+  for (int i = 1; i < argc; i++) {
+    if (argv[i][0] == 'r') {
+      rows = atoi(argv[i] + 1);
+    } else if (argv[i][0] == 'c') {
+      cols = atoi(argv[i] + 1);
+    } else if (argv[i][0] == 'n') {
+      nnzPerCol = atoi(argv[i] + 1);
+    } else if (argv[i][0] == 't') {
+      tries = atoi(argv[i] + 1);
+    } else if (argv[i][0] == 'p') {
+      repeats = atoi(argv[i] + 1);
+    } else {
       need_help = true;
     }
   }
-  if(need_help)
-  {
+  if (need_help) {
     std::cout << argv[0] << " r<nb rows> c<nb columns> n<non zeros per column> t<nb tries> p<nb repeats>\n";
     return 1;
   }
 
-  std::cout << "SpMV " << rows << " x " << cols << " with " << nnzPerCol << " non zeros per column. (" << repeats << " repeats, and " << tries << " tries)\n\n";
+  std::cout << "SpMV " << rows << " x " << cols << " with " << nnzPerCol << " non zeros per column. (" << repeats
+            << " repeats, and " << tries << " tries)\n\n";
 
-  EigenSparseMatrix sm(rows,cols);
+  EigenSparseMatrix sm(rows, cols);
   DenseVector dv(cols), res(rows);
   dv.setRandom();
 
   BenchTimer t;
-  while (nnzPerCol>=4)
-  {
+  while (nnzPerCol >= 4) {
     std::cout << "nnz: " << nnzPerCol << "\n";
     sm.setZero();
     fillMatrix2(nnzPerCol, rows, cols, sm);
 
-    // dense matrices
-    #ifdef DENSEMATRIX
+// dense matrices
+#ifdef DENSEMATRIX
     {
-      DenseMatrix dm(rows,cols), (rows,cols);
+      DenseMatrix dm(rows, cols), (rows, cols);
       eiToDense(sm, dm);
 
       SPMV_BENCH(res = dm * sm);
-      std::cout << "Dense       " << t.value()/repeats << "\t";
+      std::cout << "Dense       " << t.value() / repeats << "\t";
 
       SPMV_BENCH(res = dm.transpose() * sm);
-      std::cout << t.value()/repeats << endl;
+      std::cout << t.value() / repeats << endl;
     }
-    #endif
+#endif
 
     // eigen sparse matrices
     {
-      SPMV_BENCH(res.noalias() += sm * dv; )
-      std::cout << "Eigen       " << t.value()/repeats << "\t";
+      SPMV_BENCH(res.noalias() += sm * dv;)
+      std::cout << "Eigen       " << t.value() / repeats << "\t";
 
-      SPMV_BENCH(res.noalias() += sm.transpose() * dv; )
-      std::cout << t.value()/repeats << endl;
+      SPMV_BENCH(res.noalias() += sm.transpose() * dv;)
+      std::cout << t.value() / repeats << endl;
     }
 
-    // CSparse
-    #ifdef CSPARSE
+// CSparse
+#ifdef CSPARSE
     {
       std::cout << "CSparse \n";
       cs *csm;
       eiToCSparse(sm, csm);
 
-//       BENCH();
-//       timer.stop();
-//       std::cout << "   a * b:\t" << timer.value() << endl;
+      //       BENCH();
+      //       timer.stop();
+      //       std::cout << "   a * b:\t" << timer.value() << endl;
 
-//       BENCH( { m3 = cs_sorted_multiply2(m1, m2); cs_spfree(m3); } );
-//       std::cout << "   a * b:\t" << timer.value() << endl;
+      //       BENCH( { m3 = cs_sorted_multiply2(m1, m2); cs_spfree(m3); } );
+      //       std::cout << "   a * b:\t" << timer.value() << endl;
     }
-    #endif
+#endif
 
-    #ifdef OSKI
+#ifdef OSKI
     {
       oski_matrix_t om;
       oski_vecview_t ov, ores;
       oski_Init();
-      om = oski_CreateMatCSC(sm._outerIndexPtr(), sm._innerIndexPtr(), sm._valuePtr(), rows, cols,
-                             SHARE_INPUTMAT, 1, INDEX_ZERO_BASED);
+      om = oski_CreateMatCSC(sm._outerIndexPtr(), sm._innerIndexPtr(), sm._valuePtr(), rows, cols, SHARE_INPUTMAT, 1,
+                             INDEX_ZERO_BASED);
       ov = oski_CreateVecView(dv.data(), cols, STRIDE_UNIT);
       ores = oski_CreateVecView(res.data(), rows, STRIDE_UNIT);
 
-      SPMV_BENCH( oski_MatMult(om, OP_NORMAL, 1, ov, 0, ores) );
-      std::cout << "OSKI        " << t.value()/repeats << "\t";
+      SPMV_BENCH(oski_MatMult(om, OP_NORMAL, 1, ov, 0, ores));
+      std::cout << "OSKI        " << t.value() / repeats << "\t";
 
-      SPMV_BENCH( oski_MatMult(om, OP_TRANS, 1, ov, 0, ores) );
-      std::cout << t.value()/repeats << "\n";
+      SPMV_BENCH(oski_MatMult(om, OP_TRANS, 1, ov, 0, ores));
+      std::cout << t.value() / repeats << "\n";
 
       // tune
       t.reset();
@@ -153,81 +141,76 @@
       t.stop();
       double tuning = t.value();
 
-      SPMV_BENCH( oski_MatMult(om, OP_NORMAL, 1, ov, 0, ores) );
-      std::cout << "OSKI tuned  " << t.value()/repeats << "\t";
+      SPMV_BENCH(oski_MatMult(om, OP_NORMAL, 1, ov, 0, ores));
+      std::cout << "OSKI tuned  " << t.value() / repeats << "\t";
 
-      SPMV_BENCH( oski_MatMult(om, OP_TRANS, 1, ov, 0, ores) );
-      std::cout << t.value()/repeats << "\t(" << tuning <<  ")\n";
-
+      SPMV_BENCH(oski_MatMult(om, OP_TRANS, 1, ov, 0, ores));
+      std::cout << t.value() / repeats << "\t(" << tuning << ")\n";
 
       oski_DestroyMat(om);
       oski_DestroyVecView(ov);
       oski_DestroyVecView(ores);
       oski_Close();
     }
-    #endif
+#endif
 
-    #ifndef NOUBLAS
+#ifndef NOUBLAS
     {
       using namespace boost::numeric;
-      UblasMatrix um(rows,cols);
+      UblasMatrix um(rows, cols);
       eiToUblas(sm, um);
 
       boost::numeric::ublas::vector<Scalar> uv(cols), ures(rows);
-      Map<Matrix<Scalar,Dynamic,1> >(&uv[0], cols) = dv;
-      Map<Matrix<Scalar,Dynamic,1> >(&ures[0], rows) = res;
+      Map<Matrix<Scalar, Dynamic, 1> >(&uv[0], cols) = dv;
+      Map<Matrix<Scalar, Dynamic, 1> >(&ures[0], rows) = res;
 
       SPMV_BENCH(ublas::axpy_prod(um, uv, ures, true));
-      std::cout << "ublas       " << t.value()/repeats << "\t";
+      std::cout << "ublas       " << t.value() / repeats << "\t";
 
       SPMV_BENCH(ublas::axpy_prod(boost::numeric::ublas::trans(um), uv, ures, true));
-      std::cout << t.value()/repeats << endl;
+      std::cout << t.value() / repeats << endl;
     }
-    #endif
+#endif
 
-    // GMM++
-    #ifndef NOGMM
+// GMM++
+#ifndef NOGMM
     {
-      GmmSparse gm(rows,cols);
+      GmmSparse gm(rows, cols);
       eiToGmm(sm, gm);
 
       std::vector<Scalar> gv(cols), gres(rows);
-      Map<Matrix<Scalar,Dynamic,1> >(&gv[0], cols) = dv;
-      Map<Matrix<Scalar,Dynamic,1> >(&gres[0], rows) = res;
+      Map<Matrix<Scalar, Dynamic, 1> >(&gv[0], cols) = dv;
+      Map<Matrix<Scalar, Dynamic, 1> >(&gres[0], rows) = res;
 
       SPMV_BENCH(gmm::mult(gm, gv, gres));
-      std::cout << "GMM++       " << t.value()/repeats << "\t";
+      std::cout << "GMM++       " << t.value() / repeats << "\t";
 
       SPMV_BENCH(gmm::mult(gmm::transposed(gm), gv, gres));
-      std::cout << t.value()/repeats << endl;
+      std::cout << t.value() / repeats << endl;
     }
-    #endif
+#endif
 
-    // MTL4
-    #ifndef NOMTL
+// MTL4
+#ifndef NOMTL
     {
-      MtlSparse mm(rows,cols);
+      MtlSparse mm(rows, cols);
       eiToMtl(sm, mm);
       mtl::dense_vector<Scalar> mv(cols, 1.0);
       mtl::dense_vector<Scalar> mres(rows, 1.0);
 
       SPMV_BENCH(mres = mm * mv);
-      std::cout << "MTL4        " << t.value()/repeats << "\t";
+      std::cout << "MTL4        " << t.value() / repeats << "\t";
 
       SPMV_BENCH(mres = trans(mm) * mv);
-      std::cout << t.value()/repeats << endl;
+      std::cout << t.value() / repeats << endl;
     }
-    #endif
+#endif
 
     std::cout << "\n";
 
-    if(nnzPerCol==1)
-      break;
-    nnzPerCol -= nnzPerCol/2;
+    if (nnzPerCol == 1) break;
+    nnzPerCol -= nnzPerCol / 2;
   }
 
   return 0;
 }
-
-
-
diff --git a/bench/tensors/benchmark.h b/bench/tensors/benchmark.h
index f115b54..9fb0ebf 100644
--- a/bench/tensors/benchmark.h
+++ b/bench/tensors/benchmark.h
@@ -20,17 +20,14 @@
 namespace testing {
 class Benchmark {
  public:
-  Benchmark(const char* name, void (*fn)(int)) {
-    Register(name, fn, NULL);
-  }
-  Benchmark(const char* name, void (*fn_range)(int, int)) {
-    Register(name, NULL, fn_range);
-  }
+  Benchmark(const char* name, void (*fn)(int)) { Register(name, fn, NULL); }
+  Benchmark(const char* name, void (*fn_range)(int, int)) { Register(name, NULL, fn_range); }
   Benchmark* Arg(int x);
   Benchmark* Range(int lo, int hi);
   const char* Name();
   bool ShouldRun(int argc, char* argv[]);
   void Run();
+
  private:
   const char* name_;
   void (*fn_)(int);
@@ -45,5 +42,4 @@
 void StopBenchmarkTiming();
 void StartBenchmarkTiming();
 #define BENCHMARK(f) \
-    static ::testing::Benchmark* _benchmark_##f __attribute__((unused)) = \
-        (new ::testing::Benchmark(#f, f))
+  static ::testing::Benchmark* _benchmark_##f __attribute__((unused)) = (new ::testing::Benchmark(#f, f))
diff --git a/bench/tensors/benchmark_main.cc b/bench/tensors/benchmark_main.cc
index 1efa0db..af92063 100644
--- a/bench/tensors/benchmark_main.cc
+++ b/bench/tensors/benchmark_main.cc
@@ -38,24 +38,22 @@
 
 static int Round(int n) {
   int base = 1;
-  while (base*10 < n) {
+  while (base * 10 < n) {
     base *= 10;
   }
-  if (n < 2*base) {
-    return 2*base;
+  if (n < 2 * base) {
+    return 2 * base;
   }
-  if (n < 5*base) {
-    return 5*base;
+  if (n < 5 * base) {
+    return 5 * base;
   }
-  return 10*base;
+  return 10 * base;
 }
 
 #ifdef __APPLE__
-  #include <mach/mach_time.h>
-  static mach_timebase_info_data_t g_time_info;
-  static void __attribute__((constructor)) init_info() {
-    mach_timebase_info(&g_time_info);
-  }
+#include <mach/mach_time.h>
+static mach_timebase_info_data_t g_time_info;
+static void __attribute__((constructor)) init_info() { mach_timebase_info(&g_time_info); }
 #endif
 
 static int64_t NanoTime() {
@@ -92,9 +90,7 @@
   return this;
 }
 
-const char* Benchmark::Name() {
-  return name_;
-}
+const char* Benchmark::Name() { return name_; }
 bool Benchmark::ShouldRun(int argc, char* argv[]) {
   if (argc == 1) {
     return true;  // With no arguments, we run all benchmarks.
@@ -157,42 +153,40 @@
   RunRepeatedlyWithArg(iterations, arg);
   while (g_benchmark_total_time_ns < 1e9 && iterations < 1e9) {
     int last = iterations;
-    if (g_benchmark_total_time_ns/iterations == 0) {
+    if (g_benchmark_total_time_ns / iterations == 0) {
       iterations = 1e9;
     } else {
-      iterations = 1e9 / (g_benchmark_total_time_ns/iterations);
+      iterations = 1e9 / (g_benchmark_total_time_ns / iterations);
     }
-    iterations = std::max(last + 1, std::min(iterations + iterations/2, 100*last));
+    iterations = std::max(last + 1, std::min(iterations + iterations / 2, 100 * last));
     iterations = Round(iterations);
     RunRepeatedlyWithArg(iterations, arg);
   }
   char throughput[100];
   throughput[0] = '\0';
   if (g_benchmark_total_time_ns > 0 && g_flops_processed > 0) {
-    double mflops_processed = static_cast<double>(g_flops_processed)/1e6;
-    double seconds = static_cast<double>(g_benchmark_total_time_ns)/1e9;
-    snprintf(throughput, sizeof(throughput), " %8.2f MFlops/s", mflops_processed/seconds);
+    double mflops_processed = static_cast<double>(g_flops_processed) / 1e6;
+    double seconds = static_cast<double>(g_benchmark_total_time_ns) / 1e9;
+    snprintf(throughput, sizeof(throughput), " %8.2f MFlops/s", mflops_processed / seconds);
   }
   char full_name[100];
   if (fn_range_ != NULL) {
-    if (arg >= (1<<20)) {
-      snprintf(full_name, sizeof(full_name), "%s/%dM", name_, arg/(1<<20));
-    } else if (arg >= (1<<10)) {
-      snprintf(full_name, sizeof(full_name), "%s/%dK", name_, arg/(1<<10));
+    if (arg >= (1 << 20)) {
+      snprintf(full_name, sizeof(full_name), "%s/%dM", name_, arg / (1 << 20));
+    } else if (arg >= (1 << 10)) {
+      snprintf(full_name, sizeof(full_name), "%s/%dK", name_, arg / (1 << 10));
     } else {
       snprintf(full_name, sizeof(full_name), "%s/%d", name_, arg);
     }
   } else {
     snprintf(full_name, sizeof(full_name), "%s", name_);
   }
-  printf("%-*s %10d %10" PRId64 "%s\n", g_name_column_width, full_name,
-         iterations, g_benchmark_total_time_ns/iterations, throughput);
+  printf("%-*s %10d %10" PRId64 "%s\n", g_name_column_width, full_name, iterations,
+         g_benchmark_total_time_ns / iterations, throughput);
   fflush(stdout);
 }
 }  // namespace testing
-void SetBenchmarkFlopsProcessed(int64_t x) {
-  g_flops_processed = x;
-}
+void SetBenchmarkFlopsProcessed(int64_t x) { g_flops_processed = x; }
 void StopBenchmarkTiming() {
   if (g_benchmark_start_time_ns != 0) {
     g_benchmark_total_time_ns += NanoTime() - g_benchmark_start_time_ns;
diff --git a/bench/tensors/contraction_benchmarks_cpu.cc b/bench/tensors/contraction_benchmarks_cpu.cc
index f9e57ad..d51753a 100644
--- a/bench/tensors/contraction_benchmarks_cpu.cc
+++ b/bench/tensors/contraction_benchmarks_cpu.cc
@@ -4,10 +4,9 @@
 
 #include "tensor_benchmarks.h"
 
-#define CREATE_THREAD_POOL(threads)             \
-Eigen::ThreadPool pool(threads);                \
-Eigen::ThreadPoolDevice device(&pool, threads);
-
+#define CREATE_THREAD_POOL(threads) \
+  Eigen::ThreadPool pool(threads);  \
+  Eigen::ThreadPoolDevice device(&pool, threads);
 
 // Contractions for number of threads ranging from 1 to 32
 // Dimensions are Rows, Cols, Depth
@@ -20,7 +19,6 @@
   }                                                                           \
   BENCHMARK_RANGE(BM_##Contraction##_##D1##x##D2##x##D3, 1, 32);
 
-
 // Vector Matrix and Matrix Vector products
 BM_ContractionCPU(1, 2000, 500);
 BM_ContractionCPU(2000, 1, 500);
diff --git a/bench/tensors/tensor_benchmarks.h b/bench/tensors/tensor_benchmarks.h
index 1a7a0fe..06b815b 100644
--- a/bench/tensors/tensor_benchmarks.h
+++ b/bench/tensors/tensor_benchmarks.h
@@ -7,30 +7,23 @@
 #include "unsupported/Eigen/CXX11/Tensor"
 #include "benchmark.h"
 
-#define BENCHMARK_RANGE(bench, lo, hi) \
-  BENCHMARK(bench)->Range(lo, hi)
+#define BENCHMARK_RANGE(bench, lo, hi) BENCHMARK(bench)->Range(lo, hi)
 
 using Eigen::Tensor;
 using Eigen::TensorMap;
 
 // TODO(bsteiner): also templatize on the input type since we have users
 // for int8 as well as floats.
-template <typename Device, typename T> class BenchmarkSuite {
+template <typename Device, typename T>
+class BenchmarkSuite {
  public:
-  BenchmarkSuite(const Device& device, size_t m, size_t k, size_t n)
-      : m_(m), k_(k), n_(n), device_(device) {
+  BenchmarkSuite(const Device& device, size_t m, size_t k, size_t n) : m_(m), k_(k), n_(n), device_(device) {
     initialize();
   }
 
-  BenchmarkSuite(const Device& device, size_t m)
-      : m_(m), k_(m), n_(m), device_(device) {
-    initialize();
-  }
+  BenchmarkSuite(const Device& device, size_t m) : m_(m), k_(m), n_(m), device_(device) { initialize(); }
 
-  BenchmarkSuite(const Device& device, size_t m, size_t k)
-      : m_(1), k_(k), n_(m), device_(device) {
-    initialize();
-  }
+  BenchmarkSuite(const Device& device, size_t m, size_t k) : m_(1), k_(k), n_(m), device_(device) { initialize(); }
 
   ~BenchmarkSuite() {
     device_.deallocate(a_);
@@ -40,7 +33,7 @@
 
   void memcpy(int num_iters) {
     eigen_assert(m_ == k_ && k_ == n_);
-#ifdef EIGEN_USE_SYCL // warmup for sycl
+#ifdef EIGEN_USE_SYCL  // warmup for sycl
     for (int iter = 0; iter < 10; ++iter) {
       device_.memcpy(c_, a_, m_ * m_ * sizeof(T));
     }
@@ -65,7 +58,7 @@
     }
     const TensorMap<Tensor<int, 2, 0, TensorIndex>, Eigen::Aligned> A((int*)a_, sizes);
     TensorMap<Tensor<T, 2, 0, TensorIndex>, Eigen::Aligned> B(b_, sizes);
-#ifdef EIGEN_USE_SYCL // warmup for sycl
+#ifdef EIGEN_USE_SYCL  // warmup for sycl
     for (int iter = 0; iter < 10; ++iter) {
       B.device(device_) = A.template cast<T>();
     }
@@ -84,7 +77,7 @@
     sizes[0] = m_;
     sizes[1] = m_;
     TensorMap<Tensor<T, 2>, Eigen::Aligned> C(c_, sizes);
-#ifdef EIGEN_USE_SYCL // warmup for sycl
+#ifdef EIGEN_USE_SYCL  // warmup for sycl
     for (int iter = 0; iter < 10; ++iter) {
       C.device(device_) = C.random();
     }
@@ -106,33 +99,25 @@
     const TensorMap<Tensor<T, 2>, Eigen::Aligned> B(b_, sizes);
     TensorMap<Tensor<T, 2>, Eigen::Aligned> C(c_, sizes);
 
-    const Eigen::DSizes<TensorIndex, 2> quarter_sizes(m_/2, m_/2);
+    const Eigen::DSizes<TensorIndex, 2> quarter_sizes(m_ / 2, m_ / 2);
     const Eigen::DSizes<TensorIndex, 2> first_quadrant(0, 0);
-    const Eigen::DSizes<TensorIndex, 2> second_quadrant(0, m_/2);
-    const Eigen::DSizes<TensorIndex, 2> third_quadrant(m_/2, 0);
-    const Eigen::DSizes<TensorIndex, 2> fourth_quadrant(m_/2, m_/2);
-#ifdef EIGEN_USE_SYCL // warmup for sycl
+    const Eigen::DSizes<TensorIndex, 2> second_quadrant(0, m_ / 2);
+    const Eigen::DSizes<TensorIndex, 2> third_quadrant(m_ / 2, 0);
+    const Eigen::DSizes<TensorIndex, 2> fourth_quadrant(m_ / 2, m_ / 2);
+#ifdef EIGEN_USE_SYCL  // warmup for sycl
     for (int iter = 0; iter < 10; ++iter) {
-      C.slice(first_quadrant, quarter_sizes).device(device_) =
-          A.slice(first_quadrant, quarter_sizes);
-      C.slice(second_quadrant, quarter_sizes).device(device_) =
-          B.slice(second_quadrant, quarter_sizes);
-      C.slice(third_quadrant, quarter_sizes).device(device_) =
-          A.slice(third_quadrant, quarter_sizes);
-      C.slice(fourth_quadrant, quarter_sizes).device(device_) =
-          B.slice(fourth_quadrant, quarter_sizes);
+      C.slice(first_quadrant, quarter_sizes).device(device_) = A.slice(first_quadrant, quarter_sizes);
+      C.slice(second_quadrant, quarter_sizes).device(device_) = B.slice(second_quadrant, quarter_sizes);
+      C.slice(third_quadrant, quarter_sizes).device(device_) = A.slice(third_quadrant, quarter_sizes);
+      C.slice(fourth_quadrant, quarter_sizes).device(device_) = B.slice(fourth_quadrant, quarter_sizes);
     }
 #endif
     StartBenchmarkTiming();
     for (int iter = 0; iter < num_iters; ++iter) {
-      C.slice(first_quadrant, quarter_sizes).device(device_) =
-          A.slice(first_quadrant, quarter_sizes);
-      C.slice(second_quadrant, quarter_sizes).device(device_) =
-          B.slice(second_quadrant, quarter_sizes);
-      C.slice(third_quadrant, quarter_sizes).device(device_) =
-          A.slice(third_quadrant, quarter_sizes);
-      C.slice(fourth_quadrant, quarter_sizes).device(device_) =
-          B.slice(fourth_quadrant, quarter_sizes);
+      C.slice(first_quadrant, quarter_sizes).device(device_) = A.slice(first_quadrant, quarter_sizes);
+      C.slice(second_quadrant, quarter_sizes).device(device_) = B.slice(second_quadrant, quarter_sizes);
+      C.slice(third_quadrant, quarter_sizes).device(device_) = A.slice(third_quadrant, quarter_sizes);
+      C.slice(fourth_quadrant, quarter_sizes).device(device_) = B.slice(fourth_quadrant, quarter_sizes);
     }
     // Record the number of values copied from the rhs slice to the lhs slice
     // each second
@@ -147,7 +132,7 @@
     Eigen::array<TensorIndex, 1> output_size;
     output_size[0] = n_;
     TensorMap<Tensor<T, 1, 0, TensorIndex>, Eigen::Aligned> C(c_, output_size);
-#ifdef EIGEN_USE_SYCL // warmup for sycl
+#ifdef EIGEN_USE_SYCL  // warmup for sycl
     for (int iter = 0; iter < 10; ++iter) {
       C.device(device_) = B.chip(iter % k_, 0);
     }
@@ -168,7 +153,7 @@
     Eigen::array<TensorIndex, 1> output_size;
     output_size[0] = n_;
     TensorMap<Tensor<T, 1, 0, TensorIndex>, Eigen::Aligned> C(c_, output_size);
-#ifdef EIGEN_USE_SYCL // warmup for sycl
+#ifdef EIGEN_USE_SYCL  // warmup for sycl
     for (int iter = 0; iter < 10; ++iter) {
       C.device(device_) = B.chip(iter % n_, 1);
     }
@@ -195,7 +180,7 @@
     Eigen::array<int, 2> shuffle;
     shuffle[0] = 1;
     shuffle[1] = 0;
-#ifdef EIGEN_USE_SYCL // warmup for sycl
+#ifdef EIGEN_USE_SYCL  // warmup for sycl
     for (int iter = 0; iter < 10; ++iter) {
       B.device(device_) = A.shuffle(shuffle);
     }
@@ -208,20 +193,19 @@
     finalizeBenchmark(static_cast<int64_t>(m_) * k_ * num_iters);
   }
 
- void padding(int num_iters) {
+  void padding(int num_iters) {
     eigen_assert(m_ == k_);
     Eigen::array<TensorIndex, 2> size_a;
     size_a[0] = m_;
-    size_a[1] = k_-3;
+    size_a[1] = k_ - 3;
     const TensorMap<Tensor<T, 2>, Eigen::Aligned> A(a_, size_a);
     Eigen::array<TensorIndex, 2> size_b;
     size_b[0] = k_;
     size_b[1] = m_;
     TensorMap<Tensor<T, 2>, Eigen::Aligned> B(b_, size_b);
 
-    Eigen::IndexPairList<Eigen::type2indexpair<0, 0>,
-                         Eigen::type2indexpair<2, 1> > paddings;
-#ifdef EIGEN_USE_SYCL // warmup for sycl
+    Eigen::IndexPairList<Eigen::type2indexpair<0, 0>, Eigen::type2indexpair<2, 1>> paddings;
+#ifdef EIGEN_USE_SYCL  // warmup for sycl
     for (int iter = 0; iter < 10; ++iter) {
       B.device(device_) = A.pad(paddings);
     }
@@ -234,7 +218,7 @@
     finalizeBenchmark(static_cast<int64_t>(m_) * k_ * num_iters);
   }
 
- void striding(int num_iters) {
+  void striding(int num_iters) {
     eigen_assert(m_ == k_);
     Eigen::array<TensorIndex, 2> size_a;
     size_a[0] = m_;
@@ -242,12 +226,12 @@
     const TensorMap<Tensor<T, 2>, Eigen::Aligned> A(a_, size_a);
     Eigen::array<TensorIndex, 2> size_b;
     size_b[0] = m_;
-    size_b[1] = k_/2;
+    size_b[1] = k_ / 2;
     TensorMap<Tensor<T, 2>, Eigen::Aligned> B(b_, size_b);
 
-    Eigen::IndexList<Eigen::type2index<1>, Eigen::type2index<2> > strides;
+    Eigen::IndexList<Eigen::type2index<1>, Eigen::type2index<2>> strides;
 
-#ifdef EIGEN_USE_SYCL // warmup for sycl
+#ifdef EIGEN_USE_SYCL  // warmup for sycl
     for (int iter = 0; iter < 10; ++iter) {
       B.device(device_) = A.stride(strides);
     }
@@ -260,7 +244,6 @@
     finalizeBenchmark(static_cast<int64_t>(m_) * k_ * num_iters);
   }
 
-
   void broadcasting(int num_iters) {
     Eigen::array<TensorIndex, 2> size_a;
     size_a[0] = m_;
@@ -273,7 +256,7 @@
     Eigen::IndexList<Eigen::type2index<1>, int> broadcast;
     broadcast.set(1, n_);
 
-#ifdef EIGEN_USE_SYCL // warmup for sycl
+#ifdef EIGEN_USE_SYCL  // warmup for sycl
     for (int iter = 0; iter < 10; ++iter) {
       C.device(device_) = A.broadcast(broadcast);
     }
@@ -294,7 +277,7 @@
     const TensorMap<Tensor<T, 2>, Eigen::Aligned> A(a_, sizes);
     const TensorMap<Tensor<T, 2>, Eigen::Aligned> B(b_, sizes);
     TensorMap<Tensor<T, 2>, Eigen::Aligned> C(c_, sizes);
-#ifdef EIGEN_USE_SYCL // warmup for sycl
+#ifdef EIGEN_USE_SYCL  // warmup for sycl
     for (int iter = 0; iter < 10; ++iter) {
       C.device(device_) = A * A.constant(static_cast<T>(3.14)) + B * B.constant(static_cast<T>(2.7));
     }
@@ -317,10 +300,10 @@
     const TensorMap<Tensor<T, 2>, Eigen::Aligned> B(b_, sizes);
     TensorMap<Tensor<T, 2>, Eigen::Aligned> C(c_, sizes);
 
-#ifdef EIGEN_USE_SYCL // warmup for sycl
-for (int iter = 0; iter < 10; ++iter) {
+#ifdef EIGEN_USE_SYCL  // warmup for sycl
+    for (int iter = 0; iter < 10; ++iter) {
       C.device(device_) = A.rsqrt() + B.sqrt() * B.square();
-}
+    }
 #endif
     StartBenchmarkTiming();
     for (int iter = 0; iter < num_iters; ++iter) {
@@ -339,7 +322,7 @@
     const TensorMap<Tensor<T, 2>, Eigen::Aligned> A(a_, sizes);
     const TensorMap<Tensor<T, 2>, Eigen::Aligned> B(b_, sizes);
     TensorMap<Tensor<T, 2>, Eigen::Aligned> C(c_, sizes);
-#ifdef EIGEN_USE_SYCL // warmup for sycl
+#ifdef EIGEN_USE_SYCL  // warmup for sycl
     for (int iter = 0; iter < 10; ++iter) {
       C.device(device_) = A.exp() + B.log();
     }
@@ -353,7 +336,7 @@
     finalizeBenchmark(static_cast<int64_t>(m_) * m_ * num_iters);
   }
 
- // Row reduction
+  // Row reduction
   void rowReduction(int num_iters) {
     Eigen::array<TensorIndex, 2> input_size;
     input_size[0] = k_;
@@ -363,10 +346,10 @@
     output_size[0] = n_;
     TensorMap<Tensor<T, 1, 0, TensorIndex>, Eigen::Aligned> C(c_, output_size);
     Eigen::IndexList<Eigen::type2index<0>> sum_along_dim;
-#ifdef EIGEN_USE_SYCL // warmup for sycl
-  for (int iter = 0; iter < 10; ++iter) {
-    C.device(device_) = B.sum(sum_along_dim);
-  }
+#ifdef EIGEN_USE_SYCL  // warmup for sycl
+    for (int iter = 0; iter < 10; ++iter) {
+      C.device(device_) = B.sum(sum_along_dim);
+    }
 #endif
     StartBenchmarkTiming();
     for (int iter = 0; iter < num_iters; ++iter) {
@@ -382,12 +365,10 @@
     Eigen::array<TensorIndex, 2> input_size;
     input_size[0] = k_;
     input_size[1] = n_;
-    const TensorMap<Tensor<T, 2, 0, TensorIndex>, Eigen::Aligned> B(
-        b_, input_size);
+    const TensorMap<Tensor<T, 2, 0, TensorIndex>, Eigen::Aligned> B(b_, input_size);
     Eigen::array<TensorIndex, 1> output_size;
     output_size[0] = k_;
-    TensorMap<Tensor<T, 1, 0, TensorIndex>, Eigen::Aligned> A(
-        a_, output_size);
+    TensorMap<Tensor<T, 1, 0, TensorIndex>, Eigen::Aligned> A(a_, output_size);
 
 #ifndef EIGEN_HAS_INDEX_LIST
     Eigen::array<TensorIndex, 1> sum_along_dim;
@@ -397,10 +378,10 @@
     // optimize the code.
     Eigen::IndexList<Eigen::type2index<1>> sum_along_dim;
 #endif
-#ifdef EIGEN_USE_SYCL // warmup for sycl
-  for (int iter = 0; iter < 10; ++iter) {
-    A.device(device_) = B.sum(sum_along_dim);
-  }
+#ifdef EIGEN_USE_SYCL  // warmup for sycl
+    for (int iter = 0; iter < 10; ++iter) {
+      A.device(device_) = B.sum(sum_along_dim);
+    }
 #endif
     StartBenchmarkTiming();
     for (int iter = 0; iter < num_iters; ++iter) {
@@ -416,12 +397,10 @@
     Eigen::array<TensorIndex, 2> input_size;
     input_size[0] = k_;
     input_size[1] = n_;
-    const TensorMap<Tensor<T, 2, 0, TensorIndex>, Eigen::Aligned> B(
-        b_, input_size);
+    const TensorMap<Tensor<T, 2, 0, TensorIndex>, Eigen::Aligned> B(b_, input_size);
     Eigen::array<TensorIndex, 0> output_size;
-    TensorMap<Tensor<T, 0, 0, TensorIndex>, Eigen::Aligned> C(
-        c_, output_size);
-#ifdef EIGEN_USE_SYCL // warmup for sycl
+    TensorMap<Tensor<T, 0, 0, TensorIndex>, Eigen::Aligned> C(c_, output_size);
+#ifdef EIGEN_USE_SYCL  // warmup for sycl
     for (int iter = 0; iter < 10; ++iter) {
       C.device(device_) = B.sum();
     }
@@ -435,28 +414,16 @@
     finalizeBenchmark(static_cast<int64_t>(k_) * n_ * num_iters);
   }
 
-  
-
   // do a contraction which is equivalent to a matrix multiplication
-  void contraction(int num_iters) {
-      contraction<static_cast<int>(Eigen::ColMajor)>(num_iters, false, false);
-  }
+  void contraction(int num_iters) { contraction<static_cast<int>(Eigen::ColMajor)>(num_iters, false, false); }
 
-    void contractionRowMajor(int num_iters) {
-      contraction<static_cast<int>(Eigen::RowMajor)>(num_iters, false, false);
-  }
-    
-  void contractionRowMajorAT(int num_iters) {
-      contraction<static_cast<int>(Eigen::RowMajor)>(num_iters, true, false);
-  }
+  void contractionRowMajor(int num_iters) { contraction<static_cast<int>(Eigen::RowMajor)>(num_iters, false, false); }
 
-  void contractionRowMajorBT(int num_iters) {
-      contraction<static_cast<int>(Eigen::RowMajor)>(num_iters, false, true);
-  }
+  void contractionRowMajorAT(int num_iters) { contraction<static_cast<int>(Eigen::RowMajor)>(num_iters, true, false); }
 
-  void contractionRowMajorABT(int num_iters) {
-      contraction<static_cast<int>(Eigen::RowMajor)>(num_iters, true, true);
-  }
+  void contractionRowMajorBT(int num_iters) { contraction<static_cast<int>(Eigen::RowMajor)>(num_iters, false, true); }
+
+  void contractionRowMajorABT(int num_iters) { contraction<static_cast<int>(Eigen::RowMajor)>(num_iters, true, true); }
 
   void convolution(int num_iters, int kernel_x, int kernel_y) {
     Eigen::array<TensorIndex, 2> input_sizes;
@@ -474,10 +441,10 @@
     Eigen::array<TensorIndex, 2> dims;
     dims[0] = 0;
     dims[1] = 1;
-#ifdef EIGEN_USE_SYCL // warmup for sycl
+#ifdef EIGEN_USE_SYCL  // warmup for sycl
     for (int iter = 0; iter < 10; ++iter) {
       C.device(device_) = A.convolve(B, dims);
-     }
+    }
 #endif
     StartBenchmarkTiming();
     for (int iter = 0; iter < num_iters; ++iter) {
@@ -485,20 +452,20 @@
     }
     // Record the number of FLOPs executed per second (kernel_size
     // multiplications and additions for each value in the resulting tensor)
-    finalizeBenchmark(static_cast<int64_t>(2) *
-        (m_ - kernel_x + 1) * (n_ - kernel_y + 1) * kernel_x * kernel_y * num_iters);
+    finalizeBenchmark(static_cast<int64_t>(2) * (m_ - kernel_x + 1) * (n_ - kernel_y + 1) * kernel_x * kernel_y *
+                      num_iters);
   }
 
  private:
- // do a contraction which is equivalent to a matrix multiplication
-  template<int Layout>
+  // do a contraction which is equivalent to a matrix multiplication
+  template <int Layout>
   void contraction(int num_iters, bool trans_a, bool trans_b) {
     Eigen::array<TensorIndex, 2> sizeA;
-    sizeA[0] = (trans_a ? k_: m_);
-    sizeA[1] = (trans_a ? m_:  k_);
+    sizeA[0] = (trans_a ? k_ : m_);
+    sizeA[1] = (trans_a ? m_ : k_);
     Eigen::array<TensorIndex, 2> sizeB;
-    sizeB[0] = (trans_b ? n_: k_);
-    sizeB[1] = (trans_b ? k_: n_);
+    sizeB[0] = (trans_b ? n_ : k_);
+    sizeB[1] = (trans_b ? k_ : n_);
     Eigen::array<TensorIndex, 2> sizeC;
     sizeC[0] = m_;
     sizeC[1] = n_;
@@ -512,10 +479,10 @@
     TensorIndex a_contract_dim = (trans_a ? 0 : 1);
     TensorIndex b_contract_dim = (trans_b ? 1 : 0);
     dims[0] = DimPair(a_contract_dim, b_contract_dim);
-#ifdef EIGEN_USE_SYCL // warmup for sycl
+#ifdef EIGEN_USE_SYCL  // warmup for sycl
     for (int iter = 0; iter < 10; ++iter) {
       C.device(device_) = A.contract(B, dims);
-     }
+    }
 #endif
     StartBenchmarkTiming();
     for (int iter = 0; iter < num_iters; ++iter) {
@@ -527,16 +494,15 @@
   }
 
   void initialize() {
-    a_ = (T *) device_.allocate(m_ * k_ * sizeof(T));
-    b_ = (T *) device_.allocate(k_ * n_ * sizeof(T));
-    c_ = (T *) device_.allocate(m_ * n_ * sizeof(T));
+    a_ = (T*)device_.allocate(m_ * k_ * sizeof(T));
+    b_ = (T*)device_.allocate(k_ * n_ * sizeof(T));
+    c_ = (T*)device_.allocate(m_ * n_ * sizeof(T));
 
     // Initialize the content of the memory pools to prevent asan from
     // complaining.
     device_.fill(a_, a_ + m_ * k_, T(12));
     device_.fill(b_, b_ + k_ * n_, T(23));
     device_.fill(c_, c_ + m_ * n_, T(31));
-
   }
 
   inline void finalizeBenchmark(int64_t num_items) {
@@ -554,7 +520,6 @@
     SetBenchmarkFlopsProcessed(num_items);
   }
 
-
   TensorIndex m_;
   TensorIndex k_;
   TensorIndex n_;
diff --git a/bench/tensors/tensor_benchmarks_cpu.cc b/bench/tensors/tensor_benchmarks_cpu.cc
index 8947f4b..599ca4b 100644
--- a/bench/tensors/tensor_benchmarks_cpu.cc
+++ b/bench/tensors/tensor_benchmarks_cpu.cc
@@ -4,9 +4,9 @@
 
 #include "tensor_benchmarks.h"
 
-#define CREATE_THREAD_POOL(threads)             \
-Eigen::ThreadPool pool(threads);                \
-Eigen::ThreadPoolDevice device(&pool, threads);
+#define CREATE_THREAD_POOL(threads) \
+  Eigen::ThreadPool pool(threads);  \
+  Eigen::ThreadPoolDevice device(&pool, threads);
 
 // Simple functions
 #define BM_FuncCPU(FUNC, THREADS)                                    \
@@ -78,7 +78,6 @@
 BM_FuncCPU(colReduction, 8);
 BM_FuncCPU(colReduction, 12);
 
-
 // Contractions
 #define BM_FuncWithInputDimsCPU(FUNC, D1, D2, D3, THREADS)                      \
   static void BM_##FUNC##_##D1##x##D2##x##D3##_##THREADS##T(int iters, int N) { \
@@ -95,7 +94,6 @@
   }                                                                             \
   BENCHMARK_RANGE(BM_##FUNC##_##D1##x##D2##x##D3##_##THREADS##T, 10, 5000);
 
-
 BM_FuncWithInputDimsCPU(contraction, N, N, N, 1);
 BM_FuncWithInputDimsCPU(contraction, N, N, N, 4);
 BM_FuncWithInputDimsCPU(contraction, N, N, N, 8);
@@ -132,15 +130,14 @@
 BM_FuncWithInputDimsCPU(contraction, N, N, 1, 12);
 BM_FuncWithInputDimsCPU(contraction, N, N, 1, 16);
 
-
 // Convolutions
-#define BM_FuncWithKernelDimsCPU(FUNC, DIM1, DIM2, THREADS)                    \
-  static void BM_##FUNC##_##DIM1##x##DIM2##_##THREADS##T(int iters, int N) {   \
-    StopBenchmarkTiming();                                                     \
-    CREATE_THREAD_POOL(THREADS);                                               \
-    BenchmarkSuite<Eigen::ThreadPoolDevice, float> suite(device, N);	       \
-    suite.FUNC(iters, DIM1, DIM2);                                             \
-  }                                                                            \
+#define BM_FuncWithKernelDimsCPU(FUNC, DIM1, DIM2, THREADS)                  \
+  static void BM_##FUNC##_##DIM1##x##DIM2##_##THREADS##T(int iters, int N) { \
+    StopBenchmarkTiming();                                                   \
+    CREATE_THREAD_POOL(THREADS);                                             \
+    BenchmarkSuite<Eigen::ThreadPoolDevice, float> suite(device, N);         \
+    suite.FUNC(iters, DIM1, DIM2);                                           \
+  }                                                                          \
   BENCHMARK_RANGE(BM_##FUNC##_##DIM1##x##DIM2##_##THREADS##T, 128, 5000);
 
 BM_FuncWithKernelDimsCPU(convolution, 7, 1, 4);
diff --git a/bench/tensors/tensor_benchmarks_fp16_gpu.cu b/bench/tensors/tensor_benchmarks_fp16_gpu.cu
index d63ff8b..3ad53b1 100644
--- a/bench/tensors/tensor_benchmarks_fp16_gpu.cu
+++ b/bench/tensors/tensor_benchmarks_fp16_gpu.cu
@@ -7,20 +7,20 @@
 #include "tensor_benchmarks.h"
 
 // Simple functions
-#define BM_FuncGPU(FUNC)                                                       \
-  static void BM_##FUNC(int iters, int N) {                                    \
-    StopBenchmarkTiming();                                                     \
-    Eigen::GpuStreamDevice stream;                                             \
-    Eigen::GpuDevice device(&stream);                                          \
-    BenchmarkSuite<Eigen::GpuDevice, Eigen::half> suite(device, N);            \
-    cudaDeviceSynchronize();                                                   \
-    suite.FUNC(iters);                                                         \
-  }                                                                            \
+#define BM_FuncGPU(FUNC)                                            \
+  static void BM_##FUNC(int iters, int N) {                         \
+    StopBenchmarkTiming();                                          \
+    Eigen::GpuStreamDevice stream;                                  \
+    Eigen::GpuDevice device(&stream);                               \
+    BenchmarkSuite<Eigen::GpuDevice, Eigen::half> suite(device, N); \
+    cudaDeviceSynchronize();                                        \
+    suite.FUNC(iters);                                              \
+  }                                                                 \
   BENCHMARK_RANGE(BM_##FUNC, 10, 5000);
 
 BM_FuncGPU(memcpy);
 BM_FuncGPU(typeCasting);
-//BM_FuncGPU(random);
+// BM_FuncGPU(random);
 BM_FuncGPU(slicing);
 BM_FuncGPU(rowChip);
 BM_FuncGPU(colChip);
@@ -35,36 +35,33 @@
 BM_FuncGPU(colReduction);
 BM_FuncGPU(fullReduction);
 
-
 // Contractions
-#define BM_FuncWithInputDimsGPU(FUNC, D1, D2, D3)                              \
-  static void BM_##FUNC##_##D1##x##D2##x##D3(int iters, int N) {               \
-    StopBenchmarkTiming();                                                     \
-    Eigen::GpuStreamDevice stream;                                             \
-    Eigen::GpuDevice device(&stream);                                          \
-    BenchmarkSuite<Eigen::GpuDevice, Eigen::half> suite(device, D1, D2, D3);   \
-    cudaDeviceSynchronize();                                                   \
-    suite.FUNC(iters);                                                         \
-  }                                                                            \
+#define BM_FuncWithInputDimsGPU(FUNC, D1, D2, D3)                            \
+  static void BM_##FUNC##_##D1##x##D2##x##D3(int iters, int N) {             \
+    StopBenchmarkTiming();                                                   \
+    Eigen::GpuStreamDevice stream;                                           \
+    Eigen::GpuDevice device(&stream);                                        \
+    BenchmarkSuite<Eigen::GpuDevice, Eigen::half> suite(device, D1, D2, D3); \
+    cudaDeviceSynchronize();                                                 \
+    suite.FUNC(iters);                                                       \
+  }                                                                          \
   BENCHMARK_RANGE(BM_##FUNC##_##D1##x##D2##x##D3, 10, 5000);
 
-
 BM_FuncWithInputDimsGPU(contraction, N, N, N);
 BM_FuncWithInputDimsGPU(contraction, 64, N, N);
 BM_FuncWithInputDimsGPU(contraction, N, 64, N);
 BM_FuncWithInputDimsGPU(contraction, N, N, 64);
 
-
 // Convolutions
-#define BM_FuncWithKernelDimsGPU(FUNC, DIM1, DIM2)                             \
-  static void BM_##FUNC##_##DIM1##x##DIM2(int iters, int N) {                  \
-    StopBenchmarkTiming();                                                     \
-    Eigen::GpuStreamDevice stream;                                             \
-    Eigen::GpuDevice device(&stream);                                          \
-    BenchmarkSuite<Eigen::GpuDevice, Eigen::half> suite(device, N);            \
-    cudaDeviceSynchronize();                                                   \
-    suite.FUNC(iters, DIM1, DIM2);                                             \
-  }                                                                            \
+#define BM_FuncWithKernelDimsGPU(FUNC, DIM1, DIM2)                  \
+  static void BM_##FUNC##_##DIM1##x##DIM2(int iters, int N) {       \
+    StopBenchmarkTiming();                                          \
+    Eigen::GpuStreamDevice stream;                                  \
+    Eigen::GpuDevice device(&stream);                               \
+    BenchmarkSuite<Eigen::GpuDevice, Eigen::half> suite(device, N); \
+    cudaDeviceSynchronize();                                        \
+    suite.FUNC(iters, DIM1, DIM2);                                  \
+  }                                                                 \
   BENCHMARK_RANGE(BM_##FUNC##_##DIM1##x##DIM2, 128, 5000);
 
 /*
diff --git a/bench/tensors/tensor_benchmarks_gpu.cu b/bench/tensors/tensor_benchmarks_gpu.cu
index c778102..78d16aa 100644
--- a/bench/tensors/tensor_benchmarks_gpu.cu
+++ b/bench/tensors/tensor_benchmarks_gpu.cu
@@ -7,15 +7,15 @@
 #include "tensor_benchmarks.h"
 
 // Simple functions
-#define BM_FuncGPU(FUNC)                                                       \
-  static void BM_##FUNC(int iters, int N) {                                    \
-    StopBenchmarkTiming();                                                     \
-    Eigen::GpuStreamDevice stream;                                             \
-    Eigen::GpuDevice device(&stream);                                          \
-    BenchmarkSuite<Eigen::GpuDevice, float> suite(device, N);                  \
-    cudaDeviceSynchronize();                                                   \
-    suite.FUNC(iters);                                                         \
-  }                                                                            \
+#define BM_FuncGPU(FUNC)                                      \
+  static void BM_##FUNC(int iters, int N) {                   \
+    StopBenchmarkTiming();                                    \
+    Eigen::GpuStreamDevice stream;                            \
+    Eigen::GpuDevice device(&stream);                         \
+    BenchmarkSuite<Eigen::GpuDevice, float> suite(device, N); \
+    cudaDeviceSynchronize();                                  \
+    suite.FUNC(iters);                                        \
+  }                                                           \
   BENCHMARK_RANGE(BM_##FUNC, 10, 5000);
 
 BM_FuncGPU(memcpy);
@@ -35,36 +35,33 @@
 BM_FuncGPU(colReduction);
 BM_FuncGPU(fullReduction);
 
-
 // Contractions
-#define BM_FuncWithInputDimsGPU(FUNC, D1, D2, D3)                              \
-  static void BM_##FUNC##_##D1##x##D2##x##D3(int iters, int N) {               \
-    StopBenchmarkTiming();                                                     \
-    Eigen::GpuStreamDevice stream;                                             \
-    Eigen::GpuDevice device(&stream);                                          \
-    BenchmarkSuite<Eigen::GpuDevice, float> suite(device, D1, D2, D3);         \
-    cudaDeviceSynchronize();                                                   \
-    suite.FUNC(iters);                                                         \
-  }                                                                            \
+#define BM_FuncWithInputDimsGPU(FUNC, D1, D2, D3)                      \
+  static void BM_##FUNC##_##D1##x##D2##x##D3(int iters, int N) {       \
+    StopBenchmarkTiming();                                             \
+    Eigen::GpuStreamDevice stream;                                     \
+    Eigen::GpuDevice device(&stream);                                  \
+    BenchmarkSuite<Eigen::GpuDevice, float> suite(device, D1, D2, D3); \
+    cudaDeviceSynchronize();                                           \
+    suite.FUNC(iters);                                                 \
+  }                                                                    \
   BENCHMARK_RANGE(BM_##FUNC##_##D1##x##D2##x##D3, 10, 5000);
 
-
 BM_FuncWithInputDimsGPU(contraction, N, N, N);
 BM_FuncWithInputDimsGPU(contraction, 64, N, N);
 BM_FuncWithInputDimsGPU(contraction, N, 64, N);
 BM_FuncWithInputDimsGPU(contraction, N, N, 64);
 
-
 // Convolutions
-#define BM_FuncWithKernelDimsGPU(FUNC, DIM1, DIM2)                             \
-  static void BM_##FUNC##_##DIM1##x##DIM2(int iters, int N) {                  \
-    StopBenchmarkTiming();                                                     \
-    Eigen::GpuStreamDevice stream;                                             \
-    Eigen::GpuDevice device(&stream);                                          \
-    BenchmarkSuite<Eigen::GpuDevice, float> suite(device, N);                  \
-    cudaDeviceSynchronize();                                                   \
-    suite.FUNC(iters, DIM1, DIM2);                                             \
-  }                                                                            \
+#define BM_FuncWithKernelDimsGPU(FUNC, DIM1, DIM2)            \
+  static void BM_##FUNC##_##DIM1##x##DIM2(int iters, int N) { \
+    StopBenchmarkTiming();                                    \
+    Eigen::GpuStreamDevice stream;                            \
+    Eigen::GpuDevice device(&stream);                         \
+    BenchmarkSuite<Eigen::GpuDevice, float> suite(device, N); \
+    cudaDeviceSynchronize();                                  \
+    suite.FUNC(iters, DIM1, DIM2);                            \
+  }                                                           \
   BENCHMARK_RANGE(BM_##FUNC##_##DIM1##x##DIM2, 128, 5000);
 
 BM_FuncWithKernelDimsGPU(convolution, 7, 1);
diff --git a/bench/tensors/tensor_benchmarks_sycl.cc b/bench/tensors/tensor_benchmarks_sycl.cc
index 6f9f871..b3fb5fb 100644
--- a/bench/tensors/tensor_benchmarks_sycl.cc
+++ b/bench/tensors/tensor_benchmarks_sycl.cc
@@ -115,7 +115,6 @@
 BM_FuncWithInputDimsGPU(contractionRowMajorBT, N, 64, N);
 BM_FuncWithInputDimsGPU(contractionRowMajorBT, N, N, 64);
 
-
 BM_FuncWithInputDimsGPU(contractionRowMajorABT, N, N, N);
 BM_FuncWithInputDimsGPU(contractionRowMajorABT, 64, N, N);
 BM_FuncWithInputDimsGPU(contractionRowMajorABT, N, 64, N);
diff --git a/bench/tensors/tensor_contract_sycl_bench.cc b/bench/tensors/tensor_contract_sycl_bench.cc
index b1d89d2..300695b 100644
--- a/bench/tensors/tensor_contract_sycl_bench.cc
+++ b/bench/tensors/tensor_contract_sycl_bench.cc
@@ -29,30 +29,32 @@
 using Eigen::TensorMap;
 std::ofstream out("Result.txt");
 
-std::chrono::time_point<std::chrono::system_clock> get_time(){
+std::chrono::time_point<std::chrono::system_clock> get_time() {
   std::chrono::time_point<std::chrono::system_clock> start, end;
   return std::chrono::system_clock::now();
 }
 
-template<typename Start, typename End, typename TensorIndex>
-void finalizeBenchmark(Start start, End end, TensorIndex m_, TensorIndex k_, TensorIndex n_ , TensorIndex num_iters, std::string name){
-
-  std::chrono::duration<double> elapsed_seconds = end-start;
-  std::cout <<"Kernel Name : " << name << ", M : " << m_ << ",  N : " << n_ << ", K : " << k_ << " GFLOP/s : " <<
-  static_cast<float>((static_cast<int64_t>(2) * m_ * n_ * k_ * num_iters)/ elapsed_seconds.count()) * 1e-9 << "\n";
-    out <<"Kernel Name : " << name << ", M : " << m_ << ",  N : " << n_ << ", K : " << k_ << " GFLOP/s : " <<
-    static_cast<float>((static_cast<int64_t>(2) * m_ * n_ * k_ * num_iters)/ elapsed_seconds.count()) * 1e-9 << "\n";
+template <typename Start, typename End, typename TensorIndex>
+void finalizeBenchmark(Start start, End end, TensorIndex m_, TensorIndex k_, TensorIndex n_, TensorIndex num_iters,
+                       std::string name) {
+  std::chrono::duration<double> elapsed_seconds = end - start;
+  std::cout << "Kernel Name : " << name << ", M : " << m_ << ",  N : " << n_ << ", K : " << k_ << " GFLOP/s : "
+            << static_cast<float>((static_cast<int64_t>(2) * m_ * n_ * k_ * num_iters) / elapsed_seconds.count()) * 1e-9
+            << "\n";
+  out << "Kernel Name : " << name << ", M : " << m_ << ",  N : " << n_ << ", K : " << k_ << " GFLOP/s : "
+      << static_cast<float>((static_cast<int64_t>(2) * m_ * n_ * k_ * num_iters) / elapsed_seconds.count()) * 1e-9
+      << "\n";
 }
 
 // do a contraction which is equivalent to a matrix multiplication
-template<typename T, typename Device, typename TensorIndex>
+template <typename T, typename Device, typename TensorIndex>
 void contraction(const Device& device_, TensorIndex num_iters, TensorIndex m_, TensorIndex k_, TensorIndex n_) {
   T* a_;
   T* b_;
   T* c_;
-  a_ = (T *) device_.allocate(m_ * k_ * sizeof(T));
-  b_ = (T *) device_.allocate(k_ * n_ * sizeof(T));
-  c_ = (T *) device_.allocate(m_ * n_ * sizeof(T));
+  a_ = (T*)device_.allocate(m_ * k_ * sizeof(T));
+  b_ = (T*)device_.allocate(k_ * n_ * sizeof(T));
+  c_ = (T*)device_.allocate(m_ * n_ * sizeof(T));
 
   // Initialize the content of the memory pools to prevent asan from
   // complaining.
@@ -77,16 +79,16 @@
   typedef typename Tensor<T, 2>::DimensionPair DimPair;
   Eigen::array<DimPair, 1> dims;
   dims[0] = DimPair(1, 0);
-#ifdef EIGEN_USE_SYCL // warmup for sycl
+#ifdef EIGEN_USE_SYCL  // warmup for sycl
   for (int iter = 0; iter < 10; ++iter) {
     C.device(device_) = A.contract(B, dims);
-   }
+  }
 #endif
   auto start = get_time();
   for (int iter = 0; iter < num_iters; ++iter) {
     C.device(device_) = A.contract(B, dims);
   }
- auto end = get_time();
+  auto end = get_time();
   // Record the number of FLOPs executed per second (size_ multiplications and
   // additions for each value in the resulting tensor)
   finalizeBenchmark(start, end, m_, k_, n_, num_iters, "contraction");
@@ -96,17 +98,15 @@
   device_.synchronize();
 }
 
-
-
 // do a contraction which is equivalent to a matrix multiplication
-template<typename T, typename Device, typename TensorIndex>
+template <typename T, typename Device, typename TensorIndex>
 void contractionRowMajor(const Device& device_, TensorIndex num_iters, TensorIndex m_, TensorIndex k_, TensorIndex n_) {
   T* a_;
   T* b_;
   T* c_;
-  a_ = (T *) device_.allocate(m_ * k_ * sizeof(T));
-  b_ = (T *) device_.allocate(k_ * n_ * sizeof(T));
-  c_ = (T *) device_.allocate(m_ * n_ * sizeof(T));
+  a_ = (T*)device_.allocate(m_ * k_ * sizeof(T));
+  b_ = (T*)device_.allocate(k_ * n_ * sizeof(T));
+  c_ = (T*)device_.allocate(m_ * n_ * sizeof(T));
 
   // Initialize the content of the memory pools to prevent asan from
   // complaining.
@@ -131,10 +131,10 @@
   typedef typename Tensor<T, 2>::DimensionPair DimPair;
   Eigen::array<DimPair, 1> dims;
   dims[0] = DimPair(1, 0);
-#ifdef EIGEN_USE_SYCL // warmup for sycl
+#ifdef EIGEN_USE_SYCL  // warmup for sycl
   for (int iter = 0; iter < 10; ++iter) {
     C.device(device_) = A.contract(B, dims);
-   }
+  }
 #endif
   auto start = get_time();
   for (int iter = 0; iter < num_iters; ++iter) {
@@ -150,15 +150,14 @@
   device_.synchronize();
 }
 
-
-template<typename T, typename Device, typename TensorIndex>
+template <typename T, typename Device, typename TensorIndex>
 void contractionAT(const Device& device_, TensorIndex num_iters, TensorIndex m_, TensorIndex k_, TensorIndex n_) {
   T* a_;
   T* b_;
   T* c_;
-  a_ = (T *) device_.allocate(m_ * k_ * sizeof(T));
-  b_ = (T *) device_.allocate(k_ * n_ * sizeof(T));
-  c_ = (T *) device_.allocate(m_ * n_ * sizeof(T));
+  a_ = (T*)device_.allocate(m_ * k_ * sizeof(T));
+  b_ = (T*)device_.allocate(k_ * n_ * sizeof(T));
+  c_ = (T*)device_.allocate(m_ * n_ * sizeof(T));
 
   // Initialize the content of the memory pools to prevent asan from
   // complaining.
@@ -182,10 +181,10 @@
   typedef typename Tensor<T, 2>::DimensionPair DimPair;
   Eigen::array<DimPair, 1> dims;
   dims[0] = DimPair(0, 0);
-#ifdef EIGEN_USE_SYCL // warmup for sycl
+#ifdef EIGEN_USE_SYCL  // warmup for sycl
   for (int iter = 0; iter < 10; ++iter) {
     C.device(device_) = A.contract(B, dims);
-   }
+  }
 #endif
   auto start = get_time();
   for (int iter = 0; iter < num_iters; ++iter) {
@@ -199,17 +198,16 @@
   device_.deallocate(b_);
   device_.deallocate(c_);
   device_.synchronize();
-
 }
 
-template<typename T, typename Device, typename TensorIndex>
+template <typename T, typename Device, typename TensorIndex>
 void contractionBT(const Device& device_, TensorIndex num_iters, TensorIndex m_, TensorIndex k_, TensorIndex n_) {
   T* a_;
   T* b_;
   T* c_;
-  a_ = (T *) device_.allocate(m_ * k_ * sizeof(T));
-  b_ = (T *) device_.allocate(k_ * n_ * sizeof(T));
-  c_ = (T *) device_.allocate(m_ * n_ * sizeof(T));
+  a_ = (T*)device_.allocate(m_ * k_ * sizeof(T));
+  b_ = (T*)device_.allocate(k_ * n_ * sizeof(T));
+  c_ = (T*)device_.allocate(m_ * n_ * sizeof(T));
 
   // Initialize the content of the memory pools to prevent asan from
   // complaining.
@@ -234,10 +232,10 @@
   typedef typename Tensor<T, 2>::DimensionPair DimPair;
   Eigen::array<DimPair, 1> dims;
   dims[0] = DimPair(1, 1);
-#ifdef EIGEN_USE_SYCL // warmup for sycl
+#ifdef EIGEN_USE_SYCL  // warmup for sycl
   for (int iter = 0; iter < 10; ++iter) {
     C.device(device_) = A.contract(B, dims);
-   }
+  }
 #endif
   auto start = get_time();
   for (int iter = 0; iter < num_iters; ++iter) {
@@ -251,17 +249,16 @@
   device_.deallocate(b_);
   device_.deallocate(c_);
   device_.synchronize();
-
 }
 
-template<typename T, typename Device, typename TensorIndex>
+template <typename T, typename Device, typename TensorIndex>
 void contractionABT(const Device& device_, TensorIndex num_iters, TensorIndex m_, TensorIndex k_, TensorIndex n_) {
   T* a_;
   T* b_;
   T* c_;
-  a_ = (T *) device_.allocate(m_ * k_ * sizeof(T));
-  b_ = (T *) device_.allocate(k_ * n_ * sizeof(T));
-  c_ = (T *) device_.allocate(m_ * n_ * sizeof(T));
+  a_ = (T*)device_.allocate(m_ * k_ * sizeof(T));
+  b_ = (T*)device_.allocate(k_ * n_ * sizeof(T));
+  c_ = (T*)device_.allocate(m_ * n_ * sizeof(T));
 
   // Initialize the content of the memory pools to prevent asan from
   // complaining.
@@ -286,10 +283,10 @@
   typedef typename Tensor<T, 2>::DimensionPair DimPair;
   Eigen::array<DimPair, 1> dims;
   dims[0] = DimPair(0, 1);
-#ifdef EIGEN_USE_SYCL // warmup for sycl
+#ifdef EIGEN_USE_SYCL  // warmup for sycl
   for (int iter = 0; iter < 10; ++iter) {
     C.device(device_) = A.contract(B, dims);
-   }
+  }
 #endif
   auto start = get_time();
   for (int iter = 0; iter < num_iters; ++iter) {
@@ -309,10 +306,10 @@
   cl::sycl::gpu_selector selector;
   Eigen::QueueInterface queue(selector);
   Eigen::SyclDevice device(&queue);
-  int64_t num_iters =20;
-  for(int64_t m = 32; m <= 4096; m *= 2)
-    for(int64_t k = 32; k <= 4096; k *= 2)
-      for(int64_t n = 32; n <= 4096; n*= 2){
+  int64_t num_iters = 20;
+  for (int64_t m = 32; m <= 4096; m *= 2)
+    for (int64_t k = 32; k <= 4096; k *= 2)
+      for (int64_t n = 32; n <= 4096; n *= 2) {
         (contraction<float>(device, num_iters, m, k, n));
         (contractionRowMajor<float>(device, num_iters, m, k, n));
         (contractionAT<float>(device, num_iters, m, k, n));
@@ -320,6 +317,6 @@
         (contractionABT<float>(device, num_iters, m, k, n));
       }
   return 0;
-  }
+}
 
-#endif // EIGEN_BENCH_CONTRACT_SYCL
+#endif  // EIGEN_BENCH_CONTRACT_SYCL
diff --git a/bench/vdw_new.cpp b/bench/vdw_new.cpp
index d260404..85bcd05 100644
--- a/bench/vdw_new.cpp
+++ b/bench/vdw_new.cpp
@@ -19,17 +19,11 @@
 
 using namespace std;
 
-SCALAR E_VDW(const Vec &interactions1, const Vec &interactions2)
-{
-  return (interactions2.cwise()/interactions1)
-         .cwise().cube()
-         .cwise().square()
-         .cwise().square()
-         .sum();
+SCALAR E_VDW(const Vec &interactions1, const Vec &interactions2) {
+  return (interactions2.cwise() / interactions1).cwise().cube().cwise().square().cwise().square().sum();
 }
 
-int main() 
-{
+int main() {
   //
   //          1   2   3   4  ... (interactions)
   // ka       .   .   .   .  ...
@@ -40,17 +34,17 @@
   //    for
   // interaction)
   //
-  Vec interactions1(SIZE), interactions2(SIZE); // SIZE is the number of vdw interactions in our system
+  Vec interactions1(SIZE), interactions2(SIZE);  // SIZE is the number of vdw interactions in our system
   // SetupCalculations()
-  SCALAR rab = 1.0;  
+  SCALAR rab = 1.0;
   interactions1.setConstant(2.4);
   interactions2.setConstant(rab);
-  
+
   // Energy()
   SCALAR energy = 0.0;
-  for (unsigned int i = 0; i<REPEAT; ++i) {
+  for (unsigned int i = 0; i < REPEAT; ++i) {
     energy += E_VDW(interactions1, interactions2);
-    energy *= 1 + 1e-20 * i; // prevent compiler from optimizing the loop
+    energy *= 1 + 1e-20 * i;  // prevent compiler from optimizing the loop
   }
   cout << "energy = " << energy << endl;
 }
diff --git a/blas/BandTriangularSolver.h b/blas/BandTriangularSolver.h
index e8551cd..014af24 100644
--- a/blas/BandTriangularSolver.h
+++ b/blas/BandTriangularSolver.h
@@ -12,82 +12,71 @@
 
 namespace internal {
 
- /* \internal
-  * Solve Ax=b with A a band triangular matrix
-  * TODO: extend it to matrices for x abd b */
-template<typename Index, int Mode, typename LhsScalar, bool ConjLhs, typename RhsScalar, int StorageOrder>
+/* \internal
+ * Solve Ax=b with A a band triangular matrix
+ * TODO: extend it to matrices for x abd b */
+template <typename Index, int Mode, typename LhsScalar, bool ConjLhs, typename RhsScalar, int StorageOrder>
 struct band_solve_triangular_selector;
 
+template <typename Index, int Mode, typename LhsScalar, bool ConjLhs, typename RhsScalar>
+struct band_solve_triangular_selector<Index, Mode, LhsScalar, ConjLhs, RhsScalar, RowMajor> {
+  typedef Map<const Matrix<LhsScalar, Dynamic, Dynamic, RowMajor>, 0, OuterStride<> > LhsMap;
+  typedef Map<Matrix<RhsScalar, Dynamic, 1> > RhsMap;
+  enum { IsLower = (Mode & Lower) ? 1 : 0 };
+  static void run(Index size, Index k, const LhsScalar* _lhs, Index lhsStride, RhsScalar* _other) {
+    const LhsMap lhs(_lhs, size, k + 1, OuterStride<>(lhsStride));
+    RhsMap other(_other, size, 1);
+    std::conditional_t<ConjLhs, const CwiseUnaryOp<typename internal::scalar_conjugate_op<LhsScalar>, LhsMap>,
+                       const LhsMap&>
+        cjLhs(lhs);
 
-template<typename Index, int Mode, typename LhsScalar, bool ConjLhs, typename RhsScalar>
-struct band_solve_triangular_selector<Index,Mode,LhsScalar,ConjLhs,RhsScalar,RowMajor>
-{
-  typedef Map<const Matrix<LhsScalar,Dynamic,Dynamic,RowMajor>, 0, OuterStride<> > LhsMap;
-  typedef Map<Matrix<RhsScalar,Dynamic,1> > RhsMap;
-  enum { IsLower = (Mode&Lower) ? 1 : 0 };
-  static void run(Index size, Index k, const LhsScalar* _lhs, Index lhsStride, RhsScalar* _other)
-  {
-    const LhsMap lhs(_lhs,size,k+1,OuterStride<>(lhsStride));
-    RhsMap other(_other,size,1);
-    std::conditional_t<ConjLhs,
-                  const CwiseUnaryOp<typename internal::scalar_conjugate_op<LhsScalar>,LhsMap>,
-                  const LhsMap&> cjLhs(lhs);
-                        
-    for(int col=0 ; col<other.cols() ; ++col)
-    {
-      for(int ii=0; ii<size; ++ii)
-      {
-        int i = IsLower ? ii : size-ii-1;
-        int actual_k = (std::min)(k,ii);
-        int actual_start = IsLower ? k-actual_k : 1;
-        
-        if(actual_k>0)
-          other.coeffRef(i,col) -= cjLhs.row(i).segment(actual_start,actual_k).transpose()
-                                  .cwiseProduct(other.col(col).segment(IsLower ? i-actual_k : i+1,actual_k)).sum();
+    for (int col = 0; col < other.cols(); ++col) {
+      for (int ii = 0; ii < size; ++ii) {
+        int i = IsLower ? ii : size - ii - 1;
+        int actual_k = (std::min)(k, ii);
+        int actual_start = IsLower ? k - actual_k : 1;
 
-        if((Mode&UnitDiag)==0)
-          other.coeffRef(i,col) /= cjLhs(i,IsLower ? k : 0);
-      }
-    }
-  }
-  
-};
+        if (actual_k > 0)
+          other.coeffRef(i, col) -= cjLhs.row(i)
+                                        .segment(actual_start, actual_k)
+                                        .transpose()
+                                        .cwiseProduct(other.col(col).segment(IsLower ? i - actual_k : i + 1, actual_k))
+                                        .sum();
 
-template<typename Index, int Mode, typename LhsScalar, bool ConjLhs, typename RhsScalar>
-struct band_solve_triangular_selector<Index,Mode,LhsScalar,ConjLhs,RhsScalar,ColMajor>
-{
-  typedef Map<const Matrix<LhsScalar,Dynamic,Dynamic,ColMajor>, 0, OuterStride<> > LhsMap;
-  typedef Map<Matrix<RhsScalar,Dynamic,1> > RhsMap;
-  enum { IsLower = (Mode&Lower) ? 1 : 0 };
-  static void run(Index size, Index k, const LhsScalar* _lhs, Index lhsStride, RhsScalar* _other)
-  {
-    const LhsMap lhs(_lhs,k+1,size,OuterStride<>(lhsStride));
-    RhsMap other(_other,size,1);
-    std::conditional_t<ConjLhs,
-                  const CwiseUnaryOp<typename internal::scalar_conjugate_op<LhsScalar>,LhsMap>,
-                  const LhsMap&> cjLhs(lhs);
-                        
-    for(int col=0 ; col<other.cols() ; ++col)
-    {
-      for(int ii=0; ii<size; ++ii)
-      {
-        int i = IsLower ? ii : size-ii-1;
-        int actual_k = (std::min)(k,size-ii-1);
-        int actual_start = IsLower ? 1 : k-actual_k;
-        
-        if((Mode&UnitDiag)==0)
-          other.coeffRef(i,col) /= cjLhs(IsLower ? 0 : k, i);
-
-        if(actual_k>0)
-          other.col(col).segment(IsLower ? i+1 : i-actual_k, actual_k)
-              -= other.coeff(i,col) * cjLhs.col(i).segment(actual_start,actual_k);
-        
+        if ((Mode & UnitDiag) == 0) other.coeffRef(i, col) /= cjLhs(i, IsLower ? k : 0);
       }
     }
   }
 };
 
+template <typename Index, int Mode, typename LhsScalar, bool ConjLhs, typename RhsScalar>
+struct band_solve_triangular_selector<Index, Mode, LhsScalar, ConjLhs, RhsScalar, ColMajor> {
+  typedef Map<const Matrix<LhsScalar, Dynamic, Dynamic, ColMajor>, 0, OuterStride<> > LhsMap;
+  typedef Map<Matrix<RhsScalar, Dynamic, 1> > RhsMap;
+  enum { IsLower = (Mode & Lower) ? 1 : 0 };
+  static void run(Index size, Index k, const LhsScalar* _lhs, Index lhsStride, RhsScalar* _other) {
+    const LhsMap lhs(_lhs, k + 1, size, OuterStride<>(lhsStride));
+    RhsMap other(_other, size, 1);
+    std::conditional_t<ConjLhs, const CwiseUnaryOp<typename internal::scalar_conjugate_op<LhsScalar>, LhsMap>,
+                       const LhsMap&>
+        cjLhs(lhs);
 
-} // end namespace internal
+    for (int col = 0; col < other.cols(); ++col) {
+      for (int ii = 0; ii < size; ++ii) {
+        int i = IsLower ? ii : size - ii - 1;
+        int actual_k = (std::min)(k, size - ii - 1);
+        int actual_start = IsLower ? 1 : k - actual_k;
 
-#endif // EIGEN_BAND_TRIANGULARSOLVER_H
+        if ((Mode & UnitDiag) == 0) other.coeffRef(i, col) /= cjLhs(IsLower ? 0 : k, i);
+
+        if (actual_k > 0)
+          other.col(col).segment(IsLower ? i + 1 : i - actual_k, actual_k) -=
+              other.coeff(i, col) * cjLhs.col(i).segment(actual_start, actual_k);
+      }
+    }
+  }
+};
+
+}  // end namespace internal
+
+#endif  // EIGEN_BAND_TRIANGULARSOLVER_H
diff --git a/blas/GeneralRank1Update.h b/blas/GeneralRank1Update.h
index 07d388c..dd363e5 100644
--- a/blas/GeneralRank1Update.h
+++ b/blas/GeneralRank1Update.h
@@ -13,32 +13,28 @@
 namespace internal {
 
 /* Optimized matrix += alpha * uv' */
-template<typename Scalar, typename Index, int StorageOrder, bool ConjLhs, bool ConjRhs>
+template <typename Scalar, typename Index, int StorageOrder, bool ConjLhs, bool ConjRhs>
 struct general_rank1_update;
 
-template<typename Scalar, typename Index, bool ConjLhs, bool ConjRhs>
-struct general_rank1_update<Scalar,Index,ColMajor,ConjLhs,ConjRhs>
-{
-  static void run(Index rows, Index cols, Scalar* mat, Index stride, const Scalar* u, const Scalar* v, Scalar alpha)
-  {
-    typedef Map<const Matrix<Scalar,Dynamic,1> > OtherMap;
-    typedef typename conj_expr_if<ConjLhs,OtherMap>::type ConjRhsType;
+template <typename Scalar, typename Index, bool ConjLhs, bool ConjRhs>
+struct general_rank1_update<Scalar, Index, ColMajor, ConjLhs, ConjRhs> {
+  static void run(Index rows, Index cols, Scalar* mat, Index stride, const Scalar* u, const Scalar* v, Scalar alpha) {
+    typedef Map<const Matrix<Scalar, Dynamic, 1> > OtherMap;
+    typedef typename conj_expr_if<ConjLhs, OtherMap>::type ConjRhsType;
     conj_if<ConjRhs> cj;
 
-    for (Index i=0; i<cols; ++i)
-      Map<Matrix<Scalar,Dynamic,1> >(mat+stride*i,rows) += alpha * cj(v[i]) * ConjRhsType(OtherMap(u,rows));
+    for (Index i = 0; i < cols; ++i)
+      Map<Matrix<Scalar, Dynamic, 1> >(mat + stride * i, rows) += alpha * cj(v[i]) * ConjRhsType(OtherMap(u, rows));
   }
 };
 
-template<typename Scalar, typename Index, bool ConjLhs, bool ConjRhs>
-struct general_rank1_update<Scalar,Index,RowMajor,ConjLhs,ConjRhs>
-{
-  static void run(Index rows, Index cols, Scalar* mat, Index stride, const Scalar* u, const Scalar* v, Scalar alpha)
-  {
-    general_rank1_update<Scalar,Index,ColMajor,ConjRhs,ConjRhs>::run(rows,cols,mat,stride,u,v,alpha);
+template <typename Scalar, typename Index, bool ConjLhs, bool ConjRhs>
+struct general_rank1_update<Scalar, Index, RowMajor, ConjLhs, ConjRhs> {
+  static void run(Index rows, Index cols, Scalar* mat, Index stride, const Scalar* u, const Scalar* v, Scalar alpha) {
+    general_rank1_update<Scalar, Index, ColMajor, ConjRhs, ConjRhs>::run(rows, cols, mat, stride, u, v, alpha);
   }
 };
 
-} // end namespace internal
+}  // end namespace internal
 
-#endif // EIGEN_GENERAL_RANK1UPDATE_H
+#endif  // EIGEN_GENERAL_RANK1UPDATE_H
diff --git a/blas/PackedSelfadjointProduct.h b/blas/PackedSelfadjointProduct.h
index 07327a2..655da51 100644
--- a/blas/PackedSelfadjointProduct.h
+++ b/blas/PackedSelfadjointProduct.h
@@ -15,39 +15,36 @@
 /* Optimized matrix += alpha * uv'
  * The matrix is in packed form.
  */
-template<typename Scalar, typename Index, int StorageOrder, int UpLo, bool ConjLhs, bool ConjRhs>
+template <typename Scalar, typename Index, int StorageOrder, int UpLo, bool ConjLhs, bool ConjRhs>
 struct selfadjoint_packed_rank1_update;
 
-template<typename Scalar, typename Index, int UpLo, bool ConjLhs, bool ConjRhs>
-struct selfadjoint_packed_rank1_update<Scalar,Index,ColMajor,UpLo,ConjLhs,ConjRhs>
-{
+template <typename Scalar, typename Index, int UpLo, bool ConjLhs, bool ConjRhs>
+struct selfadjoint_packed_rank1_update<Scalar, Index, ColMajor, UpLo, ConjLhs, ConjRhs> {
   typedef typename NumTraits<Scalar>::Real RealScalar;
-  static void run(Index size, Scalar* mat, const Scalar* vec, RealScalar alpha)
-  {
-    typedef Map<const Matrix<Scalar,Dynamic,1> > OtherMap;
-    typedef typename conj_expr_if<ConjLhs,OtherMap>::type ConjRhsType;
+  static void run(Index size, Scalar* mat, const Scalar* vec, RealScalar alpha) {
+    typedef Map<const Matrix<Scalar, Dynamic, 1> > OtherMap;
+    typedef typename conj_expr_if<ConjLhs, OtherMap>::type ConjRhsType;
     conj_if<ConjRhs> cj;
 
-    for (Index i=0; i<size; ++i)
-    {
-      Map<Matrix<Scalar,Dynamic,1> >(mat, UpLo==Lower ? size-i : (i+1)) += alpha * cj(vec[i]) * ConjRhsType(OtherMap(vec+(UpLo==Lower ? i : 0), UpLo==Lower ? size-i : (i+1)));
-      //FIXME This should be handled outside.
-      mat[UpLo==Lower ? 0 : i] = numext::real(mat[UpLo==Lower ? 0 : i]);
-      mat += UpLo==Lower ? size-i : (i+1);
+    for (Index i = 0; i < size; ++i) {
+      Map<Matrix<Scalar, Dynamic, 1> >(mat, UpLo == Lower ? size - i : (i + 1)) +=
+          alpha * cj(vec[i]) * ConjRhsType(OtherMap(vec + (UpLo == Lower ? i : 0), UpLo == Lower ? size - i : (i + 1)));
+      // FIXME This should be handled outside.
+      mat[UpLo == Lower ? 0 : i] = numext::real(mat[UpLo == Lower ? 0 : i]);
+      mat += UpLo == Lower ? size - i : (i + 1);
     }
   }
 };
 
-template<typename Scalar, typename Index, int UpLo, bool ConjLhs, bool ConjRhs>
-struct selfadjoint_packed_rank1_update<Scalar,Index,RowMajor,UpLo,ConjLhs,ConjRhs>
-{
+template <typename Scalar, typename Index, int UpLo, bool ConjLhs, bool ConjRhs>
+struct selfadjoint_packed_rank1_update<Scalar, Index, RowMajor, UpLo, ConjLhs, ConjRhs> {
   typedef typename NumTraits<Scalar>::Real RealScalar;
-  static void run(Index size, Scalar* mat, const Scalar* vec, RealScalar alpha)
-  {
-    selfadjoint_packed_rank1_update<Scalar,Index,ColMajor,UpLo==Lower?Upper:Lower,ConjRhs,ConjLhs>::run(size,mat,vec,alpha);
+  static void run(Index size, Scalar* mat, const Scalar* vec, RealScalar alpha) {
+    selfadjoint_packed_rank1_update<Scalar, Index, ColMajor, UpLo == Lower ? Upper : Lower, ConjRhs, ConjLhs>::run(
+        size, mat, vec, alpha);
   }
 };
 
-} // end namespace internal
+}  // end namespace internal
 
-#endif // EIGEN_SELFADJOINT_PACKED_PRODUCT_H
+#endif  // EIGEN_SELFADJOINT_PACKED_PRODUCT_H
diff --git a/blas/PackedTriangularMatrixVector.h b/blas/PackedTriangularMatrixVector.h
index cc2a9b8..bb830cb 100644
--- a/blas/PackedTriangularMatrixVector.h
+++ b/blas/PackedTriangularMatrixVector.h
@@ -12,24 +12,23 @@
 
 namespace internal {
 
-template<typename Index, int Mode, typename LhsScalar, bool ConjLhs, typename RhsScalar, bool ConjRhs, int StorageOrder>
+template <typename Index, int Mode, typename LhsScalar, bool ConjLhs, typename RhsScalar, bool ConjRhs,
+          int StorageOrder>
 struct packed_triangular_matrix_vector_product;
 
-template<typename Index, int Mode, typename LhsScalar, bool ConjLhs, typename RhsScalar, bool ConjRhs>
-struct packed_triangular_matrix_vector_product<Index,Mode,LhsScalar,ConjLhs,RhsScalar,ConjRhs,ColMajor>
-{
+template <typename Index, int Mode, typename LhsScalar, bool ConjLhs, typename RhsScalar, bool ConjRhs>
+struct packed_triangular_matrix_vector_product<Index, Mode, LhsScalar, ConjLhs, RhsScalar, ConjRhs, ColMajor> {
   typedef typename ScalarBinaryOpTraits<LhsScalar, RhsScalar>::ReturnType ResScalar;
   enum {
-    IsLower     = (Mode & Lower)   ==Lower,
-    HasUnitDiag = (Mode & UnitDiag)==UnitDiag,
-    HasZeroDiag = (Mode & ZeroDiag)==ZeroDiag
+    IsLower = (Mode & Lower) == Lower,
+    HasUnitDiag = (Mode & UnitDiag) == UnitDiag,
+    HasZeroDiag = (Mode & ZeroDiag) == ZeroDiag
   };
-  static void run(Index size, const LhsScalar* lhs, const RhsScalar* rhs, ResScalar* res, ResScalar alpha)
-  {
+  static void run(Index size, const LhsScalar* lhs, const RhsScalar* rhs, ResScalar* res, ResScalar alpha) {
     internal::conj_if<ConjRhs> cj;
-    typedef Map<const Matrix<LhsScalar,Dynamic,1> > LhsMap;
-    typedef typename conj_expr_if<ConjLhs,LhsMap>::type ConjLhsType;
-    typedef Map<Matrix<ResScalar,Dynamic,1> > ResMap;
+    typedef Map<const Matrix<LhsScalar, Dynamic, 1> > LhsMap;
+    typedef typename conj_expr_if<ConjLhs, LhsMap>::type ConjLhsType;
+    typedef Map<Matrix<ResScalar, Dynamic, 1> > ResMap;
 
     for (Index i = 0; i < size; ++i) {
       Index s = IsLower && (HasUnitDiag || HasZeroDiag) ? 1 : 0;
@@ -45,28 +44,28 @@
   };
 };
 
-template<typename Index, int Mode, typename LhsScalar, bool ConjLhs, typename RhsScalar, bool ConjRhs>
-struct packed_triangular_matrix_vector_product<Index,Mode,LhsScalar,ConjLhs,RhsScalar,ConjRhs,RowMajor>
-{
+template <typename Index, int Mode, typename LhsScalar, bool ConjLhs, typename RhsScalar, bool ConjRhs>
+struct packed_triangular_matrix_vector_product<Index, Mode, LhsScalar, ConjLhs, RhsScalar, ConjRhs, RowMajor> {
   typedef typename ScalarBinaryOpTraits<LhsScalar, RhsScalar>::ReturnType ResScalar;
   enum {
-    IsLower     = (Mode & Lower)   ==Lower,
-    HasUnitDiag = (Mode & UnitDiag)==UnitDiag,
-    HasZeroDiag = (Mode & ZeroDiag)==ZeroDiag
+    IsLower = (Mode & Lower) == Lower,
+    HasUnitDiag = (Mode & UnitDiag) == UnitDiag,
+    HasZeroDiag = (Mode & ZeroDiag) == ZeroDiag
   };
-  static void run(Index size, const LhsScalar* lhs, const RhsScalar* rhs, ResScalar* res, ResScalar alpha)
-  {
+  static void run(Index size, const LhsScalar* lhs, const RhsScalar* rhs, ResScalar* res, ResScalar alpha) {
     internal::conj_if<ConjRhs> cj;
-    typedef Map<const Matrix<LhsScalar,Dynamic,1> > LhsMap;
-    typedef typename conj_expr_if<ConjLhs,LhsMap>::type ConjLhsType;
-    typedef Map<const Matrix<RhsScalar,Dynamic,1> > RhsMap;
-    typedef typename conj_expr_if<ConjRhs,RhsMap>::type ConjRhsType;
+    typedef Map<const Matrix<LhsScalar, Dynamic, 1> > LhsMap;
+    typedef typename conj_expr_if<ConjLhs, LhsMap>::type ConjLhsType;
+    typedef Map<const Matrix<RhsScalar, Dynamic, 1> > RhsMap;
+    typedef typename conj_expr_if<ConjRhs, RhsMap>::type ConjRhsType;
 
     for (Index i = 0; i < size; ++i) {
       Index s = !IsLower && (HasUnitDiag || HasZeroDiag) ? 1 : 0;
       Index r = IsLower ? i + 1 : size - i;
       if (!(HasUnitDiag || HasZeroDiag) || (--r > 0)) {
-        res[i] += alpha * (ConjLhsType(LhsMap(lhs + s, r)).cwiseProduct(ConjRhsType(RhsMap(rhs + (IsLower ? 0 : s + i), r)))).sum();
+        res[i] +=
+            alpha *
+            (ConjLhsType(LhsMap(lhs + s, r)).cwiseProduct(ConjRhsType(RhsMap(rhs + (IsLower ? 0 : s + i), r)))).sum();
       }
       if (HasUnitDiag) {
         res[i] += alpha * cj(rhs[i]);
@@ -76,6 +75,6 @@
   };
 };
 
-} // end namespace internal
+}  // end namespace internal
 
-#endif // EIGEN_PACKED_TRIANGULAR_MATRIX_VECTOR_H
+#endif  // EIGEN_PACKED_TRIANGULAR_MATRIX_VECTOR_H
diff --git a/blas/PackedTriangularSolverVector.h b/blas/PackedTriangularSolverVector.h
index 5c0bb4b..6a1a8c1 100644
--- a/blas/PackedTriangularSolverVector.h
+++ b/blas/PackedTriangularSolverVector.h
@@ -12,77 +12,63 @@
 
 namespace internal {
 
-template<typename LhsScalar, typename RhsScalar, typename Index, int Side, int Mode, bool Conjugate, int StorageOrder>
+template <typename LhsScalar, typename RhsScalar, typename Index, int Side, int Mode, bool Conjugate, int StorageOrder>
 struct packed_triangular_solve_vector;
 
 // forward and backward substitution, row-major, rhs is a vector
-template<typename LhsScalar, typename RhsScalar, typename Index, int Mode, bool Conjugate>
-struct packed_triangular_solve_vector<LhsScalar, RhsScalar, Index, OnTheLeft, Mode, Conjugate, RowMajor>
-{
-  enum {
-    IsLower = (Mode&Lower)==Lower
-  };
-  static void run(Index size, const LhsScalar* lhs, RhsScalar* rhs)
-  {
+template <typename LhsScalar, typename RhsScalar, typename Index, int Mode, bool Conjugate>
+struct packed_triangular_solve_vector<LhsScalar, RhsScalar, Index, OnTheLeft, Mode, Conjugate, RowMajor> {
+  enum { IsLower = (Mode & Lower) == Lower };
+  static void run(Index size, const LhsScalar* lhs, RhsScalar* rhs) {
     internal::conj_if<Conjugate> cj;
-    typedef Map<const Matrix<LhsScalar,Dynamic,1> > LhsMap;
-    typedef typename conj_expr_if<Conjugate,LhsMap>::type ConjLhsType;
+    typedef Map<const Matrix<LhsScalar, Dynamic, 1> > LhsMap;
+    typedef typename conj_expr_if<Conjugate, LhsMap>::type ConjLhsType;
 
-    lhs += IsLower ? 0 : (size*(size+1)>>1)-1;
-    for(Index pi=0; pi<size; ++pi)
-    {
-      Index i = IsLower ? pi : size-pi-1;
+    lhs += IsLower ? 0 : (size * (size + 1) >> 1) - 1;
+    for (Index pi = 0; pi < size; ++pi) {
+      Index i = IsLower ? pi : size - pi - 1;
       Index s = IsLower ? 0 : 1;
-      if (pi>0)
-	rhs[i] -= (ConjLhsType(LhsMap(lhs+s,pi))
-	    .cwiseProduct(Map<const Matrix<RhsScalar,Dynamic,1> >(rhs+(IsLower ? 0 : i+1),pi))).sum();
-      if (!(Mode & UnitDiag))
-	rhs[i] /= cj(lhs[IsLower ? i : 0]);
-      IsLower ? lhs += pi+1 : lhs -= pi+2;
+      if (pi > 0)
+        rhs[i] -= (ConjLhsType(LhsMap(lhs + s, pi))
+                       .cwiseProduct(Map<const Matrix<RhsScalar, Dynamic, 1> >(rhs + (IsLower ? 0 : i + 1), pi)))
+                      .sum();
+      if (!(Mode & UnitDiag)) rhs[i] /= cj(lhs[IsLower ? i : 0]);
+      IsLower ? lhs += pi + 1 : lhs -= pi + 2;
     }
   }
 };
 
 // forward and backward substitution, column-major, rhs is a vector
-template<typename LhsScalar, typename RhsScalar, typename Index, int Mode, bool Conjugate>
-struct packed_triangular_solve_vector<LhsScalar, RhsScalar, Index, OnTheLeft, Mode, Conjugate, ColMajor>
-{
-  enum {
-    IsLower = (Mode&Lower)==Lower
-  };
-  static void run(Index size, const LhsScalar* lhs, RhsScalar* rhs)
-  {
+template <typename LhsScalar, typename RhsScalar, typename Index, int Mode, bool Conjugate>
+struct packed_triangular_solve_vector<LhsScalar, RhsScalar, Index, OnTheLeft, Mode, Conjugate, ColMajor> {
+  enum { IsLower = (Mode & Lower) == Lower };
+  static void run(Index size, const LhsScalar* lhs, RhsScalar* rhs) {
     internal::conj_if<Conjugate> cj;
-    typedef Map<const Matrix<LhsScalar,Dynamic,1> > LhsMap;
-    typedef typename conj_expr_if<Conjugate,LhsMap>::type ConjLhsType;
+    typedef Map<const Matrix<LhsScalar, Dynamic, 1> > LhsMap;
+    typedef typename conj_expr_if<Conjugate, LhsMap>::type ConjLhsType;
 
-    lhs += IsLower ? 0 : size*(size-1)>>1;
-    for(Index pi=0; pi<size; ++pi)
-    {
-      Index i = IsLower ? pi : size-pi-1;
+    lhs += IsLower ? 0 : size * (size - 1) >> 1;
+    for (Index pi = 0; pi < size; ++pi) {
+      Index i = IsLower ? pi : size - pi - 1;
       Index r = size - pi - 1;
-      if (!(Mode & UnitDiag))
-	rhs[i] /= cj(lhs[IsLower ? 0 : i]);
-      if (r>0)
-	Map<Matrix<RhsScalar,Dynamic,1> >(rhs+(IsLower? i+1 : 0),r) -=
-	    rhs[i] * ConjLhsType(LhsMap(lhs+(IsLower? 1 : 0),r));
-      IsLower ? lhs += size-pi : lhs -= r;
+      if (!(Mode & UnitDiag)) rhs[i] /= cj(lhs[IsLower ? 0 : i]);
+      if (r > 0)
+        Map<Matrix<RhsScalar, Dynamic, 1> >(rhs + (IsLower ? i + 1 : 0), r) -=
+            rhs[i] * ConjLhsType(LhsMap(lhs + (IsLower ? 1 : 0), r));
+      IsLower ? lhs += size - pi : lhs -= r;
     }
   }
 };
 
-template<typename LhsScalar, typename RhsScalar, typename Index, int Mode, bool Conjugate, int StorageOrder>
-struct packed_triangular_solve_vector<LhsScalar, RhsScalar, Index, OnTheRight, Mode, Conjugate, StorageOrder>
-{
-  static void run(Index size, const LhsScalar* lhs, RhsScalar* rhs)
-  {
-    packed_triangular_solve_vector<LhsScalar,RhsScalar,Index,OnTheLeft,
-	((Mode&Upper)==Upper ? Lower : Upper) | (Mode&UnitDiag),
-	Conjugate,StorageOrder==RowMajor?ColMajor:RowMajor
-      >::run(size, lhs, rhs);
+template <typename LhsScalar, typename RhsScalar, typename Index, int Mode, bool Conjugate, int StorageOrder>
+struct packed_triangular_solve_vector<LhsScalar, RhsScalar, Index, OnTheRight, Mode, Conjugate, StorageOrder> {
+  static void run(Index size, const LhsScalar* lhs, RhsScalar* rhs) {
+    packed_triangular_solve_vector<LhsScalar, RhsScalar, Index, OnTheLeft,
+                                   ((Mode & Upper) == Upper ? Lower : Upper) | (Mode & UnitDiag), Conjugate,
+                                   StorageOrder == RowMajor ? ColMajor : RowMajor>::run(size, lhs, rhs);
   }
 };
 
-} // end namespace internal
+}  // end namespace internal
 
-#endif // EIGEN_PACKED_TRIANGULAR_SOLVER_VECTOR_H
+#endif  // EIGEN_PACKED_TRIANGULAR_SOLVER_VECTOR_H
diff --git a/blas/Rank2Update.h b/blas/Rank2Update.h
index 138d70f..e5046cf 100644
--- a/blas/Rank2Update.h
+++ b/blas/Rank2Update.h
@@ -15,17 +15,16 @@
 /* Optimized selfadjoint matrix += alpha * uv' + conj(alpha)*vu'
  * This is the low-level version of SelfadjointRank2Update.h
  */
-template<typename Scalar, typename Index, int UpLo>
-struct rank2_update_selector
-{
-  static void run(Index size, Scalar* mat, Index stride, const Scalar* u, const Scalar* v, Scalar alpha)
-  {
-    typedef Map<const Matrix<Scalar,Dynamic,1> > OtherMap;
-    for (Index i=0; i<size; ++i)
-    {
-      Map<Matrix<Scalar,Dynamic,1> >(mat+stride*i+(UpLo==Lower ? i : 0), UpLo==Lower ? size-i : (i+1)) +=
-      numext::conj(alpha) * numext::conj(u[i]) * OtherMap(v+(UpLo==Lower ? i : 0), UpLo==Lower ? size-i : (i+1))
-                + alpha * numext::conj(v[i]) * OtherMap(u+(UpLo==Lower ? i : 0), UpLo==Lower ? size-i : (i+1));
+template <typename Scalar, typename Index, int UpLo>
+struct rank2_update_selector {
+  static void run(Index size, Scalar* mat, Index stride, const Scalar* u, const Scalar* v, Scalar alpha) {
+    typedef Map<const Matrix<Scalar, Dynamic, 1> > OtherMap;
+    for (Index i = 0; i < size; ++i) {
+      Map<Matrix<Scalar, Dynamic, 1> >(mat + stride * i + (UpLo == Lower ? i : 0),
+                                       UpLo == Lower ? size - i : (i + 1)) +=
+          numext::conj(alpha) * numext::conj(u[i]) *
+              OtherMap(v + (UpLo == Lower ? i : 0), UpLo == Lower ? size - i : (i + 1)) +
+          alpha * numext::conj(v[i]) * OtherMap(u + (UpLo == Lower ? i : 0), UpLo == Lower ? size - i : (i + 1));
     }
   }
 };
@@ -33,25 +32,23 @@
 /* Optimized selfadjoint matrix += alpha * uv' + conj(alpha)*vu'
  * The matrix is in packed form.
  */
-template<typename Scalar, typename Index, int UpLo>
-struct packed_rank2_update_selector
-{
-  static void run(Index size, Scalar* mat, const Scalar* u, const Scalar* v, Scalar alpha)
-  {
-    typedef Map<const Matrix<Scalar,Dynamic,1> > OtherMap;
+template <typename Scalar, typename Index, int UpLo>
+struct packed_rank2_update_selector {
+  static void run(Index size, Scalar* mat, const Scalar* u, const Scalar* v, Scalar alpha) {
+    typedef Map<const Matrix<Scalar, Dynamic, 1> > OtherMap;
     Index offset = 0;
-    for (Index i=0; i<size; ++i)
-    {
-      Map<Matrix<Scalar,Dynamic,1> >(mat+offset, UpLo==Lower ? size-i : (i+1)) +=
-      numext::conj(alpha) * numext::conj(u[i]) * OtherMap(v+(UpLo==Lower ? i : 0), UpLo==Lower ? size-i : (i+1))
-                + alpha * numext::conj(v[i]) * OtherMap(u+(UpLo==Lower ? i : 0), UpLo==Lower ? size-i : (i+1));
-      //FIXME This should be handled outside.
-      mat[offset+(UpLo==Lower ? 0 : i)] = numext::real(mat[offset+(UpLo==Lower ? 0 : i)]);
-      offset += UpLo==Lower ? size-i : (i+1);
+    for (Index i = 0; i < size; ++i) {
+      Map<Matrix<Scalar, Dynamic, 1> >(mat + offset, UpLo == Lower ? size - i : (i + 1)) +=
+          numext::conj(alpha) * numext::conj(u[i]) *
+              OtherMap(v + (UpLo == Lower ? i : 0), UpLo == Lower ? size - i : (i + 1)) +
+          alpha * numext::conj(v[i]) * OtherMap(u + (UpLo == Lower ? i : 0), UpLo == Lower ? size - i : (i + 1));
+      // FIXME This should be handled outside.
+      mat[offset + (UpLo == Lower ? 0 : i)] = numext::real(mat[offset + (UpLo == Lower ? 0 : i)]);
+      offset += UpLo == Lower ? size - i : (i + 1);
     }
   }
 };
 
-} // end namespace internal
+}  // end namespace internal
 
-#endif // EIGEN_RANK2UPDATE_H
+#endif  // EIGEN_RANK2UPDATE_H
diff --git a/blas/blas.h b/blas/blas.h
index 25215b1..69a9262 100644
--- a/blas/blas.h
+++ b/blas/blas.h
@@ -2,8 +2,7 @@
 #define BLAS_H
 
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
 
 #define BLASFUNC(FUNC) FUNC##_
@@ -16,422 +15,454 @@
 typedef unsigned long BLASULONG;
 #endif
 
-int    BLASFUNC(xerbla)(const char *, int *info, int);
+int BLASFUNC(xerbla)(const char *, int *info, int);
 
-float  BLASFUNC(sdot)  (int *, float  *, int *, float  *, int *);
-float  BLASFUNC(sdsdot)(int *, float  *,        float  *, int *, float  *, int *);
+float BLASFUNC(sdot)(int *, float *, int *, float *, int *);
+float BLASFUNC(sdsdot)(int *, float *, float *, int *, float *, int *);
 
-double BLASFUNC(dsdot) (int *, float  *, int *, float  *, int *);
-double BLASFUNC(ddot)  (int *, double *, int *, double *, int *);
-double BLASFUNC(qdot)  (int *, double *, int *, double *, int *);
+double BLASFUNC(dsdot)(int *, float *, int *, float *, int *);
+double BLASFUNC(ddot)(int *, double *, int *, double *, int *);
+double BLASFUNC(qdot)(int *, double *, int *, double *, int *);
 
-int  BLASFUNC(cdotuw)  (int *, float  *, int *, float  *, int *, float*);
-int  BLASFUNC(cdotcw)  (int *, float  *, int *, float  *, int *, float*);
-int  BLASFUNC(zdotuw)  (int *, double  *, int *, double  *, int *, double*);
-int  BLASFUNC(zdotcw)  (int *, double  *, int *, double  *, int *, double*);
+int BLASFUNC(cdotuw)(int *, float *, int *, float *, int *, float *);
+int BLASFUNC(cdotcw)(int *, float *, int *, float *, int *, float *);
+int BLASFUNC(zdotuw)(int *, double *, int *, double *, int *, double *);
+int BLASFUNC(zdotcw)(int *, double *, int *, double *, int *, double *);
 
-int    BLASFUNC(saxpy) (const int *, const float  *, const float  *, const int *, float  *, const int *);
-int    BLASFUNC(daxpy) (const int *, const double *, const double *, const int *, double *, const int *);
-int    BLASFUNC(qaxpy) (const int *, const double *, const double *, const int *, double *, const int *);
-int    BLASFUNC(caxpy) (const int *, const float  *, const float  *, const int *, float  *, const int *);
-int    BLASFUNC(zaxpy) (const int *, const double *, const double *, const int *, double *, const int *);
-int    BLASFUNC(xaxpy) (const int *, const double *, const double *, const int *, double *, const int *);
-int    BLASFUNC(caxpyc)(const int *, const float  *, const float  *, const int *, float  *, const int *);
-int    BLASFUNC(zaxpyc)(const int *, const double *, const double *, const int *, double *, const int *);
-int    BLASFUNC(xaxpyc)(const int *, const double *, const double *, const int *, double *, const int *);
+int BLASFUNC(saxpy)(const int *, const float *, const float *, const int *, float *, const int *);
+int BLASFUNC(daxpy)(const int *, const double *, const double *, const int *, double *, const int *);
+int BLASFUNC(qaxpy)(const int *, const double *, const double *, const int *, double *, const int *);
+int BLASFUNC(caxpy)(const int *, const float *, const float *, const int *, float *, const int *);
+int BLASFUNC(zaxpy)(const int *, const double *, const double *, const int *, double *, const int *);
+int BLASFUNC(xaxpy)(const int *, const double *, const double *, const int *, double *, const int *);
+int BLASFUNC(caxpyc)(const int *, const float *, const float *, const int *, float *, const int *);
+int BLASFUNC(zaxpyc)(const int *, const double *, const double *, const int *, double *, const int *);
+int BLASFUNC(xaxpyc)(const int *, const double *, const double *, const int *, double *, const int *);
 
-int    BLASFUNC(scopy) (int *, float  *, int *, float  *, int *);
-int    BLASFUNC(dcopy) (int *, double *, int *, double *, int *);
-int    BLASFUNC(qcopy) (int *, double *, int *, double *, int *);
-int    BLASFUNC(ccopy) (int *, float  *, int *, float  *, int *);
-int    BLASFUNC(zcopy) (int *, double *, int *, double *, int *);
-int    BLASFUNC(xcopy) (int *, double *, int *, double *, int *);
+int BLASFUNC(scopy)(int *, float *, int *, float *, int *);
+int BLASFUNC(dcopy)(int *, double *, int *, double *, int *);
+int BLASFUNC(qcopy)(int *, double *, int *, double *, int *);
+int BLASFUNC(ccopy)(int *, float *, int *, float *, int *);
+int BLASFUNC(zcopy)(int *, double *, int *, double *, int *);
+int BLASFUNC(xcopy)(int *, double *, int *, double *, int *);
 
-int    BLASFUNC(sswap) (int *, float  *, int *, float  *, int *);
-int    BLASFUNC(dswap) (int *, double *, int *, double *, int *);
-int    BLASFUNC(qswap) (int *, double *, int *, double *, int *);
-int    BLASFUNC(cswap) (int *, float  *, int *, float  *, int *);
-int    BLASFUNC(zswap) (int *, double *, int *, double *, int *);
-int    BLASFUNC(xswap) (int *, double *, int *, double *, int *);
+int BLASFUNC(sswap)(int *, float *, int *, float *, int *);
+int BLASFUNC(dswap)(int *, double *, int *, double *, int *);
+int BLASFUNC(qswap)(int *, double *, int *, double *, int *);
+int BLASFUNC(cswap)(int *, float *, int *, float *, int *);
+int BLASFUNC(zswap)(int *, double *, int *, double *, int *);
+int BLASFUNC(xswap)(int *, double *, int *, double *, int *);
 
-float  BLASFUNC(sasum) (int *, float  *, int *);
-float  BLASFUNC(scasum)(int *, float  *, int *);
-double BLASFUNC(dasum) (int *, double *, int *);
-double BLASFUNC(qasum) (int *, double *, int *);
+float BLASFUNC(sasum)(int *, float *, int *);
+float BLASFUNC(scasum)(int *, float *, int *);
+double BLASFUNC(dasum)(int *, double *, int *);
+double BLASFUNC(qasum)(int *, double *, int *);
 double BLASFUNC(dzasum)(int *, double *, int *);
 double BLASFUNC(qxasum)(int *, double *, int *);
 
-int    BLASFUNC(isamax)(int *, float  *, int *);
-int    BLASFUNC(idamax)(int *, double *, int *);
-int    BLASFUNC(iqamax)(int *, double *, int *);
-int    BLASFUNC(icamax)(int *, float  *, int *);
-int    BLASFUNC(izamax)(int *, double *, int *);
-int    BLASFUNC(ixamax)(int *, double *, int *);
+int BLASFUNC(isamax)(int *, float *, int *);
+int BLASFUNC(idamax)(int *, double *, int *);
+int BLASFUNC(iqamax)(int *, double *, int *);
+int BLASFUNC(icamax)(int *, float *, int *);
+int BLASFUNC(izamax)(int *, double *, int *);
+int BLASFUNC(ixamax)(int *, double *, int *);
 
-int    BLASFUNC(ismax) (int *, float  *, int *);
-int    BLASFUNC(idmax) (int *, double *, int *);
-int    BLASFUNC(iqmax) (int *, double *, int *);
-int    BLASFUNC(icmax) (int *, float  *, int *);
-int    BLASFUNC(izmax) (int *, double *, int *);
-int    BLASFUNC(ixmax) (int *, double *, int *);
+int BLASFUNC(ismax)(int *, float *, int *);
+int BLASFUNC(idmax)(int *, double *, int *);
+int BLASFUNC(iqmax)(int *, double *, int *);
+int BLASFUNC(icmax)(int *, float *, int *);
+int BLASFUNC(izmax)(int *, double *, int *);
+int BLASFUNC(ixmax)(int *, double *, int *);
 
-int    BLASFUNC(isamin)(int *, float  *, int *);
-int    BLASFUNC(idamin)(int *, double *, int *);
-int    BLASFUNC(iqamin)(int *, double *, int *);
-int    BLASFUNC(icamin)(int *, float  *, int *);
-int    BLASFUNC(izamin)(int *, double *, int *);
-int    BLASFUNC(ixamin)(int *, double *, int *);
+int BLASFUNC(isamin)(int *, float *, int *);
+int BLASFUNC(idamin)(int *, double *, int *);
+int BLASFUNC(iqamin)(int *, double *, int *);
+int BLASFUNC(icamin)(int *, float *, int *);
+int BLASFUNC(izamin)(int *, double *, int *);
+int BLASFUNC(ixamin)(int *, double *, int *);
 
-int    BLASFUNC(ismin)(int *, float  *, int *);
-int    BLASFUNC(idmin)(int *, double *, int *);
-int    BLASFUNC(iqmin)(int *, double *, int *);
-int    BLASFUNC(icmin)(int *, float  *, int *);
-int    BLASFUNC(izmin)(int *, double *, int *);
-int    BLASFUNC(ixmin)(int *, double *, int *);
+int BLASFUNC(ismin)(int *, float *, int *);
+int BLASFUNC(idmin)(int *, double *, int *);
+int BLASFUNC(iqmin)(int *, double *, int *);
+int BLASFUNC(icmin)(int *, float *, int *);
+int BLASFUNC(izmin)(int *, double *, int *);
+int BLASFUNC(ixmin)(int *, double *, int *);
 
-float  BLASFUNC(samax) (int *, float  *, int *);
-double BLASFUNC(damax) (int *, double *, int *);
-double BLASFUNC(qamax) (int *, double *, int *);
-float  BLASFUNC(scamax)(int *, float  *, int *);
+float BLASFUNC(samax)(int *, float *, int *);
+double BLASFUNC(damax)(int *, double *, int *);
+double BLASFUNC(qamax)(int *, double *, int *);
+float BLASFUNC(scamax)(int *, float *, int *);
 double BLASFUNC(dzamax)(int *, double *, int *);
 double BLASFUNC(qxamax)(int *, double *, int *);
 
-float  BLASFUNC(samin) (int *, float  *, int *);
-double BLASFUNC(damin) (int *, double *, int *);
-double BLASFUNC(qamin) (int *, double *, int *);
-float  BLASFUNC(scamin)(int *, float  *, int *);
+float BLASFUNC(samin)(int *, float *, int *);
+double BLASFUNC(damin)(int *, double *, int *);
+double BLASFUNC(qamin)(int *, double *, int *);
+float BLASFUNC(scamin)(int *, float *, int *);
 double BLASFUNC(dzamin)(int *, double *, int *);
 double BLASFUNC(qxamin)(int *, double *, int *);
 
-float  BLASFUNC(smax)  (int *, float  *, int *);
-double BLASFUNC(dmax)  (int *, double *, int *);
-double BLASFUNC(qmax)  (int *, double *, int *);
-float  BLASFUNC(scmax) (int *, float  *, int *);
-double BLASFUNC(dzmax) (int *, double *, int *);
-double BLASFUNC(qxmax) (int *, double *, int *);
+float BLASFUNC(smax)(int *, float *, int *);
+double BLASFUNC(dmax)(int *, double *, int *);
+double BLASFUNC(qmax)(int *, double *, int *);
+float BLASFUNC(scmax)(int *, float *, int *);
+double BLASFUNC(dzmax)(int *, double *, int *);
+double BLASFUNC(qxmax)(int *, double *, int *);
 
-float  BLASFUNC(smin)  (int *, float  *, int *);
-double BLASFUNC(dmin)  (int *, double *, int *);
-double BLASFUNC(qmin)  (int *, double *, int *);
-float  BLASFUNC(scmin) (int *, float  *, int *);
-double BLASFUNC(dzmin) (int *, double *, int *);
-double BLASFUNC(qxmin) (int *, double *, int *);
+float BLASFUNC(smin)(int *, float *, int *);
+double BLASFUNC(dmin)(int *, double *, int *);
+double BLASFUNC(qmin)(int *, double *, int *);
+float BLASFUNC(scmin)(int *, float *, int *);
+double BLASFUNC(dzmin)(int *, double *, int *);
+double BLASFUNC(qxmin)(int *, double *, int *);
 
-int    BLASFUNC(sscal) (int *,  float  *, float  *, int *);
-int    BLASFUNC(dscal) (int *,  double *, double *, int *);
-int    BLASFUNC(qscal) (int *,  double *, double *, int *);
-int    BLASFUNC(cscal) (int *,  float  *, float  *, int *);
-int    BLASFUNC(zscal) (int *,  double *, double *, int *);
-int    BLASFUNC(xscal) (int *,  double *, double *, int *);
-int    BLASFUNC(csscal)(int *,  float  *, float  *, int *);
-int    BLASFUNC(zdscal)(int *,  double *, double *, int *);
-int    BLASFUNC(xqscal)(int *,  double *, double *, int *);
+int BLASFUNC(sscal)(int *, float *, float *, int *);
+int BLASFUNC(dscal)(int *, double *, double *, int *);
+int BLASFUNC(qscal)(int *, double *, double *, int *);
+int BLASFUNC(cscal)(int *, float *, float *, int *);
+int BLASFUNC(zscal)(int *, double *, double *, int *);
+int BLASFUNC(xscal)(int *, double *, double *, int *);
+int BLASFUNC(csscal)(int *, float *, float *, int *);
+int BLASFUNC(zdscal)(int *, double *, double *, int *);
+int BLASFUNC(xqscal)(int *, double *, double *, int *);
 
-float  BLASFUNC(snrm2) (int *, float  *, int *);
-float  BLASFUNC(scnrm2)(int *, float  *, int *);
+float BLASFUNC(snrm2)(int *, float *, int *);
+float BLASFUNC(scnrm2)(int *, float *, int *);
 
-double BLASFUNC(dnrm2) (int *, double *, int *);
-double BLASFUNC(qnrm2) (int *, double *, int *);
+double BLASFUNC(dnrm2)(int *, double *, int *);
+double BLASFUNC(qnrm2)(int *, double *, int *);
 double BLASFUNC(dznrm2)(int *, double *, int *);
 double BLASFUNC(qxnrm2)(int *, double *, int *);
 
-int    BLASFUNC(srot)  (int *, float  *, int *, float  *, int *, float  *, float  *);
-int    BLASFUNC(drot)  (int *, double *, int *, double *, int *, double *, double *);
-int    BLASFUNC(qrot)  (int *, double *, int *, double *, int *, double *, double *);
-int    BLASFUNC(csrot) (int *, float  *, int *, float  *, int *, float  *, float  *);
-int    BLASFUNC(zdrot) (int *, double *, int *, double *, int *, double *, double *);
-int    BLASFUNC(xqrot) (int *, double *, int *, double *, int *, double *, double *);
+int BLASFUNC(srot)(int *, float *, int *, float *, int *, float *, float *);
+int BLASFUNC(drot)(int *, double *, int *, double *, int *, double *, double *);
+int BLASFUNC(qrot)(int *, double *, int *, double *, int *, double *, double *);
+int BLASFUNC(csrot)(int *, float *, int *, float *, int *, float *, float *);
+int BLASFUNC(zdrot)(int *, double *, int *, double *, int *, double *, double *);
+int BLASFUNC(xqrot)(int *, double *, int *, double *, int *, double *, double *);
 
-int    BLASFUNC(srotg) (float  *, float  *, float  *, float  *);
-int    BLASFUNC(drotg) (double *, double *, double *, double *);
-int    BLASFUNC(qrotg) (double *, double *, double *, double *);
-int    BLASFUNC(crotg) (float  *, float  *, float  *, float  *);
-int    BLASFUNC(zrotg) (double *, double *, double *, double *);
-int    BLASFUNC(xrotg) (double *, double *, double *, double *);
+int BLASFUNC(srotg)(float *, float *, float *, float *);
+int BLASFUNC(drotg)(double *, double *, double *, double *);
+int BLASFUNC(qrotg)(double *, double *, double *, double *);
+int BLASFUNC(crotg)(float *, float *, float *, float *);
+int BLASFUNC(zrotg)(double *, double *, double *, double *);
+int BLASFUNC(xrotg)(double *, double *, double *, double *);
 
-int    BLASFUNC(srotmg)(float  *, float  *, float  *, float  *, float  *);
-int    BLASFUNC(drotmg)(double *, double *, double *, double *, double *);
+int BLASFUNC(srotmg)(float *, float *, float *, float *, float *);
+int BLASFUNC(drotmg)(double *, double *, double *, double *, double *);
 
-int    BLASFUNC(srotm) (int *, float  *, int *, float  *, int *, float  *);
-int    BLASFUNC(drotm) (int *, double *, int *, double *, int *, double *);
-int    BLASFUNC(qrotm) (int *, double *, int *, double *, int *, double *);
+int BLASFUNC(srotm)(int *, float *, int *, float *, int *, float *);
+int BLASFUNC(drotm)(int *, double *, int *, double *, int *, double *);
+int BLASFUNC(qrotm)(int *, double *, int *, double *, int *, double *);
 
 /* Level 2 routines */
 
-int BLASFUNC(sger)(int *,    int *, float *,  float *, int *,
-		   float *,  int *, float *,  int *);
-int BLASFUNC(dger)(int *,    int *, double *, double *, int *,
-		   double *, int *, double *, int *);
-int BLASFUNC(qger)(int *,    int *, double *, double *, int *,
-		   double *, int *, double *, int *);
-int BLASFUNC(cgeru)(int *,    int *, float *,  float *, int *,
-		    float *,  int *, float *,  int *);
-int BLASFUNC(cgerc)(int *,    int *, float *,  float *, int *,
-		    float *,  int *, float *,  int *);
-int BLASFUNC(zgeru)(int *,    int *, double *, double *, int *,
-		    double *, int *, double *, int *);
-int BLASFUNC(zgerc)(int *,    int *, double *, double *, int *,
-		    double *, int *, double *, int *);
-int BLASFUNC(xgeru)(int *,    int *, double *, double *, int *,
-		    double *, int *, double *, int *);
-int BLASFUNC(xgerc)(int *,    int *, double *, double *, int *,
-		    double *, int *, double *, int *);
+int BLASFUNC(sger)(int *, int *, float *, float *, int *, float *, int *, float *, int *);
+int BLASFUNC(dger)(int *, int *, double *, double *, int *, double *, int *, double *, int *);
+int BLASFUNC(qger)(int *, int *, double *, double *, int *, double *, int *, double *, int *);
+int BLASFUNC(cgeru)(int *, int *, float *, float *, int *, float *, int *, float *, int *);
+int BLASFUNC(cgerc)(int *, int *, float *, float *, int *, float *, int *, float *, int *);
+int BLASFUNC(zgeru)(int *, int *, double *, double *, int *, double *, int *, double *, int *);
+int BLASFUNC(zgerc)(int *, int *, double *, double *, int *, double *, int *, double *, int *);
+int BLASFUNC(xgeru)(int *, int *, double *, double *, int *, double *, int *, double *, int *);
+int BLASFUNC(xgerc)(int *, int *, double *, double *, int *, double *, int *, double *, int *);
 
-int BLASFUNC(sgemv)(const char *, const int *, const int *, const float  *, const float  *, const int *, const float  *, const int *, const float  *, float  *, const int *);
-int BLASFUNC(dgemv)(const char *, const int *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
-int BLASFUNC(qgemv)(const char *, const int *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
-int BLASFUNC(cgemv)(const char *, const int *, const int *, const float  *, const float  *, const int *, const float  *, const int *, const float  *, float  *, const int *);
-int BLASFUNC(zgemv)(const char *, const int *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
-int BLASFUNC(xgemv)(const char *, const int *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
+int BLASFUNC(sgemv)(const char *, const int *, const int *, const float *, const float *, const int *, const float *,
+                    const int *, const float *, float *, const int *);
+int BLASFUNC(dgemv)(const char *, const int *, const int *, const double *, const double *, const int *, const double *,
+                    const int *, const double *, double *, const int *);
+int BLASFUNC(qgemv)(const char *, const int *, const int *, const double *, const double *, const int *, const double *,
+                    const int *, const double *, double *, const int *);
+int BLASFUNC(cgemv)(const char *, const int *, const int *, const float *, const float *, const int *, const float *,
+                    const int *, const float *, float *, const int *);
+int BLASFUNC(zgemv)(const char *, const int *, const int *, const double *, const double *, const int *, const double *,
+                    const int *, const double *, double *, const int *);
+int BLASFUNC(xgemv)(const char *, const int *, const int *, const double *, const double *, const int *, const double *,
+                    const int *, const double *, double *, const int *);
 
-int BLASFUNC(strsv) (const char *, const char *, const char *, const int *, const float  *, const int *, float  *, const int *);
-int BLASFUNC(dtrsv) (const char *, const char *, const char *, const int *, const double *, const int *, double *, const int *);
-int BLASFUNC(qtrsv) (const char *, const char *, const char *, const int *, const double *, const int *, double *, const int *);
-int BLASFUNC(ctrsv) (const char *, const char *, const char *, const int *, const float  *, const int *, float  *, const int *);
-int BLASFUNC(ztrsv) (const char *, const char *, const char *, const int *, const double *, const int *, double *, const int *);
-int BLASFUNC(xtrsv) (const char *, const char *, const char *, const int *, const double *, const int *, double *, const int *);
+int BLASFUNC(strsv)(const char *, const char *, const char *, const int *, const float *, const int *, float *,
+                    const int *);
+int BLASFUNC(dtrsv)(const char *, const char *, const char *, const int *, const double *, const int *, double *,
+                    const int *);
+int BLASFUNC(qtrsv)(const char *, const char *, const char *, const int *, const double *, const int *, double *,
+                    const int *);
+int BLASFUNC(ctrsv)(const char *, const char *, const char *, const int *, const float *, const int *, float *,
+                    const int *);
+int BLASFUNC(ztrsv)(const char *, const char *, const char *, const int *, const double *, const int *, double *,
+                    const int *);
+int BLASFUNC(xtrsv)(const char *, const char *, const char *, const int *, const double *, const int *, double *,
+                    const int *);
 
-int BLASFUNC(stpsv) (char *, char *, char *, int *, float  *, float  *, int *);
-int BLASFUNC(dtpsv) (char *, char *, char *, int *, double *, double *, int *);
-int BLASFUNC(qtpsv) (char *, char *, char *, int *, double *, double *, int *);
-int BLASFUNC(ctpsv) (char *, char *, char *, int *, float  *, float  *, int *);
-int BLASFUNC(ztpsv) (char *, char *, char *, int *, double *, double *, int *);
-int BLASFUNC(xtpsv) (char *, char *, char *, int *, double *, double *, int *);
+int BLASFUNC(stpsv)(char *, char *, char *, int *, float *, float *, int *);
+int BLASFUNC(dtpsv)(char *, char *, char *, int *, double *, double *, int *);
+int BLASFUNC(qtpsv)(char *, char *, char *, int *, double *, double *, int *);
+int BLASFUNC(ctpsv)(char *, char *, char *, int *, float *, float *, int *);
+int BLASFUNC(ztpsv)(char *, char *, char *, int *, double *, double *, int *);
+int BLASFUNC(xtpsv)(char *, char *, char *, int *, double *, double *, int *);
 
-int BLASFUNC(strmv) (const char *, const char *, const char *, const int *, const float  *, const int *, float  *, const int *);
-int BLASFUNC(dtrmv) (const char *, const char *, const char *, const int *, const double *, const int *, double *, const int *);
-int BLASFUNC(qtrmv) (const char *, const char *, const char *, const int *, const double *, const int *, double *, const int *);
-int BLASFUNC(ctrmv) (const char *, const char *, const char *, const int *, const float  *, const int *, float  *, const int *);
-int BLASFUNC(ztrmv) (const char *, const char *, const char *, const int *, const double *, const int *, double *, const int *);
-int BLASFUNC(xtrmv) (const char *, const char *, const char *, const int *, const double *, const int *, double *, const int *);
+int BLASFUNC(strmv)(const char *, const char *, const char *, const int *, const float *, const int *, float *,
+                    const int *);
+int BLASFUNC(dtrmv)(const char *, const char *, const char *, const int *, const double *, const int *, double *,
+                    const int *);
+int BLASFUNC(qtrmv)(const char *, const char *, const char *, const int *, const double *, const int *, double *,
+                    const int *);
+int BLASFUNC(ctrmv)(const char *, const char *, const char *, const int *, const float *, const int *, float *,
+                    const int *);
+int BLASFUNC(ztrmv)(const char *, const char *, const char *, const int *, const double *, const int *, double *,
+                    const int *);
+int BLASFUNC(xtrmv)(const char *, const char *, const char *, const int *, const double *, const int *, double *,
+                    const int *);
 
-int BLASFUNC(stpmv) (char *, char *, char *, int *, float  *, float  *, int *);
-int BLASFUNC(dtpmv) (char *, char *, char *, int *, double *, double *, int *);
-int BLASFUNC(qtpmv) (char *, char *, char *, int *, double *, double *, int *);
-int BLASFUNC(ctpmv) (char *, char *, char *, int *, float  *, float  *, int *);
-int BLASFUNC(ztpmv) (char *, char *, char *, int *, double *, double *, int *);
-int BLASFUNC(xtpmv) (char *, char *, char *, int *, double *, double *, int *);
+int BLASFUNC(stpmv)(char *, char *, char *, int *, float *, float *, int *);
+int BLASFUNC(dtpmv)(char *, char *, char *, int *, double *, double *, int *);
+int BLASFUNC(qtpmv)(char *, char *, char *, int *, double *, double *, int *);
+int BLASFUNC(ctpmv)(char *, char *, char *, int *, float *, float *, int *);
+int BLASFUNC(ztpmv)(char *, char *, char *, int *, double *, double *, int *);
+int BLASFUNC(xtpmv)(char *, char *, char *, int *, double *, double *, int *);
 
-int BLASFUNC(stbmv) (char *, char *, char *, int *, int *, float  *, int *, float  *, int *);
-int BLASFUNC(dtbmv) (char *, char *, char *, int *, int *, double *, int *, double *, int *);
-int BLASFUNC(qtbmv) (char *, char *, char *, int *, int *, double *, int *, double *, int *);
-int BLASFUNC(ctbmv) (char *, char *, char *, int *, int *, float  *, int *, float  *, int *);
-int BLASFUNC(ztbmv) (char *, char *, char *, int *, int *, double *, int *, double *, int *);
-int BLASFUNC(xtbmv) (char *, char *, char *, int *, int *, double *, int *, double *, int *);
+int BLASFUNC(stbmv)(char *, char *, char *, int *, int *, float *, int *, float *, int *);
+int BLASFUNC(dtbmv)(char *, char *, char *, int *, int *, double *, int *, double *, int *);
+int BLASFUNC(qtbmv)(char *, char *, char *, int *, int *, double *, int *, double *, int *);
+int BLASFUNC(ctbmv)(char *, char *, char *, int *, int *, float *, int *, float *, int *);
+int BLASFUNC(ztbmv)(char *, char *, char *, int *, int *, double *, int *, double *, int *);
+int BLASFUNC(xtbmv)(char *, char *, char *, int *, int *, double *, int *, double *, int *);
 
-int BLASFUNC(stbsv) (char *, char *, char *, int *, int *, float  *, int *, float  *, int *);
-int BLASFUNC(dtbsv) (char *, char *, char *, int *, int *, double *, int *, double *, int *);
-int BLASFUNC(qtbsv) (char *, char *, char *, int *, int *, double *, int *, double *, int *);
-int BLASFUNC(ctbsv) (char *, char *, char *, int *, int *, float  *, int *, float  *, int *);
-int BLASFUNC(ztbsv) (char *, char *, char *, int *, int *, double *, int *, double *, int *);
-int BLASFUNC(xtbsv) (char *, char *, char *, int *, int *, double *, int *, double *, int *);
+int BLASFUNC(stbsv)(char *, char *, char *, int *, int *, float *, int *, float *, int *);
+int BLASFUNC(dtbsv)(char *, char *, char *, int *, int *, double *, int *, double *, int *);
+int BLASFUNC(qtbsv)(char *, char *, char *, int *, int *, double *, int *, double *, int *);
+int BLASFUNC(ctbsv)(char *, char *, char *, int *, int *, float *, int *, float *, int *);
+int BLASFUNC(ztbsv)(char *, char *, char *, int *, int *, double *, int *, double *, int *);
+int BLASFUNC(xtbsv)(char *, char *, char *, int *, int *, double *, int *, double *, int *);
 
-int BLASFUNC(ssymv) (const char *, const int *, const float  *, const float  *, const int *, const float  *, const int *, const float  *, float  *, const int *);
-int BLASFUNC(dsymv) (const char *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
-int BLASFUNC(qsymv) (const char *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
+int BLASFUNC(ssymv)(const char *, const int *, const float *, const float *, const int *, const float *, const int *,
+                    const float *, float *, const int *);
+int BLASFUNC(dsymv)(const char *, const int *, const double *, const double *, const int *, const double *, const int *,
+                    const double *, double *, const int *);
+int BLASFUNC(qsymv)(const char *, const int *, const double *, const double *, const int *, const double *, const int *,
+                    const double *, double *, const int *);
 
-int BLASFUNC(sspmv) (char *, int *, float  *, float *,
-		     float  *, int *, float *, float *, int *);
-int BLASFUNC(dspmv) (char *, int *, double  *, double *,
-		     double  *, int *, double *, double *, int *);
-int BLASFUNC(qspmv) (char *, int *, double  *, double *,
-		     double  *, int *, double *, double *, int *);
+int BLASFUNC(sspmv)(char *, int *, float *, float *, float *, int *, float *, float *, int *);
+int BLASFUNC(dspmv)(char *, int *, double *, double *, double *, int *, double *, double *, int *);
+int BLASFUNC(qspmv)(char *, int *, double *, double *, double *, int *, double *, double *, int *);
 
-int BLASFUNC(ssyr) (const char *, const int *, const float   *, const float  *, const int *, float  *, const int *);
-int BLASFUNC(dsyr) (const char *, const int *, const double  *, const double *, const int *, double *, const int *);
-int BLASFUNC(qsyr) (const char *, const int *, const double  *, const double *, const int *, double *, const int *);
+int BLASFUNC(ssyr)(const char *, const int *, const float *, const float *, const int *, float *, const int *);
+int BLASFUNC(dsyr)(const char *, const int *, const double *, const double *, const int *, double *, const int *);
+int BLASFUNC(qsyr)(const char *, const int *, const double *, const double *, const int *, double *, const int *);
 
-int BLASFUNC(ssyr2) (const char *, const int *, const float   *, const float  *, const int *, const float  *, const int *, float  *, const int *);
-int BLASFUNC(dsyr2) (const char *, const int *, const double  *, const double *, const int *, const double *, const int *, double *, const int *);
-int BLASFUNC(qsyr2) (const char *, const int *, const double  *, const double *, const int *, const double *, const int *, double *, const int *);
-int BLASFUNC(csyr2) (const char *, const int *, const float   *, const float  *, const int *, const float  *, const int *, float  *, const int *);
-int BLASFUNC(zsyr2) (const char *, const int *, const double  *, const double *, const int *, const double *, const int *, double *, const int *);
-int BLASFUNC(xsyr2) (const char *, const int *, const double  *, const double *, const int *, const double *, const int *, double *, const int *);
+int BLASFUNC(ssyr2)(const char *, const int *, const float *, const float *, const int *, const float *, const int *,
+                    float *, const int *);
+int BLASFUNC(dsyr2)(const char *, const int *, const double *, const double *, const int *, const double *, const int *,
+                    double *, const int *);
+int BLASFUNC(qsyr2)(const char *, const int *, const double *, const double *, const int *, const double *, const int *,
+                    double *, const int *);
+int BLASFUNC(csyr2)(const char *, const int *, const float *, const float *, const int *, const float *, const int *,
+                    float *, const int *);
+int BLASFUNC(zsyr2)(const char *, const int *, const double *, const double *, const int *, const double *, const int *,
+                    double *, const int *);
+int BLASFUNC(xsyr2)(const char *, const int *, const double *, const double *, const int *, const double *, const int *,
+                    double *, const int *);
 
-int BLASFUNC(sspr) (char *, int *, float   *, float  *, int *,
-		    float  *);
-int BLASFUNC(dspr) (char *, int *, double  *, double *, int *,
-		    double *);
-int BLASFUNC(qspr) (char *, int *, double  *, double *, int *,
-		    double *);
+int BLASFUNC(sspr)(char *, int *, float *, float *, int *, float *);
+int BLASFUNC(dspr)(char *, int *, double *, double *, int *, double *);
+int BLASFUNC(qspr)(char *, int *, double *, double *, int *, double *);
 
-int BLASFUNC(sspr2) (char *, int *, float   *,
-		     float  *, int *, float  *, int *, float  *);
-int BLASFUNC(dspr2) (char *, int *, double  *,
-		     double *, int *, double *, int *, double *);
-int BLASFUNC(qspr2) (char *, int *, double  *,
-		     double *, int *, double *, int *, double *);
-int BLASFUNC(cspr2) (char *, int *, float   *,
-		     float  *, int *, float  *, int *, float  *);
-int BLASFUNC(zspr2) (char *, int *, double  *,
-		     double *, int *, double *, int *, double *);
-int BLASFUNC(xspr2) (char *, int *, double  *,
-		     double *, int *, double *, int *, double *);
+int BLASFUNC(sspr2)(char *, int *, float *, float *, int *, float *, int *, float *);
+int BLASFUNC(dspr2)(char *, int *, double *, double *, int *, double *, int *, double *);
+int BLASFUNC(qspr2)(char *, int *, double *, double *, int *, double *, int *, double *);
+int BLASFUNC(cspr2)(char *, int *, float *, float *, int *, float *, int *, float *);
+int BLASFUNC(zspr2)(char *, int *, double *, double *, int *, double *, int *, double *);
+int BLASFUNC(xspr2)(char *, int *, double *, double *, int *, double *, int *, double *);
 
-int BLASFUNC(cher) (char *, int *, float   *, float  *, int *,
-		    float  *, int *);
-int BLASFUNC(zher) (char *, int *, double  *, double *, int *,
-		    double *, int *);
-int BLASFUNC(xher) (char *, int *, double  *, double *, int *,
-		    double *, int *);
+int BLASFUNC(cher)(char *, int *, float *, float *, int *, float *, int *);
+int BLASFUNC(zher)(char *, int *, double *, double *, int *, double *, int *);
+int BLASFUNC(xher)(char *, int *, double *, double *, int *, double *, int *);
 
-int BLASFUNC(chpr) (char *, int *, float   *, float  *, int *, float  *);
-int BLASFUNC(zhpr) (char *, int *, double  *, double *, int *, double *);
-int BLASFUNC(xhpr) (char *, int *, double  *, double *, int *, double *);
+int BLASFUNC(chpr)(char *, int *, float *, float *, int *, float *);
+int BLASFUNC(zhpr)(char *, int *, double *, double *, int *, double *);
+int BLASFUNC(xhpr)(char *, int *, double *, double *, int *, double *);
 
-int BLASFUNC(cher2) (char *, int *, float   *,
-		     float  *, int *, float  *, int *, float  *, int *);
-int BLASFUNC(zher2) (char *, int *, double  *,
-		     double *, int *, double *, int *, double *, int *);
-int BLASFUNC(xher2) (char *, int *, double  *,
-		     double *, int *, double *, int *, double *, int *);
+int BLASFUNC(cher2)(char *, int *, float *, float *, int *, float *, int *, float *, int *);
+int BLASFUNC(zher2)(char *, int *, double *, double *, int *, double *, int *, double *, int *);
+int BLASFUNC(xher2)(char *, int *, double *, double *, int *, double *, int *, double *, int *);
 
-int BLASFUNC(chpr2) (char *, int *, float   *,
-		     float  *, int *, float  *, int *, float  *);
-int BLASFUNC(zhpr2) (char *, int *, double  *,
-		     double *, int *, double *, int *, double *);
-int BLASFUNC(xhpr2) (char *, int *, double  *,
-		     double *, int *, double *, int *, double *);
+int BLASFUNC(chpr2)(char *, int *, float *, float *, int *, float *, int *, float *);
+int BLASFUNC(zhpr2)(char *, int *, double *, double *, int *, double *, int *, double *);
+int BLASFUNC(xhpr2)(char *, int *, double *, double *, int *, double *, int *, double *);
 
-int BLASFUNC(chemv) (const char *, const int *, const float  *, const float  *, const int *, const float  *, const int *, const float  *, float  *, const int *);
-int BLASFUNC(zhemv) (const char *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
-int BLASFUNC(xhemv) (const char *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
+int BLASFUNC(chemv)(const char *, const int *, const float *, const float *, const int *, const float *, const int *,
+                    const float *, float *, const int *);
+int BLASFUNC(zhemv)(const char *, const int *, const double *, const double *, const int *, const double *, const int *,
+                    const double *, double *, const int *);
+int BLASFUNC(xhemv)(const char *, const int *, const double *, const double *, const int *, const double *, const int *,
+                    const double *, double *, const int *);
 
-int BLASFUNC(chpmv) (char *, int *, float  *, float *,
-		     float  *, int *, float *, float *, int *);
-int BLASFUNC(zhpmv) (char *, int *, double  *, double *,
-		     double  *, int *, double *, double *, int *);
-int BLASFUNC(xhpmv) (char *, int *, double  *, double *,
-		     double  *, int *, double *, double *, int *);
+int BLASFUNC(chpmv)(char *, int *, float *, float *, float *, int *, float *, float *, int *);
+int BLASFUNC(zhpmv)(char *, int *, double *, double *, double *, int *, double *, double *, int *);
+int BLASFUNC(xhpmv)(char *, int *, double *, double *, double *, int *, double *, double *, int *);
 
-int BLASFUNC(snorm)(char *, int *, int *, float  *, int *);
+int BLASFUNC(snorm)(char *, int *, int *, float *, int *);
 int BLASFUNC(dnorm)(char *, int *, int *, double *, int *);
-int BLASFUNC(cnorm)(char *, int *, int *, float  *, int *);
+int BLASFUNC(cnorm)(char *, int *, int *, float *, int *);
 int BLASFUNC(znorm)(char *, int *, int *, double *, int *);
 
-int BLASFUNC(sgbmv)(char *, int *, int *, int *, int *, float  *, float  *, int *,
-		    float  *, int *, float  *, float  *, int *);
-int BLASFUNC(dgbmv)(char *, int *, int *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
-int BLASFUNC(qgbmv)(char *, int *, int *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
-int BLASFUNC(cgbmv)(char *, int *, int *, int *, int *, float  *, float  *, int *,
-		    float  *, int *, float  *, float  *, int *);
-int BLASFUNC(zgbmv)(char *, int *, int *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
-int BLASFUNC(xgbmv)(char *, int *, int *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
+int BLASFUNC(sgbmv)(char *, int *, int *, int *, int *, float *, float *, int *, float *, int *, float *, float *,
+                    int *);
+int BLASFUNC(dgbmv)(char *, int *, int *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                    int *);
+int BLASFUNC(qgbmv)(char *, int *, int *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                    int *);
+int BLASFUNC(cgbmv)(char *, int *, int *, int *, int *, float *, float *, int *, float *, int *, float *, float *,
+                    int *);
+int BLASFUNC(zgbmv)(char *, int *, int *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                    int *);
+int BLASFUNC(xgbmv)(char *, int *, int *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                    int *);
 
-int BLASFUNC(ssbmv)(char *, int *, int *, float  *, float  *, int *,
-		    float  *, int *, float  *, float  *, int *);
-int BLASFUNC(dsbmv)(char *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
-int BLASFUNC(qsbmv)(char *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
-int BLASFUNC(csbmv)(char *, int *, int *, float  *, float  *, int *,
-		    float  *, int *, float  *, float  *, int *);
-int BLASFUNC(zsbmv)(char *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
-int BLASFUNC(xsbmv)(char *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
+int BLASFUNC(ssbmv)(char *, int *, int *, float *, float *, int *, float *, int *, float *, float *, int *);
+int BLASFUNC(dsbmv)(char *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
+int BLASFUNC(qsbmv)(char *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
+int BLASFUNC(csbmv)(char *, int *, int *, float *, float *, int *, float *, int *, float *, float *, int *);
+int BLASFUNC(zsbmv)(char *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
+int BLASFUNC(xsbmv)(char *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
 
-int BLASFUNC(chbmv)(char *, int *, int *, float  *, float  *, int *,
-		    float  *, int *, float  *, float  *, int *);
-int BLASFUNC(zhbmv)(char *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
-int BLASFUNC(xhbmv)(char *, int *, int *, double *, double *, int *,
-		    double *, int *, double *, double *, int *);
+int BLASFUNC(chbmv)(char *, int *, int *, float *, float *, int *, float *, int *, float *, float *, int *);
+int BLASFUNC(zhbmv)(char *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
+int BLASFUNC(xhbmv)(char *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
 
 /* Level 3 routines */
 
-int BLASFUNC(sgemm)(const char *, const char *, const int *, const int *, const int *, const float  *, const float  *, const int *, const float  *, const int *, const float  *, float  *, const int *);
-int BLASFUNC(dgemm)(const char *, const char *, const int *, const int *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
-int BLASFUNC(qgemm)(const char *, const char *, const int *, const int *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
-int BLASFUNC(cgemm)(const char *, const char *, const int *, const int *, const int *, const float  *, const float  *, const int *, const float  *, const int *, const float  *, float  *, const int *);
-int BLASFUNC(zgemm)(const char *, const char *, const int *, const int *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
-int BLASFUNC(xgemm)(const char *, const char *, const int *, const int *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
+int BLASFUNC(sgemm)(const char *, const char *, const int *, const int *, const int *, const float *, const float *,
+                    const int *, const float *, const int *, const float *, float *, const int *);
+int BLASFUNC(dgemm)(const char *, const char *, const int *, const int *, const int *, const double *, const double *,
+                    const int *, const double *, const int *, const double *, double *, const int *);
+int BLASFUNC(qgemm)(const char *, const char *, const int *, const int *, const int *, const double *, const double *,
+                    const int *, const double *, const int *, const double *, double *, const int *);
+int BLASFUNC(cgemm)(const char *, const char *, const int *, const int *, const int *, const float *, const float *,
+                    const int *, const float *, const int *, const float *, float *, const int *);
+int BLASFUNC(zgemm)(const char *, const char *, const int *, const int *, const int *, const double *, const double *,
+                    const int *, const double *, const int *, const double *, double *, const int *);
+int BLASFUNC(xgemm)(const char *, const char *, const int *, const int *, const int *, const double *, const double *,
+                    const int *, const double *, const int *, const double *, double *, const int *);
 
-int BLASFUNC(cgemm3m)(char *, char *, int *, int *, int *, float *,
-	   float  *, int *, float  *, int *, float  *, float  *, int *);
-int BLASFUNC(zgemm3m)(char *, char *, int *, int *, int *, double *,
-	   double *, int *, double *, int *, double *, double *, int *);
-int BLASFUNC(xgemm3m)(char *, char *, int *, int *, int *, double *,
-	   double *, int *, double *, int *, double *, double *, int *);
+int BLASFUNC(cgemm3m)(char *, char *, int *, int *, int *, float *, float *, int *, float *, int *, float *, float *,
+                      int *);
+int BLASFUNC(zgemm3m)(char *, char *, int *, int *, int *, double *, double *, int *, double *, int *, double *,
+                      double *, int *);
+int BLASFUNC(xgemm3m)(char *, char *, int *, int *, int *, double *, double *, int *, double *, int *, double *,
+                      double *, int *);
 
-int BLASFUNC(sge2mm)(char *, char *, char *, int *, int *,
-		     float *, float  *, int *, float  *, int *,
-		     float *, float  *, int *);
-int BLASFUNC(dge2mm)(char *, char *, char *, int *, int *,
-		     double *, double  *, int *, double  *, int *,
-		     double *, double  *, int *);
-int BLASFUNC(cge2mm)(char *, char *, char *, int *, int *,
-		     float *, float  *, int *, float  *, int *,
-		     float *, float  *, int *);
-int BLASFUNC(zge2mm)(char *, char *, char *, int *, int *,
-		     double *, double  *, int *, double  *, int *,
-		     double *, double  *, int *);
+int BLASFUNC(sge2mm)(char *, char *, char *, int *, int *, float *, float *, int *, float *, int *, float *, float *,
+                     int *);
+int BLASFUNC(dge2mm)(char *, char *, char *, int *, int *, double *, double *, int *, double *, int *, double *,
+                     double *, int *);
+int BLASFUNC(cge2mm)(char *, char *, char *, int *, int *, float *, float *, int *, float *, int *, float *, float *,
+                     int *);
+int BLASFUNC(zge2mm)(char *, char *, char *, int *, int *, double *, double *, int *, double *, int *, double *,
+                     double *, int *);
 
-int BLASFUNC(strsm)(const char *, const char *, const char *, const char *, const int *, const int *, const float *,  const float *,  const int *, float *,  const int *);
-int BLASFUNC(dtrsm)(const char *, const char *, const char *, const char *, const int *, const int *, const double *, const double *, const int *, double *, const int *);
-int BLASFUNC(qtrsm)(const char *, const char *, const char *, const char *, const int *, const int *, const double *, const double *, const int *, double *, const int *);
-int BLASFUNC(ctrsm)(const char *, const char *, const char *, const char *, const int *, const int *, const float *,  const float *,  const int *, float *,  const int *);
-int BLASFUNC(ztrsm)(const char *, const char *, const char *, const char *, const int *, const int *, const double *, const double *, const int *, double *, const int *);
-int BLASFUNC(xtrsm)(const char *, const char *, const char *, const char *, const int *, const int *, const double *, const double *, const int *, double *, const int *);
+int BLASFUNC(strsm)(const char *, const char *, const char *, const char *, const int *, const int *, const float *,
+                    const float *, const int *, float *, const int *);
+int BLASFUNC(dtrsm)(const char *, const char *, const char *, const char *, const int *, const int *, const double *,
+                    const double *, const int *, double *, const int *);
+int BLASFUNC(qtrsm)(const char *, const char *, const char *, const char *, const int *, const int *, const double *,
+                    const double *, const int *, double *, const int *);
+int BLASFUNC(ctrsm)(const char *, const char *, const char *, const char *, const int *, const int *, const float *,
+                    const float *, const int *, float *, const int *);
+int BLASFUNC(ztrsm)(const char *, const char *, const char *, const char *, const int *, const int *, const double *,
+                    const double *, const int *, double *, const int *);
+int BLASFUNC(xtrsm)(const char *, const char *, const char *, const char *, const int *, const int *, const double *,
+                    const double *, const int *, double *, const int *);
 
-int BLASFUNC(strmm)(const char *, const char *, const char *, const char *, const int *, const int *, const float *,  const float *,  const int *, float *,  const int *);
-int BLASFUNC(dtrmm)(const char *, const char *, const char *, const char *, const int *, const int *, const double *, const double *, const int *, double *, const int *);
-int BLASFUNC(qtrmm)(const char *, const char *, const char *, const char *, const int *, const int *, const double *, const double *, const int *, double *, const int *);
-int BLASFUNC(ctrmm)(const char *, const char *, const char *, const char *, const int *, const int *, const float *,  const float *,  const int *, float *,  const int *);
-int BLASFUNC(ztrmm)(const char *, const char *, const char *, const char *, const int *, const int *, const double *, const double *, const int *, double *, const int *);
-int BLASFUNC(xtrmm)(const char *, const char *, const char *, const char *, const int *, const int *, const double *, const double *, const int *, double *, const int *);
+int BLASFUNC(strmm)(const char *, const char *, const char *, const char *, const int *, const int *, const float *,
+                    const float *, const int *, float *, const int *);
+int BLASFUNC(dtrmm)(const char *, const char *, const char *, const char *, const int *, const int *, const double *,
+                    const double *, const int *, double *, const int *);
+int BLASFUNC(qtrmm)(const char *, const char *, const char *, const char *, const int *, const int *, const double *,
+                    const double *, const int *, double *, const int *);
+int BLASFUNC(ctrmm)(const char *, const char *, const char *, const char *, const int *, const int *, const float *,
+                    const float *, const int *, float *, const int *);
+int BLASFUNC(ztrmm)(const char *, const char *, const char *, const char *, const int *, const int *, const double *,
+                    const double *, const int *, double *, const int *);
+int BLASFUNC(xtrmm)(const char *, const char *, const char *, const char *, const int *, const int *, const double *,
+                    const double *, const int *, double *, const int *);
 
-int BLASFUNC(ssymm)(const char *, const char *, const int *, const int *, const float  *, const float  *, const int *, const float  *, const int *, const float  *, float  *, const int *);
-int BLASFUNC(dsymm)(const char *, const char *, const int *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
-int BLASFUNC(qsymm)(const char *, const char *, const int *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
-int BLASFUNC(csymm)(const char *, const char *, const int *, const int *, const float  *, const float  *, const int *, const float  *, const int *, const float  *, float  *, const int *);
-int BLASFUNC(zsymm)(const char *, const char *, const int *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
-int BLASFUNC(xsymm)(const char *, const char *, const int *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
+int BLASFUNC(ssymm)(const char *, const char *, const int *, const int *, const float *, const float *, const int *,
+                    const float *, const int *, const float *, float *, const int *);
+int BLASFUNC(dsymm)(const char *, const char *, const int *, const int *, const double *, const double *, const int *,
+                    const double *, const int *, const double *, double *, const int *);
+int BLASFUNC(qsymm)(const char *, const char *, const int *, const int *, const double *, const double *, const int *,
+                    const double *, const int *, const double *, double *, const int *);
+int BLASFUNC(csymm)(const char *, const char *, const int *, const int *, const float *, const float *, const int *,
+                    const float *, const int *, const float *, float *, const int *);
+int BLASFUNC(zsymm)(const char *, const char *, const int *, const int *, const double *, const double *, const int *,
+                    const double *, const int *, const double *, double *, const int *);
+int BLASFUNC(xsymm)(const char *, const char *, const int *, const int *, const double *, const double *, const int *,
+                    const double *, const int *, const double *, double *, const int *);
 
-int BLASFUNC(csymm3m)(char *, char *, int *, int *, float  *, float  *, int *, float  *, int *, float  *, float  *, int *);
-int BLASFUNC(zsymm3m)(char *, char *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
-int BLASFUNC(xsymm3m)(char *, char *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
+int BLASFUNC(csymm3m)(char *, char *, int *, int *, float *, float *, int *, float *, int *, float *, float *, int *);
+int BLASFUNC(zsymm3m)(char *, char *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                      int *);
+int BLASFUNC(xsymm3m)(char *, char *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                      int *);
 
-int BLASFUNC(ssyrk)(const char *, const char *, const int *, const int *, const float  *, const float  *, const int *, const float  *, float  *, const int *);
-int BLASFUNC(dsyrk)(const char *, const char *, const int *, const int *, const double *, const double *, const int *, const double *, double *, const int *);
-int BLASFUNC(qsyrk)(const char *, const char *, const int *, const int *, const double *, const double *, const int *, const double *, double *, const int *);
-int BLASFUNC(csyrk)(const char *, const char *, const int *, const int *, const float  *, const float  *, const int *, const float  *, float  *, const int *);
-int BLASFUNC(zsyrk)(const char *, const char *, const int *, const int *, const double *, const double *, const int *, const double *, double *, const int *);
-int BLASFUNC(xsyrk)(const char *, const char *, const int *, const int *, const double *, const double *, const int *, const double *, double *, const int *);
+int BLASFUNC(ssyrk)(const char *, const char *, const int *, const int *, const float *, const float *, const int *,
+                    const float *, float *, const int *);
+int BLASFUNC(dsyrk)(const char *, const char *, const int *, const int *, const double *, const double *, const int *,
+                    const double *, double *, const int *);
+int BLASFUNC(qsyrk)(const char *, const char *, const int *, const int *, const double *, const double *, const int *,
+                    const double *, double *, const int *);
+int BLASFUNC(csyrk)(const char *, const char *, const int *, const int *, const float *, const float *, const int *,
+                    const float *, float *, const int *);
+int BLASFUNC(zsyrk)(const char *, const char *, const int *, const int *, const double *, const double *, const int *,
+                    const double *, double *, const int *);
+int BLASFUNC(xsyrk)(const char *, const char *, const int *, const int *, const double *, const double *, const int *,
+                    const double *, double *, const int *);
 
-int BLASFUNC(ssyr2k)(const char *, const char *, const int *, const int *, const float  *, const float  *, const int *, const float *, const int *, const float  *, float  *, const int *);
-int BLASFUNC(dsyr2k)(const char *, const char *, const int *, const int *, const double *, const double *, const int *, const double*, const int *, const double *, double *, const int *);
-int BLASFUNC(qsyr2k)(const char *, const char *, const int *, const int *, const double *, const double *, const int *, const double*, const int *, const double *, double *, const int *);
-int BLASFUNC(csyr2k)(const char *, const char *, const int *, const int *, const float  *, const float  *, const int *, const float *, const int *, const float  *, float  *, const int *);
-int BLASFUNC(zsyr2k)(const char *, const char *, const int *, const int *, const double *, const double *, const int *, const double*, const int *, const double *, double *, const int *);
-int BLASFUNC(xsyr2k)(const char *, const char *, const int *, const int *, const double *, const double *, const int *, const double*, const int *, const double *, double *, const int *);
+int BLASFUNC(ssyr2k)(const char *, const char *, const int *, const int *, const float *, const float *, const int *,
+                     const float *, const int *, const float *, float *, const int *);
+int BLASFUNC(dsyr2k)(const char *, const char *, const int *, const int *, const double *, const double *, const int *,
+                     const double *, const int *, const double *, double *, const int *);
+int BLASFUNC(qsyr2k)(const char *, const char *, const int *, const int *, const double *, const double *, const int *,
+                     const double *, const int *, const double *, double *, const int *);
+int BLASFUNC(csyr2k)(const char *, const char *, const int *, const int *, const float *, const float *, const int *,
+                     const float *, const int *, const float *, float *, const int *);
+int BLASFUNC(zsyr2k)(const char *, const char *, const int *, const int *, const double *, const double *, const int *,
+                     const double *, const int *, const double *, double *, const int *);
+int BLASFUNC(xsyr2k)(const char *, const char *, const int *, const int *, const double *, const double *, const int *,
+                     const double *, const int *, const double *, double *, const int *);
 
-int BLASFUNC(chemm)(const char *, const char *, const int *, const int *, const float  *, const float  *, const int *, const float  *, const int *, const float  *, float  *, const int *);
-int BLASFUNC(zhemm)(const char *, const char *, const int *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
-int BLASFUNC(xhemm)(const char *, const char *, const int *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
+int BLASFUNC(chemm)(const char *, const char *, const int *, const int *, const float *, const float *, const int *,
+                    const float *, const int *, const float *, float *, const int *);
+int BLASFUNC(zhemm)(const char *, const char *, const int *, const int *, const double *, const double *, const int *,
+                    const double *, const int *, const double *, double *, const int *);
+int BLASFUNC(xhemm)(const char *, const char *, const int *, const int *, const double *, const double *, const int *,
+                    const double *, const int *, const double *, double *, const int *);
 
-int BLASFUNC(chemm3m)(char *, char *, int *, int *, float  *, float  *, int *,
-	   float  *, int *, float  *, float  *, int *);
-int BLASFUNC(zhemm3m)(char *, char *, int *, int *, double *, double *, int *,
-	   double *, int *, double *, double *, int *);
-int BLASFUNC(xhemm3m)(char *, char *, int *, int *, double *, double *, int *,
-	   double *, int *, double *, double *, int *);
+int BLASFUNC(chemm3m)(char *, char *, int *, int *, float *, float *, int *, float *, int *, float *, float *, int *);
+int BLASFUNC(zhemm3m)(char *, char *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                      int *);
+int BLASFUNC(xhemm3m)(char *, char *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
+                      int *);
 
-int BLASFUNC(cherk)(const char *, const char *, const int *, const int *, const float  *, const float  *, const int *, const float  *, float  *, const int *);
-int BLASFUNC(zherk)(const char *, const char *, const int *, const int *, const double *, const double *, const int *, const double *, double *, const int *);
-int BLASFUNC(xherk)(const char *, const char *, const int *, const int *, const double *, const double *, const int *, const double *, double *, const int *);
+int BLASFUNC(cherk)(const char *, const char *, const int *, const int *, const float *, const float *, const int *,
+                    const float *, float *, const int *);
+int BLASFUNC(zherk)(const char *, const char *, const int *, const int *, const double *, const double *, const int *,
+                    const double *, double *, const int *);
+int BLASFUNC(xherk)(const char *, const char *, const int *, const int *, const double *, const double *, const int *,
+                    const double *, double *, const int *);
 
-int BLASFUNC(cher2k)(const char *, const char *, const int *, const int *, const float  *, const float  *, const int *, const float  *, const int *, const float  *, float  *, const int *);
-int BLASFUNC(zher2k)(const char *, const char *, const int *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
-int BLASFUNC(xher2k)(const char *, const char *, const int *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
-int BLASFUNC(cher2m)(const char *, const char *, const char *, const int *, const int *, const float  *, const float  *, const int *, const float *, const int *, const float  *, float  *, const int *);
-int BLASFUNC(zher2m)(const char *, const char *, const char *, const int *, const int *, const double *, const double *, const int *, const double*, const int *, const double *, double *, const int *);
-int BLASFUNC(xher2m)(const char *, const char *, const char *, const int *, const int *, const double *, const double *, const int *, const double*, const int *, const double *, double *, const int *);
-
+int BLASFUNC(cher2k)(const char *, const char *, const int *, const int *, const float *, const float *, const int *,
+                     const float *, const int *, const float *, float *, const int *);
+int BLASFUNC(zher2k)(const char *, const char *, const int *, const int *, const double *, const double *, const int *,
+                     const double *, const int *, const double *, double *, const int *);
+int BLASFUNC(xher2k)(const char *, const char *, const int *, const int *, const double *, const double *, const int *,
+                     const double *, const int *, const double *, double *, const int *);
+int BLASFUNC(cher2m)(const char *, const char *, const char *, const int *, const int *, const float *, const float *,
+                     const int *, const float *, const int *, const float *, float *, const int *);
+int BLASFUNC(zher2m)(const char *, const char *, const char *, const int *, const int *, const double *, const double *,
+                     const int *, const double *, const int *, const double *, double *, const int *);
+int BLASFUNC(xher2m)(const char *, const char *, const char *, const int *, const int *, const double *, const double *,
+                     const int *, const double *, const int *, const double *, double *, const int *);
 
 #ifdef __cplusplus
 }
diff --git a/blas/common.h b/blas/common.h
index 0364602..bf91a83 100644
--- a/blas/common.h
+++ b/blas/common.h
@@ -11,11 +11,11 @@
 #define EIGEN_BLAS_COMMON_H
 
 #ifdef __GNUC__
-# if __GNUC__<5
+#if __GNUC__ < 5
 // GCC < 5.0 does not like the global Scalar typedef
 // we just keep shadow-warnings disabled permanently
-#  define EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
-# endif
+#define EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
+#endif
 #endif
 
 #include "../Eigen/Core"
@@ -29,54 +29,35 @@
 
 #include "blas.h"
 
-#define NOTR    0
-#define TR      1
-#define ADJ     2
+#define NOTR 0
+#define TR 1
+#define ADJ 2
 
-#define LEFT    0
-#define RIGHT   1
+#define LEFT 0
+#define RIGHT 1
 
-#define UP      0
-#define LO      1
+#define UP 0
+#define LO 1
 
-#define NUNIT   0
-#define UNIT    1
+#define NUNIT 0
+#define UNIT 1
 
 #define INVALID 0xff
 
-#define OP(X)   (   ((X)=='N' || (X)=='n') ? NOTR   \
-                  : ((X)=='T' || (X)=='t') ? TR     \
-                  : ((X)=='C' || (X)=='c') ? ADJ    \
-                  : INVALID)
+#define OP(X) \
+  (((X) == 'N' || (X) == 'n') ? NOTR : ((X) == 'T' || (X) == 't') ? TR : ((X) == 'C' || (X) == 'c') ? ADJ : INVALID)
 
-#define SIDE(X) (   ((X)=='L' || (X)=='l') ? LEFT   \
-                  : ((X)=='R' || (X)=='r') ? RIGHT  \
-                  : INVALID)
+#define SIDE(X) (((X) == 'L' || (X) == 'l') ? LEFT : ((X) == 'R' || (X) == 'r') ? RIGHT : INVALID)
 
-#define UPLO(X) (   ((X)=='U' || (X)=='u') ? UP     \
-                  : ((X)=='L' || (X)=='l') ? LO     \
-                  : INVALID)
+#define UPLO(X) (((X) == 'U' || (X) == 'u') ? UP : ((X) == 'L' || (X) == 'l') ? LO : INVALID)
 
-#define DIAG(X) (   ((X)=='N' || (X)=='n') ? NUNIT  \
-                  : ((X)=='U' || (X)=='u') ? UNIT   \
-                  : INVALID)
+#define DIAG(X) (((X) == 'N' || (X) == 'n') ? NUNIT : ((X) == 'U' || (X) == 'u') ? UNIT : INVALID)
 
+inline bool check_op(const char* op) { return OP(*op) != 0xff; }
 
-inline bool check_op(const char* op)
-{
-  return OP(*op)!=0xff;
-}
+inline bool check_side(const char* side) { return SIDE(*side) != 0xff; }
 
-inline bool check_side(const char* side)
-{
-  return SIDE(*side)!=0xff;
-}
-
-inline bool check_uplo(const char* uplo)
-{
-  return UPLO(*uplo)!=0xff;
-}
-
+inline bool check_uplo(const char* uplo) { return UPLO(*uplo) != 0xff; }
 
 namespace Eigen {
 #include "BandTriangularSolver.h"
@@ -85,7 +66,7 @@
 #include "PackedTriangularMatrixVector.h"
 #include "PackedTriangularSolverVector.h"
 #include "Rank2Update.h"
-}
+}  // namespace Eigen
 
 using namespace Eigen;
 
@@ -93,76 +74,65 @@
 typedef NumTraits<Scalar>::Real RealScalar;
 typedef std::complex<RealScalar> Complex;
 
-enum
-{
-  IsComplex = Eigen::NumTraits<SCALAR>::IsComplex,
-  Conj = IsComplex
-};
+enum { IsComplex = Eigen::NumTraits<SCALAR>::IsComplex, Conj = IsComplex };
 
-typedef Matrix<Scalar,Dynamic,Dynamic,ColMajor> PlainMatrixType;
-typedef Map<Matrix<Scalar,Dynamic,Dynamic,ColMajor>, 0, OuterStride<> > MatrixType;
-typedef Map<const Matrix<Scalar,Dynamic,Dynamic,ColMajor>, 0, OuterStride<> > ConstMatrixType;
-typedef Map<Matrix<Scalar,Dynamic,1>, 0, InnerStride<Dynamic> > StridedVectorType;
-typedef Map<Matrix<Scalar,Dynamic,1> > CompactVectorType;
+typedef Matrix<Scalar, Dynamic, Dynamic, ColMajor> PlainMatrixType;
+typedef Map<Matrix<Scalar, Dynamic, Dynamic, ColMajor>, 0, OuterStride<> > MatrixType;
+typedef Map<const Matrix<Scalar, Dynamic, Dynamic, ColMajor>, 0, OuterStride<> > ConstMatrixType;
+typedef Map<Matrix<Scalar, Dynamic, 1>, 0, InnerStride<Dynamic> > StridedVectorType;
+typedef Map<Matrix<Scalar, Dynamic, 1> > CompactVectorType;
 
-template<typename T>
-Map<Matrix<T,Dynamic,Dynamic,ColMajor>, 0, OuterStride<> >
-matrix(T* data, int rows, int cols, int stride)
-{
-  return Map<Matrix<T,Dynamic,Dynamic,ColMajor>, 0, OuterStride<> >(data, rows, cols, OuterStride<>(stride));
+template <typename T>
+Map<Matrix<T, Dynamic, Dynamic, ColMajor>, 0, OuterStride<> > matrix(T* data, int rows, int cols, int stride) {
+  return Map<Matrix<T, Dynamic, Dynamic, ColMajor>, 0, OuterStride<> >(data, rows, cols, OuterStride<>(stride));
 }
 
-template<typename T>
-Map<const Matrix<T,Dynamic,Dynamic,ColMajor>, 0, OuterStride<> >
-matrix(const T* data, int rows, int cols, int stride)
-{
-  return Map<const Matrix<T,Dynamic,Dynamic,ColMajor>, 0, OuterStride<> >(data, rows, cols, OuterStride<>(stride));
+template <typename T>
+Map<const Matrix<T, Dynamic, Dynamic, ColMajor>, 0, OuterStride<> > matrix(const T* data, int rows, int cols,
+                                                                           int stride) {
+  return Map<const Matrix<T, Dynamic, Dynamic, ColMajor>, 0, OuterStride<> >(data, rows, cols, OuterStride<>(stride));
 }
 
-template<typename T>
-Map<Matrix<T,Dynamic,1>, 0, InnerStride<Dynamic> > make_vector(T* data, int size, int incr)
-{
-  return Map<Matrix<T,Dynamic,1>, 0, InnerStride<Dynamic> >(data, size, InnerStride<Dynamic>(incr));
+template <typename T>
+Map<Matrix<T, Dynamic, 1>, 0, InnerStride<Dynamic> > make_vector(T* data, int size, int incr) {
+  return Map<Matrix<T, Dynamic, 1>, 0, InnerStride<Dynamic> >(data, size, InnerStride<Dynamic>(incr));
 }
 
-template<typename T>
-Map<const Matrix<T,Dynamic,1>, 0, InnerStride<Dynamic> > make_vector(const T* data, int size, int incr)
-{
-  return Map<const Matrix<T,Dynamic,1>, 0, InnerStride<Dynamic> >(data, size, InnerStride<Dynamic>(incr));
+template <typename T>
+Map<const Matrix<T, Dynamic, 1>, 0, InnerStride<Dynamic> > make_vector(const T* data, int size, int incr) {
+  return Map<const Matrix<T, Dynamic, 1>, 0, InnerStride<Dynamic> >(data, size, InnerStride<Dynamic>(incr));
 }
 
-template<typename T>
-Map<Matrix<T,Dynamic,1> > make_vector(T* data, int size)
-{
-  return Map<Matrix<T,Dynamic,1> >(data, size);
+template <typename T>
+Map<Matrix<T, Dynamic, 1> > make_vector(T* data, int size) {
+  return Map<Matrix<T, Dynamic, 1> >(data, size);
 }
 
-template<typename T>
-Map<const Matrix<T,Dynamic,1> > make_vector(const T* data, int size)
-{
-  return Map<const Matrix<T,Dynamic,1> >(data, size);
+template <typename T>
+Map<const Matrix<T, Dynamic, 1> > make_vector(const T* data, int size) {
+  return Map<const Matrix<T, Dynamic, 1> >(data, size);
 }
 
-template<typename T>
-T* get_compact_vector(T* x, int n, int incx)
-{
-  if(incx==1)
-    return x;
+template <typename T>
+T* get_compact_vector(T* x, int n, int incx) {
+  if (incx == 1) return x;
 
   std::remove_const_t<T>* ret = new Scalar[n];
-  if(incx<0) make_vector(ret,n) = make_vector(x,n,-incx).reverse();
-  else       make_vector(ret,n) = make_vector(x,n, incx);
+  if (incx < 0)
+    make_vector(ret, n) = make_vector(x, n, -incx).reverse();
+  else
+    make_vector(ret, n) = make_vector(x, n, incx);
   return ret;
 }
 
-template<typename T>
-T* copy_back(T* x_cpy, T* x, int n, int incx)
-{
-  if(x_cpy==x)
-    return 0;
+template <typename T>
+T* copy_back(T* x_cpy, T* x, int n, int incx) {
+  if (x_cpy == x) return 0;
 
-  if(incx<0) make_vector(x,n,-incx).reverse() = make_vector(x_cpy,n);
-  else       make_vector(x,n, incx)           = make_vector(x_cpy,n);
+  if (incx < 0)
+    make_vector(x, n, -incx).reverse() = make_vector(x_cpy, n);
+  else
+    make_vector(x, n, incx) = make_vector(x_cpy, n);
   return x_cpy;
 }
 
@@ -172,4 +142,4 @@
 
 #define EIGEN_BLAS_FUNC(X) EIGEN_CAT(SCALAR_SUFFIX, EIGEN_CAT(X, EIGEN_BLAS_FUNC_SUFFIX))
 
-#endif // EIGEN_BLAS_COMMON_H
+#endif  // EIGEN_BLAS_COMMON_H
diff --git a/blas/complex_double.cpp b/blas/complex_double.cpp
index 648c6d4..94b9d20 100644
--- a/blas/complex_double.cpp
+++ b/blas/complex_double.cpp
@@ -7,11 +7,11 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-#define SCALAR        std::complex<double>
+#define SCALAR std::complex<double>
 #define SCALAR_SUFFIX z
 #define SCALAR_SUFFIX_UP "Z"
 #define REAL_SCALAR_SUFFIX d
-#define ISCOMPLEX     1
+#define ISCOMPLEX 1
 
 #include "level1_impl.h"
 #include "level1_cplx_impl.h"
diff --git a/blas/complex_single.cpp b/blas/complex_single.cpp
index 7786519..842faec 100644
--- a/blas/complex_single.cpp
+++ b/blas/complex_single.cpp
@@ -7,11 +7,11 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-#define SCALAR        std::complex<float>
+#define SCALAR std::complex<float>
 #define SCALAR_SUFFIX c
 #define SCALAR_SUFFIX_UP "C"
 #define REAL_SCALAR_SUFFIX s
-#define ISCOMPLEX     1
+#define ISCOMPLEX 1
 
 #include "level1_impl.h"
 #include "level1_cplx_impl.h"
diff --git a/blas/double.cpp b/blas/double.cpp
index eb2e573..eef5891 100644
--- a/blas/double.cpp
+++ b/blas/double.cpp
@@ -8,10 +8,10 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-#define SCALAR        double
+#define SCALAR double
 #define SCALAR_SUFFIX d
 #define SCALAR_SUFFIX_UP "D"
-#define ISCOMPLEX     0
+#define ISCOMPLEX 0
 
 #include "level1_impl.h"
 #include "level1_real_impl.h"
@@ -19,14 +19,25 @@
 #include "level2_real_impl.h"
 #include "level3_impl.h"
 
-double EIGEN_BLAS_FUNC(sdot)(int* n, float* x, int* incx, float* y, int* incy)
-{
-  if(*n<=0) return 0;
+double EIGEN_BLAS_FUNC(sdot)(int* n, float* x, int* incx, float* y, int* incy) {
+  if (*n <= 0) return 0;
 
-  if(*incx==1 && *incy==1)    return (make_vector(x,*n).cast<double>().cwiseProduct(make_vector(y,*n).cast<double>())).sum();
-  else if(*incx>0 && *incy>0) return (make_vector(x,*n,*incx).cast<double>().cwiseProduct(make_vector(y,*n,*incy).cast<double>())).sum();
-  else if(*incx<0 && *incy>0) return (make_vector(x,*n,-*incx).reverse().cast<double>().cwiseProduct(make_vector(y,*n,*incy).cast<double>())).sum();
-  else if(*incx>0 && *incy<0) return (make_vector(x,*n,*incx).cast<double>().cwiseProduct(make_vector(y,*n,-*incy).reverse().cast<double>())).sum();
-  else if(*incx<0 && *incy<0) return (make_vector(x,*n,-*incx).reverse().cast<double>().cwiseProduct(make_vector(y,*n,-*incy).reverse().cast<double>())).sum();
-  else return 0;
+  if (*incx == 1 && *incy == 1)
+    return (make_vector(x, *n).cast<double>().cwiseProduct(make_vector(y, *n).cast<double>())).sum();
+  else if (*incx > 0 && *incy > 0)
+    return (make_vector(x, *n, *incx).cast<double>().cwiseProduct(make_vector(y, *n, *incy).cast<double>())).sum();
+  else if (*incx < 0 && *incy > 0)
+    return (make_vector(x, *n, -*incx).reverse().cast<double>().cwiseProduct(make_vector(y, *n, *incy).cast<double>()))
+        .sum();
+  else if (*incx > 0 && *incy < 0)
+    return (make_vector(x, *n, *incx).cast<double>().cwiseProduct(make_vector(y, *n, -*incy).reverse().cast<double>()))
+        .sum();
+  else if (*incx < 0 && *incy < 0)
+    return (make_vector(x, *n, -*incx)
+                .reverse()
+                .cast<double>()
+                .cwiseProduct(make_vector(y, *n, -*incy).reverse().cast<double>()))
+        .sum();
+  else
+    return 0;
 }
diff --git a/blas/f2c/datatypes.h b/blas/f2c/datatypes.h
index 63232b2..7c2f4ae 100644
--- a/blas/f2c/datatypes.h
+++ b/blas/f2c/datatypes.h
@@ -9,16 +9,20 @@
 typedef unsigned int uinteger;
 typedef float real;
 typedef double doublereal;
-typedef struct { real r, i; } complex;
-typedef struct { doublereal r, i; } doublecomplex;
+typedef struct {
+  real r, i;
+} complex;
+typedef struct {
+  doublereal r, i;
+} doublecomplex;
 typedef int ftnlen;
 typedef int logical;
 
 #define abs(x) ((x) >= 0 ? (x) : -(x))
-#define dabs(x) (doublereal)abs(x)
-#define min(a,b) ((a) <= (b) ? (a) : (b))
-#define max(a,b) ((a) >= (b) ? (a) : (b))
-#define dmin(a,b) (doublereal)min(a,b)
-#define dmax(a,b) (doublereal)max(a,b)
+#define dabs(x) (doublereal) abs(x)
+#define min(a, b) ((a) <= (b) ? (a) : (b))
+#define max(a, b) ((a) >= (b) ? (a) : (b))
+#define dmin(a, b) (doublereal) min(a, b)
+#define dmax(a, b) (doublereal) max(a, b)
 
 #endif
diff --git a/blas/level1_cplx_impl.h b/blas/level1_cplx_impl.h
index aa46784..552b384 100644
--- a/blas/level1_cplx_impl.h
+++ b/blas/level1_cplx_impl.h
@@ -11,144 +11,155 @@
 
 struct scalar_norm1_op {
   typedef RealScalar result_type;
-  inline RealScalar operator() (const Scalar& a) const { return numext::norm1(a); }
+  inline RealScalar operator()(const Scalar &a) const { return numext::norm1(a); }
 };
 namespace Eigen {
-  namespace internal {
-    template<> struct functor_traits<scalar_norm1_op >
-    {
-      enum { Cost = 3 * NumTraits<Scalar>::AddCost, PacketAccess = 0 };
-    };
-  }
-}
+namespace internal {
+template <>
+struct functor_traits<scalar_norm1_op> {
+  enum { Cost = 3 * NumTraits<Scalar>::AddCost, PacketAccess = 0 };
+};
+}  // namespace internal
+}  // namespace Eigen
 
 // computes the sum of magnitudes of all vector elements or, for a complex vector x, the sum
 // res = |Rex1| + |Imx1| + |Rex2| + |Imx2| + ... + |Rexn| + |Imxn|, where x is a vector of order n
-RealScalar EIGEN_CAT(REAL_SCALAR_SUFFIX, EIGEN_BLAS_FUNC(asum))(int *n, RealScalar *px, int *incx)
-{
-//   std::cerr << "__asum " << *n << " " << *incx << "\n";
-  Complex* x = reinterpret_cast<Complex*>(px);
+RealScalar EIGEN_CAT(REAL_SCALAR_SUFFIX, EIGEN_BLAS_FUNC(asum))(int *n, RealScalar *px, int *incx) {
+  //   std::cerr << "__asum " << *n << " " << *incx << "\n";
+  Complex *x = reinterpret_cast<Complex *>(px);
 
-  if(*n<=0) return 0;
+  if (*n <= 0) return 0;
 
-  if(*incx==1)  return make_vector(x,*n).unaryExpr<scalar_norm1_op>().sum();
-  else          return make_vector(x,*n,std::abs(*incx)).unaryExpr<scalar_norm1_op>().sum();
+  if (*incx == 1)
+    return make_vector(x, *n).unaryExpr<scalar_norm1_op>().sum();
+  else
+    return make_vector(x, *n, std::abs(*incx)).unaryExpr<scalar_norm1_op>().sum();
 }
 
-int EIGEN_CAT(i, EIGEN_BLAS_FUNC(amax))(int *n, RealScalar *px, int *incx)
-{
-  if(*n<=0) return 0;
-  Scalar* x = reinterpret_cast<Scalar*>(px);
+int EIGEN_CAT(i, EIGEN_BLAS_FUNC(amax))(int *n, RealScalar *px, int *incx) {
+  if (*n <= 0) return 0;
+  Scalar *x = reinterpret_cast<Scalar *>(px);
 
   DenseIndex ret;
-  if(*incx==1)  make_vector(x,*n).unaryExpr<scalar_norm1_op>().maxCoeff(&ret);
-  else          make_vector(x,*n,std::abs(*incx)).unaryExpr<scalar_norm1_op>().maxCoeff(&ret);
-  return int(ret)+1;
+  if (*incx == 1)
+    make_vector(x, *n).unaryExpr<scalar_norm1_op>().maxCoeff(&ret);
+  else
+    make_vector(x, *n, std::abs(*incx)).unaryExpr<scalar_norm1_op>().maxCoeff(&ret);
+  return int(ret) + 1;
 }
 
-int EIGEN_CAT(i, EIGEN_BLAS_FUNC(amin))(int *n, RealScalar *px, int *incx)
-{
-  if(*n<=0) return 0;
-  Scalar* x = reinterpret_cast<Scalar*>(px);
+int EIGEN_CAT(i, EIGEN_BLAS_FUNC(amin))(int *n, RealScalar *px, int *incx) {
+  if (*n <= 0) return 0;
+  Scalar *x = reinterpret_cast<Scalar *>(px);
 
   DenseIndex ret;
-  if(*incx==1)  make_vector(x,*n).unaryExpr<scalar_norm1_op>().minCoeff(&ret);
-  else          make_vector(x,*n,std::abs(*incx)).unaryExpr<scalar_norm1_op>().minCoeff(&ret);
-  return int(ret)+1;
+  if (*incx == 1)
+    make_vector(x, *n).unaryExpr<scalar_norm1_op>().minCoeff(&ret);
+  else
+    make_vector(x, *n, std::abs(*incx)).unaryExpr<scalar_norm1_op>().minCoeff(&ret);
+  return int(ret) + 1;
 }
 
 // computes a dot product of a conjugated vector with another vector.
-int EIGEN_BLAS_FUNC(dotcw)(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar* pres)
-{
-//   std::cerr << "_dotc " << *n << " " << *incx << " " << *incy << "\n";
-  Scalar* res = reinterpret_cast<Scalar*>(pres);
+int EIGEN_BLAS_FUNC(dotcw)(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pres) {
+  //   std::cerr << "_dotc " << *n << " " << *incx << " " << *incy << "\n";
+  Scalar *res = reinterpret_cast<Scalar *>(pres);
 
-  if(*n<=0)
-  {
+  if (*n <= 0) {
     *res = Scalar(0);
     return 0;
   }
 
-  Scalar* x = reinterpret_cast<Scalar*>(px);
-  Scalar* y = reinterpret_cast<Scalar*>(py);
+  Scalar *x = reinterpret_cast<Scalar *>(px);
+  Scalar *y = reinterpret_cast<Scalar *>(py);
 
-  if(*incx==1 && *incy==1)    *res = (make_vector(x,*n).dot(make_vector(y,*n)));
-  else if(*incx>0 && *incy>0) *res = (make_vector(x,*n,*incx).dot(make_vector(y,*n,*incy)));
-  else if(*incx<0 && *incy>0) *res = (make_vector(x,*n,-*incx).reverse().dot(make_vector(y,*n,*incy)));
-  else if(*incx>0 && *incy<0) *res = (make_vector(x,*n,*incx).dot(make_vector(y,*n,-*incy).reverse()));
-  else if(*incx<0 && *incy<0) *res = (make_vector(x,*n,-*incx).reverse().dot(make_vector(y,*n,-*incy).reverse()));
+  if (*incx == 1 && *incy == 1)
+    *res = (make_vector(x, *n).dot(make_vector(y, *n)));
+  else if (*incx > 0 && *incy > 0)
+    *res = (make_vector(x, *n, *incx).dot(make_vector(y, *n, *incy)));
+  else if (*incx < 0 && *incy > 0)
+    *res = (make_vector(x, *n, -*incx).reverse().dot(make_vector(y, *n, *incy)));
+  else if (*incx > 0 && *incy < 0)
+    *res = (make_vector(x, *n, *incx).dot(make_vector(y, *n, -*incy).reverse()));
+  else if (*incx < 0 && *incy < 0)
+    *res = (make_vector(x, *n, -*incx).reverse().dot(make_vector(y, *n, -*incy).reverse()));
   return 0;
 }
 
 // computes a vector-vector dot product without complex conjugation.
-int EIGEN_BLAS_FUNC(dotuw)(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar* pres)
-{
-  Scalar* res = reinterpret_cast<Scalar*>(pres);
+int EIGEN_BLAS_FUNC(dotuw)(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pres) {
+  Scalar *res = reinterpret_cast<Scalar *>(pres);
 
-  if(*n<=0)
-  {
+  if (*n <= 0) {
     *res = Scalar(0);
     return 0;
   }
 
-  Scalar* x = reinterpret_cast<Scalar*>(px);
-  Scalar* y = reinterpret_cast<Scalar*>(py);
+  Scalar *x = reinterpret_cast<Scalar *>(px);
+  Scalar *y = reinterpret_cast<Scalar *>(py);
 
-  if(*incx==1 && *incy==1)    *res = (make_vector(x,*n).cwiseProduct(make_vector(y,*n))).sum();
-  else if(*incx>0 && *incy>0) *res = (make_vector(x,*n,*incx).cwiseProduct(make_vector(y,*n,*incy))).sum();
-  else if(*incx<0 && *incy>0) *res = (make_vector(x,*n,-*incx).reverse().cwiseProduct(make_vector(y,*n,*incy))).sum();
-  else if(*incx>0 && *incy<0) *res = (make_vector(x,*n,*incx).cwiseProduct(make_vector(y,*n,-*incy).reverse())).sum();
-  else if(*incx<0 && *incy<0) *res = (make_vector(x,*n,-*incx).reverse().cwiseProduct(make_vector(y,*n,-*incy).reverse())).sum();
+  if (*incx == 1 && *incy == 1)
+    *res = (make_vector(x, *n).cwiseProduct(make_vector(y, *n))).sum();
+  else if (*incx > 0 && *incy > 0)
+    *res = (make_vector(x, *n, *incx).cwiseProduct(make_vector(y, *n, *incy))).sum();
+  else if (*incx < 0 && *incy > 0)
+    *res = (make_vector(x, *n, -*incx).reverse().cwiseProduct(make_vector(y, *n, *incy))).sum();
+  else if (*incx > 0 && *incy < 0)
+    *res = (make_vector(x, *n, *incx).cwiseProduct(make_vector(y, *n, -*incy).reverse())).sum();
+  else if (*incx < 0 && *incy < 0)
+    *res = (make_vector(x, *n, -*incx).reverse().cwiseProduct(make_vector(y, *n, -*incy).reverse())).sum();
   return 0;
 }
 
-RealScalar EIGEN_CAT(REAL_SCALAR_SUFFIX, EIGEN_BLAS_FUNC(nrm2))(int *n, RealScalar *px, int *incx)
-{
-//   std::cerr << "__nrm2 " << *n << " " << *incx << "\n";
-  if(*n<=0) return 0;
+RealScalar EIGEN_CAT(REAL_SCALAR_SUFFIX, EIGEN_BLAS_FUNC(nrm2))(int *n, RealScalar *px, int *incx) {
+  //   std::cerr << "__nrm2 " << *n << " " << *incx << "\n";
+  if (*n <= 0) return 0;
 
-  Scalar* x = reinterpret_cast<Scalar*>(px);
+  Scalar *x = reinterpret_cast<Scalar *>(px);
 
-  if(*incx==1)
-    return make_vector(x,*n).stableNorm();
+  if (*incx == 1) return make_vector(x, *n).stableNorm();
 
-  return make_vector(x,*n,*incx).stableNorm();
+  return make_vector(x, *n, *incx).stableNorm();
 }
 
-int EIGEN_BLAS_FUNC(EIGEN_CAT(REAL_SCALAR_SUFFIX, rot))(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pc, RealScalar *ps)
-{
-  if(*n<=0) return 0;
+int EIGEN_BLAS_FUNC(EIGEN_CAT(REAL_SCALAR_SUFFIX, rot))(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy,
+                                                        RealScalar *pc, RealScalar *ps) {
+  if (*n <= 0) return 0;
 
-  Scalar* x = reinterpret_cast<Scalar*>(px);
-  Scalar* y = reinterpret_cast<Scalar*>(py);
+  Scalar *x = reinterpret_cast<Scalar *>(px);
+  Scalar *y = reinterpret_cast<Scalar *>(py);
   RealScalar c = *pc;
   RealScalar s = *ps;
 
-  StridedVectorType vx(make_vector(x,*n,std::abs(*incx)));
-  StridedVectorType vy(make_vector(y,*n,std::abs(*incy)));
+  StridedVectorType vx(make_vector(x, *n, std::abs(*incx)));
+  StridedVectorType vy(make_vector(y, *n, std::abs(*incy)));
 
   Reverse<StridedVectorType> rvx(vx);
   Reverse<StridedVectorType> rvy(vy);
 
   // TODO implement mixed real-scalar rotations
-       if(*incx<0 && *incy>0) internal::apply_rotation_in_the_plane(rvx, vy, JacobiRotation<Scalar>(c,s));
-  else if(*incx>0 && *incy<0) internal::apply_rotation_in_the_plane(vx, rvy, JacobiRotation<Scalar>(c,s));
-  else                        internal::apply_rotation_in_the_plane(vx, vy,  JacobiRotation<Scalar>(c,s));
+  if (*incx < 0 && *incy > 0)
+    internal::apply_rotation_in_the_plane(rvx, vy, JacobiRotation<Scalar>(c, s));
+  else if (*incx > 0 && *incy < 0)
+    internal::apply_rotation_in_the_plane(vx, rvy, JacobiRotation<Scalar>(c, s));
+  else
+    internal::apply_rotation_in_the_plane(vx, vy, JacobiRotation<Scalar>(c, s));
 
   return 0;
 }
 
-int EIGEN_BLAS_FUNC(EIGEN_CAT(REAL_SCALAR_SUFFIX, scal))(int *n, RealScalar *palpha, RealScalar *px, int *incx)
-{
-  if(*n<=0) return 0;
+int EIGEN_BLAS_FUNC(EIGEN_CAT(REAL_SCALAR_SUFFIX, scal))(int *n, RealScalar *palpha, RealScalar *px, int *incx) {
+  if (*n <= 0) return 0;
 
-  Scalar* x = reinterpret_cast<Scalar*>(px);
+  Scalar *x = reinterpret_cast<Scalar *>(px);
   RealScalar alpha = *palpha;
 
-//   std::cerr << "__scal " << *n << " " << alpha << " " << *incx << "\n";
+  //   std::cerr << "__scal " << *n << " " << alpha << " " << *incx << "\n";
 
-  if(*incx==1)  make_vector(x,*n) *= alpha;
-  else          make_vector(x,*n,std::abs(*incx)) *= alpha;
+  if (*incx == 1)
+    make_vector(x, *n) *= alpha;
+  else
+    make_vector(x, *n, std::abs(*incx)) *= alpha;
 
   return 0;
 }
diff --git a/blas/level1_impl.h b/blas/level1_impl.h
index 71bd534..f1ff3cc 100644
--- a/blas/level1_impl.h
+++ b/blas/level1_impl.h
@@ -9,39 +9,41 @@
 
 #include "common.h"
 
-int EIGEN_BLAS_FUNC(axpy)(const int *n, const RealScalar *palpha, const RealScalar *px, const int *incx, RealScalar *py, const int *incy)
-{
-  const Scalar* x = reinterpret_cast<const Scalar*>(px);
-  Scalar* y = reinterpret_cast<Scalar*>(py);
-  Scalar alpha  = *reinterpret_cast<const Scalar*>(palpha);
+int EIGEN_BLAS_FUNC(axpy)(const int *n, const RealScalar *palpha, const RealScalar *px, const int *incx, RealScalar *py,
+                          const int *incy) {
+  const Scalar *x = reinterpret_cast<const Scalar *>(px);
+  Scalar *y = reinterpret_cast<Scalar *>(py);
+  Scalar alpha = *reinterpret_cast<const Scalar *>(palpha);
 
-  if(*n<=0) return 0;
+  if (*n <= 0) return 0;
 
-  if(*incx==1 && *incy==1)    make_vector(y,*n) += alpha * make_vector(x,*n);
-  else if(*incx>0 && *incy>0) make_vector(y,*n,*incy) += alpha * make_vector(x,*n,*incx);
-  else if(*incx>0 && *incy<0) make_vector(y,*n,-*incy).reverse() += alpha * make_vector(x,*n,*incx);
-  else if(*incx<0 && *incy>0) make_vector(y,*n,*incy) += alpha * make_vector(x,*n,-*incx).reverse();
-  else if(*incx<0 && *incy<0) make_vector(y,*n,-*incy).reverse() += alpha * make_vector(x,*n,-*incx).reverse();
+  if (*incx == 1 && *incy == 1)
+    make_vector(y, *n) += alpha * make_vector(x, *n);
+  else if (*incx > 0 && *incy > 0)
+    make_vector(y, *n, *incy) += alpha * make_vector(x, *n, *incx);
+  else if (*incx > 0 && *incy < 0)
+    make_vector(y, *n, -*incy).reverse() += alpha * make_vector(x, *n, *incx);
+  else if (*incx < 0 && *incy > 0)
+    make_vector(y, *n, *incy) += alpha * make_vector(x, *n, -*incx).reverse();
+  else if (*incx < 0 && *incy < 0)
+    make_vector(y, *n, -*incy).reverse() += alpha * make_vector(x, *n, -*incx).reverse();
 
   return 0;
 }
 
-int EIGEN_BLAS_FUNC(copy)(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy)
-{
-  if(*n<=0) return 0;
+int EIGEN_BLAS_FUNC(copy)(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy) {
+  if (*n <= 0) return 0;
 
-  Scalar* x = reinterpret_cast<Scalar*>(px);
-  Scalar* y = reinterpret_cast<Scalar*>(py);
+  Scalar *x = reinterpret_cast<Scalar *>(px);
+  Scalar *y = reinterpret_cast<Scalar *>(py);
 
   // be careful, *incx==0 is allowed !!
-  if(*incx==1 && *incy==1)
-    make_vector(y,*n) = make_vector(x,*n);
-  else
-  {
-    if(*incx<0) x = x - (*n-1)*(*incx);
-    if(*incy<0) y = y - (*n-1)*(*incy);
-    for(int i=0;i<*n;++i)
-    {
+  if (*incx == 1 && *incy == 1)
+    make_vector(y, *n) = make_vector(x, *n);
+  else {
+    if (*incx < 0) x = x - (*n - 1) * (*incx);
+    if (*incy < 0) y = y - (*n - 1) * (*incy);
+    for (int i = 0; i < *n; ++i) {
       *y = *x;
       x += *incx;
       y += *incy;
@@ -51,94 +53,91 @@
   return 0;
 }
 
-int EIGEN_BLAS_FUNC(rotg)(RealScalar *pa, RealScalar *pb, RealScalar *pc, RealScalar *ps)
-{
-  using std::sqrt;
+int EIGEN_BLAS_FUNC(rotg)(RealScalar *pa, RealScalar *pb, RealScalar *pc, RealScalar *ps) {
   using std::abs;
+  using std::sqrt;
 
-  Scalar& a = *reinterpret_cast<Scalar*>(pa);
-  Scalar& b = *reinterpret_cast<Scalar*>(pb);
-  RealScalar* c = pc;
-  Scalar* s = reinterpret_cast<Scalar*>(ps);
+  Scalar &a = *reinterpret_cast<Scalar *>(pa);
+  Scalar &b = *reinterpret_cast<Scalar *>(pb);
+  RealScalar *c = pc;
+  Scalar *s = reinterpret_cast<Scalar *>(ps);
 
-  #if !ISCOMPLEX
-  Scalar r,z;
+#if !ISCOMPLEX
+  Scalar r, z;
   Scalar aa = abs(a);
   Scalar ab = abs(b);
-  if((aa+ab)==Scalar(0))
-  {
+  if ((aa + ab) == Scalar(0)) {
     *c = 1;
     *s = 0;
     r = 0;
     z = 0;
-  }
-  else
-  {
-    r = sqrt(a*a + b*b);
-    Scalar amax = aa>ab ? a : b;
-    r = amax>0 ? r : -r;
-    *c = a/r;
-    *s = b/r;
+  } else {
+    r = sqrt(a * a + b * b);
+    Scalar amax = aa > ab ? a : b;
+    r = amax > 0 ? r : -r;
+    *c = a / r;
+    *s = b / r;
     z = 1;
     if (aa > ab) z = *s;
-    if (ab > aa && *c!=RealScalar(0))
-      z = Scalar(1)/ *c;
+    if (ab > aa && *c != RealScalar(0)) z = Scalar(1) / *c;
   }
   *pa = r;
   *pb = z;
-  #else
+#else
   Scalar alpha;
-  RealScalar norm,scale;
-  if(abs(a)==RealScalar(0))
-  {
+  RealScalar norm, scale;
+  if (abs(a) == RealScalar(0)) {
     *c = RealScalar(0);
     *s = Scalar(1);
     a = b;
-  }
-  else
-  {
+  } else {
     scale = abs(a) + abs(b);
-    norm = scale*sqrt((numext::abs2(a/scale)) + (numext::abs2(b/scale)));
-    alpha = a/abs(a);
-    *c = abs(a)/norm;
-    *s = alpha*numext::conj(b)/norm;
-    a = alpha*norm;
+    norm = scale * sqrt((numext::abs2(a / scale)) + (numext::abs2(b / scale)));
+    alpha = a / abs(a);
+    *c = abs(a) / norm;
+    *s = alpha * numext::conj(b) / norm;
+    a = alpha * norm;
   }
-  #endif
+#endif
 
-//   JacobiRotation<Scalar> r;
-//   r.makeGivens(a,b);
-//   *c = r.c();
-//   *s = r.s();
+  //   JacobiRotation<Scalar> r;
+  //   r.makeGivens(a,b);
+  //   *c = r.c();
+  //   *s = r.s();
 
   return 0;
 }
 
-int EIGEN_BLAS_FUNC(scal)(int *n, RealScalar *palpha, RealScalar *px, int *incx)
-{
-  if(*n<=0) return 0;
+int EIGEN_BLAS_FUNC(scal)(int *n, RealScalar *palpha, RealScalar *px, int *incx) {
+  if (*n <= 0) return 0;
 
-  Scalar* x = reinterpret_cast<Scalar*>(px);
-  Scalar alpha = *reinterpret_cast<Scalar*>(palpha);
+  Scalar *x = reinterpret_cast<Scalar *>(px);
+  Scalar alpha = *reinterpret_cast<Scalar *>(palpha);
 
-  if(*incx==1)  make_vector(x,*n) *= alpha;
-  else          make_vector(x,*n,std::abs(*incx)) *= alpha;
+  if (*incx == 1)
+    make_vector(x, *n) *= alpha;
+  else
+    make_vector(x, *n, std::abs(*incx)) *= alpha;
 
   return 0;
 }
 
-int EIGEN_BLAS_FUNC(swap)(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy)
-{
-  if(*n<=0) return 0;
+int EIGEN_BLAS_FUNC(swap)(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy) {
+  if (*n <= 0) return 0;
 
-  Scalar* x = reinterpret_cast<Scalar*>(px);
-  Scalar* y = reinterpret_cast<Scalar*>(py);
+  Scalar *x = reinterpret_cast<Scalar *>(px);
+  Scalar *y = reinterpret_cast<Scalar *>(py);
 
-  if(*incx==1 && *incy==1)    make_vector(y,*n).swap(make_vector(x,*n));
-  else if(*incx>0 && *incy>0) make_vector(y,*n,*incy).swap(make_vector(x,*n,*incx));
-  else if(*incx>0 && *incy<0) make_vector(y,*n,-*incy).reverse().swap(make_vector(x,*n,*incx));
-  else if(*incx<0 && *incy>0) make_vector(y,*n,*incy).swap(make_vector(x,*n,-*incx).reverse());
-  else if(*incx<0 && *incy<0) make_vector(y,*n,-*incy).reverse().swap(make_vector(x,*n,-*incx).reverse());
+  if (*incx == 1 && *incy == 1)
+    make_vector(y, *n).swap(make_vector(x, *n));
+  else if (*incx > 0 && *incy > 0)
+    make_vector(y, *n, *incy).swap(make_vector(x, *n, *incx));
+  else if (*incx > 0 && *incy < 0)
+    make_vector(y, *n, -*incy).reverse().swap(make_vector(x, *n, *incx));
+  else if (*incx < 0 && *incy > 0)
+    make_vector(y, *n, *incy).swap(make_vector(x, *n, -*incx).reverse());
+  else if (*incx < 0 && *incy < 0)
+    make_vector(y, *n, -*incy).reverse().swap(make_vector(x, *n, -*incx).reverse());
 
   return 1;
 }
diff --git a/blas/level1_real_impl.h b/blas/level1_real_impl.h
index c587711..d5cb573 100644
--- a/blas/level1_real_impl.h
+++ b/blas/level1_real_impl.h
@@ -11,91 +11,101 @@
 
 // computes the sum of magnitudes of all vector elements or, for a complex vector x, the sum
 // res = |Rex1| + |Imx1| + |Rex2| + |Imx2| + ... + |Rexn| + |Imxn|, where x is a vector of order n
-RealScalar EIGEN_BLAS_FUNC(asum)(int *n, RealScalar *px, int *incx)
-{
-//   std::cerr << "_asum " << *n << " " << *incx << "\n";
+RealScalar EIGEN_BLAS_FUNC(asum)(int *n, RealScalar *px, int *incx) {
+  //   std::cerr << "_asum " << *n << " " << *incx << "\n";
 
-  Scalar* x = reinterpret_cast<Scalar*>(px);
+  Scalar *x = reinterpret_cast<Scalar *>(px);
 
-  if(*n<=0) return 0;
+  if (*n <= 0) return 0;
 
-  if(*incx==1)  return make_vector(x,*n).cwiseAbs().sum();
-  else          return make_vector(x,*n,std::abs(*incx)).cwiseAbs().sum();
+  if (*incx == 1)
+    return make_vector(x, *n).cwiseAbs().sum();
+  else
+    return make_vector(x, *n, std::abs(*incx)).cwiseAbs().sum();
 }
 
-int EIGEN_CAT(i, EIGEN_BLAS_FUNC(amax))(int *n, RealScalar *px, int *incx)
-{
-  if(*n<=0) return 0;
-  Scalar* x = reinterpret_cast<Scalar*>(px);
+int EIGEN_CAT(i, EIGEN_BLAS_FUNC(amax))(int *n, RealScalar *px, int *incx) {
+  if (*n <= 0) return 0;
+  Scalar *x = reinterpret_cast<Scalar *>(px);
 
   DenseIndex ret;
-  if(*incx==1)  make_vector(x,*n).cwiseAbs().maxCoeff(&ret);
-  else          make_vector(x,*n,std::abs(*incx)).cwiseAbs().maxCoeff(&ret);
-  return int(ret)+1;
+  if (*incx == 1)
+    make_vector(x, *n).cwiseAbs().maxCoeff(&ret);
+  else
+    make_vector(x, *n, std::abs(*incx)).cwiseAbs().maxCoeff(&ret);
+  return int(ret) + 1;
 }
 
-int EIGEN_CAT(i, EIGEN_BLAS_FUNC(amin))(int *n, RealScalar *px, int *incx)
-{
-  if(*n<=0) return 0;
-  Scalar* x = reinterpret_cast<Scalar*>(px);
+int EIGEN_CAT(i, EIGEN_BLAS_FUNC(amin))(int *n, RealScalar *px, int *incx) {
+  if (*n <= 0) return 0;
+  Scalar *x = reinterpret_cast<Scalar *>(px);
 
   DenseIndex ret;
-  if(*incx==1)  make_vector(x,*n).cwiseAbs().minCoeff(&ret);
-  else          make_vector(x,*n,std::abs(*incx)).cwiseAbs().minCoeff(&ret);
-  return int(ret)+1;
+  if (*incx == 1)
+    make_vector(x, *n).cwiseAbs().minCoeff(&ret);
+  else
+    make_vector(x, *n, std::abs(*incx)).cwiseAbs().minCoeff(&ret);
+  return int(ret) + 1;
 }
 
 // computes a vector-vector dot product.
-Scalar EIGEN_BLAS_FUNC(dot)(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy)
-{
-//   std::cerr << "_dot " << *n << " " << *incx << " " << *incy << "\n";
+Scalar EIGEN_BLAS_FUNC(dot)(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy) {
+  //   std::cerr << "_dot " << *n << " " << *incx << " " << *incy << "\n";
 
-  if(*n<=0) return 0;
+  if (*n <= 0) return 0;
 
-  Scalar* x = reinterpret_cast<Scalar*>(px);
-  Scalar* y = reinterpret_cast<Scalar*>(py);
+  Scalar *x = reinterpret_cast<Scalar *>(px);
+  Scalar *y = reinterpret_cast<Scalar *>(py);
 
-  if(*incx==1 && *incy==1)    return (make_vector(x,*n).cwiseProduct(make_vector(y,*n))).sum();
-  else if(*incx>0 && *incy>0) return (make_vector(x,*n,*incx).cwiseProduct(make_vector(y,*n,*incy))).sum();
-  else if(*incx<0 && *incy>0) return (make_vector(x,*n,-*incx).reverse().cwiseProduct(make_vector(y,*n,*incy))).sum();
-  else if(*incx>0 && *incy<0) return (make_vector(x,*n,*incx).cwiseProduct(make_vector(y,*n,-*incy).reverse())).sum();
-  else if(*incx<0 && *incy<0) return (make_vector(x,*n,-*incx).reverse().cwiseProduct(make_vector(y,*n,-*incy).reverse())).sum();
-  else return 0;
+  if (*incx == 1 && *incy == 1)
+    return (make_vector(x, *n).cwiseProduct(make_vector(y, *n))).sum();
+  else if (*incx > 0 && *incy > 0)
+    return (make_vector(x, *n, *incx).cwiseProduct(make_vector(y, *n, *incy))).sum();
+  else if (*incx < 0 && *incy > 0)
+    return (make_vector(x, *n, -*incx).reverse().cwiseProduct(make_vector(y, *n, *incy))).sum();
+  else if (*incx > 0 && *incy < 0)
+    return (make_vector(x, *n, *incx).cwiseProduct(make_vector(y, *n, -*incy).reverse())).sum();
+  else if (*incx < 0 && *incy < 0)
+    return (make_vector(x, *n, -*incx).reverse().cwiseProduct(make_vector(y, *n, -*incy).reverse())).sum();
+  else
+    return 0;
 }
 
 // computes the Euclidean norm of a vector.
 // FIXME
-Scalar EIGEN_BLAS_FUNC(nrm2)(int *n, RealScalar *px, int *incx)
-{
-//   std::cerr << "_nrm2 " << *n << " " << *incx << "\n";
-  if(*n<=0) return 0;
+Scalar EIGEN_BLAS_FUNC(nrm2)(int *n, RealScalar *px, int *incx) {
+  //   std::cerr << "_nrm2 " << *n << " " << *incx << "\n";
+  if (*n <= 0) return 0;
 
-  Scalar* x = reinterpret_cast<Scalar*>(px);
+  Scalar *x = reinterpret_cast<Scalar *>(px);
 
-  if(*incx==1)  return make_vector(x,*n).stableNorm();
-  else          return make_vector(x,*n,std::abs(*incx)).stableNorm();
+  if (*incx == 1)
+    return make_vector(x, *n).stableNorm();
+  else
+    return make_vector(x, *n, std::abs(*incx)).stableNorm();
 }
 
-int EIGEN_BLAS_FUNC(rot)(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pc, RealScalar *ps)
-{
-//   std::cerr << "_rot " << *n << " " << *incx << " " << *incy << "\n";
-  if(*n<=0) return 0;
+int EIGEN_BLAS_FUNC(rot)(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pc, RealScalar *ps) {
+  //   std::cerr << "_rot " << *n << " " << *incx << " " << *incy << "\n";
+  if (*n <= 0) return 0;
 
-  Scalar* x = reinterpret_cast<Scalar*>(px);
-  Scalar* y = reinterpret_cast<Scalar*>(py);
-  Scalar c = *reinterpret_cast<Scalar*>(pc);
-  Scalar s = *reinterpret_cast<Scalar*>(ps);
+  Scalar *x = reinterpret_cast<Scalar *>(px);
+  Scalar *y = reinterpret_cast<Scalar *>(py);
+  Scalar c = *reinterpret_cast<Scalar *>(pc);
+  Scalar s = *reinterpret_cast<Scalar *>(ps);
 
-  StridedVectorType vx(make_vector(x,*n,std::abs(*incx)));
-  StridedVectorType vy(make_vector(y,*n,std::abs(*incy)));
+  StridedVectorType vx(make_vector(x, *n, std::abs(*incx)));
+  StridedVectorType vy(make_vector(y, *n, std::abs(*incy)));
 
   Reverse<StridedVectorType> rvx(vx);
   Reverse<StridedVectorType> rvy(vy);
 
-       if(*incx<0 && *incy>0) internal::apply_rotation_in_the_plane(rvx, vy, JacobiRotation<Scalar>(c,s));
-  else if(*incx>0 && *incy<0) internal::apply_rotation_in_the_plane(vx, rvy, JacobiRotation<Scalar>(c,s));
-  else                        internal::apply_rotation_in_the_plane(vx, vy,  JacobiRotation<Scalar>(c,s));
-
+  if (*incx < 0 && *incy > 0)
+    internal::apply_rotation_in_the_plane(rvx, vy, JacobiRotation<Scalar>(c, s));
+  else if (*incx > 0 && *incy < 0)
+    internal::apply_rotation_in_the_plane(vx, rvy, JacobiRotation<Scalar>(c, s));
+  else
+    internal::apply_rotation_in_the_plane(vx, vy, JacobiRotation<Scalar>(c, s));
 
   return 0;
 }
diff --git a/blas/level2_cplx_impl.h b/blas/level2_cplx_impl.h
index e3ce614..8c56a6f 100644
--- a/blas/level2_cplx_impl.h
+++ b/blas/level2_cplx_impl.h
@@ -10,73 +10,75 @@
 #include "common.h"
 
 /**  ZHEMV  performs the matrix-vector  operation
-  *
-  *     y := alpha*A*x + beta*y,
-  *
-  *  where alpha and beta are scalars, x and y are n element vectors and
-  *  A is an n by n hermitian matrix.
-  */
-int EIGEN_BLAS_FUNC(hemv)(const char *uplo, const int *n, const RealScalar *palpha, const RealScalar *pa, const int *lda,
-                          const RealScalar *px, const int *incx, const RealScalar *pbeta, RealScalar *py, const int *incy)
-{
-  typedef void (*functype)(int, const Scalar*, int, const Scalar*, Scalar*, Scalar);
+ *
+ *     y := alpha*A*x + beta*y,
+ *
+ *  where alpha and beta are scalars, x and y are n element vectors and
+ *  A is an n by n hermitian matrix.
+ */
+int EIGEN_BLAS_FUNC(hemv)(const char *uplo, const int *n, const RealScalar *palpha, const RealScalar *pa,
+                          const int *lda, const RealScalar *px, const int *incx, const RealScalar *pbeta,
+                          RealScalar *py, const int *incy) {
+  typedef void (*functype)(int, const Scalar *, int, const Scalar *, Scalar *, Scalar);
   static const functype func[2] = {
-    // array index: UP
-    (internal::selfadjoint_matrix_vector_product<Scalar,int,ColMajor,Upper,false,false>::run),
-    // array index: LO
-    (internal::selfadjoint_matrix_vector_product<Scalar,int,ColMajor,Lower,false,false>::run),
+      // array index: UP
+      (internal::selfadjoint_matrix_vector_product<Scalar, int, ColMajor, Upper, false, false>::run),
+      // array index: LO
+      (internal::selfadjoint_matrix_vector_product<Scalar, int, ColMajor, Lower, false, false>::run),
   };
 
-  const Scalar* a = reinterpret_cast<const Scalar*>(pa);
-  const Scalar* x = reinterpret_cast<const Scalar*>(px);
-  Scalar* y = reinterpret_cast<Scalar*>(py);
-  Scalar alpha  = *reinterpret_cast<const Scalar*>(palpha);
-  Scalar beta   = *reinterpret_cast<const Scalar*>(pbeta);
+  const Scalar *a = reinterpret_cast<const Scalar *>(pa);
+  const Scalar *x = reinterpret_cast<const Scalar *>(px);
+  Scalar *y = reinterpret_cast<Scalar *>(py);
+  Scalar alpha = *reinterpret_cast<const Scalar *>(palpha);
+  Scalar beta = *reinterpret_cast<const Scalar *>(pbeta);
 
   // check arguments
   int info = 0;
-  if(UPLO(*uplo)==INVALID)        info = 1;
-  else if(*n<0)                   info = 2;
-  else if(*lda<std::max(1,*n))    info = 5;
-  else if(*incx==0)               info = 7;
-  else if(*incy==0)               info = 10;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"HEMV ",&info,6);
+  if (UPLO(*uplo) == INVALID)
+    info = 1;
+  else if (*n < 0)
+    info = 2;
+  else if (*lda < std::max(1, *n))
+    info = 5;
+  else if (*incx == 0)
+    info = 7;
+  else if (*incy == 0)
+    info = 10;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "HEMV ", &info, 6);
 
-  if(*n==0)
-    return 1;
+  if (*n == 0) return 1;
 
-  const Scalar* actual_x = get_compact_vector(x,*n,*incx);
-  Scalar* actual_y = get_compact_vector(y,*n,*incy);
+  const Scalar *actual_x = get_compact_vector(x, *n, *incx);
+  Scalar *actual_y = get_compact_vector(y, *n, *incy);
 
-  if(beta!=Scalar(1))
-  {
-    if(beta==Scalar(0)) make_vector(actual_y, *n).setZero();
-    else                make_vector(actual_y, *n) *= beta;
+  if (beta != Scalar(1)) {
+    if (beta == Scalar(0))
+      make_vector(actual_y, *n).setZero();
+    else
+      make_vector(actual_y, *n) *= beta;
   }
 
-  if(alpha!=Scalar(0))
-  {
+  if (alpha != Scalar(0)) {
     int code = UPLO(*uplo);
-    if(code>=2 || func[code]==0)
-      return 0;
+    if (code >= 2 || func[code] == 0) return 0;
 
     func[code](*n, a, *lda, actual_x, actual_y, alpha);
   }
 
-  if(actual_x!=x) delete[] actual_x;
-  if(actual_y!=y) delete[] copy_back(actual_y,y,*n,*incy);
+  if (actual_x != x) delete[] actual_x;
+  if (actual_y != y) delete[] copy_back(actual_y, y, *n, *incy);
 
   return 1;
 }
 
 /**  ZHBMV  performs the matrix-vector  operation
-  *
-  *     y := alpha*A*x + beta*y,
-  *
-  *  where alpha and beta are scalars, x and y are n element vectors and
-  *  A is an n by n hermitian band matrix, with k super-diagonals.
-  */
+ *
+ *     y := alpha*A*x + beta*y,
+ *
+ *  where alpha and beta are scalars, x and y are n element vectors and
+ *  A is an n by n hermitian band matrix, with k super-diagonals.
+ */
 // int EIGEN_BLAS_FUNC(hbmv)(char *uplo, int *n, int *k, RealScalar *alpha, RealScalar *a, int *lda,
 //                           RealScalar *x, int *incx, RealScalar *beta, RealScalar *y, int *incy)
 // {
@@ -84,277 +86,286 @@
 // }
 
 /**  ZHPMV  performs the matrix-vector operation
-  *
-  *     y := alpha*A*x + beta*y,
-  *
-  *  where alpha and beta are scalars, x and y are n element vectors and
-  *  A is an n by n hermitian matrix, supplied in packed form.
-  */
-// int EIGEN_BLAS_FUNC(hpmv)(char *uplo, int *n, RealScalar *alpha, RealScalar *ap, RealScalar *x, int *incx, RealScalar *beta, RealScalar *y, int *incy)
+ *
+ *     y := alpha*A*x + beta*y,
+ *
+ *  where alpha and beta are scalars, x and y are n element vectors and
+ *  A is an n by n hermitian matrix, supplied in packed form.
+ */
+// int EIGEN_BLAS_FUNC(hpmv)(char *uplo, int *n, RealScalar *alpha, RealScalar *ap, RealScalar *x, int *incx, RealScalar
+// *beta, RealScalar *y, int *incy)
 // {
 //   return 1;
 // }
 
 /**  ZHPR    performs the hermitian rank 1 operation
-  *
-  *     A := alpha*x*conjg( x' ) + A,
-  *
-  *  where alpha is a real scalar, x is an n element vector and A is an
-  *  n by n hermitian matrix, supplied in packed form.
-  */
-int EIGEN_BLAS_FUNC(hpr)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *pap)
-{
-  typedef void (*functype)(int, Scalar*, const Scalar*, RealScalar);
+ *
+ *     A := alpha*x*conjg( x' ) + A,
+ *
+ *  where alpha is a real scalar, x is an n element vector and A is an
+ *  n by n hermitian matrix, supplied in packed form.
+ */
+int EIGEN_BLAS_FUNC(hpr)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *pap) {
+  typedef void (*functype)(int, Scalar *, const Scalar *, RealScalar);
   static const functype func[2] = {
-    // array index: UP
-    (internal::selfadjoint_packed_rank1_update<Scalar,int,ColMajor,Upper,false,Conj>::run),
-    // array index: LO
-    (internal::selfadjoint_packed_rank1_update<Scalar,int,ColMajor,Lower,false,Conj>::run),
+      // array index: UP
+      (internal::selfadjoint_packed_rank1_update<Scalar, int, ColMajor, Upper, false, Conj>::run),
+      // array index: LO
+      (internal::selfadjoint_packed_rank1_update<Scalar, int, ColMajor, Lower, false, Conj>::run),
   };
 
-  Scalar* x = reinterpret_cast<Scalar*>(px);
-  Scalar* ap = reinterpret_cast<Scalar*>(pap);
+  Scalar *x = reinterpret_cast<Scalar *>(px);
+  Scalar *ap = reinterpret_cast<Scalar *>(pap);
   RealScalar alpha = *palpha;
 
   int info = 0;
-  if(UPLO(*uplo)==INVALID)                                            info = 1;
-  else if(*n<0)                                                       info = 2;
-  else if(*incx==0)                                                   info = 5;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"HPR  ",&info,6);
+  if (UPLO(*uplo) == INVALID)
+    info = 1;
+  else if (*n < 0)
+    info = 2;
+  else if (*incx == 0)
+    info = 5;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "HPR  ", &info, 6);
 
-  if(alpha==Scalar(0))
-    return 1;
+  if (alpha == Scalar(0)) return 1;
 
-  Scalar* x_cpy = get_compact_vector(x, *n, *incx);
+  Scalar *x_cpy = get_compact_vector(x, *n, *incx);
 
   int code = UPLO(*uplo);
-  if(code>=2 || func[code]==0)
-    return 0;
+  if (code >= 2 || func[code] == 0) return 0;
 
   func[code](*n, ap, x_cpy, alpha);
 
-  if(x_cpy!=x)  delete[] x_cpy;
+  if (x_cpy != x) delete[] x_cpy;
 
   return 1;
 }
 
 /**  ZHPR2  performs the hermitian rank 2 operation
-  *
-  *     A := alpha*x*conjg( y' ) + conjg( alpha )*y*conjg( x' ) + A,
-  *
-  *  where alpha is a scalar, x and y are n element vectors and A is an
-  *  n by n hermitian matrix, supplied in packed form.
-  */
-int EIGEN_BLAS_FUNC(hpr2)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pap)
-{
-  typedef void (*functype)(int, Scalar*, const Scalar*, const Scalar*, Scalar);
+ *
+ *     A := alpha*x*conjg( y' ) + conjg( alpha )*y*conjg( x' ) + A,
+ *
+ *  where alpha is a scalar, x and y are n element vectors and A is an
+ *  n by n hermitian matrix, supplied in packed form.
+ */
+int EIGEN_BLAS_FUNC(hpr2)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *py, int *incy,
+                          RealScalar *pap) {
+  typedef void (*functype)(int, Scalar *, const Scalar *, const Scalar *, Scalar);
   static const functype func[2] = {
-    // array index: UP
-    (internal::packed_rank2_update_selector<Scalar,int,Upper>::run),
-    // array index: LO
-    (internal::packed_rank2_update_selector<Scalar,int,Lower>::run),
+      // array index: UP
+      (internal::packed_rank2_update_selector<Scalar, int, Upper>::run),
+      // array index: LO
+      (internal::packed_rank2_update_selector<Scalar, int, Lower>::run),
   };
 
-  Scalar* x = reinterpret_cast<Scalar*>(px);
-  Scalar* y = reinterpret_cast<Scalar*>(py);
-  Scalar* ap = reinterpret_cast<Scalar*>(pap);
-  Scalar alpha = *reinterpret_cast<Scalar*>(palpha);
+  Scalar *x = reinterpret_cast<Scalar *>(px);
+  Scalar *y = reinterpret_cast<Scalar *>(py);
+  Scalar *ap = reinterpret_cast<Scalar *>(pap);
+  Scalar alpha = *reinterpret_cast<Scalar *>(palpha);
 
   int info = 0;
-  if(UPLO(*uplo)==INVALID)                                            info = 1;
-  else if(*n<0)                                                       info = 2;
-  else if(*incx==0)                                                   info = 5;
-  else if(*incy==0)                                                   info = 7;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"HPR2 ",&info,6);
+  if (UPLO(*uplo) == INVALID)
+    info = 1;
+  else if (*n < 0)
+    info = 2;
+  else if (*incx == 0)
+    info = 5;
+  else if (*incy == 0)
+    info = 7;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "HPR2 ", &info, 6);
 
-  if(alpha==Scalar(0))
-    return 1;
+  if (alpha == Scalar(0)) return 1;
 
-  Scalar* x_cpy = get_compact_vector(x, *n, *incx);
-  Scalar* y_cpy = get_compact_vector(y, *n, *incy);
+  Scalar *x_cpy = get_compact_vector(x, *n, *incx);
+  Scalar *y_cpy = get_compact_vector(y, *n, *incy);
 
   int code = UPLO(*uplo);
-  if(code>=2 || func[code]==0)
-    return 0;
+  if (code >= 2 || func[code] == 0) return 0;
 
   func[code](*n, ap, x_cpy, y_cpy, alpha);
 
-  if(x_cpy!=x)  delete[] x_cpy;
-  if(y_cpy!=y)  delete[] y_cpy;
+  if (x_cpy != x) delete[] x_cpy;
+  if (y_cpy != y) delete[] y_cpy;
 
   return 1;
 }
 
 /**  ZHER   performs the hermitian rank 1 operation
-  *
-  *     A := alpha*x*conjg( x' ) + A,
-  *
-  *  where alpha is a real scalar, x is an n element vector and A is an
-  *  n by n hermitian matrix.
-  */
-int EIGEN_BLAS_FUNC(her)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *pa, int *lda)
-{
-  typedef void (*functype)(int, Scalar*, int, const Scalar*, const Scalar*, const Scalar&);
+ *
+ *     A := alpha*x*conjg( x' ) + A,
+ *
+ *  where alpha is a real scalar, x is an n element vector and A is an
+ *  n by n hermitian matrix.
+ */
+int EIGEN_BLAS_FUNC(her)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *pa, int *lda) {
+  typedef void (*functype)(int, Scalar *, int, const Scalar *, const Scalar *, const Scalar &);
   static const functype func[2] = {
-    // array index: UP
-    (selfadjoint_rank1_update<Scalar,int,ColMajor,Upper,false,Conj>::run),
-    // array index: LO
-    (selfadjoint_rank1_update<Scalar,int,ColMajor,Lower,false,Conj>::run),
+      // array index: UP
+      (selfadjoint_rank1_update<Scalar, int, ColMajor, Upper, false, Conj>::run),
+      // array index: LO
+      (selfadjoint_rank1_update<Scalar, int, ColMajor, Lower, false, Conj>::run),
   };
 
-  Scalar* x = reinterpret_cast<Scalar*>(px);
-  Scalar* a = reinterpret_cast<Scalar*>(pa);
-  RealScalar alpha = *reinterpret_cast<RealScalar*>(palpha);
+  Scalar *x = reinterpret_cast<Scalar *>(px);
+  Scalar *a = reinterpret_cast<Scalar *>(pa);
+  RealScalar alpha = *reinterpret_cast<RealScalar *>(palpha);
 
   int info = 0;
-  if(UPLO(*uplo)==INVALID)                                            info = 1;
-  else if(*n<0)                                                       info = 2;
-  else if(*incx==0)                                                   info = 5;
-  else if(*lda<std::max(1,*n))                                        info = 7;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"HER  ",&info,6);
+  if (UPLO(*uplo) == INVALID)
+    info = 1;
+  else if (*n < 0)
+    info = 2;
+  else if (*incx == 0)
+    info = 5;
+  else if (*lda < std::max(1, *n))
+    info = 7;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "HER  ", &info, 6);
 
-  if(alpha==RealScalar(0))
-    return 1;
+  if (alpha == RealScalar(0)) return 1;
 
-  Scalar* x_cpy = get_compact_vector(x, *n, *incx);
+  Scalar *x_cpy = get_compact_vector(x, *n, *incx);
 
   int code = UPLO(*uplo);
-  if(code>=2 || func[code]==0)
-    return 0;
+  if (code >= 2 || func[code] == 0) return 0;
 
   func[code](*n, a, *lda, x_cpy, x_cpy, alpha);
 
-  matrix(a,*n,*n,*lda).diagonal().imag().setZero();
+  matrix(a, *n, *n, *lda).diagonal().imag().setZero();
 
-  if(x_cpy!=x)  delete[] x_cpy;
+  if (x_cpy != x) delete[] x_cpy;
 
   return 1;
 }
 
 /**  ZHER2  performs the hermitian rank 2 operation
-  *
-  *     A := alpha*x*conjg( y' ) + conjg( alpha )*y*conjg( x' ) + A,
-  *
-  *  where alpha is a scalar, x and y are n element vectors and A is an n
-  *  by n hermitian matrix.
-  */
-int EIGEN_BLAS_FUNC(her2)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pa, int *lda)
-{
-  typedef void (*functype)(int, Scalar*, int, const Scalar*, const Scalar*, Scalar);
+ *
+ *     A := alpha*x*conjg( y' ) + conjg( alpha )*y*conjg( x' ) + A,
+ *
+ *  where alpha is a scalar, x and y are n element vectors and A is an n
+ *  by n hermitian matrix.
+ */
+int EIGEN_BLAS_FUNC(her2)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *py, int *incy,
+                          RealScalar *pa, int *lda) {
+  typedef void (*functype)(int, Scalar *, int, const Scalar *, const Scalar *, Scalar);
   static const functype func[2] = {
-    // array index: UP
-    (internal::rank2_update_selector<Scalar,int,Upper>::run),
-    // array index: LO
-    (internal::rank2_update_selector<Scalar,int,Lower>::run),
+      // array index: UP
+      (internal::rank2_update_selector<Scalar, int, Upper>::run),
+      // array index: LO
+      (internal::rank2_update_selector<Scalar, int, Lower>::run),
   };
 
-  Scalar* x = reinterpret_cast<Scalar*>(px);
-  Scalar* y = reinterpret_cast<Scalar*>(py);
-  Scalar* a = reinterpret_cast<Scalar*>(pa);
-  Scalar alpha = *reinterpret_cast<Scalar*>(palpha);
+  Scalar *x = reinterpret_cast<Scalar *>(px);
+  Scalar *y = reinterpret_cast<Scalar *>(py);
+  Scalar *a = reinterpret_cast<Scalar *>(pa);
+  Scalar alpha = *reinterpret_cast<Scalar *>(palpha);
 
   int info = 0;
-  if(UPLO(*uplo)==INVALID)                                            info = 1;
-  else if(*n<0)                                                       info = 2;
-  else if(*incx==0)                                                   info = 5;
-  else if(*incy==0)                                                   info = 7;
-  else if(*lda<std::max(1,*n))                                        info = 9;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"HER2 ",&info,6);
+  if (UPLO(*uplo) == INVALID)
+    info = 1;
+  else if (*n < 0)
+    info = 2;
+  else if (*incx == 0)
+    info = 5;
+  else if (*incy == 0)
+    info = 7;
+  else if (*lda < std::max(1, *n))
+    info = 9;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "HER2 ", &info, 6);
 
-  if(alpha==Scalar(0))
-    return 1;
+  if (alpha == Scalar(0)) return 1;
 
-  Scalar* x_cpy = get_compact_vector(x, *n, *incx);
-  Scalar* y_cpy = get_compact_vector(y, *n, *incy);
+  Scalar *x_cpy = get_compact_vector(x, *n, *incx);
+  Scalar *y_cpy = get_compact_vector(y, *n, *incy);
 
   int code = UPLO(*uplo);
-  if(code>=2 || func[code]==0)
-    return 0;
+  if (code >= 2 || func[code] == 0) return 0;
 
   func[code](*n, a, *lda, x_cpy, y_cpy, alpha);
 
-  matrix(a,*n,*n,*lda).diagonal().imag().setZero();
+  matrix(a, *n, *n, *lda).diagonal().imag().setZero();
 
-  if(x_cpy!=x)  delete[] x_cpy;
-  if(y_cpy!=y)  delete[] y_cpy;
+  if (x_cpy != x) delete[] x_cpy;
+  if (y_cpy != y) delete[] y_cpy;
 
   return 1;
 }
 
 /**  ZGERU  performs the rank 1 operation
-  *
-  *     A := alpha*x*y' + A,
-  *
-  *  where alpha is a scalar, x is an m element vector, y is an n element
-  *  vector and A is an m by n matrix.
-  */
-int EIGEN_BLAS_FUNC(geru)(int *m, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pa, int *lda)
-{
-  Scalar* x = reinterpret_cast<Scalar*>(px);
-  Scalar* y = reinterpret_cast<Scalar*>(py);
-  Scalar* a = reinterpret_cast<Scalar*>(pa);
-  Scalar alpha = *reinterpret_cast<Scalar*>(palpha);
+ *
+ *     A := alpha*x*y' + A,
+ *
+ *  where alpha is a scalar, x is an m element vector, y is an n element
+ *  vector and A is an m by n matrix.
+ */
+int EIGEN_BLAS_FUNC(geru)(int *m, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *py, int *incy,
+                          RealScalar *pa, int *lda) {
+  Scalar *x = reinterpret_cast<Scalar *>(px);
+  Scalar *y = reinterpret_cast<Scalar *>(py);
+  Scalar *a = reinterpret_cast<Scalar *>(pa);
+  Scalar alpha = *reinterpret_cast<Scalar *>(palpha);
 
   int info = 0;
-       if(*m<0)                                                       info = 1;
-  else if(*n<0)                                                       info = 2;
-  else if(*incx==0)                                                   info = 5;
-  else if(*incy==0)                                                   info = 7;
-  else if(*lda<std::max(1,*m))                                        info = 9;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"GERU ",&info,6);
+  if (*m < 0)
+    info = 1;
+  else if (*n < 0)
+    info = 2;
+  else if (*incx == 0)
+    info = 5;
+  else if (*incy == 0)
+    info = 7;
+  else if (*lda < std::max(1, *m))
+    info = 9;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "GERU ", &info, 6);
 
-  if(alpha==Scalar(0))
-    return 1;
+  if (alpha == Scalar(0)) return 1;
 
-  Scalar* x_cpy = get_compact_vector(x,*m,*incx);
-  Scalar* y_cpy = get_compact_vector(y,*n,*incy);
+  Scalar *x_cpy = get_compact_vector(x, *m, *incx);
+  Scalar *y_cpy = get_compact_vector(y, *n, *incy);
 
-  internal::general_rank1_update<Scalar,int,ColMajor,false,false>::run(*m, *n, a, *lda, x_cpy, y_cpy, alpha);
+  internal::general_rank1_update<Scalar, int, ColMajor, false, false>::run(*m, *n, a, *lda, x_cpy, y_cpy, alpha);
 
-  if(x_cpy!=x)  delete[] x_cpy;
-  if(y_cpy!=y)  delete[] y_cpy;
+  if (x_cpy != x) delete[] x_cpy;
+  if (y_cpy != y) delete[] y_cpy;
 
   return 1;
 }
 
 /**  ZGERC  performs the rank 1 operation
-  *
-  *     A := alpha*x*conjg( y' ) + A,
-  *
-  *  where alpha is a scalar, x is an m element vector, y is an n element
-  *  vector and A is an m by n matrix.
-  */
-int EIGEN_BLAS_FUNC(gerc)(int *m, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pa, int *lda)
-{
-  Scalar* x = reinterpret_cast<Scalar*>(px);
-  Scalar* y = reinterpret_cast<Scalar*>(py);
-  Scalar* a = reinterpret_cast<Scalar*>(pa);
-  Scalar alpha = *reinterpret_cast<Scalar*>(palpha);
+ *
+ *     A := alpha*x*conjg( y' ) + A,
+ *
+ *  where alpha is a scalar, x is an m element vector, y is an n element
+ *  vector and A is an m by n matrix.
+ */
+int EIGEN_BLAS_FUNC(gerc)(int *m, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *py, int *incy,
+                          RealScalar *pa, int *lda) {
+  Scalar *x = reinterpret_cast<Scalar *>(px);
+  Scalar *y = reinterpret_cast<Scalar *>(py);
+  Scalar *a = reinterpret_cast<Scalar *>(pa);
+  Scalar alpha = *reinterpret_cast<Scalar *>(palpha);
 
   int info = 0;
-       if(*m<0)                                                       info = 1;
-  else if(*n<0)                                                       info = 2;
-  else if(*incx==0)                                                   info = 5;
-  else if(*incy==0)                                                   info = 7;
-  else if(*lda<std::max(1,*m))                                        info = 9;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"GERC ",&info,6);
+  if (*m < 0)
+    info = 1;
+  else if (*n < 0)
+    info = 2;
+  else if (*incx == 0)
+    info = 5;
+  else if (*incy == 0)
+    info = 7;
+  else if (*lda < std::max(1, *m))
+    info = 9;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "GERC ", &info, 6);
 
-  if(alpha==Scalar(0))
-    return 1;
+  if (alpha == Scalar(0)) return 1;
 
-  Scalar* x_cpy = get_compact_vector(x,*m,*incx);
-  Scalar* y_cpy = get_compact_vector(y,*n,*incy);
+  Scalar *x_cpy = get_compact_vector(x, *m, *incx);
+  Scalar *y_cpy = get_compact_vector(y, *n, *incy);
 
-  internal::general_rank1_update<Scalar,int,ColMajor,false,Conj>::run(*m, *n, a, *lda, x_cpy, y_cpy, alpha);
+  internal::general_rank1_update<Scalar, int, ColMajor, false, Conj>::run(*m, *n, a, *lda, x_cpy, y_cpy, alpha);
 
-  if(x_cpy!=x)  delete[] x_cpy;
-  if(y_cpy!=y)  delete[] y_cpy;
+  if (x_cpy != x) delete[] x_cpy;
+  if (y_cpy != y) delete[] y_cpy;
 
   return 1;
 }
diff --git a/blas/level2_impl.h b/blas/level2_impl.h
index 173f40b..0138a9c 100644
--- a/blas/level2_impl.h
+++ b/blas/level2_impl.h
@@ -9,270 +9,273 @@
 
 #include "common.h"
 
-template<typename Index, typename Scalar, int StorageOrder, bool ConjugateLhs, bool ConjugateRhs>
-struct general_matrix_vector_product_wrapper
-{
-  static void run(Index rows, Index cols,const Scalar *lhs, Index lhsStride, const Scalar *rhs, Index rhsIncr, Scalar* res, Index resIncr, Scalar alpha)
-  {
-    typedef internal::const_blas_data_mapper<Scalar,Index,StorageOrder> LhsMapper;
-    typedef internal::const_blas_data_mapper<Scalar,Index,RowMajor> RhsMapper;
-    
-    internal::general_matrix_vector_product
-        <Index,Scalar,LhsMapper,StorageOrder,ConjugateLhs,Scalar,RhsMapper,ConjugateRhs>::run(
-        rows, cols, LhsMapper(lhs, lhsStride), RhsMapper(rhs, rhsIncr), res, resIncr, alpha);
+template <typename Index, typename Scalar, int StorageOrder, bool ConjugateLhs, bool ConjugateRhs>
+struct general_matrix_vector_product_wrapper {
+  static void run(Index rows, Index cols, const Scalar *lhs, Index lhsStride, const Scalar *rhs, Index rhsIncr,
+                  Scalar *res, Index resIncr, Scalar alpha) {
+    typedef internal::const_blas_data_mapper<Scalar, Index, StorageOrder> LhsMapper;
+    typedef internal::const_blas_data_mapper<Scalar, Index, RowMajor> RhsMapper;
+
+    internal::general_matrix_vector_product<Index, Scalar, LhsMapper, StorageOrder, ConjugateLhs, Scalar, RhsMapper,
+                                            ConjugateRhs>::run(rows, cols, LhsMapper(lhs, lhsStride),
+                                                               RhsMapper(rhs, rhsIncr), res, resIncr, alpha);
   }
 };
 
-int EIGEN_BLAS_FUNC(gemv)(const char *opa, const int *m, const int *n, const RealScalar *palpha,
-                          const RealScalar *pa, const int *lda, const RealScalar *pb, const int *incb, const RealScalar *pbeta, RealScalar *pc, const int *incc)
-{
-  typedef void (*functype)(int, int, const Scalar *, int, const Scalar *, int , Scalar *, int, Scalar);
-  static const functype func[4] = {
-    // array index: NOTR
-    (general_matrix_vector_product_wrapper<int,Scalar,ColMajor,false,false>::run),
-    // array index: TR  
-    (general_matrix_vector_product_wrapper<int,Scalar,RowMajor,false,false>::run),
-    // array index: ADJ 
-    (general_matrix_vector_product_wrapper<int,Scalar,RowMajor,Conj ,false>::run),
-    0
-  };
+int EIGEN_BLAS_FUNC(gemv)(const char *opa, const int *m, const int *n, const RealScalar *palpha, const RealScalar *pa,
+                          const int *lda, const RealScalar *pb, const int *incb, const RealScalar *pbeta,
+                          RealScalar *pc, const int *incc) {
+  typedef void (*functype)(int, int, const Scalar *, int, const Scalar *, int, Scalar *, int, Scalar);
+  static const functype func[4] = {// array index: NOTR
+                                   (general_matrix_vector_product_wrapper<int, Scalar, ColMajor, false, false>::run),
+                                   // array index: TR
+                                   (general_matrix_vector_product_wrapper<int, Scalar, RowMajor, false, false>::run),
+                                   // array index: ADJ
+                                   (general_matrix_vector_product_wrapper<int, Scalar, RowMajor, Conj, false>::run), 0};
 
-  const Scalar* a = reinterpret_cast<const Scalar*>(pa);
-  const Scalar* b = reinterpret_cast<const Scalar*>(pb);
-  Scalar* c = reinterpret_cast<Scalar*>(pc);
-  Scalar alpha  = *reinterpret_cast<const Scalar*>(palpha);
-  Scalar beta   = *reinterpret_cast<const Scalar*>(pbeta);
+  const Scalar *a = reinterpret_cast<const Scalar *>(pa);
+  const Scalar *b = reinterpret_cast<const Scalar *>(pb);
+  Scalar *c = reinterpret_cast<Scalar *>(pc);
+  Scalar alpha = *reinterpret_cast<const Scalar *>(palpha);
+  Scalar beta = *reinterpret_cast<const Scalar *>(pbeta);
 
   // check arguments
   int info = 0;
-  if(OP(*opa)==INVALID)           info = 1;
-  else if(*m<0)                   info = 2;
-  else if(*n<0)                   info = 3;
-  else if(*lda<std::max(1,*m))    info = 6;
-  else if(*incb==0)               info = 8;
-  else if(*incc==0)               info = 11;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"GEMV ",&info,6);
+  if (OP(*opa) == INVALID)
+    info = 1;
+  else if (*m < 0)
+    info = 2;
+  else if (*n < 0)
+    info = 3;
+  else if (*lda < std::max(1, *m))
+    info = 6;
+  else if (*incb == 0)
+    info = 8;
+  else if (*incc == 0)
+    info = 11;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "GEMV ", &info, 6);
 
-  if(*m==0 || *n==0 || (alpha==Scalar(0) && beta==Scalar(1)))
-    return 0;
+  if (*m == 0 || *n == 0 || (alpha == Scalar(0) && beta == Scalar(1))) return 0;
 
   int actual_m = *m;
   int actual_n = *n;
   int code = OP(*opa);
-  if(code!=NOTR)
-    std::swap(actual_m,actual_n);
+  if (code != NOTR) std::swap(actual_m, actual_n);
 
-  const Scalar* actual_b = get_compact_vector(b,actual_n,*incb);
-  Scalar* actual_c = get_compact_vector(c,actual_m,*incc);
+  const Scalar *actual_b = get_compact_vector(b, actual_n, *incb);
+  Scalar *actual_c = get_compact_vector(c, actual_m, *incc);
 
-  if(beta!=Scalar(1))
-  {
-    if(beta==Scalar(0)) make_vector(actual_c, actual_m).setZero();
-    else                make_vector(actual_c, actual_m) *= beta;
+  if (beta != Scalar(1)) {
+    if (beta == Scalar(0))
+      make_vector(actual_c, actual_m).setZero();
+    else
+      make_vector(actual_c, actual_m) *= beta;
   }
 
-  if(code>=4 || func[code]==0)
-    return 0;
+  if (code >= 4 || func[code] == 0) return 0;
 
   func[code](actual_m, actual_n, a, *lda, actual_b, 1, actual_c, 1, alpha);
 
-  if(actual_b!=b) delete[] actual_b;
-  if(actual_c!=c) delete[] copy_back(actual_c,c,actual_m,*incc);
+  if (actual_b != b) delete[] actual_b;
+  if (actual_c != c) delete[] copy_back(actual_c, c, actual_m, *incc);
 
   return 1;
 }
 
-int EIGEN_BLAS_FUNC(trsv)(const char *uplo, const char *opa, const char *diag, const int *n, const RealScalar *pa, const int *lda, RealScalar *pb, const int *incb)
-{
+int EIGEN_BLAS_FUNC(trsv)(const char *uplo, const char *opa, const char *diag, const int *n, const RealScalar *pa,
+                          const int *lda, RealScalar *pb, const int *incb) {
   typedef void (*functype)(int, const Scalar *, int, Scalar *);
   static const functype func[16] = {
-    // array index: NOTR  | (UP << 2) | (NUNIT << 3)
-    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|0,       false,ColMajor>::run),
-    // array index: TR    | (UP << 2) | (NUNIT << 3)
-    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|0,       false,RowMajor>::run),
-    // array index: ADJ   | (UP << 2) | (NUNIT << 3)
-    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|0,       Conj, RowMajor>::run),
-    0,
-    // array index: NOTR  | (LO << 2) | (NUNIT << 3)
-    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|0,       false,ColMajor>::run),
-    // array index: TR    | (LO << 2) | (NUNIT << 3)
-    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|0,       false,RowMajor>::run),
-    // array index: ADJ   | (LO << 2) | (NUNIT << 3)
-    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|0,       Conj, RowMajor>::run),
-    0,
-    // array index: NOTR  | (UP << 2) | (UNIT  << 3)
-    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|UnitDiag,false,ColMajor>::run),
-    // array index: TR    | (UP << 2) | (UNIT  << 3)
-    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|UnitDiag,false,RowMajor>::run),
-    // array index: ADJ   | (UP << 2) | (UNIT  << 3)
-    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|UnitDiag,Conj, RowMajor>::run),
-    0,
-    // array index: NOTR  | (LO << 2) | (UNIT  << 3)
-    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|UnitDiag,false,ColMajor>::run),
-    // array index: TR    | (LO << 2) | (UNIT  << 3)
-    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|UnitDiag,false,RowMajor>::run),
-    // array index: ADJ   | (LO << 2) | (UNIT  << 3)
-    (internal::triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|UnitDiag,Conj, RowMajor>::run),
-    0
-  };
+      // array index: NOTR  | (UP << 2) | (NUNIT << 3)
+      (internal::triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Upper | 0, false, ColMajor>::run),
+      // array index: TR    | (UP << 2) | (NUNIT << 3)
+      (internal::triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Lower | 0, false, RowMajor>::run),
+      // array index: ADJ   | (UP << 2) | (NUNIT << 3)
+      (internal::triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Lower | 0, Conj, RowMajor>::run), 0,
+      // array index: NOTR  | (LO << 2) | (NUNIT << 3)
+      (internal::triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Lower | 0, false, ColMajor>::run),
+      // array index: TR    | (LO << 2) | (NUNIT << 3)
+      (internal::triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Upper | 0, false, RowMajor>::run),
+      // array index: ADJ   | (LO << 2) | (NUNIT << 3)
+      (internal::triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Upper | 0, Conj, RowMajor>::run), 0,
+      // array index: NOTR  | (UP << 2) | (UNIT  << 3)
+      (internal::triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Upper | UnitDiag, false, ColMajor>::run),
+      // array index: TR    | (UP << 2) | (UNIT  << 3)
+      (internal::triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Lower | UnitDiag, false, RowMajor>::run),
+      // array index: ADJ   | (UP << 2) | (UNIT  << 3)
+      (internal::triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Lower | UnitDiag, Conj, RowMajor>::run), 0,
+      // array index: NOTR  | (LO << 2) | (UNIT  << 3)
+      (internal::triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Lower | UnitDiag, false, ColMajor>::run),
+      // array index: TR    | (LO << 2) | (UNIT  << 3)
+      (internal::triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Upper | UnitDiag, false, RowMajor>::run),
+      // array index: ADJ   | (LO << 2) | (UNIT  << 3)
+      (internal::triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Upper | UnitDiag, Conj, RowMajor>::run), 0};
 
-  const Scalar* a = reinterpret_cast<const Scalar*>(pa);
-  Scalar* b = reinterpret_cast<Scalar*>(pb);
+  const Scalar *a = reinterpret_cast<const Scalar *>(pa);
+  Scalar *b = reinterpret_cast<Scalar *>(pb);
 
   int info = 0;
-  if(UPLO(*uplo)==INVALID)                                            info = 1;
-  else if(OP(*opa)==INVALID)                                          info = 2;
-  else if(DIAG(*diag)==INVALID)                                       info = 3;
-  else if(*n<0)                                                       info = 4;
-  else if(*lda<std::max(1,*n))                                        info = 6;
-  else if(*incb==0)                                                   info = 8;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"TRSV ",&info,6);
+  if (UPLO(*uplo) == INVALID)
+    info = 1;
+  else if (OP(*opa) == INVALID)
+    info = 2;
+  else if (DIAG(*diag) == INVALID)
+    info = 3;
+  else if (*n < 0)
+    info = 4;
+  else if (*lda < std::max(1, *n))
+    info = 6;
+  else if (*incb == 0)
+    info = 8;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "TRSV ", &info, 6);
 
-  Scalar* actual_b = get_compact_vector(b,*n,*incb);
+  Scalar *actual_b = get_compact_vector(b, *n, *incb);
 
   int code = OP(*opa) | (UPLO(*uplo) << 2) | (DIAG(*diag) << 3);
   func[code](*n, a, *lda, actual_b);
 
-  if(actual_b!=b) delete[] copy_back(actual_b,b,*n,*incb);
+  if (actual_b != b) delete[] copy_back(actual_b, b, *n, *incb);
 
   return 0;
 }
 
-
-
-int EIGEN_BLAS_FUNC(trmv)(const char *uplo, const char *opa, const char *diag, const int *n, const RealScalar *pa, const int *lda, RealScalar *pb, const int *incb)
-{
-  typedef void (*functype)(int, int, const Scalar *, int, const Scalar *, int, Scalar *, int, const Scalar&);
+int EIGEN_BLAS_FUNC(trmv)(const char *uplo, const char *opa, const char *diag, const int *n, const RealScalar *pa,
+                          const int *lda, RealScalar *pb, const int *incb) {
+  typedef void (*functype)(int, int, const Scalar *, int, const Scalar *, int, Scalar *, int, const Scalar &);
   static const functype func[16] = {
-    // array index: NOTR  | (UP << 2) | (NUNIT << 3)
-    (internal::triangular_matrix_vector_product<int,Upper|0,       Scalar,false,Scalar,false,ColMajor>::run),
-    // array index: TR    | (UP << 2) | (NUNIT << 3)
-    (internal::triangular_matrix_vector_product<int,Lower|0,       Scalar,false,Scalar,false,RowMajor>::run),
-    // array index: ADJ   | (UP << 2) | (NUNIT << 3)
-    (internal::triangular_matrix_vector_product<int,Lower|0,       Scalar,Conj, Scalar,false,RowMajor>::run),
-    0,
-    // array index: NOTR  | (LO << 2) | (NUNIT << 3)
-    (internal::triangular_matrix_vector_product<int,Lower|0,       Scalar,false,Scalar,false,ColMajor>::run),
-    // array index: TR    | (LO << 2) | (NUNIT << 3)
-    (internal::triangular_matrix_vector_product<int,Upper|0,       Scalar,false,Scalar,false,RowMajor>::run),
-    // array index: ADJ   | (LO << 2) | (NUNIT << 3)
-    (internal::triangular_matrix_vector_product<int,Upper|0,       Scalar,Conj, Scalar,false,RowMajor>::run),
-    0,
-    // array index: NOTR  | (UP << 2) | (UNIT  << 3)
-    (internal::triangular_matrix_vector_product<int,Upper|UnitDiag,Scalar,false,Scalar,false,ColMajor>::run),
-    // array index: TR    | (UP << 2) | (UNIT  << 3)
-    (internal::triangular_matrix_vector_product<int,Lower|UnitDiag,Scalar,false,Scalar,false,RowMajor>::run),
-    // array index: ADJ   | (UP << 2) | (UNIT  << 3)
-    (internal::triangular_matrix_vector_product<int,Lower|UnitDiag,Scalar,Conj, Scalar,false,RowMajor>::run),
-    0,
-    // array index: NOTR  | (LO << 2) | (UNIT  << 3)
-    (internal::triangular_matrix_vector_product<int,Lower|UnitDiag,Scalar,false,Scalar,false,ColMajor>::run),
-    // array index: TR    | (LO << 2) | (UNIT  << 3)
-    (internal::triangular_matrix_vector_product<int,Upper|UnitDiag,Scalar,false,Scalar,false,RowMajor>::run),
-    // array index: ADJ   | (LO << 2) | (UNIT  << 3)
-    (internal::triangular_matrix_vector_product<int,Upper|UnitDiag,Scalar,Conj, Scalar,false,RowMajor>::run),
-    0
-  };
+      // array index: NOTR  | (UP << 2) | (NUNIT << 3)
+      (internal::triangular_matrix_vector_product<int, Upper | 0, Scalar, false, Scalar, false, ColMajor>::run),
+      // array index: TR    | (UP << 2) | (NUNIT << 3)
+      (internal::triangular_matrix_vector_product<int, Lower | 0, Scalar, false, Scalar, false, RowMajor>::run),
+      // array index: ADJ   | (UP << 2) | (NUNIT << 3)
+      (internal::triangular_matrix_vector_product<int, Lower | 0, Scalar, Conj, Scalar, false, RowMajor>::run), 0,
+      // array index: NOTR  | (LO << 2) | (NUNIT << 3)
+      (internal::triangular_matrix_vector_product<int, Lower | 0, Scalar, false, Scalar, false, ColMajor>::run),
+      // array index: TR    | (LO << 2) | (NUNIT << 3)
+      (internal::triangular_matrix_vector_product<int, Upper | 0, Scalar, false, Scalar, false, RowMajor>::run),
+      // array index: ADJ   | (LO << 2) | (NUNIT << 3)
+      (internal::triangular_matrix_vector_product<int, Upper | 0, Scalar, Conj, Scalar, false, RowMajor>::run), 0,
+      // array index: NOTR  | (UP << 2) | (UNIT  << 3)
+      (internal::triangular_matrix_vector_product<int, Upper | UnitDiag, Scalar, false, Scalar, false, ColMajor>::run),
+      // array index: TR    | (UP << 2) | (UNIT  << 3)
+      (internal::triangular_matrix_vector_product<int, Lower | UnitDiag, Scalar, false, Scalar, false, RowMajor>::run),
+      // array index: ADJ   | (UP << 2) | (UNIT  << 3)
+      (internal::triangular_matrix_vector_product<int, Lower | UnitDiag, Scalar, Conj, Scalar, false, RowMajor>::run),
+      0,
+      // array index: NOTR  | (LO << 2) | (UNIT  << 3)
+      (internal::triangular_matrix_vector_product<int, Lower | UnitDiag, Scalar, false, Scalar, false, ColMajor>::run),
+      // array index: TR    | (LO << 2) | (UNIT  << 3)
+      (internal::triangular_matrix_vector_product<int, Upper | UnitDiag, Scalar, false, Scalar, false, RowMajor>::run),
+      // array index: ADJ   | (LO << 2) | (UNIT  << 3)
+      (internal::triangular_matrix_vector_product<int, Upper | UnitDiag, Scalar, Conj, Scalar, false, RowMajor>::run),
+      0};
 
-  const Scalar* a = reinterpret_cast<const Scalar*>(pa);
-  Scalar* b = reinterpret_cast<Scalar*>(pb);
+  const Scalar *a = reinterpret_cast<const Scalar *>(pa);
+  Scalar *b = reinterpret_cast<Scalar *>(pb);
 
   int info = 0;
-  if(UPLO(*uplo)==INVALID)                                            info = 1;
-  else if(OP(*opa)==INVALID)                                          info = 2;
-  else if(DIAG(*diag)==INVALID)                                       info = 3;
-  else if(*n<0)                                                       info = 4;
-  else if(*lda<std::max(1,*n))                                        info = 6;
-  else if(*incb==0)                                                   info = 8;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"TRMV ",&info,6);
+  if (UPLO(*uplo) == INVALID)
+    info = 1;
+  else if (OP(*opa) == INVALID)
+    info = 2;
+  else if (DIAG(*diag) == INVALID)
+    info = 3;
+  else if (*n < 0)
+    info = 4;
+  else if (*lda < std::max(1, *n))
+    info = 6;
+  else if (*incb == 0)
+    info = 8;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "TRMV ", &info, 6);
 
-  if(*n==0)
-    return 1;
+  if (*n == 0) return 1;
 
-  Scalar* actual_b = get_compact_vector(b,*n,*incb);
-  Matrix<Scalar,Dynamic,1> res(*n);
+  Scalar *actual_b = get_compact_vector(b, *n, *incb);
+  Matrix<Scalar, Dynamic, 1> res(*n);
   res.setZero();
 
   int code = OP(*opa) | (UPLO(*uplo) << 2) | (DIAG(*diag) << 3);
-  if(code>=16 || func[code]==0)
-    return 0;
+  if (code >= 16 || func[code] == 0) return 0;
 
   func[code](*n, *n, a, *lda, actual_b, 1, res.data(), 1, Scalar(1));
 
-  copy_back(res.data(),b,*n,*incb);
-  if(actual_b!=b) delete[] actual_b;
+  copy_back(res.data(), b, *n, *incb);
+  if (actual_b != b) delete[] actual_b;
 
   return 1;
 }
 
 /**  GBMV  performs one of the matrix-vector operations
-  *
-  *     y := alpha*A*x + beta*y,   or   y := alpha*A'*x + beta*y,
-  *
-  *  where alpha and beta are scalars, x and y are vectors and A is an
-  *  m by n band matrix, with kl sub-diagonals and ku super-diagonals.
-  */
+ *
+ *     y := alpha*A*x + beta*y,   or   y := alpha*A'*x + beta*y,
+ *
+ *  where alpha and beta are scalars, x and y are vectors and A is an
+ *  m by n band matrix, with kl sub-diagonals and ku super-diagonals.
+ */
 int EIGEN_BLAS_FUNC(gbmv)(char *trans, int *m, int *n, int *kl, int *ku, RealScalar *palpha, RealScalar *pa, int *lda,
-                          RealScalar *px, int *incx, RealScalar *pbeta, RealScalar *py, int *incy)
-{
-  const Scalar* a = reinterpret_cast<const Scalar*>(pa);
-  const Scalar* x = reinterpret_cast<const Scalar*>(px);
-  Scalar* y = reinterpret_cast<Scalar*>(py);
-  Scalar alpha = *reinterpret_cast<const Scalar*>(palpha);
-  Scalar beta = *reinterpret_cast<const Scalar*>(pbeta);
-  int coeff_rows = *kl+*ku+1;
+                          RealScalar *px, int *incx, RealScalar *pbeta, RealScalar *py, int *incy) {
+  const Scalar *a = reinterpret_cast<const Scalar *>(pa);
+  const Scalar *x = reinterpret_cast<const Scalar *>(px);
+  Scalar *y = reinterpret_cast<Scalar *>(py);
+  Scalar alpha = *reinterpret_cast<const Scalar *>(palpha);
+  Scalar beta = *reinterpret_cast<const Scalar *>(pbeta);
+  int coeff_rows = *kl + *ku + 1;
 
   int info = 0;
-       if(OP(*trans)==INVALID)                                        info = 1;
-  else if(*m<0)                                                       info = 2;
-  else if(*n<0)                                                       info = 3;
-  else if(*kl<0)                                                      info = 4;
-  else if(*ku<0)                                                      info = 5;
-  else if(*lda<coeff_rows)                                            info = 8;
-  else if(*incx==0)                                                   info = 10;
-  else if(*incy==0)                                                   info = 13;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"GBMV ",&info,6);
+  if (OP(*trans) == INVALID)
+    info = 1;
+  else if (*m < 0)
+    info = 2;
+  else if (*n < 0)
+    info = 3;
+  else if (*kl < 0)
+    info = 4;
+  else if (*ku < 0)
+    info = 5;
+  else if (*lda < coeff_rows)
+    info = 8;
+  else if (*incx == 0)
+    info = 10;
+  else if (*incy == 0)
+    info = 13;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "GBMV ", &info, 6);
 
-  if(*m==0 || *n==0 || (alpha==Scalar(0) && beta==Scalar(1)))
-    return 0;
+  if (*m == 0 || *n == 0 || (alpha == Scalar(0) && beta == Scalar(1))) return 0;
 
   int actual_m = *m;
   int actual_n = *n;
-  if(OP(*trans)!=NOTR)
-    std::swap(actual_m,actual_n);
+  if (OP(*trans) != NOTR) std::swap(actual_m, actual_n);
 
-  const Scalar* actual_x = get_compact_vector(x,actual_n,*incx);
-  Scalar* actual_y = get_compact_vector(y,actual_m,*incy);
+  const Scalar *actual_x = get_compact_vector(x, actual_n, *incx);
+  Scalar *actual_y = get_compact_vector(y, actual_m, *incy);
 
-  if(beta!=Scalar(1))
-  {
-    if(beta==Scalar(0)) make_vector(actual_y, actual_m).setZero();
-    else                make_vector(actual_y, actual_m) *= beta;
+  if (beta != Scalar(1)) {
+    if (beta == Scalar(0))
+      make_vector(actual_y, actual_m).setZero();
+    else
+      make_vector(actual_y, actual_m) *= beta;
   }
 
-  ConstMatrixType mat_coeffs(a,coeff_rows,*n,*lda);
+  ConstMatrixType mat_coeffs(a, coeff_rows, *n, *lda);
 
-  int nb = std::min(*n,(*m)+(*ku));
-  for(int j=0; j<nb; ++j)
-  {
-    int start = std::max(0,j - *ku);
-    int end = std::min((*m)-1,j + *kl);
+  int nb = std::min(*n, (*m) + (*ku));
+  for (int j = 0; j < nb; ++j) {
+    int start = std::max(0, j - *ku);
+    int end = std::min((*m) - 1, j + *kl);
     int len = end - start + 1;
     int offset = (*ku) - j + start;
-    if(OP(*trans)==NOTR)
-      make_vector(actual_y+start,len) += (alpha*actual_x[j]) * mat_coeffs.col(j).segment(offset,len);
-    else if(OP(*trans)==TR)
-      actual_y[j] += alpha * ( mat_coeffs.col(j).segment(offset,len).transpose() * make_vector(actual_x+start,len) ).value();
+    if (OP(*trans) == NOTR)
+      make_vector(actual_y + start, len) += (alpha * actual_x[j]) * mat_coeffs.col(j).segment(offset, len);
+    else if (OP(*trans) == TR)
+      actual_y[j] +=
+          alpha * (mat_coeffs.col(j).segment(offset, len).transpose() * make_vector(actual_x + start, len)).value();
     else
-      actual_y[j] += alpha * ( mat_coeffs.col(j).segment(offset,len).adjoint()   * make_vector(actual_x+start,len) ).value();
+      actual_y[j] +=
+          alpha * (mat_coeffs.col(j).segment(offset, len).adjoint() * make_vector(actual_x + start, len)).value();
   }
 
-  if(actual_x!=x) delete[] actual_x;
-  if(actual_y!=y) delete[] copy_back(actual_y,y,actual_m,*incy);
+  if (actual_x != x) delete[] actual_x;
+  if (actual_y != y) delete[] copy_back(actual_y, y, actual_m, *incy);
 
   return 0;
 }
@@ -337,217 +340,231 @@
 #endif
 
 /**  DTBSV  solves one of the systems of equations
-  *
-  *     A*x = b,   or   A'*x = b,
-  *
-  *  where b and x are n element vectors and A is an n by n unit, or
-  *  non-unit, upper or lower triangular band matrix, with ( k + 1 )
-  *  diagonals.
-  *
-  *  No test for singularity or near-singularity is included in this
-  *  routine. Such tests must be performed before calling this routine.
-  */
-int EIGEN_BLAS_FUNC(tbsv)(char *uplo, char *op, char *diag, int *n, int *k, RealScalar *pa, int *lda, RealScalar *px, int *incx)
-{
+ *
+ *     A*x = b,   or   A'*x = b,
+ *
+ *  where b and x are n element vectors and A is an n by n unit, or
+ *  non-unit, upper or lower triangular band matrix, with ( k + 1 )
+ *  diagonals.
+ *
+ *  No test for singularity or near-singularity is included in this
+ *  routine. Such tests must be performed before calling this routine.
+ */
+int EIGEN_BLAS_FUNC(tbsv)(char *uplo, char *op, char *diag, int *n, int *k, RealScalar *pa, int *lda, RealScalar *px,
+                          int *incx) {
   typedef void (*functype)(int, int, const Scalar *, int, Scalar *);
   static const functype func[16] = {
-    // array index: NOTR  | (UP << 2) | (NUNIT << 3)
-    (internal::band_solve_triangular_selector<int,Upper|0,       Scalar,false,Scalar,ColMajor>::run),
-    // array index: TR    | (UP << 2) | (NUNIT << 3)
-    (internal::band_solve_triangular_selector<int,Lower|0,       Scalar,false,Scalar,RowMajor>::run),
-    // array index: ADJ   | (UP << 2) | (NUNIT << 3)
-    (internal::band_solve_triangular_selector<int,Lower|0,       Scalar,Conj, Scalar,RowMajor>::run),
-    0,
-    // array index: NOTR  | (LO << 2) | (NUNIT << 3)
-    (internal::band_solve_triangular_selector<int,Lower|0,       Scalar,false,Scalar,ColMajor>::run),
-    // array index: TR    | (LO << 2) | (NUNIT << 3)
-    (internal::band_solve_triangular_selector<int,Upper|0,       Scalar,false,Scalar,RowMajor>::run),
-    // array index: ADJ   | (LO << 2) | (NUNIT << 3)
-    (internal::band_solve_triangular_selector<int,Upper|0,       Scalar,Conj, Scalar,RowMajor>::run),
-    0,
-    // array index: NOTR  | (UP << 2) | (UNIT  << 3)
-    (internal::band_solve_triangular_selector<int,Upper|UnitDiag,Scalar,false,Scalar,ColMajor>::run),
-    // array index: TR    | (UP << 2) | (UNIT  << 3)
-    (internal::band_solve_triangular_selector<int,Lower|UnitDiag,Scalar,false,Scalar,RowMajor>::run),
-    // array index: ADJ   | (UP << 2) | (UNIT  << 3)
-    (internal::band_solve_triangular_selector<int,Lower|UnitDiag,Scalar,Conj, Scalar,RowMajor>::run),
-    0,
-    // array index: NOTR  | (LO << 2) | (UNIT  << 3)
-    (internal::band_solve_triangular_selector<int,Lower|UnitDiag,Scalar,false,Scalar,ColMajor>::run),
-    // array index: TR    | (LO << 2) | (UNIT  << 3)
-    (internal::band_solve_triangular_selector<int,Upper|UnitDiag,Scalar,false,Scalar,RowMajor>::run),
-    // array index: ADJ   | (LO << 2) | (UNIT  << 3)
-    (internal::band_solve_triangular_selector<int,Upper|UnitDiag,Scalar,Conj, Scalar,RowMajor>::run),
-    0,
+      // array index: NOTR  | (UP << 2) | (NUNIT << 3)
+      (internal::band_solve_triangular_selector<int, Upper | 0, Scalar, false, Scalar, ColMajor>::run),
+      // array index: TR    | (UP << 2) | (NUNIT << 3)
+      (internal::band_solve_triangular_selector<int, Lower | 0, Scalar, false, Scalar, RowMajor>::run),
+      // array index: ADJ   | (UP << 2) | (NUNIT << 3)
+      (internal::band_solve_triangular_selector<int, Lower | 0, Scalar, Conj, Scalar, RowMajor>::run),
+      0,
+      // array index: NOTR  | (LO << 2) | (NUNIT << 3)
+      (internal::band_solve_triangular_selector<int, Lower | 0, Scalar, false, Scalar, ColMajor>::run),
+      // array index: TR    | (LO << 2) | (NUNIT << 3)
+      (internal::band_solve_triangular_selector<int, Upper | 0, Scalar, false, Scalar, RowMajor>::run),
+      // array index: ADJ   | (LO << 2) | (NUNIT << 3)
+      (internal::band_solve_triangular_selector<int, Upper | 0, Scalar, Conj, Scalar, RowMajor>::run),
+      0,
+      // array index: NOTR  | (UP << 2) | (UNIT  << 3)
+      (internal::band_solve_triangular_selector<int, Upper | UnitDiag, Scalar, false, Scalar, ColMajor>::run),
+      // array index: TR    | (UP << 2) | (UNIT  << 3)
+      (internal::band_solve_triangular_selector<int, Lower | UnitDiag, Scalar, false, Scalar, RowMajor>::run),
+      // array index: ADJ   | (UP << 2) | (UNIT  << 3)
+      (internal::band_solve_triangular_selector<int, Lower | UnitDiag, Scalar, Conj, Scalar, RowMajor>::run),
+      0,
+      // array index: NOTR  | (LO << 2) | (UNIT  << 3)
+      (internal::band_solve_triangular_selector<int, Lower | UnitDiag, Scalar, false, Scalar, ColMajor>::run),
+      // array index: TR    | (LO << 2) | (UNIT  << 3)
+      (internal::band_solve_triangular_selector<int, Upper | UnitDiag, Scalar, false, Scalar, RowMajor>::run),
+      // array index: ADJ   | (LO << 2) | (UNIT  << 3)
+      (internal::band_solve_triangular_selector<int, Upper | UnitDiag, Scalar, Conj, Scalar, RowMajor>::run),
+      0,
   };
 
-  Scalar* a = reinterpret_cast<Scalar*>(pa);
-  Scalar* x = reinterpret_cast<Scalar*>(px);
-  int coeff_rows = *k+1;
+  Scalar *a = reinterpret_cast<Scalar *>(pa);
+  Scalar *x = reinterpret_cast<Scalar *>(px);
+  int coeff_rows = *k + 1;
 
   int info = 0;
-       if(UPLO(*uplo)==INVALID)                                       info = 1;
-  else if(OP(*op)==INVALID)                                           info = 2;
-  else if(DIAG(*diag)==INVALID)                                       info = 3;
-  else if(*n<0)                                                       info = 4;
-  else if(*k<0)                                                       info = 5;
-  else if(*lda<coeff_rows)                                            info = 7;
-  else if(*incx==0)                                                   info = 9;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"TBSV ",&info,6);
+  if (UPLO(*uplo) == INVALID)
+    info = 1;
+  else if (OP(*op) == INVALID)
+    info = 2;
+  else if (DIAG(*diag) == INVALID)
+    info = 3;
+  else if (*n < 0)
+    info = 4;
+  else if (*k < 0)
+    info = 5;
+  else if (*lda < coeff_rows)
+    info = 7;
+  else if (*incx == 0)
+    info = 9;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "TBSV ", &info, 6);
 
-  if(*n==0 || (*k==0 && DIAG(*diag)==UNIT))
-    return 0;
+  if (*n == 0 || (*k == 0 && DIAG(*diag) == UNIT)) return 0;
 
   int actual_n = *n;
 
-  Scalar* actual_x = get_compact_vector(x,actual_n,*incx);
+  Scalar *actual_x = get_compact_vector(x, actual_n, *incx);
 
   int code = OP(*op) | (UPLO(*uplo) << 2) | (DIAG(*diag) << 3);
-  if(code>=16 || func[code]==0)
-    return 0;
+  if (code >= 16 || func[code] == 0) return 0;
 
   func[code](*n, *k, a, *lda, actual_x);
 
-  if(actual_x!=x) delete[] copy_back(actual_x,x,actual_n,*incx);
+  if (actual_x != x) delete[] copy_back(actual_x, x, actual_n, *incx);
 
   return 0;
 }
 
 /**  DTPMV  performs one of the matrix-vector operations
-  *
-  *     x := A*x,   or   x := A'*x,
-  *
-  *  where x is an n element vector and  A is an n by n unit, or non-unit,
-  *  upper or lower triangular matrix, supplied in packed form.
-  */
-int EIGEN_BLAS_FUNC(tpmv)(char *uplo, char *opa, char *diag, int *n, RealScalar *pap, RealScalar *px, int *incx)
-{
-  typedef void (*functype)(int, const Scalar*, const Scalar*, Scalar*, Scalar);
+ *
+ *     x := A*x,   or   x := A'*x,
+ *
+ *  where x is an n element vector and  A is an n by n unit, or non-unit,
+ *  upper or lower triangular matrix, supplied in packed form.
+ */
+int EIGEN_BLAS_FUNC(tpmv)(char *uplo, char *opa, char *diag, int *n, RealScalar *pap, RealScalar *px, int *incx) {
+  typedef void (*functype)(int, const Scalar *, const Scalar *, Scalar *, Scalar);
   static const functype func[16] = {
-    // array index: NOTR  | (UP << 2) | (NUNIT << 3)
-    (internal::packed_triangular_matrix_vector_product<int,Upper|0,       Scalar,false,Scalar,false,ColMajor>::run),
-    // array index: TR    | (UP << 2) | (NUNIT << 3)
-    (internal::packed_triangular_matrix_vector_product<int,Lower|0,       Scalar,false,Scalar,false,RowMajor>::run),
-    // array index: ADJ   | (UP << 2) | (NUNIT << 3)
-    (internal::packed_triangular_matrix_vector_product<int,Lower|0,       Scalar,Conj, Scalar,false,RowMajor>::run),
-    0,
-    // array index: NOTR  | (LO << 2) | (NUNIT << 3)
-    (internal::packed_triangular_matrix_vector_product<int,Lower|0,       Scalar,false,Scalar,false,ColMajor>::run),
-    // array index: TR    | (LO << 2) | (NUNIT << 3)
-    (internal::packed_triangular_matrix_vector_product<int,Upper|0,       Scalar,false,Scalar,false,RowMajor>::run),
-    // array index: ADJ   | (LO << 2) | (NUNIT << 3)
-    (internal::packed_triangular_matrix_vector_product<int,Upper|0,       Scalar,Conj, Scalar,false,RowMajor>::run),
-    0,
-    // array index: NOTR  | (UP << 2) | (UNIT  << 3)
-    (internal::packed_triangular_matrix_vector_product<int,Upper|UnitDiag,Scalar,false,Scalar,false,ColMajor>::run),
-    // array index: TR    | (UP << 2) | (UNIT  << 3)
-    (internal::packed_triangular_matrix_vector_product<int,Lower|UnitDiag,Scalar,false,Scalar,false,RowMajor>::run),
-    // array index: ADJ   | (UP << 2) | (UNIT  << 3)
-    (internal::packed_triangular_matrix_vector_product<int,Lower|UnitDiag,Scalar,Conj, Scalar,false,RowMajor>::run),
-    0,
-    // array index: NOTR  | (LO << 2) | (UNIT  << 3)
-    (internal::packed_triangular_matrix_vector_product<int,Lower|UnitDiag,Scalar,false,Scalar,false,ColMajor>::run),
-    // array index: TR    | (LO << 2) | (UNIT  << 3)
-    (internal::packed_triangular_matrix_vector_product<int,Upper|UnitDiag,Scalar,false,Scalar,false,RowMajor>::run),
-    // array index: ADJ   | (LO << 2) | (UNIT  << 3)
-    (internal::packed_triangular_matrix_vector_product<int,Upper|UnitDiag,Scalar,Conj, Scalar,false,RowMajor>::run),
-    0
-  };
+      // array index: NOTR  | (UP << 2) | (NUNIT << 3)
+      (internal::packed_triangular_matrix_vector_product<int, Upper | 0, Scalar, false, Scalar, false, ColMajor>::run),
+      // array index: TR    | (UP << 2) | (NUNIT << 3)
+      (internal::packed_triangular_matrix_vector_product<int, Lower | 0, Scalar, false, Scalar, false, RowMajor>::run),
+      // array index: ADJ   | (UP << 2) | (NUNIT << 3)
+      (internal::packed_triangular_matrix_vector_product<int, Lower | 0, Scalar, Conj, Scalar, false, RowMajor>::run),
+      0,
+      // array index: NOTR  | (LO << 2) | (NUNIT << 3)
+      (internal::packed_triangular_matrix_vector_product<int, Lower | 0, Scalar, false, Scalar, false, ColMajor>::run),
+      // array index: TR    | (LO << 2) | (NUNIT << 3)
+      (internal::packed_triangular_matrix_vector_product<int, Upper | 0, Scalar, false, Scalar, false, RowMajor>::run),
+      // array index: ADJ   | (LO << 2) | (NUNIT << 3)
+      (internal::packed_triangular_matrix_vector_product<int, Upper | 0, Scalar, Conj, Scalar, false, RowMajor>::run),
+      0,
+      // array index: NOTR  | (UP << 2) | (UNIT  << 3)
+      (internal::packed_triangular_matrix_vector_product<int, Upper | UnitDiag, Scalar, false, Scalar, false,
+                                                         ColMajor>::run),
+      // array index: TR    | (UP << 2) | (UNIT  << 3)
+      (internal::packed_triangular_matrix_vector_product<int, Lower | UnitDiag, Scalar, false, Scalar, false,
+                                                         RowMajor>::run),
+      // array index: ADJ   | (UP << 2) | (UNIT  << 3)
+      (internal::packed_triangular_matrix_vector_product<int, Lower | UnitDiag, Scalar, Conj, Scalar, false,
+                                                         RowMajor>::run),
+      0,
+      // array index: NOTR  | (LO << 2) | (UNIT  << 3)
+      (internal::packed_triangular_matrix_vector_product<int, Lower | UnitDiag, Scalar, false, Scalar, false,
+                                                         ColMajor>::run),
+      // array index: TR    | (LO << 2) | (UNIT  << 3)
+      (internal::packed_triangular_matrix_vector_product<int, Upper | UnitDiag, Scalar, false, Scalar, false,
+                                                         RowMajor>::run),
+      // array index: ADJ   | (LO << 2) | (UNIT  << 3)
+      (internal::packed_triangular_matrix_vector_product<int, Upper | UnitDiag, Scalar, Conj, Scalar, false,
+                                                         RowMajor>::run),
+      0};
 
-  Scalar* ap = reinterpret_cast<Scalar*>(pap);
-  Scalar* x = reinterpret_cast<Scalar*>(px);
+  Scalar *ap = reinterpret_cast<Scalar *>(pap);
+  Scalar *x = reinterpret_cast<Scalar *>(px);
 
   int info = 0;
-  if(UPLO(*uplo)==INVALID)                                            info = 1;
-  else if(OP(*opa)==INVALID)                                          info = 2;
-  else if(DIAG(*diag)==INVALID)                                       info = 3;
-  else if(*n<0)                                                       info = 4;
-  else if(*incx==0)                                                   info = 7;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"TPMV ",&info,6);
+  if (UPLO(*uplo) == INVALID)
+    info = 1;
+  else if (OP(*opa) == INVALID)
+    info = 2;
+  else if (DIAG(*diag) == INVALID)
+    info = 3;
+  else if (*n < 0)
+    info = 4;
+  else if (*incx == 0)
+    info = 7;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "TPMV ", &info, 6);
 
-  if(*n==0)
-    return 1;
+  if (*n == 0) return 1;
 
-  Scalar* actual_x = get_compact_vector(x,*n,*incx);
-  Matrix<Scalar,Dynamic,1> res(*n);
+  Scalar *actual_x = get_compact_vector(x, *n, *incx);
+  Matrix<Scalar, Dynamic, 1> res(*n);
   res.setZero();
 
   int code = OP(*opa) | (UPLO(*uplo) << 2) | (DIAG(*diag) << 3);
-  if(code>=16 || func[code]==0)
-    return 0;
+  if (code >= 16 || func[code] == 0) return 0;
 
   func[code](*n, ap, actual_x, res.data(), Scalar(1));
 
-  copy_back(res.data(),x,*n,*incx);
-  if(actual_x!=x) delete[] actual_x;
+  copy_back(res.data(), x, *n, *incx);
+  if (actual_x != x) delete[] actual_x;
 
   return 1;
 }
 
 /**  DTPSV  solves one of the systems of equations
-  *
-  *     A*x = b,   or   A'*x = b,
-  *
-  *  where b and x are n element vectors and A is an n by n unit, or
-  *  non-unit, upper or lower triangular matrix, supplied in packed form.
-  *
-  *  No test for singularity or near-singularity is included in this
-  *  routine. Such tests must be performed before calling this routine.
-  */
-int EIGEN_BLAS_FUNC(tpsv)(char *uplo, char *opa, char *diag, int *n, RealScalar *pap, RealScalar *px, int *incx)
-{
-  typedef void (*functype)(int, const Scalar*, Scalar*);
+ *
+ *     A*x = b,   or   A'*x = b,
+ *
+ *  where b and x are n element vectors and A is an n by n unit, or
+ *  non-unit, upper or lower triangular matrix, supplied in packed form.
+ *
+ *  No test for singularity or near-singularity is included in this
+ *  routine. Such tests must be performed before calling this routine.
+ */
+int EIGEN_BLAS_FUNC(tpsv)(char *uplo, char *opa, char *diag, int *n, RealScalar *pap, RealScalar *px, int *incx) {
+  typedef void (*functype)(int, const Scalar *, Scalar *);
   static const functype func[16] = {
-    // array index: NOTR  | (UP << 2) | (NUNIT << 3)
-    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|0,       false,ColMajor>::run),
-    // array index: TR    | (UP << 2) | (NUNIT << 3)
-    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|0,       false,RowMajor>::run),
-    // array index: ADJ   | (UP << 2) | (NUNIT << 3)
-    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|0,       Conj, RowMajor>::run),
-    0,
-    // array index: NOTR  | (LO << 2) | (NUNIT << 3)
-    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|0,       false,ColMajor>::run),
-    // array index: TR    | (LO << 2) | (NUNIT << 3)
-    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|0,       false,RowMajor>::run),
-    // array index: ADJ   | (LO << 2) | (NUNIT << 3)
-    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|0,       Conj, RowMajor>::run),
-    0,
-    // array index: NOTR  | (UP << 2) | (UNIT  << 3)
-    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|UnitDiag,false,ColMajor>::run),
-    // array index: TR    | (UP << 2) | (UNIT  << 3)
-    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|UnitDiag,false,RowMajor>::run),
-    // array index: ADJ   | (UP << 2) | (UNIT  << 3)
-    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|UnitDiag,Conj, RowMajor>::run),
-    0,
-    // array index: NOTR  | (LO << 2) | (UNIT  << 3)
-    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Lower|UnitDiag,false,ColMajor>::run),
-    // array index: TR    | (LO << 2) | (UNIT  << 3)
-    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|UnitDiag,false,RowMajor>::run),
-    // array index: ADJ   | (LO << 2) | (UNIT  << 3)
-    (internal::packed_triangular_solve_vector<Scalar,Scalar,int,OnTheLeft, Upper|UnitDiag,Conj, RowMajor>::run),
-    0
-  };
+      // array index: NOTR  | (UP << 2) | (NUNIT << 3)
+      (internal::packed_triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Upper | 0, false, ColMajor>::run),
+      // array index: TR    | (UP << 2) | (NUNIT << 3)
+      (internal::packed_triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Lower | 0, false, RowMajor>::run),
+      // array index: ADJ   | (UP << 2) | (NUNIT << 3)
+      (internal::packed_triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Lower | 0, Conj, RowMajor>::run), 0,
+      // array index: NOTR  | (LO << 2) | (NUNIT << 3)
+      (internal::packed_triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Lower | 0, false, ColMajor>::run),
+      // array index: TR    | (LO << 2) | (NUNIT << 3)
+      (internal::packed_triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Upper | 0, false, RowMajor>::run),
+      // array index: ADJ   | (LO << 2) | (NUNIT << 3)
+      (internal::packed_triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Upper | 0, Conj, RowMajor>::run), 0,
+      // array index: NOTR  | (UP << 2) | (UNIT  << 3)
+      (internal::packed_triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Upper | UnitDiag, false,
+                                                ColMajor>::run),
+      // array index: TR    | (UP << 2) | (UNIT  << 3)
+      (internal::packed_triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Lower | UnitDiag, false,
+                                                RowMajor>::run),
+      // array index: ADJ   | (UP << 2) | (UNIT  << 3)
+      (internal::packed_triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Lower | UnitDiag, Conj, RowMajor>::run),
+      0,
+      // array index: NOTR  | (LO << 2) | (UNIT  << 3)
+      (internal::packed_triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Lower | UnitDiag, false,
+                                                ColMajor>::run),
+      // array index: TR    | (LO << 2) | (UNIT  << 3)
+      (internal::packed_triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Upper | UnitDiag, false,
+                                                RowMajor>::run),
+      // array index: ADJ   | (LO << 2) | (UNIT  << 3)
+      (internal::packed_triangular_solve_vector<Scalar, Scalar, int, OnTheLeft, Upper | UnitDiag, Conj, RowMajor>::run),
+      0};
 
-  Scalar* ap = reinterpret_cast<Scalar*>(pap);
-  Scalar* x = reinterpret_cast<Scalar*>(px);
+  Scalar *ap = reinterpret_cast<Scalar *>(pap);
+  Scalar *x = reinterpret_cast<Scalar *>(px);
 
   int info = 0;
-  if(UPLO(*uplo)==INVALID)                                            info = 1;
-  else if(OP(*opa)==INVALID)                                          info = 2;
-  else if(DIAG(*diag)==INVALID)                                       info = 3;
-  else if(*n<0)                                                       info = 4;
-  else if(*incx==0)                                                   info = 7;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"TPSV ",&info,6);
+  if (UPLO(*uplo) == INVALID)
+    info = 1;
+  else if (OP(*opa) == INVALID)
+    info = 2;
+  else if (DIAG(*diag) == INVALID)
+    info = 3;
+  else if (*n < 0)
+    info = 4;
+  else if (*incx == 0)
+    info = 7;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "TPSV ", &info, 6);
 
-  Scalar* actual_x = get_compact_vector(x,*n,*incx);
+  Scalar *actual_x = get_compact_vector(x, *n, *incx);
 
   int code = OP(*opa) | (UPLO(*uplo) << 2) | (DIAG(*diag) << 3);
   func[code](*n, ap, actual_x);
 
-  if(actual_x!=x) delete[] copy_back(actual_x,x,*n,*incx);
+  if (actual_x != x) delete[] copy_back(actual_x, x, *n, *incx);
 
   return 1;
 }
diff --git a/blas/level2_real_impl.h b/blas/level2_real_impl.h
index 7620f0a..29f5a56 100644
--- a/blas/level2_real_impl.h
+++ b/blas/level2_real_impl.h
@@ -10,297 +10,306 @@
 #include "common.h"
 
 // y = alpha*A*x + beta*y
-int EIGEN_BLAS_FUNC(symv) (const char *uplo, const int *n, const RealScalar *palpha, const RealScalar *pa, const int *lda,
-                           const RealScalar *px, const int *incx, const RealScalar *pbeta, RealScalar *py, const int *incy)
-{
-  typedef void (*functype)(int, const Scalar*, int, const Scalar*, Scalar*, Scalar);
+int EIGEN_BLAS_FUNC(symv)(const char *uplo, const int *n, const RealScalar *palpha, const RealScalar *pa,
+                          const int *lda, const RealScalar *px, const int *incx, const RealScalar *pbeta,
+                          RealScalar *py, const int *incy) {
+  typedef void (*functype)(int, const Scalar *, int, const Scalar *, Scalar *, Scalar);
   static const functype func[2] = {
-    // array index: UP
-    (internal::selfadjoint_matrix_vector_product<Scalar,int,ColMajor,Upper,false,false>::run),
-    // array index: LO
-    (internal::selfadjoint_matrix_vector_product<Scalar,int,ColMajor,Lower,false,false>::run),
+      // array index: UP
+      (internal::selfadjoint_matrix_vector_product<Scalar, int, ColMajor, Upper, false, false>::run),
+      // array index: LO
+      (internal::selfadjoint_matrix_vector_product<Scalar, int, ColMajor, Lower, false, false>::run),
   };
 
-  const Scalar* a = reinterpret_cast<const Scalar*>(pa);
-  const Scalar* x = reinterpret_cast<const Scalar*>(px);
-  Scalar* y = reinterpret_cast<Scalar*>(py);
-  Scalar alpha  = *reinterpret_cast<const Scalar*>(palpha);
-  Scalar beta   = *reinterpret_cast<const Scalar*>(pbeta);
+  const Scalar *a = reinterpret_cast<const Scalar *>(pa);
+  const Scalar *x = reinterpret_cast<const Scalar *>(px);
+  Scalar *y = reinterpret_cast<Scalar *>(py);
+  Scalar alpha = *reinterpret_cast<const Scalar *>(palpha);
+  Scalar beta = *reinterpret_cast<const Scalar *>(pbeta);
 
   // check arguments
   int info = 0;
-  if(UPLO(*uplo)==INVALID)        info = 1;
-  else if(*n<0)                   info = 2;
-  else if(*lda<std::max(1,*n))    info = 5;
-  else if(*incx==0)               info = 7;
-  else if(*incy==0)               info = 10;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"SYMV ",&info,6);
+  if (UPLO(*uplo) == INVALID)
+    info = 1;
+  else if (*n < 0)
+    info = 2;
+  else if (*lda < std::max(1, *n))
+    info = 5;
+  else if (*incx == 0)
+    info = 7;
+  else if (*incy == 0)
+    info = 10;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "SYMV ", &info, 6);
 
-  if(*n==0)
-    return 0;
+  if (*n == 0) return 0;
 
-  const Scalar* actual_x = get_compact_vector(x,*n,*incx);
-  Scalar* actual_y = get_compact_vector(y,*n,*incy);
+  const Scalar *actual_x = get_compact_vector(x, *n, *incx);
+  Scalar *actual_y = get_compact_vector(y, *n, *incy);
 
-  if(beta!=Scalar(1))
-  {
-    if(beta==Scalar(0)) make_vector(actual_y, *n).setZero();
-    else                make_vector(actual_y, *n) *= beta;
+  if (beta != Scalar(1)) {
+    if (beta == Scalar(0))
+      make_vector(actual_y, *n).setZero();
+    else
+      make_vector(actual_y, *n) *= beta;
   }
 
   int code = UPLO(*uplo);
-  if(code>=2 || func[code]==0)
-    return 0;
+  if (code >= 2 || func[code] == 0) return 0;
 
   func[code](*n, a, *lda, actual_x, actual_y, alpha);
 
-  if(actual_x!=x) delete[] actual_x;
-  if(actual_y!=y) delete[] copy_back(actual_y,y,*n,*incy);
+  if (actual_x != x) delete[] actual_x;
+  if (actual_y != y) delete[] copy_back(actual_y, y, *n, *incy);
 
   return 1;
 }
 
 // C := alpha*x*x' + C
-int EIGEN_BLAS_FUNC(syr)(const char *uplo, const int *n, const RealScalar *palpha, const RealScalar *px, const int *incx, RealScalar *pc, const int *ldc)
-{
-
-  typedef void (*functype)(int, Scalar*, int, const Scalar*, const Scalar*, const Scalar&);
+int EIGEN_BLAS_FUNC(syr)(const char *uplo, const int *n, const RealScalar *palpha, const RealScalar *px,
+                         const int *incx, RealScalar *pc, const int *ldc) {
+  typedef void (*functype)(int, Scalar *, int, const Scalar *, const Scalar *, const Scalar &);
   static const functype func[2] = {
-    // array index: UP
-    (selfadjoint_rank1_update<Scalar,int,ColMajor,Upper,false,Conj>::run),
-    // array index: LO
-    (selfadjoint_rank1_update<Scalar,int,ColMajor,Lower,false,Conj>::run),
+      // array index: UP
+      (selfadjoint_rank1_update<Scalar, int, ColMajor, Upper, false, Conj>::run),
+      // array index: LO
+      (selfadjoint_rank1_update<Scalar, int, ColMajor, Lower, false, Conj>::run),
   };
 
-  const Scalar* x = reinterpret_cast<const Scalar*>(px);
-  Scalar* c = reinterpret_cast<Scalar*>(pc);
-  Scalar alpha = *reinterpret_cast<const Scalar*>(palpha);
+  const Scalar *x = reinterpret_cast<const Scalar *>(px);
+  Scalar *c = reinterpret_cast<Scalar *>(pc);
+  Scalar alpha = *reinterpret_cast<const Scalar *>(palpha);
 
   int info = 0;
-  if(UPLO(*uplo)==INVALID)                                            info = 1;
-  else if(*n<0)                                                       info = 2;
-  else if(*incx==0)                                                   info = 5;
-  else if(*ldc<std::max(1,*n))                                        info = 7;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"SYR  ",&info,6);
+  if (UPLO(*uplo) == INVALID)
+    info = 1;
+  else if (*n < 0)
+    info = 2;
+  else if (*incx == 0)
+    info = 5;
+  else if (*ldc < std::max(1, *n))
+    info = 7;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "SYR  ", &info, 6);
 
-  if(*n==0 || alpha==Scalar(0)) return 1;
+  if (*n == 0 || alpha == Scalar(0)) return 1;
 
   // if the increment is not 1, let's copy it to a temporary vector to enable vectorization
-  const Scalar* x_cpy = get_compact_vector(x,*n,*incx);
+  const Scalar *x_cpy = get_compact_vector(x, *n, *incx);
 
   int code = UPLO(*uplo);
-  if(code>=2 || func[code]==0)
-    return 0;
+  if (code >= 2 || func[code] == 0) return 0;
 
   func[code](*n, c, *ldc, x_cpy, x_cpy, alpha);
 
-  if(x_cpy!=x)  delete[] x_cpy;
+  if (x_cpy != x) delete[] x_cpy;
 
   return 1;
 }
 
 // C := alpha*x*y' + alpha*y*x' + C
-int EIGEN_BLAS_FUNC(syr2)(const char *uplo, const int *n, const RealScalar *palpha, const RealScalar *px, const int *incx, const RealScalar *py, const int *incy, RealScalar *pc, const int *ldc)
-{
-  typedef void (*functype)(int, Scalar*, int, const Scalar*, const Scalar*, Scalar);
+int EIGEN_BLAS_FUNC(syr2)(const char *uplo, const int *n, const RealScalar *palpha, const RealScalar *px,
+                          const int *incx, const RealScalar *py, const int *incy, RealScalar *pc, const int *ldc) {
+  typedef void (*functype)(int, Scalar *, int, const Scalar *, const Scalar *, Scalar);
   static const functype func[2] = {
-    // array index: UP
-    (internal::rank2_update_selector<Scalar,int,Upper>::run),
-    // array index: LO
-    (internal::rank2_update_selector<Scalar,int,Lower>::run),
+      // array index: UP
+      (internal::rank2_update_selector<Scalar, int, Upper>::run),
+      // array index: LO
+      (internal::rank2_update_selector<Scalar, int, Lower>::run),
   };
 
-  const Scalar* x = reinterpret_cast<const Scalar*>(px);
-  const Scalar* y = reinterpret_cast<const Scalar*>(py);
-  Scalar* c = reinterpret_cast<Scalar*>(pc);
-  Scalar alpha = *reinterpret_cast<const Scalar*>(palpha);
+  const Scalar *x = reinterpret_cast<const Scalar *>(px);
+  const Scalar *y = reinterpret_cast<const Scalar *>(py);
+  Scalar *c = reinterpret_cast<Scalar *>(pc);
+  Scalar alpha = *reinterpret_cast<const Scalar *>(palpha);
 
   int info = 0;
-  if(UPLO(*uplo)==INVALID)                                            info = 1;
-  else if(*n<0)                                                       info = 2;
-  else if(*incx==0)                                                   info = 5;
-  else if(*incy==0)                                                   info = 7;
-  else if(*ldc<std::max(1,*n))                                        info = 9;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"SYR2 ",&info,6);
+  if (UPLO(*uplo) == INVALID)
+    info = 1;
+  else if (*n < 0)
+    info = 2;
+  else if (*incx == 0)
+    info = 5;
+  else if (*incy == 0)
+    info = 7;
+  else if (*ldc < std::max(1, *n))
+    info = 9;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "SYR2 ", &info, 6);
 
-  if(alpha==Scalar(0))
-    return 1;
+  if (alpha == Scalar(0)) return 1;
 
-  const Scalar* x_cpy = get_compact_vector(x,*n,*incx);
-  const Scalar* y_cpy = get_compact_vector(y,*n,*incy);
+  const Scalar *x_cpy = get_compact_vector(x, *n, *incx);
+  const Scalar *y_cpy = get_compact_vector(y, *n, *incy);
 
   int code = UPLO(*uplo);
-  if(code>=2 || func[code]==0)
-    return 0;
+  if (code >= 2 || func[code] == 0) return 0;
 
   func[code](*n, c, *ldc, x_cpy, y_cpy, alpha);
 
-  if(x_cpy!=x)  delete[] x_cpy;
-  if(y_cpy!=y)  delete[] y_cpy;
+  if (x_cpy != x) delete[] x_cpy;
+  if (y_cpy != y) delete[] y_cpy;
 
-//   int code = UPLO(*uplo);
-//   if(code>=2 || func[code]==0)
-//     return 0;
+  //   int code = UPLO(*uplo);
+  //   if(code>=2 || func[code]==0)
+  //     return 0;
 
-//   func[code](*n, a, *inca, b, *incb, c, *ldc, alpha);
+  //   func[code](*n, a, *inca, b, *incb, c, *ldc, alpha);
   return 1;
 }
 
 /**  DSBMV  performs the matrix-vector  operation
-  *
-  *     y := alpha*A*x + beta*y,
-  *
-  *  where alpha and beta are scalars, x and y are n element vectors and
-  *  A is an n by n symmetric band matrix, with k super-diagonals.
-  */
+ *
+ *     y := alpha*A*x + beta*y,
+ *
+ *  where alpha and beta are scalars, x and y are n element vectors and
+ *  A is an n by n symmetric band matrix, with k super-diagonals.
+ */
 // int EIGEN_BLAS_FUNC(sbmv)( char *uplo, int *n, int *k, RealScalar *alpha, RealScalar *a, int *lda,
 //                            RealScalar *x, int *incx, RealScalar *beta, RealScalar *y, int *incy)
 // {
 //   return 1;
 // }
 
-
 /**  DSPMV  performs the matrix-vector operation
-  *
-  *     y := alpha*A*x + beta*y,
-  *
-  *  where alpha and beta are scalars, x and y are n element vectors and
-  *  A is an n by n symmetric matrix, supplied in packed form.
-  *
-  */
-// int EIGEN_BLAS_FUNC(spmv)(char *uplo, int *n, RealScalar *alpha, RealScalar *ap, RealScalar *x, int *incx, RealScalar *beta, RealScalar *y, int *incy)
+ *
+ *     y := alpha*A*x + beta*y,
+ *
+ *  where alpha and beta are scalars, x and y are n element vectors and
+ *  A is an n by n symmetric matrix, supplied in packed form.
+ *
+ */
+// int EIGEN_BLAS_FUNC(spmv)(char *uplo, int *n, RealScalar *alpha, RealScalar *ap, RealScalar *x, int *incx, RealScalar
+// *beta, RealScalar *y, int *incy)
 // {
 //   return 1;
 // }
 
 /**  DSPR    performs the symmetric rank 1 operation
-  *
-  *     A := alpha*x*x' + A,
-  *
-  *  where alpha is a real scalar, x is an n element vector and A is an
-  *  n by n symmetric matrix, supplied in packed form.
-  */
-int EIGEN_BLAS_FUNC(spr)(char *uplo, int *n, Scalar *palpha, Scalar *px, int *incx, Scalar *pap)
-{
-  typedef void (*functype)(int, Scalar*, const Scalar*, Scalar);
+ *
+ *     A := alpha*x*x' + A,
+ *
+ *  where alpha is a real scalar, x is an n element vector and A is an
+ *  n by n symmetric matrix, supplied in packed form.
+ */
+int EIGEN_BLAS_FUNC(spr)(char *uplo, int *n, Scalar *palpha, Scalar *px, int *incx, Scalar *pap) {
+  typedef void (*functype)(int, Scalar *, const Scalar *, Scalar);
   static const functype func[2] = {
-    // array index: UP
-    (internal::selfadjoint_packed_rank1_update<Scalar,int,ColMajor,Upper,false,false>::run),
-    // array index: LO
-    (internal::selfadjoint_packed_rank1_update<Scalar,int,ColMajor,Lower,false,false>::run),
+      // array index: UP
+      (internal::selfadjoint_packed_rank1_update<Scalar, int, ColMajor, Upper, false, false>::run),
+      // array index: LO
+      (internal::selfadjoint_packed_rank1_update<Scalar, int, ColMajor, Lower, false, false>::run),
   };
 
-  Scalar* x = reinterpret_cast<Scalar*>(px);
-  Scalar* ap = reinterpret_cast<Scalar*>(pap);
-  Scalar alpha = *reinterpret_cast<Scalar*>(palpha);
+  Scalar *x = reinterpret_cast<Scalar *>(px);
+  Scalar *ap = reinterpret_cast<Scalar *>(pap);
+  Scalar alpha = *reinterpret_cast<Scalar *>(palpha);
 
   int info = 0;
-  if(UPLO(*uplo)==INVALID)                                            info = 1;
-  else if(*n<0)                                                       info = 2;
-  else if(*incx==0)                                                   info = 5;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"SPR  ",&info,6);
+  if (UPLO(*uplo) == INVALID)
+    info = 1;
+  else if (*n < 0)
+    info = 2;
+  else if (*incx == 0)
+    info = 5;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "SPR  ", &info, 6);
 
-  if(alpha==Scalar(0))
-    return 1;
+  if (alpha == Scalar(0)) return 1;
 
-  Scalar* x_cpy = get_compact_vector(x, *n, *incx);
+  Scalar *x_cpy = get_compact_vector(x, *n, *incx);
 
   int code = UPLO(*uplo);
-  if(code>=2 || func[code]==0)
-    return 0;
+  if (code >= 2 || func[code] == 0) return 0;
 
   func[code](*n, ap, x_cpy, alpha);
 
-  if(x_cpy!=x)  delete[] x_cpy;
+  if (x_cpy != x) delete[] x_cpy;
 
   return 1;
 }
 
 /**  DSPR2  performs the symmetric rank 2 operation
-  *
-  *     A := alpha*x*y' + alpha*y*x' + A,
-  *
-  *  where alpha is a scalar, x and y are n element vectors and A is an
-  *  n by n symmetric matrix, supplied in packed form.
-  */
-int EIGEN_BLAS_FUNC(spr2)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pap)
-{
-  typedef void (*functype)(int, Scalar*, const Scalar*, const Scalar*, Scalar);
+ *
+ *     A := alpha*x*y' + alpha*y*x' + A,
+ *
+ *  where alpha is a scalar, x and y are n element vectors and A is an
+ *  n by n symmetric matrix, supplied in packed form.
+ */
+int EIGEN_BLAS_FUNC(spr2)(char *uplo, int *n, RealScalar *palpha, RealScalar *px, int *incx, RealScalar *py, int *incy,
+                          RealScalar *pap) {
+  typedef void (*functype)(int, Scalar *, const Scalar *, const Scalar *, Scalar);
   static const functype func[2] = {
-    // array index: UP
-    (internal::packed_rank2_update_selector<Scalar,int,Upper>::run),
-    // array index: LO
-    (internal::packed_rank2_update_selector<Scalar,int,Lower>::run),
+      // array index: UP
+      (internal::packed_rank2_update_selector<Scalar, int, Upper>::run),
+      // array index: LO
+      (internal::packed_rank2_update_selector<Scalar, int, Lower>::run),
   };
 
-  Scalar* x = reinterpret_cast<Scalar*>(px);
-  Scalar* y = reinterpret_cast<Scalar*>(py);
-  Scalar* ap = reinterpret_cast<Scalar*>(pap);
-  Scalar alpha = *reinterpret_cast<Scalar*>(palpha);
+  Scalar *x = reinterpret_cast<Scalar *>(px);
+  Scalar *y = reinterpret_cast<Scalar *>(py);
+  Scalar *ap = reinterpret_cast<Scalar *>(pap);
+  Scalar alpha = *reinterpret_cast<Scalar *>(palpha);
 
   int info = 0;
-  if(UPLO(*uplo)==INVALID)                                            info = 1;
-  else if(*n<0)                                                       info = 2;
-  else if(*incx==0)                                                   info = 5;
-  else if(*incy==0)                                                   info = 7;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"SPR2 ",&info,6);
+  if (UPLO(*uplo) == INVALID)
+    info = 1;
+  else if (*n < 0)
+    info = 2;
+  else if (*incx == 0)
+    info = 5;
+  else if (*incy == 0)
+    info = 7;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "SPR2 ", &info, 6);
 
-  if(alpha==Scalar(0))
-    return 1;
+  if (alpha == Scalar(0)) return 1;
 
-  Scalar* x_cpy = get_compact_vector(x, *n, *incx);
-  Scalar* y_cpy = get_compact_vector(y, *n, *incy);
+  Scalar *x_cpy = get_compact_vector(x, *n, *incx);
+  Scalar *y_cpy = get_compact_vector(y, *n, *incy);
 
   int code = UPLO(*uplo);
-  if(code>=2 || func[code]==0)
-    return 0;
+  if (code >= 2 || func[code] == 0) return 0;
 
   func[code](*n, ap, x_cpy, y_cpy, alpha);
 
-  if(x_cpy!=x)  delete[] x_cpy;
-  if(y_cpy!=y)  delete[] y_cpy;
+  if (x_cpy != x) delete[] x_cpy;
+  if (y_cpy != y) delete[] y_cpy;
 
   return 1;
 }
 
 /**  DGER   performs the rank 1 operation
-  *
-  *     A := alpha*x*y' + A,
-  *
-  *  where alpha is a scalar, x is an m element vector, y is an n element
-  *  vector and A is an m by n matrix.
-  */
-int EIGEN_BLAS_FUNC(ger)(int *m, int *n, Scalar *palpha, Scalar *px, int *incx, Scalar *py, int *incy, Scalar *pa, int *lda)
-{
-  Scalar* x = reinterpret_cast<Scalar*>(px);
-  Scalar* y = reinterpret_cast<Scalar*>(py);
-  Scalar* a = reinterpret_cast<Scalar*>(pa);
-  Scalar alpha = *reinterpret_cast<Scalar*>(palpha);
+ *
+ *     A := alpha*x*y' + A,
+ *
+ *  where alpha is a scalar, x is an m element vector, y is an n element
+ *  vector and A is an m by n matrix.
+ */
+int EIGEN_BLAS_FUNC(ger)(int *m, int *n, Scalar *palpha, Scalar *px, int *incx, Scalar *py, int *incy, Scalar *pa,
+                         int *lda) {
+  Scalar *x = reinterpret_cast<Scalar *>(px);
+  Scalar *y = reinterpret_cast<Scalar *>(py);
+  Scalar *a = reinterpret_cast<Scalar *>(pa);
+  Scalar alpha = *reinterpret_cast<Scalar *>(palpha);
 
   int info = 0;
-       if(*m<0)                                                       info = 1;
-  else if(*n<0)                                                       info = 2;
-  else if(*incx==0)                                                   info = 5;
-  else if(*incy==0)                                                   info = 7;
-  else if(*lda<std::max(1,*m))                                        info = 9;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"GER  ",&info,6);
+  if (*m < 0)
+    info = 1;
+  else if (*n < 0)
+    info = 2;
+  else if (*incx == 0)
+    info = 5;
+  else if (*incy == 0)
+    info = 7;
+  else if (*lda < std::max(1, *m))
+    info = 9;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "GER  ", &info, 6);
 
-  if(alpha==Scalar(0))
-    return 1;
+  if (alpha == Scalar(0)) return 1;
 
-  Scalar* x_cpy = get_compact_vector(x,*m,*incx);
-  Scalar* y_cpy = get_compact_vector(y,*n,*incy);
+  Scalar *x_cpy = get_compact_vector(x, *m, *incx);
+  Scalar *y_cpy = get_compact_vector(y, *n, *incy);
 
-  internal::general_rank1_update<Scalar,int,ColMajor,false,false>::run(*m, *n, a, *lda, x_cpy, y_cpy, alpha);
+  internal::general_rank1_update<Scalar, int, ColMajor, false, false>::run(*m, *n, a, *lda, x_cpy, y_cpy, alpha);
 
-  if(x_cpy!=x)  delete[] x_cpy;
-  if(y_cpy!=y)  delete[] y_cpy;
+  if (x_cpy != x) delete[] x_cpy;
+  if (y_cpy != y) delete[] y_cpy;
 
   return 1;
 }
diff --git a/blas/level3_impl.h b/blas/level3_impl.h
index 66216c9..5af5027 100644
--- a/blas/level3_impl.h
+++ b/blas/level3_impl.h
@@ -9,274 +9,338 @@
 #include <iostream>
 #include "common.h"
 
-int EIGEN_BLAS_FUNC(gemm)(const char *opa, const char *opb, const int *m, const int *n, const int *k, const RealScalar *palpha,
-                          const RealScalar *pa, const int *lda, const RealScalar *pb, const int *ldb, const RealScalar *pbeta, RealScalar *pc, const int *ldc)
-{
-//   std::cerr << "in gemm " << *opa << " " << *opb << " " << *m << " " << *n << " " << *k << " " << *lda << " " << *ldb << " " << *ldc << " " << *palpha << " " << *pbeta << "\n";
-  typedef void (*functype)(DenseIndex, DenseIndex, DenseIndex, const Scalar *, DenseIndex, const Scalar *, DenseIndex, Scalar *, DenseIndex, DenseIndex, Scalar, internal::level3_blocking<Scalar,Scalar>&, Eigen::internal::GemmParallelInfo<DenseIndex>*);
+int EIGEN_BLAS_FUNC(gemm)(const char *opa, const char *opb, const int *m, const int *n, const int *k,
+                          const RealScalar *palpha, const RealScalar *pa, const int *lda, const RealScalar *pb,
+                          const int *ldb, const RealScalar *pbeta, RealScalar *pc, const int *ldc) {
+  //   std::cerr << "in gemm " << *opa << " " << *opb << " " << *m << " " << *n << " " << *k << " " << *lda << " " <<
+  //   *ldb << " " << *ldc << " " << *palpha << " " << *pbeta << "\n";
+  typedef void (*functype)(DenseIndex, DenseIndex, DenseIndex, const Scalar *, DenseIndex, const Scalar *, DenseIndex,
+                           Scalar *, DenseIndex, DenseIndex, Scalar, internal::level3_blocking<Scalar, Scalar> &,
+                           Eigen::internal::GemmParallelInfo<DenseIndex> *);
   static const functype func[12] = {
-    // array index: NOTR  | (NOTR << 2)
-    (internal::general_matrix_matrix_product<DenseIndex,Scalar,ColMajor,false,Scalar,ColMajor,false,ColMajor,1>::run),
-    // array index: TR    | (NOTR << 2)
-    (internal::general_matrix_matrix_product<DenseIndex,Scalar,RowMajor,false,Scalar,ColMajor,false,ColMajor,1>::run),
-    // array index: ADJ   | (NOTR << 2)
-    (internal::general_matrix_matrix_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,ColMajor,false,ColMajor,1>::run),
-    0,
-    // array index: NOTR  | (TR   << 2)
-    (internal::general_matrix_matrix_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,false,ColMajor,1>::run),
-    // array index: TR    | (TR   << 2)
-    (internal::general_matrix_matrix_product<DenseIndex,Scalar,RowMajor,false,Scalar,RowMajor,false,ColMajor,1>::run),
-    // array index: ADJ   | (TR   << 2)
-    (internal::general_matrix_matrix_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,RowMajor,false,ColMajor,1>::run),
-    0,
-    // array index: NOTR  | (ADJ  << 2)
-    (internal::general_matrix_matrix_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,Conj, ColMajor,1>::run),
-    // array index: TR    | (ADJ  << 2)
-    (internal::general_matrix_matrix_product<DenseIndex,Scalar,RowMajor,false,Scalar,RowMajor,Conj, ColMajor,1>::run),
-    // array index: ADJ   | (ADJ  << 2)
-    (internal::general_matrix_matrix_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,RowMajor,Conj, ColMajor,1>::run),
-    0
-  };
+      // array index: NOTR  | (NOTR << 2)
+      (internal::general_matrix_matrix_product<DenseIndex, Scalar, ColMajor, false, Scalar, ColMajor, false, ColMajor,
+                                               1>::run),
+      // array index: TR    | (NOTR << 2)
+      (internal::general_matrix_matrix_product<DenseIndex, Scalar, RowMajor, false, Scalar, ColMajor, false, ColMajor,
+                                               1>::run),
+      // array index: ADJ   | (NOTR << 2)
+      (internal::general_matrix_matrix_product<DenseIndex, Scalar, RowMajor, Conj, Scalar, ColMajor, false, ColMajor,
+                                               1>::run),
+      0,
+      // array index: NOTR  | (TR   << 2)
+      (internal::general_matrix_matrix_product<DenseIndex, Scalar, ColMajor, false, Scalar, RowMajor, false, ColMajor,
+                                               1>::run),
+      // array index: TR    | (TR   << 2)
+      (internal::general_matrix_matrix_product<DenseIndex, Scalar, RowMajor, false, Scalar, RowMajor, false, ColMajor,
+                                               1>::run),
+      // array index: ADJ   | (TR   << 2)
+      (internal::general_matrix_matrix_product<DenseIndex, Scalar, RowMajor, Conj, Scalar, RowMajor, false, ColMajor,
+                                               1>::run),
+      0,
+      // array index: NOTR  | (ADJ  << 2)
+      (internal::general_matrix_matrix_product<DenseIndex, Scalar, ColMajor, false, Scalar, RowMajor, Conj, ColMajor,
+                                               1>::run),
+      // array index: TR    | (ADJ  << 2)
+      (internal::general_matrix_matrix_product<DenseIndex, Scalar, RowMajor, false, Scalar, RowMajor, Conj, ColMajor,
+                                               1>::run),
+      // array index: ADJ   | (ADJ  << 2)
+      (internal::general_matrix_matrix_product<DenseIndex, Scalar, RowMajor, Conj, Scalar, RowMajor, Conj, ColMajor,
+                                               1>::run),
+      0};
 
-  const Scalar* a = reinterpret_cast<const Scalar*>(pa);
-  const Scalar* b = reinterpret_cast<const Scalar*>(pb);
-  Scalar* c = reinterpret_cast<Scalar*>(pc);
-  Scalar alpha  = *reinterpret_cast<const Scalar*>(palpha);
-  Scalar beta   = *reinterpret_cast<const Scalar*>(pbeta);
+  const Scalar *a = reinterpret_cast<const Scalar *>(pa);
+  const Scalar *b = reinterpret_cast<const Scalar *>(pb);
+  Scalar *c = reinterpret_cast<Scalar *>(pc);
+  Scalar alpha = *reinterpret_cast<const Scalar *>(palpha);
+  Scalar beta = *reinterpret_cast<const Scalar *>(pbeta);
 
   int info = 0;
-  if(OP(*opa)==INVALID)                                               info = 1;
-  else if(OP(*opb)==INVALID)                                          info = 2;
-  else if(*m<0)                                                       info = 3;
-  else if(*n<0)                                                       info = 4;
-  else if(*k<0)                                                       info = 5;
-  else if(*lda<std::max(1,(OP(*opa)==NOTR)?*m:*k))                    info = 8;
-  else if(*ldb<std::max(1,(OP(*opb)==NOTR)?*k:*n))                    info = 10;
-  else if(*ldc<std::max(1,*m))                                        info = 13;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"GEMM ",&info,6);
+  if (OP(*opa) == INVALID)
+    info = 1;
+  else if (OP(*opb) == INVALID)
+    info = 2;
+  else if (*m < 0)
+    info = 3;
+  else if (*n < 0)
+    info = 4;
+  else if (*k < 0)
+    info = 5;
+  else if (*lda < std::max(1, (OP(*opa) == NOTR) ? *m : *k))
+    info = 8;
+  else if (*ldb < std::max(1, (OP(*opb) == NOTR) ? *k : *n))
+    info = 10;
+  else if (*ldc < std::max(1, *m))
+    info = 13;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "GEMM ", &info, 6);
 
-  if (*m == 0 || *n == 0)
-    return 0;
+  if (*m == 0 || *n == 0) return 0;
 
-  if(beta!=Scalar(1))
-  {
-    if(beta==Scalar(0)) matrix(c, *m, *n, *ldc).setZero();
-    else                matrix(c, *m, *n, *ldc) *= beta;
+  if (beta != Scalar(1)) {
+    if (beta == Scalar(0))
+      matrix(c, *m, *n, *ldc).setZero();
+    else
+      matrix(c, *m, *n, *ldc) *= beta;
   }
 
-  if(*k == 0)
-    return 0;
+  if (*k == 0) return 0;
 
-  internal::gemm_blocking_space<ColMajor,Scalar,Scalar,Dynamic,Dynamic,Dynamic> blocking(*m,*n,*k,1,true);
+  internal::gemm_blocking_space<ColMajor, Scalar, Scalar, Dynamic, Dynamic, Dynamic> blocking(*m, *n, *k, 1, true);
 
   int code = OP(*opa) | (OP(*opb) << 2);
   func[code](*m, *n, *k, a, *lda, b, *ldb, c, 1, *ldc, alpha, blocking, 0);
   return 0;
 }
 
-int EIGEN_BLAS_FUNC(trsm)(const char *side, const char *uplo, const char *opa, const char *diag, const int *m, const int *n,
-                          const RealScalar *palpha,  const RealScalar *pa, const int *lda, RealScalar *pb, const int *ldb)
-{
-//   std::cerr << "in trsm " << *side << " " << *uplo << " " << *opa << " " << *diag << " " << *m << "," << *n << " " << *palpha << " " << *lda << " " << *ldb<< "\n";
-  typedef void (*functype)(DenseIndex, DenseIndex, const Scalar *, DenseIndex, Scalar *, DenseIndex, DenseIndex, internal::level3_blocking<Scalar,Scalar>&);
+int EIGEN_BLAS_FUNC(trsm)(const char *side, const char *uplo, const char *opa, const char *diag, const int *m,
+                          const int *n, const RealScalar *palpha, const RealScalar *pa, const int *lda, RealScalar *pb,
+                          const int *ldb) {
+  //   std::cerr << "in trsm " << *side << " " << *uplo << " " << *opa << " " << *diag << " " << *m << "," << *n << " "
+  //   << *palpha << " " << *lda << " " << *ldb<< "\n";
+  typedef void (*functype)(DenseIndex, DenseIndex, const Scalar *, DenseIndex, Scalar *, DenseIndex, DenseIndex,
+                           internal::level3_blocking<Scalar, Scalar> &);
   static const functype func[32] = {
-    // array index: NOTR  | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Upper|0,          false,ColMajor,ColMajor,1>::run),
-    // array index: TR    | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Lower|0,          false,RowMajor,ColMajor,1>::run),
-    // array index: ADJ   | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Lower|0,          Conj, RowMajor,ColMajor,1>::run),\
-    0,
-    // array index: NOTR  | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Upper|0,          false,ColMajor,ColMajor,1>::run),
-    // array index: TR    | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Lower|0,          false,RowMajor,ColMajor,1>::run),
-    // array index: ADJ   | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Lower|0,          Conj, RowMajor,ColMajor,1>::run),
-    0,
-    // array index: NOTR  | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Lower|0,          false,ColMajor,ColMajor,1>::run),
-    // array index: TR    | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Upper|0,          false,RowMajor,ColMajor,1>::run),
-    // array index: ADJ   | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Upper|0,          Conj, RowMajor,ColMajor,1>::run),
-    0,
-    // array index: NOTR  | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Lower|0,          false,ColMajor,ColMajor,1>::run),
-    // array index: TR    | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Upper|0,          false,RowMajor,ColMajor,1>::run),
-    // array index: ADJ   | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Upper|0,          Conj, RowMajor,ColMajor,1>::run),
-    0,
-    // array index: NOTR  | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Upper|UnitDiag,false,ColMajor,ColMajor,1>::run),
-    // array index: TR    | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Lower|UnitDiag,false,RowMajor,ColMajor,1>::run),
-    // array index: ADJ   | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Lower|UnitDiag,Conj, RowMajor,ColMajor,1>::run),
-    0,
-    // array index: NOTR  | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Upper|UnitDiag,false,ColMajor,ColMajor,1>::run),
-    // array index: TR    | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Lower|UnitDiag,false,RowMajor,ColMajor,1>::run),
-    // array index: ADJ   | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Lower|UnitDiag,Conj, RowMajor,ColMajor,1>::run),
-    0,
-    // array index: NOTR  | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Lower|UnitDiag,false,ColMajor,ColMajor,1>::run),
-    // array index: TR    | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Upper|UnitDiag,false,RowMajor,ColMajor,1>::run),
-    // array index: ADJ   | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheLeft, Upper|UnitDiag,Conj, RowMajor,ColMajor,1>::run),
-    0,
-    // array index: NOTR  | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Lower|UnitDiag,false,ColMajor,ColMajor,1>::run),
-    // array index: TR    | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Upper|UnitDiag,false,RowMajor,ColMajor,1>::run),
-    // array index: ADJ   | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)
-    (internal::triangular_solve_matrix<Scalar,DenseIndex,OnTheRight,Upper|UnitDiag,Conj, RowMajor,ColMajor,1>::run),
-    0
-  };
+      // array index: NOTR  | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheLeft, Upper | 0, false, ColMajor, ColMajor, 1>::run),
+      // array index: TR    | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheLeft, Lower | 0, false, RowMajor, ColMajor, 1>::run),
+      // array index: ADJ   | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheLeft, Lower | 0, Conj, RowMajor, ColMajor, 1>::run),
+      0,
+      // array index: NOTR  | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheRight, Upper | 0, false, ColMajor, ColMajor, 1>::run),
+      // array index: TR    | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheRight, Lower | 0, false, RowMajor, ColMajor, 1>::run),
+      // array index: ADJ   | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheRight, Lower | 0, Conj, RowMajor, ColMajor, 1>::run),
+      0,
+      // array index: NOTR  | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheLeft, Lower | 0, false, ColMajor, ColMajor, 1>::run),
+      // array index: TR    | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheLeft, Upper | 0, false, RowMajor, ColMajor, 1>::run),
+      // array index: ADJ   | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheLeft, Upper | 0, Conj, RowMajor, ColMajor, 1>::run),
+      0,
+      // array index: NOTR  | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheRight, Lower | 0, false, ColMajor, ColMajor, 1>::run),
+      // array index: TR    | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheRight, Upper | 0, false, RowMajor, ColMajor, 1>::run),
+      // array index: ADJ   | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheRight, Upper | 0, Conj, RowMajor, ColMajor, 1>::run),
+      0,
+      // array index: NOTR  | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheLeft, Upper | UnitDiag, false, ColMajor, ColMajor,
+                                         1>::run),
+      // array index: TR    | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheLeft, Lower | UnitDiag, false, RowMajor, ColMajor,
+                                         1>::run),
+      // array index: ADJ   | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheLeft, Lower | UnitDiag, Conj, RowMajor, ColMajor,
+                                         1>::run),
+      0,
+      // array index: NOTR  | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheRight, Upper | UnitDiag, false, ColMajor, ColMajor,
+                                         1>::run),
+      // array index: TR    | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheRight, Lower | UnitDiag, false, RowMajor, ColMajor,
+                                         1>::run),
+      // array index: ADJ   | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheRight, Lower | UnitDiag, Conj, RowMajor, ColMajor,
+                                         1>::run),
+      0,
+      // array index: NOTR  | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheLeft, Lower | UnitDiag, false, ColMajor, ColMajor,
+                                         1>::run),
+      // array index: TR    | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheLeft, Upper | UnitDiag, false, RowMajor, ColMajor,
+                                         1>::run),
+      // array index: ADJ   | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheLeft, Upper | UnitDiag, Conj, RowMajor, ColMajor,
+                                         1>::run),
+      0,
+      // array index: NOTR  | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheRight, Lower | UnitDiag, false, ColMajor, ColMajor,
+                                         1>::run),
+      // array index: TR    | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheRight, Upper | UnitDiag, false, RowMajor, ColMajor,
+                                         1>::run),
+      // array index: ADJ   | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)
+      (internal::triangular_solve_matrix<Scalar, DenseIndex, OnTheRight, Upper | UnitDiag, Conj, RowMajor, ColMajor,
+                                         1>::run),
+      0};
 
-  const Scalar* a = reinterpret_cast<const Scalar*>(pa);
-  Scalar* b = reinterpret_cast<Scalar*>(pb);
-  Scalar  alpha = *reinterpret_cast<const Scalar*>(palpha);
+  const Scalar *a = reinterpret_cast<const Scalar *>(pa);
+  Scalar *b = reinterpret_cast<Scalar *>(pb);
+  Scalar alpha = *reinterpret_cast<const Scalar *>(palpha);
 
   int info = 0;
-  if(SIDE(*side)==INVALID)                                            info = 1;
-  else if(UPLO(*uplo)==INVALID)                                       info = 2;
-  else if(OP(*opa)==INVALID)                                          info = 3;
-  else if(DIAG(*diag)==INVALID)                                       info = 4;
-  else if(*m<0)                                                       info = 5;
-  else if(*n<0)                                                       info = 6;
-  else if(*lda<std::max(1,(SIDE(*side)==LEFT)?*m:*n))                 info = 9;
-  else if(*ldb<std::max(1,*m))                                        info = 11;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"TRSM ",&info,6);
+  if (SIDE(*side) == INVALID)
+    info = 1;
+  else if (UPLO(*uplo) == INVALID)
+    info = 2;
+  else if (OP(*opa) == INVALID)
+    info = 3;
+  else if (DIAG(*diag) == INVALID)
+    info = 4;
+  else if (*m < 0)
+    info = 5;
+  else if (*n < 0)
+    info = 6;
+  else if (*lda < std::max(1, (SIDE(*side) == LEFT) ? *m : *n))
+    info = 9;
+  else if (*ldb < std::max(1, *m))
+    info = 11;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "TRSM ", &info, 6);
 
-  if(*m==0 || *n==0)
-    return 0;
+  if (*m == 0 || *n == 0) return 0;
 
   int code = OP(*opa) | (SIDE(*side) << 2) | (UPLO(*uplo) << 3) | (DIAG(*diag) << 4);
 
-  if(SIDE(*side)==LEFT)
-  {
-    internal::gemm_blocking_space<ColMajor,Scalar,Scalar,Dynamic,Dynamic,Dynamic,4> blocking(*m,*n,*m,1,false);
+  if (SIDE(*side) == LEFT) {
+    internal::gemm_blocking_space<ColMajor, Scalar, Scalar, Dynamic, Dynamic, Dynamic, 4> blocking(*m, *n, *m, 1,
+                                                                                                   false);
     func[code](*m, *n, a, *lda, b, 1, *ldb, blocking);
-  }
-  else
-  {
-    internal::gemm_blocking_space<ColMajor,Scalar,Scalar,Dynamic,Dynamic,Dynamic,4> blocking(*m,*n,*n,1,false);
+  } else {
+    internal::gemm_blocking_space<ColMajor, Scalar, Scalar, Dynamic, Dynamic, Dynamic, 4> blocking(*m, *n, *n, 1,
+                                                                                                   false);
     func[code](*n, *m, a, *lda, b, 1, *ldb, blocking);
   }
 
-  if(alpha!=Scalar(1))
-    matrix(b,*m,*n,*ldb) *= alpha;
+  if (alpha != Scalar(1)) matrix(b, *m, *n, *ldb) *= alpha;
 
   return 0;
 }
 
-
 // b = alpha*op(a)*b  for side = 'L'or'l'
 // b = alpha*b*op(a)  for side = 'R'or'r'
-int EIGEN_BLAS_FUNC(trmm)(const char *side, const char *uplo, const char *opa, const char *diag, const int *m, const int *n,
-                          const RealScalar *palpha, const RealScalar *pa, const int *lda, RealScalar *pb, const int *ldb)
-{
-//   std::cerr << "in trmm " << *side << " " << *uplo << " " << *opa << " " << *diag << " " << *m << " " << *n << " " << *lda << " " << *ldb << " " << *palpha << "\n";
-  typedef void (*functype)(DenseIndex, DenseIndex, DenseIndex, const Scalar *, DenseIndex, const Scalar *, DenseIndex, Scalar *, DenseIndex, DenseIndex, const Scalar&, internal::level3_blocking<Scalar,Scalar>&);
+int EIGEN_BLAS_FUNC(trmm)(const char *side, const char *uplo, const char *opa, const char *diag, const int *m,
+                          const int *n, const RealScalar *palpha, const RealScalar *pa, const int *lda, RealScalar *pb,
+                          const int *ldb) {
+  //   std::cerr << "in trmm " << *side << " " << *uplo << " " << *opa << " " << *diag << " " << *m << " " << *n << " "
+  //   << *lda << " " << *ldb << " " << *palpha << "\n";
+  typedef void (*functype)(DenseIndex, DenseIndex, DenseIndex, const Scalar *, DenseIndex, const Scalar *, DenseIndex,
+                           Scalar *, DenseIndex, DenseIndex, const Scalar &,
+                           internal::level3_blocking<Scalar, Scalar> &);
   static const functype func[32] = {
-    // array index: NOTR  | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0,          true, ColMajor,false,ColMajor,false,ColMajor,1>::run),
-    // array index: TR    | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0,          true, RowMajor,false,ColMajor,false,ColMajor,1>::run),
-    // array index: ADJ   | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0,          true, RowMajor,Conj, ColMajor,false,ColMajor,1>::run),
-    0,
-    // array index: NOTR  | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0,          false,ColMajor,false,ColMajor,false,ColMajor,1>::run),
-    // array index: TR    | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0,          false,ColMajor,false,RowMajor,false,ColMajor,1>::run),
-    // array index: ADJ   | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0,          false,ColMajor,false,RowMajor,Conj, ColMajor,1>::run),
-    0,
-    // array index: NOTR  | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0,          true, ColMajor,false,ColMajor,false,ColMajor,1>::run),
-    // array index: TR    | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0,          true, RowMajor,false,ColMajor,false,ColMajor,1>::run),
-    // array index: ADJ   | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0,          true, RowMajor,Conj, ColMajor,false,ColMajor,1>::run),
-    0,
-    // array index: NOTR  | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0,          false,ColMajor,false,ColMajor,false,ColMajor,1>::run),
-    // array index: TR    | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0,          false,ColMajor,false,RowMajor,false,ColMajor,1>::run),
-    // array index: ADJ   | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0,          false,ColMajor,false,RowMajor,Conj, ColMajor,1>::run),
-    0,
-    // array index: NOTR  | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,true, ColMajor,false,ColMajor,false,ColMajor,1>::run),
-    // array index: TR    | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,true, RowMajor,false,ColMajor,false,ColMajor,1>::run),
-    // array index: ADJ   | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,true, RowMajor,Conj, ColMajor,false,ColMajor,1>::run),
-    0,
-    // array index: NOTR  | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,false,ColMajor,false,ColMajor,false,ColMajor,1>::run),
-    // array index: TR    | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,false,ColMajor,false,RowMajor,false,ColMajor,1>::run),
-    // array index: ADJ   | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,false,ColMajor,false,RowMajor,Conj, ColMajor,1>::run),
-    0,
-    // array index: NOTR  | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,true, ColMajor,false,ColMajor,false,ColMajor,1>::run),
-    // array index: TR    | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,true, RowMajor,false,ColMajor,false,ColMajor,1>::run),
-    // array index: ADJ   | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,true, RowMajor,Conj, ColMajor,false,ColMajor,1>::run),
-    0,
-    // array index: NOTR  | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,false,ColMajor,false,ColMajor,false,ColMajor,1>::run),
-    // array index: TR    | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,false,ColMajor,false,RowMajor,false,ColMajor,1>::run),
-    // array index: ADJ   | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)
-    (internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,false,ColMajor,false,RowMajor,Conj, ColMajor,1>::run),
-    0
-  };
+      // array index: NOTR  | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Upper | 0, true, ColMajor, false, ColMajor, false,
+                                                  ColMajor, 1>::run),
+      // array index: TR    | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Lower | 0, true, RowMajor, false, ColMajor, false,
+                                                  ColMajor, 1>::run),
+      // array index: ADJ   | (LEFT  << 2) | (UP << 3) | (NUNIT << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Lower | 0, true, RowMajor, Conj, ColMajor, false,
+                                                  ColMajor, 1>::run),
+      0,
+      // array index: NOTR  | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Upper | 0, false, ColMajor, false, ColMajor,
+                                                  false, ColMajor, 1>::run),
+      // array index: TR    | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Lower | 0, false, ColMajor, false, RowMajor,
+                                                  false, ColMajor, 1>::run),
+      // array index: ADJ   | (RIGHT << 2) | (UP << 3) | (NUNIT << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Lower | 0, false, ColMajor, false, RowMajor, Conj,
+                                                  ColMajor, 1>::run),
+      0,
+      // array index: NOTR  | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Lower | 0, true, ColMajor, false, ColMajor, false,
+                                                  ColMajor, 1>::run),
+      // array index: TR    | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Upper | 0, true, RowMajor, false, ColMajor, false,
+                                                  ColMajor, 1>::run),
+      // array index: ADJ   | (LEFT  << 2) | (LO << 3) | (NUNIT << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Upper | 0, true, RowMajor, Conj, ColMajor, false,
+                                                  ColMajor, 1>::run),
+      0,
+      // array index: NOTR  | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Lower | 0, false, ColMajor, false, ColMajor,
+                                                  false, ColMajor, 1>::run),
+      // array index: TR    | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Upper | 0, false, ColMajor, false, RowMajor,
+                                                  false, ColMajor, 1>::run),
+      // array index: ADJ   | (RIGHT << 2) | (LO << 3) | (NUNIT << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Upper | 0, false, ColMajor, false, RowMajor, Conj,
+                                                  ColMajor, 1>::run),
+      0,
+      // array index: NOTR  | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Upper | UnitDiag, true, ColMajor, false, ColMajor,
+                                                  false, ColMajor, 1>::run),
+      // array index: TR    | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Lower | UnitDiag, true, RowMajor, false, ColMajor,
+                                                  false, ColMajor, 1>::run),
+      // array index: ADJ   | (LEFT  << 2) | (UP << 3) | (UNIT  << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Lower | UnitDiag, true, RowMajor, Conj, ColMajor,
+                                                  false, ColMajor, 1>::run),
+      0,
+      // array index: NOTR  | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Upper | UnitDiag, false, ColMajor, false,
+                                                  ColMajor, false, ColMajor, 1>::run),
+      // array index: TR    | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Lower | UnitDiag, false, ColMajor, false,
+                                                  RowMajor, false, ColMajor, 1>::run),
+      // array index: ADJ   | (RIGHT << 2) | (UP << 3) | (UNIT  << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Lower | UnitDiag, false, ColMajor, false,
+                                                  RowMajor, Conj, ColMajor, 1>::run),
+      0,
+      // array index: NOTR  | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Lower | UnitDiag, true, ColMajor, false, ColMajor,
+                                                  false, ColMajor, 1>::run),
+      // array index: TR    | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Upper | UnitDiag, true, RowMajor, false, ColMajor,
+                                                  false, ColMajor, 1>::run),
+      // array index: ADJ   | (LEFT  << 2) | (LO << 3) | (UNIT  << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Upper | UnitDiag, true, RowMajor, Conj, ColMajor,
+                                                  false, ColMajor, 1>::run),
+      0,
+      // array index: NOTR  | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Lower | UnitDiag, false, ColMajor, false,
+                                                  ColMajor, false, ColMajor, 1>::run),
+      // array index: TR    | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Upper | UnitDiag, false, ColMajor, false,
+                                                  RowMajor, false, ColMajor, 1>::run),
+      // array index: ADJ   | (RIGHT << 2) | (LO << 3) | (UNIT  << 4)
+      (internal::product_triangular_matrix_matrix<Scalar, DenseIndex, Upper | UnitDiag, false, ColMajor, false,
+                                                  RowMajor, Conj, ColMajor, 1>::run),
+      0};
 
-  const Scalar* a = reinterpret_cast<const Scalar*>(pa);
-  Scalar* b = reinterpret_cast<Scalar*>(pb);
-  Scalar  alpha = *reinterpret_cast<const Scalar*>(palpha);
+  const Scalar *a = reinterpret_cast<const Scalar *>(pa);
+  Scalar *b = reinterpret_cast<Scalar *>(pb);
+  Scalar alpha = *reinterpret_cast<const Scalar *>(palpha);
 
   int info = 0;
-  if(SIDE(*side)==INVALID)                                            info = 1;
-  else if(UPLO(*uplo)==INVALID)                                       info = 2;
-  else if(OP(*opa)==INVALID)                                          info = 3;
-  else if(DIAG(*diag)==INVALID)                                       info = 4;
-  else if(*m<0)                                                       info = 5;
-  else if(*n<0)                                                       info = 6;
-  else if(*lda<std::max(1,(SIDE(*side)==LEFT)?*m:*n))                 info = 9;
-  else if(*ldb<std::max(1,*m))                                        info = 11;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"TRMM ",&info,6);
+  if (SIDE(*side) == INVALID)
+    info = 1;
+  else if (UPLO(*uplo) == INVALID)
+    info = 2;
+  else if (OP(*opa) == INVALID)
+    info = 3;
+  else if (DIAG(*diag) == INVALID)
+    info = 4;
+  else if (*m < 0)
+    info = 5;
+  else if (*n < 0)
+    info = 6;
+  else if (*lda < std::max(1, (SIDE(*side) == LEFT) ? *m : *n))
+    info = 9;
+  else if (*ldb < std::max(1, *m))
+    info = 11;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "TRMM ", &info, 6);
 
   int code = OP(*opa) | (SIDE(*side) << 2) | (UPLO(*uplo) << 3) | (DIAG(*diag) << 4);
 
-  if(*m==0 || *n==0)
-    return 1;
+  if (*m == 0 || *n == 0) return 1;
 
   // FIXME find a way to avoid this copy
-  Matrix<Scalar,Dynamic,Dynamic,ColMajor> tmp = matrix(b,*m,*n,*ldb);
-  matrix(b,*m,*n,*ldb).setZero();
+  Matrix<Scalar, Dynamic, Dynamic, ColMajor> tmp = matrix(b, *m, *n, *ldb);
+  matrix(b, *m, *n, *ldb).setZero();
 
-  if(SIDE(*side)==LEFT)
-  {
-    internal::gemm_blocking_space<ColMajor,Scalar,Scalar,Dynamic,Dynamic,Dynamic,4> blocking(*m,*n,*m,1,false);
+  if (SIDE(*side) == LEFT) {
+    internal::gemm_blocking_space<ColMajor, Scalar, Scalar, Dynamic, Dynamic, Dynamic, 4> blocking(*m, *n, *m, 1,
+                                                                                                   false);
     func[code](*m, *n, *m, a, *lda, tmp.data(), tmp.outerStride(), b, 1, *ldb, alpha, blocking);
-  }
-  else
-  {
-    internal::gemm_blocking_space<ColMajor,Scalar,Scalar,Dynamic,Dynamic,Dynamic,4> blocking(*m,*n,*n,1,false);
+  } else {
+    internal::gemm_blocking_space<ColMajor, Scalar, Scalar, Dynamic, Dynamic, Dynamic, 4> blocking(*m, *n, *n, 1,
+                                                                                                   false);
     func[code](*m, *n, *n, tmp.data(), tmp.outerStride(), a, *lda, b, 1, *ldb, alpha, blocking);
   }
   return 1;
@@ -285,149 +349,177 @@
 // c = alpha*a*b + beta*c  for side = 'L'or'l'
 // c = alpha*b*a + beta*c  for side = 'R'or'r
 int EIGEN_BLAS_FUNC(symm)(const char *side, const char *uplo, const int *m, const int *n, const RealScalar *palpha,
-                          const RealScalar *pa, const int *lda, const RealScalar *pb, const int *ldb, const RealScalar *pbeta, RealScalar *pc, const int *ldc)
-{
-//   std::cerr << "in symm " << *side << " " << *uplo << " " << *m << "x" << *n << " lda:" << *lda << " ldb:" << *ldb << " ldc:" << *ldc << " alpha:" << *palpha << " beta:" << *pbeta << "\n";
-  const Scalar* a = reinterpret_cast<const Scalar*>(pa);
-  const Scalar* b = reinterpret_cast<const Scalar*>(pb);
-  Scalar* c = reinterpret_cast<Scalar*>(pc);
-  Scalar alpha = *reinterpret_cast<const Scalar*>(palpha);
-  Scalar beta  = *reinterpret_cast<const Scalar*>(pbeta);
+                          const RealScalar *pa, const int *lda, const RealScalar *pb, const int *ldb,
+                          const RealScalar *pbeta, RealScalar *pc, const int *ldc) {
+  //   std::cerr << "in symm " << *side << " " << *uplo << " " << *m << "x" << *n << " lda:" << *lda << " ldb:" << *ldb
+  //   << " ldc:" << *ldc << " alpha:" << *palpha << " beta:" << *pbeta << "\n";
+  const Scalar *a = reinterpret_cast<const Scalar *>(pa);
+  const Scalar *b = reinterpret_cast<const Scalar *>(pb);
+  Scalar *c = reinterpret_cast<Scalar *>(pc);
+  Scalar alpha = *reinterpret_cast<const Scalar *>(palpha);
+  Scalar beta = *reinterpret_cast<const Scalar *>(pbeta);
 
   int info = 0;
-  if(SIDE(*side)==INVALID)                                            info = 1;
-  else if(UPLO(*uplo)==INVALID)                                       info = 2;
-  else if(*m<0)                                                       info = 3;
-  else if(*n<0)                                                       info = 4;
-  else if(*lda<std::max(1,(SIDE(*side)==LEFT)?*m:*n))                 info = 7;
-  else if(*ldb<std::max(1,*m))                                        info = 9;
-  else if(*ldc<std::max(1,*m))                                        info = 12;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"SYMM ",&info,6);
+  if (SIDE(*side) == INVALID)
+    info = 1;
+  else if (UPLO(*uplo) == INVALID)
+    info = 2;
+  else if (*m < 0)
+    info = 3;
+  else if (*n < 0)
+    info = 4;
+  else if (*lda < std::max(1, (SIDE(*side) == LEFT) ? *m : *n))
+    info = 7;
+  else if (*ldb < std::max(1, *m))
+    info = 9;
+  else if (*ldc < std::max(1, *m))
+    info = 12;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "SYMM ", &info, 6);
 
-  if(beta!=Scalar(1))
-  {
-    if(beta==Scalar(0)) matrix(c, *m, *n, *ldc).setZero();
-    else                matrix(c, *m, *n, *ldc) *= beta;
+  if (beta != Scalar(1)) {
+    if (beta == Scalar(0))
+      matrix(c, *m, *n, *ldc).setZero();
+    else
+      matrix(c, *m, *n, *ldc) *= beta;
   }
 
-  if(*m==0 || *n==0)
-  {
+  if (*m == 0 || *n == 0) {
     return 1;
   }
 
-  int size = (SIDE(*side)==LEFT) ? (*m) : (*n);
-  #if ISCOMPLEX
+  int size = (SIDE(*side) == LEFT) ? (*m) : (*n);
+#if ISCOMPLEX
   // FIXME add support for symmetric complex matrix
-  Matrix<Scalar,Dynamic,Dynamic,ColMajor> matA(size,size);
-  if(UPLO(*uplo)==UP)
-  {
-    matA.triangularView<Upper>() = matrix(a,size,size,*lda);
-    matA.triangularView<Lower>() = matrix(a,size,size,*lda).transpose();
+  Matrix<Scalar, Dynamic, Dynamic, ColMajor> matA(size, size);
+  if (UPLO(*uplo) == UP) {
+    matA.triangularView<Upper>() = matrix(a, size, size, *lda);
+    matA.triangularView<Lower>() = matrix(a, size, size, *lda).transpose();
+  } else if (UPLO(*uplo) == LO) {
+    matA.triangularView<Lower>() = matrix(a, size, size, *lda);
+    matA.triangularView<Upper>() = matrix(a, size, size, *lda).transpose();
   }
-  else if(UPLO(*uplo)==LO)
-  {
-    matA.triangularView<Lower>() = matrix(a,size,size,*lda);
-    matA.triangularView<Upper>() = matrix(a,size,size,*lda).transpose();
-  }
-  if(SIDE(*side)==LEFT)
+  if (SIDE(*side) == LEFT)
     matrix(c, *m, *n, *ldc) += alpha * matA * matrix(b, *m, *n, *ldb);
-  else if(SIDE(*side)==RIGHT)
+  else if (SIDE(*side) == RIGHT)
     matrix(c, *m, *n, *ldc) += alpha * matrix(b, *m, *n, *ldb) * matA;
-  #else
-  internal::gemm_blocking_space<ColMajor,Scalar,Scalar,Dynamic,Dynamic,Dynamic> blocking(*m,*n,size,1,false);
+#else
+  internal::gemm_blocking_space<ColMajor, Scalar, Scalar, Dynamic, Dynamic, Dynamic> blocking(*m, *n, size, 1, false);
 
-  if(SIDE(*side)==LEFT)
-    if(UPLO(*uplo)==UP)       internal::product_selfadjoint_matrix<Scalar, DenseIndex, RowMajor,true,false, ColMajor,false,false, ColMajor,1>::run(*m, *n, a, *lda, b, *ldb, c, 1, *ldc, alpha, blocking);
-    else if(UPLO(*uplo)==LO)  internal::product_selfadjoint_matrix<Scalar, DenseIndex, ColMajor,true,false, ColMajor,false,false, ColMajor,1>::run(*m, *n, a, *lda, b, *ldb, c, 1, *ldc, alpha, blocking);
-    else                      return 0;
-  else if(SIDE(*side)==RIGHT)
-    if(UPLO(*uplo)==UP)       internal::product_selfadjoint_matrix<Scalar, DenseIndex, ColMajor,false,false, RowMajor,true,false, ColMajor,1>::run(*m, *n, b, *ldb, a, *lda, c, 1, *ldc, alpha, blocking);
-    else if(UPLO(*uplo)==LO)  internal::product_selfadjoint_matrix<Scalar, DenseIndex, ColMajor,false,false, ColMajor,true,false, ColMajor,1>::run(*m, *n, b, *ldb, a, *lda, c, 1, *ldc, alpha, blocking);
-    else                      return 0;
+  if (SIDE(*side) == LEFT)
+    if (UPLO(*uplo) == UP)
+      internal::product_selfadjoint_matrix<Scalar, DenseIndex, RowMajor, true, false, ColMajor, false, false, ColMajor,
+                                           1>::run(*m, *n, a, *lda, b, *ldb, c, 1, *ldc, alpha, blocking);
+    else if (UPLO(*uplo) == LO)
+      internal::product_selfadjoint_matrix<Scalar, DenseIndex, ColMajor, true, false, ColMajor, false, false, ColMajor,
+                                           1>::run(*m, *n, a, *lda, b, *ldb, c, 1, *ldc, alpha, blocking);
+    else
+      return 0;
+  else if (SIDE(*side) == RIGHT)
+    if (UPLO(*uplo) == UP)
+      internal::product_selfadjoint_matrix<Scalar, DenseIndex, ColMajor, false, false, RowMajor, true, false, ColMajor,
+                                           1>::run(*m, *n, b, *ldb, a, *lda, c, 1, *ldc, alpha, blocking);
+    else if (UPLO(*uplo) == LO)
+      internal::product_selfadjoint_matrix<Scalar, DenseIndex, ColMajor, false, false, ColMajor, true, false, ColMajor,
+                                           1>::run(*m, *n, b, *ldb, a, *lda, c, 1, *ldc, alpha, blocking);
+    else
+      return 0;
   else
     return 0;
-  #endif
+#endif
 
   return 0;
 }
 
 // c = alpha*a*a' + beta*c  for op = 'N'or'n'
 // c = alpha*a'*a + beta*c  for op = 'T'or't','C'or'c'
-int EIGEN_BLAS_FUNC(syrk)(const char *uplo, const char *op, const int *n, const int *k,
-                          const RealScalar *palpha, const RealScalar *pa, const int *lda, const RealScalar *pbeta, RealScalar *pc, const int *ldc)
-{
-//   std::cerr << "in syrk " << *uplo << " " << *op << " " << *n << " " << *k << " " << *palpha << " " << *lda << " " << *pbeta << " " << *ldc << "\n";
-  #if !ISCOMPLEX
-  typedef void (*functype)(DenseIndex, DenseIndex, const Scalar *, DenseIndex, const Scalar *, DenseIndex, Scalar *, DenseIndex, DenseIndex, const Scalar&, internal::level3_blocking<Scalar,Scalar>&);
+int EIGEN_BLAS_FUNC(syrk)(const char *uplo, const char *op, const int *n, const int *k, const RealScalar *palpha,
+                          const RealScalar *pa, const int *lda, const RealScalar *pbeta, RealScalar *pc,
+                          const int *ldc) {
+  //   std::cerr << "in syrk " << *uplo << " " << *op << " " << *n << " " << *k << " " << *palpha << " " << *lda << " "
+  //   << *pbeta << " " << *ldc << "\n";
+#if !ISCOMPLEX
+  typedef void (*functype)(DenseIndex, DenseIndex, const Scalar *, DenseIndex, const Scalar *, DenseIndex, Scalar *,
+                           DenseIndex, DenseIndex, const Scalar &, internal::level3_blocking<Scalar, Scalar> &);
   static const functype func[8] = {
-    // array index: NOTR  | (UP << 2)
-    (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,Conj,ColMajor, 1, Upper>::run),
-    // array index: TR    | (UP << 2)
-    (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,false,Scalar,ColMajor,Conj,ColMajor, 1, Upper>::run),
-    // array index: ADJ   | (UP << 2)
-    (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,ColMajor,false,ColMajor, 1, Upper>::run),
-    0,
-    // array index: NOTR  | (LO << 2)
-    (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,Conj,ColMajor, 1, Lower>::run),
-    // array index: TR    | (LO << 2)
-    (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,false,Scalar,ColMajor,Conj,ColMajor, 1, Lower>::run),
-    // array index: ADJ   | (LO << 2)
-    (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,ColMajor,false,ColMajor, 1, Lower>::run),
-    0
-  };
-  #endif
+      // array index: NOTR  | (UP << 2)
+      (internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, ColMajor, false, Scalar, RowMajor, Conj,
+                                                          ColMajor, 1, Upper>::run),
+      // array index: TR    | (UP << 2)
+      (internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, RowMajor, false, Scalar, ColMajor, Conj,
+                                                          ColMajor, 1, Upper>::run),
+      // array index: ADJ   | (UP << 2)
+      (internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, RowMajor, Conj, Scalar, ColMajor, false,
+                                                          ColMajor, 1, Upper>::run),
+      0,
+      // array index: NOTR  | (LO << 2)
+      (internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, ColMajor, false, Scalar, RowMajor, Conj,
+                                                          ColMajor, 1, Lower>::run),
+      // array index: TR    | (LO << 2)
+      (internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, RowMajor, false, Scalar, ColMajor, Conj,
+                                                          ColMajor, 1, Lower>::run),
+      // array index: ADJ   | (LO << 2)
+      (internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, RowMajor, Conj, Scalar, ColMajor, false,
+                                                          ColMajor, 1, Lower>::run),
+      0};
+#endif
 
-  const Scalar* a = reinterpret_cast<const Scalar*>(pa);
-  Scalar* c = reinterpret_cast<Scalar*>(pc);
-  Scalar alpha = *reinterpret_cast<const Scalar*>(palpha);
-  Scalar beta  = *reinterpret_cast<const Scalar*>(pbeta);
+  const Scalar *a = reinterpret_cast<const Scalar *>(pa);
+  Scalar *c = reinterpret_cast<Scalar *>(pc);
+  Scalar alpha = *reinterpret_cast<const Scalar *>(palpha);
+  Scalar beta = *reinterpret_cast<const Scalar *>(pbeta);
 
   int info = 0;
-  if(UPLO(*uplo)==INVALID)                                            info = 1;
-  else if(OP(*op)==INVALID || (ISCOMPLEX && OP(*op)==ADJ) )           info = 2;
-  else if(*n<0)                                                       info = 3;
-  else if(*k<0)                                                       info = 4;
-  else if(*lda<std::max(1,(OP(*op)==NOTR)?*n:*k))                     info = 7;
-  else if(*ldc<std::max(1,*n))                                        info = 10;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"SYRK ",&info,6);
+  if (UPLO(*uplo) == INVALID)
+    info = 1;
+  else if (OP(*op) == INVALID || (ISCOMPLEX && OP(*op) == ADJ))
+    info = 2;
+  else if (*n < 0)
+    info = 3;
+  else if (*k < 0)
+    info = 4;
+  else if (*lda < std::max(1, (OP(*op) == NOTR) ? *n : *k))
+    info = 7;
+  else if (*ldc < std::max(1, *n))
+    info = 10;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "SYRK ", &info, 6);
 
-  if(beta!=Scalar(1))
-  {
-    if(UPLO(*uplo)==UP)
-      if(beta==Scalar(0)) matrix(c, *n, *n, *ldc).triangularView<Upper>().setZero();
-      else                matrix(c, *n, *n, *ldc).triangularView<Upper>() *= beta;
+  if (beta != Scalar(1)) {
+    if (UPLO(*uplo) == UP)
+      if (beta == Scalar(0))
+        matrix(c, *n, *n, *ldc).triangularView<Upper>().setZero();
+      else
+        matrix(c, *n, *n, *ldc).triangularView<Upper>() *= beta;
+    else if (beta == Scalar(0))
+      matrix(c, *n, *n, *ldc).triangularView<Lower>().setZero();
     else
-      if(beta==Scalar(0)) matrix(c, *n, *n, *ldc).triangularView<Lower>().setZero();
-      else                matrix(c, *n, *n, *ldc).triangularView<Lower>() *= beta;
+      matrix(c, *n, *n, *ldc).triangularView<Lower>() *= beta;
   }
 
-  if(*n==0 || *k==0)
-    return 0;
+  if (*n == 0 || *k == 0) return 0;
 
-  #if ISCOMPLEX
+#if ISCOMPLEX
   // FIXME add support for symmetric complex matrix
-  if(UPLO(*uplo)==UP)
-  {
-    if(OP(*op)==NOTR)
-      matrix(c, *n, *n, *ldc).triangularView<Upper>() += alpha * matrix(a,*n,*k,*lda) * matrix(a,*n,*k,*lda).transpose();
+  if (UPLO(*uplo) == UP) {
+    if (OP(*op) == NOTR)
+      matrix(c, *n, *n, *ldc).triangularView<Upper>() +=
+          alpha * matrix(a, *n, *k, *lda) * matrix(a, *n, *k, *lda).transpose();
     else
-      matrix(c, *n, *n, *ldc).triangularView<Upper>() += alpha * matrix(a,*k,*n,*lda).transpose() * matrix(a,*k,*n,*lda);
-  }
-  else
-  {
-    if(OP(*op)==NOTR)
-      matrix(c, *n, *n, *ldc).triangularView<Lower>() += alpha * matrix(a,*n,*k,*lda) * matrix(a,*n,*k,*lda).transpose();
+      matrix(c, *n, *n, *ldc).triangularView<Upper>() +=
+          alpha * matrix(a, *k, *n, *lda).transpose() * matrix(a, *k, *n, *lda);
+  } else {
+    if (OP(*op) == NOTR)
+      matrix(c, *n, *n, *ldc).triangularView<Lower>() +=
+          alpha * matrix(a, *n, *k, *lda) * matrix(a, *n, *k, *lda).transpose();
     else
-      matrix(c, *n, *n, *ldc).triangularView<Lower>() += alpha * matrix(a,*k,*n,*lda).transpose() * matrix(a,*k,*n,*lda);
+      matrix(c, *n, *n, *ldc).triangularView<Lower>() +=
+          alpha * matrix(a, *k, *n, *lda).transpose() * matrix(a, *k, *n, *lda);
   }
-  #else
-  internal::gemm_blocking_space<ColMajor,Scalar,Scalar,Dynamic,Dynamic,Dynamic> blocking(*n,*n,*k,1,false);
+#else
+  internal::gemm_blocking_space<ColMajor, Scalar, Scalar, Dynamic, Dynamic, Dynamic> blocking(*n, *n, *k, 1, false);
 
   int code = OP(*op) | (UPLO(*uplo) << 2);
   func[code](*n, *k, a, *lda, a, *lda, c, 1, *ldc, alpha, blocking);
-  #endif
+#endif
 
   return 0;
 }
@@ -435,124 +527,139 @@
 // c = alpha*a*b' + alpha*b*a' + beta*c  for op = 'N'or'n'
 // c = alpha*a'*b + alpha*b'*a + beta*c  for op = 'T'or't'
 int EIGEN_BLAS_FUNC(syr2k)(const char *uplo, const char *op, const int *n, const int *k, const RealScalar *palpha,
-                           const RealScalar *pa, const int *lda, const RealScalar *pb, const int *ldb, const RealScalar *pbeta, RealScalar *pc, const int *ldc)
-{
-  const Scalar* a = reinterpret_cast<const Scalar*>(pa);
-  const Scalar* b = reinterpret_cast<const Scalar*>(pb);
-  Scalar* c = reinterpret_cast<Scalar*>(pc);
-  Scalar alpha = *reinterpret_cast<const Scalar*>(palpha);
-  Scalar beta  = *reinterpret_cast<const Scalar*>(pbeta);
+                           const RealScalar *pa, const int *lda, const RealScalar *pb, const int *ldb,
+                           const RealScalar *pbeta, RealScalar *pc, const int *ldc) {
+  const Scalar *a = reinterpret_cast<const Scalar *>(pa);
+  const Scalar *b = reinterpret_cast<const Scalar *>(pb);
+  Scalar *c = reinterpret_cast<Scalar *>(pc);
+  Scalar alpha = *reinterpret_cast<const Scalar *>(palpha);
+  Scalar beta = *reinterpret_cast<const Scalar *>(pbeta);
 
-//   std::cerr << "in syr2k " << *uplo << " " << *op << " " << *n << " " << *k << " " << alpha << " " << *lda << " " << *ldb << " " << beta << " " << *ldc << "\n";
+  //   std::cerr << "in syr2k " << *uplo << " " << *op << " " << *n << " " << *k << " " << alpha << " " << *lda << " "
+  //   << *ldb << " " << beta << " " << *ldc << "\n";
 
   int info = 0;
-  if(UPLO(*uplo)==INVALID)                                            info = 1;
-  else if(OP(*op)==INVALID || (ISCOMPLEX && OP(*op)==ADJ) )           info = 2;
-  else if(*n<0)                                                       info = 3;
-  else if(*k<0)                                                       info = 4;
-  else if(*lda<std::max(1,(OP(*op)==NOTR)?*n:*k))                     info = 7;
-  else if(*ldb<std::max(1,(OP(*op)==NOTR)?*n:*k))                     info = 9;
-  else if(*ldc<std::max(1,*n))                                        info = 12;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"SYR2K",&info,6);
+  if (UPLO(*uplo) == INVALID)
+    info = 1;
+  else if (OP(*op) == INVALID || (ISCOMPLEX && OP(*op) == ADJ))
+    info = 2;
+  else if (*n < 0)
+    info = 3;
+  else if (*k < 0)
+    info = 4;
+  else if (*lda < std::max(1, (OP(*op) == NOTR) ? *n : *k))
+    info = 7;
+  else if (*ldb < std::max(1, (OP(*op) == NOTR) ? *n : *k))
+    info = 9;
+  else if (*ldc < std::max(1, *n))
+    info = 12;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "SYR2K", &info, 6);
 
-  if(beta!=Scalar(1))
-  {
-    if(UPLO(*uplo)==UP)
-      if(beta==Scalar(0)) matrix(c, *n, *n, *ldc).triangularView<Upper>().setZero();
-      else                matrix(c, *n, *n, *ldc).triangularView<Upper>() *= beta;
+  if (beta != Scalar(1)) {
+    if (UPLO(*uplo) == UP)
+      if (beta == Scalar(0))
+        matrix(c, *n, *n, *ldc).triangularView<Upper>().setZero();
+      else
+        matrix(c, *n, *n, *ldc).triangularView<Upper>() *= beta;
+    else if (beta == Scalar(0))
+      matrix(c, *n, *n, *ldc).triangularView<Lower>().setZero();
     else
-      if(beta==Scalar(0)) matrix(c, *n, *n, *ldc).triangularView<Lower>().setZero();
-      else                matrix(c, *n, *n, *ldc).triangularView<Lower>() *= beta;
+      matrix(c, *n, *n, *ldc).triangularView<Lower>() *= beta;
   }
 
-  if(*k==0)
-    return 1;
+  if (*k == 0) return 1;
 
-  if(OP(*op)==NOTR)
-  {
-    if(UPLO(*uplo)==UP)
-    {
-      matrix(c, *n, *n, *ldc).triangularView<Upper>()
-        += alpha *matrix(a, *n, *k, *lda)*matrix(b, *n, *k, *ldb).transpose()
-        +  alpha*matrix(b, *n, *k, *ldb)*matrix(a, *n, *k, *lda).transpose();
-    }
-    else if(UPLO(*uplo)==LO)
-      matrix(c, *n, *n, *ldc).triangularView<Lower>()
-        += alpha*matrix(a, *n, *k, *lda)*matrix(b, *n, *k, *ldb).transpose()
-        +  alpha*matrix(b, *n, *k, *ldb)*matrix(a, *n, *k, *lda).transpose();
-  }
-  else if(OP(*op)==TR || OP(*op)==ADJ)
-  {
-    if(UPLO(*uplo)==UP)
-      matrix(c, *n, *n, *ldc).triangularView<Upper>()
-        += alpha*matrix(a, *k, *n, *lda).transpose()*matrix(b, *k, *n, *ldb)
-        +  alpha*matrix(b, *k, *n, *ldb).transpose()*matrix(a, *k, *n, *lda);
-    else if(UPLO(*uplo)==LO)
-      matrix(c, *n, *n, *ldc).triangularView<Lower>()
-        += alpha*matrix(a, *k, *n, *lda).transpose()*matrix(b, *k, *n, *ldb)
-        +  alpha*matrix(b, *k, *n, *ldb).transpose()*matrix(a, *k, *n, *lda);
+  if (OP(*op) == NOTR) {
+    if (UPLO(*uplo) == UP) {
+      matrix(c, *n, *n, *ldc).triangularView<Upper>() +=
+          alpha * matrix(a, *n, *k, *lda) * matrix(b, *n, *k, *ldb).transpose() +
+          alpha * matrix(b, *n, *k, *ldb) * matrix(a, *n, *k, *lda).transpose();
+    } else if (UPLO(*uplo) == LO)
+      matrix(c, *n, *n, *ldc).triangularView<Lower>() +=
+          alpha * matrix(a, *n, *k, *lda) * matrix(b, *n, *k, *ldb).transpose() +
+          alpha * matrix(b, *n, *k, *ldb) * matrix(a, *n, *k, *lda).transpose();
+  } else if (OP(*op) == TR || OP(*op) == ADJ) {
+    if (UPLO(*uplo) == UP)
+      matrix(c, *n, *n, *ldc).triangularView<Upper>() +=
+          alpha * matrix(a, *k, *n, *lda).transpose() * matrix(b, *k, *n, *ldb) +
+          alpha * matrix(b, *k, *n, *ldb).transpose() * matrix(a, *k, *n, *lda);
+    else if (UPLO(*uplo) == LO)
+      matrix(c, *n, *n, *ldc).triangularView<Lower>() +=
+          alpha * matrix(a, *k, *n, *lda).transpose() * matrix(b, *k, *n, *ldb) +
+          alpha * matrix(b, *k, *n, *ldb).transpose() * matrix(a, *k, *n, *lda);
   }
 
   return 0;
 }
 
-
 #if ISCOMPLEX
 
 // c = alpha*a*b + beta*c  for side = 'L'or'l'
 // c = alpha*b*a + beta*c  for side = 'R'or'r
 int EIGEN_BLAS_FUNC(hemm)(const char *side, const char *uplo, const int *m, const int *n, const RealScalar *palpha,
-                          const RealScalar *pa, const int *lda, const RealScalar *pb, const int *ldb, const RealScalar *pbeta, RealScalar *pc, const int *ldc)
-{
-  const Scalar* a = reinterpret_cast<const Scalar*>(pa);
-  const Scalar* b = reinterpret_cast<const Scalar*>(pb);
-  Scalar* c = reinterpret_cast<Scalar*>(pc);
-  Scalar alpha = *reinterpret_cast<const Scalar*>(palpha);
-  Scalar beta  = *reinterpret_cast<const Scalar*>(pbeta);
+                          const RealScalar *pa, const int *lda, const RealScalar *pb, const int *ldb,
+                          const RealScalar *pbeta, RealScalar *pc, const int *ldc) {
+  const Scalar *a = reinterpret_cast<const Scalar *>(pa);
+  const Scalar *b = reinterpret_cast<const Scalar *>(pb);
+  Scalar *c = reinterpret_cast<Scalar *>(pc);
+  Scalar alpha = *reinterpret_cast<const Scalar *>(palpha);
+  Scalar beta = *reinterpret_cast<const Scalar *>(pbeta);
 
-//   std::cerr << "in hemm " << *side << " " << *uplo << " " << *m << " " << *n << " " << alpha << " " << *lda << " " << beta << " " << *ldc << "\n";
+  //   std::cerr << "in hemm " << *side << " " << *uplo << " " << *m << " " << *n << " " << alpha << " " << *lda << " "
+  //   << beta << " " << *ldc << "\n";
 
   int info = 0;
-  if(SIDE(*side)==INVALID)                                            info = 1;
-  else if(UPLO(*uplo)==INVALID)                                       info = 2;
-  else if(*m<0)                                                       info = 3;
-  else if(*n<0)                                                       info = 4;
-  else if(*lda<std::max(1,(SIDE(*side)==LEFT)?*m:*n))                 info = 7;
-  else if(*ldb<std::max(1,*m))                                        info = 9;
-  else if(*ldc<std::max(1,*m))                                        info = 12;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"HEMM ",&info,6);
+  if (SIDE(*side) == INVALID)
+    info = 1;
+  else if (UPLO(*uplo) == INVALID)
+    info = 2;
+  else if (*m < 0)
+    info = 3;
+  else if (*n < 0)
+    info = 4;
+  else if (*lda < std::max(1, (SIDE(*side) == LEFT) ? *m : *n))
+    info = 7;
+  else if (*ldb < std::max(1, *m))
+    info = 9;
+  else if (*ldc < std::max(1, *m))
+    info = 12;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "HEMM ", &info, 6);
 
-  if(beta==Scalar(0))       matrix(c, *m, *n, *ldc).setZero();
-  else if(beta!=Scalar(1))  matrix(c, *m, *n, *ldc) *= beta;
+  if (beta == Scalar(0))
+    matrix(c, *m, *n, *ldc).setZero();
+  else if (beta != Scalar(1))
+    matrix(c, *m, *n, *ldc) *= beta;
 
-  if(*m==0 || *n==0)
-  {
+  if (*m == 0 || *n == 0) {
     return 1;
   }
 
-  int size = (SIDE(*side)==LEFT) ? (*m) : (*n);
-  internal::gemm_blocking_space<ColMajor,Scalar,Scalar,Dynamic,Dynamic,Dynamic> blocking(*m,*n,size,1,false);
+  int size = (SIDE(*side) == LEFT) ? (*m) : (*n);
+  internal::gemm_blocking_space<ColMajor, Scalar, Scalar, Dynamic, Dynamic, Dynamic> blocking(*m, *n, size, 1, false);
 
-  if(SIDE(*side)==LEFT)
-  {
-    if(UPLO(*uplo)==UP)       internal::product_selfadjoint_matrix<Scalar,DenseIndex,RowMajor,true,Conj,  ColMajor,false,false, ColMajor, 1>
-                                ::run(*m, *n, a, *lda, b, *ldb, c, 1, *ldc, alpha, blocking);
-    else if(UPLO(*uplo)==LO)  internal::product_selfadjoint_matrix<Scalar,DenseIndex,ColMajor,true,false, ColMajor,false,false, ColMajor,1>
-                                ::run(*m, *n, a, *lda, b, *ldb, c, 1, *ldc, alpha, blocking);
-    else                      return 0;
-  }
-  else if(SIDE(*side)==RIGHT)
-  {
-    if(UPLO(*uplo)==UP)       matrix(c,*m,*n,*ldc) += alpha * matrix(b,*m,*n,*ldb) * matrix(a,*n,*n,*lda).selfadjointView<Upper>();/*internal::product_selfadjoint_matrix<Scalar,DenseIndex,ColMajor,false,false, RowMajor,true,Conj,  ColMajor, 1>
-                                ::run(*m, *n, b, *ldb, a, *lda, c, 1, *ldc, alpha, blocking);*/
-    else if(UPLO(*uplo)==LO)  internal::product_selfadjoint_matrix<Scalar,DenseIndex,ColMajor,false,false, ColMajor,true,false, ColMajor,1>
-                                ::run(*m, *n, b, *ldb, a, *lda, c, 1, *ldc, alpha, blocking);
-    else                      return 0;
-  }
-  else
-  {
+  if (SIDE(*side) == LEFT) {
+    if (UPLO(*uplo) == UP)
+      internal::product_selfadjoint_matrix<Scalar, DenseIndex, RowMajor, true, Conj, ColMajor, false, false, ColMajor,
+                                           1>::run(*m, *n, a, *lda, b, *ldb, c, 1, *ldc, alpha, blocking);
+    else if (UPLO(*uplo) == LO)
+      internal::product_selfadjoint_matrix<Scalar, DenseIndex, ColMajor, true, false, ColMajor, false, false, ColMajor,
+                                           1>::run(*m, *n, a, *lda, b, *ldb, c, 1, *ldc, alpha, blocking);
+    else
+      return 0;
+  } else if (SIDE(*side) == RIGHT) {
+    if (UPLO(*uplo) == UP)
+      matrix(c, *m, *n, *ldc) +=
+          alpha * matrix(b, *m, *n, *ldb) *
+          matrix(a, *n, *n, *lda)
+              .selfadjointView<Upper>(); /*internal::product_selfadjoint_matrix<Scalar,DenseIndex,ColMajor,false,false,
+RowMajor,true,Conj,  ColMajor, 1>
+::run(*m, *n, b, *ldb, a, *lda, c, 1, *ldc, alpha, blocking);*/
+    else if (UPLO(*uplo) == LO)
+      internal::product_selfadjoint_matrix<Scalar, DenseIndex, ColMajor, false, false, ColMajor, true, false, ColMajor,
+                                           1>::run(*m, *n, b, *ldb, a, *lda, c, 1, *ldc, alpha, blocking);
+    else
+      return 0;
+  } else {
     return 0;
   }
 
@@ -561,65 +668,76 @@
 
 // c = alpha*a*conj(a') + beta*c  for op = 'N'or'n'
 // c = alpha*conj(a')*a + beta*c  for op  = 'C'or'c'
-int EIGEN_BLAS_FUNC(herk)(const char *uplo, const char *op, const int *n, const int *k,
-                          const RealScalar *palpha, const RealScalar *pa, const int *lda, const RealScalar *pbeta, RealScalar *pc, const int *ldc)
-{
-//   std::cerr << "in herk " << *uplo << " " << *op << " " << *n << " " << *k << " " << *palpha << " " << *lda << " " << *pbeta << " " << *ldc << "\n";
+int EIGEN_BLAS_FUNC(herk)(const char *uplo, const char *op, const int *n, const int *k, const RealScalar *palpha,
+                          const RealScalar *pa, const int *lda, const RealScalar *pbeta, RealScalar *pc,
+                          const int *ldc) {
+  //   std::cerr << "in herk " << *uplo << " " << *op << " " << *n << " " << *k << " " << *palpha << " " << *lda << " "
+  //   << *pbeta << " " << *ldc << "\n";
 
-  typedef void (*functype)(DenseIndex, DenseIndex, const Scalar *, DenseIndex, const Scalar *, DenseIndex, Scalar *, DenseIndex, DenseIndex, const Scalar&, internal::level3_blocking<Scalar,Scalar>&);
+  typedef void (*functype)(DenseIndex, DenseIndex, const Scalar *, DenseIndex, const Scalar *, DenseIndex, Scalar *,
+                           DenseIndex, DenseIndex, const Scalar &, internal::level3_blocking<Scalar, Scalar> &);
   static const functype func[8] = {
-    // array index: NOTR  | (UP << 2)
-    (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,Conj, ColMajor,1,Upper>::run),
-    0,
-    // array index: ADJ   | (UP << 2)
-    (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,ColMajor,false,ColMajor,1,Upper>::run),
-    0,
-    // array index: NOTR  | (LO << 2)
-    (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,Conj, ColMajor,1,Lower>::run),
-    0,
-    // array index: ADJ   | (LO << 2)
-    (internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,ColMajor,false,ColMajor,1,Lower>::run),
-    0
-  };
+      // array index: NOTR  | (UP << 2)
+      (internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, ColMajor, false, Scalar, RowMajor, Conj,
+                                                          ColMajor, 1, Upper>::run),
+      0,
+      // array index: ADJ   | (UP << 2)
+      (internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, RowMajor, Conj, Scalar, ColMajor, false,
+                                                          ColMajor, 1, Upper>::run),
+      0,
+      // array index: NOTR  | (LO << 2)
+      (internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, ColMajor, false, Scalar, RowMajor, Conj,
+                                                          ColMajor, 1, Lower>::run),
+      0,
+      // array index: ADJ   | (LO << 2)
+      (internal::general_matrix_matrix_triangular_product<DenseIndex, Scalar, RowMajor, Conj, Scalar, ColMajor, false,
+                                                          ColMajor, 1, Lower>::run),
+      0};
 
-  const Scalar* a = reinterpret_cast<const Scalar*>(pa);
-  Scalar* c = reinterpret_cast<Scalar*>(pc);
+  const Scalar *a = reinterpret_cast<const Scalar *>(pa);
+  Scalar *c = reinterpret_cast<Scalar *>(pc);
   RealScalar alpha = *palpha;
-  RealScalar beta  = *pbeta;
+  RealScalar beta = *pbeta;
 
-//   std::cerr << "in herk " << *uplo << " " << *op << " " << *n << " " << *k << " " << alpha << " " << *lda << " " << beta << " " << *ldc << "\n";
+  //   std::cerr << "in herk " << *uplo << " " << *op << " " << *n << " " << *k << " " << alpha << " " << *lda << " " <<
+  //   beta << " " << *ldc << "\n";
 
   int info = 0;
-  if(UPLO(*uplo)==INVALID)                                            info = 1;
-  else if((OP(*op)==INVALID) || (OP(*op)==TR))                        info = 2;
-  else if(*n<0)                                                       info = 3;
-  else if(*k<0)                                                       info = 4;
-  else if(*lda<std::max(1,(OP(*op)==NOTR)?*n:*k))                     info = 7;
-  else if(*ldc<std::max(1,*n))                                        info = 10;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"HERK ",&info,6);
+  if (UPLO(*uplo) == INVALID)
+    info = 1;
+  else if ((OP(*op) == INVALID) || (OP(*op) == TR))
+    info = 2;
+  else if (*n < 0)
+    info = 3;
+  else if (*k < 0)
+    info = 4;
+  else if (*lda < std::max(1, (OP(*op) == NOTR) ? *n : *k))
+    info = 7;
+  else if (*ldc < std::max(1, *n))
+    info = 10;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "HERK ", &info, 6);
 
   int code = OP(*op) | (UPLO(*uplo) << 2);
 
-  if(beta!=RealScalar(1))
-  {
-    if(UPLO(*uplo)==UP)
-      if(beta==Scalar(0)) matrix(c, *n, *n, *ldc).triangularView<Upper>().setZero();
-      else                matrix(c, *n, *n, *ldc).triangularView<StrictlyUpper>() *= beta;
+  if (beta != RealScalar(1)) {
+    if (UPLO(*uplo) == UP)
+      if (beta == Scalar(0))
+        matrix(c, *n, *n, *ldc).triangularView<Upper>().setZero();
+      else
+        matrix(c, *n, *n, *ldc).triangularView<StrictlyUpper>() *= beta;
+    else if (beta == Scalar(0))
+      matrix(c, *n, *n, *ldc).triangularView<Lower>().setZero();
     else
-      if(beta==Scalar(0)) matrix(c, *n, *n, *ldc).triangularView<Lower>().setZero();
-      else                matrix(c, *n, *n, *ldc).triangularView<StrictlyLower>() *= beta;
+      matrix(c, *n, *n, *ldc).triangularView<StrictlyLower>() *= beta;
 
-    if(beta!=Scalar(0))
-    {
+    if (beta != Scalar(0)) {
       matrix(c, *n, *n, *ldc).diagonal().real() *= beta;
       matrix(c, *n, *n, *ldc).diagonal().imag().setZero();
     }
   }
 
-  if(*k>0 && alpha!=RealScalar(0))
-  {
-    internal::gemm_blocking_space<ColMajor,Scalar,Scalar,Dynamic,Dynamic,Dynamic> blocking(*n,*n,*k,1,false);
+  if (*k > 0 && alpha != RealScalar(0)) {
+    internal::gemm_blocking_space<ColMajor, Scalar, Scalar, Dynamic, Dynamic, Dynamic> blocking(*n, *n, *k, 1, false);
     func[code](*n, *k, a, *lda, a, *lda, c, 1, *ldc, alpha, blocking);
     matrix(c, *n, *n, *ldc).diagonal().imag().setZero();
   }
@@ -628,75 +746,76 @@
 
 // c = alpha*a*conj(b') + conj(alpha)*b*conj(a') + beta*c,  for op = 'N'or'n'
 // c = alpha*conj(a')*b + conj(alpha)*conj(b')*a + beta*c,  for op = 'C'or'c'
-int EIGEN_BLAS_FUNC(her2k)(const char *uplo, const char *op, const int *n, const int *k,
-                           const RealScalar *palpha, const RealScalar *pa, const int *lda, const RealScalar *pb, const int *ldb, const RealScalar *pbeta, RealScalar *pc, const int *ldc)
-{
-  const Scalar* a = reinterpret_cast<const Scalar*>(pa);
-  const Scalar* b = reinterpret_cast<const Scalar*>(pb);
-  Scalar* c = reinterpret_cast<Scalar*>(pc);
-  Scalar alpha = *reinterpret_cast<const Scalar*>(palpha);
-  RealScalar beta  = *pbeta;
+int EIGEN_BLAS_FUNC(her2k)(const char *uplo, const char *op, const int *n, const int *k, const RealScalar *palpha,
+                           const RealScalar *pa, const int *lda, const RealScalar *pb, const int *ldb,
+                           const RealScalar *pbeta, RealScalar *pc, const int *ldc) {
+  const Scalar *a = reinterpret_cast<const Scalar *>(pa);
+  const Scalar *b = reinterpret_cast<const Scalar *>(pb);
+  Scalar *c = reinterpret_cast<Scalar *>(pc);
+  Scalar alpha = *reinterpret_cast<const Scalar *>(palpha);
+  RealScalar beta = *pbeta;
 
-//   std::cerr << "in her2k " << *uplo << " " << *op << " " << *n << " " << *k << " " << alpha << " " << *lda << " " << *ldb << " " << beta << " " << *ldc << "\n";
+  //   std::cerr << "in her2k " << *uplo << " " << *op << " " << *n << " " << *k << " " << alpha << " " << *lda << " "
+  //   << *ldb << " " << beta << " " << *ldc << "\n";
 
   int info = 0;
-  if(UPLO(*uplo)==INVALID)                                            info = 1;
-  else if((OP(*op)==INVALID) || (OP(*op)==TR))                        info = 2;
-  else if(*n<0)                                                       info = 3;
-  else if(*k<0)                                                       info = 4;
-  else if(*lda<std::max(1,(OP(*op)==NOTR)?*n:*k))                     info = 7;
-  else if(*ldb<std::max(1,(OP(*op)==NOTR)?*n:*k))                     info = 9;
-  else if(*ldc<std::max(1,*n))                                        info = 12;
-  if(info)
-    return xerbla_(SCALAR_SUFFIX_UP"HER2K",&info,6);
+  if (UPLO(*uplo) == INVALID)
+    info = 1;
+  else if ((OP(*op) == INVALID) || (OP(*op) == TR))
+    info = 2;
+  else if (*n < 0)
+    info = 3;
+  else if (*k < 0)
+    info = 4;
+  else if (*lda < std::max(1, (OP(*op) == NOTR) ? *n : *k))
+    info = 7;
+  else if (*ldb < std::max(1, (OP(*op) == NOTR) ? *n : *k))
+    info = 9;
+  else if (*ldc < std::max(1, *n))
+    info = 12;
+  if (info) return xerbla_(SCALAR_SUFFIX_UP "HER2K", &info, 6);
 
-  if(beta!=RealScalar(1))
-  {
-    if(UPLO(*uplo)==UP)
-      if(beta==Scalar(0)) matrix(c, *n, *n, *ldc).triangularView<Upper>().setZero();
-      else                matrix(c, *n, *n, *ldc).triangularView<StrictlyUpper>() *= beta;
+  if (beta != RealScalar(1)) {
+    if (UPLO(*uplo) == UP)
+      if (beta == Scalar(0))
+        matrix(c, *n, *n, *ldc).triangularView<Upper>().setZero();
+      else
+        matrix(c, *n, *n, *ldc).triangularView<StrictlyUpper>() *= beta;
+    else if (beta == Scalar(0))
+      matrix(c, *n, *n, *ldc).triangularView<Lower>().setZero();
     else
-      if(beta==Scalar(0)) matrix(c, *n, *n, *ldc).triangularView<Lower>().setZero();
-      else                matrix(c, *n, *n, *ldc).triangularView<StrictlyLower>() *= beta;
+      matrix(c, *n, *n, *ldc).triangularView<StrictlyLower>() *= beta;
 
-    if(beta!=Scalar(0))
-    {
+    if (beta != Scalar(0)) {
       matrix(c, *n, *n, *ldc).diagonal().real() *= beta;
       matrix(c, *n, *n, *ldc).diagonal().imag().setZero();
     }
-  }
-  else if(*k>0 && alpha!=Scalar(0))
+  } else if (*k > 0 && alpha != Scalar(0))
     matrix(c, *n, *n, *ldc).diagonal().imag().setZero();
 
-  if(*k==0)
-    return 1;
+  if (*k == 0) return 1;
 
-  if(OP(*op)==NOTR)
-  {
-    if(UPLO(*uplo)==UP)
-    {
-      matrix(c, *n, *n, *ldc).triangularView<Upper>()
-        +=            alpha *matrix(a, *n, *k, *lda)*matrix(b, *n, *k, *ldb).adjoint()
-        +  numext::conj(alpha)*matrix(b, *n, *k, *ldb)*matrix(a, *n, *k, *lda).adjoint();
-    }
-    else if(UPLO(*uplo)==LO)
-      matrix(c, *n, *n, *ldc).triangularView<Lower>()
-        += alpha*matrix(a, *n, *k, *lda)*matrix(b, *n, *k, *ldb).adjoint()
-        +  numext::conj(alpha)*matrix(b, *n, *k, *ldb)*matrix(a, *n, *k, *lda).adjoint();
-  }
-  else if(OP(*op)==ADJ)
-  {
-    if(UPLO(*uplo)==UP)
-      matrix(c, *n, *n, *ldc).triangularView<Upper>()
-        +=             alpha*matrix(a, *k, *n, *lda).adjoint()*matrix(b, *k, *n, *ldb)
-        +  numext::conj(alpha)*matrix(b, *k, *n, *ldb).adjoint()*matrix(a, *k, *n, *lda);
-    else if(UPLO(*uplo)==LO)
-      matrix(c, *n, *n, *ldc).triangularView<Lower>()
-        +=             alpha*matrix(a, *k, *n, *lda).adjoint()*matrix(b, *k, *n, *ldb)
-        +  numext::conj(alpha)*matrix(b, *k, *n, *ldb).adjoint()*matrix(a, *k, *n, *lda);
+  if (OP(*op) == NOTR) {
+    if (UPLO(*uplo) == UP) {
+      matrix(c, *n, *n, *ldc).triangularView<Upper>() +=
+          alpha * matrix(a, *n, *k, *lda) * matrix(b, *n, *k, *ldb).adjoint() +
+          numext::conj(alpha) * matrix(b, *n, *k, *ldb) * matrix(a, *n, *k, *lda).adjoint();
+    } else if (UPLO(*uplo) == LO)
+      matrix(c, *n, *n, *ldc).triangularView<Lower>() +=
+          alpha * matrix(a, *n, *k, *lda) * matrix(b, *n, *k, *ldb).adjoint() +
+          numext::conj(alpha) * matrix(b, *n, *k, *ldb) * matrix(a, *n, *k, *lda).adjoint();
+  } else if (OP(*op) == ADJ) {
+    if (UPLO(*uplo) == UP)
+      matrix(c, *n, *n, *ldc).triangularView<Upper>() +=
+          alpha * matrix(a, *k, *n, *lda).adjoint() * matrix(b, *k, *n, *ldb) +
+          numext::conj(alpha) * matrix(b, *k, *n, *ldb).adjoint() * matrix(a, *k, *n, *lda);
+    else if (UPLO(*uplo) == LO)
+      matrix(c, *n, *n, *ldc).triangularView<Lower>() +=
+          alpha * matrix(a, *k, *n, *lda).adjoint() * matrix(b, *k, *n, *ldb) +
+          numext::conj(alpha) * matrix(b, *k, *n, *ldb).adjoint() * matrix(a, *k, *n, *lda);
   }
 
   return 1;
 }
 
-#endif // ISCOMPLEX
+#endif  // ISCOMPLEX
diff --git a/blas/single.cpp b/blas/single.cpp
index e66879a..9afea35 100644
--- a/blas/single.cpp
+++ b/blas/single.cpp
@@ -7,10 +7,10 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-#define SCALAR        float
+#define SCALAR float
 #define SCALAR_SUFFIX s
 #define SCALAR_SUFFIX_UP "S"
-#define ISCOMPLEX     0
+#define ISCOMPLEX 0
 
 #include "level1_impl.h"
 #include "level1_real_impl.h"
@@ -18,5 +18,6 @@
 #include "level2_real_impl.h"
 #include "level3_impl.h"
 
-float EIGEN_BLAS_FUNC(dsdot)(int* n, float* alpha, float* x, int* incx, float* y, int* incy)
-{ return double(*alpha) + BLASFUNC(dsdot)(n, x, incx, y, incy); }
+float EIGEN_BLAS_FUNC(dsdot)(int* n, float* alpha, float* x, int* incx, float* y, int* incy) {
+  return double(*alpha) + BLASFUNC(dsdot)(n, x, incx, y, incy);
+}
diff --git a/blas/xerbla.cpp b/blas/xerbla.cpp
index c373e86..698e89f 100644
--- a/blas/xerbla.cpp
+++ b/blas/xerbla.cpp
@@ -2,19 +2,17 @@
 #include <stdio.h>
 
 #if (defined __GNUC__) && (!defined __MINGW32__) && (!defined __CYGWIN__)
-#define EIGEN_WEAK_LINKING __attribute__ ((weak))
+#define EIGEN_WEAK_LINKING __attribute__((weak))
 #else
 #define EIGEN_WEAK_LINKING
 #endif
 
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
 
-EIGEN_WEAK_LINKING int xerbla_(const char * msg, int *info, int)
-{
-  printf("Eigen BLAS ERROR #%i: %s\n", *info, msg );
+EIGEN_WEAK_LINKING int xerbla_(const char *msg, int *info, int) {
+  printf("Eigen BLAS ERROR #%i: %s\n", *info, msg);
   return 0;
 }
 
diff --git a/demos/mandelbrot/mandelbrot.cpp b/demos/mandelbrot/mandelbrot.cpp
index 5d575d5..a5b1dc8 100644
--- a/demos/mandelbrot/mandelbrot.cpp
+++ b/demos/mandelbrot/mandelbrot.cpp
@@ -9,201 +9,184 @@
 
 #include "mandelbrot.h"
 #include <iostream>
-#include<QtGui/QPainter>
-#include<QtGui/QImage>
-#include<QtGui/QMouseEvent>
-#include<QtCore/QTime>
+#include <QtGui/QPainter>
+#include <QtGui/QImage>
+#include <QtGui/QMouseEvent>
+#include <QtCore/QTime>
 
-void MandelbrotWidget::resizeEvent(QResizeEvent *)
-{
-  if(size < width() * height())
-  {
+void MandelbrotWidget::resizeEvent(QResizeEvent *) {
+  if (size < width() * height()) {
     std::cout << "reallocate buffer" << std::endl;
     size = width() * height();
-    if(buffer) delete[]buffer;
-    buffer = new unsigned char[4*size];
+    if (buffer) delete[] buffer;
+    buffer = new unsigned char[4 * size];
   }
 }
 
-template<typename T> struct iters_before_test { enum { ret = 8 }; };
-template<> struct iters_before_test<double> { enum { ret = 16 }; };
+template <typename T>
+struct iters_before_test {
+  enum { ret = 8 };
+};
+template <>
+struct iters_before_test<double> {
+  enum { ret = 16 };
+};
 
-template<typename Real> void MandelbrotThread::render(int img_width, int img_height)
-{
-  enum { packetSize = Eigen::internal::packet_traits<Real>::size }; // number of reals in a Packet
-  typedef Eigen::Array<Real, packetSize, 1> Packet; // wrap a Packet as a vector
+template <typename Real>
+void MandelbrotThread::render(int img_width, int img_height) {
+  enum { packetSize = Eigen::internal::packet_traits<Real>::size };  // number of reals in a Packet
+  typedef Eigen::Array<Real, packetSize, 1> Packet;                  // wrap a Packet as a vector
 
   enum { iters_before_test = iters_before_test<Real>::ret };
   max_iter = (max_iter / iters_before_test) * iters_before_test;
-  const int alignedWidth = (img_width/packetSize)*packetSize;
+  const int alignedWidth = (img_width / packetSize) * packetSize;
   unsigned char *const buffer = widget->buffer;
   const double xradius = widget->xradius;
   const double yradius = xradius * img_height / img_width;
   const int threadcount = widget->threadcount;
   typedef Eigen::Array<Real, 2, 1> Vector2;
   Vector2 start(widget->center.x() - widget->xradius, widget->center.y() - yradius);
-  Vector2 step(2*widget->xradius/img_width, 2*yradius/img_height);
+  Vector2 step(2 * widget->xradius / img_width, 2 * yradius / img_height);
   total_iter = 0;
 
-  for(int y = id; y < img_height; y += threadcount)
-  {
+  for (int y = id; y < img_height; y += threadcount) {
     int pix = y * img_width;
 
-    // for each pixel, we're going to do the iteration z := z^2 + c where z and c are complex numbers, 
+    // for each pixel, we're going to do the iteration z := z^2 + c where z and c are complex numbers,
     // starting with z = c = complex coord of the pixel. pzi and pzr denote the real and imaginary parts of z.
     // pci and pcr denote the real and imaginary parts of c.
 
     Packet pzi_start, pci_start;
-    for(int i = 0; i < packetSize; i++) pzi_start[i] = pci_start[i] = start.y() + y * step.y();
+    for (int i = 0; i < packetSize; i++) pzi_start[i] = pci_start[i] = start.y() + y * step.y();
 
-    for(int x = 0; x < alignedWidth; x += packetSize, pix += packetSize)
-    {
+    for (int x = 0; x < alignedWidth; x += packetSize, pix += packetSize) {
       Packet pcr, pci = pci_start, pzr, pzi = pzi_start, pzr_buf;
-      for(int i = 0; i < packetSize; i++) pzr[i] = pcr[i] = start.x() + (x+i) * step.x();
+      for (int i = 0; i < packetSize; i++) pzr[i] = pcr[i] = start.x() + (x + i) * step.x();
 
       // do the iterations. Every iters_before_test iterations we check for divergence,
       // in which case we can stop iterating.
       int j = 0;
       typedef Eigen::Matrix<int, packetSize, 1> Packeti;
-      Packeti pix_iter = Packeti::Zero(), // number of iteration per pixel in the packet
-              pix_dont_diverge; // whether or not each pixel has already diverged
-      do
-      {
-        for(int i = 0; i < iters_before_test/4; i++) // peel the inner loop by 4
+      Packeti pix_iter = Packeti::Zero(),  // number of iteration per pixel in the packet
+          pix_dont_diverge;                // whether or not each pixel has already diverged
+      do {
+        for (int i = 0; i < iters_before_test / 4; i++)  // peel the inner loop by 4
         {
-#         define ITERATE \
-            pzr_buf = pzr; \
-            pzr = pzr.square(); \
-            pzr -= pzi.square(); \
-            pzr += pcr; \
-            pzi = (2*pzr_buf)*pzi; \
-            pzi += pci;
+#define ITERATE              \
+  pzr_buf = pzr;             \
+  pzr = pzr.square();        \
+  pzr -= pzi.square();       \
+  pzr += pcr;                \
+  pzi = (2 * pzr_buf) * pzi; \
+  pzi += pci;
           ITERATE ITERATE ITERATE ITERATE
         }
-        pix_dont_diverge = ((pzr.square() + pzi.square())
-                           .eval() // temporary fix as what follows is not yet vectorized by Eigen
-                           <= Packet::Constant(4))
-                                // the 4 here is not a magic value, it's a math fact that if
-                                // the square modulus is >4 then divergence is inevitable.
-                           .template cast<int>();
+        pix_dont_diverge =
+            ((pzr.square() + pzi.square()).eval()  // temporary fix as what follows is not yet vectorized by Eigen
+             <= Packet::Constant(4))
+                // the 4 here is not a magic value, it's a math fact that if
+                // the square modulus is >4 then divergence is inevitable.
+                .template cast<int>();
         pix_iter += iters_before_test * pix_dont_diverge;
         j++;
         total_iter += iters_before_test * packetSize;
-      }
-      while(j < max_iter/iters_before_test && pix_dont_diverge.any()); // any() is not yet vectorized by Eigen
+      } while (j < max_iter / iters_before_test && pix_dont_diverge.any());  // any() is not yet vectorized by Eigen
 
       // compute pixel colors
-      for(int i = 0; i < packetSize; i++)
-      {
-        buffer[4*(pix+i)] = 255*pix_iter[i]/max_iter;
-        buffer[4*(pix+i)+1] = 0;
-        buffer[4*(pix+i)+2] = 0;
+      for (int i = 0; i < packetSize; i++) {
+        buffer[4 * (pix + i)] = 255 * pix_iter[i] / max_iter;
+        buffer[4 * (pix + i) + 1] = 0;
+        buffer[4 * (pix + i) + 2] = 0;
       }
     }
 
     // if the width is not a multiple of packetSize, fill the remainder in black
-    for(int x = alignedWidth; x < img_width; x++, pix++)
-      buffer[4*pix] = buffer[4*pix+1] = buffer[4*pix+2] = 0;
+    for (int x = alignedWidth; x < img_width; x++, pix++)
+      buffer[4 * pix] = buffer[4 * pix + 1] = buffer[4 * pix + 2] = 0;
   }
   return;
 }
 
-void MandelbrotThread::run()
-{
+void MandelbrotThread::run() {
   setTerminationEnabled(true);
-  double resolution = widget->xradius*2/widget->width();
+  double resolution = widget->xradius * 2 / widget->width();
   max_iter = 128;
-  if(resolution < 1e-4f) max_iter += 128 * ( - 4 - std::log10(resolution));
-  int img_width = widget->width()/widget->draft;
-  int img_height = widget->height()/widget->draft;
+  if (resolution < 1e-4f) max_iter += 128 * (-4 - std::log10(resolution));
+  int img_width = widget->width() / widget->draft;
+  int img_height = widget->height() / widget->draft;
   single_precision = resolution > 1e-7f;
 
-  if(single_precision)
+  if (single_precision)
     render<float>(img_width, img_height);
   else
     render<double>(img_width, img_height);
 }
 
-void MandelbrotWidget::paintEvent(QPaintEvent *)
-{
+void MandelbrotWidget::paintEvent(QPaintEvent *) {
   static float max_speed = 0;
   long long total_iter = 0;
 
   QTime time;
   time.start();
-  for(int th = 0; th < threadcount; th++)
-    threads[th]->start(QThread::LowPriority);
-  for(int th = 0; th < threadcount; th++)
-  {
+  for (int th = 0; th < threadcount; th++) threads[th]->start(QThread::LowPriority);
+  for (int th = 0; th < threadcount; th++) {
     threads[th]->wait();
     total_iter += threads[th]->total_iter;
   }
   int elapsed = time.elapsed();
 
-  if(draft == 1)
-  {
-    float speed = elapsed ? float(total_iter)*1000/elapsed : 0;
+  if (draft == 1) {
+    float speed = elapsed ? float(total_iter) * 1000 / elapsed : 0;
     max_speed = std::max(max_speed, speed);
-    std::cout << threadcount << " threads, "
-              << elapsed << " ms, "
-              << speed << " iters/s (max " << max_speed << ")" << std::endl;
-    int packetSize = threads[0]->single_precision
-                   ? int(Eigen::internal::packet_traits<float>::size)
-                   : int(Eigen::internal::packet_traits<double>::size);
-    setWindowTitle(QString("resolution ")+QString::number(xradius*2/width(), 'e', 2)
-                  +QString(", %1 iterations per pixel, ").arg(threads[0]->max_iter)
-                  +(threads[0]->single_precision ? QString("single ") : QString("double "))
-                  +QString("precision, ")
-                  +(packetSize==1 ? QString("no vectorization")
-                                  : QString("vectorized (%1 per packet)").arg(packetSize)));
+    std::cout << threadcount << " threads, " << elapsed << " ms, " << speed << " iters/s (max " << max_speed << ")"
+              << std::endl;
+    int packetSize = threads[0]->single_precision ? int(Eigen::internal::packet_traits<float>::size)
+                                                  : int(Eigen::internal::packet_traits<double>::size);
+    setWindowTitle(
+        QString("resolution ") + QString::number(xradius * 2 / width(), 'e', 2) +
+        QString(", %1 iterations per pixel, ").arg(threads[0]->max_iter) +
+        (threads[0]->single_precision ? QString("single ") : QString("double ")) + QString("precision, ") +
+        (packetSize == 1 ? QString("no vectorization") : QString("vectorized (%1 per packet)").arg(packetSize)));
   }
-  
-  QImage image(buffer, width()/draft, height()/draft, QImage::Format_RGB32);
+
+  QImage image(buffer, width() / draft, height() / draft, QImage::Format_RGB32);
   QPainter painter(this);
   painter.drawImage(QPoint(0, 0), image.scaled(width(), height()));
 
-  if(draft>1)
-  {
+  if (draft > 1) {
     draft /= 2;
     setWindowTitle(QString("recomputing at 1/%1 resolution...").arg(draft));
     update();
   }
 }
 
-void MandelbrotWidget::mousePressEvent(QMouseEvent *event)
-{
-  if( event->buttons() & Qt::LeftButton )
-  {
+void MandelbrotWidget::mousePressEvent(QMouseEvent *event) {
+  if (event->buttons() & Qt::LeftButton) {
     lastpos = event->pos();
     double yradius = xradius * height() / width();
-    center = Eigen::Vector2d(center.x() + (event->pos().x() - width()/2) * xradius * 2 / width(),
-                             center.y() + (event->pos().y() - height()/2) * yradius * 2 / height());
+    center = Eigen::Vector2d(center.x() + (event->pos().x() - width() / 2) * xradius * 2 / width(),
+                             center.y() + (event->pos().y() - height() / 2) * yradius * 2 / height());
     draft = 16;
-    for(int th = 0; th < threadcount; th++)
-      threads[th]->terminate();
+    for (int th = 0; th < threadcount; th++) threads[th]->terminate();
     update();
   }
 }
 
-void MandelbrotWidget::mouseMoveEvent(QMouseEvent *event)
-{
+void MandelbrotWidget::mouseMoveEvent(QMouseEvent *event) {
   QPoint delta = event->pos() - lastpos;
   lastpos = event->pos();
-  if( event->buttons() & Qt::LeftButton )
-  {
+  if (event->buttons() & Qt::LeftButton) {
     double t = 1 + 5 * double(delta.y()) / height();
-    if(t < 0.5) t = 0.5;
-    if(t > 2) t = 2;
+    if (t < 0.5) t = 0.5;
+    if (t > 2) t = 2;
     xradius *= t;
     draft = 16;
-    for(int th = 0; th < threadcount; th++)
-      threads[th]->terminate();
+    for (int th = 0; th < threadcount; th++) threads[th]->terminate();
     update();
   }
 }
 
-int main(int argc, char *argv[])
-{
+int main(int argc, char *argv[]) {
   QApplication app(argc, argv);
   MandelbrotWidget w;
   w.show();
diff --git a/demos/mandelbrot/mandelbrot.h b/demos/mandelbrot/mandelbrot.h
index a687fd0..8b8e5b9 100644
--- a/demos/mandelbrot/mandelbrot.h
+++ b/demos/mandelbrot/mandelbrot.h
@@ -17,55 +17,51 @@
 
 class MandelbrotWidget;
 
-class MandelbrotThread : public QThread
-{
-    friend class MandelbrotWidget;
-    MandelbrotWidget *widget;
-    long long total_iter;
-    int id, max_iter;
-    bool single_precision;
+class MandelbrotThread : public QThread {
+  friend class MandelbrotWidget;
+  MandelbrotWidget *widget;
+  long long total_iter;
+  int id, max_iter;
+  bool single_precision;
 
-  public:
-    MandelbrotThread(MandelbrotWidget *w, int i) : widget(w), id(i) {}
-    void run();
-    template<typename Real> void render(int img_width, int img_height);
+ public:
+  MandelbrotThread(MandelbrotWidget *w, int i) : widget(w), id(i) {}
+  void run();
+  template <typename Real>
+  void render(int img_width, int img_height);
 };
 
-class MandelbrotWidget : public QWidget
-{
-    Q_OBJECT
+class MandelbrotWidget : public QWidget {
+  Q_OBJECT
 
-    friend class MandelbrotThread;
-    Eigen::Vector2d center;
-    double xradius;
-    int size;
-    unsigned char *buffer;
-    QPoint lastpos;
-    int draft;
-    MandelbrotThread **threads;
-    int threadcount;
+  friend class MandelbrotThread;
+  Eigen::Vector2d center;
+  double xradius;
+  int size;
+  unsigned char *buffer;
+  QPoint lastpos;
+  int draft;
+  MandelbrotThread **threads;
+  int threadcount;
 
-  protected:
-    void resizeEvent(QResizeEvent *);
-    void paintEvent(QPaintEvent *);
-    void mousePressEvent(QMouseEvent *event);
-    void mouseMoveEvent(QMouseEvent *event);
+ protected:
+  void resizeEvent(QResizeEvent *);
+  void paintEvent(QPaintEvent *);
+  void mousePressEvent(QMouseEvent *event);
+  void mouseMoveEvent(QMouseEvent *event);
 
-  public:
-    MandelbrotWidget() : QWidget(), center(0,0), xradius(2),
-                         size(0), buffer(0), draft(16)
-    {
-      setAutoFillBackground(false);
-      threadcount = QThread::idealThreadCount();
-      threads = new MandelbrotThread*[threadcount];
-      for(int th = 0; th < threadcount; th++) threads[th] = new MandelbrotThread(this, th);
-    }
-    ~MandelbrotWidget()
-    {
-      if(buffer) delete[]buffer;
-      for(int th = 0; th < threadcount; th++) delete threads[th];
-      delete[] threads;
-    }
+ public:
+  MandelbrotWidget() : QWidget(), center(0, 0), xradius(2), size(0), buffer(0), draft(16) {
+    setAutoFillBackground(false);
+    threadcount = QThread::idealThreadCount();
+    threads = new MandelbrotThread *[threadcount];
+    for (int th = 0; th < threadcount; th++) threads[th] = new MandelbrotThread(this, th);
+  }
+  ~MandelbrotWidget() {
+    if (buffer) delete[] buffer;
+    for (int th = 0; th < threadcount; th++) delete threads[th];
+    delete[] threads;
+  }
 };
 
-#endif // MANDELBROT_H
+#endif  // MANDELBROT_H
diff --git a/demos/mix_eigen_and_c/binary_library.cpp b/demos/mix_eigen_and_c/binary_library.cpp
index 15a2d03..2ac7821 100644
--- a/demos/mix_eigen_and_c/binary_library.cpp
+++ b/demos/mix_eigen_and_c/binary_library.cpp
@@ -20,166 +20,84 @@
 
 ////// class MatrixXd //////
 
-inline MatrixXd& c_to_eigen(C_MatrixXd* ptr)
-{
-  return *reinterpret_cast<MatrixXd*>(ptr);
-}
+inline MatrixXd &c_to_eigen(C_MatrixXd *ptr) { return *reinterpret_cast<MatrixXd *>(ptr); }
 
-inline const MatrixXd& c_to_eigen(const C_MatrixXd* ptr)
-{
-  return *reinterpret_cast<const MatrixXd*>(ptr);
-}
+inline const MatrixXd &c_to_eigen(const C_MatrixXd *ptr) { return *reinterpret_cast<const MatrixXd *>(ptr); }
 
-inline C_MatrixXd* eigen_to_c(MatrixXd& ref)
-{
-  return reinterpret_cast<C_MatrixXd*>(&ref);
-}
+inline C_MatrixXd *eigen_to_c(MatrixXd &ref) { return reinterpret_cast<C_MatrixXd *>(&ref); }
 
-inline const C_MatrixXd* eigen_to_c(const MatrixXd& ref)
-{
-  return reinterpret_cast<const C_MatrixXd*>(&ref);
-}
+inline const C_MatrixXd *eigen_to_c(const MatrixXd &ref) { return reinterpret_cast<const C_MatrixXd *>(&ref); }
 
 ////// class Map<MatrixXd> //////
 
-inline Map<MatrixXd>& c_to_eigen(C_Map_MatrixXd* ptr)
-{
-  return *reinterpret_cast<Map<MatrixXd>*>(ptr);
+inline Map<MatrixXd> &c_to_eigen(C_Map_MatrixXd *ptr) { return *reinterpret_cast<Map<MatrixXd> *>(ptr); }
+
+inline const Map<MatrixXd> &c_to_eigen(const C_Map_MatrixXd *ptr) {
+  return *reinterpret_cast<const Map<MatrixXd> *>(ptr);
 }
 
-inline const Map<MatrixXd>& c_to_eigen(const C_Map_MatrixXd* ptr)
-{
-  return *reinterpret_cast<const Map<MatrixXd>*>(ptr);
-}
+inline C_Map_MatrixXd *eigen_to_c(Map<MatrixXd> &ref) { return reinterpret_cast<C_Map_MatrixXd *>(&ref); }
 
-inline C_Map_MatrixXd* eigen_to_c(Map<MatrixXd>& ref)
-{
-  return reinterpret_cast<C_Map_MatrixXd*>(&ref);
+inline const C_Map_MatrixXd *eigen_to_c(const Map<MatrixXd> &ref) {
+  return reinterpret_cast<const C_Map_MatrixXd *>(&ref);
 }
 
-inline const C_Map_MatrixXd* eigen_to_c(const Map<MatrixXd>& ref)
-{
-  return reinterpret_cast<const C_Map_MatrixXd*>(&ref);
-}
-
-
 /************************* implementation of classes **********************************************/
 
-
 ////// class MatrixXd //////
 
+C_MatrixXd *MatrixXd_new(int rows, int cols) { return eigen_to_c(*new MatrixXd(rows, cols)); }
 
-C_MatrixXd* MatrixXd_new(int rows, int cols)
-{
-  return eigen_to_c(*new MatrixXd(rows,cols));
-}
+void MatrixXd_delete(C_MatrixXd *m) { delete &c_to_eigen(m); }
 
-void MatrixXd_delete(C_MatrixXd *m)
-{
-  delete &c_to_eigen(m);
-}
+double *MatrixXd_data(C_MatrixXd *m) { return c_to_eigen(m).data(); }
 
-double* MatrixXd_data(C_MatrixXd *m)
-{
-  return c_to_eigen(m).data();
-}
+void MatrixXd_set_zero(C_MatrixXd *m) { c_to_eigen(m).setZero(); }
 
-void MatrixXd_set_zero(C_MatrixXd *m)
-{
-  c_to_eigen(m).setZero();
-}
+void MatrixXd_resize(C_MatrixXd *m, int rows, int cols) { c_to_eigen(m).resize(rows, cols); }
 
-void MatrixXd_resize(C_MatrixXd *m, int rows, int cols)
-{
-  c_to_eigen(m).resize(rows,cols);
-}
+void MatrixXd_copy(C_MatrixXd *dst, const C_MatrixXd *src) { c_to_eigen(dst) = c_to_eigen(src); }
 
-void MatrixXd_copy(C_MatrixXd *dst, const C_MatrixXd *src)
-{
-  c_to_eigen(dst) = c_to_eigen(src);
-}
+void MatrixXd_copy_map(C_MatrixXd *dst, const C_Map_MatrixXd *src) { c_to_eigen(dst) = c_to_eigen(src); }
 
-void MatrixXd_copy_map(C_MatrixXd *dst, const C_Map_MatrixXd *src)
-{
-  c_to_eigen(dst) = c_to_eigen(src);
-}
+void MatrixXd_set_coeff(C_MatrixXd *m, int i, int j, double coeff) { c_to_eigen(m)(i, j) = coeff; }
 
-void MatrixXd_set_coeff(C_MatrixXd *m, int i, int j, double coeff)
-{
-  c_to_eigen(m)(i,j) = coeff;
-}
+double MatrixXd_get_coeff(const C_MatrixXd *m, int i, int j) { return c_to_eigen(m)(i, j); }
 
-double MatrixXd_get_coeff(const C_MatrixXd *m, int i, int j)
-{
-  return c_to_eigen(m)(i,j);
-}
+void MatrixXd_print(const C_MatrixXd *m) { std::cout << c_to_eigen(m) << std::endl; }
 
-void MatrixXd_print(const C_MatrixXd *m)
-{
-  std::cout << c_to_eigen(m) << std::endl;
-}
-
-void MatrixXd_multiply(const C_MatrixXd *m1, const C_MatrixXd *m2, C_MatrixXd *result)
-{
+void MatrixXd_multiply(const C_MatrixXd *m1, const C_MatrixXd *m2, C_MatrixXd *result) {
   c_to_eigen(result) = c_to_eigen(m1) * c_to_eigen(m2);
 }
 
-void MatrixXd_add(const C_MatrixXd *m1, const C_MatrixXd *m2, C_MatrixXd *result)
-{
+void MatrixXd_add(const C_MatrixXd *m1, const C_MatrixXd *m2, C_MatrixXd *result) {
   c_to_eigen(result) = c_to_eigen(m1) + c_to_eigen(m2);
 }
 
-
-
 ////// class Map_MatrixXd //////
 
-
-C_Map_MatrixXd* Map_MatrixXd_new(double *array, int rows, int cols)
-{
-  return eigen_to_c(*new Map<MatrixXd>(array,rows,cols));
+C_Map_MatrixXd *Map_MatrixXd_new(double *array, int rows, int cols) {
+  return eigen_to_c(*new Map<MatrixXd>(array, rows, cols));
 }
 
-void Map_MatrixXd_delete(C_Map_MatrixXd *m)
-{
-  delete &c_to_eigen(m);
-}
+void Map_MatrixXd_delete(C_Map_MatrixXd *m) { delete &c_to_eigen(m); }
 
-void Map_MatrixXd_set_zero(C_Map_MatrixXd *m)
-{
-  c_to_eigen(m).setZero();
-}
+void Map_MatrixXd_set_zero(C_Map_MatrixXd *m) { c_to_eigen(m).setZero(); }
 
-void Map_MatrixXd_copy(C_Map_MatrixXd *dst, const C_Map_MatrixXd *src)
-{
-  c_to_eigen(dst) = c_to_eigen(src);
-}
+void Map_MatrixXd_copy(C_Map_MatrixXd *dst, const C_Map_MatrixXd *src) { c_to_eigen(dst) = c_to_eigen(src); }
 
-void Map_MatrixXd_copy_matrix(C_Map_MatrixXd *dst, const C_MatrixXd *src)
-{
-  c_to_eigen(dst) = c_to_eigen(src);
-}
+void Map_MatrixXd_copy_matrix(C_Map_MatrixXd *dst, const C_MatrixXd *src) { c_to_eigen(dst) = c_to_eigen(src); }
 
-void Map_MatrixXd_set_coeff(C_Map_MatrixXd *m, int i, int j, double coeff)
-{
-  c_to_eigen(m)(i,j) = coeff;
-}
+void Map_MatrixXd_set_coeff(C_Map_MatrixXd *m, int i, int j, double coeff) { c_to_eigen(m)(i, j) = coeff; }
 
-double Map_MatrixXd_get_coeff(const C_Map_MatrixXd *m, int i, int j)
-{
-  return c_to_eigen(m)(i,j);
-}
+double Map_MatrixXd_get_coeff(const C_Map_MatrixXd *m, int i, int j) { return c_to_eigen(m)(i, j); }
 
-void Map_MatrixXd_print(const C_Map_MatrixXd *m)
-{
-  std::cout << c_to_eigen(m) << std::endl;
-}
+void Map_MatrixXd_print(const C_Map_MatrixXd *m) { std::cout << c_to_eigen(m) << std::endl; }
 
-void Map_MatrixXd_multiply(const C_Map_MatrixXd *m1, const C_Map_MatrixXd *m2, C_Map_MatrixXd *result)
-{
+void Map_MatrixXd_multiply(const C_Map_MatrixXd *m1, const C_Map_MatrixXd *m2, C_Map_MatrixXd *result) {
   c_to_eigen(result) = c_to_eigen(m1) * c_to_eigen(m2);
 }
 
-void Map_MatrixXd_add(const C_Map_MatrixXd *m1, const C_Map_MatrixXd *m2, C_Map_MatrixXd *result)
-{
+void Map_MatrixXd_add(const C_Map_MatrixXd *m1, const C_Map_MatrixXd *m2, C_Map_MatrixXd *result) {
   c_to_eigen(result) = c_to_eigen(m1) + c_to_eigen(m2);
 }
diff --git a/demos/mix_eigen_and_c/binary_library.h b/demos/mix_eigen_and_c/binary_library.h
index 9b63fac..9f16382 100644
--- a/demos/mix_eigen_and_c/binary_library.h
+++ b/demos/mix_eigen_and_c/binary_library.h
@@ -13,59 +13,43 @@
 // they will be compiled to C object code.
 
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
 
-  // just dummy empty structs to give different pointer types,
-  // instead of using void* which would be type unsafe
-  struct C_MatrixXd {};
-  struct C_Map_MatrixXd {};
+// just dummy empty structs to give different pointer types,
+// instead of using void* which would be type unsafe
+struct C_MatrixXd {};
+struct C_Map_MatrixXd {};
 
-  // the C_MatrixXd class, wraps some of the functionality
-  // of Eigen::MatrixXd.
-  struct C_MatrixXd* MatrixXd_new(int rows, int cols);
-  void    MatrixXd_delete     (struct C_MatrixXd *m);
-  double* MatrixXd_data       (struct C_MatrixXd *m);
-  void    MatrixXd_set_zero   (struct C_MatrixXd *m);
-  void    MatrixXd_resize     (struct C_MatrixXd *m, int rows, int cols);
-  void    MatrixXd_copy       (struct C_MatrixXd *dst,
-                               const struct C_MatrixXd *src);
-  void    MatrixXd_copy_map   (struct C_MatrixXd *dst,
-                               const struct C_Map_MatrixXd *src);  
-  void    MatrixXd_set_coeff  (struct C_MatrixXd *m,
-                               int i, int j, double coeff);
-  double  MatrixXd_get_coeff  (const struct C_MatrixXd *m,
-                               int i, int j);
-  void    MatrixXd_print      (const struct C_MatrixXd *m);
-  void    MatrixXd_add        (const struct C_MatrixXd *m1,
-                               const struct C_MatrixXd *m2,
-                               struct C_MatrixXd *result);  
-  void    MatrixXd_multiply   (const struct C_MatrixXd *m1,
-                               const struct C_MatrixXd *m2,
-                               struct C_MatrixXd *result);
-  
-  // the C_Map_MatrixXd class, wraps some of the functionality
-  // of Eigen::Map<MatrixXd>
-  struct C_Map_MatrixXd* Map_MatrixXd_new(double *array, int rows, int cols);
-  void   Map_MatrixXd_delete     (struct C_Map_MatrixXd *m);
-  void   Map_MatrixXd_set_zero   (struct C_Map_MatrixXd *m);
-  void   Map_MatrixXd_copy       (struct C_Map_MatrixXd *dst,
-                                  const struct C_Map_MatrixXd *src);
-  void   Map_MatrixXd_copy_matrix(struct C_Map_MatrixXd *dst,
-                                  const struct C_MatrixXd *src);  
-  void   Map_MatrixXd_set_coeff  (struct C_Map_MatrixXd *m,
-                                  int i, int j, double coeff);
-  double Map_MatrixXd_get_coeff  (const struct C_Map_MatrixXd *m,
-                                  int i, int j);
-  void   Map_MatrixXd_print      (const struct C_Map_MatrixXd *m);
-  void   Map_MatrixXd_add        (const struct C_Map_MatrixXd *m1,
-                                  const struct C_Map_MatrixXd *m2,
-                                  struct C_Map_MatrixXd *result);  
-  void   Map_MatrixXd_multiply   (const struct C_Map_MatrixXd *m1,
-                                  const struct C_Map_MatrixXd *m2,
-                                  struct C_Map_MatrixXd *result);
+// the C_MatrixXd class, wraps some of the functionality
+// of Eigen::MatrixXd.
+struct C_MatrixXd *MatrixXd_new(int rows, int cols);
+void MatrixXd_delete(struct C_MatrixXd *m);
+double *MatrixXd_data(struct C_MatrixXd *m);
+void MatrixXd_set_zero(struct C_MatrixXd *m);
+void MatrixXd_resize(struct C_MatrixXd *m, int rows, int cols);
+void MatrixXd_copy(struct C_MatrixXd *dst, const struct C_MatrixXd *src);
+void MatrixXd_copy_map(struct C_MatrixXd *dst, const struct C_Map_MatrixXd *src);
+void MatrixXd_set_coeff(struct C_MatrixXd *m, int i, int j, double coeff);
+double MatrixXd_get_coeff(const struct C_MatrixXd *m, int i, int j);
+void MatrixXd_print(const struct C_MatrixXd *m);
+void MatrixXd_add(const struct C_MatrixXd *m1, const struct C_MatrixXd *m2, struct C_MatrixXd *result);
+void MatrixXd_multiply(const struct C_MatrixXd *m1, const struct C_MatrixXd *m2, struct C_MatrixXd *result);
+
+// the C_Map_MatrixXd class, wraps some of the functionality
+// of Eigen::Map<MatrixXd>
+struct C_Map_MatrixXd *Map_MatrixXd_new(double *array, int rows, int cols);
+void Map_MatrixXd_delete(struct C_Map_MatrixXd *m);
+void Map_MatrixXd_set_zero(struct C_Map_MatrixXd *m);
+void Map_MatrixXd_copy(struct C_Map_MatrixXd *dst, const struct C_Map_MatrixXd *src);
+void Map_MatrixXd_copy_matrix(struct C_Map_MatrixXd *dst, const struct C_MatrixXd *src);
+void Map_MatrixXd_set_coeff(struct C_Map_MatrixXd *m, int i, int j, double coeff);
+double Map_MatrixXd_get_coeff(const struct C_Map_MatrixXd *m, int i, int j);
+void Map_MatrixXd_print(const struct C_Map_MatrixXd *m);
+void Map_MatrixXd_add(const struct C_Map_MatrixXd *m1, const struct C_Map_MatrixXd *m2, struct C_Map_MatrixXd *result);
+void Map_MatrixXd_multiply(const struct C_Map_MatrixXd *m1, const struct C_Map_MatrixXd *m2,
+                           struct C_Map_MatrixXd *result);
 
 #ifdef __cplusplus
-} // end extern "C"
+}  // end extern "C"
 #endif
diff --git a/demos/mix_eigen_and_c/example.c b/demos/mix_eigen_and_c/example.c
index 508eb54..790c45b 100644
--- a/demos/mix_eigen_and_c/example.c
+++ b/demos/mix_eigen_and_c/example.c
@@ -10,11 +10,10 @@
 #include "binary_library.h"
 #include "stdio.h"
 
-void demo_MatrixXd()
-{
+void demo_MatrixXd() {
   struct C_MatrixXd *matrix1, *matrix2, *result;
   printf("*** demo_MatrixXd ***\n");
-  
+
   matrix1 = MatrixXd_new(3, 3);
   MatrixXd_set_zero(matrix1);
   MatrixXd_set_coeff(matrix1, 0, 1, 2.5);
@@ -32,24 +31,22 @@
 }
 
 // this helper function takes a plain C array and prints it in one line
-void print_array(double *array, int n)
-{
+void print_array(double *array, int n) {
   struct C_Map_MatrixXd *m = Map_MatrixXd_new(array, 1, n);
   Map_MatrixXd_print(m);
   Map_MatrixXd_delete(m);
 }
 
-void demo_Map_MatrixXd()
-{
+void demo_Map_MatrixXd() {
   struct C_Map_MatrixXd *map;
   double array[5];
   int i;
   printf("*** demo_Map_MatrixXd ***\n");
-  
-  for(i = 0; i < 5; ++i) array[i] = i;
+
+  for (i = 0; i < 5; ++i) array[i] = i;
   printf("Initially, the array is:\n");
   print_array(array, 5);
-  
+
   map = Map_MatrixXd_new(array, 5, 1);
   Map_MatrixXd_add(map, map, map);
   Map_MatrixXd_delete(map);
@@ -58,8 +55,7 @@
   print_array(array, 5);
 }
 
-int main()
-{
+int main() {
   demo_MatrixXd();
   demo_Map_MatrixXd();
 }
diff --git a/demos/opengl/camera.cpp b/demos/opengl/camera.cpp
index 8a2344c..ea01d90 100644
--- a/demos/opengl/camera.cpp
+++ b/demos/opengl/camera.cpp
@@ -15,250 +15,205 @@
 #include "Eigen/LU"
 using namespace Eigen;
 
-Camera::Camera()
-    : mViewIsUptodate(false), mProjIsUptodate(false)
-{
-    mViewMatrix.setIdentity();
-    
-    mFovY = M_PI/3.;
-    mNearDist = 1.;
-    mFarDist = 50000.;
-    
-    mVpX = 0;
-    mVpY = 0;
+Camera::Camera() : mViewIsUptodate(false), mProjIsUptodate(false) {
+  mViewMatrix.setIdentity();
 
-    setPosition(Vector3f::Constant(100.));
-    setTarget(Vector3f::Zero());
+  mFovY = M_PI / 3.;
+  mNearDist = 1.;
+  mFarDist = 50000.;
+
+  mVpX = 0;
+  mVpY = 0;
+
+  setPosition(Vector3f::Constant(100.));
+  setTarget(Vector3f::Zero());
 }
 
-Camera& Camera::operator=(const Camera& other)
-{
-    mViewIsUptodate = false;
-    mProjIsUptodate = false;
-    
-    mVpX = other.mVpX;
-    mVpY = other.mVpY;
-    mVpWidth = other.mVpWidth;
-    mVpHeight = other.mVpHeight;
+Camera& Camera::operator=(const Camera& other) {
+  mViewIsUptodate = false;
+  mProjIsUptodate = false;
 
-    mTarget = other.mTarget;
-    mFovY = other.mFovY;
-    mNearDist = other.mNearDist;
-    mFarDist = other.mFarDist;
-    
-    mViewMatrix = other.mViewMatrix;
-    mProjectionMatrix = other.mProjectionMatrix;
+  mVpX = other.mVpX;
+  mVpY = other.mVpY;
+  mVpWidth = other.mVpWidth;
+  mVpHeight = other.mVpHeight;
 
-    return *this;
+  mTarget = other.mTarget;
+  mFovY = other.mFovY;
+  mNearDist = other.mNearDist;
+  mFarDist = other.mFarDist;
+
+  mViewMatrix = other.mViewMatrix;
+  mProjectionMatrix = other.mProjectionMatrix;
+
+  return *this;
 }
 
-Camera::Camera(const Camera& other)
-{
-    *this = other;
+Camera::Camera(const Camera& other) { *this = other; }
+
+Camera::~Camera() {}
+
+void Camera::setViewport(uint offsetx, uint offsety, uint width, uint height) {
+  mVpX = offsetx;
+  mVpY = offsety;
+  mVpWidth = width;
+  mVpHeight = height;
+
+  mProjIsUptodate = false;
 }
 
-Camera::~Camera()
-{
+void Camera::setViewport(uint width, uint height) {
+  mVpWidth = width;
+  mVpHeight = height;
+
+  mProjIsUptodate = false;
 }
 
-
-void Camera::setViewport(uint offsetx, uint offsety, uint width, uint height)
-{
-    mVpX = offsetx;
-    mVpY = offsety;
-    mVpWidth = width;
-    mVpHeight = height;
-    
-    mProjIsUptodate = false;
+void Camera::setFovY(float value) {
+  mFovY = value;
+  mProjIsUptodate = false;
 }
 
-void Camera::setViewport(uint width, uint height)
-{
-    mVpWidth = width;
-    mVpHeight = height;
-    
-    mProjIsUptodate = false;
+Vector3f Camera::direction(void) const { return -(orientation() * Vector3f::UnitZ()); }
+Vector3f Camera::up(void) const { return orientation() * Vector3f::UnitY(); }
+Vector3f Camera::right(void) const { return orientation() * Vector3f::UnitX(); }
+
+void Camera::setDirection(const Vector3f& newDirection) {
+  // TODO implement it computing the rotation between newDirection and current dir ?
+  Vector3f up = this->up();
+
+  Matrix3f camAxes;
+
+  camAxes.col(2) = (-newDirection).normalized();
+  camAxes.col(0) = up.cross(camAxes.col(2)).normalized();
+  camAxes.col(1) = camAxes.col(2).cross(camAxes.col(0)).normalized();
+  setOrientation(Quaternionf(camAxes));
+
+  mViewIsUptodate = false;
 }
 
-void Camera::setFovY(float value)
-{
-    mFovY = value;
-    mProjIsUptodate = false;
+void Camera::setTarget(const Vector3f& target) {
+  mTarget = target;
+  if (!mTarget.isApprox(position())) {
+    Vector3f newDirection = mTarget - position();
+    setDirection(newDirection.normalized());
+  }
 }
 
-Vector3f Camera::direction(void) const
-{
-    return - (orientation() * Vector3f::UnitZ());
-}
-Vector3f Camera::up(void) const
-{
-    return orientation() * Vector3f::UnitY();
-}
-Vector3f Camera::right(void) const
-{
-    return orientation() * Vector3f::UnitX();
+void Camera::setPosition(const Vector3f& p) {
+  mFrame.position = p;
+  mViewIsUptodate = false;
 }
 
-void Camera::setDirection(const Vector3f& newDirection)
-{
-    // TODO implement it computing the rotation between newDirection and current dir ?
-    Vector3f up = this->up();
-    
-    Matrix3f camAxes;
-
-    camAxes.col(2) = (-newDirection).normalized();
-    camAxes.col(0) = up.cross( camAxes.col(2) ).normalized();
-    camAxes.col(1) = camAxes.col(2).cross( camAxes.col(0) ).normalized();
-    setOrientation(Quaternionf(camAxes));
-    
-    mViewIsUptodate = false;
+void Camera::setOrientation(const Quaternionf& q) {
+  mFrame.orientation = q;
+  mViewIsUptodate = false;
 }
 
-void Camera::setTarget(const Vector3f& target)
-{
-    mTarget = target;
-    if (!mTarget.isApprox(position()))
-    {
-        Vector3f newDirection = mTarget - position();
-        setDirection(newDirection.normalized());
-    }
-}
-
-void Camera::setPosition(const Vector3f& p)
-{
-    mFrame.position = p;
-    mViewIsUptodate = false;
-}
-
-void Camera::setOrientation(const Quaternionf& q)
-{
-    mFrame.orientation = q;
-    mViewIsUptodate = false;
-}
-
-void Camera::setFrame(const Frame& f)
-{
+void Camera::setFrame(const Frame& f) {
   mFrame = f;
   mViewIsUptodate = false;
 }
 
-void Camera::rotateAroundTarget(const Quaternionf& q)
-{
-    Matrix4f mrot, mt, mtm;
-    
-    // update the transform matrix
-    updateViewMatrix();
-    Vector3f t = mViewMatrix * mTarget;
+void Camera::rotateAroundTarget(const Quaternionf& q) {
+  Matrix4f mrot, mt, mtm;
 
-    mViewMatrix = Translation3f(t)
-                * q
-                * Translation3f(-t)
-                * mViewMatrix;
-    
-    Quaternionf qa(mViewMatrix.linear());
-    qa = qa.conjugate();
-    setOrientation(qa);
-    setPosition(- (qa * mViewMatrix.translation()) );
+  // update the transform matrix
+  updateViewMatrix();
+  Vector3f t = mViewMatrix * mTarget;
 
-    mViewIsUptodate = true;
+  mViewMatrix = Translation3f(t) * q * Translation3f(-t) * mViewMatrix;
+
+  Quaternionf qa(mViewMatrix.linear());
+  qa = qa.conjugate();
+  setOrientation(qa);
+  setPosition(-(qa * mViewMatrix.translation()));
+
+  mViewIsUptodate = true;
 }
 
-void Camera::localRotate(const Quaternionf& q)
-{
-    float dist = (position() - mTarget).norm();
-    setOrientation(orientation() * q);
-    mTarget = position() + dist * direction();
+void Camera::localRotate(const Quaternionf& q) {
+  float dist = (position() - mTarget).norm();
+  setOrientation(orientation() * q);
+  mTarget = position() + dist * direction();
+  mViewIsUptodate = false;
+}
+
+void Camera::zoom(float d) {
+  float dist = (position() - mTarget).norm();
+  if (dist > d) {
+    setPosition(position() + direction() * d);
     mViewIsUptodate = false;
+  }
 }
 
-void Camera::zoom(float d)
-{
-    float dist = (position() - mTarget).norm();
-    if(dist > d)
-    {
-        setPosition(position() + direction() * d);
-        mViewIsUptodate = false;
-    }
-}
-
-void Camera::localTranslate(const Vector3f& t)
-{
+void Camera::localTranslate(const Vector3f& t) {
   Vector3f trans = orientation() * t;
-  setPosition( position() + trans );
-  setTarget( mTarget + trans );
+  setPosition(position() + trans);
+  setTarget(mTarget + trans);
 
   mViewIsUptodate = false;
 }
 
-void Camera::updateViewMatrix(void) const
-{
-    if(!mViewIsUptodate)
-    {
-        Quaternionf q = orientation().conjugate();
-        mViewMatrix.linear() = q.toRotationMatrix();
-        mViewMatrix.translation() = - (mViewMatrix.linear() * position());
+void Camera::updateViewMatrix(void) const {
+  if (!mViewIsUptodate) {
+    Quaternionf q = orientation().conjugate();
+    mViewMatrix.linear() = q.toRotationMatrix();
+    mViewMatrix.translation() = -(mViewMatrix.linear() * position());
 
-        mViewIsUptodate = true;
-    }
+    mViewIsUptodate = true;
+  }
 }
 
-const Affine3f& Camera::viewMatrix(void) const
-{
+const Affine3f& Camera::viewMatrix(void) const {
   updateViewMatrix();
   return mViewMatrix;
 }
 
-void Camera::updateProjectionMatrix(void) const
-{
-  if(!mProjIsUptodate)
-  {
+void Camera::updateProjectionMatrix(void) const {
+  if (!mProjIsUptodate) {
     mProjectionMatrix.setIdentity();
-    float aspect = float(mVpWidth)/float(mVpHeight);
-    float theta = mFovY*0.5;
+    float aspect = float(mVpWidth) / float(mVpHeight);
+    float theta = mFovY * 0.5;
     float range = mFarDist - mNearDist;
-    float invtan = 1./tan(theta);
+    float invtan = 1. / tan(theta);
 
-    mProjectionMatrix(0,0) = invtan / aspect;
-    mProjectionMatrix(1,1) = invtan;
-    mProjectionMatrix(2,2) = -(mNearDist + mFarDist) / range;
-    mProjectionMatrix(3,2) = -1;
-    mProjectionMatrix(2,3) = -2 * mNearDist * mFarDist / range;
-    mProjectionMatrix(3,3) = 0;
-    
+    mProjectionMatrix(0, 0) = invtan / aspect;
+    mProjectionMatrix(1, 1) = invtan;
+    mProjectionMatrix(2, 2) = -(mNearDist + mFarDist) / range;
+    mProjectionMatrix(3, 2) = -1;
+    mProjectionMatrix(2, 3) = -2 * mNearDist * mFarDist / range;
+    mProjectionMatrix(3, 3) = 0;
+
     mProjIsUptodate = true;
   }
 }
 
-const Matrix4f& Camera::projectionMatrix(void) const
-{
+const Matrix4f& Camera::projectionMatrix(void) const {
   updateProjectionMatrix();
   return mProjectionMatrix;
 }
 
-void Camera::activateGL(void)
-{
+void Camera::activateGL(void) {
   glViewport(vpX(), vpY(), vpWidth(), vpHeight());
-  gpu.loadMatrix(projectionMatrix(),GL_PROJECTION);
-  gpu.loadMatrix(viewMatrix().matrix(),GL_MODELVIEW);
+  gpu.loadMatrix(projectionMatrix(), GL_PROJECTION);
+  gpu.loadMatrix(viewMatrix().matrix(), GL_MODELVIEW);
 }
 
-
-Vector3f Camera::unProject(const Vector2f& uv, float depth) const
-{
-    Matrix4f inv = mViewMatrix.inverse().matrix();
-    return unProject(uv, depth, inv);
+Vector3f Camera::unProject(const Vector2f& uv, float depth) const {
+  Matrix4f inv = mViewMatrix.inverse().matrix();
+  return unProject(uv, depth, inv);
 }
 
-Vector3f Camera::unProject(const Vector2f& uv, float depth, const Matrix4f& invModelview) const
-{
-    updateViewMatrix();
-    updateProjectionMatrix();
-    
-    Vector3f a(2.*uv.x()/float(mVpWidth)-1., 2.*uv.y()/float(mVpHeight)-1., 1.);
-    a.x() *= depth/mProjectionMatrix(0,0);
-    a.y() *= depth/mProjectionMatrix(1,1);
-    a.z() = -depth;
-    // FIXME /\/|
-    Vector4f b = invModelview * Vector4f(a.x(), a.y(), a.z(), 1.);
-    return Vector3f(b.x(), b.y(), b.z());
+Vector3f Camera::unProject(const Vector2f& uv, float depth, const Matrix4f& invModelview) const {
+  updateViewMatrix();
+  updateProjectionMatrix();
+
+  Vector3f a(2. * uv.x() / float(mVpWidth) - 1., 2. * uv.y() / float(mVpHeight) - 1., 1.);
+  a.x() *= depth / mProjectionMatrix(0, 0);
+  a.y() *= depth / mProjectionMatrix(1, 1);
+  a.z() = -depth;
+  // FIXME /\/|
+  Vector4f b = invModelview * Vector4f(a.x(), a.y(), a.z(), 1.);
+  return Vector3f(b.x(), b.y(), b.z());
 }
diff --git a/demos/opengl/camera.h b/demos/opengl/camera.h
index 15714d2..676ad23 100644
--- a/demos/opengl/camera.h
+++ b/demos/opengl/camera.h
@@ -14,105 +14,98 @@
 #include <QObject>
 // #include <frame.h>
 
-class Frame
-{
-  public:
-    EIGEN_MAKE_ALIGNED_OPERATOR_NEW
-    
-    inline Frame(const Eigen::Vector3f& pos = Eigen::Vector3f::Zero(),
-                 const Eigen::Quaternionf& o = Eigen::Quaternionf())
-      : orientation(o), position(pos)
-    {}
-    Frame lerp(float alpha, const Frame& other) const
-    {
-      return Frame((1.f-alpha)*position + alpha * other.position,
-                   orientation.slerp(alpha,other.orientation));
-    }
+class Frame {
+ public:
+  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
 
-    Eigen::Quaternionf orientation;
-    Eigen::Vector3f position;
+  inline Frame(const Eigen::Vector3f& pos = Eigen::Vector3f::Zero(), const Eigen::Quaternionf& o = Eigen::Quaternionf())
+      : orientation(o), position(pos) {}
+  Frame lerp(float alpha, const Frame& other) const {
+    return Frame((1.f - alpha) * position + alpha * other.position, orientation.slerp(alpha, other.orientation));
+  }
+
+  Eigen::Quaternionf orientation;
+  Eigen::Vector3f position;
 };
 
-class Camera
-{
-  public:
-    EIGEN_MAKE_ALIGNED_OPERATOR_NEW
+class Camera {
+ public:
+  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
 
-    Camera(void);
-    
-    Camera(const Camera& other);
-    
-    virtual ~Camera();
-    
-    Camera& operator=(const Camera& other);
-    
-    void setViewport(uint offsetx, uint offsety, uint width, uint height);
-    void setViewport(uint width, uint height);
-    
-    inline uint vpX(void) const { return mVpX; }
-    inline uint vpY(void) const { return mVpY; }
-    inline uint vpWidth(void) const { return mVpWidth; }
-    inline uint vpHeight(void) const { return mVpHeight; }
+  Camera(void);
 
-    inline float fovY(void) const { return mFovY; }
-    void setFovY(float value);
-    
-    void setPosition(const Eigen::Vector3f& pos);
-    inline const Eigen::Vector3f& position(void) const { return mFrame.position; }
+  Camera(const Camera& other);
 
-    void setOrientation(const Eigen::Quaternionf& q);
-    inline const Eigen::Quaternionf& orientation(void) const { return mFrame.orientation; }
+  virtual ~Camera();
 
-    void setFrame(const Frame& f);
-    const Frame& frame(void) const { return mFrame; }
-    
-    void setDirection(const Eigen::Vector3f& newDirection);
-    Eigen::Vector3f direction(void) const;
-    void setUp(const Eigen::Vector3f& vectorUp);
-    Eigen::Vector3f up(void) const;
-    Eigen::Vector3f right(void) const;
-    
-    void setTarget(const Eigen::Vector3f& target);
-    inline const Eigen::Vector3f& target(void) { return mTarget; }
-    
-    const Eigen::Affine3f& viewMatrix(void) const;
-    const Eigen::Matrix4f& projectionMatrix(void) const;
-    
-    void rotateAroundTarget(const Eigen::Quaternionf& q);
-    void localRotate(const Eigen::Quaternionf& q);
-    void zoom(float d);
-    
-    void localTranslate(const Eigen::Vector3f& t);
-    
-    /** Setup OpenGL matrices and viewport */
-    void activateGL(void);
-    
-    Eigen::Vector3f unProject(const Eigen::Vector2f& uv, float depth, const Eigen::Matrix4f& invModelview) const;
-    Eigen::Vector3f unProject(const Eigen::Vector2f& uv, float depth) const;
-    
-  protected:
-    void updateViewMatrix(void) const;
-    void updateProjectionMatrix(void) const;
+  Camera& operator=(const Camera& other);
 
-  protected:
+  void setViewport(uint offsetx, uint offsety, uint width, uint height);
+  void setViewport(uint width, uint height);
 
-    uint mVpX, mVpY;
-    uint mVpWidth, mVpHeight;
+  inline uint vpX(void) const { return mVpX; }
+  inline uint vpY(void) const { return mVpY; }
+  inline uint vpWidth(void) const { return mVpWidth; }
+  inline uint vpHeight(void) const { return mVpHeight; }
 
-    Frame mFrame;
-    
-    mutable Eigen::Affine3f mViewMatrix;
-    mutable Eigen::Matrix4f mProjectionMatrix;
+  inline float fovY(void) const { return mFovY; }
+  void setFovY(float value);
 
-    mutable bool mViewIsUptodate;
-    mutable bool mProjIsUptodate;
+  void setPosition(const Eigen::Vector3f& pos);
+  inline const Eigen::Vector3f& position(void) const { return mFrame.position; }
 
-    // used by rotateAroundTarget
-    Eigen::Vector3f mTarget;
-    
-    float mFovY;
-    float mNearDist;
-    float mFarDist;
+  void setOrientation(const Eigen::Quaternionf& q);
+  inline const Eigen::Quaternionf& orientation(void) const { return mFrame.orientation; }
+
+  void setFrame(const Frame& f);
+  const Frame& frame(void) const { return mFrame; }
+
+  void setDirection(const Eigen::Vector3f& newDirection);
+  Eigen::Vector3f direction(void) const;
+  void setUp(const Eigen::Vector3f& vectorUp);
+  Eigen::Vector3f up(void) const;
+  Eigen::Vector3f right(void) const;
+
+  void setTarget(const Eigen::Vector3f& target);
+  inline const Eigen::Vector3f& target(void) { return mTarget; }
+
+  const Eigen::Affine3f& viewMatrix(void) const;
+  const Eigen::Matrix4f& projectionMatrix(void) const;
+
+  void rotateAroundTarget(const Eigen::Quaternionf& q);
+  void localRotate(const Eigen::Quaternionf& q);
+  void zoom(float d);
+
+  void localTranslate(const Eigen::Vector3f& t);
+
+  /** Setup OpenGL matrices and viewport */
+  void activateGL(void);
+
+  Eigen::Vector3f unProject(const Eigen::Vector2f& uv, float depth, const Eigen::Matrix4f& invModelview) const;
+  Eigen::Vector3f unProject(const Eigen::Vector2f& uv, float depth) const;
+
+ protected:
+  void updateViewMatrix(void) const;
+  void updateProjectionMatrix(void) const;
+
+ protected:
+  uint mVpX, mVpY;
+  uint mVpWidth, mVpHeight;
+
+  Frame mFrame;
+
+  mutable Eigen::Affine3f mViewMatrix;
+  mutable Eigen::Matrix4f mProjectionMatrix;
+
+  mutable bool mViewIsUptodate;
+  mutable bool mProjIsUptodate;
+
+  // used by rotateAroundTarget
+  Eigen::Vector3f mTarget;
+
+  float mFovY;
+  float mNearDist;
+  float mFarDist;
 };
 
-#endif // EIGEN_CAMERA_H
+#endif  // EIGEN_CAMERA_H
diff --git a/demos/opengl/gpuhelper.cpp b/demos/opengl/gpuhelper.cpp
index fd236b1..9e3ecbe 100644
--- a/demos/opengl/gpuhelper.cpp
+++ b/demos/opengl/gpuhelper.cpp
@@ -17,110 +17,111 @@
 
 GpuHelper gpu;
 
-GpuHelper::GpuHelper()
-{
-    mVpWidth = mVpHeight = 0;
-    mCurrentMatrixTarget = 0;
-    mInitialized = false;
+GpuHelper::GpuHelper() {
+  mVpWidth = mVpHeight = 0;
+  mCurrentMatrixTarget = 0;
+  mInitialized = false;
 }
 
-GpuHelper::~GpuHelper()
-{
+GpuHelper::~GpuHelper() {}
+
+void GpuHelper::pushProjectionMode2D(ProjectionMode2D pm) {
+  // switch to 2D projection
+  pushMatrix(Matrix4f::Identity(), GL_PROJECTION);
+
+  if (pm == PM_Normalized) {
+    // glOrtho(-1., 1., -1., 1., 0., 1.);
+  } else if (pm == PM_Viewport) {
+    GLint vp[4];
+    glGetIntegerv(GL_VIEWPORT, vp);
+    glOrtho(0., vp[2], 0., vp[3], -1., 1.);
+  }
+
+  pushMatrix(Matrix4f::Identity(), GL_MODELVIEW);
 }
 
-void GpuHelper::pushProjectionMode2D(ProjectionMode2D pm)
-{
-    // switch to 2D projection
-    pushMatrix(Matrix4f::Identity(),GL_PROJECTION);
-
-    if(pm==PM_Normalized)
-    {
-        //glOrtho(-1., 1., -1., 1., 0., 1.);
-    }
-    else if(pm==PM_Viewport)
-    {
-        GLint vp[4];
-        glGetIntegerv(GL_VIEWPORT, vp);
-        glOrtho(0., vp[2], 0., vp[3], -1., 1.);
-    }
-
-    pushMatrix(Matrix4f::Identity(),GL_MODELVIEW);
+void GpuHelper::popProjectionMode2D(void) {
+  popMatrix(GL_PROJECTION);
+  popMatrix(GL_MODELVIEW);
 }
 
-void GpuHelper::popProjectionMode2D(void)
-{
-    popMatrix(GL_PROJECTION);
-    popMatrix(GL_MODELVIEW);
+void GpuHelper::drawVector(const Vector3f& position, const Vector3f& vec, const Color& color, float aspect /* = 50.*/) {
+  static GLUquadricObj* cylindre = gluNewQuadric();
+  glColor4fv(color.data());
+  float length = vec.norm();
+  pushMatrix(GL_MODELVIEW);
+  glTranslatef(position.x(), position.y(), position.z());
+  Vector3f ax = Matrix3f::Identity().col(2).cross(vec);
+  ax.normalize();
+  Vector3f tmp = vec;
+  tmp.normalize();
+  float angle = 180.f / M_PI * acos(tmp.z());
+  if (angle > 1e-3) glRotatef(angle, ax.x(), ax.y(), ax.z());
+  gluCylinder(cylindre, length / aspect, length / aspect, 0.8 * length, 10, 10);
+  glTranslatef(0.0, 0.0, 0.8 * length);
+  gluCylinder(cylindre, 2.0 * length / aspect, 0.0, 0.2 * length, 10, 10);
+
+  popMatrix(GL_MODELVIEW);
 }
 
-void GpuHelper::drawVector(const Vector3f& position, const Vector3f& vec, const Color& color, float aspect /* = 50.*/)
-{
-    static GLUquadricObj *cylindre = gluNewQuadric();
-    glColor4fv(color.data());
-    float length = vec.norm();
-    pushMatrix(GL_MODELVIEW);
-    glTranslatef(position.x(), position.y(), position.z());
-    Vector3f ax = Matrix3f::Identity().col(2).cross(vec);
-    ax.normalize();
-    Vector3f tmp = vec;
-    tmp.normalize();
-    float angle = 180.f/M_PI * acos(tmp.z());
-    if (angle>1e-3)
-        glRotatef(angle, ax.x(), ax.y(), ax.z());
-    gluCylinder(cylindre, length/aspect, length/aspect, 0.8*length, 10, 10);
-    glTranslatef(0.0,0.0,0.8*length);
-    gluCylinder(cylindre, 2.0*length/aspect, 0.0, 0.2*length, 10, 10);
-
-    popMatrix(GL_MODELVIEW);
+void GpuHelper::drawVectorBox(const Vector3f& position, const Vector3f& vec, const Color& color, float aspect) {
+  static GLUquadricObj* cylindre = gluNewQuadric();
+  glColor4fv(color.data());
+  float length = vec.norm();
+  pushMatrix(GL_MODELVIEW);
+  glTranslatef(position.x(), position.y(), position.z());
+  Vector3f ax = Matrix3f::Identity().col(2).cross(vec);
+  ax.normalize();
+  Vector3f tmp = vec;
+  tmp.normalize();
+  float angle = 180.f / M_PI * acos(tmp.z());
+  if (angle > 1e-3) glRotatef(angle, ax.x(), ax.y(), ax.z());
+  gluCylinder(cylindre, length / aspect, length / aspect, 0.8 * length, 10, 10);
+  glTranslatef(0.0, 0.0, 0.8 * length);
+  glScalef(4.0 * length / aspect, 4.0 * length / aspect, 4.0 * length / aspect);
+  drawUnitCube();
+  popMatrix(GL_MODELVIEW);
 }
 
-void GpuHelper::drawVectorBox(const Vector3f& position, const Vector3f& vec, const Color& color, float aspect)
-{
-    static GLUquadricObj *cylindre = gluNewQuadric();
-    glColor4fv(color.data());
-    float length = vec.norm();
-    pushMatrix(GL_MODELVIEW);
-    glTranslatef(position.x(), position.y(), position.z());
-    Vector3f ax = Matrix3f::Identity().col(2).cross(vec);
-    ax.normalize();
-    Vector3f tmp = vec;
-    tmp.normalize();
-    float angle = 180.f/M_PI * acos(tmp.z());
-    if (angle>1e-3)
-        glRotatef(angle, ax.x(), ax.y(), ax.z());
-    gluCylinder(cylindre, length/aspect, length/aspect, 0.8*length, 10, 10);
-    glTranslatef(0.0,0.0,0.8*length);
-    glScalef(4.0*length/aspect,4.0*length/aspect,4.0*length/aspect);
-    drawUnitCube();
-    popMatrix(GL_MODELVIEW);
+void GpuHelper::drawUnitCube(void) {
+  static float vertices[][3] = {{-0.5, -0.5, -0.5}, {0.5, -0.5, -0.5}, {-0.5, 0.5, -0.5}, {0.5, 0.5, -0.5},
+                                {-0.5, -0.5, 0.5},  {0.5, -0.5, 0.5},  {-0.5, 0.5, 0.5},  {0.5, 0.5, 0.5}};
+
+  glBegin(GL_QUADS);
+  glNormal3f(0, 0, -1);
+  glVertex3fv(vertices[0]);
+  glVertex3fv(vertices[2]);
+  glVertex3fv(vertices[3]);
+  glVertex3fv(vertices[1]);
+  glNormal3f(0, 0, 1);
+  glVertex3fv(vertices[4]);
+  glVertex3fv(vertices[5]);
+  glVertex3fv(vertices[7]);
+  glVertex3fv(vertices[6]);
+  glNormal3f(0, -1, 0);
+  glVertex3fv(vertices[0]);
+  glVertex3fv(vertices[1]);
+  glVertex3fv(vertices[5]);
+  glVertex3fv(vertices[4]);
+  glNormal3f(0, 1, 0);
+  glVertex3fv(vertices[2]);
+  glVertex3fv(vertices[6]);
+  glVertex3fv(vertices[7]);
+  glVertex3fv(vertices[3]);
+  glNormal3f(-1, 0, 0);
+  glVertex3fv(vertices[0]);
+  glVertex3fv(vertices[4]);
+  glVertex3fv(vertices[6]);
+  glVertex3fv(vertices[2]);
+  glNormal3f(1, 0, 0);
+  glVertex3fv(vertices[1]);
+  glVertex3fv(vertices[3]);
+  glVertex3fv(vertices[7]);
+  glVertex3fv(vertices[5]);
+  glEnd();
 }
 
-void GpuHelper::drawUnitCube(void)
-{
-    static float vertices[][3] = {
-        {-0.5,-0.5,-0.5},
-        { 0.5,-0.5,-0.5},
-        {-0.5, 0.5,-0.5},
-        { 0.5, 0.5,-0.5},
-        {-0.5,-0.5, 0.5},
-        { 0.5,-0.5, 0.5},
-        {-0.5, 0.5, 0.5},
-        { 0.5, 0.5, 0.5}};
-
-    glBegin(GL_QUADS);
-    glNormal3f(0,0,-1); glVertex3fv(vertices[0]); glVertex3fv(vertices[2]); glVertex3fv(vertices[3]); glVertex3fv(vertices[1]);
-    glNormal3f(0,0, 1); glVertex3fv(vertices[4]); glVertex3fv(vertices[5]); glVertex3fv(vertices[7]); glVertex3fv(vertices[6]);
-    glNormal3f(0,-1,0); glVertex3fv(vertices[0]); glVertex3fv(vertices[1]); glVertex3fv(vertices[5]); glVertex3fv(vertices[4]);
-    glNormal3f(0, 1,0); glVertex3fv(vertices[2]); glVertex3fv(vertices[6]); glVertex3fv(vertices[7]); glVertex3fv(vertices[3]);
-    glNormal3f(-1,0,0); glVertex3fv(vertices[0]); glVertex3fv(vertices[4]); glVertex3fv(vertices[6]); glVertex3fv(vertices[2]);
-    glNormal3f( 1,0,0); glVertex3fv(vertices[1]); glVertex3fv(vertices[3]); glVertex3fv(vertices[7]); glVertex3fv(vertices[5]);
-    glEnd();
-}
-
-void GpuHelper::drawUnitSphere(int level)
-{
+void GpuHelper::drawUnitSphere(int level) {
   static IcoSphere sphere;
   sphere.draw(level);
 }
-
-
diff --git a/demos/opengl/gpuhelper.h b/demos/opengl/gpuhelper.h
index 880e9a5..b28c625 100644
--- a/demos/opengl/gpuhelper.h
+++ b/demos/opengl/gpuhelper.h
@@ -18,190 +18,170 @@
 
 typedef Vector4f Color;
 
-class GpuHelper
-{
-  public:
+class GpuHelper {
+ public:
+  GpuHelper();
 
-    GpuHelper();
+  ~GpuHelper();
 
-    ~GpuHelper();
+  enum ProjectionMode2D { PM_Normalized = 1, PM_Viewport = 2 };
+  void pushProjectionMode2D(ProjectionMode2D pm);
+  void popProjectionMode2D();
 
-    enum ProjectionMode2D { PM_Normalized = 1, PM_Viewport = 2 };
-    void pushProjectionMode2D(ProjectionMode2D pm);
-    void popProjectionMode2D();
+  /** Multiply the OpenGL matrix \a matrixTarget by the matrix \a mat.
+      Essentially, this helper function automatically calls glMatrixMode(matrixTarget) if required
+      and does a proper call to the right glMultMatrix*() function according to the scalar type
+      and storage order.
+      \warning glMatrixMode() must never be called directly. If you are unsure, use forceMatrixMode().
+      \sa Matrix, loadMatrix(), forceMatrixMode()
+  */
+  template <typename Scalar, int Flags_>
+  void multMatrix(const Matrix<Scalar, 4, 4, Flags_, 4, 4>& mat, GLenum matrixTarget);
 
-    /** Multiply the OpenGL matrix \a matrixTarget by the matrix \a mat.
-        Essentially, this helper function automatically calls glMatrixMode(matrixTarget) if required
-        and does a proper call to the right glMultMatrix*() function according to the scalar type
-        and storage order.
-        \warning glMatrixMode() must never be called directly. If you are unsure, use forceMatrixMode().
-        \sa Matrix, loadMatrix(), forceMatrixMode()
-    */
-    template<typename Scalar, int Flags_>
-    void multMatrix(const Matrix<Scalar,4,4, Flags_, 4,4>& mat, GLenum matrixTarget);
+  /** Load the matrix \a mat to the OpenGL matrix \a matrixTarget.
+      Essentially, this helper function automatically calls glMatrixMode(matrixTarget) if required
+      and does a proper call to the right glLoadMatrix*() or glLoadIdentity() function according to the scalar type
+      and storage order.
+      \warning glMatrixMode() must never be called directly. If you are unsure, use forceMatrixMode().
+      \sa Matrix, multMatrix(), forceMatrixMode()
+  */
+  template <typename Scalar, int Flags_>
+  void loadMatrix(const Eigen::Matrix<Scalar, 4, 4, Flags_, 4, 4>& mat, GLenum matrixTarget);
 
-    /** Load the matrix \a mat to the OpenGL matrix \a matrixTarget.
-        Essentially, this helper function automatically calls glMatrixMode(matrixTarget) if required
-        and does a proper call to the right glLoadMatrix*() or glLoadIdentity() function according to the scalar type
-        and storage order.
-        \warning glMatrixMode() must never be called directly. If you are unsure, use forceMatrixMode().
-        \sa Matrix, multMatrix(), forceMatrixMode()
-    */
-    template<typename Scalar, int Flags_>
-    void loadMatrix(const Eigen::Matrix<Scalar,4,4, Flags_, 4,4>& mat, GLenum matrixTarget);
+  template <typename Scalar, typename Derived>
+  void loadMatrix(const Eigen::CwiseNullaryOp<Eigen::internal::scalar_identity_op<Scalar>, Derived>&,
+                  GLenum matrixTarget);
 
-    template<typename Scalar, typename Derived>
-    void loadMatrix(
-        const Eigen::CwiseNullaryOp<Eigen::internal::scalar_identity_op<Scalar>,Derived>&,
-        GLenum matrixTarget);
+  /** Make the matrix \a matrixTarget the current OpenGL matrix target.
+      Call this function before loadMatrix() or multMatrix() if you cannot guarantee that glMatrixMode()
+      has never been called after the last loadMatrix() or multMatrix() calls.
+      \todo provides a debug mode checking the sanity of the cached matrix mode.
+  */
+  inline void forceMatrixTarget(GLenum matrixTarget) { glMatrixMode(mCurrentMatrixTarget = matrixTarget); }
 
-    /** Make the matrix \a matrixTarget the current OpenGL matrix target.
-        Call this function before loadMatrix() or multMatrix() if you cannot guarantee that glMatrixMode()
-        has never been called after the last loadMatrix() or multMatrix() calls.
-        \todo provides a debug mode checking the sanity of the cached matrix mode.
-    */
-    inline void forceMatrixTarget(GLenum matrixTarget) {glMatrixMode(mCurrentMatrixTarget=matrixTarget);}
+  inline void setMatrixTarget(GLenum matrixTarget);
 
-    inline void setMatrixTarget(GLenum matrixTarget);
+  /** Push the OpenGL matrix \a matrixTarget and load \a mat.
+   */
+  template <typename Scalar, int Flags_>
+  inline void pushMatrix(const Matrix<Scalar, 4, 4, Flags_, 4, 4>& mat, GLenum matrixTarget);
 
-    /** Push the OpenGL matrix \a matrixTarget and load \a mat.
-    */
-    template<typename Scalar, int Flags_>
-    inline void pushMatrix(const Matrix<Scalar,4,4, Flags_, 4,4>& mat, GLenum matrixTarget);
+  template <typename Scalar, typename Derived>
+  void pushMatrix(const Eigen::CwiseNullaryOp<Eigen::internal::scalar_identity_op<Scalar>, Derived>&,
+                  GLenum matrixTarget);
 
-    template<typename Scalar, typename Derived>
-    void pushMatrix(
-        const Eigen::CwiseNullaryOp<Eigen::internal::scalar_identity_op<Scalar>,Derived>&,
-        GLenum matrixTarget);
+  /** Push and clone the OpenGL matrix \a matrixTarget
+   */
+  inline void pushMatrix(GLenum matrixTarget);
 
-    /** Push and clone the OpenGL matrix \a matrixTarget
-    */
-    inline void pushMatrix(GLenum matrixTarget);
+  /** Pop the OpenGL matrix \a matrixTarget
+   */
+  inline void popMatrix(GLenum matrixTarget);
 
-    /** Pop the OpenGL matrix \a matrixTarget
-    */
-    inline void popMatrix(GLenum matrixTarget);
+  void drawVector(const Vector3f& position, const Vector3f& vec, const Color& color, float aspect = 50.);
+  void drawVectorBox(const Vector3f& position, const Vector3f& vec, const Color& color, float aspect = 50.);
+  void drawUnitCube(void);
+  void drawUnitSphere(int level = 0);
 
-    void drawVector(const Vector3f& position, const Vector3f& vec, const Color& color, float aspect = 50.);
-    void drawVectorBox(const Vector3f& position, const Vector3f& vec, const Color& color, float aspect = 50.);
-    void drawUnitCube(void);
-    void drawUnitSphere(int level=0);
+  /// draw the \a nofElement first elements
+  inline void draw(GLenum mode, uint nofElement);
 
-    /// draw the \a nofElement first elements
-    inline void draw(GLenum mode, uint nofElement);
+  /// draw a range of elements
+  inline void draw(GLenum mode, uint start, uint end);
 
-    /// draw a range of elements
-    inline void draw(GLenum mode, uint start, uint end);
+  /// draw an indexed subset
+  inline void draw(GLenum mode, const std::vector<uint>* pIndexes);
 
-    /// draw an indexed subset
-    inline void draw(GLenum mode, const std::vector<uint>* pIndexes);
+ protected:
+  void update(void);
 
-protected:
-
-    void update(void);
-
-    GLuint mColorBufferId;
-    int mVpWidth, mVpHeight;
-    GLenum mCurrentMatrixTarget;
-    bool mInitialized;
+  GLuint mColorBufferId;
+  int mVpWidth, mVpHeight;
+  GLenum mCurrentMatrixTarget;
+  bool mInitialized;
 };
 
 /** Singleton shortcut
-*/
+ */
 extern GpuHelper gpu;
 
-
 /** \internal
-*/
-template<bool RowMajor, int Flags_> struct GlMatrixHelper;
+ */
+template <bool RowMajor, int Flags_>
+struct GlMatrixHelper;
 
-template<int Flags_> struct GlMatrixHelper<false,Flags_>
-{
-    static void loadMatrix(const Matrix<float, 4,4, Flags_, 4,4>&  mat) { glLoadMatrixf(mat.data()); }
-    static void loadMatrix(const Matrix<double,4,4, Flags_, 4,4>& mat) { glLoadMatrixd(mat.data()); }
-    static void multMatrix(const Matrix<float, 4,4, Flags_, 4,4>&  mat) { glMultMatrixf(mat.data()); }
-    static void multMatrix(const Matrix<double,4,4, Flags_, 4,4>& mat) { glMultMatrixd(mat.data()); }
+template <int Flags_>
+struct GlMatrixHelper<false, Flags_> {
+  static void loadMatrix(const Matrix<float, 4, 4, Flags_, 4, 4>& mat) { glLoadMatrixf(mat.data()); }
+  static void loadMatrix(const Matrix<double, 4, 4, Flags_, 4, 4>& mat) { glLoadMatrixd(mat.data()); }
+  static void multMatrix(const Matrix<float, 4, 4, Flags_, 4, 4>& mat) { glMultMatrixf(mat.data()); }
+  static void multMatrix(const Matrix<double, 4, 4, Flags_, 4, 4>& mat) { glMultMatrixd(mat.data()); }
 };
 
-template<int Flags_> struct GlMatrixHelper<true,Flags_>
-{
-    static void loadMatrix(const Matrix<float, 4,4, Flags_, 4,4>&  mat) { glLoadMatrixf(mat.transpose().eval().data()); }
-    static void loadMatrix(const Matrix<double,4,4, Flags_, 4,4>& mat) { glLoadMatrixd(mat.transpose().eval().data()); }
-    static void multMatrix(const Matrix<float, 4,4, Flags_, 4,4>&  mat) { glMultMatrixf(mat.transpose().eval().data()); }
-    static void multMatrix(const Matrix<double,4,4, Flags_, 4,4>& mat) { glMultMatrixd(mat.transpose().eval().data()); }
+template <int Flags_>
+struct GlMatrixHelper<true, Flags_> {
+  static void loadMatrix(const Matrix<float, 4, 4, Flags_, 4, 4>& mat) { glLoadMatrixf(mat.transpose().eval().data()); }
+  static void loadMatrix(const Matrix<double, 4, 4, Flags_, 4, 4>& mat) {
+    glLoadMatrixd(mat.transpose().eval().data());
+  }
+  static void multMatrix(const Matrix<float, 4, 4, Flags_, 4, 4>& mat) { glMultMatrixf(mat.transpose().eval().data()); }
+  static void multMatrix(const Matrix<double, 4, 4, Flags_, 4, 4>& mat) {
+    glMultMatrixd(mat.transpose().eval().data());
+  }
 };
 
-inline void GpuHelper::setMatrixTarget(GLenum matrixTarget)
-{
-    if (matrixTarget != mCurrentMatrixTarget)
-        glMatrixMode(mCurrentMatrixTarget=matrixTarget);
+inline void GpuHelper::setMatrixTarget(GLenum matrixTarget) {
+  if (matrixTarget != mCurrentMatrixTarget) glMatrixMode(mCurrentMatrixTarget = matrixTarget);
 }
 
-template<typename Scalar, int Flags_>
-void GpuHelper::multMatrix(const Matrix<Scalar,4,4, Flags_, 4,4>& mat, GLenum matrixTarget)
-{
-    setMatrixTarget(matrixTarget);
-    GlMatrixHelper<Flags_&Eigen::RowMajorBit, Flags_>::multMatrix(mat);
+template <typename Scalar, int Flags_>
+void GpuHelper::multMatrix(const Matrix<Scalar, 4, 4, Flags_, 4, 4>& mat, GLenum matrixTarget) {
+  setMatrixTarget(matrixTarget);
+  GlMatrixHelper<Flags_ & Eigen::RowMajorBit, Flags_>::multMatrix(mat);
 }
 
-template<typename Scalar, typename Derived>
-void GpuHelper::loadMatrix(
-    const Eigen::CwiseNullaryOp<Eigen::internal::scalar_identity_op<Scalar>,Derived>&,
-    GLenum matrixTarget)
-{
-    setMatrixTarget(matrixTarget);
-    glLoadIdentity();
+template <typename Scalar, typename Derived>
+void GpuHelper::loadMatrix(const Eigen::CwiseNullaryOp<Eigen::internal::scalar_identity_op<Scalar>, Derived>&,
+                           GLenum matrixTarget) {
+  setMatrixTarget(matrixTarget);
+  glLoadIdentity();
 }
 
-template<typename Scalar, int Flags_>
-void GpuHelper::loadMatrix(const Eigen::Matrix<Scalar,4,4, Flags_, 4,4>& mat, GLenum matrixTarget)
-{
-    setMatrixTarget(matrixTarget);
-    GlMatrixHelper<(Flags_&Eigen::RowMajorBit)!=0, Flags_>::loadMatrix(mat);
+template <typename Scalar, int Flags_>
+void GpuHelper::loadMatrix(const Eigen::Matrix<Scalar, 4, 4, Flags_, 4, 4>& mat, GLenum matrixTarget) {
+  setMatrixTarget(matrixTarget);
+  GlMatrixHelper<(Flags_ & Eigen::RowMajorBit) != 0, Flags_>::loadMatrix(mat);
 }
 
-inline void GpuHelper::pushMatrix(GLenum matrixTarget)
-{
-    setMatrixTarget(matrixTarget);
-    glPushMatrix();
+inline void GpuHelper::pushMatrix(GLenum matrixTarget) {
+  setMatrixTarget(matrixTarget);
+  glPushMatrix();
 }
 
-template<typename Scalar, int Flags_>
-inline void GpuHelper::pushMatrix(const Matrix<Scalar,4,4, Flags_, 4,4>& mat, GLenum matrixTarget)
-{
-    pushMatrix(matrixTarget);
-    GlMatrixHelper<Flags_&Eigen::RowMajorBit,Flags_>::loadMatrix(mat);
+template <typename Scalar, int Flags_>
+inline void GpuHelper::pushMatrix(const Matrix<Scalar, 4, 4, Flags_, 4, 4>& mat, GLenum matrixTarget) {
+  pushMatrix(matrixTarget);
+  GlMatrixHelper<Flags_ & Eigen::RowMajorBit, Flags_>::loadMatrix(mat);
 }
 
-template<typename Scalar, typename Derived>
-void GpuHelper::pushMatrix(
-    const Eigen::CwiseNullaryOp<Eigen::internal::scalar_identity_op<Scalar>,Derived>&,
-    GLenum matrixTarget)
-{
-    pushMatrix(matrixTarget);
-    glLoadIdentity();
+template <typename Scalar, typename Derived>
+void GpuHelper::pushMatrix(const Eigen::CwiseNullaryOp<Eigen::internal::scalar_identity_op<Scalar>, Derived>&,
+                           GLenum matrixTarget) {
+  pushMatrix(matrixTarget);
+  glLoadIdentity();
 }
 
-inline void GpuHelper::popMatrix(GLenum matrixTarget)
-{
-    setMatrixTarget(matrixTarget);
-    glPopMatrix();
+inline void GpuHelper::popMatrix(GLenum matrixTarget) {
+  setMatrixTarget(matrixTarget);
+  glPopMatrix();
 }
 
-inline void GpuHelper::draw(GLenum mode, uint nofElement)
-{
-    glDrawArrays(mode, 0, nofElement);
+inline void GpuHelper::draw(GLenum mode, uint nofElement) { glDrawArrays(mode, 0, nofElement); }
+
+inline void GpuHelper::draw(GLenum mode, const std::vector<uint>* pIndexes) {
+  glDrawElements(mode, pIndexes->size(), GL_UNSIGNED_INT, &(pIndexes->front()));
 }
 
+inline void GpuHelper::draw(GLenum mode, uint start, uint end) { glDrawArrays(mode, start, end - start); }
 
-inline void GpuHelper::draw(GLenum mode, const std::vector<uint>* pIndexes)
-{
-    glDrawElements(mode, pIndexes->size(), GL_UNSIGNED_INT, &(pIndexes->front()));
-}
-
-inline void GpuHelper::draw(GLenum mode, uint start, uint end)
-{
-    glDrawArrays(mode, start, end-start);
-}
-
-#endif // EIGEN_GPUHELPER_H
+#endif  // EIGEN_GPUHELPER_H
diff --git a/demos/opengl/icosphere.cpp b/demos/opengl/icosphere.cpp
index 39444cb..db28c47 100644
--- a/demos/opengl/icosphere.cpp
+++ b/demos/opengl/icosphere.cpp
@@ -20,101 +20,86 @@
 #define X .525731112119133606
 #define Z .850650808352039932
 
-static GLfloat vdata[12][3] = {
-   {-X, 0.0, Z}, {X, 0.0, Z}, {-X, 0.0, -Z}, {X, 0.0, -Z},
-   {0.0, Z, X}, {0.0, Z, -X}, {0.0, -Z, X}, {0.0, -Z, -X},
-   {Z, X, 0.0}, {-Z, X, 0.0}, {Z, -X, 0.0}, {-Z, -X, 0.0}
-};
+static GLfloat vdata[12][3] = {{-X, 0.0, Z}, {X, 0.0, Z},   {-X, 0.0, -Z}, {X, 0.0, -Z}, {0.0, Z, X},  {0.0, Z, -X},
+                               {0.0, -Z, X}, {0.0, -Z, -X}, {Z, X, 0.0},   {-Z, X, 0.0}, {Z, -X, 0.0}, {-Z, -X, 0.0}};
 
-static GLint tindices[20][3] = {
-   {0,4,1}, {0,9,4}, {9,5,4}, {4,5,8}, {4,8,1},
-   {8,10,1}, {8,3,10}, {5,3,8}, {5,2,3}, {2,7,3},
-   {7,10,3}, {7,6,10}, {7,11,6}, {11,0,6}, {0,1,6},
-   {6,1,10}, {9,0,11}, {9,11,2}, {9,2,5}, {7,2,11} };
+static GLint tindices[20][3] = {{0, 4, 1}, {0, 9, 4},  {9, 5, 4},  {4, 5, 8},  {4, 8, 1},  {8, 10, 1}, {8, 3, 10},
+                                {5, 3, 8}, {5, 2, 3},  {2, 7, 3},  {7, 10, 3}, {7, 6, 10}, {7, 11, 6}, {11, 0, 6},
+                                {0, 1, 6}, {6, 1, 10}, {9, 0, 11}, {9, 11, 2}, {9, 2, 5},  {7, 2, 11}};
 //--------------------------------------------------------------------------------
 
-IcoSphere::IcoSphere(unsigned int levels)
-{
+IcoSphere::IcoSphere(unsigned int levels) {
   // init with an icosahedron
-  for (int i = 0; i < 12; i++)
-    mVertices.push_back(Map<Vector3f>(vdata[i]));
+  for (int i = 0; i < 12; i++) mVertices.push_back(Map<Vector3f>(vdata[i]));
   mIndices.push_back(new std::vector<int>);
   std::vector<int>& indices = *mIndices.back();
-  for (int i = 0; i < 20; i++)
-  {
-    for (int k = 0; k < 3; k++)
-      indices.push_back(tindices[i][k]);
+  for (int i = 0; i < 20; i++) {
+    for (int k = 0; k < 3; k++) indices.push_back(tindices[i][k]);
   }
   mListIds.push_back(0);
 
-  while(mIndices.size()<levels)
-    _subdivide();
+  while (mIndices.size() < levels) _subdivide();
 }
 
-const std::vector<int>& IcoSphere::indices(int level) const
-{
-  while (level>=int(mIndices.size()))
-    const_cast<IcoSphere*>(this)->_subdivide();
+const std::vector<int>& IcoSphere::indices(int level) const {
+  while (level >= int(mIndices.size())) const_cast<IcoSphere*>(this)->_subdivide();
   return *mIndices[level];
 }
 
-void IcoSphere::_subdivide(void)
-{
+void IcoSphere::_subdivide(void) {
   typedef unsigned long long Key;
-  std::map<Key,int> edgeMap;
+  std::map<Key, int> edgeMap;
   const std::vector<int>& indices = *mIndices.back();
   mIndices.push_back(new std::vector<int>);
   std::vector<int>& refinedIndices = *mIndices.back();
   int end = indices.size();
-  for (int i=0; i<end; i+=3)
-  {
+  for (int i = 0; i < end; i += 3) {
     int ids0[3],  // indices of outer vertices
         ids1[3];  // indices of edge vertices
-    for (int k=0; k<3; ++k)
-    {
-      int k1 = (k+1)%3;
-      int e0 = indices[i+k];
-      int e1 = indices[i+k1];
+    for (int k = 0; k < 3; ++k) {
+      int k1 = (k + 1) % 3;
+      int e0 = indices[i + k];
+      int e1 = indices[i + k1];
       ids0[k] = e0;
-      if (e1>e0)
-        std::swap(e0,e1);
-      Key edgeKey = Key(e0) | (Key(e1)<<32);
-      std::map<Key,int>::iterator it = edgeMap.find(edgeKey);
-      if (it==edgeMap.end())
-      {
+      if (e1 > e0) std::swap(e0, e1);
+      Key edgeKey = Key(e0) | (Key(e1) << 32);
+      std::map<Key, int>::iterator it = edgeMap.find(edgeKey);
+      if (it == edgeMap.end()) {
         ids1[k] = mVertices.size();
         edgeMap[edgeKey] = ids1[k];
-        mVertices.push_back( (mVertices[e0]+mVertices[e1]).normalized() );
-      }
-      else
+        mVertices.push_back((mVertices[e0] + mVertices[e1]).normalized());
+      } else
         ids1[k] = it->second;
     }
-    refinedIndices.push_back(ids0[0]); refinedIndices.push_back(ids1[0]); refinedIndices.push_back(ids1[2]);
-    refinedIndices.push_back(ids0[1]); refinedIndices.push_back(ids1[1]); refinedIndices.push_back(ids1[0]);
-    refinedIndices.push_back(ids0[2]); refinedIndices.push_back(ids1[2]); refinedIndices.push_back(ids1[1]);
-    refinedIndices.push_back(ids1[0]); refinedIndices.push_back(ids1[1]); refinedIndices.push_back(ids1[2]);
+    refinedIndices.push_back(ids0[0]);
+    refinedIndices.push_back(ids1[0]);
+    refinedIndices.push_back(ids1[2]);
+    refinedIndices.push_back(ids0[1]);
+    refinedIndices.push_back(ids1[1]);
+    refinedIndices.push_back(ids1[0]);
+    refinedIndices.push_back(ids0[2]);
+    refinedIndices.push_back(ids1[2]);
+    refinedIndices.push_back(ids1[1]);
+    refinedIndices.push_back(ids1[0]);
+    refinedIndices.push_back(ids1[1]);
+    refinedIndices.push_back(ids1[2]);
   }
   mListIds.push_back(0);
 }
 
-void IcoSphere::draw(int level)
-{
-  while (level>=int(mIndices.size()))
-    const_cast<IcoSphere*>(this)->_subdivide();
-  if (mListIds[level]==0)
-  {
+void IcoSphere::draw(int level) {
+  while (level >= int(mIndices.size())) const_cast<IcoSphere*>(this)->_subdivide();
+  if (mListIds[level] == 0) {
     mListIds[level] = glGenLists(1);
     glNewList(mListIds[level], GL_COMPILE);
-      glVertexPointer(3, GL_FLOAT, 0, mVertices[0].data());
-      glNormalPointer(GL_FLOAT, 0, mVertices[0].data());
-      glEnableClientState(GL_VERTEX_ARRAY);
-      glEnableClientState(GL_NORMAL_ARRAY);
-      glDrawElements(GL_TRIANGLES, mIndices[level]->size(), GL_UNSIGNED_INT, &(mIndices[level]->at(0)));
-      glDisableClientState(GL_VERTEX_ARRAY);
-      glDisableClientState(GL_NORMAL_ARRAY);
+    glVertexPointer(3, GL_FLOAT, 0, mVertices[0].data());
+    glNormalPointer(GL_FLOAT, 0, mVertices[0].data());
+    glEnableClientState(GL_VERTEX_ARRAY);
+    glEnableClientState(GL_NORMAL_ARRAY);
+    glDrawElements(GL_TRIANGLES, mIndices[level]->size(), GL_UNSIGNED_INT, &(mIndices[level]->at(0)));
+    glDisableClientState(GL_VERTEX_ARRAY);
+    glDisableClientState(GL_NORMAL_ARRAY);
     glEndList();
   }
   glCallList(mListIds[level]);
 }
-
-
diff --git a/demos/opengl/icosphere.h b/demos/opengl/icosphere.h
index b0210ed..11418c1 100644
--- a/demos/opengl/icosphere.h
+++ b/demos/opengl/icosphere.h
@@ -13,18 +13,18 @@
 #include <Eigen/Core>
 #include <vector>
 
-class IcoSphere
-{
-  public:
-    IcoSphere(unsigned int levels=1);
-    const std::vector<Eigen::Vector3f>& vertices() const { return mVertices; }
-    const std::vector<int>& indices(int level) const;
-    void draw(int level);
-  protected:
-    void _subdivide();
-    std::vector<Eigen::Vector3f> mVertices;
-    std::vector<std::vector<int>*> mIndices;
-    std::vector<int> mListIds;
+class IcoSphere {
+ public:
+  IcoSphere(unsigned int levels = 1);
+  const std::vector<Eigen::Vector3f>& vertices() const { return mVertices; }
+  const std::vector<int>& indices(int level) const;
+  void draw(int level);
+
+ protected:
+  void _subdivide();
+  std::vector<Eigen::Vector3f> mVertices;
+  std::vector<std::vector<int>*> mIndices;
+  std::vector<int> mListIds;
 };
 
-#endif // EIGEN_ICOSPHERE_H
+#endif  // EIGEN_ICOSPHERE_H
diff --git a/demos/opengl/quaternion_demo.cpp b/demos/opengl/quaternion_demo.cpp
index 531448d..5f8673c 100644
--- a/demos/opengl/quaternion_demo.cpp
+++ b/demos/opengl/quaternion_demo.cpp
@@ -27,126 +27,112 @@
 
 using namespace Eigen;
 
-class FancySpheres
-{
-  public:
-    EIGEN_MAKE_ALIGNED_OPERATOR_NEW
-    
-    FancySpheres()
+class FancySpheres {
+ public:
+  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
+
+  FancySpheres() {
+    const int levels = 4;
+    const float scale = 0.33;
+    float radius = 100;
+    std::vector<int> parents;
+
+    // leval 0
+    mCenters.push_back(Vector3f::Zero());
+    parents.push_back(-1);
+    mRadii.push_back(radius);
+
+    // generate level 1 using icosphere vertices
+    radius *= 0.45;
     {
-      const int levels = 4;
-      const float scale = 0.33;
-      float radius = 100;
-      std::vector<int> parents;
-
-      // leval 0
-      mCenters.push_back(Vector3f::Zero());
-      parents.push_back(-1);
-      mRadii.push_back(radius);
-
-      // generate level 1 using icosphere vertices
-      radius *= 0.45;
-      {
-        float dist = mRadii[0]*0.9;
-        for (int i=0; i<12; ++i)
-        {
-          mCenters.push_back(mIcoSphere.vertices()[i] * dist);
-          mRadii.push_back(radius);
-          parents.push_back(0);
-        }
-      }
-
-      static const float angles [10] = {
-        0, 0,
-        M_PI, 0.*M_PI,
-        M_PI, 0.5*M_PI,
-        M_PI, 1.*M_PI,
-        M_PI, 1.5*M_PI
-      };
-
-      // generate other levels
-      int start = 1;
-      for (int l=1; l<levels; l++)
-      {
-        radius *= scale;
-        int end = mCenters.size();
-        for (int i=start; i<end; ++i)
-        {
-          Vector3f c = mCenters[i];
-          Vector3f ax0 = (c - mCenters[parents[i]]).normalized();
-          Vector3f ax1 = ax0.unitOrthogonal();
-          Quaternionf q;
-          q.setFromTwoVectors(Vector3f::UnitZ(), ax0);
-          Affine3f t = Translation3f(c) * q * Scaling(mRadii[i]+radius);
-          for (int j=0; j<5; ++j)
-          {
-            Vector3f newC = c + ( (AngleAxisf(angles[j*2+1], ax0)
-                                * AngleAxisf(angles[j*2+0] * (l==1 ? 0.35 : 0.5), ax1)) * ax0)
-                                * (mRadii[i] + radius*0.8);
-            mCenters.push_back(newC);
-            mRadii.push_back(radius);
-            parents.push_back(i);
-          }
-        }
-        start = end;
+      float dist = mRadii[0] * 0.9;
+      for (int i = 0; i < 12; ++i) {
+        mCenters.push_back(mIcoSphere.vertices()[i] * dist);
+        mRadii.push_back(radius);
+        parents.push_back(0);
       }
     }
 
-    void draw()
-    {
+    static const float angles[10] = {0, 0, M_PI, 0. * M_PI, M_PI, 0.5 * M_PI, M_PI, 1. * M_PI, M_PI, 1.5 * M_PI};
+
+    // generate other levels
+    int start = 1;
+    for (int l = 1; l < levels; l++) {
+      radius *= scale;
       int end = mCenters.size();
-      glEnable(GL_NORMALIZE);
-      for (int i=0; i<end; ++i)
-      {
-        Affine3f t = Translation3f(mCenters[i]) * Scaling(mRadii[i]);
-        gpu.pushMatrix(GL_MODELVIEW);
-        gpu.multMatrix(t.matrix(),GL_MODELVIEW);
-        mIcoSphere.draw(2);
-        gpu.popMatrix(GL_MODELVIEW);
+      for (int i = start; i < end; ++i) {
+        Vector3f c = mCenters[i];
+        Vector3f ax0 = (c - mCenters[parents[i]]).normalized();
+        Vector3f ax1 = ax0.unitOrthogonal();
+        Quaternionf q;
+        q.setFromTwoVectors(Vector3f::UnitZ(), ax0);
+        Affine3f t = Translation3f(c) * q * Scaling(mRadii[i] + radius);
+        for (int j = 0; j < 5; ++j) {
+          Vector3f newC =
+              c + ((AngleAxisf(angles[j * 2 + 1], ax0) * AngleAxisf(angles[j * 2 + 0] * (l == 1 ? 0.35 : 0.5), ax1)) *
+                   ax0) *
+                      (mRadii[i] + radius * 0.8);
+          mCenters.push_back(newC);
+          mRadii.push_back(radius);
+          parents.push_back(i);
+        }
       }
-      glDisable(GL_NORMALIZE);
+      start = end;
     }
-  protected:
-    std::vector<Vector3f> mCenters;
-    std::vector<float> mRadii;
-    IcoSphere mIcoSphere;
+  }
+
+  void draw() {
+    int end = mCenters.size();
+    glEnable(GL_NORMALIZE);
+    for (int i = 0; i < end; ++i) {
+      Affine3f t = Translation3f(mCenters[i]) * Scaling(mRadii[i]);
+      gpu.pushMatrix(GL_MODELVIEW);
+      gpu.multMatrix(t.matrix(), GL_MODELVIEW);
+      mIcoSphere.draw(2);
+      gpu.popMatrix(GL_MODELVIEW);
+    }
+    glDisable(GL_NORMALIZE);
+  }
+
+ protected:
+  std::vector<Vector3f> mCenters;
+  std::vector<float> mRadii;
+  IcoSphere mIcoSphere;
 };
 
-
 // generic linear interpolation method
-template<typename T> T lerp(float t, const T& a, const T& b)
-{
-  return a*(1-t) + b*t;
+template <typename T>
+T lerp(float t, const T& a, const T& b) {
+  return a * (1 - t) + b * t;
 }
 
 // quaternion slerp
-template<> Quaternionf lerp(float t, const Quaternionf& a, const Quaternionf& b)
-{ return a.slerp(t,b); }
+template <>
+Quaternionf lerp(float t, const Quaternionf& a, const Quaternionf& b) {
+  return a.slerp(t, b);
+}
 
 // linear interpolation of a frame using the type OrientationType
 // to perform the interpolation of the orientations
-template<typename OrientationType>
-inline static Frame lerpFrame(float alpha, const Frame& a, const Frame& b)
-{
-  return Frame(lerp(alpha,a.position,b.position),
-               Quaternionf(lerp(alpha,OrientationType(a.orientation),OrientationType(b.orientation))));
+template <typename OrientationType>
+inline static Frame lerpFrame(float alpha, const Frame& a, const Frame& b) {
+  return Frame(lerp(alpha, a.position, b.position),
+               Quaternionf(lerp(alpha, OrientationType(a.orientation), OrientationType(b.orientation))));
 }
 
-template<typename Scalar_> class EulerAngles
-{
-public:
+template <typename Scalar_>
+class EulerAngles {
+ public:
   enum { Dim = 3 };
   typedef Scalar_ Scalar;
-  typedef Matrix<Scalar,3,3> Matrix3;
-  typedef Matrix<Scalar,3,1> Vector3;
+  typedef Matrix<Scalar, 3, 3> Matrix3;
+  typedef Matrix<Scalar, 3, 1> Vector3;
   typedef Quaternion<Scalar> QuaternionType;
 
-protected:
-
+ protected:
   Vector3 m_angles;
 
-public:
-
+ public:
   EulerAngles() {}
   inline EulerAngles(Scalar a0, Scalar a1, Scalar a2) : m_angles(a0, a1, a2) {}
   inline EulerAngles(const QuaternionType& q) { *this = q; }
@@ -154,31 +140,28 @@
   const Vector3& coeffs() const { return m_angles; }
   Vector3& coeffs() { return m_angles; }
 
-  EulerAngles& operator=(const QuaternionType& q)
-  {
+  EulerAngles& operator=(const QuaternionType& q) {
     Matrix3 m = q.toRotationMatrix();
     return *this = m;
   }
 
-  EulerAngles& operator=(const Matrix3& m)
-  {
+  EulerAngles& operator=(const Matrix3& m) {
     // mat =  cy*cz          -cy*sz           sy
     //        cz*sx*sy+cx*sz  cx*cz-sx*sy*sz -cy*sx
     //       -cx*cz*sy+sx*sz  cz*sx+cx*sy*sz  cx*cy
-    m_angles.coeffRef(1) = std::asin(m.coeff(0,2));
-    m_angles.coeffRef(0) = std::atan2(-m.coeff(1,2),m.coeff(2,2));
-    m_angles.coeffRef(2) = std::atan2(-m.coeff(0,1),m.coeff(0,0));
+    m_angles.coeffRef(1) = std::asin(m.coeff(0, 2));
+    m_angles.coeffRef(0) = std::atan2(-m.coeff(1, 2), m.coeff(2, 2));
+    m_angles.coeffRef(2) = std::atan2(-m.coeff(0, 1), m.coeff(0, 0));
     return *this;
   }
 
-  Matrix3 toRotationMatrix(void) const
-  {
+  Matrix3 toRotationMatrix(void) const {
     Vector3 c = m_angles.array().cos();
     Vector3 s = m_angles.array().sin();
     Matrix3 res;
-    res <<  c.y()*c.z(),                    -c.y()*s.z(),                   s.y(),
-            c.z()*s.x()*s.y()+c.x()*s.z(),  c.x()*c.z()-s.x()*s.y()*s.z(),  -c.y()*s.x(),
-            -c.x()*c.z()*s.y()+s.x()*s.z(), c.z()*s.x()+c.x()*s.y()*s.z(),  c.x()*c.y();
+    res << c.y() * c.z(), -c.y() * s.z(), s.y(), c.z() * s.x() * s.y() + c.x() * s.z(),
+        c.x() * c.z() - s.x() * s.y() * s.z(), -c.y() * s.x(), -c.x() * c.z() * s.y() + s.x() * s.z(),
+        c.z() * s.x() + c.x() * s.y() * s.z(), c.x() * c.y();
     return res;
   }
 
@@ -186,16 +169,14 @@
 };
 
 // Euler angles slerp
-template<> EulerAngles<float> lerp(float t, const EulerAngles<float>& a, const EulerAngles<float>& b)
-{
+template <>
+EulerAngles<float> lerp(float t, const EulerAngles<float>& a, const EulerAngles<float>& b) {
   EulerAngles<float> res;
   res.coeffs() = lerp(t, a.coeffs(), b.coeffs());
   return res;
 }
 
-
-RenderingWidget::RenderingWidget()
-{
+RenderingWidget::RenderingWidget() {
   mAnimate = false;
   mCurrentTrackingMode = TM_NO_TRACK;
   mNavMode = NavTurnAround;
@@ -207,43 +188,38 @@
   setFocusPolicy(Qt::ClickFocus);
 }
 
-void RenderingWidget::grabFrame(void)
-{
-    // ask user for a time
-    bool ok = false;
-    double t = 0;
-    if (!m_timeline.empty())
-      t = (--m_timeline.end())->first + 1.;
-    t = QInputDialog::getDouble(this, "Eigen's RenderingWidget", "time value: ",
-      t, 0, 1e3, 1, &ok);
-    if (ok)
-    {
-      Frame aux;
-      aux.orientation = mCamera.viewMatrix().linear();
-      aux.position = mCamera.viewMatrix().translation();
-      m_timeline[t] = aux;
-    }
+void RenderingWidget::grabFrame(void) {
+  // ask user for a time
+  bool ok = false;
+  double t = 0;
+  if (!m_timeline.empty()) t = (--m_timeline.end())->first + 1.;
+  t = QInputDialog::getDouble(this, "Eigen's RenderingWidget", "time value: ", t, 0, 1e3, 1, &ok);
+  if (ok) {
+    Frame aux;
+    aux.orientation = mCamera.viewMatrix().linear();
+    aux.position = mCamera.viewMatrix().translation();
+    m_timeline[t] = aux;
+  }
 }
 
-void RenderingWidget::drawScene()
-{
+void RenderingWidget::drawScene() {
   static FancySpheres sFancySpheres;
   float length = 50;
-  gpu.drawVector(Vector3f::Zero(), length*Vector3f::UnitX(), Color(1,0,0,1));
-  gpu.drawVector(Vector3f::Zero(), length*Vector3f::UnitY(), Color(0,1,0,1));
-  gpu.drawVector(Vector3f::Zero(), length*Vector3f::UnitZ(), Color(0,0,1,1));
+  gpu.drawVector(Vector3f::Zero(), length * Vector3f::UnitX(), Color(1, 0, 0, 1));
+  gpu.drawVector(Vector3f::Zero(), length * Vector3f::UnitY(), Color(0, 1, 0, 1));
+  gpu.drawVector(Vector3f::Zero(), length * Vector3f::UnitZ(), Color(0, 0, 1, 1));
 
   // draw the fractal object
   float sqrt3 = std::sqrt(3.);
-  glLightfv(GL_LIGHT0, GL_AMBIENT, Vector4f(0.5,0.5,0.5,1).data());
-  glLightfv(GL_LIGHT0, GL_DIFFUSE, Vector4f(0.5,1,0.5,1).data());
-  glLightfv(GL_LIGHT0, GL_SPECULAR, Vector4f(1,1,1,1).data());
-  glLightfv(GL_LIGHT0, GL_POSITION, Vector4f(-sqrt3,-sqrt3,sqrt3,0).data());
+  glLightfv(GL_LIGHT0, GL_AMBIENT, Vector4f(0.5, 0.5, 0.5, 1).data());
+  glLightfv(GL_LIGHT0, GL_DIFFUSE, Vector4f(0.5, 1, 0.5, 1).data());
+  glLightfv(GL_LIGHT0, GL_SPECULAR, Vector4f(1, 1, 1, 1).data());
+  glLightfv(GL_LIGHT0, GL_POSITION, Vector4f(-sqrt3, -sqrt3, sqrt3, 0).data());
 
-  glLightfv(GL_LIGHT1, GL_AMBIENT, Vector4f(0,0,0,1).data());
-  glLightfv(GL_LIGHT1, GL_DIFFUSE, Vector4f(1,0.5,0.5,1).data());
-  glLightfv(GL_LIGHT1, GL_SPECULAR, Vector4f(1,1,1,1).data());
-  glLightfv(GL_LIGHT1, GL_POSITION, Vector4f(-sqrt3,sqrt3,-sqrt3,0).data());
+  glLightfv(GL_LIGHT1, GL_AMBIENT, Vector4f(0, 0, 0, 1).data());
+  glLightfv(GL_LIGHT1, GL_DIFFUSE, Vector4f(1, 0.5, 0.5, 1).data());
+  glLightfv(GL_LIGHT1, GL_SPECULAR, Vector4f(1, 1, 1, 1).data());
+  glLightfv(GL_LIGHT1, GL_POSITION, Vector4f(-sqrt3, sqrt3, -sqrt3, 0).data());
 
   glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, Vector4f(0.7, 0.7, 0.7, 1).data());
   glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, Vector4f(0.8, 0.75, 0.6, 1).data());
@@ -266,8 +242,7 @@
   glDisable(GL_LIGHTING);
 }
 
-void RenderingWidget::animate()
-{
+void RenderingWidget::animate() {
   m_alpha += double(m_timer.interval()) * 1e-3;
 
   TimeLine::const_iterator hi = m_timeline.upper_bound(m_alpha);
@@ -276,26 +251,20 @@
 
   Frame currentFrame;
 
-  if(hi==m_timeline.end())
-  {
+  if (hi == m_timeline.end()) {
     // end
     currentFrame = lo->second;
     stopAnimation();
-  }
-  else if(hi==m_timeline.begin())
-  {
+  } else if (hi == m_timeline.begin()) {
     // start
     currentFrame = hi->second;
-  }
-  else
-  {
-    float s = (m_alpha - lo->first)/(hi->first - lo->first);
-    if (mLerpMode==LerpEulerAngles)
+  } else {
+    float s = (m_alpha - lo->first) / (hi->first - lo->first);
+    if (mLerpMode == LerpEulerAngles)
       currentFrame = ::lerpFrame<EulerAngles<float> >(s, lo->second, hi->second);
-    else if (mLerpMode==LerpQuaternion)
+    else if (mLerpMode == LerpQuaternion)
       currentFrame = ::lerpFrame<Eigen::Quaternionf>(s, lo->second, hi->second);
-    else
-    {
+    else {
       std::cerr << "Invalid rotation interpolation mode (abort)\n";
       exit(2);
     }
@@ -303,162 +272,141 @@
   }
 
   currentFrame.orientation = currentFrame.orientation.inverse();
-  currentFrame.position = - (currentFrame.orientation * currentFrame.position);
+  currentFrame.position = -(currentFrame.orientation * currentFrame.position);
   mCamera.setFrame(currentFrame);
 
   updateGL();
 }
 
-void RenderingWidget::keyPressEvent(QKeyEvent * e)
-{
-    switch(e->key())
-    {
-      case Qt::Key_Up:
-        mCamera.zoom(2);
-        break;
-      case Qt::Key_Down:
-        mCamera.zoom(-2);
-        break;
-      // add a frame
-      case Qt::Key_G:
-        grabFrame();
-        break;
-      // clear the time line
-      case Qt::Key_C:
-        m_timeline.clear();
-        break;
-      // move the camera to initial pos
-      case Qt::Key_R:
-        resetCamera();
-        break;
-      // start/stop the animation
-      case Qt::Key_A:
-        if (mAnimate)
-        {
-          stopAnimation();
-        }
-        else
-        {
-          m_alpha = 0;
-          connect(&m_timer, SIGNAL(timeout()), this, SLOT(animate()));
-          m_timer.start(1000/30);
-          mAnimate = true;
-        }
-        break;
-      default:
-        break;
-    }
+void RenderingWidget::keyPressEvent(QKeyEvent* e) {
+  switch (e->key()) {
+    case Qt::Key_Up:
+      mCamera.zoom(2);
+      break;
+    case Qt::Key_Down:
+      mCamera.zoom(-2);
+      break;
+    // add a frame
+    case Qt::Key_G:
+      grabFrame();
+      break;
+    // clear the time line
+    case Qt::Key_C:
+      m_timeline.clear();
+      break;
+    // move the camera to initial pos
+    case Qt::Key_R:
+      resetCamera();
+      break;
+    // start/stop the animation
+    case Qt::Key_A:
+      if (mAnimate) {
+        stopAnimation();
+      } else {
+        m_alpha = 0;
+        connect(&m_timer, SIGNAL(timeout()), this, SLOT(animate()));
+        m_timer.start(1000 / 30);
+        mAnimate = true;
+      }
+      break;
+    default:
+      break;
+  }
 
-    updateGL();
+  updateGL();
 }
 
-void RenderingWidget::stopAnimation()
-{
+void RenderingWidget::stopAnimation() {
   disconnect(&m_timer, SIGNAL(timeout()), this, SLOT(animate()));
   m_timer.stop();
   mAnimate = false;
   m_alpha = 0;
 }
 
-void RenderingWidget::mousePressEvent(QMouseEvent* e)
-{
+void RenderingWidget::mousePressEvent(QMouseEvent* e) {
   mMouseCoords = Vector2i(e->pos().x(), e->pos().y());
-  bool fly = (mNavMode==NavFly) || (e->modifiers()&Qt::ControlModifier);
-  switch(e->button())
-  {
+  bool fly = (mNavMode == NavFly) || (e->modifiers() & Qt::ControlModifier);
+  switch (e->button()) {
     case Qt::LeftButton:
-      if(fly)
-      {
+      if (fly) {
         mCurrentTrackingMode = TM_LOCAL_ROTATE;
         mTrackball.start(Trackball::Local);
-      }
-      else
-      {
+      } else {
         mCurrentTrackingMode = TM_ROTATE_AROUND;
         mTrackball.start(Trackball::Around);
       }
       mTrackball.track(mMouseCoords);
       break;
     case Qt::MidButton:
-      if(fly)
+      if (fly)
         mCurrentTrackingMode = TM_FLY_Z;
       else
         mCurrentTrackingMode = TM_ZOOM;
       break;
     case Qt::RightButton:
-        mCurrentTrackingMode = TM_FLY_PAN;
+      mCurrentTrackingMode = TM_FLY_PAN;
       break;
     default:
       break;
   }
 }
-void RenderingWidget::mouseReleaseEvent(QMouseEvent*)
-{
-    mCurrentTrackingMode = TM_NO_TRACK;
-    updateGL();
+void RenderingWidget::mouseReleaseEvent(QMouseEvent*) {
+  mCurrentTrackingMode = TM_NO_TRACK;
+  updateGL();
 }
 
-void RenderingWidget::mouseMoveEvent(QMouseEvent* e)
-{
-    // tracking
-    if(mCurrentTrackingMode != TM_NO_TRACK)
-    {
-        float dx =   float(e->x() - mMouseCoords.x()) / float(mCamera.vpWidth());
-        float dy = - float(e->y() - mMouseCoords.y()) / float(mCamera.vpHeight());
+void RenderingWidget::mouseMoveEvent(QMouseEvent* e) {
+  // tracking
+  if (mCurrentTrackingMode != TM_NO_TRACK) {
+    float dx = float(e->x() - mMouseCoords.x()) / float(mCamera.vpWidth());
+    float dy = -float(e->y() - mMouseCoords.y()) / float(mCamera.vpHeight());
 
-        // speedup the transformations
-        if(e->modifiers() & Qt::ShiftModifier)
-        {
-          dx *= 10.;
-          dy *= 10.;
-        }
-
-        switch(mCurrentTrackingMode)
-        {
-          case TM_ROTATE_AROUND:
-          case TM_LOCAL_ROTATE:
-            if (mRotationMode==RotationStable)
-            {
-              // use the stable trackball implementation mapping
-              // the 2D coordinates to 3D points on a sphere.
-              mTrackball.track(Vector2i(e->pos().x(), e->pos().y()));
-            }
-            else
-            {
-              // standard approach mapping the x and y displacements as rotations
-              // around the camera's X and Y axes.
-              Quaternionf q = AngleAxisf( dx*M_PI, Vector3f::UnitY())
-                            * AngleAxisf(-dy*M_PI, Vector3f::UnitX());
-              if (mCurrentTrackingMode==TM_LOCAL_ROTATE)
-                mCamera.localRotate(q);
-              else
-                mCamera.rotateAroundTarget(q);
-            }
-            break;
-          case TM_ZOOM :
-            mCamera.zoom(dy*100);
-            break;
-          case TM_FLY_Z :
-            mCamera.localTranslate(Vector3f(0, 0, -dy*200));
-            break;
-          case TM_FLY_PAN :
-            mCamera.localTranslate(Vector3f(dx*200, dy*200, 0));
-            break;
-          default:
-            break;
-        }
-
-        updateGL();
+    // speedup the transformations
+    if (e->modifiers() & Qt::ShiftModifier) {
+      dx *= 10.;
+      dy *= 10.;
     }
 
-    mMouseCoords = Vector2i(e->pos().x(), e->pos().y());
+    switch (mCurrentTrackingMode) {
+      case TM_ROTATE_AROUND:
+      case TM_LOCAL_ROTATE:
+        if (mRotationMode == RotationStable) {
+          // use the stable trackball implementation mapping
+          // the 2D coordinates to 3D points on a sphere.
+          mTrackball.track(Vector2i(e->pos().x(), e->pos().y()));
+        } else {
+          // standard approach mapping the x and y displacements as rotations
+          // around the camera's X and Y axes.
+          Quaternionf q = AngleAxisf(dx * M_PI, Vector3f::UnitY()) * AngleAxisf(-dy * M_PI, Vector3f::UnitX());
+          if (mCurrentTrackingMode == TM_LOCAL_ROTATE)
+            mCamera.localRotate(q);
+          else
+            mCamera.rotateAroundTarget(q);
+        }
+        break;
+      case TM_ZOOM:
+        mCamera.zoom(dy * 100);
+        break;
+      case TM_FLY_Z:
+        mCamera.localTranslate(Vector3f(0, 0, -dy * 200));
+        break;
+      case TM_FLY_PAN:
+        mCamera.localTranslate(Vector3f(dx * 200, dy * 200, 0));
+        break;
+      default:
+        break;
+    }
+
+    updateGL();
+  }
+
+  mMouseCoords = Vector2i(e->pos().x(), e->pos().y());
 }
 
-void RenderingWidget::paintGL()
-{
+void RenderingWidget::paintGL() {
   glEnable(GL_DEPTH_TEST);
   glDisable(GL_CULL_FACE);
-  glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
+  glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
   glDisable(GL_COLOR_MATERIAL);
   glDisable(GL_BLEND);
   glDisable(GL_ALPHA_TEST);
@@ -474,8 +422,7 @@
   drawScene();
 }
 
-void RenderingWidget::initializeGL()
-{
+void RenderingWidget::initializeGL() {
   glClearColor(1., 1., 1., 0.);
   glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1);
   glDepthMask(GL_TRUE);
@@ -487,30 +434,16 @@
   mInitFrame.position = mCamera.viewMatrix().translation();
 }
 
-void RenderingWidget::resizeGL(int width, int height)
-{
-    mCamera.setViewport(width,height);
-}
+void RenderingWidget::resizeGL(int width, int height) { mCamera.setViewport(width, height); }
 
-void RenderingWidget::setNavMode(int m)
-{
-  mNavMode = NavMode(m);
-}
+void RenderingWidget::setNavMode(int m) { mNavMode = NavMode(m); }
 
-void RenderingWidget::setLerpMode(int m)
-{
-  mLerpMode = LerpMode(m);
-}
+void RenderingWidget::setLerpMode(int m) { mLerpMode = LerpMode(m); }
 
-void RenderingWidget::setRotationMode(int m)
-{
-  mRotationMode = RotationMode(m);
-}
+void RenderingWidget::setRotationMode(int m) { mRotationMode = RotationMode(m); }
 
-void RenderingWidget::resetCamera()
-{
-  if (mAnimate)
-    stopAnimation();
+void RenderingWidget::resetCamera() {
+  if (mAnimate) stopAnimation();
   m_timeline.clear();
   Frame aux0 = mCamera.frame();
   aux0.orientation = aux0.orientation.inverse();
@@ -525,13 +458,13 @@
   aux1.orientation = aux1.orientation.inverse();
   aux1.position = mCamera.viewMatrix().translation();
   float duration = aux0.orientation.angularDistance(aux1.orientation) * 0.9;
-  if (duration<0.1) duration = 0.1;
+  if (duration < 0.1) duration = 0.1;
 
   // put the camera at that time step:
-  aux1 = aux0.lerp(duration/2,mInitFrame);
+  aux1 = aux0.lerp(duration / 2, mInitFrame);
   // and make it look at the target again
   aux1.orientation = aux1.orientation.inverse();
-  aux1.position = - (aux1.orientation * aux1.position);
+  aux1.position = -(aux1.orientation * aux1.position);
   mCamera.setFrame(aux1);
   mCamera.setTarget(Vector3f::Zero());
 
@@ -544,12 +477,11 @@
   m_alpha = 0;
   animate();
   connect(&m_timer, SIGNAL(timeout()), this, SLOT(animate()));
-  m_timer.start(1000/30);
+  m_timer.start(1000 / 30);
   mAnimate = true;
 }
 
-QWidget* RenderingWidget::createNavigationControlWidget()
-{
+QWidget* RenderingWidget::createNavigationControlWidget() {
   QWidget* panel = new QWidget();
   QVBoxLayout* layout = new QVBoxLayout();
 
@@ -591,7 +523,8 @@
     but = new QRadioButton("standard rotation");
     group->addButton(but, RotationStandard);
     boxLayout->addWidget(but);
-    but->setToolTip("standard approach mapping the x and y displacements\nas rotations around the camera's X and Y axes");
+    but->setToolTip(
+        "standard approach mapping the x and y displacements\nas rotations around the camera's X and Y axes");
     group->button(mRotationMode)->setChecked(true);
     connect(group, SIGNAL(buttonClicked(int)), this, SLOT(setRotationMode(int)));
     box->setLayout(boxLayout);
@@ -616,13 +549,12 @@
     box->setLayout(boxLayout);
     layout->addWidget(box);
   }
-  layout->addItem(new QSpacerItem(0,0,QSizePolicy::Minimum,QSizePolicy::Expanding));
+  layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
   panel->setLayout(layout);
   return panel;
 }
 
-QuaternionDemo::QuaternionDemo()
-{
+QuaternionDemo::QuaternionDemo() {
   mRenderingWidget = new RenderingWidget();
   setCentralWidget(mRenderingWidget);
 
@@ -632,8 +564,7 @@
   panel->setWidget(mRenderingWidget->createNavigationControlWidget());
 }
 
-int main(int argc, char *argv[])
-{
+int main(int argc, char* argv[]) {
   std::cout << "Navigation:\n";
   std::cout << "  left button:           rotate around the target\n";
   std::cout << "  middle button:         zoom\n";
@@ -647,10 +578,9 @@
 
   QApplication app(argc, argv);
   QuaternionDemo demo;
-  demo.resize(600,500);
+  demo.resize(600, 500);
   demo.show();
   return app.exec();
 }
 
 #include "quaternion_demo.moc"
-
diff --git a/demos/opengl/quaternion_demo.h b/demos/opengl/quaternion_demo.h
index dbff46c..5eb4fce 100644
--- a/demos/opengl/quaternion_demo.h
+++ b/demos/opengl/quaternion_demo.h
@@ -19,96 +19,82 @@
 #include <QtOpenGL/QGLWidget>
 #include <QtGui/QMainWindow>
 
-class RenderingWidget : public QGLWidget
-{
+class RenderingWidget : public QGLWidget {
   Q_OBJECT
 
-    typedef std::map<float,Frame> TimeLine;
-    TimeLine m_timeline;
-    Frame lerpFrame(float t);
+  typedef std::map<float, Frame> TimeLine;
+  TimeLine m_timeline;
+  Frame lerpFrame(float t);
 
-    Frame mInitFrame;
-    bool mAnimate;
-    float m_alpha;
+  Frame mInitFrame;
+  bool mAnimate;
+  float m_alpha;
 
-    enum TrackMode {
-      TM_NO_TRACK=0, TM_ROTATE_AROUND, TM_ZOOM,
-      TM_LOCAL_ROTATE, TM_FLY_Z, TM_FLY_PAN
-    };
+  enum TrackMode { TM_NO_TRACK = 0, TM_ROTATE_AROUND, TM_ZOOM, TM_LOCAL_ROTATE, TM_FLY_Z, TM_FLY_PAN };
 
-    enum NavMode {
-      NavTurnAround,
-      NavFly
-    };
+  enum NavMode { NavTurnAround, NavFly };
 
-    enum LerpMode {
-      LerpQuaternion,
-      LerpEulerAngles
-    };
+  enum LerpMode { LerpQuaternion, LerpEulerAngles };
 
-    enum RotationMode {
-      RotationStable,
-      RotationStandard
-    };
+  enum RotationMode { RotationStable, RotationStandard };
 
-    Camera mCamera;
-    TrackMode mCurrentTrackingMode;
-    NavMode mNavMode;
-    LerpMode mLerpMode;
-    RotationMode mRotationMode;
-    Vector2i mMouseCoords;
-    Trackball mTrackball;
+  Camera mCamera;
+  TrackMode mCurrentTrackingMode;
+  NavMode mNavMode;
+  LerpMode mLerpMode;
+  RotationMode mRotationMode;
+  Vector2i mMouseCoords;
+  Trackball mTrackball;
 
-    QTimer m_timer;
+  QTimer m_timer;
 
-    void setupCamera();
+  void setupCamera();
 
-    std::vector<Vector3f> mVertices;
-    std::vector<Vector3f> mNormals;
-    std::vector<int> mIndices;
+  std::vector<Vector3f> mVertices;
+  std::vector<Vector3f> mNormals;
+  std::vector<int> mIndices;
 
-  protected slots:
+ protected slots:
 
-    virtual void animate(void);
-    virtual void drawScene(void);
+  virtual void animate(void);
+  virtual void drawScene(void);
 
-    virtual void grabFrame(void);
-    virtual void stopAnimation();
+  virtual void grabFrame(void);
+  virtual void stopAnimation();
 
-    virtual void setNavMode(int);
-    virtual void setLerpMode(int);
-    virtual void setRotationMode(int);
-    virtual void resetCamera();
+  virtual void setNavMode(int);
+  virtual void setLerpMode(int);
+  virtual void setRotationMode(int);
+  virtual void resetCamera();
 
-  protected:
+ protected:
+  virtual void initializeGL();
+  virtual void resizeGL(int width, int height);
+  virtual void paintGL();
 
-    virtual void initializeGL();
-    virtual void resizeGL(int width, int height);
-    virtual void paintGL();
-    
-    //--------------------------------------------------------------------------------
-    virtual void mousePressEvent(QMouseEvent * e);
-    virtual void mouseReleaseEvent(QMouseEvent * e);
-    virtual void mouseMoveEvent(QMouseEvent * e);
-    virtual void keyPressEvent(QKeyEvent * e);
-    //--------------------------------------------------------------------------------
+  //--------------------------------------------------------------------------------
+  virtual void mousePressEvent(QMouseEvent* e);
+  virtual void mouseReleaseEvent(QMouseEvent* e);
+  virtual void mouseMoveEvent(QMouseEvent* e);
+  virtual void keyPressEvent(QKeyEvent* e);
+  //--------------------------------------------------------------------------------
 
-  public: 
-    EIGEN_MAKE_ALIGNED_OPERATOR_NEW
-    
-    RenderingWidget();
-    ~RenderingWidget() { }
+ public:
+  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
 
-    QWidget* createNavigationControlWidget();
+  RenderingWidget();
+  ~RenderingWidget() {}
+
+  QWidget* createNavigationControlWidget();
 };
 
-class QuaternionDemo : public QMainWindow
-{
+class QuaternionDemo : public QMainWindow {
   Q_OBJECT
-  public:
-    QuaternionDemo();
-  protected:
-    RenderingWidget* mRenderingWidget;
+ public:
+  QuaternionDemo();
+
+ protected:
+  RenderingWidget* mRenderingWidget;
 };
 
-#endif // EIGEN_QUATERNION_DEMO_H
+#endif  // EIGEN_QUATERNION_DEMO_H
diff --git a/demos/opengl/trackball.cpp b/demos/opengl/trackball.cpp
index 7c2da8e..b12d09b 100644
--- a/demos/opengl/trackball.cpp
+++ b/demos/opengl/trackball.cpp
@@ -12,21 +12,17 @@
 
 using namespace Eigen;
 
-void Trackball::track(const Vector2i& point2D)
-{
-  if (mpCamera==0)
-    return;
+void Trackball::track(const Vector2i& point2D) {
+  if (mpCamera == 0) return;
   Vector3f newPoint3D;
   bool newPointOk = mapToSphere(point2D, newPoint3D);
 
-  if (mLastPointOk && newPointOk)
-  {
+  if (mLastPointOk && newPointOk) {
     Vector3f axis = mLastPoint3D.cross(newPoint3D).normalized();
     float cos_angle = mLastPoint3D.dot(newPoint3D);
-    if ( std::abs(cos_angle) < 1.0 )
-    {
+    if (std::abs(cos_angle) < 1.0) {
       float angle = 2. * acos(cos_angle);
-      if (mMode==Around)
+      if (mMode == Around)
         mpCamera->rotateAroundTarget(Quaternionf(AngleAxisf(angle, axis)));
       else
         mpCamera->localRotate(Quaternionf(AngleAxisf(-angle, axis)));
@@ -37,23 +33,19 @@
   mLastPointOk = newPointOk;
 }
 
-bool Trackball::mapToSphere(const Vector2i& p2, Vector3f& v3)
-{
-  if ((p2.x() >= 0) && (p2.x() <= int(mpCamera->vpWidth())) &&
-      (p2.y() >= 0) && (p2.y() <= int(mpCamera->vpHeight())) )
-  {
-    double x  = (double)(p2.x() - 0.5*mpCamera->vpWidth())  / (double)mpCamera->vpWidth();
-    double y  = (double)(0.5*mpCamera->vpHeight() - p2.y()) / (double)mpCamera->vpHeight();
-    double sinx         = sin(M_PI * x * 0.5);
-    double siny         = sin(M_PI * y * 0.5);
-    double sinx2siny2   = sinx * sinx + siny * siny;
+bool Trackball::mapToSphere(const Vector2i& p2, Vector3f& v3) {
+  if ((p2.x() >= 0) && (p2.x() <= int(mpCamera->vpWidth())) && (p2.y() >= 0) && (p2.y() <= int(mpCamera->vpHeight()))) {
+    double x = (double)(p2.x() - 0.5 * mpCamera->vpWidth()) / (double)mpCamera->vpWidth();
+    double y = (double)(0.5 * mpCamera->vpHeight() - p2.y()) / (double)mpCamera->vpHeight();
+    double sinx = sin(M_PI * x * 0.5);
+    double siny = sin(M_PI * y * 0.5);
+    double sinx2siny2 = sinx * sinx + siny * siny;
 
     v3.x() = sinx;
     v3.y() = siny;
     v3.z() = sinx2siny2 < 1.0 ? sqrt(1.0 - sinx2siny2) : 0.0;
 
     return true;
-  }
-  else
+  } else
     return false;
 }
diff --git a/demos/opengl/trackball.h b/demos/opengl/trackball.h
index 1ea842f..dda235f 100644
--- a/demos/opengl/trackball.h
+++ b/demos/opengl/trackball.h
@@ -14,29 +14,28 @@
 
 class Camera;
 
-class Trackball
-{
-  public:
+class Trackball {
+ public:
+  enum Mode { Around, Local };
 
-    enum Mode {Around, Local};
+  Trackball() : mpCamera(0) {}
 
-    Trackball() : mpCamera(0) {}
+  void start(Mode m = Around) {
+    mMode = m;
+    mLastPointOk = false;
+  }
 
-    void start(Mode m = Around) { mMode = m; mLastPointOk = false; }
+  void setCamera(Camera* pCam) { mpCamera = pCam; }
 
-    void setCamera(Camera* pCam) { mpCamera = pCam; }
+  void track(const Eigen::Vector2i& newPoint2D);
 
-    void track(const Eigen::Vector2i& newPoint2D);
+ protected:
+  bool mapToSphere(const Eigen::Vector2i& p2, Eigen::Vector3f& v3);
 
-  protected:
-
-    bool mapToSphere( const Eigen::Vector2i& p2, Eigen::Vector3f& v3);
-
-    Camera* mpCamera;
-    Eigen::Vector3f mLastPoint3D;
-    Mode mMode;
-    bool mLastPointOk;
-
+  Camera* mpCamera;
+  Eigen::Vector3f mLastPoint3D;
+  Mode mMode;
+  bool mLastPointOk;
 };
 
-#endif // EIGEN_TRACKBALL_H
+#endif  // EIGEN_TRACKBALL_H
diff --git a/doc/examples/CustomizingEigen_Inheritance.cpp b/doc/examples/CustomizingEigen_Inheritance.cpp
index 48df64e..26e1e3c 100644
--- a/doc/examples/CustomizingEigen_Inheritance.cpp
+++ b/doc/examples/CustomizingEigen_Inheritance.cpp
@@ -1,28 +1,23 @@
 #include <Eigen/Core>
 #include <iostream>
 
-class MyVectorType : public Eigen::VectorXd
-{
-public:
-    MyVectorType(void):Eigen::VectorXd() {}
+class MyVectorType : public Eigen::VectorXd {
+ public:
+  MyVectorType(void) : Eigen::VectorXd() {}
 
-    // This constructor allows you to construct MyVectorType from Eigen expressions
-    template<typename OtherDerived>
-    MyVectorType(const Eigen::MatrixBase<OtherDerived>& other)
-        : Eigen::VectorXd(other)
-    { }
+  // This constructor allows you to construct MyVectorType from Eigen expressions
+  template <typename OtherDerived>
+  MyVectorType(const Eigen::MatrixBase<OtherDerived>& other) : Eigen::VectorXd(other) {}
 
-    // This method allows you to assign Eigen expressions to MyVectorType
-    template<typename OtherDerived>
-    MyVectorType& operator=(const Eigen::MatrixBase <OtherDerived>& other)
-    {
-        this->Eigen::VectorXd::operator=(other);
-        return *this;
-    }
+  // This method allows you to assign Eigen expressions to MyVectorType
+  template <typename OtherDerived>
+  MyVectorType& operator=(const Eigen::MatrixBase<OtherDerived>& other) {
+    this->Eigen::VectorXd::operator=(other);
+    return *this;
+  }
 };
 
-int main()
-{
+int main() {
   MyVectorType v = MyVectorType::Ones(4);
   v(2) += 10;
   v = 2 * v;
diff --git a/doc/examples/Cwise_erf.cpp b/doc/examples/Cwise_erf.cpp
index 9ddc57d..598c18c 100644
--- a/doc/examples/Cwise_erf.cpp
+++ b/doc/examples/Cwise_erf.cpp
@@ -1,8 +1,7 @@
 #include <Eigen/Core>
 #include <unsupported/Eigen/SpecialFunctions>
 #include <iostream>
-int main()
-{
-  Eigen::Array4d v(-0.5,2,0,-7);
+int main() {
+  Eigen::Array4d v(-0.5, 2, 0, -7);
   std::cout << v.erf() << std::endl;
 }
diff --git a/doc/examples/Cwise_erfc.cpp b/doc/examples/Cwise_erfc.cpp
index 4b7902c..98b0b75 100644
--- a/doc/examples/Cwise_erfc.cpp
+++ b/doc/examples/Cwise_erfc.cpp
@@ -1,8 +1,7 @@
 #include <Eigen/Core>
 #include <unsupported/Eigen/SpecialFunctions>
 #include <iostream>
-int main()
-{
-  Eigen::Array4d v(-0.5,2,0,-7);
+int main() {
+  Eigen::Array4d v(-0.5, 2, 0, -7);
   std::cout << v.erfc() << std::endl;
 }
diff --git a/doc/examples/Cwise_lgamma.cpp b/doc/examples/Cwise_lgamma.cpp
index f3c9fe6..10866d8 100644
--- a/doc/examples/Cwise_lgamma.cpp
+++ b/doc/examples/Cwise_lgamma.cpp
@@ -1,8 +1,7 @@
 #include <Eigen/Core>
 #include <unsupported/Eigen/SpecialFunctions>
 #include <iostream>
-int main()
-{
-  Eigen::Array4d v(0.5,10,0,-1);
+int main() {
+  Eigen::Array4d v(0.5, 10, 0, -1);
   std::cout << v.lgamma() << std::endl;
 }
diff --git a/doc/examples/DenseBase_middleCols_int.cpp b/doc/examples/DenseBase_middleCols_int.cpp
index d05a552..cb7dace 100644
--- a/doc/examples/DenseBase_middleCols_int.cpp
+++ b/doc/examples/DenseBase_middleCols_int.cpp
@@ -1,12 +1,11 @@
 #include <Eigen/Core>
 #include <iostream>
 
-int main()
-{
-    int const N = 5;
-    Eigen::MatrixXi A(N,N);
-    A.setRandom();
-    std::cout << "A =\n" << A << '\n' << std::endl;
-    std::cout << "A(1..3,:) =\n" << A.middleCols(1,3) << std::endl;
-    return 0;
+int main() {
+  int const N = 5;
+  Eigen::MatrixXi A(N, N);
+  A.setRandom();
+  std::cout << "A =\n" << A << '\n' << std::endl;
+  std::cout << "A(1..3,:) =\n" << A.middleCols(1, 3) << std::endl;
+  return 0;
 }
diff --git a/doc/examples/DenseBase_middleRows_int.cpp b/doc/examples/DenseBase_middleRows_int.cpp
index 8651629..6a25500 100644
--- a/doc/examples/DenseBase_middleRows_int.cpp
+++ b/doc/examples/DenseBase_middleRows_int.cpp
@@ -1,12 +1,11 @@
 #include <Eigen/Core>
 #include <iostream>
 
-int main()
-{
-    int const N = 5;
-    Eigen::MatrixXi A(N,N);
-    A.setRandom();
-    std::cout << "A =\n" << A << '\n' << std::endl;
-    std::cout << "A(2..3,:) =\n" << A.middleRows(2,2) << std::endl;
-    return 0;
+int main() {
+  int const N = 5;
+  Eigen::MatrixXi A(N, N);
+  A.setRandom();
+  std::cout << "A =\n" << A << '\n' << std::endl;
+  std::cout << "A(2..3,:) =\n" << A.middleRows(2, 2) << std::endl;
+  return 0;
 }
diff --git a/doc/examples/DenseBase_template_int_middleCols.cpp b/doc/examples/DenseBase_template_int_middleCols.cpp
index caefabf..52c032c 100644
--- a/doc/examples/DenseBase_template_int_middleCols.cpp
+++ b/doc/examples/DenseBase_template_int_middleCols.cpp
@@ -1,12 +1,11 @@
 #include <Eigen/Core>
 #include <iostream>
 
-int main()
-{
-    int const N = 5;
-    Eigen::MatrixXi A(N,N);
-    A.setRandom();
-    std::cout << "A =\n" << A << '\n' << std::endl;
-    std::cout << "A(:,1..3) =\n" << A.middleCols<3>(1) << std::endl;
-    return 0;
+int main() {
+  int const N = 5;
+  Eigen::MatrixXi A(N, N);
+  A.setRandom();
+  std::cout << "A =\n" << A << '\n' << std::endl;
+  std::cout << "A(:,1..3) =\n" << A.middleCols<3>(1) << std::endl;
+  return 0;
 }
diff --git a/doc/examples/DenseBase_template_int_middleRows.cpp b/doc/examples/DenseBase_template_int_middleRows.cpp
index ed5b295..4db5e70 100644
--- a/doc/examples/DenseBase_template_int_middleRows.cpp
+++ b/doc/examples/DenseBase_template_int_middleRows.cpp
@@ -1,12 +1,11 @@
 #include <Eigen/Core>
 #include <iostream>
 
-int main()
-{
-    int const N = 5;
-    Eigen::MatrixXi A(N,N);
-    A.setRandom();
-    std::cout << "A =\n" << A << '\n' << std::endl;
-    std::cout << "A(1..3,:) =\n" << A.middleRows<3>(1) << std::endl;
-    return 0;
+int main() {
+  int const N = 5;
+  Eigen::MatrixXi A(N, N);
+  A.setRandom();
+  std::cout << "A =\n" << A << '\n' << std::endl;
+  std::cout << "A(1..3,:) =\n" << A.middleRows<3>(1) << std::endl;
+  return 0;
 }
diff --git a/doc/examples/QuickStart_example.cpp b/doc/examples/QuickStart_example.cpp
index 7238c0c..103ddd5 100644
--- a/doc/examples/QuickStart_example.cpp
+++ b/doc/examples/QuickStart_example.cpp
@@ -3,12 +3,11 @@
 
 using Eigen::MatrixXd;
 
-int main()
-{
-  MatrixXd m(2,2);
-  m(0,0) = 3;
-  m(1,0) = 2.5;
-  m(0,1) = -1;
-  m(1,1) = m(1,0) + m(0,1);
+int main() {
+  MatrixXd m(2, 2);
+  m(0, 0) = 3;
+  m(1, 0) = 2.5;
+  m(0, 1) = -1;
+  m(1, 1) = m(1, 0) + m(0, 1);
   std::cout << m << std::endl;
 }
diff --git a/doc/examples/QuickStart_example2_dynamic.cpp b/doc/examples/QuickStart_example2_dynamic.cpp
index bc8d326..c7e7c32 100644
--- a/doc/examples/QuickStart_example2_dynamic.cpp
+++ b/doc/examples/QuickStart_example2_dynamic.cpp
@@ -4,10 +4,9 @@
 using Eigen::MatrixXd;
 using Eigen::VectorXd;
 
-int main()
-{
-  MatrixXd m = MatrixXd::Random(3,3);
-  m = (m + MatrixXd::Constant(3,3,1.2)) * 50;
+int main() {
+  MatrixXd m = MatrixXd::Random(3, 3);
+  m = (m + MatrixXd::Constant(3, 3, 1.2)) * 50;
   std::cout << "m =" << std::endl << m << std::endl;
   VectorXd v(3);
   v << 1, 2, 3;
diff --git a/doc/examples/QuickStart_example2_fixed.cpp b/doc/examples/QuickStart_example2_fixed.cpp
index af6f9a9..e643a47 100644
--- a/doc/examples/QuickStart_example2_fixed.cpp
+++ b/doc/examples/QuickStart_example2_fixed.cpp
@@ -4,12 +4,11 @@
 using Eigen::Matrix3d;
 using Eigen::Vector3d;
 
-int main()
-{
+int main() {
   Matrix3d m = Matrix3d::Random();
   m = (m + Matrix3d::Constant(1.2)) * 50;
   std::cout << "m =" << std::endl << m << std::endl;
-  Vector3d v(1,2,3);
-  
+  Vector3d v(1, 2, 3);
+
   std::cout << "m * v =" << std::endl << m * v << std::endl;
 }
diff --git a/doc/examples/TemplateKeyword_flexible.cpp b/doc/examples/TemplateKeyword_flexible.cpp
index efe458b..09919a3 100644
--- a/doc/examples/TemplateKeyword_flexible.cpp
+++ b/doc/examples/TemplateKeyword_flexible.cpp
@@ -2,19 +2,17 @@
 #include <iostream>
 
 template <typename Derived1, typename Derived2>
-void copyUpperTriangularPart(Eigen::MatrixBase<Derived1>& dst, const Eigen::MatrixBase<Derived2>& src)
-{
+void copyUpperTriangularPart(Eigen::MatrixBase<Derived1>& dst, const Eigen::MatrixBase<Derived2>& src) {
   /* Note the 'template' keywords in the following line! */
   dst.template triangularView<Eigen::Upper>() = src.template triangularView<Eigen::Upper>();
 }
 
-int main()
-{
-  Eigen::MatrixXi m1 = Eigen::MatrixXi::Ones(5,5);
-  Eigen::MatrixXi m2 = Eigen::MatrixXi::Random(4,4);
+int main() {
+  Eigen::MatrixXi m1 = Eigen::MatrixXi::Ones(5, 5);
+  Eigen::MatrixXi m2 = Eigen::MatrixXi::Random(4, 4);
   std::cout << "m2 before copy:" << std::endl;
   std::cout << m2 << std::endl << std::endl;
-  copyUpperTriangularPart(m2, m1.topLeftCorner(4,4));
+  copyUpperTriangularPart(m2, m1.topLeftCorner(4, 4));
   std::cout << "m2 after copy:" << std::endl;
   std::cout << m2 << std::endl << std::endl;
 }
diff --git a/doc/examples/TemplateKeyword_simple.cpp b/doc/examples/TemplateKeyword_simple.cpp
index 6b946ad..4902988 100644
--- a/doc/examples/TemplateKeyword_simple.cpp
+++ b/doc/examples/TemplateKeyword_simple.cpp
@@ -3,15 +3,13 @@
 
 using Eigen::MatrixXf;
 
-void copyUpperTriangularPart(MatrixXf& dst, const MatrixXf& src)
-{
+void copyUpperTriangularPart(MatrixXf& dst, const MatrixXf& src) {
   dst.triangularView<Eigen::Upper>() = src.triangularView<Eigen::Upper>();
 }
 
-int main()
-{
-  MatrixXf m1 = MatrixXf::Ones(4,4);
-  MatrixXf m2 = MatrixXf::Random(4,4);
+int main() {
+  MatrixXf m1 = MatrixXf::Ones(4, 4);
+  MatrixXf m2 = MatrixXf::Random(4, 4);
   std::cout << "m2 before copy:" << std::endl;
   std::cout << m2 << std::endl << std::endl;
   copyUpperTriangularPart(m2, m1);
diff --git a/doc/examples/TutorialInplaceLU.cpp b/doc/examples/TutorialInplaceLU.cpp
index 72bead2..06f7e53 100644
--- a/doc/examples/TutorialInplaceLU.cpp
+++ b/doc/examples/TutorialInplaceLU.cpp
@@ -6,9 +6,8 @@
 // [init]
 #include <Eigen/Dense>
 
-int main()
-{
-  Eigen::MatrixXd A(2,2);
+int main() {
+  Eigen::MatrixXd A(2, 2);
   A << 2, -1, 1, 3;
   std::cout << "Here is the input matrix A before decomposition:\n" << A << "\n";
   std::cout << "[init]\n";
@@ -23,8 +22,10 @@
   std::cout << "[matrixLU]\n";
 
   std::cout << "[solve]\n";
-  Eigen::MatrixXd A0(2,2); A0 << 2, -1, 1, 3;
-  Eigen::VectorXd b(2);    b << 1, 2;
+  Eigen::MatrixXd A0(2, 2);
+  A0 << 2, -1, 1, 3;
+  Eigen::VectorXd b(2);
+  b << 1, 2;
   Eigen::VectorXd x = lu.solve(b);
   std::cout << "Residual: " << (A0 * x - b).norm() << "\n";
   std::cout << "[solve]\n";
@@ -36,15 +37,15 @@
   std::cout << "[modifyA]\n";
 
   std::cout << "[recompute]\n";
-  A0 = A; // save A
+  A0 = A;  // save A
   lu.compute(A);
   x = lu.solve(b);
   std::cout << "Residual: " << (A0 * x - b).norm() << "\n";
   std::cout << "[recompute]\n";
 
   std::cout << "[recompute_bis0]\n";
-  Eigen::MatrixXd A1(2,2);
-  A1 << 5,-2,3,4;
+  Eigen::MatrixXd A1(2, 2);
+  A1 << 5, -2, 3, 4;
   lu.compute(A1);
   std::cout << "Here is the input matrix A1 after decomposition:\n" << A1 << "\n";
   std::cout << "[recompute_bis0]\n";
@@ -53,5 +54,4 @@
   x = lu.solve(b);
   std::cout << "Residual: " << (A1 * x - b).norm() << "\n";
   std::cout << "[recompute_bis1]\n";
-
 }
diff --git a/doc/examples/TutorialLinAlgComputeTwice.cpp b/doc/examples/TutorialLinAlgComputeTwice.cpp
index a561f08..41ff22e 100644
--- a/doc/examples/TutorialLinAlgComputeTwice.cpp
+++ b/doc/examples/TutorialLinAlgComputeTwice.cpp
@@ -1,20 +1,19 @@
 #include <iostream>
 #include <Eigen/Dense>
 
-int main()
-{
-   Eigen::Matrix2f A, b;
-   Eigen::LLT<Eigen::Matrix2f> llt;
-   A << 2, -1, -1, 3;
-   b << 1, 2, 3, 1;
-   std::cout << "Here is the matrix A:\n" << A << std::endl;
-   std::cout << "Here is the right hand side b:\n" << b << std::endl;
-   std::cout << "Computing LLT decomposition..." << std::endl;
-   llt.compute(A);
-   std::cout << "The solution is:\n" << llt.solve(b) << std::endl;
-   A(1,1)++;
-   std::cout << "The matrix A is now:\n" << A << std::endl;
-   std::cout << "Computing LLT decomposition..." << std::endl;
-   llt.compute(A);
-   std::cout << "The solution is now:\n" << llt.solve(b) << std::endl;
+int main() {
+  Eigen::Matrix2f A, b;
+  Eigen::LLT<Eigen::Matrix2f> llt;
+  A << 2, -1, -1, 3;
+  b << 1, 2, 3, 1;
+  std::cout << "Here is the matrix A:\n" << A << std::endl;
+  std::cout << "Here is the right hand side b:\n" << b << std::endl;
+  std::cout << "Computing LLT decomposition..." << std::endl;
+  llt.compute(A);
+  std::cout << "The solution is:\n" << llt.solve(b) << std::endl;
+  A(1, 1)++;
+  std::cout << "The matrix A is now:\n" << A << std::endl;
+  std::cout << "Computing LLT decomposition..." << std::endl;
+  llt.compute(A);
+  std::cout << "The solution is now:\n" << llt.solve(b) << std::endl;
 }
diff --git a/doc/examples/TutorialLinAlgExComputeSolveError.cpp b/doc/examples/TutorialLinAlgExComputeSolveError.cpp
index 199f3f5..268aa35 100644
--- a/doc/examples/TutorialLinAlgExComputeSolveError.cpp
+++ b/doc/examples/TutorialLinAlgExComputeSolveError.cpp
@@ -3,11 +3,10 @@
 
 using Eigen::MatrixXd;
 
-int main()
-{
-   MatrixXd A = MatrixXd::Random(100,100);
-   MatrixXd b = MatrixXd::Random(100,50);
-   MatrixXd x = A.fullPivLu().solve(b);
-   double relative_error = (A*x - b).norm() / b.norm(); // norm() is L2 norm
-   std::cout << "The relative error is:\n" << relative_error << std::endl;
+int main() {
+  MatrixXd A = MatrixXd::Random(100, 100);
+  MatrixXd b = MatrixXd::Random(100, 50);
+  MatrixXd x = A.fullPivLu().solve(b);
+  double relative_error = (A * x - b).norm() / b.norm();  // norm() is L2 norm
+  std::cout << "The relative error is:\n" << relative_error << std::endl;
 }
diff --git a/doc/examples/TutorialLinAlgExSolveColPivHouseholderQR.cpp b/doc/examples/TutorialLinAlgExSolveColPivHouseholderQR.cpp
index 5ee6b6a..7caed4a 100644
--- a/doc/examples/TutorialLinAlgExSolveColPivHouseholderQR.cpp
+++ b/doc/examples/TutorialLinAlgExSolveColPivHouseholderQR.cpp
@@ -1,14 +1,13 @@
 #include <iostream>
 #include <Eigen/Dense>
 
-int main()
-{
-   Eigen::Matrix3f A;
-   Eigen::Vector3f b;
-   A << 1,2,3,  4,5,6,  7,8,10;
-   b << 3, 3, 4;
-   std::cout << "Here is the matrix A:\n" << A << std::endl;
-   std::cout << "Here is the vector b:\n" << b << std::endl;
-   Eigen::Vector3f x = A.colPivHouseholderQr().solve(b);
-   std::cout << "The solution is:\n" << x << std::endl;
+int main() {
+  Eigen::Matrix3f A;
+  Eigen::Vector3f b;
+  A << 1, 2, 3, 4, 5, 6, 7, 8, 10;
+  b << 3, 3, 4;
+  std::cout << "Here is the matrix A:\n" << A << std::endl;
+  std::cout << "Here is the vector b:\n" << b << std::endl;
+  Eigen::Vector3f x = A.colPivHouseholderQr().solve(b);
+  std::cout << "The solution is:\n" << x << std::endl;
 }
diff --git a/doc/examples/TutorialLinAlgExSolveLDLT.cpp b/doc/examples/TutorialLinAlgExSolveLDLT.cpp
index 82186d4..c11557d 100644
--- a/doc/examples/TutorialLinAlgExSolveLDLT.cpp
+++ b/doc/examples/TutorialLinAlgExSolveLDLT.cpp
@@ -1,13 +1,12 @@
 #include <iostream>
 #include <Eigen/Dense>
 
-int main()
-{
-   Eigen::Matrix2f A, b;
-   A << 2, -1, -1, 3;
-   b << 1, 2, 3, 1;
-   std::cout << "Here is the matrix A:\n" << A << std::endl;
-   std::cout << "Here is the right hand side b:\n" << b << std::endl;
-   Eigen::Matrix2f x = A.ldlt().solve(b);
-   std::cout << "The solution is:\n" << x << std::endl;
+int main() {
+  Eigen::Matrix2f A, b;
+  A << 2, -1, -1, 3;
+  b << 1, 2, 3, 1;
+  std::cout << "Here is the matrix A:\n" << A << std::endl;
+  std::cout << "Here is the right hand side b:\n" << b << std::endl;
+  Eigen::Matrix2f x = A.ldlt().solve(b);
+  std::cout << "The solution is:\n" << x << std::endl;
 }
diff --git a/doc/examples/TutorialLinAlgInverseDeterminant.cpp b/doc/examples/TutorialLinAlgInverseDeterminant.cpp
index b31a92a..c03fe5c 100644
--- a/doc/examples/TutorialLinAlgInverseDeterminant.cpp
+++ b/doc/examples/TutorialLinAlgInverseDeterminant.cpp
@@ -1,13 +1,10 @@
 #include <iostream>
 #include <Eigen/Dense>
 
-int main()
-{
-   Eigen::Matrix3f A;
-   A << 1, 2, 1,
-        2, 1, 0,
-        -1, 1, 2;
-   std::cout << "Here is the matrix A:\n" << A << std::endl;
-   std::cout << "The determinant of A is " << A.determinant() << std::endl;
-   std::cout << "The inverse of A is:\n" << A.inverse() << std::endl;
+int main() {
+  Eigen::Matrix3f A;
+  A << 1, 2, 1, 2, 1, 0, -1, 1, 2;
+  std::cout << "Here is the matrix A:\n" << A << std::endl;
+  std::cout << "The determinant of A is " << A.determinant() << std::endl;
+  std::cout << "The inverse of A is:\n" << A.inverse() << std::endl;
 }
diff --git a/doc/examples/TutorialLinAlgRankRevealing.cpp b/doc/examples/TutorialLinAlgRankRevealing.cpp
index fea52ab..1f89146 100644
--- a/doc/examples/TutorialLinAlgRankRevealing.cpp
+++ b/doc/examples/TutorialLinAlgRankRevealing.cpp
@@ -1,17 +1,14 @@
 #include <iostream>
 #include <Eigen/Dense>
 
-int main()
-{
-   Eigen::Matrix3f A;
-   A << 1, 2, 5,
-        2, 1, 4,
-        3, 0, 3;
-   std::cout << "Here is the matrix A:\n" << A << std::endl;
-   Eigen::FullPivLU<Eigen::Matrix3f> lu_decomp(A);
-   std::cout << "The rank of A is " << lu_decomp.rank() << std::endl;
-   std::cout << "Here is a matrix whose columns form a basis of the null-space of A:\n"
-        << lu_decomp.kernel() << std::endl;
-   std::cout << "Here is a matrix whose columns form a basis of the column-space of A:\n"
-        << lu_decomp.image(A) << std::endl; // yes, have to pass the original A
+int main() {
+  Eigen::Matrix3f A;
+  A << 1, 2, 5, 2, 1, 4, 3, 0, 3;
+  std::cout << "Here is the matrix A:\n" << A << std::endl;
+  Eigen::FullPivLU<Eigen::Matrix3f> lu_decomp(A);
+  std::cout << "The rank of A is " << lu_decomp.rank() << std::endl;
+  std::cout << "Here is a matrix whose columns form a basis of the null-space of A:\n"
+            << lu_decomp.kernel() << std::endl;
+  std::cout << "Here is a matrix whose columns form a basis of the column-space of A:\n"
+            << lu_decomp.image(A) << std::endl;  // yes, have to pass the original A
 }
diff --git a/doc/examples/TutorialLinAlgSVDSolve.cpp b/doc/examples/TutorialLinAlgSVDSolve.cpp
index 23ad422..3cee2b4 100644
--- a/doc/examples/TutorialLinAlgSVDSolve.cpp
+++ b/doc/examples/TutorialLinAlgSVDSolve.cpp
@@ -1,12 +1,11 @@
 #include <iostream>
 #include <Eigen/Dense>
 
-int main()
-{
-   Eigen::MatrixXf A = Eigen::MatrixXf::Random(3, 2);
-   std::cout << "Here is the matrix A:\n" << A << std::endl;
-   Eigen::VectorXf b = Eigen::VectorXf::Random(3);
-   std::cout << "Here is the right hand side b:\n" << b << std::endl;
-   std::cout << "The least-squares solution is:\n"
-        << A.bdcSvd(Eigen::ComputeThinU | Eigen::ComputeThinV).solve(b) << std::endl;
+int main() {
+  Eigen::MatrixXf A = Eigen::MatrixXf::Random(3, 2);
+  std::cout << "Here is the matrix A:\n" << A << std::endl;
+  Eigen::VectorXf b = Eigen::VectorXf::Random(3);
+  std::cout << "Here is the right hand side b:\n" << b << std::endl;
+  std::cout << "The least-squares solution is:\n"
+            << A.bdcSvd(Eigen::ComputeThinU | Eigen::ComputeThinV).solve(b) << std::endl;
 }
diff --git a/doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp b/doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp
index fcf2f33..6faccb6 100644
--- a/doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp
+++ b/doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp
@@ -1,15 +1,14 @@
 #include <iostream>
 #include <Eigen/Dense>
 
-int main()
-{
-   Eigen::Matrix2f A;
-   A << 1, 2, 2, 3;
-   std::cout << "Here is the matrix A:\n" << A << std::endl;
-   Eigen::SelfAdjointEigenSolver<Eigen::Matrix2f> eigensolver(A);
-   if (eigensolver.info() != Eigen::Success) abort();
-   std::cout << "The eigenvalues of A are:\n" << eigensolver.eigenvalues() << std::endl;
-   std::cout << "Here's a matrix whose columns are eigenvectors of A \n"
-        << "corresponding to these eigenvalues:\n"
-        << eigensolver.eigenvectors() << std::endl;
+int main() {
+  Eigen::Matrix2f A;
+  A << 1, 2, 2, 3;
+  std::cout << "Here is the matrix A:\n" << A << std::endl;
+  Eigen::SelfAdjointEigenSolver<Eigen::Matrix2f> eigensolver(A);
+  if (eigensolver.info() != Eigen::Success) abort();
+  std::cout << "The eigenvalues of A are:\n" << eigensolver.eigenvalues() << std::endl;
+  std::cout << "Here's a matrix whose columns are eigenvectors of A \n"
+            << "corresponding to these eigenvalues:\n"
+            << eigensolver.eigenvectors() << std::endl;
 }
diff --git a/doc/examples/TutorialLinAlgSetThreshold.cpp b/doc/examples/TutorialLinAlgSetThreshold.cpp
index e1335e7..97251f8 100644
--- a/doc/examples/TutorialLinAlgSetThreshold.cpp
+++ b/doc/examples/TutorialLinAlgSetThreshold.cpp
@@ -1,13 +1,11 @@
 #include <iostream>
 #include <Eigen/Dense>
 
-int main()
-{
-   Eigen::Matrix2d A;
-   A << 2, 1,
-        2, 0.9999999999;
-   Eigen::FullPivLU<Eigen::Matrix2d> lu(A);
-   std::cout << "By default, the rank of A is found to be " << lu.rank() << std::endl;
-   lu.setThreshold(1e-5);
-   std::cout << "With threshold 1e-5, the rank of A is found to be " << lu.rank() << std::endl;
+int main() {
+  Eigen::Matrix2d A;
+  A << 2, 1, 2, 0.9999999999;
+  Eigen::FullPivLU<Eigen::Matrix2d> lu(A);
+  std::cout << "By default, the rank of A is found to be " << lu.rank() << std::endl;
+  lu.setThreshold(1e-5);
+  std::cout << "With threshold 1e-5, the rank of A is found to be " << lu.rank() << std::endl;
 }
diff --git a/doc/examples/Tutorial_ArrayClass_accessors.cpp b/doc/examples/Tutorial_ArrayClass_accessors.cpp
index 0db52a3..5e91deb 100644
--- a/doc/examples/Tutorial_ArrayClass_accessors.cpp
+++ b/doc/examples/Tutorial_ArrayClass_accessors.cpp
@@ -1,21 +1,21 @@
 #include <Eigen/Dense>
 #include <iostream>
 
-int main()
-{
-  Eigen::ArrayXXf  m(2,2);
-  
+int main() {
+  Eigen::ArrayXXf m(2, 2);
+
   // assign some values coefficient by coefficient
-  m(0,0) = 1.0; m(0,1) = 2.0;
-  m(1,0) = 3.0; m(1,1) = m(0,1) + m(1,0);
-  
+  m(0, 0) = 1.0;
+  m(0, 1) = 2.0;
+  m(1, 0) = 3.0;
+  m(1, 1) = m(0, 1) + m(1, 0);
+
   // print values to standard output
   std::cout << m << std::endl << std::endl;
- 
+
   // using the comma-initializer is also allowed
-  m << 1.0,2.0,
-       3.0,4.0;
-     
+  m << 1.0, 2.0, 3.0, 4.0;
+
   // print values to standard output
   std::cout << m << std::endl;
 }
diff --git a/doc/examples/Tutorial_ArrayClass_addition.cpp b/doc/examples/Tutorial_ArrayClass_addition.cpp
index 4a407a7..e9a8f3e 100644
--- a/doc/examples/Tutorial_ArrayClass_addition.cpp
+++ b/doc/examples/Tutorial_ArrayClass_addition.cpp
@@ -1,17 +1,12 @@
 #include <Eigen/Dense>
 #include <iostream>
 
-int main()
-{
-  Eigen::ArrayXXf a(3,3);
-  Eigen::ArrayXXf b(3,3);
-  a << 1,2,3,
-       4,5,6,
-       7,8,9;
-  b << 1,2,3,
-       1,2,3,
-       1,2,3;
-       
+int main() {
+  Eigen::ArrayXXf a(3, 3);
+  Eigen::ArrayXXf b(3, 3);
+  a << 1, 2, 3, 4, 5, 6, 7, 8, 9;
+  b << 1, 2, 3, 1, 2, 3, 1, 2, 3;
+
   // Adding two arrays
   std::cout << "a + b = " << std::endl << a + b << std::endl << std::endl;
 
diff --git a/doc/examples/Tutorial_ArrayClass_cwise_other.cpp b/doc/examples/Tutorial_ArrayClass_cwise_other.cpp
index 12483f3..cbd3238 100644
--- a/doc/examples/Tutorial_ArrayClass_cwise_other.cpp
+++ b/doc/examples/Tutorial_ArrayClass_cwise_other.cpp
@@ -1,16 +1,11 @@
 #include <Eigen/Dense>
 #include <iostream>
 
-int main()
-{
+int main() {
   Eigen::ArrayXf a = Eigen::ArrayXf::Random(5);
   a *= 2;
-  std::cout << "a =" << std::endl
-            << a << std::endl;
-  std::cout << "a.abs() =" << std::endl
-            << a.abs() << std::endl;
-  std::cout << "a.abs().sqrt() =" << std::endl
-            << a.abs().sqrt() << std::endl;
-  std::cout << "a.min(a.abs().sqrt()) =" << std::endl
-            << a.min(a.abs().sqrt()) << std::endl;
+  std::cout << "a =" << std::endl << a << std::endl;
+  std::cout << "a.abs() =" << std::endl << a.abs() << std::endl;
+  std::cout << "a.abs().sqrt() =" << std::endl << a.abs().sqrt() << std::endl;
+  std::cout << "a.min(a.abs().sqrt()) =" << std::endl << a.min(a.abs().sqrt()) << std::endl;
 }
diff --git a/doc/examples/Tutorial_ArrayClass_interop.cpp b/doc/examples/Tutorial_ArrayClass_interop.cpp
index c9a8352..9b02f2a 100644
--- a/doc/examples/Tutorial_ArrayClass_interop.cpp
+++ b/doc/examples/Tutorial_ArrayClass_interop.cpp
@@ -3,17 +3,14 @@
 
 using Eigen::MatrixXf;
 
-int main()
-{
-  MatrixXf m(2,2);
-  MatrixXf n(2,2);
-  MatrixXf result(2,2);
+int main() {
+  MatrixXf m(2, 2);
+  MatrixXf n(2, 2);
+  MatrixXf result(2, 2);
 
-  m << 1,2,
-       3,4;
-  n << 5,6,
-       7,8;
-  
+  m << 1, 2, 3, 4;
+  n << 5, 6, 7, 8;
+
   result = (m.array() + 4).matrix() * m;
   std::cout << "-- Combination 1: --\n" << result << "\n\n";
   result = (m.array() * n.array()).matrix() * m;
diff --git a/doc/examples/Tutorial_ArrayClass_interop_matrix.cpp b/doc/examples/Tutorial_ArrayClass_interop_matrix.cpp
index 07ec9b0..b5bc6ae 100644
--- a/doc/examples/Tutorial_ArrayClass_interop_matrix.cpp
+++ b/doc/examples/Tutorial_ArrayClass_interop_matrix.cpp
@@ -3,16 +3,13 @@
 
 using Eigen::MatrixXf;
 
-int main()
-{
-  MatrixXf m(2,2);
-  MatrixXf n(2,2);
-  MatrixXf result(2,2);
+int main() {
+  MatrixXf m(2, 2);
+  MatrixXf n(2, 2);
+  MatrixXf result(2, 2);
 
-  m << 1,2,
-       3,4;
-  n << 5,6,
-       7,8;
+  m << 1, 2, 3, 4;
+  n << 5, 6, 7, 8;
 
   result = m * n;
   std::cout << "-- Matrix m*n: --\n" << result << "\n\n";
diff --git a/doc/examples/Tutorial_ArrayClass_mult.cpp b/doc/examples/Tutorial_ArrayClass_mult.cpp
index bada36c..39c2300 100644
--- a/doc/examples/Tutorial_ArrayClass_mult.cpp
+++ b/doc/examples/Tutorial_ArrayClass_mult.cpp
@@ -1,13 +1,10 @@
 #include <Eigen/Dense>
 #include <iostream>
 
-int main()
-{
-  Eigen::ArrayXXf a(2,2);
-  Eigen::ArrayXXf b(2,2);
-  a << 1,2,
-       3,4;
-  b << 5,6,
-       7,8;
+int main() {
+  Eigen::ArrayXXf a(2, 2);
+  Eigen::ArrayXXf b(2, 2);
+  a << 1, 2, 3, 4;
+  b << 5, 6, 7, 8;
   std::cout << "a * b = " << std::endl << a * b << std::endl;
 }
diff --git a/doc/examples/Tutorial_BlockOperations_block_assignment.cpp b/doc/examples/Tutorial_BlockOperations_block_assignment.cpp
index 26ad478..27b88b3 100644
--- a/doc/examples/Tutorial_BlockOperations_block_assignment.cpp
+++ b/doc/examples/Tutorial_BlockOperations_block_assignment.cpp
@@ -1,15 +1,13 @@
 #include <Eigen/Dense>
 #include <iostream>
 
-int main()
-{
+int main() {
   Eigen::Array22f m;
-  m << 1,2,
-       3,4;
+  m << 1, 2, 3, 4;
   Eigen::Array44f a = Eigen::Array44f::Constant(0.6);
   std::cout << "Here is the array a:\n" << a << "\n\n";
-  a.block<2,2>(1,1) = m;
+  a.block<2, 2>(1, 1) = m;
   std::cout << "Here is now a with m copied into its central 2x2 block:\n" << a << "\n\n";
-  a.block(0,0,2,3) = a.block(2,1,2,3);
+  a.block(0, 0, 2, 3) = a.block(2, 1, 2, 3);
   std::cout << "Here is now a with bottom-right 2x3 block copied into top-left 2x3 block:\n" << a << "\n\n";
 }
diff --git a/doc/examples/Tutorial_BlockOperations_colrow.cpp b/doc/examples/Tutorial_BlockOperations_colrow.cpp
index 2e7eb00..b236334 100644
--- a/doc/examples/Tutorial_BlockOperations_colrow.cpp
+++ b/doc/examples/Tutorial_BlockOperations_colrow.cpp
@@ -3,12 +3,9 @@
 
 using namespace std;
 
-int main()
-{
-  Eigen::MatrixXf m(3,3);
-  m << 1,2,3,
-       4,5,6,
-       7,8,9;
+int main() {
+  Eigen::MatrixXf m(3, 3);
+  m << 1, 2, 3, 4, 5, 6, 7, 8, 9;
   cout << "Here is the matrix m:" << endl << m << endl;
   cout << "2nd Row: " << m.row(1) << endl;
   m.col(2) += 3 * m.col(0);
diff --git a/doc/examples/Tutorial_BlockOperations_corner.cpp b/doc/examples/Tutorial_BlockOperations_corner.cpp
index 3a31507..cd093fc 100644
--- a/doc/examples/Tutorial_BlockOperations_corner.cpp
+++ b/doc/examples/Tutorial_BlockOperations_corner.cpp
@@ -3,15 +3,11 @@
 
 using namespace std;
 
-int main()
-{
+int main() {
   Eigen::Matrix4f m;
-  m << 1, 2, 3, 4,
-       5, 6, 7, 8,
-       9, 10,11,12,
-       13,14,15,16;
+  m << 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16;
   cout << "m.leftCols(2) =" << endl << m.leftCols(2) << endl << endl;
   cout << "m.bottomRows<2>() =" << endl << m.bottomRows<2>() << endl << endl;
-  m.topLeftCorner(1,3) = m.bottomRightCorner(3,1).transpose();
+  m.topLeftCorner(1, 3) = m.bottomRightCorner(3, 1).transpose();
   cout << "After assignment, m = " << endl << m << endl;
 }
diff --git a/doc/examples/Tutorial_BlockOperations_print_block.cpp b/doc/examples/Tutorial_BlockOperations_print_block.cpp
index edea4ae..7c65ddb 100644
--- a/doc/examples/Tutorial_BlockOperations_print_block.cpp
+++ b/doc/examples/Tutorial_BlockOperations_print_block.cpp
@@ -3,18 +3,13 @@
 
 using namespace std;
 
-int main()
-{
-  Eigen::MatrixXf m(4,4);
-  m <<  1, 2, 3, 4,
-        5, 6, 7, 8,
-        9,10,11,12,
-       13,14,15,16;
+int main() {
+  Eigen::MatrixXf m(4, 4);
+  m << 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16;
   cout << "Block in the middle" << endl;
-  cout << m.block<2,2>(1,1) << endl << endl;
-  for (int i = 1; i <= 3; ++i)
-  {
+  cout << m.block<2, 2>(1, 1) << endl << endl;
+  for (int i = 1; i <= 3; ++i) {
     cout << "Block of size " << i << "x" << i << endl;
-    cout << m.block(0,0,i,i) << endl << endl;
+    cout << m.block(0, 0, i, i) << endl << endl;
   }
 }
diff --git a/doc/examples/Tutorial_BlockOperations_vector.cpp b/doc/examples/Tutorial_BlockOperations_vector.cpp
index 4a0b023..0ce2b0b 100644
--- a/doc/examples/Tutorial_BlockOperations_vector.cpp
+++ b/doc/examples/Tutorial_BlockOperations_vector.cpp
@@ -3,12 +3,11 @@
 
 using namespace std;
 
-int main()
-{
+int main() {
   Eigen::ArrayXf v(6);
   v << 1, 2, 3, 4, 5, 6;
   cout << "v.head(3) =" << endl << v.head(3) << endl << endl;
   cout << "v.tail<3>() = " << endl << v.tail<3>() << endl << endl;
-  v.segment(1,4) *= 2;
+  v.segment(1, 4) *= 2;
   cout << "after 'v.segment(1,4) *= 2', v =" << endl << v << endl;
 }
diff --git a/doc/examples/Tutorial_PartialLU_solve.cpp b/doc/examples/Tutorial_PartialLU_solve.cpp
index ca72c99..bfc0973 100644
--- a/doc/examples/Tutorial_PartialLU_solve.cpp
+++ b/doc/examples/Tutorial_PartialLU_solve.cpp
@@ -2,14 +2,13 @@
 #include <Eigen/LU>
 #include <iostream>
 
-int main()
-{
-   Eigen::Matrix3f A;
-   Eigen::Vector3f b;
-   A << 1,2,3,  4,5,6,  7,8,10;
-   b << 3, 3, 4;
-   std::cout << "Here is the matrix A:" << std::endl << A << std::endl;
-   std::cout << "Here is the vector b:" << std::endl << b << std::endl;
-   Eigen::Vector3f x = A.lu().solve(b);
-   std::cout << "The solution is:" << std::endl << x << std::endl;
+int main() {
+  Eigen::Matrix3f A;
+  Eigen::Vector3f b;
+  A << 1, 2, 3, 4, 5, 6, 7, 8, 10;
+  b << 3, 3, 4;
+  std::cout << "Here is the matrix A:" << std::endl << A << std::endl;
+  std::cout << "Here is the vector b:" << std::endl << b << std::endl;
+  Eigen::Vector3f x = A.lu().solve(b);
+  std::cout << "The solution is:" << std::endl << x << std::endl;
 }
diff --git a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.cpp b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.cpp
index 8ef06be..61ab75f 100644
--- a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.cpp
+++ b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.cpp
@@ -1,16 +1,13 @@
 #include <iostream>
 #include <Eigen/Dense>
 
-int main()
-{
-  Eigen::MatrixXf m(2,4);
+int main() {
+  Eigen::MatrixXf m(2, 4);
   Eigen::VectorXf v(2);
-  
-  m << 1, 23, 6, 9,
-       3, 11, 7, 2;
-       
-  v << 2,
-       3;
+
+  m << 1, 23, 6, 9, 3, 11, 7, 2;
+
+  v << 2, 3;
 
   Eigen::Index index;
   // find nearest neighbour
diff --git a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.cpp b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.cpp
index e6c87c6..63ee724 100644
--- a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.cpp
+++ b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.cpp
@@ -2,20 +2,17 @@
 #include <Eigen/Dense>
 
 using namespace std;
-int main()
-{
-  Eigen::MatrixXf mat(2,4);
+int main() {
+  Eigen::MatrixXf mat(2, 4);
   Eigen::VectorXf v(2);
-  
-  mat << 1, 2, 6, 9,
-         3, 1, 7, 2;
-         
-  v << 0,
-       1;
-       
-  //add v to each column of m
+
+  mat << 1, 2, 6, 9, 3, 1, 7, 2;
+
+  v << 0, 1;
+
+  // add v to each column of m
   mat.colwise() += v;
-  
+
   std::cout << "Broadcasting result: " << std::endl;
   std::cout << mat << std::endl;
 }
diff --git a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.cpp b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.cpp
index d87c96a..1f937ad 100644
--- a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.cpp
+++ b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.cpp
@@ -2,19 +2,17 @@
 #include <Eigen/Dense>
 
 using namespace std;
-int main()
-{
-  Eigen::MatrixXf mat(2,4);
+int main() {
+  Eigen::MatrixXf mat(2, 4);
   Eigen::VectorXf v(4);
-  
-  mat << 1, 2, 6, 9,
-         3, 1, 7, 2;
-         
-  v << 0,1,2,3;
-       
-  //add v to each row of m
+
+  mat << 1, 2, 6, 9, 3, 1, 7, 2;
+
+  v << 0, 1, 2, 3;
+
+  // add v to each row of m
   mat.rowwise() += v.transpose();
-  
+
   std::cout << "Broadcasting result: " << std::endl;
   std::cout << mat << std::endl;
 }
diff --git a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_colwise.cpp b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_colwise.cpp
index df68256..f40184b 100644
--- a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_colwise.cpp
+++ b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_colwise.cpp
@@ -2,12 +2,9 @@
 #include <Eigen/Dense>
 
 using namespace std;
-int main()
-{
-  Eigen::MatrixXf mat(2,4);
-  mat << 1, 2, 6, 9,
-         3, 1, 7, 2;
-  
-  std::cout << "Column's maximum: " << std::endl
-   << mat.colwise().maxCoeff() << std::endl;
+int main() {
+  Eigen::MatrixXf mat(2, 4);
+  mat << 1, 2, 6, 9, 3, 1, 7, 2;
+
+  std::cout << "Column's maximum: " << std::endl << mat.colwise().maxCoeff() << std::endl;
 }
diff --git a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp
index b5d88c3..88e319d 100644
--- a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp
+++ b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp
@@ -1,18 +1,16 @@
 #include <iostream>
 #include <Eigen/Dense>
 
-int main()
-{
-  Eigen::MatrixXf mat(2,4);
-  mat << 1, 2, 6, 9,
-         3, 1, 7, 2;
-  
-  Eigen::Index   maxIndex;
+int main() {
+  Eigen::MatrixXf mat(2, 4);
+  mat << 1, 2, 6, 9, 3, 1, 7, 2;
+
+  Eigen::Index maxIndex;
   float maxNorm = mat.colwise().sum().maxCoeff(&maxIndex);
-  
+
   std::cout << "Maximum sum at position " << maxIndex << std::endl;
 
   std::cout << "The corresponding vector is: " << std::endl;
-  std::cout << mat.col( maxIndex ) << std::endl;
+  std::cout << mat.col(maxIndex) << std::endl;
   std::cout << "And its sum is is: " << maxNorm << std::endl;
 }
diff --git a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp
index 7b89bcf..71f2030 100644
--- a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp
+++ b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp
@@ -1,12 +1,10 @@
 #include <Eigen/Dense>
 #include <iostream>
 
-int main()
-{
-  Eigen::ArrayXXf a(2,2);
-  
-  a << 1,2,
-       3,4;
+int main() {
+  Eigen::ArrayXXf a(2, 2);
+
+  a << 1, 2, 3, 4;
 
   std::cout << "(a > 0).all()   = " << (a > 0).all() << std::endl;
   std::cout << "(a > 0).any()   = " << (a > 0).any() << std::endl;
diff --git a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.cpp b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.cpp
index 7519137..75bfee0 100644
--- a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.cpp
+++ b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.cpp
@@ -1,16 +1,13 @@
 #include <Eigen/Dense>
 #include <iostream>
 
-int main()
-{
+int main() {
   Eigen::VectorXf v(2);
-  Eigen::MatrixXf m(2,2), n(2,2);
-  
-  v << -1,
-       2;
-  
-  m << 1,-2,
-       -3,4;
+  Eigen::MatrixXf m(2, 2), n(2, 2);
+
+  v << -1, 2;
+
+  m << 1, -2, -3, 4;
 
   std::cout << "v.squaredNorm() = " << v.squaredNorm() << std::endl;
   std::cout << "v.norm() = " << v.norm() << std::endl;
diff --git a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_operatornorm.cpp b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_operatornorm.cpp
index 8faa5a1..695f538 100644
--- a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_operatornorm.cpp
+++ b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_operatornorm.cpp
@@ -1,15 +1,13 @@
 #include <Eigen/Dense>
 #include <iostream>
 
-int main()
-{
-  Eigen::MatrixXf m(2,2);
-  m << 1,-2,
-       -3,4;
+int main() {
+  Eigen::MatrixXf m(2, 2);
+  m << 1, -2, -3, 4;
 
   std::cout << "1-norm(m)     = " << m.cwiseAbs().colwise().sum().maxCoeff()
-            << " == "             << m.colwise().lpNorm<1>().maxCoeff() << std::endl;
+            << " == " << m.colwise().lpNorm<1>().maxCoeff() << std::endl;
 
   std::cout << "infty-norm(m) = " << m.cwiseAbs().rowwise().sum().maxCoeff()
-            << " == "             << m.rowwise().lpNorm<1>().maxCoeff() << std::endl;
+            << " == " << m.rowwise().lpNorm<1>().maxCoeff() << std::endl;
 }
diff --git a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_rowwise.cpp b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_rowwise.cpp
index 80427c9..b525b2a 100644
--- a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_rowwise.cpp
+++ b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_rowwise.cpp
@@ -2,12 +2,9 @@
 #include <Eigen/Dense>
 
 using namespace std;
-int main()
-{
-  Eigen::MatrixXf mat(2,4);
-  mat << 1, 2, 6, 9,
-         3, 1, 7, 2;
-  
-  std::cout << "Row's maximum: " << std::endl
-   << mat.rowwise().maxCoeff() << std::endl;
+int main() {
+  Eigen::MatrixXf mat(2, 4);
+  mat << 1, 2, 6, 9, 3, 1, 7, 2;
+
+  std::cout << "Row's maximum: " << std::endl << mat.rowwise().maxCoeff() << std::endl;
 }
diff --git a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_visitors.cpp b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_visitors.cpp
index bd294bd..ce3ca7e 100644
--- a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_visitors.cpp
+++ b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_visitors.cpp
@@ -1,23 +1,19 @@
 #include <iostream>
 #include <Eigen/Dense>
 
-int main()
-{
-  Eigen::MatrixXf m(2,2);
-  
-  m << 1, 2,
-       3, 4;
+int main() {
+  Eigen::MatrixXf m(2, 2);
 
-  //get location of maximum
+  m << 1, 2, 3, 4;
+
+  // get location of maximum
   Eigen::Index maxRow, maxCol;
   float max = m.maxCoeff(&maxRow, &maxCol);
 
-  //get location of minimum
+  // get location of minimum
   Eigen::Index minRow, minCol;
   float min = m.minCoeff(&minRow, &minCol);
 
-  std::cout << "Max: " << max <<  ", at: " <<
-     maxRow << "," << maxCol << std::endl;
-  std:: cout << "Min: " << min << ", at: " <<
-     minRow << "," << minCol << std::endl;
+  std::cout << "Max: " << max << ", at: " << maxRow << "," << maxCol << std::endl;
+  std::cout << "Min: " << min << ", at: " << minRow << "," << minCol << std::endl;
 }
diff --git a/doc/examples/Tutorial_simple_example_dynamic_size.cpp b/doc/examples/Tutorial_simple_example_dynamic_size.cpp
index 796bd87..102223f 100644
--- a/doc/examples/Tutorial_simple_example_dynamic_size.cpp
+++ b/doc/examples/Tutorial_simple_example_dynamic_size.cpp
@@ -1,20 +1,21 @@
 #include <Eigen/Core>
 #include <iostream>
 
-int main()
-{
-  for (int size=1; size<=4; ++size)
-  {
-    Eigen::MatrixXi m(size,size+1);         // a (size)x(size+1)-matrix of int's
-    for (int j=0; j<m.cols(); ++j)   // loop over columns
-      for (int i=0; i<m.rows(); ++i) // loop over rows
-        m(i,j) = i+j*size;           // to access matrix coefficients,
-                                     // use operator()(int,int)
+int main() {
+  for (int size = 1; size <= 4; ++size) {
+    Eigen::MatrixXi m(size, size + 1);    // a (size)x(size+1)-matrix of int's
+    for (int j = 0; j < m.cols(); ++j)    // loop over columns
+      for (int i = 0; i < m.rows(); ++i)  // loop over rows
+        m(i, j) = i + j * size;           // to access matrix coefficients,
+                                          // use operator()(int,int)
     std::cout << m << "\n\n";
   }
 
-  Eigen::VectorXf v(4); // a vector of 4 float's
+  Eigen::VectorXf v(4);  // a vector of 4 float's
   // to access vector coefficients, use either operator () or operator []
-  v[0] = 1; v[1] = 2; v(2) = 3; v(3) = 4;
+  v[0] = 1;
+  v[1] = 2;
+  v(2) = 3;
+  v(3) = 4;
   std::cout << "\nv:\n" << v << std::endl;
 }
diff --git a/doc/examples/Tutorial_simple_example_fixed_size.cpp b/doc/examples/Tutorial_simple_example_fixed_size.cpp
index 99a974d..8e20230 100644
--- a/doc/examples/Tutorial_simple_example_fixed_size.cpp
+++ b/doc/examples/Tutorial_simple_example_fixed_size.cpp
@@ -1,13 +1,11 @@
 #include <Eigen/Core>
 #include <iostream>
 
-int main()
-{
+int main() {
   Eigen::Matrix3f m3;
   m3 << 1, 2, 3, 4, 5, 6, 7, 8, 9;
   Eigen::Matrix4f m4 = Eigen::Matrix4f::Identity();
   Eigen::Vector4i v4(1, 2, 3, 4);
 
-  std::cout << "m3\n" << m3 << "\nm4:\n"
-    << m4 << "\nv4:\n" << v4 << std::endl;
+  std::cout << "m3\n" << m3 << "\nm4:\n" << m4 << "\nv4:\n" << v4 << std::endl;
 }
diff --git a/doc/examples/class_Block.cpp b/doc/examples/class_Block.cpp
index 9ace0da..0fb9202 100644
--- a/doc/examples/class_Block.cpp
+++ b/doc/examples/class_Block.cpp
@@ -1,25 +1,20 @@
 #include <Eigen/Core>
 #include <iostream>
 
-template<typename Derived>
-Eigen::Block<Derived>
-topLeftCorner(Eigen::MatrixBase<Derived>& m, int rows, int cols)
-{
+template <typename Derived>
+Eigen::Block<Derived> topLeftCorner(Eigen::MatrixBase<Derived>& m, int rows, int cols) {
   return Eigen::Block<Derived>(m.derived(), 0, 0, rows, cols);
 }
 
-template<typename Derived>
-const Eigen::Block<const Derived>
-topLeftCorner(const Eigen::MatrixBase<Derived>& m, int rows, int cols)
-{
+template <typename Derived>
+const Eigen::Block<const Derived> topLeftCorner(const Eigen::MatrixBase<Derived>& m, int rows, int cols) {
   return Eigen::Block<const Derived>(m.derived(), 0, 0, rows, cols);
 }
 
-int main(int, char**)
-{
+int main(int, char**) {
   Eigen::Matrix4d m = Eigen::Matrix4d::Identity();
-  std::cout << topLeftCorner(4*m, 2, 3) << std::endl; // calls the const version
-  topLeftCorner(m, 2, 3) *= 5;              // calls the non-const version
+  std::cout << topLeftCorner(4 * m, 2, 3) << std::endl;  // calls the const version
+  topLeftCorner(m, 2, 3) *= 5;                           // calls the non-const version
   std::cout << "Now the matrix m is:" << std::endl << m << std::endl;
   return 0;
 }
diff --git a/doc/examples/class_CwiseBinaryOp.cpp b/doc/examples/class_CwiseBinaryOp.cpp
index 973befd..f8c1f92 100644
--- a/doc/examples/class_CwiseBinaryOp.cpp
+++ b/doc/examples/class_CwiseBinaryOp.cpp
@@ -4,13 +4,13 @@
 using Eigen::Matrix4d;
 
 // define a custom template binary functor
-template<typename Scalar> struct MakeComplexOp {
+template <typename Scalar>
+struct MakeComplexOp {
   typedef std::complex<Scalar> result_type;
-  result_type operator()(const Scalar& a, const Scalar& b) const { return result_type(a,b); }
+  result_type operator()(const Scalar& a, const Scalar& b) const { return result_type(a, b); }
 };
 
-int main(int, char**)
-{
+int main(int, char**) {
   Matrix4d m1 = Matrix4d::Random(), m2 = Matrix4d::Random();
   std::cout << m1.binaryExpr(m2, MakeComplexOp<double>()) << std::endl;
   return 0;
diff --git a/doc/examples/class_CwiseUnaryOp.cpp b/doc/examples/class_CwiseUnaryOp.cpp
index 6c65f2e..24177ce 100644
--- a/doc/examples/class_CwiseUnaryOp.cpp
+++ b/doc/examples/class_CwiseUnaryOp.cpp
@@ -2,16 +2,17 @@
 #include <iostream>
 
 // define a custom template unary functor
-template<typename Scalar>
+template <typename Scalar>
 struct CwiseClampOp {
   CwiseClampOp(const Scalar& inf, const Scalar& sup) : m_inf(inf), m_sup(sup) {}
-  const Scalar operator()(const Scalar& x) const { return x<m_inf ? m_inf : (x>m_sup ? m_sup : x); }
+  const Scalar operator()(const Scalar& x) const { return x < m_inf ? m_inf : (x > m_sup ? m_sup : x); }
   Scalar m_inf, m_sup;
 };
 
-int main(int, char**)
-{
+int main(int, char**) {
   Eigen::Matrix4d m1 = Eigen::Matrix4d::Random();
-  std::cout << m1 << std::endl << "becomes: " << std::endl << m1.unaryExpr(CwiseClampOp<double>(-0.5,0.5)) << std::endl;
+  std::cout << m1 << std::endl
+            << "becomes: " << std::endl
+            << m1.unaryExpr(CwiseClampOp<double>(-0.5, 0.5)) << std::endl;
   return 0;
 }
diff --git a/doc/examples/class_CwiseUnaryOp_ptrfun.cpp b/doc/examples/class_CwiseUnaryOp_ptrfun.cpp
index e97095e..279355c 100644
--- a/doc/examples/class_CwiseUnaryOp_ptrfun.cpp
+++ b/doc/examples/class_CwiseUnaryOp_ptrfun.cpp
@@ -2,16 +2,14 @@
 #include <iostream>
 
 // define function to be applied coefficient-wise
-double ramp(double x)
-{
+double ramp(double x) {
   if (x > 0)
     return x;
-  else 
+  else
     return 0;
 }
 
-int main(int, char**)
-{
+int main(int, char**) {
   Eigen::Matrix4d m1 = Eigen::Matrix4d::Random();
   std::cout << m1 << std::endl << "becomes: " << std::endl << m1.unaryExpr(std::ptr_fun(ramp)) << std::endl;
   return 0;
diff --git a/doc/examples/class_FixedBlock.cpp b/doc/examples/class_FixedBlock.cpp
index 4bb2d44..875e779 100644
--- a/doc/examples/class_FixedBlock.cpp
+++ b/doc/examples/class_FixedBlock.cpp
@@ -1,25 +1,20 @@
 #include <Eigen/Core>
 #include <iostream>
 
-template<typename Derived>
-Eigen::Block<Derived, 2, 2>
-topLeft2x2Corner(Eigen::MatrixBase<Derived>& m)
-{
+template <typename Derived>
+Eigen::Block<Derived, 2, 2> topLeft2x2Corner(Eigen::MatrixBase<Derived>& m) {
   return Eigen::Block<Derived, 2, 2>(m.derived(), 0, 0);
 }
 
-template<typename Derived>
-const Eigen::Block<const Derived, 2, 2>
-topLeft2x2Corner(const Eigen::MatrixBase<Derived>& m)
-{
+template <typename Derived>
+const Eigen::Block<const Derived, 2, 2> topLeft2x2Corner(const Eigen::MatrixBase<Derived>& m) {
   return Eigen::Block<const Derived, 2, 2>(m.derived(), 0, 0);
 }
 
-int main(int, char**)
-{
+int main(int, char**) {
   Eigen::Matrix3d m = Eigen::Matrix3d::Identity();
-  std::cout << topLeft2x2Corner(4*m) << std::endl; // calls the const version
-  topLeft2x2Corner(m) *= 2;              // calls the non-const version
+  std::cout << topLeft2x2Corner(4 * m) << std::endl;  // calls the const version
+  topLeft2x2Corner(m) *= 2;                           // calls the non-const version
   std::cout << "Now the matrix m is:" << std::endl << m << std::endl;
   return 0;
 }
diff --git a/doc/examples/class_FixedReshaped.cpp b/doc/examples/class_FixedReshaped.cpp
index be7069d..29a04f6 100644
--- a/doc/examples/class_FixedReshaped.cpp
+++ b/doc/examples/class_FixedReshaped.cpp
@@ -1,18 +1,14 @@
 #include <Eigen/Core>
 #include <iostream>
 
-template<typename Derived>
-Eigen::Reshaped<Derived, 4, 2>
-reshape_helper(Eigen::MatrixBase<Derived>& m)
-{
+template <typename Derived>
+Eigen::Reshaped<Derived, 4, 2> reshape_helper(Eigen::MatrixBase<Derived>& m) {
   return Eigen::Reshaped<Derived, 4, 2>(m.derived());
 }
 
-int main(int, char**)
-{
+int main(int, char**) {
   Eigen::MatrixXd m(2, 4);
-  m << 1, 2, 3, 4,
-       5, 6, 7, 8;
+  m << 1, 2, 3, 4, 5, 6, 7, 8;
   Eigen::MatrixXd n = reshape_helper(m);
   std::cout << "matrix m is:" << std::endl << m << std::endl;
   std::cout << "matrix n is:" << std::endl << n << std::endl;
diff --git a/doc/examples/class_FixedVectorBlock.cpp b/doc/examples/class_FixedVectorBlock.cpp
index eed3007..cee8ac8 100644
--- a/doc/examples/class_FixedVectorBlock.cpp
+++ b/doc/examples/class_FixedVectorBlock.cpp
@@ -1,25 +1,21 @@
 #include <Eigen/Core>
 #include <iostream>
 
-template<typename Derived>
-Eigen::VectorBlock<Derived, 2>
-firstTwo(Eigen::MatrixBase<Derived>& v)
-{
+template <typename Derived>
+Eigen::VectorBlock<Derived, 2> firstTwo(Eigen::MatrixBase<Derived>& v) {
   return Eigen::VectorBlock<Derived, 2>(v.derived(), 0);
 }
 
-template<typename Derived>
-const Eigen::VectorBlock<const Derived, 2>
-firstTwo(const Eigen::MatrixBase<Derived>& v)
-{
+template <typename Derived>
+const Eigen::VectorBlock<const Derived, 2> firstTwo(const Eigen::MatrixBase<Derived>& v) {
   return Eigen::VectorBlock<const Derived, 2>(v.derived(), 0);
 }
 
-int main(int, char**)
-{
-  Eigen::Matrix<int,1,6> v; v << 1,2,3,4,5,6;
-  std::cout << firstTwo(4*v) << std::endl; // calls the const version
-  firstTwo(v) *= 2;              // calls the non-const version
+int main(int, char**) {
+  Eigen::Matrix<int, 1, 6> v;
+  v << 1, 2, 3, 4, 5, 6;
+  std::cout << firstTwo(4 * v) << std::endl;  // calls the const version
+  firstTwo(v) *= 2;                           // calls the non-const version
   std::cout << "Now the vector v is:" << std::endl << v << std::endl;
   return 0;
 }
diff --git a/doc/examples/class_Reshaped.cpp b/doc/examples/class_Reshaped.cpp
index 7219853..a91c3ff 100644
--- a/doc/examples/class_Reshaped.cpp
+++ b/doc/examples/class_Reshaped.cpp
@@ -1,19 +1,14 @@
 #include <Eigen/Core>
 #include <iostream>
 
-template<typename Derived>
-const Eigen::Reshaped<const Derived>
-reshape_helper(const Eigen::MatrixBase<Derived>& m, int rows, int cols)
-{
+template <typename Derived>
+const Eigen::Reshaped<const Derived> reshape_helper(const Eigen::MatrixBase<Derived>& m, int rows, int cols) {
   return Eigen::Reshaped<const Derived>(m.derived(), rows, cols);
 }
 
-int main(int, char**)
-{
+int main(int, char**) {
   Eigen::MatrixXd m(3, 4);
-  m << 1, 4, 7, 10,
-       2, 5, 8, 11,
-       3, 6, 9, 12;
+  m << 1, 4, 7, 10, 2, 5, 8, 11, 3, 6, 9, 12;
   std::cout << m << std::endl;
   Eigen::Ref<const Eigen::MatrixXd> n = reshape_helper(m, 2, 6);
   std::cout << "Matrix m is:" << std::endl << m << std::endl;
diff --git a/doc/examples/class_VectorBlock.cpp b/doc/examples/class_VectorBlock.cpp
index 5cee147..d427fa7 100644
--- a/doc/examples/class_VectorBlock.cpp
+++ b/doc/examples/class_VectorBlock.cpp
@@ -1,25 +1,21 @@
 #include <Eigen/Core>
 #include <iostream>
 
-template<typename Derived>
-Eigen::VectorBlock<Derived>
-segmentFromRange(Eigen::MatrixBase<Derived>& v, int start, int end)
-{
-  return Eigen::VectorBlock<Derived>(v.derived(), start, end-start);
+template <typename Derived>
+Eigen::VectorBlock<Derived> segmentFromRange(Eigen::MatrixBase<Derived>& v, int start, int end) {
+  return Eigen::VectorBlock<Derived>(v.derived(), start, end - start);
 }
 
-template<typename Derived>
-const Eigen::VectorBlock<const Derived>
-segmentFromRange(const Eigen::MatrixBase<Derived>& v, int start, int end)
-{
-  return Eigen::VectorBlock<const Derived>(v.derived(), start, end-start);
+template <typename Derived>
+const Eigen::VectorBlock<const Derived> segmentFromRange(const Eigen::MatrixBase<Derived>& v, int start, int end) {
+  return Eigen::VectorBlock<const Derived>(v.derived(), start, end - start);
 }
 
-int main(int, char**)
-{
-  Eigen::Matrix<int,1,6> v; v << 1,2,3,4,5,6;
-  std::cout << segmentFromRange(2*v, 2, 4) << std::endl; // calls the const version
-  segmentFromRange(v, 1, 3) *= 5;              // calls the non-const version
+int main(int, char**) {
+  Eigen::Matrix<int, 1, 6> v;
+  v << 1, 2, 3, 4, 5, 6;
+  std::cout << segmentFromRange(2 * v, 2, 4) << std::endl;  // calls the const version
+  segmentFromRange(v, 1, 3) *= 5;                           // calls the non-const version
   std::cout << "Now the vector v is:" << std::endl << v << std::endl;
   return 0;
 }
diff --git a/doc/examples/function_taking_eigenbase.cpp b/doc/examples/function_taking_eigenbase.cpp
index 4e1e5a9..524ea18 100644
--- a/doc/examples/function_taking_eigenbase.cpp
+++ b/doc/examples/function_taking_eigenbase.cpp
@@ -2,16 +2,13 @@
 #include <Eigen/Core>
 
 template <typename Derived>
-void print_size(const Eigen::EigenBase<Derived>& b)
-{
-  std::cout << "size (rows, cols): " << b.size() << " (" << b.rows()
-            << ", " << b.cols() << ")" << std::endl;
+void print_size(const Eigen::EigenBase<Derived>& b) {
+  std::cout << "size (rows, cols): " << b.size() << " (" << b.rows() << ", " << b.cols() << ")" << std::endl;
 }
 
-int main()
-{
-    Eigen::Vector3f v;
-    print_size(v);
-    // v.asDiagonal() returns a 3x3 diagonal matrix pseudo-expression
-    print_size(v.asDiagonal());
+int main() {
+  Eigen::Vector3f v;
+  print_size(v);
+  // v.asDiagonal() returns a 3x3 diagonal matrix pseudo-expression
+  print_size(v.asDiagonal());
 }
diff --git a/doc/examples/function_taking_ref.cpp b/doc/examples/function_taking_ref.cpp
index a837e19..8fd8c76 100644
--- a/doc/examples/function_taking_ref.cpp
+++ b/doc/examples/function_taking_ref.cpp
@@ -1,17 +1,15 @@
 #include <iostream>
 #include <Eigen/SVD>
 
-float inv_cond(const Eigen::Ref<const Eigen::MatrixXf>& a)
-{
+float inv_cond(const Eigen::Ref<const Eigen::MatrixXf>& a) {
   const Eigen::VectorXf sing_vals = a.jacobiSvd().singularValues();
-  return sing_vals(sing_vals.size()-1) / sing_vals(0);
+  return sing_vals(sing_vals.size() - 1) / sing_vals(0);
 }
 
-int main()
-{
+int main() {
   Eigen::MatrixXf m = Eigen::MatrixXf::Random(4, 4);
   std::cout << "matrix m:\n" << m << "\n\n";
-  std::cout << "inv_cond(m):          " << inv_cond(m)                      << "\n";
-  std::cout << "inv_cond(m(1:3,1:3)): " << inv_cond(m.topLeftCorner(3,3))   << "\n";
-  std::cout << "inv_cond(m+I):        " << inv_cond(m+Eigen::MatrixXf::Identity(4, 4)) << "\n";
+  std::cout << "inv_cond(m):          " << inv_cond(m) << "\n";
+  std::cout << "inv_cond(m(1:3,1:3)): " << inv_cond(m.topLeftCorner(3, 3)) << "\n";
+  std::cout << "inv_cond(m+I):        " << inv_cond(m + Eigen::MatrixXf::Identity(4, 4)) << "\n";
 }
diff --git a/doc/examples/make_circulant.cpp.entry b/doc/examples/make_circulant.cpp.entry
index f9d2eb8..f5e6910 100644
--- a/doc/examples/make_circulant.cpp.entry
+++ b/doc/examples/make_circulant.cpp.entry
@@ -1,5 +1,4 @@
 template <class ArgType>
-Circulant<ArgType> makeCirculant(const Eigen::MatrixBase<ArgType>& arg)
-{
+Circulant<ArgType> makeCirculant(const Eigen::MatrixBase<ArgType>& arg) {
   return Circulant<ArgType>(arg.derived());
 }
diff --git a/doc/examples/make_circulant.cpp.evaluator b/doc/examples/make_circulant.cpp.evaluator
index cd461b9..3304d89 100644
--- a/doc/examples/make_circulant.cpp.evaluator
+++ b/doc/examples/make_circulant.cpp.evaluator
@@ -1,32 +1,24 @@
 namespace Eigen {
-  namespace internal {
-    template<typename ArgType>
-    struct evaluator<Circulant<ArgType> >
-      : evaluator_base<Circulant<ArgType> >
-    {
-      typedef Circulant<ArgType> XprType;
-      typedef typename nested_eval<ArgType, XprType::ColsAtCompileTime>::type ArgTypeNested;
-      typedef remove_all_t<ArgTypeNested> ArgTypeNestedCleaned;
-      typedef typename XprType::CoeffReturnType CoeffReturnType;
+namespace internal {
+template <typename ArgType>
+struct evaluator<Circulant<ArgType> > : evaluator_base<Circulant<ArgType> > {
+  typedef Circulant<ArgType> XprType;
+  typedef typename nested_eval<ArgType, XprType::ColsAtCompileTime>::type ArgTypeNested;
+  typedef remove_all_t<ArgTypeNested> ArgTypeNestedCleaned;
+  typedef typename XprType::CoeffReturnType CoeffReturnType;
 
-      enum { 
-        CoeffReadCost = evaluator<ArgTypeNestedCleaned>::CoeffReadCost,
-        Flags = Eigen::ColMajor 
-      };
-      
-      evaluator(const XprType& xpr)
-        : m_argImpl(xpr.m_arg), m_rows(xpr.rows())
-      { }
+  enum { CoeffReadCost = evaluator<ArgTypeNestedCleaned>::CoeffReadCost, Flags = Eigen::ColMajor };
 
-      CoeffReturnType coeff(Index row, Index col) const
-      {
-        Index index = row - col;
-        if (index < 0) index += m_rows;
-        return m_argImpl.coeff(index);
-      }
+  evaluator(const XprType& xpr) : m_argImpl(xpr.m_arg), m_rows(xpr.rows()) {}
 
-      evaluator<ArgTypeNestedCleaned> m_argImpl;
-      const Index m_rows;
-    };
+  CoeffReturnType coeff(Index row, Index col) const {
+    Index index = row - col;
+    if (index < 0) index += m_rows;
+    return m_argImpl.coeff(index);
   }
-}
+
+  evaluator<ArgTypeNestedCleaned> m_argImpl;
+  const Index m_rows;
+};
+}  // namespace internal
+}  // namespace Eigen
diff --git a/doc/examples/make_circulant.cpp.expression b/doc/examples/make_circulant.cpp.expression
index 380cd44..9868c1e 100644
--- a/doc/examples/make_circulant.cpp.expression
+++ b/doc/examples/make_circulant.cpp.expression
@@ -1,15 +1,11 @@
 template <class ArgType>
-class Circulant : public Eigen::MatrixBase<Circulant<ArgType> >
-{
-public:
-  Circulant(const ArgType& arg)
-    : m_arg(arg)
-  { 
-    EIGEN_STATIC_ASSERT(ArgType::ColsAtCompileTime == 1,
-                        YOU_TRIED_CALLING_A_VECTOR_METHOD_ON_A_MATRIX);
+class Circulant : public Eigen::MatrixBase<Circulant<ArgType> > {
+ public:
+  Circulant(const ArgType& arg) : m_arg(arg) {
+    EIGEN_STATIC_ASSERT(ArgType::ColsAtCompileTime == 1, YOU_TRIED_CALLING_A_VECTOR_METHOD_ON_A_MATRIX);
   }
 
-  typedef typename Eigen::internal::ref_selector<Circulant>::type Nested; 
+  typedef typename Eigen::internal::ref_selector<Circulant>::type Nested;
 
   typedef Eigen::Index Index;
   Index rows() const { return m_arg.rows(); }
diff --git a/doc/examples/make_circulant.cpp.main b/doc/examples/make_circulant.cpp.main
index 877f97f..0b6d946 100644
--- a/doc/examples/make_circulant.cpp.main
+++ b/doc/examples/make_circulant.cpp.main
@@ -1,5 +1,4 @@
-int main()
-{
+int main() {
   Eigen::VectorXd vec(4);
   vec << 1, 2, 4, 8;
   Eigen::MatrixXd mat;
diff --git a/doc/examples/make_circulant.cpp.preamble b/doc/examples/make_circulant.cpp.preamble
index e575cce..8906033 100644
--- a/doc/examples/make_circulant.cpp.preamble
+++ b/doc/examples/make_circulant.cpp.preamble
@@ -1,4 +1,5 @@
 #include <Eigen/Core>
 #include <iostream>
 
-template <class ArgType> class Circulant;
+template <class ArgType>
+class Circulant;
diff --git a/doc/examples/make_circulant.cpp.traits b/doc/examples/make_circulant.cpp.traits
index 4e04535..2d5e41b 100644
--- a/doc/examples/make_circulant.cpp.traits
+++ b/doc/examples/make_circulant.cpp.traits
@@ -1,19 +1,18 @@
 namespace Eigen {
-  namespace internal {
-    template <class ArgType>
-    struct traits<Circulant<ArgType> >
-    {
-      typedef Eigen::Dense StorageKind;
-      typedef Eigen::MatrixXpr XprKind;
-      typedef typename ArgType::StorageIndex StorageIndex;
-      typedef typename ArgType::Scalar Scalar;
-      enum { 
-        Flags = Eigen::ColMajor,
-        RowsAtCompileTime = ArgType::RowsAtCompileTime,
-        ColsAtCompileTime = ArgType::RowsAtCompileTime,
-        MaxRowsAtCompileTime = ArgType::MaxRowsAtCompileTime,
-        MaxColsAtCompileTime = ArgType::MaxRowsAtCompileTime
-      };
-    };
-  }
-}
+namespace internal {
+template <class ArgType>
+struct traits<Circulant<ArgType> > {
+  typedef Eigen::Dense StorageKind;
+  typedef Eigen::MatrixXpr XprKind;
+  typedef typename ArgType::StorageIndex StorageIndex;
+  typedef typename ArgType::Scalar Scalar;
+  enum {
+    Flags = Eigen::ColMajor,
+    RowsAtCompileTime = ArgType::RowsAtCompileTime,
+    ColsAtCompileTime = ArgType::RowsAtCompileTime,
+    MaxRowsAtCompileTime = ArgType::MaxRowsAtCompileTime,
+    MaxColsAtCompileTime = ArgType::MaxRowsAtCompileTime
+  };
+};
+}  // namespace internal
+}  // namespace Eigen
diff --git a/doc/examples/make_circulant2.cpp b/doc/examples/make_circulant2.cpp
index d86a66b..b3bbcfc 100644
--- a/doc/examples/make_circulant2.cpp
+++ b/doc/examples/make_circulant2.cpp
@@ -2,13 +2,14 @@
 #include <iostream>
 
 // [circulant_func]
-template<class ArgType>
+template <class ArgType>
 class circulant_functor {
-  const ArgType &m_vec;
-public:
+  const ArgType& m_vec;
+
+ public:
   circulant_functor(const ArgType& arg) : m_vec(arg) {}
 
-  const typename ArgType::Scalar& operator() (Eigen::Index row, Eigen::Index col) const {
+  const typename ArgType::Scalar& operator()(Eigen::Index row, Eigen::Index col) const {
     Eigen::Index index = row - col;
     if (index < 0) index += m_vec.size();
     return m_vec(index);
@@ -17,30 +18,25 @@
 // [circulant_func]
 
 // [square]
-template<class ArgType>
+template <class ArgType>
 struct circulant_helper {
-  typedef Eigen::Matrix<typename ArgType::Scalar,
-                 ArgType::SizeAtCompileTime,
-                 ArgType::SizeAtCompileTime,
-                 Eigen::ColMajor,
-                 ArgType::MaxSizeAtCompileTime,
-                 ArgType::MaxSizeAtCompileTime> MatrixType;
+  typedef Eigen::Matrix<typename ArgType::Scalar, ArgType::SizeAtCompileTime, ArgType::SizeAtCompileTime,
+                        Eigen::ColMajor, ArgType::MaxSizeAtCompileTime, ArgType::MaxSizeAtCompileTime>
+      MatrixType;
 };
 // [square]
 
 // [makeCirculant]
 template <class ArgType>
-Eigen::CwiseNullaryOp<circulant_functor<ArgType>, typename circulant_helper<ArgType>::MatrixType>
-makeCirculant(const Eigen::MatrixBase<ArgType>& arg)
-{
+Eigen::CwiseNullaryOp<circulant_functor<ArgType>, typename circulant_helper<ArgType>::MatrixType> makeCirculant(
+    const Eigen::MatrixBase<ArgType>& arg) {
   typedef typename circulant_helper<ArgType>::MatrixType MatrixType;
   return MatrixType::NullaryExpr(arg.size(), arg.size(), circulant_functor<ArgType>(arg.derived()));
 }
 // [makeCirculant]
 
 // [main]
-int main()
-{
+int main() {
   Eigen::VectorXd vec(4);
   vec << 1, 2, 4, 8;
   Eigen::MatrixXd mat;
diff --git a/doc/examples/matrixfree_cg.cpp b/doc/examples/matrixfree_cg.cpp
index cc0eead..66f2c27 100644
--- a/doc/examples/matrixfree_cg.cpp
+++ b/doc/examples/matrixfree_cg.cpp
@@ -9,81 +9,70 @@
 
 namespace Eigen {
 namespace internal {
-  // MatrixReplacement looks-like a SparseMatrix, so let's inherit its traits:
-  template<>
-  struct traits<MatrixReplacement> :  public Eigen::internal::traits<Eigen::SparseMatrix<double> >
-  {};
-}
-}
+// MatrixReplacement looks-like a SparseMatrix, so let's inherit its traits:
+template <>
+struct traits<MatrixReplacement> : public Eigen::internal::traits<Eigen::SparseMatrix<double> > {};
+}  // namespace internal
+}  // namespace Eigen
 
 // Example of a matrix-free wrapper from a user type to Eigen's compatible type
 // For the sake of simplicity, this example simply wrap a Eigen::SparseMatrix.
 class MatrixReplacement : public Eigen::EigenBase<MatrixReplacement> {
-public:
+ public:
   // Required typedefs, constants, and method:
   typedef double Scalar;
   typedef double RealScalar;
   typedef int StorageIndex;
-  enum {
-    ColsAtCompileTime = Eigen::Dynamic,
-    MaxColsAtCompileTime = Eigen::Dynamic,
-    IsRowMajor = false
-  };
+  enum { ColsAtCompileTime = Eigen::Dynamic, MaxColsAtCompileTime = Eigen::Dynamic, IsRowMajor = false };
 
   Index rows() const { return mp_mat->rows(); }
   Index cols() const { return mp_mat->cols(); }
 
-  template<typename Rhs>
-  Eigen::Product<MatrixReplacement,Rhs,Eigen::AliasFreeProduct> operator*(const Eigen::MatrixBase<Rhs>& x) const {
-    return Eigen::Product<MatrixReplacement,Rhs,Eigen::AliasFreeProduct>(*this, x.derived());
+  template <typename Rhs>
+  Eigen::Product<MatrixReplacement, Rhs, Eigen::AliasFreeProduct> operator*(const Eigen::MatrixBase<Rhs>& x) const {
+    return Eigen::Product<MatrixReplacement, Rhs, Eigen::AliasFreeProduct>(*this, x.derived());
   }
 
   // Custom API:
   MatrixReplacement() : mp_mat(0) {}
 
-  void attachMyMatrix(const SparseMatrix<double> &mat) {
-    mp_mat = &mat;
-  }
+  void attachMyMatrix(const SparseMatrix<double>& mat) { mp_mat = &mat; }
   const SparseMatrix<double> my_matrix() const { return *mp_mat; }
 
-private:
-  const SparseMatrix<double> *mp_mat;
+ private:
+  const SparseMatrix<double>* mp_mat;
 };
 
-
 // Implementation of MatrixReplacement * Eigen::DenseVector though a specialization of internal::generic_product_impl:
 namespace Eigen {
 namespace internal {
 
-  template<typename Rhs>
-  struct generic_product_impl<MatrixReplacement, Rhs, SparseShape, DenseShape, GemvProduct> // GEMV stands for matrix-vector
-  : generic_product_impl_base<MatrixReplacement,Rhs,generic_product_impl<MatrixReplacement,Rhs> >
-  {
-    typedef typename Product<MatrixReplacement,Rhs>::Scalar Scalar;
+template <typename Rhs>
+struct generic_product_impl<MatrixReplacement, Rhs, SparseShape, DenseShape,
+                            GemvProduct>  // GEMV stands for matrix-vector
+    : generic_product_impl_base<MatrixReplacement, Rhs, generic_product_impl<MatrixReplacement, Rhs> > {
+  typedef typename Product<MatrixReplacement, Rhs>::Scalar Scalar;
 
-    template<typename Dest>
-    static void scaleAndAddTo(Dest& dst, const MatrixReplacement& lhs, const Rhs& rhs, const Scalar& alpha)
-    {
-      // This method should implement "dst += alpha * lhs * rhs" inplace,
-      // however, for iterative solvers, alpha is always equal to 1, so let's not bother about it.
-      eigen_assert(alpha==Scalar(1) && "scaling is not implemented");
-      EIGEN_ONLY_USED_FOR_DEBUG(alpha);
+  template <typename Dest>
+  static void scaleAndAddTo(Dest& dst, const MatrixReplacement& lhs, const Rhs& rhs, const Scalar& alpha) {
+    // This method should implement "dst += alpha * lhs * rhs" inplace,
+    // however, for iterative solvers, alpha is always equal to 1, so let's not bother about it.
+    eigen_assert(alpha == Scalar(1) && "scaling is not implemented");
+    EIGEN_ONLY_USED_FOR_DEBUG(alpha);
 
-      // Here we could simply call dst.noalias() += lhs.my_matrix() * rhs,
-      // but let's do something fancier (and less efficient):
-      for(Index i=0; i<lhs.cols(); ++i)
-        dst += rhs(i) * lhs.my_matrix().col(i);
-    }
-  };
+    // Here we could simply call dst.noalias() += lhs.my_matrix() * rhs,
+    // but let's do something fancier (and less efficient):
+    for (Index i = 0; i < lhs.cols(); ++i) dst += rhs(i) * lhs.my_matrix().col(i);
+  }
+};
 
-}
-}
+}  // namespace internal
+}  // namespace Eigen
 
-int main()
-{
+int main() {
   int n = 10;
-  Eigen::SparseMatrix<double> S = Eigen::MatrixXd::Random(n,n).sparseView(0.5,1);
-  S = S.transpose()*S;
+  Eigen::SparseMatrix<double> S = Eigen::MatrixXd::Random(n, n).sparseView(0.5, 1);
+  S = S.transpose() * S;
 
   MatrixReplacement A;
   A.attachMyMatrix(S);
@@ -93,7 +82,7 @@
 
   // Solve Ax = b using various iterative solver with matrix-free version:
   {
-    Eigen::ConjugateGradient<MatrixReplacement, Eigen::Lower|Eigen::Upper, Eigen::IdentityPreconditioner> cg;
+    Eigen::ConjugateGradient<MatrixReplacement, Eigen::Lower | Eigen::Upper, Eigen::IdentityPreconditioner> cg;
     cg.compute(A);
     x = cg.solve(b);
     std::cout << "CG:       #iterations: " << cg.iterations() << ", estimated error: " << cg.error() << std::endl;
@@ -121,9 +110,10 @@
   }
 
   {
-    Eigen::MINRES<MatrixReplacement, Eigen::Lower|Eigen::Upper, Eigen::IdentityPreconditioner> minres;
+    Eigen::MINRES<MatrixReplacement, Eigen::Lower | Eigen::Upper, Eigen::IdentityPreconditioner> minres;
     minres.compute(A);
     x = minres.solve(b);
-    std::cout << "MINRES:   #iterations: " << minres.iterations() << ", estimated error: " << minres.error() << std::endl;
+    std::cout << "MINRES:   #iterations: " << minres.iterations() << ", estimated error: " << minres.error()
+              << std::endl;
   }
 }
diff --git a/doc/examples/nullary_indexing.cpp b/doc/examples/nullary_indexing.cpp
index 38260af..f98e690 100644
--- a/doc/examples/nullary_indexing.cpp
+++ b/doc/examples/nullary_indexing.cpp
@@ -2,24 +2,22 @@
 #include <iostream>
 
 // [functor]
-template<class ArgType, class RowIndexType, class ColIndexType>
+template <class ArgType, class RowIndexType, class ColIndexType>
 class indexing_functor {
-  const ArgType &m_arg;
-  const RowIndexType &m_rowIndices;
-  const ColIndexType &m_colIndices;
-public:
-  typedef Eigen::Matrix<typename ArgType::Scalar,
-                 RowIndexType::SizeAtCompileTime,
-                 ColIndexType::SizeAtCompileTime,
-                 ArgType::Flags&Eigen::RowMajorBit?Eigen::RowMajor:Eigen::ColMajor,
-                 RowIndexType::MaxSizeAtCompileTime,
-                 ColIndexType::MaxSizeAtCompileTime> MatrixType;
+  const ArgType& m_arg;
+  const RowIndexType& m_rowIndices;
+  const ColIndexType& m_colIndices;
+
+ public:
+  typedef Eigen::Matrix<typename ArgType::Scalar, RowIndexType::SizeAtCompileTime, ColIndexType::SizeAtCompileTime,
+                        ArgType::Flags & Eigen::RowMajorBit ? Eigen::RowMajor : Eigen::ColMajor,
+                        RowIndexType::MaxSizeAtCompileTime, ColIndexType::MaxSizeAtCompileTime>
+      MatrixType;
 
   indexing_functor(const ArgType& arg, const RowIndexType& row_indices, const ColIndexType& col_indices)
-    : m_arg(arg), m_rowIndices(row_indices), m_colIndices(col_indices)
-  {}
+      : m_arg(arg), m_rowIndices(row_indices), m_colIndices(col_indices) {}
 
-  const typename ArgType::Scalar& operator() (Eigen::Index row, Eigen::Index col) const {
+  const typename ArgType::Scalar& operator()(Eigen::Index row, Eigen::Index col) const {
     return m_arg(m_rowIndices[row], m_colIndices[col]);
   }
 };
@@ -27,22 +25,21 @@
 
 // [function]
 template <class ArgType, class RowIndexType, class ColIndexType>
-Eigen::CwiseNullaryOp<indexing_functor<ArgType,RowIndexType,ColIndexType>, typename indexing_functor<ArgType,RowIndexType,ColIndexType>::MatrixType>
-mat_indexing(const Eigen::MatrixBase<ArgType>& arg, const RowIndexType& row_indices, const ColIndexType& col_indices)
-{
-  typedef indexing_functor<ArgType,RowIndexType,ColIndexType> Func;
+Eigen::CwiseNullaryOp<indexing_functor<ArgType, RowIndexType, ColIndexType>,
+                      typename indexing_functor<ArgType, RowIndexType, ColIndexType>::MatrixType>
+mat_indexing(const Eigen::MatrixBase<ArgType>& arg, const RowIndexType& row_indices, const ColIndexType& col_indices) {
+  typedef indexing_functor<ArgType, RowIndexType, ColIndexType> Func;
   typedef typename Func::MatrixType MatrixType;
   return MatrixType::NullaryExpr(row_indices.size(), col_indices.size(), Func(arg.derived(), row_indices, col_indices));
 }
 // [function]
 
-
-int main()
-{
+int main() {
   std::cout << "[main1]\n";
-  Eigen::MatrixXi A = Eigen::MatrixXi::Random(4,4);
-  Eigen::Array3i ri(1,2,1);
-  Eigen::ArrayXi ci(6); ci << 3,2,1,0,0,2;
+  Eigen::MatrixXi A = Eigen::MatrixXi::Random(4, 4);
+  Eigen::Array3i ri(1, 2, 1);
+  Eigen::ArrayXi ci(6);
+  ci << 3, 2, 1, 0, 0, 2;
   Eigen::MatrixXi B = mat_indexing(A, ri, ci);
   std::cout << "A =" << std::endl;
   std::cout << A << std::endl << std::endl;
@@ -51,12 +48,13 @@
   std::cout << "[main1]\n";
 
   std::cout << "[main2]\n";
-  B =  mat_indexing(A, ri+1, ci);
+  B = mat_indexing(A, ri + 1, ci);
   std::cout << "A(ri+1,ci) =" << std::endl;
   std::cout << B << std::endl << std::endl;
-  B =  mat_indexing(A, Eigen::ArrayXi::LinSpaced(13,0,12).unaryExpr([](int x){return x%4;}), Eigen::ArrayXi::LinSpaced(4,0,3));
-  std::cout << "A(ArrayXi::LinSpaced(13,0,12).unaryExpr([](int x){return x%4;}), ArrayXi::LinSpaced(4,0,3)) =" << std::endl;
+  B = mat_indexing(A, Eigen::ArrayXi::LinSpaced(13, 0, 12).unaryExpr([](int x) { return x % 4; }),
+                   Eigen::ArrayXi::LinSpaced(4, 0, 3));
+  std::cout << "A(ArrayXi::LinSpaced(13,0,12).unaryExpr([](int x){return x%4;}), ArrayXi::LinSpaced(4,0,3)) ="
+            << std::endl;
   std::cout << B << std::endl << std::endl;
   std::cout << "[main2]\n";
 }
-
diff --git a/doc/examples/tut_arithmetic_add_sub.cpp b/doc/examples/tut_arithmetic_add_sub.cpp
index 95162c0..ceb43ca 100644
--- a/doc/examples/tut_arithmetic_add_sub.cpp
+++ b/doc/examples/tut_arithmetic_add_sub.cpp
@@ -1,20 +1,17 @@
 #include <iostream>
 #include <Eigen/Dense>
 
-int main()
-{
+int main() {
   Eigen::Matrix2d a;
-  a << 1, 2,
-       3, 4;
-  Eigen::MatrixXd b(2,2);
-  b << 2, 3,
-       1, 4;
+  a << 1, 2, 3, 4;
+  Eigen::MatrixXd b(2, 2);
+  b << 2, 3, 1, 4;
   std::cout << "a + b =\n" << a + b << std::endl;
   std::cout << "a - b =\n" << a - b << std::endl;
   std::cout << "Doing a += b;" << std::endl;
   a += b;
   std::cout << "Now a =\n" << a << std::endl;
-  Eigen::Vector3d v(1,2,3);
-  Eigen::Vector3d w(1,0,0);
+  Eigen::Vector3d v(1, 2, 3);
+  Eigen::Vector3d w(1, 0, 0);
   std::cout << "-v + w - v =\n" << -v + w - v << std::endl;
 }
diff --git a/doc/examples/tut_arithmetic_dot_cross.cpp b/doc/examples/tut_arithmetic_dot_cross.cpp
index d95e03c..09eea39 100644
--- a/doc/examples/tut_arithmetic_dot_cross.cpp
+++ b/doc/examples/tut_arithmetic_dot_cross.cpp
@@ -1,18 +1,17 @@
 #include <iostream>
 #include <Eigen/Dense>
 
-int main()
-{
-  Eigen::Vector3d v(1,2,3);
-  Eigen::Vector3d w(0,1,2);
+int main() {
+  Eigen::Vector3d v(1, 2, 3);
+  Eigen::Vector3d w(0, 1, 2);
 
   std::cout << "Dot product: " << v.dot(w) << std::endl;
-  double dp = v.adjoint()*w; // automatic conversion of the inner product to a scalar
+  double dp = v.adjoint() * w;  // automatic conversion of the inner product to a scalar
   std::cout << "Dot product via a matrix product: " << dp << std::endl;
 
   std::cout << "Cross product:\n" << v.cross(w) << std::endl;
-  Eigen::Vector2d v2(1,2);
-  Eigen::Vector2d w2(0,1);
-  double cp = v2.cross(w2); // returning a scalar between size-2 vectors
+  Eigen::Vector2d v2(1, 2);
+  Eigen::Vector2d w2(0, 1);
+  double cp = v2.cross(w2);  // returning a scalar between size-2 vectors
   std::cout << "Cross product for 2D vectors: " << cp << std::endl;
 }
diff --git a/doc/examples/tut_arithmetic_matrix_mul.cpp b/doc/examples/tut_arithmetic_matrix_mul.cpp
index c2d5e2d..ead4800 100644
--- a/doc/examples/tut_arithmetic_matrix_mul.cpp
+++ b/doc/examples/tut_arithmetic_matrix_mul.cpp
@@ -1,18 +1,16 @@
 #include <iostream>
 #include <Eigen/Dense>
 
-int main()
-{
+int main() {
   Eigen::Matrix2d mat;
-  mat << 1, 2,
-         3, 4;
-  Eigen::Vector2d u(-1,1), v(2,0);
-  std::cout << "Here is mat*mat:\n" << mat*mat << std::endl;
-  std::cout << "Here is mat*u:\n" << mat*u << std::endl;
-  std::cout << "Here is u^T*mat:\n" << u.transpose()*mat << std::endl;
-  std::cout << "Here is u^T*v:\n" << u.transpose()*v << std::endl;
-  std::cout << "Here is u*v^T:\n" << u*v.transpose() << std::endl;
+  mat << 1, 2, 3, 4;
+  Eigen::Vector2d u(-1, 1), v(2, 0);
+  std::cout << "Here is mat*mat:\n" << mat * mat << std::endl;
+  std::cout << "Here is mat*u:\n" << mat * u << std::endl;
+  std::cout << "Here is u^T*mat:\n" << u.transpose() * mat << std::endl;
+  std::cout << "Here is u^T*v:\n" << u.transpose() * v << std::endl;
+  std::cout << "Here is u*v^T:\n" << u * v.transpose() << std::endl;
   std::cout << "Let's multiply mat by itself" << std::endl;
-  mat = mat*mat;
+  mat = mat * mat;
   std::cout << "Now mat is mat:\n" << mat << std::endl;
 }
diff --git a/doc/examples/tut_arithmetic_redux_basic.cpp b/doc/examples/tut_arithmetic_redux_basic.cpp
index 5632fb5..3140237 100644
--- a/doc/examples/tut_arithmetic_redux_basic.cpp
+++ b/doc/examples/tut_arithmetic_redux_basic.cpp
@@ -2,15 +2,13 @@
 #include <Eigen/Dense>
 
 using namespace std;
-int main()
-{
+int main() {
   Eigen::Matrix2d mat;
-  mat << 1, 2,
-         3, 4;
-  cout << "Here is mat.sum():       " << mat.sum()       << endl;
-  cout << "Here is mat.prod():      " << mat.prod()      << endl;
-  cout << "Here is mat.mean():      " << mat.mean()      << endl;
-  cout << "Here is mat.minCoeff():  " << mat.minCoeff()  << endl;
-  cout << "Here is mat.maxCoeff():  " << mat.maxCoeff()  << endl;
-  cout << "Here is mat.trace():     " << mat.trace()     << endl;
+  mat << 1, 2, 3, 4;
+  cout << "Here is mat.sum():       " << mat.sum() << endl;
+  cout << "Here is mat.prod():      " << mat.prod() << endl;
+  cout << "Here is mat.mean():      " << mat.mean() << endl;
+  cout << "Here is mat.minCoeff():  " << mat.minCoeff() << endl;
+  cout << "Here is mat.maxCoeff():  " << mat.maxCoeff() << endl;
+  cout << "Here is mat.trace():     " << mat.trace() << endl;
 }
diff --git a/doc/examples/tut_arithmetic_scalar_mul_div.cpp b/doc/examples/tut_arithmetic_scalar_mul_div.cpp
index 0ba8d6b..05f1ebd 100644
--- a/doc/examples/tut_arithmetic_scalar_mul_div.cpp
+++ b/doc/examples/tut_arithmetic_scalar_mul_div.cpp
@@ -1,12 +1,10 @@
 #include <iostream>
 #include <Eigen/Dense>
 
-int main()
-{
+int main() {
   Eigen::Matrix2d a;
-  a << 1, 2,
-       3, 4;
-  Eigen::Vector3d v(1,2,3);
+  a << 1, 2, 3, 4;
+  Eigen::Vector3d v(1, 2, 3);
   std::cout << "a * 2.5 =\n" << a * 2.5 << std::endl;
   std::cout << "0.1 * v =\n" << 0.1 * v << std::endl;
   std::cout << "Doing v *= 2;" << std::endl;
diff --git a/doc/examples/tut_matrix_coefficient_accessors.cpp b/doc/examples/tut_matrix_coefficient_accessors.cpp
index 040087c..e509a98 100644
--- a/doc/examples/tut_matrix_coefficient_accessors.cpp
+++ b/doc/examples/tut_matrix_coefficient_accessors.cpp
@@ -1,13 +1,12 @@
 #include <iostream>
 #include <Eigen/Dense>
 
-int main()
-{
-  Eigen::MatrixXd m(2,2);
-  m(0,0) = 3;
-  m(1,0) = 2.5;
-  m(0,1) = -1;
-  m(1,1) = m(1,0) + m(0,1);
+int main() {
+  Eigen::MatrixXd m(2, 2);
+  m(0, 0) = 3;
+  m(1, 0) = 2.5;
+  m(0, 1) = -1;
+  m(1, 1) = m(1, 0) + m(0, 1);
   std::cout << "Here is the matrix m:\n" << m << std::endl;
   Eigen::VectorXd v(2);
   v(0) = 4;
diff --git a/doc/examples/tut_matrix_resize.cpp b/doc/examples/tut_matrix_resize.cpp
index aa80cf5..6e00919 100644
--- a/doc/examples/tut_matrix_resize.cpp
+++ b/doc/examples/tut_matrix_resize.cpp
@@ -1,16 +1,13 @@
 #include <iostream>
 #include <Eigen/Dense>
 
-int main()
-{
-  Eigen::MatrixXd m(2,5);
-  m.resize(4,3);
-  std::cout << "The matrix m is of size "
-            << m.rows() << "x" << m.cols() << std::endl;
+int main() {
+  Eigen::MatrixXd m(2, 5);
+  m.resize(4, 3);
+  std::cout << "The matrix m is of size " << m.rows() << "x" << m.cols() << std::endl;
   std::cout << "It has " << m.size() << " coefficients" << std::endl;
   Eigen::VectorXd v(2);
   v.resize(5);
   std::cout << "The vector v is of size " << v.size() << std::endl;
-  std::cout << "As a matrix, v is of size "
-            << v.rows() << "x" << v.cols() << std::endl;
+  std::cout << "As a matrix, v is of size " << v.rows() << "x" << v.cols() << std::endl;
 }
diff --git a/doc/examples/tut_matrix_resize_fixed_size.cpp b/doc/examples/tut_matrix_resize_fixed_size.cpp
index 3df87d2..44645d8 100644
--- a/doc/examples/tut_matrix_resize_fixed_size.cpp
+++ b/doc/examples/tut_matrix_resize_fixed_size.cpp
@@ -1,10 +1,8 @@
 #include <iostream>
 #include <Eigen/Dense>
 
-int main()
-{
+int main() {
   Eigen::Matrix4d m;
-  m.resize(4,4); // no operation
-  std::cout << "The matrix m is of size "
-            << m.rows() << "x" << m.cols() << std::endl;
+  m.resize(4, 4);  // no operation
+  std::cout << "The matrix m is of size " << m.rows() << "x" << m.cols() << std::endl;
 }
diff --git a/doc/snippets/AngleAxis_mimic_euler.cpp b/doc/snippets/AngleAxis_mimic_euler.cpp
index 456de7f..eb27cbf 100644
--- a/doc/snippets/AngleAxis_mimic_euler.cpp
+++ b/doc/snippets/AngleAxis_mimic_euler.cpp
@@ -1,5 +1,4 @@
 Matrix3f m;
-m = AngleAxisf(0.25*M_PI, Vector3f::UnitX())
-  * AngleAxisf(0.5*M_PI,  Vector3f::UnitY())
-  * AngleAxisf(0.33*M_PI, Vector3f::UnitZ());
+m = AngleAxisf(0.25 * M_PI, Vector3f::UnitX()) * AngleAxisf(0.5 * M_PI, Vector3f::UnitY()) *
+    AngleAxisf(0.33 * M_PI, Vector3f::UnitZ());
 cout << m << endl << "is unitary: " << m.isUnitary() << endl;
diff --git a/doc/snippets/Array_initializer_list_23_cxx11.cpp b/doc/snippets/Array_initializer_list_23_cxx11.cpp
index 2c2166e..8f491cb 100644
--- a/doc/snippets/Array_initializer_list_23_cxx11.cpp
+++ b/doc/snippets/Array_initializer_list_23_cxx11.cpp
@@ -1,5 +1,2 @@
-ArrayXXi a {
-  {1, 2, 3},
-  {3, 4, 5}
-};
+ArrayXXi a{{1, 2, 3}, {3, 4, 5}};
 cout << a << endl;
diff --git a/doc/snippets/Array_initializer_list_vector_cxx11.cpp b/doc/snippets/Array_initializer_list_vector_cxx11.cpp
index a668d84..398831f 100644
--- a/doc/snippets/Array_initializer_list_vector_cxx11.cpp
+++ b/doc/snippets/Array_initializer_list_vector_cxx11.cpp
@@ -1,2 +1,2 @@
-Array<int, Dynamic, 1> v {{1, 2, 3, 4, 5}};
+Array<int, Dynamic, 1> v{{1, 2, 3, 4, 5}};
 cout << v << endl;
diff --git a/doc/snippets/Array_variadic_ctor_cxx11.cpp b/doc/snippets/Array_variadic_ctor_cxx11.cpp
index 0e4ec44..6df78a5 100644
--- a/doc/snippets/Array_variadic_ctor_cxx11.cpp
+++ b/doc/snippets/Array_variadic_ctor_cxx11.cpp
@@ -1,3 +1,3 @@
 Array<int, 1, 6> a(1, 2, 3, 4, 5, 6);
-Array<int, 3, 1> b {1, 2, 3};
+Array<int, 3, 1> b{1, 2, 3};
 cout << a << "\n\n" << b << endl;
diff --git a/doc/snippets/BiCGSTAB_simple.cpp b/doc/snippets/BiCGSTAB_simple.cpp
index 8c8829f..68f07c9 100644
--- a/doc/snippets/BiCGSTAB_simple.cpp
+++ b/doc/snippets/BiCGSTAB_simple.cpp
@@ -1,11 +1,11 @@
-  int n = 10000;
-  VectorXd x(n), b(n);
-  SparseMatrix<double> A(n,n);
-  /* ... fill A and b ... */ 
-  BiCGSTAB<SparseMatrix<double> > solver;
-  solver.compute(A);
-  x = solver.solve(b);
-  std::cout << "#iterations:     " << solver.iterations() << std::endl;
-  std::cout << "estimated error: " << solver.error()      << std::endl;
-  /* ... update b ... */
-  x = solver.solve(b); // solve again
+int n = 10000;
+VectorXd x(n), b(n);
+SparseMatrix<double> A(n, n);
+/* ... fill A and b ... */
+BiCGSTAB<SparseMatrix<double> > solver;
+solver.compute(A);
+x = solver.solve(b);
+std::cout << "#iterations:     " << solver.iterations() << std::endl;
+std::cout << "estimated error: " << solver.error() << std::endl;
+/* ... update b ... */
+x = solver.solve(b);  // solve again
diff --git a/doc/snippets/BiCGSTAB_step_by_step.cpp b/doc/snippets/BiCGSTAB_step_by_step.cpp
index 6c95d5a..7fe53a5 100644
--- a/doc/snippets/BiCGSTAB_step_by_step.cpp
+++ b/doc/snippets/BiCGSTAB_step_by_step.cpp
@@ -1,14 +1,14 @@
-  int n = 10000;
-  VectorXd x(n), b(n);
-  SparseMatrix<double> A(n,n);
-  /* ... fill A and b ... */ 
-  BiCGSTAB<SparseMatrix<double> > solver(A);
-  // start from a random solution
-  x = VectorXd::Random(n);
-  solver.setMaxIterations(1);
-  int i = 0;
-  do {
-    x = solver.solveWithGuess(b,x);
-    std::cout << i << " : " << solver.error() << std::endl;
-    ++i;
-  } while (solver.info()!=Success && i<100);
+int n = 10000;
+VectorXd x(n), b(n);
+SparseMatrix<double> A(n, n);
+/* ... fill A and b ... */
+BiCGSTAB<SparseMatrix<double> > solver(A);
+// start from a random solution
+x = VectorXd::Random(n);
+solver.setMaxIterations(1);
+int i = 0;
+do {
+  x = solver.solveWithGuess(b, x);
+  std::cout << i << " : " << solver.error() << std::endl;
+  ++i;
+} while (solver.info() != Success && i < 100);
diff --git a/doc/snippets/ColPivHouseholderQR_solve.cpp b/doc/snippets/ColPivHouseholderQR_solve.cpp
index b7b204a..eb7d1ff 100644
--- a/doc/snippets/ColPivHouseholderQR_solve.cpp
+++ b/doc/snippets/ColPivHouseholderQR_solve.cpp
@@ -4,5 +4,5 @@
 cout << "Here is the matrix y:" << endl << y << endl;
 Matrix3f x;
 x = m.colPivHouseholderQr().solve(y);
-assert(y.isApprox(m*x));
+assert(y.isApprox(m* x));
 cout << "Here is a solution x to the equation mx=y:" << endl << x << endl;
diff --git a/doc/snippets/ComplexEigenSolver_compute.cpp b/doc/snippets/ComplexEigenSolver_compute.cpp
index 11d6bd3..e55409d 100644
--- a/doc/snippets/ComplexEigenSolver_compute.cpp
+++ b/doc/snippets/ComplexEigenSolver_compute.cpp
@@ -1,4 +1,4 @@
-MatrixXcf A = MatrixXcf::Random(4,4);
+MatrixXcf A = MatrixXcf::Random(4, 4);
 cout << "Here is a random 4x4 matrix, A:" << endl << A << endl << endl;
 
 ComplexEigenSolver<MatrixXcf> ces;
diff --git a/doc/snippets/ComplexEigenSolver_eigenvalues.cpp b/doc/snippets/ComplexEigenSolver_eigenvalues.cpp
index 5509bd8..d3bff51 100644
--- a/doc/snippets/ComplexEigenSolver_eigenvalues.cpp
+++ b/doc/snippets/ComplexEigenSolver_eigenvalues.cpp
@@ -1,4 +1,3 @@
-MatrixXcf ones = MatrixXcf::Ones(3,3);
+MatrixXcf ones = MatrixXcf::Ones(3, 3);
 ComplexEigenSolver<MatrixXcf> ces(ones, /* computeEigenvectors = */ false);
-cout << "The eigenvalues of the 3x3 matrix of ones are:" 
-     << endl << ces.eigenvalues() << endl;
+cout << "The eigenvalues of the 3x3 matrix of ones are:" << endl << ces.eigenvalues() << endl;
diff --git a/doc/snippets/ComplexEigenSolver_eigenvectors.cpp b/doc/snippets/ComplexEigenSolver_eigenvectors.cpp
index adeed9a..46aab4a 100644
--- a/doc/snippets/ComplexEigenSolver_eigenvectors.cpp
+++ b/doc/snippets/ComplexEigenSolver_eigenvectors.cpp
@@ -1,4 +1,3 @@
-MatrixXcf ones = MatrixXcf::Ones(3,3);
+MatrixXcf ones = MatrixXcf::Ones(3, 3);
 ComplexEigenSolver<MatrixXcf> ces(ones);
-cout << "The first eigenvector of the 3x3 matrix of ones is:" 
-     << endl << ces.eigenvectors().col(0) << endl;
+cout << "The first eigenvector of the 3x3 matrix of ones is:" << endl << ces.eigenvectors().col(0) << endl;
diff --git a/doc/snippets/ComplexSchur_compute.cpp b/doc/snippets/ComplexSchur_compute.cpp
index 3a51701..53b7f8b 100644
--- a/doc/snippets/ComplexSchur_compute.cpp
+++ b/doc/snippets/ComplexSchur_compute.cpp
@@ -1,4 +1,4 @@
-MatrixXcf A = MatrixXcf::Random(4,4);
+MatrixXcf A = MatrixXcf::Random(4, 4);
 ComplexSchur<MatrixXcf> schur(4);
 schur.compute(A);
 cout << "The matrix T in the decomposition of A is:" << endl << schur.matrixT() << endl;
diff --git a/doc/snippets/ComplexSchur_matrixT.cpp b/doc/snippets/ComplexSchur_matrixT.cpp
index 8380571..e1033ad 100644
--- a/doc/snippets/ComplexSchur_matrixT.cpp
+++ b/doc/snippets/ComplexSchur_matrixT.cpp
@@ -1,4 +1,4 @@
-MatrixXcf A = MatrixXcf::Random(4,4);
+MatrixXcf A = MatrixXcf::Random(4, 4);
 cout << "Here is a random 4x4 matrix, A:" << endl << A << endl << endl;
-ComplexSchur<MatrixXcf> schurOfA(A, false); // false means do not compute U
+ComplexSchur<MatrixXcf> schurOfA(A, false);  // false means do not compute U
 cout << "The triangular matrix T is:" << endl << schurOfA.matrixT() << endl;
diff --git a/doc/snippets/ComplexSchur_matrixU.cpp b/doc/snippets/ComplexSchur_matrixU.cpp
index ba3d9c2..8138394 100644
--- a/doc/snippets/ComplexSchur_matrixU.cpp
+++ b/doc/snippets/ComplexSchur_matrixU.cpp
@@ -1,4 +1,4 @@
-MatrixXcf A = MatrixXcf::Random(4,4);
+MatrixXcf A = MatrixXcf::Random(4, 4);
 cout << "Here is a random 4x4 matrix, A:" << endl << A << endl << endl;
 ComplexSchur<MatrixXcf> schurOfA(A);
 cout << "The unitary matrix U is:" << endl << schurOfA.matrixU() << endl;
diff --git a/doc/snippets/Cwise_abs.cpp b/doc/snippets/Cwise_abs.cpp
index 0aeec3a..744851a 100644
--- a/doc/snippets/Cwise_abs.cpp
+++ b/doc/snippets/Cwise_abs.cpp
@@ -1,2 +1,2 @@
-Array3d v(1,-2,-3);
+Array3d v(1, -2, -3);
 cout << v.abs() << endl;
diff --git a/doc/snippets/Cwise_abs2.cpp b/doc/snippets/Cwise_abs2.cpp
index 2c4f9b3..71e5cb2 100644
--- a/doc/snippets/Cwise_abs2.cpp
+++ b/doc/snippets/Cwise_abs2.cpp
@@ -1,2 +1,2 @@
-Array3d v(1,-2,-3);
+Array3d v(1, -2, -3);
 cout << v.abs2() << endl;
diff --git a/doc/snippets/Cwise_acos.cpp b/doc/snippets/Cwise_acos.cpp
index 34432cb..bbbbf52 100644
--- a/doc/snippets/Cwise_acos.cpp
+++ b/doc/snippets/Cwise_acos.cpp
@@ -1,2 +1,2 @@
-Array3d v(0, sqrt(2.)/2, 1);
+Array3d v(0, sqrt(2.) / 2, 1);
 cout << v.acos() << endl;
diff --git a/doc/snippets/Cwise_array_atan2_array.cpp b/doc/snippets/Cwise_array_atan2_array.cpp
index ace075a..5742f9a 100644
--- a/doc/snippets/Cwise_array_atan2_array.cpp
+++ b/doc/snippets/Cwise_array_atan2_array.cpp
@@ -1,4 +1,3 @@
-Array<double,1,3> x(8,-25,3),
-                  y(1./3.,0.5,-2.);
-cout << "atan2([" << x << "], [" << y << "]) = " << x.atan2(y) << endl; // using ArrayBase::pow
-cout << "atan2([" << x << "], [" << y << "] = " << atan2(x,y) << endl; // using Eigen::pow
+Array<double, 1, 3> x(8, -25, 3), y(1. / 3., 0.5, -2.);
+cout << "atan2([" << x << "], [" << y << "]) = " << x.atan2(y) << endl;  // using ArrayBase::pow
+cout << "atan2([" << x << "], [" << y << "] = " << atan2(x, y) << endl;  // using Eigen::pow
diff --git a/doc/snippets/Cwise_array_power_array.cpp b/doc/snippets/Cwise_array_power_array.cpp
index 432a76e..ab2d87a 100644
--- a/doc/snippets/Cwise_array_power_array.cpp
+++ b/doc/snippets/Cwise_array_power_array.cpp
@@ -1,4 +1,3 @@
-Array<double,1,3> x(8,25,3),
-                  e(1./3.,0.5,2.);
-cout << "[" << x << "]^[" << e << "] = " << x.pow(e) << endl; // using ArrayBase::pow
-cout << "[" << x << "]^[" << e << "] = " << pow(x,e) << endl; // using Eigen::pow
+Array<double, 1, 3> x(8, 25, 3), e(1. / 3., 0.5, 2.);
+cout << "[" << x << "]^[" << e << "] = " << x.pow(e) << endl;   // using ArrayBase::pow
+cout << "[" << x << "]^[" << e << "] = " << pow(x, e) << endl;  // using Eigen::pow
diff --git a/doc/snippets/Cwise_asin.cpp b/doc/snippets/Cwise_asin.cpp
index 8dad838..3a64671 100644
--- a/doc/snippets/Cwise_asin.cpp
+++ b/doc/snippets/Cwise_asin.cpp
@@ -1,2 +1,2 @@
-Array3d v(0, sqrt(2.)/2, 1);
+Array3d v(0, sqrt(2.) / 2, 1);
 cout << v.asin() << endl;
diff --git a/doc/snippets/Cwise_atan.cpp b/doc/snippets/Cwise_atan.cpp
index 4468447..1b60a9a 100644
--- a/doc/snippets/Cwise_atan.cpp
+++ b/doc/snippets/Cwise_atan.cpp
@@ -1,2 +1,2 @@
-ArrayXd v = ArrayXd::LinSpaced(5,0,1);
+ArrayXd v = ArrayXd::LinSpaced(5, 0, 1);
 cout << v.atan() << endl;
diff --git a/doc/snippets/Cwise_boolean_and.cpp b/doc/snippets/Cwise_boolean_and.cpp
index df6b60d..227ac36 100644
--- a/doc/snippets/Cwise_boolean_and.cpp
+++ b/doc/snippets/Cwise_boolean_and.cpp
@@ -1,2 +1,2 @@
-Array3d v(-1,2,1), w(-3,2,3);
-cout << ((v<w) && (v<0)) << endl;
+Array3d v(-1, 2, 1), w(-3, 2, 3);
+cout << ((v < w) && (v < 0)) << endl;
diff --git a/doc/snippets/Cwise_boolean_not.cpp b/doc/snippets/Cwise_boolean_not.cpp
index 40009f1..404fd94 100644
--- a/doc/snippets/Cwise_boolean_not.cpp
+++ b/doc/snippets/Cwise_boolean_not.cpp
@@ -1,5 +1,5 @@
-Array3d v(1,2,3);
-v(1) *= 0.0/0.0;
+Array3d v(1, 2, 3);
+v(1) *= 0.0 / 0.0;
 v(2) /= 0.0;
 cout << v << endl << endl;
 cout << !isfinite(v) << endl;
diff --git a/doc/snippets/Cwise_boolean_or.cpp b/doc/snippets/Cwise_boolean_or.cpp
index 83eb006..df87f7a 100644
--- a/doc/snippets/Cwise_boolean_or.cpp
+++ b/doc/snippets/Cwise_boolean_or.cpp
@@ -1,2 +1,2 @@
-Array3d v(-1,2,1), w(-3,2,3);
-cout << ((v<w) || (v<0)) << endl;
+Array3d v(-1, 2, 1), w(-3, 2, 3);
+cout << ((v < w) || (v < 0)) << endl;
diff --git a/doc/snippets/Cwise_cbrt.cpp b/doc/snippets/Cwise_cbrt.cpp
index a58c76c..b6dcdfc 100644
--- a/doc/snippets/Cwise_cbrt.cpp
+++ b/doc/snippets/Cwise_cbrt.cpp
@@ -1,2 +1,2 @@
-Array3d v(1,2,4);
+Array3d v(1, 2, 4);
 cout << v.cbrt() << endl;
diff --git a/doc/snippets/Cwise_ceil.cpp b/doc/snippets/Cwise_ceil.cpp
index 76cf661..6123891 100644
--- a/doc/snippets/Cwise_ceil.cpp
+++ b/doc/snippets/Cwise_ceil.cpp
@@ -1,3 +1,3 @@
-ArrayXd v = ArrayXd::LinSpaced(7,-2,2);
+ArrayXd v = ArrayXd::LinSpaced(7, -2, 2);
 cout << v << endl << endl;
 cout << ceil(v) << endl;
diff --git a/doc/snippets/Cwise_cos.cpp b/doc/snippets/Cwise_cos.cpp
index f589f07..f84f325 100644
--- a/doc/snippets/Cwise_cos.cpp
+++ b/doc/snippets/Cwise_cos.cpp
@@ -1,2 +1,2 @@
-Array3d v(M_PI, M_PI/2, M_PI/3);
+Array3d v(M_PI, M_PI / 2, M_PI / 3);
 cout << v.cos() << endl;
diff --git a/doc/snippets/Cwise_cosh.cpp b/doc/snippets/Cwise_cosh.cpp
index 80ee75d..3cd3304 100644
--- a/doc/snippets/Cwise_cosh.cpp
+++ b/doc/snippets/Cwise_cosh.cpp
@@ -1,2 +1,2 @@
-ArrayXd v = ArrayXd::LinSpaced(5,0,1);
+ArrayXd v = ArrayXd::LinSpaced(5, 0, 1);
 cout << cosh(v) << endl;
diff --git a/doc/snippets/Cwise_cube.cpp b/doc/snippets/Cwise_cube.cpp
index 85e41dc..69f4c34 100644
--- a/doc/snippets/Cwise_cube.cpp
+++ b/doc/snippets/Cwise_cube.cpp
@@ -1,2 +1,2 @@
-Array3d v(2,3,4);
+Array3d v(2, 3, 4);
 cout << v.cube() << endl;
diff --git a/doc/snippets/Cwise_equal_equal.cpp b/doc/snippets/Cwise_equal_equal.cpp
index 0ba96f6..7fdeafa 100644
--- a/doc/snippets/Cwise_equal_equal.cpp
+++ b/doc/snippets/Cwise_equal_equal.cpp
@@ -1,2 +1,2 @@
-Array3d v(1,2,3), w(3,2,1);
-cout << (v==w) << endl;
+Array3d v(1, 2, 3), w(3, 2, 1);
+cout << (v == w) << endl;
diff --git a/doc/snippets/Cwise_exp.cpp b/doc/snippets/Cwise_exp.cpp
index db23618..9d65259 100644
--- a/doc/snippets/Cwise_exp.cpp
+++ b/doc/snippets/Cwise_exp.cpp
@@ -1,2 +1,2 @@
-Array3d v(1,2,3);
+Array3d v(1, 2, 3);
 cout << v.exp() << endl;
diff --git a/doc/snippets/Cwise_floor.cpp b/doc/snippets/Cwise_floor.cpp
index 73756b4..8f3ec85 100644
--- a/doc/snippets/Cwise_floor.cpp
+++ b/doc/snippets/Cwise_floor.cpp
@@ -1,3 +1,3 @@
-ArrayXd v = ArrayXd::LinSpaced(7,-2,2);
+ArrayXd v = ArrayXd::LinSpaced(7, -2, 2);
 cout << v << endl << endl;
 cout << floor(v) << endl;
diff --git a/doc/snippets/Cwise_greater.cpp b/doc/snippets/Cwise_greater.cpp
index 40ad029..77d448a 100644
--- a/doc/snippets/Cwise_greater.cpp
+++ b/doc/snippets/Cwise_greater.cpp
@@ -1,2 +1,2 @@
-Array3d v(1,2,3), w(3,2,1);
-cout << (v>w) << endl;
+Array3d v(1, 2, 3), w(3, 2, 1);
+cout << (v > w) << endl;
diff --git a/doc/snippets/Cwise_greater_equal.cpp b/doc/snippets/Cwise_greater_equal.cpp
index 6a08f89..8aa94e8 100644
--- a/doc/snippets/Cwise_greater_equal.cpp
+++ b/doc/snippets/Cwise_greater_equal.cpp
@@ -1,2 +1,2 @@
-Array3d v(1,2,3), w(3,2,1);
-cout << (v>=w) << endl;
+Array3d v(1, 2, 3), w(3, 2, 1);
+cout << (v >= w) << endl;
diff --git a/doc/snippets/Cwise_inverse.cpp b/doc/snippets/Cwise_inverse.cpp
index 3967a7e..292daef 100644
--- a/doc/snippets/Cwise_inverse.cpp
+++ b/doc/snippets/Cwise_inverse.cpp
@@ -1,2 +1,2 @@
-Array3d v(2,3,4);
+Array3d v(2, 3, 4);
 cout << v.inverse() << endl;
diff --git a/doc/snippets/Cwise_isFinite.cpp b/doc/snippets/Cwise_isFinite.cpp
index 1da55fd..c3309f2 100644
--- a/doc/snippets/Cwise_isFinite.cpp
+++ b/doc/snippets/Cwise_isFinite.cpp
@@ -1,5 +1,5 @@
-Array3d v(1,2,3);
-v(1) *= 0.0/0.0;
+Array3d v(1, 2, 3);
+v(1) *= 0.0 / 0.0;
 v(2) /= 0.0;
 cout << v << endl << endl;
 cout << isfinite(v) << endl;
diff --git a/doc/snippets/Cwise_isInf.cpp b/doc/snippets/Cwise_isInf.cpp
index be79308..c97b8a6 100644
--- a/doc/snippets/Cwise_isInf.cpp
+++ b/doc/snippets/Cwise_isInf.cpp
@@ -1,5 +1,5 @@
-Array3d v(1,2,3);
-v(1) *= 0.0/0.0;
+Array3d v(1, 2, 3);
+v(1) *= 0.0 / 0.0;
 v(2) /= 0.0;
 cout << v << endl << endl;
 cout << isinf(v) << endl;
diff --git a/doc/snippets/Cwise_isNaN.cpp b/doc/snippets/Cwise_isNaN.cpp
index 7b2a930..ab2b528 100644
--- a/doc/snippets/Cwise_isNaN.cpp
+++ b/doc/snippets/Cwise_isNaN.cpp
@@ -1,5 +1,5 @@
-Array3d v(1,2,3);
-v(1) *= 0.0/0.0;
+Array3d v(1, 2, 3);
+v(1) *= 0.0 / 0.0;
 v(2) /= 0.0;
 cout << v << endl << endl;
 cout << isnan(v) << endl;
diff --git a/doc/snippets/Cwise_less.cpp b/doc/snippets/Cwise_less.cpp
index cafd3b6..95ccb30 100644
--- a/doc/snippets/Cwise_less.cpp
+++ b/doc/snippets/Cwise_less.cpp
@@ -1,2 +1,2 @@
-Array3d v(1,2,3), w(3,2,1);
-cout << (v<w) << endl;
+Array3d v(1, 2, 3), w(3, 2, 1);
+cout << (v < w) << endl;
diff --git a/doc/snippets/Cwise_less_equal.cpp b/doc/snippets/Cwise_less_equal.cpp
index 1600e39..08d65be 100644
--- a/doc/snippets/Cwise_less_equal.cpp
+++ b/doc/snippets/Cwise_less_equal.cpp
@@ -1,2 +1,2 @@
-Array3d v(1,2,3), w(3,2,1);
-cout << (v<=w) << endl;
+Array3d v(1, 2, 3), w(3, 2, 1);
+cout << (v <= w) << endl;
diff --git a/doc/snippets/Cwise_log.cpp b/doc/snippets/Cwise_log.cpp
index f7aca72..f3e13d6 100644
--- a/doc/snippets/Cwise_log.cpp
+++ b/doc/snippets/Cwise_log.cpp
@@ -1,2 +1,2 @@
-Array3d v(1,2,3);
+Array3d v(1, 2, 3);
 cout << v.log() << endl;
diff --git a/doc/snippets/Cwise_log10.cpp b/doc/snippets/Cwise_log10.cpp
index b7ae4a8..8656f48 100644
--- a/doc/snippets/Cwise_log10.cpp
+++ b/doc/snippets/Cwise_log10.cpp
@@ -1,2 +1,2 @@
-Array4d v(-1,0,1,2);
+Array4d v(-1, 0, 1, 2);
 cout << log10(v) << endl;
diff --git a/doc/snippets/Cwise_max.cpp b/doc/snippets/Cwise_max.cpp
index 6602881..ab8d397 100644
--- a/doc/snippets/Cwise_max.cpp
+++ b/doc/snippets/Cwise_max.cpp
@@ -1,2 +1,2 @@
-Array3d v(2,3,4), w(4,2,3);
+Array3d v(2, 3, 4), w(4, 2, 3);
 cout << v.max(w) << endl;
diff --git a/doc/snippets/Cwise_min.cpp b/doc/snippets/Cwise_min.cpp
index 1c01c76..771eaf2 100644
--- a/doc/snippets/Cwise_min.cpp
+++ b/doc/snippets/Cwise_min.cpp
@@ -1,2 +1,2 @@
-Array3d v(2,3,4), w(4,2,3);
+Array3d v(2, 3, 4), w(4, 2, 3);
 cout << v.min(w) << endl;
diff --git a/doc/snippets/Cwise_minus.cpp b/doc/snippets/Cwise_minus.cpp
index b89b9fb..1389b4a 100644
--- a/doc/snippets/Cwise_minus.cpp
+++ b/doc/snippets/Cwise_minus.cpp
@@ -1,2 +1,2 @@
-Array3d v(1,2,3);
-cout << v-5 << endl;
+Array3d v(1, 2, 3);
+cout << v - 5 << endl;
diff --git a/doc/snippets/Cwise_minus_equal.cpp b/doc/snippets/Cwise_minus_equal.cpp
index dfde49d..33433e0 100644
--- a/doc/snippets/Cwise_minus_equal.cpp
+++ b/doc/snippets/Cwise_minus_equal.cpp
@@ -1,3 +1,3 @@
-Array3d v(1,2,3);
+Array3d v(1, 2, 3);
 v -= 5;
 cout << v << endl;
diff --git a/doc/snippets/Cwise_not_equal.cpp b/doc/snippets/Cwise_not_equal.cpp
index 57a407a..60aea2b 100644
--- a/doc/snippets/Cwise_not_equal.cpp
+++ b/doc/snippets/Cwise_not_equal.cpp
@@ -1,2 +1,2 @@
-Array3d v(1,2,3), w(3,2,1);
-cout << (v!=w) << endl;
+Array3d v(1, 2, 3), w(3, 2, 1);
+cout << (v != w) << endl;
diff --git a/doc/snippets/Cwise_plus.cpp b/doc/snippets/Cwise_plus.cpp
index 9d47327..7a878d6 100644
--- a/doc/snippets/Cwise_plus.cpp
+++ b/doc/snippets/Cwise_plus.cpp
@@ -1,2 +1,2 @@
-Array3d v(1,2,3);
-cout << v+5 << endl;
+Array3d v(1, 2, 3);
+cout << v + 5 << endl;
diff --git a/doc/snippets/Cwise_plus_equal.cpp b/doc/snippets/Cwise_plus_equal.cpp
index d744b1e..3e00ba2 100644
--- a/doc/snippets/Cwise_plus_equal.cpp
+++ b/doc/snippets/Cwise_plus_equal.cpp
@@ -1,3 +1,3 @@
-Array3d v(1,2,3);
+Array3d v(1, 2, 3);
 v += 5;
 cout << v << endl;
diff --git a/doc/snippets/Cwise_pow.cpp b/doc/snippets/Cwise_pow.cpp
index a723ed8..28a9dc5 100644
--- a/doc/snippets/Cwise_pow.cpp
+++ b/doc/snippets/Cwise_pow.cpp
@@ -1,2 +1,2 @@
-Array3d v(8,27,64);
+Array3d v(8, 27, 64);
 cout << v.pow(0.333333) << endl;
diff --git a/doc/snippets/Cwise_product.cpp b/doc/snippets/Cwise_product.cpp
index 714d66d..cee5b20 100644
--- a/doc/snippets/Cwise_product.cpp
+++ b/doc/snippets/Cwise_product.cpp
@@ -1,4 +1,3 @@
 Array33i a = Array33i::Random(), b = Array33i::Random();
 Array33i c = a * b;
 cout << "a:\n" << a << "\nb:\n" << b << "\nc:\n" << c << endl;
-
diff --git a/doc/snippets/Cwise_quotient.cpp b/doc/snippets/Cwise_quotient.cpp
index 7cb9f7f..ab8b506 100644
--- a/doc/snippets/Cwise_quotient.cpp
+++ b/doc/snippets/Cwise_quotient.cpp
@@ -1,2 +1,2 @@
-Array3d v(2,3,4), w(4,2,3);
-cout << v/w << endl;
+Array3d v(2, 3, 4), w(4, 2, 3);
+cout << v / w << endl;
diff --git a/doc/snippets/Cwise_rint.cpp b/doc/snippets/Cwise_rint.cpp
index 1dc7b2f..eb8bc84 100644
--- a/doc/snippets/Cwise_rint.cpp
+++ b/doc/snippets/Cwise_rint.cpp
@@ -1,3 +1,3 @@
-ArrayXd v = ArrayXd::LinSpaced(7,-2,2);
+ArrayXd v = ArrayXd::LinSpaced(7, -2, 2);
 cout << v << endl << endl;
 cout << rint(v) << endl;
diff --git a/doc/snippets/Cwise_round.cpp b/doc/snippets/Cwise_round.cpp
index e5c8823..d9ff417 100644
--- a/doc/snippets/Cwise_round.cpp
+++ b/doc/snippets/Cwise_round.cpp
@@ -1,3 +1,3 @@
-ArrayXd v = ArrayXd::LinSpaced(7,-2,2);
+ArrayXd v = ArrayXd::LinSpaced(7, -2, 2);
 cout << v << endl << endl;
 cout << round(v) << endl;
diff --git a/doc/snippets/Cwise_scalar_power_array.cpp b/doc/snippets/Cwise_scalar_power_array.cpp
index c968b2c..65bb478 100644
--- a/doc/snippets/Cwise_scalar_power_array.cpp
+++ b/doc/snippets/Cwise_scalar_power_array.cpp
@@ -1,2 +1,2 @@
-Array<double,1,3> e(2,-3,1./3.);
-cout << "10^[" << e << "] = " << pow(10,e) << endl;
+Array<double, 1, 3> e(2, -3, 1. / 3.);
+cout << "10^[" << e << "] = " << pow(10, e) << endl;
diff --git a/doc/snippets/Cwise_sign.cpp b/doc/snippets/Cwise_sign.cpp
index 49920e4..55d24ab 100644
--- a/doc/snippets/Cwise_sign.cpp
+++ b/doc/snippets/Cwise_sign.cpp
@@ -1,2 +1,2 @@
-Array3d v(-3,5,0);
+Array3d v(-3, 5, 0);
 cout << v.sign() << endl;
diff --git a/doc/snippets/Cwise_sin.cpp b/doc/snippets/Cwise_sin.cpp
index 46fa908..43c4a04 100644
--- a/doc/snippets/Cwise_sin.cpp
+++ b/doc/snippets/Cwise_sin.cpp
@@ -1,2 +1,2 @@
-Array3d v(M_PI, M_PI/2, M_PI/3);
+Array3d v(M_PI, M_PI / 2, M_PI / 3);
 cout << v.sin() << endl;
diff --git a/doc/snippets/Cwise_sinh.cpp b/doc/snippets/Cwise_sinh.cpp
index fac9b19..aefcd6d 100644
--- a/doc/snippets/Cwise_sinh.cpp
+++ b/doc/snippets/Cwise_sinh.cpp
@@ -1,2 +1,2 @@
-ArrayXd v = ArrayXd::LinSpaced(5,0,1);
+ArrayXd v = ArrayXd::LinSpaced(5, 0, 1);
 cout << sinh(v) << endl;
diff --git a/doc/snippets/Cwise_slash_equal.cpp b/doc/snippets/Cwise_slash_equal.cpp
index 2efd32d..cb776b8 100644
--- a/doc/snippets/Cwise_slash_equal.cpp
+++ b/doc/snippets/Cwise_slash_equal.cpp
@@ -1,3 +1,3 @@
-Array3d v(3,2,4), w(5,4,2);
+Array3d v(3, 2, 4), w(5, 4, 2);
 v /= w;
 cout << v << endl;
diff --git a/doc/snippets/Cwise_sqrt.cpp b/doc/snippets/Cwise_sqrt.cpp
index 97bafe8..e0e5d36 100644
--- a/doc/snippets/Cwise_sqrt.cpp
+++ b/doc/snippets/Cwise_sqrt.cpp
@@ -1,2 +1,2 @@
-Array3d v(1,2,4);
+Array3d v(1, 2, 4);
 cout << v.sqrt() << endl;
diff --git a/doc/snippets/Cwise_square.cpp b/doc/snippets/Cwise_square.cpp
index f704c5e..2b3132e 100644
--- a/doc/snippets/Cwise_square.cpp
+++ b/doc/snippets/Cwise_square.cpp
@@ -1,2 +1,2 @@
-Array3d v(2,3,4);
+Array3d v(2, 3, 4);
 cout << v.square() << endl;
diff --git a/doc/snippets/Cwise_tan.cpp b/doc/snippets/Cwise_tan.cpp
index b758ef0..abe8d1c 100644
--- a/doc/snippets/Cwise_tan.cpp
+++ b/doc/snippets/Cwise_tan.cpp
@@ -1,2 +1,2 @@
-Array3d v(M_PI, M_PI/2, M_PI/3);
+Array3d v(M_PI, M_PI / 2, M_PI / 3);
 cout << v.tan() << endl;
diff --git a/doc/snippets/Cwise_tanh.cpp b/doc/snippets/Cwise_tanh.cpp
index 30cd045..ae8fea5 100644
--- a/doc/snippets/Cwise_tanh.cpp
+++ b/doc/snippets/Cwise_tanh.cpp
@@ -1,2 +1,2 @@
-ArrayXd v = ArrayXd::LinSpaced(5,0,1);
+ArrayXd v = ArrayXd::LinSpaced(5, 0, 1);
 cout << tanh(v) << endl;
diff --git a/doc/snippets/Cwise_times_equal.cpp b/doc/snippets/Cwise_times_equal.cpp
index 147556c..45151be 100644
--- a/doc/snippets/Cwise_times_equal.cpp
+++ b/doc/snippets/Cwise_times_equal.cpp
@@ -1,3 +1,3 @@
-Array3d v(1,2,3), w(2,3,0);
+Array3d v(1, 2, 3), w(2, 3, 0);
 v *= w;
 cout << v << endl;
diff --git a/doc/snippets/DenseBase_LinSpaced.cpp b/doc/snippets/DenseBase_LinSpaced.cpp
index 8e54b17..a57053f 100644
--- a/doc/snippets/DenseBase_LinSpaced.cpp
+++ b/doc/snippets/DenseBase_LinSpaced.cpp
@@ -1,2 +1,2 @@
-cout << VectorXi::LinSpaced(4,7,10).transpose() << endl;
-cout << VectorXd::LinSpaced(5,0.0,1.0).transpose() << endl;
+cout << VectorXi::LinSpaced(4, 7, 10).transpose() << endl;
+cout << VectorXd::LinSpaced(5, 0.0, 1.0).transpose() << endl;
diff --git a/doc/snippets/DenseBase_LinSpacedInt.cpp b/doc/snippets/DenseBase_LinSpacedInt.cpp
index 0d7ae06..732d70a 100644
--- a/doc/snippets/DenseBase_LinSpacedInt.cpp
+++ b/doc/snippets/DenseBase_LinSpacedInt.cpp
@@ -1,8 +1,8 @@
 cout << "Even spacing inputs:" << endl;
-cout << VectorXi::LinSpaced(8,1,4).transpose() << endl;
-cout << VectorXi::LinSpaced(8,1,8).transpose() << endl;
-cout << VectorXi::LinSpaced(8,1,15).transpose() << endl;
+cout << VectorXi::LinSpaced(8, 1, 4).transpose() << endl;
+cout << VectorXi::LinSpaced(8, 1, 8).transpose() << endl;
+cout << VectorXi::LinSpaced(8, 1, 15).transpose() << endl;
 cout << "Uneven spacing inputs:" << endl;
-cout << VectorXi::LinSpaced(8,1,7).transpose() << endl;
-cout << VectorXi::LinSpaced(8,1,9).transpose() << endl;
-cout << VectorXi::LinSpaced(8,1,16).transpose() << endl;
+cout << VectorXi::LinSpaced(8, 1, 7).transpose() << endl;
+cout << VectorXi::LinSpaced(8, 1, 9).transpose() << endl;
+cout << VectorXi::LinSpaced(8, 1, 16).transpose() << endl;
diff --git a/doc/snippets/DenseBase_LinSpaced_seq_deprecated.cpp b/doc/snippets/DenseBase_LinSpaced_seq_deprecated.cpp
index f55c508..3c4a565 100644
--- a/doc/snippets/DenseBase_LinSpaced_seq_deprecated.cpp
+++ b/doc/snippets/DenseBase_LinSpaced_seq_deprecated.cpp
@@ -1,2 +1,2 @@
-cout << VectorXi::LinSpaced(Sequential,4,7,10).transpose() << endl;
-cout << VectorXd::LinSpaced(Sequential,5,0.0,1.0).transpose() << endl;
+cout << VectorXi::LinSpaced(Sequential, 4, 7, 10).transpose() << endl;
+cout << VectorXd::LinSpaced(Sequential, 5, 0.0, 1.0).transpose() << endl;
diff --git a/doc/snippets/DenseBase_setLinSpaced.cpp b/doc/snippets/DenseBase_setLinSpaced.cpp
index 46054f2..6c1eca6 100644
--- a/doc/snippets/DenseBase_setLinSpaced.cpp
+++ b/doc/snippets/DenseBase_setLinSpaced.cpp
@@ -1,3 +1,3 @@
 VectorXf v;
-v.setLinSpaced(5,0.5f,1.5f);
+v.setLinSpaced(5, 0.5f, 1.5f);
 cout << v << endl;
diff --git a/doc/snippets/DirectionWise_hnormalized.cpp b/doc/snippets/DirectionWise_hnormalized.cpp
index 2451f6e..8a46652 100644
--- a/doc/snippets/DirectionWise_hnormalized.cpp
+++ b/doc/snippets/DirectionWise_hnormalized.cpp
@@ -1,6 +1,6 @@
-Matrix4Xd M = Matrix4Xd::Random(4,5);
+Matrix4Xd M = Matrix4Xd::Random(4, 5);
 Projective3d P(Matrix4d::Random());
 cout << "The matrix M is:" << endl << M << endl << endl;
 cout << "M.colwise().hnormalized():" << endl << M.colwise().hnormalized() << endl << endl;
-cout << "P*M:" << endl << P*M << endl << endl;
-cout << "(P*M).colwise().hnormalized():" << endl << (P*M).colwise().hnormalized() << endl << endl;
+cout << "P*M:" << endl << P * M << endl << endl;
+cout << "(P*M).colwise().hnormalized():" << endl << (P * M).colwise().hnormalized() << endl << endl;
diff --git a/doc/snippets/DirectionWise_replicate.cpp b/doc/snippets/DirectionWise_replicate.cpp
index d92d4a3..c448307 100644
--- a/doc/snippets/DirectionWise_replicate.cpp
+++ b/doc/snippets/DirectionWise_replicate.cpp
@@ -1,4 +1,4 @@
-MatrixXi m = MatrixXi::Random(2,3);
+MatrixXi m = MatrixXi::Random(2, 3);
 cout << "Here is the matrix m:" << endl << m << endl;
 cout << "m.colwise().replicate<3>() = ..." << endl;
 cout << m.colwise().replicate<3>() << endl;
diff --git a/doc/snippets/EigenSolver_EigenSolver_MatrixType.cpp b/doc/snippets/EigenSolver_EigenSolver_MatrixType.cpp
index c1d9fa8..b54425f 100644
--- a/doc/snippets/EigenSolver_EigenSolver_MatrixType.cpp
+++ b/doc/snippets/EigenSolver_EigenSolver_MatrixType.cpp
@@ -1,4 +1,4 @@
-MatrixXd A = MatrixXd::Random(6,6);
+MatrixXd A = MatrixXd::Random(6, 6);
 cout << "Here is a random 6x6 matrix, A:" << endl << A << endl << endl;
 
 EigenSolver<MatrixXd> es(A);
diff --git a/doc/snippets/EigenSolver_compute.cpp b/doc/snippets/EigenSolver_compute.cpp
index a5c96e9..1652463 100644
--- a/doc/snippets/EigenSolver_compute.cpp
+++ b/doc/snippets/EigenSolver_compute.cpp
@@ -1,6 +1,6 @@
 EigenSolver<MatrixXf> es;
-MatrixXf A = MatrixXf::Random(4,4);
+MatrixXf A = MatrixXf::Random(4, 4);
 es.compute(A, /* computeEigenvectors = */ false);
 cout << "The eigenvalues of A are: " << es.eigenvalues().transpose() << endl;
-es.compute(A + MatrixXf::Identity(4,4), false); // re-use es to compute eigenvalues of A+I
+es.compute(A + MatrixXf::Identity(4, 4), false);  // re-use es to compute eigenvalues of A+I
 cout << "The eigenvalues of A+I are: " << es.eigenvalues().transpose() << endl;
diff --git a/doc/snippets/EigenSolver_eigenvalues.cpp b/doc/snippets/EigenSolver_eigenvalues.cpp
index ed28869..866183c 100644
--- a/doc/snippets/EigenSolver_eigenvalues.cpp
+++ b/doc/snippets/EigenSolver_eigenvalues.cpp
@@ -1,4 +1,3 @@
-MatrixXd ones = MatrixXd::Ones(3,3);
+MatrixXd ones = MatrixXd::Ones(3, 3);
 EigenSolver<MatrixXd> es(ones, false);
-cout << "The eigenvalues of the 3x3 matrix of ones are:" 
-     << endl << es.eigenvalues() << endl;
+cout << "The eigenvalues of the 3x3 matrix of ones are:" << endl << es.eigenvalues() << endl;
diff --git a/doc/snippets/EigenSolver_eigenvectors.cpp b/doc/snippets/EigenSolver_eigenvectors.cpp
index 8355f76..6d4606d 100644
--- a/doc/snippets/EigenSolver_eigenvectors.cpp
+++ b/doc/snippets/EigenSolver_eigenvectors.cpp
@@ -1,4 +1,3 @@
-MatrixXd ones = MatrixXd::Ones(3,3);
+MatrixXd ones = MatrixXd::Ones(3, 3);
 EigenSolver<MatrixXd> es(ones);
-cout << "The first eigenvector of the 3x3 matrix of ones is:"
-     << endl << es.eigenvectors().col(0) << endl;
+cout << "The first eigenvector of the 3x3 matrix of ones is:" << endl << es.eigenvectors().col(0) << endl;
diff --git a/doc/snippets/EigenSolver_pseudoEigenvectors.cpp b/doc/snippets/EigenSolver_pseudoEigenvectors.cpp
index 85e2569..d9f3698 100644
--- a/doc/snippets/EigenSolver_pseudoEigenvectors.cpp
+++ b/doc/snippets/EigenSolver_pseudoEigenvectors.cpp
@@ -1,4 +1,4 @@
-MatrixXd A = MatrixXd::Random(6,6);
+MatrixXd A = MatrixXd::Random(6, 6);
 cout << "Here is a random 6x6 matrix, A:" << endl << A << endl << endl;
 
 EigenSolver<MatrixXd> es(A);
diff --git a/doc/snippets/FullPivHouseholderQR_solve.cpp b/doc/snippets/FullPivHouseholderQR_solve.cpp
index 23bc074..621d1d1 100644
--- a/doc/snippets/FullPivHouseholderQR_solve.cpp
+++ b/doc/snippets/FullPivHouseholderQR_solve.cpp
@@ -4,5 +4,5 @@
 cout << "Here is the matrix y:" << endl << y << endl;
 Matrix3f x;
 x = m.fullPivHouseholderQr().solve(y);
-assert(y.isApprox(m*x));
+assert(y.isApprox(m* x));
 cout << "Here is a solution x to the equation mx=y:" << endl << x << endl;
diff --git a/doc/snippets/FullPivLU_image.cpp b/doc/snippets/FullPivLU_image.cpp
index 817bc1e..a8f664e 100644
--- a/doc/snippets/FullPivLU_image.cpp
+++ b/doc/snippets/FullPivLU_image.cpp
@@ -1,9 +1,7 @@
 Matrix3d m;
-m << 1,1,0,
-     1,3,2,
-     0,1,1;
+m << 1, 1, 0, 1, 3, 2, 0, 1, 1;
 cout << "Here is the matrix m:" << endl << m << endl;
 cout << "Notice that the middle column is the sum of the two others, so the "
      << "columns are linearly dependent." << endl;
-cout << "Here is a matrix whose columns have the same span but are linearly independent:"
-     << endl << m.fullPivLu().image(m) << endl;
+cout << "Here is a matrix whose columns have the same span but are linearly independent:" << endl
+     << m.fullPivLu().image(m) << endl;
diff --git a/doc/snippets/FullPivLU_kernel.cpp b/doc/snippets/FullPivLU_kernel.cpp
index 7086e01..448a515 100644
--- a/doc/snippets/FullPivLU_kernel.cpp
+++ b/doc/snippets/FullPivLU_kernel.cpp
@@ -1,7 +1,5 @@
-MatrixXf m = MatrixXf::Random(3,5);
+MatrixXf m = MatrixXf::Random(3, 5);
 cout << "Here is the matrix m:" << endl << m << endl;
 MatrixXf ker = m.fullPivLu().kernel();
-cout << "Here is a matrix whose columns form a basis of the kernel of m:"
-     << endl << ker << endl;
-cout << "By definition of the kernel, m*ker is zero:"
-     << endl << m*ker << endl;
+cout << "Here is a matrix whose columns form a basis of the kernel of m:" << endl << ker << endl;
+cout << "By definition of the kernel, m*ker is zero:" << endl << m * ker << endl;
diff --git a/doc/snippets/FullPivLU_solve.cpp b/doc/snippets/FullPivLU_solve.cpp
index c1f8823..a4ecb83 100644
--- a/doc/snippets/FullPivLU_solve.cpp
+++ b/doc/snippets/FullPivLU_solve.cpp
@@ -1,11 +1,9 @@
-Matrix<float,2,3> m = Matrix<float,2,3>::Random();
+Matrix<float, 2, 3> m = Matrix<float, 2, 3>::Random();
 Matrix2f y = Matrix2f::Random();
 cout << "Here is the matrix m:" << endl << m << endl;
 cout << "Here is the matrix y:" << endl << y << endl;
-Matrix<float,3,2> x = m.fullPivLu().solve(y);
-if((m*x).isApprox(y))
-{
+Matrix<float, 3, 2> x = m.fullPivLu().solve(y);
+if ((m * x).isApprox(y)) {
   cout << "Here is a solution x to the equation mx=y:" << endl << x << endl;
-}
-else
+} else
   cout << "The equation mx=y does not have any solution." << endl;
diff --git a/doc/snippets/GeneralizedEigenSolver.cpp b/doc/snippets/GeneralizedEigenSolver.cpp
index 2acda45..f7a7254 100644
--- a/doc/snippets/GeneralizedEigenSolver.cpp
+++ b/doc/snippets/GeneralizedEigenSolver.cpp
@@ -1,6 +1,6 @@
 GeneralizedEigenSolver<MatrixXf> ges;
-MatrixXf A = MatrixXf::Random(4,4);
-MatrixXf B = MatrixXf::Random(4,4);
+MatrixXf A = MatrixXf::Random(4, 4);
+MatrixXf B = MatrixXf::Random(4, 4);
 ges.compute(A, B);
 cout << "The (complex) numerators of the generalzied eigenvalues are: " << ges.alphas().transpose() << endl;
 cout << "The (real) denominatore of the generalzied eigenvalues are: " << ges.betas().transpose() << endl;
diff --git a/doc/snippets/HessenbergDecomposition_compute.cpp b/doc/snippets/HessenbergDecomposition_compute.cpp
index 50e3783..298b40b 100644
--- a/doc/snippets/HessenbergDecomposition_compute.cpp
+++ b/doc/snippets/HessenbergDecomposition_compute.cpp
@@ -1,6 +1,6 @@
-MatrixXcf A = MatrixXcf::Random(4,4);
+MatrixXcf A = MatrixXcf::Random(4, 4);
 HessenbergDecomposition<MatrixXcf> hd(4);
 hd.compute(A);
 cout << "The matrix H in the decomposition of A is:" << endl << hd.matrixH() << endl;
-hd.compute(2*A); // re-use hd to compute and store decomposition of 2A
+hd.compute(2 * A);  // re-use hd to compute and store decomposition of 2A
 cout << "The matrix H in the decomposition of 2A is:" << endl << hd.matrixH() << endl;
diff --git a/doc/snippets/HessenbergDecomposition_matrixH.cpp b/doc/snippets/HessenbergDecomposition_matrixH.cpp
index af01366..1386feb 100644
--- a/doc/snippets/HessenbergDecomposition_matrixH.cpp
+++ b/doc/snippets/HessenbergDecomposition_matrixH.cpp
@@ -1,4 +1,4 @@
-Matrix4f A = MatrixXf::Random(4,4);
+Matrix4f A = MatrixXf::Random(4, 4);
 cout << "Here is a random 4x4 matrix:" << endl << A << endl;
 HessenbergDecomposition<MatrixXf> hessOfA(A);
 MatrixXf H = hessOfA.matrixH();
diff --git a/doc/snippets/HessenbergDecomposition_packedMatrix.cpp b/doc/snippets/HessenbergDecomposition_packedMatrix.cpp
index 4fa5957..66c1fd0 100644
--- a/doc/snippets/HessenbergDecomposition_packedMatrix.cpp
+++ b/doc/snippets/HessenbergDecomposition_packedMatrix.cpp
@@ -1,9 +1,8 @@
-Matrix4d A = Matrix4d::Random(4,4);
+Matrix4d A = Matrix4d::Random(4, 4);
 cout << "Here is a random 4x4 matrix:" << endl << A << endl;
 HessenbergDecomposition<Matrix4d> hessOfA(A);
 Matrix4d pm = hessOfA.packedMatrix();
 cout << "The packed matrix M is:" << endl << pm << endl;
-cout << "The upper Hessenberg part corresponds to the matrix H, which is:" 
-     << endl << hessOfA.matrixH() << endl;
+cout << "The upper Hessenberg part corresponds to the matrix H, which is:" << endl << hessOfA.matrixH() << endl;
 Vector3d hc = hessOfA.householderCoefficients();
 cout << "The vector of Householder coefficients is:" << endl << hc << endl;
diff --git a/doc/snippets/HouseholderQR_householderQ.cpp b/doc/snippets/HouseholderQR_householderQ.cpp
index e859ce5..6b5cb92 100644
--- a/doc/snippets/HouseholderQR_householderQ.cpp
+++ b/doc/snippets/HouseholderQR_householderQ.cpp
@@ -1,4 +1,4 @@
-MatrixXf A(MatrixXf::Random(5,3)), thinQ(MatrixXf::Identity(5,3)), Q;
+MatrixXf A(MatrixXf::Random(5, 3)), thinQ(MatrixXf::Identity(5, 3)), Q;
 A.setRandom();
 HouseholderQR<MatrixXf> qr(A);
 Q = qr.householderQ();
diff --git a/doc/snippets/HouseholderQR_solve.cpp b/doc/snippets/HouseholderQR_solve.cpp
index 8cce6ce..35d70ba 100644
--- a/doc/snippets/HouseholderQR_solve.cpp
+++ b/doc/snippets/HouseholderQR_solve.cpp
@@ -1,9 +1,9 @@
-typedef Matrix<float,3,3> Matrix3x3;
+typedef Matrix<float, 3, 3> Matrix3x3;
 Matrix3x3 m = Matrix3x3::Random();
 Matrix3f y = Matrix3f::Random();
 cout << "Here is the matrix m:" << endl << m << endl;
 cout << "Here is the matrix y:" << endl << y << endl;
 Matrix3f x;
 x = m.householderQr().solve(y);
-assert(y.isApprox(m*x));
+assert(y.isApprox(m* x));
 cout << "Here is a solution x to the equation mx=y:" << endl << x << endl;
diff --git a/doc/snippets/HouseholderSequence_HouseholderSequence.cpp b/doc/snippets/HouseholderSequence_HouseholderSequence.cpp
index 2632b83..ae088e6 100644
--- a/doc/snippets/HouseholderSequence_HouseholderSequence.cpp
+++ b/doc/snippets/HouseholderSequence_HouseholderSequence.cpp
@@ -2,10 +2,10 @@
 cout << "The matrix v is:" << endl;
 cout << v << endl;
 
-Vector3d v0(1, v(1,0), v(2,0));
+Vector3d v0(1, v(1, 0), v(2, 0));
 cout << "The first Householder vector is: v_0 = " << v0.transpose() << endl;
-Vector3d v1(0, 1, v(2,1));
-cout << "The second Householder vector is: v_1 = " << v1.transpose()  << endl;
+Vector3d v1(0, 1, v(2, 1));
+cout << "The second Householder vector is: v_1 = " << v1.transpose() << endl;
 Vector3d v2(0, 0, 1);
 cout << "The third Householder vector is: v_2 = " << v2.transpose() << endl;
 
diff --git a/doc/snippets/JacobiSVD_basic.cpp b/doc/snippets/JacobiSVD_basic.cpp
index 6c21baf..f451727 100644
--- a/doc/snippets/JacobiSVD_basic.cpp
+++ b/doc/snippets/JacobiSVD_basic.cpp
@@ -1,4 +1,4 @@
-MatrixXf m = MatrixXf::Random(3,2);
+MatrixXf m = MatrixXf::Random(3, 2);
 cout << "Here is the matrix m:" << endl << m << endl;
 JacobiSVD<MatrixXf, ComputeThinU | ComputeThinV> svd(m);
 cout << "Its singular values are:" << endl << svd.singularValues() << endl;
diff --git a/doc/snippets/LLT_example.cpp b/doc/snippets/LLT_example.cpp
index 46fb407..c464ac9 100644
--- a/doc/snippets/LLT_example.cpp
+++ b/doc/snippets/LLT_example.cpp
@@ -1,9 +1,9 @@
-MatrixXd A(3,3);
-A << 4,-1,2, -1,6,0, 2,0,5;
+MatrixXd A(3, 3);
+A << 4, -1, 2, -1, 6, 0, 2, 0, 5;
 cout << "The matrix A is" << endl << A << endl;
 
-LLT<MatrixXd> lltOfA(A); // compute the Cholesky decomposition of A
-MatrixXd L = lltOfA.matrixL(); // retrieve factor L  in the decomposition
+LLT<MatrixXd> lltOfA(A);        // compute the Cholesky decomposition of A
+MatrixXd L = lltOfA.matrixL();  // retrieve factor L  in the decomposition
 // The previous two lines can also be written as "L = A.llt().matrixL()"
 
 cout << "The Cholesky factor L is" << endl << L << endl;
diff --git a/doc/snippets/LLT_solve.cpp b/doc/snippets/LLT_solve.cpp
index 7095d2c..52659ab 100644
--- a/doc/snippets/LLT_solve.cpp
+++ b/doc/snippets/LLT_solve.cpp
@@ -1,8 +1,7 @@
-typedef Matrix<float,Dynamic,2> DataMatrix;
+typedef Matrix<float, Dynamic, 2> DataMatrix;
 // let's generate some samples on the 3D plane of equation z = 2x+3y (with some noise)
-DataMatrix samples = DataMatrix::Random(12,2);
-VectorXf elevations = 2*samples.col(0) + 3*samples.col(1) + VectorXf::Random(12)*0.1;
+DataMatrix samples = DataMatrix::Random(12, 2);
+VectorXf elevations = 2 * samples.col(0) + 3 * samples.col(1) + VectorXf::Random(12) * 0.1;
 // and let's solve samples * [x y]^T = elevations in least square sense:
-Matrix<float,2,1> xy
- = (samples.adjoint() * samples).llt().solve((samples.adjoint()*elevations));
+Matrix<float, 2, 1> xy = (samples.adjoint() * samples).llt().solve((samples.adjoint() * elevations));
 cout << xy << endl;
diff --git a/doc/snippets/LeastSquaresNormalEquations.cpp b/doc/snippets/LeastSquaresNormalEquations.cpp
index 997cf17..00434f7 100644
--- a/doc/snippets/LeastSquaresNormalEquations.cpp
+++ b/doc/snippets/LeastSquaresNormalEquations.cpp
@@ -1,4 +1,3 @@
 MatrixXf A = MatrixXf::Random(3, 2);
 VectorXf b = VectorXf::Random(3);
-cout << "The solution using normal equations is:\n"
-     << (A.transpose() * A).ldlt().solve(A.transpose() * b) << endl;
+cout << "The solution using normal equations is:\n" << (A.transpose() * A).ldlt().solve(A.transpose() * b) << endl;
diff --git a/doc/snippets/LeastSquaresQR.cpp b/doc/snippets/LeastSquaresQR.cpp
index 6c97045..9f8f723 100644
--- a/doc/snippets/LeastSquaresQR.cpp
+++ b/doc/snippets/LeastSquaresQR.cpp
@@ -1,4 +1,3 @@
 MatrixXf A = MatrixXf::Random(3, 2);
 VectorXf b = VectorXf::Random(3);
-cout << "The solution using the QR decomposition is:\n"
-     << A.colPivHouseholderQr().solve(b) << endl;
+cout << "The solution using the QR decomposition is:\n" << A.colPivHouseholderQr().solve(b) << endl;
diff --git a/doc/snippets/Map_general_stride.cpp b/doc/snippets/Map_general_stride.cpp
index 0657e7f..e2677ff 100644
--- a/doc/snippets/Map_general_stride.cpp
+++ b/doc/snippets/Map_general_stride.cpp
@@ -1,5 +1,3 @@
 int array[24];
-for(int i = 0; i < 24; ++i) array[i] = i;
-cout << Map<MatrixXi, 0, Stride<Dynamic,2> >
-         (array, 3, 3, Stride<Dynamic,2>(8, 2))
-     << endl;
+for (int i = 0; i < 24; ++i) array[i] = i;
+cout << Map<MatrixXi, 0, Stride<Dynamic, 2> >(array, 3, 3, Stride<Dynamic, 2>(8, 2)) << endl;
diff --git a/doc/snippets/Map_inner_stride.cpp b/doc/snippets/Map_inner_stride.cpp
index d95ae9b..f315756 100644
--- a/doc/snippets/Map_inner_stride.cpp
+++ b/doc/snippets/Map_inner_stride.cpp
@@ -1,5 +1,4 @@
 int array[12];
-for(int i = 0; i < 12; ++i) array[i] = i;
-cout << Map<VectorXi, 0, InnerStride<2> >
-         (array, 6) // the inner stride has already been passed as template parameter
+for (int i = 0; i < 12; ++i) array[i] = i;
+cout << Map<VectorXi, 0, InnerStride<2> >(array, 6)  // the inner stride has already been passed as template parameter
      << endl;
diff --git a/doc/snippets/Map_outer_stride.cpp b/doc/snippets/Map_outer_stride.cpp
index 2f6f052..75b1655 100644
--- a/doc/snippets/Map_outer_stride.cpp
+++ b/doc/snippets/Map_outer_stride.cpp
@@ -1,3 +1,3 @@
 int array[12];
-for(int i = 0; i < 12; ++i) array[i] = i;
+for (int i = 0; i < 12; ++i) array[i] = i;
 cout << Map<MatrixXi, 0, OuterStride<> >(array, 3, 3, OuterStride<>(4)) << endl;
diff --git a/doc/snippets/Map_placement_new.cpp b/doc/snippets/Map_placement_new.cpp
index 83b83a8..eb5213d 100644
--- a/doc/snippets/Map_placement_new.cpp
+++ b/doc/snippets/Map_placement_new.cpp
@@ -1,5 +1,5 @@
-int data[] = {1,2,3,4,5,6,7,8,9};
-Map<RowVectorXi> v(data,4);
+int data[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
+Map<RowVectorXi> v(data, 4);
 cout << "The mapped vector v is: " << v << "\n";
-new (&v) Map<RowVectorXi>(data+4,5);
+new (&v) Map<RowVectorXi>(data + 4, 5);
 cout << "Now v is: " << v << "\n";
diff --git a/doc/snippets/Map_simple.cpp b/doc/snippets/Map_simple.cpp
index 423bb52..3e8fa81 100644
--- a/doc/snippets/Map_simple.cpp
+++ b/doc/snippets/Map_simple.cpp
@@ -1,3 +1,3 @@
 int array[9];
-for(int i = 0; i < 9; ++i) array[i] = i;
+for (int i = 0; i < 9; ++i) array[i] = i;
 cout << Map<Matrix3i>(array) << endl;
diff --git a/doc/snippets/MatrixBase_all.cpp b/doc/snippets/MatrixBase_all.cpp
index 46f26f1..f31d10c 100644
--- a/doc/snippets/MatrixBase_all.cpp
+++ b/doc/snippets/MatrixBase_all.cpp
@@ -1,7 +1,7 @@
 Vector3f boxMin(Vector3f::Zero()), boxMax(Vector3f::Ones());
 Vector3f p0 = Vector3f::Random(), p1 = Vector3f::Random().cwiseAbs();
 // let's check if p0 and p1 are inside the axis aligned box defined by the corners boxMin,boxMax:
-cout << "Is (" << p0.transpose() << ") inside the box: "
-     << ((boxMin.array()<p0.array()).all() && (boxMax.array()>p0.array()).all()) << endl;
-cout << "Is (" << p1.transpose() << ") inside the box: "
-     << ((boxMin.array()<p1.array()).all() && (boxMax.array()>p1.array()).all()) << endl;
+cout << "Is (" << p0.transpose()
+     << ") inside the box: " << ((boxMin.array() < p0.array()).all() && (boxMax.array() > p0.array()).all()) << endl;
+cout << "Is (" << p1.transpose()
+     << ") inside the box: " << ((boxMin.array() < p1.array()).all() && (boxMax.array() > p1.array()).all()) << endl;
diff --git a/doc/snippets/MatrixBase_applyOnTheLeft.cpp b/doc/snippets/MatrixBase_applyOnTheLeft.cpp
index 6398c87..00676a3 100644
--- a/doc/snippets/MatrixBase_applyOnTheLeft.cpp
+++ b/doc/snippets/MatrixBase_applyOnTheLeft.cpp
@@ -1,7 +1,5 @@
-Matrix3f A = Matrix3f::Random(3,3), B;
-B << 0,1,0,  
-     0,0,1,  
-     1,0,0;
+Matrix3f A = Matrix3f::Random(3, 3), B;
+B << 0, 1, 0, 0, 0, 1, 1, 0, 0;
 cout << "At start, A = " << endl << A << endl;
-A.applyOnTheLeft(B); 
+A.applyOnTheLeft(B);
 cout << "After applyOnTheLeft, A = " << endl << A << endl;
diff --git a/doc/snippets/MatrixBase_applyOnTheRight.cpp b/doc/snippets/MatrixBase_applyOnTheRight.cpp
index e4b71b2..a1008c6 100644
--- a/doc/snippets/MatrixBase_applyOnTheRight.cpp
+++ b/doc/snippets/MatrixBase_applyOnTheRight.cpp
@@ -1,7 +1,5 @@
-Matrix3f A = Matrix3f::Random(3,3), B;
-B << 0,1,0,  
-     0,0,1,  
-     1,0,0;
+Matrix3f A = Matrix3f::Random(3, 3), B;
+B << 0, 1, 0, 0, 0, 1, 1, 0, 0;
 cout << "At start, A = " << endl << A << endl;
 A *= B;
 cout << "After A *= B, A = " << endl << A << endl;
diff --git a/doc/snippets/MatrixBase_array.cpp b/doc/snippets/MatrixBase_array.cpp
index f215086..456d1d6 100644
--- a/doc/snippets/MatrixBase_array.cpp
+++ b/doc/snippets/MatrixBase_array.cpp
@@ -1,4 +1,4 @@
-Vector3d v(1,2,3);
+Vector3d v(1, 2, 3);
 v.array() += 3;
 v.array() -= 2;
 cout << v << endl;
diff --git a/doc/snippets/MatrixBase_array_const.cpp b/doc/snippets/MatrixBase_array_const.cpp
index cd3b26a..e662f6c 100644
--- a/doc/snippets/MatrixBase_array_const.cpp
+++ b/doc/snippets/MatrixBase_array_const.cpp
@@ -1,4 +1,4 @@
-Vector3d v(-1,2,-3);
+Vector3d v(-1, 2, -3);
 cout << "the absolute values:" << endl << v.array().abs() << endl;
-cout << "the absolute values plus one:" << endl << v.array().abs()+1 << endl;
+cout << "the absolute values plus one:" << endl << v.array().abs() + 1 << endl;
 cout << "sum of the squares: " << v.array().square().sum() << endl;
diff --git a/doc/snippets/MatrixBase_asDiagonal.cpp b/doc/snippets/MatrixBase_asDiagonal.cpp
index b01082d..637e95b 100644
--- a/doc/snippets/MatrixBase_asDiagonal.cpp
+++ b/doc/snippets/MatrixBase_asDiagonal.cpp
@@ -1 +1 @@
-cout << Matrix3i(Vector3i(2,5,6).asDiagonal()) << endl;
+cout << Matrix3i(Vector3i(2, 5, 6).asDiagonal()) << endl;
diff --git a/doc/snippets/MatrixBase_block_int_int.cpp b/doc/snippets/MatrixBase_block_int_int.cpp
index f99b6d4..ade73ee 100644
--- a/doc/snippets/MatrixBase_block_int_int.cpp
+++ b/doc/snippets/MatrixBase_block_int_int.cpp
@@ -1,5 +1,5 @@
 Matrix4i m = Matrix4i::Random();
 cout << "Here is the matrix m:" << endl << m << endl;
-cout << "Here is m.block<2,2>(1,1):" << endl << m.block<2,2>(1,1) << endl;
-m.block<2,2>(1,1).setZero();
+cout << "Here is m.block<2,2>(1,1):" << endl << m.block<2, 2>(1, 1) << endl;
+m.block<2, 2>(1, 1).setZero();
 cout << "Now the matrix m is:" << endl << m << endl;
diff --git a/doc/snippets/MatrixBase_col.cpp b/doc/snippets/MatrixBase_col.cpp
index 87c91b1..cf0241e 100644
--- a/doc/snippets/MatrixBase_col.cpp
+++ b/doc/snippets/MatrixBase_col.cpp
@@ -1,3 +1,3 @@
 Matrix3d m = Matrix3d::Identity();
-m.col(1) = Vector3d(4,5,6);
+m.col(1) = Vector3d(4, 5, 6);
 cout << m << endl;
diff --git a/doc/snippets/MatrixBase_colwise.cpp b/doc/snippets/MatrixBase_colwise.cpp
index a048bef..a31033d 100644
--- a/doc/snippets/MatrixBase_colwise.cpp
+++ b/doc/snippets/MatrixBase_colwise.cpp
@@ -1,5 +1,4 @@
 Matrix3d m = Matrix3d::Random();
 cout << "Here is the matrix m:" << endl << m << endl;
 cout << "Here is the sum of each column:" << endl << m.colwise().sum() << endl;
-cout << "Here is the maximum absolute value of each column:"
-     << endl << m.cwiseAbs().colwise().maxCoeff() << endl;
+cout << "Here is the maximum absolute value of each column:" << endl << m.cwiseAbs().colwise().maxCoeff() << endl;
diff --git a/doc/snippets/MatrixBase_colwise_iterator_cxx11.cpp b/doc/snippets/MatrixBase_colwise_iterator_cxx11.cpp
index 116063f..c033043 100644
--- a/doc/snippets/MatrixBase_colwise_iterator_cxx11.cpp
+++ b/doc/snippets/MatrixBase_colwise_iterator_cxx11.cpp
@@ -1,12 +1,11 @@
 Matrix3i m = Matrix3i::Random();
 cout << "Here is the initial matrix m:" << endl << m << endl;
 int i = -1;
-for(auto c: m.colwise()) {
+for (auto c : m.colwise()) {
   c *= i;
   ++i;
 }
 cout << "Here is the matrix m after the for-range-loop:" << endl << m << endl;
 auto cols = m.colwise();
-auto it = std::find_if(cols.cbegin(), cols.cend(),
-                       [](Matrix3i::ConstColXpr x) { return x.squaredNorm() == 0; });
-cout << "The first empty column is: " << distance(cols.cbegin(),it) << endl;
+auto it = std::find_if(cols.cbegin(), cols.cend(), [](Matrix3i::ConstColXpr x) { return x.squaredNorm() == 0; });
+cout << "The first empty column is: " << distance(cols.cbegin(), it) << endl;
diff --git a/doc/snippets/MatrixBase_computeInverseAndDetWithCheck.cpp b/doc/snippets/MatrixBase_computeInverseAndDetWithCheck.cpp
index a7b084f..774d4d4 100644
--- a/doc/snippets/MatrixBase_computeInverseAndDetWithCheck.cpp
+++ b/doc/snippets/MatrixBase_computeInverseAndDetWithCheck.cpp
@@ -3,11 +3,10 @@
 Matrix3d inverse;
 bool invertible;
 double determinant;
-m.computeInverseAndDetWithCheck(inverse,determinant,invertible);
+m.computeInverseAndDetWithCheck(inverse, determinant, invertible);
 cout << "Its determinant is " << determinant << endl;
-if(invertible) {
+if (invertible) {
   cout << "It is invertible, and its inverse is:" << endl << inverse << endl;
-}
-else {
+} else {
   cout << "It is not invertible." << endl;
 }
diff --git a/doc/snippets/MatrixBase_computeInverseWithCheck.cpp b/doc/snippets/MatrixBase_computeInverseWithCheck.cpp
index 873a9f8..7c95100 100644
--- a/doc/snippets/MatrixBase_computeInverseWithCheck.cpp
+++ b/doc/snippets/MatrixBase_computeInverseWithCheck.cpp
@@ -2,10 +2,9 @@
 cout << "Here is the matrix m:" << endl << m << endl;
 Matrix3d inverse;
 bool invertible;
-m.computeInverseWithCheck(inverse,invertible);
-if(invertible) {
+m.computeInverseWithCheck(inverse, invertible);
+if (invertible) {
   cout << "It is invertible, and its inverse is:" << endl << inverse << endl;
-}
-else {
+} else {
   cout << "It is not invertible." << endl;
 }
diff --git a/doc/snippets/MatrixBase_cwiseAbs.cpp b/doc/snippets/MatrixBase_cwiseAbs.cpp
index 28a3160..e424190 100644
--- a/doc/snippets/MatrixBase_cwiseAbs.cpp
+++ b/doc/snippets/MatrixBase_cwiseAbs.cpp
@@ -1,4 +1,3 @@
-MatrixXd m(2,3);
-m << 2, -4, 6,   
-     -5, 1, 0;
+MatrixXd m(2, 3);
+m << 2, -4, 6, -5, 1, 0;
 cout << m.cwiseAbs() << endl;
diff --git a/doc/snippets/MatrixBase_cwiseAbs2.cpp b/doc/snippets/MatrixBase_cwiseAbs2.cpp
index 889a2e2..952ba9d 100644
--- a/doc/snippets/MatrixBase_cwiseAbs2.cpp
+++ b/doc/snippets/MatrixBase_cwiseAbs2.cpp
@@ -1,4 +1,3 @@
-MatrixXd m(2,3);
-m << 2, -4, 6,   
-     -5, 1, 0;
+MatrixXd m(2, 3);
+m << 2, -4, 6, -5, 1, 0;
 cout << m.cwiseAbs2() << endl;
diff --git a/doc/snippets/MatrixBase_cwiseEqual.cpp b/doc/snippets/MatrixBase_cwiseEqual.cpp
index 469af64..dae553c 100644
--- a/doc/snippets/MatrixBase_cwiseEqual.cpp
+++ b/doc/snippets/MatrixBase_cwiseEqual.cpp
@@ -1,7 +1,6 @@
-MatrixXi m(2,2);
-m << 1, 0,
-     1, 1;
+MatrixXi m(2, 2);
+m << 1, 0, 1, 1;
 cout << "Comparing m with identity matrix:" << endl;
-cout << m.cwiseEqual(MatrixXi::Identity(2,2)) << endl;
-Index count = m.cwiseEqual(MatrixXi::Identity(2,2)).count();
+cout << m.cwiseEqual(MatrixXi::Identity(2, 2)) << endl;
+Index count = m.cwiseEqual(MatrixXi::Identity(2, 2)).count();
 cout << "Number of coefficients that are equal: " << count << endl;
diff --git a/doc/snippets/MatrixBase_cwiseInverse.cpp b/doc/snippets/MatrixBase_cwiseInverse.cpp
index 23e08f7..74551cb 100644
--- a/doc/snippets/MatrixBase_cwiseInverse.cpp
+++ b/doc/snippets/MatrixBase_cwiseInverse.cpp
@@ -1,4 +1,3 @@
-MatrixXd m(2,3);
-m << 2, 0.5, 1,   
-     3, 0.25, 1;
+MatrixXd m(2, 3);
+m << 2, 0.5, 1, 3, 0.25, 1;
 cout << m.cwiseInverse() << endl;
diff --git a/doc/snippets/MatrixBase_cwiseMax.cpp b/doc/snippets/MatrixBase_cwiseMax.cpp
index 3c95681..cd613b5 100644
--- a/doc/snippets/MatrixBase_cwiseMax.cpp
+++ b/doc/snippets/MatrixBase_cwiseMax.cpp
@@ -1,2 +1,2 @@
-Vector3d v(2,3,4), w(4,2,3);
+Vector3d v(2, 3, 4), w(4, 2, 3);
 cout << v.cwiseMax(w) << endl;
diff --git a/doc/snippets/MatrixBase_cwiseMin.cpp b/doc/snippets/MatrixBase_cwiseMin.cpp
index 82fc761..6fa93f3 100644
--- a/doc/snippets/MatrixBase_cwiseMin.cpp
+++ b/doc/snippets/MatrixBase_cwiseMin.cpp
@@ -1,2 +1,2 @@
-Vector3d v(2,3,4), w(4,2,3);
+Vector3d v(2, 3, 4), w(4, 2, 3);
 cout << v.cwiseMin(w) << endl;
diff --git a/doc/snippets/MatrixBase_cwiseNotEqual.cpp b/doc/snippets/MatrixBase_cwiseNotEqual.cpp
index 7f0a105..1a3ec73 100644
--- a/doc/snippets/MatrixBase_cwiseNotEqual.cpp
+++ b/doc/snippets/MatrixBase_cwiseNotEqual.cpp
@@ -1,7 +1,6 @@
-MatrixXi m(2,2);
-m << 1, 0,
-     1, 1;
+MatrixXi m(2, 2);
+m << 1, 0, 1, 1;
 cout << "Comparing m with identity matrix:" << endl;
-cout << m.cwiseNotEqual(MatrixXi::Identity(2,2)) << endl;
-Index count = m.cwiseNotEqual(MatrixXi::Identity(2,2)).count();
+cout << m.cwiseNotEqual(MatrixXi::Identity(2, 2)) << endl;
+Index count = m.cwiseNotEqual(MatrixXi::Identity(2, 2)).count();
 cout << "Number of coefficients that are not equal: " << count << endl;
diff --git a/doc/snippets/MatrixBase_cwiseProduct.cpp b/doc/snippets/MatrixBase_cwiseProduct.cpp
index 1db3a11..79540a9 100644
--- a/doc/snippets/MatrixBase_cwiseProduct.cpp
+++ b/doc/snippets/MatrixBase_cwiseProduct.cpp
@@ -1,4 +1,3 @@
 Matrix3i a = Matrix3i::Random(), b = Matrix3i::Random();
 Matrix3i c = a.cwiseProduct(b);
 cout << "a:\n" << a << "\nb:\n" << b << "\nc:\n" << c << endl;
-
diff --git a/doc/snippets/MatrixBase_cwiseQuotient.cpp b/doc/snippets/MatrixBase_cwiseQuotient.cpp
index 9691212..c78110f 100644
--- a/doc/snippets/MatrixBase_cwiseQuotient.cpp
+++ b/doc/snippets/MatrixBase_cwiseQuotient.cpp
@@ -1,2 +1,2 @@
-Vector3d v(2,3,4), w(4,2,3);
+Vector3d v(2, 3, 4), w(4, 2, 3);
 cout << v.cwiseQuotient(w) << endl;
diff --git a/doc/snippets/MatrixBase_cwiseSign.cpp b/doc/snippets/MatrixBase_cwiseSign.cpp
index efd7179..c2ee94d 100644
--- a/doc/snippets/MatrixBase_cwiseSign.cpp
+++ b/doc/snippets/MatrixBase_cwiseSign.cpp
@@ -1,4 +1,3 @@
-MatrixXd m(2,3);
-m <<  2, -4, 6,
-     -5,  1, 0;
+MatrixXd m(2, 3);
+m << 2, -4, 6, -5, 1, 0;
 cout << m.cwiseSign() << endl;
diff --git a/doc/snippets/MatrixBase_cwiseSqrt.cpp b/doc/snippets/MatrixBase_cwiseSqrt.cpp
index 4bfd75d..5bfb5f3 100644
--- a/doc/snippets/MatrixBase_cwiseSqrt.cpp
+++ b/doc/snippets/MatrixBase_cwiseSqrt.cpp
@@ -1,2 +1,2 @@
-Vector3d v(1,2,4);
+Vector3d v(1, 2, 4);
 cout << v.cwiseSqrt() << endl;
diff --git a/doc/snippets/MatrixBase_diagonal.cpp b/doc/snippets/MatrixBase_diagonal.cpp
index cd63413..c15dcf1 100644
--- a/doc/snippets/MatrixBase_diagonal.cpp
+++ b/doc/snippets/MatrixBase_diagonal.cpp
@@ -1,4 +1,3 @@
 Matrix3i m = Matrix3i::Random();
 cout << "Here is the matrix m:" << endl << m << endl;
-cout << "Here are the coefficients on the main diagonal of m:" << endl
-     << m.diagonal() << endl;
+cout << "Here are the coefficients on the main diagonal of m:" << endl << m.diagonal() << endl;
diff --git a/doc/snippets/MatrixBase_eigenvalues.cpp b/doc/snippets/MatrixBase_eigenvalues.cpp
index 039f887..010f45d 100644
--- a/doc/snippets/MatrixBase_eigenvalues.cpp
+++ b/doc/snippets/MatrixBase_eigenvalues.cpp
@@ -1,3 +1,3 @@
-MatrixXd ones = MatrixXd::Ones(3,3);
+MatrixXd ones = MatrixXd::Ones(3, 3);
 VectorXcd eivals = ones.eigenvalues();
 cout << "The eigenvalues of the 3x3 matrix of ones are:" << endl << eivals << endl;
diff --git a/doc/snippets/MatrixBase_fixedBlock_int_int.cpp b/doc/snippets/MatrixBase_fixedBlock_int_int.cpp
index 3201127..6a3a8cb 100644
--- a/doc/snippets/MatrixBase_fixedBlock_int_int.cpp
+++ b/doc/snippets/MatrixBase_fixedBlock_int_int.cpp
@@ -1,4 +1,4 @@
-Matrix4d m = Vector4d(1,2,3,4).asDiagonal();
+Matrix4d m = Vector4d(1, 2, 3, 4).asDiagonal();
 cout << "Here is the matrix m:" << endl << m << endl;
 cout << "Here is m.fixed<2, 2>(2, 2):" << endl << m.block<2, 2>(2, 2) << endl;
 m.block<2, 2>(2, 0) = m.block<2, 2>(2, 2);
diff --git a/doc/snippets/MatrixBase_hnormalized.cpp b/doc/snippets/MatrixBase_hnormalized.cpp
index b714adc..23334ac 100644
--- a/doc/snippets/MatrixBase_hnormalized.cpp
+++ b/doc/snippets/MatrixBase_hnormalized.cpp
@@ -2,5 +2,5 @@
 Projective3d P(Matrix4d::Random());
 cout << "v                   = " << v.transpose() << "]^T" << endl;
 cout << "v.hnormalized()     = " << v.hnormalized().transpose() << "]^T" << endl;
-cout << "P*v                 = " << (P*v).transpose() << "]^T" << endl;
-cout << "(P*v).hnormalized() = " << (P*v).hnormalized().transpose() << "]^T" << endl;
+cout << "P*v                 = " << (P * v).transpose() << "]^T" << endl;
+cout << "(P*v).hnormalized() = " << (P * v).hnormalized().transpose() << "]^T" << endl;
diff --git a/doc/snippets/MatrixBase_homogeneous.cpp b/doc/snippets/MatrixBase_homogeneous.cpp
index 2631960..6818f9b 100644
--- a/doc/snippets/MatrixBase_homogeneous.cpp
+++ b/doc/snippets/MatrixBase_homogeneous.cpp
@@ -3,4 +3,5 @@
 cout << "v                                   = [" << v.transpose() << "]^T" << endl;
 cout << "h.homogeneous()                     = [" << v.homogeneous().transpose() << "]^T" << endl;
 cout << "(P * v.homogeneous())               = [" << (P * v.homogeneous()).transpose() << "]^T" << endl;
-cout << "(P * v.homogeneous()).hnormalized() = [" << (P * v.homogeneous()).eval().hnormalized().transpose() << "]^T" << endl;
+cout << "(P * v.homogeneous()).hnormalized() = [" << (P * v.homogeneous()).eval().hnormalized().transpose() << "]^T"
+     << endl;
diff --git a/doc/snippets/MatrixBase_isDiagonal.cpp b/doc/snippets/MatrixBase_isDiagonal.cpp
index 5b1d599..290654f 100644
--- a/doc/snippets/MatrixBase_isDiagonal.cpp
+++ b/doc/snippets/MatrixBase_isDiagonal.cpp
@@ -1,6 +1,5 @@
 Matrix3d m = 10000 * Matrix3d::Identity();
-m(0,2) = 1;
+m(0, 2) = 1;
 cout << "Here's the matrix m:" << endl << m << endl;
 cout << "m.isDiagonal() returns: " << m.isDiagonal() << endl;
 cout << "m.isDiagonal(1e-3) returns: " << m.isDiagonal(1e-3) << endl;
-
diff --git a/doc/snippets/MatrixBase_isIdentity.cpp b/doc/snippets/MatrixBase_isIdentity.cpp
index 17b756c..ea535c7 100644
--- a/doc/snippets/MatrixBase_isIdentity.cpp
+++ b/doc/snippets/MatrixBase_isIdentity.cpp
@@ -1,5 +1,5 @@
 Matrix3d m = Matrix3d::Identity();
-m(0,2) = 1e-4;
+m(0, 2) = 1e-4;
 cout << "Here's the matrix m:" << endl << m << endl;
 cout << "m.isIdentity() returns: " << m.isIdentity() << endl;
 cout << "m.isIdentity(1e-3) returns: " << m.isIdentity(1e-3) << endl;
diff --git a/doc/snippets/MatrixBase_isOnes.cpp b/doc/snippets/MatrixBase_isOnes.cpp
index f82f628..899230a 100644
--- a/doc/snippets/MatrixBase_isOnes.cpp
+++ b/doc/snippets/MatrixBase_isOnes.cpp
@@ -1,5 +1,5 @@
 Matrix3d m = Matrix3d::Ones();
-m(0,2) += 1e-4;
+m(0, 2) += 1e-4;
 cout << "Here's the matrix m:" << endl << m << endl;
 cout << "m.isOnes() returns: " << m.isOnes() << endl;
 cout << "m.isOnes(1e-3) returns: " << m.isOnes(1e-3) << endl;
diff --git a/doc/snippets/MatrixBase_isOrthogonal.cpp b/doc/snippets/MatrixBase_isOrthogonal.cpp
index b22af06..3e079b4 100644
--- a/doc/snippets/MatrixBase_isOrthogonal.cpp
+++ b/doc/snippets/MatrixBase_isOrthogonal.cpp
@@ -1,6 +1,6 @@
-Vector3d v(1,0,0);
-Vector3d w(1e-4,0,1);
+Vector3d v(1, 0, 0);
+Vector3d w(1e-4, 0, 1);
 cout << "Here's the vector v:" << endl << v << endl;
 cout << "Here's the vector w:" << endl << w << endl;
 cout << "v.isOrthogonal(w) returns: " << v.isOrthogonal(w) << endl;
-cout << "v.isOrthogonal(w,1e-3) returns: " << v.isOrthogonal(w,1e-3) << endl;
+cout << "v.isOrthogonal(w,1e-3) returns: " << v.isOrthogonal(w, 1e-3) << endl;
diff --git a/doc/snippets/MatrixBase_isUnitary.cpp b/doc/snippets/MatrixBase_isUnitary.cpp
index 3877da3..56f1b96 100644
--- a/doc/snippets/MatrixBase_isUnitary.cpp
+++ b/doc/snippets/MatrixBase_isUnitary.cpp
@@ -1,5 +1,5 @@
 Matrix3d m = Matrix3d::Identity();
-m(0,2) = 1e-4;
+m(0, 2) = 1e-4;
 cout << "Here's the matrix m:" << endl << m << endl;
 cout << "m.isUnitary() returns: " << m.isUnitary() << endl;
 cout << "m.isUnitary(1e-3) returns: " << m.isUnitary(1e-3) << endl;
diff --git a/doc/snippets/MatrixBase_isZero.cpp b/doc/snippets/MatrixBase_isZero.cpp
index c2cfe22..c878f1c 100644
--- a/doc/snippets/MatrixBase_isZero.cpp
+++ b/doc/snippets/MatrixBase_isZero.cpp
@@ -1,5 +1,5 @@
 Matrix3d m = Matrix3d::Zero();
-m(0,2) = 1e-4;
+m(0, 2) = 1e-4;
 cout << "Here's the matrix m:" << endl << m << endl;
 cout << "m.isZero() returns: " << m.isZero() << endl;
 cout << "m.isZero(1e-3) returns: " << m.isZero(1e-3) << endl;
diff --git a/doc/snippets/MatrixBase_noalias.cpp b/doc/snippets/MatrixBase_noalias.cpp
index 3b54a79..607d3d5 100644
--- a/doc/snippets/MatrixBase_noalias.cpp
+++ b/doc/snippets/MatrixBase_noalias.cpp
@@ -1,3 +1,5 @@
-Matrix2d a, b, c; a << 1,2,3,4; b << 5,6,7,8;
-c.noalias() = a * b; // this computes the product directly to c
+Matrix2d a, b, c;
+a << 1, 2, 3, 4;
+b << 5, 6, 7, 8;
+c.noalias() = a * b;  // this computes the product directly to c
 cout << c << endl;
diff --git a/doc/snippets/MatrixBase_ones_int_int.cpp b/doc/snippets/MatrixBase_ones_int_int.cpp
index 60f5a31..38bd8cf 100644
--- a/doc/snippets/MatrixBase_ones_int_int.cpp
+++ b/doc/snippets/MatrixBase_ones_int_int.cpp
@@ -1 +1 @@
-cout << MatrixXi::Ones(2,3) << endl;
+cout << MatrixXi::Ones(2, 3) << endl;
diff --git a/doc/snippets/MatrixBase_operatorNorm.cpp b/doc/snippets/MatrixBase_operatorNorm.cpp
index 355246f..99ca14d 100644
--- a/doc/snippets/MatrixBase_operatorNorm.cpp
+++ b/doc/snippets/MatrixBase_operatorNorm.cpp
@@ -1,3 +1,2 @@
-MatrixXd ones = MatrixXd::Ones(3,3);
-cout << "The operator norm of the 3x3 matrix of ones is "
-     << ones.operatorNorm() << endl;
+MatrixXd ones = MatrixXd::Ones(3, 3);
+cout << "The operator norm of the 3x3 matrix of ones is " << ones.operatorNorm() << endl;
diff --git a/doc/snippets/MatrixBase_random_int_int.cpp b/doc/snippets/MatrixBase_random_int_int.cpp
index 3f0f7dd..92f87c8 100644
--- a/doc/snippets/MatrixBase_random_int_int.cpp
+++ b/doc/snippets/MatrixBase_random_int_int.cpp
@@ -1 +1 @@
-cout << MatrixXi::Random(2,3) << endl;
+cout << MatrixXi::Random(2, 3) << endl;
diff --git a/doc/snippets/MatrixBase_replicate.cpp b/doc/snippets/MatrixBase_replicate.cpp
index 3ce52bc..bffd102 100644
--- a/doc/snippets/MatrixBase_replicate.cpp
+++ b/doc/snippets/MatrixBase_replicate.cpp
@@ -1,4 +1,4 @@
-MatrixXi m = MatrixXi::Random(2,3);
+MatrixXi m = MatrixXi::Random(2, 3);
 cout << "Here is the matrix m:" << endl << m << endl;
 cout << "m.replicate<3,2>() = ..." << endl;
-cout << m.replicate<3,2>() << endl;
+cout << m.replicate<3, 2>() << endl;
diff --git a/doc/snippets/MatrixBase_replicate_int_int.cpp b/doc/snippets/MatrixBase_replicate_int_int.cpp
index b1dbc70..1aee265 100644
--- a/doc/snippets/MatrixBase_replicate_int_int.cpp
+++ b/doc/snippets/MatrixBase_replicate_int_int.cpp
@@ -1,4 +1,4 @@
 Vector3i v = Vector3i::Random();
 cout << "Here is the vector v:" << endl << v << endl;
 cout << "v.replicate(2,5) = ..." << endl;
-cout << v.replicate(2,5) << endl;
+cout << v.replicate(2, 5) << endl;
diff --git a/doc/snippets/MatrixBase_reshaped_fixed.cpp b/doc/snippets/MatrixBase_reshaped_fixed.cpp
index 3e9e2cf..c1ae2c0 100644
--- a/doc/snippets/MatrixBase_reshaped_fixed.cpp
+++ b/doc/snippets/MatrixBase_reshaped_fixed.cpp
@@ -1,3 +1,3 @@
 Matrix4i m = Matrix4i::Random();
 cout << "Here is the matrix m:" << endl << m << endl;
-cout << "Here is m.reshaped(fix<2>,fix<8>):" << endl << m.reshaped(fix<2>,fix<8>) << endl;
+cout << "Here is m.reshaped(fix<2>,fix<8>):" << endl << m.reshaped(fix<2>, fix<8>) << endl;
diff --git a/doc/snippets/MatrixBase_reverse.cpp b/doc/snippets/MatrixBase_reverse.cpp
index f545a28..ca12558 100644
--- a/doc/snippets/MatrixBase_reverse.cpp
+++ b/doc/snippets/MatrixBase_reverse.cpp
@@ -1,8 +1,7 @@
-MatrixXi m = MatrixXi::Random(3,4);
+MatrixXi m = MatrixXi::Random(3, 4);
 cout << "Here is the matrix m:" << endl << m << endl;
 cout << "Here is the reverse of m:" << endl << m.reverse() << endl;
-cout << "Here is the coefficient (1,0) in the reverse of m:" << endl
-     << m.reverse()(1,0) << endl;
+cout << "Here is the coefficient (1,0) in the reverse of m:" << endl << m.reverse()(1, 0) << endl;
 cout << "Let us overwrite this coefficient with the value 4." << endl;
-m.reverse()(1,0) = 4;
+m.reverse()(1, 0) = 4;
 cout << "Now the matrix m is:" << endl << m << endl;
diff --git a/doc/snippets/MatrixBase_row.cpp b/doc/snippets/MatrixBase_row.cpp
index b15e626..481bff8 100644
--- a/doc/snippets/MatrixBase_row.cpp
+++ b/doc/snippets/MatrixBase_row.cpp
@@ -1,3 +1,3 @@
 Matrix3d m = Matrix3d::Identity();
-m.row(1) = Vector3d(4,5,6);
+m.row(1) = Vector3d(4, 5, 6);
 cout << m << endl;
diff --git a/doc/snippets/MatrixBase_rowwise.cpp b/doc/snippets/MatrixBase_rowwise.cpp
index ae93964..b869224 100644
--- a/doc/snippets/MatrixBase_rowwise.cpp
+++ b/doc/snippets/MatrixBase_rowwise.cpp
@@ -1,5 +1,4 @@
 Matrix3d m = Matrix3d::Random();
 cout << "Here is the matrix m:" << endl << m << endl;
 cout << "Here is the sum of each row:" << endl << m.rowwise().sum() << endl;
-cout << "Here is the maximum absolute value of each row:"
-     << endl << m.cwiseAbs().rowwise().maxCoeff() << endl;
+cout << "Here is the maximum absolute value of each row:" << endl << m.cwiseAbs().rowwise().maxCoeff() << endl;
diff --git a/doc/snippets/MatrixBase_select.cpp b/doc/snippets/MatrixBase_select.cpp
index ae5477f..d14941b 100644
--- a/doc/snippets/MatrixBase_select.cpp
+++ b/doc/snippets/MatrixBase_select.cpp
@@ -1,6 +1,4 @@
 MatrixXi m(3, 3);
-m << 1, 2, 3,
-     4, 5, 6,
-     7, 8, 9;
+m << 1, 2, 3, 4, 5, 6, 7, 8, 9;
 m = (m.array() >= 5).select(-m, m);
 cout << m << endl;
diff --git a/doc/snippets/MatrixBase_set.cpp b/doc/snippets/MatrixBase_set.cpp
index 50ecf5f..d392b68 100644
--- a/doc/snippets/MatrixBase_set.cpp
+++ b/doc/snippets/MatrixBase_set.cpp
@@ -1,13 +1,10 @@
 Matrix3i m1;
-m1 << 1, 2, 3,
-      4, 5, 6,
-      7, 8, 9;
+m1 << 1, 2, 3, 4, 5, 6, 7, 8, 9;
 cout << m1 << endl << endl;
 Matrix3i m2 = Matrix3i::Identity();
-m2.block(0,0, 2,2) << 10, 11, 12, 13;
+m2.block(0, 0, 2, 2) << 10, 11, 12, 13;
 cout << m2 << endl << endl;
 Vector2i v1;
 v1 << 14, 15;
-m2 << v1.transpose(), 16,
-      v1, m1.block(1,1,2,2);
+m2 << v1.transpose(), 16, v1, m1.block(1, 1, 2, 2);
 cout << m2 << endl;
diff --git a/doc/snippets/MatrixBase_setIdentity.cpp b/doc/snippets/MatrixBase_setIdentity.cpp
index 4fd0aa2..916b477 100644
--- a/doc/snippets/MatrixBase_setIdentity.cpp
+++ b/doc/snippets/MatrixBase_setIdentity.cpp
@@ -1,3 +1,3 @@
 Matrix4i m = Matrix4i::Zero();
-m.block<3,3>(1,0).setIdentity();
+m.block<3, 3>(1, 0).setIdentity();
 cout << m << endl;
diff --git a/doc/snippets/MatrixBase_template_int_int_bottomLeftCorner.cpp b/doc/snippets/MatrixBase_template_int_int_bottomLeftCorner.cpp
index 847892a..bf9f0ab 100644
--- a/doc/snippets/MatrixBase_template_int_int_bottomLeftCorner.cpp
+++ b/doc/snippets/MatrixBase_template_int_int_bottomLeftCorner.cpp
@@ -1,6 +1,6 @@
 Matrix4i m = Matrix4i::Random();
 cout << "Here is the matrix m:" << endl << m << endl;
 cout << "Here is m.bottomLeftCorner<2,2>():" << endl;
-cout << m.bottomLeftCorner<2,2>() << endl;
-m.bottomLeftCorner<2,2>().setZero();
+cout << m.bottomLeftCorner<2, 2>() << endl;
+m.bottomLeftCorner<2, 2>().setZero();
 cout << "Now the matrix m is:" << endl << m << endl;
diff --git a/doc/snippets/MatrixBase_template_int_int_bottomLeftCorner_int_int.cpp b/doc/snippets/MatrixBase_template_int_int_bottomLeftCorner_int_int.cpp
index a1edcc8..3d22fc2 100644
--- a/doc/snippets/MatrixBase_template_int_int_bottomLeftCorner_int_int.cpp
+++ b/doc/snippets/MatrixBase_template_int_int_bottomLeftCorner_int_int.cpp
@@ -1,6 +1,6 @@
 Matrix4i m = Matrix4i::Random();
 cout << "Here is the matrix m:" << endl << m << endl;
 cout << "Here is m.bottomLeftCorner<2,Dynamic>(2,2):" << endl;
-cout << m.bottomLeftCorner<2,Dynamic>(2,2) << endl;
-m.bottomLeftCorner<2,Dynamic>(2,2).setZero();
+cout << m.bottomLeftCorner<2, Dynamic>(2, 2) << endl;
+m.bottomLeftCorner<2, Dynamic>(2, 2).setZero();
 cout << "Now the matrix m is:" << endl << m << endl;
diff --git a/doc/snippets/MatrixBase_template_int_int_bottomRightCorner.cpp b/doc/snippets/MatrixBase_template_int_int_bottomRightCorner.cpp
index abacb01..4a78bed 100644
--- a/doc/snippets/MatrixBase_template_int_int_bottomRightCorner.cpp
+++ b/doc/snippets/MatrixBase_template_int_int_bottomRightCorner.cpp
@@ -1,6 +1,6 @@
 Matrix4i m = Matrix4i::Random();
 cout << "Here is the matrix m:" << endl << m << endl;
 cout << "Here is m.bottomRightCorner<2,2>():" << endl;
-cout << m.bottomRightCorner<2,2>() << endl;
-m.bottomRightCorner<2,2>().setZero();
+cout << m.bottomRightCorner<2, 2>() << endl;
+m.bottomRightCorner<2, 2>().setZero();
 cout << "Now the matrix m is:" << endl << m << endl;
diff --git a/doc/snippets/MatrixBase_template_int_int_bottomRightCorner_int_int.cpp b/doc/snippets/MatrixBase_template_int_int_bottomRightCorner_int_int.cpp
index a65508f..75a3e93 100644
--- a/doc/snippets/MatrixBase_template_int_int_bottomRightCorner_int_int.cpp
+++ b/doc/snippets/MatrixBase_template_int_int_bottomRightCorner_int_int.cpp
@@ -1,6 +1,6 @@
 Matrix4i m = Matrix4i::Random();
 cout << "Here is the matrix m:" << endl << m << endl;
 cout << "Here is m.bottomRightCorner<2,Dynamic>(2,2):" << endl;
-cout << m.bottomRightCorner<2,Dynamic>(2,2) << endl;
-m.bottomRightCorner<2,Dynamic>(2,2).setZero();
+cout << m.bottomRightCorner<2, Dynamic>(2, 2) << endl;
+m.bottomRightCorner<2, Dynamic>(2, 2).setZero();
 cout << "Now the matrix m is:" << endl << m << endl;
diff --git a/doc/snippets/MatrixBase_template_int_int_topLeftCorner.cpp b/doc/snippets/MatrixBase_template_int_int_topLeftCorner.cpp
index 1899d90..7c765d4 100644
--- a/doc/snippets/MatrixBase_template_int_int_topLeftCorner.cpp
+++ b/doc/snippets/MatrixBase_template_int_int_topLeftCorner.cpp
@@ -1,6 +1,6 @@
 Matrix4i m = Matrix4i::Random();
 cout << "Here is the matrix m:" << endl << m << endl;
 cout << "Here is m.topLeftCorner<2,2>():" << endl;
-cout << m.topLeftCorner<2,2>() << endl;
-m.topLeftCorner<2,2>().setZero();
+cout << m.topLeftCorner<2, 2>() << endl;
+m.topLeftCorner<2, 2>().setZero();
 cout << "Now the matrix m is:" << endl << m << endl;
diff --git a/doc/snippets/MatrixBase_template_int_int_topLeftCorner_int_int.cpp b/doc/snippets/MatrixBase_template_int_int_topLeftCorner_int_int.cpp
index fac761f..ae72684 100644
--- a/doc/snippets/MatrixBase_template_int_int_topLeftCorner_int_int.cpp
+++ b/doc/snippets/MatrixBase_template_int_int_topLeftCorner_int_int.cpp
@@ -1,6 +1,6 @@
 Matrix4i m = Matrix4i::Random();
 cout << "Here is the matrix m:" << endl << m << endl;
 cout << "Here is m.topLeftCorner<2,Dynamic>(2,2):" << endl;
-cout << m.topLeftCorner<2,Dynamic>(2,2) << endl;
-m.topLeftCorner<2,Dynamic>(2,2).setZero();
+cout << m.topLeftCorner<2, Dynamic>(2, 2) << endl;
+m.topLeftCorner<2, Dynamic>(2, 2).setZero();
 cout << "Now the matrix m is:" << endl << m << endl;
diff --git a/doc/snippets/MatrixBase_template_int_int_topRightCorner.cpp b/doc/snippets/MatrixBase_template_int_int_topRightCorner.cpp
index c3a1771..9698521 100644
--- a/doc/snippets/MatrixBase_template_int_int_topRightCorner.cpp
+++ b/doc/snippets/MatrixBase_template_int_int_topRightCorner.cpp
@@ -1,6 +1,6 @@
 Matrix4i m = Matrix4i::Random();
 cout << "Here is the matrix m:" << endl << m << endl;
 cout << "Here is m.topRightCorner<2,2>():" << endl;
-cout << m.topRightCorner<2,2>() << endl;
-m.topRightCorner<2,2>().setZero();
+cout << m.topRightCorner<2, 2>() << endl;
+m.topRightCorner<2, 2>().setZero();
 cout << "Now the matrix m is:" << endl << m << endl;
diff --git a/doc/snippets/MatrixBase_template_int_int_topRightCorner_int_int.cpp b/doc/snippets/MatrixBase_template_int_int_topRightCorner_int_int.cpp
index a17acc0..4144242 100644
--- a/doc/snippets/MatrixBase_template_int_int_topRightCorner_int_int.cpp
+++ b/doc/snippets/MatrixBase_template_int_int_topRightCorner_int_int.cpp
@@ -1,6 +1,6 @@
 Matrix4i m = Matrix4i::Random();
 cout << "Here is the matrix m:" << endl << m << endl;
 cout << "Here is m.topRightCorner<2,Dynamic>(2,2):" << endl;
-cout << m.topRightCorner<2,Dynamic>(2,2) << endl;
-m.topRightCorner<2,Dynamic>(2,2).setZero();
+cout << m.topRightCorner<2, Dynamic>(2, 2) << endl;
+m.topRightCorner<2, Dynamic>(2, 2).setZero();
 cout << "Now the matrix m is:" << endl << m << endl;
diff --git a/doc/snippets/MatrixBase_transpose.cpp b/doc/snippets/MatrixBase_transpose.cpp
index 88eea83..8bf2716 100644
--- a/doc/snippets/MatrixBase_transpose.cpp
+++ b/doc/snippets/MatrixBase_transpose.cpp
@@ -1,8 +1,7 @@
 Matrix2i m = Matrix2i::Random();
 cout << "Here is the matrix m:" << endl << m << endl;
 cout << "Here is the transpose of m:" << endl << m.transpose() << endl;
-cout << "Here is the coefficient (1,0) in the transpose of m:" << endl
-     << m.transpose()(1,0) << endl;
+cout << "Here is the coefficient (1,0) in the transpose of m:" << endl << m.transpose()(1, 0) << endl;
 cout << "Let us overwrite this coefficient with the value 0." << endl;
-m.transpose()(1,0) = 0;
+m.transpose()(1, 0) = 0;
 cout << "Now the matrix m is:" << endl << m << endl;
diff --git a/doc/snippets/MatrixBase_zero_int_int.cpp b/doc/snippets/MatrixBase_zero_int_int.cpp
index 4099c5d..a500724 100644
--- a/doc/snippets/MatrixBase_zero_int_int.cpp
+++ b/doc/snippets/MatrixBase_zero_int_int.cpp
@@ -1 +1 @@
-cout << MatrixXi::Zero(2,3) << endl;
+cout << MatrixXi::Zero(2, 3) << endl;
diff --git a/doc/snippets/Matrix_Map_stride.cpp b/doc/snippets/Matrix_Map_stride.cpp
index ae42a12..5125b54 100644
--- a/doc/snippets/Matrix_Map_stride.cpp
+++ b/doc/snippets/Matrix_Map_stride.cpp
@@ -1,7 +1,4 @@
 Matrix4i A;
-A << 1,  2,  3,  4,
-     5,  6,  7,  8,
-     9, 10, 11, 12,
-    13, 14, 15, 16;
+A << 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16;
 
-std::cout << Matrix2i::Map(&A(1,1),Stride<8,2>()) << std::endl;
+std::cout << Matrix2i::Map(&A(1, 1), Stride<8, 2>()) << std::endl;
diff --git a/doc/snippets/Matrix_initializer_list_23_cxx11.cpp b/doc/snippets/Matrix_initializer_list_23_cxx11.cpp
index 60280ab..8cde1cb 100644
--- a/doc/snippets/Matrix_initializer_list_23_cxx11.cpp
+++ b/doc/snippets/Matrix_initializer_list_23_cxx11.cpp
@@ -1,5 +1,2 @@
-MatrixXd m {
-  {1, 2, 3},
-  {4, 5, 6}
-};
+MatrixXd m{{1, 2, 3}, {4, 5, 6}};
 cout << m << endl;
diff --git a/doc/snippets/Matrix_initializer_list_vector_cxx11.cpp b/doc/snippets/Matrix_initializer_list_vector_cxx11.cpp
index 325257c..7096deb 100644
--- a/doc/snippets/Matrix_initializer_list_vector_cxx11.cpp
+++ b/doc/snippets/Matrix_initializer_list_vector_cxx11.cpp
@@ -1,2 +1,2 @@
-VectorXi v {{1, 2}};
+VectorXi v{{1, 2}};
 cout << v << endl;
diff --git a/doc/snippets/Matrix_resize_NoChange_int.cpp b/doc/snippets/Matrix_resize_NoChange_int.cpp
index acdf18c..c86ee30 100644
--- a/doc/snippets/Matrix_resize_NoChange_int.cpp
+++ b/doc/snippets/Matrix_resize_NoChange_int.cpp
@@ -1,3 +1,3 @@
-MatrixXd m(3,4);
+MatrixXd m(3, 4);
 m.resize(NoChange, 5);
 cout << "m: " << m.rows() << " rows, " << m.cols() << " cols" << endl;
diff --git a/doc/snippets/Matrix_resize_int.cpp b/doc/snippets/Matrix_resize_int.cpp
index 044c789..7f34df7 100644
--- a/doc/snippets/Matrix_resize_int.cpp
+++ b/doc/snippets/Matrix_resize_int.cpp
@@ -1,6 +1,6 @@
 VectorXd v(10);
 v.resize(3);
 RowVector3d w;
-w.resize(3); // this is legal, but has no effect
+w.resize(3);  // this is legal, but has no effect
 cout << "v: " << v.rows() << " rows, " << v.cols() << " cols" << endl;
 cout << "w: " << w.rows() << " rows, " << w.cols() << " cols" << endl;
diff --git a/doc/snippets/Matrix_resize_int_NoChange.cpp b/doc/snippets/Matrix_resize_int_NoChange.cpp
index 5c37c90..e30763d 100644
--- a/doc/snippets/Matrix_resize_int_NoChange.cpp
+++ b/doc/snippets/Matrix_resize_int_NoChange.cpp
@@ -1,3 +1,3 @@
-MatrixXd m(3,4);
+MatrixXd m(3, 4);
 m.resize(5, NoChange);
 cout << "m: " << m.rows() << " rows, " << m.cols() << " cols" << endl;
diff --git a/doc/snippets/Matrix_resize_int_int.cpp b/doc/snippets/Matrix_resize_int_int.cpp
index bfd4741..5453dbd 100644
--- a/doc/snippets/Matrix_resize_int_int.cpp
+++ b/doc/snippets/Matrix_resize_int_int.cpp
@@ -1,9 +1,9 @@
-MatrixXd m(2,3);
-m << 1,2,3,4,5,6;
+MatrixXd m(2, 3);
+m << 1, 2, 3, 4, 5, 6;
 cout << "here's the 2x3 matrix m:" << endl << m << endl;
 cout << "let's resize m to 3x2. This is a conservative resizing because 2*3==3*2." << endl;
-m.resize(3,2);
+m.resize(3, 2);
 cout << "here's the 3x2 matrix m:" << endl << m << endl;
 cout << "now let's resize m to size 2x2. This is NOT a conservative resizing, so it becomes uninitialized:" << endl;
-m.resize(2,2);
+m.resize(2, 2);
 cout << m << endl;
diff --git a/doc/snippets/Matrix_variadic_ctor_cxx11.cpp b/doc/snippets/Matrix_variadic_ctor_cxx11.cpp
index 06d33f5..45acd99 100644
--- a/doc/snippets/Matrix_variadic_ctor_cxx11.cpp
+++ b/doc/snippets/Matrix_variadic_ctor_cxx11.cpp
@@ -1,3 +1,3 @@
 Matrix<int, 1, 6> a(1, 2, 3, 4, 5, 6);
-Matrix<int, 3, 1> b {1, 2, 3};
+Matrix<int, 3, 1> b{1, 2, 3};
 cout << a << "\n\n" << b << endl;
diff --git a/doc/snippets/PartialPivLU_solve.cpp b/doc/snippets/PartialPivLU_solve.cpp
index fa3570a..ebfa56d 100644
--- a/doc/snippets/PartialPivLU_solve.cpp
+++ b/doc/snippets/PartialPivLU_solve.cpp
@@ -1,7 +1,7 @@
-MatrixXd A = MatrixXd::Random(3,3);
-MatrixXd B = MatrixXd::Random(3,2);
+MatrixXd A = MatrixXd::Random(3, 3);
+MatrixXd B = MatrixXd::Random(3, 2);
 cout << "Here is the invertible matrix A:" << endl << A << endl;
 cout << "Here is the matrix B:" << endl << B << endl;
 MatrixXd X = A.lu().solve(B);
 cout << "Here is the (unique) solution X to the equation AX=B:" << endl << X << endl;
-cout << "Relative error: " << (A*X-B).norm() / B.norm() << endl;
+cout << "Relative error: " << (A * X - B).norm() / B.norm() << endl;
diff --git a/doc/snippets/RealQZ_compute.cpp b/doc/snippets/RealQZ_compute.cpp
index a18da42..10edefc 100644
--- a/doc/snippets/RealQZ_compute.cpp
+++ b/doc/snippets/RealQZ_compute.cpp
@@ -1,17 +1,25 @@
-MatrixXf A = MatrixXf::Random(4,4);
-MatrixXf B = MatrixXf::Random(4,4);
-RealQZ<MatrixXf> qz(4); // preallocate space for 4x4 matrices
-qz.compute(A,B);  // A = Q S Z,  B = Q T Z
+MatrixXf A = MatrixXf::Random(4, 4);
+MatrixXf B = MatrixXf::Random(4, 4);
+RealQZ<MatrixXf> qz(4);  // preallocate space for 4x4 matrices
+qz.compute(A, B);        // A = Q S Z,  B = Q T Z
 
 // print original matrices and result of decomposition
-cout << "A:\n" << A << "\n" << "B:\n" << B << "\n";
-cout << "S:\n" << qz.matrixS() << "\n" << "T:\n" << qz.matrixT() << "\n";
-cout << "Q:\n" << qz.matrixQ() << "\n" << "Z:\n" << qz.matrixZ() << "\n";
+cout << "A:\n"
+     << A << "\n"
+     << "B:\n"
+     << B << "\n";
+cout << "S:\n"
+     << qz.matrixS() << "\n"
+     << "T:\n"
+     << qz.matrixT() << "\n";
+cout << "Q:\n"
+     << qz.matrixQ() << "\n"
+     << "Z:\n"
+     << qz.matrixZ() << "\n";
 
 // verify precision
 cout << "\nErrors:"
-  << "\n|A-QSZ|: " << (A-qz.matrixQ()*qz.matrixS()*qz.matrixZ()).norm()
-  << ", |B-QTZ|: " << (B-qz.matrixQ()*qz.matrixT()*qz.matrixZ()).norm()
-  << "\n|QQ* - I|: " << (qz.matrixQ()*qz.matrixQ().adjoint() - MatrixXf::Identity(4,4)).norm()
-  << ", |ZZ* - I|: " << (qz.matrixZ()*qz.matrixZ().adjoint() - MatrixXf::Identity(4,4)).norm()
-  << "\n";
+     << "\n|A-QSZ|: " << (A - qz.matrixQ() * qz.matrixS() * qz.matrixZ()).norm()
+     << ", |B-QTZ|: " << (B - qz.matrixQ() * qz.matrixT() * qz.matrixZ()).norm()
+     << "\n|QQ* - I|: " << (qz.matrixQ() * qz.matrixQ().adjoint() - MatrixXf::Identity(4, 4)).norm()
+     << ", |ZZ* - I|: " << (qz.matrixZ() * qz.matrixZ().adjoint() - MatrixXf::Identity(4, 4)).norm() << "\n";
diff --git a/doc/snippets/RealSchur_RealSchur_MatrixType.cpp b/doc/snippets/RealSchur_RealSchur_MatrixType.cpp
index a5530dc..485b0ee 100644
--- a/doc/snippets/RealSchur_RealSchur_MatrixType.cpp
+++ b/doc/snippets/RealSchur_RealSchur_MatrixType.cpp
@@ -1,4 +1,4 @@
-MatrixXd A = MatrixXd::Random(6,6);
+MatrixXd A = MatrixXd::Random(6, 6);
 cout << "Here is a random 6x6 matrix, A:" << endl << A << endl << endl;
 
 RealSchur<MatrixXd> schur(A);
diff --git a/doc/snippets/RealSchur_compute.cpp b/doc/snippets/RealSchur_compute.cpp
index 20c2611..78c71c8 100644
--- a/doc/snippets/RealSchur_compute.cpp
+++ b/doc/snippets/RealSchur_compute.cpp
@@ -1,4 +1,4 @@
-MatrixXf A = MatrixXf::Random(4,4);
+MatrixXf A = MatrixXf::Random(4, 4);
 RealSchur<MatrixXf> schur(4);
 schur.compute(A, /* computeU = */ false);
 cout << "The matrix T in the decomposition of A is:" << endl << schur.matrixT() << endl;
diff --git a/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver.cpp b/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver.cpp
index 73a7f62..16f4b23 100644
--- a/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver.cpp
+++ b/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver.cpp
@@ -1,7 +1,7 @@
 SelfAdjointEigenSolver<Matrix4f> es;
-Matrix4f X = Matrix4f::Random(4,4);
+Matrix4f X = Matrix4f::Random(4, 4);
 Matrix4f A = X + X.transpose();
 es.compute(A);
 cout << "The eigenvalues of A are: " << es.eigenvalues().transpose() << endl;
-es.compute(A + Matrix4f::Identity(4,4)); // re-use es to compute eigenvalues of A+I
+es.compute(A + Matrix4f::Identity(4, 4));  // re-use es to compute eigenvalues of A+I
 cout << "The eigenvalues of A+I are: " << es.eigenvalues().transpose() << endl;
diff --git a/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType.cpp b/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType.cpp
index 3599b17..0ed9092 100644
--- a/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType.cpp
+++ b/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType.cpp
@@ -1,4 +1,4 @@
-MatrixXd X = MatrixXd::Random(5,5);
+MatrixXd X = MatrixXd::Random(5, 5);
 MatrixXd A = X + X.transpose();
 cout << "Here is a random symmetric 5x5 matrix, A:" << endl << A << endl << endl;
 
diff --git a/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType2.cpp b/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType2.cpp
index cc0c50e..e2889b7 100644
--- a/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType2.cpp
+++ b/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType2.cpp
@@ -1,11 +1,11 @@
-MatrixXd X = MatrixXd::Random(5,5);
+MatrixXd X = MatrixXd::Random(5, 5);
 MatrixXd A = X + X.transpose();
 cout << "Here is a random symmetric matrix, A:" << endl << A << endl;
-X = MatrixXd::Random(5,5);
+X = MatrixXd::Random(5, 5);
 MatrixXd B = X * X.transpose();
 cout << "and a random positive-definite matrix, B:" << endl << B << endl << endl;
 
-GeneralizedSelfAdjointEigenSolver<MatrixXd> es(A,B);
+GeneralizedSelfAdjointEigenSolver<MatrixXd> es(A, B);
 cout << "The eigenvalues of the pencil (A,B) are:" << endl << es.eigenvalues() << endl;
 cout << "The matrix of eigenvectors, V, is:" << endl << es.eigenvectors() << endl << endl;
 
diff --git a/doc/snippets/SelfAdjointEigenSolver_compute_MatrixType.cpp b/doc/snippets/SelfAdjointEigenSolver_compute_MatrixType.cpp
index 2975cc3..9075db7 100644
--- a/doc/snippets/SelfAdjointEigenSolver_compute_MatrixType.cpp
+++ b/doc/snippets/SelfAdjointEigenSolver_compute_MatrixType.cpp
@@ -1,7 +1,7 @@
 SelfAdjointEigenSolver<MatrixXf> es(4);
-MatrixXf X = MatrixXf::Random(4,4);
+MatrixXf X = MatrixXf::Random(4, 4);
 MatrixXf A = X + X.transpose();
 es.compute(A);
 cout << "The eigenvalues of A are: " << es.eigenvalues().transpose() << endl;
-es.compute(A + MatrixXf::Identity(4,4)); // re-use es to compute eigenvalues of A+I
+es.compute(A + MatrixXf::Identity(4, 4));  // re-use es to compute eigenvalues of A+I
 cout << "The eigenvalues of A+I are: " << es.eigenvalues().transpose() << endl;
diff --git a/doc/snippets/SelfAdjointEigenSolver_compute_MatrixType2.cpp b/doc/snippets/SelfAdjointEigenSolver_compute_MatrixType2.cpp
index 07c92a1..88d44c6 100644
--- a/doc/snippets/SelfAdjointEigenSolver_compute_MatrixType2.cpp
+++ b/doc/snippets/SelfAdjointEigenSolver_compute_MatrixType2.cpp
@@ -1,9 +1,9 @@
-MatrixXd X = MatrixXd::Random(5,5);
+MatrixXd X = MatrixXd::Random(5, 5);
 MatrixXd A = X * X.transpose();
-X = MatrixXd::Random(5,5);
+X = MatrixXd::Random(5, 5);
 MatrixXd B = X * X.transpose();
 
-GeneralizedSelfAdjointEigenSolver<MatrixXd> es(A,B,EigenvaluesOnly);
+GeneralizedSelfAdjointEigenSolver<MatrixXd> es(A, B, EigenvaluesOnly);
 cout << "The eigenvalues of the pencil (A,B) are:" << endl << es.eigenvalues() << endl;
-es.compute(B,A,false);
+es.compute(B, A, false);
 cout << "The eigenvalues of the pencil (B,A) are:" << endl << es.eigenvalues() << endl;
diff --git a/doc/snippets/SelfAdjointEigenSolver_eigenvalues.cpp b/doc/snippets/SelfAdjointEigenSolver_eigenvalues.cpp
index 0ff33c6..d80f90c 100644
--- a/doc/snippets/SelfAdjointEigenSolver_eigenvalues.cpp
+++ b/doc/snippets/SelfAdjointEigenSolver_eigenvalues.cpp
@@ -1,4 +1,3 @@
-MatrixXd ones = MatrixXd::Ones(3,3);
+MatrixXd ones = MatrixXd::Ones(3, 3);
 SelfAdjointEigenSolver<MatrixXd> es(ones);
-cout << "The eigenvalues of the 3x3 matrix of ones are:" 
-     << endl << es.eigenvalues() << endl;
+cout << "The eigenvalues of the 3x3 matrix of ones are:" << endl << es.eigenvalues() << endl;
diff --git a/doc/snippets/SelfAdjointEigenSolver_eigenvectors.cpp b/doc/snippets/SelfAdjointEigenSolver_eigenvectors.cpp
index 94b0d6e..a91dca1 100644
--- a/doc/snippets/SelfAdjointEigenSolver_eigenvectors.cpp
+++ b/doc/snippets/SelfAdjointEigenSolver_eigenvectors.cpp
@@ -1,4 +1,3 @@
-MatrixXd ones = MatrixXd::Ones(3,3);
+MatrixXd ones = MatrixXd::Ones(3, 3);
 SelfAdjointEigenSolver<MatrixXd> es(ones);
-cout << "The first eigenvector of the 3x3 matrix of ones is:" 
-     << endl << es.eigenvectors().col(0) << endl;
+cout << "The first eigenvector of the 3x3 matrix of ones is:" << endl << es.eigenvectors().col(0) << endl;
diff --git a/doc/snippets/SelfAdjointEigenSolver_operatorInverseSqrt.cpp b/doc/snippets/SelfAdjointEigenSolver_operatorInverseSqrt.cpp
index 114c65f..50e83f3 100644
--- a/doc/snippets/SelfAdjointEigenSolver_operatorInverseSqrt.cpp
+++ b/doc/snippets/SelfAdjointEigenSolver_operatorInverseSqrt.cpp
@@ -1,4 +1,4 @@
-MatrixXd X = MatrixXd::Random(4,4);
+MatrixXd X = MatrixXd::Random(4, 4);
 MatrixXd A = X * X.transpose();
 cout << "Here is a random positive-definite matrix, A:" << endl << A << endl << endl;
 
diff --git a/doc/snippets/SelfAdjointEigenSolver_operatorSqrt.cpp b/doc/snippets/SelfAdjointEigenSolver_operatorSqrt.cpp
index eeacca7..bced567 100644
--- a/doc/snippets/SelfAdjointEigenSolver_operatorSqrt.cpp
+++ b/doc/snippets/SelfAdjointEigenSolver_operatorSqrt.cpp
@@ -1,8 +1,8 @@
-MatrixXd X = MatrixXd::Random(4,4);
+MatrixXd X = MatrixXd::Random(4, 4);
 MatrixXd A = X * X.transpose();
 cout << "Here is a random positive-definite matrix, A:" << endl << A << endl << endl;
 
 SelfAdjointEigenSolver<MatrixXd> es(A);
 MatrixXd sqrtA = es.operatorSqrt();
 cout << "The square root of A is: " << endl << sqrtA << endl;
-cout << "If we square this, we get: " << endl << sqrtA*sqrtA << endl;
+cout << "If we square this, we get: " << endl << sqrtA * sqrtA << endl;
diff --git a/doc/snippets/SelfAdjointView_eigenvalues.cpp b/doc/snippets/SelfAdjointView_eigenvalues.cpp
index be19867..8cef6d8 100644
--- a/doc/snippets/SelfAdjointView_eigenvalues.cpp
+++ b/doc/snippets/SelfAdjointView_eigenvalues.cpp
@@ -1,3 +1,3 @@
-MatrixXd ones = MatrixXd::Ones(3,3);
+MatrixXd ones = MatrixXd::Ones(3, 3);
 VectorXd eivals = ones.selfadjointView<Lower>().eigenvalues();
 cout << "The eigenvalues of the 3x3 matrix of ones are:" << endl << eivals << endl;
diff --git a/doc/snippets/SelfAdjointView_operatorNorm.cpp b/doc/snippets/SelfAdjointView_operatorNorm.cpp
index f380f55..c229faf 100644
--- a/doc/snippets/SelfAdjointView_operatorNorm.cpp
+++ b/doc/snippets/SelfAdjointView_operatorNorm.cpp
@@ -1,3 +1,2 @@
-MatrixXd ones = MatrixXd::Ones(3,3);
-cout << "The operator norm of the 3x3 matrix of ones is "
-     << ones.selfadjointView<Lower>().operatorNorm() << endl;
+MatrixXd ones = MatrixXd::Ones(3, 3);
+cout << "The operator norm of the 3x3 matrix of ones is " << ones.selfadjointView<Lower>().operatorNorm() << endl;
diff --git a/doc/snippets/Slicing_arrayexpr.cpp b/doc/snippets/Slicing_arrayexpr.cpp
index 6d09980..b78dbfa 100644
--- a/doc/snippets/Slicing_arrayexpr.cpp
+++ b/doc/snippets/Slicing_arrayexpr.cpp
@@ -1,4 +1,5 @@
-ArrayXi ind(5); ind<<4,2,5,5,3;
-MatrixXi A = MatrixXi::Random(4,6);
+ArrayXi ind(5);
+ind << 4, 2, 5, 5, 3;
+MatrixXi A = MatrixXi::Random(4, 6);
 cout << "Initial matrix A:\n" << A << "\n\n";
-cout << "A(all,ind-1):\n" << A(Eigen::placeholders::all,ind-1) << "\n\n";
+cout << "A(all,ind-1):\n" << A(Eigen::placeholders::all, ind - 1) << "\n\n";
diff --git a/doc/snippets/Slicing_custom_padding_cxx11.cpp b/doc/snippets/Slicing_custom_padding_cxx11.cpp
index 24db98b..4d482f6 100644
--- a/doc/snippets/Slicing_custom_padding_cxx11.cpp
+++ b/doc/snippets/Slicing_custom_padding_cxx11.cpp
@@ -1,12 +1,12 @@
 struct pad {
   Index size() const { return out_size; }
-  Index operator[] (Index i) const { return std::max<Index>(0,i-(out_size-in_size)); }
+  Index operator[](Index i) const { return std::max<Index>(0, i - (out_size - in_size)); }
   Index in_size, out_size;
 };
 
 Matrix3i A;
-A.reshaped() = VectorXi::LinSpaced(9,1,9);
+A.reshaped() = VectorXi::LinSpaced(9, 1, 9);
 cout << "Initial matrix A:\n" << A << "\n\n";
-MatrixXi B(5,5);
-B = A(pad{3,5}, pad{3,5});
+MatrixXi B(5, 5);
+B = A(pad{3, 5}, pad{3, 5});
 cout << "A(pad{3,N}, pad{3,N}):\n" << B << "\n\n";
diff --git a/doc/snippets/Slicing_rawarray_cxx11.cpp b/doc/snippets/Slicing_rawarray_cxx11.cpp
index 7a3e6e5..0495db6 100644
--- a/doc/snippets/Slicing_rawarray_cxx11.cpp
+++ b/doc/snippets/Slicing_rawarray_cxx11.cpp
@@ -1,3 +1,3 @@
-MatrixXi A = MatrixXi::Random(4,6);
+MatrixXi A = MatrixXi::Random(4, 6);
 cout << "Initial matrix A:\n" << A << "\n\n";
-cout << "A(all,{4,2,5,5,3}):\n" << A(Eigen::placeholders::all,{4,2,5,5,3}) << "\n\n";
+cout << "A(all,{4,2,5,5,3}):\n" << A(Eigen::placeholders::all, {4, 2, 5, 5, 3}) << "\n\n";
diff --git a/doc/snippets/Slicing_stdvector_cxx11.cpp b/doc/snippets/Slicing_stdvector_cxx11.cpp
index 74f0727..7d5ad0c 100644
--- a/doc/snippets/Slicing_stdvector_cxx11.cpp
+++ b/doc/snippets/Slicing_stdvector_cxx11.cpp
@@ -1,4 +1,4 @@
-std::vector<int> ind{4,2,5,5,3};
-MatrixXi A = MatrixXi::Random(4,6);
+std::vector<int> ind{4, 2, 5, 5, 3};
+MatrixXi A = MatrixXi::Random(4, 6);
 cout << "Initial matrix A:\n" << A << "\n\n";
-cout << "A(all,ind):\n" << A(Eigen::placeholders::all,ind) << "\n\n";
+cout << "A(all,ind):\n" << A(Eigen::placeholders::all, ind) << "\n\n";
diff --git a/doc/snippets/SparseMatrix_coeffs.cpp b/doc/snippets/SparseMatrix_coeffs.cpp
index f71a69b..266e32d 100644
--- a/doc/snippets/SparseMatrix_coeffs.cpp
+++ b/doc/snippets/SparseMatrix_coeffs.cpp
@@ -1,7 +1,7 @@
-SparseMatrix<double> A(3,3);
-A.insert(1,2) = 0;
-A.insert(0,1) = 1;
-A.insert(2,0) = 2;
+SparseMatrix<double> A(3, 3);
+A.insert(1, 2) = 0;
+A.insert(0, 1) = 1;
+A.insert(2, 0) = 2;
 A.makeCompressed();
 cout << "The matrix A is:" << endl << MatrixXd(A) << endl;
 cout << "it has " << A.nonZeros() << " stored non zero coefficients that are: " << A.coeffs().transpose() << endl;
diff --git a/doc/snippets/TopicAliasing_block.cpp b/doc/snippets/TopicAliasing_block.cpp
index 03282f4..bbb7c2a 100644
--- a/doc/snippets/TopicAliasing_block.cpp
+++ b/doc/snippets/TopicAliasing_block.cpp
@@ -1,7 +1,7 @@
-MatrixXi mat(3,3); 
-mat << 1, 2, 3,   4, 5, 6,   7, 8, 9;
+MatrixXi mat(3, 3);
+mat << 1, 2, 3, 4, 5, 6, 7, 8, 9;
 cout << "Here is the matrix mat:\n" << mat << endl;
 
 // This assignment shows the aliasing problem
-mat.bottomRightCorner(2,2) = mat.topLeftCorner(2,2);
+mat.bottomRightCorner(2, 2) = mat.topLeftCorner(2, 2);
 cout << "After the assignment, mat = \n" << mat << endl;
diff --git a/doc/snippets/TopicAliasing_block_correct.cpp b/doc/snippets/TopicAliasing_block_correct.cpp
index 6fee580..6a3002e 100644
--- a/doc/snippets/TopicAliasing_block_correct.cpp
+++ b/doc/snippets/TopicAliasing_block_correct.cpp
@@ -1,7 +1,7 @@
-MatrixXi mat(3,3); 
-mat << 1, 2, 3,   4, 5, 6,   7, 8, 9;
+MatrixXi mat(3, 3);
+mat << 1, 2, 3, 4, 5, 6, 7, 8, 9;
 cout << "Here is the matrix mat:\n" << mat << endl;
 
 // The eval() solves the aliasing problem
-mat.bottomRightCorner(2,2) = mat.topLeftCorner(2,2).eval();
+mat.bottomRightCorner(2, 2) = mat.topLeftCorner(2, 2).eval();
 cout << "After the assignment, mat = \n" << mat << endl;
diff --git a/doc/snippets/TopicAliasing_cwise.cpp b/doc/snippets/TopicAliasing_cwise.cpp
index 7049f6c..cb9d08a 100644
--- a/doc/snippets/TopicAliasing_cwise.cpp
+++ b/doc/snippets/TopicAliasing_cwise.cpp
@@ -1,20 +1,18 @@
-MatrixXf mat(2,2); 
-mat << 1, 2,  4, 7;
+MatrixXf mat(2, 2);
+mat << 1, 2, 4, 7;
 cout << "Here is the matrix mat:\n" << mat << endl << endl;
 
 mat = 2 * mat;
 cout << "After 'mat = 2 * mat', mat = \n" << mat << endl << endl;
 
-
-mat = mat - MatrixXf::Identity(2,2);
+mat = mat - MatrixXf::Identity(2, 2);
 cout << "After the subtraction, it becomes\n" << mat << endl << endl;
 
-
 ArrayXXf arr = mat;
 arr = arr.square();
 cout << "After squaring, it becomes\n" << arr << endl << endl;
 
 // Combining all operations in one statement:
-mat << 1, 2,  4, 7;
-mat = (2 * mat - MatrixXf::Identity(2,2)).array().square();
+mat << 1, 2, 4, 7;
+mat = (2 * mat - MatrixXf::Identity(2, 2)).array().square();
 cout << "Doing everything at once yields\n" << mat << endl << endl;
diff --git a/doc/snippets/TopicAliasing_mult1.cpp b/doc/snippets/TopicAliasing_mult1.cpp
index cd7e900..4ae2a47 100644
--- a/doc/snippets/TopicAliasing_mult1.cpp
+++ b/doc/snippets/TopicAliasing_mult1.cpp
@@ -1,4 +1,4 @@
-MatrixXf matA(2,2); 
-matA << 2, 0,  0, 2;
+MatrixXf matA(2, 2);
+matA << 2, 0, 0, 2;
 matA = matA * matA;
 cout << matA;
diff --git a/doc/snippets/TopicAliasing_mult2.cpp b/doc/snippets/TopicAliasing_mult2.cpp
index a3ff568..52c9987 100644
--- a/doc/snippets/TopicAliasing_mult2.cpp
+++ b/doc/snippets/TopicAliasing_mult2.cpp
@@ -1,5 +1,5 @@
-MatrixXf matA(2,2), matB(2,2); 
-matA << 2, 0,  0, 2;
+MatrixXf matA(2, 2), matB(2, 2);
+matA << 2, 0, 0, 2;
 
 // Simple but not quite as efficient
 matB = matA * matA;
diff --git a/doc/snippets/TopicAliasing_mult3.cpp b/doc/snippets/TopicAliasing_mult3.cpp
index 1d12a6c..b2bed6f 100644
--- a/doc/snippets/TopicAliasing_mult3.cpp
+++ b/doc/snippets/TopicAliasing_mult3.cpp
@@ -1,4 +1,4 @@
-MatrixXf matA(2,2); 
-matA << 2, 0,  0, 2;
+MatrixXf matA(2, 2);
+matA << 2, 0, 0, 2;
 matA.noalias() = matA * matA;
 cout << matA;
diff --git a/doc/snippets/TopicAliasing_mult4.cpp b/doc/snippets/TopicAliasing_mult4.cpp
index 01c1c6d..9a82322 100644
--- a/doc/snippets/TopicAliasing_mult4.cpp
+++ b/doc/snippets/TopicAliasing_mult4.cpp
@@ -1,5 +1,5 @@
-MatrixXf A(2,2), B(3,2);
-B << 2, 0,  0, 3, 1, 1;
+MatrixXf A(2, 2), B(3, 2);
+B << 2, 0, 0, 3, 1, 1;
 A << 2, 0, 0, -2;
 A = (B * A).cwiseAbs();
 cout << A;
diff --git a/doc/snippets/TopicAliasing_mult5.cpp b/doc/snippets/TopicAliasing_mult5.cpp
index 1a36def..79a94c8 100644
--- a/doc/snippets/TopicAliasing_mult5.cpp
+++ b/doc/snippets/TopicAliasing_mult5.cpp
@@ -1,5 +1,5 @@
-MatrixXf A(2,2), B(3,2);
-B << 2, 0,  0, 3, 1, 1;
+MatrixXf A(2, 2), B(3, 2);
+B << 2, 0, 0, 3, 1, 1;
 A << 2, 0, 0, -2;
 A = (B * A).eval().cwiseAbs();
 cout << A;
diff --git a/doc/snippets/TopicStorageOrders_example.cpp b/doc/snippets/TopicStorageOrders_example.cpp
index 0623ef0..64e2123 100644
--- a/doc/snippets/TopicStorageOrders_example.cpp
+++ b/doc/snippets/TopicStorageOrders_example.cpp
@@ -1,18 +1,13 @@
 Matrix<int, 3, 4, ColMajor> Acolmajor;
-Acolmajor << 8, 2, 2, 9,
-             9, 1, 4, 4,
-	     3, 5, 4, 5;
+Acolmajor << 8, 2, 2, 9, 9, 1, 4, 4, 3, 5, 4, 5;
 cout << "The matrix A:" << endl;
-cout << Acolmajor << endl << endl; 
+cout << Acolmajor << endl << endl;
 
 cout << "In memory (column-major):" << endl;
-for (int i = 0; i < Acolmajor.size(); i++)
-  cout << *(Acolmajor.data() + i) << "  ";
+for (int i = 0; i < Acolmajor.size(); i++) cout << *(Acolmajor.data() + i) << "  ";
 cout << endl << endl;
 
 Matrix<int, 3, 4, RowMajor> Arowmajor = Acolmajor;
 cout << "In memory (row-major):" << endl;
-for (int i = 0; i < Arowmajor.size(); i++)
-  cout << *(Arowmajor.data() + i) << "  ";
+for (int i = 0; i < Arowmajor.size(); i++) cout << *(Arowmajor.data() + i) << "  ";
 cout << endl;
-
diff --git a/doc/snippets/Triangular_solve.cpp b/doc/snippets/Triangular_solve.cpp
index 5484424..2da806b 100644
--- a/doc/snippets/Triangular_solve.cpp
+++ b/doc/snippets/Triangular_solve.cpp
@@ -7,5 +7,4 @@
 cout << "And now here is m.inverse()*n, taking advantage of the fact that"
         " m is upper-triangular:\n"
      << m.triangularView<Eigen::Upper>().solve(n) << endl;
-cout << "And this is n*m.inverse():\n"
-     << m.triangularView<Eigen::Upper>().solve<Eigen::OnTheRight>(n);
+cout << "And this is n*m.inverse():\n" << m.triangularView<Eigen::Upper>().solve<Eigen::OnTheRight>(n);
diff --git a/doc/snippets/Tridiagonalization_Tridiagonalization_MatrixType.cpp b/doc/snippets/Tridiagonalization_Tridiagonalization_MatrixType.cpp
index a260124..087b1ec 100644
--- a/doc/snippets/Tridiagonalization_Tridiagonalization_MatrixType.cpp
+++ b/doc/snippets/Tridiagonalization_Tridiagonalization_MatrixType.cpp
@@ -1,4 +1,4 @@
-MatrixXd X = MatrixXd::Random(5,5);
+MatrixXd X = MatrixXd::Random(5, 5);
 MatrixXd A = X + X.transpose();
 cout << "Here is a random symmetric 5x5 matrix:" << endl << A << endl << endl;
 Tridiagonalization<MatrixXd> triOfA(A);
diff --git a/doc/snippets/Tridiagonalization_compute.cpp b/doc/snippets/Tridiagonalization_compute.cpp
index 0062a99..ecaee15 100644
--- a/doc/snippets/Tridiagonalization_compute.cpp
+++ b/doc/snippets/Tridiagonalization_compute.cpp
@@ -1,9 +1,9 @@
 Tridiagonalization<MatrixXf> tri;
-MatrixXf X = MatrixXf::Random(4,4);
+MatrixXf X = MatrixXf::Random(4, 4);
 MatrixXf A = X + X.transpose();
 tri.compute(A);
 cout << "The matrix T in the tridiagonal decomposition of A is: " << endl;
 cout << tri.matrixT() << endl;
-tri.compute(2*A); // re-use tri to compute eigenvalues of 2A
+tri.compute(2 * A);  // re-use tri to compute eigenvalues of 2A
 cout << "The matrix T in the tridiagonal decomposition of 2A is: " << endl;
 cout << tri.matrixT() << endl;
diff --git a/doc/snippets/Tridiagonalization_decomposeInPlace.cpp b/doc/snippets/Tridiagonalization_decomposeInPlace.cpp
index 9a66baa..b28c935 100644
--- a/doc/snippets/Tridiagonalization_decomposeInPlace.cpp
+++ b/doc/snippets/Tridiagonalization_decomposeInPlace.cpp
@@ -1,4 +1,4 @@
-MatrixXd X = MatrixXd::Random(5,5);
+MatrixXd X = MatrixXd::Random(5, 5);
 MatrixXd A = X + X.transpose();
 cout << "Here is a random symmetric 5x5 matrix:" << endl << A << endl << endl;
 
diff --git a/doc/snippets/Tridiagonalization_diagonal.cpp b/doc/snippets/Tridiagonalization_diagonal.cpp
index 6eec821..18edc1e 100644
--- a/doc/snippets/Tridiagonalization_diagonal.cpp
+++ b/doc/snippets/Tridiagonalization_diagonal.cpp
@@ -1,4 +1,4 @@
-MatrixXcd X = MatrixXcd::Random(4,4);
+MatrixXcd X = MatrixXcd::Random(4, 4);
 MatrixXcd A = X + X.adjoint();
 cout << "Here is a random self-adjoint 4x4 matrix:" << endl << A << endl << endl;
 
@@ -8,6 +8,6 @@
 
 cout << "We can also extract the diagonals of T directly ..." << endl;
 VectorXd diag = triOfA.diagonal();
-cout << "The diagonal is:" << endl << diag << endl; 
+cout << "The diagonal is:" << endl << diag << endl;
 VectorXd subdiag = triOfA.subDiagonal();
 cout << "The subdiagonal is:" << endl << subdiag << endl;
diff --git a/doc/snippets/Tridiagonalization_householderCoefficients.cpp b/doc/snippets/Tridiagonalization_householderCoefficients.cpp
index e5d8728..f880f1d 100644
--- a/doc/snippets/Tridiagonalization_householderCoefficients.cpp
+++ b/doc/snippets/Tridiagonalization_householderCoefficients.cpp
@@ -1,4 +1,4 @@
-Matrix4d X = Matrix4d::Random(4,4);
+Matrix4d X = Matrix4d::Random(4, 4);
 Matrix4d A = X + X.transpose();
 cout << "Here is a random symmetric 4x4 matrix:" << endl << A << endl;
 Tridiagonalization<Matrix4d> triOfA(A);
diff --git a/doc/snippets/Tridiagonalization_packedMatrix.cpp b/doc/snippets/Tridiagonalization_packedMatrix.cpp
index 0f55d0c..3b186a8 100644
--- a/doc/snippets/Tridiagonalization_packedMatrix.cpp
+++ b/doc/snippets/Tridiagonalization_packedMatrix.cpp
@@ -1,8 +1,7 @@
-Matrix4d X = Matrix4d::Random(4,4);
+Matrix4d X = Matrix4d::Random(4, 4);
 Matrix4d A = X + X.transpose();
 cout << "Here is a random symmetric 4x4 matrix:" << endl << A << endl;
 Tridiagonalization<Matrix4d> triOfA(A);
 Matrix4d pm = triOfA.packedMatrix();
 cout << "The packed matrix M is:" << endl << pm << endl;
-cout << "The diagonal and subdiagonal corresponds to the matrix T, which is:" 
-     << endl << triOfA.matrixT() << endl;
+cout << "The diagonal and subdiagonal corresponds to the matrix T, which is:" << endl << triOfA.matrixT() << endl;
diff --git a/doc/snippets/Tutorial_AdvancedInitialization_Block.cpp b/doc/snippets/Tutorial_AdvancedInitialization_Block.cpp
index 96e40ac..752c522 100644
--- a/doc/snippets/Tutorial_AdvancedInitialization_Block.cpp
+++ b/doc/snippets/Tutorial_AdvancedInitialization_Block.cpp
@@ -1,5 +1,5 @@
 MatrixXf matA(2, 2);
 matA << 1, 2, 3, 4;
 MatrixXf matB(4, 4);
-matB << matA, matA/10, matA/10, matA;
+matB << matA, matA / 10, matA / 10, matA;
 std::cout << matB << std::endl;
diff --git a/doc/snippets/Tutorial_AdvancedInitialization_CommaTemporary.cpp b/doc/snippets/Tutorial_AdvancedInitialization_CommaTemporary.cpp
index 50cff4c..8af3d74 100644
--- a/doc/snippets/Tutorial_AdvancedInitialization_CommaTemporary.cpp
+++ b/doc/snippets/Tutorial_AdvancedInitialization_CommaTemporary.cpp
@@ -1,4 +1,4 @@
 MatrixXf mat = MatrixXf::Random(2, 3);
 std::cout << mat << std::endl << std::endl;
-mat = (MatrixXf(2,2) << 0, 1, 1, 0).finished() * mat;
+mat = (MatrixXf(2, 2) << 0, 1, 1, 0).finished() * mat;
 std::cout << mat << std::endl;
diff --git a/doc/snippets/Tutorial_AdvancedInitialization_ThreeWays.cpp b/doc/snippets/Tutorial_AdvancedInitialization_ThreeWays.cpp
index cb74576..4878dd7 100644
--- a/doc/snippets/Tutorial_AdvancedInitialization_ThreeWays.cpp
+++ b/doc/snippets/Tutorial_AdvancedInitialization_ThreeWays.cpp
@@ -1,20 +1,19 @@
 const int size = 6;
 MatrixXd mat1(size, size);
-mat1.topLeftCorner(size/2, size/2)     = MatrixXd::Zero(size/2, size/2);
-mat1.topRightCorner(size/2, size/2)    = MatrixXd::Identity(size/2, size/2);
-mat1.bottomLeftCorner(size/2, size/2)  = MatrixXd::Identity(size/2, size/2);
-mat1.bottomRightCorner(size/2, size/2) = MatrixXd::Zero(size/2, size/2);
+mat1.topLeftCorner(size / 2, size / 2) = MatrixXd::Zero(size / 2, size / 2);
+mat1.topRightCorner(size / 2, size / 2) = MatrixXd::Identity(size / 2, size / 2);
+mat1.bottomLeftCorner(size / 2, size / 2) = MatrixXd::Identity(size / 2, size / 2);
+mat1.bottomRightCorner(size / 2, size / 2) = MatrixXd::Zero(size / 2, size / 2);
 std::cout << mat1 << std::endl << std::endl;
 
 MatrixXd mat2(size, size);
-mat2.topLeftCorner(size/2, size/2).setZero();
-mat2.topRightCorner(size/2, size/2).setIdentity();
-mat2.bottomLeftCorner(size/2, size/2).setIdentity();
-mat2.bottomRightCorner(size/2, size/2).setZero();
+mat2.topLeftCorner(size / 2, size / 2).setZero();
+mat2.topRightCorner(size / 2, size / 2).setIdentity();
+mat2.bottomLeftCorner(size / 2, size / 2).setIdentity();
+mat2.bottomRightCorner(size / 2, size / 2).setZero();
 std::cout << mat2 << std::endl << std::endl;
 
 MatrixXd mat3(size, size);
-mat3 << MatrixXd::Zero(size/2, size/2), MatrixXd::Identity(size/2, size/2),
-        MatrixXd::Identity(size/2, size/2), MatrixXd::Zero(size/2, size/2);
+mat3 << MatrixXd::Zero(size / 2, size / 2),
+    MatrixXd::Identity(size / 2, size / 2), MatrixXd::Identity(size / 2, size / 2), MatrixXd::Zero(size / 2, size / 2);
 std::cout << mat3 << std::endl;
-
diff --git a/doc/snippets/Tutorial_AdvancedInitialization_Zero.cpp b/doc/snippets/Tutorial_AdvancedInitialization_Zero.cpp
index 76a36a3..03fb899 100644
--- a/doc/snippets/Tutorial_AdvancedInitialization_Zero.cpp
+++ b/doc/snippets/Tutorial_AdvancedInitialization_Zero.cpp
@@ -2,12 +2,10 @@
 Array33f a1 = Array33f::Zero();
 std::cout << a1 << "\n\n";
 
-
 std::cout << "A one-dimensional dynamic-size array:\n";
 ArrayXf a2 = ArrayXf::Zero(3);
 std::cout << a2 << "\n\n";
 
-
 std::cout << "A two-dimensional dynamic-size array:\n";
 ArrayXXf a3 = ArrayXXf::Zero(3, 4);
 std::cout << a3 << "\n";
diff --git a/doc/snippets/Tutorial_Map_rowmajor.cpp b/doc/snippets/Tutorial_Map_rowmajor.cpp
index fd45ace..f1b9a2f 100644
--- a/doc/snippets/Tutorial_Map_rowmajor.cpp
+++ b/doc/snippets/Tutorial_Map_rowmajor.cpp
@@ -1,7 +1,5 @@
 int array[8];
-for(int i = 0; i < 8; ++i) array[i] = i;
-cout << "Column-major:\n" << Map<Matrix<int,2,4> >(array) << endl;
-cout << "Row-major:\n" << Map<Matrix<int,2,4,RowMajor> >(array) << endl;
-cout << "Row-major using stride:\n" <<
-  Map<Matrix<int,2,4>, Unaligned, Stride<1,4> >(array) << endl;
-
+for (int i = 0; i < 8; ++i) array[i] = i;
+cout << "Column-major:\n" << Map<Matrix<int, 2, 4> >(array) << endl;
+cout << "Row-major:\n" << Map<Matrix<int, 2, 4, RowMajor> >(array) << endl;
+cout << "Row-major using stride:\n" << Map<Matrix<int, 2, 4>, Unaligned, Stride<1, 4> >(array) << endl;
diff --git a/doc/snippets/Tutorial_Map_using.cpp b/doc/snippets/Tutorial_Map_using.cpp
index e5e499f..6fd6ea8 100644
--- a/doc/snippets/Tutorial_Map_using.cpp
+++ b/doc/snippets/Tutorial_Map_using.cpp
@@ -1,21 +1,20 @@
-typedef Matrix<float,1,Dynamic> MatrixType;
+typedef Matrix<float, 1, Dynamic> MatrixType;
 typedef Map<MatrixType> MapType;
-typedef Map<const MatrixType> MapTypeConst;   // a read-only map
+typedef Map<const MatrixType> MapTypeConst;  // a read-only map
 const int n_dims = 5;
-  
+
 MatrixType m1(n_dims), m2(n_dims);
 m1.setRandom();
 m2.setRandom();
-float *p = &m2(0);  // get the address storing the data for m2
-MapType m2map(p,m2.size());   // m2map shares data with m2
-MapTypeConst m2mapconst(p,m2.size());  // a read-only accessor for m2
+float *p = &m2(0);                      // get the address storing the data for m2
+MapType m2map(p, m2.size());            // m2map shares data with m2
+MapTypeConst m2mapconst(p, m2.size());  // a read-only accessor for m2
 
 cout << "m1: " << m1 << endl;
 cout << "m2: " << m2 << endl;
-cout << "Squared euclidean distance: " << (m1-m2).squaredNorm() << endl;
-cout << "Squared euclidean distance, using map: " <<
-  (m1-m2map).squaredNorm() << endl;
-m2map(3) = 7;   // this will change m2, since they share the same array
+cout << "Squared euclidean distance: " << (m1 - m2).squaredNorm() << endl;
+cout << "Squared euclidean distance, using map: " << (m1 - m2map).squaredNorm() << endl;
+m2map(3) = 7;  // this will change m2, since they share the same array
 cout << "Updated m2: " << m2 << endl;
 cout << "m2 coefficient 2, constant accessor: " << m2mapconst(2) << endl;
-/* m2mapconst(2) = 5; */   // this yields a compile-time error
+/* m2mapconst(2) = 5; */  // this yields a compile-time error
diff --git a/doc/snippets/Tutorial_ReshapeMat2Mat.cpp b/doc/snippets/Tutorial_ReshapeMat2Mat.cpp
index 737afec..855af31 100644
--- a/doc/snippets/Tutorial_ReshapeMat2Mat.cpp
+++ b/doc/snippets/Tutorial_ReshapeMat2Mat.cpp
@@ -1,6 +1,5 @@
-MatrixXf M1(2,6);    // Column-major storage
-M1 << 1, 2, 3,  4,  5,  6,
-      7, 8, 9, 10, 11, 12;
+MatrixXf M1(2, 6);  // Column-major storage
+M1 << 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12;
 
-Map<MatrixXf> M2(M1.data(), 6,2);
+Map<MatrixXf> M2(M1.data(), 6, 2);
 cout << "M2:" << endl << M2 << endl;
diff --git a/doc/snippets/Tutorial_ReshapeMat2Vec.cpp b/doc/snippets/Tutorial_ReshapeMat2Vec.cpp
index 32980a7..9a2df01 100644
--- a/doc/snippets/Tutorial_ReshapeMat2Vec.cpp
+++ b/doc/snippets/Tutorial_ReshapeMat2Vec.cpp
@@ -1,11 +1,9 @@
-MatrixXf M1(3,3);    // Column-major storage
-M1 << 1, 2, 3,
-      4, 5, 6,
-      7, 8, 9;
+MatrixXf M1(3, 3);  // Column-major storage
+M1 << 1, 2, 3, 4, 5, 6, 7, 8, 9;
 
 Map<RowVectorXf> v1(M1.data(), M1.size());
 cout << "v1:" << endl << v1 << endl;
 
-Matrix<float,Dynamic,Dynamic,RowMajor> M2(M1);
+Matrix<float, Dynamic, Dynamic, RowMajor> M2(M1);
 Map<RowVectorXf> v2(M2.data(), M2.size());
 cout << "v2:" << endl << v2 << endl;
diff --git a/doc/snippets/Tutorial_SlicingCol.cpp b/doc/snippets/Tutorial_SlicingCol.cpp
index 695d130..bfaec50 100644
--- a/doc/snippets/Tutorial_SlicingCol.cpp
+++ b/doc/snippets/Tutorial_SlicingCol.cpp
@@ -1,11 +1,11 @@
-MatrixXf M1 = MatrixXf::Random(3,8);
+MatrixXf M1 = MatrixXf::Random(3, 8);
 cout << "Column major input:" << endl << M1 << "\n";
-Map<MatrixXf,0,OuterStride<> > M2(M1.data(), M1.rows(), (M1.cols()+2)/3, OuterStride<>(M1.outerStride()*3));
+Map<MatrixXf, 0, OuterStride<> > M2(M1.data(), M1.rows(), (M1.cols() + 2) / 3, OuterStride<>(M1.outerStride() * 3));
 cout << "1 column over 3:" << endl << M2 << "\n";
 
-typedef Matrix<float,Dynamic,Dynamic,RowMajor> RowMajorMatrixXf;
+typedef Matrix<float, Dynamic, Dynamic, RowMajor> RowMajorMatrixXf;
 RowMajorMatrixXf M3(M1);
 cout << "Row major input:" << endl << M3 << "\n";
-Map<RowMajorMatrixXf,0,Stride<Dynamic,3> > M4(M3.data(), M3.rows(), (M3.cols()+2)/3,
-                                              Stride<Dynamic,3>(M3.outerStride(),3));
+Map<RowMajorMatrixXf, 0, Stride<Dynamic, 3> > M4(M3.data(), M3.rows(), (M3.cols() + 2) / 3,
+                                                 Stride<Dynamic, 3>(M3.outerStride(), 3));
 cout << "1 column over 3:" << endl << M4 << "\n";
diff --git a/doc/snippets/Tutorial_SlicingVec.cpp b/doc/snippets/Tutorial_SlicingVec.cpp
index 9b82246..d0c81c6 100644
--- a/doc/snippets/Tutorial_SlicingVec.cpp
+++ b/doc/snippets/Tutorial_SlicingVec.cpp
@@ -1,4 +1,4 @@
-RowVectorXf v = RowVectorXf::LinSpaced(20,0,19);
+RowVectorXf v = RowVectorXf::LinSpaced(20, 0, 19);
 cout << "Input:" << endl << v << endl;
-Map<RowVectorXf,0,InnerStride<2> > v2(v.data(), v.size()/2);
+Map<RowVectorXf, 0, InnerStride<2> > v2(v.data(), v.size() / 2);
 cout << "Even:" << v2 << endl;
diff --git a/doc/snippets/Tutorial_commainit_01.cpp b/doc/snippets/Tutorial_commainit_01.cpp
index 47ba31d..36728a7 100644
--- a/doc/snippets/Tutorial_commainit_01.cpp
+++ b/doc/snippets/Tutorial_commainit_01.cpp
@@ -1,5 +1,3 @@
 Matrix3f m;
-m << 1, 2, 3,
-     4, 5, 6,
-     7, 8, 9;
+m << 1, 2, 3, 4, 5, 6, 7, 8, 9;
 std::cout << m;
diff --git a/doc/snippets/Tutorial_commainit_01b.cpp b/doc/snippets/Tutorial_commainit_01b.cpp
index 2adb2e2..126277b 100644
--- a/doc/snippets/Tutorial_commainit_01b.cpp
+++ b/doc/snippets/Tutorial_commainit_01b.cpp
@@ -1,5 +1,5 @@
 Matrix3f m;
 m.row(0) << 1, 2, 3;
-m.block(1,0,2,2) << 4, 5, 7, 8;
-m.col(2).tail(2) << 6, 9;		    
+m.block(1, 0, 2, 2) << 4, 5, 7, 8;
+m.col(2).tail(2) << 6, 9;
 std::cout << m;
diff --git a/doc/snippets/Tutorial_commainit_02.cpp b/doc/snippets/Tutorial_commainit_02.cpp
index c960d6a..3437237 100644
--- a/doc/snippets/Tutorial_commainit_02.cpp
+++ b/doc/snippets/Tutorial_commainit_02.cpp
@@ -1,7 +1,5 @@
-int rows=5, cols=5;
-MatrixXf m(rows,cols);
+int rows = 5, cols = 5;
+MatrixXf m(rows, cols);
 m << (Matrix3f() << 1, 2, 3, 4, 5, 6, 7, 8, 9).finished(),
-     MatrixXf::Zero(3,cols-3),
-     MatrixXf::Zero(rows-3,3),
-     MatrixXf::Identity(rows-3,cols-3);
+    MatrixXf::Zero(3, cols - 3), MatrixXf::Zero(rows - 3, 3), MatrixXf::Identity(rows - 3, cols - 3);
 cout << m;
diff --git a/doc/snippets/Tutorial_range_for_loop_1d_cxx11.cpp b/doc/snippets/Tutorial_range_for_loop_1d_cxx11.cpp
index e72e715..ee3af86 100644
--- a/doc/snippets/Tutorial_range_for_loop_1d_cxx11.cpp
+++ b/doc/snippets/Tutorial_range_for_loop_1d_cxx11.cpp
@@ -1,4 +1,4 @@
 VectorXi v = VectorXi::Random(4);
 cout << "Here is the vector v:\n";
-for(auto x : v) cout << x << " ";
+for (auto x : v) cout << x << " ";
 cout << "\n";
diff --git a/doc/snippets/Tutorial_range_for_loop_2d_cxx11.cpp b/doc/snippets/Tutorial_range_for_loop_2d_cxx11.cpp
index 4a12d26..27e1f8a 100644
--- a/doc/snippets/Tutorial_range_for_loop_2d_cxx11.cpp
+++ b/doc/snippets/Tutorial_range_for_loop_2d_cxx11.cpp
@@ -1,5 +1,4 @@
 Matrix2i A = Matrix2i::Random();
 cout << "Here are the coeffs of the 2x2 matrix A:\n";
-for(auto x : A.reshaped())
-  cout << x << " ";
+for (auto x : A.reshaped()) cout << x << " ";
 cout << "\n";
diff --git a/doc/snippets/Tutorial_reshaped_vs_resize_1.cpp b/doc/snippets/Tutorial_reshaped_vs_resize_1.cpp
index e520e8e..41a5d99 100644
--- a/doc/snippets/Tutorial_reshaped_vs_resize_1.cpp
+++ b/doc/snippets/Tutorial_reshaped_vs_resize_1.cpp
@@ -1,5 +1,5 @@
 MatrixXi m = Matrix4i::Random();
 cout << "Here is the matrix m:" << endl << m << endl;
 cout << "Here is m.reshaped(2, 8):" << endl << m.reshaped(2, 8) << endl;
-m.resize(2,8);
+m.resize(2, 8);
 cout << "Here is the matrix m after m.resize(2,8):" << endl << m << endl;
diff --git a/doc/snippets/Tutorial_reshaped_vs_resize_2.cpp b/doc/snippets/Tutorial_reshaped_vs_resize_2.cpp
index 50dc454..c5d3929 100644
--- a/doc/snippets/Tutorial_reshaped_vs_resize_2.cpp
+++ b/doc/snippets/Tutorial_reshaped_vs_resize_2.cpp
@@ -1,6 +1,6 @@
-Matrix<int,Dynamic,Dynamic,RowMajor> m = Matrix4i::Random();
+Matrix<int, Dynamic, Dynamic, RowMajor> m = Matrix4i::Random();
 cout << "Here is the matrix m:" << endl << m << endl;
 cout << "Here is m.reshaped(2, 8):" << endl << m.reshaped(2, 8) << endl;
 cout << "Here is m.reshaped<AutoOrder>(2, 8):" << endl << m.reshaped<AutoOrder>(2, 8) << endl;
-m.resize(2,8);
+m.resize(2, 8);
 cout << "Here is the matrix m after m.resize(2,8):" << endl << m << endl;
diff --git a/doc/snippets/Tutorial_solve_matrix_inverse.cpp b/doc/snippets/Tutorial_solve_matrix_inverse.cpp
index fff3244..e39696f 100644
--- a/doc/snippets/Tutorial_solve_matrix_inverse.cpp
+++ b/doc/snippets/Tutorial_solve_matrix_inverse.cpp
@@ -1,6 +1,6 @@
 Matrix3f A;
 Vector3f b;
-A << 1,2,3,  4,5,6,  7,8,10;
+A << 1, 2, 3, 4, 5, 6, 7, 8, 10;
 b << 3, 3, 4;
 Vector3f x = A.inverse() * b;
 cout << "The solution is:" << endl << x << endl;
diff --git a/doc/snippets/Tutorial_solve_multiple_rhs.cpp b/doc/snippets/Tutorial_solve_multiple_rhs.cpp
index 5411a44..b08100a 100644
--- a/doc/snippets/Tutorial_solve_multiple_rhs.cpp
+++ b/doc/snippets/Tutorial_solve_multiple_rhs.cpp
@@ -1,8 +1,8 @@
-Matrix3f A(3,3);
-A << 1,2,3,  4,5,6,  7,8,10;
-Matrix<float,3,2> B;
-B << 3,1, 3,1, 4,1;
-Matrix<float,3,2> X;
+Matrix3f A(3, 3);
+A << 1, 2, 3, 4, 5, 6, 7, 8, 10;
+Matrix<float, 3, 2> B;
+B << 3, 1, 3, 1, 4, 1;
+Matrix<float, 3, 2> X;
 X = A.fullPivLu().solve(B);
 cout << "The solution with right-hand side (3,3,4) is:" << endl;
 cout << X.col(0) << endl;
diff --git a/doc/snippets/Tutorial_solve_reuse_decomposition.cpp b/doc/snippets/Tutorial_solve_reuse_decomposition.cpp
index 3ca0645..d47c6ca 100644
--- a/doc/snippets/Tutorial_solve_reuse_decomposition.cpp
+++ b/doc/snippets/Tutorial_solve_reuse_decomposition.cpp
@@ -1,13 +1,13 @@
-Matrix3f A(3,3);
-A << 1,2,3,  4,5,6,  7,8,10;
-PartialPivLU<Matrix3f> luOfA(A); // compute LU decomposition of A
+Matrix3f A(3, 3);
+A << 1, 2, 3, 4, 5, 6, 7, 8, 10;
+PartialPivLU<Matrix3f> luOfA(A);  // compute LU decomposition of A
 Vector3f b;
-b << 3,3,4;
+b << 3, 3, 4;
 Vector3f x;
 x = luOfA.solve(b);
 cout << "The solution with right-hand side (3,3,4) is:" << endl;
 cout << x << endl;
-b << 1,1,1;
+b << 1, 1, 1;
 x = luOfA.solve(b);
 cout << "The solution with right-hand side (1,1,1) is:" << endl;
 cout << x << endl;
diff --git a/doc/snippets/Tutorial_solve_singular.cpp b/doc/snippets/Tutorial_solve_singular.cpp
index abff1ef..4d168df 100644
--- a/doc/snippets/Tutorial_solve_singular.cpp
+++ b/doc/snippets/Tutorial_solve_singular.cpp
@@ -1,6 +1,6 @@
 Matrix3f A;
 Vector3f b;
-A << 1,2,3,  4,5,6,  7,8,9;
+A << 1, 2, 3, 4, 5, 6, 7, 8, 9;
 b << 3, 3, 4;
 cout << "Here is the matrix A:" << endl << A << endl;
 cout << "Here is the vector b:" << endl << b << endl;
diff --git a/doc/snippets/Tutorial_solve_triangular.cpp b/doc/snippets/Tutorial_solve_triangular.cpp
index 9d13f22..b422f24 100644
--- a/doc/snippets/Tutorial_solve_triangular.cpp
+++ b/doc/snippets/Tutorial_solve_triangular.cpp
@@ -1,6 +1,6 @@
 Matrix3f A;
 Vector3f b;
-A << 1,2,3,  0,5,6,  0,0,10;
+A << 1, 2, 3, 0, 5, 6, 0, 0, 10;
 b << 3, 3, 4;
 cout << "Here is the matrix A:" << endl << A << endl;
 cout << "Here is the vector b:" << endl << b << endl;
diff --git a/doc/snippets/Tutorial_solve_triangular_inplace.cpp b/doc/snippets/Tutorial_solve_triangular_inplace.cpp
index 16ae633..f928e78 100644
--- a/doc/snippets/Tutorial_solve_triangular_inplace.cpp
+++ b/doc/snippets/Tutorial_solve_triangular_inplace.cpp
@@ -1,6 +1,6 @@
 Matrix3f A;
 Vector3f b;
-A << 1,2,3,  0,5,6,  0,0,10;
+A << 1, 2, 3, 0, 5, 6, 0, 0, 10;
 b << 3, 3, 4;
 A.triangularView<Upper>().solveInPlace(b);
 cout << "The solution is:" << endl << b << endl;
diff --git a/doc/snippets/Tutorial_std_sort_rows_cxx11.cpp b/doc/snippets/Tutorial_std_sort_rows_cxx11.cpp
index 0364160..d948949 100644
--- a/doc/snippets/Tutorial_std_sort_rows_cxx11.cpp
+++ b/doc/snippets/Tutorial_std_sort_rows_cxx11.cpp
@@ -1,5 +1,4 @@
-ArrayXXi A = ArrayXXi::Random(4,4).abs();
+ArrayXXi A = ArrayXXi::Random(4, 4).abs();
 cout << "Here is the initial matrix A:\n" << A << "\n";
-for(auto row : A.rowwise())
-  std::sort(row.begin(), row.end());
+for (auto row : A.rowwise()) std::sort(row.begin(), row.end());
 cout << "Here is the sorted matrix A:\n" << A << "\n";
diff --git a/doc/snippets/VectorwiseOp_homogeneous.cpp b/doc/snippets/VectorwiseOp_homogeneous.cpp
index 67cf573..3d2c8fd 100644
--- a/doc/snippets/VectorwiseOp_homogeneous.cpp
+++ b/doc/snippets/VectorwiseOp_homogeneous.cpp
@@ -1,6 +1,8 @@
-Matrix3Xd M = Matrix3Xd::Random(3,5);
+Matrix3Xd M = Matrix3Xd::Random(3, 5);
 Projective3d P(Matrix4d::Random());
 cout << "The matrix M is:" << endl << M << endl << endl;
 cout << "M.colwise().homogeneous():" << endl << M.colwise().homogeneous() << endl << endl;
 cout << "P * M.colwise().homogeneous():" << endl << P * M.colwise().homogeneous() << endl << endl;
-cout << "P * M.colwise().homogeneous().hnormalized(): " << endl << (P * M.colwise().homogeneous()).colwise().hnormalized() << endl << endl;
+cout << "P * M.colwise().homogeneous().hnormalized(): " << endl
+     << (P * M.colwise().homogeneous()).colwise().hnormalized() << endl
+     << endl;
diff --git a/doc/snippets/Vectorwise_reverse.cpp b/doc/snippets/Vectorwise_reverse.cpp
index 2f6a350..85a0065 100644
--- a/doc/snippets/Vectorwise_reverse.cpp
+++ b/doc/snippets/Vectorwise_reverse.cpp
@@ -1,10 +1,9 @@
-MatrixXi m = MatrixXi::Random(3,4);
+MatrixXi m = MatrixXi::Random(3, 4);
 cout << "Here is the matrix m:" << endl << m << endl;
 cout << "Here is the rowwise reverse of m:" << endl << m.rowwise().reverse() << endl;
 cout << "Here is the colwise reverse of m:" << endl << m.colwise().reverse() << endl;
 
-cout << "Here is the coefficient (1,0) in the rowise reverse of m:" << endl
-<< m.rowwise().reverse()(1,0) << endl;
+cout << "Here is the coefficient (1,0) in the rowise reverse of m:" << endl << m.rowwise().reverse()(1, 0) << endl;
 cout << "Let us overwrite this coefficient with the value 4." << endl;
-//m.colwise().reverse()(1,0) = 4;
+// m.colwise().reverse()(1,0) = 4;
 cout << "Now the matrix m is:" << endl << m << endl;
diff --git a/doc/snippets/class_FullPivLU.cpp b/doc/snippets/class_FullPivLU.cpp
index fce7fac..2951c8d 100644
--- a/doc/snippets/class_FullPivLU.cpp
+++ b/doc/snippets/class_FullPivLU.cpp
@@ -3,11 +3,10 @@
 Matrix5x3 m = Matrix5x3::Random();
 cout << "Here is the matrix m:" << endl << m << endl;
 Eigen::FullPivLU<Matrix5x3> lu(m);
-cout << "Here is, up to permutations, its LU decomposition matrix:"
-     << endl << lu.matrixLU() << endl;
+cout << "Here is, up to permutations, its LU decomposition matrix:" << endl << lu.matrixLU() << endl;
 cout << "Here is the L part:" << endl;
 Matrix5x5 l = Matrix5x5::Identity();
-l.block<5,3>(0,0).triangularView<StrictlyLower>() = lu.matrixLU();
+l.block<5, 3>(0, 0).triangularView<StrictlyLower>() = lu.matrixLU();
 cout << l << endl;
 cout << "Here is the U part:" << endl;
 Matrix5x3 u = lu.matrixLU().triangularView<Upper>();
diff --git a/doc/snippets/compile_snippet.cpp.in b/doc/snippets/compile_snippet.cpp.in
index 04f276d..e841f43 100644
--- a/doc/snippets/compile_snippet.cpp.in
+++ b/doc/snippets/compile_snippet.cpp.in
@@ -1,5 +1,10 @@
 static bool eigen_did_assert = false;
-#define eigen_assert(X) if(!eigen_did_assert && !(X)){ std::cout << "### Assertion raised in " << __FILE__ << ":" << __LINE__ << ":\n" #X << "\n### The following would happen without assertions:\n"; eigen_did_assert = true;}
+#define eigen_assert(X)                                                                \
+  if (!eigen_did_assert && !(X)) {                                                     \
+    std::cout << "### Assertion raised in " << __FILE__ << ":" << __LINE__ << ":\n" #X \
+              << "\n### The following would happen without assertions:\n";             \
+    eigen_did_assert = true;                                                           \
+  }
 
 #include <iostream>
 #include <cassert>
@@ -9,12 +14,10 @@
 #define M_PI 3.1415926535897932384626433832795
 #endif
 
-
 using namespace Eigen;
 using namespace std;
 
-int main(int, char**)
-{
+int main(int, char**) {
   cout.precision(3);
 // intentionally remove indentation of snippet
 {
diff --git a/doc/snippets/tut_arithmetic_redux_minmax.cpp b/doc/snippets/tut_arithmetic_redux_minmax.cpp
index f4ae7f4..dc43358 100644
--- a/doc/snippets/tut_arithmetic_redux_minmax.cpp
+++ b/doc/snippets/tut_arithmetic_redux_minmax.cpp
@@ -1,12 +1,10 @@
-  Matrix3f m = Matrix3f::Random();
-  std::ptrdiff_t i, j;
-  float minOfM = m.minCoeff(&i,&j);
-  cout << "Here is the matrix m:\n" << m << endl;
-  cout << "Its minimum coefficient (" << minOfM 
-       << ") is at position (" << i << "," << j << ")\n\n";
+Matrix3f m = Matrix3f::Random();
+std::ptrdiff_t i, j;
+float minOfM = m.minCoeff(&i, &j);
+cout << "Here is the matrix m:\n" << m << endl;
+cout << "Its minimum coefficient (" << minOfM << ") is at position (" << i << "," << j << ")\n\n";
 
-  RowVector4i v = RowVector4i::Random();
-  int maxOfV = v.maxCoeff(&i);
-  cout << "Here is the vector v: " << v << endl;
-  cout << "Its maximum coefficient (" << maxOfV 
-       << ") is at position " << i << endl;
+RowVector4i v = RowVector4i::Random();
+int maxOfV = v.maxCoeff(&i);
+cout << "Here is the vector v: " << v << endl;
+cout << "Its maximum coefficient (" << maxOfV << ") is at position " << i << endl;
diff --git a/doc/snippets/tut_arithmetic_transpose_aliasing.cpp b/doc/snippets/tut_arithmetic_transpose_aliasing.cpp
index f82e6f2..75d46cf 100644
--- a/doc/snippets/tut_arithmetic_transpose_aliasing.cpp
+++ b/doc/snippets/tut_arithmetic_transpose_aliasing.cpp
@@ -1,5 +1,6 @@
-Matrix2i a; a << 1, 2, 3, 4;
+Matrix2i a;
+a << 1, 2, 3, 4;
 cout << "Here is the matrix a:\n" << a << endl;
 
-a = a.transpose(); // !!! do NOT do this !!!
+a = a.transpose();  // !!! do NOT do this !!!
 cout << "and the result of the aliasing effect:\n" << a << endl;
diff --git a/doc/snippets/tut_arithmetic_transpose_conjugate.cpp b/doc/snippets/tut_arithmetic_transpose_conjugate.cpp
index 88496b2..3b356d2 100644
--- a/doc/snippets/tut_arithmetic_transpose_conjugate.cpp
+++ b/doc/snippets/tut_arithmetic_transpose_conjugate.cpp
@@ -1,12 +1,8 @@
-MatrixXcf a = MatrixXcf::Random(2,2);
+MatrixXcf a = MatrixXcf::Random(2, 2);
 cout << "Here is the matrix a\n" << a << endl;
 
 cout << "Here is the matrix a^T\n" << a.transpose() << endl;
 
-
 cout << "Here is the conjugate of a\n" << a.conjugate() << endl;
 
-
 cout << "Here is the matrix a^*\n" << a.adjoint() << endl;
-
-
diff --git a/doc/snippets/tut_arithmetic_transpose_inplace.cpp b/doc/snippets/tut_arithmetic_transpose_inplace.cpp
index 5c81c9e..dbf8bc4 100644
--- a/doc/snippets/tut_arithmetic_transpose_inplace.cpp
+++ b/doc/snippets/tut_arithmetic_transpose_inplace.cpp
@@ -1,6 +1,6 @@
-MatrixXf a(2,3); a << 1, 2, 3, 4, 5, 6;
+MatrixXf a(2, 3);
+a << 1, 2, 3, 4, 5, 6;
 cout << "Here is the initial matrix a:\n" << a << endl;
 
-
 a.transposeInPlace();
 cout << "and after being transposed:\n" << a << endl;
diff --git a/doc/snippets/tut_matrix_assignment_resizing.cpp b/doc/snippets/tut_matrix_assignment_resizing.cpp
index cf18998..9f5da43 100644
--- a/doc/snippets/tut_matrix_assignment_resizing.cpp
+++ b/doc/snippets/tut_matrix_assignment_resizing.cpp
@@ -1,5 +1,5 @@
-MatrixXf a(2,2);
+MatrixXf a(2, 2);
 std::cout << "a is of size " << a.rows() << "x" << a.cols() << std::endl;
-MatrixXf b(3,3);
+MatrixXf b(3, 3);
 a = b;
 std::cout << "a is now of size " << a.rows() << "x" << a.cols() << std::endl;
diff --git a/doc/special_examples/Tutorial_sparse_example.cpp b/doc/special_examples/Tutorial_sparse_example.cpp
index 8850db0..b8994ba 100644
--- a/doc/special_examples/Tutorial_sparse_example.cpp
+++ b/doc/special_examples/Tutorial_sparse_example.cpp
@@ -2,28 +2,27 @@
 #include <vector>
 #include <iostream>
 
-typedef Eigen::SparseMatrix<double> SpMat; // declares a column-major sparse matrix type of double
+typedef Eigen::SparseMatrix<double> SpMat;  // declares a column-major sparse matrix type of double
 typedef Eigen::Triplet<double> T;
 
 void buildProblem(std::vector<T>& coefficients, Eigen::VectorXd& b, int n);
 void saveAsBitmap(const Eigen::VectorXd& x, int n, const char* filename);
 
-int main(int argc, char** argv)
-{
-  if(argc!=2) {
+int main(int argc, char** argv) {
+  if (argc != 2) {
     std::cerr << "Error: expected one and only one argument.\n";
     return -1;
   }
-  
-  int n = 300;  // size of the image
-  int m = n*n;  // number of unknowns (=number of pixels)
+
+  int n = 300;    // size of the image
+  int m = n * n;  // number of unknowns (=number of pixels)
 
   // Assembly:
-  std::vector<T> coefficients;            // list of non-zeros coefficients
-  Eigen::VectorXd b(m);                   // the right hand side-vector resulting from the constraints
+  std::vector<T> coefficients;  // list of non-zeros coefficients
+  Eigen::VectorXd b(m);         // the right hand side-vector resulting from the constraints
   buildProblem(coefficients, b, n);
 
-  SpMat A(m,m);
+  SpMat A(m, m);
   A.setFromTriplets(coefficients.begin(), coefficients.end());
 
   // Solving:
@@ -35,4 +34,3 @@
 
   return 0;
 }
-
diff --git a/doc/special_examples/Tutorial_sparse_example_details.cpp b/doc/special_examples/Tutorial_sparse_example_details.cpp
index bc18b01..18abd6f 100644
--- a/doc/special_examples/Tutorial_sparse_example_details.cpp
+++ b/doc/special_examples/Tutorial_sparse_example_details.cpp
@@ -2,43 +2,41 @@
 #include <vector>
 #include <QImage>
 
-typedef Eigen::SparseMatrix<double> SpMat; // declares a column-major sparse matrix type of double
+typedef Eigen::SparseMatrix<double> SpMat;  // declares a column-major sparse matrix type of double
 typedef Eigen::Triplet<double> T;
 
-void insertCoefficient(int id, int i, int j, double w, std::vector<T>& coeffs,
-                       Eigen::VectorXd& b, const Eigen::VectorXd& boundary)
-{
+void insertCoefficient(int id, int i, int j, double w, std::vector<T>& coeffs, Eigen::VectorXd& b,
+                       const Eigen::VectorXd& boundary) {
   int n = int(boundary.size());
-  int id1 = i+j*n;
+  int id1 = i + j * n;
 
-        if(i==-1 || i==n) b(id) -= w * boundary(j); // constrained coefficient
-  else  if(j==-1 || j==n) b(id) -= w * boundary(i); // constrained coefficient
-  else  coeffs.push_back(T(id,id1,w));              // unknown coefficient
+  if (i == -1 || i == n)
+    b(id) -= w * boundary(j);  // constrained coefficient
+  else if (j == -1 || j == n)
+    b(id) -= w * boundary(i);  // constrained coefficient
+  else
+    coeffs.push_back(T(id, id1, w));  // unknown coefficient
 }
 
-void buildProblem(std::vector<T>& coefficients, Eigen::VectorXd& b, int n)
-{
+void buildProblem(std::vector<T>& coefficients, Eigen::VectorXd& b, int n) {
   b.setZero();
-  Eigen::ArrayXd boundary = Eigen::ArrayXd::LinSpaced(n, 0,M_PI).sin().pow(2);
-  for(int j=0; j<n; ++j)
-  {
-    for(int i=0; i<n; ++i)
-    {
-      int id = i+j*n;
-      insertCoefficient(id, i-1,j, -1, coefficients, b, boundary);
-      insertCoefficient(id, i+1,j, -1, coefficients, b, boundary);
-      insertCoefficient(id, i,j-1, -1, coefficients, b, boundary);
-      insertCoefficient(id, i,j+1, -1, coefficients, b, boundary);
-      insertCoefficient(id, i,j,    4, coefficients, b, boundary);
+  Eigen::ArrayXd boundary = Eigen::ArrayXd::LinSpaced(n, 0, M_PI).sin().pow(2);
+  for (int j = 0; j < n; ++j) {
+    for (int i = 0; i < n; ++i) {
+      int id = i + j * n;
+      insertCoefficient(id, i - 1, j, -1, coefficients, b, boundary);
+      insertCoefficient(id, i + 1, j, -1, coefficients, b, boundary);
+      insertCoefficient(id, i, j - 1, -1, coefficients, b, boundary);
+      insertCoefficient(id, i, j + 1, -1, coefficients, b, boundary);
+      insertCoefficient(id, i, j, 4, coefficients, b, boundary);
     }
   }
 }
 
-void saveAsBitmap(const Eigen::VectorXd& x, int n, const char* filename)
-{
-  Eigen::Array<unsigned char,Eigen::Dynamic,Eigen::Dynamic> bits = (x*255).cast<unsigned char>();
-  QImage img(bits.data(), n,n,QImage::Format_Indexed8);
+void saveAsBitmap(const Eigen::VectorXd& x, int n, const char* filename) {
+  Eigen::Array<unsigned char, Eigen::Dynamic, Eigen::Dynamic> bits = (x * 255).cast<unsigned char>();
+  QImage img(bits.data(), n, n, QImage::Format_Indexed8);
   img.setColorCount(256);
-  for(int i=0;i<256;i++) img.setColor(i,qRgb(i,i,i));
+  for (int i = 0; i < 256; i++) img.setColor(i, qRgb(i, i, i));
   img.save(filename);
 }
diff --git a/doc/special_examples/random_cpp11.cpp b/doc/special_examples/random_cpp11.cpp
index bd73800..a59613a 100644
--- a/doc/special_examples/random_cpp11.cpp
+++ b/doc/special_examples/random_cpp11.cpp
@@ -5,8 +5,8 @@
 int main() {
   std::default_random_engine generator;
   std::poisson_distribution<int> distribution(4.1);
-  auto poisson = [&] () {return distribution(generator);};
+  auto poisson = [&]() { return distribution(generator); };
 
-  Eigen::RowVectorXi v = Eigen::RowVectorXi::NullaryExpr(10, poisson );
+  Eigen::RowVectorXi v = Eigen::RowVectorXi::NullaryExpr(10, poisson);
   std::cout << v << "\n";
 }
diff --git a/doc/tutorial.cpp b/doc/tutorial.cpp
index 62be7c2..7e58b61 100644
--- a/doc/tutorial.cpp
+++ b/doc/tutorial.cpp
@@ -1,7 +1,6 @@
 #include <Eigen/Array>
 
-int main(int argc, char *argv[])
-{
+int main(int argc, char *argv[]) {
   std::cout.precision(2);
 
   // demo static functions
@@ -13,29 +12,29 @@
   // demo non-static set... functions
   m4.setZero();
   m3.diagonal().setOnes();
-  
+
   std::cout << "*** Step 2 ***\nm3:\n" << m3 << "\nm4:\n" << m4 << std::endl;
 
   // demo fixed-size block() expression as lvalue and as rvalue
-  m4.block<3,3>(0,1) = m3;
-  m3.row(2) = m4.block<1,3>(2,0);
+  m4.block<3, 3>(0, 1) = m3;
+  m3.row(2) = m4.block<1, 3>(2, 0);
 
   std::cout << "*** Step 3 ***\nm3:\n" << m3 << "\nm4:\n" << m4 << std::endl;
 
   // demo dynamic-size block()
   {
     int rows = 3, cols = 3;
-    m4.block(0,1,3,3).setIdentity();
+    m4.block(0, 1, 3, 3).setIdentity();
     std::cout << "*** Step 4 ***\nm4:\n" << m4 << std::endl;
   }
 
   // demo vector blocks
-  m4.diagonal().block(1,2).setOnes();
+  m4.diagonal().block(1, 2).setOnes();
   std::cout << "*** Step 5 ***\nm4.diagonal():\n" << m4.diagonal() << std::endl;
   std::cout << "m4.diagonal().start(3)\n" << m4.diagonal().start(3) << std::endl;
 
   // demo coeff-wise operations
-  m4 = m4.cwise()*m4;
+  m4 = m4.cwise() * m4;
   m3 = m3.cwise().cos();
   std::cout << "*** Step 6 ***\nm3:\n" << m3 << "\nm4:\n" << m4 << std::endl;
 
@@ -46,17 +45,17 @@
   std::cout << "m4.rowwise().sum():\n" << m4.rowwise().sum() << std::endl;
 
   // demo intelligent auto-evaluation
-  m4 = m4 * m4; // auto-evaluates so no aliasing problem (performance penalty is low)
-  Eigen::Matrix4f other = (m4 * m4).lazy(); // forces lazy evaluation
-  m4 = m4 + m4; // here Eigen goes for lazy evaluation, as with most expressions
-  m4 = -m4 + m4 + 5 * m4; // same here, Eigen chooses lazy evaluation for all that.
-  m4 = m4 * (m4 + m4); // here Eigen chooses to first evaluate m4 + m4 into a temporary.
-                       // indeed, here it is an optimization to cache this intermediate result.
-  m3 = m3 * m4.block<3,3>(1,1); // here Eigen chooses NOT to evaluate block() into a temporary
-    // because accessing coefficients of that block expression is not more costly than accessing
-    // coefficients of a plain matrix.
-  m4 = m4 * m4.transpose(); // same here, lazy evaluation of the transpose.
-  m4 = m4 * m4.transpose().eval(); // forces immediate evaluation of the transpose
+  m4 = m4 * m4;                              // auto-evaluates so no aliasing problem (performance penalty is low)
+  Eigen::Matrix4f other = (m4 * m4).lazy();  // forces lazy evaluation
+  m4 = m4 + m4;                              // here Eigen goes for lazy evaluation, as with most expressions
+  m4 = -m4 + m4 + 5 * m4;                    // same here, Eigen chooses lazy evaluation for all that.
+  m4 = m4 * (m4 + m4);                       // here Eigen chooses to first evaluate m4 + m4 into a temporary.
+                                             // indeed, here it is an optimization to cache this intermediate result.
+  m3 = m3 * m4.block<3, 3>(1, 1);            // here Eigen chooses NOT to evaluate block() into a temporary
+                                   // because accessing coefficients of that block expression is not more costly than
+                                   // accessing coefficients of a plain matrix.
+  m4 = m4 * m4.transpose();         // same here, lazy evaluation of the transpose.
+  m4 = m4 * m4.transpose().eval();  // forces immediate evaluation of the transpose
 
   std::cout << "*** Step 8 ***\nm3:\n" << m3 << "\nm4:\n" << m4 << std::endl;
 }
diff --git a/failtest/bdcsvd_int.cpp b/failtest/bdcsvd_int.cpp
index 670752c..b419457 100644
--- a/failtest/bdcsvd_int.cpp
+++ b/failtest/bdcsvd_int.cpp
@@ -8,7 +8,4 @@
 
 using namespace Eigen;
 
-int main()
-{
-  BDCSVD<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
-}
+int main() { BDCSVD<Matrix<SCALAR, Dynamic, Dynamic> > qr(Matrix<SCALAR, Dynamic, Dynamic>::Random(10, 10)); }
diff --git a/failtest/block_nonconst_ctor_on_const_xpr_0.cpp b/failtest/block_nonconst_ctor_on_const_xpr_0.cpp
index 40b8201..b2e134b 100644
--- a/failtest/block_nonconst_ctor_on_const_xpr_0.cpp
+++ b/failtest/block_nonconst_ctor_on_const_xpr_0.cpp
@@ -8,8 +8,6 @@
 
 using namespace Eigen;
 
-void foo(CV_QUALIFIER Matrix3d &m){
-    Block<Matrix3d,3,3> b(m,0,0);
-}
+void foo(CV_QUALIFIER Matrix3d &m) { Block<Matrix3d, 3, 3> b(m, 0, 0); }
 
 int main() {}
diff --git a/failtest/block_nonconst_ctor_on_const_xpr_1.cpp b/failtest/block_nonconst_ctor_on_const_xpr_1.cpp
index ef6d537..c3ddc9a 100644
--- a/failtest/block_nonconst_ctor_on_const_xpr_1.cpp
+++ b/failtest/block_nonconst_ctor_on_const_xpr_1.cpp
@@ -8,8 +8,6 @@
 
 using namespace Eigen;
 
-void foo(CV_QUALIFIER Matrix3d &m){
-    Block<Matrix3d> b(m,0,0,3,3);
-}
+void foo(CV_QUALIFIER Matrix3d &m) { Block<Matrix3d> b(m, 0, 0, 3, 3); }
 
 int main() {}
diff --git a/failtest/block_nonconst_ctor_on_const_xpr_2.cpp b/failtest/block_nonconst_ctor_on_const_xpr_2.cpp
index 43f18ae..2a1ce6c 100644
--- a/failtest/block_nonconst_ctor_on_const_xpr_2.cpp
+++ b/failtest/block_nonconst_ctor_on_const_xpr_2.cpp
@@ -8,9 +8,9 @@
 
 using namespace Eigen;
 
-void foo(CV_QUALIFIER Matrix3d &m){
-    // row/column constructor
-    Block<Matrix3d,3,1> b(m,0);
+void foo(CV_QUALIFIER Matrix3d &m) {
+  // row/column constructor
+  Block<Matrix3d, 3, 1> b(m, 0);
 }
 
 int main() {}
diff --git a/failtest/block_on_const_type_actually_const_0.cpp b/failtest/block_on_const_type_actually_const_0.cpp
index 009bebe..3486f86 100644
--- a/failtest/block_on_const_type_actually_const_0.cpp
+++ b/failtest/block_on_const_type_actually_const_0.cpp
@@ -8,9 +8,9 @@
 
 using namespace Eigen;
 
-void foo(){
-    Matrix3f m;
-    Block<CV_QUALIFIER Matrix3f>(m, 0, 0, 3, 3).coeffRef(0, 0) = 1.0f;
+void foo() {
+  Matrix3f m;
+  Block<CV_QUALIFIER Matrix3f>(m, 0, 0, 3, 3).coeffRef(0, 0) = 1.0f;
 }
 
 int main() {}
diff --git a/failtest/block_on_const_type_actually_const_1.cpp b/failtest/block_on_const_type_actually_const_1.cpp
index 4c3e93f..349061e 100644
--- a/failtest/block_on_const_type_actually_const_1.cpp
+++ b/failtest/block_on_const_type_actually_const_1.cpp
@@ -8,9 +8,9 @@
 
 using namespace Eigen;
 
-void foo(){
-    MatrixXf m;
-    Block<CV_QUALIFIER MatrixXf, 3, 3>(m, 0, 0).coeffRef(0, 0) = 1.0f;
+void foo() {
+  MatrixXf m;
+  Block<CV_QUALIFIER MatrixXf, 3, 3>(m, 0, 0).coeffRef(0, 0) = 1.0f;
 }
 
 int main() {}
diff --git a/failtest/colpivqr_int.cpp b/failtest/colpivqr_int.cpp
index db11910..72fcb05 100644
--- a/failtest/colpivqr_int.cpp
+++ b/failtest/colpivqr_int.cpp
@@ -8,7 +8,6 @@
 
 using namespace Eigen;
 
-int main()
-{
-  ColPivHouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
+int main() {
+  ColPivHouseholderQR<Matrix<SCALAR, Dynamic, Dynamic> > qr(Matrix<SCALAR, Dynamic, Dynamic>::Random(10, 10));
 }
diff --git a/failtest/const_qualified_block_method_retval_0.cpp b/failtest/const_qualified_block_method_retval_0.cpp
index a6bd5fe..08b5d3c 100644
--- a/failtest/const_qualified_block_method_retval_0.cpp
+++ b/failtest/const_qualified_block_method_retval_0.cpp
@@ -8,8 +8,6 @@
 
 using namespace Eigen;
 
-void foo(CV_QUALIFIER Matrix3d &m){
-    Block<Matrix3d,3,3> b(m.block<3,3>(0,0));
-}
+void foo(CV_QUALIFIER Matrix3d &m) { Block<Matrix3d, 3, 3> b(m.block<3, 3>(0, 0)); }
 
 int main() {}
diff --git a/failtest/const_qualified_block_method_retval_1.cpp b/failtest/const_qualified_block_method_retval_1.cpp
index ef40c24..06e12c7 100644
--- a/failtest/const_qualified_block_method_retval_1.cpp
+++ b/failtest/const_qualified_block_method_retval_1.cpp
@@ -8,8 +8,6 @@
 
 using namespace Eigen;
 
-void foo(CV_QUALIFIER Matrix3d &m){
-    Block<Matrix3d> b(m.block(0,0,3,3));
-}
+void foo(CV_QUALIFIER Matrix3d &m) { Block<Matrix3d> b(m.block(0, 0, 3, 3)); }
 
 int main() {}
diff --git a/failtest/const_qualified_diagonal_method_retval.cpp b/failtest/const_qualified_diagonal_method_retval.cpp
index 809594a..f3acba6 100644
--- a/failtest/const_qualified_diagonal_method_retval.cpp
+++ b/failtest/const_qualified_diagonal_method_retval.cpp
@@ -8,8 +8,6 @@
 
 using namespace Eigen;
 
-void foo(CV_QUALIFIER Matrix3d &m){
-    Diagonal<Matrix3d> b(m.diagonal());
-}
+void foo(CV_QUALIFIER Matrix3d &m) { Diagonal<Matrix3d> b(m.diagonal()); }
 
 int main() {}
diff --git a/failtest/const_qualified_transpose_method_retval.cpp b/failtest/const_qualified_transpose_method_retval.cpp
index 2d7f19c..394f64a 100644
--- a/failtest/const_qualified_transpose_method_retval.cpp
+++ b/failtest/const_qualified_transpose_method_retval.cpp
@@ -8,8 +8,6 @@
 
 using namespace Eigen;
 
-void foo(CV_QUALIFIER Matrix3d &m){
-    Transpose<Matrix3d> b(m.transpose());
-}
+void foo(CV_QUALIFIER Matrix3d &m) { Transpose<Matrix3d> b(m.transpose()); }
 
 int main() {}
diff --git a/failtest/cwiseunaryview_nonconst_ctor_on_const_xpr.cpp b/failtest/cwiseunaryview_nonconst_ctor_on_const_xpr.cpp
index e23cf8f..643335a 100644
--- a/failtest/cwiseunaryview_nonconst_ctor_on_const_xpr.cpp
+++ b/failtest/cwiseunaryview_nonconst_ctor_on_const_xpr.cpp
@@ -8,8 +8,6 @@
 
 using namespace Eigen;
 
-void foo(CV_QUALIFIER Matrix3d &m){
-    CwiseUnaryView<internal::scalar_real_ref_op<double>,Matrix3d> t(m);
-}
+void foo(CV_QUALIFIER Matrix3d &m) { CwiseUnaryView<internal::scalar_real_ref_op<double>, Matrix3d> t(m); }
 
 int main() {}
diff --git a/failtest/cwiseunaryview_on_const_type_actually_const.cpp b/failtest/cwiseunaryview_on_const_type_actually_const.cpp
index fcd41df..7ecf542 100644
--- a/failtest/cwiseunaryview_on_const_type_actually_const.cpp
+++ b/failtest/cwiseunaryview_on_const_type_actually_const.cpp
@@ -8,9 +8,9 @@
 
 using namespace Eigen;
 
-void foo(){
-    MatrixXf m;
-    CwiseUnaryView<internal::scalar_real_ref_op<double>,CV_QUALIFIER MatrixXf>(m).coeffRef(0, 0) = 1.0f;
+void foo() {
+  MatrixXf m;
+  CwiseUnaryView<internal::scalar_real_ref_op<double>, CV_QUALIFIER MatrixXf>(m).coeffRef(0, 0) = 1.0f;
 }
 
 int main() {}
diff --git a/failtest/diagonal_nonconst_ctor_on_const_xpr.cpp b/failtest/diagonal_nonconst_ctor_on_const_xpr.cpp
index 76398a2..9241270 100644
--- a/failtest/diagonal_nonconst_ctor_on_const_xpr.cpp
+++ b/failtest/diagonal_nonconst_ctor_on_const_xpr.cpp
@@ -8,8 +8,6 @@
 
 using namespace Eigen;
 
-void foo(CV_QUALIFIER Matrix3d &m){
-    Diagonal<Matrix3d> d(m);
-}
+void foo(CV_QUALIFIER Matrix3d &m) { Diagonal<Matrix3d> d(m); }
 
 int main() {}
diff --git a/failtest/diagonal_on_const_type_actually_const.cpp b/failtest/diagonal_on_const_type_actually_const.cpp
index d4b2fd9..204dd43 100644
--- a/failtest/diagonal_on_const_type_actually_const.cpp
+++ b/failtest/diagonal_on_const_type_actually_const.cpp
@@ -8,9 +8,9 @@
 
 using namespace Eigen;
 
-void foo(){
-    MatrixXf m;
-    Diagonal<CV_QUALIFIER MatrixXf>(m).coeffRef(0) = 1.0f;
+void foo() {
+  MatrixXf m;
+  Diagonal<CV_QUALIFIER MatrixXf>(m).coeffRef(0) = 1.0f;
 }
 
 int main() {}
diff --git a/failtest/eigensolver_cplx.cpp b/failtest/eigensolver_cplx.cpp
index c2e21e1..44ad8ff 100644
--- a/failtest/eigensolver_cplx.cpp
+++ b/failtest/eigensolver_cplx.cpp
@@ -8,7 +8,4 @@
 
 using namespace Eigen;
 
-int main()
-{
-  EigenSolver<Matrix<SCALAR,Dynamic,Dynamic> > eig(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
-}
+int main() { EigenSolver<Matrix<SCALAR, Dynamic, Dynamic> > eig(Matrix<SCALAR, Dynamic, Dynamic>::Random(10, 10)); }
diff --git a/failtest/eigensolver_int.cpp b/failtest/eigensolver_int.cpp
index eda8dc2..ad14c0f 100644
--- a/failtest/eigensolver_int.cpp
+++ b/failtest/eigensolver_int.cpp
@@ -8,7 +8,4 @@
 
 using namespace Eigen;
 
-int main()
-{
-  EigenSolver<Matrix<SCALAR,Dynamic,Dynamic> > eig(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
-}
+int main() { EigenSolver<Matrix<SCALAR, Dynamic, Dynamic> > eig(Matrix<SCALAR, Dynamic, Dynamic>::Random(10, 10)); }
diff --git a/failtest/fullpivlu_int.cpp b/failtest/fullpivlu_int.cpp
index e9d2c6e..b52e8c0 100644
--- a/failtest/fullpivlu_int.cpp
+++ b/failtest/fullpivlu_int.cpp
@@ -8,7 +8,4 @@
 
 using namespace Eigen;
 
-int main()
-{
-  FullPivLU<Matrix<SCALAR,Dynamic,Dynamic> > lu(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
-}
+int main() { FullPivLU<Matrix<SCALAR, Dynamic, Dynamic> > lu(Matrix<SCALAR, Dynamic, Dynamic>::Random(10, 10)); }
diff --git a/failtest/fullpivqr_int.cpp b/failtest/fullpivqr_int.cpp
index d182a7b..34ddb2c 100644
--- a/failtest/fullpivqr_int.cpp
+++ b/failtest/fullpivqr_int.cpp
@@ -8,7 +8,6 @@
 
 using namespace Eigen;
 
-int main()
-{
-  FullPivHouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
+int main() {
+  FullPivHouseholderQR<Matrix<SCALAR, Dynamic, Dynamic> > qr(Matrix<SCALAR, Dynamic, Dynamic>::Random(10, 10));
 }
diff --git a/failtest/initializer_list_1.cpp b/failtest/initializer_list_1.cpp
index 92dfd1f..c9683fe 100644
--- a/failtest/initializer_list_1.cpp
+++ b/failtest/initializer_list_1.cpp
@@ -8,7 +8,4 @@
 
 using namespace Eigen;
 
-int main()
-{
-  Matrix<int, ROWS, 1> {1, 2, 3};
-}
+int main() { Matrix<int, ROWS, 1>{1, 2, 3}; }
diff --git a/failtest/initializer_list_2.cpp b/failtest/initializer_list_2.cpp
index 1996050..8ea34c9 100644
--- a/failtest/initializer_list_2.cpp
+++ b/failtest/initializer_list_2.cpp
@@ -10,7 +10,4 @@
 
 using namespace Eigen;
 
-int main()
-{
-  Matrix<int, ROWS, COLS> {1, 2, 3};
-}
+int main() { Matrix<int, ROWS, COLS>{1, 2, 3}; }
diff --git a/failtest/jacobisvd_int.cpp b/failtest/jacobisvd_int.cpp
index 12790ae..52430f0 100644
--- a/failtest/jacobisvd_int.cpp
+++ b/failtest/jacobisvd_int.cpp
@@ -8,7 +8,4 @@
 
 using namespace Eigen;
 
-int main()
-{
-  JacobiSVD<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
-}
+int main() { JacobiSVD<Matrix<SCALAR, Dynamic, Dynamic> > qr(Matrix<SCALAR, Dynamic, Dynamic>::Random(10, 10)); }
diff --git a/failtest/ldlt_int.cpp b/failtest/ldlt_int.cpp
index 243e457..13531b6 100644
--- a/failtest/ldlt_int.cpp
+++ b/failtest/ldlt_int.cpp
@@ -8,7 +8,4 @@
 
 using namespace Eigen;
 
-int main()
-{
-  LDLT<Matrix<SCALAR,Dynamic,Dynamic> > ldlt(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
-}
+int main() { LDLT<Matrix<SCALAR, Dynamic, Dynamic> > ldlt(Matrix<SCALAR, Dynamic, Dynamic>::Random(10, 10)); }
diff --git a/failtest/llt_int.cpp b/failtest/llt_int.cpp
index cb02065..40b055c 100644
--- a/failtest/llt_int.cpp
+++ b/failtest/llt_int.cpp
@@ -8,7 +8,4 @@
 
 using namespace Eigen;
 
-int main()
-{
-  LLT<Matrix<SCALAR,Dynamic,Dynamic> > llt(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
-}
+int main() { LLT<Matrix<SCALAR, Dynamic, Dynamic> > llt(Matrix<SCALAR, Dynamic, Dynamic>::Random(10, 10)); }
diff --git a/failtest/map_nonconst_ctor_on_const_ptr_0.cpp b/failtest/map_nonconst_ctor_on_const_ptr_0.cpp
index d75686f..5a76cde 100644
--- a/failtest/map_nonconst_ctor_on_const_ptr_0.cpp
+++ b/failtest/map_nonconst_ctor_on_const_ptr_0.cpp
@@ -8,8 +8,6 @@
 
 using namespace Eigen;
 
-void foo(CV_QUALIFIER float *ptr){
-    Map<Matrix3f> m(ptr);
-}
+void foo(CV_QUALIFIER float *ptr) { Map<Matrix3f> m(ptr); }
 
 int main() {}
diff --git a/failtest/map_nonconst_ctor_on_const_ptr_1.cpp b/failtest/map_nonconst_ctor_on_const_ptr_1.cpp
index eda134d..4306fba 100644
--- a/failtest/map_nonconst_ctor_on_const_ptr_1.cpp
+++ b/failtest/map_nonconst_ctor_on_const_ptr_1.cpp
@@ -8,8 +8,6 @@
 
 using namespace Eigen;
 
-void foo(CV_QUALIFIER float *ptr, DenseIndex size){
-    Map<ArrayXf> m(ptr, size);
-}
+void foo(CV_QUALIFIER float *ptr, DenseIndex size) { Map<ArrayXf> m(ptr, size); }
 
 int main() {}
diff --git a/failtest/map_nonconst_ctor_on_const_ptr_2.cpp b/failtest/map_nonconst_ctor_on_const_ptr_2.cpp
index 06b4b62..411d942 100644
--- a/failtest/map_nonconst_ctor_on_const_ptr_2.cpp
+++ b/failtest/map_nonconst_ctor_on_const_ptr_2.cpp
@@ -8,8 +8,6 @@
 
 using namespace Eigen;
 
-void foo(CV_QUALIFIER float *ptr, DenseIndex rows, DenseIndex cols){
-    Map<MatrixXf> m(ptr, rows, cols);
-}
+void foo(CV_QUALIFIER float *ptr, DenseIndex rows, DenseIndex cols) { Map<MatrixXf> m(ptr, rows, cols); }
 
 int main() {}
diff --git a/failtest/map_nonconst_ctor_on_const_ptr_3.cpp b/failtest/map_nonconst_ctor_on_const_ptr_3.cpp
index 830f6f0..4df7416 100644
--- a/failtest/map_nonconst_ctor_on_const_ptr_3.cpp
+++ b/failtest/map_nonconst_ctor_on_const_ptr_3.cpp
@@ -8,8 +8,8 @@
 
 using namespace Eigen;
 
-void foo(CV_QUALIFIER float *ptr, DenseIndex rows, DenseIndex cols){
-    Map<MatrixXf, Aligned, InnerStride<2> > m(ptr, rows, cols, InnerStride<2>());
+void foo(CV_QUALIFIER float *ptr, DenseIndex rows, DenseIndex cols) {
+  Map<MatrixXf, Aligned, InnerStride<2> > m(ptr, rows, cols, InnerStride<2>());
 }
 
 int main() {}
diff --git a/failtest/map_nonconst_ctor_on_const_ptr_4.cpp b/failtest/map_nonconst_ctor_on_const_ptr_4.cpp
index c3e8c95..97a8902 100644
--- a/failtest/map_nonconst_ctor_on_const_ptr_4.cpp
+++ b/failtest/map_nonconst_ctor_on_const_ptr_4.cpp
@@ -8,8 +8,8 @@
 
 using namespace Eigen;
 
-void foo(const float *ptr, DenseIndex rows, DenseIndex cols){
-    Map<CV_QUALIFIER MatrixXf, Unaligned, OuterStride<> > m(ptr, rows, cols, OuterStride<>(2));
+void foo(const float *ptr, DenseIndex rows, DenseIndex cols) {
+  Map<CV_QUALIFIER MatrixXf, Unaligned, OuterStride<> > m(ptr, rows, cols, OuterStride<>(2));
 }
 
 int main() {}
diff --git a/failtest/map_on_const_type_actually_const_0.cpp b/failtest/map_on_const_type_actually_const_0.cpp
index 8cb6aa0..9f485db 100644
--- a/failtest/map_on_const_type_actually_const_0.cpp
+++ b/failtest/map_on_const_type_actually_const_0.cpp
@@ -8,8 +8,6 @@
 
 using namespace Eigen;
 
-void foo(float *ptr){
-    Map<CV_QUALIFIER MatrixXf>(ptr, 1, 1).coeffRef(0,0) = 1.0f;
-}
+void foo(float *ptr) { Map<CV_QUALIFIER MatrixXf>(ptr, 1, 1).coeffRef(0, 0) = 1.0f; }
 
 int main() {}
diff --git a/failtest/map_on_const_type_actually_const_1.cpp b/failtest/map_on_const_type_actually_const_1.cpp
index 04e067c..c5ff0e6 100644
--- a/failtest/map_on_const_type_actually_const_1.cpp
+++ b/failtest/map_on_const_type_actually_const_1.cpp
@@ -8,8 +8,6 @@
 
 using namespace Eigen;
 
-void foo(float *ptr){
-    Map<CV_QUALIFIER Vector3f>(ptr).coeffRef(0) = 1.0f;
-}
+void foo(float *ptr) { Map<CV_QUALIFIER Vector3f>(ptr).coeffRef(0) = 1.0f; }
 
 int main() {}
diff --git a/failtest/partialpivlu_int.cpp b/failtest/partialpivlu_int.cpp
index 98ef282..dd79735 100644
--- a/failtest/partialpivlu_int.cpp
+++ b/failtest/partialpivlu_int.cpp
@@ -8,7 +8,4 @@
 
 using namespace Eigen;
 
-int main()
-{
-  PartialPivLU<Matrix<SCALAR,Dynamic,Dynamic> > lu(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
-}
+int main() { PartialPivLU<Matrix<SCALAR, Dynamic, Dynamic> > lu(Matrix<SCALAR, Dynamic, Dynamic>::Random(10, 10)); }
diff --git a/failtest/qr_int.cpp b/failtest/qr_int.cpp
index ce200e8..541c544 100644
--- a/failtest/qr_int.cpp
+++ b/failtest/qr_int.cpp
@@ -8,7 +8,4 @@
 
 using namespace Eigen;
 
-int main()
-{
-  HouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
-}
+int main() { HouseholderQR<Matrix<SCALAR, Dynamic, Dynamic> > qr(Matrix<SCALAR, Dynamic, Dynamic>::Random(10, 10)); }
diff --git a/failtest/ref_1.cpp b/failtest/ref_1.cpp
index 8b798d5..4e50d05 100644
--- a/failtest/ref_1.cpp
+++ b/failtest/ref_1.cpp
@@ -8,10 +8,9 @@
 
 using namespace Eigen;
 
-void call_ref(Ref<VectorXf> a) { }
+void call_ref(Ref<VectorXf> a) {}
 
-int main()
-{
+int main() {
   VectorXf a(10);
   CV_QUALIFIER VectorXf& ac(a);
   call_ref(ac);
diff --git a/failtest/ref_2.cpp b/failtest/ref_2.cpp
index 0b779cc..7db5075 100644
--- a/failtest/ref_2.cpp
+++ b/failtest/ref_2.cpp
@@ -2,11 +2,10 @@
 
 using namespace Eigen;
 
-void call_ref(Ref<VectorXf> a) { }
+void call_ref(Ref<VectorXf> a) {}
 
-int main()
-{
-  MatrixXf A(10,10);
+int main() {
+  MatrixXf A(10, 10);
 #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
   call_ref(A.row(3));
 #else
diff --git a/failtest/ref_3.cpp b/failtest/ref_3.cpp
index f46027d..6310d5e 100644
--- a/failtest/ref_3.cpp
+++ b/failtest/ref_3.cpp
@@ -3,13 +3,12 @@
 using namespace Eigen;
 
 #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
-void call_ref(Ref<VectorXf> a) { }
+void call_ref(Ref<VectorXf> a) {}
 #else
-void call_ref(const Ref<const VectorXf> &a) { }
+void call_ref(const Ref<const VectorXf> &a) {}
 #endif
 
-int main()
-{
+int main() {
   VectorXf a(10);
-  call_ref(a+a);
+  call_ref(a + a);
 }
diff --git a/failtest/ref_4.cpp b/failtest/ref_4.cpp
index 6c11fa4..49f9237 100644
--- a/failtest/ref_4.cpp
+++ b/failtest/ref_4.cpp
@@ -2,11 +2,10 @@
 
 using namespace Eigen;
 
-void call_ref(Ref<MatrixXf,0,OuterStride<> > a) {}
+void call_ref(Ref<MatrixXf, 0, OuterStride<> > a) {}
 
-int main()
-{
-  MatrixXf A(10,10);
+int main() {
+  MatrixXf A(10, 10);
 #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
   call_ref(A.transpose());
 #else
diff --git a/failtest/ref_5.cpp b/failtest/ref_5.cpp
index 846d527..173f4fa 100644
--- a/failtest/ref_5.cpp
+++ b/failtest/ref_5.cpp
@@ -2,10 +2,9 @@
 
 using namespace Eigen;
 
-void call_ref(Ref<VectorXf> a) { }
+void call_ref(Ref<VectorXf> a) {}
 
-int main()
-{
+int main() {
   VectorXf a(10);
   DenseBase<VectorXf> &ac(a);
 #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
diff --git a/failtest/selfadjointview_nonconst_ctor_on_const_xpr.cpp b/failtest/selfadjointview_nonconst_ctor_on_const_xpr.cpp
index a240f81..cf04957 100644
--- a/failtest/selfadjointview_nonconst_ctor_on_const_xpr.cpp
+++ b/failtest/selfadjointview_nonconst_ctor_on_const_xpr.cpp
@@ -8,8 +8,6 @@
 
 using namespace Eigen;
 
-void foo(CV_QUALIFIER Matrix3d &m){
-    SelfAdjointView<Matrix3d,Upper> t(m);
-}
+void foo(CV_QUALIFIER Matrix3d &m) { SelfAdjointView<Matrix3d, Upper> t(m); }
 
 int main() {}
diff --git a/failtest/selfadjointview_on_const_type_actually_const.cpp b/failtest/selfadjointview_on_const_type_actually_const.cpp
index 19aaad6..7205b53 100644
--- a/failtest/selfadjointview_on_const_type_actually_const.cpp
+++ b/failtest/selfadjointview_on_const_type_actually_const.cpp
@@ -8,9 +8,9 @@
 
 using namespace Eigen;
 
-void foo(){
-    MatrixXf m;
-    SelfAdjointView<CV_QUALIFIER MatrixXf,Upper>(m).coeffRef(0, 0) = 1.0f;
+void foo() {
+  MatrixXf m;
+  SelfAdjointView<CV_QUALIFIER MatrixXf, Upper>(m).coeffRef(0, 0) = 1.0f;
 }
 
 int main() {}
diff --git a/failtest/sparse_ref_1.cpp b/failtest/sparse_ref_1.cpp
index d78d1f9..30777e7 100644
--- a/failtest/sparse_ref_1.cpp
+++ b/failtest/sparse_ref_1.cpp
@@ -8,11 +8,10 @@
 
 using namespace Eigen;
 
-void call_ref(Ref<SparseMatrix<float> > a) { }
+void call_ref(Ref<SparseMatrix<float> > a) {}
 
-int main()
-{
-  SparseMatrix<float> a(10,10);
+int main() {
+  SparseMatrix<float> a(10, 10);
   CV_QUALIFIER SparseMatrix<float>& ac(a);
   call_ref(ac);
 }
diff --git a/failtest/sparse_ref_2.cpp b/failtest/sparse_ref_2.cpp
index 46c9440..c36f629 100644
--- a/failtest/sparse_ref_2.cpp
+++ b/failtest/sparse_ref_2.cpp
@@ -2,11 +2,10 @@
 
 using namespace Eigen;
 
-void call_ref(Ref<SparseMatrix<float> > a) { }
+void call_ref(Ref<SparseMatrix<float> > a) {}
 
-int main()
-{
-  SparseMatrix<float> A(10,10);
+int main() {
+  SparseMatrix<float> A(10, 10);
 #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
   call_ref(A.row(3));
 #else
diff --git a/failtest/sparse_ref_3.cpp b/failtest/sparse_ref_3.cpp
index a9949b5..e62c557 100644
--- a/failtest/sparse_ref_3.cpp
+++ b/failtest/sparse_ref_3.cpp
@@ -3,13 +3,12 @@
 using namespace Eigen;
 
 #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
-void call_ref(Ref<SparseMatrix<float> > a) { }
+void call_ref(Ref<SparseMatrix<float> > a) {}
 #else
-void call_ref(const Ref<const SparseMatrix<float> > &a) { }
+void call_ref(const Ref<const SparseMatrix<float> > &a) {}
 #endif
 
-int main()
-{
-  SparseMatrix<float> a(10,10);
-  call_ref(a+a);
+int main() {
+  SparseMatrix<float> a(10, 10);
+  call_ref(a + a);
 }
diff --git a/failtest/sparse_ref_4.cpp b/failtest/sparse_ref_4.cpp
index 57bb6a1..2e67240 100644
--- a/failtest/sparse_ref_4.cpp
+++ b/failtest/sparse_ref_4.cpp
@@ -4,9 +4,8 @@
 
 void call_ref(Ref<SparseMatrix<float> > a) {}
 
-int main()
-{
-  SparseMatrix<float> A(10,10);
+int main() {
+  SparseMatrix<float> A(10, 10);
 #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
   call_ref(A.transpose());
 #else
diff --git a/failtest/sparse_ref_5.cpp b/failtest/sparse_ref_5.cpp
index 4478f6f..f842b57 100644
--- a/failtest/sparse_ref_5.cpp
+++ b/failtest/sparse_ref_5.cpp
@@ -2,11 +2,10 @@
 
 using namespace Eigen;
 
-void call_ref(Ref<SparseMatrix<float> > a) { }
+void call_ref(Ref<SparseMatrix<float> > a) {}
 
-int main()
-{
-  SparseMatrix<float> a(10,10);
+int main() {
+  SparseMatrix<float> a(10, 10);
   SparseMatrixBase<SparseMatrix<float> > &ac(a);
 #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
   call_ref(ac);
diff --git a/failtest/sparse_storage_mismatch.cpp b/failtest/sparse_storage_mismatch.cpp
index 51840d4..de051ac 100644
--- a/failtest/sparse_storage_mismatch.cpp
+++ b/failtest/sparse_storage_mismatch.cpp
@@ -1,16 +1,15 @@
 #include "../Eigen/Sparse"
 using namespace Eigen;
 
-typedef SparseMatrix<double,ColMajor> Mat1;
+typedef SparseMatrix<double, ColMajor> Mat1;
 #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
-typedef SparseMatrix<double,RowMajor> Mat2;
+typedef SparseMatrix<double, RowMajor> Mat2;
 #else
-typedef SparseMatrix<double,ColMajor> Mat2;
+typedef SparseMatrix<double, ColMajor> Mat2;
 #endif
 
-int main()
-{
-  Mat1 a(10,10);
-  Mat2 b(10,10);
+int main() {
+  Mat1 a(10, 10);
+  Mat2 b(10, 10);
   a += b;
 }
diff --git a/failtest/swap_1.cpp b/failtest/swap_1.cpp
index 1063797..8f9648a 100644
--- a/failtest/swap_1.cpp
+++ b/failtest/swap_1.cpp
@@ -2,8 +2,7 @@
 
 using namespace Eigen;
 
-int main()
-{
+int main() {
   VectorXf a(10), b(10);
 #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
   const DenseBase<VectorXf> &ac(a);
diff --git a/failtest/swap_2.cpp b/failtest/swap_2.cpp
index b386cf4..5ad90e3 100644
--- a/failtest/swap_2.cpp
+++ b/failtest/swap_2.cpp
@@ -2,8 +2,7 @@
 
 using namespace Eigen;
 
-int main()
-{
+int main() {
   VectorXf a(10), b(10);
   VectorXf const &ac(a);
 #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
diff --git a/failtest/ternary_1.cpp b/failtest/ternary_1.cpp
index b40bcb0..4f957f4 100644
--- a/failtest/ternary_1.cpp
+++ b/failtest/ternary_1.cpp
@@ -2,12 +2,11 @@
 
 using namespace Eigen;
 
-int main(int argc,char **)
-{
+int main(int argc, char **) {
   VectorXf a(10), b(10);
 #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
-  b = argc>1 ? 2*a : -a;
+  b = argc > 1 ? 2 * a : -a;
 #else
-  b = argc>1 ? 2*a : VectorXf(-a);
+  b = argc > 1 ? 2 * a : VectorXf(-a);
 #endif
 }
diff --git a/failtest/ternary_2.cpp b/failtest/ternary_2.cpp
index a46b12b..801d39f 100644
--- a/failtest/ternary_2.cpp
+++ b/failtest/ternary_2.cpp
@@ -2,12 +2,11 @@
 
 using namespace Eigen;
 
-int main(int argc,char **)
-{
+int main(int argc, char **) {
   VectorXf a(10), b(10);
 #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
-  b = argc>1 ? 2*a : a+a;
+  b = argc > 1 ? 2 * a : a + a;
 #else
-  b = argc>1 ? VectorXf(2*a) : VectorXf(a+a);
+  b = argc > 1 ? VectorXf(2 * a) : VectorXf(a + a);
 #endif
 }
diff --git a/failtest/transpose_nonconst_ctor_on_const_xpr.cpp b/failtest/transpose_nonconst_ctor_on_const_xpr.cpp
index 4223e7f..79d39aa 100644
--- a/failtest/transpose_nonconst_ctor_on_const_xpr.cpp
+++ b/failtest/transpose_nonconst_ctor_on_const_xpr.cpp
@@ -8,8 +8,6 @@
 
 using namespace Eigen;
 
-void foo(CV_QUALIFIER Matrix3d &m){
-    Transpose<Matrix3d> t(m);
-}
+void foo(CV_QUALIFIER Matrix3d &m) { Transpose<Matrix3d> t(m); }
 
 int main() {}
diff --git a/failtest/transpose_on_const_type_actually_const.cpp b/failtest/transpose_on_const_type_actually_const.cpp
index d0b7d0d..29500da 100644
--- a/failtest/transpose_on_const_type_actually_const.cpp
+++ b/failtest/transpose_on_const_type_actually_const.cpp
@@ -8,9 +8,9 @@
 
 using namespace Eigen;
 
-void foo(){
-    MatrixXf m;
-    Transpose<CV_QUALIFIER MatrixXf>(m).coeffRef(0, 0) = 1.0f;
+void foo() {
+  MatrixXf m;
+  Transpose<CV_QUALIFIER MatrixXf>(m).coeffRef(0, 0) = 1.0f;
 }
 
 int main() {}
diff --git a/failtest/triangularview_nonconst_ctor_on_const_xpr.cpp b/failtest/triangularview_nonconst_ctor_on_const_xpr.cpp
index 807447e..811ec3a 100644
--- a/failtest/triangularview_nonconst_ctor_on_const_xpr.cpp
+++ b/failtest/triangularview_nonconst_ctor_on_const_xpr.cpp
@@ -8,8 +8,6 @@
 
 using namespace Eigen;
 
-void foo(CV_QUALIFIER Matrix3d &m){
-  TriangularView<Matrix3d,Upper> t(m);
-}
+void foo(CV_QUALIFIER Matrix3d &m) { TriangularView<Matrix3d, Upper> t(m); }
 
 int main() {}
diff --git a/failtest/triangularview_on_const_type_actually_const.cpp b/failtest/triangularview_on_const_type_actually_const.cpp
index 0a381a6..b95b37d 100644
--- a/failtest/triangularview_on_const_type_actually_const.cpp
+++ b/failtest/triangularview_on_const_type_actually_const.cpp
@@ -8,9 +8,9 @@
 
 using namespace Eigen;
 
-void foo(){
-    MatrixXf m;
-    TriangularView<CV_QUALIFIER MatrixXf,Upper>(m).coeffRef(0, 0) = 1.0f;
+void foo() {
+  MatrixXf m;
+  TriangularView<CV_QUALIFIER MatrixXf, Upper>(m).coeffRef(0, 0) = 1.0f;
 }
 
 int main() {}
diff --git a/lapack/complex_double.cpp b/lapack/complex_double.cpp
index 492f743..1056767 100644
--- a/lapack/complex_double.cpp
+++ b/lapack/complex_double.cpp
@@ -7,11 +7,11 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-#define SCALAR        std::complex<double>
+#define SCALAR std::complex<double>
 #define SCALAR_SUFFIX z
 #define SCALAR_SUFFIX_UP "Z"
 #define REAL_SCALAR_SUFFIX d
-#define ISCOMPLEX     1
+#define ISCOMPLEX 1
 
 #include "cholesky.inc"
 #include "lu.inc"
diff --git a/lapack/complex_single.cpp b/lapack/complex_single.cpp
index cdf989e..40ab913 100644
--- a/lapack/complex_single.cpp
+++ b/lapack/complex_single.cpp
@@ -7,11 +7,11 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-#define SCALAR        std::complex<float>
+#define SCALAR std::complex<float>
 #define SCALAR_SUFFIX c
 #define SCALAR_SUFFIX_UP "C"
 #define REAL_SCALAR_SUFFIX s
-#define ISCOMPLEX     1
+#define ISCOMPLEX 1
 
 #include "cholesky.inc"
 #include "lu.inc"
diff --git a/lapack/double.cpp b/lapack/double.cpp
index afabce3..9e57e90 100644
--- a/lapack/double.cpp
+++ b/lapack/double.cpp
@@ -7,10 +7,10 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-#define SCALAR        double
+#define SCALAR double
 #define SCALAR_SUFFIX d
 #define SCALAR_SUFFIX_UP "D"
-#define ISCOMPLEX     0
+#define ISCOMPLEX 0
 
 #include "cholesky.inc"
 #include "lu.inc"
diff --git a/lapack/lapack.h b/lapack/lapack.h
index 121d233..9bb222b 100644
--- a/lapack/lapack.h
+++ b/lapack/lapack.h
@@ -4,144 +4,128 @@
 #include "../blas/blas.h"
 
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
 
-int BLASFUNC(csymv) (const char *, const int *, const float  *, const float  *, const int *, const float  *, const int *, const float  *, float  *, const int *);
-int BLASFUNC(zsymv) (const char *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
-int BLASFUNC(xsymv) (const char *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *);
+int BLASFUNC(csymv)(const char *, const int *, const float *, const float *, const int *, const float *, const int *,
+                    const float *, float *, const int *);
+int BLASFUNC(zsymv)(const char *, const int *, const double *, const double *, const int *, const double *, const int *,
+                    const double *, double *, const int *);
+int BLASFUNC(xsymv)(const char *, const int *, const double *, const double *, const int *, const double *, const int *,
+                    const double *, double *, const int *);
 
+int BLASFUNC(cspmv)(char *, int *, float *, float *, float *, int *, float *, float *, int *);
+int BLASFUNC(zspmv)(char *, int *, double *, double *, double *, int *, double *, double *, int *);
+int BLASFUNC(xspmv)(char *, int *, double *, double *, double *, int *, double *, double *, int *);
 
-int BLASFUNC(cspmv) (char *, int *, float  *, float *,
-         float  *, int *, float *, float *, int *);
-int BLASFUNC(zspmv) (char *, int *, double  *, double *,
-         double  *, int *, double *, double *, int *);
-int BLASFUNC(xspmv) (char *, int *, double  *, double *,
-         double  *, int *, double *, double *, int *);
+int BLASFUNC(csyr)(char *, int *, float *, float *, int *, float *, int *);
+int BLASFUNC(zsyr)(char *, int *, double *, double *, int *, double *, int *);
+int BLASFUNC(xsyr)(char *, int *, double *, double *, int *, double *, int *);
 
-int BLASFUNC(csyr) (char *, int *, float   *, float  *, int *,
-        float  *, int *);
-int BLASFUNC(zsyr) (char *, int *, double  *, double *, int *,
-        double *, int *);
-int BLASFUNC(xsyr) (char *, int *, double  *, double *, int *,
-        double *, int *);
+int BLASFUNC(cspr)(char *, int *, float *, float *, int *, float *);
+int BLASFUNC(zspr)(char *, int *, double *, double *, int *, double *);
+int BLASFUNC(xspr)(char *, int *, double *, double *, int *, double *);
 
-int BLASFUNC(cspr) (char *, int *, float   *, float  *, int *,
-        float  *);
-int BLASFUNC(zspr) (char *, int *, double  *, double *, int *,
-        double *);
-int BLASFUNC(xspr) (char *, int *, double  *, double *, int *,
-        double *);
+int BLASFUNC(sgemt)(char *, int *, int *, float *, float *, int *, float *, int *);
+int BLASFUNC(dgemt)(char *, int *, int *, double *, double *, int *, double *, int *);
+int BLASFUNC(cgemt)(char *, int *, int *, float *, float *, int *, float *, int *);
+int BLASFUNC(zgemt)(char *, int *, int *, double *, double *, int *, double *, int *);
 
-int BLASFUNC(sgemt)(char *, int *, int *, float  *, float  *, int *,
-        float  *, int *);
-int BLASFUNC(dgemt)(char *, int *, int *, double *, double *, int *,
-        double *, int *);
-int BLASFUNC(cgemt)(char *, int *, int *, float  *, float  *, int *,
-        float  *, int *);
-int BLASFUNC(zgemt)(char *, int *, int *, double *, double *, int *,
-        double *, int *);
+int BLASFUNC(sgema)(char *, char *, int *, int *, float *, float *, int *, float *, float *, int *, float *, int *);
+int BLASFUNC(dgema)(char *, char *, int *, int *, double *, double *, int *, double *, double *, int *, double *,
+                    int *);
+int BLASFUNC(cgema)(char *, char *, int *, int *, float *, float *, int *, float *, float *, int *, float *, int *);
+int BLASFUNC(zgema)(char *, char *, int *, int *, double *, double *, int *, double *, double *, int *, double *,
+                    int *);
 
-int BLASFUNC(sgema)(char *, char *, int *, int *, float  *,
-        float  *, int *, float *, float  *, int *, float *, int *);
-int BLASFUNC(dgema)(char *, char *, int *, int *, double *,
-        double *, int *, double*, double *, int *, double*, int *);
-int BLASFUNC(cgema)(char *, char *, int *, int *, float  *,
-        float  *, int *, float *, float  *, int *, float *, int *);
-int BLASFUNC(zgema)(char *, char *, int *, int *, double *,
-        double *, int *, double*, double *, int *, double*, int *);
+int BLASFUNC(sgems)(char *, char *, int *, int *, float *, float *, int *, float *, float *, int *, float *, int *);
+int BLASFUNC(dgems)(char *, char *, int *, int *, double *, double *, int *, double *, double *, int *, double *,
+                    int *);
+int BLASFUNC(cgems)(char *, char *, int *, int *, float *, float *, int *, float *, float *, int *, float *, int *);
+int BLASFUNC(zgems)(char *, char *, int *, int *, double *, double *, int *, double *, double *, int *, double *,
+                    int *);
 
-int BLASFUNC(sgems)(char *, char *, int *, int *, float  *,
-        float  *, int *, float *, float  *, int *, float *, int *);
-int BLASFUNC(dgems)(char *, char *, int *, int *, double *,
-        double *, int *, double*, double *, int *, double*, int *);
-int BLASFUNC(cgems)(char *, char *, int *, int *, float  *,
-        float  *, int *, float *, float  *, int *, float *, int *);
-int BLASFUNC(zgems)(char *, char *, int *, int *, double *,
-        double *, int *, double*, double *, int *, double*, int *);
-
-int BLASFUNC(sgetf2)(int *, int *, float  *, int *, int *, int *);
+int BLASFUNC(sgetf2)(int *, int *, float *, int *, int *, int *);
 int BLASFUNC(dgetf2)(int *, int *, double *, int *, int *, int *);
 int BLASFUNC(qgetf2)(int *, int *, double *, int *, int *, int *);
-int BLASFUNC(cgetf2)(int *, int *, float  *, int *, int *, int *);
+int BLASFUNC(cgetf2)(int *, int *, float *, int *, int *, int *);
 int BLASFUNC(zgetf2)(int *, int *, double *, int *, int *, int *);
 int BLASFUNC(xgetf2)(int *, int *, double *, int *, int *, int *);
 
-int BLASFUNC(sgetrf)(int *, int *, float  *, int *, int *, int *);
+int BLASFUNC(sgetrf)(int *, int *, float *, int *, int *, int *);
 int BLASFUNC(dgetrf)(int *, int *, double *, int *, int *, int *);
 int BLASFUNC(qgetrf)(int *, int *, double *, int *, int *, int *);
-int BLASFUNC(cgetrf)(int *, int *, float  *, int *, int *, int *);
+int BLASFUNC(cgetrf)(int *, int *, float *, int *, int *, int *);
 int BLASFUNC(zgetrf)(int *, int *, double *, int *, int *, int *);
 int BLASFUNC(xgetrf)(int *, int *, double *, int *, int *, int *);
 
-int BLASFUNC(slaswp)(int *, float  *, int *, int *, int *, int *, int *);
+int BLASFUNC(slaswp)(int *, float *, int *, int *, int *, int *, int *);
 int BLASFUNC(dlaswp)(int *, double *, int *, int *, int *, int *, int *);
 int BLASFUNC(qlaswp)(int *, double *, int *, int *, int *, int *, int *);
-int BLASFUNC(claswp)(int *, float  *, int *, int *, int *, int *, int *);
+int BLASFUNC(claswp)(int *, float *, int *, int *, int *, int *, int *);
 int BLASFUNC(zlaswp)(int *, double *, int *, int *, int *, int *, int *);
 int BLASFUNC(xlaswp)(int *, double *, int *, int *, int *, int *, int *);
 
-int BLASFUNC(sgetrs)(char *, int *, int *, float  *, int *, int *, float  *, int *, int *);
+int BLASFUNC(sgetrs)(char *, int *, int *, float *, int *, int *, float *, int *, int *);
 int BLASFUNC(dgetrs)(char *, int *, int *, double *, int *, int *, double *, int *, int *);
 int BLASFUNC(qgetrs)(char *, int *, int *, double *, int *, int *, double *, int *, int *);
-int BLASFUNC(cgetrs)(char *, int *, int *, float  *, int *, int *, float  *, int *, int *);
+int BLASFUNC(cgetrs)(char *, int *, int *, float *, int *, int *, float *, int *, int *);
 int BLASFUNC(zgetrs)(char *, int *, int *, double *, int *, int *, double *, int *, int *);
 int BLASFUNC(xgetrs)(char *, int *, int *, double *, int *, int *, double *, int *, int *);
 
-int BLASFUNC(sgesv)(int *, int *, float  *, int *, int *, float *, int *, int *);
-int BLASFUNC(dgesv)(int *, int *, double *, int *, int *, double*, int *, int *);
-int BLASFUNC(qgesv)(int *, int *, double *, int *, int *, double*, int *, int *);
-int BLASFUNC(cgesv)(int *, int *, float  *, int *, int *, float *, int *, int *);
-int BLASFUNC(zgesv)(int *, int *, double *, int *, int *, double*, int *, int *);
-int BLASFUNC(xgesv)(int *, int *, double *, int *, int *, double*, int *, int *);
+int BLASFUNC(sgesv)(int *, int *, float *, int *, int *, float *, int *, int *);
+int BLASFUNC(dgesv)(int *, int *, double *, int *, int *, double *, int *, int *);
+int BLASFUNC(qgesv)(int *, int *, double *, int *, int *, double *, int *, int *);
+int BLASFUNC(cgesv)(int *, int *, float *, int *, int *, float *, int *, int *);
+int BLASFUNC(zgesv)(int *, int *, double *, int *, int *, double *, int *, int *);
+int BLASFUNC(xgesv)(int *, int *, double *, int *, int *, double *, int *, int *);
 
-int BLASFUNC(spotf2)(char *, int *, float  *, int *, int *);
+int BLASFUNC(spotf2)(char *, int *, float *, int *, int *);
 int BLASFUNC(dpotf2)(char *, int *, double *, int *, int *);
 int BLASFUNC(qpotf2)(char *, int *, double *, int *, int *);
-int BLASFUNC(cpotf2)(char *, int *, float  *, int *, int *);
+int BLASFUNC(cpotf2)(char *, int *, float *, int *, int *);
 int BLASFUNC(zpotf2)(char *, int *, double *, int *, int *);
 int BLASFUNC(xpotf2)(char *, int *, double *, int *, int *);
 
-int BLASFUNC(spotrf)(char *, int *, float  *, int *, int *);
+int BLASFUNC(spotrf)(char *, int *, float *, int *, int *);
 int BLASFUNC(dpotrf)(char *, int *, double *, int *, int *);
 int BLASFUNC(qpotrf)(char *, int *, double *, int *, int *);
-int BLASFUNC(cpotrf)(char *, int *, float  *, int *, int *);
+int BLASFUNC(cpotrf)(char *, int *, float *, int *, int *);
 int BLASFUNC(zpotrf)(char *, int *, double *, int *, int *);
 int BLASFUNC(xpotrf)(char *, int *, double *, int *, int *);
 
-int BLASFUNC(slauu2)(char *, int *, float  *, int *, int *);
+int BLASFUNC(slauu2)(char *, int *, float *, int *, int *);
 int BLASFUNC(dlauu2)(char *, int *, double *, int *, int *);
 int BLASFUNC(qlauu2)(char *, int *, double *, int *, int *);
-int BLASFUNC(clauu2)(char *, int *, float  *, int *, int *);
+int BLASFUNC(clauu2)(char *, int *, float *, int *, int *);
 int BLASFUNC(zlauu2)(char *, int *, double *, int *, int *);
 int BLASFUNC(xlauu2)(char *, int *, double *, int *, int *);
 
-int BLASFUNC(slauum)(char *, int *, float  *, int *, int *);
+int BLASFUNC(slauum)(char *, int *, float *, int *, int *);
 int BLASFUNC(dlauum)(char *, int *, double *, int *, int *);
 int BLASFUNC(qlauum)(char *, int *, double *, int *, int *);
-int BLASFUNC(clauum)(char *, int *, float  *, int *, int *);
+int BLASFUNC(clauum)(char *, int *, float *, int *, int *);
 int BLASFUNC(zlauum)(char *, int *, double *, int *, int *);
 int BLASFUNC(xlauum)(char *, int *, double *, int *, int *);
 
-int BLASFUNC(strti2)(char *, char *, int *, float  *, int *, int *);
+int BLASFUNC(strti2)(char *, char *, int *, float *, int *, int *);
 int BLASFUNC(dtrti2)(char *, char *, int *, double *, int *, int *);
 int BLASFUNC(qtrti2)(char *, char *, int *, double *, int *, int *);
-int BLASFUNC(ctrti2)(char *, char *, int *, float  *, int *, int *);
+int BLASFUNC(ctrti2)(char *, char *, int *, float *, int *, int *);
 int BLASFUNC(ztrti2)(char *, char *, int *, double *, int *, int *);
 int BLASFUNC(xtrti2)(char *, char *, int *, double *, int *, int *);
 
-int BLASFUNC(strtri)(char *, char *, int *, float  *, int *, int *);
+int BLASFUNC(strtri)(char *, char *, int *, float *, int *, int *);
 int BLASFUNC(dtrtri)(char *, char *, int *, double *, int *, int *);
 int BLASFUNC(qtrtri)(char *, char *, int *, double *, int *, int *);
-int BLASFUNC(ctrtri)(char *, char *, int *, float  *, int *, int *);
+int BLASFUNC(ctrtri)(char *, char *, int *, float *, int *, int *);
 int BLASFUNC(ztrtri)(char *, char *, int *, double *, int *, int *);
 int BLASFUNC(xtrtri)(char *, char *, int *, double *, int *, int *);
 
-int BLASFUNC(spotri)(char *, int *, float  *, int *, int *);
+int BLASFUNC(spotri)(char *, int *, float *, int *, int *);
 int BLASFUNC(dpotri)(char *, int *, double *, int *, int *);
 int BLASFUNC(qpotri)(char *, int *, double *, int *, int *);
-int BLASFUNC(cpotri)(char *, int *, float  *, int *, int *);
+int BLASFUNC(cpotri)(char *, int *, float *, int *, int *);
 int BLASFUNC(zpotri)(char *, int *, double *, int *, int *);
 int BLASFUNC(xpotri)(char *, int *, double *, int *, int *);
 
diff --git a/lapack/lapack_common.h b/lapack/lapack_common.h
index 5ca6dd7..37d1f14 100644
--- a/lapack/lapack_common.h
+++ b/lapack/lapack_common.h
@@ -13,11 +13,14 @@
 #include "../blas/common.h"
 #include "lapack.h"
 
-#define EIGEN_LAPACK_FUNC(FUNC,ARGLIST)               \
-  extern "C" { int EIGEN_BLAS_FUNC(FUNC) ARGLIST; }   \
-  int EIGEN_BLAS_FUNC(FUNC) ARGLIST
+#define EIGEN_LAPACK_FUNC(FUNC, ARGLIST) \
+  extern "C" {                           \
+  int EIGEN_BLAS_FUNC(FUNC) ARGLIST;     \
+  }                                      \
+  int EIGEN_BLAS_FUNC(FUNC)              \
+  ARGLIST
 
-typedef Eigen::Map<Eigen::Transpositions<Eigen::Dynamic,Eigen::Dynamic,int> > PivotsType;
+typedef Eigen::Map<Eigen::Transpositions<Eigen::Dynamic, Eigen::Dynamic, int> > PivotsType;
 
 #if ISCOMPLEX
 #define EIGEN_LAPACK_ARG_IF_COMPLEX(X) X,
@@ -25,5 +28,4 @@
 #define EIGEN_LAPACK_ARG_IF_COMPLEX(X)
 #endif
 
-
-#endif // EIGEN_LAPACK_COMMON_H
+#endif  // EIGEN_LAPACK_COMMON_H
diff --git a/lapack/single.cpp b/lapack/single.cpp
index 2994436..10c0a2b 100644
--- a/lapack/single.cpp
+++ b/lapack/single.cpp
@@ -7,10 +7,10 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-#define SCALAR        float
+#define SCALAR float
 #define SCALAR_SUFFIX s
 #define SCALAR_SUFFIX_UP "S"
-#define ISCOMPLEX     0
+#define ISCOMPLEX 0
 
 #include "cholesky.inc"
 #include "lu.inc"
diff --git a/scripts/eigen_gen_credits.cpp b/scripts/eigen_gen_credits.cpp
index f2e8163..bf8e4df 100644
--- a/scripts/eigen_gen_credits.cpp
+++ b/scripts/eigen_gen_credits.cpp
@@ -10,19 +10,16 @@
 
 // this function takes a line that may contain a name and/or email address,
 // and returns just the name, while fixing the "bad cases".
-std::string contributor_name(const std::string& line)
-{
+std::string contributor_name(const std::string& line) {
   string result;
 
   // let's first take care of the case of isolated email addresses, like
   // "user@localhost.localdomain" entries
-  if(line.find("markb@localhost.localdomain") != string::npos)
-  {
+  if (line.find("markb@localhost.localdomain") != string::npos) {
     return "Mark Borgerding";
   }
 
-  if(line.find("kayhman@contact.intra.cea.fr") != string::npos)
-  {
+  if (line.find("kayhman@contact.intra.cea.fr") != string::npos) {
     return "Guillaume Saupin";
   }
 
@@ -31,26 +28,22 @@
   //   Bla bli Blurp
   // or:
   //   Bla bli Blurp <bblurp@email.com>
-  
+
   size_t position_of_email_address = line.find_first_of('<');
-  if(position_of_email_address != string::npos)
-  {
+  if (position_of_email_address != string::npos) {
     // there is an e-mail address in <...>.
-    
+
     // Hauke once committed as "John Smith", fix that.
-    if(line.find("hauke.heibel") != string::npos)
+    if (line.find("hauke.heibel") != string::npos)
       result = "Hauke Heibel";
-    else
-    {
+    else {
       // just remove the e-mail address
       result = line.substr(0, position_of_email_address);
     }
-  }
-  else
-  {
+  } else {
     // there is no e-mail address in <...>.
-    
-    if(line.find("convert-repo") != string::npos)
+
+    if (line.find("convert-repo") != string::npos)
       result = "";
     else
       result = line;
@@ -58,44 +51,41 @@
 
   // remove trailing spaces
   size_t length = result.length();
-  while(length >= 1 && result[length-1] == ' ') result.erase(--length);
+  while (length >= 1 && result[length - 1] == ' ') result.erase(--length);
 
   return result;
 }
 
 // parses hg churn output to generate a contributors map.
-map<string,int> contributors_map_from_churn_output(const char *filename)
-{
-  map<string,int> contributors_map;
+map<string, int> contributors_map_from_churn_output(const char* filename) {
+  map<string, int> contributors_map;
 
   string line;
   ifstream churn_out;
   churn_out.open(filename, ios::in);
-  while(!getline(churn_out,line).eof())
-  {
+  while (!getline(churn_out, line).eof()) {
     // remove the histograms "******" that hg churn may draw at the end of some lines
     size_t first_star = line.find_first_of('*');
-    if(first_star != string::npos) line.erase(first_star);
-    
+    if (first_star != string::npos) line.erase(first_star);
+
     // remove trailing spaces
     size_t length = line.length();
-    while(length >= 1 && line[length-1] == ' ') line.erase(--length);
+    while (length >= 1 && line[length - 1] == ' ') line.erase(--length);
 
     // now the last space indicates where the number starts
     size_t last_space = line.find_last_of(' ');
-    
+
     // get the number (of changesets or of modified lines for each contributor)
     int number;
-    istringstream(line.substr(last_space+1)) >> number;
+    istringstream(line.substr(last_space + 1)) >> number;
 
     // get the name of the contributor
-    line.erase(last_space);    
+    line.erase(last_space);
     string name = contributor_name(line);
-    
-    map<string,int>::iterator it = contributors_map.find(name);
+
+    map<string, int>::iterator it = contributors_map.find(name);
     // if new contributor, insert
-    if(it == contributors_map.end())
-      contributors_map.insert(pair<string,int>(name, number));
+    if (it == contributors_map.end()) contributors_map.insert(pair<string, int>(name, number));
     // if duplicate, just add the number
     else
       it->second += number;
@@ -107,75 +97,64 @@
 
 // find the last name, i.e. the last word.
 // for "van den Schbling" types of last names, that's not a problem, that's actually what we want.
-string lastname(const string& name)
-{
+string lastname(const string& name) {
   size_t last_space = name.find_last_of(' ');
-  if(last_space >= name.length()-1) return name;
-  else return name.substr(last_space+1);
+  if (last_space >= name.length() - 1)
+    return name;
+  else
+    return name.substr(last_space + 1);
 }
 
-struct contributor
-{
+struct contributor {
   string name;
   int changedlines;
   int changesets;
   string url;
   string misc;
-  
+
   contributor() : changedlines(0), changesets(0) {}
-  
-  bool operator < (const contributor& other)
-  {
-    return lastname(name).compare(lastname(other.name)) < 0;
-  }
+
+  bool operator<(const contributor& other) { return lastname(name).compare(lastname(other.name)) < 0; }
 };
 
-void add_online_info_into_contributors_list(list<contributor>& contributors_list, const char *filename)
-{
+void add_online_info_into_contributors_list(list<contributor>& contributors_list, const char* filename) {
   string line;
   ifstream online_info;
   online_info.open(filename, ios::in);
-  while(!getline(online_info,line).eof())
-  {
+  while (!getline(online_info, line).eof()) {
     string hgname, realname, url, misc;
-    
+
     size_t last_bar = line.find_last_of('|');
-    if(last_bar == string::npos) continue;
-    if(last_bar < line.length())
-      misc = line.substr(last_bar+1);
-    line.erase(last_bar);
-    
-    last_bar = line.find_last_of('|');
-    if(last_bar == string::npos) continue;
-    if(last_bar < line.length())
-      url = line.substr(last_bar+1);
+    if (last_bar == string::npos) continue;
+    if (last_bar < line.length()) misc = line.substr(last_bar + 1);
     line.erase(last_bar);
 
     last_bar = line.find_last_of('|');
-    if(last_bar == string::npos) continue;
-    if(last_bar < line.length())
-      realname = line.substr(last_bar+1);
+    if (last_bar == string::npos) continue;
+    if (last_bar < line.length()) url = line.substr(last_bar + 1);
+    line.erase(last_bar);
+
+    last_bar = line.find_last_of('|');
+    if (last_bar == string::npos) continue;
+    if (last_bar < line.length()) realname = line.substr(last_bar + 1);
     line.erase(last_bar);
 
     hgname = line;
-    
+
     // remove the example line
-    if(hgname.find("MercurialName") != string::npos) continue;
-    
+    if (hgname.find("MercurialName") != string::npos) continue;
+
     list<contributor>::iterator it;
-    for(it=contributors_list.begin(); it != contributors_list.end() && it->name != hgname; ++it)
-    {}
-    
-    if(it == contributors_list.end())
-    {
+    for (it = contributors_list.begin(); it != contributors_list.end() && it->name != hgname; ++it) {
+    }
+
+    if (it == contributors_list.end()) {
       contributor c;
       c.name = realname;
       c.url = url;
       c.misc = misc;
       contributors_list.push_back(c);
-    }
-    else
-    {
+    } else {
       it->name = realname;
       it->url = url;
       it->misc = misc;
@@ -183,28 +162,26 @@
   }
 }
 
-int main()
-{
+int main() {
   // parse the hg churn output files
-  map<string,int> contributors_map_for_changedlines = contributors_map_from_churn_output("churn-changedlines.out");
-  //map<string,int> contributors_map_for_changesets = contributors_map_from_churn_output("churn-changesets.out");
-  
+  map<string, int> contributors_map_for_changedlines = contributors_map_from_churn_output("churn-changedlines.out");
+  // map<string,int> contributors_map_for_changesets = contributors_map_from_churn_output("churn-changesets.out");
+
   // merge into the contributors list
   list<contributor> contributors_list;
-  map<string,int>::iterator it;
-  for(it=contributors_map_for_changedlines.begin(); it != contributors_map_for_changedlines.end(); ++it)
-  {
+  map<string, int>::iterator it;
+  for (it = contributors_map_for_changedlines.begin(); it != contributors_map_for_changedlines.end(); ++it) {
     contributor c;
     c.name = it->first;
     c.changedlines = it->second;
-    c.changesets = 0; //contributors_map_for_changesets.find(it->first)->second;
+    c.changesets = 0;  // contributors_map_for_changesets.find(it->first)->second;
     contributors_list.push_back(c);
   }
-  
+
   add_online_info_into_contributors_list(contributors_list, "online-info.out");
-  
+
   contributors_list.sort();
-  
+
   cout << "{| cellpadding=\"5\"\n";
   cout << "!\n";
   cout << "! Lines changed\n";
@@ -212,16 +189,17 @@
 
   list<contributor>::iterator itc;
   int i = 0;
-  for(itc=contributors_list.begin(); itc != contributors_list.end(); ++itc)
-  {
-    if(itc->name.length() == 0) continue;
-    if(i%2) cout << "|-\n";
-    else cout << "|- style=\"background:#FFFFD0\"\n";
-    if(itc->url.length())
+  for (itc = contributors_list.begin(); itc != contributors_list.end(); ++itc) {
+    if (itc->name.length() == 0) continue;
+    if (i % 2)
+      cout << "|-\n";
+    else
+      cout << "|- style=\"background:#FFFFD0\"\n";
+    if (itc->url.length())
       cout << "| [" << itc->url << " " << itc->name << "]\n";
     else
       cout << "| " << itc->name << "\n";
-    if(itc->changedlines)
+    if (itc->changedlines)
       cout << "| " << itc->changedlines << "\n";
     else
       cout << "| (no information)\n";
diff --git a/test/AnnoyingScalar.h b/test/AnnoyingScalar.h
index 94b513c..b4f77ad 100644
--- a/test/AnnoyingScalar.h
+++ b/test/AnnoyingScalar.h
@@ -17,8 +17,7 @@
 #endif
 
 #ifndef EIGEN_TEST_ANNOYING_SCALAR_DONT_THROW
-struct my_exception
-{
+struct my_exception {
   my_exception() {}
   ~my_exception() {}
 };
@@ -26,88 +25,120 @@
 
 // An AnnoyingScalar is a pseudo scalar type that:
 // - can randomly through an exception in operator +
-// - randomly allocate on the heap or initialize a reference to itself making it non trivially copyable, nor movable, nor relocatable.
+// - randomly allocate on the heap or initialize a reference to itself making it non trivially copyable, nor movable,
+// nor relocatable.
 
-class AnnoyingScalar
-{
-  public:
-    AnnoyingScalar()                { init(); *v = 0;  }
-    AnnoyingScalar(long double _v)  { init(); *v = static_cast<float>(_v); }
-    AnnoyingScalar(double _v)       { init(); *v = static_cast<float>(_v); }
-    AnnoyingScalar(float _v)        { init(); *v = _v; }
-    AnnoyingScalar(int _v)          { init(); *v = static_cast<float>(_v); }
-    AnnoyingScalar(long _v)         { init(); *v = static_cast<float>(_v); }
-    AnnoyingScalar(long long _v)    { init(); *v = static_cast<float>(_v); }
-    AnnoyingScalar(const AnnoyingScalar& other) { init(); *v = *(other.v); }
-    ~AnnoyingScalar() {
-      if(v!=&data)
-        delete v;
-      instances--;
-    }
+class AnnoyingScalar {
+ public:
+  AnnoyingScalar() {
+    init();
+    *v = 0;
+  }
+  AnnoyingScalar(long double _v) {
+    init();
+    *v = static_cast<float>(_v);
+  }
+  AnnoyingScalar(double _v) {
+    init();
+    *v = static_cast<float>(_v);
+  }
+  AnnoyingScalar(float _v) {
+    init();
+    *v = _v;
+  }
+  AnnoyingScalar(int _v) {
+    init();
+    *v = static_cast<float>(_v);
+  }
+  AnnoyingScalar(long _v) {
+    init();
+    *v = static_cast<float>(_v);
+  }
+  AnnoyingScalar(long long _v) {
+    init();
+    *v = static_cast<float>(_v);
+  }
+  AnnoyingScalar(const AnnoyingScalar& other) {
+    init();
+    *v = *(other.v);
+  }
+  ~AnnoyingScalar() {
+    if (v != &data) delete v;
+    instances--;
+  }
 
-    void init() {
-      if(internal::random<bool>())
-        v = new float;
-      else
-        v = &data;
-      instances++;
-    }
+  void init() {
+    if (internal::random<bool>())
+      v = new float;
+    else
+      v = &data;
+    instances++;
+  }
 
-    AnnoyingScalar operator+(const AnnoyingScalar& other) const
-    {
-      #ifndef EIGEN_TEST_ANNOYING_SCALAR_DONT_THROW
-      countdown--;
-      if(countdown<=0 && !dont_throw)
-        throw my_exception();
-      #endif
-      return AnnoyingScalar(*v+*other.v);
-    }
-
-    AnnoyingScalar operator-() const
-    { return AnnoyingScalar(-*v); }
-
-    AnnoyingScalar operator-(const AnnoyingScalar& other) const
-    { return AnnoyingScalar(*v-*other.v); }
-    
-    AnnoyingScalar operator*(const AnnoyingScalar& other) const
-    { return AnnoyingScalar((*v)*(*other.v)); }
-
-    AnnoyingScalar operator/(const AnnoyingScalar& other) const
-    { return AnnoyingScalar((*v)/(*other.v)); }
-
-    AnnoyingScalar& operator+=(const AnnoyingScalar& other) { *v += *other.v; return *this; }
-    AnnoyingScalar& operator-=(const AnnoyingScalar& other) { *v -= *other.v; return *this; }
-    AnnoyingScalar& operator*=(const AnnoyingScalar& other) { *v *= *other.v; return *this; }
-    AnnoyingScalar& operator/=(const AnnoyingScalar& other) { *v /= *other.v; return *this; }
-    AnnoyingScalar& operator= (const AnnoyingScalar& other) { *v  = *other.v; return *this; }
-
-    bool operator==(const AnnoyingScalar& other) const { return numext::equal_strict(*v, *other.v); }
-    bool operator!=(const AnnoyingScalar& other) const { return numext::not_equal_strict(*v, *other.v); }
-    bool operator<=(const AnnoyingScalar& other) const { return *v <= *other.v; }
-    bool operator< (const AnnoyingScalar& other) const { return *v <  *other.v; }
-    bool operator>=(const AnnoyingScalar& other) const { return *v >= *other.v; }
-    bool operator> (const AnnoyingScalar& other) const { return *v >  *other.v; }
-  
-    float* v;
-    float data;
-    static int instances;
+  AnnoyingScalar operator+(const AnnoyingScalar& other) const {
 #ifndef EIGEN_TEST_ANNOYING_SCALAR_DONT_THROW
-    static int countdown;
-    static bool dont_throw;
+    countdown--;
+    if (countdown <= 0 && !dont_throw) throw my_exception();
+#endif
+    return AnnoyingScalar(*v + *other.v);
+  }
+
+  AnnoyingScalar operator-() const { return AnnoyingScalar(-*v); }
+
+  AnnoyingScalar operator-(const AnnoyingScalar& other) const { return AnnoyingScalar(*v - *other.v); }
+
+  AnnoyingScalar operator*(const AnnoyingScalar& other) const { return AnnoyingScalar((*v) * (*other.v)); }
+
+  AnnoyingScalar operator/(const AnnoyingScalar& other) const { return AnnoyingScalar((*v) / (*other.v)); }
+
+  AnnoyingScalar& operator+=(const AnnoyingScalar& other) {
+    *v += *other.v;
+    return *this;
+  }
+  AnnoyingScalar& operator-=(const AnnoyingScalar& other) {
+    *v -= *other.v;
+    return *this;
+  }
+  AnnoyingScalar& operator*=(const AnnoyingScalar& other) {
+    *v *= *other.v;
+    return *this;
+  }
+  AnnoyingScalar& operator/=(const AnnoyingScalar& other) {
+    *v /= *other.v;
+    return *this;
+  }
+  AnnoyingScalar& operator=(const AnnoyingScalar& other) {
+    *v = *other.v;
+    return *this;
+  }
+
+  bool operator==(const AnnoyingScalar& other) const { return numext::equal_strict(*v, *other.v); }
+  bool operator!=(const AnnoyingScalar& other) const { return numext::not_equal_strict(*v, *other.v); }
+  bool operator<=(const AnnoyingScalar& other) const { return *v <= *other.v; }
+  bool operator<(const AnnoyingScalar& other) const { return *v < *other.v; }
+  bool operator>=(const AnnoyingScalar& other) const { return *v >= *other.v; }
+  bool operator>(const AnnoyingScalar& other) const { return *v > *other.v; }
+
+  float* v;
+  float data;
+  static int instances;
+#ifndef EIGEN_TEST_ANNOYING_SCALAR_DONT_THROW
+  static int countdown;
+  static bool dont_throw;
 #endif
 };
 
-AnnoyingScalar real(const AnnoyingScalar &x) { return x; }
-AnnoyingScalar imag(const AnnoyingScalar & ) { return 0; }
-AnnoyingScalar conj(const AnnoyingScalar &x) { return x; }
-AnnoyingScalar sqrt(const AnnoyingScalar &x) { return std::sqrt(*x.v); }
-AnnoyingScalar abs (const AnnoyingScalar &x) { return std::abs(*x.v); }
-AnnoyingScalar cos (const AnnoyingScalar &x) { return std::cos(*x.v); }
-AnnoyingScalar sin (const AnnoyingScalar &x) { return std::sin(*x.v); }
-AnnoyingScalar acos(const AnnoyingScalar &x) { return std::acos(*x.v); }
-AnnoyingScalar atan2(const AnnoyingScalar &y,const AnnoyingScalar &x) { return std::atan2(*y.v,*x.v); }
+AnnoyingScalar real(const AnnoyingScalar& x) { return x; }
+AnnoyingScalar imag(const AnnoyingScalar&) { return 0; }
+AnnoyingScalar conj(const AnnoyingScalar& x) { return x; }
+AnnoyingScalar sqrt(const AnnoyingScalar& x) { return std::sqrt(*x.v); }
+AnnoyingScalar abs(const AnnoyingScalar& x) { return std::abs(*x.v); }
+AnnoyingScalar cos(const AnnoyingScalar& x) { return std::cos(*x.v); }
+AnnoyingScalar sin(const AnnoyingScalar& x) { return std::sin(*x.v); }
+AnnoyingScalar acos(const AnnoyingScalar& x) { return std::acos(*x.v); }
+AnnoyingScalar atan2(const AnnoyingScalar& y, const AnnoyingScalar& x) { return std::atan2(*y.v, *x.v); }
 
-std::ostream& operator<<(std::ostream& stream,const AnnoyingScalar& x) {
+std::ostream& operator<<(std::ostream& stream, const AnnoyingScalar& x) {
   stream << (*(x.v));
   return stream;
 }
@@ -120,9 +151,8 @@
 #endif
 
 namespace Eigen {
-template<>
-struct NumTraits<AnnoyingScalar> : NumTraits<float>
-{
+template <>
+struct NumTraits<AnnoyingScalar> : NumTraits<float> {
   enum {
     RequireInitialization = 1,
   };
@@ -132,32 +162,42 @@
   typedef AnnoyingScalar NonInteger;
 };
 
-template<> inline AnnoyingScalar test_precision<AnnoyingScalar>() { return test_precision<float>(); }
+template <>
+inline AnnoyingScalar test_precision<AnnoyingScalar>() {
+  return test_precision<float>();
+}
 
 namespace numext {
-template<>
-EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
-bool (isfinite)(const AnnoyingScalar& x) {
+template <>
+EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool(isfinite)(const AnnoyingScalar& x) {
   return (numext::isfinite)(*x.v);
 }
-}
+}  // namespace numext
 
 namespace internal {
-  template<> EIGEN_STRONG_INLINE double cast(const AnnoyingScalar& x) { return double(*x.v); }
-  template<> EIGEN_STRONG_INLINE float  cast(const AnnoyingScalar& x) { return *x.v; }
+template <>
+EIGEN_STRONG_INLINE double cast(const AnnoyingScalar& x) {
+  return double(*x.v);
 }
+template <>
+EIGEN_STRONG_INLINE float cast(const AnnoyingScalar& x) {
+  return *x.v;
+}
+}  // namespace internal
 }  // namespace Eigen
 
-AnnoyingScalar get_test_precision(const AnnoyingScalar&)
-{ return Eigen::test_precision<AnnoyingScalar>(); }
+AnnoyingScalar get_test_precision(const AnnoyingScalar&) { return Eigen::test_precision<AnnoyingScalar>(); }
 
-AnnoyingScalar test_relative_error(const AnnoyingScalar &a, const AnnoyingScalar &b)
-{ return test_relative_error(*a.v, *b.v); }
+AnnoyingScalar test_relative_error(const AnnoyingScalar& a, const AnnoyingScalar& b) {
+  return test_relative_error(*a.v, *b.v);
+}
 
-inline bool test_isApprox(const AnnoyingScalar &a, const AnnoyingScalar &b)
-{ return internal::isApprox(*a.v, *b.v, test_precision<float>()); }
+inline bool test_isApprox(const AnnoyingScalar& a, const AnnoyingScalar& b) {
+  return internal::isApprox(*a.v, *b.v, test_precision<float>());
+}
 
-inline bool test_isMuchSmallerThan(const AnnoyingScalar &a, const AnnoyingScalar &b)
-{ return test_isMuchSmallerThan(*a.v, *b.v); }
+inline bool test_isMuchSmallerThan(const AnnoyingScalar& a, const AnnoyingScalar& b) {
+  return test_isMuchSmallerThan(*a.v, *b.v);
+}
 
-#endif // EIGEN_TEST_ANNOYING_SCALAR_H
+#endif  // EIGEN_TEST_ANNOYING_SCALAR_H
diff --git a/test/MovableScalar.h b/test/MovableScalar.h
index 6a90d03..52591bc 100644
--- a/test/MovableScalar.h
+++ b/test/MovableScalar.h
@@ -12,11 +12,9 @@
 
 #include <vector>
 
-namespace Eigen
-{
+namespace Eigen {
 template <typename Scalar, typename Base = std::vector<Scalar>>
-struct MovableScalar : public Base
-{
+struct MovableScalar : public Base {
   MovableScalar() = default;
   ~MovableScalar() = default;
   MovableScalar(const MovableScalar&) = default;
@@ -28,8 +26,8 @@
   operator Scalar() const { return this->size() > 0 ? this->back() : Scalar(); }
 };
 
-template<> struct NumTraits<MovableScalar<float>> : GenericNumTraits<float> {};
-}
+template <>
+struct NumTraits<MovableScalar<float>> : GenericNumTraits<float> {};
+}  // namespace Eigen
 
 #endif
-
diff --git a/test/OffByOneScalar.h b/test/OffByOneScalar.h
index db59ab6..8184571 100644
--- a/test/OffByOneScalar.h
+++ b/test/OffByOneScalar.h
@@ -1,24 +1,20 @@
 
 // A Scalar with internal representation T+1 so that zero is internally
 // represented by T(1). This is used to test memory fill.
-// 
+//
 #pragma once
-template<typename T>
+template <typename T>
 class OffByOneScalar {
  public:
   OffByOneScalar() : val_(1) {}
   OffByOneScalar(const OffByOneScalar& other) = default;
   OffByOneScalar& operator=(const OffByOneScalar& other) = default;
-  
+
   OffByOneScalar(T val) : val_(val + 1) {}
-  OffByOneScalar& operator=(T val) {
-    val_ = val + 1;
-  }
-  
-  operator T() const {
-    return val_ - 1;
-  }
- 
+  OffByOneScalar& operator=(T val) { val_ = val + 1; }
+
+  operator T() const { return val_ - 1; }
+
  private:
   T val_;
 };
diff --git a/test/SafeScalar.h b/test/SafeScalar.h
index c5cb757..2079af4 100644
--- a/test/SafeScalar.h
+++ b/test/SafeScalar.h
@@ -1,29 +1,27 @@
 
 // A Scalar that asserts for uninitialized access.
-template<typename T>
+template <typename T>
 class SafeScalar {
  public:
   SafeScalar() : initialized_(false) {}
-  SafeScalar(const SafeScalar& other) {
-    *this = other;
-  }
+  SafeScalar(const SafeScalar& other) { *this = other; }
   SafeScalar& operator=(const SafeScalar& other) {
     val_ = T(other);
     initialized_ = true;
     return *this;
   }
-  
+
   SafeScalar(T val) : val_(val), initialized_(true) {}
   SafeScalar& operator=(T val) {
     val_ = val;
     initialized_ = true;
   }
-  
+
   operator T() const {
     VERIFY(initialized_ && "Uninitialized access.");
     return val_;
   }
- 
+
  private:
   T val_;
   bool initialized_;
diff --git a/test/accelerate_support.cpp b/test/accelerate_support.cpp
index ac4be61..4620d41 100644
--- a/test/accelerate_support.cpp
+++ b/test/accelerate_support.cpp
@@ -7,45 +7,43 @@
 
 #include <Eigen/AccelerateSupport>
 
-template<typename MatrixType,typename DenseMat>
-int generate_sparse_rectangular_problem(MatrixType& A, DenseMat& dA, int maxRows = 300, int maxCols = 300)
-{
+template <typename MatrixType, typename DenseMat>
+int generate_sparse_rectangular_problem(MatrixType& A, DenseMat& dA, int maxRows = 300, int maxCols = 300) {
   typedef typename MatrixType::Scalar Scalar;
   int rows = internal::random<int>(1, maxRows);
   int cols = internal::random<int>(1, maxCols);
   double density = (std::max)(8.0 / (rows * cols), 0.01);
-  
-  A.resize(rows,cols);
-  dA.resize(rows,cols);
+
+  A.resize(rows, cols);
+  dA.resize(rows, cols);
   initSparse<Scalar>(density, dA, A, ForceNonZeroDiag);
   A.makeCompressed();
   return rows;
 }
 
-template<typename MatrixType,typename DenseMat>
-int generate_sparse_square_symmetric_problem(MatrixType& A, DenseMat& dA, int maxSize = 300)
-{
+template <typename MatrixType, typename DenseMat>
+int generate_sparse_square_symmetric_problem(MatrixType& A, DenseMat& dA, int maxSize = 300) {
   typedef typename MatrixType::Scalar Scalar;
   int rows = internal::random<int>(1, maxSize);
   int cols = rows;
   double density = (std::max)(8.0 / (rows * cols), 0.01);
-  
-  A.resize(rows,cols);
-  dA.resize(rows,cols);
+
+  A.resize(rows, cols);
+  dA.resize(rows, cols);
   initSparse<Scalar>(density, dA, A, ForceNonZeroDiag);
   dA = dA * dA.transpose();
-  A  = A * A.transpose();
+  A = A * A.transpose();
   A.makeCompressed();
   return rows;
 }
 
-template<typename Scalar, typename Solver> void test_accelerate_ldlt()
-{
-  typedef SparseMatrix<Scalar> MatrixType; 
-  typedef Matrix<Scalar,Dynamic,1> DenseVector;
- 
+template <typename Scalar, typename Solver>
+void test_accelerate_ldlt() {
+  typedef SparseMatrix<Scalar> MatrixType;
+  typedef Matrix<Scalar, Dynamic, 1> DenseVector;
+
   MatrixType A;
-  Matrix<Scalar,Dynamic,Dynamic> dA;
+  Matrix<Scalar, Dynamic, Dynamic> dA;
 
   generate_sparse_square_symmetric_problem(A, dA);
 
@@ -54,8 +52,7 @@
   Solver solver;
   solver.compute(A);
 
-  if (solver.info() != Success)
-  {
+  if (solver.info() != Success) {
     std::cerr << "sparse LDLT factorization failed\n";
     exit(0);
     return;
@@ -63,25 +60,24 @@
 
   DenseVector x = solver.solve(b);
 
-  if (solver.info() != Success)
-  {
+  if (solver.info() != Success) {
     std::cerr << "sparse LDLT factorization failed\n";
     exit(0);
     return;
   }
 
-  //Compare with a dense solver
+  // Compare with a dense solver
   DenseVector refX = dA.ldlt().solve(b);
   VERIFY((A * x).isApprox(A * refX, test_precision<Scalar>()));
 }
 
-template<typename Scalar, typename Solver> void test_accelerate_llt()
-{
-  typedef SparseMatrix<Scalar> MatrixType; 
-  typedef Matrix<Scalar,Dynamic,1> DenseVector;
- 
+template <typename Scalar, typename Solver>
+void test_accelerate_llt() {
+  typedef SparseMatrix<Scalar> MatrixType;
+  typedef Matrix<Scalar, Dynamic, 1> DenseVector;
+
   MatrixType A;
-  Matrix<Scalar,Dynamic,Dynamic> dA;
+  Matrix<Scalar, Dynamic, Dynamic> dA;
 
   generate_sparse_square_symmetric_problem(A, dA);
 
@@ -90,8 +86,7 @@
   Solver solver;
   solver.compute(A);
 
-  if (solver.info() != Success)
-  {
+  if (solver.info() != Success) {
     std::cerr << "sparse LLT factorization failed\n";
     exit(0);
     return;
@@ -99,25 +94,24 @@
 
   DenseVector x = solver.solve(b);
 
-  if (solver.info() != Success)
-  {
+  if (solver.info() != Success) {
     std::cerr << "sparse LLT factorization failed\n";
     exit(0);
     return;
   }
 
-  //Compare with a dense solver
+  // Compare with a dense solver
   DenseVector refX = dA.llt().solve(b);
   VERIFY((A * x).isApprox(A * refX, test_precision<Scalar>()));
 }
 
-template<typename Scalar, typename Solver> void test_accelerate_qr()
-{
-  typedef SparseMatrix<Scalar> MatrixType; 
-  typedef Matrix<Scalar,Dynamic,1> DenseVector;
- 
+template <typename Scalar, typename Solver>
+void test_accelerate_qr() {
+  typedef SparseMatrix<Scalar> MatrixType;
+  typedef Matrix<Scalar, Dynamic, 1> DenseVector;
+
   MatrixType A;
-  Matrix<Scalar,Dynamic,Dynamic> dA;
+  Matrix<Scalar, Dynamic, Dynamic> dA;
 
   generate_sparse_rectangular_problem(A, dA);
 
@@ -126,8 +120,7 @@
   Solver solver;
   solver.compute(A);
 
-  if (solver.info() != Success)
-  {
+  if (solver.info() != Success) {
     std::cerr << "sparse QR factorization failed\n";
     exit(0);
     return;
@@ -135,22 +128,20 @@
 
   DenseVector x = solver.solve(b);
 
-  if (solver.info() != Success)
-  {
+  if (solver.info() != Success) {
     std::cerr << "sparse QR factorization failed\n";
     exit(0);
     return;
   }
 
-  //Compare with a dense solver
+  // Compare with a dense solver
   DenseVector refX = dA.colPivHouseholderQr().solve(b);
   VERIFY((A * x).isApprox(A * refX, test_precision<Scalar>()));
 }
 
-template<typename Scalar> 
-void run_tests()
-{
-  typedef SparseMatrix<Scalar> MatrixType; 
+template <typename Scalar>
+void run_tests() {
+  typedef SparseMatrix<Scalar> MatrixType;
 
   test_accelerate_ldlt<Scalar, AccelerateLDLT<MatrixType, Lower> >();
   test_accelerate_ldlt<Scalar, AccelerateLDLTUnpivoted<MatrixType, Lower> >();
@@ -169,8 +160,7 @@
   test_accelerate_qr<Scalar, AccelerateQR<MatrixType> >();
 }
 
-EIGEN_DECLARE_TEST(accelerate_support)
-{
+EIGEN_DECLARE_TEST(accelerate_support) {
   CALL_SUBTEST_1(run_tests<float>());
   CALL_SUBTEST_2(run_tests<double>());
 }
diff --git a/test/adjoint.cpp b/test/adjoint.cpp
index 37d23b1..6366476 100644
--- a/test/adjoint.cpp
+++ b/test/adjoint.cpp
@@ -9,30 +9,35 @@
 
 #include "main.h"
 
-template<bool IsInteger> struct adjoint_specific;
+template <bool IsInteger>
+struct adjoint_specific;
 
-template<> struct adjoint_specific<true> {
-  template<typename Vec, typename Mat, typename Scalar>
+template <>
+struct adjoint_specific<true> {
+  template <typename Vec, typename Mat, typename Scalar>
   static void run(const Vec& v1, const Vec& v2, Vec& v3, const Mat& square, Scalar s1, Scalar s2) {
-    VERIFY(test_isApproxWithRef((s1 * v1 + s2 * v2).dot(v3),     numext::conj(s1) * v1.dot(v3) + numext::conj(s2) * v2.dot(v3), 0));
-    VERIFY(test_isApproxWithRef(v3.dot(s1 * v1 + s2 * v2),       s1*v3.dot(v1)+s2*v3.dot(v2), 0));
-    
+    VERIFY(test_isApproxWithRef((s1 * v1 + s2 * v2).dot(v3),
+                                numext::conj(s1) * v1.dot(v3) + numext::conj(s2) * v2.dot(v3), 0));
+    VERIFY(test_isApproxWithRef(v3.dot(s1 * v1 + s2 * v2), s1 * v3.dot(v1) + s2 * v3.dot(v2), 0));
+
     // check compatibility of dot and adjoint
     VERIFY(test_isApproxWithRef(v1.dot(square * v2), (square.adjoint() * v1).dot(v2), 0));
   }
 };
 
-template<> struct adjoint_specific<false> {
-  template<typename Vec, typename Mat, typename Scalar>
+template <>
+struct adjoint_specific<false> {
+  template <typename Vec, typename Mat, typename Scalar>
   static void run(const Vec& v1, const Vec& v2, Vec& v3, const Mat& square, Scalar s1, Scalar s2) {
     typedef typename NumTraits<Scalar>::Real RealScalar;
     using std::abs;
-    
-    RealScalar ref = NumTraits<Scalar>::IsInteger ? RealScalar(0) : (std::max)((s1 * v1 + s2 * v2).norm(),v3.norm());
-    VERIFY(test_isApproxWithRef((s1 * v1 + s2 * v2).dot(v3),     numext::conj(s1) * v1.dot(v3) + numext::conj(s2) * v2.dot(v3), ref));
-    VERIFY(test_isApproxWithRef(v3.dot(s1 * v1 + s2 * v2),       s1*v3.dot(v1)+s2*v3.dot(v2), ref));
-  
-    VERIFY_IS_APPROX(v1.squaredNorm(),                v1.norm() * v1.norm());
+
+    RealScalar ref = NumTraits<Scalar>::IsInteger ? RealScalar(0) : (std::max)((s1 * v1 + s2 * v2).norm(), v3.norm());
+    VERIFY(test_isApproxWithRef((s1 * v1 + s2 * v2).dot(v3),
+                                numext::conj(s1) * v1.dot(v3) + numext::conj(s2) * v2.dot(v3), ref));
+    VERIFY(test_isApproxWithRef(v3.dot(s1 * v1 + s2 * v2), s1 * v3.dot(v1) + s2 * v3.dot(v2), ref));
+
+    VERIFY_IS_APPROX(v1.squaredNorm(), v1.norm() * v1.norm());
     // check normalized() and normalize()
     VERIFY_IS_APPROX(v1, v1.norm() * v1.normalized());
     v3 = v1;
@@ -42,39 +47,42 @@
     VERIFY_IS_APPROX(v3.norm(), RealScalar(1));
 
     // check null inputs
-    VERIFY_IS_APPROX((v1*0).normalized(), (v1*0));
+    VERIFY_IS_APPROX((v1 * 0).normalized(), (v1 * 0));
 #if (!EIGEN_ARCH_i386) || defined(EIGEN_VECTORIZE)
     RealScalar very_small = (std::numeric_limits<RealScalar>::min)();
-    VERIFY( numext::is_exactly_zero((v1*very_small).norm()) );
-    VERIFY_IS_APPROX((v1*very_small).normalized(), (v1*very_small));
-    v3 = v1*very_small;
+    VERIFY(numext::is_exactly_zero((v1 * very_small).norm()));
+    VERIFY_IS_APPROX((v1 * very_small).normalized(), (v1 * very_small));
+    v3 = v1 * very_small;
     v3.normalize();
-    VERIFY_IS_APPROX(v3, (v1*very_small));
+    VERIFY_IS_APPROX(v3, (v1 * very_small));
 #endif
-    
+
     // check compatibility of dot and adjoint
-    ref = NumTraits<Scalar>::IsInteger ? 0 : (std::max)((std::max)(v1.norm(),v2.norm()),(std::max)((square * v2).norm(),(square.adjoint() * v1).norm()));
-    VERIFY(internal::isMuchSmallerThan(abs(v1.dot(square * v2) - (square.adjoint() * v1).dot(v2)), ref, test_precision<Scalar>()));
-    
+    ref = NumTraits<Scalar>::IsInteger ? 0
+                                       : (std::max)((std::max)(v1.norm(), v2.norm()),
+                                                    (std::max)((square * v2).norm(), (square.adjoint() * v1).norm()));
+    VERIFY(internal::isMuchSmallerThan(abs(v1.dot(square * v2) - (square.adjoint() * v1).dot(v2)), ref,
+                                       test_precision<Scalar>()));
+
     // check that Random().normalized() works: tricky as the random xpr must be evaluated by
     // normalized() in order to produce a consistent result.
     VERIFY_IS_APPROX(Vec::Random(v1.size()).normalized().norm(), RealScalar(1));
   }
 };
 
-template<typename MatrixType, typename Scalar = typename MatrixType::Scalar>
+template <typename MatrixType, typename Scalar = typename MatrixType::Scalar>
 MatrixType RandomMatrix(Index rows, Index cols, Scalar min, Scalar max) {
   MatrixType M = MatrixType(rows, cols);
-  for (Index i=0; i<rows; ++i) {
-    for (Index j=0; j<cols; ++j) {
+  for (Index i = 0; i < rows; ++i) {
+    for (Index j = 0; j < cols; ++j) {
       M(i, j) = Eigen::internal::random<Scalar>(min, max);
     }
   }
   return M;
 }
 
-template<typename MatrixType> void adjoint(const MatrixType& m)
-{
+template <typename MatrixType>
+void adjoint(const MatrixType& m) {
   /* this test covers the following files:
      Transpose.h Conjugate.h Dot.h
   */
@@ -84,7 +92,7 @@
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> SquareMatrixType;
   const Index PacketSize = internal::packet_traits<Scalar>::size;
-  
+
   Index rows = m.rows();
   Index cols = m.cols();
 
@@ -93,79 +101,73 @@
   RealScalar rmax = static_cast<RealScalar>(NumTraits<Scalar>::IsInteger ? 100 : 1);
 
   MatrixType m1 = RandomMatrix<MatrixType>(rows, cols, rmin, rmax),
-             m2 = RandomMatrix<MatrixType>(rows, cols, rmin, rmax),
-             m3(rows, cols),
+             m2 = RandomMatrix<MatrixType>(rows, cols, rmin, rmax), m3(rows, cols),
              square = RandomMatrix<SquareMatrixType>(rows, rows, rmin, rmax);
-  VectorType v1 = RandomMatrix<VectorType>(rows, 1, rmin, rmax),
-             v2 = RandomMatrix<VectorType>(rows, 1, rmin, rmax),
-             v3 = RandomMatrix<VectorType>(rows, 1, rmin, rmax),
-             vzero = VectorType::Zero(rows);
+  VectorType v1 = RandomMatrix<VectorType>(rows, 1, rmin, rmax), v2 = RandomMatrix<VectorType>(rows, 1, rmin, rmax),
+             v3 = RandomMatrix<VectorType>(rows, 1, rmin, rmax), vzero = VectorType::Zero(rows);
 
-  Scalar s1 = internal::random<Scalar>(rmin, rmax),
-         s2 = internal::random<Scalar>(rmin, rmax);
+  Scalar s1 = internal::random<Scalar>(rmin, rmax), s2 = internal::random<Scalar>(rmin, rmax);
 
   // check basic compatibility of adjoint, transpose, conjugate
-  VERIFY_IS_APPROX(m1.transpose().conjugate().adjoint(),    m1);
-  VERIFY_IS_APPROX(m1.adjoint().conjugate().transpose(),    m1);
+  VERIFY_IS_APPROX(m1.transpose().conjugate().adjoint(), m1);
+  VERIFY_IS_APPROX(m1.adjoint().conjugate().transpose(), m1);
 
   // check multiplicative behavior
-  VERIFY_IS_APPROX((m1.adjoint() * m2).adjoint(),           m2.adjoint() * m1);
-  VERIFY_IS_APPROX((s1 * m1).adjoint(),                     numext::conj(s1) * m1.adjoint());
+  VERIFY_IS_APPROX((m1.adjoint() * m2).adjoint(), m2.adjoint() * m1);
+  VERIFY_IS_APPROX((s1 * m1).adjoint(), numext::conj(s1) * m1.adjoint());
 
   // check basic properties of dot, squaredNorm
-  VERIFY_IS_APPROX(numext::conj(v1.dot(v2)),               v2.dot(v1));
-  VERIFY_IS_APPROX(numext::real(v1.dot(v1)),               v1.squaredNorm());
-  
+  VERIFY_IS_APPROX(numext::conj(v1.dot(v2)), v2.dot(v1));
+  VERIFY_IS_APPROX(numext::real(v1.dot(v1)), v1.squaredNorm());
+
   adjoint_specific<NumTraits<Scalar>::IsInteger>::run(v1, v2, v3, square, s1, s2);
-  
-  VERIFY_IS_MUCH_SMALLER_THAN(abs(vzero.dot(v1)),  static_cast<RealScalar>(1));
-  
+
+  VERIFY_IS_MUCH_SMALLER_THAN(abs(vzero.dot(v1)), static_cast<RealScalar>(1));
+
   // like in testBasicStuff, test operator() to check const-qualification
-  Index r = internal::random<Index>(0, rows-1),
-      c = internal::random<Index>(0, cols-1);
-  VERIFY_IS_APPROX(m1.conjugate()(r,c), numext::conj(m1(r,c)));
-  VERIFY_IS_APPROX(m1.adjoint()(c,r), numext::conj(m1(r,c)));
+  Index r = internal::random<Index>(0, rows - 1), c = internal::random<Index>(0, cols - 1);
+  VERIFY_IS_APPROX(m1.conjugate()(r, c), numext::conj(m1(r, c)));
+  VERIFY_IS_APPROX(m1.adjoint()(c, r), numext::conj(m1(r, c)));
 
   // check inplace transpose
   m3 = m1;
   m3.transposeInPlace();
-  VERIFY_IS_APPROX(m3,m1.transpose());
+  VERIFY_IS_APPROX(m3, m1.transpose());
   m3.transposeInPlace();
-  VERIFY_IS_APPROX(m3,m1);
-  
-  if(PacketSize<m3.rows() && PacketSize<m3.cols())
-  {
+  VERIFY_IS_APPROX(m3, m1);
+
+  if (PacketSize < m3.rows() && PacketSize < m3.cols()) {
     m3 = m1;
-    Index i = internal::random<Index>(0,m3.rows()-PacketSize);
-    Index j = internal::random<Index>(0,m3.cols()-PacketSize);
-    m3.template block<PacketSize,PacketSize>(i,j).transposeInPlace();
-    VERIFY_IS_APPROX( (m3.template block<PacketSize,PacketSize>(i,j)), (m1.template block<PacketSize,PacketSize>(i,j).transpose()) );
-    m3.template block<PacketSize,PacketSize>(i,j).transposeInPlace();
-    VERIFY_IS_APPROX(m3,m1);
+    Index i = internal::random<Index>(0, m3.rows() - PacketSize);
+    Index j = internal::random<Index>(0, m3.cols() - PacketSize);
+    m3.template block<PacketSize, PacketSize>(i, j).transposeInPlace();
+    VERIFY_IS_APPROX((m3.template block<PacketSize, PacketSize>(i, j)),
+                     (m1.template block<PacketSize, PacketSize>(i, j).transpose()));
+    m3.template block<PacketSize, PacketSize>(i, j).transposeInPlace();
+    VERIFY_IS_APPROX(m3, m1);
   }
 
   // check inplace adjoint
   m3 = m1;
   m3.adjointInPlace();
-  VERIFY_IS_APPROX(m3,m1.adjoint());
+  VERIFY_IS_APPROX(m3, m1.adjoint());
   m3.transposeInPlace();
-  VERIFY_IS_APPROX(m3,m1.conjugate());
+  VERIFY_IS_APPROX(m3, m1.conjugate());
 
   // check mixed dot product
   typedef Matrix<RealScalar, MatrixType::RowsAtCompileTime, 1> RealVectorType;
   RealVectorType rv1 = RandomMatrix<RealVectorType>(rows, 1, rmin, rmax);
-  
+
   VERIFY_IS_APPROX(v1.dot(rv1.template cast<Scalar>()), v1.dot(rv1));
   VERIFY_IS_APPROX(rv1.template cast<Scalar>().dot(v1), rv1.dot(v1));
 
-  VERIFY( is_same_type(m1,m1.template conjugateIf<false>()) );
-  VERIFY( is_same_type(m1.conjugate(),m1.template conjugateIf<true>()) );
+  VERIFY(is_same_type(m1, m1.template conjugateIf<false>()));
+  VERIFY(is_same_type(m1.conjugate(), m1.template conjugateIf<true>()));
 }
 
-template<int>
-void adjoint_extra()
-{
-  MatrixXcf a(10,10), b(10,10);
+template <int>
+void adjoint_extra() {
+  MatrixXcf a(10, 10), b(10, 10);
   VERIFY_RAISES_ASSERT(a = a.transpose());
   VERIFY_RAISES_ASSERT(a = a.transpose() + b);
   VERIFY_RAISES_ASSERT(a = b + a.transpose());
@@ -183,11 +185,11 @@
   a.transpose() += a.adjoint() + b;
 
   // regression tests for check_for_aliasing
-  MatrixXd c(10,10);
-  c = 1.0 * MatrixXd::Ones(10,10) + c;
-  c = MatrixXd::Ones(10,10) * 1.0 + c;
-  c = c + MatrixXd::Ones(10,10) .cwiseProduct( MatrixXd::Zero(10,10) );
-  c = MatrixXd::Ones(10,10) * MatrixXd::Zero(10,10);
+  MatrixXd c(10, 10);
+  c = 1.0 * MatrixXd::Ones(10, 10) + c;
+  c = MatrixXd::Ones(10, 10) * 1.0 + c;
+  c = c + MatrixXd::Ones(10, 10).cwiseProduct(MatrixXd::Zero(10, 10));
+  c = MatrixXd::Ones(10, 10) * MatrixXd::Zero(10, 10);
 
   // regression for bug 1646
   for (int j = 0; j < 10; ++j) {
@@ -198,36 +200,37 @@
     c.col(j) = c.row(j);
   }
 
-  a.conservativeResize(1,1);
+  a.conservativeResize(1, 1);
   a = a.transpose();
 
-  a.conservativeResize(0,0);
+  a.conservativeResize(0, 0);
   a = a.transpose();
 }
 
-EIGEN_DECLARE_TEST(adjoint)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( adjoint(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( adjoint(Matrix3d()) );
-    CALL_SUBTEST_3( adjoint(Matrix4f()) );
-    
-    CALL_SUBTEST_4( adjoint(MatrixXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2), internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2))) );
-    CALL_SUBTEST_5( adjoint(MatrixXi(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_6( adjoint(MatrixXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    
+EIGEN_DECLARE_TEST(adjoint) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(adjoint(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(adjoint(Matrix3d()));
+    CALL_SUBTEST_3(adjoint(Matrix4f()));
+
+    CALL_SUBTEST_4(adjoint(MatrixXcf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2),
+                                     internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2))));
+    CALL_SUBTEST_5(adjoint(
+        MatrixXi(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_6(adjoint(
+        MatrixXf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+
     // Complement for 128 bits vectorization:
-    CALL_SUBTEST_8( adjoint(Matrix2d()) );
-    CALL_SUBTEST_9( adjoint(Matrix<int,4,4>()) );
-    
+    CALL_SUBTEST_8(adjoint(Matrix2d()));
+    CALL_SUBTEST_9(adjoint(Matrix<int, 4, 4>()));
+
     // 256 bits vectorization:
-    CALL_SUBTEST_10( adjoint(Matrix<float,8,8>()) );
-    CALL_SUBTEST_11( adjoint(Matrix<double,4,4>()) );
-    CALL_SUBTEST_12( adjoint(Matrix<int,8,8>()) );
+    CALL_SUBTEST_10(adjoint(Matrix<float, 8, 8>()));
+    CALL_SUBTEST_11(adjoint(Matrix<double, 4, 4>()));
+    CALL_SUBTEST_12(adjoint(Matrix<int, 8, 8>()));
   }
   // test a large static matrix only once
-  CALL_SUBTEST_7( adjoint(Matrix<float, 100, 100>()) );
+  CALL_SUBTEST_7(adjoint(Matrix<float, 100, 100>()));
 
-  CALL_SUBTEST_13( adjoint_extra<0>() );
+  CALL_SUBTEST_13(adjoint_extra<0>());
 }
-
diff --git a/test/array_cwise.cpp b/test/array_cwise.cpp
index 9b62969..0cfea8b 100644
--- a/test/array_cwise.cpp
+++ b/test/array_cwise.cpp
@@ -25,7 +25,7 @@
   return negative_or_zero_impl<Scalar>::run(a);
 }
 
-template <typename Scalar, std::enable_if_t<NumTraits<Scalar>::IsInteger,int> = 0>
+template <typename Scalar, std::enable_if_t<NumTraits<Scalar>::IsInteger, int> = 0>
 std::vector<Scalar> special_values() {
   const Scalar zero = Scalar(0);
   const Scalar one = Scalar(1);
@@ -33,7 +33,7 @@
   const Scalar three = Scalar(3);
   const Scalar min = (std::numeric_limits<Scalar>::min)();
   const Scalar max = (std::numeric_limits<Scalar>::max)();
-  return { zero, min, one, two, three, max };
+  return {zero, min, one, two, three, max};
 }
 
 template <typename Scalar, std::enable_if_t<!NumTraits<Scalar>::IsInteger, int> = 0>
@@ -44,22 +44,21 @@
   const Scalar two = Scalar(2);
   const Scalar three = Scalar(3);
   const Scalar sqrt_half = Scalar(std::sqrt(0.5));
-  const Scalar sqrt2 = Scalar(std::sqrt(2));    
+  const Scalar sqrt2 = Scalar(std::sqrt(2));
   const Scalar inf = Eigen::NumTraits<Scalar>::infinity();
   const Scalar nan = Eigen::NumTraits<Scalar>::quiet_NaN();
   const Scalar denorm_min = EIGEN_ARCH_ARM ? zero : std::numeric_limits<Scalar>::denorm_min();
   const Scalar min = (std::numeric_limits<Scalar>::min)();
   const Scalar max = (std::numeric_limits<Scalar>::max)();
   const Scalar max_exp = (static_cast<Scalar>(int(Eigen::NumTraits<Scalar>::max_exponent())) * Scalar(EIGEN_LN2)) / eps;
-  return { zero, denorm_min, min, eps, sqrt_half, one, sqrt2, two, three, max_exp, max, inf, nan };
+  return {zero, denorm_min, min, eps, sqrt_half, one, sqrt2, two, three, max_exp, max, inf, nan};
 }
 
-template<typename Scalar>
-void special_value_pairs(Array<Scalar, Dynamic, Dynamic>& x,
-                         Array<Scalar, Dynamic, Dynamic>& y) {
+template <typename Scalar>
+void special_value_pairs(Array<Scalar, Dynamic, Dynamic>& x, Array<Scalar, Dynamic, Dynamic>& y) {
   std::vector<Scalar> abs_vals = special_values<Scalar>();
   const Index abs_cases = (Index)abs_vals.size();
-  const Index num_cases = 2*abs_cases * 2*abs_cases;
+  const Index num_cases = 2 * abs_cases * 2 * abs_cases;
   // ensure both vectorized and non-vectorized paths taken
   const Index num_repeats = 2 * (Index)internal::packet_traits<Scalar>::size + 1;
   x.resize(num_repeats, num_cases);
@@ -95,30 +94,30 @@
   bool all_pass = true;
   for (Index i = 0; i < lhs.rows(); ++i) {
     for (Index j = 0; j < lhs.cols(); ++j) {
-      Scalar e = static_cast<Scalar>(ref(lhs(i,j), rhs(i,j)));
+      Scalar e = static_cast<Scalar>(ref(lhs(i, j), rhs(i, j)));
       Scalar a = actual(i, j);
-      #if EIGEN_ARCH_ARM
+#if EIGEN_ARCH_ARM
       // Work around NEON flush-to-zero mode
       // if ref returns denormalized value and Eigen returns 0, then skip the test
       int ref_fpclass = std::fpclassify(e);
       if (a == Scalar(0) && ref_fpclass == FP_SUBNORMAL) continue;
-      #endif
-      bool success = (a==e) || ((numext::isfinite)(e) && internal::isApprox(a, e, tol)) || ((numext::isnan)(a) && (numext::isnan)(e));
+#endif
+      bool success = (a == e) || ((numext::isfinite)(e) && internal::isApprox(a, e, tol)) ||
+                     ((numext::isnan)(a) && (numext::isnan)(e));
       if ((a == a) && (e == e)) success &= (bool)numext::signbit(e) == (bool)numext::signbit(a);
       all_pass &= success;
       if (!success) {
-        std::cout << name << "(" << lhs(i,j) << "," << rhs(i,j) << ") = " << a << " !=  " << e << std::endl;
+        std::cout << name << "(" << lhs(i, j) << "," << rhs(i, j) << ") = " << a << " !=  " << e << std::endl;
       }
     }
   }
   VERIFY(all_pass);
 }
 
-#define BINARY_FUNCTOR_TEST_ARGS(fun) #fun, \
-      [](const auto& x_, const auto& y_) { return (Eigen::fun)(x_, y_); },    \
+#define BINARY_FUNCTOR_TEST_ARGS(fun)                                        \
+  #fun, [](const auto& x_, const auto& y_) { return (Eigen::fun)(x_, y_); }, \
       [](const auto& x_, const auto& y_) { return (std::fun)(x_, y_); }
 
-
 template <typename Scalar>
 void binary_ops_test() {
   binary_op_test<Scalar>(BINARY_FUNCTOR_TEST_ARGS(pow));
@@ -140,7 +139,6 @@
 #endif
 }
 
-
 template <typename Scalar, typename Fn, typename RefFn>
 void unary_op_test(std::string name, Fn fun, RefFn ref) {
   const Scalar tol = test_precision<Scalar>();
@@ -163,13 +161,11 @@
   VERIFY(all_pass);
 }
 
-#define UNARY_FUNCTOR_TEST_ARGS(fun) #fun, \
-      [](const auto& x_) { return (Eigen::fun)(x_); },    \
-      [](const auto& y_) { return (std::fun)(y_); }
+#define UNARY_FUNCTOR_TEST_ARGS(fun) \
+  #fun, [](const auto& x_) { return (Eigen::fun)(x_); }, [](const auto& y_) { return (std::fun)(y_); }
 
 template <typename Scalar>
 void unary_ops_test() {
-  
   unary_op_test<Scalar>(UNARY_FUNCTOR_TEST_ARGS(sqrt));
   unary_op_test<Scalar>(UNARY_FUNCTOR_TEST_ARGS(cbrt));
   unary_op_test<Scalar>(UNARY_FUNCTOR_TEST_ARGS(exp));
@@ -186,9 +182,9 @@
   unary_op_test<Scalar>(UNARY_FUNCTOR_TEST_ARGS(asinh));
   unary_op_test<Scalar>(UNARY_FUNCTOR_TEST_ARGS(acosh));
   unary_op_test<Scalar>(UNARY_FUNCTOR_TEST_ARGS(atanh));
-  /* FIXME: Enable when the behavior of rsqrt on denormals for half and double is fixed. 
+  /* FIXME: Enable when the behavior of rsqrt on denormals for half and double is fixed.
   unary_op_test<Scalar>("rsqrt",
-                        [](const auto& x) { return Eigen::rsqrt(x); }, 
+                        [](const auto& x) { return Eigen::rsqrt(x); },
                         [](Scalar x) {
                           if (x >= 0 && x < (std::numeric_limits<Scalar>::min)()) {
                             // rsqrt return +inf for positive subnormals.
@@ -272,19 +268,19 @@
             }
 
             Base a = eigenPow(j);
-            #ifdef EIGEN_COMP_MSVC
+#ifdef EIGEN_COMP_MSVC
             // Work around MSVC return value on underflow.
             // if std::pow returns 0 and Eigen returns a denormalized value, then skip the test
             int eigen_fpclass = std::fpclassify(a);
             if (e == Base(0) && eigen_fpclass == FP_SUBNORMAL) continue;
-            #endif
+#endif
 
-            #ifdef EIGEN_VECTORIZE_NEON
+#ifdef EIGEN_VECTORIZE_NEON
             // Work around NEON flush-to-zero mode
             // if std::pow returns denormalized value and Eigen returns 0, then skip the test
             int ref_fpclass = std::fpclassify(e);
             if (a == Base(0) && ref_fpclass == FP_SUBNORMAL) continue;
-            #endif
+#endif
 
             bool both_nan = (numext::isnan)(a) && (numext::isnan)(e);
             bool exact_or_approx = (a == e) || internal::isApprox(a, e, tol);
@@ -303,25 +299,24 @@
 
 template <typename Scalar, typename ScalarExponent>
 Scalar calc_overflow_threshold(const ScalarExponent exponent) {
-    EIGEN_USING_STD(exp2);
-    EIGEN_USING_STD(log2);
-    EIGEN_STATIC_ASSERT((NumTraits<Scalar>::digits() < 2 * NumTraits<double>::digits()), BASE_TYPE_IS_TOO_BIG);
+  EIGEN_USING_STD(exp2);
+  EIGEN_USING_STD(log2);
+  EIGEN_STATIC_ASSERT((NumTraits<Scalar>::digits() < 2 * NumTraits<double>::digits()), BASE_TYPE_IS_TOO_BIG);
 
-    if (exponent < 2)
-        return NumTraits<Scalar>::highest();
-    else {
-        // base^e <= highest ==> base <= 2^(log2(highest)/e)
-        // For floating-point types, consider the bound for integer values that can be reproduced exactly = 2 ^ digits
-        double highest_bits = numext::mini(static_cast<double>(NumTraits<Scalar>::digits()),
-                                           static_cast<double>(log2(NumTraits<Scalar>::highest())));
-        return static_cast<Scalar>(
-          numext::floor(exp2(highest_bits / static_cast<double>(exponent))));
-    }
+  if (exponent < 2)
+    return NumTraits<Scalar>::highest();
+  else {
+    // base^e <= highest ==> base <= 2^(log2(highest)/e)
+    // For floating-point types, consider the bound for integer values that can be reproduced exactly = 2 ^ digits
+    double highest_bits = numext::mini(static_cast<double>(NumTraits<Scalar>::digits()),
+                                       static_cast<double>(log2(NumTraits<Scalar>::highest())));
+    return static_cast<Scalar>(numext::floor(exp2(highest_bits / static_cast<double>(exponent))));
+  }
 }
 
 template <typename Base, typename Exponent>
 void test_exponent(Exponent exponent) {
-  EIGEN_STATIC_ASSERT(NumTraits<Base>::IsInteger,THIS TEST IS ONLY INTENDED FOR BASE INTEGER TYPES)
+  EIGEN_STATIC_ASSERT(NumTraits<Base>::IsInteger, THIS TEST IS ONLY INTENDED FOR BASE INTEGER TYPES)
   const Base max_abs_bases = static_cast<Base>(10000);
   // avoid integer overflow in Base type
   Base threshold = calc_overflow_threshold<Base, Exponent>(numext::abs(exponent));
@@ -420,12 +415,11 @@
 };
 template <typename Scalar>
 struct functor_traits<test_signbit_op<Scalar>> {
-  enum { Cost = 1, PacketAccess = true }; //todo: define HasSignbit flag
+  enum { Cost = 1, PacketAccess = true };  // todo: define HasSignbit flag
 };
 }  // namespace internal
 }  // namespace Eigen
 
-
 template <typename Scalar>
 void signbit_test() {
   const size_t size = 100 * internal::packet_traits<Scalar>::size;
@@ -459,8 +453,8 @@
   signbit_test<int64_t>();
 }
 
-template<typename ArrayType> void array_generic(const ArrayType& m)
-{
+template <typename ArrayType>
+void array_generic(const ArrayType& m) {
   typedef typename ArrayType::Scalar Scalar;
   typedef typename ArrayType::RealScalar RealScalar;
   typedef Array<Scalar, ArrayType::RowsAtCompileTime, 1> ColVectorType;
@@ -470,36 +464,32 @@
   Index cols = m.cols();
 
   ArrayType m1 = ArrayType::Random(rows, cols);
-  if (NumTraits<RealScalar>::IsInteger && NumTraits<RealScalar>::IsSigned
-      && !NumTraits<Scalar>::IsComplex) {
+  if (NumTraits<RealScalar>::IsInteger && NumTraits<RealScalar>::IsSigned && !NumTraits<Scalar>::IsComplex) {
     // Here we cap the size of the values in m1 such that pow(3)/cube()
     // doesn't overflow and result in undefined behavior. Notice that because
     // pow(int, int) promotes its inputs and output to double (according to
     // the C++ standard), we have to make sure that the result fits in 53 bits
     // for int64,
     RealScalar max_val =
-        numext::mini(RealScalar(std::cbrt(NumTraits<RealScalar>::highest())),
-                     RealScalar(std::cbrt(1LL << 53)))/2;
+        numext::mini(RealScalar(std::cbrt(NumTraits<RealScalar>::highest())), RealScalar(std::cbrt(1LL << 53))) / 2;
     m1.array() = (m1.abs().array() <= max_val).select(m1, Scalar(max_val));
   }
-  ArrayType  m2 = ArrayType::Random(rows, cols),
-             m3(rows, cols);
-  ArrayType m4 = m1; // copy constructor
+  ArrayType m2 = ArrayType::Random(rows, cols), m3(rows, cols);
+  ArrayType m4 = m1;  // copy constructor
   VERIFY_IS_APPROX(m1, m4);
 
   ColVectorType cv1 = ColVectorType::Random(rows);
   RowVectorType rv1 = RowVectorType::Random(cols);
 
-  Scalar  s1 = internal::random<Scalar>(),
-          s2 = internal::random<Scalar>();
+  Scalar s1 = internal::random<Scalar>(), s2 = internal::random<Scalar>();
 
   // scalar addition
   VERIFY_IS_APPROX(m1 + s1, s1 + m1);
-  VERIFY_IS_APPROX(m1 + s1, ArrayType::Constant(rows,cols,s1) + m1);
-  VERIFY_IS_APPROX(s1 - m1, (-m1)+s1 );
-  VERIFY_IS_APPROX(m1 - s1, m1 - ArrayType::Constant(rows,cols,s1));
-  VERIFY_IS_APPROX(s1 - m1, ArrayType::Constant(rows,cols,s1) - m1);
-  VERIFY_IS_APPROX((m1*Scalar(2)) - s2, (m1+m1) - ArrayType::Constant(rows,cols,s2) );
+  VERIFY_IS_APPROX(m1 + s1, ArrayType::Constant(rows, cols, s1) + m1);
+  VERIFY_IS_APPROX(s1 - m1, (-m1) + s1);
+  VERIFY_IS_APPROX(m1 - s1, m1 - ArrayType::Constant(rows, cols, s1));
+  VERIFY_IS_APPROX(s1 - m1, ArrayType::Constant(rows, cols, s1) - m1);
+  VERIFY_IS_APPROX((m1 * Scalar(2)) - s2, (m1 + m1) - ArrayType::Constant(rows, cols, s2));
   m3 = m1;
   m3 += s2;
   VERIFY_IS_APPROX(m3, m1 + s2);
@@ -508,21 +498,25 @@
   VERIFY_IS_APPROX(m3, m1 - s1);
 
   // scalar operators via Maps
-  m3 = m1;  m4 = m1;
+  m3 = m1;
+  m4 = m1;
   ArrayType::Map(m4.data(), m4.rows(), m4.cols()) -= ArrayType::Map(m2.data(), m2.rows(), m2.cols());
   VERIFY_IS_APPROX(m4, m3 - m2);
 
-  m3 = m1;  m4 = m1;
+  m3 = m1;
+  m4 = m1;
   ArrayType::Map(m4.data(), m4.rows(), m4.cols()) += ArrayType::Map(m2.data(), m2.rows(), m2.cols());
   VERIFY_IS_APPROX(m4, m3 + m2);
 
-  m3 = m1; m4 = m1;
+  m3 = m1;
+  m4 = m1;
   ArrayType::Map(m4.data(), m4.rows(), m4.cols()) *= ArrayType::Map(m2.data(), m2.rows(), m2.cols());
   VERIFY_IS_APPROX(m4, m3 * m2);
 
-  m3 = m1; m4 = m1;
-  m2 = ArrayType::Random(rows,cols);
-  m2 = (m2==0).select(1,m2);
+  m3 = m1;
+  m4 = m1;
+  m2 = ArrayType::Random(rows, cols);
+  m2 = (m2 == 0).select(1, m2);
   ArrayType::Map(m4.data(), m4.rows(), m4.cols()) /= ArrayType::Map(m2.data(), m2.rows(), m2.cols());
   VERIFY_IS_APPROX(m4, m3 / m2);
 
@@ -532,9 +526,9 @@
   using numext::abs;
   VERIFY_IS_MUCH_SMALLER_THAN(abs(m1.colwise().sum().sum() - m1.sum()), m1.abs().sum());
   VERIFY_IS_MUCH_SMALLER_THAN(abs(m1.rowwise().sum().sum() - m1.sum()), m1.abs().sum());
-  if (!internal::isMuchSmallerThan(abs(m1.sum() - (m1+m2).sum()), m1.abs().sum(), test_precision<Scalar>()))
-      VERIFY_IS_NOT_APPROX(((m1+m2).rowwise().sum()).sum(), m1.sum());
-  VERIFY_IS_APPROX(m1.colwise().sum(), m1.colwise().redux(internal::scalar_sum_op<Scalar,Scalar>()));
+  if (!internal::isMuchSmallerThan(abs(m1.sum() - (m1 + m2).sum()), m1.abs().sum(), test_precision<Scalar>()))
+    VERIFY_IS_NOT_APPROX(((m1 + m2).rowwise().sum()).sum(), m1.sum());
+  VERIFY_IS_APPROX(m1.colwise().sum(), m1.colwise().redux(internal::scalar_sum_op<Scalar, Scalar>()));
 
   // vector-wise ops
   m3 = m1;
@@ -547,20 +541,19 @@
   VERIFY_IS_APPROX(m3.rowwise() -= rv1, m1.rowwise() - rv1);
 
   // Conversion from scalar
-  VERIFY_IS_APPROX((m3 = s1), ArrayType::Constant(rows,cols,s1));
-  VERIFY_IS_APPROX((m3 = 1),  ArrayType::Constant(rows,cols,1));
-  VERIFY_IS_APPROX((m3.topLeftCorner(rows,cols) = 1),  ArrayType::Constant(rows,cols,1));
-  typedef Array<Scalar,
-                ArrayType::RowsAtCompileTime==Dynamic?2:ArrayType::RowsAtCompileTime,
-                ArrayType::ColsAtCompileTime==Dynamic?2:ArrayType::ColsAtCompileTime,
-                ArrayType::Options> FixedArrayType;
+  VERIFY_IS_APPROX((m3 = s1), ArrayType::Constant(rows, cols, s1));
+  VERIFY_IS_APPROX((m3 = 1), ArrayType::Constant(rows, cols, 1));
+  VERIFY_IS_APPROX((m3.topLeftCorner(rows, cols) = 1), ArrayType::Constant(rows, cols, 1));
+  typedef Array<Scalar, ArrayType::RowsAtCompileTime == Dynamic ? 2 : ArrayType::RowsAtCompileTime,
+                ArrayType::ColsAtCompileTime == Dynamic ? 2 : ArrayType::ColsAtCompileTime, ArrayType::Options>
+      FixedArrayType;
   {
     FixedArrayType f1(s1);
     VERIFY_IS_APPROX(f1, FixedArrayType::Constant(s1));
     FixedArrayType f2(numext::real(s1));
     VERIFY_IS_APPROX(f2, FixedArrayType::Constant(numext::real(s1)));
-    FixedArrayType f3((int)100*numext::real(s1));
-    VERIFY_IS_APPROX(f3, FixedArrayType::Constant((int)100*numext::real(s1)));
+    FixedArrayType f3((int)100 * numext::real(s1));
+    VERIFY_IS_APPROX(f3, FixedArrayType::Constant((int)100 * numext::real(s1)));
     f1.setRandom();
     FixedArrayType f4(f1.data());
     VERIFY_IS_APPROX(f4, f1);
@@ -570,8 +563,8 @@
     VERIFY_IS_APPROX(f1, FixedArrayType::Constant(s1));
     FixedArrayType f2{numext::real(s1)};
     VERIFY_IS_APPROX(f2, FixedArrayType::Constant(numext::real(s1)));
-    FixedArrayType f3{(int)100*numext::real(s1)};
-    VERIFY_IS_APPROX(f3, FixedArrayType::Constant((int)100*numext::real(s1)));
+    FixedArrayType f3{(int)100 * numext::real(s1)};
+    VERIFY_IS_APPROX(f3, FixedArrayType::Constant((int)100 * numext::real(s1)));
     f1.setRandom();
     FixedArrayType f4{f1.data()};
     VERIFY_IS_APPROX(f4, f1);
@@ -579,67 +572,67 @@
 
   // pow
   VERIFY_IS_APPROX(m1.pow(2), m1.square());
-  VERIFY_IS_APPROX(pow(m1,2), m1.square());
+  VERIFY_IS_APPROX(pow(m1, 2), m1.square());
   VERIFY_IS_APPROX(m1.pow(3), m1.cube());
-  VERIFY_IS_APPROX(pow(m1,3), m1.cube());
+  VERIFY_IS_APPROX(pow(m1, 3), m1.cube());
   VERIFY_IS_APPROX((-m1).pow(3), -m1.cube());
-  VERIFY_IS_APPROX(pow(2*m1,3), 8*m1.cube());
+  VERIFY_IS_APPROX(pow(2 * m1, 3), 8 * m1.cube());
   ArrayType exponents = ArrayType::Constant(rows, cols, RealScalar(2));
-  VERIFY_IS_APPROX(Eigen::pow(m1,exponents), m1.square());
+  VERIFY_IS_APPROX(Eigen::pow(m1, exponents), m1.square());
   VERIFY_IS_APPROX(m1.pow(exponents), m1.square());
-  VERIFY_IS_APPROX(Eigen::pow(2*m1,exponents), 4*m1.square());
-  VERIFY_IS_APPROX((2*m1).pow(exponents), 4*m1.square());
-  VERIFY_IS_APPROX(Eigen::pow(m1,2*exponents), m1.square().square());
-  VERIFY_IS_APPROX(m1.pow(2*exponents), m1.square().square());
-  VERIFY_IS_APPROX(Eigen::pow(m1(0,0), exponents), ArrayType::Constant(rows,cols,m1(0,0)*m1(0,0)));
+  VERIFY_IS_APPROX(Eigen::pow(2 * m1, exponents), 4 * m1.square());
+  VERIFY_IS_APPROX((2 * m1).pow(exponents), 4 * m1.square());
+  VERIFY_IS_APPROX(Eigen::pow(m1, 2 * exponents), m1.square().square());
+  VERIFY_IS_APPROX(m1.pow(2 * exponents), m1.square().square());
+  VERIFY_IS_APPROX(Eigen::pow(m1(0, 0), exponents), ArrayType::Constant(rows, cols, m1(0, 0) * m1(0, 0)));
 
   // Check possible conflicts with 1D ctor
   typedef Array<Scalar, Dynamic, 1> OneDArrayType;
   {
     OneDArrayType o1(rows);
-    VERIFY(o1.size()==rows);
+    VERIFY(o1.size() == rows);
     OneDArrayType o2(static_cast<int>(rows));
-    VERIFY(o2.size()==rows);
+    VERIFY(o2.size() == rows);
   }
   {
     OneDArrayType o1{rows};
-    VERIFY(o1.size()==rows);
+    VERIFY(o1.size() == rows);
     OneDArrayType o4{int(rows)};
-    VERIFY(o4.size()==rows);
+    VERIFY(o4.size() == rows);
   }
   // Check possible conflicts with 2D ctor
   typedef Array<Scalar, Dynamic, Dynamic> TwoDArrayType;
   typedef Array<Scalar, 2, 1> ArrayType2;
   {
-    TwoDArrayType o1(rows,cols);
-    VERIFY(o1.rows()==rows);
-    VERIFY(o1.cols()==cols);
-    TwoDArrayType o2(static_cast<int>(rows),static_cast<int>(cols));
-    VERIFY(o2.rows()==rows);
-    VERIFY(o2.cols()==cols);
+    TwoDArrayType o1(rows, cols);
+    VERIFY(o1.rows() == rows);
+    VERIFY(o1.cols() == cols);
+    TwoDArrayType o2(static_cast<int>(rows), static_cast<int>(cols));
+    VERIFY(o2.rows() == rows);
+    VERIFY(o2.cols() == cols);
 
-    ArrayType2 o3(rows,cols);
-    VERIFY(o3(0)==Scalar(rows) && o3(1)==Scalar(cols));
-    ArrayType2 o4(static_cast<int>(rows),static_cast<int>(cols));
-    VERIFY(o4(0)==Scalar(rows) && o4(1)==Scalar(cols));
+    ArrayType2 o3(rows, cols);
+    VERIFY(o3(0) == Scalar(rows) && o3(1) == Scalar(cols));
+    ArrayType2 o4(static_cast<int>(rows), static_cast<int>(cols));
+    VERIFY(o4(0) == Scalar(rows) && o4(1) == Scalar(cols));
   }
   {
-    TwoDArrayType o1{rows,cols};
-    VERIFY(o1.rows()==rows);
-    VERIFY(o1.cols()==cols);
-    TwoDArrayType o2{int(rows),int(cols)};
-    VERIFY(o2.rows()==rows);
-    VERIFY(o2.cols()==cols);
+    TwoDArrayType o1{rows, cols};
+    VERIFY(o1.rows() == rows);
+    VERIFY(o1.cols() == cols);
+    TwoDArrayType o2{int(rows), int(cols)};
+    VERIFY(o2.rows() == rows);
+    VERIFY(o2.cols() == cols);
 
-    ArrayType2 o3{rows,cols};
-    VERIFY(o3(0)==Scalar(rows) && o3(1)==Scalar(cols));
-    ArrayType2 o4{int(rows),int(cols)};
-    VERIFY(o4(0)==Scalar(rows) && o4(1)==Scalar(cols));
+    ArrayType2 o3{rows, cols};
+    VERIFY(o3(0) == Scalar(rows) && o3(1) == Scalar(cols));
+    ArrayType2 o4{int(rows), int(cols)};
+    VERIFY(o4(0) == Scalar(rows) && o4(1) == Scalar(cols));
   }
 }
 
-template<typename ArrayType> void comparisons(const ArrayType& m)
-{
+template <typename ArrayType>
+void comparisons(const ArrayType& m) {
   using numext::abs;
   typedef typename ArrayType::Scalar Scalar;
   typedef typename NumTraits<Scalar>::Real RealScalar;
@@ -647,44 +640,39 @@
   Index rows = m.rows();
   Index cols = m.cols();
 
-  Index r = internal::random<Index>(0, rows-1),
-        c = internal::random<Index>(0, cols-1);
+  Index r = internal::random<Index>(0, rows - 1), c = internal::random<Index>(0, cols - 1);
 
-  ArrayType m1 = ArrayType::Random(rows, cols),
-            m2 = ArrayType::Random(rows, cols),
-            m3(rows, cols),
-            m4 = m1;
+  ArrayType m1 = ArrayType::Random(rows, cols), m2 = ArrayType::Random(rows, cols), m3(rows, cols), m4 = m1;
 
-  m4 = (m4.abs()==Scalar(0)).select(1,m4);
+  m4 = (m4.abs() == Scalar(0)).select(1, m4);
 
   // use operator overloads with default return type
 
   VERIFY(((m1 + Scalar(1)) > m1).all());
   VERIFY(((m1 - Scalar(1)) < m1).all());
-  if (rows*cols>1)
-  {
+  if (rows * cols > 1) {
     m3 = m1;
-    m3(r,c) += 1;
-    VERIFY(! (m1 < m3).all() );
-    VERIFY(! (m1 > m3).all() );
+    m3(r, c) += 1;
+    VERIFY(!(m1 < m3).all());
+    VERIFY(!(m1 > m3).all());
   }
   VERIFY(!(m1 > m2 && m1 < m2).any());
   VERIFY((m1 <= m2 || m1 >= m2).all());
 
   // comparisons array to scalar
-  VERIFY( (m1 != (m1(r,c)+1) ).any() );
-  VERIFY( (m1 >  (m1(r,c)-1) ).any() );
-  VERIFY( (m1 <  (m1(r,c)+1) ).any() );
-  VERIFY( (m1 ==  m1(r,c)    ).any() );
+  VERIFY((m1 != (m1(r, c) + 1)).any());
+  VERIFY((m1 > (m1(r, c) - 1)).any());
+  VERIFY((m1 < (m1(r, c) + 1)).any());
+  VERIFY((m1 == m1(r, c)).any());
 
   // comparisons scalar to array
-  VERIFY( ( (m1(r,c)+1) != m1).any() );
-  VERIFY( ( (m1(r,c)-1) <  m1).any() );
-  VERIFY( ( (m1(r,c)+1) >  m1).any() );
-  VERIFY( (  m1(r,c)    == m1).any() );
+  VERIFY(((m1(r, c) + 1) != m1).any());
+  VERIFY(((m1(r, c) - 1) < m1).any());
+  VERIFY(((m1(r, c) + 1) > m1).any());
+  VERIFY((m1(r, c) == m1).any());
 
   // currently, any() / all() are not vectorized, so use VERIFY_IS_CWISE_EQUAL to test vectorized path
-   
+
   // use typed comparisons, regardless of operator overload behavior
   typename ArrayType::ConstantReturnType typed_true = ArrayType::Constant(rows, cols, Scalar(1));
   // (m1 + Scalar(1)) > m1).all()
@@ -728,40 +716,37 @@
   VERIFY_IS_CWISE_EQUAL(m1.abs().cwiseGreaterOrEqual(Scalar(0)), bool_true);
 
   // test Select
-  VERIFY_IS_APPROX( (m1<m2).select(m1,m2), m1.cwiseMin(m2) );
-  VERIFY_IS_APPROX( (m1>m2).select(m1,m2), m1.cwiseMax(m2) );
-  Scalar mid = (m1.cwiseAbs().minCoeff() + m1.cwiseAbs().maxCoeff())/Scalar(2);
-  for (int j=0; j<cols; ++j)
-  for (int i=0; i<rows; ++i)
-    m3(i,j) = abs(m1(i,j))<mid ? 0 : m1(i,j);
-  VERIFY_IS_APPROX( (m1.abs()<ArrayType::Constant(rows,cols,mid))
-                        .select(ArrayType::Zero(rows,cols),m1), m3);
+  VERIFY_IS_APPROX((m1 < m2).select(m1, m2), m1.cwiseMin(m2));
+  VERIFY_IS_APPROX((m1 > m2).select(m1, m2), m1.cwiseMax(m2));
+  Scalar mid = (m1.cwiseAbs().minCoeff() + m1.cwiseAbs().maxCoeff()) / Scalar(2);
+  for (int j = 0; j < cols; ++j)
+    for (int i = 0; i < rows; ++i) m3(i, j) = abs(m1(i, j)) < mid ? 0 : m1(i, j);
+  VERIFY_IS_APPROX((m1.abs() < ArrayType::Constant(rows, cols, mid)).select(ArrayType::Zero(rows, cols), m1), m3);
   // shorter versions:
-  VERIFY_IS_APPROX( (m1.abs()<ArrayType::Constant(rows,cols,mid))
-                        .select(0,m1), m3);
-  VERIFY_IS_APPROX( (m1.abs()>=ArrayType::Constant(rows,cols,mid))
-                        .select(m1,0), m3);
+  VERIFY_IS_APPROX((m1.abs() < ArrayType::Constant(rows, cols, mid)).select(0, m1), m3);
+  VERIFY_IS_APPROX((m1.abs() >= ArrayType::Constant(rows, cols, mid)).select(m1, 0), m3);
   // even shorter version:
-  VERIFY_IS_APPROX( (m1.abs()<mid).select(0,m1), m3); 
+  VERIFY_IS_APPROX((m1.abs() < mid).select(0, m1), m3);
 
   // count
-  VERIFY(((m1.abs()+1)>RealScalar(0.1)).count() == rows*cols);
+  VERIFY(((m1.abs() + 1) > RealScalar(0.1)).count() == rows * cols);
 
   // and/or
-  VERIFY( (m1<RealScalar(0) && m1>RealScalar(0)).count() == 0);
-  VERIFY( (m1<RealScalar(0) || m1>=RealScalar(0)).count() == rows*cols);
+  VERIFY((m1 < RealScalar(0) && m1 > RealScalar(0)).count() == 0);
+  VERIFY((m1 < RealScalar(0) || m1 >= RealScalar(0)).count() == rows * cols);
   RealScalar a = m1.abs().mean();
-  VERIFY( (m1<-a || m1>a).count() == (m1.abs()>a).count());
+  VERIFY((m1 < -a || m1 > a).count() == (m1.abs() > a).count());
 
   typedef Array<Index, Dynamic, 1> ArrayOfIndices;
 
   // TODO allows colwise/rowwise for array
-  VERIFY_IS_APPROX(((m1.abs()+1)>RealScalar(0.1)).colwise().count(), ArrayOfIndices::Constant(cols,rows).transpose());
-  VERIFY_IS_APPROX(((m1.abs()+1)>RealScalar(0.1)).rowwise().count(), ArrayOfIndices::Constant(rows, cols));
+  VERIFY_IS_APPROX(((m1.abs() + 1) > RealScalar(0.1)).colwise().count(),
+                   ArrayOfIndices::Constant(cols, rows).transpose());
+  VERIFY_IS_APPROX(((m1.abs() + 1) > RealScalar(0.1)).rowwise().count(), ArrayOfIndices::Constant(rows, cols));
 }
 
-template<typename ArrayType> void array_real(const ArrayType& m)
-{
+template <typename ArrayType>
+void array_real(const ArrayType& m) {
   using numext::abs;
   using std::sqrt;
   typedef typename ArrayType::Scalar Scalar;
@@ -770,19 +755,16 @@
   Index rows = m.rows();
   Index cols = m.cols();
 
-  ArrayType m1 = ArrayType::Random(rows, cols),
-            m2 = ArrayType::Random(rows, cols),
-            m3(rows, cols),
-            m4 = m1;
+  ArrayType m1 = ArrayType::Random(rows, cols), m2 = ArrayType::Random(rows, cols), m3(rows, cols), m4 = m1;
 
   // avoid denormalized values so verification doesn't fail on platforms that don't support them
   // denormalized behavior is tested elsewhere (unary_op_test, binary_ops_test)
   const Scalar min = (std::numeric_limits<Scalar>::min)();
-  m1 = (m1.abs()<min).select(Scalar(0),m1);
-  m2 = (m2.abs()<min).select(Scalar(0),m2);
-  m4 = (m4.abs()<min).select(Scalar(1),m4);
+  m1 = (m1.abs() < min).select(Scalar(0), m1);
+  m2 = (m2.abs() < min).select(Scalar(0), m2);
+  m4 = (m4.abs() < min).select(Scalar(1), m4);
 
-  Scalar  s1 = internal::random<Scalar>();
+  Scalar s1 = internal::random<Scalar>();
 
   // these tests are mostly to check possible compilation issues with free-functions.
   VERIFY_IS_APPROX(m1.sin(), sin(m1));
@@ -794,7 +776,7 @@
   VERIFY_IS_APPROX(m1.sinh(), sinh(m1));
   VERIFY_IS_APPROX(m1.cosh(), cosh(m1));
   VERIFY_IS_APPROX(m1.tanh(), tanh(m1));
-  VERIFY_IS_APPROX(m1.atan2(m2), atan2(m1,m2));
+  VERIFY_IS_APPROX(m1.atan2(m2), atan2(m1, m2));
 
   VERIFY_IS_APPROX(m1.tanh().atanh(), atanh(tanh(m1)));
   VERIFY_IS_APPROX(m1.sinh().asinh(), asinh(sinh(m1)));
@@ -815,7 +797,7 @@
   VERIFY_IS_APPROX(m1.abs2(), abs2(m1));
   VERIFY_IS_APPROX(m1.square(), square(m1));
   VERIFY_IS_APPROX(m1.cube(), cube(m1));
-  VERIFY_IS_APPROX(cos(m1+RealScalar(3)*m2), cos((m1+RealScalar(3)*m2).eval()));
+  VERIFY_IS_APPROX(cos(m1 + RealScalar(3) * m2), cos((m1 + RealScalar(3) * m2).eval()));
   VERIFY_IS_APPROX(m1.sign(), sign(m1));
   VERIFY((m1.sqrt().sign().isNaN() == (Eigen::isnan)(sign(sqrt(m1)))).all());
 
@@ -824,41 +806,42 @@
 
   VERIFY_IS_APPROX(m3.sqrt(), sqrt(abs(m3)));
   VERIFY_IS_APPROX(m3.cbrt(), cbrt(m3));
-  VERIFY_IS_APPROX(m3.rsqrt(), Scalar(1)/sqrt(abs(m3)));
-  VERIFY_IS_APPROX(rsqrt(m3), Scalar(1)/sqrt(abs(m3)));
+  VERIFY_IS_APPROX(m3.rsqrt(), Scalar(1) / sqrt(abs(m3)));
+  VERIFY_IS_APPROX(rsqrt(m3), Scalar(1) / sqrt(abs(m3)));
   VERIFY_IS_APPROX(m3.log(), log(m3));
   VERIFY_IS_APPROX(m3.log1p(), log1p(m3));
   VERIFY_IS_APPROX(m3.log10(), log10(m3));
   VERIFY_IS_APPROX(m3.log2(), log2(m3));
 
-
-  VERIFY((!(m1>m2) == (m1<=m2)).all());
+  VERIFY((!(m1 > m2) == (m1 <= m2)).all());
 
   VERIFY_IS_APPROX(sin(m1.asin()), m1);
   VERIFY_IS_APPROX(cos(m1.acos()), m1);
   VERIFY_IS_APPROX(tan(m1.atan()), m1);
-  VERIFY_IS_APPROX(sinh(m1), Scalar(0.5)*(exp(m1)-exp(-m1)));
-  VERIFY_IS_APPROX(cosh(m1), Scalar(0.5)*(exp(m1)+exp(-m1)));
-  VERIFY_IS_APPROX(tanh(m1), (Scalar(0.5)*(exp(m1)-exp(-m1)))/(Scalar(0.5)*(exp(m1)+exp(-m1))));
-  VERIFY_IS_APPROX(logistic(m1), (Scalar(1)/(Scalar(1)+exp(-m1))));
-  VERIFY_IS_APPROX(arg(m1), ((m1<Scalar(0)).template cast<Scalar>())*Scalar(std::acos(Scalar(-1))));
+  VERIFY_IS_APPROX(sinh(m1), Scalar(0.5) * (exp(m1) - exp(-m1)));
+  VERIFY_IS_APPROX(cosh(m1), Scalar(0.5) * (exp(m1) + exp(-m1)));
+  VERIFY_IS_APPROX(tanh(m1), (Scalar(0.5) * (exp(m1) - exp(-m1))) / (Scalar(0.5) * (exp(m1) + exp(-m1))));
+  VERIFY_IS_APPROX(logistic(m1), (Scalar(1) / (Scalar(1) + exp(-m1))));
+  VERIFY_IS_APPROX(arg(m1), ((m1 < Scalar(0)).template cast<Scalar>()) * Scalar(std::acos(Scalar(-1))));
   VERIFY((round(m1) <= ceil(m1) && round(m1) >= floor(m1)).all());
   VERIFY((rint(m1) <= ceil(m1) && rint(m1) >= floor(m1)).all());
   VERIFY(((ceil(m1) - round(m1)) <= Scalar(0.5) || (round(m1) - floor(m1)) <= Scalar(0.5)).all());
   VERIFY(((ceil(m1) - round(m1)) <= Scalar(1.0) && (round(m1) - floor(m1)) <= Scalar(1.0)).all());
   VERIFY(((ceil(m1) - rint(m1)) <= Scalar(0.5) || (rint(m1) - floor(m1)) <= Scalar(0.5)).all());
   VERIFY(((ceil(m1) - rint(m1)) <= Scalar(1.0) && (rint(m1) - floor(m1)) <= Scalar(1.0)).all());
-  VERIFY((Eigen::isnan)((m1*Scalar(0))/Scalar(0)).all());
-  VERIFY((Eigen::isinf)(m4/Scalar(0)).all());
-  VERIFY(((Eigen::isfinite)(m1) && (!(Eigen::isfinite)(m1*Scalar(0)/Scalar(0))) && (!(Eigen::isfinite)(m4/Scalar(0)))).all());
-  VERIFY_IS_APPROX(inverse(inverse(m4)),m4);
+  VERIFY((Eigen::isnan)((m1 * Scalar(0)) / Scalar(0)).all());
+  VERIFY((Eigen::isinf)(m4 / Scalar(0)).all());
+  VERIFY(((Eigen::isfinite)(m1) && (!(Eigen::isfinite)(m1 * Scalar(0) / Scalar(0))) &&
+          (!(Eigen::isfinite)(m4 / Scalar(0))))
+             .all());
+  VERIFY_IS_APPROX(inverse(inverse(m4)), m4);
   VERIFY((abs(m1) == m1 || abs(m1) == -m1).all());
   VERIFY_IS_APPROX(m3, sqrt(abs2(m3)));
   VERIFY_IS_APPROX(m1.absolute_difference(m2), (m1 > m2).select(m1 - m2, m2 - m1));
-  VERIFY_IS_APPROX( m1.sign(), -(-m1).sign() );
-  VERIFY_IS_APPROX( m1*m1.sign(),m1.abs());
+  VERIFY_IS_APPROX(m1.sign(), -(-m1).sign());
+  VERIFY_IS_APPROX(m1 * m1.sign(), m1.abs());
   VERIFY_IS_APPROX(m1.sign() * m1.abs(), m1);
-  
+
   ArrayType tmp = m1.atan2(m2);
   for (Index i = 0; i < tmp.size(); ++i) {
     Scalar actual = tmp.array()(i);
@@ -868,45 +851,44 @@
 
   VERIFY_IS_APPROX(numext::abs2(numext::real(m1)) + numext::abs2(numext::imag(m1)), numext::abs2(m1));
   VERIFY_IS_APPROX(numext::abs2(Eigen::real(m1)) + numext::abs2(Eigen::imag(m1)), numext::abs2(m1));
-  if(!NumTraits<Scalar>::IsComplex)
-    VERIFY_IS_APPROX(numext::real(m1), m1);
+  if (!NumTraits<Scalar>::IsComplex) VERIFY_IS_APPROX(numext::real(m1), m1);
 
   // shift argument of logarithm so that it is not zero
   Scalar smallNumber = NumTraits<Scalar>::dummy_precision();
-  VERIFY_IS_APPROX((m3 + smallNumber).log() , log(abs(m3) + smallNumber));
-  VERIFY_IS_APPROX((m3 + smallNumber + Scalar(1)).log() , log1p(abs(m3) + smallNumber));
+  VERIFY_IS_APPROX((m3 + smallNumber).log(), log(abs(m3) + smallNumber));
+  VERIFY_IS_APPROX((m3 + smallNumber + Scalar(1)).log(), log1p(abs(m3) + smallNumber));
 
-  VERIFY_IS_APPROX(m1.exp() * m2.exp(), exp(m1+m2));
+  VERIFY_IS_APPROX(m1.exp() * m2.exp(), exp(m1 + m2));
   VERIFY_IS_APPROX(m1.exp(), exp(m1));
-  VERIFY_IS_APPROX(m1.exp() / m2.exp(),(m1-m2).exp());
+  VERIFY_IS_APPROX(m1.exp() / m2.exp(), (m1 - m2).exp());
 
   VERIFY_IS_APPROX(m1.expm1(), expm1(m1));
   VERIFY_IS_APPROX((m3 + smallNumber).exp() - Scalar(1), expm1(abs(m3) + smallNumber));
 
   VERIFY_IS_APPROX(m3.pow(RealScalar(0.5)), m3.sqrt());
-  VERIFY_IS_APPROX(pow(m3,RealScalar(0.5)), m3.sqrt());
-  VERIFY_IS_APPROX(m3.pow(RealScalar(1.0/3.0)), m3.cbrt());
-  VERIFY_IS_APPROX(pow(m3,RealScalar(1.0/3.0)), m3.cbrt());
+  VERIFY_IS_APPROX(pow(m3, RealScalar(0.5)), m3.sqrt());
+  VERIFY_IS_APPROX(m3.pow(RealScalar(1.0 / 3.0)), m3.cbrt());
+  VERIFY_IS_APPROX(pow(m3, RealScalar(1.0 / 3.0)), m3.cbrt());
 
   VERIFY_IS_APPROX(m3.pow(RealScalar(-0.5)), m3.rsqrt());
-  VERIFY_IS_APPROX(pow(m3,RealScalar(-0.5)), m3.rsqrt());
+  VERIFY_IS_APPROX(pow(m3, RealScalar(-0.5)), m3.rsqrt());
 
   // Avoid inf and NaN.
-  m3 = (m1.square()<NumTraits<Scalar>::epsilon()).select(Scalar(1),m3);
+  m3 = (m1.square() < NumTraits<Scalar>::epsilon()).select(Scalar(1), m3);
   VERIFY_IS_APPROX(m3.pow(RealScalar(-2)), m3.square().inverse());
 
   // Test pow and atan2 on special IEEE values.
   unary_ops_test<Scalar>();
   binary_ops_test<Scalar>();
 
-  VERIFY_IS_APPROX(log10(m3), log(m3)/numext::log(Scalar(10)));
-  VERIFY_IS_APPROX(log2(m3), log(m3)/numext::log(Scalar(2)));
+  VERIFY_IS_APPROX(log10(m3), log(m3) / numext::log(Scalar(10)));
+  VERIFY_IS_APPROX(log2(m3), log(m3) / numext::log(Scalar(2)));
 
   // scalar by array division
   const RealScalar tiny = sqrt(std::numeric_limits<RealScalar>::epsilon());
   s1 += Scalar(tiny);
-  m1 += ArrayType::Constant(rows,cols,Scalar(tiny));
-  VERIFY_IS_CWISE_APPROX(s1/m1, s1 * m1.inverse());
+  m1 += ArrayType::Constant(rows, cols, Scalar(tiny));
+  VERIFY_IS_CWISE_APPROX(s1 / m1, s1 * m1.inverse());
 
   // check inplace transpose
   m3 = m1;
@@ -916,27 +898,23 @@
   VERIFY_IS_APPROX(m3, m1);
 }
 
-
-template<typename ArrayType> void array_complex(const ArrayType& m)
-{
+template <typename ArrayType>
+void array_complex(const ArrayType& m) {
   typedef typename ArrayType::Scalar Scalar;
   typedef typename NumTraits<Scalar>::Real RealScalar;
 
   Index rows = m.rows();
   Index cols = m.cols();
 
-  ArrayType m1 = ArrayType::Random(rows, cols),
-            m2(rows, cols),
-            m4 = m1;
+  ArrayType m1 = ArrayType::Random(rows, cols), m2(rows, cols), m4 = m1;
 
-  m4.real() = (m4.real().abs()==RealScalar(0)).select(RealScalar(1),m4.real());
-  m4.imag() = (m4.imag().abs()==RealScalar(0)).select(RealScalar(1),m4.imag());
+  m4.real() = (m4.real().abs() == RealScalar(0)).select(RealScalar(1), m4.real());
+  m4.imag() = (m4.imag().abs() == RealScalar(0)).select(RealScalar(1), m4.imag());
 
   Array<RealScalar, -1, -1> m3(rows, cols);
 
   for (Index i = 0; i < m.rows(); ++i)
-    for (Index j = 0; j < m.cols(); ++j)
-      m2(i,j) = sqrt(m1(i,j));
+    for (Index j = 0; j < m.cols(); ++j) m2(i, j) = sqrt(m1(i, j));
 
   // these tests are mostly to check possible compilation issues with free-functions.
   VERIFY_IS_APPROX(m1.sin(), sin(m1));
@@ -961,12 +939,12 @@
   VERIFY_IS_APPROX(m1.sqrt(), sqrt(m1));
   VERIFY_IS_APPROX(m1.square(), square(m1));
   VERIFY_IS_APPROX(m1.cube(), cube(m1));
-  VERIFY_IS_APPROX(cos(m1+RealScalar(3)*m2), cos((m1+RealScalar(3)*m2).eval()));
+  VERIFY_IS_APPROX(cos(m1 + RealScalar(3) * m2), cos((m1 + RealScalar(3) * m2).eval()));
   VERIFY_IS_APPROX(m1.sign(), sign(m1));
 
-  VERIFY_IS_APPROX(m1.exp() * m2.exp(), exp(m1+m2));
+  VERIFY_IS_APPROX(m1.exp() * m2.exp(), exp(m1 + m2));
   VERIFY_IS_APPROX(m1.exp(), exp(m1));
-  VERIFY_IS_APPROX(m1.exp() / m2.exp(),(m1-m2).exp());
+  VERIFY_IS_APPROX(m1.exp() / m2.exp(), (m1 - m2).exp());
 
   VERIFY_IS_APPROX(m1.expm1(), expm1(m1));
   VERIFY_IS_APPROX(expm1(m1), exp(m1) - 1.);
@@ -986,49 +964,46 @@
   }
 
   for (Index i = 0; i < m.rows(); ++i)
-    for (Index j = 0; j < m.cols(); ++j)
-      m3(i,j) = std::atan2(m1(i,j).imag(), m1(i,j).real());
+    for (Index j = 0; j < m.cols(); ++j) m3(i, j) = std::atan2(m1(i, j).imag(), m1(i, j).real());
   VERIFY_IS_APPROX(arg(m1), m3);
   VERIFY_IS_APPROX(carg(m1), m3);
 
-  std::complex<RealScalar> zero(0.0,0.0);
-  VERIFY((Eigen::isnan)(m1*zero/zero).all());
+  std::complex<RealScalar> zero(0.0, 0.0);
+  VERIFY((Eigen::isnan)(m1 * zero / zero).all());
 #if EIGEN_COMP_MSVC
   // msvc complex division is not robust
-  VERIFY((Eigen::isinf)(m4/RealScalar(0)).all());
+  VERIFY((Eigen::isinf)(m4 / RealScalar(0)).all());
 #else
 #if EIGEN_COMP_CLANG
   // clang's complex division is notoriously broken too
-  if((numext::isinf)(m4(0,0)/RealScalar(0))) {
+  if ((numext::isinf)(m4(0, 0) / RealScalar(0))) {
 #endif
-    VERIFY((Eigen::isinf)(m4/zero).all());
+    VERIFY((Eigen::isinf)(m4 / zero).all());
 #if EIGEN_COMP_CLANG
-  }
-  else
-  {
-    VERIFY((Eigen::isinf)(m4.real()/zero.real()).all());
+  } else {
+    VERIFY((Eigen::isinf)(m4.real() / zero.real()).all());
   }
 #endif
-#endif // MSVC
+#endif  // MSVC
 
-  VERIFY(((Eigen::isfinite)(m1) && (!(Eigen::isfinite)(m1*zero/zero)) && (!(Eigen::isfinite)(m1/zero))).all());
+  VERIFY(((Eigen::isfinite)(m1) && (!(Eigen::isfinite)(m1 * zero / zero)) && (!(Eigen::isfinite)(m1 / zero))).all());
 
-  VERIFY_IS_APPROX(inverse(inverse(m4)),m4);
+  VERIFY_IS_APPROX(inverse(inverse(m4)), m4);
   VERIFY_IS_APPROX(conj(m1.conjugate()), m1);
-  VERIFY_IS_APPROX(abs(m1), sqrt(square(m1.real())+square(m1.imag())));
+  VERIFY_IS_APPROX(abs(m1), sqrt(square(m1.real()) + square(m1.imag())));
   VERIFY_IS_APPROX(abs(m1), sqrt(abs2(m1)));
-  VERIFY_IS_APPROX(log10(m1), log(m1)/log(10));
-  VERIFY_IS_APPROX(log2(m1), log(m1)/log(2));
+  VERIFY_IS_APPROX(log10(m1), log(m1) / log(10));
+  VERIFY_IS_APPROX(log2(m1), log(m1) / log(2));
 
-  VERIFY_IS_APPROX( m1.sign(), -(-m1).sign() );
-  VERIFY_IS_APPROX( m1.sign() * m1.abs(), m1);
+  VERIFY_IS_APPROX(m1.sign(), -(-m1).sign());
+  VERIFY_IS_APPROX(m1.sign() * m1.abs(), m1);
 
   // scalar by array division
-  Scalar  s1 = internal::random<Scalar>();
+  Scalar s1 = internal::random<Scalar>();
   const RealScalar tiny = std::sqrt(std::numeric_limits<RealScalar>::epsilon());
   s1 += Scalar(tiny);
-  m1 += ArrayType::Constant(rows,cols,Scalar(tiny));
-  VERIFY_IS_APPROX(s1/m1, s1 * m1.inverse());
+  m1 += ArrayType::Constant(rows, cols, Scalar(tiny));
+  VERIFY_IS_APPROX(s1 / m1, s1 * m1.inverse());
 
   // check inplace transpose
   m2 = m1;
@@ -1043,8 +1018,8 @@
   VERIFY_IS_APPROX(m6, m5.transpose());
 }
 
-template<typename ArrayType> void min_max(const ArrayType& m)
-{
+template <typename ArrayType>
+void min_max(const ArrayType& m) {
   typedef typename ArrayType::Scalar Scalar;
 
   Index rows = m.rows();
@@ -1056,23 +1031,22 @@
   Scalar maxM1 = m1.maxCoeff();
   Scalar minM1 = m1.minCoeff();
 
-  VERIFY_IS_APPROX(ArrayType::Constant(rows,cols, minM1), (m1.min)(ArrayType::Constant(rows,cols, minM1)));
-  VERIFY_IS_APPROX(m1, (m1.min)(ArrayType::Constant(rows,cols, maxM1)));
+  VERIFY_IS_APPROX(ArrayType::Constant(rows, cols, minM1), (m1.min)(ArrayType::Constant(rows, cols, minM1)));
+  VERIFY_IS_APPROX(m1, (m1.min)(ArrayType::Constant(rows, cols, maxM1)));
 
-  VERIFY_IS_APPROX(ArrayType::Constant(rows,cols, maxM1), (m1.max)(ArrayType::Constant(rows,cols, maxM1)));
-  VERIFY_IS_APPROX(m1, (m1.max)(ArrayType::Constant(rows,cols, minM1)));
+  VERIFY_IS_APPROX(ArrayType::Constant(rows, cols, maxM1), (m1.max)(ArrayType::Constant(rows, cols, maxM1)));
+  VERIFY_IS_APPROX(m1, (m1.max)(ArrayType::Constant(rows, cols, minM1)));
 
   // min/max with scalar input
-  VERIFY_IS_APPROX(ArrayType::Constant(rows,cols, minM1), (m1.min)( minM1));
-  VERIFY_IS_APPROX(m1, (m1.min)( maxM1));
+  VERIFY_IS_APPROX(ArrayType::Constant(rows, cols, minM1), (m1.min)(minM1));
+  VERIFY_IS_APPROX(m1, (m1.min)(maxM1));
 
-  VERIFY_IS_APPROX(ArrayType::Constant(rows,cols, maxM1), (m1.max)( maxM1));
-  VERIFY_IS_APPROX(m1, (m1.max)( minM1));
-
+  VERIFY_IS_APPROX(ArrayType::Constant(rows, cols, maxM1), (m1.max)(maxM1));
+  VERIFY_IS_APPROX(m1, (m1.max)(minM1));
 
   // min/max with various NaN propagation options.
   if (m1.size() > 1 && !NumTraits<Scalar>::IsInteger) {
-    m1(0,0) = NumTraits<Scalar>::quiet_NaN();
+    m1(0, 0) = NumTraits<Scalar>::quiet_NaN();
     maxM1 = m1.template maxCoeff<PropagateNaN>();
     minM1 = m1.template minCoeff<PropagateNaN>();
     VERIFY((numext::isnan)(maxM1));
@@ -1085,17 +1059,17 @@
   }
 }
 
-template<int N>
+template <int N>
 struct shift_left {
-  template<typename Scalar>
+  template <typename Scalar>
   Scalar operator()(const Scalar& v) const {
     return (v << N);
   }
 };
 
-template<int N>
+template <int N>
 struct arithmetic_shift_right {
-  template<typename Scalar>
+  template <typename Scalar>
   Scalar operator()(const Scalar& v) const {
     return (v >> N);
   }
@@ -1108,7 +1082,7 @@
   static constexpr size_t MaxShift = (CHAR_BIT * Size) - 1;
 
   template <size_t N = 1>
-  static inline std::enable_if_t<(N >  MaxShift), void> run(const ArrayType&  ) {}
+  static inline std::enable_if_t<(N > MaxShift), void> run(const ArrayType&) {}
   template <size_t N = 1>
   static inline std::enable_if_t<(N <= MaxShift), void> run(const ArrayType& m) {
     const Index rows = m.rows();
@@ -1129,7 +1103,7 @@
 };
 template <typename ArrayType>
 void signed_shift_test(const ArrayType& m) {
-    signed_shift_test_impl<ArrayType>::run(m);
+  signed_shift_test_impl<ArrayType>::run(m);
 }
 
 template <typename ArrayType>
@@ -1139,13 +1113,18 @@
   static bool scalar_to_bool(const Scalar& x) { return x != Scalar(0); }
   static Scalar bool_to_scalar(bool x) { return x ? Scalar(1) : Scalar(0); }
 
-  static Scalar eval_bool_and(const Scalar& x, const Scalar& y) { return bool_to_scalar(scalar_to_bool(x) && scalar_to_bool(y)); }
-  static Scalar eval_bool_or(const Scalar& x, const Scalar& y) { return bool_to_scalar(scalar_to_bool(x) || scalar_to_bool(y)); }
-  static Scalar eval_bool_xor(const Scalar& x, const Scalar& y) { return bool_to_scalar(scalar_to_bool(x) != scalar_to_bool(y)); }
+  static Scalar eval_bool_and(const Scalar& x, const Scalar& y) {
+    return bool_to_scalar(scalar_to_bool(x) && scalar_to_bool(y));
+  }
+  static Scalar eval_bool_or(const Scalar& x, const Scalar& y) {
+    return bool_to_scalar(scalar_to_bool(x) || scalar_to_bool(y));
+  }
+  static Scalar eval_bool_xor(const Scalar& x, const Scalar& y) {
+    return bool_to_scalar(scalar_to_bool(x) != scalar_to_bool(y));
+  }
   static Scalar eval_bool_not(const Scalar& x) { return bool_to_scalar(!scalar_to_bool(x)); }
 
   static void run(const ArrayType& m) {
-      
     Index rows = m.rows();
     Index cols = m.cols();
 
@@ -1232,24 +1211,63 @@
 };
 template <typename ArrayType>
 void typed_logicals_test(const ArrayType& m) {
-    typed_logicals_test_impl<ArrayType>::run(m);
+  typed_logicals_test_impl<ArrayType>::run(m);
 }
 
 // print non-mangled typenames
-template<typename T> std::string printTypeInfo(const T&) { return typeid(T).name(); }
-template<> std::string printTypeInfo(const int8_t&) { return "int8_t"; }
-template<> std::string printTypeInfo(const int16_t&) { return "int16_t"; }
-template<> std::string printTypeInfo(const int32_t&) { return "int32_t"; }
-template<> std::string printTypeInfo(const int64_t&) { return "int64_t"; }
-template<> std::string printTypeInfo(const uint8_t&) { return "uint8_t"; }
-template<> std::string printTypeInfo(const uint16_t&) { return "uint16_t"; }
-template<> std::string printTypeInfo(const uint32_t&) { return "uint32_t"; }
-template<> std::string printTypeInfo(const uint64_t&) { return "uint64_t"; }
-template<> std::string printTypeInfo(const float&) { return "float"; }
-template<> std::string printTypeInfo(const double&) { return "double"; }
-//template<> std::string printTypeInfo(const long double&) { return "long double"; }
-template<> std::string printTypeInfo(const half&) { return "half"; }
-template<> std::string printTypeInfo(const bfloat16&) { return "bfloat16"; }
+template <typename T>
+std::string printTypeInfo(const T&) {
+  return typeid(T).name();
+}
+template <>
+std::string printTypeInfo(const int8_t&) {
+  return "int8_t";
+}
+template <>
+std::string printTypeInfo(const int16_t&) {
+  return "int16_t";
+}
+template <>
+std::string printTypeInfo(const int32_t&) {
+  return "int32_t";
+}
+template <>
+std::string printTypeInfo(const int64_t&) {
+  return "int64_t";
+}
+template <>
+std::string printTypeInfo(const uint8_t&) {
+  return "uint8_t";
+}
+template <>
+std::string printTypeInfo(const uint16_t&) {
+  return "uint16_t";
+}
+template <>
+std::string printTypeInfo(const uint32_t&) {
+  return "uint32_t";
+}
+template <>
+std::string printTypeInfo(const uint64_t&) {
+  return "uint64_t";
+}
+template <>
+std::string printTypeInfo(const float&) {
+  return "float";
+}
+template <>
+std::string printTypeInfo(const double&) {
+  return "double";
+}
+// template<> std::string printTypeInfo(const long double&) { return "long double"; }
+template <>
+std::string printTypeInfo(const half&) {
+  return "half";
+}
+template <>
+std::string printTypeInfo(const bfloat16&) {
+  return "bfloat16";
+}
 
 template <typename SrcType, typename DstType, int RowsAtCompileTime, int ColsAtCompileTime>
 struct cast_test_impl {
@@ -1318,79 +1336,91 @@
 template <int RowsAtCompileTime, int ColsAtCompileTime>
 void cast_test() {
   cast_tests_impl<RowsAtCompileTime, ColsAtCompileTime, bool, int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t,
-                  uint32_t, uint64_t, float, double, /*long double, */half, bfloat16>::run();
+                  uint32_t, uint64_t, float, double, /*long double, */ half, bfloat16>::run();
 }
 
-EIGEN_DECLARE_TEST(array_cwise)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( array_generic(Array<float, 1, 1>()) );
-    CALL_SUBTEST_2( array_generic(Array22f()) );
-    CALL_SUBTEST_3( array_generic(Array44d()) );
-    CALL_SUBTEST_4( array_generic(ArrayXXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_7( array_generic(ArrayXXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_8( array_generic(ArrayXXi(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_7( array_generic(Array<Index,Dynamic,Dynamic>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_8( signed_shift_test(ArrayXXi(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
-    CALL_SUBTEST_9( signed_shift_test(Array<Index, Dynamic, Dynamic>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
-    CALL_SUBTEST_10( array_generic(Array<uint32_t, Dynamic, Dynamic>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
-    CALL_SUBTEST_11( array_generic(Array<uint64_t, Dynamic, Dynamic>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
-  }
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( comparisons(Array<float, 1, 1>()) );
-    CALL_SUBTEST_2( comparisons(Array22f()) );
-    CALL_SUBTEST_3( comparisons(Array44d()) );
-    CALL_SUBTEST_7( comparisons(ArrayXXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_8( comparisons(ArrayXXi(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-  }
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_6( min_max(Array<float, 1, 1>()) );
-    CALL_SUBTEST_7( min_max(Array22f()) );
-    CALL_SUBTEST_8( min_max(Array44d()) );
-    CALL_SUBTEST_9( min_max(ArrayXXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_10( min_max(ArrayXXi(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-  }
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_11( array_real(Array<float, 1, 1>()) );
-    CALL_SUBTEST_12( array_real(Array22f()) );
-    CALL_SUBTEST_13( array_real(Array44d()) );
-    CALL_SUBTEST_14( array_real(ArrayXXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_15( array_real(Array<Eigen::half, 32, 32>()) );
-    CALL_SUBTEST_16( array_real(Array<Eigen::bfloat16, 32, 32>()) );
-  }
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_17( array_complex(ArrayXXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_18( array_complex(ArrayXXcd(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))));
-  }
-
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_19( float_pow_test() );
-    CALL_SUBTEST_20( int_pow_test() );
-    CALL_SUBTEST_21( mixed_pow_test() );
-    CALL_SUBTEST_22( signbit_tests() );
+EIGEN_DECLARE_TEST(array_cwise) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(array_generic(Array<float, 1, 1>()));
+    CALL_SUBTEST_2(array_generic(Array22f()));
+    CALL_SUBTEST_3(array_generic(Array44d()));
+    CALL_SUBTEST_4(array_generic(
+        ArrayXXcf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_7(array_generic(
+        ArrayXXf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_8(array_generic(
+        ArrayXXi(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_7(array_generic(Array<Index, Dynamic, Dynamic>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE),
+                                                                internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_8(signed_shift_test(
+        ArrayXXi(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_9(signed_shift_test(Array<Index, Dynamic, Dynamic>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE),
+                                                                    internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_10(array_generic(Array<uint32_t, Dynamic, Dynamic>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE),
+                                                                    internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_11(array_generic(Array<uint64_t, Dynamic, Dynamic>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE),
+                                                                    internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
   }
   for (int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_23( typed_logicals_test(ArrayX<int>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_24( typed_logicals_test(ArrayX<float>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_25( typed_logicals_test(ArrayX<double>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_26( typed_logicals_test(ArrayX<std::complex<float>>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
-    CALL_SUBTEST_27( typed_logicals_test(ArrayX<std::complex<double>>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_1(comparisons(Array<float, 1, 1>()));
+    CALL_SUBTEST_2(comparisons(Array22f()));
+    CALL_SUBTEST_3(comparisons(Array44d()));
+    CALL_SUBTEST_7(comparisons(
+        ArrayXXf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_8(comparisons(
+        ArrayXXi(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+  }
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_6(min_max(Array<float, 1, 1>()));
+    CALL_SUBTEST_7(min_max(Array22f()));
+    CALL_SUBTEST_8(min_max(Array44d()));
+    CALL_SUBTEST_9(min_max(
+        ArrayXXf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_10(min_max(
+        ArrayXXi(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+  }
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_11(array_real(Array<float, 1, 1>()));
+    CALL_SUBTEST_12(array_real(Array22f()));
+    CALL_SUBTEST_13(array_real(Array44d()));
+    CALL_SUBTEST_14(array_real(
+        ArrayXXf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_15(array_real(Array<Eigen::half, 32, 32>()));
+    CALL_SUBTEST_16(array_real(Array<Eigen::bfloat16, 32, 32>()));
+  }
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_17(array_complex(
+        ArrayXXcf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_18(array_complex(
+        ArrayXXcd(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
   }
 
   for (int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_28( (cast_test<1, 1>()) );
-    CALL_SUBTEST_29( (cast_test<3, 1>()) );
-    CALL_SUBTEST_30( (cast_test<5, 1>()) );
-    CALL_SUBTEST_31( (cast_test<9, 1>()) );
-    CALL_SUBTEST_32( (cast_test<17, 1>()) );
-    CALL_SUBTEST_33( (cast_test<Dynamic, 1>()) );
+    CALL_SUBTEST_19(float_pow_test());
+    CALL_SUBTEST_20(int_pow_test());
+    CALL_SUBTEST_21(mixed_pow_test());
+    CALL_SUBTEST_22(signbit_tests());
+  }
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_23(typed_logicals_test(ArrayX<int>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_24(typed_logicals_test(ArrayX<float>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_25(typed_logicals_test(ArrayX<double>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_26(typed_logicals_test(ArrayX<std::complex<float>>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_27(typed_logicals_test(ArrayX<std::complex<double>>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
   }
 
-  VERIFY((internal::is_same< internal::global_math_functions_filtering_base<int>::type, int >::value));
-  VERIFY((internal::is_same< internal::global_math_functions_filtering_base<float>::type, float >::value));
-  VERIFY((internal::is_same< internal::global_math_functions_filtering_base<Array2i>::type, ArrayBase<Array2i> >::value));
-  typedef CwiseUnaryOp<internal::scalar_abs_op<double>, ArrayXd > Xpr;
-  VERIFY((internal::is_same< internal::global_math_functions_filtering_base<Xpr>::type,
-                           ArrayBase<Xpr>
-                         >::value));
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_28((cast_test<1, 1>()));
+    CALL_SUBTEST_29((cast_test<3, 1>()));
+    CALL_SUBTEST_30((cast_test<5, 1>()));
+    CALL_SUBTEST_31((cast_test<9, 1>()));
+    CALL_SUBTEST_32((cast_test<17, 1>()));
+    CALL_SUBTEST_33((cast_test<Dynamic, 1>()));
+  }
+
+  VERIFY((internal::is_same<internal::global_math_functions_filtering_base<int>::type, int>::value));
+  VERIFY((internal::is_same<internal::global_math_functions_filtering_base<float>::type, float>::value));
+  VERIFY((internal::is_same<internal::global_math_functions_filtering_base<Array2i>::type, ArrayBase<Array2i>>::value));
+  typedef CwiseUnaryOp<internal::scalar_abs_op<double>, ArrayXd> Xpr;
+  VERIFY((internal::is_same<internal::global_math_functions_filtering_base<Xpr>::type, ArrayBase<Xpr>>::value));
 }
diff --git a/test/array_for_matrix.cpp b/test/array_for_matrix.cpp
index 34d7215..afe6894 100644
--- a/test/array_for_matrix.cpp
+++ b/test/array_for_matrix.cpp
@@ -9,29 +9,26 @@
 
 #include "main.h"
 
-template<typename MatrixType> void array_for_matrix(const MatrixType& m)
-{
+template <typename MatrixType>
+void array_for_matrix(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> ColVectorType;
-  typedef Matrix<Scalar, 1, MatrixType::ColsAtCompileTime> RowVectorType; 
+  typedef Matrix<Scalar, 1, MatrixType::ColsAtCompileTime> RowVectorType;
 
   Index rows = m.rows();
   Index cols = m.cols();
 
-  MatrixType m1 = MatrixType::Random(rows, cols),
-             m2 = MatrixType::Random(rows, cols),
-             m3(rows, cols);
+  MatrixType m1 = MatrixType::Random(rows, cols), m2 = MatrixType::Random(rows, cols), m3(rows, cols);
 
   ColVectorType cv1 = ColVectorType::Random(rows);
   RowVectorType rv1 = RowVectorType::Random(cols);
 
-  Scalar  s1 = internal::random<Scalar>(),
-          s2 = internal::random<Scalar>();
+  Scalar s1 = internal::random<Scalar>(), s2 = internal::random<Scalar>();
 
   // scalar addition
   VERIFY_IS_APPROX(m1.array() + s1, s1 + m1.array());
-  VERIFY_IS_APPROX((m1.array() + s1).matrix(), MatrixType::Constant(rows,cols,s1) + m1);
-  VERIFY_IS_APPROX(((m1*Scalar(2)).array() - s2).matrix(), (m1+m1) - MatrixType::Constant(rows,cols,s2) );
+  VERIFY_IS_APPROX((m1.array() + s1).matrix(), MatrixType::Constant(rows, cols, s1) + m1);
+  VERIFY_IS_APPROX(((m1 * Scalar(2)).array() - s2).matrix(), (m1 + m1) - MatrixType::Constant(rows, cols, s2));
   m3 = m1;
   m3.array() += s2;
   VERIFY_IS_APPROX(m3, (m1.array() + s2).matrix());
@@ -42,9 +39,11 @@
   // reductions
   VERIFY_IS_MUCH_SMALLER_THAN(m1.colwise().sum().sum() - m1.sum(), m1.squaredNorm());
   VERIFY_IS_MUCH_SMALLER_THAN(m1.rowwise().sum().sum() - m1.sum(), m1.squaredNorm());
-  VERIFY_IS_MUCH_SMALLER_THAN(m1.colwise().sum() + m2.colwise().sum() - (m1+m2).colwise().sum(), (m1+m2).squaredNorm());
-  VERIFY_IS_MUCH_SMALLER_THAN(m1.rowwise().sum() - m2.rowwise().sum() - (m1-m2).rowwise().sum(), (m1-m2).squaredNorm());
-  VERIFY_IS_APPROX(m1.colwise().sum(), m1.colwise().redux(internal::scalar_sum_op<Scalar,Scalar>()));
+  VERIFY_IS_MUCH_SMALLER_THAN(m1.colwise().sum() + m2.colwise().sum() - (m1 + m2).colwise().sum(),
+                              (m1 + m2).squaredNorm());
+  VERIFY_IS_MUCH_SMALLER_THAN(m1.rowwise().sum() - m2.rowwise().sum() - (m1 - m2).rowwise().sum(),
+                              (m1 - m2).squaredNorm());
+  VERIFY_IS_APPROX(m1.colwise().sum(), m1.colwise().redux(internal::scalar_sum_op<Scalar, Scalar>()));
 
   // vector-wise ops
   m3 = m1;
@@ -57,37 +56,37 @@
   VERIFY_IS_APPROX(m3.rowwise() -= rv1, m1.rowwise() - rv1);
 
   // empty objects
-  VERIFY_IS_EQUAL((m1.template block<0,Dynamic>(0,0,0,cols).colwise().sum()), RowVectorType::Zero(cols));
-  VERIFY_IS_EQUAL((m1.template block<Dynamic,0>(0,0,rows,0).rowwise().sum()), ColVectorType::Zero(rows));
-  VERIFY_IS_EQUAL((m1.template block<0,Dynamic>(0,0,0,cols).colwise().prod()), RowVectorType::Ones(cols));
-  VERIFY_IS_EQUAL((m1.template block<Dynamic,0>(0,0,rows,0).rowwise().prod()), ColVectorType::Ones(rows));
+  VERIFY_IS_EQUAL((m1.template block<0, Dynamic>(0, 0, 0, cols).colwise().sum()), RowVectorType::Zero(cols));
+  VERIFY_IS_EQUAL((m1.template block<Dynamic, 0>(0, 0, rows, 0).rowwise().sum()), ColVectorType::Zero(rows));
+  VERIFY_IS_EQUAL((m1.template block<0, Dynamic>(0, 0, 0, cols).colwise().prod()), RowVectorType::Ones(cols));
+  VERIFY_IS_EQUAL((m1.template block<Dynamic, 0>(0, 0, rows, 0).rowwise().prod()), ColVectorType::Ones(rows));
 
-  VERIFY_IS_EQUAL(m1.block(0,0,0,cols).colwise().sum(), RowVectorType::Zero(cols));
-  VERIFY_IS_EQUAL(m1.block(0,0,rows,0).rowwise().sum(), ColVectorType::Zero(rows));
-  VERIFY_IS_EQUAL(m1.block(0,0,0,cols).colwise().prod(), RowVectorType::Ones(cols));
-  VERIFY_IS_EQUAL(m1.block(0,0,rows,0).rowwise().prod(), ColVectorType::Ones(rows));
+  VERIFY_IS_EQUAL(m1.block(0, 0, 0, cols).colwise().sum(), RowVectorType::Zero(cols));
+  VERIFY_IS_EQUAL(m1.block(0, 0, rows, 0).rowwise().sum(), ColVectorType::Zero(rows));
+  VERIFY_IS_EQUAL(m1.block(0, 0, 0, cols).colwise().prod(), RowVectorType::Ones(cols));
+  VERIFY_IS_EQUAL(m1.block(0, 0, rows, 0).rowwise().prod(), ColVectorType::Ones(rows));
 
   // verify the const accessors exist
   const Scalar& ref_m1 = m.matrix().array().coeffRef(0);
-  const Scalar& ref_m2 = m.matrix().array().coeffRef(0,0);
+  const Scalar& ref_m2 = m.matrix().array().coeffRef(0, 0);
   const Scalar& ref_a1 = m.array().matrix().coeffRef(0);
-  const Scalar& ref_a2 = m.array().matrix().coeffRef(0,0);
+  const Scalar& ref_a2 = m.array().matrix().coeffRef(0, 0);
   VERIFY(&ref_a1 == &ref_m1);
   VERIFY(&ref_a2 == &ref_m2);
 
   // Check write accessors:
-  m1.array().coeffRef(0,0) = 1;
-  VERIFY_IS_APPROX(m1(0,0),Scalar(1));
-  m1.array()(0,0) = 2;
-  VERIFY_IS_APPROX(m1(0,0),Scalar(2));
-  m1.array().matrix().coeffRef(0,0) = 3;
-  VERIFY_IS_APPROX(m1(0,0),Scalar(3));
-  m1.array().matrix()(0,0) = 4;
-  VERIFY_IS_APPROX(m1(0,0),Scalar(4));
+  m1.array().coeffRef(0, 0) = 1;
+  VERIFY_IS_APPROX(m1(0, 0), Scalar(1));
+  m1.array()(0, 0) = 2;
+  VERIFY_IS_APPROX(m1(0, 0), Scalar(2));
+  m1.array().matrix().coeffRef(0, 0) = 3;
+  VERIFY_IS_APPROX(m1(0, 0), Scalar(3));
+  m1.array().matrix()(0, 0) = 4;
+  VERIFY_IS_APPROX(m1(0, 0), Scalar(4));
 }
 
-template<typename MatrixType> void comparisons(const MatrixType& m)
-{
+template <typename MatrixType>
+void comparisons(const MatrixType& m) {
   using std::abs;
   typedef typename MatrixType::Scalar Scalar;
   typedef typename NumTraits<Scalar>::Real RealScalar;
@@ -95,88 +94,81 @@
   Index rows = m.rows();
   Index cols = m.cols();
 
-  Index r = internal::random<Index>(0, rows-1),
-        c = internal::random<Index>(0, cols-1);
+  Index r = internal::random<Index>(0, rows - 1), c = internal::random<Index>(0, cols - 1);
 
-  MatrixType m1 = MatrixType::Random(rows, cols),
-             m2 = MatrixType::Random(rows, cols),
-             m3(rows, cols);
+  MatrixType m1 = MatrixType::Random(rows, cols), m2 = MatrixType::Random(rows, cols), m3(rows, cols);
 
   VERIFY(((m1.array() + Scalar(1)) > m1.array()).all());
   VERIFY(((m1.array() - Scalar(1)) < m1.array()).all());
-  if (rows*cols>1)
-  {
+  if (rows * cols > 1) {
     m3 = m1;
-    m3(r,c) += 1;
-    VERIFY(! (m1.array() < m3.array()).all() );
-    VERIFY(! (m1.array() > m3.array()).all() );
+    m3(r, c) += 1;
+    VERIFY(!(m1.array() < m3.array()).all());
+    VERIFY(!(m1.array() > m3.array()).all());
   }
 
   // comparisons to scalar
-  VERIFY( (m1.array() != (m1(r,c)+1) ).any() );
-  VERIFY( (m1.array() > (m1(r,c)-1) ).any() );
-  VERIFY( (m1.array() < (m1(r,c)+1) ).any() );
-  VERIFY( (m1.array() == m1(r,c) ).any() );
-  VERIFY( m1.cwiseEqual(m1(r,c)).any() );
+  VERIFY((m1.array() != (m1(r, c) + 1)).any());
+  VERIFY((m1.array() > (m1(r, c) - 1)).any());
+  VERIFY((m1.array() < (m1(r, c) + 1)).any());
+  VERIFY((m1.array() == m1(r, c)).any());
+  VERIFY(m1.cwiseEqual(m1(r, c)).any());
 
   // test Select
-  VERIFY_IS_APPROX( (m1.array()<m2.array()).select(m1,m2), m1.cwiseMin(m2) );
-  VERIFY_IS_APPROX( (m1.array()>m2.array()).select(m1,m2), m1.cwiseMax(m2) );
-  Scalar mid = (m1.cwiseAbs().minCoeff() + m1.cwiseAbs().maxCoeff())/Scalar(2);
-  for (int j=0; j<cols; ++j)
-  for (int i=0; i<rows; ++i)
-    m3(i,j) = abs(m1(i,j))<mid ? 0 : m1(i,j);
-  VERIFY_IS_APPROX( (m1.array().abs()<MatrixType::Constant(rows,cols,mid).array())
-                        .select(MatrixType::Zero(rows,cols),m1), m3);
+  VERIFY_IS_APPROX((m1.array() < m2.array()).select(m1, m2), m1.cwiseMin(m2));
+  VERIFY_IS_APPROX((m1.array() > m2.array()).select(m1, m2), m1.cwiseMax(m2));
+  Scalar mid = (m1.cwiseAbs().minCoeff() + m1.cwiseAbs().maxCoeff()) / Scalar(2);
+  for (int j = 0; j < cols; ++j)
+    for (int i = 0; i < rows; ++i) m3(i, j) = abs(m1(i, j)) < mid ? 0 : m1(i, j);
+  VERIFY_IS_APPROX(
+      (m1.array().abs() < MatrixType::Constant(rows, cols, mid).array()).select(MatrixType::Zero(rows, cols), m1), m3);
   // shorter versions:
-  VERIFY_IS_APPROX( (m1.array().abs()<MatrixType::Constant(rows,cols,mid).array())
-                        .select(0,m1), m3);
-  VERIFY_IS_APPROX( (m1.array().abs()>=MatrixType::Constant(rows,cols,mid).array())
-                        .select(m1,0), m3);
+  VERIFY_IS_APPROX((m1.array().abs() < MatrixType::Constant(rows, cols, mid).array()).select(0, m1), m3);
+  VERIFY_IS_APPROX((m1.array().abs() >= MatrixType::Constant(rows, cols, mid).array()).select(m1, 0), m3);
   // even shorter version:
-  VERIFY_IS_APPROX( (m1.array().abs()<mid).select(0,m1), m3);
+  VERIFY_IS_APPROX((m1.array().abs() < mid).select(0, m1), m3);
 
   // count
-  VERIFY(((m1.array().abs()+1)>RealScalar(0.1)).count() == rows*cols);
+  VERIFY(((m1.array().abs() + 1) > RealScalar(0.1)).count() == rows * cols);
 
   // and/or
-  VERIFY( ((m1.array()<RealScalar(0)).matrix() && (m1.array()>RealScalar(0)).matrix()).count() == 0);
-  VERIFY( ((m1.array()<RealScalar(0)).matrix() || (m1.array()>=RealScalar(0)).matrix()).count() == rows*cols);
+  VERIFY(((m1.array() < RealScalar(0)).matrix() && (m1.array() > RealScalar(0)).matrix()).count() == 0);
+  VERIFY(((m1.array() < RealScalar(0)).matrix() || (m1.array() >= RealScalar(0)).matrix()).count() == rows * cols);
   RealScalar a = m1.cwiseAbs().mean();
-  VERIFY( ((m1.array()<-a).matrix() || (m1.array()>a).matrix()).count() == (m1.cwiseAbs().array()>a).count());
+  VERIFY(((m1.array() < -a).matrix() || (m1.array() > a).matrix()).count() == (m1.cwiseAbs().array() > a).count());
 
   typedef Matrix<Index, Dynamic, 1> VectorOfIndices;
 
   // TODO allows colwise/rowwise for array
-  VERIFY_IS_APPROX(((m1.array().abs()+1)>RealScalar(0.1)).matrix().colwise().count(), VectorOfIndices::Constant(cols,rows).transpose());
-  VERIFY_IS_APPROX(((m1.array().abs()+1)>RealScalar(0.1)).matrix().rowwise().count(), VectorOfIndices::Constant(rows, cols));
+  VERIFY_IS_APPROX(((m1.array().abs() + 1) > RealScalar(0.1)).matrix().colwise().count(),
+                   VectorOfIndices::Constant(cols, rows).transpose());
+  VERIFY_IS_APPROX(((m1.array().abs() + 1) > RealScalar(0.1)).matrix().rowwise().count(),
+                   VectorOfIndices::Constant(rows, cols));
 }
 
-template<typename VectorType> void lpNorm(const VectorType& v)
-{
+template <typename VectorType>
+void lpNorm(const VectorType& v) {
   using std::sqrt;
   typedef typename VectorType::RealScalar RealScalar;
   VectorType u = VectorType::Random(v.size());
 
-  if(v.size()==0)
-  {
+  if (v.size() == 0) {
     VERIFY_IS_APPROX(u.template lpNorm<Infinity>(), RealScalar(0));
     VERIFY_IS_APPROX(u.template lpNorm<1>(), RealScalar(0));
     VERIFY_IS_APPROX(u.template lpNorm<2>(), RealScalar(0));
     VERIFY_IS_APPROX(u.template lpNorm<5>(), RealScalar(0));
-  }
-  else
-  {
+  } else {
     VERIFY_IS_APPROX(u.template lpNorm<Infinity>(), u.cwiseAbs().maxCoeff());
   }
 
   VERIFY_IS_APPROX(u.template lpNorm<1>(), u.cwiseAbs().sum());
   VERIFY_IS_APPROX(u.template lpNorm<2>(), sqrt(u.array().abs().square().sum()));
-  VERIFY_IS_APPROX(numext::pow(u.template lpNorm<5>(), typename VectorType::RealScalar(5)), u.array().abs().pow(5).sum());
+  VERIFY_IS_APPROX(numext::pow(u.template lpNorm<5>(), typename VectorType::RealScalar(5)),
+                   u.array().abs().pow(5).sum());
 }
 
-template<typename MatrixType> void cwise_min_max(const MatrixType& m)
-{
+template <typename MatrixType>
+void cwise_min_max(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
 
   Index rows = m.rows();
@@ -188,51 +180,54 @@
   Scalar maxM1 = m1.maxCoeff();
   Scalar minM1 = m1.minCoeff();
 
-  VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, minM1), m1.cwiseMin(MatrixType::Constant(rows,cols, minM1)));
-  VERIFY_IS_APPROX(m1, m1.cwiseMin(MatrixType::Constant(rows,cols, maxM1)));
+  VERIFY_IS_APPROX(MatrixType::Constant(rows, cols, minM1), m1.cwiseMin(MatrixType::Constant(rows, cols, minM1)));
+  VERIFY_IS_APPROX(m1, m1.cwiseMin(MatrixType::Constant(rows, cols, maxM1)));
 
-  VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, maxM1), m1.cwiseMax(MatrixType::Constant(rows,cols, maxM1)));
-  VERIFY_IS_APPROX(m1, m1.cwiseMax(MatrixType::Constant(rows,cols, minM1)));
+  VERIFY_IS_APPROX(MatrixType::Constant(rows, cols, maxM1), m1.cwiseMax(MatrixType::Constant(rows, cols, maxM1)));
+  VERIFY_IS_APPROX(m1, m1.cwiseMax(MatrixType::Constant(rows, cols, minM1)));
 
   // min/max with scalar input
-  VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, minM1), m1.cwiseMin( minM1));
+  VERIFY_IS_APPROX(MatrixType::Constant(rows, cols, minM1), m1.cwiseMin(minM1));
   VERIFY_IS_APPROX(m1, m1.cwiseMin(maxM1));
   VERIFY_IS_APPROX(-m1, (-m1).cwiseMin(-minM1));
-  VERIFY_IS_APPROX(-m1.array(), ((-m1).array().min)( -minM1));
+  VERIFY_IS_APPROX(-m1.array(), ((-m1).array().min)(-minM1));
 
-  VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, maxM1), m1.cwiseMax( maxM1));
+  VERIFY_IS_APPROX(MatrixType::Constant(rows, cols, maxM1), m1.cwiseMax(maxM1));
   VERIFY_IS_APPROX(m1, m1.cwiseMax(minM1));
   VERIFY_IS_APPROX(-m1, (-m1).cwiseMax(-maxM1));
   VERIFY_IS_APPROX(-m1.array(), ((-m1).array().max)(-maxM1));
 
-  VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, minM1).array(), (m1.array().min)( minM1));
-  VERIFY_IS_APPROX(m1.array(), (m1.array().min)( maxM1));
+  VERIFY_IS_APPROX(MatrixType::Constant(rows, cols, minM1).array(), (m1.array().min)(minM1));
+  VERIFY_IS_APPROX(m1.array(), (m1.array().min)(maxM1));
 
-  VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, maxM1).array(), (m1.array().max)( maxM1));
-  VERIFY_IS_APPROX(m1.array(), (m1.array().max)( minM1));
+  VERIFY_IS_APPROX(MatrixType::Constant(rows, cols, maxM1).array(), (m1.array().max)(maxM1));
+  VERIFY_IS_APPROX(m1.array(), (m1.array().max)(minM1));
 
   // Test NaN propagation for min/max.
   if (!NumTraits<Scalar>::IsInteger) {
-    m1(0,0) = NumTraits<Scalar>::quiet_NaN();
+    m1(0, 0) = NumTraits<Scalar>::quiet_NaN();
     // Elementwise.
-    VERIFY((numext::isnan)(m1.template cwiseMax<PropagateNaN>(MatrixType::Constant(rows,cols, Scalar(1)))(0,0)));
-    VERIFY((numext::isnan)(m1.template cwiseMin<PropagateNaN>(MatrixType::Constant(rows,cols, Scalar(1)))(0,0)));
-    VERIFY(!(numext::isnan)(m1.template cwiseMax<PropagateNumbers>(MatrixType::Constant(rows,cols, Scalar(1)))(0,0)));
-    VERIFY(!(numext::isnan)(m1.template cwiseMin<PropagateNumbers>(MatrixType::Constant(rows,cols, Scalar(1)))(0,0)));
-    VERIFY((numext::isnan)(m1.template cwiseMax<PropagateNaN>(Scalar(1))(0,0)));
-    VERIFY((numext::isnan)(m1.template cwiseMin<PropagateNaN>(Scalar(1))(0,0)));
-    VERIFY(!(numext::isnan)(m1.template cwiseMax<PropagateNumbers>(Scalar(1))(0,0)));
-    VERIFY(!(numext::isnan)(m1.template cwiseMin<PropagateNumbers>(Scalar(1))(0,0)));
+    VERIFY((numext::isnan)(m1.template cwiseMax<PropagateNaN>(MatrixType::Constant(rows, cols, Scalar(1)))(0, 0)));
+    VERIFY((numext::isnan)(m1.template cwiseMin<PropagateNaN>(MatrixType::Constant(rows, cols, Scalar(1)))(0, 0)));
+    VERIFY(!(numext::isnan)(m1.template cwiseMax<PropagateNumbers>(MatrixType::Constant(rows, cols, Scalar(1)))(0, 0)));
+    VERIFY(!(numext::isnan)(m1.template cwiseMin<PropagateNumbers>(MatrixType::Constant(rows, cols, Scalar(1)))(0, 0)));
+    VERIFY((numext::isnan)(m1.template cwiseMax<PropagateNaN>(Scalar(1))(0, 0)));
+    VERIFY((numext::isnan)(m1.template cwiseMin<PropagateNaN>(Scalar(1))(0, 0)));
+    VERIFY(!(numext::isnan)(m1.template cwiseMax<PropagateNumbers>(Scalar(1))(0, 0)));
+    VERIFY(!(numext::isnan)(m1.template cwiseMin<PropagateNumbers>(Scalar(1))(0, 0)));
 
-
-    VERIFY((numext::isnan)(m1.array().template max<PropagateNaN>(MatrixType::Constant(rows,cols, Scalar(1)).array())(0,0)));
-    VERIFY((numext::isnan)(m1.array().template min<PropagateNaN>(MatrixType::Constant(rows,cols, Scalar(1)).array())(0,0)));
-    VERIFY(!(numext::isnan)(m1.array().template max<PropagateNumbers>(MatrixType::Constant(rows,cols, Scalar(1)).array())(0,0)));
-    VERIFY(!(numext::isnan)(m1.array().template min<PropagateNumbers>(MatrixType::Constant(rows,cols, Scalar(1)).array())(0,0)));
-    VERIFY((numext::isnan)(m1.array().template max<PropagateNaN>(Scalar(1))(0,0)));
-    VERIFY((numext::isnan)(m1.array().template min<PropagateNaN>(Scalar(1))(0,0)));
-    VERIFY(!(numext::isnan)(m1.array().template max<PropagateNumbers>(Scalar(1))(0,0)));
-    VERIFY(!(numext::isnan)(m1.array().template min<PropagateNumbers>(Scalar(1))(0,0)));
+    VERIFY((numext::isnan)(
+        m1.array().template max<PropagateNaN>(MatrixType::Constant(rows, cols, Scalar(1)).array())(0, 0)));
+    VERIFY((numext::isnan)(
+        m1.array().template min<PropagateNaN>(MatrixType::Constant(rows, cols, Scalar(1)).array())(0, 0)));
+    VERIFY(!(numext::isnan)(
+        m1.array().template max<PropagateNumbers>(MatrixType::Constant(rows, cols, Scalar(1)).array())(0, 0)));
+    VERIFY(!(numext::isnan)(
+        m1.array().template min<PropagateNumbers>(MatrixType::Constant(rows, cols, Scalar(1)).array())(0, 0)));
+    VERIFY((numext::isnan)(m1.array().template max<PropagateNaN>(Scalar(1))(0, 0)));
+    VERIFY((numext::isnan)(m1.array().template min<PropagateNaN>(Scalar(1))(0, 0)));
+    VERIFY(!(numext::isnan)(m1.array().template max<PropagateNumbers>(Scalar(1))(0, 0)));
+    VERIFY(!(numext::isnan)(m1.array().template min<PropagateNumbers>(Scalar(1))(0, 0)));
 
     // Reductions.
     VERIFY((numext::isnan)(m1.template maxCoeff<PropagateNaN>()));
@@ -247,42 +242,40 @@
   }
 }
 
-template<typename MatrixTraits> void resize(const MatrixTraits& t)
-{
+template <typename MatrixTraits>
+void resize(const MatrixTraits& t) {
   typedef typename MatrixTraits::Scalar Scalar;
-  typedef Matrix<Scalar,Dynamic,Dynamic> MatrixType;
-  typedef Array<Scalar,Dynamic,Dynamic> Array2DType;
-  typedef Matrix<Scalar,Dynamic,1> VectorType;
-  typedef Array<Scalar,Dynamic,1> Array1DType;
+  typedef Matrix<Scalar, Dynamic, Dynamic> MatrixType;
+  typedef Array<Scalar, Dynamic, Dynamic> Array2DType;
+  typedef Matrix<Scalar, Dynamic, 1> VectorType;
+  typedef Array<Scalar, Dynamic, 1> Array1DType;
 
   Index rows = t.rows(), cols = t.cols();
 
-  MatrixType m(rows,cols);
+  MatrixType m(rows, cols);
   VectorType v(rows);
-  Array2DType a2(rows,cols);
+  Array2DType a2(rows, cols);
   Array1DType a1(rows);
 
-  m.array().resize(rows+1,cols+1);
-  VERIFY(m.rows()==rows+1 && m.cols()==cols+1);
-  a2.matrix().resize(rows+1,cols+1);
-  VERIFY(a2.rows()==rows+1 && a2.cols()==cols+1);
+  m.array().resize(rows + 1, cols + 1);
+  VERIFY(m.rows() == rows + 1 && m.cols() == cols + 1);
+  a2.matrix().resize(rows + 1, cols + 1);
+  VERIFY(a2.rows() == rows + 1 && a2.cols() == cols + 1);
   v.array().resize(cols);
-  VERIFY(v.size()==cols);
+  VERIFY(v.size() == cols);
   a1.matrix().resize(cols);
-  VERIFY(a1.size()==cols);
+  VERIFY(a1.size() == cols);
 }
 
-template<int>
-void regression_bug_654()
-{
+template <int>
+void regression_bug_654() {
   ArrayXf a = RowVectorXf(3);
-  VectorXf v = Array<float,1,Dynamic>(3);
+  VectorXf v = Array<float, 1, Dynamic>(3);
 }
 
 // Check propagation of LvalueBit through Array/Matrix-Wrapper
-template<int>
-void regrrssion_bug_1410()
-{
+template <int>
+void regrrssion_bug_1410() {
   const Matrix4i M;
   const Array4i A;
   ArrayWrapper<const Matrix4i> MA = M.array();
@@ -290,52 +283,61 @@
   MatrixWrapper<const Array4i> AM = A.matrix();
   AM.row(0);
 
-  VERIFY((internal::traits<ArrayWrapper<const Matrix4i> >::Flags&LvalueBit)==0);
-  VERIFY((internal::traits<MatrixWrapper<const Array4i> >::Flags&LvalueBit)==0);
+  VERIFY((internal::traits<ArrayWrapper<const Matrix4i> >::Flags & LvalueBit) == 0);
+  VERIFY((internal::traits<MatrixWrapper<const Array4i> >::Flags & LvalueBit) == 0);
 
-  VERIFY((internal::traits<ArrayWrapper<Matrix4i> >::Flags&LvalueBit)==LvalueBit);
-  VERIFY((internal::traits<MatrixWrapper<Array4i> >::Flags&LvalueBit)==LvalueBit);
+  VERIFY((internal::traits<ArrayWrapper<Matrix4i> >::Flags & LvalueBit) == LvalueBit);
+  VERIFY((internal::traits<MatrixWrapper<Array4i> >::Flags & LvalueBit) == LvalueBit);
 }
 
-EIGEN_DECLARE_TEST(array_for_matrix)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( array_for_matrix(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( array_for_matrix(Matrix2f()) );
-    CALL_SUBTEST_3( array_for_matrix(Matrix4d()) );
-    CALL_SUBTEST_4( array_for_matrix(MatrixXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_5( array_for_matrix(MatrixXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_6( array_for_matrix(MatrixXi(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
+EIGEN_DECLARE_TEST(array_for_matrix) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(array_for_matrix(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(array_for_matrix(Matrix2f()));
+    CALL_SUBTEST_3(array_for_matrix(Matrix4d()));
+    CALL_SUBTEST_4(array_for_matrix(
+        MatrixXcf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_5(array_for_matrix(
+        MatrixXf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_6(array_for_matrix(
+        MatrixXi(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
   }
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( comparisons(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( comparisons(Matrix2f()) );
-    CALL_SUBTEST_3( comparisons(Matrix4d()) );
-    CALL_SUBTEST_5( comparisons(MatrixXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_6( comparisons(MatrixXi(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(comparisons(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(comparisons(Matrix2f()));
+    CALL_SUBTEST_3(comparisons(Matrix4d()));
+    CALL_SUBTEST_5(comparisons(
+        MatrixXf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_6(comparisons(
+        MatrixXi(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
   }
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( cwise_min_max(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( cwise_min_max(Matrix2f()) );
-    CALL_SUBTEST_3( cwise_min_max(Matrix4d()) );
-    CALL_SUBTEST_5( cwise_min_max(MatrixXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_6( cwise_min_max(MatrixXi(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(cwise_min_max(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(cwise_min_max(Matrix2f()));
+    CALL_SUBTEST_3(cwise_min_max(Matrix4d()));
+    CALL_SUBTEST_5(cwise_min_max(
+        MatrixXf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_6(cwise_min_max(
+        MatrixXi(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
   }
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( lpNorm(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( lpNorm(Vector2f()) );
-    CALL_SUBTEST_7( lpNorm(Vector3d()) );
-    CALL_SUBTEST_8( lpNorm(Vector4f()) );
-    CALL_SUBTEST_5( lpNorm(VectorXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_4( lpNorm(VectorXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(lpNorm(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(lpNorm(Vector2f()));
+    CALL_SUBTEST_7(lpNorm(Vector3d()));
+    CALL_SUBTEST_8(lpNorm(Vector4f()));
+    CALL_SUBTEST_5(lpNorm(VectorXf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_4(lpNorm(VectorXcf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
   }
-  CALL_SUBTEST_5( lpNorm(VectorXf(0)) );
-  CALL_SUBTEST_4( lpNorm(VectorXcf(0)) );
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_4( resize(MatrixXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_5( resize(MatrixXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_6( resize(MatrixXi(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
+  CALL_SUBTEST_5(lpNorm(VectorXf(0)));
+  CALL_SUBTEST_4(lpNorm(VectorXcf(0)));
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_4(resize(
+        MatrixXcf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_5(
+        resize(MatrixXf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_6(
+        resize(MatrixXi(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
   }
-  CALL_SUBTEST_6( regression_bug_654<0>() );
-  CALL_SUBTEST_6( regrrssion_bug_1410<0>() );
+  CALL_SUBTEST_6(regression_bug_654<0>());
+  CALL_SUBTEST_6(regrrssion_bug_1410<0>());
 }
diff --git a/test/array_of_string.cpp b/test/array_of_string.cpp
index 23e5152..f92603f 100644
--- a/test/array_of_string.cpp
+++ b/test/array_of_string.cpp
@@ -9,9 +9,8 @@
 
 #include "main.h"
 
-EIGEN_DECLARE_TEST(array_of_string)
-{
-  typedef Array<std::string,1,Dynamic> ArrayXs;
+EIGEN_DECLARE_TEST(array_of_string) {
+  typedef Array<std::string, 1, Dynamic> ArrayXs;
   ArrayXs a1(3), a2(3), a3(3), a3ref(3);
   a1 << "one", "two", "three";
   a2 << "1", "2", "3";
@@ -20,13 +19,13 @@
   s1 << a1;
   VERIFY_IS_EQUAL(s1.str(), std::string("  one    two  three"));
   a3 = a1 + std::string(" (") + a2 + std::string(")");
-  VERIFY((a3==a3ref).all());
+  VERIFY((a3 == a3ref).all());
 
   a3 = a1;
   a3 += std::string(" (") + a2 + std::string(")");
-  VERIFY((a3==a3ref).all());
+  VERIFY((a3 == a3ref).all());
 
   a1.swap(a3);
-  VERIFY((a1==a3ref).all());
-  VERIFY((a3!=a3ref).all());
+  VERIFY((a1 == a3ref).all());
+  VERIFY((a3 != a3ref).all());
 }
diff --git a/test/array_replicate.cpp b/test/array_replicate.cpp
index 057c3c7..f5c9246 100644
--- a/test/array_replicate.cpp
+++ b/test/array_replicate.cpp
@@ -9,8 +9,8 @@
 
 #include "main.h"
 
-template<typename MatrixType> void replicate(const MatrixType& m)
-{
+template <typename MatrixType>
+void replicate(const MatrixType& m) {
   /* this test covers the following files:
      Replicate.cpp
   */
@@ -22,60 +22,52 @@
   Index rows = m.rows();
   Index cols = m.cols();
 
-  MatrixType m1 = MatrixType::Random(rows, cols),
-             m2 = MatrixType::Random(rows, cols);
+  MatrixType m1 = MatrixType::Random(rows, cols), m2 = MatrixType::Random(rows, cols);
 
   VectorType v1 = VectorType::Random(rows);
 
   MatrixX x1, x2;
   VectorX vx1;
 
-  int  f1 = internal::random<int>(1,10),
-       f2 = internal::random<int>(1,10);
+  int f1 = internal::random<int>(1, 10), f2 = internal::random<int>(1, 10);
 
-  x1.resize(rows*f1,cols*f2);
-  for(int j=0; j<f2; j++)
-  for(int i=0; i<f1; i++)
-    x1.block(i*rows,j*cols,rows,cols) = m1;
-  VERIFY_IS_APPROX(x1, m1.replicate(f1,f2));
+  x1.resize(rows * f1, cols * f2);
+  for (int j = 0; j < f2; j++)
+    for (int i = 0; i < f1; i++) x1.block(i * rows, j * cols, rows, cols) = m1;
+  VERIFY_IS_APPROX(x1, m1.replicate(f1, f2));
 
-  x2.resize(2*rows,3*cols);
-  x2 << m2, m2, m2,
-        m2, m2, m2;
-  VERIFY_IS_APPROX(x2, (m2.template replicate<2,3>()));
-  
-  x2.resize(rows,3*cols);
+  x2.resize(2 * rows, 3 * cols);
+  x2 << m2, m2, m2, m2, m2, m2;
+  VERIFY_IS_APPROX(x2, (m2.template replicate<2, 3>()));
+
+  x2.resize(rows, 3 * cols);
   x2 << m2, m2, m2;
-  VERIFY_IS_APPROX(x2, (m2.template replicate<1,3>()));
-  
-  vx1.resize(3*rows,cols);
-  vx1 << m2, m2, m2;
-  VERIFY_IS_APPROX(vx1+vx1, vx1+(m2.template replicate<3,1>()));
-  
-  vx1=m2+(m2.colwise().replicate(1));
-  
-  if(m2.cols()==1)
-    VERIFY_IS_APPROX(m2.coeff(0), (m2.template replicate<3,1>().coeff(m2.rows())));
+  VERIFY_IS_APPROX(x2, (m2.template replicate<1, 3>()));
 
-  x2.resize(rows,f1);
-  for (int j=0; j<f1; ++j)
-    x2.col(j) = v1;
+  vx1.resize(3 * rows, cols);
+  vx1 << m2, m2, m2;
+  VERIFY_IS_APPROX(vx1 + vx1, vx1 + (m2.template replicate<3, 1>()));
+
+  vx1 = m2 + (m2.colwise().replicate(1));
+
+  if (m2.cols() == 1) VERIFY_IS_APPROX(m2.coeff(0), (m2.template replicate<3, 1>().coeff(m2.rows())));
+
+  x2.resize(rows, f1);
+  for (int j = 0; j < f1; ++j) x2.col(j) = v1;
   VERIFY_IS_APPROX(x2, v1.rowwise().replicate(f1));
 
-  vx1.resize(rows*f2);
-  for (int j=0; j<f2; ++j)
-    vx1.segment(j*rows,rows) = v1;
+  vx1.resize(rows * f2);
+  for (int j = 0; j < f2; ++j) vx1.segment(j * rows, rows) = v1;
   VERIFY_IS_APPROX(vx1, v1.colwise().replicate(f2));
 }
 
-EIGEN_DECLARE_TEST(array_replicate)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( replicate(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( replicate(Vector2f()) );
-    CALL_SUBTEST_3( replicate(Vector3d()) );
-    CALL_SUBTEST_4( replicate(Vector4f()) );
-    CALL_SUBTEST_5( replicate(VectorXf(16)) );
-    CALL_SUBTEST_6( replicate(VectorXcd(10)) );
+EIGEN_DECLARE_TEST(array_replicate) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(replicate(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(replicate(Vector2f()));
+    CALL_SUBTEST_3(replicate(Vector3d()));
+    CALL_SUBTEST_4(replicate(Vector4f()));
+    CALL_SUBTEST_5(replicate(VectorXf(16)));
+    CALL_SUBTEST_6(replicate(VectorXcd(10)));
   }
 }
diff --git a/test/array_reverse.cpp b/test/array_reverse.cpp
index c77528a..3120c3c 100644
--- a/test/array_reverse.cpp
+++ b/test/array_reverse.cpp
@@ -13,8 +13,8 @@
 
 using namespace std;
 
-template<typename MatrixType> void reverse(const MatrixType& m)
-{
+template <typename MatrixType>
+void reverse(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
 
@@ -28,93 +28,92 @@
 
   MatrixType m1_r = m1.reverse();
   // Verify that MatrixBase::reverse() works
-  for ( int i = 0; i < rows; i++ ) {
-    for ( int j = 0; j < cols; j++ ) {
+  for (int i = 0; i < rows; i++) {
+    for (int j = 0; j < cols; j++) {
       VERIFY_IS_APPROX(m1_r(i, j), m1(rows - 1 - i, cols - 1 - j));
     }
   }
 
   Reverse<MatrixType> m1_rd(m1);
   // Verify that a Reverse default (in both directions) of an expression works
-  for ( int i = 0; i < rows; i++ ) {
-    for ( int j = 0; j < cols; j++ ) {
+  for (int i = 0; i < rows; i++) {
+    for (int j = 0; j < cols; j++) {
       VERIFY_IS_APPROX(m1_rd(i, j), m1(rows - 1 - i, cols - 1 - j));
     }
   }
 
   Reverse<MatrixType, BothDirections> m1_rb(m1);
   // Verify that a Reverse in both directions of an expression works
-  for ( int i = 0; i < rows; i++ ) {
-    for ( int j = 0; j < cols; j++ ) {
+  for (int i = 0; i < rows; i++) {
+    for (int j = 0; j < cols; j++) {
       VERIFY_IS_APPROX(m1_rb(i, j), m1(rows - 1 - i, cols - 1 - j));
     }
   }
 
   Reverse<MatrixType, Vertical> m1_rv(m1);
   // Verify that a Reverse in the vertical directions of an expression works
-  for ( int i = 0; i < rows; i++ ) {
-    for ( int j = 0; j < cols; j++ ) {
+  for (int i = 0; i < rows; i++) {
+    for (int j = 0; j < cols; j++) {
       VERIFY_IS_APPROX(m1_rv(i, j), m1(rows - 1 - i, j));
     }
   }
 
   Reverse<MatrixType, Horizontal> m1_rh(m1);
   // Verify that a Reverse in the horizontal directions of an expression works
-  for ( int i = 0; i < rows; i++ ) {
-    for ( int j = 0; j < cols; j++ ) {
+  for (int i = 0; i < rows; i++) {
+    for (int j = 0; j < cols; j++) {
       VERIFY_IS_APPROX(m1_rh(i, j), m1(i, cols - 1 - j));
     }
   }
 
   VectorType v1_r = v1.reverse();
   // Verify that a VectorType::reverse() of an expression works
-  for ( int i = 0; i < rows; i++ ) {
+  for (int i = 0; i < rows; i++) {
     VERIFY_IS_APPROX(v1_r(i), v1(rows - 1 - i));
   }
 
   MatrixType m1_cr = m1.colwise().reverse();
   // Verify that PartialRedux::reverse() works (for colwise())
-  for ( int i = 0; i < rows; i++ ) {
-    for ( int j = 0; j < cols; j++ ) {
+  for (int i = 0; i < rows; i++) {
+    for (int j = 0; j < cols; j++) {
       VERIFY_IS_APPROX(m1_cr(i, j), m1(rows - 1 - i, j));
     }
   }
 
   MatrixType m1_rr = m1.rowwise().reverse();
   // Verify that PartialRedux::reverse() works (for rowwise())
-  for ( int i = 0; i < rows; i++ ) {
-    for ( int j = 0; j < cols; j++ ) {
+  for (int i = 0; i < rows; i++) {
+    for (int j = 0; j < cols; j++) {
       VERIFY_IS_APPROX(m1_rr(i, j), m1(i, cols - 1 - j));
     }
   }
 
   Scalar x = internal::random<Scalar>();
 
-  Index r = internal::random<Index>(0, rows-1),
-        c = internal::random<Index>(0, cols-1);
+  Index r = internal::random<Index>(0, rows - 1), c = internal::random<Index>(0, cols - 1);
 
   m1.reverse()(r, c) = x;
   VERIFY_IS_APPROX(x, m1(rows - 1 - r, cols - 1 - c));
-  
+
   m2 = m1;
   m2.reverseInPlace();
-  VERIFY_IS_APPROX(m2,m1.reverse().eval());
-  
+  VERIFY_IS_APPROX(m2, m1.reverse().eval());
+
   m2 = m1;
   m2.col(0).reverseInPlace();
-  VERIFY_IS_APPROX(m2.col(0),m1.col(0).reverse().eval());
-  
+  VERIFY_IS_APPROX(m2.col(0), m1.col(0).reverse().eval());
+
   m2 = m1;
   m2.row(0).reverseInPlace();
-  VERIFY_IS_APPROX(m2.row(0),m1.row(0).reverse().eval());
-  
+  VERIFY_IS_APPROX(m2.row(0), m1.row(0).reverse().eval());
+
   m2 = m1;
   m2.rowwise().reverseInPlace();
-  VERIFY_IS_APPROX(m2,m1.rowwise().reverse().eval());
-  
+  VERIFY_IS_APPROX(m2, m1.rowwise().reverse().eval());
+
   m2 = m1;
   m2.colwise().reverseInPlace();
-  VERIFY_IS_APPROX(m2,m1.colwise().reverse().eval());
+  VERIFY_IS_APPROX(m2, m1.colwise().reverse().eval());
 
   m1.colwise().reverse()(r, c) = x;
   VERIFY_IS_APPROX(x, m1(rows - 1 - r, c));
@@ -123,11 +122,12 @@
   VERIFY_IS_APPROX(x, m1(r, cols - 1 - c));
 }
 
-template<int>
-void array_reverse_extra()
-{
-  Vector4f x; x << 1, 2, 3, 4;
-  Vector4f y; y << 4, 3, 2, 1;
+template <int>
+void array_reverse_extra() {
+  Vector4f x;
+  x << 1, 2, 3, 4;
+  Vector4f y;
+  y << 4, 3, 2, 1;
   VERIFY(x.reverse()[1] == 3);
   VERIFY(x.reverse() == y);
 }
@@ -136,30 +136,24 @@
 // in clang 6/7 with -O2 and AVX or AVX512 enabled.
 // This simpler version ensure that the clang bug is not simply hidden
 // through mis-inlining of reverseInPlace or other minor changes.
-template<typename MatrixType>
-EIGEN_DONT_INLINE
-void bug1684_job1(MatrixType& m1, MatrixType& m2)
-{
+template <typename MatrixType>
+EIGEN_DONT_INLINE void bug1684_job1(MatrixType& m1, MatrixType& m2) {
   m2 = m1;
   m2.col(0).swap(m2.col(3));
   m2.col(1).swap(m2.col(2));
 }
 
-template<typename MatrixType>
-EIGEN_DONT_INLINE
-void bug1684_job2(MatrixType& m1, MatrixType& m2)
-{
-  m2 = m1; // load m1/m2 in AVX registers
-  m1.col(0) = m2.col(3); // perform 128 bits moves
+template <typename MatrixType>
+EIGEN_DONT_INLINE void bug1684_job2(MatrixType& m1, MatrixType& m2) {
+  m2 = m1;                // load m1/m2 in AVX registers
+  m1.col(0) = m2.col(3);  // perform 128 bits moves
   m1.col(1) = m2.col(2);
   m1.col(2) = m2.col(1);
   m1.col(3) = m2.col(0);
 }
 
-template<typename MatrixType>
-EIGEN_DONT_INLINE
-void bug1684_job3(MatrixType& m1, MatrixType& m2)
-{
+template <typename MatrixType>
+EIGEN_DONT_INLINE void bug1684_job3(MatrixType& m1, MatrixType& m2) {
   m2 = m1;
   Vector4f tmp;
   tmp = m2.col(0);
@@ -168,17 +162,15 @@
   tmp = m2.col(1);
   m2.col(1) = m2.col(2);
   m2.col(2) = tmp;
-  
 }
 
-template<int>
-void bug1684()
-{
+template <int>
+void bug1684() {
   Matrix4f m1 = Matrix4f::Random();
   Matrix4f m2 = Matrix4f::Random();
-  bug1684_job1(m1,m2);
+  bug1684_job1(m1, m2);
   VERIFY_IS_APPROX(m2, m1.rowwise().reverse().eval());
-  bug1684_job2(m1,m2);
+  bug1684_job2(m1, m2);
   VERIFY_IS_APPROX(m2, m1.rowwise().reverse().eval());
   // This one still fail after our swap's workaround,
   // but I expect users not to implement their own swap.
@@ -186,19 +178,22 @@
   // VERIFY_IS_APPROX(m2, m1.rowwise().reverse().eval());
 }
 
-EIGEN_DECLARE_TEST(array_reverse)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( reverse(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( reverse(Matrix2f()) );
-    CALL_SUBTEST_3( reverse(Matrix4f()) );
-    CALL_SUBTEST_4( reverse(Matrix4d()) );
-    CALL_SUBTEST_5( reverse(MatrixXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_6( reverse(MatrixXi(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_7( reverse(MatrixXcd(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_8( reverse(Matrix<float, 100, 100>()) );
-    CALL_SUBTEST_9( reverse(Matrix<float,Dynamic,Dynamic,RowMajor>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_3( bug1684<0>() );
+EIGEN_DECLARE_TEST(array_reverse) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(reverse(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(reverse(Matrix2f()));
+    CALL_SUBTEST_3(reverse(Matrix4f()));
+    CALL_SUBTEST_4(reverse(Matrix4d()));
+    CALL_SUBTEST_5(reverse(
+        MatrixXcf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_6(reverse(
+        MatrixXi(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_7(reverse(
+        MatrixXcd(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_8(reverse(Matrix<float, 100, 100>()));
+    CALL_SUBTEST_9(reverse(Matrix<float, Dynamic, Dynamic, RowMajor>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE),
+                                                                     internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_3(bug1684<0>());
   }
-  CALL_SUBTEST_3( array_reverse_extra<0>() );
+  CALL_SUBTEST_3(array_reverse_extra<0>());
 }
diff --git a/test/bandmatrix.cpp b/test/bandmatrix.cpp
index 66a1b0d..027eb06 100644
--- a/test/bandmatrix.cpp
+++ b/test/bandmatrix.cpp
@@ -9,63 +9,58 @@
 
 #include "main.h"
 
-template<typename MatrixType> void bandmatrix(const MatrixType& _m)
-{
+template <typename MatrixType>
+void bandmatrix(const MatrixType& _m) {
   typedef typename MatrixType::Scalar Scalar;
   typedef typename NumTraits<Scalar>::Real RealScalar;
-  typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrixType;
+  typedef Matrix<Scalar, Dynamic, Dynamic> DenseMatrixType;
 
   Index rows = _m.rows();
   Index cols = _m.cols();
   Index supers = _m.supers();
   Index subs = _m.subs();
 
-  MatrixType m(rows,cols,supers,subs);
+  MatrixType m(rows, cols, supers, subs);
 
-  DenseMatrixType dm1(rows,cols);
+  DenseMatrixType dm1(rows, cols);
   dm1.setZero();
 
   m.diagonal().setConstant(123);
   dm1.diagonal().setConstant(123);
-  for (int i=1; i<=m.supers();++i)
-  {
+  for (int i = 1; i <= m.supers(); ++i) {
     m.diagonal(i).setConstant(static_cast<RealScalar>(i));
     dm1.diagonal(i).setConstant(static_cast<RealScalar>(i));
   }
-  for (int i=1; i<=m.subs();++i)
-  {
+  for (int i = 1; i <= m.subs(); ++i) {
     m.diagonal(-i).setConstant(-static_cast<RealScalar>(i));
     dm1.diagonal(-i).setConstant(-static_cast<RealScalar>(i));
   }
-  //std::cerr << m.m_data << "\n\n" << m.toDense() << "\n\n" << dm1 << "\n\n\n\n";
-  VERIFY_IS_APPROX(dm1,m.toDenseMatrix());
+  // std::cerr << m.m_data << "\n\n" << m.toDense() << "\n\n" << dm1 << "\n\n\n\n";
+  VERIFY_IS_APPROX(dm1, m.toDenseMatrix());
 
-  for (int i=0; i<cols; ++i)
-  {
-    m.col(i).setConstant(static_cast<RealScalar>(i+1));
-    dm1.col(i).setConstant(static_cast<RealScalar>(i+1));
+  for (int i = 0; i < cols; ++i) {
+    m.col(i).setConstant(static_cast<RealScalar>(i + 1));
+    dm1.col(i).setConstant(static_cast<RealScalar>(i + 1));
   }
-  Index d = (std::min)(rows,cols);
-  Index a = std::max<Index>(0,cols-d-supers);
-  Index b = std::max<Index>(0,rows-d-subs);
-  if(a>0) dm1.block(0,d+supers,rows,a).setZero();
-  dm1.block(0,supers+1,cols-supers-1-a,cols-supers-1-a).template triangularView<Upper>().setZero();
-  dm1.block(subs+1,0,rows-subs-1-b,rows-subs-1-b).template triangularView<Lower>().setZero();
-  if(b>0) dm1.block(d+subs,0,b,cols).setZero();
-  //std::cerr << m.m_data << "\n\n" << m.toDense() << "\n\n" << dm1 << "\n\n";
-  VERIFY_IS_APPROX(dm1,m.toDenseMatrix());
-
+  Index d = (std::min)(rows, cols);
+  Index a = std::max<Index>(0, cols - d - supers);
+  Index b = std::max<Index>(0, rows - d - subs);
+  if (a > 0) dm1.block(0, d + supers, rows, a).setZero();
+  dm1.block(0, supers + 1, cols - supers - 1 - a, cols - supers - 1 - a).template triangularView<Upper>().setZero();
+  dm1.block(subs + 1, 0, rows - subs - 1 - b, rows - subs - 1 - b).template triangularView<Lower>().setZero();
+  if (b > 0) dm1.block(d + subs, 0, b, cols).setZero();
+  // std::cerr << m.m_data << "\n\n" << m.toDense() << "\n\n" << dm1 << "\n\n";
+  VERIFY_IS_APPROX(dm1, m.toDenseMatrix());
 }
 
 using Eigen::internal::BandMatrix;
 
-EIGEN_DECLARE_TEST(bandmatrix)
-{
-  for(int i = 0; i < 10*g_repeat ; i++) {
-    Index rows = internal::random<Index>(1,10);
-    Index cols = internal::random<Index>(1,10);
-    Index sups = internal::random<Index>(0,cols-1);
-    Index subs = internal::random<Index>(0,rows-1);
-    CALL_SUBTEST(bandmatrix(BandMatrix<float>(rows,cols,sups,subs)) );
+EIGEN_DECLARE_TEST(bandmatrix) {
+  for (int i = 0; i < 10 * g_repeat; i++) {
+    Index rows = internal::random<Index>(1, 10);
+    Index cols = internal::random<Index>(1, 10);
+    Index sups = internal::random<Index>(0, cols - 1);
+    Index subs = internal::random<Index>(0, rows - 1);
+    CALL_SUBTEST(bandmatrix(BandMatrix<float>(rows, cols, sups, subs)));
   }
 }
diff --git a/test/basicstuff.cpp b/test/basicstuff.cpp
index 05cd6ad..455cbfd 100644
--- a/test/basicstuff.cpp
+++ b/test/basicstuff.cpp
@@ -11,18 +11,18 @@
 #include "random_without_cast_overflow.h"
 
 template <typename MatrixType>
-std::enable_if_t<(MatrixType::RowsAtCompileTime==1 || MatrixType::ColsAtCompileTime==1),void>
-check_index(const MatrixType& m) {
+std::enable_if_t<(MatrixType::RowsAtCompileTime == 1 || MatrixType::ColsAtCompileTime == 1), void> check_index(
+    const MatrixType& m) {
   VERIFY_RAISES_ASSERT(m[0]);
-  VERIFY_RAISES_ASSERT((m+m)[0]);
+  VERIFY_RAISES_ASSERT((m + m)[0]);
 }
 
 template <typename MatrixType>
-std::enable_if_t<!(MatrixType::RowsAtCompileTime==1 || MatrixType::ColsAtCompileTime==1),void>
-check_index(const MatrixType& /*unused*/) {}
+std::enable_if_t<!(MatrixType::RowsAtCompileTime == 1 || MatrixType::ColsAtCompileTime == 1), void> check_index(
+    const MatrixType& /*unused*/) {}
 
-template<typename MatrixType> void basicStuff(const MatrixType& m)
-{
+template <typename MatrixType>
+void basicStuff(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> SquareMatrixType;
@@ -32,25 +32,21 @@
 
   // this test relies a lot on Random.h, and there's not much more that we can do
   // to test it, hence I consider that we will have tested Random.h
-  MatrixType m1 = MatrixType::Random(rows, cols),
-             m2 = MatrixType::Random(rows, cols),
-             m3(rows, cols),
+  MatrixType m1 = MatrixType::Random(rows, cols), m2 = MatrixType::Random(rows, cols), m3(rows, cols),
              mzero = MatrixType::Zero(rows, cols),
              square = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>::Random(rows, rows);
-  VectorType v1 = VectorType::Random(rows),
-             vzero = VectorType::Zero(rows);
-  SquareMatrixType sm1 = SquareMatrixType::Random(rows,rows), sm2(rows,rows);
+  VectorType v1 = VectorType::Random(rows), vzero = VectorType::Zero(rows);
+  SquareMatrixType sm1 = SquareMatrixType::Random(rows, rows), sm2(rows, rows);
 
   Scalar x = 0;
-  while(x == Scalar(0)) x = internal::random<Scalar>();
+  while (x == Scalar(0)) x = internal::random<Scalar>();
 
-  Index r = internal::random<Index>(0, rows-1),
-        c = internal::random<Index>(0, cols-1);
+  Index r = internal::random<Index>(0, rows - 1), c = internal::random<Index>(0, cols - 1);
 
-  m1.coeffRef(r,c) = x;
-  VERIFY_IS_APPROX(x, m1.coeff(r,c));
-  m1(r,c) = x;
-  VERIFY_IS_APPROX(x, m1(r,c));
+  m1.coeffRef(r, c) = x;
+  VERIFY_IS_APPROX(x, m1.coeff(r, c));
+  m1(r, c) = x;
+  VERIFY_IS_APPROX(x, m1(r, c));
   v1.coeffRef(r) = x;
   VERIFY_IS_APPROX(x, v1.coeff(r));
   v1(r) = x;
@@ -59,7 +55,7 @@
   VERIFY_IS_APPROX(x, v1[r]);
 
   // test fetching with various index types.
-  Index r1 = internal::random<Index>(0, numext::mini(Index(127),rows-1));
+  Index r1 = internal::random<Index>(0, numext::mini(Index(127), rows - 1));
   x = v1(static_cast<char>(r1));
   x = v1(static_cast<signed char>(r1));
   x = v1(static_cast<unsigned char>(r1));
@@ -69,22 +65,20 @@
   x = v1(static_cast<unsigned int>(r1));
   x = v1(static_cast<signed long>(r1));
   x = v1(static_cast<unsigned long>(r1));
-  if(sizeof(Index) >= sizeof(long long int))
-    x = v1(static_cast<long long int>(r1));
-  if(sizeof(Index) >= sizeof(unsigned long long int))
-    x = v1(static_cast<unsigned long long int>(r1));
+  if (sizeof(Index) >= sizeof(long long int)) x = v1(static_cast<long long int>(r1));
+  if (sizeof(Index) >= sizeof(unsigned long long int)) x = v1(static_cast<unsigned long long int>(r1));
 
-  VERIFY_IS_APPROX(               v1,    v1);
-  VERIFY_IS_NOT_APPROX(           v1,    2*v1);
-  VERIFY_IS_MUCH_SMALLER_THAN(    vzero, v1);
-  VERIFY_IS_MUCH_SMALLER_THAN(  vzero, v1.squaredNorm());
-  VERIFY_IS_NOT_MUCH_SMALLER_THAN(v1,    v1);
-  VERIFY_IS_APPROX(               vzero, v1-v1);
-  VERIFY_IS_APPROX(               m1,    m1);
-  VERIFY_IS_NOT_APPROX(           m1,    2*m1);
-  VERIFY_IS_MUCH_SMALLER_THAN(    mzero, m1);
-  VERIFY_IS_NOT_MUCH_SMALLER_THAN(m1,    m1);
-  VERIFY_IS_APPROX(               mzero, m1-m1);
+  VERIFY_IS_APPROX(v1, v1);
+  VERIFY_IS_NOT_APPROX(v1, 2 * v1);
+  VERIFY_IS_MUCH_SMALLER_THAN(vzero, v1);
+  VERIFY_IS_MUCH_SMALLER_THAN(vzero, v1.squaredNorm());
+  VERIFY_IS_NOT_MUCH_SMALLER_THAN(v1, v1);
+  VERIFY_IS_APPROX(vzero, v1 - v1);
+  VERIFY_IS_APPROX(m1, m1);
+  VERIFY_IS_NOT_APPROX(m1, 2 * m1);
+  VERIFY_IS_MUCH_SMALLER_THAN(mzero, m1);
+  VERIFY_IS_NOT_MUCH_SMALLER_THAN(m1, m1);
+  VERIFY_IS_APPROX(mzero, m1 - m1);
 
   // always test operator() on each read-only expression class,
   // in order to check const-qualifiers.
@@ -92,7 +86,7 @@
   // hence has no _write() method, the corresponding MatrixBase method (here zero())
   // should return a const-qualified object so that it is the const-qualified
   // operator() that gets called, which in turn calls _read().
-  VERIFY_IS_MUCH_SMALLER_THAN(MatrixType::Zero(rows,cols)(r,c), static_cast<Scalar>(1));
+  VERIFY_IS_MUCH_SMALLER_THAN(MatrixType::Zero(rows, cols)(r, c), static_cast<Scalar>(1));
 
   // now test copying a row-vector into a (column-)vector and conversely.
   square.col(r) = square.row(r).eval();
@@ -103,71 +97,71 @@
 
   VERIFY_IS_APPROX(rv, cv.transpose());
 
-  if(cols!=1 && rows!=1 && MatrixType::SizeAtCompileTime!=Dynamic)
-  {
-    VERIFY_RAISES_ASSERT(m1 = (m2.block(0,0, rows-1, cols-1)));
+  if (cols != 1 && rows != 1 && MatrixType::SizeAtCompileTime != Dynamic) {
+    VERIFY_RAISES_ASSERT(m1 = (m2.block(0, 0, rows - 1, cols - 1)));
   }
 
-  if(cols!=1 && rows!=1)
-  {
+  if (cols != 1 && rows != 1) {
     check_index(m1);
   }
 
-  VERIFY_IS_APPROX(m3 = m1,m1);
+  VERIFY_IS_APPROX(m3 = m1, m1);
   MatrixType m4;
-  VERIFY_IS_APPROX(m4 = m1,m1);
+  VERIFY_IS_APPROX(m4 = m1, m1);
 
   m3.real() = m1.real();
   VERIFY_IS_APPROX(static_cast<const MatrixType&>(m3).real(), static_cast<const MatrixType&>(m1).real());
   VERIFY_IS_APPROX(static_cast<const MatrixType&>(m3).real(), m1.real());
 
   // check == / != operators
-  VERIFY(m1==m1);
-  VERIFY(m1!=m2);
-  VERIFY(!(m1==m2));
-  VERIFY(!(m1!=m1));
+  VERIFY(m1 == m1);
+  VERIFY(m1 != m2);
+  VERIFY(!(m1 == m2));
+  VERIFY(!(m1 != m1));
   m1 = m2;
-  VERIFY(m1==m2);
-  VERIFY(!(m1!=m2));
+  VERIFY(m1 == m2);
+  VERIFY(!(m1 != m2));
 
   // check automatic transposition
   sm2.setZero();
-  for(Index i=0;i<rows;++i)
-    sm2.col(i) = sm1.row(i);
-  VERIFY_IS_APPROX(sm2,sm1.transpose());
+  for (Index i = 0; i < rows; ++i) sm2.col(i) = sm1.row(i);
+  VERIFY_IS_APPROX(sm2, sm1.transpose());
 
   sm2.setZero();
-  for(Index i=0;i<rows;++i)
-    sm2.col(i).noalias() = sm1.row(i);
-  VERIFY_IS_APPROX(sm2,sm1.transpose());
+  for (Index i = 0; i < rows; ++i) sm2.col(i).noalias() = sm1.row(i);
+  VERIFY_IS_APPROX(sm2, sm1.transpose());
 
   sm2.setZero();
-  for(Index i=0;i<rows;++i)
-    sm2.col(i).noalias() += sm1.row(i);
-  VERIFY_IS_APPROX(sm2,sm1.transpose());
+  for (Index i = 0; i < rows; ++i) sm2.col(i).noalias() += sm1.row(i);
+  VERIFY_IS_APPROX(sm2, sm1.transpose());
 
   sm2.setZero();
-  for(Index i=0;i<rows;++i)
-    sm2.col(i).noalias() -= sm1.row(i);
-  VERIFY_IS_APPROX(sm2,-sm1.transpose());
+  for (Index i = 0; i < rows; ++i) sm2.col(i).noalias() -= sm1.row(i);
+  VERIFY_IS_APPROX(sm2, -sm1.transpose());
 
   // check ternary usage
   {
-    bool b = internal::random<int>(0,10)>5;
+    bool b = internal::random<int>(0, 10) > 5;
     m3 = b ? m1 : m2;
-    if(b) VERIFY_IS_APPROX(m3,m1);
-    else  VERIFY_IS_APPROX(m3,m2);
+    if (b)
+      VERIFY_IS_APPROX(m3, m1);
+    else
+      VERIFY_IS_APPROX(m3, m2);
     m3 = b ? -m1 : m2;
-    if(b) VERIFY_IS_APPROX(m3,-m1);
-    else  VERIFY_IS_APPROX(m3,m2);
+    if (b)
+      VERIFY_IS_APPROX(m3, -m1);
+    else
+      VERIFY_IS_APPROX(m3, m2);
     m3 = b ? m1 : -m2;
-    if(b) VERIFY_IS_APPROX(m3,m1);
-    else  VERIFY_IS_APPROX(m3,-m2);
+    if (b)
+      VERIFY_IS_APPROX(m3, m1);
+    else
+      VERIFY_IS_APPROX(m3, -m2);
   }
 }
 
-template<typename MatrixType> void basicStuffComplex(const MatrixType& m)
-{
+template <typename MatrixType>
+void basicStuffComplex(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
   typedef typename NumTraits<Scalar>::Real RealScalar;
   typedef Matrix<RealScalar, MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime> RealMatrixType;
@@ -175,19 +169,17 @@
   Index rows = m.rows();
   Index cols = m.cols();
 
-  Scalar s1 = internal::random<Scalar>(),
-         s2 = internal::random<Scalar>();
+  Scalar s1 = internal::random<Scalar>(), s2 = internal::random<Scalar>();
 
-  VERIFY(numext::real(s1)==numext::real_ref(s1));
-  VERIFY(numext::imag(s1)==numext::imag_ref(s1));
+  VERIFY(numext::real(s1) == numext::real_ref(s1));
+  VERIFY(numext::imag(s1) == numext::imag_ref(s1));
   numext::real_ref(s1) = numext::real(s2);
   numext::imag_ref(s1) = numext::imag(s2);
   VERIFY(internal::isApprox(s1, s2, NumTraits<RealScalar>::epsilon()));
   // extended precision in Intel FPUs means that s1 == s2 in the line above is not guaranteed.
 
-  RealMatrixType rm1 = RealMatrixType::Random(rows,cols),
-                 rm2 = RealMatrixType::Random(rows,cols);
-  MatrixType cm(rows,cols);
+  RealMatrixType rm1 = RealMatrixType::Random(rows, cols), rm2 = RealMatrixType::Random(rows, cols);
+  MatrixType cm(rows, cols);
   cm.real() = rm1;
   cm.imag() = rm2;
   VERIFY_IS_APPROX(static_cast<const MatrixType&>(cm).real(), rm1);
@@ -203,25 +195,25 @@
   VERIFY(!static_cast<const MatrixType&>(cm).imag().isZero());
 }
 
-template<typename SrcScalar, typename TgtScalar>
+template <typename SrcScalar, typename TgtScalar>
 struct casting_test {
   static void run() {
-    Matrix<SrcScalar,4,4> m;
-    for (int i=0; i<m.rows(); ++i) {
-      for (int j=0; j<m.cols(); ++j) {
-        m(i, j) = internal::random_without_cast_overflow<SrcScalar,TgtScalar>::value();
+    Matrix<SrcScalar, 4, 4> m;
+    for (int i = 0; i < m.rows(); ++i) {
+      for (int j = 0; j < m.cols(); ++j) {
+        m(i, j) = internal::random_without_cast_overflow<SrcScalar, TgtScalar>::value();
       }
     }
-    Matrix<TgtScalar,4,4> n = m.template cast<TgtScalar>();
-    for (int i=0; i<m.rows(); ++i) {
-      for (int j=0; j<m.cols(); ++j) {
-        VERIFY_IS_APPROX(n(i, j), (internal::cast<SrcScalar,TgtScalar>(m(i, j))));
+    Matrix<TgtScalar, 4, 4> n = m.template cast<TgtScalar>();
+    for (int i = 0; i < m.rows(); ++i) {
+      for (int j = 0; j < m.cols(); ++j) {
+        VERIFY_IS_APPROX(n(i, j), (internal::cast<SrcScalar, TgtScalar>(m(i, j))));
       }
     }
   }
 };
 
-template<typename SrcScalar, typename EnableIf = void>
+template <typename SrcScalar, typename EnableIf = void>
 struct casting_test_runner {
   static void run() {
     casting_test<SrcScalar, bool>::run();
@@ -237,20 +229,19 @@
     casting_test<SrcScalar, bfloat16>::run();
     casting_test<SrcScalar, float>::run();
     casting_test<SrcScalar, double>::run();
-    casting_test<SrcScalar, std::complex<float> >::run();
-    casting_test<SrcScalar, std::complex<double> >::run();
+    casting_test<SrcScalar, std::complex<float>>::run();
+    casting_test<SrcScalar, std::complex<double>>::run();
   }
 };
 
-template<typename SrcScalar>
-struct casting_test_runner<SrcScalar, std::enable_if_t<(NumTraits<SrcScalar>::IsComplex)>>
-{
+template <typename SrcScalar>
+struct casting_test_runner<SrcScalar, std::enable_if_t<(NumTraits<SrcScalar>::IsComplex)>> {
   static void run() {
     // Only a few casts from std::complex<T> are defined.
     casting_test<SrcScalar, half>::run();
     casting_test<SrcScalar, bfloat16>::run();
-    casting_test<SrcScalar, std::complex<float> >::run();
-    casting_test<SrcScalar, std::complex<double> >::run();
+    casting_test<SrcScalar, std::complex<float>>::run();
+    casting_test<SrcScalar, std::complex<double>>::run();
   }
 };
 
@@ -268,61 +259,57 @@
   casting_test_runner<bfloat16>::run();
   casting_test_runner<float>::run();
   casting_test_runner<double>::run();
-  casting_test_runner<std::complex<float> >::run();
-  casting_test_runner<std::complex<double> >::run();
+  casting_test_runner<std::complex<float>>::run();
+  casting_test_runner<std::complex<double>>::run();
 }
 
 template <typename Scalar>
-void fixedSizeMatrixConstruction()
-{
+void fixedSizeMatrixConstruction() {
   Scalar raw[4];
-  for(int k=0; k<4; ++k)
-    raw[k] = internal::random<Scalar>();
+  for (int k = 0; k < 4; ++k) raw[k] = internal::random<Scalar>();
 
   {
-    Matrix<Scalar,4,1> m(raw);
-    Array<Scalar,4,1> a(raw);
-    for(int k=0; k<4; ++k) VERIFY(m(k) == raw[k]);
-    for(int k=0; k<4; ++k) VERIFY(a(k) == raw[k]);
-    VERIFY_IS_EQUAL(m,(Matrix<Scalar,4,1>(raw[0],raw[1],raw[2],raw[3])));
-    VERIFY((a==(Array<Scalar,4,1>(raw[0],raw[1],raw[2],raw[3]))).all());
+    Matrix<Scalar, 4, 1> m(raw);
+    Array<Scalar, 4, 1> a(raw);
+    for (int k = 0; k < 4; ++k) VERIFY(m(k) == raw[k]);
+    for (int k = 0; k < 4; ++k) VERIFY(a(k) == raw[k]);
+    VERIFY_IS_EQUAL(m, (Matrix<Scalar, 4, 1>(raw[0], raw[1], raw[2], raw[3])));
+    VERIFY((a == (Array<Scalar, 4, 1>(raw[0], raw[1], raw[2], raw[3]))).all());
   }
   {
-    Matrix<Scalar,3,1> m(raw);
-    Array<Scalar,3,1> a(raw);
-    for(int k=0; k<3; ++k) VERIFY(m(k) == raw[k]);
-    for(int k=0; k<3; ++k) VERIFY(a(k) == raw[k]);
-    VERIFY_IS_EQUAL(m,(Matrix<Scalar,3,1>(raw[0],raw[1],raw[2])));
-    VERIFY((a==Array<Scalar,3,1>(raw[0],raw[1],raw[2])).all());
+    Matrix<Scalar, 3, 1> m(raw);
+    Array<Scalar, 3, 1> a(raw);
+    for (int k = 0; k < 3; ++k) VERIFY(m(k) == raw[k]);
+    for (int k = 0; k < 3; ++k) VERIFY(a(k) == raw[k]);
+    VERIFY_IS_EQUAL(m, (Matrix<Scalar, 3, 1>(raw[0], raw[1], raw[2])));
+    VERIFY((a == Array<Scalar, 3, 1>(raw[0], raw[1], raw[2])).all());
   }
   {
-    Matrix<Scalar,2,1> m(raw), m2( (DenseIndex(raw[0])), (DenseIndex(raw[1])) );
-    Array<Scalar,2,1> a(raw),  a2( (DenseIndex(raw[0])), (DenseIndex(raw[1])) );
-    for(int k=0; k<2; ++k) VERIFY(m(k) == raw[k]);
-    for(int k=0; k<2; ++k) VERIFY(a(k) == raw[k]);
-    VERIFY_IS_EQUAL(m,(Matrix<Scalar,2,1>(raw[0],raw[1])));
-    VERIFY((a==Array<Scalar,2,1>(raw[0],raw[1])).all());
-    for(int k=0; k<2; ++k) VERIFY(m2(k) == DenseIndex(raw[k]));
-    for(int k=0; k<2; ++k) VERIFY(a2(k) == DenseIndex(raw[k]));
+    Matrix<Scalar, 2, 1> m(raw), m2((DenseIndex(raw[0])), (DenseIndex(raw[1])));
+    Array<Scalar, 2, 1> a(raw), a2((DenseIndex(raw[0])), (DenseIndex(raw[1])));
+    for (int k = 0; k < 2; ++k) VERIFY(m(k) == raw[k]);
+    for (int k = 0; k < 2; ++k) VERIFY(a(k) == raw[k]);
+    VERIFY_IS_EQUAL(m, (Matrix<Scalar, 2, 1>(raw[0], raw[1])));
+    VERIFY((a == Array<Scalar, 2, 1>(raw[0], raw[1])).all());
+    for (int k = 0; k < 2; ++k) VERIFY(m2(k) == DenseIndex(raw[k]));
+    for (int k = 0; k < 2; ++k) VERIFY(a2(k) == DenseIndex(raw[k]));
   }
   {
-    Matrix<Scalar,1,2> m(raw),
-                       m2( (DenseIndex(raw[0])), (DenseIndex(raw[1])) ),
-                       m3( (int(raw[0])), (int(raw[1])) ),
-                       m4( (float(raw[0])), (float(raw[1])) );
-    Array<Scalar,1,2> a(raw),  a2( (DenseIndex(raw[0])), (DenseIndex(raw[1])) );
-    for(int k=0; k<2; ++k) VERIFY(m(k) == raw[k]);
-    for(int k=0; k<2; ++k) VERIFY(a(k) == raw[k]);
-    VERIFY_IS_EQUAL(m,(Matrix<Scalar,1,2>(raw[0],raw[1])));
-    VERIFY((a==Array<Scalar,1,2>(raw[0],raw[1])).all());
-    for(int k=0; k<2; ++k) VERIFY(m2(k) == DenseIndex(raw[k]));
-    for(int k=0; k<2; ++k) VERIFY(a2(k) == DenseIndex(raw[k]));
-    for(int k=0; k<2; ++k) VERIFY(m3(k) == int(raw[k]));
-    for(int k=0; k<2; ++k) VERIFY((m4(k)) == Scalar(float(raw[k])));
+    Matrix<Scalar, 1, 2> m(raw), m2((DenseIndex(raw[0])), (DenseIndex(raw[1]))), m3((int(raw[0])), (int(raw[1]))),
+        m4((float(raw[0])), (float(raw[1])));
+    Array<Scalar, 1, 2> a(raw), a2((DenseIndex(raw[0])), (DenseIndex(raw[1])));
+    for (int k = 0; k < 2; ++k) VERIFY(m(k) == raw[k]);
+    for (int k = 0; k < 2; ++k) VERIFY(a(k) == raw[k]);
+    VERIFY_IS_EQUAL(m, (Matrix<Scalar, 1, 2>(raw[0], raw[1])));
+    VERIFY((a == Array<Scalar, 1, 2>(raw[0], raw[1])).all());
+    for (int k = 0; k < 2; ++k) VERIFY(m2(k) == DenseIndex(raw[k]));
+    for (int k = 0; k < 2; ++k) VERIFY(a2(k) == DenseIndex(raw[k]));
+    for (int k = 0; k < 2; ++k) VERIFY(m3(k) == int(raw[k]));
+    for (int k = 0; k < 2; ++k) VERIFY((m4(k)) == Scalar(float(raw[k])));
   }
   {
-    Matrix<Scalar,1,1> m(raw), m1(raw[0]), m2( (DenseIndex(raw[0])) ), m3( (int(raw[0])) );
-    Array<Scalar,1,1> a(raw), a1(raw[0]), a2( (DenseIndex(raw[0])) );
+    Matrix<Scalar, 1, 1> m(raw), m1(raw[0]), m2((DenseIndex(raw[0]))), m3((int(raw[0])));
+    Array<Scalar, 1, 1> a(raw), a1(raw[0]), a2((DenseIndex(raw[0])));
     VERIFY(m(0) == raw[0]);
     VERIFY(a(0) == raw[0]);
     VERIFY(m1(0) == raw[0]);
@@ -330,25 +317,30 @@
     VERIFY(m2(0) == DenseIndex(raw[0]));
     VERIFY(a2(0) == DenseIndex(raw[0]));
     VERIFY(m3(0) == int(raw[0]));
-    VERIFY_IS_EQUAL(m,(Matrix<Scalar,1,1>(raw[0])));
-    VERIFY((a==Array<Scalar,1,1>(raw[0])).all());
+    VERIFY_IS_EQUAL(m, (Matrix<Scalar, 1, 1>(raw[0])));
+    VERIFY((a == Array<Scalar, 1, 1>(raw[0])).all());
   }
 }
 
-EIGEN_DECLARE_TEST(basicstuff)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( basicStuff(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( basicStuff(Matrix4d()) );
-    CALL_SUBTEST_3( basicStuff(MatrixXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_4( basicStuff(MatrixXi(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_5( basicStuff(MatrixXcd(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_6( basicStuff(Matrix<float, 100, 100>()) );
-    CALL_SUBTEST_7( basicStuff(Matrix<long double,Dynamic,Dynamic>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE),internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_8( casting_all() );
+EIGEN_DECLARE_TEST(basicstuff) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(basicStuff(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(basicStuff(Matrix4d()));
+    CALL_SUBTEST_3(basicStuff(
+        MatrixXcf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_4(basicStuff(
+        MatrixXi(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_5(basicStuff(
+        MatrixXcd(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_6(basicStuff(Matrix<float, 100, 100>()));
+    CALL_SUBTEST_7(basicStuff(Matrix<long double, Dynamic, Dynamic>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE),
+                                                                    internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_8(casting_all());
 
-    CALL_SUBTEST_3( basicStuffComplex(MatrixXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_5( basicStuffComplex(MatrixXcd(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
+    CALL_SUBTEST_3(basicStuffComplex(
+        MatrixXcf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_5(basicStuffComplex(
+        MatrixXcd(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
   }
 
   CALL_SUBTEST_1(fixedSizeMatrixConstruction<unsigned char>());
diff --git a/test/bdcsvd.cpp b/test/bdcsvd.cpp
index 4f0a137..c51f354 100644
--- a/test/bdcsvd.cpp
+++ b/test/bdcsvd.cpp
@@ -22,9 +22,8 @@
 #define SVD_STATIC_OPTIONS(M, O) BDCSVD<M, O>
 #include "svd_common.h"
 
-template<typename MatrixType>
-void bdcsvd_method()
-{
+template <typename MatrixType>
+void bdcsvd_method() {
   enum { Size = MatrixType::RowsAtCompileTime };
   typedef typename MatrixType::RealScalar RealScalar;
   typedef Matrix<RealScalar, Size, 1> RealVecType;
@@ -48,22 +47,16 @@
 }
 
 // Verifies total deflation is **not** triggered.
-void compare_bdc_jacobi_instance(bool structure_as_m, int algoswap = 16)
-{
+void compare_bdc_jacobi_instance(bool structure_as_m, int algoswap = 16) {
   MatrixXd m(4, 3);
   if (structure_as_m) {
     // The first 3 rows are the reduced form of Matrix 1 as shown below, and it
     // has nonzero elements in the first column and diagonals only.
-    m << 1.056293, 0, 0,
-         -0.336468, 0.907359, 0,
-         -1.566245, 0, 0.149150,
-         -0.1, 0, 0;
+    m << 1.056293, 0, 0, -0.336468, 0.907359, 0, -1.566245, 0, 0.149150, -0.1, 0, 0;
   } else {
     // Matrix 1.
-    m << 0.882336, 18.3914, -26.7921,
-         -5.58135, 17.1931, -24.0892,
-         -20.794, 8.68496, -4.83103,
-         -8.4981, -10.5451, 23.9072;
+    m << 0.882336, 18.3914, -26.7921, -5.58135, 17.1931, -24.0892, -20.794, 8.68496, -4.83103, -8.4981, -10.5451,
+        23.9072;
   }
   compare_bdc_jacobi(m, algoswap, false);
 }
@@ -84,8 +77,7 @@
   svd_verify_constructor_options_assert<BDCSVD<MatrixType>>(input);
 }
 
-EIGEN_DECLARE_TEST(bdcsvd)
-{
+EIGEN_DECLARE_TEST(bdcsvd) {
   CALL_SUBTEST_1((bdcsvd_verify_assert<Matrix3f>()));
   CALL_SUBTEST_2((bdcsvd_verify_assert<Matrix4d>()));
   CALL_SUBTEST_3((bdcsvd_verify_assert<Matrix<float, 10, 7>>()));
@@ -98,8 +90,7 @@
   CALL_SUBTEST_9((svd_all_trivial_2x2(bdcsvd_full_options<Matrix2d>)));
 
   for (int i = 0; i < g_repeat; i++) {
-    int r = internal::random<int>(1, EIGEN_TEST_MAX_SIZE/2),
-        c = internal::random<int>(1, EIGEN_TEST_MAX_SIZE/2);
+    int r = internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2), c = internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2);
 
     TEST_SET_BUT_UNUSED_VARIABLE(r)
     TEST_SET_BUT_UNUSED_VARIABLE(c)
@@ -130,10 +121,14 @@
     CALL_SUBTEST_30((bdcsvd_full_options<MatrixXcd>(MatrixXcd(r, c))));
     CALL_SUBTEST_31((bdcsvd_thin_options<MatrixXd>(MatrixXd(r, c))));
     CALL_SUBTEST_32((bdcsvd_full_options<MatrixXd>(MatrixXd(r, c))));
-    CALL_SUBTEST_33((bdcsvd_thin_options<Matrix<double, Dynamic, Dynamic, RowMajor>>(Matrix<double, Dynamic, Dynamic, RowMajor>(20, 27))));
-    CALL_SUBTEST_34((bdcsvd_full_options<Matrix<double, Dynamic, Dynamic, RowMajor>>(Matrix<double, Dynamic, Dynamic, RowMajor>(20, 27))));
-    CALL_SUBTEST_35((bdcsvd_thin_options<Matrix<double, Dynamic, Dynamic, RowMajor>>(Matrix<double, Dynamic, Dynamic, RowMajor>(27, 20))));
-    CALL_SUBTEST_36((bdcsvd_full_options<Matrix<double, Dynamic, Dynamic, RowMajor>>(Matrix<double, Dynamic, Dynamic, RowMajor>(27, 20))));
+    CALL_SUBTEST_33((bdcsvd_thin_options<Matrix<double, Dynamic, Dynamic, RowMajor>>(
+        Matrix<double, Dynamic, Dynamic, RowMajor>(20, 27))));
+    CALL_SUBTEST_34((bdcsvd_full_options<Matrix<double, Dynamic, Dynamic, RowMajor>>(
+        Matrix<double, Dynamic, Dynamic, RowMajor>(20, 27))));
+    CALL_SUBTEST_35((bdcsvd_thin_options<Matrix<double, Dynamic, Dynamic, RowMajor>>(
+        Matrix<double, Dynamic, Dynamic, RowMajor>(27, 20))));
+    CALL_SUBTEST_36((bdcsvd_full_options<Matrix<double, Dynamic, Dynamic, RowMajor>>(
+        Matrix<double, Dynamic, Dynamic, RowMajor>(27, 20))));
     CALL_SUBTEST_37((
         svd_check_max_size_matrix<Matrix<float, Dynamic, Dynamic, ColMajor, 20, 35>, ColPivHouseholderQRPreconditioner>(
             r, c)));
@@ -149,23 +144,23 @@
   }
 
   // test matrixbase method
-  CALL_SUBTEST_41(( bdcsvd_method<Matrix2cd>() ));
-  CALL_SUBTEST_42(( bdcsvd_method<Matrix3f>() ));
+  CALL_SUBTEST_41((bdcsvd_method<Matrix2cd>()));
+  CALL_SUBTEST_42((bdcsvd_method<Matrix3f>()));
 
   // Test problem size constructors
-  CALL_SUBTEST_43( BDCSVD<MatrixXf>(10,10) );
+  CALL_SUBTEST_43(BDCSVD<MatrixXf>(10, 10));
 
   // Check that preallocation avoids subsequent mallocs
   // Disabled because not supported by BDCSVD
   // CALL_SUBTEST_9( svd_preallocate<void>() );
 
-  CALL_SUBTEST_44( svd_underoverflow<void>() );
+  CALL_SUBTEST_44(svd_underoverflow<void>());
 
   // Without total deflation issues.
-  CALL_SUBTEST_45((  compare_bdc_jacobi_instance(true) ));
-  CALL_SUBTEST_46((  compare_bdc_jacobi_instance(false) ));
+  CALL_SUBTEST_45((compare_bdc_jacobi_instance(true)));
+  CALL_SUBTEST_46((compare_bdc_jacobi_instance(false)));
 
   // With total deflation issues before, when it shouldn't be triggered.
-  CALL_SUBTEST_47((  compare_bdc_jacobi_instance(true, 3) ));
-  CALL_SUBTEST_48((  compare_bdc_jacobi_instance(false, 3) ));
+  CALL_SUBTEST_47((compare_bdc_jacobi_instance(true, 3)));
+  CALL_SUBTEST_48((compare_bdc_jacobi_instance(false, 3)));
 }
diff --git a/test/bfloat16_float.cpp b/test/bfloat16_float.cpp
index 5cc44ac..922a6d1 100644
--- a/test/bfloat16_float.cpp
+++ b/test/bfloat16_float.cpp
@@ -21,45 +21,37 @@
 
 using Eigen::bfloat16;
 
-float BinaryToFloat(uint32_t sign, uint32_t exponent, uint32_t high_mantissa,
-                    uint32_t low_mantissa) {
+float BinaryToFloat(uint32_t sign, uint32_t exponent, uint32_t high_mantissa, uint32_t low_mantissa) {
   float dest;
   uint32_t src = (sign << 31) + (exponent << 23) + (high_mantissa << 16) + low_mantissa;
-  memcpy(static_cast<void*>(&dest),
-         static_cast<const void*>(&src), sizeof(dest));
+  memcpy(static_cast<void*>(&dest), static_cast<const void*>(&src), sizeof(dest));
   return dest;
 }
 
-template<typename T>
- void test_roundtrip() {
+template <typename T>
+void test_roundtrip() {
   // Representable T round trip via bfloat16
-  VERIFY_IS_EQUAL((internal::cast<bfloat16,T>(internal::cast<T,bfloat16>(-std::numeric_limits<T>::infinity()))), -std::numeric_limits<T>::infinity());
-  VERIFY_IS_EQUAL((internal::cast<bfloat16,T>(internal::cast<T,bfloat16>(std::numeric_limits<T>::infinity()))), std::numeric_limits<T>::infinity());
-  VERIFY_IS_EQUAL((internal::cast<bfloat16,T>(internal::cast<T,bfloat16>(T(-1.0)))), T(-1.0));
-  VERIFY_IS_EQUAL((internal::cast<bfloat16,T>(internal::cast<T,bfloat16>(T(-0.5)))), T(-0.5));
-  VERIFY_IS_EQUAL((internal::cast<bfloat16,T>(internal::cast<T,bfloat16>(T(-0.0)))), T(-0.0));
-  VERIFY_IS_EQUAL((internal::cast<bfloat16,T>(internal::cast<T,bfloat16>(T(1.0)))), T(1.0));
-  VERIFY_IS_EQUAL((internal::cast<bfloat16,T>(internal::cast<T,bfloat16>(T(0.5)))), T(0.5));
-  VERIFY_IS_EQUAL((internal::cast<bfloat16,T>(internal::cast<T,bfloat16>(T(0.0)))), T(0.0));
+  VERIFY_IS_EQUAL((internal::cast<bfloat16, T>(internal::cast<T, bfloat16>(-std::numeric_limits<T>::infinity()))),
+                  -std::numeric_limits<T>::infinity());
+  VERIFY_IS_EQUAL((internal::cast<bfloat16, T>(internal::cast<T, bfloat16>(std::numeric_limits<T>::infinity()))),
+                  std::numeric_limits<T>::infinity());
+  VERIFY_IS_EQUAL((internal::cast<bfloat16, T>(internal::cast<T, bfloat16>(T(-1.0)))), T(-1.0));
+  VERIFY_IS_EQUAL((internal::cast<bfloat16, T>(internal::cast<T, bfloat16>(T(-0.5)))), T(-0.5));
+  VERIFY_IS_EQUAL((internal::cast<bfloat16, T>(internal::cast<T, bfloat16>(T(-0.0)))), T(-0.0));
+  VERIFY_IS_EQUAL((internal::cast<bfloat16, T>(internal::cast<T, bfloat16>(T(1.0)))), T(1.0));
+  VERIFY_IS_EQUAL((internal::cast<bfloat16, T>(internal::cast<T, bfloat16>(T(0.5)))), T(0.5));
+  VERIFY_IS_EQUAL((internal::cast<bfloat16, T>(internal::cast<T, bfloat16>(T(0.0)))), T(0.0));
 }
 
-void test_conversion()
-{
+void test_conversion() {
   using Eigen::bfloat16_impl::__bfloat16_raw;
 
   // Round-trip casts
-  VERIFY_IS_EQUAL(
-    numext::bit_cast<bfloat16>(numext::bit_cast<numext::uint16_t>(bfloat16(1.0f))),
-    bfloat16(1.0f));
-  VERIFY_IS_EQUAL(
-    numext::bit_cast<bfloat16>(numext::bit_cast<numext::uint16_t>(bfloat16(0.5f))),
-    bfloat16(0.5f));
-  VERIFY_IS_EQUAL(
-    numext::bit_cast<bfloat16>(numext::bit_cast<numext::uint16_t>(bfloat16(-0.33333f))),
-    bfloat16(-0.33333f));
-   VERIFY_IS_EQUAL(
-    numext::bit_cast<bfloat16>(numext::bit_cast<numext::uint16_t>(bfloat16(0.0f))),
-    bfloat16(0.0f));
+  VERIFY_IS_EQUAL(numext::bit_cast<bfloat16>(numext::bit_cast<numext::uint16_t>(bfloat16(1.0f))), bfloat16(1.0f));
+  VERIFY_IS_EQUAL(numext::bit_cast<bfloat16>(numext::bit_cast<numext::uint16_t>(bfloat16(0.5f))), bfloat16(0.5f));
+  VERIFY_IS_EQUAL(numext::bit_cast<bfloat16>(numext::bit_cast<numext::uint16_t>(bfloat16(-0.33333f))),
+                  bfloat16(-0.33333f));
+  VERIFY_IS_EQUAL(numext::bit_cast<bfloat16>(numext::bit_cast<numext::uint16_t>(bfloat16(0.0f))), bfloat16(0.0f));
 
   // Conversion from float.
   VERIFY_BFLOAT16_BITS_EQUAL(bfloat16(1.0f), 0x3f80);
@@ -118,23 +110,23 @@
   test_roundtrip<std::complex<double> >();
 
   // Conversion
-  Array<float,1,100> a;
+  Array<float, 1, 100> a;
   for (int i = 0; i < 100; i++) a(i) = i + 1.25;
-  Array<bfloat16,1,100> b = a.cast<bfloat16>();
-  Array<float,1,100> c = b.cast<float>();
+  Array<bfloat16, 1, 100> b = a.cast<bfloat16>();
+  Array<float, 1, 100> c = b.cast<float>();
   for (int i = 0; i < 100; ++i) {
     VERIFY_LE(numext::abs(c(i) - a(i)), a(i) / 128);
   }
 
   // Epsilon
   VERIFY_LE(1.0f, static_cast<float>((std::numeric_limits<bfloat16>::epsilon)() + bfloat16(1.0f)));
-  VERIFY_IS_EQUAL(1.0f, static_cast<float>((std::numeric_limits<bfloat16>::epsilon)() / bfloat16(2.0f) + bfloat16(1.0f)));
+  VERIFY_IS_EQUAL(1.0f,
+                  static_cast<float>((std::numeric_limits<bfloat16>::epsilon)() / bfloat16(2.0f) + bfloat16(1.0f)));
 
   // Negate
   VERIFY_IS_EQUAL(static_cast<float>(-bfloat16(3.0f)), -3.0f);
   VERIFY_IS_EQUAL(static_cast<float>(-bfloat16(-4.5f)), 4.5f);
 
-
 #if !EIGEN_COMP_MSVC
   // Visual Studio errors out on divisions by 0
   VERIFY((numext::isnan)(static_cast<float>(bfloat16(0.0 / 0.0))));
@@ -167,46 +159,51 @@
   VERIFY_BFLOAT16_BITS_EQUAL(bfloat16(BinaryToFloat(0x1, 0xff, 0x40, 0x0)), 0xffc0);
 }
 
-void test_numtraits()
-{
-  std::cout << "epsilon       = " << NumTraits<bfloat16>::epsilon() << "  (0x" << std::hex << numext::bit_cast<numext::uint16_t>(NumTraits<bfloat16>::epsilon()) << ")" << std::endl;
-  std::cout << "highest       = " << NumTraits<bfloat16>::highest() << "  (0x" << std::hex << numext::bit_cast<numext::uint16_t>(NumTraits<bfloat16>::highest()) << ")" << std::endl;
-  std::cout << "lowest        = " << NumTraits<bfloat16>::lowest() << "  (0x" << std::hex << numext::bit_cast<numext::uint16_t>(NumTraits<bfloat16>::lowest()) << ")" << std::endl;
-  std::cout << "min           = " << (std::numeric_limits<bfloat16>::min)() << "  (0x" << std::hex << numext::bit_cast<numext::uint16_t>((std::numeric_limits<bfloat16>::min)()) << ")" << std::endl;
-  std::cout << "denorm min    = " << (std::numeric_limits<bfloat16>::denorm_min)() << "  (0x" << std::hex << numext::bit_cast<numext::uint16_t>((std::numeric_limits<bfloat16>::denorm_min)()) << ")" << std::endl;
-  std::cout << "infinity      = " << NumTraits<bfloat16>::infinity() << "  (0x" << std::hex << numext::bit_cast<numext::uint16_t>(NumTraits<bfloat16>::infinity()) << ")" << std::endl;
-  std::cout << "quiet nan     = " << NumTraits<bfloat16>::quiet_NaN() << "  (0x" << std::hex << numext::bit_cast<numext::uint16_t>(NumTraits<bfloat16>::quiet_NaN()) << ")" << std::endl;
-  std::cout << "signaling nan = " << std::numeric_limits<bfloat16>::signaling_NaN() << "  (0x" << std::hex << numext::bit_cast<numext::uint16_t>(std::numeric_limits<bfloat16>::signaling_NaN()) << ")" << std::endl;
+void test_numtraits() {
+  std::cout << "epsilon       = " << NumTraits<bfloat16>::epsilon() << "  (0x" << std::hex
+            << numext::bit_cast<numext::uint16_t>(NumTraits<bfloat16>::epsilon()) << ")" << std::endl;
+  std::cout << "highest       = " << NumTraits<bfloat16>::highest() << "  (0x" << std::hex
+            << numext::bit_cast<numext::uint16_t>(NumTraits<bfloat16>::highest()) << ")" << std::endl;
+  std::cout << "lowest        = " << NumTraits<bfloat16>::lowest() << "  (0x" << std::hex
+            << numext::bit_cast<numext::uint16_t>(NumTraits<bfloat16>::lowest()) << ")" << std::endl;
+  std::cout << "min           = " << (std::numeric_limits<bfloat16>::min)() << "  (0x" << std::hex
+            << numext::bit_cast<numext::uint16_t>((std::numeric_limits<bfloat16>::min)()) << ")" << std::endl;
+  std::cout << "denorm min    = " << (std::numeric_limits<bfloat16>::denorm_min)() << "  (0x" << std::hex
+            << numext::bit_cast<numext::uint16_t>((std::numeric_limits<bfloat16>::denorm_min)()) << ")" << std::endl;
+  std::cout << "infinity      = " << NumTraits<bfloat16>::infinity() << "  (0x" << std::hex
+            << numext::bit_cast<numext::uint16_t>(NumTraits<bfloat16>::infinity()) << ")" << std::endl;
+  std::cout << "quiet nan     = " << NumTraits<bfloat16>::quiet_NaN() << "  (0x" << std::hex
+            << numext::bit_cast<numext::uint16_t>(NumTraits<bfloat16>::quiet_NaN()) << ")" << std::endl;
+  std::cout << "signaling nan = " << std::numeric_limits<bfloat16>::signaling_NaN() << "  (0x" << std::hex
+            << numext::bit_cast<numext::uint16_t>(std::numeric_limits<bfloat16>::signaling_NaN()) << ")" << std::endl;
 
   VERIFY(NumTraits<bfloat16>::IsSigned);
 
-  VERIFY_IS_EQUAL(
-    numext::bit_cast<numext::uint16_t>(std::numeric_limits<bfloat16>::infinity()),
-    numext::bit_cast<numext::uint16_t>(bfloat16(std::numeric_limits<float>::infinity())) );
+  VERIFY_IS_EQUAL(numext::bit_cast<numext::uint16_t>(std::numeric_limits<bfloat16>::infinity()),
+                  numext::bit_cast<numext::uint16_t>(bfloat16(std::numeric_limits<float>::infinity())));
   // There is no guarantee that casting a 32-bit NaN to bfloat16 has a precise
   // bit pattern.  We test that it is in fact a NaN, then test the signaling
   // bit (msb of significand is 1 for quiet, 0 for signaling).
   const numext::uint16_t BFLOAT16_QUIET_BIT = 0x0040;
-  VERIFY(
-    (numext::isnan)(std::numeric_limits<bfloat16>::quiet_NaN())
-    && (numext::isnan)(bfloat16(std::numeric_limits<float>::quiet_NaN()))
-    && ((numext::bit_cast<numext::uint16_t>(std::numeric_limits<bfloat16>::quiet_NaN()) & BFLOAT16_QUIET_BIT) > 0)
-    && ((numext::bit_cast<numext::uint16_t>(bfloat16(std::numeric_limits<float>::quiet_NaN())) & BFLOAT16_QUIET_BIT) > 0) );
+  VERIFY((numext::isnan)(std::numeric_limits<bfloat16>::quiet_NaN()) &&
+         (numext::isnan)(bfloat16(std::numeric_limits<float>::quiet_NaN())) &&
+         ((numext::bit_cast<numext::uint16_t>(std::numeric_limits<bfloat16>::quiet_NaN()) & BFLOAT16_QUIET_BIT) > 0) &&
+         ((numext::bit_cast<numext::uint16_t>(bfloat16(std::numeric_limits<float>::quiet_NaN())) & BFLOAT16_QUIET_BIT) >
+          0));
   // After a cast to bfloat16, a signaling NaN may become non-signaling. Thus,
   // we check that both are NaN, and that only the `numeric_limits` version is
   // signaling.
   VERIFY(
-    (numext::isnan)(std::numeric_limits<bfloat16>::signaling_NaN())
-    && (numext::isnan)(bfloat16(std::numeric_limits<float>::signaling_NaN()))
-    && ((numext::bit_cast<numext::uint16_t>(std::numeric_limits<bfloat16>::signaling_NaN()) & BFLOAT16_QUIET_BIT) == 0) );
+      (numext::isnan)(std::numeric_limits<bfloat16>::signaling_NaN()) &&
+      (numext::isnan)(bfloat16(std::numeric_limits<float>::signaling_NaN())) &&
+      ((numext::bit_cast<numext::uint16_t>(std::numeric_limits<bfloat16>::signaling_NaN()) & BFLOAT16_QUIET_BIT) == 0));
 
-  VERIFY( (std::numeric_limits<bfloat16>::min)() > bfloat16(0.f) );
-  VERIFY( (std::numeric_limits<bfloat16>::denorm_min)() > bfloat16(0.f) );
-  VERIFY_IS_EQUAL( (std::numeric_limits<bfloat16>::denorm_min)()/bfloat16(2), bfloat16(0.f) );
+  VERIFY((std::numeric_limits<bfloat16>::min)() > bfloat16(0.f));
+  VERIFY((std::numeric_limits<bfloat16>::denorm_min)() > bfloat16(0.f));
+  VERIFY_IS_EQUAL((std::numeric_limits<bfloat16>::denorm_min)() / bfloat16(2), bfloat16(0.f));
 }
 
-void test_arithmetic()
-{
+void test_arithmetic() {
   VERIFY_IS_EQUAL(static_cast<float>(bfloat16(2) + bfloat16(2)), 4.f);
   VERIFY_IS_EQUAL(static_cast<float>(bfloat16(2) + bfloat16(-2)), 0.f);
   VERIFY_IS_APPROX(static_cast<float>(bfloat16(0.33333f) + bfloat16(0.66667f)), 1.0f);
@@ -216,8 +213,7 @@
   VERIFY_IS_EQUAL(static_cast<float>(-bfloat16(-4096.0f)), 4096.0f);
 }
 
-void test_comparison()
-{
+void test_comparison() {
   VERIFY(bfloat16(1.0f) > bfloat16(0.5f));
   VERIFY(bfloat16(0.5f) < bfloat16(1.0f));
   VERIFY(!(bfloat16(1.0f) < bfloat16(0.5f)));
@@ -254,8 +250,7 @@
 #endif
 }
 
-void test_basic_functions()
-{
+void test_basic_functions() {
   VERIFY_IS_EQUAL(static_cast<float>(numext::abs(bfloat16(3.5f))), 3.5f);
   VERIFY_IS_EQUAL(static_cast<float>(abs(bfloat16(3.5f))), 3.5f);
   VERIFY_IS_EQUAL(static_cast<float>(numext::abs(bfloat16(-3.5f))), 3.5f);
@@ -302,8 +297,7 @@
   VERIFY_IS_APPROX(static_cast<float>(log1p(bfloat16(10.0f))), 2.390625f);
 }
 
-void test_trigonometric_functions()
-{
+void test_trigonometric_functions() {
   VERIFY_IS_APPROX(numext::cos(bfloat16(0.0f)), bfloat16(cosf(0.0f)));
   VERIFY_IS_APPROX(cos(bfloat16(0.0f)), bfloat16(cosf(0.0f)));
   VERIFY_IS_APPROX(numext::cos(bfloat16(EIGEN_PI)), bfloat16(cosf(EIGEN_PI)));
@@ -314,8 +308,8 @@
   VERIFY_IS_APPROX(numext::sin(bfloat16(0.0f)), bfloat16(sinf(0.0f)));
   VERIFY_IS_APPROX(sin(bfloat16(0.0f)), bfloat16(sinf(0.0f)));
   // VERIFY_IS_APPROX(numext::sin(bfloat16(EIGEN_PI)), bfloat16(sinf(EIGEN_PI)));
-  VERIFY_IS_APPROX(numext::sin(bfloat16(EIGEN_PI/2)), bfloat16(sinf(EIGEN_PI/2)));
-  VERIFY_IS_APPROX(numext::sin(bfloat16(3*EIGEN_PI/2)), bfloat16(sinf(3*EIGEN_PI/2)));
+  VERIFY_IS_APPROX(numext::sin(bfloat16(EIGEN_PI / 2)), bfloat16(sinf(EIGEN_PI / 2)));
+  VERIFY_IS_APPROX(numext::sin(bfloat16(3 * EIGEN_PI / 2)), bfloat16(sinf(3 * EIGEN_PI / 2)));
   VERIFY_IS_APPROX(numext::sin(bfloat16(3.5f)), bfloat16(sinf(3.5f)));
 
   VERIFY_IS_APPROX(numext::tan(bfloat16(0.0f)), bfloat16(tanf(0.0f)));
@@ -326,45 +320,42 @@
   VERIFY_IS_APPROX(numext::tan(bfloat16(3.5f)), bfloat16(tanf(3.5f)));
 }
 
-void test_array()
-{
-  typedef Array<bfloat16,1,Dynamic> ArrayXh;
-  Index size = internal::random<Index>(1,10);
-  Index i = internal::random<Index>(0,size-1);
+void test_array() {
+  typedef Array<bfloat16, 1, Dynamic> ArrayXh;
+  Index size = internal::random<Index>(1, 10);
+  Index i = internal::random<Index>(0, size - 1);
   ArrayXh a1 = ArrayXh::Random(size), a2 = ArrayXh::Random(size);
-  VERIFY_IS_APPROX( a1+a1, bfloat16(2)*a1 );
-  VERIFY( (a1.abs() >= bfloat16(0)).all() );
-  VERIFY_IS_APPROX( (a1*a1).sqrt(), a1.abs() );
+  VERIFY_IS_APPROX(a1 + a1, bfloat16(2) * a1);
+  VERIFY((a1.abs() >= bfloat16(0)).all());
+  VERIFY_IS_APPROX((a1 * a1).sqrt(), a1.abs());
 
-  VERIFY( ((a1.min)(a2) <= (a1.max)(a2)).all() );
+  VERIFY(((a1.min)(a2) <= (a1.max)(a2)).all());
   a1(i) = bfloat16(-10.);
-  VERIFY_IS_EQUAL( a1.minCoeff(), bfloat16(-10.) );
+  VERIFY_IS_EQUAL(a1.minCoeff(), bfloat16(-10.));
   a1(i) = bfloat16(10.);
-  VERIFY_IS_EQUAL( a1.maxCoeff(), bfloat16(10.) );
+  VERIFY_IS_EQUAL(a1.maxCoeff(), bfloat16(10.));
 
   std::stringstream ss;
   ss << a1;
 }
 
-void test_product()
-{
-  typedef Matrix<bfloat16,Dynamic,Dynamic> MatrixXh;
-  Index rows  = internal::random<Index>(1,EIGEN_TEST_MAX_SIZE);
-  Index cols  = internal::random<Index>(1,EIGEN_TEST_MAX_SIZE);
-  Index depth = internal::random<Index>(1,EIGEN_TEST_MAX_SIZE);
-  MatrixXh Ah = MatrixXh::Random(rows,depth);
-  MatrixXh Bh = MatrixXh::Random(depth,cols);
-  MatrixXh Ch = MatrixXh::Random(rows,cols);
+void test_product() {
+  typedef Matrix<bfloat16, Dynamic, Dynamic> MatrixXh;
+  Index rows = internal::random<Index>(1, EIGEN_TEST_MAX_SIZE);
+  Index cols = internal::random<Index>(1, EIGEN_TEST_MAX_SIZE);
+  Index depth = internal::random<Index>(1, EIGEN_TEST_MAX_SIZE);
+  MatrixXh Ah = MatrixXh::Random(rows, depth);
+  MatrixXh Bh = MatrixXh::Random(depth, cols);
+  MatrixXh Ch = MatrixXh::Random(rows, cols);
   MatrixXf Af = Ah.cast<float>();
   MatrixXf Bf = Bh.cast<float>();
   MatrixXf Cf = Ch.cast<float>();
-  VERIFY_IS_APPROX(Ch.noalias()+=Ah*Bh, (Cf.noalias()+=Af*Bf).cast<bfloat16>());
+  VERIFY_IS_APPROX(Ch.noalias() += Ah * Bh, (Cf.noalias() += Af * Bf).cast<bfloat16>());
 }
 
-EIGEN_DECLARE_TEST(bfloat16_float)
-{
+EIGEN_DECLARE_TEST(bfloat16_float) {
   CALL_SUBTEST(test_numtraits());
-  for(int i = 0; i < g_repeat; i++) {
+  for (int i = 0; i < g_repeat; i++) {
     CALL_SUBTEST(test_conversion());
     CALL_SUBTEST(test_arithmetic());
     CALL_SUBTEST(test_comparison());
diff --git a/test/bicgstab.cpp b/test/bicgstab.cpp
index 59c4b50..3f53e3e 100644
--- a/test/bicgstab.cpp
+++ b/test/bicgstab.cpp
@@ -10,25 +10,24 @@
 #include "sparse_solver.h"
 #include <Eigen/IterativeLinearSolvers>
 
-template<typename T, typename I_> void test_bicgstab_T()
-{
-  BiCGSTAB<SparseMatrix<T,0,I_>, DiagonalPreconditioner<T> >     bicgstab_colmajor_diag;
-  BiCGSTAB<SparseMatrix<T,0,I_>, IdentityPreconditioner    >     bicgstab_colmajor_I;
-  BiCGSTAB<SparseMatrix<T,0,I_>, IncompleteLUT<T,I_> >              bicgstab_colmajor_ilut;
-  //BiCGSTAB<SparseMatrix<T>, SSORPreconditioner<T> >     bicgstab_colmajor_ssor;
+template <typename T, typename I_>
+void test_bicgstab_T() {
+  BiCGSTAB<SparseMatrix<T, 0, I_>, DiagonalPreconditioner<T> > bicgstab_colmajor_diag;
+  BiCGSTAB<SparseMatrix<T, 0, I_>, IdentityPreconditioner> bicgstab_colmajor_I;
+  BiCGSTAB<SparseMatrix<T, 0, I_>, IncompleteLUT<T, I_> > bicgstab_colmajor_ilut;
+  // BiCGSTAB<SparseMatrix<T>, SSORPreconditioner<T> >     bicgstab_colmajor_ssor;
 
-  bicgstab_colmajor_diag.setTolerance(NumTraits<T>::epsilon()*4);
-  bicgstab_colmajor_ilut.setTolerance(NumTraits<T>::epsilon()*4);
-  
-  CALL_SUBTEST( check_sparse_square_solving(bicgstab_colmajor_diag)  );
-//   CALL_SUBTEST( check_sparse_square_solving(bicgstab_colmajor_I)     );
-  CALL_SUBTEST( check_sparse_square_solving(bicgstab_colmajor_ilut)     );
-  //CALL_SUBTEST( check_sparse_square_solving(bicgstab_colmajor_ssor)     );
+  bicgstab_colmajor_diag.setTolerance(NumTraits<T>::epsilon() * 4);
+  bicgstab_colmajor_ilut.setTolerance(NumTraits<T>::epsilon() * 4);
+
+  CALL_SUBTEST(check_sparse_square_solving(bicgstab_colmajor_diag));
+  //   CALL_SUBTEST( check_sparse_square_solving(bicgstab_colmajor_I)     );
+  CALL_SUBTEST(check_sparse_square_solving(bicgstab_colmajor_ilut));
+  // CALL_SUBTEST( check_sparse_square_solving(bicgstab_colmajor_ssor)     );
 }
 
-EIGEN_DECLARE_TEST(bicgstab)
-{
-  CALL_SUBTEST_1((test_bicgstab_T<double,int>()) );
+EIGEN_DECLARE_TEST(bicgstab) {
+  CALL_SUBTEST_1((test_bicgstab_T<double, int>()));
   CALL_SUBTEST_2((test_bicgstab_T<std::complex<double>, int>()));
-  CALL_SUBTEST_3((test_bicgstab_T<double,long int>()));
+  CALL_SUBTEST_3((test_bicgstab_T<double, long int>()));
 }
diff --git a/test/blasutil.cpp b/test/blasutil.cpp
index 2fc8b68..199b571 100644
--- a/test/blasutil.cpp
+++ b/test/blasutil.cpp
@@ -13,193 +13,166 @@
 // for packet_traits<Packet*>
 // => The only workaround would be to wrap _m128 and the likes
 //    within wrappers.
-#if EIGEN_GNUC_STRICT_AT_LEAST(6,0,0)
-    #pragma GCC diagnostic ignored "-Wignored-attributes"
+#if EIGEN_GNUC_STRICT_AT_LEAST(6, 0, 0)
+#pragma GCC diagnostic ignored "-Wignored-attributes"
 #endif
 
-#define GET(i,j) (StorageOrder == RowMajor ? (i)*stride + (j) : (i) + (j)*stride)
-#define SCATTER(i,j,k) (StorageOrder == RowMajor ? ((i)+(k))*stride + (j) : (i) + ((j)+(k))*stride)
+#define GET(i, j) (StorageOrder == RowMajor ? (i) * stride + (j) : (i) + (j) * stride)
+#define SCATTER(i, j, k) (StorageOrder == RowMajor ? ((i) + (k)) * stride + (j) : (i) + ((j) + (k)) * stride)
 
-template<typename Scalar, typename Packet>
-void compare(const Packet& a, const Packet& b)
-{
-    int pktsz = internal::packet_traits<Scalar>::size;
-    Scalar *buffA = new Scalar[pktsz];
-    Scalar *buffB = new Scalar[pktsz];
+template <typename Scalar, typename Packet>
+void compare(const Packet& a, const Packet& b) {
+  int pktsz = internal::packet_traits<Scalar>::size;
+  Scalar* buffA = new Scalar[pktsz];
+  Scalar* buffB = new Scalar[pktsz];
 
-    internal::pstoreu<Scalar, Packet>(buffA, a);
-    internal::pstoreu<Scalar, Packet>(buffB, b);
+  internal::pstoreu<Scalar, Packet>(buffA, a);
+  internal::pstoreu<Scalar, Packet>(buffB, b);
 
-    for(int i = 0; i < pktsz; i++)
-    {
-        VERIFY_IS_EQUAL(buffA[i], buffB[i]);
-    }
+  for (int i = 0; i < pktsz; i++) {
+    VERIFY_IS_EQUAL(buffA[i], buffB[i]);
+  }
 
-    delete[] buffA;
-    delete[] buffB;
+  delete[] buffA;
+  delete[] buffB;
 }
 
-template<typename Scalar, int StorageOrder, int n>
-struct PacketBlockSet
-{
-    typedef typename internal::packet_traits<Scalar>::type Packet;
+template <typename Scalar, int StorageOrder, int n>
+struct PacketBlockSet {
+  typedef typename internal::packet_traits<Scalar>::type Packet;
 
-    void setPacketBlock(internal::PacketBlock<Packet,n>& block, Scalar value)
-    {
-        for(int idx = 0; idx < n; idx++)
-        {
-            block.packet[idx] = internal::pset1<Packet>(value);
-        }
+  void setPacketBlock(internal::PacketBlock<Packet, n>& block, Scalar value) {
+    for (int idx = 0; idx < n; idx++) {
+      block.packet[idx] = internal::pset1<Packet>(value);
     }
+  }
 
-    void comparePacketBlock(Scalar *data, int i, int j, int stride, internal::PacketBlock<Packet, n>& block)
-    {
-        for(int idx = 0; idx < n; idx++)
-        {
-            Packet line = internal::ploadu<Packet>(data + SCATTER(i,j,idx));
-            compare<Scalar, Packet>(block.packet[idx], line);
-        }
+  void comparePacketBlock(Scalar* data, int i, int j, int stride, internal::PacketBlock<Packet, n>& block) {
+    for (int idx = 0; idx < n; idx++) {
+      Packet line = internal::ploadu<Packet>(data + SCATTER(i, j, idx));
+      compare<Scalar, Packet>(block.packet[idx], line);
     }
+  }
 };
 
-template<typename Scalar, int StorageOrder, int BlockSize>
-void run_bdmp_spec_1()
-{
-    typedef internal::blas_data_mapper<Scalar, int, StorageOrder> BlasDataMapper;
-    int packetSize = internal::packet_traits<Scalar>::size;
-    int minSize = std::max<int>(packetSize, BlockSize);
-    typedef typename internal::packet_traits<Scalar>::type Packet;
+template <typename Scalar, int StorageOrder, int BlockSize>
+void run_bdmp_spec_1() {
+  typedef internal::blas_data_mapper<Scalar, int, StorageOrder> BlasDataMapper;
+  int packetSize = internal::packet_traits<Scalar>::size;
+  int minSize = std::max<int>(packetSize, BlockSize);
+  typedef typename internal::packet_traits<Scalar>::type Packet;
 
-    int szm = internal::random<int>(minSize,500), szn = internal::random<int>(minSize,500);
-    int stride = StorageOrder == RowMajor ? szn : szm;
-    Scalar *d = new Scalar[szn*szm];
+  int szm = internal::random<int>(minSize, 500), szn = internal::random<int>(minSize, 500);
+  int stride = StorageOrder == RowMajor ? szn : szm;
+  Scalar* d = new Scalar[szn * szm];
 
-    // Initializing with random entries
-    for(int i = 0; i < szm*szn; i++)
-    {
-        d[i] = internal::random<Scalar>(static_cast<Scalar>(3), static_cast<Scalar>(10));
+  // Initializing with random entries
+  for (int i = 0; i < szm * szn; i++) {
+    d[i] = internal::random<Scalar>(static_cast<Scalar>(3), static_cast<Scalar>(10));
+  }
+
+  BlasDataMapper bdm(d, stride);
+
+  // Testing operator()
+  for (int i = 0; i < szm; i++) {
+    for (int j = 0; j < szn; j++) {
+      VERIFY_IS_EQUAL(d[GET(i, j)], bdm(i, j));
     }
+  }
 
-    BlasDataMapper bdm(d, stride);
+  // Testing getSubMapper and getLinearMapper
+  int i0 = internal::random<int>(0, szm - 2);
+  int j0 = internal::random<int>(0, szn - 2);
+  for (int i = i0; i < szm; i++) {
+    for (int j = j0; j < szn; j++) {
+      const BlasDataMapper& bdmSM = bdm.getSubMapper(i0, j0);
+      const internal::BlasLinearMapper<Scalar, int, 0>& bdmLM = bdm.getLinearMapper(i0, j0);
 
-    // Testing operator()
-    for(int i = 0; i < szm; i++)
-    {
-        for(int j = 0; j < szn; j++)
-        {
-            VERIFY_IS_EQUAL(d[GET(i,j)], bdm(i,j));
-        }
+      Scalar v = bdmSM(i - i0, j - j0);
+      Scalar vd = d[GET(i, j)];
+      VERIFY_IS_EQUAL(vd, v);
+      VERIFY_IS_EQUAL(vd, bdmLM(GET(i - i0, j - j0)));
     }
+  }
 
-    // Testing getSubMapper and getLinearMapper
-    int i0 = internal::random<int>(0,szm-2);
-    int j0 = internal::random<int>(0,szn-2);
-    for(int i = i0; i < szm; i++)
-    {
-        for(int j = j0; j < szn; j++)
-        {
-            const BlasDataMapper& bdmSM = bdm.getSubMapper(i0,j0);
-            const internal::BlasLinearMapper<Scalar, int, 0>& bdmLM = bdm.getLinearMapper(i0,j0);
+  // Testing loadPacket
+  for (int i = 0; i < szm - minSize; i++) {
+    for (int j = 0; j < szn - minSize; j++) {
+      Packet pktBDM = bdm.template loadPacket<Packet>(i, j);
+      Packet pktD = internal::ploadu<Packet>(d + GET(i, j));
 
-            Scalar v = bdmSM(i - i0, j - j0);
-            Scalar vd = d[GET(i,j)];
-            VERIFY_IS_EQUAL(vd, v);
-            VERIFY_IS_EQUAL(vd, bdmLM(GET(i-i0, j-j0)));
-        }
+      compare<Scalar, Packet>(pktBDM, pktD);
     }
+  }
 
-    // Testing loadPacket
-    for(int i = 0; i < szm - minSize; i++)
-    {
-        for(int j = 0; j < szn - minSize; j++)
-        {
-            Packet pktBDM = bdm.template loadPacket<Packet>(i,j);
-            Packet pktD = internal::ploadu<Packet>(d + GET(i,j));
+  // Testing gatherPacket
+  Scalar* buff = new Scalar[packetSize];
+  for (int i = 0; i < szm - minSize; i++) {
+    for (int j = 0; j < szn - minSize; j++) {
+      Packet p = bdm.template gatherPacket<Packet>(i, j);
+      internal::pstoreu<Scalar, Packet>(buff, p);
 
-            compare<Scalar, Packet>(pktBDM, pktD);
-        }
+      for (int k = 0; k < packetSize; k++) {
+        VERIFY_IS_EQUAL(d[SCATTER(i, j, k)], buff[k]);
+      }
     }
+  }
+  delete[] buff;
 
-    // Testing gatherPacket
-    Scalar *buff = new Scalar[packetSize];
-    for(int i = 0; i < szm - minSize; i++)
-    {
-        for(int j = 0; j < szn - minSize; j++)
-        {
-            Packet p = bdm.template gatherPacket<Packet>(i,j);
-            internal::pstoreu<Scalar, Packet>(buff, p);
-
-            for(int k = 0; k < packetSize; k++)
-            {
-                VERIFY_IS_EQUAL(d[SCATTER(i,j,k)], buff[k]);
-            }
-
-        }
+  // Testing scatterPacket
+  for (int i = 0; i < szm - minSize; i++) {
+    for (int j = 0; j < szn - minSize; j++) {
+      Packet p = internal::pset1<Packet>(static_cast<Scalar>(1));
+      bdm.template scatterPacket<Packet>(i, j, p);
+      for (int k = 0; k < packetSize; k++) {
+        VERIFY_IS_EQUAL(d[SCATTER(i, j, k)], static_cast<Scalar>(1));
+      }
     }
-    delete[] buff;
+  }
 
-    // Testing scatterPacket
-    for(int i = 0; i < szm - minSize; i++)
-    {
-        for(int j = 0; j < szn - minSize; j++)
-        {
-            Packet p = internal::pset1<Packet>(static_cast<Scalar>(1));
-            bdm.template scatterPacket<Packet>(i,j,p);
-            for(int k = 0; k < packetSize; k++)
-            {
-                VERIFY_IS_EQUAL(d[SCATTER(i,j,k)], static_cast<Scalar>(1));
-            }
-        }
+  // Testing storePacketBlock
+  internal::PacketBlock<Packet, BlockSize> block;
+
+  PacketBlockSet<Scalar, StorageOrder, BlockSize> pbs;
+  pbs.setPacketBlock(block, static_cast<Scalar>(2));
+
+  for (int i = 0; i < szm - minSize; i++) {
+    for (int j = 0; j < szn - minSize; j++) {
+      bdm.template storePacketBlock<Packet, BlockSize>(i, j, block);
+
+      pbs.comparePacketBlock(d, i, j, stride, block);
     }
+  }
 
-    //Testing storePacketBlock
-    internal::PacketBlock<Packet, BlockSize> block;
-
-    PacketBlockSet<Scalar, StorageOrder, BlockSize> pbs;
-    pbs.setPacketBlock(block, static_cast<Scalar>(2));
-
-    for(int i = 0; i < szm - minSize; i++)
-    {
-        for(int j = 0; j < szn - minSize; j++)
-        {
-            bdm.template storePacketBlock<Packet, BlockSize>(i, j, block);
-
-            pbs.comparePacketBlock(d, i, j, stride, block);
-        }
-    }
-
-    delete[] d;
+  delete[] d;
 }
 
-template<typename Scalar>
-void run_test()
-{
-    run_bdmp_spec_1<Scalar, RowMajor, 1>();
-    run_bdmp_spec_1<Scalar, ColMajor, 1>();
-    run_bdmp_spec_1<Scalar, RowMajor, 2>();
-    run_bdmp_spec_1<Scalar, ColMajor, 2>();
-    run_bdmp_spec_1<Scalar, RowMajor, 4>();
-    run_bdmp_spec_1<Scalar, ColMajor, 4>();
-    run_bdmp_spec_1<Scalar, RowMajor, 8>();
-    run_bdmp_spec_1<Scalar, ColMajor, 8>();
-    run_bdmp_spec_1<Scalar, RowMajor, 16>();
-    run_bdmp_spec_1<Scalar, ColMajor, 16>();
+template <typename Scalar>
+void run_test() {
+  run_bdmp_spec_1<Scalar, RowMajor, 1>();
+  run_bdmp_spec_1<Scalar, ColMajor, 1>();
+  run_bdmp_spec_1<Scalar, RowMajor, 2>();
+  run_bdmp_spec_1<Scalar, ColMajor, 2>();
+  run_bdmp_spec_1<Scalar, RowMajor, 4>();
+  run_bdmp_spec_1<Scalar, ColMajor, 4>();
+  run_bdmp_spec_1<Scalar, RowMajor, 8>();
+  run_bdmp_spec_1<Scalar, ColMajor, 8>();
+  run_bdmp_spec_1<Scalar, RowMajor, 16>();
+  run_bdmp_spec_1<Scalar, ColMajor, 16>();
 }
 
-EIGEN_DECLARE_TEST(blasutil)
-{
-    for(int i = 0; i < g_repeat; i++)
-    {
-        CALL_SUBTEST_1(run_test<numext::int8_t>());
-        CALL_SUBTEST_2(run_test<numext::int16_t>());
-        CALL_SUBTEST_3(run_test<numext::int32_t>());
+EIGEN_DECLARE_TEST(blasutil) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(run_test<numext::int8_t>());
+    CALL_SUBTEST_2(run_test<numext::int16_t>());
+    CALL_SUBTEST_3(run_test<numext::int32_t>());
 
-// TODO: Replace this by a call to numext::int64_t as soon as we have a way to
-// detect the typedef for int64_t on all platforms
-        CALL_SUBTEST_4(run_test<signed long long>());
-        CALL_SUBTEST_5(run_test<float_t>());
-        CALL_SUBTEST_6(run_test<double_t>());
-        CALL_SUBTEST_7(run_test<std::complex<float> >());
-        CALL_SUBTEST_8(run_test<std::complex<double> >());
-    }
+    // TODO: Replace this by a call to numext::int64_t as soon as we have a way to
+    // detect the typedef for int64_t on all platforms
+    CALL_SUBTEST_4(run_test<signed long long>());
+    CALL_SUBTEST_5(run_test<float_t>());
+    CALL_SUBTEST_6(run_test<double_t>());
+    CALL_SUBTEST_7(run_test<std::complex<float> >());
+    CALL_SUBTEST_8(run_test<std::complex<double> >());
+  }
 }
diff --git a/test/block.cpp b/test/block.cpp
index 867b769..9f96498 100644
--- a/test/block.cpp
+++ b/test/block.cpp
@@ -9,78 +9,73 @@
 
 #include "main.h"
 
-template<typename MatrixType, typename Index, typename Scalar>
-std::enable_if_t<!NumTraits<typename MatrixType::Scalar>::IsComplex,typename MatrixType::Scalar>
-block_real_only(const MatrixType &m1, Index r1, Index r2, Index c1, Index c2, const Scalar& s1) {
+template <typename MatrixType, typename Index, typename Scalar>
+std::enable_if_t<!NumTraits<typename MatrixType::Scalar>::IsComplex, typename MatrixType::Scalar> block_real_only(
+    const MatrixType& m1, Index r1, Index r2, Index c1, Index c2, const Scalar& s1) {
   // check cwise-Functions:
   VERIFY_IS_APPROX(m1.row(r1).cwiseMax(s1), m1.cwiseMax(s1).row(r1));
   VERIFY_IS_APPROX(m1.col(c1).cwiseMin(s1), m1.cwiseMin(s1).col(c1));
 
-  VERIFY_IS_APPROX(m1.block(r1,c1,r2-r1+1,c2-c1+1).cwiseMin(s1), m1.cwiseMin(s1).block(r1,c1,r2-r1+1,c2-c1+1));
-  VERIFY_IS_APPROX(m1.block(r1,c1,r2-r1+1,c2-c1+1).cwiseMax(s1), m1.cwiseMax(s1).block(r1,c1,r2-r1+1,c2-c1+1));
-  
+  VERIFY_IS_APPROX(m1.block(r1, c1, r2 - r1 + 1, c2 - c1 + 1).cwiseMin(s1),
+                   m1.cwiseMin(s1).block(r1, c1, r2 - r1 + 1, c2 - c1 + 1));
+  VERIFY_IS_APPROX(m1.block(r1, c1, r2 - r1 + 1, c2 - c1 + 1).cwiseMax(s1),
+                   m1.cwiseMax(s1).block(r1, c1, r2 - r1 + 1, c2 - c1 + 1));
+
   return Scalar(0);
 }
 
-template<typename MatrixType, typename Index, typename Scalar>
-std::enable_if_t<NumTraits<typename MatrixType::Scalar>::IsComplex,typename MatrixType::Scalar>
-block_real_only(const MatrixType &, Index, Index, Index, Index, const Scalar&) {
+template <typename MatrixType, typename Index, typename Scalar>
+std::enable_if_t<NumTraits<typename MatrixType::Scalar>::IsComplex, typename MatrixType::Scalar> block_real_only(
+    const MatrixType&, Index, Index, Index, Index, const Scalar&) {
   return Scalar(0);
 }
 
 // Check at compile-time that T1==T2, and at runtime-time that a==b
-template<typename T1,typename T2>
-std::enable_if_t<internal::is_same<T1,T2>::value,bool>
-is_same_block(const T1& a, const T2& b)
-{
+template <typename T1, typename T2>
+std::enable_if_t<internal::is_same<T1, T2>::value, bool> is_same_block(const T1& a, const T2& b) {
   return a.isApprox(b);
 }
 
 template <typename MatrixType>
-std::enable_if_t<((MatrixType::Flags&RowMajorBit)==0),void>
-check_left_top(const MatrixType& m, Index r, Index c,
-               Index rows, Index /*unused*/) {
-  if(c > 0) VERIFY_IS_EQUAL(m.leftCols(c).coeff(r+c*rows), m(r,c));
+std::enable_if_t<((MatrixType::Flags & RowMajorBit) == 0), void> check_left_top(const MatrixType& m, Index r, Index c,
+                                                                                Index rows, Index /*unused*/) {
+  if (c > 0) VERIFY_IS_EQUAL(m.leftCols(c).coeff(r + c * rows), m(r, c));
 }
 
 template <typename MatrixType>
-std::enable_if_t<((MatrixType::Flags&RowMajorBit)!=0),void>
-check_left_top(const MatrixType& m,  Index r, Index c,
-               Index /*unused*/, Index cols) {
-  if(r > 0) VERIFY_IS_EQUAL(m.topRows(r).coeff(c+r*cols), m(r,c));
+std::enable_if_t<((MatrixType::Flags & RowMajorBit) != 0), void> check_left_top(const MatrixType& m, Index r, Index c,
+                                                                                Index /*unused*/, Index cols) {
+  if (r > 0) VERIFY_IS_EQUAL(m.topRows(r).coeff(c + r * cols), m(r, c));
 }
 
-template<typename MatrixType> void block(const MatrixType& m)
-{
+template <typename MatrixType>
+void block(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
   typedef typename MatrixType::RealScalar RealScalar;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
   typedef Matrix<Scalar, 1, MatrixType::ColsAtCompileTime> RowVectorType;
-  typedef Matrix<Scalar, Dynamic, Dynamic, MatrixType::IsRowMajor?RowMajor:ColMajor> DynamicMatrixType;
+  typedef Matrix<Scalar, Dynamic, Dynamic, MatrixType::IsRowMajor ? RowMajor : ColMajor> DynamicMatrixType;
   typedef Matrix<Scalar, Dynamic, 1> DynamicVectorType;
-  
+
   Index rows = m.rows();
   Index cols = m.cols();
 
-  MatrixType m1 = MatrixType::Random(rows, cols),
-             m1_copy = m1,
-             m2 = MatrixType::Random(rows, cols),
-             m3(rows, cols),
+  MatrixType m1 = MatrixType::Random(rows, cols), m1_copy = m1, m2 = MatrixType::Random(rows, cols), m3(rows, cols),
              ones = MatrixType::Ones(rows, cols);
   VectorType v1 = VectorType::Random(rows);
 
   Scalar s1 = internal::random<Scalar>();
 
-  Index r1 = internal::random<Index>(0,rows-1);
-  Index r2 = internal::random<Index>(r1,rows-1);
-  Index c1 = internal::random<Index>(0,cols-1);
-  Index c2 = internal::random<Index>(c1,cols-1);
+  Index r1 = internal::random<Index>(0, rows - 1);
+  Index r2 = internal::random<Index>(r1, rows - 1);
+  Index c1 = internal::random<Index>(0, cols - 1);
+  Index c2 = internal::random<Index>(c1, cols - 1);
 
   block_real_only(m1, r1, r2, c1, c1, s1);
 
-  //check row() and col()
+  // check row() and col()
   VERIFY_IS_EQUAL(m1.col(c1).transpose(), m1.transpose().row(c1));
-  //check operator(), both constant and non-constant, on row() and col()
+  // check operator(), both constant and non-constant, on row() and col()
   m1 = m1_copy;
   m1.row(r1) += s1 * m1_copy.row(r2);
   VERIFY_IS_APPROX(m1.row(r1), m1_copy.row(r1) + s1 * m1_copy.row(r2));
@@ -93,59 +88,62 @@
   m1.col(c1).col(0) += s1 * m1_copy.col(c2);
   VERIFY_IS_APPROX(m1.col(c1), m1_copy.col(c1) + Scalar(2) * s1 * m1_copy.col(c2));
 
-  check_left_top(m1,r1,c1,rows,cols);
-  
-  //check block()
-  Matrix<Scalar,Dynamic,Dynamic> b1(1,1); b1(0,0) = m1(r1,c1);
+  check_left_top(m1, r1, c1, rows, cols);
 
-  RowVectorType br1(m1.block(r1,0,1,cols));
-  VectorType bc1(m1.block(0,c1,rows,1));
-  VERIFY_IS_EQUAL(b1, m1.block(r1,c1,1,1));
+  // check block()
+  Matrix<Scalar, Dynamic, Dynamic> b1(1, 1);
+  b1(0, 0) = m1(r1, c1);
+
+  RowVectorType br1(m1.block(r1, 0, 1, cols));
+  VectorType bc1(m1.block(0, c1, rows, 1));
+  VERIFY_IS_EQUAL(b1, m1.block(r1, c1, 1, 1));
   VERIFY_IS_EQUAL(m1.row(r1), br1);
   VERIFY_IS_EQUAL(m1.col(c1), bc1);
-  //check operator(), both constant and non-constant, on block()
-  m1.block(r1,c1,r2-r1+1,c2-c1+1) = s1 * m2.block(0, 0, r2-r1+1,c2-c1+1);
-  m1.block(r1,c1,r2-r1+1,c2-c1+1)(r2-r1,c2-c1) = m2.block(0, 0, r2-r1+1,c2-c1+1)(0,0);
+  // check operator(), both constant and non-constant, on block()
+  m1.block(r1, c1, r2 - r1 + 1, c2 - c1 + 1) = s1 * m2.block(0, 0, r2 - r1 + 1, c2 - c1 + 1);
+  m1.block(r1, c1, r2 - r1 + 1, c2 - c1 + 1)(r2 - r1, c2 - c1) = m2.block(0, 0, r2 - r1 + 1, c2 - c1 + 1)(0, 0);
 
   const Index BlockRows = 2;
   const Index BlockCols = 5;
 
-  if (rows>=5 && cols>=8)
-  {
+  if (rows >= 5 && cols >= 8) {
     // test fixed block() as lvalue
-    m1.template block<BlockRows,BlockCols>(1,1) *= s1;
+    m1.template block<BlockRows, BlockCols>(1, 1) *= s1;
     // test operator() on fixed block() both as constant and non-constant
-    m1.template block<BlockRows,BlockCols>(1,1)(0, 3) = m1.template block<2,5>(1,1)(1,2);
+    m1.template block<BlockRows, BlockCols>(1, 1)(0, 3) = m1.template block<2, 5>(1, 1)(1, 2);
     // check that fixed block() and block() agree
-    Matrix<Scalar,Dynamic,Dynamic> b = m1.template block<BlockRows,BlockCols>(3,3);
-    VERIFY_IS_EQUAL(b, m1.block(3,3,BlockRows,BlockCols));
+    Matrix<Scalar, Dynamic, Dynamic> b = m1.template block<BlockRows, BlockCols>(3, 3);
+    VERIFY_IS_EQUAL(b, m1.block(3, 3, BlockRows, BlockCols));
 
     // same tests with mixed fixed/dynamic size
-    m1.template block<BlockRows,Dynamic>(1,1,BlockRows,BlockCols) *= s1;
-    m1.template block<BlockRows,Dynamic>(1,1,BlockRows,BlockCols)(0,3) = m1.template block<2,5>(1,1)(1,2);
-    Matrix<Scalar,Dynamic,Dynamic> b2 = m1.template block<Dynamic,BlockCols>(3,3,2,5);
-    VERIFY_IS_EQUAL(b2, m1.block(3,3,BlockRows,BlockCols));
+    m1.template block<BlockRows, Dynamic>(1, 1, BlockRows, BlockCols) *= s1;
+    m1.template block<BlockRows, Dynamic>(1, 1, BlockRows, BlockCols)(0, 3) = m1.template block<2, 5>(1, 1)(1, 2);
+    Matrix<Scalar, Dynamic, Dynamic> b2 = m1.template block<Dynamic, BlockCols>(3, 3, 2, 5);
+    VERIFY_IS_EQUAL(b2, m1.block(3, 3, BlockRows, BlockCols));
 
-    VERIFY(is_same_block(m1.block(3,3,BlockRows,BlockCols), m1.block(3,3,fix<Dynamic>(BlockRows),fix<Dynamic>(BlockCols))));
-    VERIFY(is_same_block(m1.template block<BlockRows,Dynamic>(1,1,BlockRows,BlockCols), m1.block(1,1,fix<BlockRows>,BlockCols)));
-    VERIFY(is_same_block(m1.template block<BlockRows,BlockCols>(1,1,BlockRows,BlockCols), m1.block(1,1,fix<BlockRows>(),fix<BlockCols>)));
-    VERIFY(is_same_block(m1.template block<BlockRows,BlockCols>(1,1,BlockRows,BlockCols), m1.block(1,1,fix<BlockRows>,fix<BlockCols>(BlockCols))));
+    VERIFY(is_same_block(m1.block(3, 3, BlockRows, BlockCols),
+                         m1.block(3, 3, fix<Dynamic>(BlockRows), fix<Dynamic>(BlockCols))));
+    VERIFY(is_same_block(m1.template block<BlockRows, Dynamic>(1, 1, BlockRows, BlockCols),
+                         m1.block(1, 1, fix<BlockRows>, BlockCols)));
+    VERIFY(is_same_block(m1.template block<BlockRows, BlockCols>(1, 1, BlockRows, BlockCols),
+                         m1.block(1, 1, fix<BlockRows>(), fix<BlockCols>)));
+    VERIFY(is_same_block(m1.template block<BlockRows, BlockCols>(1, 1, BlockRows, BlockCols),
+                         m1.block(1, 1, fix<BlockRows>, fix<BlockCols>(BlockCols))));
   }
 
-  if (rows>2)
-  {
+  if (rows > 2) {
     // test sub vectors
-    VERIFY_IS_EQUAL(v1.template head<2>(), v1.block(0,0,2,1));
+    VERIFY_IS_EQUAL(v1.template head<2>(), v1.block(0, 0, 2, 1));
     VERIFY_IS_EQUAL(v1.template head<2>(), v1.head(2));
-    VERIFY_IS_EQUAL(v1.template head<2>(), v1.segment(0,2));
+    VERIFY_IS_EQUAL(v1.template head<2>(), v1.segment(0, 2));
     VERIFY_IS_EQUAL(v1.template head<2>(), v1.template segment<2>(0));
-    Index i = rows-2;
-    VERIFY_IS_EQUAL(v1.template tail<2>(), v1.block(i,0,2,1));
+    Index i = rows - 2;
+    VERIFY_IS_EQUAL(v1.template tail<2>(), v1.block(i, 0, 2, 1));
     VERIFY_IS_EQUAL(v1.template tail<2>(), v1.tail(2));
-    VERIFY_IS_EQUAL(v1.template tail<2>(), v1.segment(i,2));
+    VERIFY_IS_EQUAL(v1.template tail<2>(), v1.segment(i, 2));
     VERIFY_IS_EQUAL(v1.template tail<2>(), v1.template segment<2>(i));
-    i = internal::random<Index>(0,rows-2);
-    VERIFY_IS_EQUAL(v1.segment(i,2), v1.template segment<2>(i));
+    i = internal::random<Index>(0, rows - 2);
+    VERIFY_IS_EQUAL(v1.segment(i, 2), v1.template segment<2>(i));
   }
 
   // stress some basic stuffs with block matrices
@@ -154,98 +152,107 @@
 
   VERIFY_IS_EQUAL(numext::real(ones.col(c1).dot(ones.col(c2))), RealScalar(rows));
   VERIFY_IS_EQUAL(numext::real(ones.row(r1).dot(ones.row(r2))), RealScalar(cols));
-  
+
   // check that linear acccessors works on blocks
   m1 = m1_copy;
 
   // now test some block-inside-of-block.
-  
+
   // expressions with direct access
-  VERIFY_IS_EQUAL( (m1.block(r1,c1,rows-r1,cols-c1).block(r2-r1,c2-c1,rows-r2,cols-c2)) , (m1.block(r2,c2,rows-r2,cols-c2)) );
-  VERIFY_IS_EQUAL( (m1.block(r1,c1,r2-r1+1,c2-c1+1).row(0)) , (m1.row(r1).segment(c1,c2-c1+1)) );
-  VERIFY_IS_EQUAL( (m1.block(r1,c1,r2-r1+1,c2-c1+1).col(0)) , (m1.col(c1).segment(r1,r2-r1+1)) );
-  VERIFY_IS_EQUAL( (m1.block(r1,c1,r2-r1+1,c2-c1+1).transpose().col(0)) , (m1.row(r1).segment(c1,c2-c1+1)).transpose() );
-  VERIFY_IS_EQUAL( (m1.transpose().block(c1,r1,c2-c1+1,r2-r1+1).col(0)) , (m1.row(r1).segment(c1,c2-c1+1)).transpose() );
+  VERIFY_IS_EQUAL((m1.block(r1, c1, rows - r1, cols - c1).block(r2 - r1, c2 - c1, rows - r2, cols - c2)),
+                  (m1.block(r2, c2, rows - r2, cols - c2)));
+  VERIFY_IS_EQUAL((m1.block(r1, c1, r2 - r1 + 1, c2 - c1 + 1).row(0)), (m1.row(r1).segment(c1, c2 - c1 + 1)));
+  VERIFY_IS_EQUAL((m1.block(r1, c1, r2 - r1 + 1, c2 - c1 + 1).col(0)), (m1.col(c1).segment(r1, r2 - r1 + 1)));
+  VERIFY_IS_EQUAL((m1.block(r1, c1, r2 - r1 + 1, c2 - c1 + 1).transpose().col(0)),
+                  (m1.row(r1).segment(c1, c2 - c1 + 1)).transpose());
+  VERIFY_IS_EQUAL((m1.transpose().block(c1, r1, c2 - c1 + 1, r2 - r1 + 1).col(0)),
+                  (m1.row(r1).segment(c1, c2 - c1 + 1)).transpose());
 
   // expressions without direct access
-  VERIFY_IS_APPROX( ((m1+m2).block(r1,c1,rows-r1,cols-c1).block(r2-r1,c2-c1,rows-r2,cols-c2)) , ((m1+m2).block(r2,c2,rows-r2,cols-c2)) );
-  VERIFY_IS_APPROX( ((m1+m2).block(r1,c1,r2-r1+1,c2-c1+1).row(0)) , ((m1+m2).row(r1).segment(c1,c2-c1+1)) );
-  VERIFY_IS_APPROX( ((m1+m2).block(r1,c1,r2-r1+1,c2-c1+1).row(0)) , ((m1+m2).eval().row(r1).segment(c1,c2-c1+1)) );
-  VERIFY_IS_APPROX( ((m1+m2).block(r1,c1,r2-r1+1,c2-c1+1).col(0)) , ((m1+m2).col(c1).segment(r1,r2-r1+1)) );
-  VERIFY_IS_APPROX( ((m1+m2).block(r1,c1,r2-r1+1,c2-c1+1).transpose().col(0)) , ((m1+m2).row(r1).segment(c1,c2-c1+1)).transpose() );
-  VERIFY_IS_APPROX( ((m1+m2).transpose().block(c1,r1,c2-c1+1,r2-r1+1).col(0)) , ((m1+m2).row(r1).segment(c1,c2-c1+1)).transpose() );
-  VERIFY_IS_APPROX( ((m1+m2).template block<Dynamic,1>(r1,c1,r2-r1+1,1)) , ((m1+m2).eval().col(c1).eval().segment(r1,r2-r1+1)) );
-  VERIFY_IS_APPROX( ((m1+m2).template block<1,Dynamic>(r1,c1,1,c2-c1+1)) , ((m1+m2).eval().row(r1).eval().segment(c1,c2-c1+1)) );
-  VERIFY_IS_APPROX( ((m1+m2).transpose().template block<1,Dynamic>(c1,r1,1,r2-r1+1)) , ((m1+m2).eval().col(c1).eval().segment(r1,r2-r1+1)).transpose() );
-  VERIFY_IS_APPROX( (m1+m2).row(r1).eval(), (m1+m2).eval().row(r1) );
-  VERIFY_IS_APPROX( (m1+m2).adjoint().col(r1).eval(), (m1+m2).adjoint().eval().col(r1) );
-  VERIFY_IS_APPROX( (m1+m2).adjoint().row(c1).eval(), (m1+m2).adjoint().eval().row(c1) );
-  VERIFY_IS_APPROX( (m1*1).row(r1).segment(c1,c2-c1+1).eval(), m1.row(r1).eval().segment(c1,c2-c1+1).eval() );
-  VERIFY_IS_APPROX( m1.col(c1).reverse().segment(r1,r2-r1+1).eval(),m1.col(c1).reverse().eval().segment(r1,r2-r1+1).eval() );
+  VERIFY_IS_APPROX(((m1 + m2).block(r1, c1, rows - r1, cols - c1).block(r2 - r1, c2 - c1, rows - r2, cols - c2)),
+                   ((m1 + m2).block(r2, c2, rows - r2, cols - c2)));
+  VERIFY_IS_APPROX(((m1 + m2).block(r1, c1, r2 - r1 + 1, c2 - c1 + 1).row(0)),
+                   ((m1 + m2).row(r1).segment(c1, c2 - c1 + 1)));
+  VERIFY_IS_APPROX(((m1 + m2).block(r1, c1, r2 - r1 + 1, c2 - c1 + 1).row(0)),
+                   ((m1 + m2).eval().row(r1).segment(c1, c2 - c1 + 1)));
+  VERIFY_IS_APPROX(((m1 + m2).block(r1, c1, r2 - r1 + 1, c2 - c1 + 1).col(0)),
+                   ((m1 + m2).col(c1).segment(r1, r2 - r1 + 1)));
+  VERIFY_IS_APPROX(((m1 + m2).block(r1, c1, r2 - r1 + 1, c2 - c1 + 1).transpose().col(0)),
+                   ((m1 + m2).row(r1).segment(c1, c2 - c1 + 1)).transpose());
+  VERIFY_IS_APPROX(((m1 + m2).transpose().block(c1, r1, c2 - c1 + 1, r2 - r1 + 1).col(0)),
+                   ((m1 + m2).row(r1).segment(c1, c2 - c1 + 1)).transpose());
+  VERIFY_IS_APPROX(((m1 + m2).template block<Dynamic, 1>(r1, c1, r2 - r1 + 1, 1)),
+                   ((m1 + m2).eval().col(c1).eval().segment(r1, r2 - r1 + 1)));
+  VERIFY_IS_APPROX(((m1 + m2).template block<1, Dynamic>(r1, c1, 1, c2 - c1 + 1)),
+                   ((m1 + m2).eval().row(r1).eval().segment(c1, c2 - c1 + 1)));
+  VERIFY_IS_APPROX(((m1 + m2).transpose().template block<1, Dynamic>(c1, r1, 1, r2 - r1 + 1)),
+                   ((m1 + m2).eval().col(c1).eval().segment(r1, r2 - r1 + 1)).transpose());
+  VERIFY_IS_APPROX((m1 + m2).row(r1).eval(), (m1 + m2).eval().row(r1));
+  VERIFY_IS_APPROX((m1 + m2).adjoint().col(r1).eval(), (m1 + m2).adjoint().eval().col(r1));
+  VERIFY_IS_APPROX((m1 + m2).adjoint().row(c1).eval(), (m1 + m2).adjoint().eval().row(c1));
+  VERIFY_IS_APPROX((m1 * 1).row(r1).segment(c1, c2 - c1 + 1).eval(), m1.row(r1).eval().segment(c1, c2 - c1 + 1).eval());
+  VERIFY_IS_APPROX(m1.col(c1).reverse().segment(r1, r2 - r1 + 1).eval(),
+                   m1.col(c1).reverse().eval().segment(r1, r2 - r1 + 1).eval());
 
-  VERIFY_IS_APPROX( (m1*1).topRows(r1),  m1.topRows(r1) );
-  VERIFY_IS_APPROX( (m1*1).leftCols(c1), m1.leftCols(c1) );
-  VERIFY_IS_APPROX( (m1*1).transpose().topRows(c1), m1.transpose().topRows(c1) );
-  VERIFY_IS_APPROX( (m1*1).transpose().leftCols(r1), m1.transpose().leftCols(r1) );
-  VERIFY_IS_APPROX( (m1*1).transpose().middleRows(c1,c2-c1+1), m1.transpose().middleRows(c1,c2-c1+1) );
-  VERIFY_IS_APPROX( (m1*1).transpose().middleCols(r1,r2-r1+1), m1.transpose().middleCols(r1,r2-r1+1) );
+  VERIFY_IS_APPROX((m1 * 1).topRows(r1), m1.topRows(r1));
+  VERIFY_IS_APPROX((m1 * 1).leftCols(c1), m1.leftCols(c1));
+  VERIFY_IS_APPROX((m1 * 1).transpose().topRows(c1), m1.transpose().topRows(c1));
+  VERIFY_IS_APPROX((m1 * 1).transpose().leftCols(r1), m1.transpose().leftCols(r1));
+  VERIFY_IS_APPROX((m1 * 1).transpose().middleRows(c1, c2 - c1 + 1), m1.transpose().middleRows(c1, c2 - c1 + 1));
+  VERIFY_IS_APPROX((m1 * 1).transpose().middleCols(r1, r2 - r1 + 1), m1.transpose().middleCols(r1, r2 - r1 + 1));
 
   // evaluation into plain matrices from expressions with direct access (stress MapBase)
   DynamicMatrixType dm;
   DynamicVectorType dv;
   dm.setZero();
-  dm = m1.block(r1,c1,rows-r1,cols-c1).block(r2-r1,c2-c1,rows-r2,cols-c2);
-  VERIFY_IS_EQUAL(dm, (m1.block(r2,c2,rows-r2,cols-c2)));
+  dm = m1.block(r1, c1, rows - r1, cols - c1).block(r2 - r1, c2 - c1, rows - r2, cols - c2);
+  VERIFY_IS_EQUAL(dm, (m1.block(r2, c2, rows - r2, cols - c2)));
   dm.setZero();
   dv.setZero();
-  dm = m1.block(r1,c1,r2-r1+1,c2-c1+1).row(0).transpose();
-  dv = m1.row(r1).segment(c1,c2-c1+1);
+  dm = m1.block(r1, c1, r2 - r1 + 1, c2 - c1 + 1).row(0).transpose();
+  dv = m1.row(r1).segment(c1, c2 - c1 + 1);
   VERIFY_IS_EQUAL(dv, dm);
   dm.setZero();
   dv.setZero();
-  dm = m1.col(c1).segment(r1,r2-r1+1);
-  dv = m1.block(r1,c1,r2-r1+1,c2-c1+1).col(0);
+  dm = m1.col(c1).segment(r1, r2 - r1 + 1);
+  dv = m1.block(r1, c1, r2 - r1 + 1, c2 - c1 + 1).col(0);
   VERIFY_IS_EQUAL(dv, dm);
   dm.setZero();
   dv.setZero();
-  dm = m1.block(r1,c1,r2-r1+1,c2-c1+1).transpose().col(0);
-  dv = m1.row(r1).segment(c1,c2-c1+1);
+  dm = m1.block(r1, c1, r2 - r1 + 1, c2 - c1 + 1).transpose().col(0);
+  dv = m1.row(r1).segment(c1, c2 - c1 + 1);
   VERIFY_IS_EQUAL(dv, dm);
   dm.setZero();
   dv.setZero();
-  dm = m1.row(r1).segment(c1,c2-c1+1).transpose();
-  dv = m1.transpose().block(c1,r1,c2-c1+1,r2-r1+1).col(0);
+  dm = m1.row(r1).segment(c1, c2 - c1 + 1).transpose();
+  dv = m1.transpose().block(c1, r1, c2 - c1 + 1, r2 - r1 + 1).col(0);
   VERIFY_IS_EQUAL(dv, dm);
 
-  VERIFY_IS_EQUAL( (m1.template block<Dynamic,1>(1,0,0,1)), m1.block(1,0,0,1));
-  VERIFY_IS_EQUAL( (m1.template block<1,Dynamic>(0,1,1,0)), m1.block(0,1,1,0));
-  VERIFY_IS_EQUAL( ((m1*1).template block<Dynamic,1>(1,0,0,1)), m1.block(1,0,0,1));
-  VERIFY_IS_EQUAL( ((m1*1).template block<1,Dynamic>(0,1,1,0)), m1.block(0,1,1,0));
+  VERIFY_IS_EQUAL((m1.template block<Dynamic, 1>(1, 0, 0, 1)), m1.block(1, 0, 0, 1));
+  VERIFY_IS_EQUAL((m1.template block<1, Dynamic>(0, 1, 1, 0)), m1.block(0, 1, 1, 0));
+  VERIFY_IS_EQUAL(((m1 * 1).template block<Dynamic, 1>(1, 0, 0, 1)), m1.block(1, 0, 0, 1));
+  VERIFY_IS_EQUAL(((m1 * 1).template block<1, Dynamic>(0, 1, 1, 0)), m1.block(0, 1, 1, 0));
 
-  VERIFY_IS_EQUAL( m1.template subVector<Horizontal>(r1), m1.row(r1) );
-  VERIFY_IS_APPROX( (m1+m1).template subVector<Horizontal>(r1), (m1+m1).row(r1) );
-  VERIFY_IS_EQUAL( m1.template subVector<Vertical>(c1), m1.col(c1) );
-  VERIFY_IS_APPROX( (m1+m1).template subVector<Vertical>(c1), (m1+m1).col(c1) );
-  VERIFY_IS_EQUAL( m1.template subVectors<Horizontal>(), m1.rows() );
-  VERIFY_IS_EQUAL( m1.template subVectors<Vertical>(), m1.cols() );
+  VERIFY_IS_EQUAL(m1.template subVector<Horizontal>(r1), m1.row(r1));
+  VERIFY_IS_APPROX((m1 + m1).template subVector<Horizontal>(r1), (m1 + m1).row(r1));
+  VERIFY_IS_EQUAL(m1.template subVector<Vertical>(c1), m1.col(c1));
+  VERIFY_IS_APPROX((m1 + m1).template subVector<Vertical>(c1), (m1 + m1).col(c1));
+  VERIFY_IS_EQUAL(m1.template subVectors<Horizontal>(), m1.rows());
+  VERIFY_IS_EQUAL(m1.template subVectors<Vertical>(), m1.cols());
 
-  if (rows>=2 || cols>=2) {
-    VERIFY_IS_EQUAL( int(m1.middleCols(0,0).IsRowMajor), int(m1.IsRowMajor) );
-    VERIFY_IS_EQUAL( m1.middleCols(0,0).outerSize(), m1.IsRowMajor ? rows : 0);
-    VERIFY_IS_EQUAL( m1.middleCols(0,0).innerSize(), m1.IsRowMajor ? 0 : rows);
+  if (rows >= 2 || cols >= 2) {
+    VERIFY_IS_EQUAL(int(m1.middleCols(0, 0).IsRowMajor), int(m1.IsRowMajor));
+    VERIFY_IS_EQUAL(m1.middleCols(0, 0).outerSize(), m1.IsRowMajor ? rows : 0);
+    VERIFY_IS_EQUAL(m1.middleCols(0, 0).innerSize(), m1.IsRowMajor ? 0 : rows);
 
-    VERIFY_IS_EQUAL( int(m1.middleRows(0,0).IsRowMajor), int(m1.IsRowMajor) );
-    VERIFY_IS_EQUAL( m1.middleRows(0,0).outerSize(), m1.IsRowMajor ? 0 : cols);
-    VERIFY_IS_EQUAL( m1.middleRows(0,0).innerSize(), m1.IsRowMajor ? cols : 0);
+    VERIFY_IS_EQUAL(int(m1.middleRows(0, 0).IsRowMajor), int(m1.IsRowMajor));
+    VERIFY_IS_EQUAL(m1.middleRows(0, 0).outerSize(), m1.IsRowMajor ? 0 : cols);
+    VERIFY_IS_EQUAL(m1.middleRows(0, 0).innerSize(), m1.IsRowMajor ? cols : 0);
   }
 }
 
-
-
-template<typename MatrixType>
-std::enable_if_t<MatrixType::IsVectorAtCompileTime,void>
-compare_using_data_and_stride(const MatrixType& m)
-{
+template <typename MatrixType>
+std::enable_if_t<MatrixType::IsVectorAtCompileTime, void> compare_using_data_and_stride(const MatrixType& m) {
   Index rows = m.rows();
   Index cols = m.cols();
   Index size = m.size();
@@ -254,19 +261,15 @@
   Index colStride = m.colStride();
   const typename MatrixType::Scalar* data = m.data();
 
-  for(int j=0;j<cols;++j)
-    for(int i=0;i<rows;++i)
-      VERIFY(m.coeff(i,j) == data[i*rowStride + j*colStride]);
+  for (int j = 0; j < cols; ++j)
+    for (int i = 0; i < rows; ++i) VERIFY(m.coeff(i, j) == data[i * rowStride + j * colStride]);
 
-  VERIFY(innerStride == int((&m.coeff(1))-(&m.coeff(0))));
-  for (int i=0;i<size;++i)
-    VERIFY(m.coeff(i) == data[i*innerStride]);
+  VERIFY(innerStride == int((&m.coeff(1)) - (&m.coeff(0))));
+  for (int i = 0; i < size; ++i) VERIFY(m.coeff(i) == data[i * innerStride]);
 }
 
-template<typename MatrixType>
-std::enable_if_t<!MatrixType::IsVectorAtCompileTime,void>
-compare_using_data_and_stride(const MatrixType& m)
-{
+template <typename MatrixType>
+std::enable_if_t<!MatrixType::IsVectorAtCompileTime, void> compare_using_data_and_stride(const MatrixType& m) {
   Index rows = m.rows();
   Index cols = m.cols();
   Index innerStride = m.innerStride();
@@ -275,38 +278,34 @@
   Index colStride = m.colStride();
   const typename MatrixType::Scalar* data = m.data();
 
-  for(int j=0;j<cols;++j)
-    for(int i=0;i<rows;++i)
-      VERIFY(m.coeff(i,j) == data[i*rowStride + j*colStride]);
+  for (int j = 0; j < cols; ++j)
+    for (int i = 0; i < rows; ++i) VERIFY(m.coeff(i, j) == data[i * rowStride + j * colStride]);
 
-  for(int j=0;j<cols;++j)
-    for(int i=0;i<rows;++i)
-      VERIFY(m.coeff(i,j) == data[(MatrixType::Flags&RowMajorBit)
-                                  ? i*outerStride + j*innerStride
-                                  : j*outerStride + i*innerStride]);
+  for (int j = 0; j < cols; ++j)
+    for (int i = 0; i < rows; ++i)
+      VERIFY(m.coeff(i, j) == data[(MatrixType::Flags & RowMajorBit) ? i * outerStride + j * innerStride
+                                                                     : j * outerStride + i * innerStride]);
 }
 
-template<typename MatrixType>
-void data_and_stride(const MatrixType& m)
-{
+template <typename MatrixType>
+void data_and_stride(const MatrixType& m) {
   Index rows = m.rows();
   Index cols = m.cols();
 
-  Index r1 = internal::random<Index>(0,rows-1);
-  Index r2 = internal::random<Index>(r1,rows-1);
-  Index c1 = internal::random<Index>(0,cols-1);
-  Index c2 = internal::random<Index>(c1,cols-1);
+  Index r1 = internal::random<Index>(0, rows - 1);
+  Index r2 = internal::random<Index>(r1, rows - 1);
+  Index c1 = internal::random<Index>(0, cols - 1);
+  Index c2 = internal::random<Index>(c1, cols - 1);
 
   MatrixType m1 = MatrixType::Random(rows, cols);
-  compare_using_data_and_stride(m1.block(r1, c1, r2-r1+1, c2-c1+1));
-  compare_using_data_and_stride(m1.transpose().block(c1, r1, c2-c1+1, r2-r1+1));
+  compare_using_data_and_stride(m1.block(r1, c1, r2 - r1 + 1, c2 - c1 + 1));
+  compare_using_data_and_stride(m1.transpose().block(c1, r1, c2 - c1 + 1, r2 - r1 + 1));
   compare_using_data_and_stride(m1.row(r1));
   compare_using_data_and_stride(m1.col(c1));
   compare_using_data_and_stride(m1.row(r1).transpose());
   compare_using_data_and_stride(m1.col(c1).transpose());
 }
 
-
 template <typename BaseXpr, typename Xpr = BaseXpr, int Depth = 0>
 struct unwind_test_impl {
   static void run(Xpr& xpr) {
@@ -343,25 +342,25 @@
   unwind_test_impl<BaseXpr>::run(xpr);
 }
 
-EIGEN_DECLARE_TEST(block)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( block(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_1( block(Matrix<float, 1, Dynamic>(internal::random(2,50))) );
-    CALL_SUBTEST_1( block(Matrix<float, Dynamic, 1>(internal::random(2,50))) );
-    CALL_SUBTEST_2( block(Matrix4d()) );
-    CALL_SUBTEST_3( block(MatrixXcf(internal::random(2,50), internal::random(2,50))) );
-    CALL_SUBTEST_4( block(MatrixXi(internal::random(2,50), internal::random(2,50))) );
-    CALL_SUBTEST_5( block(MatrixXcd(internal::random(2,50), internal::random(2,50))) );
-    CALL_SUBTEST_6( block(MatrixXf(internal::random(2,50), internal::random(2,50))) );
-    CALL_SUBTEST_7( block(Matrix<int,Dynamic,Dynamic,RowMajor>(internal::random(2,50), internal::random(2,50))) );
+EIGEN_DECLARE_TEST(block) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(block(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_1(block(Matrix<float, 1, Dynamic>(internal::random(2, 50))));
+    CALL_SUBTEST_1(block(Matrix<float, Dynamic, 1>(internal::random(2, 50))));
+    CALL_SUBTEST_2(block(Matrix4d()));
+    CALL_SUBTEST_3(block(MatrixXcf(internal::random(2, 50), internal::random(2, 50))));
+    CALL_SUBTEST_4(block(MatrixXi(internal::random(2, 50), internal::random(2, 50))));
+    CALL_SUBTEST_5(block(MatrixXcd(internal::random(2, 50), internal::random(2, 50))));
+    CALL_SUBTEST_6(block(MatrixXf(internal::random(2, 50), internal::random(2, 50))));
+    CALL_SUBTEST_7(block(Matrix<int, Dynamic, Dynamic, RowMajor>(internal::random(2, 50), internal::random(2, 50))));
 
-    CALL_SUBTEST_8( block(Matrix<float,Dynamic,4>(3, 4)) );
-    CALL_SUBTEST_9( unwind_test(MatrixXf()));
+    CALL_SUBTEST_8(block(Matrix<float, Dynamic, 4>(3, 4)));
+    CALL_SUBTEST_9(unwind_test(MatrixXf()));
 
 #ifndef EIGEN_DEFAULT_TO_ROW_MAJOR
-    CALL_SUBTEST_6( data_and_stride(MatrixXf(internal::random(5,50), internal::random(5,50))) );
-    CALL_SUBTEST_7( data_and_stride(Matrix<int,Dynamic,Dynamic,RowMajor>(internal::random(5,50), internal::random(5,50))) );
+    CALL_SUBTEST_6(data_and_stride(MatrixXf(internal::random(5, 50), internal::random(5, 50))));
+    CALL_SUBTEST_7(
+        data_and_stride(Matrix<int, Dynamic, Dynamic, RowMajor>(internal::random(5, 50), internal::random(5, 50))));
 #endif
   }
 }
diff --git a/test/boostmultiprec.cpp b/test/boostmultiprec.cpp
index 6684f74..76e80fe 100644
--- a/test/boostmultiprec.cpp
+++ b/test/boostmultiprec.cpp
@@ -77,79 +77,74 @@
 typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<100>, boost::multiprecision::et_on> Real;
 
 namespace Eigen {
-  template<> struct NumTraits<Real> : GenericNumTraits<Real> {
-    static inline Real dummy_precision() { return 1e-50; }
-  };
+template <>
+struct NumTraits<Real> : GenericNumTraits<Real> {
+  static inline Real dummy_precision() { return 1e-50; }
+};
 
-  template<typename T1,typename T2,typename T3,typename T4,typename T5>
-  struct NumTraits<boost::multiprecision::detail::expression<T1,T2,T3,T4,T5> > : NumTraits<Real> {};
+template <typename T1, typename T2, typename T3, typename T4, typename T5>
+struct NumTraits<boost::multiprecision::detail::expression<T1, T2, T3, T4, T5> > : NumTraits<Real> {};
 
-  template<>
-  Real test_precision<Real>() { return 1e-50; }
-
-  // needed in C++93 mode where number does not support explicit cast.
-  namespace internal {
-    template<typename NewType>
-    struct cast_impl<Real,NewType> {
-      static inline NewType run(const Real& x) {
-        return x.template convert_to<NewType>();
-      }
-    };
-
-    template<>
-    struct cast_impl<Real,std::complex<Real> > {
-      static inline std::complex<Real>  run(const Real& x) {
-        return std::complex<Real>(x);
-      }
-    };
-  }
+template <>
+Real test_precision<Real>() {
+  return 1e-50;
 }
 
+// needed in C++93 mode where number does not support explicit cast.
+namespace internal {
+template <typename NewType>
+struct cast_impl<Real, NewType> {
+  static inline NewType run(const Real& x) { return x.template convert_to<NewType>(); }
+};
+
+template <>
+struct cast_impl<Real, std::complex<Real> > {
+  static inline std::complex<Real> run(const Real& x) { return std::complex<Real>(x); }
+};
+}  // namespace internal
+}  // namespace Eigen
+
 namespace boost {
 namespace multiprecision {
-  // to make ADL works as expected:
-  using boost::math::isfinite;
-  using boost::math::isnan;
-  using boost::math::isinf;
-  using boost::math::copysign;
-  using boost::math::hypot;
+// to make ADL works as expected:
+using boost::math::copysign;
+using boost::math::hypot;
+using boost::math::isfinite;
+using boost::math::isinf;
+using boost::math::isnan;
 
-  // The following is needed for std::complex<Real>:
-  Real fabs(const Real& a) { return abs EIGEN_NOT_A_MACRO (a); }
-  Real fmax(const Real& a, const Real& b) { using std::max; return max(a,b); }
-
-  // some specialization for the unit tests:
-  inline bool test_isMuchSmallerThan(const Real& a, const Real& b) {
-    return internal::isMuchSmallerThan(a, b, test_precision<Real>());
-  }
-
-  inline bool test_isApprox(const Real& a, const Real& b) {
-    return internal::isApprox(a, b, test_precision<Real>());
-  }
-
-  inline bool test_isApproxOrLessThan(const Real& a, const Real& b) {
-    return internal::isApproxOrLessThan(a, b, test_precision<Real>());
-  }
-
-  Real get_test_precision(const Real&) {
-    return test_precision<Real>();
-  }
-
-  Real test_relative_error(const Real &a, const Real &b) {
-    using Eigen::numext::abs2;
-    return sqrt(abs2<Real>(a-b)/Eigen::numext::mini<Real>(abs2(a),abs2(b)));
-  }
-}
+// The following is needed for std::complex<Real>:
+Real fabs(const Real& a) { return abs EIGEN_NOT_A_MACRO(a); }
+Real fmax(const Real& a, const Real& b) {
+  using std::max;
+  return max(a, b);
 }
 
-namespace Eigen {
-
+// some specialization for the unit tests:
+inline bool test_isMuchSmallerThan(const Real& a, const Real& b) {
+  return internal::isMuchSmallerThan(a, b, test_precision<Real>());
 }
 
-EIGEN_DECLARE_TEST(boostmultiprec)
-{
-  typedef Matrix<Real,Dynamic,Dynamic> Mat;
-  typedef Matrix<std::complex<Real>,Dynamic,Dynamic> MatC;
+inline bool test_isApprox(const Real& a, const Real& b) { return internal::isApprox(a, b, test_precision<Real>()); }
+
+inline bool test_isApproxOrLessThan(const Real& a, const Real& b) {
+  return internal::isApproxOrLessThan(a, b, test_precision<Real>());
+}
+
+Real get_test_precision(const Real&) { return test_precision<Real>(); }
+
+Real test_relative_error(const Real& a, const Real& b) {
+  using Eigen::numext::abs2;
+  return sqrt(abs2<Real>(a - b) / Eigen::numext::mini<Real>(abs2(a), abs2(b)));
+}
+}  // namespace multiprecision
+}  // namespace boost
+
+namespace Eigen {}
+
+EIGEN_DECLARE_TEST(boostmultiprec) {
+  typedef Matrix<Real, Dynamic, Dynamic> Mat;
+  typedef Matrix<std::complex<Real>, Dynamic, Dynamic> MatC;
 
   std::cout << "NumTraits<Real>::epsilon()         = " << NumTraits<Real>::epsilon() << std::endl;
   std::cout << "NumTraits<Real>::dummy_precision() = " << NumTraits<Real>::dummy_precision() << std::endl;
@@ -160,51 +155,58 @@
 
   // check stream output
   {
-    Mat A(10,10);
+    Mat A(10, 10);
     A.setRandom();
     std::stringstream ss;
     ss << A;
   }
   {
-    MatC A(10,10);
+    MatC A(10, 10);
     A.setRandom();
     std::stringstream ss;
     ss << A;
   }
 
-  for(int i = 0; i < g_repeat; i++) {
-    int s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE);
+  for (int i = 0; i < g_repeat; i++) {
+    int s = internal::random<int>(1, EIGEN_TEST_MAX_SIZE);
 
-    CALL_SUBTEST_1( cholesky(Mat(s,s)) );
+    CALL_SUBTEST_1(cholesky(Mat(s, s)));
 
-    CALL_SUBTEST_2( lu_non_invertible<Mat>() );
-    CALL_SUBTEST_2( lu_invertible<Mat>() );
-    CALL_SUBTEST_2( lu_non_invertible<MatC>() );
-    CALL_SUBTEST_2( lu_invertible<MatC>() );
+    CALL_SUBTEST_2(lu_non_invertible<Mat>());
+    CALL_SUBTEST_2(lu_invertible<Mat>());
+    CALL_SUBTEST_2(lu_non_invertible<MatC>());
+    CALL_SUBTEST_2(lu_invertible<MatC>());
 
-    CALL_SUBTEST_3( qr(Mat(internal::random<int>(1,EIGEN_TEST_MAX_SIZE),internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_3( qr_invertible<Mat>() );
+    CALL_SUBTEST_3(
+        qr(Mat(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_3(qr_invertible<Mat>());
 
-    CALL_SUBTEST_4( qr<Mat>() );
-    CALL_SUBTEST_4( cod<Mat>() );
-    CALL_SUBTEST_4( qr_invertible<Mat>() );
+    CALL_SUBTEST_4(qr<Mat>());
+    CALL_SUBTEST_4(cod<Mat>());
+    CALL_SUBTEST_4(qr_invertible<Mat>());
 
-    CALL_SUBTEST_5( qr<Mat>() );
-    CALL_SUBTEST_5( qr_invertible<Mat>() );
+    CALL_SUBTEST_5(qr<Mat>());
+    CALL_SUBTEST_5(qr_invertible<Mat>());
 
-    CALL_SUBTEST_6( selfadjointeigensolver(Mat(s,s)) );
+    CALL_SUBTEST_6(selfadjointeigensolver(Mat(s, s)));
 
-    CALL_SUBTEST_7( eigensolver(Mat(s,s)) );
+    CALL_SUBTEST_7(eigensolver(Mat(s, s)));
 
-    CALL_SUBTEST_8( generalized_eigensolver_real(Mat(s,s)) );
+    CALL_SUBTEST_8(generalized_eigensolver_real(Mat(s, s)));
 
     TEST_SET_BUT_UNUSED_VARIABLE(s)
   }
 
-  CALL_SUBTEST_9(( jacobisvd_thin_options(Mat(internal::random<int>(EIGEN_TEST_MAX_SIZE/4, EIGEN_TEST_MAX_SIZE), internal::random<int>(EIGEN_TEST_MAX_SIZE/4, EIGEN_TEST_MAX_SIZE/2))) ));
-  CALL_SUBTEST_9(( jacobisvd_full_options(Mat(internal::random<int>(EIGEN_TEST_MAX_SIZE/4, EIGEN_TEST_MAX_SIZE), internal::random<int>(EIGEN_TEST_MAX_SIZE/4, EIGEN_TEST_MAX_SIZE/2))) ));
-  CALL_SUBTEST_10(( bdcsvd_thin_options(Mat(internal::random<int>(EIGEN_TEST_MAX_SIZE/4, EIGEN_TEST_MAX_SIZE), internal::random<int>(EIGEN_TEST_MAX_SIZE/4, EIGEN_TEST_MAX_SIZE/2))) ));
-  CALL_SUBTEST_10(( bdcsvd_full_options(Mat(internal::random<int>(EIGEN_TEST_MAX_SIZE/4, EIGEN_TEST_MAX_SIZE), internal::random<int>(EIGEN_TEST_MAX_SIZE/4, EIGEN_TEST_MAX_SIZE/2))) ));
+  CALL_SUBTEST_9(
+      (jacobisvd_thin_options(Mat(internal::random<int>(EIGEN_TEST_MAX_SIZE / 4, EIGEN_TEST_MAX_SIZE),
+                                  internal::random<int>(EIGEN_TEST_MAX_SIZE / 4, EIGEN_TEST_MAX_SIZE / 2)))));
+  CALL_SUBTEST_9(
+      (jacobisvd_full_options(Mat(internal::random<int>(EIGEN_TEST_MAX_SIZE / 4, EIGEN_TEST_MAX_SIZE),
+                                  internal::random<int>(EIGEN_TEST_MAX_SIZE / 4, EIGEN_TEST_MAX_SIZE / 2)))));
+  CALL_SUBTEST_10((bdcsvd_thin_options(Mat(internal::random<int>(EIGEN_TEST_MAX_SIZE / 4, EIGEN_TEST_MAX_SIZE),
+                                           internal::random<int>(EIGEN_TEST_MAX_SIZE / 4, EIGEN_TEST_MAX_SIZE / 2)))));
+  CALL_SUBTEST_10((bdcsvd_full_options(Mat(internal::random<int>(EIGEN_TEST_MAX_SIZE / 4, EIGEN_TEST_MAX_SIZE),
+                                           internal::random<int>(EIGEN_TEST_MAX_SIZE / 4, EIGEN_TEST_MAX_SIZE / 2)))));
 
-  CALL_SUBTEST_11(( test_simplicial_cholesky_T<Real,int,ColMajor>() ));
+  CALL_SUBTEST_11((test_simplicial_cholesky_T<Real, int, ColMajor>()));
 }
diff --git a/test/bug1213.cpp b/test/bug1213.cpp
index 581760c..8dbe1a8 100644
--- a/test/bug1213.cpp
+++ b/test/bug1213.cpp
@@ -1,13 +1,7 @@
 
 // This anonymous enum is essential to trigger the linking issue
-enum {
-  Foo
-};
+enum { Foo };
 
 #include "bug1213.h"
 
-bool bug1213_1(const Eigen::Vector3f& x)
-{
-  return bug1213_2(x);
-}
-
+bool bug1213_1(const Eigen::Vector3f& x) { return bug1213_2(x); }
diff --git a/test/bug1213.h b/test/bug1213.h
index 040e5a4..49687f2 100644
--- a/test/bug1213.h
+++ b/test/bug1213.h
@@ -1,8 +1,7 @@
 
 #include <Eigen/Core>
 
-template<typename T, int dim>
-bool bug1213_2(const Eigen::Matrix<T,dim,1>& x);
+template <typename T, int dim>
+bool bug1213_2(const Eigen::Matrix<T, dim, 1>& x);
 
 bool bug1213_1(const Eigen::Vector3f& x);
-
diff --git a/test/bug1213_main.cpp b/test/bug1213_main.cpp
index 4802c00..16150cf 100644
--- a/test/bug1213_main.cpp
+++ b/test/bug1213_main.cpp
@@ -3,16 +3,11 @@
 
 #include "bug1213.h"
 
-int main()
-{
-  return 0;
-}
+int main() { return 0; }
 
-
-template<typename T, int dim>
-bool bug1213_2(const Eigen::Matrix<T,dim,1>& )
-{
+template <typename T, int dim>
+bool bug1213_2(const Eigen::Matrix<T, dim, 1>&) {
   return true;
 }
 
-template bool bug1213_2<float,3>(const Eigen::Vector3f&);
+template bool bug1213_2<float, 3>(const Eigen::Vector3f&);
diff --git a/test/cholesky.cpp b/test/cholesky.cpp
index 0b1a7b4..1c1e18e 100644
--- a/test/cholesky.cpp
+++ b/test/cholesky.cpp
@@ -14,15 +14,15 @@
 #include <Eigen/QR>
 #include "solverbase.h"
 
-template<typename MatrixType, int UpLo>
+template <typename MatrixType, int UpLo>
 typename MatrixType::RealScalar matrix_l1_norm(const MatrixType& m) {
-  if(m.cols()==0) return typename MatrixType::RealScalar(0);
+  if (m.cols() == 0) return typename MatrixType::RealScalar(0);
   MatrixType symm = m.template selfadjointView<UpLo>();
   return symm.cwiseAbs().colwise().sum().maxCoeff();
 }
 
-template<typename MatrixType,template <typename,int> class CholType> void test_chol_update(const MatrixType& symm)
-{
+template <typename MatrixType, template <typename, int> class CholType>
+void test_chol_update(const MatrixType& symm) {
   typedef typename MatrixType::Scalar Scalar;
   typedef typename MatrixType::RealScalar RealScalar;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
@@ -31,19 +31,17 @@
   MatrixType symmUp = symm.template triangularView<Upper>();
   MatrixType symmCpy = symm;
 
-  CholType<MatrixType,Lower> chollo(symmLo);
-  CholType<MatrixType,Upper> cholup(symmUp);
+  CholType<MatrixType, Lower> chollo(symmLo);
+  CholType<MatrixType, Upper> cholup(symmUp);
 
-  for (int k=0; k<10; ++k)
-  {
+  for (int k = 0; k < 10; ++k) {
     VectorType vec = VectorType::Random(symm.rows());
     RealScalar sigma = internal::random<RealScalar>();
     symmCpy += sigma * vec * vec.adjoint();
 
     // we are doing some downdates, so it might be the case that the matrix is not SPD anymore
-    CholType<MatrixType,Lower> chol(symmCpy);
-    if(chol.info()!=Success)
-      break;
+    CholType<MatrixType, Lower> chol(symmCpy);
+    if (chol.info() != Success) break;
 
     chollo.rankUpdate(vec, sigma);
     VERIFY_IS_APPROX(symmCpy, chollo.reconstructedMatrix());
@@ -53,8 +51,8 @@
   }
 }
 
-template<typename MatrixType> void cholesky(const MatrixType& m)
-{
+template <typename MatrixType>
+void cholesky(const MatrixType& m) {
   /* this test covers the following files:
      LLT.h LDLT.h
   */
@@ -66,40 +64,39 @@
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> SquareMatrixType;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
 
-  MatrixType a0 = MatrixType::Random(rows,cols);
+  MatrixType a0 = MatrixType::Random(rows, cols);
   VectorType vecB = VectorType::Random(rows), vecX(rows);
-  MatrixType matB = MatrixType::Random(rows,cols), matX(rows,cols);
-  SquareMatrixType symm =  a0 * a0.adjoint();
+  MatrixType matB = MatrixType::Random(rows, cols), matX(rows, cols);
+  SquareMatrixType symm = a0 * a0.adjoint();
   // let's make sure the matrix is not singular or near singular
-  for (int k=0; k<3; ++k)
-  {
-    MatrixType a1 = MatrixType::Random(rows,cols);
+  for (int k = 0; k < 3; ++k) {
+    MatrixType a1 = MatrixType::Random(rows, cols);
     symm += a1 * a1.adjoint();
   }
 
   {
-    STATIC_CHECK(( internal::is_same<typename LLT<MatrixType,Lower>::StorageIndex,int>::value ));
-    STATIC_CHECK(( internal::is_same<typename LLT<MatrixType,Upper>::StorageIndex,int>::value ));
+    STATIC_CHECK((internal::is_same<typename LLT<MatrixType, Lower>::StorageIndex, int>::value));
+    STATIC_CHECK((internal::is_same<typename LLT<MatrixType, Upper>::StorageIndex, int>::value));
 
     SquareMatrixType symmUp = symm.template triangularView<Upper>();
     SquareMatrixType symmLo = symm.template triangularView<Lower>();
 
-    LLT<SquareMatrixType,Lower> chollo(symmLo);
+    LLT<SquareMatrixType, Lower> chollo(symmLo);
     VERIFY_IS_APPROX(symm, chollo.reconstructedMatrix());
 
     check_solverbase<VectorType, VectorType>(symm, chollo, rows, rows, 1);
     check_solverbase<MatrixType, MatrixType>(symm, chollo, rows, cols, rows);
 
-    const MatrixType symmLo_inverse = chollo.solve(MatrixType::Identity(rows,cols));
-    RealScalar rcond = (RealScalar(1) / matrix_l1_norm<MatrixType, Lower>(symmLo)) /
-                             matrix_l1_norm<MatrixType, Lower>(symmLo_inverse);
+    const MatrixType symmLo_inverse = chollo.solve(MatrixType::Identity(rows, cols));
+    RealScalar rcond =
+        (RealScalar(1) / matrix_l1_norm<MatrixType, Lower>(symmLo)) / matrix_l1_norm<MatrixType, Lower>(symmLo_inverse);
     RealScalar rcond_est = chollo.rcond();
     // Verify that the estimated condition number is within a factor of 10 of the
     // truth.
     VERIFY(rcond_est >= rcond / 10 && rcond_est <= rcond * 10);
 
     // test the upper mode
-    LLT<SquareMatrixType,Upper> cholup(symmUp);
+    LLT<SquareMatrixType, Upper> cholup(symmUp);
     VERIFY_IS_APPROX(symm, cholup.reconstructedMatrix());
     vecX = cholup.solve(vecB);
     VERIFY_IS_APPROX(symm * vecX, vecB);
@@ -108,16 +105,15 @@
 
     // Verify that the estimated condition number is within a factor of 10 of the
     // truth.
-    const MatrixType symmUp_inverse = cholup.solve(MatrixType::Identity(rows,cols));
-    rcond = (RealScalar(1) / matrix_l1_norm<MatrixType, Upper>(symmUp)) /
-                             matrix_l1_norm<MatrixType, Upper>(symmUp_inverse);
+    const MatrixType symmUp_inverse = cholup.solve(MatrixType::Identity(rows, cols));
+    rcond =
+        (RealScalar(1) / matrix_l1_norm<MatrixType, Upper>(symmUp)) / matrix_l1_norm<MatrixType, Upper>(symmUp_inverse);
     rcond_est = cholup.rcond();
     VERIFY(rcond_est >= rcond / 10 && rcond_est <= rcond * 10);
 
-
     MatrixType neg = -symmLo;
     chollo.compute(neg);
-    VERIFY(neg.size()==0 || chollo.info()==NumericalIssue);
+    VERIFY(neg.size() == 0 || chollo.info() == NumericalIssue);
 
     VERIFY_IS_APPROX(MatrixType(chollo.matrixL().transpose().conjugate()), MatrixType(chollo.matrixU()));
     VERIFY_IS_APPROX(MatrixType(chollo.matrixU().transpose().conjugate()), MatrixType(chollo.matrixL()));
@@ -125,7 +121,7 @@
     VERIFY_IS_APPROX(MatrixType(cholup.matrixU().transpose().conjugate()), MatrixType(cholup.matrixL()));
 
     // test some special use cases of SelfCwiseBinaryOp:
-    MatrixType m1 = MatrixType::Random(rows,cols), m2(rows,cols);
+    MatrixType m1 = MatrixType::Random(rows, cols), m2(rows, cols);
     m2 = m1;
     m2 += symmLo.template selfadjointView<Lower>().llt().solve(matB);
     VERIFY_IS_APPROX(m2, m1 + symmLo.template selfadjointView<Lower>().llt().solve(matB));
@@ -142,37 +138,35 @@
 
   // LDLT
   {
-    STATIC_CHECK(( internal::is_same<typename LDLT<MatrixType,Lower>::StorageIndex,int>::value ));
-    STATIC_CHECK(( internal::is_same<typename LDLT<MatrixType,Upper>::StorageIndex,int>::value ));
+    STATIC_CHECK((internal::is_same<typename LDLT<MatrixType, Lower>::StorageIndex, int>::value));
+    STATIC_CHECK((internal::is_same<typename LDLT<MatrixType, Upper>::StorageIndex, int>::value));
 
-    int sign = internal::random<int>()%2 ? 1 : -1;
+    int sign = internal::random<int>() % 2 ? 1 : -1;
 
-    if(sign == -1)
-    {
-      symm = -symm; // test a negative matrix
+    if (sign == -1) {
+      symm = -symm;  // test a negative matrix
     }
 
     SquareMatrixType symmUp = symm.template triangularView<Upper>();
     SquareMatrixType symmLo = symm.template triangularView<Lower>();
 
-    LDLT<SquareMatrixType,Lower> ldltlo(symmLo);
-    VERIFY(ldltlo.info()==Success);
+    LDLT<SquareMatrixType, Lower> ldltlo(symmLo);
+    VERIFY(ldltlo.info() == Success);
     VERIFY_IS_APPROX(symm, ldltlo.reconstructedMatrix());
 
     check_solverbase<VectorType, VectorType>(symm, ldltlo, rows, rows, 1);
     check_solverbase<MatrixType, MatrixType>(symm, ldltlo, rows, cols, rows);
 
-    const MatrixType symmLo_inverse = ldltlo.solve(MatrixType::Identity(rows,cols));
-    RealScalar rcond = (RealScalar(1) / matrix_l1_norm<MatrixType, Lower>(symmLo)) /
-                             matrix_l1_norm<MatrixType, Lower>(symmLo_inverse);
+    const MatrixType symmLo_inverse = ldltlo.solve(MatrixType::Identity(rows, cols));
+    RealScalar rcond =
+        (RealScalar(1) / matrix_l1_norm<MatrixType, Lower>(symmLo)) / matrix_l1_norm<MatrixType, Lower>(symmLo_inverse);
     RealScalar rcond_est = ldltlo.rcond();
     // Verify that the estimated condition number is within a factor of 10 of the
     // truth.
     VERIFY(rcond_est >= rcond / 10 && rcond_est <= rcond * 10);
 
-
-    LDLT<SquareMatrixType,Upper> ldltup(symmUp);
-    VERIFY(ldltup.info()==Success);
+    LDLT<SquareMatrixType, Upper> ldltup(symmUp);
+    VERIFY(ldltup.info() == Success);
     VERIFY_IS_APPROX(symm, ldltup.reconstructedMatrix());
     vecX = ldltup.solve(vecB);
     VERIFY_IS_APPROX(symm * vecX, vecB);
@@ -181,9 +175,9 @@
 
     // Verify that the estimated condition number is within a factor of 10 of the
     // truth.
-    const MatrixType symmUp_inverse = ldltup.solve(MatrixType::Identity(rows,cols));
-    rcond = (RealScalar(1) / matrix_l1_norm<MatrixType, Upper>(symmUp)) /
-                             matrix_l1_norm<MatrixType, Upper>(symmUp_inverse);
+    const MatrixType symmUp_inverse = ldltup.solve(MatrixType::Identity(rows, cols));
+    rcond =
+        (RealScalar(1) / matrix_l1_norm<MatrixType, Upper>(symmUp)) / matrix_l1_norm<MatrixType, Upper>(symmUp_inverse);
     rcond_est = ldltup.rcond();
     VERIFY(rcond_est >= rcond / 10 && rcond_est <= rcond * 10);
 
@@ -192,8 +186,7 @@
     VERIFY_IS_APPROX(MatrixType(ldltup.matrixL().transpose().conjugate()), MatrixType(ldltup.matrixU()));
     VERIFY_IS_APPROX(MatrixType(ldltup.matrixU().transpose().conjugate()), MatrixType(ldltup.matrixL()));
 
-    if(MatrixType::RowsAtCompileTime==Dynamic)
-    {
+    if (MatrixType::RowsAtCompileTime == Dynamic) {
       // note : each inplace permutation requires a small temporary vector (mask)
 
       // check inplace solve
@@ -201,22 +194,19 @@
       VERIFY_EVALUATION_COUNT(matX = ldltlo.solve(matX), 0);
       VERIFY_IS_APPROX(matX, ldltlo.solve(matB).eval());
 
-
       matX = matB;
       VERIFY_EVALUATION_COUNT(matX = ldltup.solve(matX), 0);
       VERIFY_IS_APPROX(matX, ldltup.solve(matB).eval());
     }
 
     // restore
-    if(sign == -1)
-      symm = -symm;
+    if (sign == -1) symm = -symm;
 
     // check matrices coming from linear constraints with Lagrange multipliers
-    if(rows>=3)
-    {
+    if (rows >= 3) {
       SquareMatrixType A = symm;
-      Index c = internal::random<Index>(0,rows-2);
-      A.bottomRightCorner(c,c).setZero();
+      Index c = internal::random<Index>(0, rows - 2);
+      A.bottomRightCorner(c, c).setZero();
       // Make sure a solution exists:
       vecX.setRandom();
       vecB = A * vecX;
@@ -228,10 +218,9 @@
     }
 
     // check non-full rank matrices
-    if(rows>=3)
-    {
-      Index r = internal::random<Index>(1,rows-1);
-      Matrix<Scalar,Dynamic,Dynamic> a = Matrix<Scalar,Dynamic,Dynamic>::Random(rows,r);
+    if (rows >= 3) {
+      Index r = internal::random<Index>(1, rows - 1);
+      Matrix<Scalar, Dynamic, Dynamic> a = Matrix<Scalar, Dynamic, Dynamic>::Random(rows, r);
       SquareMatrixType A = a * a.adjoint();
       // Make sure a solution exists:
       vecX.setRandom();
@@ -244,15 +233,13 @@
     }
 
     // check matrices with a wide spectrum
-    if(rows>=3)
-    {
+    if (rows >= 3) {
       using std::pow;
       using std::sqrt;
-      RealScalar s = (std::min)(16,std::numeric_limits<RealScalar>::max_exponent10/8);
-      Matrix<Scalar,Dynamic,Dynamic> a = Matrix<Scalar,Dynamic,Dynamic>::Random(rows,rows);
-      Matrix<RealScalar,Dynamic,1> d =  Matrix<RealScalar,Dynamic,1>::Random(rows);
-      for(Index k=0; k<rows; ++k)
-        d(k) = d(k)*pow(RealScalar(10),internal::random<RealScalar>(-s,s));
+      RealScalar s = (std::min)(16, std::numeric_limits<RealScalar>::max_exponent10 / 8);
+      Matrix<Scalar, Dynamic, Dynamic> a = Matrix<Scalar, Dynamic, Dynamic>::Random(rows, rows);
+      Matrix<RealScalar, Dynamic, 1> d = Matrix<RealScalar, Dynamic, 1>::Random(rows);
+      for (Index k = 0; k < rows; ++k) d(k) = d(k) * pow(RealScalar(10), internal::random<RealScalar>(-s, s));
       SquareMatrixType A = a * d.asDiagonal() * a.adjoint();
       // Make sure a solution exists:
       vecX.setRandom();
@@ -262,29 +249,26 @@
       VERIFY_IS_APPROX(A, ldltlo.reconstructedMatrix());
       vecX = ldltlo.solve(vecB);
 
-      if(ldltlo.vectorD().real().cwiseAbs().minCoeff()>RealScalar(0))
-      {
-        VERIFY_IS_APPROX(A * vecX,vecB);
-      }
-      else
-      {
-        RealScalar large_tol =  sqrt(test_precision<RealScalar>());
+      if (ldltlo.vectorD().real().cwiseAbs().minCoeff() > RealScalar(0)) {
+        VERIFY_IS_APPROX(A * vecX, vecB);
+      } else {
+        RealScalar large_tol = sqrt(test_precision<RealScalar>());
         VERIFY((A * vecX).isApprox(vecB, large_tol));
 
         ++g_test_level;
-        VERIFY_IS_APPROX(A * vecX,vecB);
+        VERIFY_IS_APPROX(A * vecX, vecB);
         --g_test_level;
       }
     }
   }
 
   // update/downdate
-  CALL_SUBTEST(( test_chol_update<SquareMatrixType,LLT>(symm)  ));
-  CALL_SUBTEST(( test_chol_update<SquareMatrixType,LDLT>(symm) ));
+  CALL_SUBTEST((test_chol_update<SquareMatrixType, LLT>(symm)));
+  CALL_SUBTEST((test_chol_update<SquareMatrixType, LDLT>(symm)));
 }
 
-template<typename MatrixType> void cholesky_cplx(const MatrixType& m)
-{
+template <typename MatrixType>
+void cholesky_cplx(const MatrixType& m) {
   // classic test
   cholesky(m);
 
@@ -298,50 +282,48 @@
   typedef Matrix<RealScalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> RealMatrixType;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
 
-  RealMatrixType a0 = RealMatrixType::Random(rows,cols);
+  RealMatrixType a0 = RealMatrixType::Random(rows, cols);
   VectorType vecB = VectorType::Random(rows), vecX(rows);
-  MatrixType matB = MatrixType::Random(rows,cols), matX(rows,cols);
-  RealMatrixType symm =  a0 * a0.adjoint();
+  MatrixType matB = MatrixType::Random(rows, cols), matX(rows, cols);
+  RealMatrixType symm = a0 * a0.adjoint();
   // let's make sure the matrix is not singular or near singular
-  for (int k=0; k<3; ++k)
-  {
-    RealMatrixType a1 = RealMatrixType::Random(rows,cols);
+  for (int k = 0; k < 3; ++k) {
+    RealMatrixType a1 = RealMatrixType::Random(rows, cols);
     symm += a1 * a1.adjoint();
   }
 
   {
     RealMatrixType symmLo = symm.template triangularView<Lower>();
 
-    LLT<RealMatrixType,Lower> chollo(symmLo);
+    LLT<RealMatrixType, Lower> chollo(symmLo);
     VERIFY_IS_APPROX(symm, chollo.reconstructedMatrix());
 
     check_solverbase<VectorType, VectorType>(symm, chollo, rows, rows, 1);
-    //check_solverbase<MatrixType, MatrixType>(symm, chollo, rows, cols, rows);
+    // check_solverbase<MatrixType, MatrixType>(symm, chollo, rows, cols, rows);
   }
 
   // LDLT
   {
-    int sign = internal::random<int>()%2 ? 1 : -1;
+    int sign = internal::random<int>() % 2 ? 1 : -1;
 
-    if(sign == -1)
-    {
-      symm = -symm; // test a negative matrix
+    if (sign == -1) {
+      symm = -symm;  // test a negative matrix
     }
 
     RealMatrixType symmLo = symm.template triangularView<Lower>();
 
-    LDLT<RealMatrixType,Lower> ldltlo(symmLo);
-    VERIFY(ldltlo.info()==Success);
+    LDLT<RealMatrixType, Lower> ldltlo(symmLo);
+    VERIFY(ldltlo.info() == Success);
     VERIFY_IS_APPROX(symm, ldltlo.reconstructedMatrix());
 
     check_solverbase<VectorType, VectorType>(symm, ldltlo, rows, rows, 1);
-    //check_solverbase<MatrixType, MatrixType>(symm, ldltlo, rows, cols, rows);
+    // check_solverbase<MatrixType, MatrixType>(symm, ldltlo, rows, cols, rows);
   }
 }
 
 // regression test for bug 241
-template<typename MatrixType> void cholesky_bug241(const MatrixType& m)
-{
+template <typename MatrixType>
+void cholesky_bug241(const MatrixType& m) {
   eigen_assert(m.rows() == 2 && m.cols() == 2);
 
   typedef typename MatrixType::Scalar Scalar;
@@ -358,8 +340,8 @@
 // LDLT is not guaranteed to work for indefinite matrices, but happens to work fine if matrix is diagonal.
 // This test checks that LDLT reports correctly that matrix is indefinite.
 // See http://forum.kde.org/viewtopic.php?f=74&t=106942 and bug 736
-template<typename MatrixType> void cholesky_definiteness(const MatrixType& m)
-{
+template <typename MatrixType>
+void cholesky_definiteness(const MatrixType& m) {
   eigen_assert(m.rows() == 2 && m.cols() == 2);
   MatrixType mat;
   LDLT<MatrixType> ldlt(2);
@@ -367,109 +349,96 @@
   {
     mat << 1, 0, 0, -1;
     ldlt.compute(mat);
-    VERIFY(ldlt.info()==Success);
+    VERIFY(ldlt.info() == Success);
     VERIFY(!ldlt.isNegative());
     VERIFY(!ldlt.isPositive());
-    VERIFY_IS_APPROX(mat,ldlt.reconstructedMatrix());
+    VERIFY_IS_APPROX(mat, ldlt.reconstructedMatrix());
   }
   {
     mat << 1, 2, 2, 1;
     ldlt.compute(mat);
-    VERIFY(ldlt.info()==Success);
+    VERIFY(ldlt.info() == Success);
     VERIFY(!ldlt.isNegative());
     VERIFY(!ldlt.isPositive());
-    VERIFY_IS_APPROX(mat,ldlt.reconstructedMatrix());
+    VERIFY_IS_APPROX(mat, ldlt.reconstructedMatrix());
   }
   {
     mat << 0, 0, 0, 0;
     ldlt.compute(mat);
-    VERIFY(ldlt.info()==Success);
+    VERIFY(ldlt.info() == Success);
     VERIFY(ldlt.isNegative());
     VERIFY(ldlt.isPositive());
-    VERIFY_IS_APPROX(mat,ldlt.reconstructedMatrix());
+    VERIFY_IS_APPROX(mat, ldlt.reconstructedMatrix());
   }
   {
     mat << 0, 0, 0, 1;
     ldlt.compute(mat);
-    VERIFY(ldlt.info()==Success);
+    VERIFY(ldlt.info() == Success);
     VERIFY(!ldlt.isNegative());
     VERIFY(ldlt.isPositive());
-    VERIFY_IS_APPROX(mat,ldlt.reconstructedMatrix());
+    VERIFY_IS_APPROX(mat, ldlt.reconstructedMatrix());
   }
   {
     mat << -1, 0, 0, 0;
     ldlt.compute(mat);
-    VERIFY(ldlt.info()==Success);
+    VERIFY(ldlt.info() == Success);
     VERIFY(ldlt.isNegative());
     VERIFY(!ldlt.isPositive());
-    VERIFY_IS_APPROX(mat,ldlt.reconstructedMatrix());
+    VERIFY_IS_APPROX(mat, ldlt.reconstructedMatrix());
   }
 }
 
-template<typename>
-void cholesky_faillure_cases()
-{
+template <typename>
+void cholesky_faillure_cases() {
   MatrixXd mat;
   LDLT<MatrixXd> ldlt;
 
   {
-    mat.resize(2,2);
+    mat.resize(2, 2);
     mat << 0, 1, 1, 0;
     ldlt.compute(mat);
-    VERIFY_IS_NOT_APPROX(mat,ldlt.reconstructedMatrix());
-    VERIFY(ldlt.info()==NumericalIssue);
+    VERIFY_IS_NOT_APPROX(mat, ldlt.reconstructedMatrix());
+    VERIFY(ldlt.info() == NumericalIssue);
   }
 #if (!EIGEN_ARCH_i386) || defined(EIGEN_VECTORIZE_SSE2)
   {
-    mat.resize(3,3);
-    mat << -1, -3, 3,
-           -3, -8.9999999999999999999, 1,
-            3, 1, 0;
+    mat.resize(3, 3);
+    mat << -1, -3, 3, -3, -8.9999999999999999999, 1, 3, 1, 0;
     ldlt.compute(mat);
-    VERIFY(ldlt.info()==NumericalIssue);
-    VERIFY_IS_NOT_APPROX(mat,ldlt.reconstructedMatrix());
+    VERIFY(ldlt.info() == NumericalIssue);
+    VERIFY_IS_NOT_APPROX(mat, ldlt.reconstructedMatrix());
   }
 #endif
   {
-    mat.resize(3,3);
-    mat <<  1, 2, 3,
-            2, 4, 1,
-            3, 1, 0;
+    mat.resize(3, 3);
+    mat << 1, 2, 3, 2, 4, 1, 3, 1, 0;
     ldlt.compute(mat);
-    VERIFY(ldlt.info()==NumericalIssue);
-    VERIFY_IS_NOT_APPROX(mat,ldlt.reconstructedMatrix());
+    VERIFY(ldlt.info() == NumericalIssue);
+    VERIFY_IS_NOT_APPROX(mat, ldlt.reconstructedMatrix());
   }
 
   {
-    mat.resize(8,8);
-    mat <<  0.1, 0, -0.1, 0, 0, 0, 1, 0,
-            0, 4.24667, 0, 2.00333, 0, 0, 0, 0,
-            -0.1, 0, 0.2, 0, -0.1, 0, 0, 0,
-            0, 2.00333, 0, 8.49333, 0, 2.00333, 0, 0,
-            0, 0, -0.1, 0, 0.1, 0, 0, 1,
-            0, 0, 0, 2.00333, 0, 4.24667, 0, 0,
-            1, 0, 0, 0, 0, 0, 0, 0,
-            0, 0, 0, 0, 1, 0, 0, 0;
+    mat.resize(8, 8);
+    mat << 0.1, 0, -0.1, 0, 0, 0, 1, 0, 0, 4.24667, 0, 2.00333, 0, 0, 0, 0, -0.1, 0, 0.2, 0, -0.1, 0, 0, 0, 0, 2.00333,
+        0, 8.49333, 0, 2.00333, 0, 0, 0, 0, -0.1, 0, 0.1, 0, 0, 1, 0, 0, 0, 2.00333, 0, 4.24667, 0, 0, 1, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 1, 0, 0, 0;
     ldlt.compute(mat);
-    VERIFY(ldlt.info()==NumericalIssue);
-    VERIFY_IS_NOT_APPROX(mat,ldlt.reconstructedMatrix());
+    VERIFY(ldlt.info() == NumericalIssue);
+    VERIFY_IS_NOT_APPROX(mat, ldlt.reconstructedMatrix());
   }
 
   // bug 1479
   {
-    mat.resize(4,4);
-    mat <<  1, 2, 0, 1,
-            2, 4, 0, 2,
-            0, 0, 0, 1,
-            1, 2, 1, 1;
+    mat.resize(4, 4);
+    mat << 1, 2, 0, 1, 2, 4, 0, 2, 0, 0, 0, 1, 1, 2, 1, 1;
     ldlt.compute(mat);
-    VERIFY(ldlt.info()==NumericalIssue);
-    VERIFY_IS_NOT_APPROX(mat,ldlt.reconstructedMatrix());
+    VERIFY(ldlt.info() == NumericalIssue);
+    VERIFY_IS_NOT_APPROX(mat, ldlt.reconstructedMatrix());
   }
 }
 
-template<typename MatrixType> void cholesky_verify_assert()
-{
+template <typename MatrixType>
+void cholesky_verify_assert() {
   MatrixType tmp;
 
   LLT<MatrixType> llt;
@@ -492,41 +461,40 @@
   VERIFY_RAISES_ASSERT(ldlt.solveInPlace(tmp))
 }
 
-EIGEN_DECLARE_TEST(cholesky)
-{
+EIGEN_DECLARE_TEST(cholesky) {
   int s = 0;
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( cholesky(Matrix<double,1,1>()) );
-    CALL_SUBTEST_3( cholesky(Matrix2d()) );
-    CALL_SUBTEST_3( cholesky_bug241(Matrix2d()) );
-    CALL_SUBTEST_3( cholesky_definiteness(Matrix2d()) );
-    CALL_SUBTEST_4( cholesky(Matrix3f()) );
-    CALL_SUBTEST_5( cholesky(Matrix4d()) );
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(cholesky(Matrix<double, 1, 1>()));
+    CALL_SUBTEST_3(cholesky(Matrix2d()));
+    CALL_SUBTEST_3(cholesky_bug241(Matrix2d()));
+    CALL_SUBTEST_3(cholesky_definiteness(Matrix2d()));
+    CALL_SUBTEST_4(cholesky(Matrix3f()));
+    CALL_SUBTEST_5(cholesky(Matrix4d()));
 
-    s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE);
-    CALL_SUBTEST_2( cholesky(MatrixXd(s,s)) );
+    s = internal::random<int>(1, EIGEN_TEST_MAX_SIZE);
+    CALL_SUBTEST_2(cholesky(MatrixXd(s, s)));
     TEST_SET_BUT_UNUSED_VARIABLE(s)
 
-    s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2);
-    CALL_SUBTEST_6( cholesky_cplx(MatrixXcd(s,s)) );
+    s = internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2);
+    CALL_SUBTEST_6(cholesky_cplx(MatrixXcd(s, s)));
     TEST_SET_BUT_UNUSED_VARIABLE(s)
   }
   // empty matrix, regression test for Bug 785:
-  CALL_SUBTEST_2( cholesky(MatrixXd(0,0)) );
+  CALL_SUBTEST_2(cholesky(MatrixXd(0, 0)));
 
   // This does not work yet:
   // CALL_SUBTEST_2( cholesky(Matrix<double,0,0>()) );
 
-  CALL_SUBTEST_4( cholesky_verify_assert<Matrix3f>() );
-  CALL_SUBTEST_7( cholesky_verify_assert<Matrix3d>() );
-  CALL_SUBTEST_8( cholesky_verify_assert<MatrixXf>() );
-  CALL_SUBTEST_2( cholesky_verify_assert<MatrixXd>() );
+  CALL_SUBTEST_4(cholesky_verify_assert<Matrix3f>());
+  CALL_SUBTEST_7(cholesky_verify_assert<Matrix3d>());
+  CALL_SUBTEST_8(cholesky_verify_assert<MatrixXf>());
+  CALL_SUBTEST_2(cholesky_verify_assert<MatrixXd>());
 
   // Test problem size constructors
-  CALL_SUBTEST_9( LLT<MatrixXf>(10) );
-  CALL_SUBTEST_9( LDLT<MatrixXf>(10) );
+  CALL_SUBTEST_9(LLT<MatrixXf>(10));
+  CALL_SUBTEST_9(LDLT<MatrixXf>(10));
 
-  CALL_SUBTEST_2( cholesky_faillure_cases<void>() );
+  CALL_SUBTEST_2(cholesky_faillure_cases<void>());
 
   TEST_SET_BUT_UNUSED_VARIABLE(nb_temporaries)
 }
diff --git a/test/cholmod_support.cpp b/test/cholmod_support.cpp
index 89b9cf4..24126a0 100644
--- a/test/cholmod_support.cpp
+++ b/test/cholmod_support.cpp
@@ -12,15 +12,21 @@
 
 #include <Eigen/CholmodSupport>
 
-template<typename SparseType> void test_cholmod_ST()
-{
-  CholmodDecomposition<SparseType, Lower> g_chol_colmajor_lower; g_chol_colmajor_lower.setMode(CholmodSupernodalLLt);
-  CholmodDecomposition<SparseType, Upper> g_chol_colmajor_upper; g_chol_colmajor_upper.setMode(CholmodSupernodalLLt);
-  CholmodDecomposition<SparseType, Lower> g_llt_colmajor_lower;  g_llt_colmajor_lower.setMode(CholmodSimplicialLLt);
-  CholmodDecomposition<SparseType, Upper> g_llt_colmajor_upper;  g_llt_colmajor_upper.setMode(CholmodSimplicialLLt);
-  CholmodDecomposition<SparseType, Lower> g_ldlt_colmajor_lower; g_ldlt_colmajor_lower.setMode(CholmodLDLt);
-  CholmodDecomposition<SparseType, Upper> g_ldlt_colmajor_upper; g_ldlt_colmajor_upper.setMode(CholmodLDLt);
-  
+template <typename SparseType>
+void test_cholmod_ST() {
+  CholmodDecomposition<SparseType, Lower> g_chol_colmajor_lower;
+  g_chol_colmajor_lower.setMode(CholmodSupernodalLLt);
+  CholmodDecomposition<SparseType, Upper> g_chol_colmajor_upper;
+  g_chol_colmajor_upper.setMode(CholmodSupernodalLLt);
+  CholmodDecomposition<SparseType, Lower> g_llt_colmajor_lower;
+  g_llt_colmajor_lower.setMode(CholmodSimplicialLLt);
+  CholmodDecomposition<SparseType, Upper> g_llt_colmajor_upper;
+  g_llt_colmajor_upper.setMode(CholmodSimplicialLLt);
+  CholmodDecomposition<SparseType, Lower> g_ldlt_colmajor_lower;
+  g_ldlt_colmajor_lower.setMode(CholmodLDLt);
+  CholmodDecomposition<SparseType, Upper> g_ldlt_colmajor_upper;
+  g_ldlt_colmajor_upper.setMode(CholmodLDLt);
+
   CholmodSupernodalLLT<SparseType, Lower> chol_colmajor_lower;
   CholmodSupernodalLLT<SparseType, Upper> chol_colmajor_upper;
   CholmodSimplicialLLT<SparseType, Lower> llt_colmajor_lower;
@@ -34,7 +40,7 @@
   check_sparse_spd_solving(g_llt_colmajor_upper);
   check_sparse_spd_solving(g_ldlt_colmajor_lower);
   check_sparse_spd_solving(g_ldlt_colmajor_upper);
-  
+
   check_sparse_spd_solving(chol_colmajor_lower);
   check_sparse_spd_solving(chol_colmajor_upper);
   check_sparse_spd_solving(llt_colmajor_lower);
@@ -50,19 +56,18 @@
   check_sparse_spd_determinant(ldlt_colmajor_upper);
 }
 
-template<typename T, int flags, typename IdxType> void test_cholmod_T()
-{
-    test_cholmod_ST<SparseMatrix<T, flags, IdxType> >();
+template <typename T, int flags, typename IdxType>
+void test_cholmod_T() {
+  test_cholmod_ST<SparseMatrix<T, flags, IdxType> >();
 }
 
-EIGEN_DECLARE_TEST(cholmod_support)
-{
-  CALL_SUBTEST_11( (test_cholmod_T<double              , ColMajor, int >()) );
-  CALL_SUBTEST_12( (test_cholmod_T<double              , ColMajor, long>()) );
-  CALL_SUBTEST_13( (test_cholmod_T<double              , RowMajor, int >()) );
-  CALL_SUBTEST_14( (test_cholmod_T<double              , RowMajor, long>()) );
-  CALL_SUBTEST_21( (test_cholmod_T<std::complex<double>, ColMajor, int >()) );
-  CALL_SUBTEST_22( (test_cholmod_T<std::complex<double>, ColMajor, long>()) );
+EIGEN_DECLARE_TEST(cholmod_support) {
+  CALL_SUBTEST_11((test_cholmod_T<double, ColMajor, int>()));
+  CALL_SUBTEST_12((test_cholmod_T<double, ColMajor, long>()));
+  CALL_SUBTEST_13((test_cholmod_T<double, RowMajor, int>()));
+  CALL_SUBTEST_14((test_cholmod_T<double, RowMajor, long>()));
+  CALL_SUBTEST_21((test_cholmod_T<std::complex<double>, ColMajor, int>()));
+  CALL_SUBTEST_22((test_cholmod_T<std::complex<double>, ColMajor, long>()));
   // TODO complex row-major matrices do not work at the moment:
   // CALL_SUBTEST_23( (test_cholmod_T<std::complex<double>, RowMajor, int >()) );
   // CALL_SUBTEST_24( (test_cholmod_T<std::complex<double>, RowMajor, long>()) );
diff --git a/test/commainitializer.cpp b/test/commainitializer.cpp
index eb275be..771ab6f 100644
--- a/test/commainitializer.cpp
+++ b/test/commainitializer.cpp
@@ -9,86 +9,79 @@
 
 #include "main.h"
 
+template <int M1, int M2, int N1, int N2>
+void test_blocks() {
+  Matrix<int, M1 + M2, N1 + N2> m_fixed;
+  MatrixXi m_dynamic(M1 + M2, N1 + N2);
 
-template<int M1, int M2, int N1, int N2>
-void test_blocks()
-{
-  Matrix<int, M1+M2, N1+N2> m_fixed;
-  MatrixXi m_dynamic(M1+M2, N1+N2);
-
-  Matrix<int, M1, N1> mat11; mat11.setRandom();
-  Matrix<int, M1, N2> mat12; mat12.setRandom();
-  Matrix<int, M2, N1> mat21; mat21.setRandom();
-  Matrix<int, M2, N2> mat22; mat22.setRandom();
+  Matrix<int, M1, N1> mat11;
+  mat11.setRandom();
+  Matrix<int, M1, N2> mat12;
+  mat12.setRandom();
+  Matrix<int, M2, N1> mat21;
+  mat21.setRandom();
+  Matrix<int, M2, N2> mat22;
+  mat22.setRandom();
 
   MatrixXi matx11 = mat11, matx12 = mat12, matx21 = mat21, matx22 = mat22;
 
   {
-    VERIFY_IS_EQUAL((m_fixed << mat11, mat12, mat21, matx22).finished(), (m_dynamic << mat11, matx12, mat21, matx22).finished());
-    VERIFY_IS_EQUAL((m_fixed.template topLeftCorner<M1,N1>()), mat11);
-    VERIFY_IS_EQUAL((m_fixed.template topRightCorner<M1,N2>()), mat12);
-    VERIFY_IS_EQUAL((m_fixed.template bottomLeftCorner<M2,N1>()), mat21);
-    VERIFY_IS_EQUAL((m_fixed.template bottomRightCorner<M2,N2>()), mat22);
-    VERIFY_IS_EQUAL((m_fixed << mat12, mat11, matx21, mat22).finished(), (m_dynamic << mat12, matx11, matx21, mat22).finished());
+    VERIFY_IS_EQUAL((m_fixed << mat11, mat12, mat21, matx22).finished(),
+                    (m_dynamic << mat11, matx12, mat21, matx22).finished());
+    VERIFY_IS_EQUAL((m_fixed.template topLeftCorner<M1, N1>()), mat11);
+    VERIFY_IS_EQUAL((m_fixed.template topRightCorner<M1, N2>()), mat12);
+    VERIFY_IS_EQUAL((m_fixed.template bottomLeftCorner<M2, N1>()), mat21);
+    VERIFY_IS_EQUAL((m_fixed.template bottomRightCorner<M2, N2>()), mat22);
+    VERIFY_IS_EQUAL((m_fixed << mat12, mat11, matx21, mat22).finished(),
+                    (m_dynamic << mat12, matx11, matx21, mat22).finished());
   }
 
-  if(N1 > 0)
-  {
-    if(M1 > 0)
-    {
+  if (N1 > 0) {
+    if (M1 > 0) {
       VERIFY_RAISES_ASSERT((m_fixed << mat11, mat12, mat11, mat21, mat22));
     }
-    if(M2 > 0)
-    {
+    if (M2 > 0) {
       VERIFY_RAISES_ASSERT((m_fixed << mat11, mat12, mat21, mat21, mat22));
     }
-  }
-  else
-  {
+  } else {
     // allow insertion of zero-column blocks:
-    VERIFY_IS_EQUAL((m_fixed << mat11, mat12, mat11, mat11, mat21, mat21, mat22).finished(), (m_dynamic << mat12, mat22).finished());
+    VERIFY_IS_EQUAL((m_fixed << mat11, mat12, mat11, mat11, mat21, mat21, mat22).finished(),
+                    (m_dynamic << mat12, mat22).finished());
   }
-  if(M1 != M2)
-  {
+  if (M1 != M2) {
     VERIFY_RAISES_ASSERT((m_fixed << mat11, mat21, mat12, mat22));
   }
 }
 
-
-template<int depth, int N=0>
-struct test_block_recursion
-{
-  static void run()
-  {
-    test_block_recursion<depth-1, N>::run();
-    test_block_recursion<depth-1, N + (1 << (depth-1))>::run();
+template <int depth, int N = 0>
+struct test_block_recursion {
+  static void run() {
+    test_block_recursion<depth - 1, N>::run();
+    test_block_recursion<depth - 1, N + (1 << (depth - 1))>::run();
   }
 };
 
-template<int N>
-struct test_block_recursion<0,N>
-{
-  static void run() {
-    test_blocks<(N>>6)&3, (N>>4)&3, (N>>2)&3, N & 3>();
-  }
+template <int N>
+struct test_block_recursion<0, N> {
+  static void run() { test_blocks<(N >> 6) & 3, (N >> 4) & 3, (N >> 2) & 3, N & 3>(); }
 };
 
 void test_basics() {
   Matrix3d m3;
   Matrix4d m4;
 
-  VERIFY_RAISES_ASSERT( (m3 << 1, 2, 3, 4, 5, 6, 7, 8) );
-  
-  #ifndef _MSC_VER
-  VERIFY_RAISES_ASSERT( (m3 << 1, 2, 3, 4, 5, 6, 7, 8, 9, 10) );
-  #endif
+  VERIFY_RAISES_ASSERT((m3 << 1, 2, 3, 4, 5, 6, 7, 8));
+
+#ifndef _MSC_VER
+  VERIFY_RAISES_ASSERT((m3 << 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+#endif
 
   double data[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
-  Matrix3d ref = Map<Matrix<double,3,3,RowMajor> >(data);
+  Matrix3d ref = Map<Matrix<double, 3, 3, RowMajor> >(data);
 
   m3 = Matrix3d::Random();
   m3 << 1, 2, 3, 4, 5, 6, 7, 8, 9;
-  VERIFY_IS_APPROX(m3, ref );
+  VERIFY_IS_APPROX(m3, ref);
 
   Vector3d vec[3];
   vec[0] << 1, 4, 7;
@@ -102,15 +95,11 @@
   vec[1] << 4, 5, 6;
   vec[2] << 7, 8, 9;
   m3 = Matrix3d::Random();
-  m3 << vec[0].transpose(),
-        4, 5, 6,
-        vec[2].transpose();
+  m3 << vec[0].transpose(), 4, 5, 6, vec[2].transpose();
   VERIFY_IS_APPROX(m3, ref);
 }
 
-EIGEN_DECLARE_TEST(commainitializer)
-{
-
+EIGEN_DECLARE_TEST(commainitializer) {
   CALL_SUBTEST_1(test_basics());
 
   // recursively test all block-sizes from 0 to 3:
diff --git a/test/conjugate_gradient.cpp b/test/conjugate_gradient.cpp
index b076a12..87e1f8c 100644
--- a/test/conjugate_gradient.cpp
+++ b/test/conjugate_gradient.cpp
@@ -10,25 +10,24 @@
 #include "sparse_solver.h"
 #include <Eigen/IterativeLinearSolvers>
 
-template<typename T, typename I_> void test_conjugate_gradient_T()
-{
-  typedef SparseMatrix<T,0,I_> SparseMatrixType;
-  ConjugateGradient<SparseMatrixType, Lower      > cg_colmajor_lower_diag;
-  ConjugateGradient<SparseMatrixType, Upper      > cg_colmajor_upper_diag;
-  ConjugateGradient<SparseMatrixType, Lower|Upper> cg_colmajor_loup_diag;
+template <typename T, typename I_>
+void test_conjugate_gradient_T() {
+  typedef SparseMatrix<T, 0, I_> SparseMatrixType;
+  ConjugateGradient<SparseMatrixType, Lower> cg_colmajor_lower_diag;
+  ConjugateGradient<SparseMatrixType, Upper> cg_colmajor_upper_diag;
+  ConjugateGradient<SparseMatrixType, Lower | Upper> cg_colmajor_loup_diag;
   ConjugateGradient<SparseMatrixType, Lower, IdentityPreconditioner> cg_colmajor_lower_I;
   ConjugateGradient<SparseMatrixType, Upper, IdentityPreconditioner> cg_colmajor_upper_I;
 
-  CALL_SUBTEST( check_sparse_spd_solving(cg_colmajor_lower_diag)  );
-  CALL_SUBTEST( check_sparse_spd_solving(cg_colmajor_upper_diag)  );
-  CALL_SUBTEST( check_sparse_spd_solving(cg_colmajor_loup_diag)   );
-  CALL_SUBTEST( check_sparse_spd_solving(cg_colmajor_lower_I)     );
-  CALL_SUBTEST( check_sparse_spd_solving(cg_colmajor_upper_I)     );
+  CALL_SUBTEST(check_sparse_spd_solving(cg_colmajor_lower_diag));
+  CALL_SUBTEST(check_sparse_spd_solving(cg_colmajor_upper_diag));
+  CALL_SUBTEST(check_sparse_spd_solving(cg_colmajor_loup_diag));
+  CALL_SUBTEST(check_sparse_spd_solving(cg_colmajor_lower_I));
+  CALL_SUBTEST(check_sparse_spd_solving(cg_colmajor_upper_I));
 }
 
-EIGEN_DECLARE_TEST(conjugate_gradient)
-{
-  CALL_SUBTEST_1(( test_conjugate_gradient_T<double,int>() ));
-  CALL_SUBTEST_2(( test_conjugate_gradient_T<std::complex<double>, int>() ));
-  CALL_SUBTEST_3(( test_conjugate_gradient_T<double,long int>() ));
+EIGEN_DECLARE_TEST(conjugate_gradient) {
+  CALL_SUBTEST_1((test_conjugate_gradient_T<double, int>()));
+  CALL_SUBTEST_2((test_conjugate_gradient_T<std::complex<double>, int>()));
+  CALL_SUBTEST_3((test_conjugate_gradient_T<double, long int>()));
 }
diff --git a/test/conservative_resize.cpp b/test/conservative_resize.cpp
index d48eb12..73e34a6 100644
--- a/test/conservative_resize.cpp
+++ b/test/conservative_resize.cpp
@@ -15,51 +15,47 @@
 using namespace Eigen;
 
 template <typename Scalar, int Storage>
-void run_matrix_tests()
-{
+void run_matrix_tests() {
   typedef Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, Storage> MatrixType;
 
   MatrixType m, n;
 
   // boundary cases ...
-  m = n = MatrixType::Random(50,50);
-  m.conservativeResize(1,50);
-  VERIFY_IS_APPROX(m, n.block(0,0,1,50));
+  m = n = MatrixType::Random(50, 50);
+  m.conservativeResize(1, 50);
+  VERIFY_IS_APPROX(m, n.block(0, 0, 1, 50));
 
-  m = n = MatrixType::Random(50,50);
-  m.conservativeResize(50,1);
-  VERIFY_IS_APPROX(m, n.block(0,0,50,1));
+  m = n = MatrixType::Random(50, 50);
+  m.conservativeResize(50, 1);
+  VERIFY_IS_APPROX(m, n.block(0, 0, 50, 1));
 
-  m = n = MatrixType::Random(50,50);
-  m.conservativeResize(50,50);
-  VERIFY_IS_APPROX(m, n.block(0,0,50,50));
+  m = n = MatrixType::Random(50, 50);
+  m.conservativeResize(50, 50);
+  VERIFY_IS_APPROX(m, n.block(0, 0, 50, 50));
 
   // random shrinking ...
-  for (int i=0; i<25; ++i)
-  {
-    const Index rows = internal::random<Index>(1,50);
-    const Index cols = internal::random<Index>(1,50);
-    m = n = MatrixType::Random(50,50);
-    m.conservativeResize(rows,cols);
-    VERIFY_IS_APPROX(m, n.block(0,0,rows,cols));
+  for (int i = 0; i < 25; ++i) {
+    const Index rows = internal::random<Index>(1, 50);
+    const Index cols = internal::random<Index>(1, 50);
+    m = n = MatrixType::Random(50, 50);
+    m.conservativeResize(rows, cols);
+    VERIFY_IS_APPROX(m, n.block(0, 0, rows, cols));
   }
 
   // random growing with zeroing ...
-  for (int i=0; i<25; ++i)
-  {
-    const Index rows = internal::random<Index>(50,75);
-    const Index cols = internal::random<Index>(50,75);
-    m = n = MatrixType::Random(50,50);
-    m.conservativeResizeLike(MatrixType::Zero(rows,cols));
-    VERIFY_IS_APPROX(m.block(0,0,n.rows(),n.cols()), n);
-    VERIFY( rows<=50 || m.block(50,0,rows-50,cols).sum() == Scalar(0) );
-    VERIFY( cols<=50 || m.block(0,50,rows,cols-50).sum() == Scalar(0) );
+  for (int i = 0; i < 25; ++i) {
+    const Index rows = internal::random<Index>(50, 75);
+    const Index cols = internal::random<Index>(50, 75);
+    m = n = MatrixType::Random(50, 50);
+    m.conservativeResizeLike(MatrixType::Zero(rows, cols));
+    VERIFY_IS_APPROX(m.block(0, 0, n.rows(), n.cols()), n);
+    VERIFY(rows <= 50 || m.block(50, 0, rows - 50, cols).sum() == Scalar(0));
+    VERIFY(cols <= 50 || m.block(0, 50, rows, cols - 50).sum() == Scalar(0));
   }
 }
 
 template <typename Scalar>
-void run_vector_tests()
-{
+void run_vector_tests() {
   typedef Matrix<Scalar, 1, Eigen::Dynamic> VectorType;
 
   VectorType m, n;
@@ -67,54 +63,52 @@
   // boundary cases ...
   m = n = VectorType::Random(50);
   m.conservativeResize(1);
-  VERIFY_IS_APPROX(m, n.segment(0,1));
+  VERIFY_IS_APPROX(m, n.segment(0, 1));
 
   m = n = VectorType::Random(50);
   m.conservativeResize(50);
-  VERIFY_IS_APPROX(m, n.segment(0,50));
-  
-  m = n = VectorType::Random(50);
-  m.conservativeResize(m.rows(),1);
-  VERIFY_IS_APPROX(m, n.segment(0,1));
+  VERIFY_IS_APPROX(m, n.segment(0, 50));
 
   m = n = VectorType::Random(50);
-  m.conservativeResize(m.rows(),50);
-  VERIFY_IS_APPROX(m, n.segment(0,50));
+  m.conservativeResize(m.rows(), 1);
+  VERIFY_IS_APPROX(m, n.segment(0, 1));
+
+  m = n = VectorType::Random(50);
+  m.conservativeResize(m.rows(), 50);
+  VERIFY_IS_APPROX(m, n.segment(0, 50));
 
   // random shrinking ...
-  for (int i=0; i<50; ++i)
-  {
-    const int size = internal::random<int>(1,50);
+  for (int i = 0; i < 50; ++i) {
+    const int size = internal::random<int>(1, 50);
     m = n = VectorType::Random(50);
     m.conservativeResize(size);
-    VERIFY_IS_APPROX(m, n.segment(0,size));
-    
+    VERIFY_IS_APPROX(m, n.segment(0, size));
+
     m = n = VectorType::Random(50);
     m.conservativeResize(m.rows(), size);
-    VERIFY_IS_APPROX(m, n.segment(0,size));
+    VERIFY_IS_APPROX(m, n.segment(0, size));
   }
 
   // random growing with zeroing ...
-  for (int i=0; i<50; ++i)
-  {
-    const int size = internal::random<int>(50,100);
+  for (int i = 0; i < 50; ++i) {
+    const int size = internal::random<int>(50, 100);
     m = n = VectorType::Random(50);
     m.conservativeResizeLike(VectorType::Zero(size));
-    VERIFY_IS_APPROX(m.segment(0,50), n);
-    VERIFY( size<=50 || m.segment(50,size-50).sum() == Scalar(0) );
-    
+    VERIFY_IS_APPROX(m.segment(0, 50), n);
+    VERIFY(size <= 50 || m.segment(50, size - 50).sum() == Scalar(0));
+
     m = n = VectorType::Random(50);
-    m.conservativeResizeLike(Matrix<Scalar,Dynamic,Dynamic>::Zero(1,size));
-    VERIFY_IS_APPROX(m.segment(0,50), n);
-    VERIFY( size<=50 || m.segment(50,size-50).sum() == Scalar(0) );
+    m.conservativeResizeLike(Matrix<Scalar, Dynamic, Dynamic>::Zero(1, size));
+    VERIFY_IS_APPROX(m.segment(0, 50), n);
+    VERIFY(size <= 50 || m.segment(50, size - 50).sum() == Scalar(0));
   }
 }
 
 // Basic memory leak check with a non-copyable scalar type
-template<int> void noncopyable()
-{
-  typedef Eigen::Matrix<AnnoyingScalar,Dynamic,1> VectorType;
-  typedef Eigen::Matrix<AnnoyingScalar,Dynamic,Dynamic> MatrixType;
+template <int>
+void noncopyable() {
+  typedef Eigen::Matrix<AnnoyingScalar, Dynamic, 1> VectorType;
+  typedef Eigen::Matrix<AnnoyingScalar, Dynamic, Dynamic> MatrixType;
 
   {
 #ifndef EIGEN_TEST_ANNOYING_SCALAR_DONT_THROW
@@ -122,24 +116,25 @@
 #endif
     int n = 50;
     VectorType v0(n), v1(n);
-    MatrixType m0(n,n), m1(n,n), m2(n,n);
-    v0.setOnes(); v1.setOnes();
-    m0.setOnes(); m1.setOnes(); m2.setOnes();
-    VERIFY(m0==m1);
-    m0.conservativeResize(2*n,2*n);
-    VERIFY(m0.topLeftCorner(n,n) == m1);
-    
+    MatrixType m0(n, n), m1(n, n), m2(n, n);
+    v0.setOnes();
+    v1.setOnes();
+    m0.setOnes();
+    m1.setOnes();
+    m2.setOnes();
+    VERIFY(m0 == m1);
+    m0.conservativeResize(2 * n, 2 * n);
+    VERIFY(m0.topLeftCorner(n, n) == m1);
+
     VERIFY(v0.head(n) == v1);
-    v0.conservativeResize(2*n);
+    v0.conservativeResize(2 * n);
     VERIFY(v0.head(n) == v1);
   }
-  VERIFY(AnnoyingScalar::instances==0 && "global memory leak detected in noncopyable");
+  VERIFY(AnnoyingScalar::instances == 0 && "global memory leak detected in noncopyable");
 }
 
-EIGEN_DECLARE_TEST(conservative_resize)
-{
-  for(int i=0; i<g_repeat; ++i)
-  {
+EIGEN_DECLARE_TEST(conservative_resize) {
+  for (int i = 0; i < g_repeat; ++i) {
     CALL_SUBTEST_1((run_matrix_tests<int, Eigen::RowMajor>()));
     CALL_SUBTEST_1((run_matrix_tests<int, Eigen::ColMajor>()));
     CALL_SUBTEST_2((run_matrix_tests<float, Eigen::RowMajor>()));
@@ -161,7 +156,7 @@
 #ifndef EIGEN_TEST_ANNOYING_SCALAR_DONT_THROW
     AnnoyingScalar::dont_throw = true;
 #endif
-    CALL_SUBTEST_6(( run_vector_tests<AnnoyingScalar>() ));
-    CALL_SUBTEST_6(( noncopyable<0>() ));
+    CALL_SUBTEST_6((run_vector_tests<AnnoyingScalar>()));
+    CALL_SUBTEST_6((noncopyable<0>()));
   }
 }
diff --git a/test/constexpr.cpp b/test/constexpr.cpp
index b8f0b09..ee154f8 100644
--- a/test/constexpr.cpp
+++ b/test/constexpr.cpp
@@ -19,22 +19,22 @@
   constexpr Matrix3i mat({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}});
   VERIFY_IS_EQUAL(mat.size(), 9);
   VERIFY_IS_EQUAL(mat(0, 0), 1);
-  static_assert(mat.coeff(0,1) == 2);
+  static_assert(mat.coeff(0, 1) == 2);
   constexpr Array33i arr({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}});
   VERIFY_IS_EQUAL(arr(0, 0), 1);
   VERIFY_IS_EQUAL(arr.size(), 9);
-  static_assert(arr.coeff(0,1) == 2);
+  static_assert(arr.coeff(0, 1) == 2);
   // Also check dynamic size arrays/matrices with fixed-size storage (currently
   // only works if all elements are initialized, since otherwise the compiler
   // complains about uninitialized trailing elements.
   constexpr Matrix<int, Eigen::Dynamic, Eigen::Dynamic, 0, 3, 3> dyn_mat({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}});
   VERIFY_IS_EQUAL(dyn_mat.size(), 9);
   VERIFY_IS_EQUAL(dyn_mat(0, 0), 1);
-  static_assert(dyn_mat.coeff(0,1) == 2);
+  static_assert(dyn_mat.coeff(0, 1) == 2);
   constexpr Array<int, Eigen::Dynamic, Eigen::Dynamic, 0, 3, 3> dyn_arr({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}});
   VERIFY_IS_EQUAL(dyn_arr(0, 0), 1);
   VERIFY_IS_EQUAL(dyn_arr.size(), 9);
-  static_assert(dyn_arr.coeff(0,1) == 2);
+  static_assert(dyn_arr.coeff(0, 1) == 2);
 #endif  // EIGEN_COMP_CXXVER >= 20
 }
 
@@ -47,6 +47,6 @@
 EIGEN_DECLARE_TEST(constexpr_global) {
   VERIFY_IS_EQUAL(global_mat.size(), 4);
   VERIFY_IS_EQUAL(global_mat(0, 0), 1);
-  static_assert(global_mat.coeff(0,0) == 1);
+  static_assert(global_mat.coeff(0, 0) == 1);
 }
 #endif  // EIGEN_COMP_CXXVER >= 20
diff --git a/test/constructor.cpp b/test/constructor.cpp
index ffd5e80..fb125c4 100644
--- a/test/constructor.cpp
+++ b/test/constructor.cpp
@@ -7,92 +7,91 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-
 #define TEST_ENABLE_TEMPORARY_TRACKING
 
 #include "main.h"
 
-template<typename MatrixType> struct Wrapper
-{
+template <typename MatrixType>
+struct Wrapper {
   MatrixType m_mat;
-  inline Wrapper(const MatrixType &x) : m_mat(x) {}
-  inline operator const MatrixType& () const { return m_mat; }
-  inline operator MatrixType& () { return m_mat; }
+  inline Wrapper(const MatrixType& x) : m_mat(x) {}
+  inline operator const MatrixType&() const { return m_mat; }
+  inline operator MatrixType&() { return m_mat; }
 };
 
-enum my_sizes { M = 12, N = 7};
+enum my_sizes { M = 12, N = 7 };
 
-template<typename MatrixType> void ctor_init1(const MatrixType& m)
-{
+template <typename MatrixType>
+void ctor_init1(const MatrixType& m) {
   // Check logic in PlainObjectBase::_init1
   Index rows = m.rows();
   Index cols = m.cols();
 
-  MatrixType m0 = MatrixType::Random(rows,cols);
+  MatrixType m0 = MatrixType::Random(rows, cols);
 
-  VERIFY_EVALUATION_COUNT( MatrixType m1(m0), 1);
-  VERIFY_EVALUATION_COUNT( MatrixType m2(m0+m0), 1);
-  VERIFY_EVALUATION_COUNT( MatrixType m2(m0.block(0,0,rows,cols)) , 1);
+  VERIFY_EVALUATION_COUNT(MatrixType m1(m0), 1);
+  VERIFY_EVALUATION_COUNT(MatrixType m2(m0 + m0), 1);
+  VERIFY_EVALUATION_COUNT(MatrixType m2(m0.block(0, 0, rows, cols)), 1);
 
   Wrapper<MatrixType> wrapper(m0);
-  VERIFY_EVALUATION_COUNT( MatrixType m3(wrapper) , 1);
+  VERIFY_EVALUATION_COUNT(MatrixType m3(wrapper), 1);
 }
 
-
-EIGEN_DECLARE_TEST(constructor)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( ctor_init1(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_1( ctor_init1(Matrix4d()) );
-    CALL_SUBTEST_1( ctor_init1(MatrixXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_1( ctor_init1(MatrixXi(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
+EIGEN_DECLARE_TEST(constructor) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(ctor_init1(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_1(ctor_init1(Matrix4d()));
+    CALL_SUBTEST_1(ctor_init1(
+        MatrixXcf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_1(ctor_init1(
+        MatrixXi(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
   }
   {
-    Matrix<Index,1,1> a(123);
+    Matrix<Index, 1, 1> a(123);
     VERIFY_IS_EQUAL(a[0], 123);
   }
   {
-    Matrix<Index,1,1> a(123.0);
+    Matrix<Index, 1, 1> a(123.0);
     VERIFY_IS_EQUAL(a[0], 123);
   }
   {
-    Matrix<float,1,1> a(123);
+    Matrix<float, 1, 1> a(123);
     VERIFY_IS_EQUAL(a[0], 123.f);
   }
   {
-    Array<Index,1,1> a(123);
+    Array<Index, 1, 1> a(123);
     VERIFY_IS_EQUAL(a[0], 123);
   }
   {
-    Array<Index,1,1> a(123.0);
+    Array<Index, 1, 1> a(123.0);
     VERIFY_IS_EQUAL(a[0], 123);
   }
   {
-    Array<float,1,1> a(123);
+    Array<float, 1, 1> a(123);
     VERIFY_IS_EQUAL(a[0], 123.f);
   }
   {
-    Array<Index,3,3> a(123);
+    Array<Index, 3, 3> a(123);
     VERIFY_IS_EQUAL(a(4), 123);
   }
   {
-    Array<Index,3,3> a(123.0);
+    Array<Index, 3, 3> a(123.0);
     VERIFY_IS_EQUAL(a(4), 123);
   }
   {
-    Array<float,3,3> a(123);
+    Array<float, 3, 3> a(123);
     VERIFY_IS_EQUAL(a(4), 123.f);
   }
   {
-    MatrixXi m1(M,N);
-    VERIFY_IS_EQUAL(m1.rows(),M);
-    VERIFY_IS_EQUAL(m1.cols(),N);
-    ArrayXXi a1(M,N);
-    VERIFY_IS_EQUAL(a1.rows(),M);
-    VERIFY_IS_EQUAL(a1.cols(),N);
+    MatrixXi m1(M, N);
+    VERIFY_IS_EQUAL(m1.rows(), M);
+    VERIFY_IS_EQUAL(m1.cols(), N);
+    ArrayXXi a1(M, N);
+    VERIFY_IS_EQUAL(a1.rows(), M);
+    VERIFY_IS_EQUAL(a1.cols(), N);
     VectorXi v1(M);
-    VERIFY_IS_EQUAL(v1.size(),M);
+    VERIFY_IS_EQUAL(v1.size(), M);
     ArrayXi a2(M);
-    VERIFY_IS_EQUAL(a2.size(),M);
+    VERIFY_IS_EQUAL(a2.size(), M);
   }
 }
diff --git a/test/corners.cpp b/test/corners.cpp
index 73342a8..8bbb3f8 100644
--- a/test/corners.cpp
+++ b/test/corners.cpp
@@ -9,41 +9,41 @@
 
 #include "main.h"
 
-#define COMPARE_CORNER(A,B) \
+#define COMPARE_CORNER(A, B)           \
   VERIFY_IS_EQUAL(matrix.A, matrix.B); \
   VERIFY_IS_EQUAL(const_matrix.A, const_matrix.B);
 
-template<typename MatrixType> void corners(const MatrixType& m)
-{
+template <typename MatrixType>
+void corners(const MatrixType& m) {
   Index rows = m.rows();
   Index cols = m.cols();
 
-  Index r = internal::random<Index>(1,rows);
-  Index c = internal::random<Index>(1,cols);
+  Index r = internal::random<Index>(1, rows);
+  Index c = internal::random<Index>(1, cols);
 
-  MatrixType matrix = MatrixType::Random(rows,cols);
-  const MatrixType const_matrix = MatrixType::Random(rows,cols);
+  MatrixType matrix = MatrixType::Random(rows, cols);
+  const MatrixType const_matrix = MatrixType::Random(rows, cols);
 
-  COMPARE_CORNER(topLeftCorner(r,c), block(0,0,r,c));
-  COMPARE_CORNER(topRightCorner(r,c), block(0,cols-c,r,c));
-  COMPARE_CORNER(bottomLeftCorner(r,c), block(rows-r,0,r,c));
-  COMPARE_CORNER(bottomRightCorner(r,c), block(rows-r,cols-c,r,c));
+  COMPARE_CORNER(topLeftCorner(r, c), block(0, 0, r, c));
+  COMPARE_CORNER(topRightCorner(r, c), block(0, cols - c, r, c));
+  COMPARE_CORNER(bottomLeftCorner(r, c), block(rows - r, 0, r, c));
+  COMPARE_CORNER(bottomRightCorner(r, c), block(rows - r, cols - c, r, c));
 
-  Index sr = internal::random<Index>(1,rows) - 1;
-  Index nr = internal::random<Index>(1,rows-sr);
-  Index sc = internal::random<Index>(1,cols) - 1;
-  Index nc = internal::random<Index>(1,cols-sc);
+  Index sr = internal::random<Index>(1, rows) - 1;
+  Index nr = internal::random<Index>(1, rows - sr);
+  Index sc = internal::random<Index>(1, cols) - 1;
+  Index nc = internal::random<Index>(1, cols - sc);
 
-  COMPARE_CORNER(topRows(r), block(0,0,r,cols));
-  COMPARE_CORNER(middleRows(sr,nr), block(sr,0,nr,cols));
-  COMPARE_CORNER(bottomRows(r), block(rows-r,0,r,cols));
-  COMPARE_CORNER(leftCols(c), block(0,0,rows,c));
-  COMPARE_CORNER(middleCols(sc,nc), block(0,sc,rows,nc));
-  COMPARE_CORNER(rightCols(c), block(0,cols-c,rows,c));
+  COMPARE_CORNER(topRows(r), block(0, 0, r, cols));
+  COMPARE_CORNER(middleRows(sr, nr), block(sr, 0, nr, cols));
+  COMPARE_CORNER(bottomRows(r), block(rows - r, 0, r, cols));
+  COMPARE_CORNER(leftCols(c), block(0, 0, rows, c));
+  COMPARE_CORNER(middleCols(sc, nc), block(0, sc, rows, nc));
+  COMPARE_CORNER(rightCols(c), block(0, cols - c, rows, c));
 }
 
-template<typename MatrixType, int CRows, int CCols, int SRows, int SCols> void corners_fixedsize()
-{
+template <typename MatrixType, int CRows, int CCols, int SRows, int SCols>
+void corners_fixedsize() {
   MatrixType matrix = MatrixType::Random();
   const MatrixType const_matrix = MatrixType::Random();
 
@@ -52,66 +52,74 @@
     cols = MatrixType::ColsAtCompileTime,
     r = CRows,
     c = CCols,
-	sr = SRows,
-	sc = SCols
+    sr = SRows,
+    sc = SCols
   };
 
-  VERIFY_IS_EQUAL((matrix.template topLeftCorner<r,c>()), (matrix.template block<r,c>(0,0)));
-  VERIFY_IS_EQUAL((matrix.template topRightCorner<r,c>()), (matrix.template block<r,c>(0,cols-c)));
-  VERIFY_IS_EQUAL((matrix.template bottomLeftCorner<r,c>()), (matrix.template block<r,c>(rows-r,0)));
-  VERIFY_IS_EQUAL((matrix.template bottomRightCorner<r,c>()), (matrix.template block<r,c>(rows-r,cols-c)));
+  VERIFY_IS_EQUAL((matrix.template topLeftCorner<r, c>()), (matrix.template block<r, c>(0, 0)));
+  VERIFY_IS_EQUAL((matrix.template topRightCorner<r, c>()), (matrix.template block<r, c>(0, cols - c)));
+  VERIFY_IS_EQUAL((matrix.template bottomLeftCorner<r, c>()), (matrix.template block<r, c>(rows - r, 0)));
+  VERIFY_IS_EQUAL((matrix.template bottomRightCorner<r, c>()), (matrix.template block<r, c>(rows - r, cols - c)));
 
-  VERIFY_IS_EQUAL((matrix.template topLeftCorner<r,c>()), (matrix.template topLeftCorner<r,Dynamic>(r,c)));
-  VERIFY_IS_EQUAL((matrix.template topRightCorner<r,c>()), (matrix.template topRightCorner<r,Dynamic>(r,c)));
-  VERIFY_IS_EQUAL((matrix.template bottomLeftCorner<r,c>()), (matrix.template bottomLeftCorner<r,Dynamic>(r,c)));
-  VERIFY_IS_EQUAL((matrix.template bottomRightCorner<r,c>()), (matrix.template bottomRightCorner<r,Dynamic>(r,c)));
+  VERIFY_IS_EQUAL((matrix.template topLeftCorner<r, c>()), (matrix.template topLeftCorner<r, Dynamic>(r, c)));
+  VERIFY_IS_EQUAL((matrix.template topRightCorner<r, c>()), (matrix.template topRightCorner<r, Dynamic>(r, c)));
+  VERIFY_IS_EQUAL((matrix.template bottomLeftCorner<r, c>()), (matrix.template bottomLeftCorner<r, Dynamic>(r, c)));
+  VERIFY_IS_EQUAL((matrix.template bottomRightCorner<r, c>()), (matrix.template bottomRightCorner<r, Dynamic>(r, c)));
 
-  VERIFY_IS_EQUAL((matrix.template topLeftCorner<r,c>()), (matrix.template topLeftCorner<Dynamic,c>(r,c)));
-  VERIFY_IS_EQUAL((matrix.template topRightCorner<r,c>()), (matrix.template topRightCorner<Dynamic,c>(r,c)));
-  VERIFY_IS_EQUAL((matrix.template bottomLeftCorner<r,c>()), (matrix.template bottomLeftCorner<Dynamic,c>(r,c)));
-  VERIFY_IS_EQUAL((matrix.template bottomRightCorner<r,c>()), (matrix.template bottomRightCorner<Dynamic,c>(r,c)));
+  VERIFY_IS_EQUAL((matrix.template topLeftCorner<r, c>()), (matrix.template topLeftCorner<Dynamic, c>(r, c)));
+  VERIFY_IS_EQUAL((matrix.template topRightCorner<r, c>()), (matrix.template topRightCorner<Dynamic, c>(r, c)));
+  VERIFY_IS_EQUAL((matrix.template bottomLeftCorner<r, c>()), (matrix.template bottomLeftCorner<Dynamic, c>(r, c)));
+  VERIFY_IS_EQUAL((matrix.template bottomRightCorner<r, c>()), (matrix.template bottomRightCorner<Dynamic, c>(r, c)));
 
-  VERIFY_IS_EQUAL((matrix.template topRows<r>()), (matrix.template block<r,cols>(0,0)));
-  VERIFY_IS_EQUAL((matrix.template middleRows<r>(sr)), (matrix.template block<r,cols>(sr,0)));
-  VERIFY_IS_EQUAL((matrix.template bottomRows<r>()), (matrix.template block<r,cols>(rows-r,0)));
-  VERIFY_IS_EQUAL((matrix.template leftCols<c>()), (matrix.template block<rows,c>(0,0)));
-  VERIFY_IS_EQUAL((matrix.template middleCols<c>(sc)), (matrix.template block<rows,c>(0,sc)));
-  VERIFY_IS_EQUAL((matrix.template rightCols<c>()), (matrix.template block<rows,c>(0,cols-c)));
+  VERIFY_IS_EQUAL((matrix.template topRows<r>()), (matrix.template block<r, cols>(0, 0)));
+  VERIFY_IS_EQUAL((matrix.template middleRows<r>(sr)), (matrix.template block<r, cols>(sr, 0)));
+  VERIFY_IS_EQUAL((matrix.template bottomRows<r>()), (matrix.template block<r, cols>(rows - r, 0)));
+  VERIFY_IS_EQUAL((matrix.template leftCols<c>()), (matrix.template block<rows, c>(0, 0)));
+  VERIFY_IS_EQUAL((matrix.template middleCols<c>(sc)), (matrix.template block<rows, c>(0, sc)));
+  VERIFY_IS_EQUAL((matrix.template rightCols<c>()), (matrix.template block<rows, c>(0, cols - c)));
 
-  VERIFY_IS_EQUAL((const_matrix.template topLeftCorner<r,c>()), (const_matrix.template block<r,c>(0,0)));
-  VERIFY_IS_EQUAL((const_matrix.template topRightCorner<r,c>()), (const_matrix.template block<r,c>(0,cols-c)));
-  VERIFY_IS_EQUAL((const_matrix.template bottomLeftCorner<r,c>()), (const_matrix.template block<r,c>(rows-r,0)));
-  VERIFY_IS_EQUAL((const_matrix.template bottomRightCorner<r,c>()), (const_matrix.template block<r,c>(rows-r,cols-c)));
+  VERIFY_IS_EQUAL((const_matrix.template topLeftCorner<r, c>()), (const_matrix.template block<r, c>(0, 0)));
+  VERIFY_IS_EQUAL((const_matrix.template topRightCorner<r, c>()), (const_matrix.template block<r, c>(0, cols - c)));
+  VERIFY_IS_EQUAL((const_matrix.template bottomLeftCorner<r, c>()), (const_matrix.template block<r, c>(rows - r, 0)));
+  VERIFY_IS_EQUAL((const_matrix.template bottomRightCorner<r, c>()),
+                  (const_matrix.template block<r, c>(rows - r, cols - c)));
 
-  VERIFY_IS_EQUAL((const_matrix.template topLeftCorner<r,c>()), (const_matrix.template topLeftCorner<r,Dynamic>(r,c)));
-  VERIFY_IS_EQUAL((const_matrix.template topRightCorner<r,c>()), (const_matrix.template topRightCorner<r,Dynamic>(r,c)));
-  VERIFY_IS_EQUAL((const_matrix.template bottomLeftCorner<r,c>()), (const_matrix.template bottomLeftCorner<r,Dynamic>(r,c)));
-  VERIFY_IS_EQUAL((const_matrix.template bottomRightCorner<r,c>()), (const_matrix.template bottomRightCorner<r,Dynamic>(r,c)));
+  VERIFY_IS_EQUAL((const_matrix.template topLeftCorner<r, c>()),
+                  (const_matrix.template topLeftCorner<r, Dynamic>(r, c)));
+  VERIFY_IS_EQUAL((const_matrix.template topRightCorner<r, c>()),
+                  (const_matrix.template topRightCorner<r, Dynamic>(r, c)));
+  VERIFY_IS_EQUAL((const_matrix.template bottomLeftCorner<r, c>()),
+                  (const_matrix.template bottomLeftCorner<r, Dynamic>(r, c)));
+  VERIFY_IS_EQUAL((const_matrix.template bottomRightCorner<r, c>()),
+                  (const_matrix.template bottomRightCorner<r, Dynamic>(r, c)));
 
-  VERIFY_IS_EQUAL((const_matrix.template topLeftCorner<r,c>()), (const_matrix.template topLeftCorner<Dynamic,c>(r,c)));
-  VERIFY_IS_EQUAL((const_matrix.template topRightCorner<r,c>()), (const_matrix.template topRightCorner<Dynamic,c>(r,c)));
-  VERIFY_IS_EQUAL((const_matrix.template bottomLeftCorner<r,c>()), (const_matrix.template bottomLeftCorner<Dynamic,c>(r,c)));
-  VERIFY_IS_EQUAL((const_matrix.template bottomRightCorner<r,c>()), (const_matrix.template bottomRightCorner<Dynamic,c>(r,c)));
+  VERIFY_IS_EQUAL((const_matrix.template topLeftCorner<r, c>()),
+                  (const_matrix.template topLeftCorner<Dynamic, c>(r, c)));
+  VERIFY_IS_EQUAL((const_matrix.template topRightCorner<r, c>()),
+                  (const_matrix.template topRightCorner<Dynamic, c>(r, c)));
+  VERIFY_IS_EQUAL((const_matrix.template bottomLeftCorner<r, c>()),
+                  (const_matrix.template bottomLeftCorner<Dynamic, c>(r, c)));
+  VERIFY_IS_EQUAL((const_matrix.template bottomRightCorner<r, c>()),
+                  (const_matrix.template bottomRightCorner<Dynamic, c>(r, c)));
 
-  VERIFY_IS_EQUAL((const_matrix.template topRows<r>()), (const_matrix.template block<r,cols>(0,0)));
-  VERIFY_IS_EQUAL((const_matrix.template middleRows<r>(sr)), (const_matrix.template block<r,cols>(sr,0)));
-  VERIFY_IS_EQUAL((const_matrix.template bottomRows<r>()), (const_matrix.template block<r,cols>(rows-r,0)));
-  VERIFY_IS_EQUAL((const_matrix.template leftCols<c>()), (const_matrix.template block<rows,c>(0,0)));
-  VERIFY_IS_EQUAL((const_matrix.template middleCols<c>(sc)), (const_matrix.template block<rows,c>(0,sc)));
-  VERIFY_IS_EQUAL((const_matrix.template rightCols<c>()), (const_matrix.template block<rows,c>(0,cols-c)));
+  VERIFY_IS_EQUAL((const_matrix.template topRows<r>()), (const_matrix.template block<r, cols>(0, 0)));
+  VERIFY_IS_EQUAL((const_matrix.template middleRows<r>(sr)), (const_matrix.template block<r, cols>(sr, 0)));
+  VERIFY_IS_EQUAL((const_matrix.template bottomRows<r>()), (const_matrix.template block<r, cols>(rows - r, 0)));
+  VERIFY_IS_EQUAL((const_matrix.template leftCols<c>()), (const_matrix.template block<rows, c>(0, 0)));
+  VERIFY_IS_EQUAL((const_matrix.template middleCols<c>(sc)), (const_matrix.template block<rows, c>(0, sc)));
+  VERIFY_IS_EQUAL((const_matrix.template rightCols<c>()), (const_matrix.template block<rows, c>(0, cols - c)));
 }
 
-EIGEN_DECLARE_TEST(corners)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( corners(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( corners(Matrix4d()) );
-    CALL_SUBTEST_3( corners(Matrix<int,10,12>()) );
-    CALL_SUBTEST_4( corners(MatrixXcf(5, 7)) );
-    CALL_SUBTEST_5( corners(MatrixXf(21, 20)) );
+EIGEN_DECLARE_TEST(corners) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(corners(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(corners(Matrix4d()));
+    CALL_SUBTEST_3(corners(Matrix<int, 10, 12>()));
+    CALL_SUBTEST_4(corners(MatrixXcf(5, 7)));
+    CALL_SUBTEST_5(corners(MatrixXf(21, 20)));
 
-    CALL_SUBTEST_1(( corners_fixedsize<Matrix<float, 1, 1>, 1, 1, 0, 0>() ));
-    CALL_SUBTEST_2(( corners_fixedsize<Matrix4d,2,2,1,1>() ));
-    CALL_SUBTEST_3(( corners_fixedsize<Matrix<int,10,12>,4,7,5,2>() ));
+    CALL_SUBTEST_1((corners_fixedsize<Matrix<float, 1, 1>, 1, 1, 0, 0>()));
+    CALL_SUBTEST_2((corners_fixedsize<Matrix4d, 2, 2, 1, 1>()));
+    CALL_SUBTEST_3((corners_fixedsize<Matrix<int, 10, 12>, 4, 7, 5, 2>()));
   }
 }
diff --git a/test/ctorleak.cpp b/test/ctorleak.cpp
index 7390417..eb25897 100644
--- a/test/ctorleak.cpp
+++ b/test/ctorleak.cpp
@@ -2,25 +2,25 @@
 
 #include <exception>  // std::exception
 
-struct Foo
-{
+struct Foo {
   static Index object_count;
   static Index object_limit;
   int dummy;
 
-  Foo() : dummy(0)
-  {
+  Foo() : dummy(0) {
 #ifdef EIGEN_EXCEPTIONS
     // TODO: Is this the correct way to handle this?
-    if (Foo::object_count > Foo::object_limit) { std::cout << "\nThrow!\n"; throw Foo::Fail(); }
+    if (Foo::object_count > Foo::object_limit) {
+      std::cout << "\nThrow!\n";
+      throw Foo::Fail();
+    }
 #endif
-	  std::cout << '+';
+    std::cout << '+';
     ++Foo::object_count;
   }
 
-  ~Foo()
-  {
-	  std::cout << '-';
+  ~Foo() {
+    std::cout << '-';
     --Foo::object_count;
   }
 
@@ -33,47 +33,45 @@
 #undef EIGEN_TEST_MAX_SIZE
 #define EIGEN_TEST_MAX_SIZE 3
 
-EIGEN_DECLARE_TEST(ctorleak)
-{
+EIGEN_DECLARE_TEST(ctorleak) {
   typedef Matrix<Foo, Dynamic, Dynamic> MatrixX;
   typedef Matrix<Foo, Dynamic, 1> VectorX;
-  
+
   Foo::object_count = 0;
-  for(int i = 0; i < g_repeat; i++) {
-    Index rows = internal::random<Index>(2,EIGEN_TEST_MAX_SIZE), cols = internal::random<Index>(2,EIGEN_TEST_MAX_SIZE);
-    Foo::object_limit = rows*cols;
+  for (int i = 0; i < g_repeat; i++) {
+    Index rows = internal::random<Index>(2, EIGEN_TEST_MAX_SIZE),
+          cols = internal::random<Index>(2, EIGEN_TEST_MAX_SIZE);
+    Foo::object_limit = rows * cols;
     {
-    MatrixX r(rows, cols);
-    Foo::object_limit = r.size()+internal::random<Index>(0, rows*cols - 2);
-    std::cout << "object_limit =" << Foo::object_limit << std::endl;
+      MatrixX r(rows, cols);
+      Foo::object_limit = r.size() + internal::random<Index>(0, rows * cols - 2);
+      std::cout << "object_limit =" << Foo::object_limit << std::endl;
 #ifdef EIGEN_EXCEPTIONS
-    try
-    {
+      try {
 #endif
-      if(internal::random<bool>()) {
-        std::cout <<       "\nMatrixX m(" << rows << ", " << cols << ");\n";
-        MatrixX m(rows, cols);
-      }
-      else {
-        std::cout <<       "\nMatrixX m(r);\n";
-        MatrixX m(r);
-      }
+        if (internal::random<bool>()) {
+          std::cout << "\nMatrixX m(" << rows << ", " << cols << ");\n";
+          MatrixX m(rows, cols);
+        } else {
+          std::cout << "\nMatrixX m(r);\n";
+          MatrixX m(r);
+        }
 #ifdef EIGEN_EXCEPTIONS
-      VERIFY(false);  // not reached if exceptions are enabled
-    }
-    catch (const Foo::Fail&) { /* ignore */ }
+        VERIFY(false);             // not reached if exceptions are enabled
+      } catch (const Foo::Fail&) { /* ignore */
+      }
 #endif
     }
     VERIFY_IS_EQUAL(Index(0), Foo::object_count);
 
     {
-      Foo::object_limit = (rows+1)*(cols+1);
+      Foo::object_limit = (rows + 1) * (cols + 1);
       MatrixX A(rows, cols);
-      VERIFY_IS_EQUAL(Foo::object_count, rows*cols);
-      VectorX v=A.row(0);
-      VERIFY_IS_EQUAL(Foo::object_count, (rows+1)*cols);
+      VERIFY_IS_EQUAL(Foo::object_count, rows * cols);
+      VectorX v = A.row(0);
+      VERIFY_IS_EQUAL(Foo::object_count, (rows + 1) * cols);
       v = A.col(0);
-      VERIFY_IS_EQUAL(Foo::object_count, rows*(cols+1));
+      VERIFY_IS_EQUAL(Foo::object_count, rows * (cols + 1));
     }
     VERIFY_IS_EQUAL(Index(0), Foo::object_count);
   }
diff --git a/test/denseLM.cpp b/test/denseLM.cpp
index afb8004..471e946 100644
--- a/test/denseLM.cpp
+++ b/test/denseLM.cpp
@@ -17,174 +17,156 @@
 using namespace std;
 using namespace Eigen;
 
-template<typename Scalar>
-struct DenseLM : DenseFunctor<Scalar>
-{
+template <typename Scalar>
+struct DenseLM : DenseFunctor<Scalar> {
   typedef DenseFunctor<Scalar> Base;
   typedef typename Base::JacobianType JacobianType;
-  typedef Matrix<Scalar,Dynamic,1> VectorType;
-  
-  DenseLM(int n, int m) : DenseFunctor<Scalar>(n,m) 
-  { }
- 
-  VectorType model(const VectorType& uv, VectorType& x)
-  {
-    VectorType y; // Should change to use expression template
-    int m = Base::values(); 
+  typedef Matrix<Scalar, Dynamic, 1> VectorType;
+
+  DenseLM(int n, int m) : DenseFunctor<Scalar>(n, m) {}
+
+  VectorType model(const VectorType& uv, VectorType& x) {
+    VectorType y;  // Should change to use expression template
+    int m = Base::values();
     int n = Base::inputs();
-    eigen_assert(uv.size()%2 == 0);
+    eigen_assert(uv.size() % 2 == 0);
     eigen_assert(uv.size() == n);
     eigen_assert(x.size() == m);
     y.setZero(m);
-    int half = n/2;
+    int half = n / 2;
     VectorBlock<const VectorType> u(uv, 0, half);
     VectorBlock<const VectorType> v(uv, half, half);
-    for (int j = 0; j < m; j++)
-    {
-      for (int i = 0; i < half; i++)
-        y(j) += u(i)*std::exp(-(x(j)-i)*(x(j)-i)/(v(i)*v(i)));
+    for (int j = 0; j < m; j++) {
+      for (int i = 0; i < half; i++) y(j) += u(i) * std::exp(-(x(j) - i) * (x(j) - i) / (v(i) * v(i)));
     }
     return y;
-    
   }
-  void initPoints(VectorType& uv_ref, VectorType& x)
-  {
+  void initPoints(VectorType& uv_ref, VectorType& x) {
     m_x = x;
     m_y = this->model(uv_ref, x);
   }
-  
-  int operator()(const VectorType& uv, VectorType& fvec)
-  {
-    
-    int m = Base::values(); 
+
+  int operator()(const VectorType& uv, VectorType& fvec) {
+    int m = Base::values();
     int n = Base::inputs();
-    eigen_assert(uv.size()%2 == 0);
+    eigen_assert(uv.size() % 2 == 0);
     eigen_assert(uv.size() == n);
     eigen_assert(fvec.size() == m);
-    int half = n/2;
+    int half = n / 2;
     VectorBlock<const VectorType> u(uv, 0, half);
     VectorBlock<const VectorType> v(uv, half, half);
-    for (int j = 0; j < m; j++)
-    {
+    for (int j = 0; j < m; j++) {
       fvec(j) = m_y(j);
-      for (int i = 0; i < half; i++)
-      {
-        fvec(j) -= u(i) *std::exp(-(m_x(j)-i)*(m_x(j)-i)/(v(i)*v(i)));
+      for (int i = 0; i < half; i++) {
+        fvec(j) -= u(i) * std::exp(-(m_x(j) - i) * (m_x(j) - i) / (v(i) * v(i)));
       }
     }
-    
+
     return 0;
   }
-  int df(const VectorType& uv, JacobianType& fjac)
-  {
-    int m = Base::values(); 
+  int df(const VectorType& uv, JacobianType& fjac) {
+    int m = Base::values();
     int n = Base::inputs();
     eigen_assert(n == uv.size());
     eigen_assert(fjac.rows() == m);
     eigen_assert(fjac.cols() == n);
-    int half = n/2;
+    int half = n / 2;
     VectorBlock<const VectorType> u(uv, 0, half);
     VectorBlock<const VectorType> v(uv, half, half);
-    for (int j = 0; j < m; j++)
-    {
-      for (int i = 0; i < half; i++)
-      {
-        fjac.coeffRef(j,i) = -std::exp(-(m_x(j)-i)*(m_x(j)-i)/(v(i)*v(i)));
-        fjac.coeffRef(j,i+half) = -2.*u(i)*(m_x(j)-i)*(m_x(j)-i)/(std::pow(v(i),3)) * std::exp(-(m_x(j)-i)*(m_x(j)-i)/(v(i)*v(i)));
+    for (int j = 0; j < m; j++) {
+      for (int i = 0; i < half; i++) {
+        fjac.coeffRef(j, i) = -std::exp(-(m_x(j) - i) * (m_x(j) - i) / (v(i) * v(i)));
+        fjac.coeffRef(j, i + half) = -2. * u(i) * (m_x(j) - i) * (m_x(j) - i) / (std::pow(v(i), 3)) *
+                                     std::exp(-(m_x(j) - i) * (m_x(j) - i) / (v(i) * v(i)));
       }
     }
     return 0;
   }
-  VectorType m_x, m_y; //Data Points
+  VectorType m_x, m_y;  // Data Points
 };
 
-template<typename FunctorType, typename VectorType>
-int test_minimizeLM(FunctorType& functor, VectorType& uv)
-{
+template <typename FunctorType, typename VectorType>
+int test_minimizeLM(FunctorType& functor, VectorType& uv) {
   LevenbergMarquardt<FunctorType> lm(functor);
-  LevenbergMarquardtSpace::Status info; 
-  
+  LevenbergMarquardtSpace::Status info;
+
   info = lm.minimize(uv);
-  
+
   VERIFY_IS_EQUAL(info, 1);
-  //FIXME Check other parameters
+  // FIXME Check other parameters
   return info;
 }
 
-template<typename FunctorType, typename VectorType>
-int test_lmder(FunctorType& functor, VectorType& uv)
-{
+template <typename FunctorType, typename VectorType>
+int test_lmder(FunctorType& functor, VectorType& uv) {
   typedef typename VectorType::Scalar Scalar;
-  LevenbergMarquardtSpace::Status info; 
+  LevenbergMarquardtSpace::Status info;
   LevenbergMarquardt<FunctorType> lm(functor);
   info = lm.lmder1(uv);
-  
+
   VERIFY_IS_EQUAL(info, 1);
-  //FIXME Check other parameters
+  // FIXME Check other parameters
   return info;
 }
 
-template<typename FunctorType, typename VectorType>
-int test_minimizeSteps(FunctorType& functor, VectorType& uv)
-{
-  LevenbergMarquardtSpace::Status info;   
+template <typename FunctorType, typename VectorType>
+int test_minimizeSteps(FunctorType& functor, VectorType& uv) {
+  LevenbergMarquardtSpace::Status info;
   LevenbergMarquardt<FunctorType> lm(functor);
   info = lm.minimizeInit(uv);
-  if (info==LevenbergMarquardtSpace::ImproperInputParameters)
-      return info;
-  do 
-  {
+  if (info == LevenbergMarquardtSpace::ImproperInputParameters) return info;
+  do {
     info = lm.minimizeOneStep(uv);
-  } while (info==LevenbergMarquardtSpace::Running);
-  
+  } while (info == LevenbergMarquardtSpace::Running);
+
   VERIFY_IS_EQUAL(info, 1);
-  //FIXME Check other parameters
+  // FIXME Check other parameters
   return info;
 }
 
-template<typename T>
-void test_denseLM_T()
-{
-  typedef Matrix<T,Dynamic,1> VectorType;
-  
-  int inputs = 10; 
-  int values = 1000; 
+template <typename T>
+void test_denseLM_T() {
+  typedef Matrix<T, Dynamic, 1> VectorType;
+
+  int inputs = 10;
+  int values = 1000;
   DenseLM<T> dense_gaussian(inputs, values);
-  VectorType uv(inputs),uv_ref(inputs);
+  VectorType uv(inputs), uv_ref(inputs);
   VectorType x(values);
-  
-  // Generate the reference solution 
-  uv_ref << -2, 1, 4 ,8, 6, 1.8, 1.2, 1.1, 1.9 , 3;
-  
-  //Generate the reference data points
+
+  // Generate the reference solution
+  uv_ref << -2, 1, 4, 8, 6, 1.8, 1.2, 1.1, 1.9, 3;
+
+  // Generate the reference data points
   x.setRandom();
-  x = 10*x;
+  x = 10 * x;
   x.array() += 10;
   dense_gaussian.initPoints(uv_ref, x);
-  
-  // Generate the initial parameters 
-  VectorBlock<VectorType> u(uv, 0, inputs/2); 
-  VectorBlock<VectorType> v(uv, inputs/2, inputs/2);
-  
+
+  // Generate the initial parameters
+  VectorBlock<VectorType> u(uv, 0, inputs / 2);
+  VectorBlock<VectorType> v(uv, inputs / 2, inputs / 2);
+
   // Solve the optimization problem
-  
-  //Solve in one go
-  u.setOnes(); v.setOnes();
+
+  // Solve in one go
+  u.setOnes();
+  v.setOnes();
   test_minimizeLM(dense_gaussian, uv);
-  
-  //Solve until the machine precision
-  u.setOnes(); v.setOnes();
-  test_lmder(dense_gaussian, uv); 
-  
+
+  // Solve until the machine precision
+  u.setOnes();
+  v.setOnes();
+  test_lmder(dense_gaussian, uv);
+
   // Solve step by step
-  v.setOnes(); u.setOnes();
+  v.setOnes();
+  u.setOnes();
   test_minimizeSteps(dense_gaussian, uv);
-  
 }
 
-EIGEN_DECLARE_TEST(denseLM)
-{
+EIGEN_DECLARE_TEST(denseLM) {
   CALL_SUBTEST_2(test_denseLM_T<double>());
-  
+
   // CALL_SUBTEST_2(test_sparseLM_T<std::complex<double>());
 }
diff --git a/test/dense_storage.cpp b/test/dense_storage.cpp
index ec78f01..8d61e92 100644
--- a/test/dense_storage.cpp
+++ b/test/dense_storage.cpp
@@ -14,170 +14,167 @@
 #include <Eigen/Core>
 
 using DenseStorageD3x3 = Eigen::DenseStorage<double, 3, 3, 3, 3>;
-static_assert(std::is_trivially_move_constructible<DenseStorageD3x3>::value, "DenseStorage not trivially_move_constructible");
+static_assert(std::is_trivially_move_constructible<DenseStorageD3x3>::value,
+              "DenseStorage not trivially_move_constructible");
 static_assert(std::is_trivially_move_assignable<DenseStorageD3x3>::value, "DenseStorage not trivially_move_assignable");
 #if !defined(EIGEN_DENSE_STORAGE_CTOR_PLUGIN)
-static_assert(std::is_trivially_copy_constructible<DenseStorageD3x3>::value, "DenseStorage not trivially_copy_constructible");
+static_assert(std::is_trivially_copy_constructible<DenseStorageD3x3>::value,
+              "DenseStorage not trivially_copy_constructible");
 static_assert(std::is_trivially_copy_assignable<DenseStorageD3x3>::value, "DenseStorage not trivially_copy_assignable");
 static_assert(std::is_trivially_copyable<DenseStorageD3x3>::value, "DenseStorage not trivially_copyable");
 #endif
 
 template <typename T, int Size, int Rows, int Cols>
-void dense_storage_copy(int rows, int cols)
-{
+void dense_storage_copy(int rows, int cols) {
   typedef DenseStorage<T, Size, Rows, Cols, 0> DenseStorageType;
-  
-  const int size = rows*cols;
+
+  const int size = rows * cols;
   DenseStorageType reference(size, rows, cols);
   T* raw_reference = reference.data();
-  for (int i=0; i<size; ++i)
-    raw_reference[i] = static_cast<T>(i);
-    
+  for (int i = 0; i < size; ++i) raw_reference[i] = static_cast<T>(i);
+
   DenseStorageType copied_reference(reference);
   const T* raw_copied_reference = copied_reference.data();
-  for (int i=0; i<size; ++i)
-    VERIFY_IS_EQUAL(raw_reference[i], raw_copied_reference[i]);
+  for (int i = 0; i < size; ++i) VERIFY_IS_EQUAL(raw_reference[i], raw_copied_reference[i]);
 }
 
 template <typename T, int Size, int Rows, int Cols>
-void dense_storage_assignment(int rows, int cols)
-{
+void dense_storage_assignment(int rows, int cols) {
   typedef DenseStorage<T, Size, Rows, Cols, 0> DenseStorageType;
-  
-  const int size = rows*cols;
+
+  const int size = rows * cols;
   DenseStorageType reference(size, rows, cols);
   T* raw_reference = reference.data();
-  for (int i=0; i<size; ++i)
-    raw_reference[i] = static_cast<T>(i);
-    
+  for (int i = 0; i < size; ++i) raw_reference[i] = static_cast<T>(i);
+
   DenseStorageType copied_reference;
   copied_reference = reference;
   const T* raw_copied_reference = copied_reference.data();
-  for (int i=0; i<size; ++i)
-    VERIFY_IS_EQUAL(raw_reference[i], raw_copied_reference[i]);
+  for (int i = 0; i < size; ++i) VERIFY_IS_EQUAL(raw_reference[i], raw_copied_reference[i]);
 }
 
 template <typename T, int Size, int Rows, int Cols>
-void dense_storage_swap(int rows0, int cols0, int rows1, int cols1)
-{
+void dense_storage_swap(int rows0, int cols0, int rows1, int cols1) {
   typedef DenseStorage<T, Size, Rows, Cols, 0> DenseStorageType;
-  
-  const int size0 = rows0*cols0;
+
+  const int size0 = rows0 * cols0;
   DenseStorageType a(size0, rows0, cols0);
-  for (int i=0; i<size0; ++i) {
+  for (int i = 0; i < size0; ++i) {
     a.data()[i] = static_cast<T>(i);
   }
-  
-  const int size1 = rows1*cols1;
+
+  const int size1 = rows1 * cols1;
   DenseStorageType b(size1, rows1, cols1);
-  for (int i=0; i<size1; ++i) {
+  for (int i = 0; i < size1; ++i) {
     b.data()[i] = static_cast<T>(-i);
   }
-  
+
   a.swap(b);
-  
-  for (int i=0; i<size0; ++i) {
+
+  for (int i = 0; i < size0; ++i) {
     VERIFY_IS_EQUAL(b.data()[i], static_cast<T>(i));
   }
-  
-  for (int i=0; i<size1; ++i) {
+
+  for (int i = 0; i < size1; ++i) {
     VERIFY_IS_EQUAL(a.data()[i], static_cast<T>(-i));
   }
 }
 
-template<typename T, int Size, std::size_t Alignment>
-void dense_storage_alignment()
-{
+template <typename T, int Size, std::size_t Alignment>
+void dense_storage_alignment() {
   struct alignas(Alignment) Empty1 {};
   VERIFY_IS_EQUAL(std::alignment_of<Empty1>::value, Alignment);
 
   struct EIGEN_ALIGN_TO_BOUNDARY(Alignment) Empty2 {};
   VERIFY_IS_EQUAL(std::alignment_of<Empty2>::value, Alignment);
 
-  struct Nested1 { EIGEN_ALIGN_TO_BOUNDARY(Alignment) T data[Size]; };
+  struct Nested1 {
+    EIGEN_ALIGN_TO_BOUNDARY(Alignment) T data[Size];
+  };
   VERIFY_IS_EQUAL(std::alignment_of<Nested1>::value, Alignment);
 
-  VERIFY_IS_EQUAL( (std::alignment_of<internal::plain_array<T,Size,AutoAlign,Alignment> >::value), Alignment);
+  VERIFY_IS_EQUAL((std::alignment_of<internal::plain_array<T, Size, AutoAlign, Alignment> >::value), Alignment);
 
-  const std::size_t default_alignment = internal::compute_default_alignment<T,Size>::value;
+  const std::size_t default_alignment = internal::compute_default_alignment<T, Size>::value;
   if (default_alignment > 0) {
-    VERIFY_IS_EQUAL( (std::alignment_of<DenseStorage<T,Size,1,1,AutoAlign> >::value), default_alignment);
-    VERIFY_IS_EQUAL( (std::alignment_of<Matrix<T,Size,1,AutoAlign> >::value), default_alignment);
-    struct Nested2 { Matrix<T,Size,1,AutoAlign> mat; };
+    VERIFY_IS_EQUAL((std::alignment_of<DenseStorage<T, Size, 1, 1, AutoAlign> >::value), default_alignment);
+    VERIFY_IS_EQUAL((std::alignment_of<Matrix<T, Size, 1, AutoAlign> >::value), default_alignment);
+    struct Nested2 {
+      Matrix<T, Size, 1, AutoAlign> mat;
+    };
     VERIFY_IS_EQUAL(std::alignment_of<Nested2>::value, default_alignment);
   }
 }
 
-template<typename T>
+template <typename T>
 void dense_storage_tests() {
   // Dynamic Storage.
-  dense_storage_copy<T,Dynamic,Dynamic,Dynamic>(4, 3);  
-  dense_storage_copy<T,Dynamic,Dynamic,3>(4, 3);
-  dense_storage_copy<T,Dynamic,4,Dynamic>(4, 3);
+  dense_storage_copy<T, Dynamic, Dynamic, Dynamic>(4, 3);
+  dense_storage_copy<T, Dynamic, Dynamic, 3>(4, 3);
+  dense_storage_copy<T, Dynamic, 4, Dynamic>(4, 3);
   // Fixed Storage.
-  dense_storage_copy<T,12,4,3>(4, 3);
-  dense_storage_copy<T,12,Dynamic,Dynamic>(4, 3);
-  dense_storage_copy<T,12,4,Dynamic>(4, 3);
-  dense_storage_copy<T,12,Dynamic,3>(4, 3);
+  dense_storage_copy<T, 12, 4, 3>(4, 3);
+  dense_storage_copy<T, 12, Dynamic, Dynamic>(4, 3);
+  dense_storage_copy<T, 12, 4, Dynamic>(4, 3);
+  dense_storage_copy<T, 12, Dynamic, 3>(4, 3);
   // Fixed Storage with Uninitialized Elements.
-  dense_storage_copy<T,18,Dynamic,Dynamic>(4, 3);
-  dense_storage_copy<T,18,4,Dynamic>(4, 3);
-  dense_storage_copy<T,18,Dynamic,3>(4, 3);
-  
+  dense_storage_copy<T, 18, Dynamic, Dynamic>(4, 3);
+  dense_storage_copy<T, 18, 4, Dynamic>(4, 3);
+  dense_storage_copy<T, 18, Dynamic, 3>(4, 3);
+
   // Dynamic Storage.
-  dense_storage_assignment<T,Dynamic,Dynamic,Dynamic>(4, 3);  
-  dense_storage_assignment<T,Dynamic,Dynamic,3>(4, 3);
-  dense_storage_assignment<T,Dynamic,4,Dynamic>(4, 3);
+  dense_storage_assignment<T, Dynamic, Dynamic, Dynamic>(4, 3);
+  dense_storage_assignment<T, Dynamic, Dynamic, 3>(4, 3);
+  dense_storage_assignment<T, Dynamic, 4, Dynamic>(4, 3);
   // Fixed Storage.
-  dense_storage_assignment<T,12,4,3>(4, 3);
-  dense_storage_assignment<T,12,Dynamic,Dynamic>(4, 3);
-  dense_storage_assignment<T,12,4,Dynamic>(4, 3);
-  dense_storage_assignment<T,12,Dynamic,3>(4, 3);
+  dense_storage_assignment<T, 12, 4, 3>(4, 3);
+  dense_storage_assignment<T, 12, Dynamic, Dynamic>(4, 3);
+  dense_storage_assignment<T, 12, 4, Dynamic>(4, 3);
+  dense_storage_assignment<T, 12, Dynamic, 3>(4, 3);
   // Fixed Storage with Uninitialized Elements.
-  dense_storage_assignment<T,18,Dynamic,Dynamic>(4, 3);
-  dense_storage_assignment<T,18,4,Dynamic>(4, 3);
-  dense_storage_assignment<T,18,Dynamic,3>(4, 3);
-  
+  dense_storage_assignment<T, 18, Dynamic, Dynamic>(4, 3);
+  dense_storage_assignment<T, 18, 4, Dynamic>(4, 3);
+  dense_storage_assignment<T, 18, Dynamic, 3>(4, 3);
+
   // Dynamic Storage.
-  dense_storage_swap<T,Dynamic,Dynamic,Dynamic>(4, 3, 4, 3); 
-  dense_storage_swap<T,Dynamic,Dynamic,Dynamic>(4, 3, 2, 1);  
-  dense_storage_swap<T,Dynamic,Dynamic,Dynamic>(2, 1, 4, 3);
-  dense_storage_swap<T,Dynamic,Dynamic,3>(4, 3, 4, 3);
-  dense_storage_swap<T,Dynamic,Dynamic,3>(4, 3, 2, 3);
-  dense_storage_swap<T,Dynamic,Dynamic,3>(2, 3, 4, 3);
-  dense_storage_swap<T,Dynamic,4,Dynamic>(4, 3, 4, 3);
-  dense_storage_swap<T,Dynamic,4,Dynamic>(4, 3, 4, 1);
-  dense_storage_swap<T,Dynamic,4,Dynamic>(4, 1, 4, 3);
+  dense_storage_swap<T, Dynamic, Dynamic, Dynamic>(4, 3, 4, 3);
+  dense_storage_swap<T, Dynamic, Dynamic, Dynamic>(4, 3, 2, 1);
+  dense_storage_swap<T, Dynamic, Dynamic, Dynamic>(2, 1, 4, 3);
+  dense_storage_swap<T, Dynamic, Dynamic, 3>(4, 3, 4, 3);
+  dense_storage_swap<T, Dynamic, Dynamic, 3>(4, 3, 2, 3);
+  dense_storage_swap<T, Dynamic, Dynamic, 3>(2, 3, 4, 3);
+  dense_storage_swap<T, Dynamic, 4, Dynamic>(4, 3, 4, 3);
+  dense_storage_swap<T, Dynamic, 4, Dynamic>(4, 3, 4, 1);
+  dense_storage_swap<T, Dynamic, 4, Dynamic>(4, 1, 4, 3);
   // Fixed Storage.
-  dense_storage_swap<T,12,4,3>(4, 3, 4, 3);
-  dense_storage_swap<T,12,Dynamic,Dynamic>(4, 3, 4, 3);
-  dense_storage_swap<T,12,Dynamic,Dynamic>(4, 3, 2, 1);
-  dense_storage_swap<T,12,Dynamic,Dynamic>(2, 1, 4, 3);
-  dense_storage_swap<T,12,4,Dynamic>(4, 3, 4, 3);
-  dense_storage_swap<T,12,4,Dynamic>(4, 3, 4, 1);
-  dense_storage_swap<T,12,4,Dynamic>(4, 1, 4, 3);
-  dense_storage_swap<T,12,Dynamic,3>(4, 3, 4, 3);
-  dense_storage_swap<T,12,Dynamic,3>(4, 3, 2, 3);
-  dense_storage_swap<T,12,Dynamic,3>(2, 3, 4, 3);
+  dense_storage_swap<T, 12, 4, 3>(4, 3, 4, 3);
+  dense_storage_swap<T, 12, Dynamic, Dynamic>(4, 3, 4, 3);
+  dense_storage_swap<T, 12, Dynamic, Dynamic>(4, 3, 2, 1);
+  dense_storage_swap<T, 12, Dynamic, Dynamic>(2, 1, 4, 3);
+  dense_storage_swap<T, 12, 4, Dynamic>(4, 3, 4, 3);
+  dense_storage_swap<T, 12, 4, Dynamic>(4, 3, 4, 1);
+  dense_storage_swap<T, 12, 4, Dynamic>(4, 1, 4, 3);
+  dense_storage_swap<T, 12, Dynamic, 3>(4, 3, 4, 3);
+  dense_storage_swap<T, 12, Dynamic, 3>(4, 3, 2, 3);
+  dense_storage_swap<T, 12, Dynamic, 3>(2, 3, 4, 3);
   // Fixed Storage with Uninitialized Elements.
-  dense_storage_swap<T,18,Dynamic,Dynamic>(4, 3, 4, 3);
-  dense_storage_swap<T,18,Dynamic,Dynamic>(4, 3, 2, 1);
-  dense_storage_swap<T,18,Dynamic,Dynamic>(2, 1, 4, 3);
-  dense_storage_swap<T,18,4,Dynamic>(4, 3, 4, 3);
-  dense_storage_swap<T,18,4,Dynamic>(4, 3, 4, 1);
-  dense_storage_swap<T,18,4,Dynamic>(4, 1, 4, 3);
-  dense_storage_swap<T,18,Dynamic,3>(4, 3, 4, 3);
-  dense_storage_swap<T,18,Dynamic,3>(4, 3, 2, 3);
-  dense_storage_swap<T,18,Dynamic,3>(2, 3, 4, 3);
-  
-  dense_storage_alignment<T,16,8>();
-  dense_storage_alignment<T,16,16>();
-  dense_storage_alignment<T,16,32>();
-  dense_storage_alignment<T,16,64>();
+  dense_storage_swap<T, 18, Dynamic, Dynamic>(4, 3, 4, 3);
+  dense_storage_swap<T, 18, Dynamic, Dynamic>(4, 3, 2, 1);
+  dense_storage_swap<T, 18, Dynamic, Dynamic>(2, 1, 4, 3);
+  dense_storage_swap<T, 18, 4, Dynamic>(4, 3, 4, 3);
+  dense_storage_swap<T, 18, 4, Dynamic>(4, 3, 4, 1);
+  dense_storage_swap<T, 18, 4, Dynamic>(4, 1, 4, 3);
+  dense_storage_swap<T, 18, Dynamic, 3>(4, 3, 4, 3);
+  dense_storage_swap<T, 18, Dynamic, 3>(4, 3, 2, 3);
+  dense_storage_swap<T, 18, Dynamic, 3>(2, 3, 4, 3);
+
+  dense_storage_alignment<T, 16, 8>();
+  dense_storage_alignment<T, 16, 16>();
+  dense_storage_alignment<T, 16, 32>();
+  dense_storage_alignment<T, 16, 64>();
 }
 
-EIGEN_DECLARE_TEST(dense_storage)
-{
+EIGEN_DECLARE_TEST(dense_storage) {
   dense_storage_tests<int>();
   dense_storage_tests<float>();
   dense_storage_tests<SafeScalar<float> >();
diff --git a/test/determinant.cpp b/test/determinant.cpp
index 7dd33c3..0f2d4f8 100644
--- a/test/determinant.cpp
+++ b/test/determinant.cpp
@@ -11,8 +11,8 @@
 #include "main.h"
 #include <Eigen/LU>
 
-template<typename MatrixType> void determinant(const MatrixType& m)
-{
+template <typename MatrixType>
+void determinant(const MatrixType& m) {
   /* this test covers the following files:
      Determinant.h
   */
@@ -24,13 +24,13 @@
   typedef typename MatrixType::Scalar Scalar;
   Scalar x = internal::random<Scalar>();
   VERIFY_IS_APPROX(MatrixType::Identity(size, size).determinant(), Scalar(1));
-  VERIFY_IS_APPROX((m1*m2).eval().determinant(), m1.determinant() * m2.determinant());
-  if(size==1) return;
-  Index i = internal::random<Index>(0, size-1);
+  VERIFY_IS_APPROX((m1 * m2).eval().determinant(), m1.determinant() * m2.determinant());
+  if (size == 1) return;
+  Index i = internal::random<Index>(0, size - 1);
   Index j;
   do {
-    j = internal::random<Index>(0, size-1);
-  } while(j==i);
+    j = internal::random<Index>(0, size - 1);
+  } while (j == i);
   m2 = m1;
   m2.row(i).swap(m2.row(j));
   VERIFY_IS_APPROX(m2.determinant(), -m1.determinant());
@@ -40,27 +40,26 @@
   VERIFY_IS_APPROX(m2.determinant(), m2.transpose().determinant());
   VERIFY_IS_APPROX(numext::conj(m2.determinant()), m2.adjoint().determinant());
   m2 = m1;
-  m2.row(i) += x*m2.row(j);
+  m2.row(i) += x * m2.row(j);
   VERIFY_IS_APPROX(m2.determinant(), m1.determinant());
   m2 = m1;
   m2.row(i) *= x;
   VERIFY_IS_APPROX(m2.determinant(), m1.determinant() * x);
-  
+
   // check empty matrix
-  VERIFY_IS_APPROX(m2.block(0,0,0,0).determinant(), Scalar(1));
+  VERIFY_IS_APPROX(m2.block(0, 0, 0, 0).determinant(), Scalar(1));
 }
 
-EIGEN_DECLARE_TEST(determinant)
-{
-  for(int i = 0; i < g_repeat; i++) {
+EIGEN_DECLARE_TEST(determinant) {
+  for (int i = 0; i < g_repeat; i++) {
     int s = 0;
-    CALL_SUBTEST_1( determinant(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( determinant(Matrix<double, 2, 2>()) );
-    CALL_SUBTEST_3( determinant(Matrix<double, 3, 3>()) );
-    CALL_SUBTEST_4( determinant(Matrix<double, 4, 4>()) );
-    CALL_SUBTEST_5( determinant(Matrix<std::complex<double>, 10, 10>()) );
-    s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE/4);
-    CALL_SUBTEST_6( determinant(MatrixXd(s, s)) );
+    CALL_SUBTEST_1(determinant(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(determinant(Matrix<double, 2, 2>()));
+    CALL_SUBTEST_3(determinant(Matrix<double, 3, 3>()));
+    CALL_SUBTEST_4(determinant(Matrix<double, 4, 4>()));
+    CALL_SUBTEST_5(determinant(Matrix<std::complex<double>, 10, 10>()));
+    s = internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 4);
+    CALL_SUBTEST_6(determinant(MatrixXd(s, s)));
     TEST_SET_BUT_UNUSED_VARIABLE(s)
   }
 }
diff --git a/test/diagonal.cpp b/test/diagonal.cpp
index 4e8c4b3..a56118c 100644
--- a/test/diagonal.cpp
+++ b/test/diagonal.cpp
@@ -9,33 +9,27 @@
 
 #include "main.h"
 
-template<typename MatrixType> void diagonal(const MatrixType& m)
-{
+template <typename MatrixType>
+void diagonal(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
 
   Index rows = m.rows();
   Index cols = m.cols();
 
-  MatrixType m1 = MatrixType::Random(rows, cols),
-             m2 = MatrixType::Random(rows, cols);
+  MatrixType m1 = MatrixType::Random(rows, cols), m2 = MatrixType::Random(rows, cols);
 
   Scalar s1 = internal::random<Scalar>();
 
-  //check diagonal()
+  // check diagonal()
   VERIFY_IS_APPROX(m1.diagonal(), m1.transpose().diagonal());
   m2.diagonal() = 2 * m1.diagonal();
   m2.diagonal()[0] *= 3;
 
-  if (rows>2)
-  {
-    enum {
-      N1 = MatrixType::RowsAtCompileTime>2 ?  2 : 0,
-      N2 = MatrixType::RowsAtCompileTime>1 ? -1 : 0
-    };
+  if (rows > 2) {
+    enum { N1 = MatrixType::RowsAtCompileTime > 2 ? 2 : 0, N2 = MatrixType::RowsAtCompileTime > 1 ? -1 : 0 };
 
     // check sub/super diagonal
-    if(MatrixType::SizeAtCompileTime!=Dynamic)
-    {
+    if (MatrixType::SizeAtCompileTime != Dynamic) {
       VERIFY(m1.template diagonal<N1>().RowsAtCompileTime == m1.diagonal(N1).size());
       VERIFY(m1.template diagonal<N2>().RowsAtCompileTime == m1.diagonal(N2).size());
     }
@@ -45,7 +39,6 @@
     m2.template diagonal<N1>()[0] *= 3;
     VERIFY_IS_APPROX(m2.template diagonal<N1>()[0], static_cast<Scalar>(6) * m1.template diagonal<N1>()[0]);
 
-
     m2.template diagonal<N2>() = 2 * m1.template diagonal<N2>();
     m2.template diagonal<N2>()[0] *= 3;
     VERIFY_IS_APPROX(m2.template diagonal<N2>()[0], static_cast<Scalar>(6) * m1.template diagonal<N2>()[0]);
@@ -62,44 +55,48 @@
 
     m2.diagonal(N2).x() = s1;
     VERIFY_IS_APPROX(m2.diagonal(N2).x(), s1);
-    m2.diagonal(N2).coeffRef(0) = Scalar(2)*s1;
-    VERIFY_IS_APPROX(m2.diagonal(N2).coeff(0), Scalar(2)*s1);
+    m2.diagonal(N2).coeffRef(0) = Scalar(2) * s1;
+    VERIFY_IS_APPROX(m2.diagonal(N2).coeff(0), Scalar(2) * s1);
   }
 
-  VERIFY( m1.diagonal( cols).size()==0 );
-  VERIFY( m1.diagonal(-rows).size()==0 );
+  VERIFY(m1.diagonal(cols).size() == 0);
+  VERIFY(m1.diagonal(-rows).size() == 0);
 }
 
-template<typename MatrixType> void diagonal_assert(const MatrixType& m) {
+template <typename MatrixType>
+void diagonal_assert(const MatrixType& m) {
   Index rows = m.rows();
   Index cols = m.cols();
 
   MatrixType m1 = MatrixType::Random(rows, cols);
 
-  if (rows>=2 && cols>=2)
-  {
-    VERIFY_RAISES_ASSERT( m1 += m1.diagonal() );
-    VERIFY_RAISES_ASSERT( m1 -= m1.diagonal() );
-    VERIFY_RAISES_ASSERT( m1.array() *= m1.diagonal().array() );
-    VERIFY_RAISES_ASSERT( m1.array() /= m1.diagonal().array() );
+  if (rows >= 2 && cols >= 2) {
+    VERIFY_RAISES_ASSERT(m1 += m1.diagonal());
+    VERIFY_RAISES_ASSERT(m1 -= m1.diagonal());
+    VERIFY_RAISES_ASSERT(m1.array() *= m1.diagonal().array());
+    VERIFY_RAISES_ASSERT(m1.array() /= m1.diagonal().array());
   }
 
-  VERIFY_RAISES_ASSERT( m1.diagonal(cols+1) );
-  VERIFY_RAISES_ASSERT( m1.diagonal(-(rows+1)) );
+  VERIFY_RAISES_ASSERT(m1.diagonal(cols + 1));
+  VERIFY_RAISES_ASSERT(m1.diagonal(-(rows + 1)));
 }
 
-EIGEN_DECLARE_TEST(diagonal)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( diagonal(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_1( diagonal(Matrix<float, 4, 9>()) );
-    CALL_SUBTEST_1( diagonal(Matrix<float, 7, 3>()) );
-    CALL_SUBTEST_2( diagonal(Matrix4d()) );
-    CALL_SUBTEST_2( diagonal(MatrixXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_2( diagonal(MatrixXi(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_2( diagonal(MatrixXcd(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_1( diagonal(MatrixXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_1( diagonal(Matrix<float,Dynamic,4>(3, 4)) );
-    CALL_SUBTEST_1( diagonal_assert(MatrixXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
+EIGEN_DECLARE_TEST(diagonal) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(diagonal(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_1(diagonal(Matrix<float, 4, 9>()));
+    CALL_SUBTEST_1(diagonal(Matrix<float, 7, 3>()));
+    CALL_SUBTEST_2(diagonal(Matrix4d()));
+    CALL_SUBTEST_2(diagonal(
+        MatrixXcf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_2(diagonal(
+        MatrixXi(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_2(diagonal(
+        MatrixXcd(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_1(diagonal(
+        MatrixXf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_1(diagonal(Matrix<float, Dynamic, 4>(3, 4)));
+    CALL_SUBTEST_1(diagonal_assert(
+        MatrixXf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
   }
 }
diff --git a/test/diagonal_matrix_variadic_ctor.cpp b/test/diagonal_matrix_variadic_ctor.cpp
index db56539..e3e51aa 100644
--- a/test/diagonal_matrix_variadic_ctor.cpp
+++ b/test/diagonal_matrix_variadic_ctor.cpp
@@ -33,9 +33,8 @@
   VERIFY_IS_APPROX(Dense(3, 3), (Scalar)V3);                       \
   VERIFY_IS_APPROX(Dense(4, 4), (Scalar)V4);
 
-template<typename Scalar>
-void constructorTest()
-{
+template <typename Scalar>
+void constructorTest() {
   typedef DiagonalMatrix<Scalar, 0> DiagonalMatrix0;
   typedef DiagonalMatrix<Scalar, 3> DiagonalMatrix3;
   typedef DiagonalMatrix<Scalar, 4> DiagonalMatrix4;
@@ -46,21 +45,21 @@
 
   // Fixed-sized matrices
   {
-    DiagonalMatrix0 a {{}};
+    DiagonalMatrix0 a{{}};
     VERIFY(a.rows() == 0);
     VERIFY(a.cols() == 0);
     typename DiagonalMatrix0::DenseMatrixType m = a.toDenseMatrix();
     for (Index k = 0; k < a.rows(); ++k) VERIFY(m(k, k) == raw[k]);
   }
   {
-    DiagonalMatrix3 a {{raw[0], raw[1], raw[2]}};
+    DiagonalMatrix3 a{{raw[0], raw[1], raw[2]}};
     VERIFY(a.rows() == 3);
     VERIFY(a.cols() == 3);
     typename DiagonalMatrix3::DenseMatrixType m = a.toDenseMatrix();
     for (Index k = 0; k < a.rows(); ++k) VERIFY(m(k, k) == raw[k]);
   }
   {
-    DiagonalMatrix4 a {{raw[0], raw[1], raw[2], raw[3]}};
+    DiagonalMatrix4 a{{raw[0], raw[1], raw[2], raw[3]}};
     VERIFY(a.rows() == 4);
     VERIFY(a.cols() == 4);
     typename DiagonalMatrix4::DenseMatrixType m = a.toDenseMatrix();
@@ -84,9 +83,8 @@
   }
 }
 
-template<>
-void constructorTest<float>()
-{
+template <>
+void constructorTest<float>() {
   typedef float Scalar;
 
   typedef DiagonalMatrix<Scalar, 0> DiagonalMatrix0;
@@ -100,21 +98,21 @@
 
   // Fixed-sized matrices
   {
-    DiagonalMatrix0 a {{}};
+    DiagonalMatrix0 a{{}};
     VERIFY(a.rows() == 0);
     VERIFY(a.cols() == 0);
     typename DiagonalMatrix0::DenseMatrixType m = a.toDenseMatrix();
     for (Index k = 0; k < a.rows(); ++k) VERIFY(m(k, k) == raw[k]);
   }
   {
-    DiagonalMatrix3 a {{raw[0], raw[1], raw[2]}};
+    DiagonalMatrix3 a{{raw[0], raw[1], raw[2]}};
     VERIFY(a.rows() == 3);
     VERIFY(a.cols() == 3);
     typename DiagonalMatrix3::DenseMatrixType m = a.toDenseMatrix();
     for (Index k = 0; k < a.rows(); ++k) VERIFY(m(k, k) == raw[k]);
   }
   {
-    DiagonalMatrix4 a {{raw[0], raw[1], raw[2], raw[3]}};
+    DiagonalMatrix4 a{{raw[0], raw[1], raw[2], raw[3]}};
     VERIFY(a.rows() == 4);
     VERIFY(a.cols() == 4);
     typename DiagonalMatrix4::DenseMatrixType m = a.toDenseMatrix();
@@ -141,8 +139,7 @@
   { VERIFY_IMPLICIT_CONVERSION_5(DiagonalMatrix5, 1.2647, 2.56f, -3, 3.23f, 2); }
 }
 
-EIGEN_DECLARE_TEST(diagonal_matrix_variadic_ctor)
-{
+EIGEN_DECLARE_TEST(diagonal_matrix_variadic_ctor) {
   CALL_SUBTEST_2(constructorTest<unsigned char>());
   CALL_SUBTEST_2(constructorTest<float>());
   CALL_SUBTEST_2(constructorTest<Index>());
diff --git a/test/diagonalmatrices.cpp b/test/diagonalmatrices.cpp
index 15492a7..62450ab 100644
--- a/test/diagonalmatrices.cpp
+++ b/test/diagonalmatrices.cpp
@@ -7,7 +7,6 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-
 // discard stack allocation as that too bypasses malloc
 #define EIGEN_STACK_ALLOCATION_LIMIT 0
 // heap allocation will raise an assert if enabled at runtime
@@ -15,8 +14,8 @@
 
 #include "main.h"
 using namespace std;
-template<typename MatrixType> void diagonalmatrices(const MatrixType& m)
-{
+template <typename MatrixType>
+void diagonalmatrices(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
   enum { Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime };
   typedef Matrix<Scalar, Rows, 1> VectorType;
@@ -25,76 +24,73 @@
   typedef Matrix<Scalar, Dynamic, Dynamic> DynMatrixType;
   typedef DiagonalMatrix<Scalar, Rows> LeftDiagonalMatrix;
   typedef DiagonalMatrix<Scalar, Cols> RightDiagonalMatrix;
-  typedef Matrix<Scalar, Rows==Dynamic?Dynamic:2*Rows, Cols==Dynamic?Dynamic:2*Cols> BigMatrix;
+  typedef Matrix<Scalar, Rows == Dynamic ? Dynamic : 2 * Rows, Cols == Dynamic ? Dynamic : 2 * Cols> BigMatrix;
   Index rows = m.rows();
   Index cols = m.cols();
 
-  MatrixType m1 = MatrixType::Random(rows, cols),
-             m2 = MatrixType::Random(rows, cols);
-  VectorType v1 = VectorType::Random(rows),
-             v2 = VectorType::Random(rows);
-  RowVectorType rv1 = RowVectorType::Random(cols),
-             rv2 = RowVectorType::Random(cols);
+  MatrixType m1 = MatrixType::Random(rows, cols), m2 = MatrixType::Random(rows, cols);
+  VectorType v1 = VectorType::Random(rows), v2 = VectorType::Random(rows);
+  RowVectorType rv1 = RowVectorType::Random(cols), rv2 = RowVectorType::Random(cols);
 
   LeftDiagonalMatrix ldm1(v1), ldm2(v2);
   RightDiagonalMatrix rdm1(rv1), rdm2(rv2);
-  
+
   Scalar s1 = internal::random<Scalar>();
 
-  SquareMatrixType sq_m1 (v1.asDiagonal());
+  SquareMatrixType sq_m1(v1.asDiagonal());
   VERIFY_IS_APPROX(sq_m1, v1.asDiagonal().toDenseMatrix());
   sq_m1 = v1.asDiagonal();
   VERIFY_IS_APPROX(sq_m1, v1.asDiagonal().toDenseMatrix());
   SquareMatrixType sq_m2 = v1.asDiagonal();
   VERIFY_IS_APPROX(sq_m1, sq_m2);
-  
+
   ldm1 = v1.asDiagonal();
   LeftDiagonalMatrix ldm3(v1);
   VERIFY_IS_APPROX(ldm1.diagonal(), ldm3.diagonal());
   LeftDiagonalMatrix ldm4 = v1.asDiagonal();
   VERIFY_IS_APPROX(ldm1.diagonal(), ldm4.diagonal());
-  
-  sq_m1.block(0,0,rows,rows) = ldm1;
+
+  sq_m1.block(0, 0, rows, rows) = ldm1;
   VERIFY_IS_APPROX(sq_m1, ldm1.toDenseMatrix());
   sq_m1.transpose() = ldm1;
   VERIFY_IS_APPROX(sq_m1, ldm1.toDenseMatrix());
-  
-  Index i = internal::random<Index>(0, rows-1);
-  Index j = internal::random<Index>(0, cols-1);
-  
+
+  Index i = internal::random<Index>(0, rows - 1);
+  Index j = internal::random<Index>(0, cols - 1);
+
   internal::set_is_malloc_allowed(false);
-  VERIFY_IS_APPROX( ((ldm1 * m1)(i,j))  , ldm1.diagonal()(i) * m1(i,j) );
-  VERIFY_IS_APPROX( ((ldm1 * (m1+m2))(i,j))  , ldm1.diagonal()(i) * (m1+m2)(i,j) );
-  VERIFY_IS_APPROX( ((m1 * rdm1)(i,j))  , rdm1.diagonal()(j) * m1(i,j) );
-  VERIFY_IS_APPROX( ((v1.asDiagonal() * m1)(i,j))  , v1(i) * m1(i,j) );
-  VERIFY_IS_APPROX( ((m1 * rv1.asDiagonal())(i,j))  , rv1(j) * m1(i,j) );
-  VERIFY_IS_APPROX( (((v1+v2).asDiagonal() * m1)(i,j))  , (v1+v2)(i) * m1(i,j) );
-  VERIFY_IS_APPROX( (((v1+v2).asDiagonal() * (m1+m2))(i,j))  , (v1+v2)(i) * (m1+m2)(i,j) );
-  VERIFY_IS_APPROX( ((m1 * (rv1+rv2).asDiagonal())(i,j))  , (rv1+rv2)(j) * m1(i,j) );
-  VERIFY_IS_APPROX( (((m1+m2) * (rv1+rv2).asDiagonal())(i,j))  , (rv1+rv2)(j) * (m1+m2)(i,j) );
-  VERIFY_IS_APPROX( (ldm1 * ldm1).diagonal()(i), ldm1.diagonal()(i) * ldm1.diagonal()(i) );
-  VERIFY_IS_APPROX( (ldm1 * ldm1 * m1)(i, j), ldm1.diagonal()(i) * ldm1.diagonal()(i) * m1(i, j) );
-  VERIFY_IS_APPROX( ((v1.asDiagonal() * v1.asDiagonal()).diagonal()(i)), v1(i) * v1(i) );
+  VERIFY_IS_APPROX(((ldm1 * m1)(i, j)), ldm1.diagonal()(i) * m1(i, j));
+  VERIFY_IS_APPROX(((ldm1 * (m1 + m2))(i, j)), ldm1.diagonal()(i) * (m1 + m2)(i, j));
+  VERIFY_IS_APPROX(((m1 * rdm1)(i, j)), rdm1.diagonal()(j) * m1(i, j));
+  VERIFY_IS_APPROX(((v1.asDiagonal() * m1)(i, j)), v1(i) * m1(i, j));
+  VERIFY_IS_APPROX(((m1 * rv1.asDiagonal())(i, j)), rv1(j) * m1(i, j));
+  VERIFY_IS_APPROX((((v1 + v2).asDiagonal() * m1)(i, j)), (v1 + v2)(i)*m1(i, j));
+  VERIFY_IS_APPROX((((v1 + v2).asDiagonal() * (m1 + m2))(i, j)), (v1 + v2)(i) * (m1 + m2)(i, j));
+  VERIFY_IS_APPROX(((m1 * (rv1 + rv2).asDiagonal())(i, j)), (rv1 + rv2)(j)*m1(i, j));
+  VERIFY_IS_APPROX((((m1 + m2) * (rv1 + rv2).asDiagonal())(i, j)), (rv1 + rv2)(j) * (m1 + m2)(i, j));
+  VERIFY_IS_APPROX((ldm1 * ldm1).diagonal()(i), ldm1.diagonal()(i) * ldm1.diagonal()(i));
+  VERIFY_IS_APPROX((ldm1 * ldm1 * m1)(i, j), ldm1.diagonal()(i) * ldm1.diagonal()(i) * m1(i, j));
+  VERIFY_IS_APPROX(((v1.asDiagonal() * v1.asDiagonal()).diagonal()(i)), v1(i) * v1(i));
   internal::set_is_malloc_allowed(true);
-  
-  if(rows>1)
-  {
-    DynMatrixType tmp = m1.topRows(rows/2), res;
-    VERIFY_IS_APPROX( (res = m1.topRows(rows/2) * rv1.asDiagonal()), tmp * rv1.asDiagonal() );
-    VERIFY_IS_APPROX( (res = v1.head(rows/2).asDiagonal()*m1.topRows(rows/2)), v1.head(rows/2).asDiagonal()*tmp );
+
+  if (rows > 1) {
+    DynMatrixType tmp = m1.topRows(rows / 2), res;
+    VERIFY_IS_APPROX((res = m1.topRows(rows / 2) * rv1.asDiagonal()), tmp * rv1.asDiagonal());
+    VERIFY_IS_APPROX((res = v1.head(rows / 2).asDiagonal() * m1.topRows(rows / 2)),
+                     v1.head(rows / 2).asDiagonal() * tmp);
   }
 
   BigMatrix big;
-  big.setZero(2*rows, 2*cols);
-  
-  big.block(i,j,rows,cols) = m1;
-  big.block(i,j,rows,cols) = v1.asDiagonal() * big.block(i,j,rows,cols);
-  
-  VERIFY_IS_APPROX((big.block(i,j,rows,cols)) , v1.asDiagonal() * m1 );
-  
-  big.block(i,j,rows,cols) = m1;
-  big.block(i,j,rows,cols) = big.block(i,j,rows,cols) * rv1.asDiagonal();
-  VERIFY_IS_APPROX((big.block(i,j,rows,cols)) , m1 * rv1.asDiagonal() );
+  big.setZero(2 * rows, 2 * cols);
+
+  big.block(i, j, rows, cols) = m1;
+  big.block(i, j, rows, cols) = v1.asDiagonal() * big.block(i, j, rows, cols);
+
+  VERIFY_IS_APPROX((big.block(i, j, rows, cols)), v1.asDiagonal() * m1);
+
+  big.block(i, j, rows, cols) = m1;
+  big.block(i, j, rows, cols) = big.block(i, j, rows, cols) * rv1.asDiagonal();
+  VERIFY_IS_APPROX((big.block(i, j, rows, cols)), m1 * rv1.asDiagonal());
 
   // products do not allocate memory
   MatrixType res(rows, cols);
@@ -103,34 +99,34 @@
   res.noalias() = m1 * rdm1;
   res.noalias() = ldm1 * m1 * rdm1;
   res.noalias() = LeftDiagonalMatrix::Identity(rows) * m1 * RightDiagonalMatrix::Zero(cols);
-  internal::set_is_malloc_allowed(true);  
-  
+  internal::set_is_malloc_allowed(true);
+
   // scalar multiple
-  VERIFY_IS_APPROX(LeftDiagonalMatrix(ldm1*s1).diagonal(), ldm1.diagonal() * s1);
-  VERIFY_IS_APPROX(LeftDiagonalMatrix(s1*ldm1).diagonal(), s1 * ldm1.diagonal());
-  
+  VERIFY_IS_APPROX(LeftDiagonalMatrix(ldm1 * s1).diagonal(), ldm1.diagonal() * s1);
+  VERIFY_IS_APPROX(LeftDiagonalMatrix(s1 * ldm1).diagonal(), s1 * ldm1.diagonal());
+
   VERIFY_IS_APPROX(m1 * (rdm1 * s1), (m1 * rdm1) * s1);
   VERIFY_IS_APPROX(m1 * (s1 * rdm1), (m1 * rdm1) * s1);
-  
+
   // Diagonal to dense
   sq_m1.setRandom();
   sq_m2 = sq_m1;
-  VERIFY_IS_APPROX( (sq_m1 += (s1*v1).asDiagonal()), sq_m2 += (s1*v1).asDiagonal().toDenseMatrix() );
-  VERIFY_IS_APPROX( (sq_m1 -= (s1*v1).asDiagonal()), sq_m2 -= (s1*v1).asDiagonal().toDenseMatrix() );
-  VERIFY_IS_APPROX( (sq_m1 = (s1*v1).asDiagonal()), (s1*v1).asDiagonal().toDenseMatrix() );
+  VERIFY_IS_APPROX((sq_m1 += (s1 * v1).asDiagonal()), sq_m2 += (s1 * v1).asDiagonal().toDenseMatrix());
+  VERIFY_IS_APPROX((sq_m1 -= (s1 * v1).asDiagonal()), sq_m2 -= (s1 * v1).asDiagonal().toDenseMatrix());
+  VERIFY_IS_APPROX((sq_m1 = (s1 * v1).asDiagonal()), (s1 * v1).asDiagonal().toDenseMatrix());
 
   sq_m1.setRandom();
   sq_m2 = v1.asDiagonal();
   sq_m2 = sq_m1 * sq_m2;
-  VERIFY_IS_APPROX( (sq_m1*v1.asDiagonal()).col(i), sq_m2.col(i) );
-  VERIFY_IS_APPROX( (sq_m1*v1.asDiagonal()).row(i), sq_m2.row(i) );
+  VERIFY_IS_APPROX((sq_m1 * v1.asDiagonal()).col(i), sq_m2.col(i));
+  VERIFY_IS_APPROX((sq_m1 * v1.asDiagonal()).row(i), sq_m2.row(i));
 
   sq_m1 = v1.asDiagonal();
   sq_m2 = v2.asDiagonal();
   SquareMatrixType sq_m3 = v1.asDiagonal();
-  VERIFY_IS_APPROX( sq_m3 = v1.asDiagonal() + v2.asDiagonal(), sq_m1 + sq_m2);
-  VERIFY_IS_APPROX( sq_m3 = v1.asDiagonal() - v2.asDiagonal(), sq_m1 - sq_m2);
-  VERIFY_IS_APPROX( sq_m3 = v1.asDiagonal() - 2*v2.asDiagonal() + v1.asDiagonal(), sq_m1 - 2*sq_m2 + sq_m1);
+  VERIFY_IS_APPROX(sq_m3 = v1.asDiagonal() + v2.asDiagonal(), sq_m1 + sq_m2);
+  VERIFY_IS_APPROX(sq_m3 = v1.asDiagonal() - v2.asDiagonal(), sq_m1 - sq_m2);
+  VERIFY_IS_APPROX(sq_m3 = v1.asDiagonal() - 2 * v2.asDiagonal() + v1.asDiagonal(), sq_m1 - 2 * sq_m2 + sq_m1);
 
   // Zero and Identity
   LeftDiagonalMatrix zero = LeftDiagonalMatrix::Zero(rows);
@@ -140,8 +136,8 @@
   VERIFY_IS_APPROX((zero + 2 * LeftDiagonalMatrix::Identity(rows)).diagonal().sum(), Scalar(2 * rows));
 }
 
-template<typename MatrixType> void as_scalar_product(const MatrixType& m)
-{
+template <typename MatrixType>
+void as_scalar_product(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
   typedef Matrix<Scalar, Dynamic, Dynamic> DynMatrixType;
@@ -149,51 +145,53 @@
   typedef Matrix<Scalar, 1, Dynamic> DynRowVectorType;
 
   Index rows = m.rows();
-  Index depth = internal::random<Index>(1,EIGEN_TEST_MAX_SIZE);
+  Index depth = internal::random<Index>(1, EIGEN_TEST_MAX_SIZE);
 
-  VectorType v1 = VectorType::Random(rows);  
-  DynVectorType     dv1  = DynVectorType::Random(depth);
-  DynRowVectorType  drv1 = DynRowVectorType::Random(depth);
-  DynMatrixType     dm1  = dv1;
-  DynMatrixType     drm1 = drv1;
-  
+  VectorType v1 = VectorType::Random(rows);
+  DynVectorType dv1 = DynVectorType::Random(depth);
+  DynRowVectorType drv1 = DynRowVectorType::Random(depth);
+  DynMatrixType dm1 = dv1;
+  DynMatrixType drm1 = drv1;
+
   Scalar s = v1(0);
 
-  VERIFY_IS_APPROX( v1.asDiagonal() * drv1, s*drv1 );
-  VERIFY_IS_APPROX( dv1 * v1.asDiagonal(), dv1*s );
+  VERIFY_IS_APPROX(v1.asDiagonal() * drv1, s * drv1);
+  VERIFY_IS_APPROX(dv1 * v1.asDiagonal(), dv1 * s);
 
-  VERIFY_IS_APPROX( v1.asDiagonal() * drm1, s*drm1 );
-  VERIFY_IS_APPROX( dm1 * v1.asDiagonal(), dm1*s );
+  VERIFY_IS_APPROX(v1.asDiagonal() * drm1, s * drm1);
+  VERIFY_IS_APPROX(dm1 * v1.asDiagonal(), dm1 * s);
 }
 
-template<int>
-void bug987()
-{
+template <int>
+void bug987() {
   Matrix3Xd points = Matrix3Xd::Random(3, 3);
   Vector2d diag = Vector2d::Random();
   Matrix2Xd tmp1 = points.topRows<2>(), res1, res2;
-  VERIFY_IS_APPROX( res1 = diag.asDiagonal() * points.topRows<2>(), res2 = diag.asDiagonal() * tmp1 );
-  Matrix2d tmp2 = points.topLeftCorner<2,2>();
-  VERIFY_IS_APPROX(( res1 = points.topLeftCorner<2,2>()*diag.asDiagonal()) , res2 = tmp2*diag.asDiagonal() );
+  VERIFY_IS_APPROX(res1 = diag.asDiagonal() * points.topRows<2>(), res2 = diag.asDiagonal() * tmp1);
+  Matrix2d tmp2 = points.topLeftCorner<2, 2>();
+  VERIFY_IS_APPROX((res1 = points.topLeftCorner<2, 2>() * diag.asDiagonal()), res2 = tmp2 * diag.asDiagonal());
 }
 
-EIGEN_DECLARE_TEST(diagonalmatrices)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( diagonalmatrices(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_1( as_scalar_product(Matrix<float, 1, 1>()) );
+EIGEN_DECLARE_TEST(diagonalmatrices) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(diagonalmatrices(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_1(as_scalar_product(Matrix<float, 1, 1>()));
 
-    CALL_SUBTEST_2( diagonalmatrices(Matrix3f()) );
-    CALL_SUBTEST_3( diagonalmatrices(Matrix<double,3,3,RowMajor>()) );
-    CALL_SUBTEST_4( diagonalmatrices(Matrix4d()) );
-    CALL_SUBTEST_5( diagonalmatrices(Matrix<float,4,4,RowMajor>()) );
-    CALL_SUBTEST_6( diagonalmatrices(MatrixXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_6( as_scalar_product(MatrixXcf(1,1)) );
-    CALL_SUBTEST_7( diagonalmatrices(MatrixXi(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_8( diagonalmatrices(Matrix<double,Dynamic,Dynamic,RowMajor>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_9( diagonalmatrices(MatrixXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_9( diagonalmatrices(MatrixXf(1,1)) );
-    CALL_SUBTEST_9( as_scalar_product(MatrixXf(1,1)) );
+    CALL_SUBTEST_2(diagonalmatrices(Matrix3f()));
+    CALL_SUBTEST_3(diagonalmatrices(Matrix<double, 3, 3, RowMajor>()));
+    CALL_SUBTEST_4(diagonalmatrices(Matrix4d()));
+    CALL_SUBTEST_5(diagonalmatrices(Matrix<float, 4, 4, RowMajor>()));
+    CALL_SUBTEST_6(diagonalmatrices(
+        MatrixXcf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_6(as_scalar_product(MatrixXcf(1, 1)));
+    CALL_SUBTEST_7(diagonalmatrices(
+        MatrixXi(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_8(diagonalmatrices(Matrix<double, Dynamic, Dynamic, RowMajor>(
+        internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_9(diagonalmatrices(
+        MatrixXf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_9(diagonalmatrices(MatrixXf(1, 1)));
+    CALL_SUBTEST_9(as_scalar_product(MatrixXf(1, 1)));
   }
-  CALL_SUBTEST_10( bug987<0>() );
+  CALL_SUBTEST_10(bug987<0>());
 }
diff --git a/test/dontalign.cpp b/test/dontalign.cpp
index 2e4102b..2210bad 100644
--- a/test/dontalign.cpp
+++ b/test/dontalign.cpp
@@ -16,9 +16,8 @@
 #include "main.h"
 #include <Eigen/Dense>
 
-template<typename MatrixType>
-void dontalign(const MatrixType& m)
-{
+template <typename MatrixType>
+void dontalign(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> SquareMatrixType;
@@ -26,14 +25,14 @@
   Index rows = m.rows();
   Index cols = m.cols();
 
-  MatrixType a = MatrixType::Random(rows,cols);
-  SquareMatrixType square = SquareMatrixType::Random(rows,rows);
+  MatrixType a = MatrixType::Random(rows, cols);
+  SquareMatrixType square = SquareMatrixType::Random(rows, rows);
   VectorType v = VectorType::Random(rows);
 
   VERIFY_IS_APPROX(v, square * square.colPivHouseholderQr().solve(v));
   square = square.inverse().eval();
   a = square * a;
-  square = square*square;
+  square = square * square;
   v = square * v;
   v = a.adjoint() * v;
   VERIFY(square.determinant() != Scalar(0));
@@ -44,8 +43,7 @@
   internal::aligned_delete(array, rows);
 }
 
-EIGEN_DECLARE_TEST(dontalign)
-{
+EIGEN_DECLARE_TEST(dontalign) {
 #if defined EIGEN_TEST_PART_1 || defined EIGEN_TEST_PART_5
   dontalign(Matrix3d());
   dontalign(Matrix4f());
diff --git a/test/dynalloc.cpp b/test/dynalloc.cpp
index f75ff6c..8732f68 100644
--- a/test/dynalloc.cpp
+++ b/test/dynalloc.cpp
@@ -9,172 +9,160 @@
 
 #include "main.h"
 
-#if EIGEN_MAX_ALIGN_BYTES>0
+#if EIGEN_MAX_ALIGN_BYTES > 0
 #define ALIGNMENT EIGEN_MAX_ALIGN_BYTES
 #else
 #define ALIGNMENT 1
 #endif
 
-typedef Matrix<float,16,1> Vector16f;
-typedef Matrix<float,8,1> Vector8f;
+typedef Matrix<float, 16, 1> Vector16f;
+typedef Matrix<float, 8, 1> Vector8f;
 
-void check_handmade_aligned_malloc()
-{
+void check_handmade_aligned_malloc() {
   // Hand-make alignment needs at least sizeof(void*) to store the offset.
-  constexpr int alignment = (std::max<int>)(EIGEN_DEFAULT_ALIGN_BYTES, sizeof(void*));
-  
-  for(int i = 1; i < 1000; i++)
-  {
-    char *p = (char*)internal::handmade_aligned_malloc(i, alignment);
-    VERIFY(std::uintptr_t(p)%ALIGNMENT==0);
+  constexpr int alignment = (std::max<int>)(EIGEN_DEFAULT_ALIGN_BYTES, sizeof(void *));
+
+  for (int i = 1; i < 1000; i++) {
+    char *p = (char *)internal::handmade_aligned_malloc(i, alignment);
+    VERIFY(std::uintptr_t(p) % ALIGNMENT == 0);
     // if the buffer is wrongly allocated this will give a bad write --> check with valgrind
-    for(int j = 0; j < i; j++) p[j]=0;
+    for (int j = 0; j < i; j++) p[j] = 0;
     internal::handmade_aligned_free(p);
   }
 }
 
-void check_aligned_malloc()
-{
-  for(int i = ALIGNMENT; i < 1000; i++)
-  {
-    char *p = (char*)internal::aligned_malloc(i);
-    VERIFY(std::uintptr_t(p)%ALIGNMENT==0);
+void check_aligned_malloc() {
+  for (int i = ALIGNMENT; i < 1000; i++) {
+    char *p = (char *)internal::aligned_malloc(i);
+    VERIFY(std::uintptr_t(p) % ALIGNMENT == 0);
     // if the buffer is wrongly allocated this will give a bad write --> check with valgrind
-    for(int j = 0; j < i; j++) p[j]=0;
+    for (int j = 0; j < i; j++) p[j] = 0;
     internal::aligned_free(p);
   }
 }
 
-void check_aligned_new()
-{
-  for(int i = ALIGNMENT; i < 1000; i++)
-  {
+void check_aligned_new() {
+  for (int i = ALIGNMENT; i < 1000; i++) {
     float *p = internal::aligned_new<float>(i);
-    VERIFY(std::uintptr_t(p)%ALIGNMENT==0);
+    VERIFY(std::uintptr_t(p) % ALIGNMENT == 0);
     // if the buffer is wrongly allocated this will give a bad write --> check with valgrind
-    for(int j = 0; j < i; j++) p[j]=0;
-    internal::aligned_delete(p,i);
+    for (int j = 0; j < i; j++) p[j] = 0;
+    internal::aligned_delete(p, i);
   }
 }
 
-void check_aligned_stack_alloc()
-{
-  for(int i = ALIGNMENT; i < 400; i++)
-  {
-    ei_declare_aligned_stack_constructed_variable(float,p,i,0);
-    VERIFY(std::uintptr_t(p)%ALIGNMENT==0);
+void check_aligned_stack_alloc() {
+  for (int i = ALIGNMENT; i < 400; i++) {
+    ei_declare_aligned_stack_constructed_variable(float, p, i, 0);
+    VERIFY(std::uintptr_t(p) % ALIGNMENT == 0);
     // if the buffer is wrongly allocated this will give a bad write --> check with valgrind
-    for(int j = 0; j < i; j++) p[j]=0;
+    for (int j = 0; j < i; j++) p[j] = 0;
   }
 }
 
-
 // test compilation with both a struct and a class...
-struct MyStruct
-{
+struct MyStruct {
   EIGEN_MAKE_ALIGNED_OPERATOR_NEW
   char dummychar;
   Vector16f avec;
 };
 
-class MyClassA
-{
-  public:
-    EIGEN_MAKE_ALIGNED_OPERATOR_NEW
-    char dummychar;
-    Vector16f avec;
+class MyClassA {
+ public:
+  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
+  char dummychar;
+  Vector16f avec;
 };
 
-template<typename T> void check_dynaligned()
-{
+template <typename T>
+void check_dynaligned() {
   // TODO have to be updated once we support multiple alignment values
-  if(T::SizeAtCompileTime % ALIGNMENT == 0)
-  {
-    T* obj = new T;
-    VERIFY(T::NeedsToAlign==1);
-    VERIFY(std::uintptr_t(obj)%ALIGNMENT==0);
+  if (T::SizeAtCompileTime % ALIGNMENT == 0) {
+    T *obj = new T;
+    VERIFY(T::NeedsToAlign == 1);
+    VERIFY(std::uintptr_t(obj) % ALIGNMENT == 0);
     delete obj;
   }
 }
 
-template<typename T> void check_custom_new_delete()
-{
+template <typename T>
+void check_custom_new_delete() {
   {
-    T* t = new T;
+    T *t = new T;
     delete t;
   }
-  
+
   {
-    std::size_t N = internal::random<std::size_t>(1,10);
-    T* t = new T[N];
+    std::size_t N = internal::random<std::size_t>(1, 10);
+    T *t = new T[N];
     delete[] t;
   }
-  
-#if EIGEN_MAX_ALIGN_BYTES>0 && (!EIGEN_HAS_CXX17_OVERALIGN)
+
+#if EIGEN_MAX_ALIGN_BYTES > 0 && (!EIGEN_HAS_CXX17_OVERALIGN)
   {
-    T* t = static_cast<T *>((T::operator new)(sizeof(T)));
+    T *t = static_cast<T *>((T::operator new)(sizeof(T)));
     (T::operator delete)(t, sizeof(T));
   }
-  
+
   {
-    T* t = static_cast<T *>((T::operator new)(sizeof(T)));
+    T *t = static_cast<T *>((T::operator new)(sizeof(T)));
     (T::operator delete)(t);
   }
 #endif
 }
 
-EIGEN_DECLARE_TEST(dynalloc)
-{
+EIGEN_DECLARE_TEST(dynalloc) {
   // low level dynamic memory allocation
   CALL_SUBTEST(check_handmade_aligned_malloc());
   CALL_SUBTEST(check_aligned_malloc());
   CALL_SUBTEST(check_aligned_new());
   CALL_SUBTEST(check_aligned_stack_alloc());
 
-  for (int i=0; i<g_repeat*100; ++i)
-  {
-    CALL_SUBTEST( check_custom_new_delete<Vector4f>() );
-    CALL_SUBTEST( check_custom_new_delete<Vector2f>() );
-    CALL_SUBTEST( check_custom_new_delete<Matrix4f>() );
-    CALL_SUBTEST( check_custom_new_delete<MatrixXi>() );
+  for (int i = 0; i < g_repeat * 100; ++i) {
+    CALL_SUBTEST(check_custom_new_delete<Vector4f>());
+    CALL_SUBTEST(check_custom_new_delete<Vector2f>());
+    CALL_SUBTEST(check_custom_new_delete<Matrix4f>());
+    CALL_SUBTEST(check_custom_new_delete<MatrixXi>());
   }
-  
-  // check static allocation, who knows ?
-  #if EIGEN_MAX_STATIC_ALIGN_BYTES
-  for (int i=0; i<g_repeat*100; ++i)
-  {
-    CALL_SUBTEST(check_dynaligned<Vector4f>() );
-    CALL_SUBTEST(check_dynaligned<Vector2d>() );
-    CALL_SUBTEST(check_dynaligned<Matrix4f>() );
-    CALL_SUBTEST(check_dynaligned<Vector4d>() );
-    CALL_SUBTEST(check_dynaligned<Vector4i>() );
-    CALL_SUBTEST(check_dynaligned<Vector8f>() );
-    CALL_SUBTEST(check_dynaligned<Vector16f>() );
+
+// check static allocation, who knows ?
+#if EIGEN_MAX_STATIC_ALIGN_BYTES
+  for (int i = 0; i < g_repeat * 100; ++i) {
+    CALL_SUBTEST(check_dynaligned<Vector4f>());
+    CALL_SUBTEST(check_dynaligned<Vector2d>());
+    CALL_SUBTEST(check_dynaligned<Matrix4f>());
+    CALL_SUBTEST(check_dynaligned<Vector4d>());
+    CALL_SUBTEST(check_dynaligned<Vector4i>());
+    CALL_SUBTEST(check_dynaligned<Vector8f>());
+    CALL_SUBTEST(check_dynaligned<Vector16f>());
   }
 
   {
-    MyStruct foo0;  VERIFY(std::uintptr_t(foo0.avec.data())%ALIGNMENT==0);
-    MyClassA fooA;  VERIFY(std::uintptr_t(fooA.avec.data())%ALIGNMENT==0);
+    MyStruct foo0;
+    VERIFY(std::uintptr_t(foo0.avec.data()) % ALIGNMENT == 0);
+    MyClassA fooA;
+    VERIFY(std::uintptr_t(fooA.avec.data()) % ALIGNMENT == 0);
   }
-  
+
   // dynamic allocation, single object
-  for (int i=0; i<g_repeat*100; ++i)
-  {
-    MyStruct *foo0 = new MyStruct();  VERIFY(std::uintptr_t(foo0->avec.data())%ALIGNMENT==0);
-    MyClassA *fooA = new MyClassA();  VERIFY(std::uintptr_t(fooA->avec.data())%ALIGNMENT==0);
+  for (int i = 0; i < g_repeat * 100; ++i) {
+    MyStruct *foo0 = new MyStruct();
+    VERIFY(std::uintptr_t(foo0->avec.data()) % ALIGNMENT == 0);
+    MyClassA *fooA = new MyClassA();
+    VERIFY(std::uintptr_t(fooA->avec.data()) % ALIGNMENT == 0);
     delete foo0;
     delete fooA;
   }
 
   // dynamic allocation, array
   const int N = 10;
-  for (int i=0; i<g_repeat*100; ++i)
-  {
-    MyStruct *foo0 = new MyStruct[N];  VERIFY(std::uintptr_t(foo0->avec.data())%ALIGNMENT==0);
-    MyClassA *fooA = new MyClassA[N];  VERIFY(std::uintptr_t(fooA->avec.data())%ALIGNMENT==0);
+  for (int i = 0; i < g_repeat * 100; ++i) {
+    MyStruct *foo0 = new MyStruct[N];
+    VERIFY(std::uintptr_t(foo0->avec.data()) % ALIGNMENT == 0);
+    MyClassA *fooA = new MyClassA[N];
+    VERIFY(std::uintptr_t(fooA->avec.data()) % ALIGNMENT == 0);
     delete[] foo0;
     delete[] fooA;
   }
-  #endif
-  
+#endif
 }
diff --git a/test/eigen2support.cpp b/test/eigen2support.cpp
index 49d7328..878352b 100644
--- a/test/eigen2support.cpp
+++ b/test/eigen2support.cpp
@@ -11,23 +11,21 @@
 
 #include "main.h"
 
-template<typename MatrixType> void eigen2support(const MatrixType& m)
-{
+template <typename MatrixType>
+void eigen2support(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
 
   Index rows = m.rows();
   Index cols = m.cols();
 
-  MatrixType m1 = MatrixType::Random(rows, cols),
-             m3(rows, cols);
+  MatrixType m1 = MatrixType::Random(rows, cols), m3(rows, cols);
 
-  Scalar  s1 = internal::random<Scalar>(),
-          s2 = internal::random<Scalar>();
+  Scalar s1 = internal::random<Scalar>(), s2 = internal::random<Scalar>();
 
   // scalar addition
   VERIFY_IS_APPROX(m1.cwise() + s1, s1 + m1.cwise());
-  VERIFY_IS_APPROX(m1.cwise() + s1, MatrixType::Constant(rows,cols,s1) + m1);
-  VERIFY_IS_APPROX((m1*Scalar(2)).cwise() - s2, (m1+m1) - MatrixType::Constant(rows,cols,s2) );
+  VERIFY_IS_APPROX(m1.cwise() + s1, MatrixType::Constant(rows, cols, s1) + m1);
+  VERIFY_IS_APPROX((m1 * Scalar(2)).cwise() - s2, (m1 + m1) - MatrixType::Constant(rows, cols, s2));
   m3 = m1;
   m3.cwise() += s2;
   VERIFY_IS_APPROX(m3, m1.cwise() + s2);
@@ -35,31 +33,30 @@
   m3.cwise() -= s1;
   VERIFY_IS_APPROX(m3, m1.cwise() - s1);
 
-  VERIFY_IS_EQUAL((m1.corner(TopLeft,1,1)), (m1.block(0,0,1,1)));
-  VERIFY_IS_EQUAL((m1.template corner<1,1>(TopLeft)), (m1.template block<1,1>(0,0)));
-  VERIFY_IS_EQUAL((m1.col(0).start(1)), (m1.col(0).segment(0,1)));
-  VERIFY_IS_EQUAL((m1.col(0).template start<1>()), (m1.col(0).segment(0,1)));
-  VERIFY_IS_EQUAL((m1.col(0).end(1)), (m1.col(0).segment(rows-1,1)));
-  VERIFY_IS_EQUAL((m1.col(0).template end<1>()), (m1.col(0).segment(rows-1,1)));
-  
-  using std::cos;
-  using numext::real;
+  VERIFY_IS_EQUAL((m1.corner(TopLeft, 1, 1)), (m1.block(0, 0, 1, 1)));
+  VERIFY_IS_EQUAL((m1.template corner<1, 1>(TopLeft)), (m1.template block<1, 1>(0, 0)));
+  VERIFY_IS_EQUAL((m1.col(0).start(1)), (m1.col(0).segment(0, 1)));
+  VERIFY_IS_EQUAL((m1.col(0).template start<1>()), (m1.col(0).segment(0, 1)));
+  VERIFY_IS_EQUAL((m1.col(0).end(1)), (m1.col(0).segment(rows - 1, 1)));
+  VERIFY_IS_EQUAL((m1.col(0).template end<1>()), (m1.col(0).segment(rows - 1, 1)));
+
   using numext::abs2;
+  using numext::real;
+  using std::cos;
   VERIFY_IS_EQUAL(ei_cos(s1), cos(s1));
   VERIFY_IS_EQUAL(ei_real(s1), real(s1));
   VERIFY_IS_EQUAL(ei_abs2(s1), abs2(s1));
 
-  m1.minor(0,0);
+  m1.minor(0, 0);
 }
 
-EIGEN_DECLARE_TEST(eigen2support)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( eigen2support(Matrix<double,1,1>()) );
-    CALL_SUBTEST_2( eigen2support(MatrixXd(1,1)) );
-    CALL_SUBTEST_4( eigen2support(Matrix3f()) );
-    CALL_SUBTEST_5( eigen2support(Matrix4d()) );
-    CALL_SUBTEST_2( eigen2support(MatrixXf(200,200)) );
-    CALL_SUBTEST_6( eigen2support(MatrixXcd(100,100)) );
+EIGEN_DECLARE_TEST(eigen2support) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(eigen2support(Matrix<double, 1, 1>()));
+    CALL_SUBTEST_2(eigen2support(MatrixXd(1, 1)));
+    CALL_SUBTEST_4(eigen2support(Matrix3f()));
+    CALL_SUBTEST_5(eigen2support(Matrix4d()));
+    CALL_SUBTEST_2(eigen2support(MatrixXf(200, 200)));
+    CALL_SUBTEST_6(eigen2support(MatrixXcd(100, 100)));
   }
 }
diff --git a/test/eigensolver_complex.cpp b/test/eigensolver_complex.cpp
index c5373f4..67aff4b 100644
--- a/test/eigensolver_complex.cpp
+++ b/test/eigensolver_complex.cpp
@@ -13,35 +13,30 @@
 #include <Eigen/Eigenvalues>
 #include <Eigen/LU>
 
-template<typename MatrixType> bool find_pivot(typename MatrixType::Scalar tol, MatrixType &diffs, Index col=0)
-{
+template <typename MatrixType>
+bool find_pivot(typename MatrixType::Scalar tol, MatrixType& diffs, Index col = 0) {
   bool match = diffs.diagonal().sum() <= tol;
-  if(match || col==diffs.cols())
-  {
+  if (match || col == diffs.cols()) {
     return match;
-  }
-  else
-  {
+  } else {
     Index n = diffs.cols();
-    std::vector<std::pair<Index,Index> > transpositions;
-    for(Index i=col; i<n; ++i)
-    {
+    std::vector<std::pair<Index, Index> > transpositions;
+    for (Index i = col; i < n; ++i) {
       Index best_index(0);
-      if(diffs.col(col).segment(col,n-i).minCoeff(&best_index) > tol)
-        break;
-      
+      if (diffs.col(col).segment(col, n - i).minCoeff(&best_index) > tol) break;
+
       best_index += col;
-      
+
       diffs.row(col).swap(diffs.row(best_index));
-      if(find_pivot(tol,diffs,col+1)) return true;
+      if (find_pivot(tol, diffs, col + 1)) return true;
       diffs.row(col).swap(diffs.row(best_index));
-      
+
       // move current pivot to the end
-      diffs.row(n-(i-col)-1).swap(diffs.row(best_index));
-      transpositions.push_back(std::pair<Index,Index>(n-(i-col)-1,best_index));
+      diffs.row(n - (i - col) - 1).swap(diffs.row(best_index));
+      transpositions.push_back(std::pair<Index, Index>(n - (i - col) - 1, best_index));
     }
     // restore
-    for(Index k=transpositions.size()-1; k>=0; --k)
+    for (Index k = transpositions.size() - 1; k >= 0; --k)
       diffs.row(transpositions[k].first).swap(diffs.row(transpositions[k].second));
   }
   return false;
@@ -51,26 +46,26 @@
  * Initially, this method checked that the k-th power sums are equal for all k = 1, ..., vec1.rows(),
  * however this strategy is numerically inacurate because of numerical cancellation issues.
  */
-template<typename VectorType>
-void verify_is_approx_upto_permutation(const VectorType& vec1, const VectorType& vec2)
-{
+template <typename VectorType>
+void verify_is_approx_upto_permutation(const VectorType& vec1, const VectorType& vec2) {
   typedef typename VectorType::Scalar Scalar;
   typedef typename NumTraits<Scalar>::Real RealScalar;
 
   VERIFY(vec1.cols() == 1);
   VERIFY(vec2.cols() == 1);
   VERIFY(vec1.rows() == vec2.rows());
-  
+
   Index n = vec1.rows();
-  RealScalar tol = test_precision<RealScalar>()*test_precision<RealScalar>()*numext::maxi(vec1.squaredNorm(),vec2.squaredNorm());
-  Matrix<RealScalar,Dynamic,Dynamic> diffs = (vec1.rowwise().replicate(n) - vec2.rowwise().replicate(n).transpose()).cwiseAbs2();
-  
-  VERIFY( find_pivot(tol, diffs) );
+  RealScalar tol = test_precision<RealScalar>() * test_precision<RealScalar>() *
+                   numext::maxi(vec1.squaredNorm(), vec2.squaredNorm());
+  Matrix<RealScalar, Dynamic, Dynamic> diffs =
+      (vec1.rowwise().replicate(n) - vec2.rowwise().replicate(n).transpose()).cwiseAbs2();
+
+  VERIFY(find_pivot(tol, diffs));
 }
 
-
-template<typename MatrixType> void eigensolver(const MatrixType& m)
-{
+template <typename MatrixType>
+void eigensolver(const MatrixType& m) {
   /* this test covers the following files:
      ComplexEigenSolver.h, and indirectly ComplexSchur.h
   */
@@ -80,8 +75,8 @@
   typedef typename MatrixType::Scalar Scalar;
   typedef typename NumTraits<Scalar>::Real RealScalar;
 
-  MatrixType a = MatrixType::Random(rows,cols);
-  MatrixType symmA =  a.adjoint() * a;
+  MatrixType a = MatrixType::Random(rows, cols);
+  MatrixType symmA = a.adjoint() * a;
 
   ComplexEigenSolver<MatrixType> ei0(symmA);
   VERIFY_IS_EQUAL(ei0.info(), Success);
@@ -110,17 +105,16 @@
   VERIFY_IS_APPROX(ei1.eigenvalues(), eiNoEivecs.eigenvalues());
 
   // Regression test for issue #66
-  MatrixType z = MatrixType::Zero(rows,cols);
+  MatrixType z = MatrixType::Zero(rows, cols);
   ComplexEigenSolver<MatrixType> eiz(z);
   VERIFY((eiz.eigenvalues().cwiseEqual(0)).all());
 
   MatrixType id = MatrixType::Identity(rows, cols);
   VERIFY_IS_APPROX(id.operatorNorm(), RealScalar(1));
 
-  if (rows > 1 && rows < 20)
-  {
+  if (rows > 1 && rows < 20) {
     // Test matrix with NaN
-    a(0,0) = std::numeric_limits<typename MatrixType::RealScalar>::quiet_NaN();
+    a(0, 0) = std::numeric_limits<typename MatrixType::RealScalar>::quiet_NaN();
     ComplexEigenSolver<MatrixType> eiNaN(a);
     VERIFY_IS_EQUAL(eiNaN.info(), NoConvergence);
   }
@@ -136,41 +130,40 @@
     a.setZero();
     ComplexEigenSolver<MatrixType> ei3(a);
     VERIFY_IS_EQUAL(ei3.info(), Success);
-    VERIFY_IS_MUCH_SMALLER_THAN(ei3.eigenvalues().norm(),RealScalar(1));
-    VERIFY((ei3.eigenvectors().transpose()*ei3.eigenvectors().transpose()).eval().isIdentity());
+    VERIFY_IS_MUCH_SMALLER_THAN(ei3.eigenvalues().norm(), RealScalar(1));
+    VERIFY((ei3.eigenvectors().transpose() * ei3.eigenvectors().transpose()).eval().isIdentity());
   }
 }
 
-template<typename MatrixType> void eigensolver_verify_assert(const MatrixType& m)
-{
+template <typename MatrixType>
+void eigensolver_verify_assert(const MatrixType& m) {
   ComplexEigenSolver<MatrixType> eig;
   VERIFY_RAISES_ASSERT(eig.eigenvectors());
   VERIFY_RAISES_ASSERT(eig.eigenvalues());
 
-  MatrixType a = MatrixType::Random(m.rows(),m.cols());
+  MatrixType a = MatrixType::Random(m.rows(), m.cols());
   eig.compute(a, false);
   VERIFY_RAISES_ASSERT(eig.eigenvectors());
 }
 
-EIGEN_DECLARE_TEST(eigensolver_complex)
-{
+EIGEN_DECLARE_TEST(eigensolver_complex) {
   int s = 0;
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( eigensolver(Matrix4cf()) );
-    s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE/4);
-    CALL_SUBTEST_2( eigensolver(MatrixXcd(s,s)) );
-    CALL_SUBTEST_3( eigensolver(Matrix<std::complex<float>, 1, 1>()) );
-    CALL_SUBTEST_4( eigensolver(Matrix3f()) );
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(eigensolver(Matrix4cf()));
+    s = internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 4);
+    CALL_SUBTEST_2(eigensolver(MatrixXcd(s, s)));
+    CALL_SUBTEST_3(eigensolver(Matrix<std::complex<float>, 1, 1>()));
+    CALL_SUBTEST_4(eigensolver(Matrix3f()));
     TEST_SET_BUT_UNUSED_VARIABLE(s)
   }
-  CALL_SUBTEST_1( eigensolver_verify_assert(Matrix4cf()) );
-  s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE/4);
-  CALL_SUBTEST_2( eigensolver_verify_assert(MatrixXcd(s,s)) );
-  CALL_SUBTEST_3( eigensolver_verify_assert(Matrix<std::complex<float>, 1, 1>()) );
-  CALL_SUBTEST_4( eigensolver_verify_assert(Matrix3f()) );
+  CALL_SUBTEST_1(eigensolver_verify_assert(Matrix4cf()));
+  s = internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 4);
+  CALL_SUBTEST_2(eigensolver_verify_assert(MatrixXcd(s, s)));
+  CALL_SUBTEST_3(eigensolver_verify_assert(Matrix<std::complex<float>, 1, 1>()));
+  CALL_SUBTEST_4(eigensolver_verify_assert(Matrix3f()));
 
   // Test problem size constructors
   CALL_SUBTEST_5(ComplexEigenSolver<MatrixXf> tmp(s));
-  
+
   TEST_SET_BUT_UNUSED_VARIABLE(s)
 }
diff --git a/test/eigensolver_generalized_real.cpp b/test/eigensolver_generalized_real.cpp
index a0c99b1..eb3f884 100644
--- a/test/eigensolver_generalized_real.cpp
+++ b/test/eigensolver_generalized_real.cpp
@@ -13,8 +13,8 @@
 #include <Eigen/Eigenvalues>
 #include <Eigen/LU>
 
-template<typename MatrixType> void generalized_eigensolver_real(const MatrixType& m)
-{
+template <typename MatrixType>
+void generalized_eigensolver_real(const MatrixType& m) {
   /* this test covers the following files:
      GeneralizedEigenSolver.h
   */
@@ -25,12 +25,12 @@
   typedef std::complex<Scalar> ComplexScalar;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
 
-  MatrixType a = MatrixType::Random(rows,cols);
-  MatrixType b = MatrixType::Random(rows,cols);
-  MatrixType a1 = MatrixType::Random(rows,cols);
-  MatrixType b1 = MatrixType::Random(rows,cols);
-  MatrixType spdA =  a.adjoint() * a + a1.adjoint() * a1;
-  MatrixType spdB =  b.adjoint() * b + b1.adjoint() * b1;
+  MatrixType a = MatrixType::Random(rows, cols);
+  MatrixType b = MatrixType::Random(rows, cols);
+  MatrixType a1 = MatrixType::Random(rows, cols);
+  MatrixType b1 = MatrixType::Random(rows, cols);
+  MatrixType spdA = a.adjoint() * a + a1.adjoint() * a1;
+  MatrixType spdB = b.adjoint() * b + b1.adjoint() * b1;
 
   // lets compare to GeneralizedSelfAdjointEigenSolver
   {
@@ -40,41 +40,41 @@
     VERIFY_IS_EQUAL(eig.eigenvalues().imag().cwiseAbs().maxCoeff(), 0);
 
     VectorType realEigenvalues = eig.eigenvalues().real();
-    std::sort(realEigenvalues.data(), realEigenvalues.data()+realEigenvalues.size());
+    std::sort(realEigenvalues.data(), realEigenvalues.data() + realEigenvalues.size());
     VERIFY_IS_APPROX(realEigenvalues, symmEig.eigenvalues());
 
     // check eigenvectors
     typename GeneralizedEigenSolver<MatrixType>::EigenvectorsType D = eig.eigenvalues().asDiagonal();
     typename GeneralizedEigenSolver<MatrixType>::EigenvectorsType V = eig.eigenvectors();
-    VERIFY_IS_APPROX(spdA*V, spdB*V*D);
+    VERIFY_IS_APPROX(spdA * V, spdB * V * D);
   }
 
   // non symmetric case:
   {
     GeneralizedEigenSolver<MatrixType> eig(rows);
-    // TODO enable full-prealocation of required memory, this probably requires an in-place mode for HessenbergDecomposition
-    //Eigen::internal::set_is_malloc_allowed(false);
-    eig.compute(a,b);
-    //Eigen::internal::set_is_malloc_allowed(true);
-    for(Index k=0; k<cols; ++k)
-    {
-      Matrix<ComplexScalar,Dynamic,Dynamic> tmp = (eig.betas()(k)*a).template cast<ComplexScalar>() - eig.alphas()(k)*b;
-      if(tmp.size()>1 && tmp.norm()>(std::numeric_limits<Scalar>::min)())
-        tmp /= tmp.norm();
-      VERIFY_IS_MUCH_SMALLER_THAN( std::abs(tmp.determinant()), Scalar(1) );
+    // TODO enable full-prealocation of required memory, this probably requires an in-place mode for
+    // HessenbergDecomposition
+    // Eigen::internal::set_is_malloc_allowed(false);
+    eig.compute(a, b);
+    // Eigen::internal::set_is_malloc_allowed(true);
+    for (Index k = 0; k < cols; ++k) {
+      Matrix<ComplexScalar, Dynamic, Dynamic> tmp =
+          (eig.betas()(k) * a).template cast<ComplexScalar>() - eig.alphas()(k) * b;
+      if (tmp.size() > 1 && tmp.norm() > (std::numeric_limits<Scalar>::min)()) tmp /= tmp.norm();
+      VERIFY_IS_MUCH_SMALLER_THAN(std::abs(tmp.determinant()), Scalar(1));
     }
     // check eigenvectors
     typename GeneralizedEigenSolver<MatrixType>::EigenvectorsType D = eig.eigenvalues().asDiagonal();
     typename GeneralizedEigenSolver<MatrixType>::EigenvectorsType V = eig.eigenvectors();
-    VERIFY_IS_APPROX(a*V, b*V*D);
+    VERIFY_IS_APPROX(a * V, b * V * D);
   }
 
   // regression test for bug 1098
   {
-    GeneralizedSelfAdjointEigenSolver<MatrixType> eig1(a.adjoint() * a,b.adjoint() * b);
-    eig1.compute(a.adjoint() * a,b.adjoint() * b);
-    GeneralizedEigenSolver<MatrixType> eig2(a.adjoint() * a,b.adjoint() * b);
-    eig2.compute(a.adjoint() * a,b.adjoint() * b);
+    GeneralizedSelfAdjointEigenSolver<MatrixType> eig1(a.adjoint() * a, b.adjoint() * b);
+    eig1.compute(a.adjoint() * a, b.adjoint() * b);
+    GeneralizedEigenSolver<MatrixType> eig2(a.adjoint() * a, b.adjoint() * b);
+    eig2.compute(a.adjoint() * a, b.adjoint() * b);
   }
 
   // check without eigenvectors
@@ -85,56 +85,55 @@
   }
 }
 
-template<typename MatrixType>
+template <typename MatrixType>
 void generalized_eigensolver_assert() {
-    GeneralizedEigenSolver<MatrixType> eig;
-    // all raise assert if uninitialized
-    VERIFY_RAISES_ASSERT(eig.info());
-    VERIFY_RAISES_ASSERT(eig.eigenvectors());
-    VERIFY_RAISES_ASSERT(eig.eigenvalues());
-    VERIFY_RAISES_ASSERT(eig.alphas());
-    VERIFY_RAISES_ASSERT(eig.betas());
+  GeneralizedEigenSolver<MatrixType> eig;
+  // all raise assert if uninitialized
+  VERIFY_RAISES_ASSERT(eig.info());
+  VERIFY_RAISES_ASSERT(eig.eigenvectors());
+  VERIFY_RAISES_ASSERT(eig.eigenvalues());
+  VERIFY_RAISES_ASSERT(eig.alphas());
+  VERIFY_RAISES_ASSERT(eig.betas());
 
-    // none raise assert after compute called
-    eig.compute(MatrixType::Random(20, 20), MatrixType::Random(20, 20));
-    VERIFY(eig.info() == Success);
-    eig.eigenvectors();
-    eig.eigenvalues();
-    eig.alphas();
-    eig.betas();
+  // none raise assert after compute called
+  eig.compute(MatrixType::Random(20, 20), MatrixType::Random(20, 20));
+  VERIFY(eig.info() == Success);
+  eig.eigenvectors();
+  eig.eigenvalues();
+  eig.alphas();
+  eig.betas();
 
-    // eigenvectors() raises assert, if eigenvectors were not requested
-    eig.compute(MatrixType::Random(20, 20), MatrixType::Random(20, 20), false);
-    VERIFY(eig.info() == Success);
-    VERIFY_RAISES_ASSERT(eig.eigenvectors());
-    eig.eigenvalues();
-    eig.alphas();
-    eig.betas();
+  // eigenvectors() raises assert, if eigenvectors were not requested
+  eig.compute(MatrixType::Random(20, 20), MatrixType::Random(20, 20), false);
+  VERIFY(eig.info() == Success);
+  VERIFY_RAISES_ASSERT(eig.eigenvectors());
+  eig.eigenvalues();
+  eig.alphas();
+  eig.betas();
 
-    // all except info raise assert if realQZ did not converge
-    eig.setMaxIterations(0); // force real QZ to fail.
-    eig.compute(MatrixType::Random(20, 20), MatrixType::Random(20, 20));
-    VERIFY(eig.info() == NoConvergence);
-    VERIFY_RAISES_ASSERT(eig.eigenvectors());
-    VERIFY_RAISES_ASSERT(eig.eigenvalues());
-    VERIFY_RAISES_ASSERT(eig.alphas());
-    VERIFY_RAISES_ASSERT(eig.betas());
+  // all except info raise assert if realQZ did not converge
+  eig.setMaxIterations(0);  // force real QZ to fail.
+  eig.compute(MatrixType::Random(20, 20), MatrixType::Random(20, 20));
+  VERIFY(eig.info() == NoConvergence);
+  VERIFY_RAISES_ASSERT(eig.eigenvectors());
+  VERIFY_RAISES_ASSERT(eig.eigenvalues());
+  VERIFY_RAISES_ASSERT(eig.alphas());
+  VERIFY_RAISES_ASSERT(eig.betas());
 }
 
-EIGEN_DECLARE_TEST(eigensolver_generalized_real)
-{
-  for(int i = 0; i < g_repeat; i++) {
+EIGEN_DECLARE_TEST(eigensolver_generalized_real) {
+  for (int i = 0; i < g_repeat; i++) {
     int s = 0;
-    CALL_SUBTEST_1( generalized_eigensolver_real(Matrix4f()) );
-    s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE/4);
-    CALL_SUBTEST_2( generalized_eigensolver_real(MatrixXd(s,s)) );
+    CALL_SUBTEST_1(generalized_eigensolver_real(Matrix4f()));
+    s = internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 4);
+    CALL_SUBTEST_2(generalized_eigensolver_real(MatrixXd(s, s)));
 
     // some trivial but implementation-wise special cases
-    CALL_SUBTEST_2( generalized_eigensolver_real(MatrixXd(1,1)) );
-    CALL_SUBTEST_2( generalized_eigensolver_real(MatrixXd(2,2)) );
-    CALL_SUBTEST_3( generalized_eigensolver_real(Matrix<double,1,1>()) );
-    CALL_SUBTEST_4( generalized_eigensolver_real(Matrix2d()) );
-    CALL_SUBTEST_5( generalized_eigensolver_assert<MatrixXd>() );
+    CALL_SUBTEST_2(generalized_eigensolver_real(MatrixXd(1, 1)));
+    CALL_SUBTEST_2(generalized_eigensolver_real(MatrixXd(2, 2)));
+    CALL_SUBTEST_3(generalized_eigensolver_real(Matrix<double, 1, 1>()));
+    CALL_SUBTEST_4(generalized_eigensolver_real(Matrix2d()));
+    CALL_SUBTEST_5(generalized_eigensolver_assert<MatrixXd>());
     TEST_SET_BUT_UNUSED_VARIABLE(s)
   }
 }
diff --git a/test/eigensolver_generic.cpp b/test/eigensolver_generic.cpp
index 7adb986..c665df8 100644
--- a/test/eigensolver_generic.cpp
+++ b/test/eigensolver_generic.cpp
@@ -12,9 +12,8 @@
 #include <limits>
 #include <Eigen/Eigenvalues>
 
-template<typename EigType,typename MatType>
-void check_eigensolver_for_given_mat(const EigType &eig, const MatType& a)
-{
+template <typename EigType, typename MatType>
+void check_eigensolver_for_given_mat(const EigType& eig, const MatType& a) {
   typedef typename NumTraits<typename MatType::Scalar>::Real RealScalar;
   typedef Matrix<RealScalar, MatType::RowsAtCompileTime, 1> RealVectorType;
   typedef typename std::complex<RealScalar> Complex;
@@ -27,8 +26,8 @@
   VERIFY_IS_APPROX(a.eigenvalues(), eig.eigenvalues());
 }
 
-template<typename MatrixType> void eigensolver(const MatrixType& m)
-{
+template <typename MatrixType>
+void eigensolver(const MatrixType& m) {
   /* this test covers the following files:
      EigenSolver.h
   */
@@ -39,18 +38,18 @@
   typedef typename NumTraits<Scalar>::Real RealScalar;
   typedef typename std::complex<RealScalar> Complex;
 
-  MatrixType a = MatrixType::Random(rows,cols);
-  MatrixType a1 = MatrixType::Random(rows,cols);
-  MatrixType symmA =  a.adjoint() * a + a1.adjoint() * a1;
+  MatrixType a = MatrixType::Random(rows, cols);
+  MatrixType a1 = MatrixType::Random(rows, cols);
+  MatrixType symmA = a.adjoint() * a + a1.adjoint() * a1;
 
   EigenSolver<MatrixType> ei0(symmA);
   VERIFY_IS_EQUAL(ei0.info(), Success);
   VERIFY_IS_APPROX(symmA * ei0.pseudoEigenvectors(), ei0.pseudoEigenvectors() * ei0.pseudoEigenvalueMatrix());
   VERIFY_IS_APPROX((symmA.template cast<Complex>()) * (ei0.pseudoEigenvectors().template cast<Complex>()),
-    (ei0.pseudoEigenvectors().template cast<Complex>()) * (ei0.eigenvalues().asDiagonal()));
+                   (ei0.pseudoEigenvectors().template cast<Complex>()) * (ei0.eigenvalues().asDiagonal()));
 
   EigenSolver<MatrixType> ei1(a);
-  CALL_SUBTEST( check_eigensolver_for_given_mat(ei1,a) );
+  CALL_SUBTEST(check_eigensolver_for_given_mat(ei1, a));
 
   EigenSolver<MatrixType> ei2;
   ei2.setMaxIterations(RealSchur<MatrixType>::m_maxIterationsPerRow * rows).compute(a);
@@ -71,10 +70,9 @@
   MatrixType id = MatrixType::Identity(rows, cols);
   VERIFY_IS_APPROX(id.operatorNorm(), RealScalar(1));
 
-  if (rows > 2 && rows < 20)
-  {
+  if (rows > 2 && rows < 20) {
     // Test matrix with NaN
-    a(0,0) = std::numeric_limits<typename MatrixType::RealScalar>::quiet_NaN();
+    a(0, 0) = std::numeric_limits<typename MatrixType::RealScalar>::quiet_NaN();
     EigenSolver<MatrixType> eiNaN(a);
     VERIFY_IS_NOT_EQUAL(eiNaN.info(), Success);
   }
@@ -90,158 +88,146 @@
     a.setZero();
     EigenSolver<MatrixType> ei3(a);
     VERIFY_IS_EQUAL(ei3.info(), Success);
-    VERIFY_IS_MUCH_SMALLER_THAN(ei3.eigenvalues().norm(),RealScalar(1));
-    VERIFY((ei3.eigenvectors().transpose()*ei3.eigenvectors().transpose()).eval().isIdentity());
+    VERIFY_IS_MUCH_SMALLER_THAN(ei3.eigenvalues().norm(), RealScalar(1));
+    VERIFY((ei3.eigenvectors().transpose() * ei3.eigenvectors().transpose()).eval().isIdentity());
   }
 }
 
-template<typename MatrixType> void eigensolver_verify_assert(const MatrixType& m)
-{
+template <typename MatrixType>
+void eigensolver_verify_assert(const MatrixType& m) {
   EigenSolver<MatrixType> eig;
   VERIFY_RAISES_ASSERT(eig.eigenvectors());
   VERIFY_RAISES_ASSERT(eig.pseudoEigenvectors());
   VERIFY_RAISES_ASSERT(eig.pseudoEigenvalueMatrix());
   VERIFY_RAISES_ASSERT(eig.eigenvalues());
 
-  MatrixType a = MatrixType::Random(m.rows(),m.cols());
+  MatrixType a = MatrixType::Random(m.rows(), m.cols());
   eig.compute(a, false);
   VERIFY_RAISES_ASSERT(eig.eigenvectors());
   VERIFY_RAISES_ASSERT(eig.pseudoEigenvectors());
 }
 
-
-template<typename CoeffType>
-Matrix<typename CoeffType::Scalar,Dynamic,Dynamic>
-make_companion(const CoeffType& coeffs)
-{
-  Index n = coeffs.size()-1;
-  Matrix<typename CoeffType::Scalar,Dynamic,Dynamic> res(n,n);
+template <typename CoeffType>
+Matrix<typename CoeffType::Scalar, Dynamic, Dynamic> make_companion(const CoeffType& coeffs) {
+  Index n = coeffs.size() - 1;
+  Matrix<typename CoeffType::Scalar, Dynamic, Dynamic> res(n, n);
   res.setZero();
-	res.row(0) = -coeffs.tail(n) / coeffs(0);
-	res.diagonal(-1).setOnes();
+  res.row(0) = -coeffs.tail(n) / coeffs(0);
+  res.diagonal(-1).setOnes();
   return res;
 }
 
-template<int>
-void eigensolver_generic_extra()
-{
+template <int>
+void eigensolver_generic_extra() {
   {
     // regression test for bug 793
-    MatrixXd a(3,3);
-    a << 0,  0,  1,
-        1,  1, 1,
-        1, 1e+200,  1;
+    MatrixXd a(3, 3);
+    a << 0, 0, 1, 1, 1, 1, 1, 1e+200, 1;
     Eigen::EigenSolver<MatrixXd> eig(a);
-    double scale = 1e-200; // scale to avoid overflow during the comparisons
-    VERIFY_IS_APPROX(a * eig.pseudoEigenvectors()*scale, eig.pseudoEigenvectors() * eig.pseudoEigenvalueMatrix()*scale);
-    VERIFY_IS_APPROX(a * eig.eigenvectors()*scale, eig.eigenvectors() * eig.eigenvalues().asDiagonal()*scale);
+    double scale = 1e-200;  // scale to avoid overflow during the comparisons
+    VERIFY_IS_APPROX(a * eig.pseudoEigenvectors() * scale,
+                     eig.pseudoEigenvectors() * eig.pseudoEigenvalueMatrix() * scale);
+    VERIFY_IS_APPROX(a * eig.eigenvectors() * scale, eig.eigenvectors() * eig.eigenvalues().asDiagonal() * scale);
   }
   {
     // check a case where all eigenvalues are null.
-    MatrixXd a(2,2);
-    a << 1,  1,
-        -1, -1;
+    MatrixXd a(2, 2);
+    a << 1, 1, -1, -1;
     Eigen::EigenSolver<MatrixXd> eig(a);
     VERIFY_IS_APPROX(eig.pseudoEigenvectors().squaredNorm(), 2.);
-    VERIFY_IS_APPROX((a * eig.pseudoEigenvectors()).norm()+1., 1.);
-    VERIFY_IS_APPROX((eig.pseudoEigenvectors() * eig.pseudoEigenvalueMatrix()).norm()+1., 1.);
-    VERIFY_IS_APPROX((a * eig.eigenvectors()).norm()+1., 1.);
-    VERIFY_IS_APPROX((eig.eigenvectors() * eig.eigenvalues().asDiagonal()).norm()+1., 1.);
+    VERIFY_IS_APPROX((a * eig.pseudoEigenvectors()).norm() + 1., 1.);
+    VERIFY_IS_APPROX((eig.pseudoEigenvectors() * eig.pseudoEigenvalueMatrix()).norm() + 1., 1.);
+    VERIFY_IS_APPROX((a * eig.eigenvectors()).norm() + 1., 1.);
+    VERIFY_IS_APPROX((eig.eigenvectors() * eig.eigenvalues().asDiagonal()).norm() + 1., 1.);
   }
 
   // regression test for bug 933
   {
     {
-      VectorXd coeffs(5); coeffs << 1, -3, -175, -225, 2250;
+      VectorXd coeffs(5);
+      coeffs << 1, -3, -175, -225, 2250;
       MatrixXd C = make_companion(coeffs);
       EigenSolver<MatrixXd> eig(C);
-      CALL_SUBTEST( check_eigensolver_for_given_mat(eig,C) );
+      CALL_SUBTEST(check_eigensolver_for_given_mat(eig, C));
     }
     {
       // this test is tricky because it requires high accuracy in smallest eigenvalues
-      VectorXd coeffs(5); coeffs << 6.154671e-15, -1.003870e-10, -9.819570e-01, 3.995715e+03, 2.211511e+08;
+      VectorXd coeffs(5);
+      coeffs << 6.154671e-15, -1.003870e-10, -9.819570e-01, 3.995715e+03, 2.211511e+08;
       MatrixXd C = make_companion(coeffs);
       EigenSolver<MatrixXd> eig(C);
-      CALL_SUBTEST( check_eigensolver_for_given_mat(eig,C) );
+      CALL_SUBTEST(check_eigensolver_for_given_mat(eig, C));
       Index n = C.rows();
-      for(Index i=0;i<n;++i)
-      {
+      for (Index i = 0; i < n; ++i) {
         typedef std::complex<double> Complex;
         MatrixXcd ac = C.cast<Complex>();
         ac.diagonal().array() -= eig.eigenvalues()(i);
         VectorXd sv = ac.jacobiSvd().singularValues();
         // comparing to sv(0) is not enough here to catch the "bug",
         // the hard-coded 1.0 is important!
-        VERIFY_IS_MUCH_SMALLER_THAN(sv(n-1), 1.0);
+        VERIFY_IS_MUCH_SMALLER_THAN(sv(n - 1), 1.0);
       }
     }
   }
   // regression test for bug 1557
   {
     // this test is interesting because it contains zeros on the diagonal.
-    MatrixXd A_bug1557(3,3);
+    MatrixXd A_bug1557(3, 3);
     A_bug1557 << 0, 0, 0, 1, 0, 0.5887907064808635127, 0, 1, 0;
     EigenSolver<MatrixXd> eig(A_bug1557);
-    CALL_SUBTEST( check_eigensolver_for_given_mat(eig,A_bug1557) );
+    CALL_SUBTEST(check_eigensolver_for_given_mat(eig, A_bug1557));
   }
 
   // regression test for bug 1174
   {
     Index n = 12;
-    MatrixXf A_bug1174(n,n);
-    A_bug1174 <<  262144, 0, 0, 262144, 786432, 0, 0, 0, 0, 0, 0, 786432,
-                  262144, 0, 0, 262144, 786432, 0, 0, 0, 0, 0, 0, 786432,
-                  262144, 0, 0, 262144, 786432, 0, 0, 0, 0, 0, 0, 786432,
-                  262144, 0, 0, 262144, 786432, 0, 0, 0, 0, 0, 0, 786432,
-                  0, 262144, 262144, 0, 0, 262144, 262144, 262144, 262144, 262144, 262144, 0,
-                  0, 262144, 262144, 0, 0, 262144, 262144, 262144, 262144, 262144, 262144, 0,
-                  0, 262144, 262144, 0, 0, 262144, 262144, 262144, 262144, 262144, 262144, 0,
-                  0, 262144, 262144, 0, 0, 262144, 262144, 262144, 262144, 262144, 262144, 0,
-                  0, 262144, 262144, 0, 0, 262144, 262144, 262144, 262144, 262144, 262144, 0,
-                  0, 262144, 262144, 0, 0, 262144, 262144, 262144, 262144, 262144, 262144, 0,
-                  0, 262144, 262144, 0, 0, 262144, 262144, 262144, 262144, 262144, 262144, 0,
-                  0, 262144, 262144, 0, 0, 262144, 262144, 262144, 262144, 262144, 262144, 0;
+    MatrixXf A_bug1174(n, n);
+    A_bug1174 << 262144, 0, 0, 262144, 786432, 0, 0, 0, 0, 0, 0, 786432, 262144, 0, 0, 262144, 786432, 0, 0, 0, 0, 0, 0,
+        786432, 262144, 0, 0, 262144, 786432, 0, 0, 0, 0, 0, 0, 786432, 262144, 0, 0, 262144, 786432, 0, 0, 0, 0, 0, 0,
+        786432, 0, 262144, 262144, 0, 0, 262144, 262144, 262144, 262144, 262144, 262144, 0, 0, 262144, 262144, 0, 0,
+        262144, 262144, 262144, 262144, 262144, 262144, 0, 0, 262144, 262144, 0, 0, 262144, 262144, 262144, 262144,
+        262144, 262144, 0, 0, 262144, 262144, 0, 0, 262144, 262144, 262144, 262144, 262144, 262144, 0, 0, 262144,
+        262144, 0, 0, 262144, 262144, 262144, 262144, 262144, 262144, 0, 0, 262144, 262144, 0, 0, 262144, 262144,
+        262144, 262144, 262144, 262144, 0, 0, 262144, 262144, 0, 0, 262144, 262144, 262144, 262144, 262144, 262144, 0,
+        0, 262144, 262144, 0, 0, 262144, 262144, 262144, 262144, 262144, 262144, 0;
     EigenSolver<MatrixXf> eig(A_bug1174);
-    CALL_SUBTEST( check_eigensolver_for_given_mat(eig,A_bug1174) );
+    CALL_SUBTEST(check_eigensolver_for_given_mat(eig, A_bug1174));
   }
 }
 
-EIGEN_DECLARE_TEST(eigensolver_generic)
-{
+EIGEN_DECLARE_TEST(eigensolver_generic) {
   int s = 0;
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( eigensolver(Matrix4f()) );
-    s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE/4);
-    CALL_SUBTEST_2( eigensolver(MatrixXd(s,s)) );
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(eigensolver(Matrix4f()));
+    s = internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 4);
+    CALL_SUBTEST_2(eigensolver(MatrixXd(s, s)));
     TEST_SET_BUT_UNUSED_VARIABLE(s)
 
     // some trivial but implementation-wise tricky cases
-    CALL_SUBTEST_2( eigensolver(MatrixXd(1,1)) );
-    CALL_SUBTEST_2( eigensolver(MatrixXd(2,2)) );
-    CALL_SUBTEST_3( eigensolver(Matrix<double,1,1>()) );
-    CALL_SUBTEST_4( eigensolver(Matrix2d()) );
+    CALL_SUBTEST_2(eigensolver(MatrixXd(1, 1)));
+    CALL_SUBTEST_2(eigensolver(MatrixXd(2, 2)));
+    CALL_SUBTEST_3(eigensolver(Matrix<double, 1, 1>()));
+    CALL_SUBTEST_4(eigensolver(Matrix2d()));
   }
 
-  CALL_SUBTEST_1( eigensolver_verify_assert(Matrix4f()) );
-  s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE/4);
-  CALL_SUBTEST_2( eigensolver_verify_assert(MatrixXd(s,s)) );
-  CALL_SUBTEST_3( eigensolver_verify_assert(Matrix<double,1,1>()) );
-  CALL_SUBTEST_4( eigensolver_verify_assert(Matrix2d()) );
+  CALL_SUBTEST_1(eigensolver_verify_assert(Matrix4f()));
+  s = internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 4);
+  CALL_SUBTEST_2(eigensolver_verify_assert(MatrixXd(s, s)));
+  CALL_SUBTEST_3(eigensolver_verify_assert(Matrix<double, 1, 1>()));
+  CALL_SUBTEST_4(eigensolver_verify_assert(Matrix2d()));
 
   // Test problem size constructors
   CALL_SUBTEST_5(EigenSolver<MatrixXf> tmp(s));
 
   // regression test for bug 410
-  CALL_SUBTEST_2(
-  {
-     MatrixXd A(1,1);
-     A(0,0) = std::sqrt(-1.); // is Not-a-Number
-     Eigen::EigenSolver<MatrixXd> solver(A);
-     VERIFY_IS_EQUAL(solver.info(), NumericalIssue);
-  }
-  );
-  
-  CALL_SUBTEST_2( eigensolver_generic_extra<0>() );
-  
+  CALL_SUBTEST_2({
+    MatrixXd A(1, 1);
+    A(0, 0) = std::sqrt(-1.);  // is Not-a-Number
+    Eigen::EigenSolver<MatrixXd> solver(A);
+    VERIFY_IS_EQUAL(solver.info(), NumericalIssue);
+  });
+
+  CALL_SUBTEST_2(eigensolver_generic_extra<0>());
+
   TEST_SET_BUT_UNUSED_VARIABLE(s)
 }
diff --git a/test/eigensolver_selfadjoint.cpp b/test/eigensolver_selfadjoint.cpp
index 0fb2f4d..fc0c8d8 100644
--- a/test/eigensolver_selfadjoint.cpp
+++ b/test/eigensolver_selfadjoint.cpp
@@ -14,60 +14,54 @@
 #include <Eigen/Eigenvalues>
 #include <Eigen/SparseCore>
 
-
-template<typename MatrixType> void selfadjointeigensolver_essential_check(const MatrixType& m)
-{
+template <typename MatrixType>
+void selfadjointeigensolver_essential_check(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
   typedef typename NumTraits<Scalar>::Real RealScalar;
-  RealScalar eival_eps = numext::mini<RealScalar>(test_precision<RealScalar>(),  NumTraits<Scalar>::dummy_precision()*20000);
-  
+  RealScalar eival_eps =
+      numext::mini<RealScalar>(test_precision<RealScalar>(), NumTraits<Scalar>::dummy_precision() * 20000);
+
   SelfAdjointEigenSolver<MatrixType> eiSymm(m);
   VERIFY_IS_EQUAL(eiSymm.info(), Success);
 
   RealScalar scaling = m.cwiseAbs().maxCoeff();
 
-  if(scaling<(std::numeric_limits<RealScalar>::min)())
-  {
+  if (scaling < (std::numeric_limits<RealScalar>::min)()) {
     VERIFY(eiSymm.eigenvalues().cwiseAbs().maxCoeff() <= (std::numeric_limits<RealScalar>::min)());
-  }
-  else
-  {
-    VERIFY_IS_APPROX((m.template selfadjointView<Lower>() * eiSymm.eigenvectors())/scaling,
-                     (eiSymm.eigenvectors() * eiSymm.eigenvalues().asDiagonal())/scaling);
+  } else {
+    VERIFY_IS_APPROX((m.template selfadjointView<Lower>() * eiSymm.eigenvectors()) / scaling,
+                     (eiSymm.eigenvectors() * eiSymm.eigenvalues().asDiagonal()) / scaling);
   }
   VERIFY_IS_APPROX(m.template selfadjointView<Lower>().eigenvalues(), eiSymm.eigenvalues());
   VERIFY_IS_UNITARY(eiSymm.eigenvectors());
 
-  if(m.cols()<=4)
-  {
+  if (m.cols() <= 4) {
     SelfAdjointEigenSolver<MatrixType> eiDirect;
-    eiDirect.computeDirect(m);  
+    eiDirect.computeDirect(m);
     VERIFY_IS_EQUAL(eiDirect.info(), Success);
-    if(! eiSymm.eigenvalues().isApprox(eiDirect.eigenvalues(), eival_eps) )
-    {
+    if (!eiSymm.eigenvalues().isApprox(eiDirect.eigenvalues(), eival_eps)) {
       std::cerr << "reference eigenvalues: " << eiSymm.eigenvalues().transpose() << "\n"
                 << "obtained eigenvalues:  " << eiDirect.eigenvalues().transpose() << "\n"
-                << "diff:                  " << (eiSymm.eigenvalues()-eiDirect.eigenvalues()).transpose() << "\n"
-                << "error (eps):           " << (eiSymm.eigenvalues()-eiDirect.eigenvalues()).norm() / eiSymm.eigenvalues().norm() << "  (" << eival_eps << ")\n";
+                << "diff:                  " << (eiSymm.eigenvalues() - eiDirect.eigenvalues()).transpose() << "\n"
+                << "error (eps):           "
+                << (eiSymm.eigenvalues() - eiDirect.eigenvalues()).norm() / eiSymm.eigenvalues().norm() << "  ("
+                << eival_eps << ")\n";
     }
-    if(scaling<(std::numeric_limits<RealScalar>::min)())
-    {
+    if (scaling < (std::numeric_limits<RealScalar>::min)()) {
       VERIFY(eiDirect.eigenvalues().cwiseAbs().maxCoeff() <= (std::numeric_limits<RealScalar>::min)());
-    }
-    else
-    {
-      VERIFY_IS_APPROX(eiSymm.eigenvalues()/scaling, eiDirect.eigenvalues()/scaling);
-      VERIFY_IS_APPROX((m.template selfadjointView<Lower>() * eiDirect.eigenvectors())/scaling,
-                       (eiDirect.eigenvectors() * eiDirect.eigenvalues().asDiagonal())/scaling);
-      VERIFY_IS_APPROX(m.template selfadjointView<Lower>().eigenvalues()/scaling, eiDirect.eigenvalues()/scaling);
+    } else {
+      VERIFY_IS_APPROX(eiSymm.eigenvalues() / scaling, eiDirect.eigenvalues() / scaling);
+      VERIFY_IS_APPROX((m.template selfadjointView<Lower>() * eiDirect.eigenvectors()) / scaling,
+                       (eiDirect.eigenvectors() * eiDirect.eigenvalues().asDiagonal()) / scaling);
+      VERIFY_IS_APPROX(m.template selfadjointView<Lower>().eigenvalues() / scaling, eiDirect.eigenvalues() / scaling);
     }
 
     VERIFY_IS_UNITARY(eiDirect.eigenvectors());
   }
 }
 
-template<typename MatrixType> void selfadjointeigensolver(const MatrixType& m)
-{
+template <typename MatrixType>
+void selfadjointeigensolver(const MatrixType& m) {
   /* this test covers the following files:
      EigenSolver.h, SelfAdjointEigenSolver.h (and indirectly: Tridiagonalization.h)
   */
@@ -77,24 +71,24 @@
   typedef typename MatrixType::Scalar Scalar;
   typedef typename NumTraits<Scalar>::Real RealScalar;
 
-  RealScalar largerEps = 10*test_precision<RealScalar>();
+  RealScalar largerEps = 10 * test_precision<RealScalar>();
 
-  MatrixType a = MatrixType::Random(rows,cols);
-  MatrixType a1 = MatrixType::Random(rows,cols);
-  MatrixType symmA =  a.adjoint() * a + a1.adjoint() * a1;
+  MatrixType a = MatrixType::Random(rows, cols);
+  MatrixType a1 = MatrixType::Random(rows, cols);
+  MatrixType symmA = a.adjoint() * a + a1.adjoint() * a1;
   MatrixType symmC = symmA;
-  
-  svd_fill_random(symmA,Symmetric);
+
+  svd_fill_random(symmA, Symmetric);
 
   symmA.template triangularView<StrictlyUpper>().setZero();
   symmC.template triangularView<StrictlyUpper>().setZero();
 
-  MatrixType b = MatrixType::Random(rows,cols);
-  MatrixType b1 = MatrixType::Random(rows,cols);
+  MatrixType b = MatrixType::Random(rows, cols);
+  MatrixType b1 = MatrixType::Random(rows, cols);
   MatrixType symmB = b.adjoint() * b + b1.adjoint() * b1;
   symmB.template triangularView<StrictlyUpper>().setZero();
-  
-  CALL_SUBTEST( selfadjointeigensolver_essential_check(symmA) );
+
+  CALL_SUBTEST(selfadjointeigensolver_essential_check(symmA));
 
   SelfAdjointEigenSolver<MatrixType> eiSymm(symmA);
   // generalized eigen pb
@@ -103,30 +97,33 @@
   SelfAdjointEigenSolver<MatrixType> eiSymmNoEivecs(symmA, false);
   VERIFY_IS_EQUAL(eiSymmNoEivecs.info(), Success);
   VERIFY_IS_APPROX(eiSymm.eigenvalues(), eiSymmNoEivecs.eigenvalues());
-  
+
   // generalized eigen problem Ax = lBx
-  eiSymmGen.compute(symmC, symmB,Ax_lBx);
+  eiSymmGen.compute(symmC, symmB, Ax_lBx);
   VERIFY_IS_EQUAL(eiSymmGen.info(), Success);
-  VERIFY((symmC.template selfadjointView<Lower>() * eiSymmGen.eigenvectors()).isApprox(
-          symmB.template selfadjointView<Lower>() * (eiSymmGen.eigenvectors() * eiSymmGen.eigenvalues().asDiagonal()), largerEps));
+  VERIFY((symmC.template selfadjointView<Lower>() * eiSymmGen.eigenvectors())
+             .isApprox(symmB.template selfadjointView<Lower>() *
+                           (eiSymmGen.eigenvectors() * eiSymmGen.eigenvalues().asDiagonal()),
+                       largerEps));
 
   // generalized eigen problem BAx = lx
-  eiSymmGen.compute(symmC, symmB,BAx_lx);
+  eiSymmGen.compute(symmC, symmB, BAx_lx);
   VERIFY_IS_EQUAL(eiSymmGen.info(), Success);
-  VERIFY((symmB.template selfadjointView<Lower>() * (symmC.template selfadjointView<Lower>() * eiSymmGen.eigenvectors())).isApprox(
-         (eiSymmGen.eigenvectors() * eiSymmGen.eigenvalues().asDiagonal()), largerEps));
+  VERIFY(
+      (symmB.template selfadjointView<Lower>() * (symmC.template selfadjointView<Lower>() * eiSymmGen.eigenvectors()))
+          .isApprox((eiSymmGen.eigenvectors() * eiSymmGen.eigenvalues().asDiagonal()), largerEps));
 
   // generalized eigen problem ABx = lx
-  eiSymmGen.compute(symmC, symmB,ABx_lx);
+  eiSymmGen.compute(symmC, symmB, ABx_lx);
   VERIFY_IS_EQUAL(eiSymmGen.info(), Success);
-  VERIFY((symmC.template selfadjointView<Lower>() * (symmB.template selfadjointView<Lower>() * eiSymmGen.eigenvectors())).isApprox(
-         (eiSymmGen.eigenvectors() * eiSymmGen.eigenvalues().asDiagonal()), largerEps));
-
+  VERIFY(
+      (symmC.template selfadjointView<Lower>() * (symmB.template selfadjointView<Lower>() * eiSymmGen.eigenvectors()))
+          .isApprox((eiSymmGen.eigenvectors() * eiSymmGen.eigenvalues().asDiagonal()), largerEps));
 
   eiSymm.compute(symmC);
   MatrixType sqrtSymmA = eiSymm.operatorSqrt();
-  VERIFY_IS_APPROX(MatrixType(symmC.template selfadjointView<Lower>()), sqrtSymmA*sqrtSymmA);
-  VERIFY_IS_APPROX(sqrtSymmA, symmC.template selfadjointView<Lower>()*eiSymm.operatorInverseSqrt());
+  VERIFY_IS_APPROX(MatrixType(symmC.template selfadjointView<Lower>()), sqrtSymmA * sqrtSymmA);
+  VERIFY_IS_APPROX(sqrtSymmA, symmC.template selfadjointView<Lower>() * eiSymm.operatorInverseSqrt());
 
   MatrixType id = MatrixType::Identity(rows, cols);
   VERIFY_IS_APPROX(id.template selfadjointView<Lower>().operatorNorm(), RealScalar(1));
@@ -147,29 +144,31 @@
   Tridiagonalization<MatrixType> tridiag(symmC);
   VERIFY_IS_APPROX(tridiag.diagonal(), tridiag.matrixT().diagonal());
   VERIFY_IS_APPROX(tridiag.subDiagonal(), tridiag.matrixT().template diagonal<-1>());
-  Matrix<RealScalar,Dynamic,Dynamic> T = tridiag.matrixT();
-  if(rows>1 && cols>1) {
+  Matrix<RealScalar, Dynamic, Dynamic> T = tridiag.matrixT();
+  if (rows > 1 && cols > 1) {
     // FIXME check that upper and lower part are 0:
-    //VERIFY(T.topRightCorner(rows-2, cols-2).template triangularView<Upper>().isZero());
+    // VERIFY(T.topRightCorner(rows-2, cols-2).template triangularView<Upper>().isZero());
   }
   VERIFY_IS_APPROX(tridiag.diagonal(), T.diagonal());
   VERIFY_IS_APPROX(tridiag.subDiagonal(), T.template diagonal<1>());
-  VERIFY_IS_APPROX(MatrixType(symmC.template selfadjointView<Lower>()), tridiag.matrixQ() * tridiag.matrixT().eval() * MatrixType(tridiag.matrixQ()).adjoint());
-  VERIFY_IS_APPROX(MatrixType(symmC.template selfadjointView<Lower>()), tridiag.matrixQ() * tridiag.matrixT() * tridiag.matrixQ().adjoint());
-  
+  VERIFY_IS_APPROX(MatrixType(symmC.template selfadjointView<Lower>()),
+                   tridiag.matrixQ() * tridiag.matrixT().eval() * MatrixType(tridiag.matrixQ()).adjoint());
+  VERIFY_IS_APPROX(MatrixType(symmC.template selfadjointView<Lower>()),
+                   tridiag.matrixQ() * tridiag.matrixT() * tridiag.matrixQ().adjoint());
+
   // Test computation of eigenvalues from tridiagonal matrix
-  if(rows > 1)
-  {
+  if (rows > 1) {
     SelfAdjointEigenSolver<MatrixType> eiSymmTridiag;
-    eiSymmTridiag.computeFromTridiagonal(tridiag.matrixT().diagonal(), tridiag.matrixT().diagonal(-1), ComputeEigenvectors);
+    eiSymmTridiag.computeFromTridiagonal(tridiag.matrixT().diagonal(), tridiag.matrixT().diagonal(-1),
+                                         ComputeEigenvectors);
     VERIFY_IS_APPROX(eiSymm.eigenvalues(), eiSymmTridiag.eigenvalues());
-    VERIFY_IS_APPROX(tridiag.matrixT(), eiSymmTridiag.eigenvectors().real() * eiSymmTridiag.eigenvalues().asDiagonal() * eiSymmTridiag.eigenvectors().real().transpose());
+    VERIFY_IS_APPROX(tridiag.matrixT(), eiSymmTridiag.eigenvectors().real() * eiSymmTridiag.eigenvalues().asDiagonal() *
+                                            eiSymmTridiag.eigenvectors().real().transpose());
   }
 
-  if (rows > 1 && rows < 20)
-  {
+  if (rows > 1 && rows < 20) {
     // Test matrix with NaN
-    symmC(0,0) = std::numeric_limits<typename MatrixType::RealScalar>::quiet_NaN();
+    symmC(0, 0) = std::numeric_limits<typename MatrixType::RealScalar>::quiet_NaN();
     SelfAdjointEigenSolver<MatrixType> eiSymmNaN(symmC);
     VERIFY_IS_EQUAL(eiSymmNaN.info(), NoConvergence);
   }
@@ -185,97 +184,86 @@
     a.setZero();
     SelfAdjointEigenSolver<MatrixType> ei3(a);
     VERIFY_IS_EQUAL(ei3.info(), Success);
-    VERIFY_IS_MUCH_SMALLER_THAN(ei3.eigenvalues().norm(),RealScalar(1));
-    VERIFY((ei3.eigenvectors().transpose()*ei3.eigenvectors().transpose()).eval().isIdentity());
+    VERIFY_IS_MUCH_SMALLER_THAN(ei3.eigenvalues().norm(), RealScalar(1));
+    VERIFY((ei3.eigenvectors().transpose() * ei3.eigenvectors().transpose()).eval().isIdentity());
   }
 }
 
-template<int>
-void bug_854()
-{
+template <int>
+void bug_854() {
   Matrix3d m;
-  m << 850.961, 51.966, 0,
-       51.966, 254.841, 0,
-            0,       0, 0;
+  m << 850.961, 51.966, 0, 51.966, 254.841, 0, 0, 0, 0;
   selfadjointeigensolver_essential_check(m);
 }
 
-template<int>
-void bug_1014()
-{
+template <int>
+void bug_1014() {
   Matrix3d m;
-  m <<        0.11111111111111114658, 0, 0,
-       0,     0.11111111111111109107, 0,
-       0, 0,  0.11111111111111107719;
+  m << 0.11111111111111114658, 0, 0, 0, 0.11111111111111109107, 0, 0, 0, 0.11111111111111107719;
   selfadjointeigensolver_essential_check(m);
 }
 
-template<int>
-void bug_1225()
-{
+template <int>
+void bug_1225() {
   Matrix3d m1, m2;
   m1.setRandom();
-  m1 = m1*m1.transpose();
+  m1 = m1 * m1.transpose();
   m2 = m1.triangularView<Upper>();
   SelfAdjointEigenSolver<Matrix3d> eig1(m1);
   SelfAdjointEigenSolver<Matrix3d> eig2(m2.selfadjointView<Upper>());
   VERIFY_IS_APPROX(eig1.eigenvalues(), eig2.eigenvalues());
 }
 
-template<int>
-void bug_1204()
-{
-  SparseMatrix<double> A(2,2);
+template <int>
+void bug_1204() {
+  SparseMatrix<double> A(2, 2);
   A.setIdentity();
   SelfAdjointEigenSolver<Eigen::SparseMatrix<double> > eig(A);
 }
 
-EIGEN_DECLARE_TEST(eigensolver_selfadjoint)
-{
+EIGEN_DECLARE_TEST(eigensolver_selfadjoint) {
   int s = 0;
-  for(int i = 0; i < g_repeat; i++) {
-
+  for (int i = 0; i < g_repeat; i++) {
     // trivial test for 1x1 matrices:
-    CALL_SUBTEST_1( selfadjointeigensolver(Matrix<float, 1, 1>()));
-    CALL_SUBTEST_1( selfadjointeigensolver(Matrix<double, 1, 1>()));
-    CALL_SUBTEST_1( selfadjointeigensolver(Matrix<std::complex<double>, 1, 1>()));
+    CALL_SUBTEST_1(selfadjointeigensolver(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_1(selfadjointeigensolver(Matrix<double, 1, 1>()));
+    CALL_SUBTEST_1(selfadjointeigensolver(Matrix<std::complex<double>, 1, 1>()));
 
     // very important to test 3x3 and 2x2 matrices since we provide special paths for them
-    CALL_SUBTEST_12( selfadjointeigensolver(Matrix2f()) );
-    CALL_SUBTEST_12( selfadjointeigensolver(Matrix2d()) );
-    CALL_SUBTEST_12( selfadjointeigensolver(Matrix2cd()) );
-    CALL_SUBTEST_13( selfadjointeigensolver(Matrix3f()) );
-    CALL_SUBTEST_13( selfadjointeigensolver(Matrix3d()) );
-    CALL_SUBTEST_13( selfadjointeigensolver(Matrix3cd()) );
-    CALL_SUBTEST_2( selfadjointeigensolver(Matrix4d()) );
-    CALL_SUBTEST_2( selfadjointeigensolver(Matrix4cd()) );
-    
-    s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE/4);
-    CALL_SUBTEST_3( selfadjointeigensolver(MatrixXf(s,s)) );
-    CALL_SUBTEST_4( selfadjointeigensolver(MatrixXd(s,s)) );
-    CALL_SUBTEST_5( selfadjointeigensolver(MatrixXcd(s,s)) );
-    CALL_SUBTEST_9( selfadjointeigensolver(Matrix<std::complex<double>,Dynamic,Dynamic,RowMajor>(s,s)) );
+    CALL_SUBTEST_12(selfadjointeigensolver(Matrix2f()));
+    CALL_SUBTEST_12(selfadjointeigensolver(Matrix2d()));
+    CALL_SUBTEST_12(selfadjointeigensolver(Matrix2cd()));
+    CALL_SUBTEST_13(selfadjointeigensolver(Matrix3f()));
+    CALL_SUBTEST_13(selfadjointeigensolver(Matrix3d()));
+    CALL_SUBTEST_13(selfadjointeigensolver(Matrix3cd()));
+    CALL_SUBTEST_2(selfadjointeigensolver(Matrix4d()));
+    CALL_SUBTEST_2(selfadjointeigensolver(Matrix4cd()));
+
+    s = internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 4);
+    CALL_SUBTEST_3(selfadjointeigensolver(MatrixXf(s, s)));
+    CALL_SUBTEST_4(selfadjointeigensolver(MatrixXd(s, s)));
+    CALL_SUBTEST_5(selfadjointeigensolver(MatrixXcd(s, s)));
+    CALL_SUBTEST_9(selfadjointeigensolver(Matrix<std::complex<double>, Dynamic, Dynamic, RowMajor>(s, s)));
     TEST_SET_BUT_UNUSED_VARIABLE(s)
 
     // some trivial but implementation-wise tricky cases
-    CALL_SUBTEST_4( selfadjointeigensolver(MatrixXd(1,1)) );
-    CALL_SUBTEST_4( selfadjointeigensolver(MatrixXd(2,2)) );
-    CALL_SUBTEST_5( selfadjointeigensolver(MatrixXcd(1,1)) );
-    CALL_SUBTEST_5( selfadjointeigensolver(MatrixXcd(2,2)) );
-    CALL_SUBTEST_6( selfadjointeigensolver(Matrix<double,1,1>()) );
-    CALL_SUBTEST_7( selfadjointeigensolver(Matrix<double,2,2>()) );
+    CALL_SUBTEST_4(selfadjointeigensolver(MatrixXd(1, 1)));
+    CALL_SUBTEST_4(selfadjointeigensolver(MatrixXd(2, 2)));
+    CALL_SUBTEST_5(selfadjointeigensolver(MatrixXcd(1, 1)));
+    CALL_SUBTEST_5(selfadjointeigensolver(MatrixXcd(2, 2)));
+    CALL_SUBTEST_6(selfadjointeigensolver(Matrix<double, 1, 1>()));
+    CALL_SUBTEST_7(selfadjointeigensolver(Matrix<double, 2, 2>()));
   }
-  
-  CALL_SUBTEST_13( bug_854<0>() );
-  CALL_SUBTEST_13( bug_1014<0>() );
-  CALL_SUBTEST_13( bug_1204<0>() );
-  CALL_SUBTEST_13( bug_1225<0>() );
+
+  CALL_SUBTEST_13(bug_854<0>());
+  CALL_SUBTEST_13(bug_1014<0>());
+  CALL_SUBTEST_13(bug_1204<0>());
+  CALL_SUBTEST_13(bug_1225<0>());
 
   // Test problem size constructors
-  s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE/4);
+  s = internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 4);
   CALL_SUBTEST_8(SelfAdjointEigenSolver<MatrixXf> tmp1(s));
   CALL_SUBTEST_8(Tridiagonalization<MatrixXf> tmp2(s));
-  
+
   TEST_SET_BUT_UNUSED_VARIABLE(s)
 }
-
diff --git a/test/evaluators.cpp b/test/evaluators.cpp
index 0f9b6f8..d96a0a1 100644
--- a/test/evaluators.cpp
+++ b/test/evaluators.cpp
@@ -3,112 +3,105 @@
 
 namespace Eigen {
 
-  template<typename Lhs,typename Rhs>
-  const Product<Lhs,Rhs>
-  prod(const Lhs& lhs, const Rhs& rhs)
-  {
-    return Product<Lhs,Rhs>(lhs,rhs);
-  }
-
-  template<typename Lhs,typename Rhs>
-  const Product<Lhs,Rhs,LazyProduct>
-  lazyprod(const Lhs& lhs, const Rhs& rhs)
-  {
-    return Product<Lhs,Rhs,LazyProduct>(lhs,rhs);
-  }
-  
-  template<typename DstXprType, typename SrcXprType>
-  EIGEN_STRONG_INLINE
-  DstXprType& copy_using_evaluator(const EigenBase<DstXprType> &dst, const SrcXprType &src)
-  {
-    call_assignment(dst.const_cast_derived(), src.derived(), internal::assign_op<typename DstXprType::Scalar,typename SrcXprType::Scalar>());
-    return dst.const_cast_derived();
-  }
-  
-  template<typename DstXprType, template <typename> class StorageBase, typename SrcXprType>
-  EIGEN_STRONG_INLINE
-  const DstXprType& copy_using_evaluator(const NoAlias<DstXprType, StorageBase>& dst, const SrcXprType &src)
-  {
-    call_assignment(dst, src.derived(), internal::assign_op<typename DstXprType::Scalar,typename SrcXprType::Scalar>());
-    return dst.expression();
-  }
-  
-  template<typename DstXprType, typename SrcXprType>
-  EIGEN_STRONG_INLINE
-  DstXprType& copy_using_evaluator(const PlainObjectBase<DstXprType> &dst, const SrcXprType &src)
-  {
-    #ifdef EIGEN_NO_AUTOMATIC_RESIZING
-    eigen_assert((dst.size()==0 || (IsVectorAtCompileTime ? (dst.size() == src.size())
-                                                          : (dst.rows() == src.rows() && dst.cols() == src.cols())))
-                && "Size mismatch. Automatic resizing is disabled because EIGEN_NO_AUTOMATIC_RESIZING is defined");
-  #else
-    dst.const_cast_derived().resizeLike(src.derived());
-  #endif
-    
-    call_assignment(dst.const_cast_derived(), src.derived(), internal::assign_op<typename DstXprType::Scalar,typename SrcXprType::Scalar>());
-    return dst.const_cast_derived();
-  }
-
-  template<typename DstXprType, typename SrcXprType>
-  void add_assign_using_evaluator(const DstXprType& dst, const SrcXprType& src)
-  {
-    typedef typename DstXprType::Scalar Scalar;
-    call_assignment(const_cast<DstXprType&>(dst), src.derived(), internal::add_assign_op<Scalar,typename SrcXprType::Scalar>());
-  }
-
-  template<typename DstXprType, typename SrcXprType>
-  void subtract_assign_using_evaluator(const DstXprType& dst, const SrcXprType& src)
-  {
-    typedef typename DstXprType::Scalar Scalar;
-    call_assignment(const_cast<DstXprType&>(dst), src.derived(), internal::sub_assign_op<Scalar,typename SrcXprType::Scalar>());
-  }
-
-  template<typename DstXprType, typename SrcXprType>
-  void multiply_assign_using_evaluator(const DstXprType& dst, const SrcXprType& src)
-  {
-    typedef typename DstXprType::Scalar Scalar;
-    call_assignment(dst.const_cast_derived(), src.derived(), internal::mul_assign_op<Scalar,typename SrcXprType::Scalar>());
-  }
-
-  template<typename DstXprType, typename SrcXprType>
-  void divide_assign_using_evaluator(const DstXprType& dst, const SrcXprType& src)
-  {
-    typedef typename DstXprType::Scalar Scalar;
-    call_assignment(dst.const_cast_derived(), src.derived(), internal::div_assign_op<Scalar,typename SrcXprType::Scalar>());
-  }
-  
-  template<typename DstXprType, typename SrcXprType>
-  void swap_using_evaluator(const DstXprType& dst, const SrcXprType& src)
-  {
-    typedef typename DstXprType::Scalar Scalar;
-    call_assignment(dst.const_cast_derived(), src.const_cast_derived(), internal::swap_assign_op<Scalar>());
-  }
-
-  namespace internal {
-    template<typename Dst, template <typename> class StorageBase, typename Src, typename Func>
-    EIGEN_DEVICE_FUNC void call_assignment(const NoAlias<Dst,StorageBase>& dst, const Src& src, const Func& func)
-    {
-      call_assignment_no_alias(dst.expression(), src, func);
-    }
-
-    template<typename Dst, template <typename> class StorageBase, typename Src, typename Func>
-    EIGEN_DEVICE_FUNC void call_restricted_packet_assignment(const NoAlias<Dst,StorageBase>& dst, const Src& src, const Func& func)
-    {
-      call_restricted_packet_assignment_no_alias(dst.expression(), src, func);
-    }
-  }
-  
+template <typename Lhs, typename Rhs>
+const Product<Lhs, Rhs> prod(const Lhs& lhs, const Rhs& rhs) {
+  return Product<Lhs, Rhs>(lhs, rhs);
 }
 
-template<typename XprType> long get_cost(const XprType& ) { return Eigen::internal::evaluator<XprType>::CoeffReadCost; }
+template <typename Lhs, typename Rhs>
+const Product<Lhs, Rhs, LazyProduct> lazyprod(const Lhs& lhs, const Rhs& rhs) {
+  return Product<Lhs, Rhs, LazyProduct>(lhs, rhs);
+}
+
+template <typename DstXprType, typename SrcXprType>
+EIGEN_STRONG_INLINE DstXprType& copy_using_evaluator(const EigenBase<DstXprType>& dst, const SrcXprType& src) {
+  call_assignment(dst.const_cast_derived(), src.derived(),
+                  internal::assign_op<typename DstXprType::Scalar, typename SrcXprType::Scalar>());
+  return dst.const_cast_derived();
+}
+
+template <typename DstXprType, template <typename> class StorageBase, typename SrcXprType>
+EIGEN_STRONG_INLINE const DstXprType& copy_using_evaluator(const NoAlias<DstXprType, StorageBase>& dst,
+                                                           const SrcXprType& src) {
+  call_assignment(dst, src.derived(), internal::assign_op<typename DstXprType::Scalar, typename SrcXprType::Scalar>());
+  return dst.expression();
+}
+
+template <typename DstXprType, typename SrcXprType>
+EIGEN_STRONG_INLINE DstXprType& copy_using_evaluator(const PlainObjectBase<DstXprType>& dst, const SrcXprType& src) {
+#ifdef EIGEN_NO_AUTOMATIC_RESIZING
+  eigen_assert((dst.size() == 0 || (IsVectorAtCompileTime ? (dst.size() == src.size())
+                                                          : (dst.rows() == src.rows() && dst.cols() == src.cols()))) &&
+               "Size mismatch. Automatic resizing is disabled because EIGEN_NO_AUTOMATIC_RESIZING is defined");
+#else
+  dst.const_cast_derived().resizeLike(src.derived());
+#endif
+
+  call_assignment(dst.const_cast_derived(), src.derived(),
+                  internal::assign_op<typename DstXprType::Scalar, typename SrcXprType::Scalar>());
+  return dst.const_cast_derived();
+}
+
+template <typename DstXprType, typename SrcXprType>
+void add_assign_using_evaluator(const DstXprType& dst, const SrcXprType& src) {
+  typedef typename DstXprType::Scalar Scalar;
+  call_assignment(const_cast<DstXprType&>(dst), src.derived(),
+                  internal::add_assign_op<Scalar, typename SrcXprType::Scalar>());
+}
+
+template <typename DstXprType, typename SrcXprType>
+void subtract_assign_using_evaluator(const DstXprType& dst, const SrcXprType& src) {
+  typedef typename DstXprType::Scalar Scalar;
+  call_assignment(const_cast<DstXprType&>(dst), src.derived(),
+                  internal::sub_assign_op<Scalar, typename SrcXprType::Scalar>());
+}
+
+template <typename DstXprType, typename SrcXprType>
+void multiply_assign_using_evaluator(const DstXprType& dst, const SrcXprType& src) {
+  typedef typename DstXprType::Scalar Scalar;
+  call_assignment(dst.const_cast_derived(), src.derived(),
+                  internal::mul_assign_op<Scalar, typename SrcXprType::Scalar>());
+}
+
+template <typename DstXprType, typename SrcXprType>
+void divide_assign_using_evaluator(const DstXprType& dst, const SrcXprType& src) {
+  typedef typename DstXprType::Scalar Scalar;
+  call_assignment(dst.const_cast_derived(), src.derived(),
+                  internal::div_assign_op<Scalar, typename SrcXprType::Scalar>());
+}
+
+template <typename DstXprType, typename SrcXprType>
+void swap_using_evaluator(const DstXprType& dst, const SrcXprType& src) {
+  typedef typename DstXprType::Scalar Scalar;
+  call_assignment(dst.const_cast_derived(), src.const_cast_derived(), internal::swap_assign_op<Scalar>());
+}
+
+namespace internal {
+template <typename Dst, template <typename> class StorageBase, typename Src, typename Func>
+EIGEN_DEVICE_FUNC void call_assignment(const NoAlias<Dst, StorageBase>& dst, const Src& src, const Func& func) {
+  call_assignment_no_alias(dst.expression(), src, func);
+}
+
+template <typename Dst, template <typename> class StorageBase, typename Src, typename Func>
+EIGEN_DEVICE_FUNC void call_restricted_packet_assignment(const NoAlias<Dst, StorageBase>& dst, const Src& src,
+                                                         const Func& func) {
+  call_restricted_packet_assignment_no_alias(dst.expression(), src, func);
+}
+}  // namespace internal
+
+}  // namespace Eigen
+
+template <typename XprType>
+long get_cost(const XprType&) {
+  return Eigen::internal::evaluator<XprType>::CoeffReadCost;
+}
 
 using namespace std;
 
-#define VERIFY_IS_APPROX_EVALUATOR(DEST,EXPR) VERIFY_IS_APPROX(copy_using_evaluator(DEST,(EXPR)), (EXPR).eval());
-#define VERIFY_IS_APPROX_EVALUATOR2(DEST,EXPR,REF) VERIFY_IS_APPROX(copy_using_evaluator(DEST,(EXPR)), (REF).eval());
+#define VERIFY_IS_APPROX_EVALUATOR(DEST, EXPR) VERIFY_IS_APPROX(copy_using_evaluator(DEST, (EXPR)), (EXPR).eval());
+#define VERIFY_IS_APPROX_EVALUATOR2(DEST, EXPR, REF) VERIFY_IS_APPROX(copy_using_evaluator(DEST, (EXPR)), (REF).eval());
 
-EIGEN_DECLARE_TEST(evaluators)
-{
+EIGEN_DECLARE_TEST(evaluators) {
   // Testing Matrix evaluator and Transpose
   Vector2d v = Vector2d::Random();
   const Vector2d v_const(v);
@@ -119,20 +112,20 @@
   VERIFY_IS_APPROX_EVALUATOR(v2, v_const);
 
   // Testing Transpose
-  VERIFY_IS_APPROX_EVALUATOR(w, v.transpose()); // Transpose as rvalue
+  VERIFY_IS_APPROX_EVALUATOR(w, v.transpose());  // Transpose as rvalue
   VERIFY_IS_APPROX_EVALUATOR(w, v_const.transpose());
 
-  copy_using_evaluator(w.transpose(), v); // Transpose as lvalue
-  VERIFY_IS_APPROX(w,v.transpose().eval());
+  copy_using_evaluator(w.transpose(), v);  // Transpose as lvalue
+  VERIFY_IS_APPROX(w, v.transpose().eval());
 
   copy_using_evaluator(w.transpose(), v_const);
-  VERIFY_IS_APPROX(w,v_const.transpose().eval());
+  VERIFY_IS_APPROX(w, v_const.transpose().eval());
 
   // Testing Array evaluator
   {
-    ArrayXXf a(2,3);
-    ArrayXXf b(3,2);
-    a << 1,2,3, 4,5,6;
+    ArrayXXf a(2, 3);
+    ArrayXXf b(3, 2);
+    a << 1, 2, 3, 4, 5, 6;
     const ArrayXXf a_const(a);
 
     VERIFY_IS_APPROX_EVALUATOR(b, a.transpose());
@@ -141,99 +134,108 @@
 
     // Testing CwiseNullaryOp evaluator
     copy_using_evaluator(w, RowVector2d::Random());
-    VERIFY((w.array() >= -1).all() && (w.array() <= 1).all()); // not easy to test ...
+    VERIFY((w.array() >= -1).all() && (w.array() <= 1).all());  // not easy to test ...
 
     VERIFY_IS_APPROX_EVALUATOR(w, RowVector2d::Zero());
 
     VERIFY_IS_APPROX_EVALUATOR(w, RowVector2d::Constant(3));
-    
+
     // mix CwiseNullaryOp and transpose
     VERIFY_IS_APPROX_EVALUATOR(w, Vector2d::Zero().transpose());
   }
 
   {
     // test product expressions
-    int s = internal::random<int>(1,100);
-    MatrixXf a(s,s), b(s,s), c(s,s), d(s,s);
+    int s = internal::random<int>(1, 100);
+    MatrixXf a(s, s), b(s, s), c(s, s), d(s, s);
     a.setRandom();
     b.setRandom();
     c.setRandom();
     d.setRandom();
     VERIFY_IS_APPROX_EVALUATOR(d, (a + b));
     VERIFY_IS_APPROX_EVALUATOR(d, (a + b).transpose());
-    VERIFY_IS_APPROX_EVALUATOR2(d, prod(a,b), a*b);
-    VERIFY_IS_APPROX_EVALUATOR2(d.noalias(), prod(a,b), a*b);
-    VERIFY_IS_APPROX_EVALUATOR2(d, prod(a,b) + c, a*b + c);
-    VERIFY_IS_APPROX_EVALUATOR2(d, s * prod(a,b), s * a*b);
-    VERIFY_IS_APPROX_EVALUATOR2(d, prod(a,b).transpose(), (a*b).transpose());
-    VERIFY_IS_APPROX_EVALUATOR2(d, prod(a,b) + prod(b,c), a*b + b*c);
+    VERIFY_IS_APPROX_EVALUATOR2(d, prod(a, b), a * b);
+    VERIFY_IS_APPROX_EVALUATOR2(d.noalias(), prod(a, b), a * b);
+    VERIFY_IS_APPROX_EVALUATOR2(d, prod(a, b) + c, a * b + c);
+    VERIFY_IS_APPROX_EVALUATOR2(d, s * prod(a, b), s * a * b);
+    VERIFY_IS_APPROX_EVALUATOR2(d, prod(a, b).transpose(), (a * b).transpose());
+    VERIFY_IS_APPROX_EVALUATOR2(d, prod(a, b) + prod(b, c), a * b + b * c);
 
     // check that prod works even with aliasing present
-    c = a*a;
-    copy_using_evaluator(a, prod(a,a));
-    VERIFY_IS_APPROX(a,c);
+    c = a * a;
+    copy_using_evaluator(a, prod(a, a));
+    VERIFY_IS_APPROX(a, c);
 
     // check compound assignment of products
     d = c;
-    add_assign_using_evaluator(c.noalias(), prod(a,b));
-    d.noalias() += a*b;
+    add_assign_using_evaluator(c.noalias(), prod(a, b));
+    d.noalias() += a * b;
     VERIFY_IS_APPROX(c, d);
 
     d = c;
-    subtract_assign_using_evaluator(c.noalias(), prod(a,b));
-    d.noalias() -= a*b;
+    subtract_assign_using_evaluator(c.noalias(), prod(a, b));
+    d.noalias() -= a * b;
     VERIFY_IS_APPROX(c, d);
   }
 
   {
     // test product with all possible sizes
-    int s = internal::random<int>(1,100);
-    Matrix<float,      1,      1> m11, res11;  m11.setRandom(1,1);
-    Matrix<float,      1,      4> m14, res14;  m14.setRandom(1,4);
-    Matrix<float,      1,Dynamic> m1X, res1X;  m1X.setRandom(1,s);
-    Matrix<float,      4,      1> m41, res41;  m41.setRandom(4,1);
-    Matrix<float,      4,      4> m44, res44;  m44.setRandom(4,4);
-    Matrix<float,      4,Dynamic> m4X, res4X;  m4X.setRandom(4,s);
-    Matrix<float,Dynamic,      1> mX1, resX1;  mX1.setRandom(s,1);
-    Matrix<float,Dynamic,      4> mX4, resX4;  mX4.setRandom(s,4);
-    Matrix<float,Dynamic,Dynamic> mXX, resXX;  mXX.setRandom(s,s);
+    int s = internal::random<int>(1, 100);
+    Matrix<float, 1, 1> m11, res11;
+    m11.setRandom(1, 1);
+    Matrix<float, 1, 4> m14, res14;
+    m14.setRandom(1, 4);
+    Matrix<float, 1, Dynamic> m1X, res1X;
+    m1X.setRandom(1, s);
+    Matrix<float, 4, 1> m41, res41;
+    m41.setRandom(4, 1);
+    Matrix<float, 4, 4> m44, res44;
+    m44.setRandom(4, 4);
+    Matrix<float, 4, Dynamic> m4X, res4X;
+    m4X.setRandom(4, s);
+    Matrix<float, Dynamic, 1> mX1, resX1;
+    mX1.setRandom(s, 1);
+    Matrix<float, Dynamic, 4> mX4, resX4;
+    mX4.setRandom(s, 4);
+    Matrix<float, Dynamic, Dynamic> mXX, resXX;
+    mXX.setRandom(s, s);
 
-    VERIFY_IS_APPROX_EVALUATOR2(res11, prod(m11,m11), m11*m11);
-    VERIFY_IS_APPROX_EVALUATOR2(res11, prod(m14,m41), m14*m41);
-    VERIFY_IS_APPROX_EVALUATOR2(res11, prod(m1X,mX1), m1X*mX1);
-    VERIFY_IS_APPROX_EVALUATOR2(res14, prod(m11,m14), m11*m14);
-    VERIFY_IS_APPROX_EVALUATOR2(res14, prod(m14,m44), m14*m44);
-    VERIFY_IS_APPROX_EVALUATOR2(res14, prod(m1X,mX4), m1X*mX4);
-    VERIFY_IS_APPROX_EVALUATOR2(res1X, prod(m11,m1X), m11*m1X);
-    VERIFY_IS_APPROX_EVALUATOR2(res1X, prod(m14,m4X), m14*m4X);
-    VERIFY_IS_APPROX_EVALUATOR2(res1X, prod(m1X,mXX), m1X*mXX);
-    VERIFY_IS_APPROX_EVALUATOR2(res41, prod(m41,m11), m41*m11);
-    VERIFY_IS_APPROX_EVALUATOR2(res41, prod(m44,m41), m44*m41);
-    VERIFY_IS_APPROX_EVALUATOR2(res41, prod(m4X,mX1), m4X*mX1);
-    VERIFY_IS_APPROX_EVALUATOR2(res44, prod(m41,m14), m41*m14);
-    VERIFY_IS_APPROX_EVALUATOR2(res44, prod(m44,m44), m44*m44);
-    VERIFY_IS_APPROX_EVALUATOR2(res44, prod(m4X,mX4), m4X*mX4);
-    VERIFY_IS_APPROX_EVALUATOR2(res4X, prod(m41,m1X), m41*m1X);
-    VERIFY_IS_APPROX_EVALUATOR2(res4X, prod(m44,m4X), m44*m4X);
-    VERIFY_IS_APPROX_EVALUATOR2(res4X, prod(m4X,mXX), m4X*mXX);
-    VERIFY_IS_APPROX_EVALUATOR2(resX1, prod(mX1,m11), mX1*m11);
-    VERIFY_IS_APPROX_EVALUATOR2(resX1, prod(mX4,m41), mX4*m41);
-    VERIFY_IS_APPROX_EVALUATOR2(resX1, prod(mXX,mX1), mXX*mX1);
-    VERIFY_IS_APPROX_EVALUATOR2(resX4, prod(mX1,m14), mX1*m14);
-    VERIFY_IS_APPROX_EVALUATOR2(resX4, prod(mX4,m44), mX4*m44);
-    VERIFY_IS_APPROX_EVALUATOR2(resX4, prod(mXX,mX4), mXX*mX4);
-    VERIFY_IS_APPROX_EVALUATOR2(resXX, prod(mX1,m1X), mX1*m1X);
-    VERIFY_IS_APPROX_EVALUATOR2(resXX, prod(mX4,m4X), mX4*m4X);
-    VERIFY_IS_APPROX_EVALUATOR2(resXX, prod(mXX,mXX), mXX*mXX);
+    VERIFY_IS_APPROX_EVALUATOR2(res11, prod(m11, m11), m11 * m11);
+    VERIFY_IS_APPROX_EVALUATOR2(res11, prod(m14, m41), m14 * m41);
+    VERIFY_IS_APPROX_EVALUATOR2(res11, prod(m1X, mX1), m1X * mX1);
+    VERIFY_IS_APPROX_EVALUATOR2(res14, prod(m11, m14), m11 * m14);
+    VERIFY_IS_APPROX_EVALUATOR2(res14, prod(m14, m44), m14 * m44);
+    VERIFY_IS_APPROX_EVALUATOR2(res14, prod(m1X, mX4), m1X * mX4);
+    VERIFY_IS_APPROX_EVALUATOR2(res1X, prod(m11, m1X), m11 * m1X);
+    VERIFY_IS_APPROX_EVALUATOR2(res1X, prod(m14, m4X), m14 * m4X);
+    VERIFY_IS_APPROX_EVALUATOR2(res1X, prod(m1X, mXX), m1X * mXX);
+    VERIFY_IS_APPROX_EVALUATOR2(res41, prod(m41, m11), m41 * m11);
+    VERIFY_IS_APPROX_EVALUATOR2(res41, prod(m44, m41), m44 * m41);
+    VERIFY_IS_APPROX_EVALUATOR2(res41, prod(m4X, mX1), m4X * mX1);
+    VERIFY_IS_APPROX_EVALUATOR2(res44, prod(m41, m14), m41 * m14);
+    VERIFY_IS_APPROX_EVALUATOR2(res44, prod(m44, m44), m44 * m44);
+    VERIFY_IS_APPROX_EVALUATOR2(res44, prod(m4X, mX4), m4X * mX4);
+    VERIFY_IS_APPROX_EVALUATOR2(res4X, prod(m41, m1X), m41 * m1X);
+    VERIFY_IS_APPROX_EVALUATOR2(res4X, prod(m44, m4X), m44 * m4X);
+    VERIFY_IS_APPROX_EVALUATOR2(res4X, prod(m4X, mXX), m4X * mXX);
+    VERIFY_IS_APPROX_EVALUATOR2(resX1, prod(mX1, m11), mX1 * m11);
+    VERIFY_IS_APPROX_EVALUATOR2(resX1, prod(mX4, m41), mX4 * m41);
+    VERIFY_IS_APPROX_EVALUATOR2(resX1, prod(mXX, mX1), mXX * mX1);
+    VERIFY_IS_APPROX_EVALUATOR2(resX4, prod(mX1, m14), mX1 * m14);
+    VERIFY_IS_APPROX_EVALUATOR2(resX4, prod(mX4, m44), mX4 * m44);
+    VERIFY_IS_APPROX_EVALUATOR2(resX4, prod(mXX, mX4), mXX * mX4);
+    VERIFY_IS_APPROX_EVALUATOR2(resXX, prod(mX1, m1X), mX1 * m1X);
+    VERIFY_IS_APPROX_EVALUATOR2(resXX, prod(mX4, m4X), mX4 * m4X);
+    VERIFY_IS_APPROX_EVALUATOR2(resXX, prod(mXX, mXX), mXX * mXX);
   }
 
   {
-    ArrayXXf a(2,3);
-    ArrayXXf b(3,2);
-    a << 1,2,3, 4,5,6;
+    ArrayXXf a(2, 3);
+    ArrayXXf b(3, 2);
+    a << 1, 2, 3, 4, 5, 6;
     const ArrayXXf a_const(a);
-    
-    // this does not work because Random is eval-before-nested: 
+
+    // this does not work because Random is eval-before-nested:
     // copy_using_evaluator(w, Vector2d::Random().transpose());
 
     // test CwiseUnaryOp
@@ -247,20 +249,20 @@
     VERIFY_IS_APPROX_EVALUATOR(w, (v + Vector2d::Ones()).transpose().cwiseProduct(RowVector2d::Constant(3)));
 
     // dynamic matrices and arrays
-    MatrixXd mat1(6,6), mat2(6,6);
-    VERIFY_IS_APPROX_EVALUATOR(mat1, MatrixXd::Identity(6,6));
+    MatrixXd mat1(6, 6), mat2(6, 6);
+    VERIFY_IS_APPROX_EVALUATOR(mat1, MatrixXd::Identity(6, 6));
     VERIFY_IS_APPROX_EVALUATOR(mat2, mat1);
     copy_using_evaluator(mat2.transpose(), mat1);
     VERIFY_IS_APPROX(mat2.transpose(), mat1);
 
-    ArrayXXd arr1(6,6), arr2(6,6);
-    VERIFY_IS_APPROX_EVALUATOR(arr1, ArrayXXd::Constant(6,6, 3.0));
+    ArrayXXd arr1(6, 6), arr2(6, 6);
+    VERIFY_IS_APPROX_EVALUATOR(arr1, ArrayXXd::Constant(6, 6, 3.0));
     VERIFY_IS_APPROX_EVALUATOR(arr2, arr1);
-    
+
     // test automatic resizing
-    mat2.resize(3,3);
+    mat2.resize(3, 3);
     VERIFY_IS_APPROX_EVALUATOR(mat2, mat1);
-    arr2.resize(9,9);
+    arr2.resize(9, 9);
     VERIFY_IS_APPROX_EVALUATOR(arr2, arr1);
 
     // test direct traversal
@@ -268,40 +270,40 @@
     Array33f a3;
     VERIFY_IS_APPROX_EVALUATOR(m3, Matrix3f::Identity());  // matrix, nullary
     // TODO: find a way to test direct traversal with array
-    VERIFY_IS_APPROX_EVALUATOR(m3.transpose(), Matrix3f::Identity().transpose());  // transpose
-    VERIFY_IS_APPROX_EVALUATOR(m3, 2 * Matrix3f::Identity());  // unary
-    VERIFY_IS_APPROX_EVALUATOR(m3, Matrix3f::Identity() + Matrix3f::Zero());  // binary
-    VERIFY_IS_APPROX_EVALUATOR(m3.block(0,0,2,2), Matrix3f::Identity().block(1,1,2,2));  // block
+    VERIFY_IS_APPROX_EVALUATOR(m3.transpose(), Matrix3f::Identity().transpose());              // transpose
+    VERIFY_IS_APPROX_EVALUATOR(m3, 2 * Matrix3f::Identity());                                  // unary
+    VERIFY_IS_APPROX_EVALUATOR(m3, Matrix3f::Identity() + Matrix3f::Zero());                   // binary
+    VERIFY_IS_APPROX_EVALUATOR(m3.block(0, 0, 2, 2), Matrix3f::Identity().block(1, 1, 2, 2));  // block
 
     // test linear traversal
-    VERIFY_IS_APPROX_EVALUATOR(m3, Matrix3f::Zero());  // matrix, nullary
-    VERIFY_IS_APPROX_EVALUATOR(a3, Array33f::Zero());  // array
+    VERIFY_IS_APPROX_EVALUATOR(m3, Matrix3f::Zero());                          // matrix, nullary
+    VERIFY_IS_APPROX_EVALUATOR(a3, Array33f::Zero());                          // array
     VERIFY_IS_APPROX_EVALUATOR(m3.transpose(), Matrix3f::Zero().transpose());  // transpose
-    VERIFY_IS_APPROX_EVALUATOR(m3, 2 * Matrix3f::Zero());  // unary
-    VERIFY_IS_APPROX_EVALUATOR(m3, Matrix3f::Zero() + m3);  // binary  
+    VERIFY_IS_APPROX_EVALUATOR(m3, 2 * Matrix3f::Zero());                      // unary
+    VERIFY_IS_APPROX_EVALUATOR(m3, Matrix3f::Zero() + m3);                     // binary
 
     // test inner vectorization
     Matrix4f m4, m4src = Matrix4f::Random();
     Array44f a4, a4src = Matrix4f::Random();
-    VERIFY_IS_APPROX_EVALUATOR(m4, m4src);  // matrix
-    VERIFY_IS_APPROX_EVALUATOR(a4, a4src);  // array
+    VERIFY_IS_APPROX_EVALUATOR(m4, m4src);                          // matrix
+    VERIFY_IS_APPROX_EVALUATOR(a4, a4src);                          // array
     VERIFY_IS_APPROX_EVALUATOR(m4.transpose(), m4src.transpose());  // transpose
     // TODO: find out why Matrix4f::Zero() does not allow inner vectorization
-    VERIFY_IS_APPROX_EVALUATOR(m4, 2 * m4src);  // unary
+    VERIFY_IS_APPROX_EVALUATOR(m4, 2 * m4src);      // unary
     VERIFY_IS_APPROX_EVALUATOR(m4, m4src + m4src);  // binary
 
     // test linear vectorization
-    MatrixXf mX(6,6), mXsrc = MatrixXf::Random(6,6);
-    ArrayXXf aX(6,6), aXsrc = ArrayXXf::Random(6,6);
-    VERIFY_IS_APPROX_EVALUATOR(mX, mXsrc);  // matrix
-    VERIFY_IS_APPROX_EVALUATOR(aX, aXsrc);  // array
+    MatrixXf mX(6, 6), mXsrc = MatrixXf::Random(6, 6);
+    ArrayXXf aX(6, 6), aXsrc = ArrayXXf::Random(6, 6);
+    VERIFY_IS_APPROX_EVALUATOR(mX, mXsrc);                          // matrix
+    VERIFY_IS_APPROX_EVALUATOR(aX, aXsrc);                          // array
     VERIFY_IS_APPROX_EVALUATOR(mX.transpose(), mXsrc.transpose());  // transpose
-    VERIFY_IS_APPROX_EVALUATOR(mX, MatrixXf::Zero(6,6));  // nullary
-    VERIFY_IS_APPROX_EVALUATOR(mX, 2 * mXsrc);  // unary
-    VERIFY_IS_APPROX_EVALUATOR(mX, mXsrc + mXsrc);  // binary
+    VERIFY_IS_APPROX_EVALUATOR(mX, MatrixXf::Zero(6, 6));           // nullary
+    VERIFY_IS_APPROX_EVALUATOR(mX, 2 * mXsrc);                      // unary
+    VERIFY_IS_APPROX_EVALUATOR(mX, mXsrc + mXsrc);                  // binary
 
     // test blocks and slice vectorization
-    VERIFY_IS_APPROX_EVALUATOR(m4, (mXsrc.block<4,4>(1,0)));
+    VERIFY_IS_APPROX_EVALUATOR(m4, (mXsrc.block<4, 4>(1, 0)));
     VERIFY_IS_APPROX_EVALUATOR(aX, ArrayXXf::Constant(10, 10, 3.0).block(2, 3, 6, 6));
 
     Matrix4f m4ref = m4;
@@ -309,21 +311,21 @@
     m4ref.block(1, 1, 2, 3) = m3.bottomRows(2);
     VERIFY_IS_APPROX(m4, m4ref);
 
-    mX.setIdentity(20,20);
-    MatrixXf mXref = MatrixXf::Identity(20,20);
-    mXsrc = MatrixXf::Random(9,12);
+    mX.setIdentity(20, 20);
+    MatrixXf mXref = MatrixXf::Identity(20, 20);
+    mXsrc = MatrixXf::Random(9, 12);
     copy_using_evaluator(mX.block(4, 4, 9, 12), mXsrc);
     mXref.block(4, 4, 9, 12) = mXsrc;
     VERIFY_IS_APPROX(mX, mXref);
 
     // test Map
-    const float raw[3] = {1,2,3};
-    float buffer[3] = {0,0,0};
+    const float raw[3] = {1, 2, 3};
+    float buffer[3] = {0, 0, 0};
     Vector3f v3;
     Array3f a3f;
     VERIFY_IS_APPROX_EVALUATOR(v3, Map<const Vector3f>(raw));
     VERIFY_IS_APPROX_EVALUATOR(a3f, Map<const Array3f>(raw));
-    Vector3f::Map(buffer) = 2*v3;
+    Vector3f::Map(buffer) = 2 * v3;
     VERIFY(buffer[0] == 2);
     VERIFY(buffer[1] == 4);
     VERIFY(buffer[2] == 6);
@@ -331,7 +333,7 @@
     // test CwiseUnaryView
     mat1.setRandom();
     mat2.setIdentity();
-    MatrixXcd matXcd(6,6), matXcd_ref(6,6);
+    MatrixXcd matXcd(6, 6), matXcd_ref(6, 6);
     copy_using_evaluator(matXcd.real(), mat1);
     copy_using_evaluator(matXcd.imag(), mat2);
     matXcd_ref.real() = mat1;
@@ -347,8 +349,8 @@
     mX.resize(6, 6);
     VERIFY_IS_APPROX_EVALUATOR(mX, mXsrc.colwise() + vX);
     matXcd.resize(12, 12);
-    VERIFY_IS_APPROX_EVALUATOR(matXcd, matXcd_ref.replicate(2,2));
-    VERIFY_IS_APPROX_EVALUATOR(matXcd, (matXcd_ref.replicate<2,2>()));
+    VERIFY_IS_APPROX_EVALUATOR(matXcd, matXcd_ref.replicate(2, 2));
+    VERIFY_IS_APPROX_EVALUATOR(matXcd, (matXcd_ref.replicate<2, 2>()));
 
     // test partial reductions
     VectorXd vec1(6);
@@ -356,16 +358,16 @@
     VERIFY_IS_APPROX_EVALUATOR(vec1, mat1.colwise().sum().transpose());
 
     // test MatrixWrapper and ArrayWrapper
-    mat1.setRandom(6,6);
-    arr1.setRandom(6,6);
+    mat1.setRandom(6, 6);
+    arr1.setRandom(6, 6);
     VERIFY_IS_APPROX_EVALUATOR(mat2, arr1.matrix());
     VERIFY_IS_APPROX_EVALUATOR(arr2, mat1.array());
     VERIFY_IS_APPROX_EVALUATOR(mat2, (arr1 + 2).matrix());
     VERIFY_IS_APPROX_EVALUATOR(arr2, mat1.array() + 2);
     mat2.array() = arr1 * arr1;
     VERIFY_IS_APPROX(mat2, (arr1 * arr1).matrix());
-    arr2.matrix() = MatrixXd::Identity(6,6);
-    VERIFY_IS_APPROX(arr2, MatrixXd::Identity(6,6).array());
+    arr2.matrix() = MatrixXd::Identity(6, 6);
+    VERIFY_IS_APPROX(arr2, MatrixXd::Identity(6, 6).array());
 
     // test Reverse
     VERIFY_IS_APPROX_EVALUATOR(arr2, arr1.reverse());
@@ -392,7 +394,7 @@
     mat2.diagonal<-1>() = mat2.diagonal(1);
     VERIFY_IS_APPROX(mat1, mat2);
   }
-  
+
   {
     // test swapping
     MatrixXd mat1, mat2, mat1ref, mat2ref;
@@ -416,18 +418,18 @@
 
   {
     // test compound assignment
-    const Matrix4d mat_const = Matrix4d::Random(); 
+    const Matrix4d mat_const = Matrix4d::Random();
     Matrix4d mat, mat_ref;
     mat = mat_ref = Matrix4d::Identity();
     add_assign_using_evaluator(mat, mat_const);
     mat_ref += mat_const;
     VERIFY_IS_APPROX(mat, mat_ref);
 
-    subtract_assign_using_evaluator(mat.row(1), 2*mat.row(2));
-    mat_ref.row(1) -= 2*mat_ref.row(2);
+    subtract_assign_using_evaluator(mat.row(1), 2 * mat.row(2));
+    mat_ref.row(1) -= 2 * mat_ref.row(2);
     VERIFY_IS_APPROX(mat, mat_ref);
 
-    const ArrayXXf arr_const = ArrayXXf::Random(5,3); 
+    const ArrayXXf arr_const = ArrayXXf::Random(5, 3);
     ArrayXXf arr, arr_ref;
     arr = arr_ref = ArrayXXf::Constant(5, 3, 0.5);
     multiply_assign_using_evaluator(arr, arr_const);
@@ -438,69 +440,79 @@
     arr_ref.row(1) /= (arr_ref.row(2) + 1);
     VERIFY_IS_APPROX(arr, arr_ref);
   }
-  
+
   {
     // test triangular shapes
-    MatrixXd A = MatrixXd::Random(6,6), B(6,6), C(6,6), D(6,6);
-    A.setRandom();B.setRandom();
+    MatrixXd A = MatrixXd::Random(6, 6), B(6, 6), C(6, 6), D(6, 6);
+    A.setRandom();
+    B.setRandom();
     VERIFY_IS_APPROX_EVALUATOR2(B, A.triangularView<Upper>(), MatrixXd(A.triangularView<Upper>()));
-    
-    A.setRandom();B.setRandom();
+
+    A.setRandom();
+    B.setRandom();
     VERIFY_IS_APPROX_EVALUATOR2(B, A.triangularView<UnitLower>(), MatrixXd(A.triangularView<UnitLower>()));
-    
-    A.setRandom();B.setRandom();
+
+    A.setRandom();
+    B.setRandom();
     VERIFY_IS_APPROX_EVALUATOR2(B, A.triangularView<UnitUpper>(), MatrixXd(A.triangularView<UnitUpper>()));
-    
-    A.setRandom();B.setRandom();
-    C = B; C.triangularView<Upper>() = A;
+
+    A.setRandom();
+    B.setRandom();
+    C = B;
+    C.triangularView<Upper>() = A;
     copy_using_evaluator(B.triangularView<Upper>(), A);
     VERIFY(B.isApprox(C) && "copy_using_evaluator(B.triangularView<Upper>(), A)");
-    
-    A.setRandom();B.setRandom();
-    C = B; C.triangularView<Lower>() = A.triangularView<Lower>();
+
+    A.setRandom();
+    B.setRandom();
+    C = B;
+    C.triangularView<Lower>() = A.triangularView<Lower>();
     copy_using_evaluator(B.triangularView<Lower>(), A.triangularView<Lower>());
     VERIFY(B.isApprox(C) && "copy_using_evaluator(B.triangularView<Lower>(), A.triangularView<Lower>())");
-    
-    
-    A.setRandom();B.setRandom();
-    C = B; C.triangularView<Lower>() = A.triangularView<Upper>().transpose();
+
+    A.setRandom();
+    B.setRandom();
+    C = B;
+    C.triangularView<Lower>() = A.triangularView<Upper>().transpose();
     copy_using_evaluator(B.triangularView<Lower>(), A.triangularView<Upper>().transpose());
     VERIFY(B.isApprox(C) && "copy_using_evaluator(B.triangularView<Lower>(), A.triangularView<Lower>().transpose())");
-    
-    
-    A.setRandom();B.setRandom(); C = B; D = A;
+
+    A.setRandom();
+    B.setRandom();
+    C = B;
+    D = A;
     C.triangularView<Upper>().swap(D.triangularView<Upper>());
     swap_using_evaluator(B.triangularView<Upper>(), A.triangularView<Upper>());
     VERIFY(B.isApprox(C) && "swap_using_evaluator(B.triangularView<Upper>(), A.triangularView<Upper>())");
-    
-    
-    VERIFY_IS_APPROX_EVALUATOR2(B, prod(A.triangularView<Upper>(),A), MatrixXd(A.triangularView<Upper>()*A));
-    
-    VERIFY_IS_APPROX_EVALUATOR2(B, prod(A.selfadjointView<Upper>(),A), MatrixXd(A.selfadjointView<Upper>()*A));
+
+    VERIFY_IS_APPROX_EVALUATOR2(B, prod(A.triangularView<Upper>(), A), MatrixXd(A.triangularView<Upper>() * A));
+
+    VERIFY_IS_APPROX_EVALUATOR2(B, prod(A.selfadjointView<Upper>(), A), MatrixXd(A.selfadjointView<Upper>() * A));
   }
 
   {
     // test diagonal shapes
     VectorXd d = VectorXd::Random(6);
-    MatrixXd A = MatrixXd::Random(6,6), B(6,6);
-    A.setRandom();B.setRandom();
-    
-    VERIFY_IS_APPROX_EVALUATOR2(B, lazyprod(d.asDiagonal(),A), MatrixXd(d.asDiagonal()*A));
-    VERIFY_IS_APPROX_EVALUATOR2(B, lazyprod(A,d.asDiagonal()), MatrixXd(A*d.asDiagonal()));
+    MatrixXd A = MatrixXd::Random(6, 6), B(6, 6);
+    A.setRandom();
+    B.setRandom();
+
+    VERIFY_IS_APPROX_EVALUATOR2(B, lazyprod(d.asDiagonal(), A), MatrixXd(d.asDiagonal() * A));
+    VERIFY_IS_APPROX_EVALUATOR2(B, lazyprod(A, d.asDiagonal()), MatrixXd(A * d.asDiagonal()));
   }
 
   {
     // test CoeffReadCost
     Matrix4d a, b;
-    VERIFY_IS_EQUAL( get_cost(a), 1 );
-    VERIFY_IS_EQUAL( get_cost(a+b), 3);
-    VERIFY_IS_EQUAL( get_cost(2*a+b), 4);
-    VERIFY_IS_EQUAL( get_cost(a*b), 1);
-    VERIFY_IS_EQUAL( get_cost(a.lazyProduct(b)), 15);
-    VERIFY_IS_EQUAL( get_cost(a*(a*b)), 1);
-    VERIFY_IS_EQUAL( get_cost(a.lazyProduct(a*b)), 15);
-    VERIFY_IS_EQUAL( get_cost(a*(a+b)), 1);
-    VERIFY_IS_EQUAL( get_cost(a.lazyProduct(a+b)), 15);
+    VERIFY_IS_EQUAL(get_cost(a), 1);
+    VERIFY_IS_EQUAL(get_cost(a + b), 3);
+    VERIFY_IS_EQUAL(get_cost(2 * a + b), 4);
+    VERIFY_IS_EQUAL(get_cost(a * b), 1);
+    VERIFY_IS_EQUAL(get_cost(a.lazyProduct(b)), 15);
+    VERIFY_IS_EQUAL(get_cost(a * (a * b)), 1);
+    VERIFY_IS_EQUAL(get_cost(a.lazyProduct(a * b)), 15);
+    VERIFY_IS_EQUAL(get_cost(a * (a + b)), 1);
+    VERIFY_IS_EQUAL(get_cost(a.lazyProduct(a + b)), 15);
   }
 
   // regression test for PR 544 and bug 1622 (introduced in #71609c4)
@@ -509,19 +521,21 @@
     const size_t M = 2;
     const size_t K = 2;
     const size_t N = 5;
-    float *destMem = new float[(M*N) + 1];
+    float* destMem = new float[(M * N) + 1];
     // In case of no alignment, avoid division by zero.
     constexpr int alignment = (std::max<int>)(EIGEN_MAX_ALIGN_BYTES, 1);
-    float *dest = (std::uintptr_t(destMem)%alignment) == 0 ? destMem+1 : destMem;
+    float* dest = (std::uintptr_t(destMem) % alignment) == 0 ? destMem + 1 : destMem;
 
     const Matrix<float, Dynamic, Dynamic, RowMajor> a = Matrix<float, Dynamic, Dynamic, RowMajor>::Random(M, K);
     const Matrix<float, Dynamic, Dynamic, RowMajor> b = Matrix<float, Dynamic, Dynamic, RowMajor>::Random(K, N);
-    
-    Map<Matrix<float, Dynamic, Dynamic, RowMajor> > z(dest, M, N);;
-    Product<Matrix<float, Dynamic, Dynamic, RowMajor>, Matrix<float, Dynamic, Dynamic, RowMajor>, LazyProduct> tmp(a,b);
+
+    Map<Matrix<float, Dynamic, Dynamic, RowMajor> > z(dest, M, N);
+    ;
+    Product<Matrix<float, Dynamic, Dynamic, RowMajor>, Matrix<float, Dynamic, Dynamic, RowMajor>, LazyProduct> tmp(a,
+                                                                                                                   b);
     internal::call_restricted_packet_assignment(z.noalias(), tmp.derived(), internal::assign_op<float, float>());
-    
-    VERIFY_IS_APPROX(z, a*b);
+
+    VERIFY_IS_APPROX(z, a * b);
     delete[] destMem;
   }
 }
diff --git a/test/exceptions.cpp b/test/exceptions.cpp
index 3d93060..e3a5893 100644
--- a/test/exceptions.cpp
+++ b/test/exceptions.cpp
@@ -7,7 +7,6 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-
 // Various sanity tests with exceptions and non trivially copyable scalar type.
 //  - no memory leak when a custom scalar type trow an exceptions
 //  - todo: complete the list of tests!
@@ -17,33 +16,37 @@
 #include "main.h"
 #include "AnnoyingScalar.h"
 
-#define CHECK_MEMLEAK(OP) {                                 \
-    AnnoyingScalar::countdown = 100;                        \
-    int before = AnnoyingScalar::instances;                 \
-    bool exception_thrown = false;                          \
-    try { OP; }                                             \
-    catch (my_exception) {                                  \
-      exception_thrown = true;                              \
-      VERIFY(AnnoyingScalar::instances==before && "memory leak detected in " && EIGEN_MAKESTRING(OP)); \
-    } \
-    VERIFY( (AnnoyingScalar::dont_throw) || (exception_thrown && " no exception thrown in " && EIGEN_MAKESTRING(OP)) ); \
+#define CHECK_MEMLEAK(OP)                                                                                             \
+  {                                                                                                                   \
+    AnnoyingScalar::countdown = 100;                                                                                  \
+    int before = AnnoyingScalar::instances;                                                                           \
+    bool exception_thrown = false;                                                                                    \
+    try {                                                                                                             \
+      OP;                                                                                                             \
+    } catch (my_exception) {                                                                                          \
+      exception_thrown = true;                                                                                        \
+      VERIFY(AnnoyingScalar::instances == before && "memory leak detected in " && EIGEN_MAKESTRING(OP));              \
+    }                                                                                                                 \
+    VERIFY((AnnoyingScalar::dont_throw) || (exception_thrown && " no exception thrown in " && EIGEN_MAKESTRING(OP))); \
   }
 
-EIGEN_DECLARE_TEST(exceptions)
-{
-  typedef Eigen::Matrix<AnnoyingScalar,Dynamic,1> VectorType;
-  typedef Eigen::Matrix<AnnoyingScalar,Dynamic,Dynamic> MatrixType;
-  
+EIGEN_DECLARE_TEST(exceptions) {
+  typedef Eigen::Matrix<AnnoyingScalar, Dynamic, 1> VectorType;
+  typedef Eigen::Matrix<AnnoyingScalar, Dynamic, Dynamic> MatrixType;
+
   {
     AnnoyingScalar::dont_throw = false;
     int n = 50;
     VectorType v0(n), v1(n);
-    MatrixType m0(n,n), m1(n,n), m2(n,n);
-    v0.setOnes(); v1.setOnes();
-    m0.setOnes(); m1.setOnes(); m2.setOnes();
+    MatrixType m0(n, n), m1(n, n), m2(n, n);
+    v0.setOnes();
+    v1.setOnes();
+    m0.setOnes();
+    m1.setOnes();
+    m2.setOnes();
     CHECK_MEMLEAK(v0 = m0 * m1 * v1);
     CHECK_MEMLEAK(m2 = m0 * m1 * m2);
-    CHECK_MEMLEAK((v0+v1).dot(v0+v1));
+    CHECK_MEMLEAK((v0 + v1).dot(v0 + v1));
   }
-  VERIFY(AnnoyingScalar::instances==0 && "global memory leak detected in " && EIGEN_MAKESTRING(OP));
+  VERIFY(AnnoyingScalar::instances == 0 && "global memory leak detected in " && EIGEN_MAKESTRING(OP));
 }
diff --git a/test/fastmath.cpp b/test/fastmath.cpp
index 902dfd7..6d91fe9 100644
--- a/test/fastmath.cpp
+++ b/test/fastmath.cpp
@@ -9,10 +9,9 @@
 
 #include "main.h"
 
-void check(bool b, bool ref)
-{
+void check(bool b, bool ref) {
   std::cout << b;
-  if(b==ref)
+  if (b == ref)
     std::cout << " OK  ";
   else
     std::cout << " BAD ";
@@ -20,78 +19,189 @@
 
 #if EIGEN_COMP_MSVC && EIGEN_COMP_MSVC < 1800
 namespace std {
-  template<typename T> bool (isfinite)(T x) { return _finite(x); }
-  template<typename T> bool (isnan)(T x) { return _isnan(x); }
-  template<typename T> bool (isinf)(T x) { return _fpclass(x)==_FPCLASS_NINF || _fpclass(x)==_FPCLASS_PINF; }
+template <typename T>
+bool(isfinite)(T x) {
+  return _finite(x);
 }
+template <typename T>
+bool(isnan)(T x) {
+  return _isnan(x);
+}
+template <typename T>
+bool(isinf)(T x) {
+  return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF;
+}
+}  // namespace std
 #endif
 
-template<typename T>
+template <typename T>
 void check_inf_nan(bool dryrun) {
-  Matrix<T,Dynamic,1> m(10);
+  Matrix<T, Dynamic, 1> m(10);
   m.setRandom();
   m(3) = std::numeric_limits<T>::quiet_NaN();
 
-  if(dryrun)
-  {
-    std::cout << "std::isfinite(" << m(3) << ") = "; check((std::isfinite)(m(3)),false); std::cout << "  ; numext::isfinite = "; check((numext::isfinite)(m(3)), false); std::cout << "\n";
-    std::cout << "std::isinf(" << m(3) << ")    = "; check((std::isinf)(m(3)),false);    std::cout << "  ; numext::isinf    = "; check((numext::isinf)(m(3)), false); std::cout << "\n";
-    std::cout << "std::isnan(" << m(3) << ")    = "; check((std::isnan)(m(3)),true);     std::cout << "  ; numext::isnan    = "; check((numext::isnan)(m(3)), true); std::cout << "\n";
-    std::cout << "allFinite: "; check(m.allFinite(), 0); std::cout << "\n";
-    std::cout << "hasNaN:    "; check(m.hasNaN(), 1);    std::cout << "\n";
+  if (dryrun) {
+    std::cout << "std::isfinite(" << m(3) << ") = ";
+    check((std::isfinite)(m(3)), false);
+    std::cout << "  ; numext::isfinite = ";
+    check((numext::isfinite)(m(3)), false);
     std::cout << "\n";
+    std::cout << "std::isinf(" << m(3) << ")    = ";
+    check((std::isinf)(m(3)), false);
+    std::cout << "  ; numext::isinf    = ";
+    check((numext::isinf)(m(3)), false);
+    std::cout << "\n";
+    std::cout << "std::isnan(" << m(3) << ")    = ";
+    check((std::isnan)(m(3)), true);
+    std::cout << "  ; numext::isnan    = ";
+    check((numext::isnan)(m(3)), true);
+    std::cout << "\n";
+    std::cout << "allFinite: ";
+    check(m.allFinite(), 0);
+    std::cout << "\n";
+    std::cout << "hasNaN:    ";
+    check(m.hasNaN(), 1);
+    std::cout << "\n";
+    std::cout << "\n";
+  } else {
+    if ((std::isfinite)(m(3))) {
+      g_test_level = 1;
+      VERIFY(!(numext::isfinite)(m(3)));
+      g_test_level = 0;
+    }
+    if ((std::isinf)(m(3))) {
+      g_test_level = 1;
+      VERIFY(!(numext::isinf)(m(3)));
+      g_test_level = 0;
+    }
+    if (!(std::isnan)(m(3))) {
+      g_test_level = 1;
+      VERIFY((numext::isnan)(m(3)));
+      g_test_level = 0;
+    }
+    if ((std::isfinite)(m(3))) {
+      g_test_level = 1;
+      VERIFY(!m.allFinite());
+      g_test_level = 0;
+    }
+    if (!(std::isnan)(m(3))) {
+      g_test_level = 1;
+      VERIFY(m.hasNaN());
+      g_test_level = 0;
+    }
   }
-  else
-  {
-    if( (std::isfinite)(m(3))) { g_test_level=1;  VERIFY( !(numext::isfinite)(m(3)) ); g_test_level=0; }
-    if( (std::isinf)   (m(3))) { g_test_level=1;  VERIFY( !(numext::isinf)(m(3)) );    g_test_level=0; }
-    if(!(std::isnan)   (m(3))) { g_test_level=1;  VERIFY(  (numext::isnan)(m(3)) );    g_test_level=0; }
-    if( (std::isfinite)(m(3))) { g_test_level=1;  VERIFY( !m.allFinite() );            g_test_level=0; }
-    if(!(std::isnan)   (m(3))) { g_test_level=1;  VERIFY(  m.hasNaN() );               g_test_level=0; }
-  }
-  T hidden_zero = (std::numeric_limits<T>::min)()*(std::numeric_limits<T>::min)();
+  T hidden_zero = (std::numeric_limits<T>::min)() * (std::numeric_limits<T>::min)();
   m(4) /= hidden_zero;
-  if(dryrun)
-  {
-    std::cout << "std::isfinite(" << m(4) << ") = "; check((std::isfinite)(m(4)),false); std::cout << "  ; numext::isfinite = "; check((numext::isfinite)(m(4)), false); std::cout << "\n";
-    std::cout << "std::isinf(" << m(4) << ")    = "; check((std::isinf)(m(4)),true);     std::cout << "  ; numext::isinf    = "; check((numext::isinf)(m(4)), true); std::cout << "\n";
-    std::cout << "std::isnan(" << m(4) << ")    = "; check((std::isnan)(m(4)),false);    std::cout << "  ; numext::isnan    = "; check((numext::isnan)(m(4)), false); std::cout << "\n";
-    std::cout << "allFinite: "; check(m.allFinite(), 0); std::cout << "\n";
-    std::cout << "hasNaN:    "; check(m.hasNaN(), 1);    std::cout << "\n";
+  if (dryrun) {
+    std::cout << "std::isfinite(" << m(4) << ") = ";
+    check((std::isfinite)(m(4)), false);
+    std::cout << "  ; numext::isfinite = ";
+    check((numext::isfinite)(m(4)), false);
     std::cout << "\n";
-  }
-  else
-  {
-    if( (std::isfinite)(m(3))) { g_test_level=1;  VERIFY( !(numext::isfinite)(m(4)) );  g_test_level=0; }
-    if(!(std::isinf)   (m(3))) { g_test_level=1;  VERIFY(  (numext::isinf)(m(4)) );     g_test_level=0; }
-    if( (std::isnan)   (m(3))) { g_test_level=1;  VERIFY( !(numext::isnan)(m(4)) );     g_test_level=0; }
-    if( (std::isfinite)(m(3))) { g_test_level=1;  VERIFY( !m.allFinite() );             g_test_level=0; }
-    if(!(std::isnan)   (m(3))) { g_test_level=1;  VERIFY(  m.hasNaN() );                g_test_level=0; }
+    std::cout << "std::isinf(" << m(4) << ")    = ";
+    check((std::isinf)(m(4)), true);
+    std::cout << "  ; numext::isinf    = ";
+    check((numext::isinf)(m(4)), true);
+    std::cout << "\n";
+    std::cout << "std::isnan(" << m(4) << ")    = ";
+    check((std::isnan)(m(4)), false);
+    std::cout << "  ; numext::isnan    = ";
+    check((numext::isnan)(m(4)), false);
+    std::cout << "\n";
+    std::cout << "allFinite: ";
+    check(m.allFinite(), 0);
+    std::cout << "\n";
+    std::cout << "hasNaN:    ";
+    check(m.hasNaN(), 1);
+    std::cout << "\n";
+    std::cout << "\n";
+  } else {
+    if ((std::isfinite)(m(3))) {
+      g_test_level = 1;
+      VERIFY(!(numext::isfinite)(m(4)));
+      g_test_level = 0;
+    }
+    if (!(std::isinf)(m(3))) {
+      g_test_level = 1;
+      VERIFY((numext::isinf)(m(4)));
+      g_test_level = 0;
+    }
+    if ((std::isnan)(m(3))) {
+      g_test_level = 1;
+      VERIFY(!(numext::isnan)(m(4)));
+      g_test_level = 0;
+    }
+    if ((std::isfinite)(m(3))) {
+      g_test_level = 1;
+      VERIFY(!m.allFinite());
+      g_test_level = 0;
+    }
+    if (!(std::isnan)(m(3))) {
+      g_test_level = 1;
+      VERIFY(m.hasNaN());
+      g_test_level = 0;
+    }
   }
   m(3) = 0;
-  if(dryrun)
-  {
-    std::cout << "std::isfinite(" << m(3) << ") = "; check((std::isfinite)(m(3)),true); std::cout << "  ; numext::isfinite = "; check((numext::isfinite)(m(3)), true); std::cout << "\n";
-    std::cout << "std::isinf(" << m(3) << ")    = "; check((std::isinf)(m(3)),false);   std::cout << "  ; numext::isinf    = "; check((numext::isinf)(m(3)), false); std::cout << "\n";
-    std::cout << "std::isnan(" << m(3) << ")    = "; check((std::isnan)(m(3)),false);   std::cout << "  ; numext::isnan    = "; check((numext::isnan)(m(3)), false); std::cout << "\n";
-    std::cout << "allFinite: "; check(m.allFinite(), 0); std::cout << "\n";
-    std::cout << "hasNaN:    "; check(m.hasNaN(), 0);    std::cout << "\n";
+  if (dryrun) {
+    std::cout << "std::isfinite(" << m(3) << ") = ";
+    check((std::isfinite)(m(3)), true);
+    std::cout << "  ; numext::isfinite = ";
+    check((numext::isfinite)(m(3)), true);
+    std::cout << "\n";
+    std::cout << "std::isinf(" << m(3) << ")    = ";
+    check((std::isinf)(m(3)), false);
+    std::cout << "  ; numext::isinf    = ";
+    check((numext::isinf)(m(3)), false);
+    std::cout << "\n";
+    std::cout << "std::isnan(" << m(3) << ")    = ";
+    check((std::isnan)(m(3)), false);
+    std::cout << "  ; numext::isnan    = ";
+    check((numext::isnan)(m(3)), false);
+    std::cout << "\n";
+    std::cout << "allFinite: ";
+    check(m.allFinite(), 0);
+    std::cout << "\n";
+    std::cout << "hasNaN:    ";
+    check(m.hasNaN(), 0);
+    std::cout << "\n";
     std::cout << "\n\n";
-  }
-  else
-  {
-    if(!(std::isfinite)(m(3))) { g_test_level=1;  VERIFY(  (numext::isfinite)(m(3)) );  g_test_level=0; }
-    if( (std::isinf)   (m(3))) { g_test_level=1;  VERIFY( !(numext::isinf)(m(3)) );     g_test_level=0; }
-    if( (std::isnan)   (m(3))) { g_test_level=1;  VERIFY( !(numext::isnan)(m(3)) );     g_test_level=0; }
-    if( (std::isfinite)(m(3))) { g_test_level=1;  VERIFY( !m.allFinite() );             g_test_level=0; }
-    if( (std::isnan)   (m(3))) { g_test_level=1;  VERIFY( !m.hasNaN() );                g_test_level=0; }
+  } else {
+    if (!(std::isfinite)(m(3))) {
+      g_test_level = 1;
+      VERIFY((numext::isfinite)(m(3)));
+      g_test_level = 0;
+    }
+    if ((std::isinf)(m(3))) {
+      g_test_level = 1;
+      VERIFY(!(numext::isinf)(m(3)));
+      g_test_level = 0;
+    }
+    if ((std::isnan)(m(3))) {
+      g_test_level = 1;
+      VERIFY(!(numext::isnan)(m(3)));
+      g_test_level = 0;
+    }
+    if ((std::isfinite)(m(3))) {
+      g_test_level = 1;
+      VERIFY(!m.allFinite());
+      g_test_level = 0;
+    }
+    if ((std::isnan)(m(3))) {
+      g_test_level = 1;
+      VERIFY(!m.hasNaN());
+      g_test_level = 0;
+    }
   }
 }
 
 EIGEN_DECLARE_TEST(fastmath) {
-  std::cout << "*** float *** \n\n"; check_inf_nan<float>(true);
-  std::cout << "*** double ***\n\n"; check_inf_nan<double>(true);
-  std::cout << "*** long double *** \n\n"; check_inf_nan<long double>(true);
+  std::cout << "*** float *** \n\n";
+  check_inf_nan<float>(true);
+  std::cout << "*** double ***\n\n";
+  check_inf_nan<double>(true);
+  std::cout << "*** long double *** \n\n";
+  check_inf_nan<long double>(true);
 
   check_inf_nan<float>(false);
   check_inf_nan<double>(false);
diff --git a/test/first_aligned.cpp b/test/first_aligned.cpp
index aaa4d01..6695785 100644
--- a/test/first_aligned.cpp
+++ b/test/first_aligned.cpp
@@ -9,42 +9,41 @@
 
 #include "main.h"
 
-template<typename Scalar>
-void test_first_aligned_helper(Scalar *array, int size)
-{
+template <typename Scalar>
+void test_first_aligned_helper(Scalar *array, int size) {
   const int packet_size = sizeof(Scalar) * internal::packet_traits<Scalar>::size;
   VERIFY(((size_t(array) + sizeof(Scalar) * internal::first_default_aligned(array, size)) % packet_size) == 0);
 }
 
-template<typename Scalar>
-void test_none_aligned_helper(Scalar *array, int size)
-{
+template <typename Scalar>
+void test_none_aligned_helper(Scalar *array, int size) {
   EIGEN_UNUSED_VARIABLE(array);
   EIGEN_UNUSED_VARIABLE(size);
   VERIFY(internal::packet_traits<Scalar>::size == 1 || internal::first_default_aligned(array, size) == size);
 }
 
-struct some_non_vectorizable_type { float x; };
+struct some_non_vectorizable_type {
+  float x;
+};
 
-EIGEN_DECLARE_TEST(first_aligned)
-{
+EIGEN_DECLARE_TEST(first_aligned) {
   EIGEN_ALIGN16 float array_float[100];
   test_first_aligned_helper(array_float, 50);
-  test_first_aligned_helper(array_float+1, 50);
-  test_first_aligned_helper(array_float+2, 50);
-  test_first_aligned_helper(array_float+3, 50);
-  test_first_aligned_helper(array_float+4, 50);
-  test_first_aligned_helper(array_float+5, 50);
-  
+  test_first_aligned_helper(array_float + 1, 50);
+  test_first_aligned_helper(array_float + 2, 50);
+  test_first_aligned_helper(array_float + 3, 50);
+  test_first_aligned_helper(array_float + 4, 50);
+  test_first_aligned_helper(array_float + 5, 50);
+
   EIGEN_ALIGN16 double array_double[100];
   test_first_aligned_helper(array_double, 50);
-  test_first_aligned_helper(array_double+1, 50);
-  test_first_aligned_helper(array_double+2, 50);
-  
-  double *array_double_plus_4_bytes = (double*)(std::uintptr_t(array_double)+4);
+  test_first_aligned_helper(array_double + 1, 50);
+  test_first_aligned_helper(array_double + 2, 50);
+
+  double *array_double_plus_4_bytes = (double *)(std::uintptr_t(array_double) + 4);
   test_none_aligned_helper(array_double_plus_4_bytes, 50);
-  test_none_aligned_helper(array_double_plus_4_bytes+1, 50);
-  
+  test_none_aligned_helper(array_double_plus_4_bytes + 1, 50);
+
   some_non_vectorizable_type array_nonvec[100];
   test_first_aligned_helper(array_nonvec, 100);
   test_none_aligned_helper(array_nonvec, 100);
diff --git a/test/float_conversion.cpp b/test/float_conversion.cpp
index fd8d45d..6ea8a37 100644
--- a/test/float_conversion.cpp
+++ b/test/float_conversion.cpp
@@ -9,7 +9,7 @@
 
 #include "main.h"
 
-template<typename From, typename To>
+template <typename From, typename To>
 void test_conversion() {
   typedef Array<From, Dynamic, 1> ArrayXFrom;
   typedef Array<To, Dynamic, 1> ArrayXTo;
@@ -21,7 +21,7 @@
 
   // ArrayXFrom::Random() only generates 32-bit values (#2749), so we generate
   // doubles and scale to fit the range.
-  ArrayXDouble doubles = (ArrayXDouble::Random(size)+1.0)*(from_range/2.0) + from_min;
+  ArrayXDouble doubles = (ArrayXDouble::Random(size) + 1.0) * (from_range / 2.0) + from_min;
   ArrayXFrom from = doubles.template cast<From>();
   ArrayXTo to(size);
   for (Index i = 0; i < size; ++i) {
@@ -30,7 +30,7 @@
   VERIFY_IS_APPROX(from.template cast<To>(), to);
 }
 
-template<typename To>
+template <typename To>
 void test_conversion_to() {
   CALL_SUBTEST((test_conversion<int64_t, To>()));
   CALL_SUBTEST((test_conversion<uint64_t, To>()));
@@ -42,9 +42,8 @@
   CALL_SUBTEST((test_conversion<uint8_t, To>()));
 }
 
-EIGEN_DECLARE_TEST(float_conversion)
-{
-  for(int i = 0; i < g_repeat; i++) {
+EIGEN_DECLARE_TEST(float_conversion) {
+  for (int i = 0; i < g_repeat; i++) {
     CALL_SUBTEST(test_conversion_to<float>());
     CALL_SUBTEST(test_conversion_to<double>());
   }
diff --git a/test/geo_alignedbox.cpp b/test/geo_alignedbox.cpp
index e4dab32..266e58b 100644
--- a/test/geo_alignedbox.cpp
+++ b/test/geo_alignedbox.cpp
@@ -15,8 +15,8 @@
 // NOTE the following workaround was needed on some 32 bits builds to kill extra precision of x87 registers.
 // It seems that it is not needed anymore, but let's keep it here, just in case...
 
-template<typename T> EIGEN_DONT_INLINE
-void kill_extra_precision(T& /* x */) {
+template <typename T>
+EIGEN_DONT_INLINE void kill_extra_precision(T& /* x */) {
   // This one worked but triggered a warning:
   /* eigen_assert((void*)(&x) != (void*)0); */
   // An alternative could be:
@@ -24,9 +24,8 @@
   /* x = tmp; */
 }
 
-
-template<typename BoxType> void alignedbox(const BoxType& box)
-{
+template <typename BoxType>
+void alignedbox(const BoxType& box) {
   /* this test covers the following files:
      AlignedBox.h
   */
@@ -39,12 +38,13 @@
 
   VectorType p0 = VectorType::Random(dim);
   VectorType p1 = VectorType::Random(dim);
-  while( p1 == p0 ){
-      p1 =  VectorType::Random(dim); }
-  RealScalar s1 = internal::random<RealScalar>(0,1);
+  while (p1 == p0) {
+    p1 = VectorType::Random(dim);
+  }
+  RealScalar s1 = internal::random<RealScalar>(0, 1);
 
   BoxType b0(dim);
-  BoxType b1(VectorType::Random(dim),VectorType::Random(dim));
+  BoxType b1(VectorType::Random(dim), VectorType::Random(dim));
   BoxType b2;
 
   kill_extra_precision(b1);
@@ -53,9 +53,9 @@
 
   b0.extend(p0);
   b0.extend(p1);
-  VERIFY(b0.contains(p0*s1+(Scalar(1)-s1)*p1));
+  VERIFY(b0.contains(p0 * s1 + (Scalar(1) - s1) * p1));
   VERIFY(b0.contains(b0.center()));
-  VERIFY_IS_APPROX(b0.center(),(p0+p1)/Scalar(2));
+  VERIFY_IS_APPROX(b0.center(), (p0 + p1) / Scalar(2));
 
   (b2 = b0).extend(b1);
   VERIFY(b2.contains(b0));
@@ -71,23 +71,21 @@
   VERIFY(box1.intersects(box2) == !box1.intersection(box2).isEmpty());
 
   // alignment -- make sure there is no memory alignment assertion
-  BoxType *bp0 = new BoxType(dim);
-  BoxType *bp1 = new BoxType(dim);
+  BoxType* bp0 = new BoxType(dim);
+  BoxType* bp1 = new BoxType(dim);
   bp0->extend(*bp1);
   delete bp0;
   delete bp1;
 
   // sampling
-  for( int i=0; i<10; ++i )
-  {
-      VectorType r = b0.sample();
-      VERIFY(b0.contains(r));
+  for (int i = 0; i < 10; ++i) {
+    VectorType r = b0.sample();
+    VERIFY(b0.contains(r));
   }
-
 }
 
-template<typename BoxType> void alignedboxTranslatable(const BoxType& box)
-{
+template <typename BoxType>
+void alignedboxTranslatable(const BoxType& box) {
   typedef typename BoxType::Scalar Scalar;
   typedef Matrix<Scalar, BoxType::AmbientDimAtCompileTime, 1> VectorType;
   typedef Transform<Scalar, BoxType::AmbientDimAtCompileTime, Isometry> IsometryTransform;
@@ -153,13 +151,11 @@
   BoxType transformedC = c.transformed(IsometryTransform::Identity());
   VERIFY_IS_APPROX(transformedC, c);
 
-  for (size_t i = 0; i < 10; ++i)
-  {
+  for (size_t i = 0; i < 10; ++i) {
     VectorType minCorner;
     VectorType maxCorner;
-    for (Index d = 0; d < dim; ++d)
-    {
-      minCorner[d] = internal::random<Scalar>(-10,10);
+    for (Index d = 0; d < dim; ++d) {
+      minCorner[d] = internal::random<Scalar>(-10, 10);
       maxCorner[d] = minCorner[d] + internal::random<Scalar>(0, 10);
     }
 
@@ -173,31 +169,29 @@
   }
 }
 
-template<typename Scalar, typename Rotation>
+template <typename Scalar, typename Rotation>
 Rotation rotate2D(Scalar angle) {
   return Rotation2D<Scalar>(angle);
 }
 
-template<typename Scalar, typename Rotation>
+template <typename Scalar, typename Rotation>
 Rotation rotate2DIntegral(typename NumTraits<Scalar>::NonInteger angle) {
   typedef typename NumTraits<Scalar>::NonInteger NonInteger;
-  return Rotation2D<NonInteger>(angle).toRotationMatrix().
-      template cast<Scalar>();
+  return Rotation2D<NonInteger>(angle).toRotationMatrix().template cast<Scalar>();
 }
 
-template<typename Scalar, typename Rotation>
+template <typename Scalar, typename Rotation>
 Rotation rotate3DZAxis(Scalar angle) {
   return AngleAxis<Scalar>(angle, Matrix<Scalar, 3, 1>(0, 0, 1));
 }
 
-template<typename Scalar, typename Rotation>
+template <typename Scalar, typename Rotation>
 Rotation rotate3DZAxisIntegral(typename NumTraits<Scalar>::NonInteger angle) {
   typedef typename NumTraits<Scalar>::NonInteger NonInteger;
-  return AngleAxis<NonInteger>(angle, Matrix<NonInteger, 3, 1>(0, 0, 1)).
-      toRotationMatrix().template cast<Scalar>();
+  return AngleAxis<NonInteger>(angle, Matrix<NonInteger, 3, 1>(0, 0, 1)).toRotationMatrix().template cast<Scalar>();
 }
 
-template<typename Scalar, typename Rotation>
+template <typename Scalar, typename Rotation>
 Rotation rotate4DZWAxis(Scalar angle) {
   Rotation result = Matrix<Scalar, 4, 4>::Identity();
   result.block(0, 0, 3, 3) = rotate3DZAxis<Scalar, AngleAxisd>(angle).toRotationMatrix();
@@ -205,8 +199,7 @@
 }
 
 template <typename MatrixType>
-MatrixType randomRotationMatrix()
-{
+MatrixType randomRotationMatrix() {
   // algorithm from
   // https://www.isprs-ann-photogramm-remote-sens-spatial-inf-sci.net/III-7/103/2016/isprs-annals-III-7-103-2016.pdf
   const MatrixType rand = MatrixType::Random();
@@ -220,21 +213,17 @@
 }
 
 template <typename Scalar, int Dim>
-Matrix<Scalar, Dim, (1<<Dim)> boxGetCorners(const Matrix<Scalar, Dim, 1>& min_, const Matrix<Scalar, Dim, 1>& max_)
-{
-  Matrix<Scalar, Dim, (1<<Dim) > result;
-  for(Index i=0; i<(1<<Dim); ++i)
-  {
-    for(Index j=0; j<Dim; ++j)
-      result(j,i) = (i & (1<<j)) ? min_(j) : max_(j);
+Matrix<Scalar, Dim, (1 << Dim)> boxGetCorners(const Matrix<Scalar, Dim, 1>& min_, const Matrix<Scalar, Dim, 1>& max_) {
+  Matrix<Scalar, Dim, (1 << Dim)> result;
+  for (Index i = 0; i < (1 << Dim); ++i) {
+    for (Index j = 0; j < Dim; ++j) result(j, i) = (i & (1 << j)) ? min_(j) : max_(j);
   }
   return result;
 }
 
-template<typename BoxType, typename Rotation> void alignedboxRotatable(
-    const BoxType& box,
-    Rotation (*rotate)(typename NumTraits<typename BoxType::Scalar>::NonInteger /*_angle*/))
-{
+template <typename BoxType, typename Rotation>
+void alignedboxRotatable(const BoxType& box,
+                         Rotation (*rotate)(typename NumTraits<typename BoxType::Scalar>::NonInteger /*_angle*/)) {
   alignedboxTranslatable(box);
 
   typedef typename BoxType::Scalar Scalar;
@@ -301,10 +290,9 @@
   VERIFY_IS_APPROX((c.max)(), Ones + UnitX);
 }
 
-template<typename BoxType, typename Rotation> void alignedboxNonIntegralRotatable(
-    const BoxType& box,
-    Rotation (*rotate)(typename NumTraits<typename BoxType::Scalar>::NonInteger /*_angle*/))
-{
+template <typename BoxType, typename Rotation>
+void alignedboxNonIntegralRotatable(
+    const BoxType& box, Rotation (*rotate)(typename NumTraits<typename BoxType::Scalar>::NonInteger /*_angle*/)) {
   alignedboxRotatable(box, rotate);
 
   typedef typename BoxType::Scalar Scalar;
@@ -328,10 +316,12 @@
 
   VectorType cornerBL = (c.min)();
   VectorType cornerTR = (c.max)();
-  VectorType cornerBR = (c.min)(); cornerBR[0] = cornerTR[0];
-  VectorType cornerTL = (c.max)(); cornerTL[0] = cornerBL[0];
+  VectorType cornerBR = (c.min)();
+  cornerBR[0] = cornerTR[0];
+  VectorType cornerTL = (c.max)();
+  cornerTL[0] = cornerBL[0];
 
-  NonInteger angle = NonInteger(EIGEN_PI/3);
+  NonInteger angle = NonInteger(EIGEN_PI / 3);
   Rotation rot = rotate(angle);
   IsometryTransform tf2;
   tf2.setIdentity();
@@ -352,27 +342,24 @@
   minCorner[1] = (min)((min)(cornerBL[1], cornerBR[1]), (min)(cornerTL[1], cornerTR[1]));
   maxCorner[1] = (max)((max)(cornerBL[1], cornerBR[1]), (max)(cornerTL[1], cornerTR[1]));
 
-  for (Index d = 2; d < dim; ++d)
-    VERIFY_IS_APPROX(c.sizes()[d], Scalar(2));
+  for (Index d = 2; d < dim; ++d) VERIFY_IS_APPROX(c.sizes()[d], Scalar(2));
 
   VERIFY_IS_APPROX((c.min)(), minCorner);
   VERIFY_IS_APPROX((c.max)(), maxCorner);
 
   VectorType minCornerValue = Ones * Scalar(-2);
   VectorType maxCornerValue = Zero;
-  minCornerValue[0] = Scalar(Scalar(-sqrt(2*2 + 3*3)) * Scalar(cos(Scalar(atan(2.0/3.0)) - angle/2)));
-  minCornerValue[1] = Scalar(Scalar(-sqrt(1*1 + 2*2)) * Scalar(sin(Scalar(atan(2.0/1.0)) - angle/2)));
+  minCornerValue[0] = Scalar(Scalar(-sqrt(2 * 2 + 3 * 3)) * Scalar(cos(Scalar(atan(2.0 / 3.0)) - angle / 2)));
+  minCornerValue[1] = Scalar(Scalar(-sqrt(1 * 1 + 2 * 2)) * Scalar(sin(Scalar(atan(2.0 / 1.0)) - angle / 2)));
   maxCornerValue[0] = Scalar(-sin(angle));
   maxCornerValue[1] = Scalar(3 * cos(angle));
   VERIFY_IS_APPROX((c.min)(), minCornerValue);
   VERIFY_IS_APPROX((c.max)(), maxCornerValue);
 
   // randomized test - translate and rotate the box and compare to a box made of transformed vertices
-  for (size_t i = 0; i < 10; ++i)
-  {
-    for (Index d = 0; d < dim; ++d)
-    {
-      minCorner[d] = internal::random<Scalar>(-10,10);
+  for (size_t i = 0; i < 10; ++i) {
+    for (Index d = 0; d < dim; ++d) {
+      minCorner[d] = internal::random<Scalar>(-10, 10);
       maxCorner[d] = minCorner[d] + internal::random<Scalar>(0, 10);
     }
 
@@ -398,11 +385,9 @@
   }
 
   // randomized test - transform the box with a random affine matrix and compare to a box made of transformed vertices
-  for (size_t i = 0; i < 10; ++i)
-  {
-    for (Index d = 0; d < dim; ++d)
-    {
-      minCorner[d] = internal::random<Scalar>(-10,10);
+  for (size_t i = 0; i < 10; ++i) {
+    for (Index d = 0; d < dim; ++d) {
+      minCorner[d] = internal::random<Scalar>(-10, 10);
       maxCorner[d] = minCorner[d] + internal::random<Scalar>(0, 10);
     }
 
@@ -425,9 +410,8 @@
   }
 }
 
-template<typename BoxType>
-void alignedboxCastTests(const BoxType& box)
-{
+template <typename BoxType>
+void alignedboxCastTests(const BoxType& box) {
   // casting
   typedef typename BoxType::Scalar Scalar;
   typedef Matrix<Scalar, BoxType::AmbientDimAtCompileTime, 1> VectorType;
@@ -444,88 +428,90 @@
 
   const int Dim = BoxType::AmbientDimAtCompileTime;
   typedef typename GetDifferentType<Scalar>::type OtherScalar;
-  AlignedBox<OtherScalar,Dim> hp1f = b0.template cast<OtherScalar>();
-  VERIFY_IS_APPROX(hp1f.template cast<Scalar>(),b0);
-  AlignedBox<Scalar,Dim> hp1d = b0.template cast<Scalar>();
-  VERIFY_IS_APPROX(hp1d.template cast<Scalar>(),b0);
+  AlignedBox<OtherScalar, Dim> hp1f = b0.template cast<OtherScalar>();
+  VERIFY_IS_APPROX(hp1f.template cast<Scalar>(), b0);
+  AlignedBox<Scalar, Dim> hp1d = b0.template cast<Scalar>();
+  VERIFY_IS_APPROX(hp1d.template cast<Scalar>(), b0);
 }
 
+void specificTest1() {
+  Vector2f m;
+  m << -1.0f, -2.0f;
+  Vector2f M;
+  M << 1.0f, 5.0f;
 
-void specificTest1()
-{
-    Vector2f m; m << -1.0f, -2.0f;
-    Vector2f M; M <<  1.0f,  5.0f;
+  typedef AlignedBox2f BoxType;
+  BoxType box(m, M);
 
-    typedef AlignedBox2f  BoxType;
-    BoxType box( m, M );
+  Vector2f sides = M - m;
+  VERIFY_IS_APPROX(sides, box.sizes());
+  VERIFY_IS_APPROX(sides[1], box.sizes()[1]);
+  VERIFY_IS_APPROX(sides[1], box.sizes().maxCoeff());
+  VERIFY_IS_APPROX(sides[0], box.sizes().minCoeff());
 
-    Vector2f sides = M-m;
-    VERIFY_IS_APPROX(sides, box.sizes() );
-    VERIFY_IS_APPROX(sides[1], box.sizes()[1] );
-    VERIFY_IS_APPROX(sides[1], box.sizes().maxCoeff() );
-    VERIFY_IS_APPROX(sides[0], box.sizes().minCoeff() );
+  VERIFY_IS_APPROX(14.0f, box.volume());
+  VERIFY_IS_APPROX(53.0f, box.diagonal().squaredNorm());
+  VERIFY_IS_APPROX(std::sqrt(53.0f), box.diagonal().norm());
 
-    VERIFY_IS_APPROX( 14.0f, box.volume() );
-    VERIFY_IS_APPROX( 53.0f, box.diagonal().squaredNorm() );
-    VERIFY_IS_APPROX( std::sqrt( 53.0f ), box.diagonal().norm() );
-
-    VERIFY_IS_APPROX( m, box.corner( BoxType::BottomLeft ) );
-    VERIFY_IS_APPROX( M, box.corner( BoxType::TopRight ) );
-    Vector2f bottomRight; bottomRight << M[0], m[1];
-    Vector2f topLeft; topLeft << m[0], M[1];
-    VERIFY_IS_APPROX( bottomRight, box.corner( BoxType::BottomRight ) );
-    VERIFY_IS_APPROX( topLeft, box.corner( BoxType::TopLeft ) );
+  VERIFY_IS_APPROX(m, box.corner(BoxType::BottomLeft));
+  VERIFY_IS_APPROX(M, box.corner(BoxType::TopRight));
+  Vector2f bottomRight;
+  bottomRight << M[0], m[1];
+  Vector2f topLeft;
+  topLeft << m[0], M[1];
+  VERIFY_IS_APPROX(bottomRight, box.corner(BoxType::BottomRight));
+  VERIFY_IS_APPROX(topLeft, box.corner(BoxType::TopLeft));
 }
 
+void specificTest2() {
+  Vector3i m;
+  m << -1, -2, 0;
+  Vector3i M;
+  M << 1, 5, 3;
 
-void specificTest2()
-{
-    Vector3i m; m << -1, -2, 0;
-    Vector3i M; M <<  1,  5, 3;
+  typedef AlignedBox3i BoxType;
+  BoxType box(m, M);
 
-    typedef AlignedBox3i  BoxType;
-    BoxType box( m, M );
+  Vector3i sides = M - m;
+  VERIFY_IS_APPROX(sides, box.sizes());
+  VERIFY_IS_APPROX(sides[1], box.sizes()[1]);
+  VERIFY_IS_APPROX(sides[1], box.sizes().maxCoeff());
+  VERIFY_IS_APPROX(sides[0], box.sizes().minCoeff());
 
-    Vector3i sides = M-m;
-    VERIFY_IS_APPROX(sides, box.sizes() );
-    VERIFY_IS_APPROX(sides[1], box.sizes()[1] );
-    VERIFY_IS_APPROX(sides[1], box.sizes().maxCoeff() );
-    VERIFY_IS_APPROX(sides[0], box.sizes().minCoeff() );
+  VERIFY_IS_APPROX(42, box.volume());
+  VERIFY_IS_APPROX(62, box.diagonal().squaredNorm());
 
-    VERIFY_IS_APPROX( 42, box.volume() );
-    VERIFY_IS_APPROX( 62, box.diagonal().squaredNorm() );
-
-    VERIFY_IS_APPROX( m, box.corner( BoxType::BottomLeftFloor ) );
-    VERIFY_IS_APPROX( M, box.corner( BoxType::TopRightCeil ) );
-    Vector3i bottomRightFloor; bottomRightFloor << M[0], m[1], m[2];
-    Vector3i topLeftFloor; topLeftFloor << m[0], M[1], m[2];
-    VERIFY_IS_APPROX( bottomRightFloor, box.corner( BoxType::BottomRightFloor ) );
-    VERIFY_IS_APPROX( topLeftFloor, box.corner( BoxType::TopLeftFloor ) );
+  VERIFY_IS_APPROX(m, box.corner(BoxType::BottomLeftFloor));
+  VERIFY_IS_APPROX(M, box.corner(BoxType::TopRightCeil));
+  Vector3i bottomRightFloor;
+  bottomRightFloor << M[0], m[1], m[2];
+  Vector3i topLeftFloor;
+  topLeftFloor << m[0], M[1], m[2];
+  VERIFY_IS_APPROX(bottomRightFloor, box.corner(BoxType::BottomRightFloor));
+  VERIFY_IS_APPROX(topLeftFloor, box.corner(BoxType::TopLeftFloor));
 }
 
+EIGEN_DECLARE_TEST(geo_alignedbox) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1((alignedboxNonIntegralRotatable<AlignedBox2f, Rotation2Df>(AlignedBox2f(), &rotate2D)));
+    CALL_SUBTEST_2(alignedboxCastTests(AlignedBox2f()));
 
-EIGEN_DECLARE_TEST(geo_alignedbox)
-{
-  for(int i = 0; i < g_repeat; i++)
-  {
-    CALL_SUBTEST_1( (alignedboxNonIntegralRotatable<AlignedBox2f, Rotation2Df>(AlignedBox2f(), &rotate2D)) );
-    CALL_SUBTEST_2( alignedboxCastTests(AlignedBox2f()) );
+    CALL_SUBTEST_3((alignedboxNonIntegralRotatable<AlignedBox3f, AngleAxisf>(AlignedBox3f(), &rotate3DZAxis)));
+    CALL_SUBTEST_4(alignedboxCastTests(AlignedBox3f()));
 
-    CALL_SUBTEST_3( (alignedboxNonIntegralRotatable<AlignedBox3f, AngleAxisf>(AlignedBox3f(), &rotate3DZAxis)) );
-    CALL_SUBTEST_4( alignedboxCastTests(AlignedBox3f()) );
+    CALL_SUBTEST_5((alignedboxNonIntegralRotatable<AlignedBox4d, Matrix4d>(AlignedBox4d(), &rotate4DZWAxis)));
+    CALL_SUBTEST_6(alignedboxCastTests(AlignedBox4d()));
 
-    CALL_SUBTEST_5( (alignedboxNonIntegralRotatable<AlignedBox4d, Matrix4d>(AlignedBox4d(), &rotate4DZWAxis)) );
-    CALL_SUBTEST_6( alignedboxCastTests(AlignedBox4d()) );
+    CALL_SUBTEST_7(alignedboxTranslatable(AlignedBox1d()));
+    CALL_SUBTEST_8(alignedboxCastTests(AlignedBox1d()));
 
-    CALL_SUBTEST_7( alignedboxTranslatable(AlignedBox1d()) );
-    CALL_SUBTEST_8( alignedboxCastTests(AlignedBox1d()) );
+    CALL_SUBTEST_9(alignedboxTranslatable(AlignedBox1i()));
+    CALL_SUBTEST_10((alignedboxRotatable<AlignedBox2i, Matrix2i>(AlignedBox2i(), &rotate2DIntegral<int, Matrix2i>)));
+    CALL_SUBTEST_11(
+        (alignedboxRotatable<AlignedBox3i, Matrix3i>(AlignedBox3i(), &rotate3DZAxisIntegral<int, Matrix3i>)));
 
-    CALL_SUBTEST_9( alignedboxTranslatable(AlignedBox1i()) );
-    CALL_SUBTEST_10( (alignedboxRotatable<AlignedBox2i, Matrix2i>(AlignedBox2i(), &rotate2DIntegral<int, Matrix2i>)) );
-    CALL_SUBTEST_11( (alignedboxRotatable<AlignedBox3i, Matrix3i>(AlignedBox3i(), &rotate3DZAxisIntegral<int, Matrix3i>)) );
-
-    CALL_SUBTEST_14( alignedbox(AlignedBox<double,Dynamic>(4)) );
+    CALL_SUBTEST_14(alignedbox(AlignedBox<double, Dynamic>(4)));
   }
-  CALL_SUBTEST_12( specificTest1() );
-  CALL_SUBTEST_13( specificTest2() );
+  CALL_SUBTEST_12(specificTest1());
+  CALL_SUBTEST_13(specificTest2());
 }
diff --git a/test/geo_eulerangles.cpp b/test/geo_eulerangles.cpp
index 2751675..3d443de 100644
--- a/test/geo_eulerangles.cpp
+++ b/test/geo_eulerangles.cpp
@@ -16,20 +16,20 @@
 #include <Eigen/LU>
 #include <Eigen/SVD>
 
-
-template<typename Scalar>
-void verify_euler(const Matrix<Scalar, 3, 1>& ea, int i, int j, int k)
-{
+template <typename Scalar>
+void verify_euler(const Matrix<Scalar, 3, 1>& ea, int i, int j, int k) {
   typedef Matrix<Scalar, 3, 3> Matrix3;
   typedef Matrix<Scalar, 3, 1> Vector3;
   typedef AngleAxis<Scalar> AngleAxisx;
-  const Matrix3 m(AngleAxisx(ea[0], Vector3::Unit(i)) * AngleAxisx(ea[1], Vector3::Unit(j)) * AngleAxisx(ea[2], Vector3::Unit(k)));
+  const Matrix3 m(AngleAxisx(ea[0], Vector3::Unit(i)) * AngleAxisx(ea[1], Vector3::Unit(j)) *
+                  AngleAxisx(ea[2], Vector3::Unit(k)));
 
   // Test non-canonical eulerAngles
   {
     Vector3 eabis = m.eulerAngles(i, j, k);
-    Matrix3 mbis(AngleAxisx(eabis[0], Vector3::Unit(i)) * AngleAxisx(eabis[1], Vector3::Unit(j)) * AngleAxisx(eabis[2], Vector3::Unit(k)));
-    VERIFY_IS_APPROX(m,  mbis);
+    Matrix3 mbis(AngleAxisx(eabis[0], Vector3::Unit(i)) * AngleAxisx(eabis[1], Vector3::Unit(j)) *
+                 AngleAxisx(eabis[2], Vector3::Unit(k)));
+    VERIFY_IS_APPROX(m, mbis);
 
     // approx_or_less_than does not work for 0
     VERIFY(0 < eabis[0] || test_isMuchSmallerThan(eabis[0], Scalar(1)));
@@ -43,19 +43,17 @@
   // Test canonicalEulerAngles
   {
     Vector3 eabis = m.canonicalEulerAngles(i, j, k);
-    Matrix3 mbis(AngleAxisx(eabis[0], Vector3::Unit(i)) * AngleAxisx(eabis[1], Vector3::Unit(j)) * AngleAxisx(eabis[2], Vector3::Unit(k)));
-    VERIFY_IS_APPROX(m,  mbis);
+    Matrix3 mbis(AngleAxisx(eabis[0], Vector3::Unit(i)) * AngleAxisx(eabis[1], Vector3::Unit(j)) *
+                 AngleAxisx(eabis[2], Vector3::Unit(k)));
+    VERIFY_IS_APPROX(m, mbis);
 
     VERIFY_IS_APPROX_OR_LESS_THAN(-Scalar(EIGEN_PI), eabis[0]);
     VERIFY_IS_APPROX_OR_LESS_THAN(eabis[0], Scalar(EIGEN_PI));
-    if (i != k)
-    {
+    if (i != k) {
       // Tait-Bryan sequence
       VERIFY_IS_APPROX_OR_LESS_THAN(-Scalar(EIGEN_PI / 2), eabis[1]);
       VERIFY_IS_APPROX_OR_LESS_THAN(eabis[1], Scalar(EIGEN_PI / 2));
-    }
-    else
-    {
+    } else {
       // Proper Euler sequence
       // approx_or_less_than does not work for 0
       VERIFY(0 < eabis[1] || test_isMuchSmallerThan(eabis[1], Scalar(1)));
@@ -66,10 +64,9 @@
   }
 }
 
-template<typename Scalar> void check_all_var(const Matrix<Scalar, 3, 1>& ea)
-{
-  auto verify_permutation = [](const Matrix<Scalar, 3, 1>& eap)
-  {
+template <typename Scalar>
+void check_all_var(const Matrix<Scalar, 3, 1>& ea) {
+  auto verify_permutation = [](const Matrix<Scalar, 3, 1>& eap) {
     verify_euler(eap, 0, 1, 2);
     verify_euler(eap, 0, 1, 0);
     verify_euler(eap, 0, 2, 1);
@@ -89,15 +86,14 @@
   int i, j, k;
   for (i = 0; i < 3; i++)
     for (j = 0; j < 3; j++)
-      for (k = 0; k < 3; k++)
-      {
-        Matrix<Scalar,3,1> eap(ea(i), ea(j), ea(k));
+      for (k = 0; k < 3; k++) {
+        Matrix<Scalar, 3, 1> eap(ea(i), ea(j), ea(k));
         verify_permutation(eap);
       }
 }
 
-template<typename Scalar> void eulerangles()
-{
+template <typename Scalar>
+void eulerangles() {
   typedef Matrix<Scalar, 3, 3> Matrix3;
   typedef Matrix<Scalar, 3, 1> Vector3;
   typedef Array<Scalar, 3, 1> Array3;
@@ -127,8 +123,7 @@
   ea = Array3::Random() * Scalar(EIGEN_PI);
   check_all_var(ea);
 
-  auto test_with_some_zeros = [](const Vector3& eaz)
-  {
+  auto test_with_some_zeros = [](const Vector3& eaz) {
     check_all_var(eaz);
     Vector3 ea_glz = eaz;
     ea_glz[0] = Scalar(0);
@@ -142,20 +137,20 @@
   };
   // Check gimbal lock configurations and a bit noisy gimbal locks
   Vector3 ea_gl = ea;
-  ea_gl[1] = EIGEN_PI/2;
+  ea_gl[1] = EIGEN_PI / 2;
   test_with_some_zeros(ea_gl);
   ea_gl[1] += internal::random<Scalar>(-0.001, 0.001);
   test_with_some_zeros(ea_gl);
-  ea_gl[1] = -EIGEN_PI/2;
+  ea_gl[1] = -EIGEN_PI / 2;
   test_with_some_zeros(ea_gl);
   ea_gl[1] += internal::random<Scalar>(-0.001, 0.001);
   test_with_some_zeros(ea_gl);
-  ea_gl[1] = EIGEN_PI/2;
+  ea_gl[1] = EIGEN_PI / 2;
   ea_gl[2] = ea_gl[0];
   test_with_some_zeros(ea_gl);
   ea_gl[1] += internal::random<Scalar>(-0.001, 0.001);
   test_with_some_zeros(ea_gl);
-  ea_gl[1] = -EIGEN_PI/2;
+  ea_gl[1] = -EIGEN_PI / 2;
   test_with_some_zeros(ea_gl);
   ea_gl[1] += internal::random<Scalar>(-0.001, 0.001);
   test_with_some_zeros(ea_gl);
@@ -196,11 +191,9 @@
   check_all_var(ea);
 }
 
-EIGEN_DECLARE_TEST(geo_eulerangles)
-{
-  for(int i = 0; i < g_repeat; i++)
-  {
-    CALL_SUBTEST_1( eulerangles<float>() );
-    CALL_SUBTEST_2( eulerangles<double>() );
+EIGEN_DECLARE_TEST(geo_eulerangles) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(eulerangles<float>());
+    CALL_SUBTEST_2(eulerangles<double>());
   }
 }
diff --git a/test/geo_homogeneous.cpp b/test/geo_homogeneous.cpp
index 9aebe62..cb14413 100644
--- a/test/geo_homogeneous.cpp
+++ b/test/geo_homogeneous.cpp
@@ -10,24 +10,23 @@
 #include "main.h"
 #include <Eigen/Geometry>
 
-template<typename Scalar,int Size> void homogeneous(void)
-{
+template <typename Scalar, int Size>
+void homogeneous(void) {
   /* this test covers the following files:
      Homogeneous.h
   */
 
-  typedef Matrix<Scalar,Size,Size> MatrixType;
-  typedef Matrix<Scalar,Size,1, ColMajor> VectorType;
+  typedef Matrix<Scalar, Size, Size> MatrixType;
+  typedef Matrix<Scalar, Size, 1, ColMajor> VectorType;
 
-  typedef Matrix<Scalar,Size+1,Size> HMatrixType;
-  typedef Matrix<Scalar,Size+1,1> HVectorType;
+  typedef Matrix<Scalar, Size + 1, Size> HMatrixType;
+  typedef Matrix<Scalar, Size + 1, 1> HVectorType;
 
-  typedef Matrix<Scalar,Size,Size+1>   T1MatrixType;
-  typedef Matrix<Scalar,Size+1,Size+1> T2MatrixType;
-  typedef Matrix<Scalar,Size+1,Size> T3MatrixType;
+  typedef Matrix<Scalar, Size, Size + 1> T1MatrixType;
+  typedef Matrix<Scalar, Size + 1, Size + 1> T2MatrixType;
+  typedef Matrix<Scalar, Size + 1, Size> T3MatrixType;
 
-  VectorType v0 = VectorType::Random(),
-             ones = VectorType::Ones();
+  VectorType v0 = VectorType::Random(), ones = VectorType::Ones();
 
   HVectorType hv0 = HVectorType::Random();
 
@@ -38,7 +37,7 @@
   hv0 << v0, 1;
   VERIFY_IS_APPROX(v0.homogeneous(), hv0);
   VERIFY_IS_APPROX(v0, hv0.hnormalized());
-  
+
   VERIFY_IS_APPROX(v0.homogeneous().sum(), hv0.sum());
   VERIFY_IS_APPROX(v0.homogeneous().minCoeff(), hv0.minCoeff());
   VERIFY_IS_APPROX(v0.homogeneous().maxCoeff(), hv0.maxCoeff());
@@ -46,9 +45,8 @@
   hm0 << m0, ones.transpose();
   VERIFY_IS_APPROX(m0.colwise().homogeneous(), hm0);
   VERIFY_IS_APPROX(m0, hm0.colwise().hnormalized());
-  hm0.row(Size-1).setRandom();
-  for(int j=0; j<Size; ++j)
-    m0.col(j) = hm0.col(j).head(Size) / hm0(Size,j);
+  hm0.row(Size - 1).setRandom();
+  for (int j = 0; j < Size; ++j) m0.col(j) = hm0.col(j).head(Size) / hm0(Size, j);
   VERIFY_IS_APPROX(m0, hm0.colwise().hnormalized());
 
   T1MatrixType t1 = T1MatrixType::Random();
@@ -61,65 +59,65 @@
   VERIFY_IS_APPROX(t2 * (v0.homogeneous().asDiagonal()), t2 * hv0.asDiagonal());
   VERIFY_IS_APPROX((v0.homogeneous().asDiagonal()) * t2, hv0.asDiagonal() * t2);
 
-  VERIFY_IS_APPROX((v0.transpose().rowwise().homogeneous().eval()) * t2,
-                    v0.transpose().rowwise().homogeneous() * t2);
-  VERIFY_IS_APPROX((m0.transpose().rowwise().homogeneous().eval()) * t2,
-                    m0.transpose().rowwise().homogeneous() * t2);
+  VERIFY_IS_APPROX((v0.transpose().rowwise().homogeneous().eval()) * t2, v0.transpose().rowwise().homogeneous() * t2);
+  VERIFY_IS_APPROX((m0.transpose().rowwise().homogeneous().eval()) * t2, m0.transpose().rowwise().homogeneous() * t2);
 
   T3MatrixType t3 = T3MatrixType::Random();
-  VERIFY_IS_APPROX((v0.transpose().rowwise().homogeneous().eval()) * t3,
-                    v0.transpose().rowwise().homogeneous() * t3);
-  VERIFY_IS_APPROX((m0.transpose().rowwise().homogeneous().eval()) * t3,
-                    m0.transpose().rowwise().homogeneous() * t3);
+  VERIFY_IS_APPROX((v0.transpose().rowwise().homogeneous().eval()) * t3, v0.transpose().rowwise().homogeneous() * t3);
+  VERIFY_IS_APPROX((m0.transpose().rowwise().homogeneous().eval()) * t3, m0.transpose().rowwise().homogeneous() * t3);
 
   // test product with a Transform object
   Transform<Scalar, Size, Affine> aff;
   Transform<Scalar, Size, AffineCompact> caff;
   Transform<Scalar, Size, Projective> proj;
-  Matrix<Scalar, Size, Dynamic>   pts;
-  Matrix<Scalar, Size+1, Dynamic> pts1, pts2;
+  Matrix<Scalar, Size, Dynamic> pts;
+  Matrix<Scalar, Size + 1, Dynamic> pts1, pts2;
 
   aff.affine().setRandom();
   proj = caff = aff;
-  pts.setRandom(Size,internal::random<int>(1,20));
-  
+  pts.setRandom(Size, internal::random<int>(1, 20));
+
   pts1 = pts.colwise().homogeneous();
-  VERIFY_IS_APPROX(aff  * pts.colwise().homogeneous(), (aff  * pts1).colwise().hnormalized());
+  VERIFY_IS_APPROX(aff * pts.colwise().homogeneous(), (aff * pts1).colwise().hnormalized());
   VERIFY_IS_APPROX(caff * pts.colwise().homogeneous(), (caff * pts1).colwise().hnormalized());
   VERIFY_IS_APPROX(proj * pts.colwise().homogeneous(), (proj * pts1));
 
-  VERIFY_IS_APPROX((aff  * pts1).colwise().hnormalized(),  aff  * pts);
+  VERIFY_IS_APPROX((aff * pts1).colwise().hnormalized(), aff * pts);
   VERIFY_IS_APPROX((caff * pts1).colwise().hnormalized(), caff * pts);
-  
+
   pts2 = pts1;
   pts2.row(Size).setRandom();
-  VERIFY_IS_APPROX((aff  * pts2).colwise().hnormalized(), aff  * pts2.colwise().hnormalized());
+  VERIFY_IS_APPROX((aff * pts2).colwise().hnormalized(), aff * pts2.colwise().hnormalized());
   VERIFY_IS_APPROX((caff * pts2).colwise().hnormalized(), caff * pts2.colwise().hnormalized());
-  VERIFY_IS_APPROX((proj * pts2).colwise().hnormalized(), (proj * pts2.colwise().hnormalized().colwise().homogeneous()).colwise().hnormalized());
-  
-  // Test combination of homogeneous
-  
-  VERIFY_IS_APPROX( (t2 * v0.homogeneous()).hnormalized(),
-                       (t2.template topLeftCorner<Size,Size>() * v0 + t2.template topRightCorner<Size,1>())
-                     / ((t2.template bottomLeftCorner<1,Size>()*v0).value() + t2(Size,Size)) );
-  
-  VERIFY_IS_APPROX( (t2 * pts.colwise().homogeneous()).colwise().hnormalized(),
-                    (Matrix<Scalar, Size+1, Dynamic>(t2 * pts1).colwise().hnormalized()) );
-  
-  VERIFY_IS_APPROX( (t2 .lazyProduct( v0.homogeneous() )).hnormalized(), (t2 * v0.homogeneous()).hnormalized() );
-  VERIFY_IS_APPROX( (t2 .lazyProduct  ( pts.colwise().homogeneous() )).colwise().hnormalized(), (t2 * pts1).colwise().hnormalized() );
-  
-  VERIFY_IS_APPROX( (v0.transpose().homogeneous() .lazyProduct( t2 )).hnormalized(), (v0.transpose().homogeneous()*t2).hnormalized() );
-  VERIFY_IS_APPROX( (pts.transpose().rowwise().homogeneous() .lazyProduct( t2 )).rowwise().hnormalized(), (pts1.transpose()*t2).rowwise().hnormalized() );
+  VERIFY_IS_APPROX((proj * pts2).colwise().hnormalized(),
+                   (proj * pts2.colwise().hnormalized().colwise().homogeneous()).colwise().hnormalized());
 
-  VERIFY_IS_APPROX( (t2.template triangularView<Lower>() * v0.homogeneous()).eval(), (t2.template triangularView<Lower>()*hv0) );
+  // Test combination of homogeneous
+
+  VERIFY_IS_APPROX((t2 * v0.homogeneous()).hnormalized(),
+                   (t2.template topLeftCorner<Size, Size>() * v0 + t2.template topRightCorner<Size, 1>()) /
+                       ((t2.template bottomLeftCorner<1, Size>() * v0).value() + t2(Size, Size)));
+
+  VERIFY_IS_APPROX((t2 * pts.colwise().homogeneous()).colwise().hnormalized(),
+                   (Matrix<Scalar, Size + 1, Dynamic>(t2 * pts1).colwise().hnormalized()));
+
+  VERIFY_IS_APPROX((t2.lazyProduct(v0.homogeneous())).hnormalized(), (t2 * v0.homogeneous()).hnormalized());
+  VERIFY_IS_APPROX((t2.lazyProduct(pts.colwise().homogeneous())).colwise().hnormalized(),
+                   (t2 * pts1).colwise().hnormalized());
+
+  VERIFY_IS_APPROX((v0.transpose().homogeneous().lazyProduct(t2)).hnormalized(),
+                   (v0.transpose().homogeneous() * t2).hnormalized());
+  VERIFY_IS_APPROX((pts.transpose().rowwise().homogeneous().lazyProduct(t2)).rowwise().hnormalized(),
+                   (pts1.transpose() * t2).rowwise().hnormalized());
+
+  VERIFY_IS_APPROX((t2.template triangularView<Lower>() * v0.homogeneous()).eval(),
+                   (t2.template triangularView<Lower>() * hv0));
 }
 
-EIGEN_DECLARE_TEST(geo_homogeneous)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1(( homogeneous<float,1>() ));
-    CALL_SUBTEST_2(( homogeneous<double,3>() ));
-    CALL_SUBTEST_3(( homogeneous<double,8>() ));
+EIGEN_DECLARE_TEST(geo_homogeneous) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1((homogeneous<float, 1>()));
+    CALL_SUBTEST_2((homogeneous<double, 3>()));
+    CALL_SUBTEST_3((homogeneous<double, 8>()));
   }
 }
diff --git a/test/geo_hyperplane.cpp b/test/geo_hyperplane.cpp
index 44b2f2a..2e6b500 100644
--- a/test/geo_hyperplane.cpp
+++ b/test/geo_hyperplane.cpp
@@ -13,8 +13,8 @@
 #include <Eigen/LU>
 #include <Eigen/QR>
 
-template<typename HyperplaneType> void hyperplane(const HyperplaneType& _plane)
-{
+template <typename HyperplaneType>
+void hyperplane(const HyperplaneType &_plane) {
   /* this test covers the following files:
      Hyperplane.h
   */
@@ -24,8 +24,7 @@
   typedef typename HyperplaneType::Scalar Scalar;
   typedef typename HyperplaneType::RealScalar RealScalar;
   typedef Matrix<Scalar, HyperplaneType::AmbientDimAtCompileTime, 1> VectorType;
-  typedef Matrix<Scalar, HyperplaneType::AmbientDimAtCompileTime,
-                         HyperplaneType::AmbientDimAtCompileTime> MatrixType;
+  typedef Matrix<Scalar, HyperplaneType::AmbientDimAtCompileTime, HyperplaneType::AmbientDimAtCompileTime> MatrixType;
 
   VectorType p0 = VectorType::Random(dim);
   VectorType p1 = VectorType::Random(dim);
@@ -40,71 +39,69 @@
   Scalar s0 = internal::random<Scalar>();
   Scalar s1 = internal::random<Scalar>();
 
-  VERIFY_IS_APPROX( n1.dot(n1), Scalar(1) );
+  VERIFY_IS_APPROX(n1.dot(n1), Scalar(1));
 
-  VERIFY_IS_MUCH_SMALLER_THAN( pl0.absDistance(p0), Scalar(1) );
-  if(numext::abs2(s0)>RealScalar(1e-6))
-    VERIFY_IS_APPROX( pl1.signedDistance(p1 + n1 * s0), s0);
+  VERIFY_IS_MUCH_SMALLER_THAN(pl0.absDistance(p0), Scalar(1));
+  if (numext::abs2(s0) > RealScalar(1e-6))
+    VERIFY_IS_APPROX(pl1.signedDistance(p1 + n1 * s0), s0);
   else
-    VERIFY_IS_MUCH_SMALLER_THAN( abs(pl1.signedDistance(p1 + n1 * s0) - s0), Scalar(1) );
-  VERIFY_IS_MUCH_SMALLER_THAN( pl1.signedDistance(pl1.projection(p0)), Scalar(1) );
-  VERIFY_IS_MUCH_SMALLER_THAN( pl1.absDistance(p1 +  pl1.normal().unitOrthogonal() * s1), Scalar(1) );
+    VERIFY_IS_MUCH_SMALLER_THAN(abs(pl1.signedDistance(p1 + n1 * s0) - s0), Scalar(1));
+  VERIFY_IS_MUCH_SMALLER_THAN(pl1.signedDistance(pl1.projection(p0)), Scalar(1));
+  VERIFY_IS_MUCH_SMALLER_THAN(pl1.absDistance(p1 + pl1.normal().unitOrthogonal() * s1), Scalar(1));
 
   // transform
-  if (!NumTraits<Scalar>::IsComplex)
-  {
-    MatrixType rot = MatrixType::Random(dim,dim).householderQr().householderQ();
-    DiagonalMatrix<Scalar,HyperplaneType::AmbientDimAtCompileTime> scaling(VectorType::Random());
-    Translation<Scalar,HyperplaneType::AmbientDimAtCompileTime> translation(VectorType::Random());
-    
-    while(scaling.diagonal().cwiseAbs().minCoeff()<RealScalar(1e-4)) scaling.diagonal() = VectorType::Random();
+  if (!NumTraits<Scalar>::IsComplex) {
+    MatrixType rot = MatrixType::Random(dim, dim).householderQr().householderQ();
+    DiagonalMatrix<Scalar, HyperplaneType::AmbientDimAtCompileTime> scaling(VectorType::Random());
+    Translation<Scalar, HyperplaneType::AmbientDimAtCompileTime> translation(VectorType::Random());
+
+    while (scaling.diagonal().cwiseAbs().minCoeff() < RealScalar(1e-4)) scaling.diagonal() = VectorType::Random();
 
     pl2 = pl1;
-    VERIFY_IS_MUCH_SMALLER_THAN( pl2.transform(rot).absDistance(rot * p1), Scalar(1) );
+    VERIFY_IS_MUCH_SMALLER_THAN(pl2.transform(rot).absDistance(rot * p1), Scalar(1));
     pl2 = pl1;
-    VERIFY_IS_MUCH_SMALLER_THAN( pl2.transform(rot,Isometry).absDistance(rot * p1), Scalar(1) );
+    VERIFY_IS_MUCH_SMALLER_THAN(pl2.transform(rot, Isometry).absDistance(rot * p1), Scalar(1));
     pl2 = pl1;
-    VERIFY_IS_MUCH_SMALLER_THAN( pl2.transform(rot*scaling).absDistance((rot*scaling) * p1), Scalar(1) );
-    VERIFY_IS_APPROX( pl2.normal().norm(), RealScalar(1) );
+    VERIFY_IS_MUCH_SMALLER_THAN(pl2.transform(rot * scaling).absDistance((rot * scaling) * p1), Scalar(1));
+    VERIFY_IS_APPROX(pl2.normal().norm(), RealScalar(1));
     pl2 = pl1;
-    VERIFY_IS_MUCH_SMALLER_THAN( pl2.transform(rot*scaling*translation)
-                                  .absDistance((rot*scaling*translation) * p1), Scalar(1) );
-    VERIFY_IS_APPROX( pl2.normal().norm(), RealScalar(1) );
+    VERIFY_IS_MUCH_SMALLER_THAN(
+        pl2.transform(rot * scaling * translation).absDistance((rot * scaling * translation) * p1), Scalar(1));
+    VERIFY_IS_APPROX(pl2.normal().norm(), RealScalar(1));
     pl2 = pl1;
-    VERIFY_IS_MUCH_SMALLER_THAN( pl2.transform(rot*translation,Isometry)
-                                 .absDistance((rot*translation) * p1), Scalar(1) );
-    VERIFY_IS_APPROX( pl2.normal().norm(), RealScalar(1) );
+    VERIFY_IS_MUCH_SMALLER_THAN(pl2.transform(rot * translation, Isometry).absDistance((rot * translation) * p1),
+                                Scalar(1));
+    VERIFY_IS_APPROX(pl2.normal().norm(), RealScalar(1));
   }
 
   // casting
   const int Dim = HyperplaneType::AmbientDimAtCompileTime;
   typedef typename GetDifferentType<Scalar>::type OtherScalar;
-  Hyperplane<OtherScalar,Dim,Options> hp1f = pl1.template cast<OtherScalar>();
-  VERIFY_IS_APPROX(hp1f.template cast<Scalar>(),pl1);
-  Hyperplane<Scalar,Dim,Options> hp1d = pl1.template cast<Scalar>();
-  VERIFY_IS_APPROX(hp1d.template cast<Scalar>(),pl1);
+  Hyperplane<OtherScalar, Dim, Options> hp1f = pl1.template cast<OtherScalar>();
+  VERIFY_IS_APPROX(hp1f.template cast<Scalar>(), pl1);
+  Hyperplane<Scalar, Dim, Options> hp1d = pl1.template cast<Scalar>();
+  VERIFY_IS_APPROX(hp1d.template cast<Scalar>(), pl1);
 }
 
-template<typename Scalar> void lines()
-{
+template <typename Scalar>
+void lines() {
   using std::abs;
   typedef Hyperplane<Scalar, 2> HLine;
   typedef ParametrizedLine<Scalar, 2> PLine;
-  typedef Matrix<Scalar,2,1> Vector;
-  typedef Matrix<Scalar,3,1> CoeffsType;
+  typedef Matrix<Scalar, 2, 1> Vector;
+  typedef Matrix<Scalar, 3, 1> CoeffsType;
 
-  for(int i = 0; i < 10; i++)
-  {
+  for (int i = 0; i < 10; i++) {
     Vector center = Vector::Random();
     Vector u = Vector::Random();
     Vector v = Vector::Random();
     Scalar a = internal::random<Scalar>();
-    while (abs(a-1) < Scalar(1e-4)) a = internal::random<Scalar>();
+    while (abs(a - 1) < Scalar(1e-4)) a = internal::random<Scalar>();
     while (u.norm() < Scalar(1e-4)) u = Vector::Random();
     while (v.norm() < Scalar(1e-4)) v = Vector::Random();
 
-    HLine line_u = HLine::Through(center + u, center + a*u);
-    HLine line_v = HLine::Through(center + v, center + a*v);
+    HLine line_u = HLine::Through(center + u, center + a * u);
+    HLine line_v = HLine::Through(center + v, center + a * v);
 
     // the line equations should be normalized so that a^2+b^2=1
     VERIFY_IS_APPROX(line_u.normal().norm(), Scalar(1));
@@ -113,35 +110,32 @@
     Vector result = line_u.intersection(line_v);
 
     // the lines should intersect at the point we called "center"
-    if(abs(a-1) > Scalar(1e-2) && abs(v.normalized().dot(u.normalized()))<Scalar(0.9))
+    if (abs(a - 1) > Scalar(1e-2) && abs(v.normalized().dot(u.normalized())) < Scalar(0.9))
       VERIFY_IS_APPROX(result, center);
 
     // check conversions between two types of lines
-    PLine pl(line_u); // gcc 3.3 will crash if we don't name this variable.
+    PLine pl(line_u);  // gcc 3.3 will crash if we don't name this variable.
     HLine line_u2(pl);
     CoeffsType converted_coeffs = line_u2.coeffs();
-    if(line_u2.normal().dot(line_u.normal())<Scalar(0))
-      converted_coeffs = -line_u2.coeffs();
+    if (line_u2.normal().dot(line_u.normal()) < Scalar(0)) converted_coeffs = -line_u2.coeffs();
     VERIFY(line_u.coeffs().isApprox(converted_coeffs));
   }
 }
 
-template<typename Scalar> void planes()
-{
+template <typename Scalar>
+void planes() {
   using std::abs;
   typedef Hyperplane<Scalar, 3> Plane;
-  typedef Matrix<Scalar,3,1> Vector;
+  typedef Matrix<Scalar, 3, 1> Vector;
 
-  for(int i = 0; i < 10; i++)
-  {
+  for (int i = 0; i < 10; i++) {
     Vector v0 = Vector::Random();
     Vector v1(v0), v2(v0);
-    if(internal::random<double>(0,1)>0.25)
-      v1 += Vector::Random();
-    if(internal::random<double>(0,1)>0.25)
-      v2 += v1 * std::pow(internal::random<Scalar>(0,1),internal::random<int>(1,16));
-    if(internal::random<double>(0,1)>0.25)
-      v2 += Vector::Random() * std::pow(internal::random<Scalar>(0,1),internal::random<int>(1,16));
+    if (internal::random<double>(0, 1) > 0.25) v1 += Vector::Random();
+    if (internal::random<double>(0, 1) > 0.25)
+      v2 += v1 * std::pow(internal::random<Scalar>(0, 1), internal::random<int>(1, 16));
+    if (internal::random<double>(0, 1) > 0.25)
+      v2 += Vector::Random() * std::pow(internal::random<Scalar>(0, 1), internal::random<int>(1, 16));
 
     Plane p0 = Plane::Through(v0, v1, v2);
 
@@ -152,20 +146,20 @@
   }
 }
 
-template<typename Scalar> void hyperplane_alignment()
-{
-  typedef Hyperplane<Scalar,3,AutoAlign> Plane3a;
-  typedef Hyperplane<Scalar,3,DontAlign> Plane3u;
+template <typename Scalar>
+void hyperplane_alignment() {
+  typedef Hyperplane<Scalar, 3, AutoAlign> Plane3a;
+  typedef Hyperplane<Scalar, 3, DontAlign> Plane3u;
 
   EIGEN_ALIGN_MAX Scalar array1[4];
   EIGEN_ALIGN_MAX Scalar array2[4];
-  EIGEN_ALIGN_MAX Scalar array3[4+1];
-  Scalar* array3u = array3+1;
+  EIGEN_ALIGN_MAX Scalar array3[4 + 1];
+  Scalar *array3u = array3 + 1;
 
-  Plane3a *p1 = ::new(reinterpret_cast<void*>(array1)) Plane3a;
-  Plane3u *p2 = ::new(reinterpret_cast<void*>(array2)) Plane3u;
-  Plane3u *p3 = ::new(reinterpret_cast<void*>(array3u)) Plane3u;
-  
+  Plane3a *p1 = ::new (reinterpret_cast<void *>(array1)) Plane3a;
+  Plane3u *p2 = ::new (reinterpret_cast<void *>(array2)) Plane3u;
+  Plane3u *p3 = ::new (reinterpret_cast<void *>(array3u)) Plane3u;
+
   p1->coeffs().setRandom();
   *p2 = *p1;
   *p3 = *p1;
@@ -174,19 +168,17 @@
   VERIFY_IS_APPROX(p1->coeffs(), p3->coeffs());
 }
 
-
-EIGEN_DECLARE_TEST(geo_hyperplane)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( hyperplane(Hyperplane<float,2>()) );
-    CALL_SUBTEST_2( hyperplane(Hyperplane<float,3>()) );
-    CALL_SUBTEST_2( hyperplane(Hyperplane<float,3,DontAlign>()) );
-    CALL_SUBTEST_2( hyperplane_alignment<float>() );
-    CALL_SUBTEST_3( hyperplane(Hyperplane<double,4>()) );
-    CALL_SUBTEST_4( hyperplane(Hyperplane<std::complex<double>,5>()) );
-    CALL_SUBTEST_1( lines<float>() );
-    CALL_SUBTEST_3( lines<double>() );
-    CALL_SUBTEST_2( planes<float>() );
-    CALL_SUBTEST_5( planes<double>() );
+EIGEN_DECLARE_TEST(geo_hyperplane) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(hyperplane(Hyperplane<float, 2>()));
+    CALL_SUBTEST_2(hyperplane(Hyperplane<float, 3>()));
+    CALL_SUBTEST_2(hyperplane(Hyperplane<float, 3, DontAlign>()));
+    CALL_SUBTEST_2(hyperplane_alignment<float>());
+    CALL_SUBTEST_3(hyperplane(Hyperplane<double, 4>()));
+    CALL_SUBTEST_4(hyperplane(Hyperplane<std::complex<double>, 5>()));
+    CALL_SUBTEST_1(lines<float>());
+    CALL_SUBTEST_3(lines<double>());
+    CALL_SUBTEST_2(planes<float>());
+    CALL_SUBTEST_5(planes<double>());
   }
 }
diff --git a/test/geo_orthomethods.cpp b/test/geo_orthomethods.cpp
index 64b3927..5ee0f47 100644
--- a/test/geo_orthomethods.cpp
+++ b/test/geo_orthomethods.cpp
@@ -16,17 +16,15 @@
    Geometry/OrthoMethods.h
 */
 
-template<typename Scalar> void orthomethods_3()
-{
+template <typename Scalar>
+void orthomethods_3() {
   typedef typename NumTraits<Scalar>::Real RealScalar;
-  typedef Matrix<Scalar,3,3> Matrix3;
-  typedef Matrix<Scalar,3,1> Vector3;
+  typedef Matrix<Scalar, 3, 3> Matrix3;
+  typedef Matrix<Scalar, 3, 1> Vector3;
 
-  typedef Matrix<Scalar,4,1> Vector4;
+  typedef Matrix<Scalar, 4, 1> Vector4;
 
-  Vector3 v0 = Vector3::Random(),
-          v1 = Vector3::Random(),
-          v2 = Vector3::Random();
+  Vector3 v0 = Vector3::Random(), v1 = Vector3::Random(), v2 = Vector3::Random();
 
   // cross product
   VERIFY_IS_MUCH_SMALLER_THAN(v1.cross(v2).dot(v1), Scalar(1));
@@ -35,41 +33,38 @@
   VERIFY_IS_MUCH_SMALLER_THAN(v2.dot(v1.cross(v2)), Scalar(1));
   VERIFY_IS_MUCH_SMALLER_THAN(v1.cross(Vector3::Random()).dot(v1), Scalar(1));
   Matrix3 mat3;
-  mat3 << v0.normalized(),
-         (v0.cross(v1)).normalized(),
-         (v0.cross(v1).cross(v0)).normalized();
+  mat3 << v0.normalized(), (v0.cross(v1)).normalized(), (v0.cross(v1).cross(v0)).normalized();
   VERIFY(mat3.isUnitary());
-  
+
   mat3.setRandom();
-  VERIFY_IS_APPROX(v0.cross(mat3*v1), -(mat3*v1).cross(v0));
+  VERIFY_IS_APPROX(v0.cross(mat3 * v1), -(mat3 * v1).cross(v0));
   VERIFY_IS_APPROX(v0.cross(mat3.lazyProduct(v1)), -(mat3.lazyProduct(v1)).cross(v0));
 
   // colwise/rowwise cross product
   mat3.setRandom();
   Vector3 vec3 = Vector3::Random();
   Matrix3 mcross;
-  int i = internal::random<int>(0,2);
+  int i = internal::random<int>(0, 2);
   mcross = mat3.colwise().cross(vec3);
   VERIFY_IS_APPROX(mcross.col(i), mat3.col(i).cross(vec3));
-  
+
   VERIFY_IS_MUCH_SMALLER_THAN((mat3.adjoint() * mat3.colwise().cross(vec3)).diagonal().cwiseAbs().sum(), Scalar(1));
-  VERIFY_IS_MUCH_SMALLER_THAN((mat3.adjoint() * mat3.colwise().cross(Vector3::Random())).diagonal().cwiseAbs().sum(), Scalar(1));
-  
+  VERIFY_IS_MUCH_SMALLER_THAN((mat3.adjoint() * mat3.colwise().cross(Vector3::Random())).diagonal().cwiseAbs().sum(),
+                              Scalar(1));
+
   VERIFY_IS_MUCH_SMALLER_THAN((vec3.adjoint() * mat3.colwise().cross(vec3)).cwiseAbs().sum(), Scalar(1));
   VERIFY_IS_MUCH_SMALLER_THAN((vec3.adjoint() * Matrix3::Random().colwise().cross(vec3)).cwiseAbs().sum(), Scalar(1));
-  
+
   mcross = mat3.rowwise().cross(vec3);
   VERIFY_IS_APPROX(mcross.row(i), mat3.row(i).cross(vec3));
 
   // cross3
-  Vector4 v40 = Vector4::Random(),
-          v41 = Vector4::Random(),
-          v42 = Vector4::Random();
+  Vector4 v40 = Vector4::Random(), v41 = Vector4::Random(), v42 = Vector4::Random();
   v40.w() = v41.w() = v42.w() = 0;
   v42.template head<3>() = v40.template head<3>().cross(v41.template head<3>());
   VERIFY_IS_APPROX(v40.cross3(v41), v42);
   VERIFY_IS_MUCH_SMALLER_THAN(v40.cross3(Vector4::Random()).dot(v40), Scalar(1));
-  
+
   // check mixed product
   typedef Matrix<RealScalar, 3, 1> RealVector3;
   RealVector3 rv1 = RealVector3::Random();
@@ -78,26 +73,25 @@
   VERIFY_IS_APPROX(v2.cross(v1), rv1.cross(v1));
 }
 
-template<typename Scalar> void orthomethods_2()
-{
+template <typename Scalar>
+void orthomethods_2() {
   typedef typename NumTraits<Scalar>::Real RealScalar;
-  typedef Matrix<Scalar,2,1> Vector2;
-  typedef Matrix<Scalar,3,1> Vector3;
+  typedef Matrix<Scalar, 2, 1> Vector2;
+  typedef Matrix<Scalar, 3, 1> Vector3;
 
-  Vector3 v30 = Vector3::Random(),
-          v31 = Vector3::Random();
+  Vector3 v30 = Vector3::Random(), v31 = Vector3::Random();
   Vector2 v20 = v30.template head<2>();
   Vector2 v21 = v31.template head<2>();
 
   VERIFY_IS_MUCH_SMALLER_THAN(v20.cross(v20), Scalar(1));
   VERIFY_IS_MUCH_SMALLER_THAN(v21.cross(v21), Scalar(1));
   VERIFY_IS_APPROX(v20.cross(v21), v30.cross(v31).z());
-  
+
   Vector2 v20Rot90(numext::conj(-v20.y()), numext::conj(v20.x()));
-  VERIFY_IS_APPROX(v20.cross( v20Rot90),  v20.squaredNorm());
+  VERIFY_IS_APPROX(v20.cross(v20Rot90), v20.squaredNorm());
   VERIFY_IS_APPROX(v20.cross(-v20Rot90), -v20.squaredNorm());
   Vector2 v21Rot90(numext::conj(-v21.y()), numext::conj(v21.x()));
-  VERIFY_IS_APPROX(v21.cross( v21Rot90),  v21.squaredNorm());
+  VERIFY_IS_APPROX(v21.cross(v21Rot90), v21.squaredNorm());
   VERIFY_IS_APPROX(v21.cross(-v21Rot90), -v21.squaredNorm());
 
   // check mixed product
@@ -108,13 +102,13 @@
   VERIFY_IS_APPROX(v21.cross(v20), rv21.cross(v20));
 }
 
-template<typename Scalar, int Size> void orthomethods(int size=Size)
-{
+template <typename Scalar, int Size>
+void orthomethods(int size = Size) {
   typedef typename NumTraits<Scalar>::Real RealScalar;
-  typedef Matrix<Scalar,Size,1> VectorType;
-  typedef Matrix<Scalar,3,Size> Matrix3N;
-  typedef Matrix<Scalar,Size,3> MatrixN3;
-  typedef Matrix<Scalar,3,1> Vector3;
+  typedef Matrix<Scalar, Size, 1> VectorType;
+  typedef Matrix<Scalar, 3, Size> Matrix3N;
+  typedef Matrix<Scalar, Size, 3> MatrixN3;
+  typedef Matrix<Scalar, 3, 1> Vector3;
 
   VectorType v0 = VectorType::Random(size);
 
@@ -122,10 +116,9 @@
   VERIFY_IS_MUCH_SMALLER_THAN(v0.unitOrthogonal().dot(v0), Scalar(1));
   VERIFY_IS_APPROX(v0.unitOrthogonal().norm(), RealScalar(1));
 
-  if (size>=3)
-  {
+  if (size >= 3) {
     v0.template head<2>().setZero();
-    v0.tail(size-2).setRandom();
+    v0.tail(size - 2).setRandom();
 
     VERIFY_IS_MUCH_SMALLER_THAN(v0.unitOrthogonal().dot(v0), Scalar(1));
     VERIFY_IS_APPROX(v0.unitOrthogonal().norm(), RealScalar(1));
@@ -133,35 +126,34 @@
 
   // colwise/rowwise cross product
   Vector3 vec3 = Vector3::Random();
-  int i = internal::random<int>(0,size-1);
+  int i = internal::random<int>(0, size - 1);
 
-  Matrix3N mat3N(3,size), mcross3N(3,size);
+  Matrix3N mat3N(3, size), mcross3N(3, size);
   mat3N.setRandom();
   mcross3N = mat3N.colwise().cross(vec3);
   VERIFY_IS_APPROX(mcross3N.col(i), mat3N.col(i).cross(vec3));
 
-  MatrixN3 matN3(size,3), mcrossN3(size,3);
+  MatrixN3 matN3(size, 3), mcrossN3(size, 3);
   matN3.setRandom();
   mcrossN3 = matN3.rowwise().cross(vec3);
   VERIFY_IS_APPROX(mcrossN3.row(i), matN3.row(i).cross(vec3));
 }
 
-EIGEN_DECLARE_TEST(geo_orthomethods)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( orthomethods_2<float>() );
-    CALL_SUBTEST_2( orthomethods_2<double>() );
-    CALL_SUBTEST_4( orthomethods_2<std::complex<double> >() );
-    CALL_SUBTEST_1( orthomethods_3<float>() );
-    CALL_SUBTEST_2( orthomethods_3<double>() );
-    CALL_SUBTEST_4( orthomethods_3<std::complex<double> >() );
-    CALL_SUBTEST_1( (orthomethods<float,2>()) );
-    CALL_SUBTEST_2( (orthomethods<double,2>()) );
-    CALL_SUBTEST_1( (orthomethods<float,3>()) );
-    CALL_SUBTEST_2( (orthomethods<double,3>()) );
-    CALL_SUBTEST_3( (orthomethods<float,7>()) );
-    CALL_SUBTEST_4( (orthomethods<std::complex<double>,8>()) );
-    CALL_SUBTEST_5( (orthomethods<float,Dynamic>(36)) );
-    CALL_SUBTEST_6( (orthomethods<double,Dynamic>(35)) );
+EIGEN_DECLARE_TEST(geo_orthomethods) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(orthomethods_2<float>());
+    CALL_SUBTEST_2(orthomethods_2<double>());
+    CALL_SUBTEST_4(orthomethods_2<std::complex<double> >());
+    CALL_SUBTEST_1(orthomethods_3<float>());
+    CALL_SUBTEST_2(orthomethods_3<double>());
+    CALL_SUBTEST_4(orthomethods_3<std::complex<double> >());
+    CALL_SUBTEST_1((orthomethods<float, 2>()));
+    CALL_SUBTEST_2((orthomethods<double, 2>()));
+    CALL_SUBTEST_1((orthomethods<float, 3>()));
+    CALL_SUBTEST_2((orthomethods<double, 3>()));
+    CALL_SUBTEST_3((orthomethods<float, 7>()));
+    CALL_SUBTEST_4((orthomethods<std::complex<double>, 8>()));
+    CALL_SUBTEST_5((orthomethods<float, Dynamic>(36)));
+    CALL_SUBTEST_6((orthomethods<double, Dynamic>(35)));
   }
 }
diff --git a/test/geo_parametrizedline.cpp b/test/geo_parametrizedline.cpp
index e4b194a..856261e 100644
--- a/test/geo_parametrizedline.cpp
+++ b/test/geo_parametrizedline.cpp
@@ -13,8 +13,8 @@
 #include <Eigen/LU>
 #include <Eigen/QR>
 
-template<typename LineType> void parametrizedline(const LineType& _line)
-{
+template <typename LineType>
+void parametrizedline(const LineType &_line) {
   /* this test covers the following files:
      ParametrizedLine.h
   */
@@ -23,9 +23,8 @@
   typedef typename LineType::Scalar Scalar;
   typedef typename NumTraits<Scalar>::Real RealScalar;
   typedef Matrix<Scalar, LineType::AmbientDimAtCompileTime, 1> VectorType;
-  typedef Hyperplane<Scalar,LineType::AmbientDimAtCompileTime> HyperplaneType;
-  typedef Matrix<Scalar, HyperplaneType::AmbientDimAtCompileTime,
-                         HyperplaneType::AmbientDimAtCompileTime> MatrixType;
+  typedef Hyperplane<Scalar, LineType::AmbientDimAtCompileTime> HyperplaneType;
+  typedef Matrix<Scalar, HyperplaneType::AmbientDimAtCompileTime, HyperplaneType::AmbientDimAtCompileTime> MatrixType;
 
   VectorType p0 = VectorType::Random(dim);
   VectorType p1 = VectorType::Random(dim);
@@ -37,24 +36,24 @@
   Scalar s0 = internal::random<Scalar>();
   Scalar s1 = abs(internal::random<Scalar>());
 
-  VERIFY_IS_MUCH_SMALLER_THAN( l0.distance(p0), RealScalar(1) );
-  VERIFY_IS_MUCH_SMALLER_THAN( l0.distance(p0+s0*d0), RealScalar(1) );
-  VERIFY_IS_APPROX( (l0.projection(p1)-p1).norm(), l0.distance(p1) );
-  VERIFY_IS_MUCH_SMALLER_THAN( l0.distance(l0.projection(p1)), RealScalar(1) );
-  VERIFY_IS_APPROX( Scalar(l0.distance((p0+s0*d0) + d0.unitOrthogonal() * s1)), s1 );
+  VERIFY_IS_MUCH_SMALLER_THAN(l0.distance(p0), RealScalar(1));
+  VERIFY_IS_MUCH_SMALLER_THAN(l0.distance(p0 + s0 * d0), RealScalar(1));
+  VERIFY_IS_APPROX((l0.projection(p1) - p1).norm(), l0.distance(p1));
+  VERIFY_IS_MUCH_SMALLER_THAN(l0.distance(l0.projection(p1)), RealScalar(1));
+  VERIFY_IS_APPROX(Scalar(l0.distance((p0 + s0 * d0) + d0.unitOrthogonal() * s1)), s1);
 
   // casting
   const int Dim = LineType::AmbientDimAtCompileTime;
   typedef typename GetDifferentType<Scalar>::type OtherScalar;
-  ParametrizedLine<OtherScalar,Dim> hp1f = l0.template cast<OtherScalar>();
-  VERIFY_IS_APPROX(hp1f.template cast<Scalar>(),l0);
-  ParametrizedLine<Scalar,Dim> hp1d = l0.template cast<Scalar>();
-  VERIFY_IS_APPROX(hp1d.template cast<Scalar>(),l0);
+  ParametrizedLine<OtherScalar, Dim> hp1f = l0.template cast<OtherScalar>();
+  VERIFY_IS_APPROX(hp1f.template cast<Scalar>(), l0);
+  ParametrizedLine<Scalar, Dim> hp1d = l0.template cast<Scalar>();
+  VERIFY_IS_APPROX(hp1d.template cast<Scalar>(), l0);
 
   // intersections
   VectorType p2 = VectorType::Random(dim);
   VectorType n2 = VectorType::Random(dim).normalized();
-  HyperplaneType hp(p2,n2);
+  HyperplaneType hp(p2, n2);
   Scalar t = l0.intersectionParameter(hp);
   VectorType pi = l0.pointAt(t);
   VERIFY_IS_MUCH_SMALLER_THAN(hp.signedDistance(pi), RealScalar(1));
@@ -62,45 +61,43 @@
   VERIFY_IS_APPROX(l0.intersectionPoint(hp), pi);
 
   // transform
-  if (!NumTraits<Scalar>::IsComplex)
-  {
-    MatrixType rot = MatrixType::Random(dim,dim).householderQr().householderQ();
-    DiagonalMatrix<Scalar,LineType::AmbientDimAtCompileTime> scaling(VectorType::Random());
-    Translation<Scalar,LineType::AmbientDimAtCompileTime> translation(VectorType::Random());
+  if (!NumTraits<Scalar>::IsComplex) {
+    MatrixType rot = MatrixType::Random(dim, dim).householderQr().householderQ();
+    DiagonalMatrix<Scalar, LineType::AmbientDimAtCompileTime> scaling(VectorType::Random());
+    Translation<Scalar, LineType::AmbientDimAtCompileTime> translation(VectorType::Random());
 
-    while(scaling.diagonal().cwiseAbs().minCoeff()<RealScalar(1e-4)) scaling.diagonal() = VectorType::Random();
+    while (scaling.diagonal().cwiseAbs().minCoeff() < RealScalar(1e-4)) scaling.diagonal() = VectorType::Random();
 
     LineType l1 = l0;
     VectorType p3 = l0.pointAt(Scalar(1));
-    VERIFY_IS_MUCH_SMALLER_THAN( l1.transform(rot).distance(rot * p3), Scalar(1) );
+    VERIFY_IS_MUCH_SMALLER_THAN(l1.transform(rot).distance(rot * p3), Scalar(1));
     l1 = l0;
-    VERIFY_IS_MUCH_SMALLER_THAN( l1.transform(rot,Isometry).distance(rot * p3), Scalar(1) );
+    VERIFY_IS_MUCH_SMALLER_THAN(l1.transform(rot, Isometry).distance(rot * p3), Scalar(1));
     l1 = l0;
-    VERIFY_IS_MUCH_SMALLER_THAN( l1.transform(rot*scaling).distance((rot*scaling) * p3), Scalar(1) );
+    VERIFY_IS_MUCH_SMALLER_THAN(l1.transform(rot * scaling).distance((rot * scaling) * p3), Scalar(1));
     l1 = l0;
-    VERIFY_IS_MUCH_SMALLER_THAN( l1.transform(rot*scaling*translation)
-                                   .distance((rot*scaling*translation) * p3), Scalar(1) );
+    VERIFY_IS_MUCH_SMALLER_THAN(l1.transform(rot * scaling * translation).distance((rot * scaling * translation) * p3),
+                                Scalar(1));
     l1 = l0;
-    VERIFY_IS_MUCH_SMALLER_THAN( l1.transform(rot*translation,Isometry)
-                                   .distance((rot*translation) * p3), Scalar(1) );
+    VERIFY_IS_MUCH_SMALLER_THAN(l1.transform(rot * translation, Isometry).distance((rot * translation) * p3),
+                                Scalar(1));
   }
-
 }
 
-template<typename Scalar> void parametrizedline_alignment()
-{
-  typedef ParametrizedLine<Scalar,4,AutoAlign> Line4a;
-  typedef ParametrizedLine<Scalar,4,DontAlign> Line4u;
+template <typename Scalar>
+void parametrizedline_alignment() {
+  typedef ParametrizedLine<Scalar, 4, AutoAlign> Line4a;
+  typedef ParametrizedLine<Scalar, 4, DontAlign> Line4u;
 
   EIGEN_ALIGN_MAX Scalar array1[16];
   EIGEN_ALIGN_MAX Scalar array2[16];
-  EIGEN_ALIGN_MAX Scalar array3[16+1];
-  Scalar* array3u = array3+1;
+  EIGEN_ALIGN_MAX Scalar array3[16 + 1];
+  Scalar *array3u = array3 + 1;
 
-  Line4a *p1 = ::new(reinterpret_cast<void*>(array1)) Line4a;
-  Line4u *p2 = ::new(reinterpret_cast<void*>(array2)) Line4u;
-  Line4u *p3 = ::new(reinterpret_cast<void*>(array3u)) Line4u;
-  
+  Line4a *p1 = ::new (reinterpret_cast<void *>(array1)) Line4a;
+  Line4u *p2 = ::new (reinterpret_cast<void *>(array2)) Line4u;
+  Line4u *p3 = ::new (reinterpret_cast<void *>(array3u)) Line4u;
+
   p1->origin().setRandom();
   p1->direction().setRandom();
   *p2 = *p1;
@@ -112,14 +109,13 @@
   VERIFY_IS_APPROX(p1->direction(), p3->direction());
 }
 
-EIGEN_DECLARE_TEST(geo_parametrizedline)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( parametrizedline(ParametrizedLine<float,2>()) );
-    CALL_SUBTEST_2( parametrizedline(ParametrizedLine<float,3>()) );
-    CALL_SUBTEST_2( parametrizedline_alignment<float>() );
-    CALL_SUBTEST_3( parametrizedline(ParametrizedLine<double,4>()) );
-    CALL_SUBTEST_3( parametrizedline_alignment<double>() );
-    CALL_SUBTEST_4( parametrizedline(ParametrizedLine<std::complex<double>,5>()) );
+EIGEN_DECLARE_TEST(geo_parametrizedline) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(parametrizedline(ParametrizedLine<float, 2>()));
+    CALL_SUBTEST_2(parametrizedline(ParametrizedLine<float, 3>()));
+    CALL_SUBTEST_2(parametrizedline_alignment<float>());
+    CALL_SUBTEST_3(parametrizedline(ParametrizedLine<double, 4>()));
+    CALL_SUBTEST_3(parametrizedline_alignment<double>());
+    CALL_SUBTEST_4(parametrizedline(ParametrizedLine<std::complex<double>, 5>()));
   }
 }
diff --git a/test/geo_quaternion.cpp b/test/geo_quaternion.cpp
index 2eef40b..b7e4dc5 100644
--- a/test/geo_quaternion.cpp
+++ b/test/geo_quaternion.cpp
@@ -14,66 +14,62 @@
 #include <Eigen/SVD>
 #include "AnnoyingScalar.h"
 
-template<typename T> T bounded_acos(T v)
-{
+template <typename T>
+T bounded_acos(T v) {
   using std::acos;
-  using std::min;
   using std::max;
-  return acos((max)(T(-1),(min)(v,T(1))));
+  using std::min;
+  return acos((max)(T(-1), (min)(v, T(1))));
 }
 
-template<typename QuatType> void check_slerp(const QuatType& q0, const QuatType& q1)
-{
+template <typename QuatType>
+void check_slerp(const QuatType& q0, const QuatType& q1) {
   using std::abs;
   typedef typename QuatType::Scalar Scalar;
   typedef AngleAxis<Scalar> AA;
 
   Scalar largeEps = test_precision<Scalar>();
 
-  Scalar theta_tot = AA(q1*q0.inverse()).angle();
-  if(theta_tot>Scalar(EIGEN_PI))
-    theta_tot = Scalar(2.)*Scalar(EIGEN_PI)-theta_tot;
-  for(Scalar t=0; t<=Scalar(1.001); t+=Scalar(0.1))
-  {
-    QuatType q = q0.slerp(t,q1);
-    Scalar theta = AA(q*q0.inverse()).angle();
+  Scalar theta_tot = AA(q1 * q0.inverse()).angle();
+  if (theta_tot > Scalar(EIGEN_PI)) theta_tot = Scalar(2.) * Scalar(EIGEN_PI) - theta_tot;
+  for (Scalar t = 0; t <= Scalar(1.001); t += Scalar(0.1)) {
+    QuatType q = q0.slerp(t, q1);
+    Scalar theta = AA(q * q0.inverse()).angle();
     VERIFY(abs(q.norm() - 1) < largeEps);
-    if(theta_tot==0)  VERIFY(theta_tot==0);
-    else              VERIFY(abs(theta - t * theta_tot) < largeEps);
+    if (theta_tot == 0)
+      VERIFY(theta_tot == 0);
+    else
+      VERIFY(abs(theta - t * theta_tot) < largeEps);
   }
 }
 
-template<typename Scalar, int Options> void quaternion(void)
-{
+template <typename Scalar, int Options>
+void quaternion(void) {
   /* this test covers the following files:
      Quaternion.h
   */
   using std::abs;
-  typedef Matrix<Scalar,3,1> Vector3;
-  typedef Matrix<Scalar,3,3> Matrix3;
-  typedef Quaternion<Scalar,Options> Quaternionx;
+  typedef Matrix<Scalar, 3, 1> Vector3;
+  typedef Matrix<Scalar, 3, 3> Matrix3;
+  typedef Quaternion<Scalar, Options> Quaternionx;
   typedef AngleAxis<Scalar> AngleAxisx;
 
   Scalar largeEps = test_precision<Scalar>();
-  if (internal::is_same<Scalar,float>::value)
-    largeEps = Scalar(1e-3);
+  if (internal::is_same<Scalar, float>::value) largeEps = Scalar(1e-3);
 
   Scalar eps = internal::random<Scalar>() * Scalar(1e-2);
 
-  Vector3 v0 = Vector3::Random(),
-          v1 = Vector3::Random(),
-          v2 = Vector3::Random(),
-          v3 = Vector3::Random();
+  Vector3 v0 = Vector3::Random(), v1 = Vector3::Random(), v2 = Vector3::Random(), v3 = Vector3::Random();
 
-  Scalar  a = internal::random<Scalar>(-Scalar(EIGEN_PI), Scalar(EIGEN_PI)),
-          b = internal::random<Scalar>(-Scalar(EIGEN_PI), Scalar(EIGEN_PI));
+  Scalar a = internal::random<Scalar>(-Scalar(EIGEN_PI), Scalar(EIGEN_PI)),
+         b = internal::random<Scalar>(-Scalar(EIGEN_PI), Scalar(EIGEN_PI));
 
   // Quaternion: Identity(), setIdentity();
   Quaternionx q1, q2;
   q2.setIdentity();
   VERIFY_IS_APPROX(Quaternionx(Quaternionx::Identity()).coeffs(), q2.coeffs());
   q1.coeffs().setRandom();
-  VERIFY_IS_APPROX(q1.coeffs(), (q1*q2).coeffs());
+  VERIFY_IS_APPROX(q1.coeffs(), (q1 * q2).coeffs());
 
 #ifndef EIGEN_NO_IO
   // Printing
@@ -89,12 +85,10 @@
   q2 = AngleAxisx(a, v1.normalized());
 
   // angular distance
-  Scalar refangle = abs(AngleAxisx(q1.inverse()*q2).angle());
-  if (refangle>Scalar(EIGEN_PI))
-    refangle = Scalar(2)*Scalar(EIGEN_PI) - refangle;
+  Scalar refangle = abs(AngleAxisx(q1.inverse() * q2).angle());
+  if (refangle > Scalar(EIGEN_PI)) refangle = Scalar(2) * Scalar(EIGEN_PI) - refangle;
 
-  if((q1.coeffs()-q2.coeffs()).norm() > Scalar(10)*largeEps)
-  {
+  if ((q1.coeffs() - q2.coeffs()).norm() > Scalar(10) * largeEps) {
     VERIFY_IS_MUCH_SMALLER_THAN(abs(q1.angularDistance(q2) - refangle), Scalar(1));
   }
 
@@ -104,20 +98,18 @@
 
   // rotation matrix conversion
   VERIFY_IS_APPROX(q1 * v2, q1.toRotationMatrix() * v2);
-  VERIFY_IS_APPROX(q1 * q2 * v2,
-    q1.toRotationMatrix() * q2.toRotationMatrix() * v2);
+  VERIFY_IS_APPROX(q1 * q2 * v2, q1.toRotationMatrix() * q2.toRotationMatrix() * v2);
 
-  VERIFY(  (q2*q1).isApprox(q1*q2, largeEps)
-        || !(q2 * q1 * v2).isApprox(q1.toRotationMatrix() * q2.toRotationMatrix() * v2));
+  VERIFY((q2 * q1).isApprox(q1 * q2, largeEps) ||
+         !(q2 * q1 * v2).isApprox(q1.toRotationMatrix() * q2.toRotationMatrix() * v2));
 
   q2 = q1.toRotationMatrix();
-  VERIFY_IS_APPROX(q1*v1,q2*v1);
+  VERIFY_IS_APPROX(q1 * v1, q2 * v1);
 
   Matrix3 rot1(q1);
-  VERIFY_IS_APPROX(q1*v1,rot1*v1);
-  Quaternionx q3(rot1.transpose()*rot1);
-  VERIFY_IS_APPROX(q3*v1,v1);
-
+  VERIFY_IS_APPROX(q1 * v1, rot1 * v1);
+  Quaternionx q3(rot1.transpose() * rot1);
+  VERIFY_IS_APPROX(q3 * v1, v1);
 
   // angle-axis conversion
   AngleAxisx aa = AngleAxisx(q1);
@@ -125,33 +117,29 @@
 
   // Do not execute the test if the rotation angle is almost zero, or
   // the rotation axis and v1 are almost parallel.
-  if (abs(aa.angle()) > Scalar(5)*test_precision<Scalar>()
-      && (aa.axis() - v1.normalized()).norm() < Scalar(1.99)
-      && (aa.axis() + v1.normalized()).norm() < Scalar(1.99))
-  {
-    VERIFY_IS_NOT_APPROX(q1 * v1, Quaternionx(AngleAxisx(aa.angle()*2,aa.axis())) * v1);
+  if (abs(aa.angle()) > Scalar(5) * test_precision<Scalar>() && (aa.axis() - v1.normalized()).norm() < Scalar(1.99) &&
+      (aa.axis() + v1.normalized()).norm() < Scalar(1.99)) {
+    VERIFY_IS_NOT_APPROX(q1 * v1, Quaternionx(AngleAxisx(aa.angle() * 2, aa.axis())) * v1);
   }
 
   // from two vector creation
-  VERIFY_IS_APPROX( v2.normalized(),(q2.setFromTwoVectors(v1, v2)*v1).normalized());
-  VERIFY_IS_APPROX( v1.normalized(),(q2.setFromTwoVectors(v1, v1)*v1).normalized());
-  VERIFY_IS_APPROX(-v1.normalized(),(q2.setFromTwoVectors(v1,-v1)*v1).normalized());
-  if (internal::is_same<Scalar,double>::value)
-  {
-    v3 = (v1.array()+eps).matrix();
-    VERIFY_IS_APPROX( v3.normalized(),(q2.setFromTwoVectors(v1, v3)*v1).normalized());
-    VERIFY_IS_APPROX(-v3.normalized(),(q2.setFromTwoVectors(v1,-v3)*v1).normalized());
+  VERIFY_IS_APPROX(v2.normalized(), (q2.setFromTwoVectors(v1, v2) * v1).normalized());
+  VERIFY_IS_APPROX(v1.normalized(), (q2.setFromTwoVectors(v1, v1) * v1).normalized());
+  VERIFY_IS_APPROX(-v1.normalized(), (q2.setFromTwoVectors(v1, -v1) * v1).normalized());
+  if (internal::is_same<Scalar, double>::value) {
+    v3 = (v1.array() + eps).matrix();
+    VERIFY_IS_APPROX(v3.normalized(), (q2.setFromTwoVectors(v1, v3) * v1).normalized());
+    VERIFY_IS_APPROX(-v3.normalized(), (q2.setFromTwoVectors(v1, -v3) * v1).normalized());
   }
 
   // from two vector creation static function
-  VERIFY_IS_APPROX( v2.normalized(),(Quaternionx::FromTwoVectors(v1, v2)*v1).normalized());
-  VERIFY_IS_APPROX( v1.normalized(),(Quaternionx::FromTwoVectors(v1, v1)*v1).normalized());
-  VERIFY_IS_APPROX(-v1.normalized(),(Quaternionx::FromTwoVectors(v1,-v1)*v1).normalized());
-  if (internal::is_same<Scalar,double>::value)
-  {
-    v3 = (v1.array()+eps).matrix();
-    VERIFY_IS_APPROX( v3.normalized(),(Quaternionx::FromTwoVectors(v1, v3)*v1).normalized());
-    VERIFY_IS_APPROX(-v3.normalized(),(Quaternionx::FromTwoVectors(v1,-v3)*v1).normalized());
+  VERIFY_IS_APPROX(v2.normalized(), (Quaternionx::FromTwoVectors(v1, v2) * v1).normalized());
+  VERIFY_IS_APPROX(v1.normalized(), (Quaternionx::FromTwoVectors(v1, v1) * v1).normalized());
+  VERIFY_IS_APPROX(-v1.normalized(), (Quaternionx::FromTwoVectors(v1, -v1) * v1).normalized());
+  if (internal::is_same<Scalar, double>::value) {
+    v3 = (v1.array() + eps).matrix();
+    VERIFY_IS_APPROX(v3.normalized(), (Quaternionx::FromTwoVectors(v1, v3) * v1).normalized());
+    VERIFY_IS_APPROX(-v3.normalized(), (Quaternionx::FromTwoVectors(v1, -v3) * v1).normalized());
   }
 
   // inverse and conjugate
@@ -160,56 +148,56 @@
 
   // test casting
   Quaternion<float> q1f = q1.template cast<float>();
-  VERIFY_IS_APPROX(q1f.template cast<Scalar>(),q1);
+  VERIFY_IS_APPROX(q1f.template cast<Scalar>(), q1);
   Quaternion<double> q1d = q1.template cast<double>();
-  VERIFY_IS_APPROX(q1d.template cast<Scalar>(),q1);
+  VERIFY_IS_APPROX(q1d.template cast<Scalar>(), q1);
 
   // test bug 369 - improper alignment.
-  Quaternionx *q = new Quaternionx;
+  Quaternionx* q = new Quaternionx;
   delete q;
 
   q1 = Quaternionx::UnitRandom();
   q2 = Quaternionx::UnitRandom();
-  check_slerp(q1,q2);
+  check_slerp(q1, q2);
 
   q1 = AngleAxisx(b, v1.normalized());
-  q2 = AngleAxisx(b+Scalar(EIGEN_PI), v1.normalized());
-  check_slerp(q1,q2);
+  q2 = AngleAxisx(b + Scalar(EIGEN_PI), v1.normalized());
+  check_slerp(q1, q2);
 
-  q1 = AngleAxisx(b,  v1.normalized());
+  q1 = AngleAxisx(b, v1.normalized());
   q2 = AngleAxisx(-b, -v1.normalized());
-  check_slerp(q1,q2);
+  check_slerp(q1, q2);
 
   q1 = Quaternionx::UnitRandom();
   q2.coeffs() = -q1.coeffs();
-  check_slerp(q1,q2);
+  check_slerp(q1, q2);
 }
 
-template<typename Scalar> void mapQuaternion(void){
+template <typename Scalar>
+void mapQuaternion(void) {
   typedef Map<Quaternion<Scalar>, Aligned> MQuaternionA;
   typedef Map<const Quaternion<Scalar>, Aligned> MCQuaternionA;
   typedef Map<Quaternion<Scalar> > MQuaternionUA;
   typedef Map<const Quaternion<Scalar> > MCQuaternionUA;
   typedef Quaternion<Scalar> Quaternionx;
-  typedef Matrix<Scalar,3,1> Vector3;
+  typedef Matrix<Scalar, 3, 1> Vector3;
   typedef AngleAxis<Scalar> AngleAxisx;
-  
-  Vector3 v0 = Vector3::Random(),
-          v1 = Vector3::Random();
-  Scalar  a = internal::random<Scalar>(-Scalar(EIGEN_PI), Scalar(EIGEN_PI));
+
+  Vector3 v0 = Vector3::Random(), v1 = Vector3::Random();
+  Scalar a = internal::random<Scalar>(-Scalar(EIGEN_PI), Scalar(EIGEN_PI));
 
   EIGEN_ALIGN_MAX Scalar array1[4];
   EIGEN_ALIGN_MAX Scalar array2[4];
-  EIGEN_ALIGN_MAX Scalar array3[4+1];
-  Scalar* array3unaligned = array3+1;
-  
-  MQuaternionA    mq1(array1);
-  MCQuaternionA   mcq1(array1);
-  MQuaternionA    mq2(array2);
-  MQuaternionUA   mq3(array3unaligned);
-  MCQuaternionUA  mcq3(array3unaligned);
+  EIGEN_ALIGN_MAX Scalar array3[4 + 1];
+  Scalar* array3unaligned = array3 + 1;
 
-//  std::cerr << array1 << " " << array2 << " " << array3 << "\n";
+  MQuaternionA mq1(array1);
+  MCQuaternionA mcq1(array1);
+  MQuaternionA mq2(array2);
+  MQuaternionUA mq3(array3unaligned);
+  MCQuaternionUA mcq3(array3unaligned);
+
+  //  std::cerr << array1 << " " << array2 << " " << array3 << "\n";
   mq1 = AngleAxisx(a, v0.normalized());
   mq2 = mq1;
   mq3 = mq1;
@@ -222,58 +210,59 @@
   VERIFY_IS_APPROX(q1.coeffs(), q2.coeffs());
   VERIFY_IS_APPROX(q1.coeffs(), q3.coeffs());
   VERIFY_IS_APPROX(q4.coeffs(), q3.coeffs());
-    
+
   VERIFY_IS_APPROX(mq1 * (mq1.inverse() * v1), v1);
   VERIFY_IS_APPROX(mq1 * (mq1.conjugate() * v1), v1);
-  
+
   VERIFY_IS_APPROX(mcq1 * (mcq1.inverse() * v1), v1);
   VERIFY_IS_APPROX(mcq1 * (mcq1.conjugate() * v1), v1);
-  
+
   VERIFY_IS_APPROX(mq3 * (mq3.inverse() * v1), v1);
   VERIFY_IS_APPROX(mq3 * (mq3.conjugate() * v1), v1);
-  
+
   VERIFY_IS_APPROX(mcq3 * (mcq3.inverse() * v1), v1);
   VERIFY_IS_APPROX(mcq3 * (mcq3.conjugate() * v1), v1);
-  
-  VERIFY_IS_APPROX(mq1*mq2, q1*q2);
-  VERIFY_IS_APPROX(mq3*mq2, q3*q2);
-  VERIFY_IS_APPROX(mcq1*mq2, q1*q2);
-  VERIFY_IS_APPROX(mcq3*mq2, q3*q2);
+
+  VERIFY_IS_APPROX(mq1 * mq2, q1 * q2);
+  VERIFY_IS_APPROX(mq3 * mq2, q3 * q2);
+  VERIFY_IS_APPROX(mcq1 * mq2, q1 * q2);
+  VERIFY_IS_APPROX(mcq3 * mq2, q3 * q2);
 
   // Bug 1461, compilation issue with Map<const Quat>::w(), and other reference/constness checks:
   VERIFY_IS_APPROX(mcq3.coeffs().x() + mcq3.coeffs().y() + mcq3.coeffs().z() + mcq3.coeffs().w(), mcq3.coeffs().sum());
   VERIFY_IS_APPROX(mcq3.x() + mcq3.y() + mcq3.z() + mcq3.w(), mcq3.coeffs().sum());
   mq3.w() = 1;
   const Quaternionx& cq3(q3);
-  VERIFY( &cq3.x() == &q3.x() );
+  VERIFY(&cq3.x() == &q3.x());
   const MQuaternionUA& cmq3(mq3);
-  VERIFY( &cmq3.x() == &mq3.x() );
+  VERIFY(&cmq3.x() == &mq3.x());
   // FIXME the following should be ok. The problem is that currently the LValueBit flag
   // is used to determine whether we can return a coeff by reference or not, which is not enough for Map<const ...>.
-  //const MCQuaternionUA& cmcq3(mcq3);
-  //VERIFY( &cmcq3.x() == &mcq3.x() );
+  // const MCQuaternionUA& cmcq3(mcq3);
+  // VERIFY( &cmcq3.x() == &mcq3.x() );
 
   // test cast
   {
     Quaternion<float> q1f = mq1.template cast<float>();
-    VERIFY_IS_APPROX(q1f.template cast<Scalar>(),mq1);
+    VERIFY_IS_APPROX(q1f.template cast<Scalar>(), mq1);
     Quaternion<double> q1d = mq1.template cast<double>();
-    VERIFY_IS_APPROX(q1d.template cast<Scalar>(),mq1);
+    VERIFY_IS_APPROX(q1d.template cast<Scalar>(), mq1);
   }
 }
 
-template<typename Scalar> void quaternionAlignment(void){
-  typedef Quaternion<Scalar,AutoAlign> QuaternionA;
-  typedef Quaternion<Scalar,DontAlign> QuaternionUA;
+template <typename Scalar>
+void quaternionAlignment(void) {
+  typedef Quaternion<Scalar, AutoAlign> QuaternionA;
+  typedef Quaternion<Scalar, DontAlign> QuaternionUA;
 
   EIGEN_ALIGN_MAX Scalar array1[4];
   EIGEN_ALIGN_MAX Scalar array2[4];
-  EIGEN_ALIGN_MAX Scalar array3[4+1];
-  Scalar* arrayunaligned = array3+1;
+  EIGEN_ALIGN_MAX Scalar array3[4 + 1];
+  Scalar* arrayunaligned = array3 + 1;
 
-  QuaternionA *q1 = ::new(reinterpret_cast<void*>(array1)) QuaternionA;
-  QuaternionUA *q2 = ::new(reinterpret_cast<void*>(array2)) QuaternionUA;
-  QuaternionUA *q3 = ::new(reinterpret_cast<void*>(arrayunaligned)) QuaternionUA;
+  QuaternionA* q1 = ::new (reinterpret_cast<void*>(array1)) QuaternionA;
+  QuaternionUA* q2 = ::new (reinterpret_cast<void*>(array2)) QuaternionUA;
+  QuaternionUA* q3 = ::new (reinterpret_cast<void*>(arrayunaligned)) QuaternionUA;
 
   q1->coeffs().setRandom();
   *q2 = *q1;
@@ -283,24 +272,24 @@
   VERIFY_IS_APPROX(q1->coeffs(), q3->coeffs());
 }
 
-template<typename PlainObjectType> void check_const_correctness(const PlainObjectType&)
-{
+template <typename PlainObjectType>
+void check_const_correctness(const PlainObjectType&) {
   // there's a lot that we can't test here while still having this test compile!
   // the only possible approach would be to run a script trying to compile stuff and checking that it fails.
   // CMake can help with that.
 
   // verify that map-to-const don't have LvalueBit
   typedef std::add_const_t<PlainObjectType> ConstPlainObjectType;
-  VERIFY( !(internal::traits<Map<ConstPlainObjectType> >::Flags & LvalueBit) );
-  VERIFY( !(internal::traits<Map<ConstPlainObjectType, Aligned> >::Flags & LvalueBit) );
-  VERIFY( !(Map<ConstPlainObjectType>::Flags & LvalueBit) );
-  VERIFY( !(Map<ConstPlainObjectType, Aligned>::Flags & LvalueBit) );
+  VERIFY(!(internal::traits<Map<ConstPlainObjectType> >::Flags & LvalueBit));
+  VERIFY(!(internal::traits<Map<ConstPlainObjectType, Aligned> >::Flags & LvalueBit));
+  VERIFY(!(Map<ConstPlainObjectType>::Flags & LvalueBit));
+  VERIFY(!(Map<ConstPlainObjectType, Aligned>::Flags & LvalueBit));
 }
 
 // Regression for bug 1573
 struct MovableClass {
   // The following line is a workaround for gcc 4.7 and 4.8 (see bug 1573 comments).
-  static_assert(std::is_nothrow_move_constructible<Quaternionf>::value,"");
+  static_assert(std::is_nothrow_move_constructible<Quaternionf>::value, "");
   MovableClass() = default;
   MovableClass(const MovableClass&) = default;
   MovableClass(MovableClass&&) noexcept = default;
@@ -309,24 +298,23 @@
   Quaternionf m_quat;
 };
 
-EIGEN_DECLARE_TEST(geo_quaternion)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1(( quaternion<float,AutoAlign>() ));
-    CALL_SUBTEST_1( check_const_correctness(Quaternionf()) );
-    CALL_SUBTEST_1(( quaternion<float,DontAlign>() ));
-    CALL_SUBTEST_1(( quaternionAlignment<float>() ));
-    CALL_SUBTEST_1( mapQuaternion<float>() );
+EIGEN_DECLARE_TEST(geo_quaternion) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1((quaternion<float, AutoAlign>()));
+    CALL_SUBTEST_1(check_const_correctness(Quaternionf()));
+    CALL_SUBTEST_1((quaternion<float, DontAlign>()));
+    CALL_SUBTEST_1((quaternionAlignment<float>()));
+    CALL_SUBTEST_1(mapQuaternion<float>());
 
-    CALL_SUBTEST_2(( quaternion<double,AutoAlign>() ));
-    CALL_SUBTEST_2( check_const_correctness(Quaterniond()) );
-    CALL_SUBTEST_2(( quaternion<double,DontAlign>() ));
-    CALL_SUBTEST_2(( quaternionAlignment<double>() ));
-    CALL_SUBTEST_2( mapQuaternion<double>() );
+    CALL_SUBTEST_2((quaternion<double, AutoAlign>()));
+    CALL_SUBTEST_2(check_const_correctness(Quaterniond()));
+    CALL_SUBTEST_2((quaternion<double, DontAlign>()));
+    CALL_SUBTEST_2((quaternionAlignment<double>()));
+    CALL_SUBTEST_2(mapQuaternion<double>());
 
 #ifndef EIGEN_TEST_ANNOYING_SCALAR_DONT_THROW
     AnnoyingScalar::dont_throw = true;
 #endif
-    CALL_SUBTEST_3(( quaternion<AnnoyingScalar,AutoAlign>() ));
+    CALL_SUBTEST_3((quaternion<AnnoyingScalar, AutoAlign>()));
   }
 }
diff --git a/test/geo_transformations.cpp b/test/geo_transformations.cpp
index 72c6eda..2fddf55 100644
--- a/test/geo_transformations.cpp
+++ b/test/geo_transformations.cpp
@@ -12,31 +12,31 @@
 #include <Eigen/LU>
 #include <Eigen/SVD>
 
-template<typename T>
-Matrix<T,2,1> angleToVec(T a)
-{
-  return Matrix<T,2,1>(std::cos(a), std::sin(a));
+template <typename T>
+Matrix<T, 2, 1> angleToVec(T a) {
+  return Matrix<T, 2, 1>(std::cos(a), std::sin(a));
 }
 
 // This permits to workaround a bug in clang/llvm code generation.
-template<typename T>
-EIGEN_DONT_INLINE
-void dont_over_optimize(T& x) { volatile typename T::Scalar tmp = x(0); x(0) = tmp; }
+template <typename T>
+EIGEN_DONT_INLINE void dont_over_optimize(T& x) {
+  volatile typename T::Scalar tmp = x(0);
+  x(0) = tmp;
+}
 
-template<typename Scalar, int Mode, int Options> void non_projective_only()
-{
-    /* this test covers the following files:
-     Cross.h Quaternion.h, Transform.cpp
-  */
-  typedef Matrix<Scalar,3,1> Vector3;
+template <typename Scalar, int Mode, int Options>
+void non_projective_only() {
+  /* this test covers the following files:
+   Cross.h Quaternion.h, Transform.cpp
+*/
+  typedef Matrix<Scalar, 3, 1> Vector3;
   typedef Quaternion<Scalar> Quaternionx;
   typedef AngleAxis<Scalar> AngleAxisx;
-  typedef Transform<Scalar,3,Mode,Options> Transform3;
-  typedef DiagonalMatrix<Scalar,3> AlignedScaling3;
-  typedef Translation<Scalar,3> Translation3;
+  typedef Transform<Scalar, 3, Mode, Options> Transform3;
+  typedef DiagonalMatrix<Scalar, 3> AlignedScaling3;
+  typedef Translation<Scalar, 3> Translation3;
 
-  Vector3 v0 = Vector3::Random(),
-          v1 = Vector3::Random();
+  Vector3 v0 = Vector3::Random(), v1 = Vector3::Random();
 
   Transform3 t0, t1, t2;
 
@@ -54,7 +54,7 @@
   v0 << 50, 2, 1;
   t0.scale(v0);
 
-  VERIFY_IS_APPROX( (t0 * Vector3(1,0,0)).template head<3>().norm(), v0.x());
+  VERIFY_IS_APPROX((t0 * Vector3(1, 0, 0)).template head<3>().norm(), v0.x());
 
   t0.setIdentity();
   t1.setIdentity();
@@ -70,7 +70,7 @@
 
   t1.fromPositionOrientationScale(v0, q1, v1);
   VERIFY_IS_APPROX(t1.matrix(), t0.matrix());
-  VERIFY_IS_APPROX(t1*v1, t0*v1);
+  VERIFY_IS_APPROX(t1 * v1, t0 * v1);
 
   // translation * vector
   t0.setIdentity();
@@ -83,42 +83,40 @@
   VERIFY_IS_APPROX((t0 * v1).template head<3>(), AlignedScaling3(v0) * v1);
 }
 
-template<typename Scalar, int Mode, int Options> void transformations()
-{
+template <typename Scalar, int Mode, int Options>
+void transformations() {
   /* this test covers the following files:
      Cross.h Quaternion.h, Transform.cpp
   */
-  using std::cos;
   using std::abs;
-  typedef Matrix<Scalar,3,3> Matrix3;
-  typedef Matrix<Scalar,4,4> Matrix4;
-  typedef Matrix<Scalar,2,1> Vector2;
-  typedef Matrix<Scalar,3,1> Vector3;
-  typedef Matrix<Scalar,4,1> Vector4;
+  using std::cos;
+  typedef Matrix<Scalar, 3, 3> Matrix3;
+  typedef Matrix<Scalar, 4, 4> Matrix4;
+  typedef Matrix<Scalar, 2, 1> Vector2;
+  typedef Matrix<Scalar, 3, 1> Vector3;
+  typedef Matrix<Scalar, 4, 1> Vector4;
   typedef Quaternion<Scalar> Quaternionx;
   typedef AngleAxis<Scalar> AngleAxisx;
-  typedef Transform<Scalar,2,Mode,Options> Transform2;
-  typedef Transform<Scalar,3,Mode,Options> Transform3;
+  typedef Transform<Scalar, 2, Mode, Options> Transform2;
+  typedef Transform<Scalar, 3, Mode, Options> Transform3;
   typedef typename Transform3::MatrixType MatrixType;
-  typedef DiagonalMatrix<Scalar,3> AlignedScaling3;
-  typedef Translation<Scalar,2> Translation2;
-  typedef Translation<Scalar,3> Translation3;
+  typedef DiagonalMatrix<Scalar, 3> AlignedScaling3;
+  typedef Translation<Scalar, 2> Translation2;
+  typedef Translation<Scalar, 3> Translation3;
 
-  Vector3 v0 = Vector3::Random(),
-          v1 = Vector3::Random();
+  Vector3 v0 = Vector3::Random(), v1 = Vector3::Random();
   Matrix3 matrot1, m;
 
   Scalar a = internal::random<Scalar>(-Scalar(EIGEN_PI), Scalar(EIGEN_PI));
   Scalar s0 = internal::random<Scalar>(), s1 = internal::random<Scalar>();
-  
-  while(v0.norm() < test_precision<Scalar>()) v0 = Vector3::Random();
-  while(v1.norm() < test_precision<Scalar>()) v1 = Vector3::Random();
+
+  while (v0.norm() < test_precision<Scalar>()) v0 = Vector3::Random();
+  while (v1.norm() < test_precision<Scalar>()) v1 = Vector3::Random();
 
   VERIFY_IS_APPROX(v0, AngleAxisx(a, v0.normalized()) * v0);
   VERIFY_IS_APPROX(-v0, AngleAxisx(Scalar(EIGEN_PI), v0.unitOrthogonal()) * v0);
-  if(abs(cos(a)) > test_precision<Scalar>())
-  {
-    VERIFY_IS_APPROX(cos(a)*v0.squaredNorm(), v0.dot(AngleAxisx(a, v0.unitOrthogonal()) * v0));
+  if (abs(cos(a)) > test_precision<Scalar>()) {
+    VERIFY_IS_APPROX(cos(a) * v0.squaredNorm(), v0.dot(AngleAxisx(a, v0.unitOrthogonal()) * v0));
   }
   m = AngleAxisx(a, v0.normalized()).toRotationMatrix().adjoint();
   VERIFY_IS_APPROX(Matrix3::Identity(), m * AngleAxisx(a, v0.normalized()));
@@ -129,47 +127,44 @@
   q2 = AngleAxisx(a, v1.normalized());
 
   // rotation matrix conversion
-  matrot1 = AngleAxisx(Scalar(0.1), Vector3::UnitX())
-          * AngleAxisx(Scalar(0.2), Vector3::UnitY())
-          * AngleAxisx(Scalar(0.3), Vector3::UnitZ());
-  VERIFY_IS_APPROX(matrot1 * v1,
-       AngleAxisx(Scalar(0.1), Vector3(1,0,0)).toRotationMatrix()
-    * (AngleAxisx(Scalar(0.2), Vector3(0,1,0)).toRotationMatrix()
-    * (AngleAxisx(Scalar(0.3), Vector3(0,0,1)).toRotationMatrix() * v1)));
+  matrot1 = AngleAxisx(Scalar(0.1), Vector3::UnitX()) * AngleAxisx(Scalar(0.2), Vector3::UnitY()) *
+            AngleAxisx(Scalar(0.3), Vector3::UnitZ());
+  VERIFY_IS_APPROX(matrot1 * v1, AngleAxisx(Scalar(0.1), Vector3(1, 0, 0)).toRotationMatrix() *
+                                     (AngleAxisx(Scalar(0.2), Vector3(0, 1, 0)).toRotationMatrix() *
+                                      (AngleAxisx(Scalar(0.3), Vector3(0, 0, 1)).toRotationMatrix() * v1)));
 
   // angle-axis conversion
   AngleAxisx aa = AngleAxisx(q1);
   VERIFY_IS_APPROX(q1 * v1, Quaternionx(aa) * v1);
-  
+
   // The following test is stable only if 2*angle != angle and v1 is not colinear with axis
-  if( (abs(aa.angle()) > test_precision<Scalar>()) && (abs(aa.axis().dot(v1.normalized()))<(Scalar(1)-Scalar(4)*test_precision<Scalar>())) )
-  {
-    VERIFY( !(q1 * v1).isApprox(Quaternionx(AngleAxisx(aa.angle()*2,aa.axis())) * v1) );
+  if ((abs(aa.angle()) > test_precision<Scalar>()) &&
+      (abs(aa.axis().dot(v1.normalized())) < (Scalar(1) - Scalar(4) * test_precision<Scalar>()))) {
+    VERIFY(!(q1 * v1).isApprox(Quaternionx(AngleAxisx(aa.angle() * 2, aa.axis())) * v1));
   }
 
   aa.fromRotationMatrix(aa.toRotationMatrix());
   VERIFY_IS_APPROX(q1 * v1, Quaternionx(aa) * v1);
   // The following test is stable only if 2*angle != angle and v1 is not colinear with axis
-  if( (abs(aa.angle()) > test_precision<Scalar>()) && (abs(aa.axis().dot(v1.normalized()))<(Scalar(1)-Scalar(4)*test_precision<Scalar>())) )
-  {
-    VERIFY( !(q1 * v1).isApprox(Quaternionx(AngleAxisx(aa.angle()*2,aa.axis())) * v1) );
+  if ((abs(aa.angle()) > test_precision<Scalar>()) &&
+      (abs(aa.axis().dot(v1.normalized())) < (Scalar(1) - Scalar(4) * test_precision<Scalar>()))) {
+    VERIFY(!(q1 * v1).isApprox(Quaternionx(AngleAxisx(aa.angle() * 2, aa.axis())) * v1));
   }
 
   // AngleAxis
-  VERIFY_IS_APPROX(AngleAxisx(a,v1.normalized()).toRotationMatrix(),
-    Quaternionx(AngleAxisx(a,v1.normalized())).toRotationMatrix());
+  VERIFY_IS_APPROX(AngleAxisx(a, v1.normalized()).toRotationMatrix(),
+                   Quaternionx(AngleAxisx(a, v1.normalized())).toRotationMatrix());
 
   AngleAxisx aa1;
   m = q1.toRotationMatrix();
   aa1 = m;
-  VERIFY_IS_APPROX(AngleAxisx(m).toRotationMatrix(),
-    Quaternionx(m).toRotationMatrix());
+  VERIFY_IS_APPROX(AngleAxisx(m).toRotationMatrix(), Quaternionx(m).toRotationMatrix());
 
   // Transform
   // TODO complete the tests !
   a = 0;
-  while (abs(a)<Scalar(0.1))
-    a = internal::random<Scalar>(-Scalar(0.4)*Scalar(EIGEN_PI), Scalar(0.4)*Scalar(EIGEN_PI));
+  while (abs(a) < Scalar(0.1))
+    a = internal::random<Scalar>(-Scalar(0.4) * Scalar(EIGEN_PI), Scalar(0.4) * Scalar(EIGEN_PI));
   q1 = AngleAxisx(a, v0.normalized());
   Transform3 t0, t1, t2;
 
@@ -195,11 +190,14 @@
   t1.fromPositionOrientationScale(v0, q1, v1);
   VERIFY_IS_APPROX(t1.matrix(), t0.matrix());
 
-  t0.setIdentity(); t0.scale(v0).rotate(q1.toRotationMatrix());
-  t1.setIdentity(); t1.scale(v0).rotate(q1);
+  t0.setIdentity();
+  t0.scale(v0).rotate(q1.toRotationMatrix());
+  t1.setIdentity();
+  t1.scale(v0).rotate(q1);
   VERIFY_IS_APPROX(t0.matrix(), t1.matrix());
 
-  t0.setIdentity(); t0.scale(v0).rotate(AngleAxisx(q1));
+  t0.setIdentity();
+  t0.scale(v0).rotate(AngleAxisx(q1));
   VERIFY_IS_APPROX(t0.matrix(), t1.matrix());
 
   VERIFY_IS_APPROX(t0.scale(a).matrix(), t1.scale(Vector3::Constant(a)).matrix());
@@ -209,10 +207,9 @@
 
   Matrix3 mat3 = Matrix3::Random();
   Matrix4 mat4;
-  mat4 << mat3 , Vector3::Zero() , Vector4::Zero().transpose();
+  mat4 << mat3, Vector3::Zero(), Vector4::Zero().transpose();
   Transform3 tmat3(mat3), tmat4(mat4);
-  if(Mode!=int(AffineCompact))
-    tmat4.matrix()(3,3) = Scalar(1);
+  if (Mode != int(AffineCompact)) tmat4.matrix()(3, 3) = Scalar(1);
   VERIFY_IS_APPROX(tmat3.matrix(), tmat4.matrix());
 
   Scalar a3 = internal::random<Scalar>(-Scalar(EIGEN_PI), Scalar(EIGEN_PI));
@@ -222,7 +219,7 @@
   Transform3 t4;
   t4 = aa3;
   VERIFY_IS_APPROX(t3.matrix(), t4.matrix());
-  t4.rotate(AngleAxisx(-a3,v3));
+  t4.rotate(AngleAxisx(-a3, v3));
   VERIFY_IS_APPROX(t4.matrix(), MatrixType::Identity());
   t4 *= aa3;
   VERIFY_IS_APPROX(t3.matrix(), t4.matrix());
@@ -230,7 +227,7 @@
   do {
     v3 = Vector3::Random();
     dont_over_optimize(v3);
-  } while (v3.cwiseAbs().minCoeff()<NumTraits<Scalar>::epsilon());
+  } while (v3.cwiseAbs().minCoeff() < NumTraits<Scalar>::epsilon());
   Translation3 tv3(v3);
   Transform3 t5(tv3);
   t4 = tv3;
@@ -250,31 +247,31 @@
   VERIFY_IS_APPROX(t6.matrix(), t4.matrix());
 
   // matrix * transform
-  VERIFY_IS_APPROX((t3.matrix()*t4).matrix(), (t3*t4).matrix());
+  VERIFY_IS_APPROX((t3.matrix() * t4).matrix(), (t3 * t4).matrix());
 
   // chained Transform product
-  VERIFY_IS_APPROX(((t3*t4)*t5).matrix(), (t3*(t4*t5)).matrix());
+  VERIFY_IS_APPROX(((t3 * t4) * t5).matrix(), (t3 * (t4 * t5)).matrix());
 
   // check that Transform product doesn't have aliasing problems
   t5 = t4;
-  t5 = t5*t5;
-  VERIFY_IS_APPROX(t5, t4*t4);
+  t5 = t5 * t5;
+  VERIFY_IS_APPROX(t5, t4 * t4);
 
   // 2D transformation
   Transform2 t20, t21;
   Vector2 v20 = Vector2::Random();
   Vector2 v21 = Vector2::Random();
-  for (int k=0; k<2; ++k)
-    if (abs(v21[k])<Scalar(1e-3)) v21[k] = Scalar(1e-3);
+  for (int k = 0; k < 2; ++k)
+    if (abs(v21[k]) < Scalar(1e-3)) v21[k] = Scalar(1e-3);
   t21.setIdentity();
   t21.linear() = Rotation2D<Scalar>(a).toRotationMatrix();
-  VERIFY_IS_APPROX(t20.fromPositionOrientationScale(v20,a,v21).matrix(),
-    t21.pretranslate(v20).scale(v21).matrix());
+  VERIFY_IS_APPROX(t20.fromPositionOrientationScale(v20, a, v21).matrix(), t21.pretranslate(v20).scale(v21).matrix());
 
   t21.setIdentity();
   t21.linear() = Rotation2D<Scalar>(-a).toRotationMatrix();
-  VERIFY( (t20.fromPositionOrientationScale(v20,a,v21)
-        * (t21.prescale(v21.cwiseInverse()).translate(-v20))).matrix().isIdentity(test_precision<Scalar>()) );
+  VERIFY((t20.fromPositionOrientationScale(v20, a, v21) * (t21.prescale(v21.cwiseInverse()).translate(-v20)))
+             .matrix()
+             .isIdentity(test_precision<Scalar>()));
 
   // Transform - new API
   // 3D
@@ -291,7 +288,6 @@
   t1 = Matrix3(q1) * (AlignedScaling3(v0) * Translation3(v0));
   VERIFY_IS_APPROX(t0.matrix(), t1.matrix());
 
-
   t0.setIdentity();
   t0.scale(s0).translate(v0);
   t1 = Eigen::Scaling(s0) * Translation3(v0);
@@ -299,13 +295,13 @@
   t0.prescale(s0);
   t1 = Eigen::Scaling(s0) * t1;
   VERIFY_IS_APPROX(t0.matrix(), t1.matrix());
-  
+
   t0 = t3;
   t0.scale(s0);
-  t1 = t3 * Eigen::Scaling(s0,s0,s0);
+  t1 = t3 * Eigen::Scaling(s0, s0, s0);
   VERIFY_IS_APPROX(t0.matrix(), t1.matrix());
   t0.prescale(s0);
-  t1 = Eigen::Scaling(s0,s0,s0) * t1;
+  t1 = Eigen::Scaling(s0, s0, s0) * t1;
   VERIFY_IS_APPROX(t0.matrix(), t1.matrix());
 
   t0 = t3;
@@ -381,159 +377,156 @@
   t0.translate(v0);
   do {
     t0.linear().setRandom();
-  } while(t0.linear().jacobiSvd().singularValues()(2)<test_precision<Scalar>());
+  } while (t0.linear().jacobiSvd().singularValues()(2) < test_precision<Scalar>());
   Matrix4 t044 = Matrix4::Zero();
-  t044(3,3) = 1;
-  t044.block(0,0,t0.matrix().rows(),4) = t0.matrix();
-  VERIFY_IS_APPROX(t0.inverse(Affine).matrix(), t044.inverse().block(0,0,t0.matrix().rows(),4));
+  t044(3, 3) = 1;
+  t044.block(0, 0, t0.matrix().rows(), 4) = t0.matrix();
+  VERIFY_IS_APPROX(t0.inverse(Affine).matrix(), t044.inverse().block(0, 0, t0.matrix().rows(), 4));
   t0.setIdentity();
   t0.translate(v0).rotate(q1);
   t044 = Matrix4::Zero();
-  t044(3,3) = 1;
-  t044.block(0,0,t0.matrix().rows(),4) = t0.matrix();
-  VERIFY_IS_APPROX(t0.inverse(Isometry).matrix(), t044.inverse().block(0,0,t0.matrix().rows(),4));
+  t044(3, 3) = 1;
+  t044.block(0, 0, t0.matrix().rows(), 4) = t0.matrix();
+  VERIFY_IS_APPROX(t0.inverse(Isometry).matrix(), t044.inverse().block(0, 0, t0.matrix().rows(), 4));
 
   Matrix3 mat_rotation, mat_scaling;
   t0.setIdentity();
   t0.translate(v0).rotate(q1).scale(v1);
   t0.computeRotationScaling(&mat_rotation, &mat_scaling);
   VERIFY_IS_APPROX(t0.linear(), mat_rotation * mat_scaling);
-  VERIFY_IS_APPROX(mat_rotation*mat_rotation.adjoint(), Matrix3::Identity());
+  VERIFY_IS_APPROX(mat_rotation * mat_rotation.adjoint(), Matrix3::Identity());
   VERIFY_IS_APPROX(mat_rotation.determinant(), Scalar(1));
   t0.computeScalingRotation(&mat_scaling, &mat_rotation);
   VERIFY_IS_APPROX(t0.linear(), mat_scaling * mat_rotation);
-  VERIFY_IS_APPROX(mat_rotation*mat_rotation.adjoint(), Matrix3::Identity());
+  VERIFY_IS_APPROX(mat_rotation * mat_rotation.adjoint(), Matrix3::Identity());
   VERIFY_IS_APPROX(mat_rotation.determinant(), Scalar(1));
 
   // test casting
-  Transform<float,3,Mode> t1f = t1.template cast<float>();
-  VERIFY_IS_APPROX(t1f.template cast<Scalar>(),t1);
-  Transform<double,3,Mode> t1d = t1.template cast<double>();
-  VERIFY_IS_APPROX(t1d.template cast<Scalar>(),t1);
+  Transform<float, 3, Mode> t1f = t1.template cast<float>();
+  VERIFY_IS_APPROX(t1f.template cast<Scalar>(), t1);
+  Transform<double, 3, Mode> t1d = t1.template cast<double>();
+  VERIFY_IS_APPROX(t1d.template cast<Scalar>(), t1);
 
   Translation3 tr1(v0);
-  Translation<float,3> tr1f = tr1.template cast<float>();
-  VERIFY_IS_APPROX(tr1f.template cast<Scalar>(),tr1);
-  Translation<double,3> tr1d = tr1.template cast<double>();
-  VERIFY_IS_APPROX(tr1d.template cast<Scalar>(),tr1);
+  Translation<float, 3> tr1f = tr1.template cast<float>();
+  VERIFY_IS_APPROX(tr1f.template cast<Scalar>(), tr1);
+  Translation<double, 3> tr1d = tr1.template cast<double>();
+  VERIFY_IS_APPROX(tr1d.template cast<Scalar>(), tr1);
 
   AngleAxis<float> aa1f = aa1.template cast<float>();
-  VERIFY_IS_APPROX(aa1f.template cast<Scalar>(),aa1);
+  VERIFY_IS_APPROX(aa1f.template cast<Scalar>(), aa1);
   AngleAxis<double> aa1d = aa1.template cast<double>();
-  VERIFY_IS_APPROX(aa1d.template cast<Scalar>(),aa1);
+  VERIFY_IS_APPROX(aa1d.template cast<Scalar>(), aa1);
 
   Rotation2D<Scalar> r2d1(internal::random<Scalar>());
   Rotation2D<float> r2d1f = r2d1.template cast<float>();
-  VERIFY_IS_APPROX(r2d1f.template cast<Scalar>(),r2d1);
+  VERIFY_IS_APPROX(r2d1f.template cast<Scalar>(), r2d1);
   Rotation2D<double> r2d1d = r2d1.template cast<double>();
-  VERIFY_IS_APPROX(r2d1d.template cast<Scalar>(),r2d1);
-  
-  for(int k=0; k<100; ++k)
-  {
-    Scalar angle = internal::random<Scalar>(-100,100);
-    Rotation2D<Scalar> rot2(angle);
-    VERIFY( rot2.smallestPositiveAngle() >= 0 );
-    VERIFY( rot2.smallestPositiveAngle() <= Scalar(2)*Scalar(EIGEN_PI) );
-    VERIFY_IS_APPROX( angleToVec(rot2.smallestPositiveAngle()), angleToVec(rot2.angle()) );
-    
-    VERIFY( rot2.smallestAngle() >= -Scalar(EIGEN_PI) );
-    VERIFY( rot2.smallestAngle() <=  Scalar(EIGEN_PI) );
-    VERIFY_IS_APPROX( angleToVec(rot2.smallestAngle()), angleToVec(rot2.angle()) );
+  VERIFY_IS_APPROX(r2d1d.template cast<Scalar>(), r2d1);
 
-    Matrix<Scalar,2,2> rot2_as_mat(rot2);
+  for (int k = 0; k < 100; ++k) {
+    Scalar angle = internal::random<Scalar>(-100, 100);
+    Rotation2D<Scalar> rot2(angle);
+    VERIFY(rot2.smallestPositiveAngle() >= 0);
+    VERIFY(rot2.smallestPositiveAngle() <= Scalar(2) * Scalar(EIGEN_PI));
+    VERIFY_IS_APPROX(angleToVec(rot2.smallestPositiveAngle()), angleToVec(rot2.angle()));
+
+    VERIFY(rot2.smallestAngle() >= -Scalar(EIGEN_PI));
+    VERIFY(rot2.smallestAngle() <= Scalar(EIGEN_PI));
+    VERIFY_IS_APPROX(angleToVec(rot2.smallestAngle()), angleToVec(rot2.angle()));
+
+    Matrix<Scalar, 2, 2> rot2_as_mat(rot2);
     Rotation2D<Scalar> rot3(rot2_as_mat);
-    VERIFY_IS_APPROX( angleToVec(rot2.smallestAngle()),  angleToVec(rot3.angle()) );
+    VERIFY_IS_APPROX(angleToVec(rot2.smallestAngle()), angleToVec(rot3.angle()));
   }
 
-  s0 = internal::random<Scalar>(-100,100);
-  s1 = internal::random<Scalar>(-100,100);
+  s0 = internal::random<Scalar>(-100, 100);
+  s1 = internal::random<Scalar>(-100, 100);
   Rotation2D<Scalar> R0(s0), R1(s1);
-  
+
   t20 = Translation2(v20) * (R0 * Eigen::Scaling(s0));
   t21 = Translation2(v20) * R0 * Eigen::Scaling(s0);
-  VERIFY_IS_APPROX(t20,t21);
-  
+  VERIFY_IS_APPROX(t20, t21);
+
   t20 = Translation2(v20) * (R0 * R0.inverse() * Eigen::Scaling(s0));
   t21 = Translation2(v20) * Eigen::Scaling(s0);
-  VERIFY_IS_APPROX(t20,t21);
-  
+  VERIFY_IS_APPROX(t20, t21);
+
   VERIFY_IS_APPROX(s0, (R0.slerp(0, R1)).angle());
-  VERIFY_IS_APPROX( angleToVec(R1.smallestPositiveAngle()), angleToVec((R0.slerp(1, R1)).smallestPositiveAngle()) );
+  VERIFY_IS_APPROX(angleToVec(R1.smallestPositiveAngle()), angleToVec((R0.slerp(1, R1)).smallestPositiveAngle()));
   VERIFY_IS_APPROX(R0.smallestPositiveAngle(), (R0.slerp(0.5, R0)).smallestPositiveAngle());
 
-  if(std::cos(s0)>0)
+  if (std::cos(s0) > 0)
     VERIFY_IS_MUCH_SMALLER_THAN((R0.slerp(0.5, R0.inverse())).smallestAngle(), Scalar(1));
   else
     VERIFY_IS_APPROX(Scalar(EIGEN_PI), (R0.slerp(0.5, R0.inverse())).smallestPositiveAngle());
-  
+
   // Check path length
   Scalar l = 0;
   int path_steps = 100;
-  for(int k=0; k<path_steps; ++k)
-  {
-    Scalar a1 = R0.slerp(Scalar(k)/Scalar(path_steps), R1).angle();
-    Scalar a2 = R0.slerp(Scalar(k+1)/Scalar(path_steps), R1).angle();
-    l += std::abs(a2-a1);
+  for (int k = 0; k < path_steps; ++k) {
+    Scalar a1 = R0.slerp(Scalar(k) / Scalar(path_steps), R1).angle();
+    Scalar a2 = R0.slerp(Scalar(k + 1) / Scalar(path_steps), R1).angle();
+    l += std::abs(a2 - a1);
   }
-  VERIFY(l<=Scalar(EIGEN_PI)*(Scalar(1)+NumTraits<Scalar>::epsilon()*Scalar(path_steps/2)));
-  
+  VERIFY(l <= Scalar(EIGEN_PI) * (Scalar(1) + NumTraits<Scalar>::epsilon() * Scalar(path_steps / 2)));
+
   // check basic features
   {
-    Rotation2D<Scalar> r1;           // default ctor
-    r1 = Rotation2D<Scalar>(s0);     // copy assignment
-    VERIFY_IS_APPROX(r1.angle(),s0);
-    Rotation2D<Scalar> r2(r1);       // copy ctor
-    VERIFY_IS_APPROX(r2.angle(),s0);
+    Rotation2D<Scalar> r1;        // default ctor
+    r1 = Rotation2D<Scalar>(s0);  // copy assignment
+    VERIFY_IS_APPROX(r1.angle(), s0);
+    Rotation2D<Scalar> r2(r1);  // copy ctor
+    VERIFY_IS_APPROX(r2.angle(), s0);
   }
 
   {
     Transform3 t32(Matrix4::Random()), t33, t34;
     t34 = t33 = t32;
     t32.scale(v0);
-    t33*=AlignedScaling3(v0);
+    t33 *= AlignedScaling3(v0);
     VERIFY_IS_APPROX(t32.matrix(), t33.matrix());
     t33 = t34 * AlignedScaling3(v0);
     VERIFY_IS_APPROX(t32.matrix(), t33.matrix());
   }
-
 }
 
-template<typename A1, typename A2, typename P, typename Q, typename V, typename H>
-void transform_associativity_left(const A1& a1, const A2& a2, const P& p, const Q& q, const V& v, const H& h)
-{
-  VERIFY_IS_APPROX( q*(a1*v), (q*a1)*v );
-  VERIFY_IS_APPROX( q*(a2*v), (q*a2)*v );
-  VERIFY_IS_APPROX( q*(p*h).hnormalized(),  ((q*p)*h).hnormalized() );
+template <typename A1, typename A2, typename P, typename Q, typename V, typename H>
+void transform_associativity_left(const A1& a1, const A2& a2, const P& p, const Q& q, const V& v, const H& h) {
+  VERIFY_IS_APPROX(q * (a1 * v), (q * a1) * v);
+  VERIFY_IS_APPROX(q * (a2 * v), (q * a2) * v);
+  VERIFY_IS_APPROX(q * (p * h).hnormalized(), ((q * p) * h).hnormalized());
 }
 
-template<typename A1, typename A2, typename P, typename Q, typename V, typename H>
-void transform_associativity2(const A1& a1, const A2& a2, const P& p, const Q& q, const V& v, const H& h)
-{
-  VERIFY_IS_APPROX( a1*(q*v), (a1*q)*v );
-  VERIFY_IS_APPROX( a2*(q*v), (a2*q)*v );
-  VERIFY_IS_APPROX( p *(q*v).homogeneous(), (p *q)*v.homogeneous() );
+template <typename A1, typename A2, typename P, typename Q, typename V, typename H>
+void transform_associativity2(const A1& a1, const A2& a2, const P& p, const Q& q, const V& v, const H& h) {
+  VERIFY_IS_APPROX(a1 * (q * v), (a1 * q) * v);
+  VERIFY_IS_APPROX(a2 * (q * v), (a2 * q) * v);
+  VERIFY_IS_APPROX(p * (q * v).homogeneous(), (p * q) * v.homogeneous());
 
-  transform_associativity_left(a1, a2,p, q, v, h);
+  transform_associativity_left(a1, a2, p, q, v, h);
 }
 
-template<typename Scalar, int Dim, int Options,typename RotationType>
-void transform_associativity(const RotationType& R)
-{
-  typedef Matrix<Scalar,Dim,1> VectorType;
-  typedef Matrix<Scalar,Dim+1,1> HVectorType;
-  typedef Matrix<Scalar,Dim,Dim> LinearType;
-  typedef Matrix<Scalar,Dim+1,Dim+1> MatrixType;
-  typedef Transform<Scalar,Dim,AffineCompact,Options> AffineCompactType;
-  typedef Transform<Scalar,Dim,Affine,Options> AffineType;
-  typedef Transform<Scalar,Dim,Projective,Options> ProjectiveType;
-  typedef DiagonalMatrix<Scalar,Dim> ScalingType;
-  typedef Translation<Scalar,Dim> TranslationType;
+template <typename Scalar, int Dim, int Options, typename RotationType>
+void transform_associativity(const RotationType& R) {
+  typedef Matrix<Scalar, Dim, 1> VectorType;
+  typedef Matrix<Scalar, Dim + 1, 1> HVectorType;
+  typedef Matrix<Scalar, Dim, Dim> LinearType;
+  typedef Matrix<Scalar, Dim + 1, Dim + 1> MatrixType;
+  typedef Transform<Scalar, Dim, AffineCompact, Options> AffineCompactType;
+  typedef Transform<Scalar, Dim, Affine, Options> AffineType;
+  typedef Transform<Scalar, Dim, Projective, Options> ProjectiveType;
+  typedef DiagonalMatrix<Scalar, Dim> ScalingType;
+  typedef Translation<Scalar, Dim> TranslationType;
 
-  AffineCompactType A1c; A1c.matrix().setRandom();
-  AffineCompactType A2c; A2c.matrix().setRandom();
+  AffineCompactType A1c;
+  A1c.matrix().setRandom();
+  AffineCompactType A2c;
+  A2c.matrix().setRandom();
   AffineType A1(A1c);
   AffineType A2(A2c);
-  ProjectiveType P1; P1.matrix().setRandom();
+  ProjectiveType P1;
+  P1.matrix().setRandom();
   VectorType v1 = VectorType::Random();
   VectorType v2 = VectorType::Random();
   HVectorType h1 = HVectorType::Random();
@@ -541,87 +534,89 @@
   LinearType L = LinearType::Random();
   MatrixType M = MatrixType::Random();
 
-  CALL_SUBTEST( transform_associativity2(A1c, A1, P1, A2, v2, h1) );
-  CALL_SUBTEST( transform_associativity2(A1c, A1, P1, A2c, v2, h1) );
-  CALL_SUBTEST( transform_associativity2(A1c, A1, P1, v1.asDiagonal(), v2, h1) );
-  CALL_SUBTEST( transform_associativity2(A1c, A1, P1, ScalingType(v1), v2, h1) );
-  CALL_SUBTEST( transform_associativity2(A1c, A1, P1, Scaling(v1), v2, h1) );
-  CALL_SUBTEST( transform_associativity2(A1c, A1, P1, Scaling(s1), v2, h1) );
-  CALL_SUBTEST( transform_associativity2(A1c, A1, P1, TranslationType(v1), v2, h1) );
-  CALL_SUBTEST( transform_associativity_left(A1c, A1, P1, L, v2, h1) );
-  CALL_SUBTEST( transform_associativity2(A1c, A1, P1, R, v2, h1) );
+  CALL_SUBTEST(transform_associativity2(A1c, A1, P1, A2, v2, h1));
+  CALL_SUBTEST(transform_associativity2(A1c, A1, P1, A2c, v2, h1));
+  CALL_SUBTEST(transform_associativity2(A1c, A1, P1, v1.asDiagonal(), v2, h1));
+  CALL_SUBTEST(transform_associativity2(A1c, A1, P1, ScalingType(v1), v2, h1));
+  CALL_SUBTEST(transform_associativity2(A1c, A1, P1, Scaling(v1), v2, h1));
+  CALL_SUBTEST(transform_associativity2(A1c, A1, P1, Scaling(s1), v2, h1));
+  CALL_SUBTEST(transform_associativity2(A1c, A1, P1, TranslationType(v1), v2, h1));
+  CALL_SUBTEST(transform_associativity_left(A1c, A1, P1, L, v2, h1));
+  CALL_SUBTEST(transform_associativity2(A1c, A1, P1, R, v2, h1));
 
-  VERIFY_IS_APPROX( A1*(M*h1), (A1*M)*h1 );
-  VERIFY_IS_APPROX( A1c*(M*h1), (A1c*M)*h1 );
-  VERIFY_IS_APPROX( P1*(M*h1), (P1*M)*h1 );
+  VERIFY_IS_APPROX(A1 * (M * h1), (A1 * M) * h1);
+  VERIFY_IS_APPROX(A1c * (M * h1), (A1c * M) * h1);
+  VERIFY_IS_APPROX(P1 * (M * h1), (P1 * M) * h1);
 
-  VERIFY_IS_APPROX( M*(A1*h1), (M*A1)*h1 );
-  VERIFY_IS_APPROX( M*(A1c*h1), (M*A1c)*h1 );
-  VERIFY_IS_APPROX( M*(P1*h1),  ((M*P1)*h1) );
+  VERIFY_IS_APPROX(M * (A1 * h1), (M * A1) * h1);
+  VERIFY_IS_APPROX(M * (A1c * h1), (M * A1c) * h1);
+  VERIFY_IS_APPROX(M * (P1 * h1), ((M * P1) * h1));
 }
 
-template<typename Scalar> void transform_alignment()
-{
-  typedef Transform<Scalar,3,Projective,AutoAlign> Projective3a;
-  typedef Transform<Scalar,3,Projective,DontAlign> Projective3u;
+template <typename Scalar>
+void transform_alignment() {
+  typedef Transform<Scalar, 3, Projective, AutoAlign> Projective3a;
+  typedef Transform<Scalar, 3, Projective, DontAlign> Projective3u;
 
   EIGEN_ALIGN_MAX Scalar array1[16];
   EIGEN_ALIGN_MAX Scalar array2[16];
-  EIGEN_ALIGN_MAX Scalar array3[16+1];
-  Scalar* array3u = array3+1;
+  EIGEN_ALIGN_MAX Scalar array3[16 + 1];
+  Scalar* array3u = array3 + 1;
 
-  Projective3a *p1 = ::new(reinterpret_cast<void*>(array1)) Projective3a;
-  Projective3u *p2 = ::new(reinterpret_cast<void*>(array2)) Projective3u;
-  Projective3u *p3 = ::new(reinterpret_cast<void*>(array3u)) Projective3u;
-  
+  Projective3a* p1 = ::new (reinterpret_cast<void*>(array1)) Projective3a;
+  Projective3u* p2 = ::new (reinterpret_cast<void*>(array2)) Projective3u;
+  Projective3u* p3 = ::new (reinterpret_cast<void*>(array3u)) Projective3u;
+
   p1->matrix().setRandom();
   *p2 = *p1;
   *p3 = *p1;
 
   VERIFY_IS_APPROX(p1->matrix(), p2->matrix());
   VERIFY_IS_APPROX(p1->matrix(), p3->matrix());
-  
-  VERIFY_IS_APPROX( (*p1) * (*p1), (*p2)*(*p3));
+
+  VERIFY_IS_APPROX((*p1) * (*p1), (*p2) * (*p3));
 }
 
-template<typename Scalar, int Dim, int Options> void transform_products()
-{
-  typedef Matrix<Scalar,Dim+1,Dim+1> Mat;
-  typedef Transform<Scalar,Dim,Projective,Options> Proj;
-  typedef Transform<Scalar,Dim,Affine,Options> Aff;
-  typedef Transform<Scalar,Dim,AffineCompact,Options> AffC;
+template <typename Scalar, int Dim, int Options>
+void transform_products() {
+  typedef Matrix<Scalar, Dim + 1, Dim + 1> Mat;
+  typedef Transform<Scalar, Dim, Projective, Options> Proj;
+  typedef Transform<Scalar, Dim, Affine, Options> Aff;
+  typedef Transform<Scalar, Dim, AffineCompact, Options> AffC;
 
-  Proj p; p.matrix().setRandom();
-  Aff a; a.linear().setRandom(); a.translation().setRandom();
+  Proj p;
+  p.matrix().setRandom();
+  Aff a;
+  a.linear().setRandom();
+  a.translation().setRandom();
   AffC ac = a;
 
   Mat p_m(p.matrix()), a_m(a.matrix());
 
-  VERIFY_IS_APPROX((p*p).matrix(), p_m*p_m);
-  VERIFY_IS_APPROX((a*a).matrix(), a_m*a_m);
-  VERIFY_IS_APPROX((p*a).matrix(), p_m*a_m);
-  VERIFY_IS_APPROX((a*p).matrix(), a_m*p_m);
-  VERIFY_IS_APPROX((ac*a).matrix(), a_m*a_m);
-  VERIFY_IS_APPROX((a*ac).matrix(), a_m*a_m);
-  VERIFY_IS_APPROX((p*ac).matrix(), p_m*a_m);
-  VERIFY_IS_APPROX((ac*p).matrix(), a_m*p_m);
+  VERIFY_IS_APPROX((p * p).matrix(), p_m * p_m);
+  VERIFY_IS_APPROX((a * a).matrix(), a_m * a_m);
+  VERIFY_IS_APPROX((p * a).matrix(), p_m * a_m);
+  VERIFY_IS_APPROX((a * p).matrix(), a_m * p_m);
+  VERIFY_IS_APPROX((ac * a).matrix(), a_m * a_m);
+  VERIFY_IS_APPROX((a * ac).matrix(), a_m * a_m);
+  VERIFY_IS_APPROX((p * ac).matrix(), p_m * a_m);
+  VERIFY_IS_APPROX((ac * p).matrix(), a_m * p_m);
 }
 
-template<typename Scalar, int Mode, int Options> void transformations_no_scale()
-{
-     /* this test covers the following files:
-     Cross.h Quaternion.h, Transform.h
-  */
-  typedef Matrix<Scalar,3,1> Vector3;
-  typedef Matrix<Scalar,4,1> Vector4;
+template <typename Scalar, int Mode, int Options>
+void transformations_no_scale() {
+  /* this test covers the following files:
+  Cross.h Quaternion.h, Transform.h
+*/
+  typedef Matrix<Scalar, 3, 1> Vector3;
+  typedef Matrix<Scalar, 4, 1> Vector4;
   typedef Quaternion<Scalar> Quaternionx;
   typedef AngleAxis<Scalar> AngleAxisx;
-  typedef Transform<Scalar,3,Mode,Options> Transform3;
-  typedef Translation<Scalar,3> Translation3;
-  typedef Matrix<Scalar,4,4> Matrix4;
+  typedef Transform<Scalar, 3, Mode, Options> Transform3;
+  typedef Translation<Scalar, 3> Translation3;
+  typedef Matrix<Scalar, 4, 4> Matrix4;
 
-  Vector3 v0 = Vector3::Random(),
-          v1 = Vector3::Random();
+  Vector3 v0 = Vector3::Random(), v1 = Vector3::Random();
 
   Transform3 t0, t1, t2;
 
@@ -646,7 +641,7 @@
 
   t1.fromPositionOrientationScale(v0, q1, v1);
   VERIFY_IS_APPROX(t1.matrix(), t0.matrix());
-  VERIFY_IS_APPROX(t1*v1, t0*v1);
+  VERIFY_IS_APPROX(t1 * v1, t0 * v1);
 
   // translation * vector
   t0.setIdentity();
@@ -663,21 +658,18 @@
   VERIFY_IS_APPROX(Vector4(m3.row(3)), Vector4(0.0, 0.0, 0.0, 1.0));
 
   VERIFY_IS_APPROX(t3.rotation(), t3.linear());
-  if(Mode==Isometry)
-    VERIFY(t3.rotation().data()==t3.linear().data());
+  if (Mode == Isometry) VERIFY(t3.rotation().data() == t3.linear().data());
 }
 
-template<typename Scalar, int Mode, int Options> void transformations_computed_scaling_continuity()
-{
+template <typename Scalar, int Mode, int Options>
+void transformations_computed_scaling_continuity() {
   typedef Matrix<Scalar, 3, 1> Vector3;
   typedef Transform<Scalar, 3, Mode, Options> Transform3;
   typedef Matrix<Scalar, 3, 3> Matrix3;
 
   // Given: two transforms that differ by '2*eps'.
   Scalar eps(1e-3);
-  Vector3 v0 = Vector3::Random().normalized(),
-    v1 = Vector3::Random().normalized(),
-    v3 = Vector3::Random().normalized();
+  Vector3 v0 = Vector3::Random().normalized(), v1 = Vector3::Random().normalized(), v3 = Vector3::Random().normalized();
   Transform3 t0, t1;
   // The interesting case is when their determinants have different signs.
   Matrix3 rank2 = 50 * v0 * v0.adjoint() + 20 * v1 * v1.adjoint();
@@ -690,42 +682,41 @@
   t1.computeRotationScaling(&r1, &s1);
 
   // Then: the scaling parts should differ by no more than '2*eps'.
-  const Scalar c(2.1); // 2 + room for rounding errors
+  const Scalar c(2.1);  // 2 + room for rounding errors
   VERIFY((s0 - s1).norm() < c * eps);
 }
 
-EIGEN_DECLARE_TEST(geo_transformations)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1(( transformations<double,Affine,AutoAlign>() ));
-    CALL_SUBTEST_1(( non_projective_only<double,Affine,AutoAlign>() ));
-    CALL_SUBTEST_1(( transformations_computed_scaling_continuity<double,Affine,AutoAlign>() ));   
-    
-    CALL_SUBTEST_2(( transformations<float,AffineCompact,AutoAlign>() ));
-    CALL_SUBTEST_2(( non_projective_only<float,AffineCompact,AutoAlign>() ));
-    CALL_SUBTEST_2(( transform_alignment<float>() ));
-    
-    CALL_SUBTEST_3(( transformations<double,Projective,AutoAlign>() ));
-    CALL_SUBTEST_3(( transformations<double,Projective,DontAlign>() ));
-    CALL_SUBTEST_3(( transform_alignment<double>() ));
+EIGEN_DECLARE_TEST(geo_transformations) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1((transformations<double, Affine, AutoAlign>()));
+    CALL_SUBTEST_1((non_projective_only<double, Affine, AutoAlign>()));
+    CALL_SUBTEST_1((transformations_computed_scaling_continuity<double, Affine, AutoAlign>()));
 
-    CALL_SUBTEST_4(( transformations<float,Affine,RowMajor|AutoAlign>() ));
-    CALL_SUBTEST_4(( non_projective_only<float,Affine,RowMajor>() ));
-    
-    CALL_SUBTEST_5(( transformations<double,AffineCompact,RowMajor|AutoAlign>() ));
-    CALL_SUBTEST_5(( non_projective_only<double,AffineCompact,RowMajor>() ));
+    CALL_SUBTEST_2((transformations<float, AffineCompact, AutoAlign>()));
+    CALL_SUBTEST_2((non_projective_only<float, AffineCompact, AutoAlign>()));
+    CALL_SUBTEST_2((transform_alignment<float>()));
 
-    CALL_SUBTEST_6(( transformations<double,Projective,RowMajor|AutoAlign>() ));
-    CALL_SUBTEST_6(( transformations<double,Projective,RowMajor|DontAlign>() ));
+    CALL_SUBTEST_3((transformations<double, Projective, AutoAlign>()));
+    CALL_SUBTEST_3((transformations<double, Projective, DontAlign>()));
+    CALL_SUBTEST_3((transform_alignment<double>()));
 
+    CALL_SUBTEST_4((transformations<float, Affine, RowMajor | AutoAlign>()));
+    CALL_SUBTEST_4((non_projective_only<float, Affine, RowMajor>()));
 
-    CALL_SUBTEST_7(( transform_products<double,3,RowMajor|AutoAlign>() ));
-    CALL_SUBTEST_7(( transform_products<float,2,AutoAlign>() ));
+    CALL_SUBTEST_5((transformations<double, AffineCompact, RowMajor | AutoAlign>()));
+    CALL_SUBTEST_5((non_projective_only<double, AffineCompact, RowMajor>()));
 
-    CALL_SUBTEST_8(( transform_associativity<double,2,ColMajor>(Rotation2D<double>(internal::random<double>()*double(EIGEN_PI))) ));
-    CALL_SUBTEST_8(( transform_associativity<double,3,ColMajor>(Quaterniond::UnitRandom()) ));
+    CALL_SUBTEST_6((transformations<double, Projective, RowMajor | AutoAlign>()));
+    CALL_SUBTEST_6((transformations<double, Projective, RowMajor | DontAlign>()));
 
-    CALL_SUBTEST_9(( transformations_no_scale<double,Affine,AutoAlign>() ));
-    CALL_SUBTEST_9(( transformations_no_scale<double,Isometry,AutoAlign>() ));
+    CALL_SUBTEST_7((transform_products<double, 3, RowMajor | AutoAlign>()));
+    CALL_SUBTEST_7((transform_products<float, 2, AutoAlign>()));
+
+    CALL_SUBTEST_8((transform_associativity<double, 2, ColMajor>(
+        Rotation2D<double>(internal::random<double>() * double(EIGEN_PI)))));
+    CALL_SUBTEST_8((transform_associativity<double, 3, ColMajor>(Quaterniond::UnitRandom())));
+
+    CALL_SUBTEST_9((transformations_no_scale<double, Affine, AutoAlign>()));
+    CALL_SUBTEST_9((transformations_no_scale<double, Isometry, AutoAlign>()));
   }
 }
diff --git a/test/gpu_basic.cu b/test/gpu_basic.cu
index 67f16bf..35839e4 100644
--- a/test/gpu_basic.cu
+++ b/test/gpu_basic.cu
@@ -8,9 +8,9 @@
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 // workaround issue between gcc >= 4.7 and cuda 5.5
-#if (defined __GNUC__) && (__GNUC__>4 || __GNUC_MINOR__>=7)
-  #undef _GLIBCXX_ATOMIC_BUILTINS
-  #undef _GLIBCXX_USE_INT128
+#if (defined __GNUC__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 7)
+#undef _GLIBCXX_ATOMIC_BUILTINS
+#undef _GLIBCXX_USE_INT128
 #endif
 
 #define EIGEN_TEST_NO_LONGDOUBLE
@@ -39,31 +39,27 @@
 //   }
 // };
 
-template<typename T>
+template <typename T>
 struct coeff_wise {
-  EIGEN_DEVICE_FUNC
-  void operator()(int i, const typename T::Scalar* in, typename T::Scalar* out) const
-  {
+  EIGEN_DEVICE_FUNC void operator()(int i, const typename T::Scalar* in, typename T::Scalar* out) const {
     using namespace Eigen;
-    T x1(in+i);
-    T x2(in+i+1);
-    T x3(in+i+2);
-    Map<T> res(out+i*T::MaxSizeAtCompileTime);
-    
+    T x1(in + i);
+    T x2(in + i + 1);
+    T x3(in + i + 2);
+    Map<T> res(out + i * T::MaxSizeAtCompileTime);
+
     res.array() += (in[0] * x1 + x2).array() * x3.array();
   }
 };
 
-template<typename T>
+template <typename T>
 struct complex_sqrt {
-  EIGEN_DEVICE_FUNC
-  void operator()(int i, const typename T::Scalar* in, typename T::Scalar* out) const
-  {
+  EIGEN_DEVICE_FUNC void operator()(int i, const typename T::Scalar* in, typename T::Scalar* out) const {
     using namespace Eigen;
     typedef typename T::Scalar ComplexType;
     typedef typename T::Scalar::value_type ValueType;
     const int num_special_inputs = 18;
-    
+
     if (i == 0) {
       const ValueType nan = std::numeric_limits<ValueType>::quiet_NaN();
       typedef Eigen::Vector<ComplexType, num_special_inputs> SpecialInputs;
@@ -74,12 +70,11 @@
       special_in[idx++] = ComplexType(-0, 0);
       special_in[idx++] = ComplexType(0, -0);
       special_in[idx++] = ComplexType(-0, -0);
-      // GCC's fallback sqrt implementation fails for inf inputs.
-      // It is called when _GLIBCXX_USE_C99_COMPLEX is false or if
-      // clang includes the GCC header (which temporarily disables
-      // _GLIBCXX_USE_C99_COMPLEX)
-      #if !defined(_GLIBCXX_COMPLEX) || \
-        (_GLIBCXX_USE_C99_COMPLEX && !defined(__CLANG_CUDA_WRAPPERS_COMPLEX))
+// GCC's fallback sqrt implementation fails for inf inputs.
+// It is called when _GLIBCXX_USE_C99_COMPLEX is false or if
+// clang includes the GCC header (which temporarily disables
+// _GLIBCXX_USE_C99_COMPLEX)
+#if !defined(_GLIBCXX_COMPLEX) || (_GLIBCXX_USE_C99_COMPLEX && !defined(__CLANG_CUDA_WRAPPERS_COMPLEX))
       const ValueType inf = std::numeric_limits<ValueType>::infinity();
       special_in[idx++] = ComplexType(1.0, inf);
       special_in[idx++] = ComplexType(nan, inf);
@@ -91,41 +86,39 @@
       special_in[idx++] = ComplexType(inf, -1.0);
       special_in[idx++] = ComplexType(-inf, nan);
       special_in[idx++] = ComplexType(inf, nan);
-      #endif
+#endif
       special_in[idx++] = ComplexType(1.0, nan);
       special_in[idx++] = ComplexType(nan, 1.0);
       special_in[idx++] = ComplexType(nan, -1.0);
       special_in[idx++] = ComplexType(nan, nan);
-      
+
       Map<SpecialInputs> special_out(out);
       special_out = special_in.cwiseSqrt();
     }
-    
+
     T x1(in + i);
-    Map<T> res(out + num_special_inputs + i*T::MaxSizeAtCompileTime);
+    Map<T> res(out + num_special_inputs + i * T::MaxSizeAtCompileTime);
     res = x1.cwiseSqrt();
   }
 };
 
-template<typename T>
+template <typename T>
 struct complex_operators {
-  EIGEN_DEVICE_FUNC
-  void operator()(int i, const typename T::Scalar* in, typename T::Scalar* out) const
-  {
+  EIGEN_DEVICE_FUNC void operator()(int i, const typename T::Scalar* in, typename T::Scalar* out) const {
     using namespace Eigen;
     typedef typename T::Scalar ComplexType;
     typedef typename T::Scalar::value_type ValueType;
     const int num_scalar_operators = 24;
     const int num_vector_operators = 23;  // no unary + operator.
     int out_idx = i * (num_scalar_operators + num_vector_operators * T::MaxSizeAtCompileTime);
-    
+
     // Scalar operators.
     const ComplexType a = in[i];
     const ComplexType b = in[i + 1];
-    
+
     out[out_idx++] = +a;
     out[out_idx++] = -a;
-    
+
     out[out_idx++] = a + b;
     out[out_idx++] = a + numext::real(b);
     out[out_idx++] = numext::real(a) + b;
@@ -138,14 +131,18 @@
     out[out_idx++] = a / b;
     out[out_idx++] = a / numext::real(b);
     out[out_idx++] = numext::real(a) / b;
-    
+
 #if !EIGEN_COMP_MSVC
-    out[out_idx] = a; out[out_idx++] += b;
-    out[out_idx] = a; out[out_idx++] -= b;
-    out[out_idx] = a; out[out_idx++] *= b;
-    out[out_idx] = a; out[out_idx++] /= b;
+    out[out_idx] = a;
+    out[out_idx++] += b;
+    out[out_idx] = a;
+    out[out_idx++] -= b;
+    out[out_idx] = a;
+    out[out_idx++] *= b;
+    out[out_idx] = a;
+    out[out_idx++] /= b;
 #endif
-    
+
     const ComplexType true_value = ComplexType(ValueType(1), ValueType(0));
     const ComplexType false_value = ComplexType(ValueType(0), ValueType(0));
     out[out_idx++] = (a == b ? true_value : false_value);
@@ -154,18 +151,18 @@
     out[out_idx++] = (a != b ? true_value : false_value);
     out[out_idx++] = (a != numext::real(b) ? true_value : false_value);
     out[out_idx++] = (numext::real(a) != b ? true_value : false_value);
-    
+
     // Vector versions.
     T x1(in + i);
     T x2(in + i + 1);
     const int res_size = T::MaxSizeAtCompileTime * num_scalar_operators;
     const int size = T::MaxSizeAtCompileTime;
     int block_idx = 0;
-    
+
     Map<VectorX<ComplexType>> res(out + out_idx, res_size);
     res.segment(block_idx, size) = -x1;
     block_idx += size;
-    
+
     res.segment(block_idx, size) = x1 + x2;
     block_idx += size;
     res.segment(block_idx, size) = x1 + x2.real();
@@ -190,15 +187,19 @@
     block_idx += size;
     res.segment(block_idx, size) = x1.real().array() / x2.array();
     block_idx += size;
-    
+
 #if !EIGEN_COMP_MSVC
-    res.segment(block_idx, size) = x1; res.segment(block_idx, size) += x2;
+    res.segment(block_idx, size) = x1;
+    res.segment(block_idx, size) += x2;
     block_idx += size;
-    res.segment(block_idx, size) = x1; res.segment(block_idx, size) -= x2;
+    res.segment(block_idx, size) = x1;
+    res.segment(block_idx, size) -= x2;
     block_idx += size;
-    res.segment(block_idx, size) = x1; res.segment(block_idx, size).array() *= x2.array();
+    res.segment(block_idx, size) = x1;
+    res.segment(block_idx, size).array() *= x2.array();
     block_idx += size;
-    res.segment(block_idx, size) = x1; res.segment(block_idx, size).array() /= x2.array();
+    res.segment(block_idx, size) = x1;
+    res.segment(block_idx, size).array() /= x2.array();
     block_idx += size;
 #endif
 
@@ -220,138 +221,120 @@
   }
 };
 
-template<typename T>
+template <typename T>
 struct replicate {
-  EIGEN_DEVICE_FUNC
-  void operator()(int i, const typename T::Scalar* in, typename T::Scalar* out) const
-  {
+  EIGEN_DEVICE_FUNC void operator()(int i, const typename T::Scalar* in, typename T::Scalar* out) const {
     using namespace Eigen;
-    T x1(in+i);
-    int step   = x1.size() * 4;
+    T x1(in + i);
+    int step = x1.size() * 4;
     int stride = 3 * step;
-    
-    typedef Map<Array<typename T::Scalar,Dynamic,Dynamic> > MapType;
-    MapType(out+i*stride+0*step, x1.rows()*2, x1.cols()*2) = x1.replicate(2,2);
-    MapType(out+i*stride+1*step, x1.rows()*3, x1.cols()) = in[i] * x1.colwise().replicate(3);
-    MapType(out+i*stride+2*step, x1.rows(), x1.cols()*3) = in[i] * x1.rowwise().replicate(3);
+
+    typedef Map<Array<typename T::Scalar, Dynamic, Dynamic>> MapType;
+    MapType(out + i * stride + 0 * step, x1.rows() * 2, x1.cols() * 2) = x1.replicate(2, 2);
+    MapType(out + i * stride + 1 * step, x1.rows() * 3, x1.cols()) = in[i] * x1.colwise().replicate(3);
+    MapType(out + i * stride + 2 * step, x1.rows(), x1.cols() * 3) = in[i] * x1.rowwise().replicate(3);
   }
 };
 
-template<typename T>
+template <typename T>
 struct alloc_new_delete {
-  EIGEN_DEVICE_FUNC
-  void operator()(int i, const typename T::Scalar* in, typename T::Scalar* out) const
-  {
-    int offset = 2*i*T::MaxSizeAtCompileTime;
+  EIGEN_DEVICE_FUNC void operator()(int i, const typename T::Scalar* in, typename T::Scalar* out) const {
+    int offset = 2 * i * T::MaxSizeAtCompileTime;
     T* x = new T(in + offset);
     Eigen::Map<T> u(out + offset);
     u = *x;
     delete x;
-    
+
     offset += T::MaxSizeAtCompileTime;
     T* y = new T[1];
     y[0] = T(in + offset);
     Eigen::Map<T> v(out + offset);
-    v = y[0];    
+    v = y[0];
     delete[] y;
   }
 };
 
-template<typename T>
+template <typename T>
 struct redux {
-  EIGEN_DEVICE_FUNC
-  void operator()(int i, const typename T::Scalar* in, typename T::Scalar* out) const
-  {
+  EIGEN_DEVICE_FUNC void operator()(int i, const typename T::Scalar* in, typename T::Scalar* out) const {
     using namespace Eigen;
     int N = 10;
-    T x1(in+i);
-    out[i*N+0] = x1.minCoeff();
-    out[i*N+1] = x1.maxCoeff();
-    out[i*N+2] = x1.sum();
-    out[i*N+3] = x1.prod();
-    out[i*N+4] = x1.matrix().squaredNorm();
-    out[i*N+5] = x1.matrix().norm();
-    out[i*N+6] = x1.colwise().sum().maxCoeff();
-    out[i*N+7] = x1.rowwise().maxCoeff().sum();
-    out[i*N+8] = x1.matrix().colwise().squaredNorm().sum();
+    T x1(in + i);
+    out[i * N + 0] = x1.minCoeff();
+    out[i * N + 1] = x1.maxCoeff();
+    out[i * N + 2] = x1.sum();
+    out[i * N + 3] = x1.prod();
+    out[i * N + 4] = x1.matrix().squaredNorm();
+    out[i * N + 5] = x1.matrix().norm();
+    out[i * N + 6] = x1.colwise().sum().maxCoeff();
+    out[i * N + 7] = x1.rowwise().maxCoeff().sum();
+    out[i * N + 8] = x1.matrix().colwise().squaredNorm().sum();
   }
 };
 
-template<typename T1, typename T2>
+template <typename T1, typename T2>
 struct prod_test {
-  EIGEN_DEVICE_FUNC
-  void operator()(int i, const typename T1::Scalar* in, typename T1::Scalar* out) const
-  {
+  EIGEN_DEVICE_FUNC void operator()(int i, const typename T1::Scalar* in, typename T1::Scalar* out) const {
     using namespace Eigen;
     typedef Matrix<typename T1::Scalar, T1::RowsAtCompileTime, T2::ColsAtCompileTime> T3;
-    T1 x1(in+i);
-    T2 x2(in+i+1);
-    Map<T3> res(out+i*T3::MaxSizeAtCompileTime);
+    T1 x1(in + i);
+    T2 x2(in + i + 1);
+    Map<T3> res(out + i * T3::MaxSizeAtCompileTime);
     res += in[i] * x1 * x2;
   }
 };
 
-template<typename T1, typename T2>
+template <typename T1, typename T2>
 struct diagonal {
-  EIGEN_DEVICE_FUNC
-  void operator()(int i, const typename T1::Scalar* in, typename T1::Scalar* out) const
-  {
+  EIGEN_DEVICE_FUNC void operator()(int i, const typename T1::Scalar* in, typename T1::Scalar* out) const {
     using namespace Eigen;
-    T1 x1(in+i);
-    Map<T2> res(out+i*T2::MaxSizeAtCompileTime);
+    T1 x1(in + i);
+    Map<T2> res(out + i * T2::MaxSizeAtCompileTime);
     res += x1.diagonal();
   }
 };
 
-template<typename T>
+template <typename T>
 struct eigenvalues_direct {
-  EIGEN_DEVICE_FUNC
-  void operator()(int i, const typename T::Scalar* in, typename T::Scalar* out) const
-  {
+  EIGEN_DEVICE_FUNC void operator()(int i, const typename T::Scalar* in, typename T::Scalar* out) const {
     using namespace Eigen;
     typedef Matrix<typename T::Scalar, T::RowsAtCompileTime, 1> Vec;
-    T M(in+i);
-    Map<Vec> res(out+i*Vec::MaxSizeAtCompileTime);
-    T A = M*M.adjoint();
+    T M(in + i);
+    Map<Vec> res(out + i * Vec::MaxSizeAtCompileTime);
+    T A = M * M.adjoint();
     SelfAdjointEigenSolver<T> eig;
     eig.computeDirect(A);
     res = eig.eigenvalues();
   }
 };
 
-template<typename T>
+template <typename T>
 struct eigenvalues {
-  EIGEN_DEVICE_FUNC
-  void operator()(int i, const typename T::Scalar* in, typename T::Scalar* out) const
-  {
+  EIGEN_DEVICE_FUNC void operator()(int i, const typename T::Scalar* in, typename T::Scalar* out) const {
     using namespace Eigen;
     typedef Matrix<typename T::Scalar, T::RowsAtCompileTime, 1> Vec;
-    T M(in+i);
-    Map<Vec> res(out+i*Vec::MaxSizeAtCompileTime);
-    T A = M*M.adjoint();
+    T M(in + i);
+    Map<Vec> res(out + i * Vec::MaxSizeAtCompileTime);
+    T A = M * M.adjoint();
     SelfAdjointEigenSolver<T> eig;
     eig.compute(A);
     res = eig.eigenvalues();
   }
 };
 
-template<typename T>
+template <typename T>
 struct matrix_inverse {
-  EIGEN_DEVICE_FUNC
-  void operator()(int i, const typename T::Scalar* in, typename T::Scalar* out) const
-  {
+  EIGEN_DEVICE_FUNC void operator()(int i, const typename T::Scalar* in, typename T::Scalar* out) const {
     using namespace Eigen;
-    T M(in+i);
-    Map<T> res(out+i*T::MaxSizeAtCompileTime);
+    T M(in + i);
+    Map<T> res(out + i * T::MaxSizeAtCompileTime);
     res = M.inverse();
   }
 };
 
-template<typename T>
+template <typename T>
 struct numeric_limits_test {
-  EIGEN_DEVICE_FUNC
-  void operator()(int i, const typename T::Scalar* in, typename T::Scalar* out) const
-  {
+  EIGEN_DEVICE_FUNC void operator()(int i, const typename T::Scalar* in, typename T::Scalar* out) const {
     EIGEN_UNUSED_VARIABLE(in)
     int out_idx = i * 5;
     out[out_idx++] = numext::numeric_limits<float>::epsilon();
@@ -362,8 +345,9 @@
   }
 };
 
-template<typename Type1, typename Type2>
-bool verifyIsApproxWithInfsNans(const Type1& a, const Type2& b, typename Type1::Scalar* = 0) // Enabled for Eigen's type only
+template <typename Type1, typename Type2>
+bool verifyIsApproxWithInfsNans(const Type1& a, const Type2& b,
+                                typename Type1::Scalar* = 0)  // Enabled for Eigen's type only
 {
   if (a.rows() != b.rows()) {
     return false;
@@ -373,9 +357,8 @@
   }
   for (Index r = 0; r < a.rows(); ++r) {
     for (Index c = 0; c < a.cols(); ++c) {
-      if (a(r, c) != b(r, c)
-          && !((numext::isnan)(a(r, c)) && (numext::isnan)(b(r, c))) 
-          && !test_isApprox(a(r, c), b(r, c))) {
+      if (a(r, c) != b(r, c) && !((numext::isnan)(a(r, c)) && (numext::isnan)(b(r, c))) &&
+          !test_isApprox(a(r, c), b(r, c))) {
         return false;
       }
     }
@@ -383,41 +366,39 @@
   return true;
 }
 
-template<typename Kernel, typename Input, typename Output>
-void test_with_infs_nans(const Kernel& ker, int n, const Input& in, Output& out)
-{
+template <typename Kernel, typename Input, typename Output>
+void test_with_infs_nans(const Kernel& ker, int n, const Input& in, Output& out) {
   Output out_ref, out_gpu;
-  #if !defined(EIGEN_GPU_COMPILE_PHASE)
+#if !defined(EIGEN_GPU_COMPILE_PHASE)
   out_ref = out_gpu = out;
-  #else
+#else
   EIGEN_UNUSED_VARIABLE(in);
   EIGEN_UNUSED_VARIABLE(out);
-  #endif
-  run_on_cpu (ker, n, in,  out_ref);
+#endif
+  run_on_cpu(ker, n, in, out_ref);
   run_on_gpu(ker, n, in, out_gpu);
-  #if !defined(EIGEN_GPU_COMPILE_PHASE)
+#if !defined(EIGEN_GPU_COMPILE_PHASE)
   verifyIsApproxWithInfsNans(out_ref, out_gpu);
-  #endif
+#endif
 }
 
-EIGEN_DECLARE_TEST(gpu_basic)
-{
+EIGEN_DECLARE_TEST(gpu_basic) {
   ei_test_init_gpu();
-  
+
   int nthreads = 100;
   Eigen::VectorXf in, out;
   Eigen::VectorXcf cfin, cfout;
-  
-  #if !defined(EIGEN_GPU_COMPILE_PHASE)
+
+#if !defined(EIGEN_GPU_COMPILE_PHASE)
   int data_size = nthreads * 512;
   in.setRandom(data_size);
   out.setConstant(data_size, -1);
   cfin.setRandom(data_size);
   cfout.setConstant(data_size, -1);
-  #endif
-  
-  CALL_SUBTEST( run_and_compare_to_gpu(coeff_wise<Vector3f>(), nthreads, in, out) );
-  CALL_SUBTEST( run_and_compare_to_gpu(coeff_wise<Array44f>(), nthreads, in, out) );
+#endif
+
+  CALL_SUBTEST(run_and_compare_to_gpu(coeff_wise<Vector3f>(), nthreads, in, out));
+  CALL_SUBTEST(run_and_compare_to_gpu(coeff_wise<Array44f>(), nthreads, in, out));
 
 #if !defined(EIGEN_USE_HIP)
   // FIXME
@@ -425,40 +406,41 @@
   //
   //  eigen-upstream/Eigen/src/Core/Replicate.h:61:65: error:
   //           base class 'internal::dense_xpr_base<Replicate<Array<float, 4, 1, 0, 4, 1>, -1, -1> >::type'
-  //           (aka 'ArrayBase<Eigen::Replicate<Eigen::Array<float, 4, 1, 0, 4, 1>, -1, -1> >') has protected default constructor
-  CALL_SUBTEST( run_and_compare_to_gpu(replicate<Array4f>(), nthreads, in, out) );
-  CALL_SUBTEST( run_and_compare_to_gpu(replicate<Array33f>(), nthreads, in, out) );
+  //           (aka 'ArrayBase<Eigen::Replicate<Eigen::Array<float, 4, 1, 0, 4, 1>, -1, -1> >') has protected default
+  //           constructor
+  CALL_SUBTEST(run_and_compare_to_gpu(replicate<Array4f>(), nthreads, in, out));
+  CALL_SUBTEST(run_and_compare_to_gpu(replicate<Array33f>(), nthreads, in, out));
 
   // HIP does not support new/delete on device.
-  CALL_SUBTEST( run_and_compare_to_gpu(alloc_new_delete<Vector3f>(), nthreads, in, out) );
+  CALL_SUBTEST(run_and_compare_to_gpu(alloc_new_delete<Vector3f>(), nthreads, in, out));
 #endif
-  
-  CALL_SUBTEST( run_and_compare_to_gpu(redux<Array4f>(), nthreads, in, out) );
-  CALL_SUBTEST( run_and_compare_to_gpu(redux<Matrix3f>(), nthreads, in, out) );
-  
-  CALL_SUBTEST( run_and_compare_to_gpu(prod_test<Matrix3f,Matrix3f>(), nthreads, in, out) );
-  CALL_SUBTEST( run_and_compare_to_gpu(prod_test<Matrix4f,Vector4f>(), nthreads, in, out) );
-  
-  CALL_SUBTEST( run_and_compare_to_gpu(diagonal<Matrix3f,Vector3f>(), nthreads, in, out) );
-  CALL_SUBTEST( run_and_compare_to_gpu(diagonal<Matrix4f,Vector4f>(), nthreads, in, out) );
 
-  CALL_SUBTEST( run_and_compare_to_gpu(matrix_inverse<Matrix2f>(), nthreads, in, out) );
-  CALL_SUBTEST( run_and_compare_to_gpu(matrix_inverse<Matrix3f>(), nthreads, in, out) );
-  CALL_SUBTEST( run_and_compare_to_gpu(matrix_inverse<Matrix4f>(), nthreads, in, out) );
-  
-  CALL_SUBTEST( run_and_compare_to_gpu(eigenvalues_direct<Matrix3f>(), nthreads, in, out) );
-  CALL_SUBTEST( run_and_compare_to_gpu(eigenvalues_direct<Matrix2f>(), nthreads, in, out) );
+  CALL_SUBTEST(run_and_compare_to_gpu(redux<Array4f>(), nthreads, in, out));
+  CALL_SUBTEST(run_and_compare_to_gpu(redux<Matrix3f>(), nthreads, in, out));
+
+  CALL_SUBTEST(run_and_compare_to_gpu(prod_test<Matrix3f, Matrix3f>(), nthreads, in, out));
+  CALL_SUBTEST(run_and_compare_to_gpu(prod_test<Matrix4f, Vector4f>(), nthreads, in, out));
+
+  CALL_SUBTEST(run_and_compare_to_gpu(diagonal<Matrix3f, Vector3f>(), nthreads, in, out));
+  CALL_SUBTEST(run_and_compare_to_gpu(diagonal<Matrix4f, Vector4f>(), nthreads, in, out));
+
+  CALL_SUBTEST(run_and_compare_to_gpu(matrix_inverse<Matrix2f>(), nthreads, in, out));
+  CALL_SUBTEST(run_and_compare_to_gpu(matrix_inverse<Matrix3f>(), nthreads, in, out));
+  CALL_SUBTEST(run_and_compare_to_gpu(matrix_inverse<Matrix4f>(), nthreads, in, out));
+
+  CALL_SUBTEST(run_and_compare_to_gpu(eigenvalues_direct<Matrix3f>(), nthreads, in, out));
+  CALL_SUBTEST(run_and_compare_to_gpu(eigenvalues_direct<Matrix2f>(), nthreads, in, out));
 
   // Test std::complex.
-  CALL_SUBTEST( run_and_compare_to_gpu(complex_operators<Vector3cf>(), nthreads, cfin, cfout) );
-  CALL_SUBTEST( test_with_infs_nans(complex_sqrt<Vector3cf>(), nthreads, cfin, cfout) );
+  CALL_SUBTEST(run_and_compare_to_gpu(complex_operators<Vector3cf>(), nthreads, cfin, cfout));
+  CALL_SUBTEST(test_with_infs_nans(complex_sqrt<Vector3cf>(), nthreads, cfin, cfout));
 
   // numeric_limits
-  CALL_SUBTEST( test_with_infs_nans(numeric_limits_test<Vector3f>(), 1, in, out) );
+  CALL_SUBTEST(test_with_infs_nans(numeric_limits_test<Vector3f>(), 1, in, out));
 
   // These tests require dynamic-sized matrix multiplcation, which isn't currently
   // supported on GPU.
-  
+
   // CALL_SUBTEST( run_and_compare_to_gpu(eigenvalues<Matrix4f>(), nthreads, in, out) );
   // typedef Matrix<float,6,6> Matrix6f;
   // CALL_SUBTEST( run_and_compare_to_gpu(eigenvalues<Matrix6f>(), nthreads, in, out) );
diff --git a/test/gpu_common.h b/test/gpu_common.h
index 659babe..03b9e8f 100644
--- a/test/gpu_common.h
+++ b/test/gpu_common.h
@@ -2,12 +2,12 @@
 #define EIGEN_TEST_GPU_COMMON_H
 
 #ifdef EIGEN_USE_HIP
-  #include <hip/hip_runtime.h>
-  #include <hip/hip_runtime_api.h>
+#include <hip/hip_runtime.h>
+#include <hip/hip_runtime_api.h>
 #else
-  #include <cuda.h>
-  #include <cuda_runtime.h>
-  #include <cuda_runtime_api.h>
+#include <cuda.h>
+#include <cuda_runtime.h>
+#include <cuda_runtime_api.h>
 #endif
 
 #include <iostream>
@@ -16,54 +16,46 @@
 dim3 threadIdx, blockDim, blockIdx;
 #endif
 
-template<typename Kernel, typename Input, typename Output>
-void run_on_cpu(const Kernel& ker, int n, const Input& in, Output& out)
-{
-  for(int i=0; i<n; i++)
-    ker(i, in.data(), out.data());
+template <typename Kernel, typename Input, typename Output>
+void run_on_cpu(const Kernel& ker, int n, const Input& in, Output& out) {
+  for (int i = 0; i < n; i++) ker(i, in.data(), out.data());
 }
 
-
-template<typename Kernel, typename Input, typename Output>
-__global__
-EIGEN_HIP_LAUNCH_BOUNDS_1024
-void run_on_gpu_meta_kernel(const Kernel ker, int n, const Input* in, Output* out)
-{
-  int i = threadIdx.x + blockIdx.x*blockDim.x;
-  if(i<n) {
+template <typename Kernel, typename Input, typename Output>
+__global__ EIGEN_HIP_LAUNCH_BOUNDS_1024 void run_on_gpu_meta_kernel(const Kernel ker, int n, const Input* in,
+                                                                    Output* out) {
+  int i = threadIdx.x + blockIdx.x * blockDim.x;
+  if (i < n) {
     ker(i, in, out);
   }
 }
 
-
-template<typename Kernel, typename Input, typename Output>
-void run_on_gpu(const Kernel& ker, int n, const Input& in, Output& out)
-{
-  typename Input::Scalar*  d_in;
+template <typename Kernel, typename Input, typename Output>
+void run_on_gpu(const Kernel& ker, int n, const Input& in, Output& out) {
+  typename Input::Scalar* d_in;
   typename Output::Scalar* d_out;
-  std::ptrdiff_t in_bytes  = in.size()  * sizeof(typename Input::Scalar);
+  std::ptrdiff_t in_bytes = in.size() * sizeof(typename Input::Scalar);
   std::ptrdiff_t out_bytes = out.size() * sizeof(typename Output::Scalar);
-  
-  gpuMalloc((void**)(&d_in),  in_bytes);
+
+  gpuMalloc((void**)(&d_in), in_bytes);
   gpuMalloc((void**)(&d_out), out_bytes);
-  
-  gpuMemcpy(d_in,  in.data(),  in_bytes,  gpuMemcpyHostToDevice);
+
+  gpuMemcpy(d_in, in.data(), in_bytes, gpuMemcpyHostToDevice);
   gpuMemcpy(d_out, out.data(), out_bytes, gpuMemcpyHostToDevice);
-  
+
   // Simple and non-optimal 1D mapping assuming n is not too large
   // That's only for unit testing!
   dim3 Blocks(128);
-  dim3 Grids( (n+int(Blocks.x)-1)/int(Blocks.x) );
+  dim3 Grids((n + int(Blocks.x) - 1) / int(Blocks.x));
 
   gpuDeviceSynchronize();
-  
+
 #ifdef EIGEN_USE_HIP
-  hipLaunchKernelGGL(HIP_KERNEL_NAME(run_on_gpu_meta_kernel<Kernel,
-				     typename std::decay<decltype(*d_in)>::type,
-				     typename std::decay<decltype(*d_out)>::type>), 
-		     dim3(Grids), dim3(Blocks), 0, 0, ker, n, d_in, d_out);
+  hipLaunchKernelGGL(HIP_KERNEL_NAME(run_on_gpu_meta_kernel<Kernel, typename std::decay<decltype(*d_in)>::type,
+                                                            typename std::decay<decltype(*d_out)>::type>),
+                     dim3(Grids), dim3(Blocks), 0, 0, ker, n, d_in, d_out);
 #else
-  run_on_gpu_meta_kernel<<<Grids,Blocks>>>(ker, n, d_in, d_out);
+  run_on_gpu_meta_kernel<<<Grids, Blocks> > >(ker, n, d_in, d_out);
 #endif
   // Pre-launch errors.
   gpuError_t err = gpuGetLastError();
@@ -71,90 +63,83 @@
     printf("%s: %s\n", gpuGetErrorName(err), gpuGetErrorString(err));
     gpu_assert(false);
   }
-  
+
   // Kernel execution errors.
   err = gpuDeviceSynchronize();
   if (err != gpuSuccess) {
     printf("%s: %s\n", gpuGetErrorName(err), gpuGetErrorString(err));
     gpu_assert(false);
   }
-  
-  
+
   // check inputs have not been modified
-  gpuMemcpy(const_cast<typename Input::Scalar*>(in.data()),  d_in,  in_bytes,  gpuMemcpyDeviceToHost);
+  gpuMemcpy(const_cast<typename Input::Scalar*>(in.data()), d_in, in_bytes, gpuMemcpyDeviceToHost);
   gpuMemcpy(out.data(), d_out, out_bytes, gpuMemcpyDeviceToHost);
-  
+
   gpuFree(d_in);
   gpuFree(d_out);
 }
 
-
-template<typename Kernel, typename Input, typename Output>
-void run_and_compare_to_gpu(const Kernel& ker, int n, const Input& in, Output& out)
-{
-  Input  in_ref,  in_gpu;
+template <typename Kernel, typename Input, typename Output>
+void run_and_compare_to_gpu(const Kernel& ker, int n, const Input& in, Output& out) {
+  Input in_ref, in_gpu;
   Output out_ref, out_gpu;
-  #if !defined(EIGEN_GPU_COMPILE_PHASE)
+#if !defined(EIGEN_GPU_COMPILE_PHASE)
   in_ref = in_gpu = in;
   out_ref = out_gpu = out;
-  #else
+#else
   EIGEN_UNUSED_VARIABLE(in);
   EIGEN_UNUSED_VARIABLE(out);
-  #endif
-  run_on_cpu (ker, n, in_ref,  out_ref);
+#endif
+  run_on_cpu(ker, n, in_ref, out_ref);
   run_on_gpu(ker, n, in_gpu, out_gpu);
-  #if !defined(EIGEN_GPU_COMPILE_PHASE)
+#if !defined(EIGEN_GPU_COMPILE_PHASE)
   VERIFY_IS_APPROX(in_ref, in_gpu);
   VERIFY_IS_APPROX(out_ref, out_gpu);
-  #endif
+#endif
 }
 
 struct compile_time_device_info {
-  EIGEN_DEVICE_FUNC
-  void operator()(int i, const int* /*in*/, int* info) const
-  {
+  EIGEN_DEVICE_FUNC void operator()(int i, const int* /*in*/, int* info) const {
     if (i == 0) {
       EIGEN_UNUSED_VARIABLE(info)
-      #if defined(__CUDA_ARCH__)
-      info[0] = int(__CUDA_ARCH__ +0);
-      #endif
-      #if defined(EIGEN_HIP_DEVICE_COMPILE)
-      info[1] = int(EIGEN_HIP_DEVICE_COMPILE +0);
-      #endif
+#if defined(__CUDA_ARCH__)
+      info[0] = int(__CUDA_ARCH__ + 0);
+#endif
+#if defined(EIGEN_HIP_DEVICE_COMPILE)
+      info[1] = int(EIGEN_HIP_DEVICE_COMPILE + 0);
+#endif
     }
   }
 };
 
-void ei_test_init_gpu()
-{
+void ei_test_init_gpu() {
   int device = 0;
   gpuDeviceProp_t deviceProp;
   gpuGetDeviceProperties(&deviceProp, device);
 
   ArrayXi dummy(1), info(10);
   info = -1;
-  run_on_gpu(compile_time_device_info(),10,dummy,info);
-
+  run_on_gpu(compile_time_device_info(), 10, dummy, info);
 
   std::cout << "GPU compile-time info:\n";
-  
-  #ifdef EIGEN_CUDACC
+
+#ifdef EIGEN_CUDACC
   std::cout << "  EIGEN_CUDACC:                 " << int(EIGEN_CUDACC) << "\n";
-  #endif
-  
-  #ifdef EIGEN_CUDA_SDK_VER
+#endif
+
+#ifdef EIGEN_CUDA_SDK_VER
   std::cout << "  EIGEN_CUDA_SDK_VER:             " << int(EIGEN_CUDA_SDK_VER) << "\n";
-  #endif
+#endif
 
-  #if EIGEN_COMP_NVCC
+#if EIGEN_COMP_NVCC
   std::cout << "  EIGEN_COMP_NVCC:             " << int(EIGEN_COMP_NVCC) << "\n";
-  #endif
-  
-  #ifdef EIGEN_HIPCC
-  std::cout << "  EIGEN_HIPCC:                 " << int(EIGEN_HIPCC) << "\n";
-  #endif
+#endif
 
-  std::cout << "  EIGEN_CUDA_ARCH:             " << info[0] << "\n";  
+#ifdef EIGEN_HIPCC
+  std::cout << "  EIGEN_HIPCC:                 " << int(EIGEN_HIPCC) << "\n";
+#endif
+
+  std::cout << "  EIGEN_CUDA_ARCH:             " << info[0] << "\n";
   std::cout << "  EIGEN_HIP_DEVICE_COMPILE:    " << info[1] << "\n";
 
   std::cout << "GPU device info:\n";
@@ -170,4 +155,4 @@
   std::cout << "  computeMode:                 " << deviceProp.computeMode << "\n";
 }
 
-#endif // EIGEN_TEST_GPU_COMMON_H
+#endif  // EIGEN_TEST_GPU_COMMON_H
diff --git a/test/gpu_example.cu b/test/gpu_example.cu
index d4715cf..cb5ea30 100644
--- a/test/gpu_example.cu
+++ b/test/gpu_example.cu
@@ -18,11 +18,10 @@
 struct AddKernel {
   // Parameters must be POD or serializable Eigen types (e.g. Matrix,
   // Array). The return value must be a POD or serializable value type.
-  template<typename Type1, typename Type2, typename Type3>
-  EIGEN_DEVICE_FUNC
-  Type3 operator()(const Type1& A, const Type2& B, Type3& C) const {
-    C = A + B;       // Populate output parameter.
-    Type3 D = A + B; // Populate return value.
+  template <typename Type1, typename Type2, typename Type3>
+  EIGEN_DEVICE_FUNC Type3 operator()(const Type1& A, const Type2& B, Type3& C) const {
+    C = A + B;        // Populate output parameter.
+    Type3 D = A + B;  // Populate return value.
     return D;
   }
 };
@@ -36,7 +35,7 @@
   // Create random inputs.
   const T A = T::Random(rows, cols);
   const T B = T::Random(rows, cols);
-  T C; // Output parameter.
+  T C;  // Output parameter.
 
   // Create kernel.
   AddKernel add_kernel;
@@ -54,16 +53,15 @@
   // In a GPU-only test, we can verify that the CPU and GPU produce the
   // same results.
   T C_cpu, C_gpu;
-  T D_cpu = run_on_cpu(add_kernel, A, B, C_cpu); // Runs on CPU.
-  T D_gpu = run_on_gpu(add_kernel, A, B, C_gpu); // Runs on GPU.
+  T D_cpu = run_on_cpu(add_kernel, A, B, C_cpu);  // Runs on CPU.
+  T D_gpu = run_on_gpu(add_kernel, A, B, C_gpu);  // Runs on GPU.
   VERIFY_IS_CWISE_EQUAL(C_cpu, C_gpu);
   VERIFY_IS_CWISE_EQUAL(D_cpu, D_gpu);
 };
 
 struct MultiplyKernel {
-  template<typename Type1, typename Type2, typename Type3>
-  EIGEN_DEVICE_FUNC
-  Type3 operator()(const Type1& A, const Type2& B, Type3& C) const {
+  template <typename Type1, typename Type2, typename Type3>
+  EIGEN_DEVICE_FUNC Type3 operator()(const Type1& A, const Type2& B, Type3& C) const {
     C = A * B;
     return A * B;
   }
@@ -85,9 +83,9 @@
 
   // 2 outputs of size (A * B). For each matrix output, the buffer will store
   // the number of rows, columns, and the data.
-  size_t buffer_capacity_hint = 2 * (                     // 2 output parameters
-    2 * sizeof(typename T3::Index)                        // # Rows, # Cols
-    + A.rows() * B.cols() * sizeof(typename T3::Scalar)); // Output data
+  size_t buffer_capacity_hint = 2 * (                                                          // 2 output parameters
+                                        2 * sizeof(typename T3::Index)                         // # Rows, # Cols
+                                        + A.rows() * B.cols() * sizeof(typename T3::Scalar));  // Output data
 
   T3 D = run_with_hint(buffer_capacity_hint, multiply_kernel, A, B, C);
 
@@ -97,34 +95,26 @@
 
   T3 C_cpu, C_gpu;
   T3 D_cpu = run_on_cpu(multiply_kernel, A, B, C_cpu);
-  T3 D_gpu = run_on_gpu_with_hint(buffer_capacity_hint,
-                                  multiply_kernel, A, B, C_gpu);
+  T3 D_gpu = run_on_gpu_with_hint(buffer_capacity_hint, multiply_kernel, A, B, C_gpu);
   VERIFY_IS_CWISE_APPROX(C_cpu, C_gpu);
   VERIFY_IS_CWISE_APPROX(D_cpu, D_gpu);
 }
 
 // Declare the test fixture.
-EIGEN_DECLARE_TEST(gpu_example)
-{
+EIGEN_DECLARE_TEST(gpu_example) {
   // For the number of repeats, call the desired subtests.
-  for(int i = 0; i < g_repeat; i++) {
+  for (int i = 0; i < g_repeat; i++) {
     // Call subtests with different sized/typed inputs.
-    CALL_SUBTEST( test_add(Eigen::Vector3f()) );
-    CALL_SUBTEST( test_add(Eigen::Matrix3d()) );
-    CALL_SUBTEST( test_add(Eigen::MatrixX<int>(10, 10)) );
+    CALL_SUBTEST(test_add(Eigen::Vector3f()));
+    CALL_SUBTEST(test_add(Eigen::Matrix3d()));
+    CALL_SUBTEST(test_add(Eigen::MatrixX<int>(10, 10)));
 
-    CALL_SUBTEST( test_add(Eigen::Array44f()) );
-    CALL_SUBTEST( test_add(Eigen::ArrayXd(20)) );
-    CALL_SUBTEST( test_add(Eigen::ArrayXXi(13, 17)) );
+    CALL_SUBTEST(test_add(Eigen::Array44f()));
+    CALL_SUBTEST(test_add(Eigen::ArrayXd(20)));
+    CALL_SUBTEST(test_add(Eigen::ArrayXXi(13, 17)));
 
-    CALL_SUBTEST( test_multiply(Eigen::Matrix3d(),
-                                Eigen::Matrix3d(),
-                                Eigen::Matrix3d()) );
-    CALL_SUBTEST( test_multiply(Eigen::MatrixX<int>(10, 10),
-                                Eigen::MatrixX<int>(10, 10),
-                                Eigen::MatrixX<int>()) );
-    CALL_SUBTEST( test_multiply(Eigen::MatrixXf(12, 1),
-                                Eigen::MatrixXf(1, 32),
-                                Eigen::MatrixXf()) );
+    CALL_SUBTEST(test_multiply(Eigen::Matrix3d(), Eigen::Matrix3d(), Eigen::Matrix3d()));
+    CALL_SUBTEST(test_multiply(Eigen::MatrixX<int>(10, 10), Eigen::MatrixX<int>(10, 10), Eigen::MatrixX<int>()));
+    CALL_SUBTEST(test_multiply(Eigen::MatrixXf(12, 1), Eigen::MatrixXf(1, 32), Eigen::MatrixXf()));
   }
 }
diff --git a/test/gpu_test_helper.h b/test/gpu_test_helper.h
index ca9378b..bbf766d 100644
--- a/test/gpu_test_helper.h
+++ b/test/gpu_test_helper.h
@@ -29,20 +29,20 @@
 namespace test_detail {
 // Use std::tuple on CPU, otherwise use the GPU-specific versions.
 #if !EIGEN_USE_CUSTOM_TUPLE
-using std::tuple;
 using std::get;
 using std::make_tuple;
 using std::tie;
+using std::tuple;
 #else
-using tuple_impl::tuple;
 using tuple_impl::get;
 using tuple_impl::make_tuple;
 using tuple_impl::tie;
+using tuple_impl::tuple;
 #endif
 #undef EIGEN_USE_CUSTOM_TUPLE
 }  // namespace test_detail
 
-template<size_t N, size_t Idx, typename OutputIndexSequence, typename... Ts>
+template <size_t N, size_t Idx, typename OutputIndexSequence, typename... Ts>
 struct extract_output_indices_helper;
 
 /**
@@ -56,70 +56,63 @@
  * \tparam T1 the next type to consider, with index Idx.
  * \tparam Ts the remaining types.
  */
-template<size_t N, size_t Idx, size_t... OutputIndices, typename T1, typename... Ts>
+template <size_t N, size_t Idx, size_t... OutputIndices, typename T1, typename... Ts>
 struct extract_output_indices_helper<N, Idx, std::index_sequence<OutputIndices...>, T1, Ts...> {
-  using type = typename
-    extract_output_indices_helper<
+  using type = typename extract_output_indices_helper<
       N - 1, Idx + 1,
       typename std::conditional<
-        // If is a non-const l-value reference, append index.
-        std::is_lvalue_reference<T1>::value 
-          && !std::is_const<std::remove_reference_t<T1>>::value,
-        std::index_sequence<OutputIndices..., Idx>,
-        std::index_sequence<OutputIndices...> >::type,
+          // If is a non-const l-value reference, append index.
+          std::is_lvalue_reference<T1>::value && !std::is_const<std::remove_reference_t<T1>>::value,
+          std::index_sequence<OutputIndices..., Idx>, std::index_sequence<OutputIndices...>>::type,
       Ts...>::type;
 };
 
 // Base case.
-template<size_t Idx, size_t... OutputIndices>
-struct extract_output_indices_helper<0, Idx, std::index_sequence<OutputIndices...> > {
+template <size_t Idx, size_t... OutputIndices>
+struct extract_output_indices_helper<0, Idx, std::index_sequence<OutputIndices...>> {
   using type = std::index_sequence<OutputIndices...>;
 };
 
 // Extracts a set of indices into Types... that correspond to non-const
 // l-value references.
-template<typename... Types>
-using extract_output_indices = typename extract_output_indices_helper<sizeof...(Types), 0, std::index_sequence<>, Types...>::type;
+template <typename... Types>
+using extract_output_indices =
+    typename extract_output_indices_helper<sizeof...(Types), 0, std::index_sequence<>, Types...>::type;
 
 // Helper struct for dealing with Generic functors that may return void.
 struct void_helper {
   struct Void {};
-  
+
   // Converts void -> Void, T otherwise.
-  template<typename T>
+  template <typename T>
   using ReturnType = typename std::conditional<std::is_same<T, void>::value, Void, T>::type;
-  
+
   // Non-void return value.
-  template<typename Func, typename... Args>
-  static EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC
-  auto call(Func&& func, Args&&... args) -> 
-      std::enable_if_t<!std::is_same<decltype(func(args...)), void>::value,
-                       decltype(func(args...))> {
+  template <typename Func, typename... Args>
+  static EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC auto call(Func&& func, Args&&... args)
+      -> std::enable_if_t<!std::is_same<decltype(func(args...)), void>::value, decltype(func(args...))> {
     return func(std::forward<Args>(args)...);
   }
-  
+
   // Void return value.
-  template<typename Func, typename... Args>
-  static EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC
-  auto call(Func&& func, Args&&... args) -> 
-    std::enable_if_t<std::is_same<decltype(func(args...)), void>::value,
-                     Void> {
+  template <typename Func, typename... Args>
+  static EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC auto call(Func&& func, Args&&... args)
+      -> std::enable_if_t<std::is_same<decltype(func(args...)), void>::value, Void> {
     func(std::forward<Args>(args)...);
     return Void{};
   }
-  
+
   // Restores the original return type, Void -> void, T otherwise.
-  template<typename T>
+  template <typename T>
   static EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC
-  std::enable_if_t<!std::is_same<typename std::decay<T>::type, Void>::value, T>
-  restore(T&& val) {
+      std::enable_if_t<!std::is_same<typename std::decay<T>::type, Void>::value, T>
+      restore(T&& val) {
     return val;
   }
-  
+
   // Void case.
-  template<typename T = void>
-  static EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC
-  void restore(const Void&) {}
+  template <typename T = void>
+  static EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC void restore(const Void&) {}
 };
 
 // Runs a kernel via serialized buffer.  Does this by deserializing the buffer
@@ -130,10 +123,9 @@
 //     [ output_buffer_size, output_parameters, return_value ]
 // If the output_buffer_size exceeds the buffer's capacity, then only the
 // output_buffer_size is populated.
-template<typename Kernel, typename... Args, size_t... Indices, size_t... OutputIndices>
-EIGEN_DEVICE_FUNC
-void run_serialized(std::index_sequence<Indices...>, std::index_sequence<OutputIndices...>,
-                    Kernel kernel, uint8_t* buffer, size_t capacity) {
+template <typename Kernel, typename... Args, size_t... Indices, size_t... OutputIndices>
+EIGEN_DEVICE_FUNC void run_serialized(std::index_sequence<Indices...>, std::index_sequence<OutputIndices...>,
+                                      Kernel kernel, uint8_t* buffer, size_t capacity) {
   using test_detail::get;
   using test_detail::make_tuple;
   using test_detail::tuple;
@@ -144,19 +136,19 @@
   read_ptr = Eigen::deserialize(read_ptr, read_end, input_size);
   // Create value-type instances to populate.
   auto args = make_tuple(typename std::decay<Args>::type{}...);
-  EIGEN_UNUSED_VARIABLE(args) // Avoid NVCC compile warning.
+  EIGEN_UNUSED_VARIABLE(args)  // Avoid NVCC compile warning.
   // NVCC 9.1 requires us to spell out the template parameters explicitly.
   read_ptr = Eigen::deserialize(read_ptr, read_end, get<Indices, typename std::decay<Args>::type...>(args)...);
-  
+
   // Call function, with void->Void conversion so we are guaranteed a complete
   // output type.
   auto result = void_helper::call(kernel, get<Indices, typename std::decay<Args>::type...>(args)...);
-  
+
   // Determine required output size.
   size_t output_size = Eigen::serialize_size(capacity);
   output_size += Eigen::serialize_size(get<OutputIndices, typename std::decay<Args>::type...>(args)...);
   output_size += Eigen::serialize_size(result);
-  
+
   // Always serialize required buffer size.
   uint8_t* write_ptr = buffer;
   uint8_t* write_end = buffer + capacity;
@@ -170,48 +162,44 @@
   }
 }
 
-template<typename Kernel, typename... Args>
-EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
-void run_serialized(Kernel kernel, uint8_t* buffer, size_t capacity) {
-  run_serialized<Kernel, Args...> (std::make_index_sequence<sizeof...(Args)>{},
-                                   extract_output_indices<Args...>{},
-                                   kernel, buffer, capacity);
+template <typename Kernel, typename... Args>
+EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run_serialized(Kernel kernel, uint8_t* buffer, size_t capacity) {
+  run_serialized<Kernel, Args...>(std::make_index_sequence<sizeof...(Args)>{}, extract_output_indices<Args...>{},
+                                  kernel, buffer, capacity);
 }
 
 #ifdef EIGEN_GPUCC
 
 // Checks for GPU errors and asserts / prints the error message.
-#define GPU_CHECK(expr)                                                \
-do {                                                                   \
-  gpuError_t err = expr;                                               \
-  if (err != gpuSuccess) {                                             \
-    printf("%s: %s\n", gpuGetErrorName(err), gpuGetErrorString(err));  \
-    gpu_assert(false);                                                 \
-  }                                                                    \
-} while(0)
+#define GPU_CHECK(expr)                                                 \
+  do {                                                                  \
+    gpuError_t err = expr;                                              \
+    if (err != gpuSuccess) {                                            \
+      printf("%s: %s\n", gpuGetErrorName(err), gpuGetErrorString(err)); \
+      gpu_assert(false);                                                \
+    }                                                                   \
+  } while (0)
 
 // Calls run_serialized on the GPU.
-template<typename Kernel, typename... Args>
-__global__
-EIGEN_HIP_LAUNCH_BOUNDS_1024
-void run_serialized_on_gpu_meta_kernel(const Kernel kernel, uint8_t* buffer, size_t capacity) {
+template <typename Kernel, typename... Args>
+__global__ EIGEN_HIP_LAUNCH_BOUNDS_1024 void run_serialized_on_gpu_meta_kernel(const Kernel kernel, uint8_t* buffer,
+                                                                               size_t capacity) {
   run_serialized<Kernel, Args...>(kernel, buffer, capacity);
 }
 
-// Runs kernel(args...) on the GPU via the serialization mechanism. 
+// Runs kernel(args...) on the GPU via the serialization mechanism.
 //
 // Note: this may end up calling the kernel multiple times if the initial output
 // buffer is not large enough to hold the outputs.
-template<typename Kernel, typename... Args, size_t... Indices, size_t... OutputIndices>
-auto run_serialized_on_gpu(size_t buffer_capacity_hint,
-                           std::index_sequence<Indices...>,
-                           std::index_sequence<OutputIndices...>,
-                           Kernel kernel, Args&&... args) -> decltype(kernel(args...)) {  
+template <typename Kernel, typename... Args, size_t... Indices, size_t... OutputIndices>
+auto run_serialized_on_gpu(size_t buffer_capacity_hint, std::index_sequence<Indices...>,
+                           std::index_sequence<OutputIndices...>, Kernel kernel, Args&&... args)
+    -> decltype(kernel(args...)) {
   // Compute the required serialization buffer capacity.
   // Round up input size to next power of two to give a little extra room
   // for outputs.
   size_t input_data_size = sizeof(size_t) + Eigen::serialize_size(args...);
-  
+
   size_t capacity;
   if (buffer_capacity_hint == 0) {
     // Estimate as the power of two larger than the total input size.
@@ -223,17 +211,16 @@
     // Use the larger of the hint and the total input size.
     // Add sizeof(size_t) to the hint to account for storing the buffer capacity
     // itself so the user doesn't need to think about this.
-    capacity = std::max<size_t>(buffer_capacity_hint + sizeof(size_t),
-                                input_data_size);
+    capacity = std::max<size_t>(buffer_capacity_hint + sizeof(size_t), input_data_size);
   }
   std::vector<uint8_t> buffer(capacity);
-  
+
   uint8_t* host_data = nullptr;
   uint8_t* host_data_end = nullptr;
   uint8_t* host_ptr = nullptr;
   uint8_t* device_data = nullptr;
   size_t output_data_size = 0;
-  
+
   // Allocate buffers and copy input data.
   capacity = std::max<size_t>(capacity, output_data_size);
   buffer.resize(capacity);
@@ -241,21 +228,19 @@
   host_data_end = buffer.data() + capacity;
   host_ptr = Eigen::serialize(host_data, host_data_end, input_data_size);
   host_ptr = Eigen::serialize(host_ptr, host_data_end, args...);
-  
+
   // Copy inputs to host.
   gpuMalloc((void**)(&device_data), capacity);
   gpuMemcpy(device_data, buffer.data(), input_data_size, gpuMemcpyHostToDevice);
   GPU_CHECK(gpuDeviceSynchronize());
-      
-  // Run kernel.
-  #ifdef EIGEN_USE_HIP
-    hipLaunchKernelGGL(
-        HIP_KERNEL_NAME(run_serialized_on_gpu_meta_kernel<Kernel, Args...>), 
-        1, 1, 0, 0, kernel, device_data, capacity);
-  #else
-    run_serialized_on_gpu_meta_kernel<Kernel, Args...><<<1,1>>>(
-        kernel, device_data, capacity);
-  #endif
+
+// Run kernel.
+#ifdef EIGEN_USE_HIP
+  hipLaunchKernelGGL(HIP_KERNEL_NAME(run_serialized_on_gpu_meta_kernel<Kernel, Args...>), 1, 1, 0, 0, kernel,
+                     device_data, capacity);
+#else
+  run_serialized_on_gpu_meta_kernel<Kernel, Args...><<<1, 1>>>(kernel, device_data, capacity);
+#endif
   // Check pre-launch and kernel execution errors.
   GPU_CHECK(gpuGetLastError());
   GPU_CHECK(gpuDeviceSynchronize());
@@ -263,34 +248,32 @@
   gpuMemcpy(host_data, device_data, capacity, gpuMemcpyDeviceToHost);
   gpuFree(device_data);
   GPU_CHECK(gpuDeviceSynchronize());
-  
+
   // Determine output buffer size.
   const uint8_t* c_host_ptr = Eigen::deserialize(host_data, host_data_end, output_data_size);
   // If the output doesn't fit in the buffer, spit out warning and fail.
   if (output_data_size > capacity) {
-    std::cerr << "The serialized output does not fit in the output buffer, "
-              << output_data_size << " vs capacity " << capacity << "."
-              << std::endl
+    std::cerr << "The serialized output does not fit in the output buffer, " << output_data_size << " vs capacity "
+              << capacity << "." << std::endl
               << "Try specifying a minimum buffer capacity: " << std::endl
-              << "  run_with_hint(" << output_data_size << ", ...)"
-              << std::endl;
+              << "  run_with_hint(" << output_data_size << ", ...)" << std::endl;
     VERIFY(false);
   }
-  
+
   // Deserialize outputs.
   auto args_tuple = test_detail::tie(args...);
   EIGEN_UNUSED_VARIABLE(args_tuple)  // Avoid NVCC compile warning.
   c_host_ptr = Eigen::deserialize(c_host_ptr, host_data_end, test_detail::get<OutputIndices, Args&...>(args_tuple)...);
-  
+
   // Maybe deserialize return value, properly handling void.
   typename void_helper::ReturnType<decltype(kernel(args...))> result;
   c_host_ptr = Eigen::deserialize(c_host_ptr, host_data_end, result);
   return void_helper::restore(result);
 }
 
-#endif // EIGEN_GPUCC
+#endif  // EIGEN_GPUCC
 
-} // namespace internal
+}  // namespace internal
 
 /**
  * Runs a kernel on the CPU, returning the results.
@@ -298,8 +281,8 @@
  * \param args ... input arguments.
  * \return kernel(args...).
  */
-template<typename Kernel, typename... Args>
-auto run_on_cpu(Kernel kernel, Args&&... args) -> decltype(kernel(args...)){  
+template <typename Kernel, typename... Args>
+auto run_on_cpu(Kernel kernel, Args&&... args) -> decltype(kernel(args...)) {
   return kernel(std::forward<Args>(args)...);
 }
 
@@ -307,23 +290,21 @@
 
 /**
  * Runs a kernel on the GPU, returning the results.
- * 
+ *
  * The kernel must be able to be passed directly as an input to a global
  * function (i.e. empty or POD).  Its inputs must be "Serializable" so we
  * can transfer them to the device, and the output must be a Serializable value
  * type so it can be transferred back from the device.
- * 
+ *
  * \param kernel kernel to run.
  * \param args ... input arguments, must be "Serializable".
  * \return kernel(args...).
  */
-template<typename Kernel, typename... Args>
-auto run_on_gpu(Kernel kernel, Args&&... args) -> decltype(kernel(args...)){  
+template <typename Kernel, typename... Args>
+auto run_on_gpu(Kernel kernel, Args&&... args) -> decltype(kernel(args...)) {
   return internal::run_serialized_on_gpu<Kernel, Args...>(
-      /*buffer_capacity_hint=*/ 0,
-      std::make_index_sequence<sizeof...(Args)>{},
-      internal::extract_output_indices<Args...>{},
-      kernel, std::forward<Args>(args)...);
+      /*buffer_capacity_hint=*/0, std::make_index_sequence<sizeof...(Args)>{},
+      internal::extract_output_indices<Args...>{}, kernel, std::forward<Args>(args)...);
 }
 
 /**
@@ -340,13 +321,10 @@
  * \return kernel(args...).
  * \sa run_on_gpu
  */
-template<typename Kernel, typename... Args>
-auto run_on_gpu_with_hint(size_t buffer_capacity_hint, 
-    Kernel kernel, Args&&... args) -> decltype(kernel(args...)){  
+template <typename Kernel, typename... Args>
+auto run_on_gpu_with_hint(size_t buffer_capacity_hint, Kernel kernel, Args&&... args) -> decltype(kernel(args...)) {
   return internal::run_serialized_on_gpu<Kernel, Args...>(
-      buffer_capacity_hint,
-      std::make_index_sequence<sizeof...(Args)>{},
-      internal::extract_output_indices<Args...>{},
+      buffer_capacity_hint, std::make_index_sequence<sizeof...(Args)>{}, internal::extract_output_indices<Args...>{},
       kernel, std::forward<Args>(args)...);
 }
 
@@ -359,17 +337,15 @@
     int cuda;
     int hip;
   };
-  
-  EIGEN_DEVICE_FUNC
-  Info operator()() const
-  {
+
+  EIGEN_DEVICE_FUNC Info operator()() const {
     Info info = {-1, -1};
-    #if defined(__CUDA_ARCH__)
-    info.cuda = static_cast<int>(__CUDA_ARCH__ +0);
-    #endif
-    #if defined(EIGEN_HIP_DEVICE_COMPILE)
-    info.hip = static_cast<int>(EIGEN_HIP_DEVICE_COMPILE +0);
-    #endif
+#if defined(__CUDA_ARCH__)
+    info.cuda = static_cast<int>(__CUDA_ARCH__ + 0);
+#endif
+#if defined(EIGEN_HIP_DEVICE_COMPILE)
+    info.hip = static_cast<int>(EIGEN_HIP_DEVICE_COMPILE + 0);
+#endif
     return info;
   }
 };
@@ -377,8 +353,7 @@
 /**
  * Queries and prints the compile-time and runtime GPU info.
  */
-void print_gpu_device_info()
-{
+void print_gpu_device_info() {
   int device = 0;
   gpuDeviceProp_t deviceProp;
   gpuGetDeviceProperties(&deviceProp, device);
@@ -386,24 +361,24 @@
   auto info = run_on_gpu(CompileTimeDeviceInfoKernel());
 
   std::cout << "GPU compile-time info:\n";
-  
-  #ifdef EIGEN_CUDACC
+
+#ifdef EIGEN_CUDACC
   std::cout << "  EIGEN_CUDACC:                " << int(EIGEN_CUDACC) << std::endl;
-  #endif
-  
-  #ifdef EIGEN_CUDA_SDK_VER
+#endif
+
+#ifdef EIGEN_CUDA_SDK_VER
   std::cout << "  EIGEN_CUDA_SDK_VER:          " << int(EIGEN_CUDA_SDK_VER) << std::endl;
-  #endif
+#endif
 
-  #if EIGEN_COMP_NVCC
+#if EIGEN_COMP_NVCC
   std::cout << "  EIGEN_COMP_NVCC:             " << int(EIGEN_COMP_NVCC) << std::endl;
-  #endif
-  
-  #ifdef EIGEN_HIPCC
-  std::cout << "  EIGEN_HIPCC:                 " << int(EIGEN_HIPCC) << std::endl;
-  #endif
+#endif
 
-  std::cout << "  EIGEN_CUDA_ARCH:             " << info.cuda << std::endl;  
+#ifdef EIGEN_HIPCC
+  std::cout << "  EIGEN_HIPCC:                 " << int(EIGEN_HIPCC) << std::endl;
+#endif
+
+  std::cout << "  EIGEN_CUDA_ARCH:             " << info.cuda << std::endl;
   std::cout << "  EIGEN_HIP_DEVICE_COMPILE:    " << info.hip << std::endl;
 
   std::cout << "GPU device info:\n";
@@ -419,24 +394,24 @@
   std::cout << "  computeMode:                 " << deviceProp.computeMode << std::endl;
 }
 
-#endif // EIGEN_GPUCC
+#endif  // EIGEN_GPUCC
 
 /**
  * Runs a kernel on the GPU (if EIGEN_GPUCC), or CPU otherwise.
- * 
+ *
  * This is to better support creating generic tests.
- * 
+ *
  * The kernel must be able to be passed directly as an input to a global
  * function (i.e. empty or POD).  Its inputs must be "Serializable" so we
  * can transfer them to the device, and the output must be a Serializable value
  * type so it can be transferred back from the device.
- * 
+ *
  * \param kernel kernel to run.
  * \param args ... input arguments, must be "Serializable".
  * \return kernel(args...).
  */
-template<typename Kernel, typename... Args>
-auto run(Kernel kernel, Args&&... args) -> decltype(kernel(args...)){
+template <typename Kernel, typename... Args>
+auto run(Kernel kernel, Args&&... args) -> decltype(kernel(args...)) {
 #ifdef EIGEN_GPUCC
   return run_on_gpu(kernel, std::forward<Args>(args)...);
 #else
@@ -446,7 +421,7 @@
 
 /**
  * Runs a kernel on the GPU (if EIGEN_GPUCC), or CPU otherwise.
- * 
+ *
  * This version allows specifying a minimum buffer capacity size required for
  * serializing the puts to transfer results from device to host.  Use this when
  * `run(...)` fails to determine an appropriate capacity by default.
@@ -458,9 +433,8 @@
  * \return kernel(args...).
  * \sa run
  */
-template<typename Kernel, typename... Args>
-auto run_with_hint(size_t buffer_capacity_hint,
-    Kernel kernel, Args&&... args) -> decltype(kernel(args...)){
+template <typename Kernel, typename... Args>
+auto run_with_hint(size_t buffer_capacity_hint, Kernel kernel, Args&&... args) -> decltype(kernel(args...)) {
 #ifdef EIGEN_GPUCC
   return run_on_gpu_with_hint(buffer_capacity_hint, kernel, std::forward<Args>(args)...);
 #else
@@ -469,6 +443,6 @@
 #endif
 }
 
-} // namespace Eigen
+}  // namespace Eigen
 
-#endif // GPU_TEST_HELPER_H
+#endif  // GPU_TEST_HELPER_H
diff --git a/test/half_float.cpp b/test/half_float.cpp
index 83b057e..90ac825 100644
--- a/test/half_float.cpp
+++ b/test/half_float.cpp
@@ -19,23 +19,14 @@
 
 using Eigen::half;
 
-void test_conversion()
-{
+void test_conversion() {
   using Eigen::half_impl::__half_raw;
 
   // Round-trip bit-cast with uint16.
-  VERIFY_IS_EQUAL(
-    numext::bit_cast<half>(numext::bit_cast<numext::uint16_t>(half(1.0f))),
-    half(1.0f));
-  VERIFY_IS_EQUAL(
-    numext::bit_cast<half>(numext::bit_cast<numext::uint16_t>(half(0.5f))),
-    half(0.5f));
-  VERIFY_IS_EQUAL(
-    numext::bit_cast<half>(numext::bit_cast<numext::uint16_t>(half(-0.33333f))),
-    half(-0.33333f));
-   VERIFY_IS_EQUAL(
-    numext::bit_cast<half>(numext::bit_cast<numext::uint16_t>(half(0.0f))),
-    half(0.0f));
+  VERIFY_IS_EQUAL(numext::bit_cast<half>(numext::bit_cast<numext::uint16_t>(half(1.0f))), half(1.0f));
+  VERIFY_IS_EQUAL(numext::bit_cast<half>(numext::bit_cast<numext::uint16_t>(half(0.5f))), half(0.5f));
+  VERIFY_IS_EQUAL(numext::bit_cast<half>(numext::bit_cast<numext::uint16_t>(half(-0.33333f))), half(-0.33333f));
+  VERIFY_IS_EQUAL(numext::bit_cast<half>(numext::bit_cast<numext::uint16_t>(half(0.0f))), half(0.0f));
 
   // Conversion from float.
   VERIFY_HALF_BITS_EQUAL(half(1.0f), 0x3c00);
@@ -118,53 +109,56 @@
   VERIFY(static_cast<bool>(half(-5.96046e-08f)));
 }
 
-void test_numtraits()
-{
-  std::cout << "epsilon       = " << NumTraits<half>::epsilon() << "  (0x" << std::hex << numext::bit_cast<numext::uint16_t>(NumTraits<half>::epsilon()) << ")" << std::endl;
-  std::cout << "highest       = " << NumTraits<half>::highest() << "  (0x" << std::hex << numext::bit_cast<numext::uint16_t>(NumTraits<half>::highest()) << ")" << std::endl;
-  std::cout << "lowest        = " << NumTraits<half>::lowest() << "  (0x" << std::hex << numext::bit_cast<numext::uint16_t>(NumTraits<half>::lowest()) << ")" << std::endl;
-  std::cout << "min           = " << (std::numeric_limits<half>::min)() << "  (0x" << std::hex << numext::bit_cast<numext::uint16_t>(half((std::numeric_limits<half>::min)())) << ")" << std::endl;
-  std::cout << "denorm min    = " << (std::numeric_limits<half>::denorm_min)() << "  (0x" << std::hex << numext::bit_cast<numext::uint16_t>(half((std::numeric_limits<half>::denorm_min)())) << ")" << std::endl;
-  std::cout << "infinity      = " << NumTraits<half>::infinity() << "  (0x" << std::hex << numext::bit_cast<numext::uint16_t>(NumTraits<half>::infinity()) << ")" << std::endl;
-  std::cout << "quiet nan     = " << NumTraits<half>::quiet_NaN() << "  (0x" << std::hex << numext::bit_cast<numext::uint16_t>(NumTraits<half>::quiet_NaN()) << ")" << std::endl;
-  std::cout << "signaling nan = " << std::numeric_limits<half>::signaling_NaN() << "  (0x" << std::hex << numext::bit_cast<numext::uint16_t>(std::numeric_limits<half>::signaling_NaN()) << ")" << std::endl;
+void test_numtraits() {
+  std::cout << "epsilon       = " << NumTraits<half>::epsilon() << "  (0x" << std::hex
+            << numext::bit_cast<numext::uint16_t>(NumTraits<half>::epsilon()) << ")" << std::endl;
+  std::cout << "highest       = " << NumTraits<half>::highest() << "  (0x" << std::hex
+            << numext::bit_cast<numext::uint16_t>(NumTraits<half>::highest()) << ")" << std::endl;
+  std::cout << "lowest        = " << NumTraits<half>::lowest() << "  (0x" << std::hex
+            << numext::bit_cast<numext::uint16_t>(NumTraits<half>::lowest()) << ")" << std::endl;
+  std::cout << "min           = " << (std::numeric_limits<half>::min)() << "  (0x" << std::hex
+            << numext::bit_cast<numext::uint16_t>(half((std::numeric_limits<half>::min)())) << ")" << std::endl;
+  std::cout << "denorm min    = " << (std::numeric_limits<half>::denorm_min)() << "  (0x" << std::hex
+            << numext::bit_cast<numext::uint16_t>(half((std::numeric_limits<half>::denorm_min)())) << ")" << std::endl;
+  std::cout << "infinity      = " << NumTraits<half>::infinity() << "  (0x" << std::hex
+            << numext::bit_cast<numext::uint16_t>(NumTraits<half>::infinity()) << ")" << std::endl;
+  std::cout << "quiet nan     = " << NumTraits<half>::quiet_NaN() << "  (0x" << std::hex
+            << numext::bit_cast<numext::uint16_t>(NumTraits<half>::quiet_NaN()) << ")" << std::endl;
+  std::cout << "signaling nan = " << std::numeric_limits<half>::signaling_NaN() << "  (0x" << std::hex
+            << numext::bit_cast<numext::uint16_t>(std::numeric_limits<half>::signaling_NaN()) << ")" << std::endl;
 
   VERIFY(NumTraits<half>::IsSigned);
 
-  VERIFY_IS_EQUAL(
-    numext::bit_cast<numext::uint16_t>(std::numeric_limits<half>::infinity()),
-    numext::bit_cast<numext::uint16_t>(half(std::numeric_limits<float>::infinity())) );
+  VERIFY_IS_EQUAL(numext::bit_cast<numext::uint16_t>(std::numeric_limits<half>::infinity()),
+                  numext::bit_cast<numext::uint16_t>(half(std::numeric_limits<float>::infinity())));
   // There is no guarantee that casting a 32-bit NaN to 16-bit has a precise
   // bit pattern.  We test that it is in fact a NaN, then test the signaling
   // bit (msb of significand is 1 for quiet, 0 for signaling).
   const numext::uint16_t HALF_QUIET_BIT = 0x0200;
-  VERIFY(
-    (numext::isnan)(std::numeric_limits<half>::quiet_NaN())
-    && (numext::isnan)(half(std::numeric_limits<float>::quiet_NaN()))
-    && ((numext::bit_cast<numext::uint16_t>(std::numeric_limits<half>::quiet_NaN()) & HALF_QUIET_BIT) > 0)
-    && ((numext::bit_cast<numext::uint16_t>(half(std::numeric_limits<float>::quiet_NaN())) & HALF_QUIET_BIT) > 0) );
+  VERIFY((numext::isnan)(std::numeric_limits<half>::quiet_NaN()) &&
+         (numext::isnan)(half(std::numeric_limits<float>::quiet_NaN())) &&
+         ((numext::bit_cast<numext::uint16_t>(std::numeric_limits<half>::quiet_NaN()) & HALF_QUIET_BIT) > 0) &&
+         ((numext::bit_cast<numext::uint16_t>(half(std::numeric_limits<float>::quiet_NaN())) & HALF_QUIET_BIT) > 0));
   // After a cast to half, a signaling NaN may become non-signaling
   // (e.g. in the case of casting float to native __fp16). Thus, we check that
   // both are NaN, and that only the `numeric_limits` version is signaling.
-  VERIFY(
-    (numext::isnan)(std::numeric_limits<half>::signaling_NaN())
-    && (numext::isnan)(half(std::numeric_limits<float>::signaling_NaN()))
-    && ((numext::bit_cast<numext::uint16_t>(std::numeric_limits<half>::signaling_NaN()) & HALF_QUIET_BIT) == 0) );
+  VERIFY((numext::isnan)(std::numeric_limits<half>::signaling_NaN()) &&
+         (numext::isnan)(half(std::numeric_limits<float>::signaling_NaN())) &&
+         ((numext::bit_cast<numext::uint16_t>(std::numeric_limits<half>::signaling_NaN()) & HALF_QUIET_BIT) == 0));
 
-  VERIFY( (std::numeric_limits<half>::min)() > half(0.f) );
-  VERIFY( (std::numeric_limits<half>::denorm_min)() > half(0.f) );
-  VERIFY( (std::numeric_limits<half>::min)()/half(2) > half(0.f) );
-  VERIFY_IS_EQUAL( (std::numeric_limits<half>::denorm_min)()/half(2), half(0.f) );
+  VERIFY((std::numeric_limits<half>::min)() > half(0.f));
+  VERIFY((std::numeric_limits<half>::denorm_min)() > half(0.f));
+  VERIFY((std::numeric_limits<half>::min)() / half(2) > half(0.f));
+  VERIFY_IS_EQUAL((std::numeric_limits<half>::denorm_min)() / half(2), half(0.f));
 
   // Test to see that we are able to link against the symbols for digits and
   // digits10.
   volatile const int& digits10 = std::numeric_limits<half>::digits10;
   volatile const int& digits = std::numeric_limits<half>::digits;
-  VERIFY( (digits10) != (digits) );
+  VERIFY((digits10) != (digits));
 }
 
-void test_arithmetic()
-{
+void test_arithmetic() {
   VERIFY_IS_EQUAL(float(half(2) + half(2)), 4);
   VERIFY_IS_EQUAL(float(half(2) + half(-2)), 0);
   VERIFY_IS_APPROX(float(half(0.33333f) + half(0.66667f)), 1.0f);
@@ -172,7 +166,7 @@
   VERIFY_IS_APPROX(float(half(1.0f) / half(3.0f)), 0.33333f);
   VERIFY_IS_EQUAL(float(-half(4096.0f)), -4096.0f);
   VERIFY_IS_EQUAL(float(-half(-4096.0f)), 4096.0f);
-  
+
   half x(3);
   half y = ++x;
   VERIFY_IS_EQUAL(x, half(4));
@@ -188,8 +182,7 @@
   VERIFY_IS_EQUAL(y, half(4));
 }
 
-void test_comparison()
-{
+void test_comparison() {
   VERIFY(half(1.0f) > half(0.5f));
   VERIFY(half(0.5f) < half(1.0f));
   VERIFY(!(half(1.0f) < half(0.5f)));
@@ -226,8 +219,7 @@
 #endif
 }
 
-void test_basic_functions()
-{
+void test_basic_functions() {
   constexpr float PI = static_cast<float>(EIGEN_PI);
 
   VERIFY_IS_EQUAL(float(numext::abs(half(3.5f))), 3.5f);
@@ -274,15 +266,14 @@
   VERIFY_IS_EQUAL(float(log1p(half(0.0f))), 0.0f);
   VERIFY_IS_APPROX(float(numext::log1p(half(10.0f))), 2.3978953f);
   VERIFY_IS_APPROX(float(log1p(half(10.0f))), 2.3978953f);
-  
+
   VERIFY_IS_APPROX(numext::fmod(half(5.3f), half(2.0f)), half(1.3f));
   VERIFY_IS_APPROX(fmod(half(5.3f), half(2.0f)), half(1.3f));
   VERIFY_IS_APPROX(numext::fmod(half(-18.5f), half(-4.2f)), half(-1.7f));
   VERIFY_IS_APPROX(fmod(half(-18.5f), half(-4.2f)), half(-1.7f));
 }
 
-void test_trigonometric_functions()
-{
+void test_trigonometric_functions() {
   constexpr float PI = static_cast<float>(EIGEN_PI);
   VERIFY_IS_APPROX(numext::cos(half(0.0f)), half(cosf(0.0f)));
   VERIFY_IS_APPROX(cos(half(0.0f)), half(cosf(0.0f)));
@@ -294,57 +285,54 @@
   VERIFY_IS_APPROX(numext::sin(half(0.0f)), half(sinf(0.0f)));
   VERIFY_IS_APPROX(sin(half(0.0f)), half(sinf(0.0f)));
   //  VERIFY_IS_APPROX(numext::sin(half(PI)), half(sinf(PI)));
-  VERIFY_IS_APPROX(numext::sin(half(PI/2)), half(sinf(PI/2)));
-  VERIFY_IS_APPROX(numext::sin(half(3*PI/2)), half(sinf(3*PI/2)));
+  VERIFY_IS_APPROX(numext::sin(half(PI / 2)), half(sinf(PI / 2)));
+  VERIFY_IS_APPROX(numext::sin(half(3 * PI / 2)), half(sinf(3 * PI / 2)));
   VERIFY_IS_APPROX(numext::sin(half(3.5f)), half(sinf(3.5f)));
 
   VERIFY_IS_APPROX(numext::tan(half(0.0f)), half(tanf(0.0f)));
   VERIFY_IS_APPROX(tan(half(0.0f)), half(tanf(0.0f)));
   //  VERIFY_IS_APPROX(numext::tan(half(PI)), half(tanf(PI)));
   //  VERIFY_IS_APPROX(numext::tan(half(PI/2)), half(tanf(PI/2)));
-  //VERIFY_IS_APPROX(numext::tan(half(3*PI/2)), half(tanf(3*PI/2)));
+  // VERIFY_IS_APPROX(numext::tan(half(3*PI/2)), half(tanf(3*PI/2)));
   VERIFY_IS_APPROX(numext::tan(half(3.5f)), half(tanf(3.5f)));
 }
 
-void test_array()
-{
-  typedef Array<half,1,Dynamic> ArrayXh;
-  Index size = internal::random<Index>(1,10);
-  Index i = internal::random<Index>(0,size-1);
+void test_array() {
+  typedef Array<half, 1, Dynamic> ArrayXh;
+  Index size = internal::random<Index>(1, 10);
+  Index i = internal::random<Index>(0, size - 1);
   ArrayXh a1 = ArrayXh::Random(size), a2 = ArrayXh::Random(size);
-  VERIFY_IS_APPROX( a1+a1, half(2)*a1 );
-  VERIFY( (a1.abs() >= half(0)).all() );
-  VERIFY_IS_APPROX( (a1*a1).sqrt(), a1.abs() );
+  VERIFY_IS_APPROX(a1 + a1, half(2) * a1);
+  VERIFY((a1.abs() >= half(0)).all());
+  VERIFY_IS_APPROX((a1 * a1).sqrt(), a1.abs());
 
-  VERIFY( ((a1.min)(a2) <= (a1.max)(a2)).all() );
+  VERIFY(((a1.min)(a2) <= (a1.max)(a2)).all());
   a1(i) = half(-10.);
-  VERIFY_IS_EQUAL( a1.minCoeff(), half(-10.) );
+  VERIFY_IS_EQUAL(a1.minCoeff(), half(-10.));
   a1(i) = half(10.);
-  VERIFY_IS_EQUAL( a1.maxCoeff(), half(10.) );
+  VERIFY_IS_EQUAL(a1.maxCoeff(), half(10.));
 
   std::stringstream ss;
   ss << a1;
 }
 
-void test_product()
-{
-  typedef Matrix<half,Dynamic,Dynamic> MatrixXh;
-  Index rows  = internal::random<Index>(1,EIGEN_TEST_MAX_SIZE);
-  Index cols  = internal::random<Index>(1,EIGEN_TEST_MAX_SIZE);
-  Index depth = internal::random<Index>(1,EIGEN_TEST_MAX_SIZE);
-  MatrixXh Ah = MatrixXh::Random(rows,depth);
-  MatrixXh Bh = MatrixXh::Random(depth,cols);
-  MatrixXh Ch = MatrixXh::Random(rows,cols);
+void test_product() {
+  typedef Matrix<half, Dynamic, Dynamic> MatrixXh;
+  Index rows = internal::random<Index>(1, EIGEN_TEST_MAX_SIZE);
+  Index cols = internal::random<Index>(1, EIGEN_TEST_MAX_SIZE);
+  Index depth = internal::random<Index>(1, EIGEN_TEST_MAX_SIZE);
+  MatrixXh Ah = MatrixXh::Random(rows, depth);
+  MatrixXh Bh = MatrixXh::Random(depth, cols);
+  MatrixXh Ch = MatrixXh::Random(rows, cols);
   MatrixXf Af = Ah.cast<float>();
   MatrixXf Bf = Bh.cast<float>();
   MatrixXf Cf = Ch.cast<float>();
-  VERIFY_IS_APPROX(Ch.noalias()+=Ah*Bh, (Cf.noalias()+=Af*Bf).cast<half>());
+  VERIFY_IS_APPROX(Ch.noalias() += Ah * Bh, (Cf.noalias() += Af * Bf).cast<half>());
 }
 
-EIGEN_DECLARE_TEST(half_float)
-{
+EIGEN_DECLARE_TEST(half_float) {
   CALL_SUBTEST(test_numtraits());
-  for(int i = 0; i < g_repeat; i++) {
+  for (int i = 0; i < g_repeat; i++) {
     CALL_SUBTEST(test_conversion());
     CALL_SUBTEST(test_arithmetic());
     CALL_SUBTEST(test_comparison());
diff --git a/test/hessenberg.cpp b/test/hessenberg.cpp
index 0e1b009..90364f1 100644
--- a/test/hessenberg.cpp
+++ b/test/hessenberg.cpp
@@ -11,20 +11,20 @@
 #include "main.h"
 #include <Eigen/Eigenvalues>
 
-template<typename Scalar,int Size> void hessenberg(int size = Size)
-{
-  typedef Matrix<Scalar,Size,Size> MatrixType;
+template <typename Scalar, int Size>
+void hessenberg(int size = Size) {
+  typedef Matrix<Scalar, Size, Size> MatrixType;
 
   // Test basic functionality: A = U H U* and H is Hessenberg
-  for(int counter = 0; counter < g_repeat; ++counter) {
-    MatrixType m = MatrixType::Random(size,size);
+  for (int counter = 0; counter < g_repeat; ++counter) {
+    MatrixType m = MatrixType::Random(size, size);
     HessenbergDecomposition<MatrixType> hess(m);
     MatrixType Q = hess.matrixQ();
     MatrixType H = hess.matrixH();
     VERIFY_IS_APPROX(m, Q * H * Q.adjoint());
-    for(int row = 2; row < size; ++row) {
-      for(int col = 0; col < row-1; ++col) {
-	VERIFY(H(row,col) == (typename MatrixType::Scalar)0);
+    for (int row = 2; row < size; ++row) {
+      for (int col = 0; col < row - 1; ++col) {
+        VERIFY(H(row, col) == (typename MatrixType::Scalar)0);
       }
     }
   }
@@ -36,26 +36,25 @@
   HessenbergDecomposition<MatrixType> cs2(A);
   VERIFY_IS_EQUAL(cs1.matrixH().eval(), cs2.matrixH().eval());
   MatrixType cs1Q = cs1.matrixQ();
-  MatrixType cs2Q = cs2.matrixQ();  
+  MatrixType cs2Q = cs2.matrixQ();
   VERIFY_IS_EQUAL(cs1Q, cs2Q);
 
   // Test assertions for when used uninitialized
   HessenbergDecomposition<MatrixType> hessUninitialized;
-  VERIFY_RAISES_ASSERT( hessUninitialized.matrixH() );
-  VERIFY_RAISES_ASSERT( hessUninitialized.matrixQ() );
-  VERIFY_RAISES_ASSERT( hessUninitialized.householderCoefficients() );
-  VERIFY_RAISES_ASSERT( hessUninitialized.packedMatrix() );
+  VERIFY_RAISES_ASSERT(hessUninitialized.matrixH());
+  VERIFY_RAISES_ASSERT(hessUninitialized.matrixQ());
+  VERIFY_RAISES_ASSERT(hessUninitialized.householderCoefficients());
+  VERIFY_RAISES_ASSERT(hessUninitialized.packedMatrix());
 
   // TODO: Add tests for packedMatrix() and householderCoefficients()
 }
 
-EIGEN_DECLARE_TEST(hessenberg)
-{
-  CALL_SUBTEST_1(( hessenberg<std::complex<double>,1>() ));
-  CALL_SUBTEST_2(( hessenberg<std::complex<double>,2>() ));
-  CALL_SUBTEST_3(( hessenberg<std::complex<float>,4>() ));
-  CALL_SUBTEST_4(( hessenberg<float,Dynamic>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE)) ));
-  CALL_SUBTEST_5(( hessenberg<std::complex<double>,Dynamic>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE)) ));
+EIGEN_DECLARE_TEST(hessenberg) {
+  CALL_SUBTEST_1((hessenberg<std::complex<double>, 1>()));
+  CALL_SUBTEST_2((hessenberg<std::complex<double>, 2>()));
+  CALL_SUBTEST_3((hessenberg<std::complex<float>, 4>()));
+  CALL_SUBTEST_4((hessenberg<float, Dynamic>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+  CALL_SUBTEST_5((hessenberg<std::complex<double>, Dynamic>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
 
   // Test problem size constructors
   CALL_SUBTEST_6(HessenbergDecomposition<MatrixXf>(10));
diff --git a/test/householder.cpp b/test/householder.cpp
index 3a3d047..0107759 100644
--- a/test/householder.cpp
+++ b/test/householder.cpp
@@ -10,8 +10,8 @@
 #include "main.h"
 #include <Eigen/QR>
 
-template<typename MatrixType> void householder(const MatrixType& m)
-{
+template <typename MatrixType>
+void householder(const MatrixType& m) {
   static bool even = true;
   even = !even;
   /* this test covers the following files:
@@ -29,9 +29,10 @@
   typedef Matrix<Scalar, Dynamic, 1> HCoeffsVectorType;
 
   typedef Matrix<Scalar, MatrixType::ColsAtCompileTime, MatrixType::RowsAtCompileTime> TMatrixType;
-  
-  Matrix<Scalar, internal::max_size_prefer_dynamic(MatrixType::RowsAtCompileTime,MatrixType::ColsAtCompileTime), 1> _tmp((std::max)(rows,cols));
-  Scalar* tmp = &_tmp.coeffRef(0,0);
+
+  Matrix<Scalar, internal::max_size_prefer_dynamic(MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime), 1>
+      _tmp((std::max)(rows, cols));
+  Scalar* tmp = &_tmp.coeffRef(0, 0);
 
   Scalar beta;
   RealScalar alpha;
@@ -40,12 +41,12 @@
   VectorType v1 = VectorType::Random(rows), v2;
   v2 = v1;
   v1.makeHouseholder(essential, beta, alpha);
-  v1.applyHouseholderOnTheLeft(essential,beta,tmp);
+  v1.applyHouseholderOnTheLeft(essential, beta, tmp);
   VERIFY_IS_APPROX(v1.norm(), v2.norm());
-  if(rows>=2) VERIFY_IS_MUCH_SMALLER_THAN(v1.tail(rows-1).norm(), v1.norm());
+  if (rows >= 2) VERIFY_IS_MUCH_SMALLER_THAN(v1.tail(rows - 1).norm(), v1.norm());
   v1 = VectorType::Random(rows);
   v2 = v1;
-  v1.applyHouseholderOnTheLeft(essential,beta,tmp);
+  v1.applyHouseholderOnTheLeft(essential, beta, tmp);
   VERIFY_IS_APPROX(v1.norm(), v2.norm());
 
   // reconstruct householder matrix:
@@ -57,69 +58,68 @@
   H1.applyHouseholderOnTheLeft(essential, beta, tmp);
   H2.applyHouseholderOnTheRight(essential, beta, tmp);
   VERIFY_IS_APPROX(H1, H2);
-  VERIFY_IS_APPROX(H1, id - beta * vv*vv.adjoint());
+  VERIFY_IS_APPROX(H1, id - beta * vv * vv.adjoint());
 
-  MatrixType m1(rows, cols),
-             m2(rows, cols);
+  MatrixType m1(rows, cols), m2(rows, cols);
 
   v1 = VectorType::Random(rows);
-  if(even) v1.tail(rows-1).setZero();
+  if (even) v1.tail(rows - 1).setZero();
   m1.colwise() = v1;
   m2 = m1;
   m1.col(0).makeHouseholder(essential, beta, alpha);
-  m1.applyHouseholderOnTheLeft(essential,beta,tmp);
+  m1.applyHouseholderOnTheLeft(essential, beta, tmp);
   VERIFY_IS_APPROX(m1.norm(), m2.norm());
-  if(rows>=2) VERIFY_IS_MUCH_SMALLER_THAN(m1.block(1,0,rows-1,cols).norm(), m1.norm());
-  VERIFY_IS_MUCH_SMALLER_THAN(numext::imag(m1(0,0)), numext::real(m1(0,0)));
-  VERIFY_IS_APPROX(numext::real(m1(0,0)), alpha);
+  if (rows >= 2) VERIFY_IS_MUCH_SMALLER_THAN(m1.block(1, 0, rows - 1, cols).norm(), m1.norm());
+  VERIFY_IS_MUCH_SMALLER_THAN(numext::imag(m1(0, 0)), numext::real(m1(0, 0)));
+  VERIFY_IS_APPROX(numext::real(m1(0, 0)), alpha);
 
   v1 = VectorType::Random(rows);
-  if(even) v1.tail(rows-1).setZero();
-  SquareMatrixType m3(rows,rows), m4(rows,rows);
+  if (even) v1.tail(rows - 1).setZero();
+  SquareMatrixType m3(rows, rows), m4(rows, rows);
   m3.rowwise() = v1.transpose();
   m4 = m3;
   m3.row(0).makeHouseholder(essential, beta, alpha);
-  m3.applyHouseholderOnTheRight(essential.conjugate(),beta,tmp);
+  m3.applyHouseholderOnTheRight(essential.conjugate(), beta, tmp);
   VERIFY_IS_APPROX(m3.norm(), m4.norm());
-  if(rows>=2) VERIFY_IS_MUCH_SMALLER_THAN(m3.block(0,1,rows,rows-1).norm(), m3.norm());
-  VERIFY_IS_MUCH_SMALLER_THAN(numext::imag(m3(0,0)), numext::real(m3(0,0)));
-  VERIFY_IS_APPROX(numext::real(m3(0,0)), alpha);
+  if (rows >= 2) VERIFY_IS_MUCH_SMALLER_THAN(m3.block(0, 1, rows, rows - 1).norm(), m3.norm());
+  VERIFY_IS_MUCH_SMALLER_THAN(numext::imag(m3(0, 0)), numext::real(m3(0, 0)));
+  VERIFY_IS_APPROX(numext::real(m3(0, 0)), alpha);
 
   // test householder sequence on the left with a shift
 
-  Index shift = internal::random<Index>(0, std::max<Index>(rows-2,0));
+  Index shift = internal::random<Index>(0, std::max<Index>(rows - 2, 0));
   Index brows = rows - shift;
   m1.setRandom(rows, cols);
-  HBlockMatrixType hbm = m1.block(shift,0,brows,cols);
+  HBlockMatrixType hbm = m1.block(shift, 0, brows, cols);
   HouseholderQR<HBlockMatrixType> qr(hbm);
   m2 = m1;
-  m2.block(shift,0,brows,cols) = qr.matrixQR();
+  m2.block(shift, 0, brows, cols) = qr.matrixQR();
   HCoeffsVectorType hc = qr.hCoeffs().conjugate();
   HouseholderSequence<MatrixType, HCoeffsVectorType> hseq(m2, hc);
   hseq.setLength(hc.size()).setShift(shift);
   VERIFY(hseq.length() == hc.size());
   VERIFY(hseq.shift() == shift);
-  
+
   MatrixType m5 = m2;
-  m5.block(shift,0,brows,cols).template triangularView<StrictlyLower>().setZero();
-  VERIFY_IS_APPROX(hseq * m5, m1); // test applying hseq directly
+  m5.block(shift, 0, brows, cols).template triangularView<StrictlyLower>().setZero();
+  VERIFY_IS_APPROX(hseq * m5, m1);  // test applying hseq directly
   m3 = hseq;
-  VERIFY_IS_APPROX(m3 * m5, m1); // test evaluating hseq to a dense matrix, then applying
-  
+  VERIFY_IS_APPROX(m3 * m5, m1);  // test evaluating hseq to a dense matrix, then applying
+
   SquareMatrixType hseq_mat = hseq;
   SquareMatrixType hseq_mat_conj = hseq.conjugate();
   SquareMatrixType hseq_mat_adj = hseq.adjoint();
   SquareMatrixType hseq_mat_trans = hseq.transpose();
   SquareMatrixType m6 = SquareMatrixType::Random(rows, rows);
-  VERIFY_IS_APPROX(hseq_mat.adjoint(),    hseq_mat_adj);
-  VERIFY_IS_APPROX(hseq_mat.conjugate(),  hseq_mat_conj);
-  VERIFY_IS_APPROX(hseq_mat.transpose(),  hseq_mat_trans);
-  VERIFY_IS_APPROX(hseq * m6,             hseq_mat * m6);
-  VERIFY_IS_APPROX(hseq.adjoint() * m6,   hseq_mat_adj * m6);
+  VERIFY_IS_APPROX(hseq_mat.adjoint(), hseq_mat_adj);
+  VERIFY_IS_APPROX(hseq_mat.conjugate(), hseq_mat_conj);
+  VERIFY_IS_APPROX(hseq_mat.transpose(), hseq_mat_trans);
+  VERIFY_IS_APPROX(hseq * m6, hseq_mat * m6);
+  VERIFY_IS_APPROX(hseq.adjoint() * m6, hseq_mat_adj * m6);
   VERIFY_IS_APPROX(hseq.conjugate() * m6, hseq_mat_conj * m6);
   VERIFY_IS_APPROX(hseq.transpose() * m6, hseq_mat_trans * m6);
-  VERIFY_IS_APPROX(m6 * hseq,             m6 * hseq_mat);
-  VERIFY_IS_APPROX(m6 * hseq.adjoint(),   m6 * hseq_mat_adj);
+  VERIFY_IS_APPROX(m6 * hseq, m6 * hseq_mat);
+  VERIFY_IS_APPROX(m6 * hseq.adjoint(), m6 * hseq_mat_adj);
   VERIFY_IS_APPROX(m6 * hseq.conjugate(), m6 * hseq_mat_conj);
   VERIFY_IS_APPROX(m6 * hseq.transpose(), m6 * hseq_mat_trans);
 
@@ -128,12 +128,11 @@
   TMatrixType tm2 = m2.transpose();
   HouseholderSequence<TMatrixType, HCoeffsVectorType, OnTheRight> rhseq(tm2, hc);
   rhseq.setLength(hc.size()).setShift(shift);
-  VERIFY_IS_APPROX(rhseq * m5, m1); // test applying rhseq directly
+  VERIFY_IS_APPROX(rhseq * m5, m1);  // test applying rhseq directly
   m3 = rhseq;
-  VERIFY_IS_APPROX(m3 * m5, m1); // test evaluating rhseq to a dense matrix, then applying
+  VERIFY_IS_APPROX(m3 * m5, m1);  // test evaluating rhseq to a dense matrix, then applying
 }
 
-
 template <typename MatrixType>
 void householder_update(const MatrixType& m) {
   // This test is covering the internal::householder_qr_inplace_update function.
@@ -153,7 +152,7 @@
   Scalar* tmp = tmpOwner.data();
 
   // The matrix to factorize.
-  const MatrixType A = MatrixType::Random(rows, cols); 
+  const MatrixType A = MatrixType::Random(rows, cols);
 
   // matQR and hCoeffs will hold the factorization of A,
   // built by a sequence of calls to `update`.
@@ -164,11 +163,10 @@
   // We verify this by starting with an empty factorization and 'updating' one column at a time.
   // After each call to update, we should have a QR factorization of the columns presented so far.
 
-  const Index size = (std::min)(rows, cols); // QR can only go up to 'size' b/c that's full rank.
-  for (Index k = 0; k != size; ++k)
-  {
+  const Index size = (std::min)(rows, cols);  // QR can only go up to 'size' b/c that's full rank.
+  for (Index k = 0; k != size; ++k) {
     // Make a copy of the column to prevent any possibility of 'leaking' other parts of A.
-    const VectorType newColumn = A.col(k); 
+    const VectorType newColumn = A.col(k);
     internal::householder_qr_inplace_update(matQR, hCoeffs, newColumn, k, tmp);
 
     // Verify Property:
@@ -187,7 +185,7 @@
     // A sequence of calls to 'householder_qr_inplace_update'
     // should produce the same result as 'householder_qr_inplace_unblocked'.
     // This is a property of the current implementation.
-    // If these implementations diverge in the future, 
+    // If these implementations diverge in the future,
     // then simply delete the test of this property.
     {
       MatrixX QR_at_once = A.leftCols(k + 1);
@@ -200,10 +198,10 @@
 
   // Verify Property:
   // We can go back and update any column to have a new value,
-  // and get a QR factorization of the columns up to that one.  
+  // and get a QR factorization of the columns up to that one.
   {
     const Index k = internal::random<Index>(0, size - 1);
-    VectorType newColumn = VectorType::Random(rows);      
+    VectorType newColumn = VectorType::Random(rows);
     internal::householder_qr_inplace_update(matQR, hCoeffs, newColumn, k, tmp);
 
     const MatrixX matQR_k = matQR.leftCols(k + 1);
@@ -212,24 +210,26 @@
     MatrixX QxR = householderSequence(matQR_k, hCoeffs_k.conjugate()) * R;
     VERIFY_IS_APPROX(QxR.leftCols(k), A.leftCols(k));
     VERIFY_IS_APPROX(QxR.col(k), newColumn);
-  }  
+  }
 }
 
+EIGEN_DECLARE_TEST(householder) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(householder(Matrix<double, 2, 2>()));
+    CALL_SUBTEST_2(householder(Matrix<float, 2, 3>()));
+    CALL_SUBTEST_3(householder(Matrix<double, 3, 5>()));
+    CALL_SUBTEST_4(householder(Matrix<float, 4, 4>()));
+    CALL_SUBTEST_5(householder(
+        MatrixXd(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_6(householder(
+        MatrixXcf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_7(householder(
+        MatrixXf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_8(householder(Matrix<double, 1, 1>()));
 
-EIGEN_DECLARE_TEST(householder)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( householder(Matrix<double,2,2>()) );
-    CALL_SUBTEST_2( householder(Matrix<float,2,3>()) );
-    CALL_SUBTEST_3( householder(Matrix<double,3,5>()) );
-    CALL_SUBTEST_4( householder(Matrix<float,4,4>()) );
-    CALL_SUBTEST_5( householder(MatrixXd(internal::random<int>(1,EIGEN_TEST_MAX_SIZE),internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_6( householder(MatrixXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE),internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_7( householder(MatrixXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE),internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_8( householder(Matrix<double,1,1>()) );
-
-    CALL_SUBTEST_9( householder_update(Matrix<double, 3, 5>()) );
-    CALL_SUBTEST_9( householder_update(Matrix<float, 4, 2>()) );
-    CALL_SUBTEST_9( householder_update(MatrixXcf(internal::random<Index>(1,EIGEN_TEST_MAX_SIZE), internal::random<Index>(1,EIGEN_TEST_MAX_SIZE))) );
+    CALL_SUBTEST_9(householder_update(Matrix<double, 3, 5>()));
+    CALL_SUBTEST_9(householder_update(Matrix<float, 4, 2>()));
+    CALL_SUBTEST_9(householder_update(
+        MatrixXcf(internal::random<Index>(1, EIGEN_TEST_MAX_SIZE), internal::random<Index>(1, EIGEN_TEST_MAX_SIZE))));
   }
 }
diff --git a/test/incomplete_cholesky.cpp b/test/incomplete_cholesky.cpp
index 72316a2..2b03ba1 100644
--- a/test/incomplete_cholesky.cpp
+++ b/test/incomplete_cholesky.cpp
@@ -11,58 +11,53 @@
 #include "sparse_solver.h"
 #include <Eigen/IterativeLinearSolvers>
 
-template<typename T, typename I_> void test_incomplete_cholesky_T()
-{
-  typedef SparseMatrix<T,0,I_> SparseMatrixType;
-  ConjugateGradient<SparseMatrixType, Lower, IncompleteCholesky<T, Lower, AMDOrdering<I_> > >        cg_illt_lower_amd;
-  ConjugateGradient<SparseMatrixType, Lower, IncompleteCholesky<T, Lower, NaturalOrdering<I_> > >    cg_illt_lower_nat;
-  ConjugateGradient<SparseMatrixType, Upper, IncompleteCholesky<T, Upper, AMDOrdering<I_> > >        cg_illt_upper_amd;
-  ConjugateGradient<SparseMatrixType, Upper, IncompleteCholesky<T, Upper, NaturalOrdering<I_> > >    cg_illt_upper_nat;
-  ConjugateGradient<SparseMatrixType, Upper|Lower, IncompleteCholesky<T, Lower, AMDOrdering<I_> > >  cg_illt_uplo_amd;
-  
+template <typename T, typename I_>
+void test_incomplete_cholesky_T() {
+  typedef SparseMatrix<T, 0, I_> SparseMatrixType;
+  ConjugateGradient<SparseMatrixType, Lower, IncompleteCholesky<T, Lower, AMDOrdering<I_> > > cg_illt_lower_amd;
+  ConjugateGradient<SparseMatrixType, Lower, IncompleteCholesky<T, Lower, NaturalOrdering<I_> > > cg_illt_lower_nat;
+  ConjugateGradient<SparseMatrixType, Upper, IncompleteCholesky<T, Upper, AMDOrdering<I_> > > cg_illt_upper_amd;
+  ConjugateGradient<SparseMatrixType, Upper, IncompleteCholesky<T, Upper, NaturalOrdering<I_> > > cg_illt_upper_nat;
+  ConjugateGradient<SparseMatrixType, Upper | Lower, IncompleteCholesky<T, Lower, AMDOrdering<I_> > > cg_illt_uplo_amd;
 
-  CALL_SUBTEST( check_sparse_spd_solving(cg_illt_lower_amd) );
-  CALL_SUBTEST( check_sparse_spd_solving(cg_illt_lower_nat) );
-  CALL_SUBTEST( check_sparse_spd_solving(cg_illt_upper_amd) );
-  CALL_SUBTEST( check_sparse_spd_solving(cg_illt_upper_nat) );
-  CALL_SUBTEST( check_sparse_spd_solving(cg_illt_uplo_amd) );
+  CALL_SUBTEST(check_sparse_spd_solving(cg_illt_lower_amd));
+  CALL_SUBTEST(check_sparse_spd_solving(cg_illt_lower_nat));
+  CALL_SUBTEST(check_sparse_spd_solving(cg_illt_upper_amd));
+  CALL_SUBTEST(check_sparse_spd_solving(cg_illt_upper_nat));
+  CALL_SUBTEST(check_sparse_spd_solving(cg_illt_uplo_amd));
 }
 
-template<int>
-void bug1150()
-{
+template <int>
+void bug1150() {
   // regression for bug 1150
-  for(int N = 1; N<20; ++N)
-  {
-    Eigen::MatrixXd b( N, N );
+  for (int N = 1; N < 20; ++N) {
+    Eigen::MatrixXd b(N, N);
     b.setOnes();
 
-    Eigen::SparseMatrix<double> m( N, N );
-    m.reserve(Eigen::VectorXi::Constant(N,4));
-    for( int i = 0; i < N; ++i )
-    {
-        m.insert( i, i ) = 1;
-        m.coeffRef( i, i / 2 ) = 2;
-        m.coeffRef( i, i / 3 ) = 2;
-        m.coeffRef( i, i / 4 ) = 2;
+    Eigen::SparseMatrix<double> m(N, N);
+    m.reserve(Eigen::VectorXi::Constant(N, 4));
+    for (int i = 0; i < N; ++i) {
+      m.insert(i, i) = 1;
+      m.coeffRef(i, i / 2) = 2;
+      m.coeffRef(i, i / 3) = 2;
+      m.coeffRef(i, i / 4) = 2;
     }
 
     Eigen::SparseMatrix<double> A;
     A = m * m.transpose();
 
-    Eigen::ConjugateGradient<Eigen::SparseMatrix<double>,
-        Eigen::Lower | Eigen::Upper,
-        Eigen::IncompleteCholesky<double> > solver( A );
+    Eigen::ConjugateGradient<Eigen::SparseMatrix<double>, Eigen::Lower | Eigen::Upper,
+                             Eigen::IncompleteCholesky<double> >
+        solver(A);
     VERIFY(solver.preconditioner().info() == Eigen::Success);
     VERIFY(solver.info() == Eigen::Success);
   }
 }
 
-EIGEN_DECLARE_TEST(incomplete_cholesky)
-{
-  CALL_SUBTEST_1(( test_incomplete_cholesky_T<double,int>() ));
-  CALL_SUBTEST_2(( test_incomplete_cholesky_T<std::complex<double>, int>() ));
-  CALL_SUBTEST_3(( test_incomplete_cholesky_T<double,long int>() ));
+EIGEN_DECLARE_TEST(incomplete_cholesky) {
+  CALL_SUBTEST_1((test_incomplete_cholesky_T<double, int>()));
+  CALL_SUBTEST_2((test_incomplete_cholesky_T<std::complex<double>, int>()));
+  CALL_SUBTEST_3((test_incomplete_cholesky_T<double, long int>()));
 
-  CALL_SUBTEST_1(( bug1150<0>() ));
+  CALL_SUBTEST_1((bug1150<0>()));
 }
diff --git a/test/indexed_view.cpp b/test/indexed_view.cpp
index 41ba521..494e0d6 100644
--- a/test/indexed_view.cpp
+++ b/test/indexed_view.cpp
@@ -13,287 +13,279 @@
 
 using Eigen::placeholders::all;
 using Eigen::placeholders::last;
-using Eigen::placeholders::lastp1;
 using Eigen::placeholders::lastN;
+using Eigen::placeholders::lastp1;
 #include <array>
 
-typedef std::pair<Index,Index> IndexPair;
+typedef std::pair<Index, Index> IndexPair;
 
-int encode(Index i, Index j) {
-  return int(i*100 + j);
-}
+int encode(Index i, Index j) { return int(i * 100 + j); }
 
-IndexPair decode(Index ij) {
-  return IndexPair(ij / 100, ij % 100);
-}
+IndexPair decode(Index ij) { return IndexPair(ij / 100, ij % 100); }
 
-template<typename T>
+template <typename T>
 bool match(const T& xpr, std::string ref, std::string str_xpr = "") {
   EIGEN_UNUSED_VARIABLE(str_xpr);
   std::stringstream str;
   str << xpr;
-  if(!(str.str() == ref))
-    std::cout << str_xpr << "\n" << xpr << "\n\n";
+  if (!(str.str() == ref)) std::cout << str_xpr << "\n" << xpr << "\n\n";
   return str.str() == ref;
 }
 
-#define MATCH(X,R) match(X, R, #X)
+#define MATCH(X, R) match(X, R, #X)
 
-template<typename T1,typename T2>
-std::enable_if_t<internal::is_same<T1,T2>::value,bool>
-is_same_eq(const T1& a, const T2& b)
-{
+template <typename T1, typename T2>
+std::enable_if_t<internal::is_same<T1, T2>::value, bool> is_same_eq(const T1& a, const T2& b) {
   return (a == b).all();
 }
 
-template<typename T1,typename T2>
-bool is_same_seq(const T1& a, const T2& b)
-{
-  bool ok = a.first()==b.first() && a.size() == b.size() && Index(a.incrObject())==Index(b.incrObject());;
-  if(!ok)
-  {
+template <typename T1, typename T2>
+bool is_same_seq(const T1& a, const T2& b) {
+  bool ok = a.first() == b.first() && a.size() == b.size() && Index(a.incrObject()) == Index(b.incrObject());
+  ;
+  if (!ok) {
     std::cerr << "seqN(" << a.first() << ", " << a.size() << ", " << Index(a.incrObject()) << ") != ";
     std::cerr << "seqN(" << b.first() << ", " << b.size() << ", " << Index(b.incrObject()) << ")\n";
   }
   return ok;
 }
 
-template<typename T1,typename T2>
-std::enable_if_t<internal::is_same<T1,T2>::value,bool>
-is_same_seq_type(const T1& a, const T2& b)
-{
-  return is_same_seq(a,b);
+template <typename T1, typename T2>
+std::enable_if_t<internal::is_same<T1, T2>::value, bool> is_same_seq_type(const T1& a, const T2& b) {
+  return is_same_seq(a, b);
 }
 
-
-
-#define VERIFY_EQ_INT(A,B) VERIFY_IS_APPROX(int(A),int(B))
+#define VERIFY_EQ_INT(A, B) VERIFY_IS_APPROX(int(A), int(B))
 
 // C++03 does not allow local or unnamed enums as index
-enum DummyEnum { XX=0, YY=1 };
+enum DummyEnum { XX = 0, YY = 1 };
 
-void check_indexed_view()
-{
+void check_indexed_view() {
   Index n = 10;
 
-  ArrayXd a = ArrayXd::LinSpaced(n,0,n-1);
-  Array<double,1,Dynamic> b = a.transpose();
+  ArrayXd a = ArrayXd::LinSpaced(n, 0, n - 1);
+  Array<double, 1, Dynamic> b = a.transpose();
 
-  ArrayXXi A = ArrayXXi::NullaryExpr(n,n, std::ref(encode));
+  ArrayXXi A = ArrayXXi::NullaryExpr(n, n, std::ref(encode));
 
-  for(Index i=0; i<n; ++i)
-    for(Index j=0; j<n; ++j)
-      VERIFY( decode(A(i,j)) == IndexPair(i,j) );
+  for (Index i = 0; i < n; ++i)
+    for (Index j = 0; j < n; ++j) VERIFY(decode(A(i, j)) == IndexPair(i, j));
 
-  Array4i eii(4); eii << 3, 1, 6, 5;
-  std::valarray<int> vali(4); Map<ArrayXi>(&vali[0],4) = eii;
-  std::vector<int> veci(4); Map<ArrayXi>(veci.data(),4) = eii;
+  Array4i eii(4);
+  eii << 3, 1, 6, 5;
+  std::valarray<int> vali(4);
+  Map<ArrayXi>(&vali[0], 4) = eii;
+  std::vector<int> veci(4);
+  Map<ArrayXi>(veci.data(), 4) = eii;
 
-  VERIFY( MATCH( A(3, seq(9,3,-1)),
-    "309  308  307  306  305  304  303")
-  );
+  VERIFY(MATCH(A(3, seq(9, 3, -1)), "309  308  307  306  305  304  303"));
 
-  VERIFY( MATCH( A(seqN(2,5), seq(9,3,-1)),
-    "209  208  207  206  205  204  203\n"
-    "309  308  307  306  305  304  303\n"
-    "409  408  407  406  405  404  403\n"
-    "509  508  507  506  505  504  503\n"
-    "609  608  607  606  605  604  603")
-  );
+  VERIFY(MATCH(A(seqN(2, 5), seq(9, 3, -1)),
+               "209  208  207  206  205  204  203\n"
+               "309  308  307  306  305  304  303\n"
+               "409  408  407  406  405  404  403\n"
+               "509  508  507  506  505  504  503\n"
+               "609  608  607  606  605  604  603"));
 
-  VERIFY( MATCH( A(seqN(2,5), 5),
-    "205\n"
-    "305\n"
-    "405\n"
-    "505\n"
-    "605")
-  );
+  VERIFY(MATCH(A(seqN(2, 5), 5),
+               "205\n"
+               "305\n"
+               "405\n"
+               "505\n"
+               "605"));
 
-  VERIFY( MATCH( A(seqN(last,5,-1), seq(2,last)),
-    "902  903  904  905  906  907  908  909\n"
-    "802  803  804  805  806  807  808  809\n"
-    "702  703  704  705  706  707  708  709\n"
-    "602  603  604  605  606  607  608  609\n"
-    "502  503  504  505  506  507  508  509")
-  );
+  VERIFY(MATCH(A(seqN(last, 5, -1), seq(2, last)),
+               "902  903  904  905  906  907  908  909\n"
+               "802  803  804  805  806  807  808  809\n"
+               "702  703  704  705  706  707  708  709\n"
+               "602  603  604  605  606  607  608  609\n"
+               "502  503  504  505  506  507  508  509"));
 
-  VERIFY( MATCH( A(eii, veci),
-    "303  301  306  305\n"
-    "103  101  106  105\n"
-    "603  601  606  605\n"
-    "503  501  506  505")
-  );
+  VERIFY(MATCH(A(eii, veci),
+               "303  301  306  305\n"
+               "103  101  106  105\n"
+               "603  601  606  605\n"
+               "503  501  506  505"));
 
-  VERIFY( MATCH( A(eii, all),
-    "300  301  302  303  304  305  306  307  308  309\n"
-    "100  101  102  103  104  105  106  107  108  109\n"
-    "600  601  602  603  604  605  606  607  608  609\n"
-    "500  501  502  503  504  505  506  507  508  509")
-  );
+  VERIFY(MATCH(A(eii, all),
+               "300  301  302  303  304  305  306  307  308  309\n"
+               "100  101  102  103  104  105  106  107  108  109\n"
+               "600  601  602  603  604  605  606  607  608  609\n"
+               "500  501  502  503  504  505  506  507  508  509"));
 
   // take row number 3, and repeat it 5 times
-  VERIFY( MATCH( A(seqN(3,5,0), all),
-    "300  301  302  303  304  305  306  307  308  309\n"
-    "300  301  302  303  304  305  306  307  308  309\n"
-    "300  301  302  303  304  305  306  307  308  309\n"
-    "300  301  302  303  304  305  306  307  308  309\n"
-    "300  301  302  303  304  305  306  307  308  309")
-  );
+  VERIFY(MATCH(A(seqN(3, 5, 0), all),
+               "300  301  302  303  304  305  306  307  308  309\n"
+               "300  301  302  303  304  305  306  307  308  309\n"
+               "300  301  302  303  304  305  306  307  308  309\n"
+               "300  301  302  303  304  305  306  307  308  309\n"
+               "300  301  302  303  304  305  306  307  308  309"));
 
-  VERIFY( MATCH( a(seqN(3,3),0), "3\n4\n5" ) );
-  VERIFY( MATCH( a(seq(3,5)), "3\n4\n5" ) );
-  VERIFY( MATCH( a(seqN(3,3,1)), "3\n4\n5" ) );
-  VERIFY( MATCH( a(seqN(5,3,-1)), "5\n4\n3" ) );
+  VERIFY(MATCH(a(seqN(3, 3), 0), "3\n4\n5"));
+  VERIFY(MATCH(a(seq(3, 5)), "3\n4\n5"));
+  VERIFY(MATCH(a(seqN(3, 3, 1)), "3\n4\n5"));
+  VERIFY(MATCH(a(seqN(5, 3, -1)), "5\n4\n3"));
 
-  VERIFY( MATCH( b(0,seqN(3,3)), "3  4  5" ) );
-  VERIFY( MATCH( b(seq(3,5)), "3  4  5" ) );
-  VERIFY( MATCH( b(seqN(3,3,1)), "3  4  5" ) );
-  VERIFY( MATCH( b(seqN(5,3,-1)), "5  4  3" ) );
+  VERIFY(MATCH(b(0, seqN(3, 3)), "3  4  5"));
+  VERIFY(MATCH(b(seq(3, 5)), "3  4  5"));
+  VERIFY(MATCH(b(seqN(3, 3, 1)), "3  4  5"));
+  VERIFY(MATCH(b(seqN(5, 3, -1)), "5  4  3"));
 
-  VERIFY( MATCH( b(all), "0  1  2  3  4  5  6  7  8  9" ) );
-  VERIFY( MATCH( b(eii), "3  1  6  5" ) );
+  VERIFY(MATCH(b(all), "0  1  2  3  4  5  6  7  8  9"));
+  VERIFY(MATCH(b(eii), "3  1  6  5"));
 
   Array44i B;
   B.setRandom();
-  VERIFY( (A(seqN(2,5), 5)).ColsAtCompileTime == 1);
-  VERIFY( (A(seqN(2,5), 5)).RowsAtCompileTime == Dynamic);
-  VERIFY_EQ_INT( (A(seqN(2,5), 5)).InnerStrideAtCompileTime , A.InnerStrideAtCompileTime);
-  VERIFY_EQ_INT( (A(seqN(2,5), 5)).OuterStrideAtCompileTime , A.col(5).OuterStrideAtCompileTime);
+  VERIFY((A(seqN(2, 5), 5)).ColsAtCompileTime == 1);
+  VERIFY((A(seqN(2, 5), 5)).RowsAtCompileTime == Dynamic);
+  VERIFY_EQ_INT((A(seqN(2, 5), 5)).InnerStrideAtCompileTime, A.InnerStrideAtCompileTime);
+  VERIFY_EQ_INT((A(seqN(2, 5), 5)).OuterStrideAtCompileTime, A.col(5).OuterStrideAtCompileTime);
 
-  VERIFY_EQ_INT( (A(5,seqN(2,5))).InnerStrideAtCompileTime , A.row(5).InnerStrideAtCompileTime);
-  VERIFY_EQ_INT( (A(5,seqN(2,5))).OuterStrideAtCompileTime , A.row(5).OuterStrideAtCompileTime);
-  VERIFY_EQ_INT( (B(1,seqN(1,2))).InnerStrideAtCompileTime , B.row(1).InnerStrideAtCompileTime);
-  VERIFY_EQ_INT( (B(1,seqN(1,2))).OuterStrideAtCompileTime , B.row(1).OuterStrideAtCompileTime);
+  VERIFY_EQ_INT((A(5, seqN(2, 5))).InnerStrideAtCompileTime, A.row(5).InnerStrideAtCompileTime);
+  VERIFY_EQ_INT((A(5, seqN(2, 5))).OuterStrideAtCompileTime, A.row(5).OuterStrideAtCompileTime);
+  VERIFY_EQ_INT((B(1, seqN(1, 2))).InnerStrideAtCompileTime, B.row(1).InnerStrideAtCompileTime);
+  VERIFY_EQ_INT((B(1, seqN(1, 2))).OuterStrideAtCompileTime, B.row(1).OuterStrideAtCompileTime);
 
-  VERIFY_EQ_INT( (A(seqN(2,5), seq(1,3))).InnerStrideAtCompileTime , A.InnerStrideAtCompileTime);
-  VERIFY_EQ_INT( (A(seqN(2,5), seq(1,3))).OuterStrideAtCompileTime , A.OuterStrideAtCompileTime);
-  VERIFY_EQ_INT( (B(seqN(1,2), seq(1,3))).InnerStrideAtCompileTime , B.InnerStrideAtCompileTime);
-  VERIFY_EQ_INT( (B(seqN(1,2), seq(1,3))).OuterStrideAtCompileTime , B.OuterStrideAtCompileTime);
-  VERIFY_EQ_INT( (A(seqN(2,5,2), seq(1,3,2))).InnerStrideAtCompileTime , Dynamic);
-  VERIFY_EQ_INT( (A(seqN(2,5,2), seq(1,3,2))).OuterStrideAtCompileTime , Dynamic);
-  VERIFY_EQ_INT( (A(seqN(2,5,fix<2>), seq(1,3,fix<3>))).InnerStrideAtCompileTime , 2);
-  VERIFY_EQ_INT( (A(seqN(2,5,fix<2>), seq(1,3,fix<3>))).OuterStrideAtCompileTime , Dynamic);
-  VERIFY_EQ_INT( (B(seqN(1,2,fix<2>), seq(1,3,fix<3>))).InnerStrideAtCompileTime , 2);
-  VERIFY_EQ_INT( (B(seqN(1,2,fix<2>), seq(1,3,fix<3>))).OuterStrideAtCompileTime , 3*4);
+  VERIFY_EQ_INT((A(seqN(2, 5), seq(1, 3))).InnerStrideAtCompileTime, A.InnerStrideAtCompileTime);
+  VERIFY_EQ_INT((A(seqN(2, 5), seq(1, 3))).OuterStrideAtCompileTime, A.OuterStrideAtCompileTime);
+  VERIFY_EQ_INT((B(seqN(1, 2), seq(1, 3))).InnerStrideAtCompileTime, B.InnerStrideAtCompileTime);
+  VERIFY_EQ_INT((B(seqN(1, 2), seq(1, 3))).OuterStrideAtCompileTime, B.OuterStrideAtCompileTime);
+  VERIFY_EQ_INT((A(seqN(2, 5, 2), seq(1, 3, 2))).InnerStrideAtCompileTime, Dynamic);
+  VERIFY_EQ_INT((A(seqN(2, 5, 2), seq(1, 3, 2))).OuterStrideAtCompileTime, Dynamic);
+  VERIFY_EQ_INT((A(seqN(2, 5, fix<2>), seq(1, 3, fix<3>))).InnerStrideAtCompileTime, 2);
+  VERIFY_EQ_INT((A(seqN(2, 5, fix<2>), seq(1, 3, fix<3>))).OuterStrideAtCompileTime, Dynamic);
+  VERIFY_EQ_INT((B(seqN(1, 2, fix<2>), seq(1, 3, fix<3>))).InnerStrideAtCompileTime, 2);
+  VERIFY_EQ_INT((B(seqN(1, 2, fix<2>), seq(1, 3, fix<3>))).OuterStrideAtCompileTime, 3 * 4);
 
-  VERIFY_EQ_INT( (A(seqN(2,fix<5>), seqN(1,fix<3>))).RowsAtCompileTime, 5);
-  VERIFY_EQ_INT( (A(seqN(2,fix<5>), seqN(1,fix<3>))).ColsAtCompileTime, 3);
-  VERIFY_EQ_INT( (A(seqN(2,fix<5>(5)), seqN(1,fix<3>(3)))).RowsAtCompileTime, 5);
-  VERIFY_EQ_INT( (A(seqN(2,fix<5>(5)), seqN(1,fix<3>(3)))).ColsAtCompileTime, 3);
-  VERIFY_EQ_INT( (A(seqN(2,fix<Dynamic>(5)), seqN(1,fix<Dynamic>(3)))).RowsAtCompileTime, Dynamic);
-  VERIFY_EQ_INT( (A(seqN(2,fix<Dynamic>(5)), seqN(1,fix<Dynamic>(3)))).ColsAtCompileTime, Dynamic);
-  VERIFY_EQ_INT( (A(seqN(2,fix<Dynamic>(5)), seqN(1,fix<Dynamic>(3)))).rows(), 5);
-  VERIFY_EQ_INT( (A(seqN(2,fix<Dynamic>(5)), seqN(1,fix<Dynamic>(3)))).cols(), 3);
+  VERIFY_EQ_INT((A(seqN(2, fix<5>), seqN(1, fix<3>))).RowsAtCompileTime, 5);
+  VERIFY_EQ_INT((A(seqN(2, fix<5>), seqN(1, fix<3>))).ColsAtCompileTime, 3);
+  VERIFY_EQ_INT((A(seqN(2, fix<5>(5)), seqN(1, fix<3>(3)))).RowsAtCompileTime, 5);
+  VERIFY_EQ_INT((A(seqN(2, fix<5>(5)), seqN(1, fix<3>(3)))).ColsAtCompileTime, 3);
+  VERIFY_EQ_INT((A(seqN(2, fix<Dynamic>(5)), seqN(1, fix<Dynamic>(3)))).RowsAtCompileTime, Dynamic);
+  VERIFY_EQ_INT((A(seqN(2, fix<Dynamic>(5)), seqN(1, fix<Dynamic>(3)))).ColsAtCompileTime, Dynamic);
+  VERIFY_EQ_INT((A(seqN(2, fix<Dynamic>(5)), seqN(1, fix<Dynamic>(3)))).rows(), 5);
+  VERIFY_EQ_INT((A(seqN(2, fix<Dynamic>(5)), seqN(1, fix<Dynamic>(3)))).cols(), 3);
 
-  VERIFY( is_same_seq_type( seqN(2,5,fix<-1>), seqN(2,5,fix<-1>(-1)) ) );
-  VERIFY( is_same_seq_type( seqN(2,5), seqN(2,5,fix<1>(1)) ) );
-  VERIFY( is_same_seq_type( seqN(2,5,3), seqN(2,5,fix<DynamicIndex>(3)) ) );
-  VERIFY( is_same_seq_type( seq(2,7,fix<3>), seqN(2,2,fix<3>) ) );
-  VERIFY( is_same_seq_type( seqN(2,fix<Dynamic>(5),3), seqN(2,5,fix<DynamicIndex>(3)) ) );
-  VERIFY( is_same_seq_type( seqN(2,fix<5>(5),fix<-2>), seqN(2,fix<5>,fix<-2>()) ) );
+  VERIFY(is_same_seq_type(seqN(2, 5, fix<-1>), seqN(2, 5, fix<-1>(-1))));
+  VERIFY(is_same_seq_type(seqN(2, 5), seqN(2, 5, fix<1>(1))));
+  VERIFY(is_same_seq_type(seqN(2, 5, 3), seqN(2, 5, fix<DynamicIndex>(3))));
+  VERIFY(is_same_seq_type(seq(2, 7, fix<3>), seqN(2, 2, fix<3>)));
+  VERIFY(is_same_seq_type(seqN(2, fix<Dynamic>(5), 3), seqN(2, 5, fix<DynamicIndex>(3))));
+  VERIFY(is_same_seq_type(seqN(2, fix<5>(5), fix<-2>), seqN(2, fix<5>, fix<-2>())));
 
-  VERIFY( is_same_seq_type( seq(2,fix<5>), seqN(2,4) ) );
-  VERIFY( is_same_seq_type( seq(fix<2>,fix<5>), seqN(fix<2>,fix<4>) ) );
-  VERIFY( is_same_seq( seqN(2,std::integral_constant<int,5>(),std::integral_constant<int,-2>()), seqN(2,fix<5>,fix<-2>()) ) );
-  VERIFY( is_same_seq( seq(std::integral_constant<int,1>(),std::integral_constant<int,5>(),std::integral_constant<int,2>()),
-                       seq(fix<1>,fix<5>,fix<2>()) ) );
-  VERIFY( is_same_seq_type( seqN(2,std::integral_constant<int,5>(),std::integral_constant<int,-2>()), seqN(2,fix<5>,fix<-2>()) ) );
-  VERIFY( is_same_seq_type( seq(std::integral_constant<int,1>(),std::integral_constant<int,5>(),std::integral_constant<int,2>()),
-                            seq(fix<1>,fix<5>,fix<2>()) ) );
+  VERIFY(is_same_seq_type(seq(2, fix<5>), seqN(2, 4)));
+  VERIFY(is_same_seq_type(seq(fix<2>, fix<5>), seqN(fix<2>, fix<4>)));
+  VERIFY(is_same_seq(seqN(2, std::integral_constant<int, 5>(), std::integral_constant<int, -2>()),
+                     seqN(2, fix<5>, fix<-2>())));
+  VERIFY(is_same_seq(
+      seq(std::integral_constant<int, 1>(), std::integral_constant<int, 5>(), std::integral_constant<int, 2>()),
+      seq(fix<1>, fix<5>, fix<2>())));
+  VERIFY(is_same_seq_type(seqN(2, std::integral_constant<int, 5>(), std::integral_constant<int, -2>()),
+                          seqN(2, fix<5>, fix<-2>())));
+  VERIFY(is_same_seq_type(
+      seq(std::integral_constant<int, 1>(), std::integral_constant<int, 5>(), std::integral_constant<int, 2>()),
+      seq(fix<1>, fix<5>, fix<2>())));
 
-  VERIFY( is_same_seq_type( seqN(2,std::integral_constant<int,5>()), seqN(2,fix<5>) ) );
-  VERIFY( is_same_seq_type( seq(std::integral_constant<int,1>(),std::integral_constant<int,5>()), seq(fix<1>,fix<5>) ) );
+  VERIFY(is_same_seq_type(seqN(2, std::integral_constant<int, 5>()), seqN(2, fix<5>)));
+  VERIFY(
+      is_same_seq_type(seq(std::integral_constant<int, 1>(), std::integral_constant<int, 5>()), seq(fix<1>, fix<5>)));
 
-  VERIFY( (A(seqN(2,fix<5>), 5)).RowsAtCompileTime == 5);
-  VERIFY( (A(4, all)).ColsAtCompileTime == Dynamic);
-  VERIFY( (A(4, all)).RowsAtCompileTime == 1);
-  VERIFY( (B(1, all)).ColsAtCompileTime == 4);
-  VERIFY( (B(1, all)).RowsAtCompileTime == 1);
-  VERIFY( (B(all,1)).ColsAtCompileTime == 1);
-  VERIFY( (B(all,1)).RowsAtCompileTime == 4);
+  VERIFY((A(seqN(2, fix<5>), 5)).RowsAtCompileTime == 5);
+  VERIFY((A(4, all)).ColsAtCompileTime == Dynamic);
+  VERIFY((A(4, all)).RowsAtCompileTime == 1);
+  VERIFY((B(1, all)).ColsAtCompileTime == 4);
+  VERIFY((B(1, all)).RowsAtCompileTime == 1);
+  VERIFY((B(all, 1)).ColsAtCompileTime == 1);
+  VERIFY((B(all, 1)).RowsAtCompileTime == 4);
 
-  VERIFY(int( (A(all, eii)).ColsAtCompileTime) == int(eii.SizeAtCompileTime));
-  VERIFY_EQ_INT( (A(eii, eii)).Flags&DirectAccessBit, (unsigned int)(0));
-  VERIFY_EQ_INT( (A(eii, eii)).InnerStrideAtCompileTime, 0);
-  VERIFY_EQ_INT( (A(eii, eii)).OuterStrideAtCompileTime, 0);
+  VERIFY(int((A(all, eii)).ColsAtCompileTime) == int(eii.SizeAtCompileTime));
+  VERIFY_EQ_INT((A(eii, eii)).Flags & DirectAccessBit, (unsigned int)(0));
+  VERIFY_EQ_INT((A(eii, eii)).InnerStrideAtCompileTime, 0);
+  VERIFY_EQ_INT((A(eii, eii)).OuterStrideAtCompileTime, 0);
 
-  VERIFY_IS_APPROX( A(seq(n-1,2,-2), seqN(n-1-6,3,-1)), A(seq(last,2,fix<-2>), seqN(last-6,3,fix<-1>)) );
+  VERIFY_IS_APPROX(A(seq(n - 1, 2, -2), seqN(n - 1 - 6, 3, -1)), A(seq(last, 2, fix<-2>), seqN(last - 6, 3, fix<-1>)));
 
-  VERIFY_IS_APPROX( A(seq(n-1,2,-2), seqN(n-1-6,4)), A(seq(last,2,-2), seqN(last-6,4)) );
-  VERIFY_IS_APPROX( A(seq(n-1-6,n-1-2), seqN(n-1-6,4)), A(seq(last-6,last-2), seqN(6+last-6-6,4)) );
-  VERIFY_IS_APPROX( A(seq((n-1)/2,(n)/2+3), seqN(2,4)), A(seq(last/2,(last+1)/2+3), seqN(last+2-last,4)) );
-  VERIFY_IS_APPROX( A(seq(n-2,2,-2), seqN(n-8,4)), A(seq(lastp1-2,2,-2), seqN(lastp1-8,4)) );
+  VERIFY_IS_APPROX(A(seq(n - 1, 2, -2), seqN(n - 1 - 6, 4)), A(seq(last, 2, -2), seqN(last - 6, 4)));
+  VERIFY_IS_APPROX(A(seq(n - 1 - 6, n - 1 - 2), seqN(n - 1 - 6, 4)),
+                   A(seq(last - 6, last - 2), seqN(6 + last - 6 - 6, 4)));
+  VERIFY_IS_APPROX(A(seq((n - 1) / 2, (n) / 2 + 3), seqN(2, 4)),
+                   A(seq(last / 2, (last + 1) / 2 + 3), seqN(last + 2 - last, 4)));
+  VERIFY_IS_APPROX(A(seq(n - 2, 2, -2), seqN(n - 8, 4)), A(seq(lastp1 - 2, 2, -2), seqN(lastp1 - 8, 4)));
 
   // Check all combinations of seq:
-  VERIFY_IS_APPROX( A(seq(1,n-1-2,2), seq(1,n-1-2,2)), A(seq(1,last-2,2), seq(1,last-2,fix<2>)) );
-  VERIFY_IS_APPROX( A(seq(n-1-5,n-1-2,2), seq(n-1-5,n-1-2,2)), A(seq(last-5,last-2,2), seq(last-5,last-2,fix<2>)) );
-  VERIFY_IS_APPROX( A(seq(n-1-5,7,2), seq(n-1-5,7,2)), A(seq(last-5,7,2), seq(last-5,7,fix<2>)) );
-  VERIFY_IS_APPROX( A(seq(1,n-1-2), seq(n-1-5,7)), A(seq(1,last-2), seq(last-5,7)) );
-  VERIFY_IS_APPROX( A(seq(n-1-5,n-1-2), seq(n-1-5,n-1-2)), A(seq(last-5,last-2), seq(last-5,last-2)) );
+  VERIFY_IS_APPROX(A(seq(1, n - 1 - 2, 2), seq(1, n - 1 - 2, 2)), A(seq(1, last - 2, 2), seq(1, last - 2, fix<2>)));
+  VERIFY_IS_APPROX(A(seq(n - 1 - 5, n - 1 - 2, 2), seq(n - 1 - 5, n - 1 - 2, 2)),
+                   A(seq(last - 5, last - 2, 2), seq(last - 5, last - 2, fix<2>)));
+  VERIFY_IS_APPROX(A(seq(n - 1 - 5, 7, 2), seq(n - 1 - 5, 7, 2)), A(seq(last - 5, 7, 2), seq(last - 5, 7, fix<2>)));
+  VERIFY_IS_APPROX(A(seq(1, n - 1 - 2), seq(n - 1 - 5, 7)), A(seq(1, last - 2), seq(last - 5, 7)));
+  VERIFY_IS_APPROX(A(seq(n - 1 - 5, n - 1 - 2), seq(n - 1 - 5, n - 1 - 2)),
+                   A(seq(last - 5, last - 2), seq(last - 5, last - 2)));
 
-  VERIFY_IS_APPROX( A.col(A.cols()-1), A(all,last) );
-  VERIFY_IS_APPROX( A(A.rows()-2, A.cols()/2), A(last-1, lastp1/2) );
-  VERIFY_IS_APPROX( a(a.size()-2), a(last-1) );
-  VERIFY_IS_APPROX( a(a.size()/2), a((last+1)/2) );
+  VERIFY_IS_APPROX(A.col(A.cols() - 1), A(all, last));
+  VERIFY_IS_APPROX(A(A.rows() - 2, A.cols() / 2), A(last - 1, lastp1 / 2));
+  VERIFY_IS_APPROX(a(a.size() - 2), a(last - 1));
+  VERIFY_IS_APPROX(a(a.size() / 2), a((last + 1) / 2));
 
   // Check fall-back to Block
   {
-    VERIFY( is_same_eq(A.col(0), A(all,0)) );
-    VERIFY( is_same_eq(A.row(0), A(0,all)) );
-    VERIFY( is_same_eq(A.block(0,0,2,2), A(seqN(0,2),seq(0,1))) );
-    VERIFY( is_same_eq(A.middleRows(2,4), A(seqN(2,4),all)) );
-    VERIFY( is_same_eq(A.middleCols(2,4), A(all,seqN(2,4))) );
+    VERIFY(is_same_eq(A.col(0), A(all, 0)));
+    VERIFY(is_same_eq(A.row(0), A(0, all)));
+    VERIFY(is_same_eq(A.block(0, 0, 2, 2), A(seqN(0, 2), seq(0, 1))));
+    VERIFY(is_same_eq(A.middleRows(2, 4), A(seqN(2, 4), all)));
+    VERIFY(is_same_eq(A.middleCols(2, 4), A(all, seqN(2, 4))));
 
-    VERIFY( is_same_eq(A.col(A.cols()-1), A(all,last)) );
+    VERIFY(is_same_eq(A.col(A.cols() - 1), A(all, last)));
 
     const ArrayXXi& cA(A);
-    VERIFY( is_same_eq(cA.col(0), cA(all,0)) );
-    VERIFY( is_same_eq(cA.row(0), cA(0,all)) );
-    VERIFY( is_same_eq(cA.block(0,0,2,2), cA(seqN(0,2),seq(0,1))) );
-    VERIFY( is_same_eq(cA.middleRows(2,4), cA(seqN(2,4),all)) );
-    VERIFY( is_same_eq(cA.middleCols(2,4), cA(all,seqN(2,4))) );
+    VERIFY(is_same_eq(cA.col(0), cA(all, 0)));
+    VERIFY(is_same_eq(cA.row(0), cA(0, all)));
+    VERIFY(is_same_eq(cA.block(0, 0, 2, 2), cA(seqN(0, 2), seq(0, 1))));
+    VERIFY(is_same_eq(cA.middleRows(2, 4), cA(seqN(2, 4), all)));
+    VERIFY(is_same_eq(cA.middleCols(2, 4), cA(all, seqN(2, 4))));
 
-    VERIFY( is_same_eq(a.head(4), a(seq(0,3))) );
-    VERIFY( is_same_eq(a.tail(4), a(seqN(last-3,4))) );
-    VERIFY( is_same_eq(a.tail(4), a(seq(lastp1-4,last))) );
-    VERIFY( is_same_eq(a.segment<4>(3), a(seqN(3,fix<4>))) );
+    VERIFY(is_same_eq(a.head(4), a(seq(0, 3))));
+    VERIFY(is_same_eq(a.tail(4), a(seqN(last - 3, 4))));
+    VERIFY(is_same_eq(a.tail(4), a(seq(lastp1 - 4, last))));
+    VERIFY(is_same_eq(a.segment<4>(3), a(seqN(3, fix<4>))));
   }
 
-  ArrayXXi A1=A, A2 = ArrayXXi::Random(4,4);
-  ArrayXi range25(4); range25 << 3,2,4,5;
-  A1(seqN(3,4),seq(2,5)) = A2;
-  VERIFY_IS_APPROX( A1.block(3,2,4,4), A2 );
+  ArrayXXi A1 = A, A2 = ArrayXXi::Random(4, 4);
+  ArrayXi range25(4);
+  range25 << 3, 2, 4, 5;
+  A1(seqN(3, 4), seq(2, 5)) = A2;
+  VERIFY_IS_APPROX(A1.block(3, 2, 4, 4), A2);
   A1 = A;
   A2.setOnes();
-  A1(seq(6,3,-1),range25) = A2;
-  VERIFY_IS_APPROX( A1.block(3,2,4,4), A2 );
+  A1(seq(6, 3, -1), range25) = A2;
+  VERIFY_IS_APPROX(A1.block(3, 2, 4, 4), A2);
 
   // check reverse
   {
-    VERIFY( is_same_seq_type( seq(3,7).reverse(), seqN(7,5,fix<-1>)  ) );
-    VERIFY( is_same_seq_type( seq(7,3,fix<-2>).reverse(), seqN(3,3,fix<2>)  ) );
-    VERIFY_IS_APPROX( a(seqN(2,last/2).reverse()), a(seqN(2+(last/2-1)*1,last/2,fix<-1>)) );
-    VERIFY_IS_APPROX( a(seqN(last/2,fix<4>).reverse()),a(seqN(last/2,fix<4>)).reverse() );
-    VERIFY_IS_APPROX( A(seq(last-5,last-1,2).reverse(), seqN(last-3,3,fix<-2>).reverse()),
-                      A(seq(last-5,last-1,2), seqN(last-3,3,fix<-2>)).reverse() );
+    VERIFY(is_same_seq_type(seq(3, 7).reverse(), seqN(7, 5, fix<-1>)));
+    VERIFY(is_same_seq_type(seq(7, 3, fix<-2>).reverse(), seqN(3, 3, fix<2>)));
+    VERIFY_IS_APPROX(a(seqN(2, last / 2).reverse()), a(seqN(2 + (last / 2 - 1) * 1, last / 2, fix<-1>)));
+    VERIFY_IS_APPROX(a(seqN(last / 2, fix<4>).reverse()), a(seqN(last / 2, fix<4>)).reverse());
+    VERIFY_IS_APPROX(A(seq(last - 5, last - 1, 2).reverse(), seqN(last - 3, 3, fix<-2>).reverse()),
+                     A(seq(last - 5, last - 1, 2), seqN(last - 3, 3, fix<-2>)).reverse());
   }
 
   // check lastN
-  VERIFY_IS_APPROX( a(lastN(3)), a.tail(3) );
-  VERIFY( MATCH( a(lastN(3)), "7\n8\n9" ) );
-  VERIFY_IS_APPROX( a(lastN(fix<3>())), a.tail<3>() );
-  VERIFY( MATCH( a(lastN(3,2)), "5\n7\n9" ) );
-  VERIFY( MATCH( a(lastN(3,fix<2>())), "5\n7\n9" ) );
-  VERIFY( a(lastN(fix<3>())).SizeAtCompileTime == 3 );
+  VERIFY_IS_APPROX(a(lastN(3)), a.tail(3));
+  VERIFY(MATCH(a(lastN(3)), "7\n8\n9"));
+  VERIFY_IS_APPROX(a(lastN(fix<3>())), a.tail<3>());
+  VERIFY(MATCH(a(lastN(3, 2)), "5\n7\n9"));
+  VERIFY(MATCH(a(lastN(3, fix<2>())), "5\n7\n9"));
+  VERIFY(a(lastN(fix<3>())).SizeAtCompileTime == 3);
 
-  VERIFY( (A(all, std::array<int,4>{{1,3,2,4}})).ColsAtCompileTime == 4);
+  VERIFY((A(all, std::array<int, 4>{{1, 3, 2, 4}})).ColsAtCompileTime == 4);
 
-  VERIFY_IS_APPROX( (A(std::array<int,3>{{1,3,5}}, std::array<int,4>{{9,6,3,0}})), A(seqN(1,3,2), seqN(9,4,-3)) );
+  VERIFY_IS_APPROX((A(std::array<int, 3>{{1, 3, 5}}, std::array<int, 4>{{9, 6, 3, 0}})),
+                   A(seqN(1, 3, 2), seqN(9, 4, -3)));
   VERIFY_IS_EQUAL(A(std::array<int, 3>{1, 3, 5}, std::array<int, 4>{3, 1, 6, 5}).RowsAtCompileTime, 3);
   VERIFY_IS_EQUAL(A(std::array<int, 3>{1, 3, 5}, std::array<int, 4>{3, 1, 6, 5}).ColsAtCompileTime, 4);
 
-  VERIFY_IS_EQUAL( a(std::array<int,3>{1,3,5}).SizeAtCompileTime, 3 );
-  VERIFY_IS_EQUAL( b(std::array<int,3>{1,3,5}).SizeAtCompileTime, 3 );
+  VERIFY_IS_EQUAL(a(std::array<int, 3>{1, 3, 5}).SizeAtCompileTime, 3);
+  VERIFY_IS_EQUAL(b(std::array<int, 3>{1, 3, 5}).SizeAtCompileTime, 3);
 
   // check different index types (C-style array, STL container, Eigen type)
   {
@@ -302,23 +294,23 @@
     ArrayXi idx = ArrayXi::EqualSpaced(size, 0, 1);
     std::shuffle(idx.begin(), idx.end(), std::random_device());
 
-    int c_array[3] = { idx[0], idx[1], idx[2] };
-    std::vector<int> std_vector{ idx[0], idx[1], idx[2] };
-    Matrix<int, 3, 1> eigen_matrix{ idx[0], idx[1], idx[2] };
+    int c_array[3] = {idx[0], idx[1], idx[2]};
+    std::vector<int> std_vector{idx[0], idx[1], idx[2]};
+    Matrix<int, 3, 1> eigen_matrix{idx[0], idx[1], idx[2]};
 
     // non-const access
-    VERIFY_IS_CWISE_EQUAL(r({ idx[0], idx[1], idx[2] }), r(c_array));
-    VERIFY_IS_CWISE_EQUAL(r({ idx[0], idx[1], idx[2] }), r(std_vector));
-    VERIFY_IS_CWISE_EQUAL(r({ idx[0], idx[1], idx[2] }), r(eigen_matrix));
+    VERIFY_IS_CWISE_EQUAL(r({idx[0], idx[1], idx[2]}), r(c_array));
+    VERIFY_IS_CWISE_EQUAL(r({idx[0], idx[1], idx[2]}), r(std_vector));
+    VERIFY_IS_CWISE_EQUAL(r({idx[0], idx[1], idx[2]}), r(eigen_matrix));
     VERIFY_IS_CWISE_EQUAL(r(std_vector), r(c_array));
     VERIFY_IS_CWISE_EQUAL(r(std_vector), r(eigen_matrix));
     VERIFY_IS_CWISE_EQUAL(r(eigen_matrix), r(c_array));
 
     const ArrayXd& r_ref = r;
     // const access
-    VERIFY_IS_CWISE_EQUAL(r_ref({ idx[0], idx[1], idx[2] }), r_ref(c_array));
-    VERIFY_IS_CWISE_EQUAL(r_ref({ idx[0], idx[1], idx[2] }), r_ref(std_vector));
-    VERIFY_IS_CWISE_EQUAL(r_ref({ idx[0], idx[1], idx[2] }), r_ref(eigen_matrix));
+    VERIFY_IS_CWISE_EQUAL(r_ref({idx[0], idx[1], idx[2]}), r_ref(c_array));
+    VERIFY_IS_CWISE_EQUAL(r_ref({idx[0], idx[1], idx[2]}), r_ref(std_vector));
+    VERIFY_IS_CWISE_EQUAL(r_ref({idx[0], idx[1], idx[2]}), r_ref(eigen_matrix));
     VERIFY_IS_CWISE_EQUAL(r_ref(std_vector), r_ref(c_array));
     VERIFY_IS_CWISE_EQUAL(r_ref(std_vector), r_ref(eigen_matrix));
     VERIFY_IS_CWISE_EQUAL(r_ref(eigen_matrix), r_ref(c_array));
@@ -333,26 +325,32 @@
     std::shuffle(r_idx.begin(), r_idx.end(), std::random_device());
     std::shuffle(c_idx.begin(), c_idx.end(), std::random_device());
 
-    int c_array_rows[3] = { r_idx[0], r_idx[1], r_idx[2] };
-    int c_array_cols[4] = { c_idx[0], c_idx[1], c_idx[2], c_idx[3] };
-    std::vector<int> std_vector_rows{ r_idx[0], r_idx[1], r_idx[2] };
-    std::vector<int> std_vector_cols{ c_idx[0], c_idx[1], c_idx[2], c_idx[3] };
-    Matrix<int, 3, 1> eigen_matrix_rows{ r_idx[0], r_idx[1], r_idx[2] };
-    Matrix<int, 4, 1> eigen_matrix_cols{ c_idx[0], c_idx[1], c_idx[2], c_idx[3] };
+    int c_array_rows[3] = {r_idx[0], r_idx[1], r_idx[2]};
+    int c_array_cols[4] = {c_idx[0], c_idx[1], c_idx[2], c_idx[3]};
+    std::vector<int> std_vector_rows{r_idx[0], r_idx[1], r_idx[2]};
+    std::vector<int> std_vector_cols{c_idx[0], c_idx[1], c_idx[2], c_idx[3]};
+    Matrix<int, 3, 1> eigen_matrix_rows{r_idx[0], r_idx[1], r_idx[2]};
+    Matrix<int, 4, 1> eigen_matrix_cols{c_idx[0], c_idx[1], c_idx[2], c_idx[3]};
 
     // non-const access
-    VERIFY_IS_CWISE_EQUAL(R({ r_idx[0], r_idx[1], r_idx[2] }, { c_idx[0], c_idx[1], c_idx[2], c_idx[3] }), R(c_array_rows, c_array_cols));
-    VERIFY_IS_CWISE_EQUAL(R({ r_idx[0], r_idx[1], r_idx[2] }, { c_idx[0], c_idx[1], c_idx[2], c_idx[3] }), R(std_vector_rows, std_vector_cols));
-    VERIFY_IS_CWISE_EQUAL(R({ r_idx[0], r_idx[1], r_idx[2] }, { c_idx[0], c_idx[1], c_idx[2], c_idx[3] }), R(eigen_matrix_rows, eigen_matrix_cols));
+    VERIFY_IS_CWISE_EQUAL(R({r_idx[0], r_idx[1], r_idx[2]}, {c_idx[0], c_idx[1], c_idx[2], c_idx[3]}),
+                          R(c_array_rows, c_array_cols));
+    VERIFY_IS_CWISE_EQUAL(R({r_idx[0], r_idx[1], r_idx[2]}, {c_idx[0], c_idx[1], c_idx[2], c_idx[3]}),
+                          R(std_vector_rows, std_vector_cols));
+    VERIFY_IS_CWISE_EQUAL(R({r_idx[0], r_idx[1], r_idx[2]}, {c_idx[0], c_idx[1], c_idx[2], c_idx[3]}),
+                          R(eigen_matrix_rows, eigen_matrix_cols));
     VERIFY_IS_CWISE_EQUAL(R(std_vector_rows, std_vector_cols), R(c_array_rows, c_array_cols));
     VERIFY_IS_CWISE_EQUAL(R(std_vector_rows, std_vector_cols), R(eigen_matrix_rows, eigen_matrix_cols));
     VERIFY_IS_CWISE_EQUAL(R(eigen_matrix_rows, eigen_matrix_cols), R(c_array_rows, c_array_cols));
 
     const ArrayXXd& R_ref = R;
     // const access
-    VERIFY_IS_CWISE_EQUAL(R_ref({ r_idx[0], r_idx[1], r_idx[2] }, { c_idx[0], c_idx[1], c_idx[2], c_idx[3] }), R_ref(c_array_rows, c_array_cols));
-    VERIFY_IS_CWISE_EQUAL(R_ref({ r_idx[0], r_idx[1], r_idx[2] }, { c_idx[0], c_idx[1], c_idx[2], c_idx[3] }), R_ref(std_vector_rows, std_vector_cols));
-    VERIFY_IS_CWISE_EQUAL(R_ref({ r_idx[0], r_idx[1], r_idx[2] }, { c_idx[0], c_idx[1], c_idx[2], c_idx[3] }), R_ref(eigen_matrix_rows, eigen_matrix_cols));
+    VERIFY_IS_CWISE_EQUAL(R_ref({r_idx[0], r_idx[1], r_idx[2]}, {c_idx[0], c_idx[1], c_idx[2], c_idx[3]}),
+                          R_ref(c_array_rows, c_array_cols));
+    VERIFY_IS_CWISE_EQUAL(R_ref({r_idx[0], r_idx[1], r_idx[2]}, {c_idx[0], c_idx[1], c_idx[2], c_idx[3]}),
+                          R_ref(std_vector_rows, std_vector_cols));
+    VERIFY_IS_CWISE_EQUAL(R_ref({r_idx[0], r_idx[1], r_idx[2]}, {c_idx[0], c_idx[1], c_idx[2], c_idx[3]}),
+                          R_ref(eigen_matrix_rows, eigen_matrix_cols));
     VERIFY_IS_CWISE_EQUAL(R_ref(std_vector_rows, std_vector_cols), R_ref(c_array_rows, c_array_cols));
     VERIFY_IS_CWISE_EQUAL(R_ref(std_vector_rows, std_vector_cols), R_ref(eigen_matrix_rows, eigen_matrix_cols));
     VERIFY_IS_CWISE_EQUAL(R_ref(eigen_matrix_rows, eigen_matrix_cols), R_ref(c_array_rows, c_array_cols));
@@ -360,65 +358,65 @@
 
   // check mat(i,j) with weird types for i and j
   {
-    VERIFY_IS_APPROX( A(B.RowsAtCompileTime-1, 1), A(3,1) );
-    VERIFY_IS_APPROX( A(B.RowsAtCompileTime, 1), A(4,1) );
-    VERIFY_IS_APPROX( A(B.RowsAtCompileTime-1, B.ColsAtCompileTime-1), A(3,3) );
-    VERIFY_IS_APPROX( A(B.RowsAtCompileTime, B.ColsAtCompileTime), A(4,4) );
+    VERIFY_IS_APPROX(A(B.RowsAtCompileTime - 1, 1), A(3, 1));
+    VERIFY_IS_APPROX(A(B.RowsAtCompileTime, 1), A(4, 1));
+    VERIFY_IS_APPROX(A(B.RowsAtCompileTime - 1, B.ColsAtCompileTime - 1), A(3, 3));
+    VERIFY_IS_APPROX(A(B.RowsAtCompileTime, B.ColsAtCompileTime), A(4, 4));
     const Index I_ = 3, J_ = 4;
-    VERIFY_IS_APPROX( A(I_,J_), A(3,4) );
+    VERIFY_IS_APPROX(A(I_, J_), A(3, 4));
   }
 
   // check extended block API
   {
-    VERIFY( is_same_eq( A.block<3,4>(1,1), A.block(1,1,fix<3>,fix<4>)) );
-    VERIFY( is_same_eq( A.block<3,4>(1,1,3,4), A.block(1,1,fix<3>(),fix<4>(4))) );
-    VERIFY( is_same_eq( A.block<3,Dynamic>(1,1,3,4), A.block(1,1,fix<3>,4)) );
-    VERIFY( is_same_eq( A.block<Dynamic,4>(1,1,3,4), A.block(1,1,fix<Dynamic>(3),fix<4>)) );
-    VERIFY( is_same_eq( A.block(1,1,3,4), A.block(1,1,fix<Dynamic>(3),fix<Dynamic>(4))) );
+    VERIFY(is_same_eq(A.block<3, 4>(1, 1), A.block(1, 1, fix<3>, fix<4>)));
+    VERIFY(is_same_eq(A.block<3, 4>(1, 1, 3, 4), A.block(1, 1, fix<3>(), fix<4>(4))));
+    VERIFY(is_same_eq(A.block<3, Dynamic>(1, 1, 3, 4), A.block(1, 1, fix<3>, 4)));
+    VERIFY(is_same_eq(A.block<Dynamic, 4>(1, 1, 3, 4), A.block(1, 1, fix<Dynamic>(3), fix<4>)));
+    VERIFY(is_same_eq(A.block(1, 1, 3, 4), A.block(1, 1, fix<Dynamic>(3), fix<Dynamic>(4))));
 
-    VERIFY( is_same_eq( A.topLeftCorner<3,4>(), A.topLeftCorner(fix<3>,fix<4>)) );
-    VERIFY( is_same_eq( A.bottomLeftCorner<3,4>(), A.bottomLeftCorner(fix<3>,fix<4>)) );
-    VERIFY( is_same_eq( A.bottomRightCorner<3,4>(), A.bottomRightCorner(fix<3>,fix<4>)) );
-    VERIFY( is_same_eq( A.topRightCorner<3,4>(), A.topRightCorner(fix<3>,fix<4>)) );
+    VERIFY(is_same_eq(A.topLeftCorner<3, 4>(), A.topLeftCorner(fix<3>, fix<4>)));
+    VERIFY(is_same_eq(A.bottomLeftCorner<3, 4>(), A.bottomLeftCorner(fix<3>, fix<4>)));
+    VERIFY(is_same_eq(A.bottomRightCorner<3, 4>(), A.bottomRightCorner(fix<3>, fix<4>)));
+    VERIFY(is_same_eq(A.topRightCorner<3, 4>(), A.topRightCorner(fix<3>, fix<4>)));
 
-    VERIFY( is_same_eq( A.leftCols<3>(), A.leftCols(fix<3>)) );
-    VERIFY( is_same_eq( A.rightCols<3>(), A.rightCols(fix<3>)) );
-    VERIFY( is_same_eq( A.middleCols<3>(1), A.middleCols(1,fix<3>)) );
+    VERIFY(is_same_eq(A.leftCols<3>(), A.leftCols(fix<3>)));
+    VERIFY(is_same_eq(A.rightCols<3>(), A.rightCols(fix<3>)));
+    VERIFY(is_same_eq(A.middleCols<3>(1), A.middleCols(1, fix<3>)));
 
-    VERIFY( is_same_eq( A.topRows<3>(), A.topRows(fix<3>)) );
-    VERIFY( is_same_eq( A.bottomRows<3>(), A.bottomRows(fix<3>)) );
-    VERIFY( is_same_eq( A.middleRows<3>(1), A.middleRows(1,fix<3>)) );
+    VERIFY(is_same_eq(A.topRows<3>(), A.topRows(fix<3>)));
+    VERIFY(is_same_eq(A.bottomRows<3>(), A.bottomRows(fix<3>)));
+    VERIFY(is_same_eq(A.middleRows<3>(1), A.middleRows(1, fix<3>)));
 
-    VERIFY( is_same_eq( a.segment<3>(1), a.segment(1,fix<3>)) );
-    VERIFY( is_same_eq( a.head<3>(), a.head(fix<3>)) );
-    VERIFY( is_same_eq( a.tail<3>(), a.tail(fix<3>)) );
+    VERIFY(is_same_eq(a.segment<3>(1), a.segment(1, fix<3>)));
+    VERIFY(is_same_eq(a.head<3>(), a.head(fix<3>)));
+    VERIFY(is_same_eq(a.tail<3>(), a.tail(fix<3>)));
 
     const ArrayXXi& cA(A);
-    VERIFY( is_same_eq( cA.block<Dynamic,4>(1,1,3,4), cA.block(1,1,fix<Dynamic>(3),fix<4>)) );
+    VERIFY(is_same_eq(cA.block<Dynamic, 4>(1, 1, 3, 4), cA.block(1, 1, fix<Dynamic>(3), fix<4>)));
 
-    VERIFY( is_same_eq( cA.topLeftCorner<3,4>(), cA.topLeftCorner(fix<3>,fix<4>)) );
-    VERIFY( is_same_eq( cA.bottomLeftCorner<3,4>(), cA.bottomLeftCorner(fix<3>,fix<4>)) );
-    VERIFY( is_same_eq( cA.bottomRightCorner<3,4>(), cA.bottomRightCorner(fix<3>,fix<4>)) );
-    VERIFY( is_same_eq( cA.topRightCorner<3,4>(), cA.topRightCorner(fix<3>,fix<4>)) );
+    VERIFY(is_same_eq(cA.topLeftCorner<3, 4>(), cA.topLeftCorner(fix<3>, fix<4>)));
+    VERIFY(is_same_eq(cA.bottomLeftCorner<3, 4>(), cA.bottomLeftCorner(fix<3>, fix<4>)));
+    VERIFY(is_same_eq(cA.bottomRightCorner<3, 4>(), cA.bottomRightCorner(fix<3>, fix<4>)));
+    VERIFY(is_same_eq(cA.topRightCorner<3, 4>(), cA.topRightCorner(fix<3>, fix<4>)));
 
-    VERIFY( is_same_eq( cA.leftCols<3>(), cA.leftCols(fix<3>)) );
-    VERIFY( is_same_eq( cA.rightCols<3>(), cA.rightCols(fix<3>)) );
-    VERIFY( is_same_eq( cA.middleCols<3>(1), cA.middleCols(1,fix<3>)) );
+    VERIFY(is_same_eq(cA.leftCols<3>(), cA.leftCols(fix<3>)));
+    VERIFY(is_same_eq(cA.rightCols<3>(), cA.rightCols(fix<3>)));
+    VERIFY(is_same_eq(cA.middleCols<3>(1), cA.middleCols(1, fix<3>)));
 
-    VERIFY( is_same_eq( cA.topRows<3>(), cA.topRows(fix<3>)) );
-    VERIFY( is_same_eq( cA.bottomRows<3>(), cA.bottomRows(fix<3>)) );
-    VERIFY( is_same_eq( cA.middleRows<3>(1), cA.middleRows(1,fix<3>)) );
+    VERIFY(is_same_eq(cA.topRows<3>(), cA.topRows(fix<3>)));
+    VERIFY(is_same_eq(cA.bottomRows<3>(), cA.bottomRows(fix<3>)));
+    VERIFY(is_same_eq(cA.middleRows<3>(1), cA.middleRows(1, fix<3>)));
   }
 
   // Check compilation of enums as index type:
   a(XX) = 1;
-  A(XX,YY) = 1;
+  A(XX, YY) = 1;
   // Anonymous enums only work with C++11
-  enum { X=0, Y=1 };
+  enum { X = 0, Y = 1 };
   a(X) = 1;
-  A(X,Y) = 1;
-  A(XX,Y) = 1;
-  A(X,YY) = 1;
+  A(X, Y) = 1;
+  A(XX, Y) = 1;
+  A(X, YY) = 1;
   // check symbolic indices
   a(last) = 1.0;
   A(last, last) = 1;
@@ -447,27 +445,27 @@
     VERIFY_IS_EQUAL(matrixXpr.coeff(matrixXpr.rows() - 1, matrixXpr.cols() - 1), matrixXpr(last, last));
   }
 
-
   // Check compilation of varying integer types as index types:
-  Index i = n/2;
+  Index i = n / 2;
   short i_short(i);
   std::size_t i_sizet(i);
-  VERIFY_IS_EQUAL( a(i), a.coeff(i_short) );
-  VERIFY_IS_EQUAL( a(i), a.coeff(i_sizet) );
+  VERIFY_IS_EQUAL(a(i), a.coeff(i_short));
+  VERIFY_IS_EQUAL(a(i), a.coeff(i_sizet));
 
-  VERIFY_IS_EQUAL( A(i,i), A.coeff(i_short, i_short) );
-  VERIFY_IS_EQUAL( A(i,i), A.coeff(i_short, i) );
-  VERIFY_IS_EQUAL( A(i,i), A.coeff(i, i_short) );
-  VERIFY_IS_EQUAL( A(i,i), A.coeff(i, i_sizet) );
-  VERIFY_IS_EQUAL( A(i,i), A.coeff(i_sizet, i) );
-  VERIFY_IS_EQUAL( A(i,i), A.coeff(i_sizet, i_short) );
-  VERIFY_IS_EQUAL( A(i,i), A.coeff(5, i_sizet) );
+  VERIFY_IS_EQUAL(A(i, i), A.coeff(i_short, i_short));
+  VERIFY_IS_EQUAL(A(i, i), A.coeff(i_short, i));
+  VERIFY_IS_EQUAL(A(i, i), A.coeff(i, i_short));
+  VERIFY_IS_EQUAL(A(i, i), A.coeff(i, i_sizet));
+  VERIFY_IS_EQUAL(A(i, i), A.coeff(i_sizet, i));
+  VERIFY_IS_EQUAL(A(i, i), A.coeff(i_sizet, i_short));
+  VERIFY_IS_EQUAL(A(i, i), A.coeff(5, i_sizet));
 
   // Regression test for Max{Rows,Cols}AtCompileTime
   {
     Matrix3i A3 = Matrix3i::Random();
-    ArrayXi ind(5); ind << 1,1,1,1,1;
-    VERIFY_IS_EQUAL( A3(ind,ind).eval(), MatrixXi::Constant(5,5,A3(1,1)) );
+    ArrayXi ind(5);
+    ind << 1, 1, 1, 1, 1;
+    VERIFY_IS_EQUAL(A3(ind, ind).eval(), MatrixXi::Constant(5, 5, A3(1, 1)));
   }
 
   // Regression for bug 1736
@@ -478,12 +476,12 @@
 
   // bug 1815: IndexedView should allow linear access
   {
-    VERIFY( MATCH( b(eii)(0), "3" ) );
-    VERIFY( MATCH( a(eii)(0), "3" ) );
-    VERIFY( MATCH( A(1,eii)(0), "103"));
-    VERIFY( MATCH( A(eii,1)(0), "301"));
-    VERIFY( MATCH( A(1,all)(1), "101"));
-    VERIFY( MATCH( A(all,1)(1), "101"));
+    VERIFY(MATCH(b(eii)(0), "3"));
+    VERIFY(MATCH(a(eii)(0), "3"));
+    VERIFY(MATCH(A(1, eii)(0), "103"));
+    VERIFY(MATCH(A(eii, 1)(0), "301"));
+    VERIFY(MATCH(A(1, all)(1), "101"));
+    VERIFY(MATCH(A(all, 1)(1), "101"));
   }
 
   // bug #2375: indexing over matrices of dim >128 should compile on gcc
@@ -491,33 +489,30 @@
     Matrix<double, 513, 3> large_mat = Matrix<double, 513, 3>::Random();
     std::array<int, 2> test_indices = {0, 1};
     Matrix<double, 513, 2> thin_slice = large_mat(all, test_indices);
-    for(int col = 0; col < int(test_indices.size()); ++col)
-      for(int row = 0; row < large_mat.rows(); ++row)
-        VERIFY_IS_EQUAL( thin_slice(row, col), large_mat(row, col) );
+    for (int col = 0; col < int(test_indices.size()); ++col)
+      for (int row = 0; row < large_mat.rows(); ++row) VERIFY_IS_EQUAL(thin_slice(row, col), large_mat(row, col));
   }
 
-  //Bug IndexView with a single static row should be RowMajor:
+  // Bug IndexView with a single static row should be RowMajor:
   {
     // A(1, seq(0,2,1)).cwiseAbs().colwise().replicate(2).eval();
-    STATIC_CHECK(( (internal::evaluator<decltype( A(1,seq(0,2,1)) )>::Flags & RowMajorBit) == RowMajorBit ));
+    STATIC_CHECK(((internal::evaluator<decltype(A(1, seq(0, 2, 1)))>::Flags & RowMajorBit) == RowMajorBit));
   }
-
 }
 
-EIGEN_DECLARE_TEST(indexed_view)
-{
-//   for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( check_indexed_view() );
-//   }
+EIGEN_DECLARE_TEST(indexed_view) {
+  //   for(int i = 0; i < g_repeat; i++) {
+  CALL_SUBTEST_1(check_indexed_view());
+  //   }
 
   // static checks of some internals:
-  STATIC_CHECK(( internal::is_valid_index_type<int>::value ));
-  STATIC_CHECK(( internal::is_valid_index_type<unsigned int>::value ));
-  STATIC_CHECK(( internal::is_valid_index_type<short>::value ));
-  STATIC_CHECK(( internal::is_valid_index_type<std::ptrdiff_t>::value ));
-  STATIC_CHECK(( internal::is_valid_index_type<std::size_t>::value ));
-  STATIC_CHECK(( !internal::valid_indexed_view_overload<int,int>::value ));
-  STATIC_CHECK(( !internal::valid_indexed_view_overload<int,std::ptrdiff_t>::value ));
-  STATIC_CHECK(( !internal::valid_indexed_view_overload<std::ptrdiff_t,int>::value ));
-  STATIC_CHECK(( !internal::valid_indexed_view_overload<std::size_t,int>::value ));
+  STATIC_CHECK((internal::is_valid_index_type<int>::value));
+  STATIC_CHECK((internal::is_valid_index_type<unsigned int>::value));
+  STATIC_CHECK((internal::is_valid_index_type<short>::value));
+  STATIC_CHECK((internal::is_valid_index_type<std::ptrdiff_t>::value));
+  STATIC_CHECK((internal::is_valid_index_type<std::size_t>::value));
+  STATIC_CHECK((!internal::valid_indexed_view_overload<int, int>::value));
+  STATIC_CHECK((!internal::valid_indexed_view_overload<int, std::ptrdiff_t>::value));
+  STATIC_CHECK((!internal::valid_indexed_view_overload<std::ptrdiff_t, int>::value));
+  STATIC_CHECK((!internal::valid_indexed_view_overload<std::size_t, int>::value));
 }
diff --git a/test/initializer_list_construction.cpp b/test/initializer_list_construction.cpp
index b576ec2..2c3f185 100644
--- a/test/initializer_list_construction.cpp
+++ b/test/initializer_list_construction.cpp
@@ -16,34 +16,33 @@
 
 #include "main.h"
 
-template<typename Scalar, bool is_integer = NumTraits<Scalar>::IsInteger>
+template <typename Scalar, bool is_integer = NumTraits<Scalar>::IsInteger>
 struct TestMethodDispatching {
   static void run() {}
 };
 
-template<typename Scalar>
+template <typename Scalar>
 struct TestMethodDispatching<Scalar, 1> {
-  static void run()
-  {
+  static void run() {
     {
-      Matrix<Scalar, Dynamic, Dynamic> m {3, 4};
-      Array<Scalar, Dynamic, Dynamic> a {3, 4};
+      Matrix<Scalar, Dynamic, Dynamic> m{3, 4};
+      Array<Scalar, Dynamic, Dynamic> a{3, 4};
       VERIFY(m.rows() == 3);
       VERIFY(m.cols() == 4);
       VERIFY(a.rows() == 3);
       VERIFY(a.cols() == 4);
     }
     {
-      Matrix<Scalar, 1, 2> m {3, 4};
-      Array<Scalar, 1, 2> a {3, 4};
+      Matrix<Scalar, 1, 2> m{3, 4};
+      Array<Scalar, 1, 2> a{3, 4};
       VERIFY(m(0) == 3);
       VERIFY(m(1) == 4);
       VERIFY(a(0) == 3);
       VERIFY(a(1) == 4);
     }
     {
-      Matrix<Scalar, 2, 1> m {3, 4};
-      Array<Scalar, 2, 1> a {3, 4};
+      Matrix<Scalar, 2, 1> m{3, 4};
+      Array<Scalar, 2, 1> a{3, 4};
       VERIFY(m(0) == 3);
       VERIFY(m(1) == 4);
       VERIFY(a(0) == 3);
@@ -52,119 +51,120 @@
   }
 };
 
-template<typename Vec4, typename Vec5> void fixedsizeVariadicVectorConstruction2()
-{
+template <typename Vec4, typename Vec5>
+void fixedsizeVariadicVectorConstruction2() {
   {
     Vec4 ref = Vec4::Random();
-    Vec4 v{ ref[0], ref[1], ref[2], ref[3] };
+    Vec4 v{ref[0], ref[1], ref[2], ref[3]};
     VERIFY_IS_APPROX(v, ref);
-    VERIFY_IS_APPROX(v, (Vec4( ref[0], ref[1], ref[2], ref[3] )));
+    VERIFY_IS_APPROX(v, (Vec4(ref[0], ref[1], ref[2], ref[3])));
     VERIFY_IS_APPROX(v, (Vec4({ref[0], ref[1], ref[2], ref[3]})));
 
-    Vec4 v2 = { ref[0], ref[1], ref[2], ref[3] };
+    Vec4 v2 = {ref[0], ref[1], ref[2], ref[3]};
     VERIFY_IS_APPROX(v2, ref);
   }
   {
     Vec5 ref = Vec5::Random();
-    Vec5 v{ ref[0], ref[1], ref[2], ref[3], ref[4] };
+    Vec5 v{ref[0], ref[1], ref[2], ref[3], ref[4]};
     VERIFY_IS_APPROX(v, ref);
-    VERIFY_IS_APPROX(v, (Vec5( ref[0], ref[1], ref[2], ref[3], ref[4] )));
+    VERIFY_IS_APPROX(v, (Vec5(ref[0], ref[1], ref[2], ref[3], ref[4])));
     VERIFY_IS_APPROX(v, (Vec5({ref[0], ref[1], ref[2], ref[3], ref[4]})));
 
-    Vec5 v2 = { ref[0], ref[1], ref[2], ref[3], ref[4] };
+    Vec5 v2 = {ref[0], ref[1], ref[2], ref[3], ref[4]};
     VERIFY_IS_APPROX(v2, ref);
   }
 }
 
-#define CHECK_MIXSCALAR_V5_APPROX(V, A0, A1, A2, A3, A4) { \
-  VERIFY_IS_APPROX(V[0], Scalar(A0) ); \
-  VERIFY_IS_APPROX(V[1], Scalar(A1) ); \
-  VERIFY_IS_APPROX(V[2], Scalar(A2) ); \
-  VERIFY_IS_APPROX(V[3], Scalar(A3) ); \
-  VERIFY_IS_APPROX(V[4], Scalar(A4) ); \
-}
+#define CHECK_MIXSCALAR_V5_APPROX(V, A0, A1, A2, A3, A4) \
+  {                                                      \
+    VERIFY_IS_APPROX(V[0], Scalar(A0));                  \
+    VERIFY_IS_APPROX(V[1], Scalar(A1));                  \
+    VERIFY_IS_APPROX(V[2], Scalar(A2));                  \
+    VERIFY_IS_APPROX(V[3], Scalar(A3));                  \
+    VERIFY_IS_APPROX(V[4], Scalar(A4));                  \
+  }
 
-#define CHECK_MIXSCALAR_V5(VEC5, A0, A1, A2, A3, A4) { \
-  typedef VEC5::Scalar Scalar; \
-  VEC5 v = { A0 , A1 , A2 , A3 , A4 }; \
-  CHECK_MIXSCALAR_V5_APPROX(v, A0 , A1 , A2 , A3 , A4); \
-}
+#define CHECK_MIXSCALAR_V5(VEC5, A0, A1, A2, A3, A4)  \
+  {                                                   \
+    typedef VEC5::Scalar Scalar;                      \
+    VEC5 v = {A0, A1, A2, A3, A4};                    \
+    CHECK_MIXSCALAR_V5_APPROX(v, A0, A1, A2, A3, A4); \
+  }
 
-template<int> void fixedsizeVariadicVectorConstruction3()
-{
-  typedef Matrix<double,5,1> Vec5;
-  typedef Array<float,5,1> Arr5;
+template <int>
+void fixedsizeVariadicVectorConstruction3() {
+  typedef Matrix<double, 5, 1> Vec5;
+  typedef Array<float, 5, 1> Arr5;
   CHECK_MIXSCALAR_V5(Vec5, 1, 2., -3, 4.121, 5.53252);
   CHECK_MIXSCALAR_V5(Arr5, 1, 2., 3.12f, 4.121, 5.53252);
 }
 
-template<typename Scalar> void fixedsizeVariadicVectorConstruction()
-{
-  CALL_SUBTEST(( fixedsizeVariadicVectorConstruction2<Matrix<Scalar,4,1>, Matrix<Scalar,5,1> >() ));
-  CALL_SUBTEST(( fixedsizeVariadicVectorConstruction2<Matrix<Scalar,1,4>, Matrix<Scalar,1,5> >() ));
-  CALL_SUBTEST(( fixedsizeVariadicVectorConstruction2<Array<Scalar,4,1>,  Array<Scalar,5,1>  >() ));
-  CALL_SUBTEST(( fixedsizeVariadicVectorConstruction2<Array<Scalar,1,4>,  Array<Scalar,1,5>  >() ));
+template <typename Scalar>
+void fixedsizeVariadicVectorConstruction() {
+  CALL_SUBTEST((fixedsizeVariadicVectorConstruction2<Matrix<Scalar, 4, 1>, Matrix<Scalar, 5, 1>>()));
+  CALL_SUBTEST((fixedsizeVariadicVectorConstruction2<Matrix<Scalar, 1, 4>, Matrix<Scalar, 1, 5>>()));
+  CALL_SUBTEST((fixedsizeVariadicVectorConstruction2<Array<Scalar, 4, 1>, Array<Scalar, 5, 1>>()));
+  CALL_SUBTEST((fixedsizeVariadicVectorConstruction2<Array<Scalar, 1, 4>, Array<Scalar, 1, 5>>()));
 }
 
-
-template<typename Scalar> void initializerListVectorConstruction()
-{
+template <typename Scalar>
+void initializerListVectorConstruction() {
   Scalar raw[4];
-  for(int k = 0; k < 4; ++k) {
+  for (int k = 0; k < 4; ++k) {
     raw[k] = internal::random<Scalar>();
   }
   {
-    Matrix<Scalar, 4, 1> m { {raw[0]}, {raw[1]},{raw[2]},{raw[3]} };
-    Array<Scalar, 4, 1> a { {raw[0]}, {raw[1]}, {raw[2]}, {raw[3]} };
-    for(int k = 0; k < 4; ++k) {
+    Matrix<Scalar, 4, 1> m{{raw[0]}, {raw[1]}, {raw[2]}, {raw[3]}};
+    Array<Scalar, 4, 1> a{{raw[0]}, {raw[1]}, {raw[2]}, {raw[3]}};
+    for (int k = 0; k < 4; ++k) {
       VERIFY(m(k) == raw[k]);
     }
-    for(int k = 0; k < 4; ++k) {
+    for (int k = 0; k < 4; ++k) {
       VERIFY(a(k) == raw[k]);
     }
-    VERIFY_IS_EQUAL(m, (Matrix<Scalar,4,1>({ {raw[0]}, {raw[1]}, {raw[2]}, {raw[3]} })));
-    VERIFY((a == (Array<Scalar,4,1>({ {raw[0]}, {raw[1]}, {raw[2]}, {raw[3]} }))).all());
+    VERIFY_IS_EQUAL(m, (Matrix<Scalar, 4, 1>({{raw[0]}, {raw[1]}, {raw[2]}, {raw[3]}})));
+    VERIFY((a == (Array<Scalar, 4, 1>({{raw[0]}, {raw[1]}, {raw[2]}, {raw[3]}}))).all());
   }
   {
-    Matrix<Scalar, 1, 4> m { {raw[0], raw[1], raw[2], raw[3]} };
-    Array<Scalar, 1, 4> a { {raw[0], raw[1], raw[2], raw[3]} };
-    for(int k = 0; k < 4; ++k) {
+    Matrix<Scalar, 1, 4> m{{raw[0], raw[1], raw[2], raw[3]}};
+    Array<Scalar, 1, 4> a{{raw[0], raw[1], raw[2], raw[3]}};
+    for (int k = 0; k < 4; ++k) {
       VERIFY(m(k) == raw[k]);
     }
-    for(int k = 0; k < 4; ++k) {
+    for (int k = 0; k < 4; ++k) {
       VERIFY(a(k) == raw[k]);
     }
-    VERIFY_IS_EQUAL(m, (Matrix<Scalar, 1, 4>({{raw[0],raw[1],raw[2],raw[3]}})));
-    VERIFY((a == (Array<Scalar, 1, 4>({{raw[0],raw[1],raw[2],raw[3]}}))).all());
+    VERIFY_IS_EQUAL(m, (Matrix<Scalar, 1, 4>({{raw[0], raw[1], raw[2], raw[3]}})));
+    VERIFY((a == (Array<Scalar, 1, 4>({{raw[0], raw[1], raw[2], raw[3]}}))).all());
   }
   {
-    Matrix<Scalar, 4, Dynamic> m { {raw[0]}, {raw[1]}, {raw[2]}, {raw[3]} };
-    Array<Scalar, 4, Dynamic> a { {raw[0]}, {raw[1]}, {raw[2]}, {raw[3]} };
-    for(int k=0; k < 4; ++k) {
+    Matrix<Scalar, 4, Dynamic> m{{raw[0]}, {raw[1]}, {raw[2]}, {raw[3]}};
+    Array<Scalar, 4, Dynamic> a{{raw[0]}, {raw[1]}, {raw[2]}, {raw[3]}};
+    for (int k = 0; k < 4; ++k) {
       VERIFY(m(k) == raw[k]);
     }
-    for(int k=0; k < 4; ++k) {
+    for (int k = 0; k < 4; ++k) {
       VERIFY(a(k) == raw[k]);
     }
-    VERIFY_IS_EQUAL(m, (Matrix<Scalar, 4, Dynamic>({ {raw[0]}, {raw[1]}, {raw[2]}, {raw[3]} })));
-    VERIFY((a == (Array<Scalar, 4, Dynamic>({ {raw[0]}, {raw[1]}, {raw[2]}, {raw[3]} }))).all());
+    VERIFY_IS_EQUAL(m, (Matrix<Scalar, 4, Dynamic>({{raw[0]}, {raw[1]}, {raw[2]}, {raw[3]}})));
+    VERIFY((a == (Array<Scalar, 4, Dynamic>({{raw[0]}, {raw[1]}, {raw[2]}, {raw[3]}}))).all());
   }
   {
-    Matrix<Scalar, Dynamic, 4> m {{raw[0],raw[1],raw[2],raw[3]}};
-    Array<Scalar, Dynamic, 4> a {{raw[0],raw[1],raw[2],raw[3]}};
-    for(int k=0; k < 4; ++k) {
+    Matrix<Scalar, Dynamic, 4> m{{raw[0], raw[1], raw[2], raw[3]}};
+    Array<Scalar, Dynamic, 4> a{{raw[0], raw[1], raw[2], raw[3]}};
+    for (int k = 0; k < 4; ++k) {
       VERIFY(m(k) == raw[k]);
     }
-    for(int k=0; k < 4; ++k) {
+    for (int k = 0; k < 4; ++k) {
       VERIFY(a(k) == raw[k]);
     }
-    VERIFY_IS_EQUAL(m, (Matrix<Scalar, Dynamic, 4>({{raw[0],raw[1],raw[2],raw[3]}})));
-    VERIFY((a == (Array<Scalar, Dynamic, 4>({{raw[0],raw[1],raw[2],raw[3]}}))).all());
+    VERIFY_IS_EQUAL(m, (Matrix<Scalar, Dynamic, 4>({{raw[0], raw[1], raw[2], raw[3]}})));
+    VERIFY((a == (Array<Scalar, Dynamic, 4>({{raw[0], raw[1], raw[2], raw[3]}}))).all());
   }
 }
 
-template<typename Scalar> void initializerListMatrixConstruction()
-{
+template <typename Scalar>
+void initializerListMatrixConstruction() {
   const Index RowsAtCompileTime = 5;
   const Index ColsAtCompileTime = 4;
   const Index SizeAtCompileTime = RowsAtCompileTime * ColsAtCompileTime;
@@ -174,29 +174,24 @@
     raw[i] = internal::random<Scalar>();
   }
   {
-    Matrix<Scalar, Dynamic, Dynamic> m {};
+    Matrix<Scalar, Dynamic, Dynamic> m{};
     VERIFY(m.cols() == 0);
     VERIFY(m.rows() == 0);
     VERIFY_IS_EQUAL(m, (Matrix<Scalar, Dynamic, Dynamic>()));
   }
   {
-    Matrix<Scalar, 5, 4> m {
-      {raw[0], raw[1], raw[2], raw[3]},
-      {raw[4], raw[5], raw[6], raw[7]},
-      {raw[8], raw[9], raw[10], raw[11]},
-      {raw[12], raw[13], raw[14], raw[15]},
-      {raw[16], raw[17], raw[18], raw[19]}
-    };
+    Matrix<Scalar, 5, 4> m{{raw[0], raw[1], raw[2], raw[3]},
+                           {raw[4], raw[5], raw[6], raw[7]},
+                           {raw[8], raw[9], raw[10], raw[11]},
+                           {raw[12], raw[13], raw[14], raw[15]},
+                           {raw[16], raw[17], raw[18], raw[19]}};
 
     Matrix<Scalar, 5, 4> m2;
-    m2 << raw[0], raw[1], raw[2], raw[3],
-          raw[4], raw[5], raw[6], raw[7],
-          raw[8], raw[9], raw[10], raw[11],
-          raw[12], raw[13], raw[14], raw[15],
-          raw[16], raw[17], raw[18], raw[19];
+    m2 << raw[0], raw[1], raw[2], raw[3], raw[4], raw[5], raw[6], raw[7], raw[8], raw[9], raw[10], raw[11], raw[12],
+        raw[13], raw[14], raw[15], raw[16], raw[17], raw[18], raw[19];
 
     int k = 0;
-    for(int i = 0; i < RowsAtCompileTime; ++i) {
+    for (int i = 0; i < RowsAtCompileTime; ++i) {
       for (int j = 0; j < ColsAtCompileTime; ++j) {
         VERIFY(m(i, j) == raw[k]);
         ++k;
@@ -205,18 +200,16 @@
     VERIFY_IS_EQUAL(m, m2);
   }
   {
-    Matrix<Scalar, Dynamic, Dynamic> m{
-      {raw[0], raw[1], raw[2], raw[3]},
-      {raw[4], raw[5], raw[6], raw[7]},
-      {raw[8], raw[9], raw[10], raw[11]},
-      {raw[12], raw[13], raw[14], raw[15]},
-      {raw[16], raw[17], raw[18], raw[19]}
-    };
+    Matrix<Scalar, Dynamic, Dynamic> m{{raw[0], raw[1], raw[2], raw[3]},
+                                       {raw[4], raw[5], raw[6], raw[7]},
+                                       {raw[8], raw[9], raw[10], raw[11]},
+                                       {raw[12], raw[13], raw[14], raw[15]},
+                                       {raw[16], raw[17], raw[18], raw[19]}};
 
     VERIFY(m.cols() == 4);
     VERIFY(m.rows() == 5);
     int k = 0;
-    for(int i = 0; i < RowsAtCompileTime; ++i) {
+    for (int i = 0; i < RowsAtCompileTime; ++i) {
       for (int j = 0; j < ColsAtCompileTime; ++j) {
         VERIFY(m(i, j) == raw[k]);
         ++k;
@@ -225,7 +218,7 @@
 
     Matrix<Scalar, Dynamic, Dynamic> m2(RowsAtCompileTime, ColsAtCompileTime);
     k = 0;
-    for(int i = 0; i < RowsAtCompileTime; ++i) {
+    for (int i = 0; i < RowsAtCompileTime; ++i) {
       for (int j = 0; j < ColsAtCompileTime; ++j) {
         m2(i, j) = raw[k];
         ++k;
@@ -235,8 +228,8 @@
   }
 }
 
-template<typename Scalar> void initializerListArrayConstruction()
-{
+template <typename Scalar>
+void initializerListArrayConstruction() {
   const Index RowsAtCompileTime = 5;
   const Index ColsAtCompileTime = 4;
   const Index SizeAtCompileTime = RowsAtCompileTime * ColsAtCompileTime;
@@ -246,28 +239,23 @@
     raw[i] = internal::random<Scalar>();
   }
   {
-    Array<Scalar, Dynamic, Dynamic> a {};
+    Array<Scalar, Dynamic, Dynamic> a{};
     VERIFY(a.cols() == 0);
     VERIFY(a.rows() == 0);
   }
   {
-    Array<Scalar, 5, 4> m {
-      {raw[0], raw[1], raw[2], raw[3]},
-      {raw[4], raw[5], raw[6], raw[7]},
-      {raw[8], raw[9], raw[10], raw[11]},
-      {raw[12], raw[13], raw[14], raw[15]},
-      {raw[16], raw[17], raw[18], raw[19]}
-    };
+    Array<Scalar, 5, 4> m{{raw[0], raw[1], raw[2], raw[3]},
+                          {raw[4], raw[5], raw[6], raw[7]},
+                          {raw[8], raw[9], raw[10], raw[11]},
+                          {raw[12], raw[13], raw[14], raw[15]},
+                          {raw[16], raw[17], raw[18], raw[19]}};
 
     Array<Scalar, 5, 4> m2;
-    m2 << raw[0], raw[1], raw[2], raw[3],
-          raw[4], raw[5], raw[6], raw[7],
-          raw[8], raw[9], raw[10], raw[11],
-          raw[12], raw[13], raw[14], raw[15],
-          raw[16], raw[17], raw[18], raw[19];
+    m2 << raw[0], raw[1], raw[2], raw[3], raw[4], raw[5], raw[6], raw[7], raw[8], raw[9], raw[10], raw[11], raw[12],
+        raw[13], raw[14], raw[15], raw[16], raw[17], raw[18], raw[19];
 
     int k = 0;
-    for(int i = 0; i < RowsAtCompileTime; ++i) {
+    for (int i = 0; i < RowsAtCompileTime; ++i) {
       for (int j = 0; j < ColsAtCompileTime; ++j) {
         VERIFY(m(i, j) == raw[k]);
         ++k;
@@ -276,18 +264,16 @@
     VERIFY_IS_APPROX(m, m2);
   }
   {
-    Array<Scalar, Dynamic, Dynamic> m {
-      {raw[0], raw[1], raw[2], raw[3]},
-      {raw[4], raw[5], raw[6], raw[7]},
-      {raw[8], raw[9], raw[10], raw[11]},
-      {raw[12], raw[13], raw[14], raw[15]},
-      {raw[16], raw[17], raw[18], raw[19]}
-    };
+    Array<Scalar, Dynamic, Dynamic> m{{raw[0], raw[1], raw[2], raw[3]},
+                                      {raw[4], raw[5], raw[6], raw[7]},
+                                      {raw[8], raw[9], raw[10], raw[11]},
+                                      {raw[12], raw[13], raw[14], raw[15]},
+                                      {raw[16], raw[17], raw[18], raw[19]}};
 
     VERIFY(m.cols() == 4);
     VERIFY(m.rows() == 5);
     int k = 0;
-    for(int i = 0; i < RowsAtCompileTime; ++i) {
+    for (int i = 0; i < RowsAtCompileTime; ++i) {
       for (int j = 0; j < ColsAtCompileTime; ++j) {
         VERIFY(m(i, j) == raw[k]);
         ++k;
@@ -296,7 +282,7 @@
 
     Array<Scalar, Dynamic, Dynamic> m2(RowsAtCompileTime, ColsAtCompileTime);
     k = 0;
-    for(int i = 0; i < RowsAtCompileTime; ++i) {
+    for (int i = 0; i < RowsAtCompileTime; ++i) {
       for (int j = 0; j < ColsAtCompileTime; ++j) {
         m2(i, j) = raw[k];
         ++k;
@@ -306,29 +292,28 @@
   }
 }
 
-template<typename Scalar> void dynamicVectorConstruction()
-{
+template <typename Scalar>
+void dynamicVectorConstruction() {
   const Index size = 4;
   Scalar raw[size];
   for (int i = 0; i < size; ++i) {
     raw[i] = internal::random<Scalar>();
   }
 
-  typedef Matrix<Scalar, Dynamic, 1>  VectorX;
+  typedef Matrix<Scalar, Dynamic, 1> VectorX;
 
   {
-    VectorX v {{raw[0], raw[1], raw[2], raw[3]}};
+    VectorX v{{raw[0], raw[1], raw[2], raw[3]}};
     for (int i = 0; i < size; ++i) {
       VERIFY(v(i) == raw[i]);
     }
     VERIFY(v.rows() == size);
     VERIFY(v.cols() == 1);
-    VERIFY_IS_EQUAL(v, (VectorX {{raw[0], raw[1], raw[2], raw[3]}}));
+    VERIFY_IS_EQUAL(v, (VectorX{{raw[0], raw[1], raw[2], raw[3]}}));
   }
 }
 
-EIGEN_DECLARE_TEST(initializer_list_construction)
-{
+EIGEN_DECLARE_TEST(initializer_list_construction) {
   CALL_SUBTEST_1(initializerListVectorConstruction<unsigned char>());
   CALL_SUBTEST_1(initializerListVectorConstruction<float>());
   CALL_SUBTEST_1(initializerListVectorConstruction<double>());
diff --git a/test/inplace_decomposition.cpp b/test/inplace_decomposition.cpp
index e3aa995..a57596c 100644
--- a/test/inplace_decomposition.cpp
+++ b/test/inplace_decomposition.cpp
@@ -14,21 +14,22 @@
 
 // This file test inplace decomposition through Ref<>, as supported by Cholesky, LU, and QR decompositions.
 
-template<typename DecType,typename MatrixType> void inplace(bool square = false, bool SPD = false)
-{
+template <typename DecType, typename MatrixType>
+void inplace(bool square = false, bool SPD = false) {
   typedef typename MatrixType::Scalar Scalar;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> RhsType;
   typedef Matrix<Scalar, MatrixType::ColsAtCompileTime, 1> ResType;
 
-  Index rows = MatrixType::RowsAtCompileTime==Dynamic ? internal::random<Index>(2,EIGEN_TEST_MAX_SIZE/2) : Index(MatrixType::RowsAtCompileTime);
-  Index cols = MatrixType::ColsAtCompileTime==Dynamic ? (square?rows:internal::random<Index>(2,rows))    : Index(MatrixType::ColsAtCompileTime);
+  Index rows = MatrixType::RowsAtCompileTime == Dynamic ? internal::random<Index>(2, EIGEN_TEST_MAX_SIZE / 2)
+                                                        : Index(MatrixType::RowsAtCompileTime);
+  Index cols = MatrixType::ColsAtCompileTime == Dynamic ? (square ? rows : internal::random<Index>(2, rows))
+                                                        : Index(MatrixType::ColsAtCompileTime);
 
-  MatrixType A = MatrixType::Random(rows,cols);
+  MatrixType A = MatrixType::Random(rows, cols);
   RhsType b = RhsType::Random(rows);
   ResType x(cols);
 
-  if(SPD)
-  {
+  if (SPD) {
     assert(square);
     A.topRows(cols) = A.topRows(cols).adjoint() * A.topRows(cols);
     A.diagonal().array() += 1e-3;
@@ -40,71 +41,60 @@
   DecType dec(A);
 
   // Check that the content of A has been modified
-  VERIFY_IS_NOT_APPROX( A, A0 );
+  VERIFY_IS_NOT_APPROX(A, A0);
 
   // Check that the decomposition is correct:
-  if(rows==cols)
-  {
-    VERIFY_IS_APPROX( A0 * (x = dec.solve(b)), b );
-  }
-  else
-  {
-    VERIFY_IS_APPROX( A0.transpose() * A0 * (x = dec.solve(b)), A0.transpose() * b );
+  if (rows == cols) {
+    VERIFY_IS_APPROX(A0 * (x = dec.solve(b)), b);
+  } else {
+    VERIFY_IS_APPROX(A0.transpose() * A0 * (x = dec.solve(b)), A0.transpose() * b);
   }
 
   // Check that modifying A breaks the current dec:
   A.setRandom();
-  if(rows==cols)
-  {
-    VERIFY_IS_NOT_APPROX( A0 * (x = dec.solve(b)), b );
-  }
-  else
-  {
-    VERIFY_IS_NOT_APPROX( A0.transpose() * A0 * (x = dec.solve(b)), A0.transpose() * b );
+  if (rows == cols) {
+    VERIFY_IS_NOT_APPROX(A0 * (x = dec.solve(b)), b);
+  } else {
+    VERIFY_IS_NOT_APPROX(A0.transpose() * A0 * (x = dec.solve(b)), A0.transpose() * b);
   }
 
   // Check that calling compute(A1) does not modify A1:
   A = A0;
   dec.compute(A1);
-  VERIFY_IS_EQUAL(A0,A1);
-  VERIFY_IS_NOT_APPROX( A, A0 );
-  if(rows==cols)
-  {
-    VERIFY_IS_APPROX( A0 * (x = dec.solve(b)), b );
-  }
-  else
-  {
-    VERIFY_IS_APPROX( A0.transpose() * A0 * (x = dec.solve(b)), A0.transpose() * b );
+  VERIFY_IS_EQUAL(A0, A1);
+  VERIFY_IS_NOT_APPROX(A, A0);
+  if (rows == cols) {
+    VERIFY_IS_APPROX(A0 * (x = dec.solve(b)), b);
+  } else {
+    VERIFY_IS_APPROX(A0.transpose() * A0 * (x = dec.solve(b)), A0.transpose() * b);
   }
 }
 
+EIGEN_DECLARE_TEST(inplace_decomposition) {
+  EIGEN_UNUSED typedef Matrix<double, 4, 3> Matrix43d;
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1((inplace<LLT<Ref<MatrixXd> >, MatrixXd>(true, true)));
+    CALL_SUBTEST_1((inplace<LLT<Ref<Matrix4d> >, Matrix4d>(true, true)));
 
-EIGEN_DECLARE_TEST(inplace_decomposition)
-{
-  EIGEN_UNUSED typedef Matrix<double,4,3> Matrix43d;
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1(( inplace<LLT<Ref<MatrixXd> >, MatrixXd>(true,true) ));
-    CALL_SUBTEST_1(( inplace<LLT<Ref<Matrix4d> >, Matrix4d>(true,true) ));
+    CALL_SUBTEST_2((inplace<LDLT<Ref<MatrixXd> >, MatrixXd>(true, true)));
+    CALL_SUBTEST_2((inplace<LDLT<Ref<Matrix4d> >, Matrix4d>(true, true)));
 
-    CALL_SUBTEST_2(( inplace<LDLT<Ref<MatrixXd> >, MatrixXd>(true,true) ));
-    CALL_SUBTEST_2(( inplace<LDLT<Ref<Matrix4d> >, Matrix4d>(true,true) ));
+    CALL_SUBTEST_3((inplace<PartialPivLU<Ref<MatrixXd> >, MatrixXd>(true, false)));
+    CALL_SUBTEST_3((inplace<PartialPivLU<Ref<Matrix4d> >, Matrix4d>(true, false)));
 
-    CALL_SUBTEST_3(( inplace<PartialPivLU<Ref<MatrixXd> >, MatrixXd>(true,false) ));
-    CALL_SUBTEST_3(( inplace<PartialPivLU<Ref<Matrix4d> >, Matrix4d>(true,false) ));
+    CALL_SUBTEST_4((inplace<FullPivLU<Ref<MatrixXd> >, MatrixXd>(true, false)));
+    CALL_SUBTEST_4((inplace<FullPivLU<Ref<Matrix4d> >, Matrix4d>(true, false)));
 
-    CALL_SUBTEST_4(( inplace<FullPivLU<Ref<MatrixXd> >, MatrixXd>(true,false) ));
-    CALL_SUBTEST_4(( inplace<FullPivLU<Ref<Matrix4d> >, Matrix4d>(true,false) ));
+    CALL_SUBTEST_5((inplace<HouseholderQR<Ref<MatrixXd> >, MatrixXd>(false, false)));
+    CALL_SUBTEST_5((inplace<HouseholderQR<Ref<Matrix43d> >, Matrix43d>(false, false)));
 
-    CALL_SUBTEST_5(( inplace<HouseholderQR<Ref<MatrixXd> >, MatrixXd>(false,false) ));
-    CALL_SUBTEST_5(( inplace<HouseholderQR<Ref<Matrix43d> >, Matrix43d>(false,false) ));
+    CALL_SUBTEST_6((inplace<ColPivHouseholderQR<Ref<MatrixXd> >, MatrixXd>(false, false)));
+    CALL_SUBTEST_6((inplace<ColPivHouseholderQR<Ref<Matrix43d> >, Matrix43d>(false, false)));
 
-    CALL_SUBTEST_6(( inplace<ColPivHouseholderQR<Ref<MatrixXd> >, MatrixXd>(false,false) ));
-    CALL_SUBTEST_6(( inplace<ColPivHouseholderQR<Ref<Matrix43d> >, Matrix43d>(false,false) ));
+    CALL_SUBTEST_7((inplace<FullPivHouseholderQR<Ref<MatrixXd> >, MatrixXd>(false, false)));
+    CALL_SUBTEST_7((inplace<FullPivHouseholderQR<Ref<Matrix43d> >, Matrix43d>(false, false)));
 
-    CALL_SUBTEST_7(( inplace<FullPivHouseholderQR<Ref<MatrixXd> >, MatrixXd>(false,false) ));
-    CALL_SUBTEST_7(( inplace<FullPivHouseholderQR<Ref<Matrix43d> >, Matrix43d>(false,false) ));
-
-    CALL_SUBTEST_8(( inplace<CompleteOrthogonalDecomposition<Ref<MatrixXd> >, MatrixXd>(false,false) ));
-    CALL_SUBTEST_8(( inplace<CompleteOrthogonalDecomposition<Ref<Matrix43d> >, Matrix43d>(false,false) ));
+    CALL_SUBTEST_8((inplace<CompleteOrthogonalDecomposition<Ref<MatrixXd> >, MatrixXd>(false, false)));
+    CALL_SUBTEST_8((inplace<CompleteOrthogonalDecomposition<Ref<Matrix43d> >, Matrix43d>(false, false)));
   }
 }
diff --git a/test/integer_types.cpp b/test/integer_types.cpp
index 1322527..a3be749 100644
--- a/test/integer_types.cpp
+++ b/test/integer_types.cpp
@@ -10,12 +10,12 @@
 #include "main.h"
 
 #undef VERIFY_IS_APPROX
-#define VERIFY_IS_APPROX(a, b) VERIFY((a)==(b));
+#define VERIFY_IS_APPROX(a, b) VERIFY((a) == (b));
 #undef VERIFY_IS_NOT_APPROX
-#define VERIFY_IS_NOT_APPROX(a, b) VERIFY((a)!=(b));
+#define VERIFY_IS_NOT_APPROX(a, b) VERIFY((a) != (b));
 
-template<typename MatrixType> void signed_integer_type_tests(const MatrixType& m)
-{
+template <typename MatrixType>
+void signed_integer_type_tests(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
 
   enum { is_signed = (Scalar(-1) > Scalar(0)) ? 0 : 1 };
@@ -24,28 +24,26 @@
   Index rows = m.rows();
   Index cols = m.cols();
 
-  MatrixType m1(rows, cols),
-             m2 = MatrixType::Random(rows, cols),
-             mzero = MatrixType::Zero(rows, cols);
+  MatrixType m1(rows, cols), m2 = MatrixType::Random(rows, cols), mzero = MatrixType::Zero(rows, cols);
 
   do {
     m1 = MatrixType::Random(rows, cols);
-  } while(m1 == mzero || m1 == m2);
+  } while (m1 == mzero || m1 == m2);
 
   // check linear structure
 
   Scalar s1;
   do {
     s1 = internal::random<Scalar>();
-  } while(s1 == 0);
+  } while (s1 == 0);
 
-  VERIFY_IS_EQUAL(-(-m1),                  m1);
-  VERIFY_IS_EQUAL(-m2+m1+m2,               m1);
-  VERIFY_IS_EQUAL((-m1+m2)*s1,             -s1*m1+s1*m2);
+  VERIFY_IS_EQUAL(-(-m1), m1);
+  VERIFY_IS_EQUAL(-m2 + m1 + m2, m1);
+  VERIFY_IS_EQUAL((-m1 + m2) * s1, -s1 * m1 + s1 * m2);
 }
 
-template<typename MatrixType> void integer_type_tests(const MatrixType& m)
-{
+template <typename MatrixType>
+void integer_type_tests(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
 
   VERIFY(NumTraits<Scalar>::IsInteger);
@@ -59,67 +57,64 @@
 
   // this test relies a lot on Random.h, and there's not much more that we can do
   // to test it, hence I consider that we will have tested Random.h
-  MatrixType m1(rows, cols),
-             m2 = MatrixType::Random(rows, cols),
-             m3(rows, cols),
-             mzero = MatrixType::Zero(rows, cols);
+  MatrixType m1(rows, cols), m2 = MatrixType::Random(rows, cols), m3(rows, cols), mzero = MatrixType::Zero(rows, cols);
 
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> SquareMatrixType;
-  SquareMatrixType identity = SquareMatrixType::Identity(rows, rows),
-                   square = SquareMatrixType::Random(rows, rows);
-  VectorType v1(rows),
-             v2 = VectorType::Random(rows),
-             vzero = VectorType::Zero(rows);
+  SquareMatrixType identity = SquareMatrixType::Identity(rows, rows), square = SquareMatrixType::Random(rows, rows);
+  VectorType v1(rows), v2 = VectorType::Random(rows), vzero = VectorType::Zero(rows);
 
   do {
     m1 = MatrixType::Random(rows, cols);
-  } while(m1 == mzero || m1 == m2);
+  } while (m1 == mzero || m1 == m2);
 
   do {
     v1 = VectorType::Random(rows);
-  } while(v1 == vzero || v1 == v2);
+  } while (v1 == vzero || v1 == v2);
 
-  VERIFY_IS_APPROX(               v1,    v1);
-  VERIFY_IS_NOT_APPROX(           v1,    2*v1);
-  VERIFY_IS_APPROX(               vzero, v1-v1);
-  VERIFY_IS_APPROX(               m1,    m1);
-  VERIFY_IS_NOT_APPROX(           m1,    2*m1);
-  VERIFY_IS_APPROX(               mzero, m1-m1);
+  VERIFY_IS_APPROX(v1, v1);
+  VERIFY_IS_NOT_APPROX(v1, 2 * v1);
+  VERIFY_IS_APPROX(vzero, v1 - v1);
+  VERIFY_IS_APPROX(m1, m1);
+  VERIFY_IS_NOT_APPROX(m1, 2 * m1);
+  VERIFY_IS_APPROX(mzero, m1 - m1);
 
-  VERIFY_IS_APPROX(m3 = m1,m1);
+  VERIFY_IS_APPROX(m3 = m1, m1);
   MatrixType m4;
-  VERIFY_IS_APPROX(m4 = m1,m1);
+  VERIFY_IS_APPROX(m4 = m1, m1);
 
   m3.real() = m1.real();
   VERIFY_IS_APPROX(static_cast<const MatrixType&>(m3).real(), static_cast<const MatrixType&>(m1).real());
   VERIFY_IS_APPROX(static_cast<const MatrixType&>(m3).real(), m1.real());
 
   // check == / != operators
-  VERIFY(m1==m1);
-  VERIFY(m1!=m2);
-  VERIFY(!(m1==m2));
-  VERIFY(!(m1!=m1));
+  VERIFY(m1 == m1);
+  VERIFY(m1 != m2);
+  VERIFY(!(m1 == m2));
+  VERIFY(!(m1 != m1));
   m1 = m2;
-  VERIFY(m1==m2);
-  VERIFY(!(m1!=m2));
+  VERIFY(m1 == m2);
+  VERIFY(!(m1 != m2));
 
   // check linear structure
 
   Scalar s1;
   do {
     s1 = internal::random<Scalar>();
-  } while(s1 == 0);
+  } while (s1 == 0);
 
-  VERIFY_IS_EQUAL(m1+m1,                   2*m1);
-  VERIFY_IS_EQUAL(m1+m2-m1,                m2);
-  VERIFY_IS_EQUAL(m1*s1,                   s1*m1);
-  VERIFY_IS_EQUAL((m1+m2)*s1,              s1*m1+s1*m2);
-  m3 = m2; m3 += m1;
-  VERIFY_IS_EQUAL(m3,                      m1+m2);
-  m3 = m2; m3 -= m1;
-  VERIFY_IS_EQUAL(m3,                      m2-m1);
-  m3 = m2; m3 *= s1;
-  VERIFY_IS_EQUAL(m3,                      s1*m2);
+  VERIFY_IS_EQUAL(m1 + m1, 2 * m1);
+  VERIFY_IS_EQUAL(m1 + m2 - m1, m2);
+  VERIFY_IS_EQUAL(m1 * s1, s1 * m1);
+  VERIFY_IS_EQUAL((m1 + m2) * s1, s1 * m1 + s1 * m2);
+  m3 = m2;
+  m3 += m1;
+  VERIFY_IS_EQUAL(m3, m1 + m2);
+  m3 = m2;
+  m3 -= m1;
+  VERIFY_IS_EQUAL(m3, m2 - m1);
+  m3 = m2;
+  m3 *= s1;
+  VERIFY_IS_EQUAL(m3, s1 * m2);
 
   // check matrix product.
 
@@ -129,41 +124,39 @@
   VERIFY_IS_APPROX((m1 * m2.transpose()) * m1, m1 * (m2.transpose() * m1));
 }
 
-template<int>
-void integer_types_extra()
-{
+template <int>
+void integer_types_extra() {
   VERIFY_IS_EQUAL(int(internal::scalar_div_cost<int>::value), 8);
   VERIFY_IS_EQUAL(int(internal::scalar_div_cost<unsigned int>::value), 8);
-  if(sizeof(long)>sizeof(int)) {
+  if (sizeof(long) > sizeof(int)) {
     VERIFY(int(internal::scalar_div_cost<long>::value) > int(internal::scalar_div_cost<int>::value));
     VERIFY(int(internal::scalar_div_cost<unsigned long>::value) > int(internal::scalar_div_cost<int>::value));
   }
 }
 
-EIGEN_DECLARE_TEST(integer_types)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( integer_type_tests(Matrix<unsigned int, 1, 1>()) );
-    CALL_SUBTEST_1( integer_type_tests(Matrix<unsigned long, 3, 4>()) );
+EIGEN_DECLARE_TEST(integer_types) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(integer_type_tests(Matrix<unsigned int, 1, 1>()));
+    CALL_SUBTEST_1(integer_type_tests(Matrix<unsigned long, 3, 4>()));
 
-    CALL_SUBTEST_2( integer_type_tests(Matrix<long, 2, 2>()) );
-    CALL_SUBTEST_2( signed_integer_type_tests(Matrix<long, 2, 2>()) );
+    CALL_SUBTEST_2(integer_type_tests(Matrix<long, 2, 2>()));
+    CALL_SUBTEST_2(signed_integer_type_tests(Matrix<long, 2, 2>()));
 
-    CALL_SUBTEST_3( integer_type_tests(Matrix<char, 2, Dynamic>(2, 10)) );
-    CALL_SUBTEST_3( signed_integer_type_tests(Matrix<signed char, 2, Dynamic>(2, 10)) );
+    CALL_SUBTEST_3(integer_type_tests(Matrix<char, 2, Dynamic>(2, 10)));
+    CALL_SUBTEST_3(signed_integer_type_tests(Matrix<signed char, 2, Dynamic>(2, 10)));
 
-    CALL_SUBTEST_4( integer_type_tests(Matrix<unsigned char, 3, 3>()) );
-    CALL_SUBTEST_4( integer_type_tests(Matrix<unsigned char, Dynamic, Dynamic>(20, 20)) );
+    CALL_SUBTEST_4(integer_type_tests(Matrix<unsigned char, 3, 3>()));
+    CALL_SUBTEST_4(integer_type_tests(Matrix<unsigned char, Dynamic, Dynamic>(20, 20)));
 
-    CALL_SUBTEST_5( integer_type_tests(Matrix<short, Dynamic, 4>(7, 4)) );
-    CALL_SUBTEST_5( signed_integer_type_tests(Matrix<short, Dynamic, 4>(7, 4)) );
+    CALL_SUBTEST_5(integer_type_tests(Matrix<short, Dynamic, 4>(7, 4)));
+    CALL_SUBTEST_5(signed_integer_type_tests(Matrix<short, Dynamic, 4>(7, 4)));
 
-    CALL_SUBTEST_6( integer_type_tests(Matrix<unsigned short, 4, 4>()) );
+    CALL_SUBTEST_6(integer_type_tests(Matrix<unsigned short, 4, 4>()));
 
-    CALL_SUBTEST_7( integer_type_tests(Matrix<long long, 11, 13>()) );
-    CALL_SUBTEST_7( signed_integer_type_tests(Matrix<long long, 11, 13>()) );
+    CALL_SUBTEST_7(integer_type_tests(Matrix<long long, 11, 13>()));
+    CALL_SUBTEST_7(signed_integer_type_tests(Matrix<long long, 11, 13>()));
 
-    CALL_SUBTEST_8( integer_type_tests(Matrix<unsigned long long, Dynamic, 5>(1, 5)) );
+    CALL_SUBTEST_8(integer_type_tests(Matrix<unsigned long long, Dynamic, 5>(1, 5)));
   }
-  CALL_SUBTEST_9( integer_types_extra<0>() );
+  CALL_SUBTEST_9(integer_types_extra<0>());
 }
diff --git a/test/inverse.cpp b/test/inverse.cpp
index 2748c38..d564db4 100644
--- a/test/inverse.cpp
+++ b/test/inverse.cpp
@@ -11,14 +11,11 @@
 #include "main.h"
 #include <Eigen/LU>
 
-template<typename MatrixType>
-void inverse_for_fixed_size(const MatrixType&, std::enable_if_t<MatrixType::SizeAtCompileTime==Dynamic>* = 0)
-{
-}
+template <typename MatrixType>
+void inverse_for_fixed_size(const MatrixType&, std::enable_if_t<MatrixType::SizeAtCompileTime == Dynamic>* = 0) {}
 
-template<typename MatrixType>
-void inverse_for_fixed_size(const MatrixType& m1, std::enable_if_t<MatrixType::SizeAtCompileTime!=Dynamic>* = 0)
-{
+template <typename MatrixType>
+void inverse_for_fixed_size(const MatrixType& m1, std::enable_if_t<MatrixType::SizeAtCompileTime != Dynamic>* = 0) {
   using std::abs;
 
   MatrixType m2, identity = MatrixType::Identity();
@@ -26,44 +23,45 @@
   typedef typename MatrixType::Scalar Scalar;
   typedef typename NumTraits<Scalar>::Real RealScalar;
   typedef Matrix<Scalar, MatrixType::ColsAtCompileTime, 1> VectorType;
-  
-  //computeInverseAndDetWithCheck tests
-  //First: an invertible matrix
+
+  // computeInverseAndDetWithCheck tests
+  // First: an invertible matrix
   bool invertible;
   Scalar det;
 
   m2.setZero();
   m1.computeInverseAndDetWithCheck(m2, det, invertible);
   VERIFY(invertible);
-  VERIFY_IS_APPROX(identity, m1*m2);
+  VERIFY_IS_APPROX(identity, m1 * m2);
   VERIFY_IS_APPROX(det, m1.determinant());
 
   m2.setZero();
   m1.computeInverseWithCheck(m2, invertible);
   VERIFY(invertible);
-  VERIFY_IS_APPROX(identity, m1*m2);
+  VERIFY_IS_APPROX(identity, m1 * m2);
 
-  //Second: a rank one matrix (not invertible, except for 1x1 matrices)
+  // Second: a rank one matrix (not invertible, except for 1x1 matrices)
   VectorType v3 = VectorType::Random();
-  MatrixType m3 = v3*v3.transpose(), m4;
+  MatrixType m3 = v3 * v3.transpose(), m4;
   m3.computeInverseAndDetWithCheck(m4, det, invertible);
-  VERIFY( m1.rows()==1 ? invertible : !invertible );
-  VERIFY_IS_MUCH_SMALLER_THAN(abs(det-m3.determinant()), RealScalar(1));
+  VERIFY(m1.rows() == 1 ? invertible : !invertible);
+  VERIFY_IS_MUCH_SMALLER_THAN(abs(det - m3.determinant()), RealScalar(1));
   m3.computeInverseWithCheck(m4, invertible);
-  VERIFY( m1.rows()==1 ? invertible : !invertible );
-  
+  VERIFY(m1.rows() == 1 ? invertible : !invertible);
+
   // check with submatrices
   {
-    Matrix<Scalar, MatrixType::RowsAtCompileTime+1, MatrixType::RowsAtCompileTime+1, MatrixType::Options> m5;
+    Matrix<Scalar, MatrixType::RowsAtCompileTime + 1, MatrixType::RowsAtCompileTime + 1, MatrixType::Options> m5;
     m5.setRandom();
-    m5.topLeftCorner(m1.rows(),m1.rows()) = m1;
-    m2 = m5.template topLeftCorner<MatrixType::RowsAtCompileTime,MatrixType::ColsAtCompileTime>().inverse();
-    VERIFY_IS_APPROX( (m5.template topLeftCorner<MatrixType::RowsAtCompileTime,MatrixType::ColsAtCompileTime>()), m2.inverse() );
+    m5.topLeftCorner(m1.rows(), m1.rows()) = m1;
+    m2 = m5.template topLeftCorner<MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime>().inverse();
+    VERIFY_IS_APPROX((m5.template topLeftCorner<MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime>()),
+                     m2.inverse());
   }
 }
 
-template<typename MatrixType> void inverse(const MatrixType& m)
-{
+template <typename MatrixType>
+void inverse(const MatrixType& m) {
   /* this test covers the following files:
      Inverse.h
   */
@@ -72,19 +70,17 @@
 
   typedef typename MatrixType::Scalar Scalar;
 
-  MatrixType m1(rows, cols),
-             m2(rows, cols),
-             identity = MatrixType::Identity(rows, rows);
-  createRandomPIMatrixOfRank(rows,rows,rows,m1);
+  MatrixType m1(rows, cols), m2(rows, cols), identity = MatrixType::Identity(rows, rows);
+  createRandomPIMatrixOfRank(rows, rows, rows, m1);
   m2 = m1.inverse();
-  VERIFY_IS_APPROX(m1, m2.inverse() );
+  VERIFY_IS_APPROX(m1, m2.inverse());
 
-  VERIFY_IS_APPROX((Scalar(2)*m2).inverse(), m2.inverse()*Scalar(0.5));
+  VERIFY_IS_APPROX((Scalar(2) * m2).inverse(), m2.inverse() * Scalar(0.5));
 
-  VERIFY_IS_APPROX(identity, m1.inverse() * m1 );
-  VERIFY_IS_APPROX(identity, m1 * m1.inverse() );
+  VERIFY_IS_APPROX(identity, m1.inverse() * m1);
+  VERIFY_IS_APPROX(identity, m1 * m1.inverse());
 
-  VERIFY_IS_APPROX(m1, m1.inverse().inverse() );
+  VERIFY_IS_APPROX(m1, m1.inverse().inverse());
 
   // since for the general case we implement separately row-major and col-major, test that
   VERIFY_IS_APPROX(MatrixType(m1.transpose().inverse()), MatrixType(m1.inverse().transpose()));
@@ -92,59 +88,54 @@
   inverse_for_fixed_size(m1);
 
   // check in-place inversion
-  if(MatrixType::RowsAtCompileTime>=2 && MatrixType::RowsAtCompileTime<=4)
-  {
+  if (MatrixType::RowsAtCompileTime >= 2 && MatrixType::RowsAtCompileTime <= 4) {
     // in-place is forbidden
     VERIFY_RAISES_ASSERT(m1 = m1.inverse());
-  }
-  else
-  {
+  } else {
     m2 = m1.inverse();
     m1 = m1.inverse();
-    VERIFY_IS_APPROX(m1,m2);
+    VERIFY_IS_APPROX(m1, m2);
   }
 }
 
-template<typename Scalar>
-void inverse_zerosized()
-{
-  Matrix<Scalar,Dynamic,Dynamic> A(0,0);
+template <typename Scalar>
+void inverse_zerosized() {
+  Matrix<Scalar, Dynamic, Dynamic> A(0, 0);
   {
-    Matrix<Scalar,0,1> b, x;
+    Matrix<Scalar, 0, 1> b, x;
     x = A.inverse() * b;
   }
   {
-    Matrix<Scalar,Dynamic,Dynamic> b(0,1), x;
+    Matrix<Scalar, Dynamic, Dynamic> b(0, 1), x;
     x = A.inverse() * b;
     VERIFY_IS_EQUAL(x.rows(), 0);
     VERIFY_IS_EQUAL(x.cols(), 1);
   }
 }
 
-EIGEN_DECLARE_TEST(inverse)
-{
+EIGEN_DECLARE_TEST(inverse) {
   int s = 0;
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( inverse(Matrix<double,1,1>()) );
-    CALL_SUBTEST_2( inverse(Matrix2d()) );
-    CALL_SUBTEST_3( inverse(Matrix3f()) );
-    CALL_SUBTEST_4( inverse(Matrix4f()) );
-    CALL_SUBTEST_4( inverse(Matrix<float,4,4,DontAlign>()) );
-    
-    s = internal::random<int>(50,320); 
-    CALL_SUBTEST_5( inverse(MatrixXf(s,s)) );
-    TEST_SET_BUT_UNUSED_VARIABLE(s)
-    CALL_SUBTEST_5( inverse_zerosized<float>() );
-    CALL_SUBTEST_5( inverse(MatrixXf(0, 0)) );
-    CALL_SUBTEST_5( inverse(MatrixXf(1, 1)) );
-    
-    s = internal::random<int>(25,100);
-    CALL_SUBTEST_6( inverse(MatrixXcd(s,s)) );
-    TEST_SET_BUT_UNUSED_VARIABLE(s)
-    
-    CALL_SUBTEST_7( inverse(Matrix4d()) );
-    CALL_SUBTEST_7( inverse(Matrix<double,4,4,DontAlign>()) );
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(inverse(Matrix<double, 1, 1>()));
+    CALL_SUBTEST_2(inverse(Matrix2d()));
+    CALL_SUBTEST_3(inverse(Matrix3f()));
+    CALL_SUBTEST_4(inverse(Matrix4f()));
+    CALL_SUBTEST_4(inverse(Matrix<float, 4, 4, DontAlign>()));
 
-    CALL_SUBTEST_8( inverse(Matrix4cd()) );
+    s = internal::random<int>(50, 320);
+    CALL_SUBTEST_5(inverse(MatrixXf(s, s)));
+    TEST_SET_BUT_UNUSED_VARIABLE(s)
+    CALL_SUBTEST_5(inverse_zerosized<float>());
+    CALL_SUBTEST_5(inverse(MatrixXf(0, 0)));
+    CALL_SUBTEST_5(inverse(MatrixXf(1, 1)));
+
+    s = internal::random<int>(25, 100);
+    CALL_SUBTEST_6(inverse(MatrixXcd(s, s)));
+    TEST_SET_BUT_UNUSED_VARIABLE(s)
+
+    CALL_SUBTEST_7(inverse(Matrix4d()));
+    CALL_SUBTEST_7(inverse(Matrix<double, 4, 4, DontAlign>()));
+
+    CALL_SUBTEST_8(inverse(Matrix4cd()));
   }
 }
diff --git a/test/io.cpp b/test/io.cpp
index aa14e76..219e1cb 100644
--- a/test/io.cpp
+++ b/test/io.cpp
@@ -11,52 +11,44 @@
 
 #include "main.h"
 
-template<typename Scalar>
-struct check_ostream_impl
-{
-  static void run()
-  {
-    const Array<Scalar,1,1> array(123);
+template <typename Scalar>
+struct check_ostream_impl {
+  static void run() {
+    const Array<Scalar, 1, 1> array(123);
     std::ostringstream ss;
     ss << array;
     VERIFY(ss.str() == "123");
 
-    check_ostream_impl< std::complex<Scalar> >::run();
+    check_ostream_impl<std::complex<Scalar> >::run();
   };
 };
 
-template<>
-struct check_ostream_impl<bool>
-{
-  static void run()
-  {
-    const Array<bool,1,2> array(1, 0);
+template <>
+struct check_ostream_impl<bool> {
+  static void run() {
+    const Array<bool, 1, 2> array(1, 0);
     std::ostringstream ss;
     ss << array;
     VERIFY(ss.str() == "1  0");
   };
 };
 
-template<typename Scalar>
-struct check_ostream_impl< std::complex<Scalar> >
-{
-  static void run()
-  {
-    const Array<std::complex<Scalar>,1,1> array(std::complex<Scalar>(12, 34));
+template <typename Scalar>
+struct check_ostream_impl<std::complex<Scalar> > {
+  static void run() {
+    const Array<std::complex<Scalar>, 1, 1> array(std::complex<Scalar>(12, 34));
     std::ostringstream ss;
     ss << array;
     VERIFY(ss.str() == "(12,34)");
   };
 };
 
-template<typename Scalar>
-static void check_ostream()
-{
+template <typename Scalar>
+static void check_ostream() {
   check_ostream_impl<Scalar>::run();
 }
 
-EIGEN_DECLARE_TEST(rand)
-{
+EIGEN_DECLARE_TEST(rand) {
   CALL_SUBTEST(check_ostream<bool>());
   CALL_SUBTEST(check_ostream<float>());
   CALL_SUBTEST(check_ostream<double>());
diff --git a/test/is_same_dense.cpp b/test/is_same_dense.cpp
index 23dd806..18c07e6 100644
--- a/test/is_same_dense.cpp
+++ b/test/is_same_dense.cpp
@@ -11,30 +11,28 @@
 
 using internal::is_same_dense;
 
-EIGEN_DECLARE_TEST(is_same_dense)
-{
-  typedef Matrix<double,Dynamic,Dynamic,ColMajor> ColMatrixXd;
-  typedef Matrix<std::complex<double>,Dynamic,Dynamic,ColMajor> ColMatrixXcd;
-  ColMatrixXd m1(10,10);
-  ColMatrixXcd m2(10,10);
+EIGEN_DECLARE_TEST(is_same_dense) {
+  typedef Matrix<double, Dynamic, Dynamic, ColMajor> ColMatrixXd;
+  typedef Matrix<std::complex<double>, Dynamic, Dynamic, ColMajor> ColMatrixXcd;
+  ColMatrixXd m1(10, 10);
+  ColMatrixXcd m2(10, 10);
   Ref<ColMatrixXd> ref_m1(m1);
-  Ref<ColMatrixXd,0, Stride<Dynamic,Dynamic> >  ref_m2_real(m2.real());
+  Ref<ColMatrixXd, 0, Stride<Dynamic, Dynamic> > ref_m2_real(m2.real());
   Ref<const ColMatrixXd> const_ref_m1(m1);
 
-  VERIFY(is_same_dense(m1,m1));
-  VERIFY(is_same_dense(m1,ref_m1));
-  VERIFY(is_same_dense(const_ref_m1,m1));
-  VERIFY(is_same_dense(const_ref_m1,ref_m1));
-  
-  VERIFY(is_same_dense(m1.block(0,0,m1.rows(),m1.cols()),m1));
-  VERIFY(!is_same_dense(m1.row(0),m1.col(0)));
-  
-  Ref<const ColMatrixXd> const_ref_m1_row(m1.row(1));
-  VERIFY(!is_same_dense(m1.row(1),const_ref_m1_row));
-  
-  Ref<const ColMatrixXd> const_ref_m1_col(m1.col(1));
-  VERIFY(is_same_dense(m1.col(1),const_ref_m1_col));
+  VERIFY(is_same_dense(m1, m1));
+  VERIFY(is_same_dense(m1, ref_m1));
+  VERIFY(is_same_dense(const_ref_m1, m1));
+  VERIFY(is_same_dense(const_ref_m1, ref_m1));
 
+  VERIFY(is_same_dense(m1.block(0, 0, m1.rows(), m1.cols()), m1));
+  VERIFY(!is_same_dense(m1.row(0), m1.col(0)));
+
+  Ref<const ColMatrixXd> const_ref_m1_row(m1.row(1));
+  VERIFY(!is_same_dense(m1.row(1), const_ref_m1_row));
+
+  Ref<const ColMatrixXd> const_ref_m1_col(m1.col(1));
+  VERIFY(is_same_dense(m1.col(1), const_ref_m1_col));
 
   VERIFY(!is_same_dense(m1, ref_m2_real));
   VERIFY(!is_same_dense(m2, ref_m2_real));
diff --git a/test/jacobi.cpp b/test/jacobi.cpp
index 273b94d..7634604 100644
--- a/test/jacobi.cpp
+++ b/test/jacobi.cpp
@@ -11,16 +11,12 @@
 #include "main.h"
 #include <Eigen/SVD>
 
-template<typename MatrixType, typename JacobiScalar>
-void jacobi(const MatrixType& m = MatrixType())
-{
+template <typename MatrixType, typename JacobiScalar>
+void jacobi(const MatrixType& m = MatrixType()) {
   Index rows = m.rows();
   Index cols = m.cols();
 
-  enum {
-    RowsAtCompileTime = MatrixType::RowsAtCompileTime,
-    ColsAtCompileTime = MatrixType::ColsAtCompileTime
-  };
+  enum { RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime };
 
   typedef Matrix<JacobiScalar, 2, 1> JacobiVector;
 
@@ -31,10 +27,10 @@
   JacobiRotation<JacobiScalar> rot(c, s);
 
   {
-    Index p = internal::random<Index>(0, rows-1);
+    Index p = internal::random<Index>(0, rows - 1);
     Index q;
     do {
-      q = internal::random<Index>(0, rows-1);
+      q = internal::random<Index>(0, rows - 1);
     } while (q == p);
 
     MatrixType b = a;
@@ -44,10 +40,10 @@
   }
 
   {
-    Index p = internal::random<Index>(0, cols-1);
+    Index p = internal::random<Index>(0, cols - 1);
     Index q;
     do {
-      q = internal::random<Index>(0, cols-1);
+      q = internal::random<Index>(0, cols - 1);
     } while (q == p);
 
     MatrixType b = a;
@@ -57,28 +53,28 @@
   }
 }
 
-EIGEN_DECLARE_TEST(jacobi)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1(( jacobi<Matrix3f, float>() ));
-    CALL_SUBTEST_2(( jacobi<Matrix4d, double>() ));
-    CALL_SUBTEST_3(( jacobi<Matrix4cf, float>() ));
-    CALL_SUBTEST_3(( jacobi<Matrix4cf, std::complex<float> >() ));
+EIGEN_DECLARE_TEST(jacobi) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1((jacobi<Matrix3f, float>()));
+    CALL_SUBTEST_2((jacobi<Matrix4d, double>()));
+    CALL_SUBTEST_3((jacobi<Matrix4cf, float>()));
+    CALL_SUBTEST_3((jacobi<Matrix4cf, std::complex<float> >()));
 
-    CALL_SUBTEST_1(( jacobi<Matrix<float, 3, 3, RowMajor>, float>() ));
-    CALL_SUBTEST_2(( jacobi<Matrix<double, 4, 4, RowMajor>, double>() ));
-    CALL_SUBTEST_3(( jacobi<Matrix<std::complex<float>, 4, 4, RowMajor>, float>() ));
-    CALL_SUBTEST_3(( jacobi<Matrix<std::complex<float>, 4, 4, RowMajor>, std::complex<float> >() ));
+    CALL_SUBTEST_1((jacobi<Matrix<float, 3, 3, RowMajor>, float>()));
+    CALL_SUBTEST_2((jacobi<Matrix<double, 4, 4, RowMajor>, double>()));
+    CALL_SUBTEST_3((jacobi<Matrix<std::complex<float>, 4, 4, RowMajor>, float>()));
+    CALL_SUBTEST_3((jacobi<Matrix<std::complex<float>, 4, 4, RowMajor>, std::complex<float> >()));
 
-    int r = internal::random<int>(2, internal::random<int>(1,EIGEN_TEST_MAX_SIZE)/2),
-        c = internal::random<int>(2, internal::random<int>(1,EIGEN_TEST_MAX_SIZE)/2);
-    CALL_SUBTEST_4(( jacobi<MatrixXf, float>(MatrixXf(r,c)) ));
-    CALL_SUBTEST_5(( jacobi<MatrixXcd, double>(MatrixXcd(r,c)) ));
-    CALL_SUBTEST_5(( jacobi<MatrixXcd, std::complex<double> >(MatrixXcd(r,c)) ));
-    // complex<float> is really important to test as it is the only way to cover conjugation issues in certain unaligned paths
-    CALL_SUBTEST_6(( jacobi<MatrixXcf, float>(MatrixXcf(r,c)) ));
-    CALL_SUBTEST_6(( jacobi<MatrixXcf, std::complex<float> >(MatrixXcf(r,c)) ));
-    
+    int r = internal::random<int>(2, internal::random<int>(1, EIGEN_TEST_MAX_SIZE) / 2),
+        c = internal::random<int>(2, internal::random<int>(1, EIGEN_TEST_MAX_SIZE) / 2);
+    CALL_SUBTEST_4((jacobi<MatrixXf, float>(MatrixXf(r, c))));
+    CALL_SUBTEST_5((jacobi<MatrixXcd, double>(MatrixXcd(r, c))));
+    CALL_SUBTEST_5((jacobi<MatrixXcd, std::complex<double> >(MatrixXcd(r, c))));
+    // complex<float> is really important to test as it is the only way to cover conjugation issues in certain unaligned
+    // paths
+    CALL_SUBTEST_6((jacobi<MatrixXcf, float>(MatrixXcf(r, c))));
+    CALL_SUBTEST_6((jacobi<MatrixXcf, std::complex<float> >(MatrixXcf(r, c))));
+
     TEST_SET_BUT_UNUSED_VARIABLE(r);
     TEST_SET_BUT_UNUSED_VARIABLE(c);
   }
diff --git a/test/jacobisvd.cpp b/test/jacobisvd.cpp
index 9416b84..cf5cc5f 100644
--- a/test/jacobisvd.cpp
+++ b/test/jacobisvd.cpp
@@ -15,13 +15,12 @@
 #include <Eigen/SVD>
 
 #define SVD_DEFAULT(M) JacobiSVD<M>
-#define SVD_FOR_MIN_NORM(M) JacobiSVD<M,ColPivHouseholderQRPreconditioner>
+#define SVD_FOR_MIN_NORM(M) JacobiSVD<M, ColPivHouseholderQRPreconditioner>
 #define SVD_STATIC_OPTIONS(M, O) JacobiSVD<M, O>
 #include "svd_common.h"
 
-template<typename MatrixType>
-void jacobisvd_method()
-{
+template <typename MatrixType>
+void jacobisvd_method() {
   enum { Size = MatrixType::RowsAtCompileTime };
   typedef typename MatrixType::RealScalar RealScalar;
   typedef Matrix<RealScalar, Size, 1> RealVecType;
@@ -98,21 +97,22 @@
 namespace Foo {
 // older compiler require a default constructor for Bar
 // cf: https://stackoverflow.com/questions/7411515/
-class Bar {public: Bar() {}};
+class Bar {
+ public:
+  Bar() {}
+};
 bool operator<(const Bar&, const Bar&) { return true; }
-}
+}  // namespace Foo
 // regression test for a very strange MSVC issue for which simply
 // including SVDBase.h messes up with std::max and custom scalar type
-void msvc_workaround()
-{
+void msvc_workaround() {
   const Foo::Bar a;
   const Foo::Bar b;
-  const Foo::Bar c = std::max EIGEN_NOT_A_MACRO (a,b);
+  const Foo::Bar c = std::max EIGEN_NOT_A_MACRO(a, b);
   EIGEN_UNUSED_VARIABLE(c)
 }
 
-EIGEN_DECLARE_TEST(jacobisvd)
-{
+EIGEN_DECLARE_TEST(jacobisvd) {
   CALL_SUBTEST_1((jacobisvd_verify_inputs<Matrix4d>()));
   CALL_SUBTEST_2((jacobisvd_verify_inputs(Matrix<float, 5, Dynamic>(5, 6))));
   CALL_SUBTEST_3((jacobisvd_verify_inputs<Matrix<std::complex<double>, 7, 5>>()));
@@ -128,12 +128,11 @@
   CALL_SUBTEST_11(svd_all_trivial_2x2(jacobisvd_thin_options<Matrix2d>));
 
   for (int i = 0; i < g_repeat; i++) {
-    int r = internal::random<int>(1, 30),
-        c = internal::random<int>(1, 30);
-    
+    int r = internal::random<int>(1, 30), c = internal::random<int>(1, 30);
+
     TEST_SET_BUT_UNUSED_VARIABLE(r)
     TEST_SET_BUT_UNUSED_VARIABLE(c)
-    
+
     CALL_SUBTEST_12((jacobisvd_thin_options<Matrix3f>()));
     CALL_SUBTEST_13((jacobisvd_full_options<Matrix3f>()));
     CALL_SUBTEST_14((jacobisvd_thin_options<Matrix4d>()));
@@ -201,16 +200,16 @@
                 internal::random<int>(EIGEN_TEST_MAX_SIZE / 4, EIGEN_TEST_MAX_SIZE / 3)))));
 
   // test matrixbase method
-  CALL_SUBTEST_51(( jacobisvd_method<Matrix2cd>() ));
-  CALL_SUBTEST_52(( jacobisvd_method<Matrix3f>() ));
+  CALL_SUBTEST_51((jacobisvd_method<Matrix2cd>()));
+  CALL_SUBTEST_52((jacobisvd_method<Matrix3f>()));
 
   // Test problem size constructors
-  CALL_SUBTEST_53( JacobiSVD<MatrixXf>(10,10) );
+  CALL_SUBTEST_53(JacobiSVD<MatrixXf>(10, 10));
 
   // Check that preallocation avoids subsequent mallocs
-  CALL_SUBTEST_54( svd_preallocate<void>() );
+  CALL_SUBTEST_54(svd_preallocate<void>());
 
-  CALL_SUBTEST_55( svd_underoverflow<void>() );
+  CALL_SUBTEST_55(svd_underoverflow<void>());
 
   msvc_workaround();
 }
diff --git a/test/klu_support.cpp b/test/klu_support.cpp
index f806ad5..b4f1f43 100644
--- a/test/klu_support.cpp
+++ b/test/klu_support.cpp
@@ -12,21 +12,19 @@
 
 #include <Eigen/KLUSupport>
 
-template<typename T> void test_klu_support_T()
-{
+template <typename T>
+void test_klu_support_T() {
   KLU<SparseMatrix<T, ColMajor> > klu_colmajor;
   KLU<SparseMatrix<T, RowMajor> > klu_rowmajor;
-  
+
   check_sparse_square_solving(klu_colmajor);
   check_sparse_square_solving(klu_rowmajor);
-  
-  //check_sparse_square_determinant(umfpack_colmajor);
-  //check_sparse_square_determinant(umfpack_rowmajor);
+
+  // check_sparse_square_determinant(umfpack_colmajor);
+  // check_sparse_square_determinant(umfpack_rowmajor);
 }
 
-EIGEN_DECLARE_TEST(klu_support)
-{
+EIGEN_DECLARE_TEST(klu_support) {
   CALL_SUBTEST_1(test_klu_support_T<double>());
   CALL_SUBTEST_2(test_klu_support_T<std::complex<double> >());
 }
-
diff --git a/test/linearstructure.cpp b/test/linearstructure.cpp
index 46ee516..e5684a5 100644
--- a/test/linearstructure.cpp
+++ b/test/linearstructure.cpp
@@ -9,15 +9,16 @@
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 static bool g_called;
-#define EIGEN_SCALAR_BINARY_OP_PLUGIN { g_called |= (!internal::is_same<LhsScalar,RhsScalar>::value); }
+#define EIGEN_SCALAR_BINARY_OP_PLUGIN \
+  { g_called |= (!internal::is_same<LhsScalar, RhsScalar>::value); }
 
 #include "main.h"
 
-template<typename MatrixType> void linearStructure(const MatrixType& m)
-{
+template <typename MatrixType>
+void linearStructure(const MatrixType& m) {
   using std::abs;
   /* this test covers the following files:
-     CwiseUnaryOp.h, CwiseBinaryOp.h, SelfCwiseBinaryOp.h 
+     CwiseUnaryOp.h, CwiseBinaryOp.h, SelfCwiseBinaryOp.h
   */
   typedef typename MatrixType::Scalar Scalar;
   typedef typename MatrixType::RealScalar RealScalar;
@@ -27,121 +28,124 @@
 
   // this test relies a lot on Random.h, and there's not much more that we can do
   // to test it, hence I consider that we will have tested Random.h
-  MatrixType m1 = MatrixType::Random(rows, cols),
-             m2 = MatrixType::Random(rows, cols),
-             m3(rows, cols);
+  MatrixType m1 = MatrixType::Random(rows, cols), m2 = MatrixType::Random(rows, cols), m3(rows, cols);
 
   Scalar s1 = internal::random<Scalar>();
-  while (abs(s1)<RealScalar(1e-3)) s1 = internal::random<Scalar>();
+  while (abs(s1) < RealScalar(1e-3)) s1 = internal::random<Scalar>();
 
-  Index r = internal::random<Index>(0, rows-1),
-        c = internal::random<Index>(0, cols-1);
+  Index r = internal::random<Index>(0, rows - 1), c = internal::random<Index>(0, cols - 1);
 
-  VERIFY_IS_APPROX(-(-m1),                  m1);
-  VERIFY_IS_APPROX(m1+m1,                   2*m1);
-  VERIFY_IS_APPROX(m1+m2-m1,                m2);
-  VERIFY_IS_APPROX(-m2+m1+m2,               m1);
-  VERIFY_IS_APPROX(m1*s1,                   s1*m1);
-  VERIFY_IS_APPROX((m1+m2)*s1,              s1*m1+s1*m2);
-  VERIFY_IS_APPROX((-m1+m2)*s1,             -s1*m1+s1*m2);
-  m3 = m2; m3 += m1;
-  VERIFY_IS_APPROX(m3,                      m1+m2);
-  m3 = m2; m3 -= m1;
-  VERIFY_IS_APPROX(m3,                      m2-m1);
-  m3 = m2; m3 *= s1;
-  VERIFY_IS_APPROX(m3,                      s1*m2);
-  if(!NumTraits<Scalar>::IsInteger)
-  {
-    m3 = m2; m3 /= s1;
-    VERIFY_IS_APPROX(m3,                    m2/s1);
+  VERIFY_IS_APPROX(-(-m1), m1);
+  VERIFY_IS_APPROX(m1 + m1, 2 * m1);
+  VERIFY_IS_APPROX(m1 + m2 - m1, m2);
+  VERIFY_IS_APPROX(-m2 + m1 + m2, m1);
+  VERIFY_IS_APPROX(m1 * s1, s1 * m1);
+  VERIFY_IS_APPROX((m1 + m2) * s1, s1 * m1 + s1 * m2);
+  VERIFY_IS_APPROX((-m1 + m2) * s1, -s1 * m1 + s1 * m2);
+  m3 = m2;
+  m3 += m1;
+  VERIFY_IS_APPROX(m3, m1 + m2);
+  m3 = m2;
+  m3 -= m1;
+  VERIFY_IS_APPROX(m3, m2 - m1);
+  m3 = m2;
+  m3 *= s1;
+  VERIFY_IS_APPROX(m3, s1 * m2);
+  if (!NumTraits<Scalar>::IsInteger) {
+    m3 = m2;
+    m3 /= s1;
+    VERIFY_IS_APPROX(m3, m2 / s1);
   }
 
   // again, test operator() to check const-qualification
-  VERIFY_IS_APPROX((-m1)(r,c), -(m1(r,c)));
-  VERIFY_IS_APPROX((m1-m2)(r,c), (m1(r,c))-(m2(r,c)));
-  VERIFY_IS_APPROX((m1+m2)(r,c), (m1(r,c))+(m2(r,c)));
-  VERIFY_IS_APPROX((s1*m1)(r,c), s1*(m1(r,c)));
-  VERIFY_IS_APPROX((m1*s1)(r,c), (m1(r,c))*s1);
-  if(!NumTraits<Scalar>::IsInteger)
-    VERIFY_IS_APPROX((m1/s1)(r,c), (m1(r,c))/s1);
+  VERIFY_IS_APPROX((-m1)(r, c), -(m1(r, c)));
+  VERIFY_IS_APPROX((m1 - m2)(r, c), (m1(r, c)) - (m2(r, c)));
+  VERIFY_IS_APPROX((m1 + m2)(r, c), (m1(r, c)) + (m2(r, c)));
+  VERIFY_IS_APPROX((s1 * m1)(r, c), s1 * (m1(r, c)));
+  VERIFY_IS_APPROX((m1 * s1)(r, c), (m1(r, c)) * s1);
+  if (!NumTraits<Scalar>::IsInteger) VERIFY_IS_APPROX((m1 / s1)(r, c), (m1(r, c)) / s1);
 
   // use .block to disable vectorization and compare to the vectorized version
-  VERIFY_IS_APPROX(m1+m1.block(0,0,rows,cols), m1+m1);
-  VERIFY_IS_APPROX(m1.cwiseProduct(m1.block(0,0,rows,cols)), m1.cwiseProduct(m1));
-  VERIFY_IS_APPROX(m1 - m1.block(0,0,rows,cols), m1 - m1);
-  VERIFY_IS_APPROX(m1.block(0,0,rows,cols) * s1, m1 * s1);
+  VERIFY_IS_APPROX(m1 + m1.block(0, 0, rows, cols), m1 + m1);
+  VERIFY_IS_APPROX(m1.cwiseProduct(m1.block(0, 0, rows, cols)), m1.cwiseProduct(m1));
+  VERIFY_IS_APPROX(m1 - m1.block(0, 0, rows, cols), m1 - m1);
+  VERIFY_IS_APPROX(m1.block(0, 0, rows, cols) * s1, m1 * s1);
 }
 
 // Make sure that complex * real and real * complex are properly optimized
-template<typename MatrixType> void real_complex(DenseIndex rows = MatrixType::RowsAtCompileTime, DenseIndex cols = MatrixType::ColsAtCompileTime)
-{
+template <typename MatrixType>
+void real_complex(DenseIndex rows = MatrixType::RowsAtCompileTime, DenseIndex cols = MatrixType::ColsAtCompileTime) {
   typedef typename MatrixType::Scalar Scalar;
   typedef typename MatrixType::RealScalar RealScalar;
-  
+
   RealScalar s = internal::random<RealScalar>();
   MatrixType m1 = MatrixType::Random(rows, cols);
-  
+
   g_called = false;
-  VERIFY_IS_APPROX(s*m1, Scalar(s)*m1);
+  VERIFY_IS_APPROX(s * m1, Scalar(s) * m1);
   VERIFY(g_called && "real * matrix<complex> not properly optimized");
-  
+
   g_called = false;
-  VERIFY_IS_APPROX(m1*s, m1*Scalar(s));
+  VERIFY_IS_APPROX(m1 * s, m1 * Scalar(s));
   VERIFY(g_called && "matrix<complex> * real not properly optimized");
-  
+
   g_called = false;
-  VERIFY_IS_APPROX(m1/s, m1/Scalar(s));
+  VERIFY_IS_APPROX(m1 / s, m1 / Scalar(s));
   VERIFY(g_called && "matrix<complex> / real not properly optimized");
 
   g_called = false;
-  VERIFY_IS_APPROX(s+m1.array(), Scalar(s)+m1.array());
+  VERIFY_IS_APPROX(s + m1.array(), Scalar(s) + m1.array());
   VERIFY(g_called && "real + matrix<complex> not properly optimized");
 
   g_called = false;
-  VERIFY_IS_APPROX(m1.array()+s, m1.array()+Scalar(s));
+  VERIFY_IS_APPROX(m1.array() + s, m1.array() + Scalar(s));
   VERIFY(g_called && "matrix<complex> + real not properly optimized");
 
   g_called = false;
-  VERIFY_IS_APPROX(s-m1.array(), Scalar(s)-m1.array());
+  VERIFY_IS_APPROX(s - m1.array(), Scalar(s) - m1.array());
   VERIFY(g_called && "real - matrix<complex> not properly optimized");
 
   g_called = false;
-  VERIFY_IS_APPROX(m1.array()-s, m1.array()-Scalar(s));
+  VERIFY_IS_APPROX(m1.array() - s, m1.array() - Scalar(s));
   VERIFY(g_called && "matrix<complex> - real not properly optimized");
 }
 
-template<int>
-void linearstructure_overflow()
-{
+template <int>
+void linearstructure_overflow() {
   // make sure that /=scalar and /scalar do not overflow
   // rational: 1.0/4.94e-320 overflow, but m/4.94e-320 should not
   Matrix4d m2, m3;
-  m3 = m2 =  Matrix4d::Random()*1e-20;
+  m3 = m2 = Matrix4d::Random() * 1e-20;
   m2 = m2 / 4.9e-320;
   VERIFY_IS_APPROX(m2.cwiseQuotient(m2), Matrix4d::Ones());
   m3 /= 4.9e-320;
   VERIFY_IS_APPROX(m3.cwiseQuotient(m3), Matrix4d::Ones());
 }
 
-EIGEN_DECLARE_TEST(linearstructure)
-{
+EIGEN_DECLARE_TEST(linearstructure) {
   g_called = true;
-  VERIFY(g_called); // avoid `unneeded-internal-declaration` warning.
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( linearStructure(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( linearStructure(Matrix2f()) );
-    CALL_SUBTEST_3( linearStructure(Vector3d()) );
-    CALL_SUBTEST_4( linearStructure(Matrix4d()) );
-    CALL_SUBTEST_5( linearStructure(MatrixXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2), internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2))) );
-    CALL_SUBTEST_6( linearStructure(MatrixXf (internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_7( linearStructure(MatrixXi (internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_8( linearStructure(MatrixXcd(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2), internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2))) );
-    CALL_SUBTEST_9( linearStructure(ArrayXXf (internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_10( linearStructure(ArrayXXcf (internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    
-    CALL_SUBTEST_11( real_complex<Matrix4cd>() );
-    CALL_SUBTEST_11( real_complex<MatrixXcf>(10,10) );
-    CALL_SUBTEST_11( real_complex<ArrayXXcf>(10,10) );
+  VERIFY(g_called);  // avoid `unneeded-internal-declaration` warning.
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(linearStructure(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(linearStructure(Matrix2f()));
+    CALL_SUBTEST_3(linearStructure(Vector3d()));
+    CALL_SUBTEST_4(linearStructure(Matrix4d()));
+    CALL_SUBTEST_5(linearStructure(MatrixXcf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2),
+                                             internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2))));
+    CALL_SUBTEST_6(linearStructure(
+        MatrixXf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_7(linearStructure(
+        MatrixXi(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_8(linearStructure(MatrixXcd(internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2),
+                                             internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2))));
+    CALL_SUBTEST_9(linearStructure(
+        ArrayXXf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_10(linearStructure(
+        ArrayXXcf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+
+    CALL_SUBTEST_11(real_complex<Matrix4cd>());
+    CALL_SUBTEST_11(real_complex<MatrixXcf>(10, 10));
+    CALL_SUBTEST_11(real_complex<ArrayXXcf>(10, 10));
   }
-  CALL_SUBTEST_4( linearstructure_overflow<0>() );
+  CALL_SUBTEST_4(linearstructure_overflow<0>());
 }
diff --git a/test/lscg.cpp b/test/lscg.cpp
index feb2347..1c94e0a 100644
--- a/test/lscg.cpp
+++ b/test/lscg.cpp
@@ -10,28 +10,27 @@
 #include "sparse_solver.h"
 #include <Eigen/IterativeLinearSolvers>
 
-template<typename T> void test_lscg_T()
-{
+template <typename T>
+void test_lscg_T() {
   LeastSquaresConjugateGradient<SparseMatrix<T> > lscg_colmajor_diag;
   LeastSquaresConjugateGradient<SparseMatrix<T>, IdentityPreconditioner> lscg_colmajor_I;
-  LeastSquaresConjugateGradient<SparseMatrix<T,RowMajor> > lscg_rowmajor_diag;
-  LeastSquaresConjugateGradient<SparseMatrix<T,RowMajor>, IdentityPreconditioner> lscg_rowmajor_I;
+  LeastSquaresConjugateGradient<SparseMatrix<T, RowMajor> > lscg_rowmajor_diag;
+  LeastSquaresConjugateGradient<SparseMatrix<T, RowMajor>, IdentityPreconditioner> lscg_rowmajor_I;
 
-  CALL_SUBTEST( check_sparse_square_solving(lscg_colmajor_diag)  );
-  CALL_SUBTEST( check_sparse_square_solving(lscg_colmajor_I)     );
-  
-  CALL_SUBTEST( check_sparse_leastsquare_solving(lscg_colmajor_diag)  );
-  CALL_SUBTEST( check_sparse_leastsquare_solving(lscg_colmajor_I)     );
+  CALL_SUBTEST(check_sparse_square_solving(lscg_colmajor_diag));
+  CALL_SUBTEST(check_sparse_square_solving(lscg_colmajor_I));
 
-  CALL_SUBTEST( check_sparse_square_solving(lscg_rowmajor_diag)  );
-  CALL_SUBTEST( check_sparse_square_solving(lscg_rowmajor_I)     );
+  CALL_SUBTEST(check_sparse_leastsquare_solving(lscg_colmajor_diag));
+  CALL_SUBTEST(check_sparse_leastsquare_solving(lscg_colmajor_I));
 
-  CALL_SUBTEST( check_sparse_leastsquare_solving(lscg_rowmajor_diag)  );
-  CALL_SUBTEST( check_sparse_leastsquare_solving(lscg_rowmajor_I)     );
+  CALL_SUBTEST(check_sparse_square_solving(lscg_rowmajor_diag));
+  CALL_SUBTEST(check_sparse_square_solving(lscg_rowmajor_I));
+
+  CALL_SUBTEST(check_sparse_leastsquare_solving(lscg_rowmajor_diag));
+  CALL_SUBTEST(check_sparse_leastsquare_solving(lscg_rowmajor_I));
 }
 
-EIGEN_DECLARE_TEST(lscg)
-{
+EIGEN_DECLARE_TEST(lscg) {
   CALL_SUBTEST_1(test_lscg_T<double>());
   CALL_SUBTEST_2(test_lscg_T<std::complex<double> >());
 }
diff --git a/test/lu.cpp b/test/lu.cpp
index 3369f82..1792c2b 100644
--- a/test/lu.cpp
+++ b/test/lu.cpp
@@ -12,55 +12,43 @@
 #include "solverbase.h"
 using namespace std;
 
-template<typename MatrixType>
+template <typename MatrixType>
 typename MatrixType::RealScalar matrix_l1_norm(const MatrixType& m) {
   return m.cwiseAbs().colwise().sum().maxCoeff();
 }
 
-template<typename MatrixType> void lu_non_invertible()
-{
-
+template <typename MatrixType>
+void lu_non_invertible() {
   typedef typename MatrixType::RealScalar RealScalar;
   /* this test covers the following files:
      LU.h
   */
   Index rows, cols, cols2;
-  if(MatrixType::RowsAtCompileTime==Dynamic)
-  {
-    rows = internal::random<Index>(2,EIGEN_TEST_MAX_SIZE);
-  }
-  else
-  {
+  if (MatrixType::RowsAtCompileTime == Dynamic) {
+    rows = internal::random<Index>(2, EIGEN_TEST_MAX_SIZE);
+  } else {
     rows = MatrixType::RowsAtCompileTime;
   }
-  if(MatrixType::ColsAtCompileTime==Dynamic)
-  {
-    cols = internal::random<Index>(2,EIGEN_TEST_MAX_SIZE);
-    cols2 = internal::random<int>(2,EIGEN_TEST_MAX_SIZE);
-  }
-  else
-  {
+  if (MatrixType::ColsAtCompileTime == Dynamic) {
+    cols = internal::random<Index>(2, EIGEN_TEST_MAX_SIZE);
+    cols2 = internal::random<int>(2, EIGEN_TEST_MAX_SIZE);
+  } else {
     cols2 = cols = MatrixType::ColsAtCompileTime;
   }
 
-  enum {
-    RowsAtCompileTime = MatrixType::RowsAtCompileTime,
-    ColsAtCompileTime = MatrixType::ColsAtCompileTime
-  };
+  enum { RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime };
   typedef typename internal::kernel_retval_base<FullPivLU<MatrixType> >::ReturnType KernelMatrixType;
   typedef typename internal::image_retval_base<FullPivLU<MatrixType> >::ReturnType ImageMatrixType;
-  typedef Matrix<typename MatrixType::Scalar, ColsAtCompileTime, ColsAtCompileTime>
-          CMatrixType;
-  typedef Matrix<typename MatrixType::Scalar, RowsAtCompileTime, RowsAtCompileTime>
-          RMatrixType;
+  typedef Matrix<typename MatrixType::Scalar, ColsAtCompileTime, ColsAtCompileTime> CMatrixType;
+  typedef Matrix<typename MatrixType::Scalar, RowsAtCompileTime, RowsAtCompileTime> RMatrixType;
 
-  Index rank = internal::random<Index>(1, (std::min)(rows, cols)-1);
+  Index rank = internal::random<Index>(1, (std::min)(rows, cols) - 1);
 
   // The image of the zero matrix should consist of a single (zero) column vector
-  VERIFY((MatrixType::Zero(rows,cols).fullPivLu().image(MatrixType::Zero(rows,cols)).cols() == 1));
+  VERIFY((MatrixType::Zero(rows, cols).fullPivLu().image(MatrixType::Zero(rows, cols)).cols() == 1));
 
   // The kernel of the zero matrix is the entire space, and thus is an invertible matrix of dimensions cols.
-  KernelMatrixType kernel = MatrixType::Zero(rows,cols).fullPivLu().kernel();
+  KernelMatrixType kernel = MatrixType::Zero(rows, cols).fullPivLu().kernel();
   VERIFY((kernel.fullPivLu().isInvertible()));
 
   MatrixType m1(rows, cols), m3(rows, cols2);
@@ -75,13 +63,13 @@
   lu.setThreshold(RealScalar(0.01));
   lu.compute(m1);
 
-  MatrixType u(rows,cols);
+  MatrixType u(rows, cols);
   u = lu.matrixLU().template triangularView<Upper>();
-  RMatrixType l = RMatrixType::Identity(rows,rows);
-  l.block(0,0,rows,(std::min)(rows,cols)).template triangularView<StrictlyLower>()
-    = lu.matrixLU().block(0,0,rows,(std::min)(rows,cols));
+  RMatrixType l = RMatrixType::Identity(rows, rows);
+  l.block(0, 0, rows, (std::min)(rows, cols)).template triangularView<StrictlyLower>() =
+      lu.matrixLU().block(0, 0, rows, (std::min)(rows, cols));
 
-  VERIFY_IS_APPROX(lu.permutationP() * m1 * lu.permutationQ(), l*u);
+  VERIFY_IS_APPROX(lu.permutationP() * m1 * lu.permutationQ(), l * u);
 
   KernelMatrixType m1kernel = lu.kernel();
   ImageMatrixType m1image = lu.image(m1);
@@ -98,35 +86,34 @@
 
   check_solverbase<CMatrixType, MatrixType>(m1, lu, rows, cols, cols2);
 
-  m2 = CMatrixType::Random(cols,cols2);
-  m3 = m1*m2;
-  m2 = CMatrixType::Random(cols,cols2);
+  m2 = CMatrixType::Random(cols, cols2);
+  m3 = m1 * m2;
+  m2 = CMatrixType::Random(cols, cols2);
   // test that the code, which does resize(), may be applied to an xpr
-  m2.block(0,0,m2.rows(),m2.cols()) = lu.solve(m3);
-  VERIFY_IS_APPROX(m3, m1*m2);
+  m2.block(0, 0, m2.rows(), m2.cols()) = lu.solve(m3);
+  VERIFY_IS_APPROX(m3, m1 * m2);
 }
 
-template<typename MatrixType> void lu_invertible()
-{
+template <typename MatrixType>
+void lu_invertible() {
   /* this test covers the following files:
      FullPivLU.h
   */
   typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar;
   Index size = MatrixType::RowsAtCompileTime;
-  if( size==Dynamic)
-    size = internal::random<Index>(1,EIGEN_TEST_MAX_SIZE);
+  if (size == Dynamic) size = internal::random<Index>(1, EIGEN_TEST_MAX_SIZE);
 
   MatrixType m1(size, size), m2(size, size), m3(size, size);
   FullPivLU<MatrixType> lu;
   lu.setThreshold(RealScalar(0.01));
   do {
-    m1 = MatrixType::Random(size,size);
+    m1 = MatrixType::Random(size, size);
     lu.compute(m1);
-  } while(!lu.isInvertible());
+  } while (!lu.isInvertible());
 
   VERIFY_IS_APPROX(m1, lu.reconstructedMatrix());
   VERIFY(0 == lu.dimensionOfKernel());
-  VERIFY(lu.kernel().cols() == 1); // the kernel() should consist of a single (zero) column vector
+  VERIFY(lu.kernel().cols() == 1);  // the kernel() should consist of a single (zero) column vector
   VERIFY(size == lu.rank());
   VERIFY(lu.isInjective());
   VERIFY(lu.isSurjective());
@@ -136,9 +123,9 @@
   check_solverbase<MatrixType, MatrixType>(m1, lu, size, size, size);
 
   MatrixType m1_inverse = lu.inverse();
-  m3 = MatrixType::Random(size,size);
+  m3 = MatrixType::Random(size, size);
   m2 = lu.solve(m3);
-  VERIFY_IS_APPROX(m2, m1_inverse*m3);
+  VERIFY_IS_APPROX(m2, m1_inverse * m3);
 
   RealScalar rcond = (RealScalar(1) / matrix_l1_norm(m1)) / matrix_l1_norm(m1_inverse);
   const RealScalar rcond_est = lu.rcond();
@@ -147,12 +134,12 @@
   VERIFY(rcond_est > rcond / 10 && rcond_est < rcond * 10);
 
   // Regression test for Bug 302
-  MatrixType m4 = MatrixType::Random(size,size);
-  VERIFY_IS_APPROX(lu.solve(m3*m4), lu.solve(m3)*m4);
+  MatrixType m4 = MatrixType::Random(size, size);
+  VERIFY_IS_APPROX(lu.solve(m3 * m4), lu.solve(m3) * m4);
 }
 
-template<typename MatrixType> void lu_partial_piv(Index size = MatrixType::ColsAtCompileTime)
-{
+template <typename MatrixType>
+void lu_partial_piv(Index size = MatrixType::ColsAtCompileTime) {
   /* this test covers the following files:
      PartialPivLU.h
   */
@@ -167,9 +154,9 @@
   check_solverbase<MatrixType, MatrixType>(m1, plu, size, size, size);
 
   MatrixType m1_inverse = plu.inverse();
-  m3 = MatrixType::Random(size,size);
+  m3 = MatrixType::Random(size, size);
   m2 = plu.solve(m3);
-  VERIFY_IS_APPROX(m2, m1_inverse*m3);
+  VERIFY_IS_APPROX(m2, m1_inverse * m3);
 
   RealScalar rcond = (RealScalar(1) / matrix_l1_norm(m1)) / matrix_l1_norm(m1_inverse);
   const RealScalar rcond_est = plu.rcond();
@@ -177,8 +164,8 @@
   VERIFY(rcond_est > rcond / 10 && rcond_est < rcond * 10);
 }
 
-template<typename MatrixType> void lu_verify_assert()
-{
+template <typename MatrixType>
+void lu_verify_assert() {
   MatrixType tmp;
 
   FullPivLU<MatrixType> lu;
@@ -208,42 +195,41 @@
   VERIFY_RAISES_ASSERT(plu.inverse())
 }
 
-EIGEN_DECLARE_TEST(lu)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( lu_non_invertible<Matrix3f>() );
-    CALL_SUBTEST_1( lu_invertible<Matrix3f>() );
-    CALL_SUBTEST_1( lu_verify_assert<Matrix3f>() );
-    CALL_SUBTEST_1( lu_partial_piv<Matrix3f>() );
+EIGEN_DECLARE_TEST(lu) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(lu_non_invertible<Matrix3f>());
+    CALL_SUBTEST_1(lu_invertible<Matrix3f>());
+    CALL_SUBTEST_1(lu_verify_assert<Matrix3f>());
+    CALL_SUBTEST_1(lu_partial_piv<Matrix3f>());
 
-    CALL_SUBTEST_2( (lu_non_invertible<Matrix<double, 4, 6> >()) );
-    CALL_SUBTEST_2( (lu_verify_assert<Matrix<double, 4, 6> >()) );
-    CALL_SUBTEST_2( lu_partial_piv<Matrix2d>() );
-    CALL_SUBTEST_2( lu_partial_piv<Matrix4d>() );
-    CALL_SUBTEST_2( (lu_partial_piv<Matrix<double,6,6> >()) );
+    CALL_SUBTEST_2((lu_non_invertible<Matrix<double, 4, 6> >()));
+    CALL_SUBTEST_2((lu_verify_assert<Matrix<double, 4, 6> >()));
+    CALL_SUBTEST_2(lu_partial_piv<Matrix2d>());
+    CALL_SUBTEST_2(lu_partial_piv<Matrix4d>());
+    CALL_SUBTEST_2((lu_partial_piv<Matrix<double, 6, 6> >()));
 
-    CALL_SUBTEST_3( lu_non_invertible<MatrixXf>() );
-    CALL_SUBTEST_3( lu_invertible<MatrixXf>() );
-    CALL_SUBTEST_3( lu_verify_assert<MatrixXf>() );
+    CALL_SUBTEST_3(lu_non_invertible<MatrixXf>());
+    CALL_SUBTEST_3(lu_invertible<MatrixXf>());
+    CALL_SUBTEST_3(lu_verify_assert<MatrixXf>());
 
-    CALL_SUBTEST_4( lu_non_invertible<MatrixXd>() );
-    CALL_SUBTEST_4( lu_invertible<MatrixXd>() );
-    CALL_SUBTEST_4( lu_partial_piv<MatrixXd>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE)) );
-    CALL_SUBTEST_4( lu_verify_assert<MatrixXd>() );
+    CALL_SUBTEST_4(lu_non_invertible<MatrixXd>());
+    CALL_SUBTEST_4(lu_invertible<MatrixXd>());
+    CALL_SUBTEST_4(lu_partial_piv<MatrixXd>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE)));
+    CALL_SUBTEST_4(lu_verify_assert<MatrixXd>());
 
-    CALL_SUBTEST_5( lu_non_invertible<MatrixXcf>() );
-    CALL_SUBTEST_5( lu_invertible<MatrixXcf>() );
-    CALL_SUBTEST_5( lu_verify_assert<MatrixXcf>() );
+    CALL_SUBTEST_5(lu_non_invertible<MatrixXcf>());
+    CALL_SUBTEST_5(lu_invertible<MatrixXcf>());
+    CALL_SUBTEST_5(lu_verify_assert<MatrixXcf>());
 
-    CALL_SUBTEST_6( lu_non_invertible<MatrixXcd>() );
-    CALL_SUBTEST_6( lu_invertible<MatrixXcd>() );
-    CALL_SUBTEST_6( lu_partial_piv<MatrixXcd>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE)) );
-    CALL_SUBTEST_6( lu_verify_assert<MatrixXcd>() );
+    CALL_SUBTEST_6(lu_non_invertible<MatrixXcd>());
+    CALL_SUBTEST_6(lu_invertible<MatrixXcd>());
+    CALL_SUBTEST_6(lu_partial_piv<MatrixXcd>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE)));
+    CALL_SUBTEST_6(lu_verify_assert<MatrixXcd>());
 
-    CALL_SUBTEST_7(( lu_non_invertible<Matrix<float,Dynamic,16> >() ));
+    CALL_SUBTEST_7((lu_non_invertible<Matrix<float, Dynamic, 16> >()));
 
     // Test problem size constructors
-    CALL_SUBTEST_9( PartialPivLU<MatrixXf>(10) );
-    CALL_SUBTEST_9( FullPivLU<MatrixXf>(10, 20); );
+    CALL_SUBTEST_9(PartialPivLU<MatrixXf>(10));
+    CALL_SUBTEST_9(FullPivLU<MatrixXf>(10, 20););
   }
 }
diff --git a/test/main.h b/test/main.h
index be6fe14..771725f 100644
--- a/test/main.h
+++ b/test/main.h
@@ -66,24 +66,24 @@
 
 // Configure GPU.
 #if defined(EIGEN_USE_HIP)
-  #if defined(__HIPCC__) && !defined(EIGEN_NO_HIP)
-    #define EIGEN_HIPCC __HIPCC__
-    #include <hip/hip_runtime.h>
-    #include <hip/hip_runtime_api.h>
-  #endif
+#if defined(__HIPCC__) && !defined(EIGEN_NO_HIP)
+#define EIGEN_HIPCC __HIPCC__
+#include <hip/hip_runtime.h>
+#include <hip/hip_runtime_api.h>
+#endif
 #elif defined(__CUDACC__) && !defined(EIGEN_NO_CUDA)
-  #define EIGEN_CUDACC __CUDACC__
-  #include <cuda.h>
-  #include <cuda_runtime.h>
-  #include <cuda_runtime_api.h>
-  #if CUDA_VERSION >= 7050
-    #include <cuda_fp16.h>
-  #endif
+#define EIGEN_CUDACC __CUDACC__
+#include <cuda.h>
+#include <cuda_runtime.h>
+#include <cuda_runtime_api.h>
+#if CUDA_VERSION >= 7050
+#include <cuda_fp16.h>
+#endif
 #endif
 
 #if defined(EIGEN_CUDACC) || defined(EIGEN_HIPCC)
-  #define EIGEN_TEST_NO_LONGDOUBLE
-  #define EIGEN_DEFAULT_DENSE_INDEX_TYPE int
+#define EIGEN_TEST_NO_LONGDOUBLE
+#define EIGEN_DEFAULT_DENSE_INDEX_TYPE int
 #endif
 
 // To test that all calls from Eigen code to std::min() and std::max() are
@@ -91,27 +91,27 @@
 // are defined here and any not-parenthesized min/max call will cause a
 // compiler error.
 #if !defined(__HIPCC__) && !defined(EIGEN_USE_SYCL) && !defined(EIGEN_POCKETFFT_DEFAULT)
-  //
-  // HIP header files include the following files
-  //  <thread>
-  //  <regex>
-  //  <unordered_map>
-  // which seem to contain not-parenthesized calls to "max"/"min", triggering the following check and causing the compile to fail
-  //
-  // Including those header files before the following macro definition for "min" / "max", only partially resolves the issue
-  // This is because other HIP header files also define "isnan" / "isinf" / "isfinite" functions, which are needed in other
-  // headers.
-  //
-  // So instead choosing to simply disable this check for HIP
-  //
-  #define min(A,B) please_protect_your_min_with_parentheses
-  #define max(A,B) please_protect_your_max_with_parentheses
-  #define isnan(X) please_protect_your_isnan_with_parentheses
-  #define isinf(X) please_protect_your_isinf_with_parentheses
-  #define isfinite(X) please_protect_your_isfinite_with_parentheses
+//
+// HIP header files include the following files
+//  <thread>
+//  <regex>
+//  <unordered_map>
+// which seem to contain not-parenthesized calls to "max"/"min", triggering the following check and causing the compile
+// to fail
+//
+// Including those header files before the following macro definition for "min" / "max", only partially resolves the
+// issue This is because other HIP header files also define "isnan" / "isinf" / "isfinite" functions, which are needed
+// in other headers.
+//
+// So instead choosing to simply disable this check for HIP
+//
+#define min(A, B) please_protect_your_min_with_parentheses
+#define max(A, B) please_protect_your_max_with_parentheses
+#define isnan(X) please_protect_your_isnan_with_parentheses
+#define isinf(X) please_protect_your_isinf_with_parentheses
+#define isfinite(X) please_protect_your_isfinite_with_parentheses
 #endif
 
-
 // test possible conflicts
 struct real {};
 struct imag {};
@@ -121,10 +121,11 @@
 #endif
 #define M_PI please_use_EIGEN_PI_instead_of_M_PI
 
-#define FORBIDDEN_IDENTIFIER (this_identifier_is_forbidden_to_avoid_clashes) this_identifier_is_forbidden_to_avoid_clashes
+#define FORBIDDEN_IDENTIFIER \
+  (this_identifier_is_forbidden_to_avoid_clashes) this_identifier_is_forbidden_to_avoid_clashes
 // B0 is defined in POSIX header termios.h
 #define B0 FORBIDDEN_IDENTIFIER
-#define I  FORBIDDEN_IDENTIFIER
+#define I FORBIDDEN_IDENTIFIER
 
 // _res is defined by resolv.h
 #define _res FORBIDDEN_IDENTIFIER
@@ -145,17 +146,21 @@
 
 inline void on_temporary_creation(long int size) {
   // here's a great place to set a breakpoint when debugging failures in this test!
-  if(size!=0) nb_temporaries++;
-  if(nb_temporaries_on_assert>0) assert(nb_temporaries<nb_temporaries_on_assert);
+  if (size != 0) nb_temporaries++;
+  if (nb_temporaries_on_assert > 0) assert(nb_temporaries < nb_temporaries_on_assert);
 }
 
-#define EIGEN_DENSE_STORAGE_CTOR_PLUGIN { on_temporary_creation(size); }
+#define EIGEN_DENSE_STORAGE_CTOR_PLUGIN \
+  { on_temporary_creation(size); }
 
-#define VERIFY_EVALUATION_COUNT(XPR,N) {\
-    nb_temporaries = 0; \
-    XPR; \
-    if(nb_temporaries!=(N)) { std::cerr << "nb_temporaries == " << nb_temporaries << "\n"; }\
-    VERIFY( (#XPR) && nb_temporaries==(N) ); \
+#define VERIFY_EVALUATION_COUNT(XPR, N)                            \
+  {                                                                \
+    nb_temporaries = 0;                                            \
+    XPR;                                                           \
+    if (nb_temporaries != (N)) {                                   \
+      std::cerr << "nb_temporaries == " << nb_temporaries << "\n"; \
+    }                                                              \
+    VERIFY((#XPR) && nb_temporaries == (N));                       \
   }
 
 #endif
@@ -178,193 +183,178 @@
 
 #define DEFAULT_REPEAT 10
 
-namespace Eigen
-{
-  static std::vector<std::string> g_test_stack;
-  // level == 0 <=> abort if test fail
-  // level >= 1 <=> warning message to std::cerr if test fail
-  static int g_test_level = 0;
-  static int g_repeat = 1;
-  static unsigned int g_seed = 0;
-  static bool g_has_set_repeat = false, g_has_set_seed = false;
+namespace Eigen {
+static std::vector<std::string> g_test_stack;
+// level == 0 <=> abort if test fail
+// level >= 1 <=> warning message to std::cerr if test fail
+static int g_test_level = 0;
+static int g_repeat = 1;
+static unsigned int g_seed = 0;
+static bool g_has_set_repeat = false, g_has_set_seed = false;
 
-  class EigenTest
-  {
-  public:
-    EigenTest() : m_func(0) {}
-    EigenTest(const char* a_name, void (*func)(void))
-      : m_name(a_name), m_func(func)
-    {
-      get_registered_tests().push_back(this);
-    }
-    const std::string& name() const { return m_name; }
-    void operator()() const { m_func(); }
+class EigenTest {
+ public:
+  EigenTest() : m_func(0) {}
+  EigenTest(const char* a_name, void (*func)(void)) : m_name(a_name), m_func(func) {
+    get_registered_tests().push_back(this);
+  }
+  const std::string& name() const { return m_name; }
+  void operator()() const { m_func(); }
 
-    static const std::vector<EigenTest*>& all() { return get_registered_tests(); }
-  protected:
-    static std::vector<EigenTest*>& get_registered_tests()
-    {
-      static std::vector<EigenTest*>* ms_registered_tests = new std::vector<EigenTest*>();
-      return *ms_registered_tests;
-    }
-    std::string m_name;
-    void (*m_func)(void);
-  };
+  static const std::vector<EigenTest*>& all() { return get_registered_tests(); }
 
-  // Declare and register a test, e.g.:
-  //    EIGEN_DECLARE_TEST(mytest) { ... }
-  // will create a function:
-  //    void test_mytest() { ... }
-  // that will be automatically called.
-  #define EIGEN_DECLARE_TEST(X) \
-    void EIGEN_CAT(test_,X) (); \
-    static EigenTest EIGEN_CAT(test_handler_,X) (EIGEN_MAKESTRING(X), & EIGEN_CAT(test_,X)); \
-    void EIGEN_CAT(test_,X) ()
-}
+ protected:
+  static std::vector<EigenTest*>& get_registered_tests() {
+    static std::vector<EigenTest*>* ms_registered_tests = new std::vector<EigenTest*>();
+    return *ms_registered_tests;
+  }
+  std::string m_name;
+  void (*m_func)(void);
+};
+
+// Declare and register a test, e.g.:
+//    EIGEN_DECLARE_TEST(mytest) { ... }
+// will create a function:
+//    void test_mytest() { ... }
+// that will be automatically called.
+#define EIGEN_DECLARE_TEST(X)                                                              \
+  void EIGEN_CAT(test_, X)();                                                              \
+  static EigenTest EIGEN_CAT(test_handler_, X)(EIGEN_MAKESTRING(X), &EIGEN_CAT(test_, X)); \
+  void EIGEN_CAT(test_, X)()
+}  // namespace Eigen
 
 #define TRACK std::cerr << __FILE__ << " " << __LINE__ << std::endl
 // #define TRACK while()
 
 #define EIGEN_DEFAULT_IO_FORMAT IOFormat(4, 0, "  ", "\n", "", "", "", "")
 
-#if (defined(_CPPUNWIND) || defined(__EXCEPTIONS)) && !defined(__CUDA_ARCH__) && !defined(__HIP_DEVICE_COMPILE__) && !defined(__SYCL_DEVICE_ONLY__)
-  #define EIGEN_EXCEPTIONS
+#if (defined(_CPPUNWIND) || defined(__EXCEPTIONS)) && !defined(__CUDA_ARCH__) && !defined(__HIP_DEVICE_COMPILE__) && \
+    !defined(__SYCL_DEVICE_ONLY__)
+#define EIGEN_EXCEPTIONS
 #endif
 
 #ifndef EIGEN_NO_ASSERTION_CHECKING
 
-  namespace Eigen
-  {
-    static const bool should_raise_an_assert = false;
+namespace Eigen {
+static const bool should_raise_an_assert = false;
 
-    // Used to avoid to raise two exceptions at a time in which
-    // case the exception is not properly caught.
-    // This may happen when a second exceptions is triggered in a destructor.
-    static bool no_more_assert = false;
-    static bool report_on_cerr_on_assert_failure = true;
+// Used to avoid to raise two exceptions at a time in which
+// case the exception is not properly caught.
+// This may happen when a second exceptions is triggered in a destructor.
+static bool no_more_assert = false;
+static bool report_on_cerr_on_assert_failure = true;
 
-    struct eigen_assert_exception
-    {
-      eigen_assert_exception(void) {}
-      ~eigen_assert_exception() { Eigen::no_more_assert = false; }
-    };
+struct eigen_assert_exception {
+  eigen_assert_exception(void) {}
+  ~eigen_assert_exception() { Eigen::no_more_assert = false; }
+};
 
-    struct eigen_static_assert_exception
-    {
-      eigen_static_assert_exception(void) {}
-      ~eigen_static_assert_exception() { Eigen::no_more_assert = false; }
-    };
+struct eigen_static_assert_exception {
+  eigen_static_assert_exception(void) {}
+  ~eigen_static_assert_exception() { Eigen::no_more_assert = false; }
+};
+}  // namespace Eigen
+// If EIGEN_DEBUG_ASSERTS is defined and if no assertion is triggered while
+// one should have been, then the list of executed assertions is printed out.
+//
+// EIGEN_DEBUG_ASSERTS is not enabled by default as it
+// significantly increases the compilation time
+// and might even introduce side effects that would hide
+// some memory errors.
+#ifdef EIGEN_DEBUG_ASSERTS
+
+namespace Eigen {
+namespace internal {
+static bool push_assert = false;
+}
+static std::vector<std::string> eigen_assert_list;
+}  // namespace Eigen
+#define eigen_assert(a)                                                                                             \
+  if ((!(a)) && (!no_more_assert)) {                                                                                \
+    if (report_on_cerr_on_assert_failure) std::cerr << #a << " " __FILE__ << "(" << __LINE__ << ")\n";              \
+    Eigen::no_more_assert = true;                                                                                   \
+    EIGEN_THROW_X(Eigen::eigen_assert_exception());                                                                 \
+  } else if (Eigen::internal::push_assert) {                                                                        \
+    eigen_assert_list.push_back(std::string(EIGEN_MAKESTRING(__FILE__) " (" EIGEN_MAKESTRING(__LINE__) ") : " #a)); \
   }
-  // If EIGEN_DEBUG_ASSERTS is defined and if no assertion is triggered while
-  // one should have been, then the list of executed assertions is printed out.
-  //
-  // EIGEN_DEBUG_ASSERTS is not enabled by default as it
-  // significantly increases the compilation time
-  // and might even introduce side effects that would hide
-  // some memory errors.
-  #ifdef EIGEN_DEBUG_ASSERTS
 
-    namespace Eigen
-    {
-      namespace internal
-      {
-        static bool push_assert = false;
-      }
-      static std::vector<std::string> eigen_assert_list;
-    }
-    #define eigen_assert(a)                       \
-      if( (!(a)) && (!no_more_assert) )     \
-      { \
-        if(report_on_cerr_on_assert_failure) \
-          std::cerr <<  #a << " " __FILE__ << "(" << __LINE__ << ")\n"; \
-        Eigen::no_more_assert = true;       \
-        EIGEN_THROW_X(Eigen::eigen_assert_exception()); \
-      }                                     \
-      else if (Eigen::internal::push_assert)       \
-      {                                     \
-        eigen_assert_list.push_back(std::string(EIGEN_MAKESTRING(__FILE__) " (" EIGEN_MAKESTRING(__LINE__) ") : " #a) ); \
-      }
+#ifdef EIGEN_EXCEPTIONS
+#define VERIFY_RAISES_ASSERT(a)                                                                                  \
+  {                                                                                                              \
+    Eigen::no_more_assert = false;                                                                               \
+    Eigen::eigen_assert_list.clear();                                                                            \
+    Eigen::internal::push_assert = true;                                                                         \
+    Eigen::report_on_cerr_on_assert_failure = false;                                                             \
+    try {                                                                                                        \
+      a;                                                                                                         \
+      std::cerr << "One of the following asserts should have been triggered:\n";                                 \
+      for (uint ai = 0; ai < eigen_assert_list.size(); ++ai) std::cerr << "  " << eigen_assert_list[ai] << "\n"; \
+      VERIFY(Eigen::should_raise_an_assert&& #a);                                                                \
+    } catch (Eigen::eigen_assert_exception) {                                                                    \
+      Eigen::internal::push_assert = false;                                                                      \
+      VERIFY(true);                                                                                              \
+    }                                                                                                            \
+    Eigen::report_on_cerr_on_assert_failure = true;                                                              \
+    Eigen::internal::push_assert = false;                                                                        \
+  }
+#endif  // EIGEN_EXCEPTIONS
 
-    #ifdef EIGEN_EXCEPTIONS
-    #define VERIFY_RAISES_ASSERT(a)                                                   \
-      {                                                                               \
-        Eigen::no_more_assert = false;                                                \
-        Eigen::eigen_assert_list.clear();                                             \
-        Eigen::internal::push_assert = true;                                          \
-        Eigen::report_on_cerr_on_assert_failure = false;                              \
-        try {                                                                         \
-          a;                                                                          \
-          std::cerr << "One of the following asserts should have been triggered:\n";  \
-          for (uint ai=0 ; ai<eigen_assert_list.size() ; ++ai)                        \
-            std::cerr << "  " << eigen_assert_list[ai] << "\n";                       \
-          VERIFY(Eigen::should_raise_an_assert && # a);                               \
-        } catch (Eigen::eigen_assert_exception) {                                     \
-          Eigen::internal::push_assert = false; VERIFY(true);                         \
-        }                                                                             \
-        Eigen::report_on_cerr_on_assert_failure = true;                               \
-        Eigen::internal::push_assert = false;                                         \
-      }
-    #endif //EIGEN_EXCEPTIONS
+#elif !defined(__CUDACC__) && !defined(__HIPCC__) && !defined(__SYCL_DEVICE_ONLY__)  // EIGEN_DEBUG_ASSERTS
+#define eigen_assert(a)                               \
+  if ((!(a)) && (!no_more_assert)) {                  \
+    Eigen::no_more_assert = true;                     \
+    if (report_on_cerr_on_assert_failure) {           \
+      eigen_plain_assert(a);                          \
+    } else {                                          \
+      EIGEN_THROW_X(Eigen::eigen_assert_exception()); \
+    }                                                 \
+  }
 
-  #elif !defined(__CUDACC__) && !defined(__HIPCC__) && !defined(__SYCL_DEVICE_ONLY__) // EIGEN_DEBUG_ASSERTS
-    #define eigen_assert(a) \
-      if( (!(a)) && (!no_more_assert) )       \
-      {                                       \
-        Eigen::no_more_assert = true;         \
-        if(report_on_cerr_on_assert_failure) { \
-          eigen_plain_assert(a);              \
-        } else {                                  \
-          EIGEN_THROW_X(Eigen::eigen_assert_exception()); \
-        } \
-      }
-
-    #ifdef EIGEN_EXCEPTIONS
-      #define VERIFY_RAISES_ASSERT(a) {                           \
-        Eigen::no_more_assert = false;                            \
-        Eigen::report_on_cerr_on_assert_failure = false;          \
-        try {                                                     \
-          a;                                                      \
-          VERIFY(Eigen::should_raise_an_assert && # a);           \
-        }                                                         \
-        catch (Eigen::eigen_assert_exception&) { VERIFY(true); }  \
-        Eigen::report_on_cerr_on_assert_failure = true;           \
-      }
-    #endif // EIGEN_EXCEPTIONS
-  #endif // EIGEN_DEBUG_ASSERTS
+#ifdef EIGEN_EXCEPTIONS
+#define VERIFY_RAISES_ASSERT(a)                      \
+  {                                                  \
+    Eigen::no_more_assert = false;                   \
+    Eigen::report_on_cerr_on_assert_failure = false; \
+    try {                                            \
+      a;                                             \
+      VERIFY(Eigen::should_raise_an_assert&& #a);    \
+    } catch (Eigen::eigen_assert_exception&) {       \
+      VERIFY(true);                                  \
+    }                                                \
+    Eigen::report_on_cerr_on_assert_failure = true;  \
+  }
+#endif  // EIGEN_EXCEPTIONS
+#endif  // EIGEN_DEBUG_ASSERTS
 
 #ifndef VERIFY_RAISES_ASSERT
-  #define VERIFY_RAISES_ASSERT(a) \
-    std::cout << "Can't VERIFY_RAISES_ASSERT( " #a " ) with exceptions disabled\n";
+#define VERIFY_RAISES_ASSERT(a) std::cout << "Can't VERIFY_RAISES_ASSERT( " #a " ) with exceptions disabled\n";
 #endif
 
-  #if !defined(__CUDACC__) && !defined(__HIPCC__) && !defined(SYCL_DEVICE_ONLY)
-  #define EIGEN_USE_CUSTOM_ASSERT
-  #endif
+#if !defined(__CUDACC__) && !defined(__HIPCC__) && !defined(SYCL_DEVICE_ONLY)
+#define EIGEN_USE_CUSTOM_ASSERT
+#endif
 
-#else // EIGEN_NO_ASSERTION_CHECKING
+#else  // EIGEN_NO_ASSERTION_CHECKING
 
-  #define VERIFY_RAISES_ASSERT(a) {}
+#define VERIFY_RAISES_ASSERT(a) \
+  {}
 
-#endif // EIGEN_NO_ASSERTION_CHECKING
+#endif  // EIGEN_NO_ASSERTION_CHECKING
 
 #define EIGEN_INTERNAL_DEBUGGING
-#include <Eigen/QR> // required for createRandomPIMatrixOfRank and generateRandomMatrixSvs
+#include <Eigen/QR>  // required for createRandomPIMatrixOfRank and generateRandomMatrixSvs
 
-inline void verify_impl(bool condition, const char *testname, const char *file, int line, const char *condition_as_string)
-{
-  if (!condition)
-  {
-    if(Eigen::g_test_level>0)
-      std::cerr << "WARNING: ";
-    std::cerr << "Test " << testname << " failed in " << file << " (" << line << ")"
-      << std::endl << "    " << condition_as_string << std::endl;
+inline void verify_impl(bool condition, const char* testname, const char* file, int line,
+                        const char* condition_as_string) {
+  if (!condition) {
+    if (Eigen::g_test_level > 0) std::cerr << "WARNING: ";
+    std::cerr << "Test " << testname << " failed in " << file << " (" << line << ")" << std::endl
+              << "    " << condition_as_string << std::endl;
     std::cerr << "Stack:\n";
     const int test_stack_size = static_cast<int>(Eigen::g_test_stack.size());
-    for(int i=test_stack_size-1; i>=0; --i)
-      std::cerr << "  - " << Eigen::g_test_stack[i] << "\n";
+    for (int i = test_stack_size - 1; i >= 0; --i) std::cerr << "  - " << Eigen::g_test_stack[i] << "\n";
     std::cerr << "\n";
-    if(Eigen::g_test_level==0)
-      abort();
+    if (Eigen::g_test_level == 0) abort();
   }
 }
 
@@ -373,7 +363,6 @@
 #define VERIFY_GE(a, b) ::verify_impl(a >= b, g_test_stack.back().c_str(), __FILE__, __LINE__, EIGEN_MAKESTRING(a >= b))
 #define VERIFY_LE(a, b) ::verify_impl(a <= b, g_test_stack.back().c_str(), __FILE__, __LINE__, EIGEN_MAKESTRING(a <= b))
 
-
 #define VERIFY_IS_EQUAL(a, b) VERIFY(test_is_equal(a, b, true))
 #define VERIFY_IS_NOT_EQUAL(a, b) VERIFY(test_is_equal(a, b, false))
 #define VERIFY_IS_APPROX(a, b) VERIFY(verifyIsApprox(a, b))
@@ -387,60 +376,81 @@
 
 #define VERIFY_IS_UNITARY(a) VERIFY(test_isUnitary(a))
 
-#define STATIC_CHECK(COND) EIGEN_STATIC_ASSERT( (COND) , EIGEN_INTERNAL_ERROR_PLEASE_FILE_A_BUG_REPORT )
+#define STATIC_CHECK(COND) EIGEN_STATIC_ASSERT((COND), EIGEN_INTERNAL_ERROR_PLEASE_FILE_A_BUG_REPORT)
 
-#define CALL_SUBTEST(FUNC) do { \
+#define CALL_SUBTEST(FUNC)                          \
+  do {                                              \
     g_test_stack.push_back(EIGEN_MAKESTRING(FUNC)); \
-    FUNC; \
-    g_test_stack.pop_back(); \
+    FUNC;                                           \
+    g_test_stack.pop_back();                        \
   } while (0)
 
-
 // Forward declarations to avoid ICC warnings
 #if EIGEN_COMP_ICC
 
-template<typename T> std::string type_name();
+template <typename T>
+std::string type_name();
 
 namespace Eigen {
 
-template<typename T, typename U>
-bool test_is_equal(const T& actual, const U& expected, bool expect_equal=true);
+template <typename T, typename U>
+bool test_is_equal(const T& actual, const U& expected, bool expect_equal = true);
 
-} // end namespace Eigen
+}  // end namespace Eigen
 
 #endif  // EIGEN_COMP_ICC
 
-
 namespace Eigen {
 
-template<typename T1,typename T2>
-std::enable_if_t<internal::is_same<T1,T2>::value,bool>
-is_same_type(const T1&, const T2&)
-{
+template <typename T1, typename T2>
+std::enable_if_t<internal::is_same<T1, T2>::value, bool> is_same_type(const T1&, const T2&) {
   return true;
 }
 
-template<typename T> inline typename NumTraits<T>::Real test_precision() { return NumTraits<T>::dummy_precision(); }
-template<> inline float test_precision<float>() { return 1e-3f; }
-template<> inline double test_precision<double>() { return 1e-6; }
-template<> inline long double test_precision<long double>() { return 1e-6l; }
-template<> inline float test_precision<std::complex<float> >() { return test_precision<float>(); }
-template<> inline double test_precision<std::complex<double> >() { return test_precision<double>(); }
-template<> inline long double test_precision<std::complex<long double> >() { return test_precision<long double>(); }
+template <typename T>
+inline typename NumTraits<T>::Real test_precision() {
+  return NumTraits<T>::dummy_precision();
+}
+template <>
+inline float test_precision<float>() {
+  return 1e-3f;
+}
+template <>
+inline double test_precision<double>() {
+  return 1e-6;
+}
+template <>
+inline long double test_precision<long double>() {
+  return 1e-6l;
+}
+template <>
+inline float test_precision<std::complex<float> >() {
+  return test_precision<float>();
+}
+template <>
+inline double test_precision<std::complex<double> >() {
+  return test_precision<double>();
+}
+template <>
+inline long double test_precision<std::complex<long double> >() {
+  return test_precision<long double>();
+}
 
-#define EIGEN_TEST_SCALAR_TEST_OVERLOAD(TYPE)                             \
-  inline bool test_isApprox(TYPE a, TYPE b)                               \
-  { return numext::equal_strict(a, b) ||                                  \
-      ((numext::isnan)(a) && (numext::isnan)(b)) ||                       \
-      (internal::isApprox(a, b, test_precision<TYPE>())); }               \
-  inline bool test_isCwiseApprox(TYPE a, TYPE b, bool exact)              \
-  { return numext::equal_strict(a, b) ||                                  \
-      ((numext::isnan)(a) && (numext::isnan)(b)) ||                       \
-      (!exact && internal::isApprox(a, b, test_precision<TYPE>())); }     \
-  inline bool test_isMuchSmallerThan(TYPE a, TYPE b)                      \
-  { return internal::isMuchSmallerThan(a, b, test_precision<TYPE>()); }   \
-  inline bool test_isApproxOrLessThan(TYPE a, TYPE b)                     \
-  { return internal::isApproxOrLessThan(a, b, test_precision<TYPE>()); }
+#define EIGEN_TEST_SCALAR_TEST_OVERLOAD(TYPE)                                          \
+  inline bool test_isApprox(TYPE a, TYPE b) {                                          \
+    return numext::equal_strict(a, b) || ((numext::isnan)(a) && (numext::isnan)(b)) || \
+           (internal::isApprox(a, b, test_precision<TYPE>()));                         \
+  }                                                                                    \
+  inline bool test_isCwiseApprox(TYPE a, TYPE b, bool exact) {                         \
+    return numext::equal_strict(a, b) || ((numext::isnan)(a) && (numext::isnan)(b)) || \
+           (!exact && internal::isApprox(a, b, test_precision<TYPE>()));               \
+  }                                                                                    \
+  inline bool test_isMuchSmallerThan(TYPE a, TYPE b) {                                 \
+    return internal::isMuchSmallerThan(a, b, test_precision<TYPE>());                  \
+  }                                                                                    \
+  inline bool test_isApproxOrLessThan(TYPE a, TYPE b) {                                \
+    return internal::isApproxOrLessThan(a, b, test_precision<TYPE>());                 \
+  }
 
 EIGEN_TEST_SCALAR_TEST_OVERLOAD(short)
 EIGEN_TEST_SCALAR_TEST_OVERLOAD(unsigned short)
@@ -458,164 +468,164 @@
 #undef EIGEN_TEST_SCALAR_TEST_OVERLOAD
 
 #ifndef EIGEN_TEST_NO_COMPLEX
-inline bool test_isApprox(const std::complex<float>& a, const std::complex<float>& b)
-{ return internal::isApprox(a, b, test_precision<std::complex<float> >()); }
-inline bool test_isMuchSmallerThan(const std::complex<float>& a, const std::complex<float>& b)
-{ return internal::isMuchSmallerThan(a, b, test_precision<std::complex<float> >()); }
-
-inline bool test_isApprox(const std::complex<double>& a, const std::complex<double>& b)
-{ return internal::isApprox(a, b, test_precision<std::complex<double> >()); }
-inline bool test_isMuchSmallerThan(const std::complex<double>& a, const std::complex<double>& b)
-{ return internal::isMuchSmallerThan(a, b, test_precision<std::complex<double> >()); }
-
-#ifndef EIGEN_TEST_NO_LONGDOUBLE
-inline bool test_isApprox(const std::complex<long double>& a, const std::complex<long double>& b)
-{ return internal::isApprox(a, b, test_precision<std::complex<long double> >()); }
-inline bool test_isMuchSmallerThan(const std::complex<long double>& a, const std::complex<long double>& b)
-{ return internal::isMuchSmallerThan(a, b, test_precision<std::complex<long double> >()); }
-#endif
-#endif
-
-#ifndef EIGEN_TEST_NO_LONGDOUBLE
-inline bool test_isApprox(const long double& a, const long double& b)
-{
-    bool ret = internal::isApprox(a, b, test_precision<long double>());
-    if (!ret) std::cerr
-        << std::endl << "    actual   = " << a
-        << std::endl << "    expected = " << b << std::endl << std::endl;
-    return ret;
+inline bool test_isApprox(const std::complex<float>& a, const std::complex<float>& b) {
+  return internal::isApprox(a, b, test_precision<std::complex<float> >());
+}
+inline bool test_isMuchSmallerThan(const std::complex<float>& a, const std::complex<float>& b) {
+  return internal::isMuchSmallerThan(a, b, test_precision<std::complex<float> >());
 }
 
-inline bool test_isMuchSmallerThan(const long double& a, const long double& b)
-{ return internal::isMuchSmallerThan(a, b, test_precision<long double>()); }
-inline bool test_isApproxOrLessThan(const long double& a, const long double& b)
-{ return internal::isApproxOrLessThan(a, b, test_precision<long double>()); }
-#endif // EIGEN_TEST_NO_LONGDOUBLE
+inline bool test_isApprox(const std::complex<double>& a, const std::complex<double>& b) {
+  return internal::isApprox(a, b, test_precision<std::complex<double> >());
+}
+inline bool test_isMuchSmallerThan(const std::complex<double>& a, const std::complex<double>& b) {
+  return internal::isMuchSmallerThan(a, b, test_precision<std::complex<double> >());
+}
+
+#ifndef EIGEN_TEST_NO_LONGDOUBLE
+inline bool test_isApprox(const std::complex<long double>& a, const std::complex<long double>& b) {
+  return internal::isApprox(a, b, test_precision<std::complex<long double> >());
+}
+inline bool test_isMuchSmallerThan(const std::complex<long double>& a, const std::complex<long double>& b) {
+  return internal::isMuchSmallerThan(a, b, test_precision<std::complex<long double> >());
+}
+#endif
+#endif
+
+#ifndef EIGEN_TEST_NO_LONGDOUBLE
+inline bool test_isApprox(const long double& a, const long double& b) {
+  bool ret = internal::isApprox(a, b, test_precision<long double>());
+  if (!ret)
+    std::cerr << std::endl << "    actual   = " << a << std::endl << "    expected = " << b << std::endl << std::endl;
+  return ret;
+}
+
+inline bool test_isMuchSmallerThan(const long double& a, const long double& b) {
+  return internal::isMuchSmallerThan(a, b, test_precision<long double>());
+}
+inline bool test_isApproxOrLessThan(const long double& a, const long double& b) {
+  return internal::isApproxOrLessThan(a, b, test_precision<long double>());
+}
+#endif  // EIGEN_TEST_NO_LONGDOUBLE
 
 // test_relative_error returns the relative difference between a and b as a real scalar as used in isApprox.
-template<typename T1,typename T2>
-typename NumTraits<typename T1::RealScalar>::NonInteger test_relative_error(const EigenBase<T1> &a, const EigenBase<T2> &b)
-{
+template <typename T1, typename T2>
+typename NumTraits<typename T1::RealScalar>::NonInteger test_relative_error(const EigenBase<T1>& a,
+                                                                            const EigenBase<T2>& b) {
   using std::sqrt;
   typedef typename NumTraits<typename T1::RealScalar>::NonInteger RealScalar;
-  typename internal::nested_eval<T1,2>::type ea(a.derived());
-  typename internal::nested_eval<T2,2>::type eb(b.derived());
-  return sqrt(RealScalar((ea.matrix()-eb.matrix()).cwiseAbs2().sum()) / RealScalar((std::min)(eb.cwiseAbs2().sum(),ea.cwiseAbs2().sum())));
+  typename internal::nested_eval<T1, 2>::type ea(a.derived());
+  typename internal::nested_eval<T2, 2>::type eb(b.derived());
+  return sqrt(RealScalar((ea.matrix() - eb.matrix()).cwiseAbs2().sum()) /
+              RealScalar((std::min)(eb.cwiseAbs2().sum(), ea.cwiseAbs2().sum())));
 }
 
-template<typename T1,typename T2>
-typename T1::RealScalar test_relative_error(const T1 &a, const T2 &b, const typename T1::Coefficients* = 0)
-{
+template <typename T1, typename T2>
+typename T1::RealScalar test_relative_error(const T1& a, const T2& b, const typename T1::Coefficients* = 0) {
   return test_relative_error(a.coeffs(), b.coeffs());
 }
 
-template<typename T1,typename T2>
-typename T1::Scalar test_relative_error(const T1 &a, const T2 &b, const typename T1::MatrixType* = 0)
-{
+template <typename T1, typename T2>
+typename T1::Scalar test_relative_error(const T1& a, const T2& b, const typename T1::MatrixType* = 0) {
   return test_relative_error(a.matrix(), b.matrix());
 }
 
-template<typename S, int D>
-S test_relative_error(const Translation<S,D> &a, const Translation<S,D> &b)
-{
+template <typename S, int D>
+S test_relative_error(const Translation<S, D>& a, const Translation<S, D>& b) {
   return test_relative_error(a.vector(), b.vector());
 }
 
 template <typename S, int D, int O>
-S test_relative_error(const ParametrizedLine<S,D,O> &a, const ParametrizedLine<S,D,O> &b)
-{
+S test_relative_error(const ParametrizedLine<S, D, O>& a, const ParametrizedLine<S, D, O>& b) {
   return (std::max)(test_relative_error(a.origin(), b.origin()), test_relative_error(a.origin(), b.origin()));
 }
 
 template <typename S, int D>
-S test_relative_error(const AlignedBox<S,D> &a, const AlignedBox<S,D> &b)
-{
+S test_relative_error(const AlignedBox<S, D>& a, const AlignedBox<S, D>& b) {
   return (std::max)(test_relative_error((a.min)(), (b.min)()), test_relative_error((a.max)(), (b.max)()));
 }
 
-template<typename Derived> class SparseMatrixBase;
-template<typename T1,typename T2>
-typename T1::RealScalar test_relative_error(const MatrixBase<T1> &a, const SparseMatrixBase<T2> &b)
-{
-  return test_relative_error(a,b.toDense());
+template <typename Derived>
+class SparseMatrixBase;
+template <typename T1, typename T2>
+typename T1::RealScalar test_relative_error(const MatrixBase<T1>& a, const SparseMatrixBase<T2>& b) {
+  return test_relative_error(a, b.toDense());
 }
 
-template<typename Derived> class SparseMatrixBase;
-template<typename T1,typename T2>
-typename T1::RealScalar test_relative_error(const SparseMatrixBase<T1> &a, const MatrixBase<T2> &b)
-{
-  return test_relative_error(a.toDense(),b);
+template <typename Derived>
+class SparseMatrixBase;
+template <typename T1, typename T2>
+typename T1::RealScalar test_relative_error(const SparseMatrixBase<T1>& a, const MatrixBase<T2>& b) {
+  return test_relative_error(a.toDense(), b);
 }
 
-template<typename Derived> class SparseMatrixBase;
-template<typename T1,typename T2>
-typename T1::RealScalar test_relative_error(const SparseMatrixBase<T1> &a, const SparseMatrixBase<T2> &b)
-{
-  return test_relative_error(a.toDense(),b.toDense());
+template <typename Derived>
+class SparseMatrixBase;
+template <typename T1, typename T2>
+typename T1::RealScalar test_relative_error(const SparseMatrixBase<T1>& a, const SparseMatrixBase<T2>& b) {
+  return test_relative_error(a.toDense(), b.toDense());
 }
 
-template<typename T1,typename T2>
-typename NumTraits<typename NumTraits<T1>::Real>::NonInteger test_relative_error(const T1 &a, const T2 &b, std::enable_if_t<internal::is_arithmetic<typename NumTraits<T1>::Real>::value, T1>* = 0)
-{
+template <typename T1, typename T2>
+typename NumTraits<typename NumTraits<T1>::Real>::NonInteger test_relative_error(
+    const T1& a, const T2& b, std::enable_if_t<internal::is_arithmetic<typename NumTraits<T1>::Real>::value, T1>* = 0) {
   typedef typename NumTraits<typename NumTraits<T1>::Real>::NonInteger RealScalar;
-  return numext::sqrt(RealScalar(numext::abs2(a-b))/(numext::mini)(RealScalar(numext::abs2(a)),RealScalar(numext::abs2(b))));
+  return numext::sqrt(RealScalar(numext::abs2(a - b)) /
+                      (numext::mini)(RealScalar(numext::abs2(a)), RealScalar(numext::abs2(b))));
 }
 
-template<typename T>
-T test_relative_error(const Rotation2D<T> &a, const Rotation2D<T> &b)
-{
+template <typename T>
+T test_relative_error(const Rotation2D<T>& a, const Rotation2D<T>& b) {
   return test_relative_error(a.angle(), b.angle());
 }
 
-template<typename T>
-T test_relative_error(const AngleAxis<T> &a, const AngleAxis<T> &b)
-{
+template <typename T>
+T test_relative_error(const AngleAxis<T>& a, const AngleAxis<T>& b) {
   return (std::max)(test_relative_error(a.angle(), b.angle()), test_relative_error(a.axis(), b.axis()));
 }
 
-template<typename Type1, typename Type2>
-inline bool test_isApprox(const Type1& a, const Type2& b, typename Type1::Scalar* = 0) // Enabled for Eigen's type only
+template <typename Type1, typename Type2>
+inline bool test_isApprox(const Type1& a, const Type2& b, typename Type1::Scalar* = 0)  // Enabled for Eigen's type only
 {
   return a.isApprox(b, test_precision<typename Type1::Scalar>());
 }
 
-// get_test_precision is a small wrapper to test_precision allowing to return the scalar precision for either scalars or expressions
-template<typename T>
-typename NumTraits<typename T::Scalar>::Real get_test_precision(const T&, const typename T::Scalar* = 0)
-{
+// get_test_precision is a small wrapper to test_precision allowing to return the scalar precision for either scalars or
+// expressions
+template <typename T>
+typename NumTraits<typename T::Scalar>::Real get_test_precision(const T&, const typename T::Scalar* = 0) {
   return test_precision<typename NumTraits<typename T::Scalar>::Real>();
 }
 
-template<typename T>
-typename NumTraits<T>::Real get_test_precision(const T&,std::enable_if_t<internal::is_arithmetic<typename NumTraits<T>::Real>::value, T>* = 0)
-{
+template <typename T>
+typename NumTraits<T>::Real get_test_precision(
+    const T&, std::enable_if_t<internal::is_arithmetic<typename NumTraits<T>::Real>::value, T>* = 0) {
   return test_precision<typename NumTraits<T>::Real>();
 }
 
 // verifyIsApprox is a wrapper to test_isApprox that outputs the relative difference magnitude if the test fails.
-template<typename Type1, typename Type2>
-inline bool verifyIsApprox(const Type1& a, const Type2& b)
-{
-  bool ret = test_isApprox(a,b);
-  if(!ret)
-  {
-    std::cerr << "Difference too large wrt tolerance " << get_test_precision(a)  << ", relative error is: " << test_relative_error(a,b) << std::endl;
+template <typename Type1, typename Type2>
+inline bool verifyIsApprox(const Type1& a, const Type2& b) {
+  bool ret = test_isApprox(a, b);
+  if (!ret) {
+    std::cerr << "Difference too large wrt tolerance " << get_test_precision(a)
+              << ", relative error is: " << test_relative_error(a, b) << std::endl;
   }
   return ret;
 }
 
-// verifyIsCwiseApprox is a wrapper to test_isCwiseApprox that outputs the relative difference magnitude if the test fails.
-template<typename Type1, typename Type2>
-inline bool verifyIsCwiseApprox(const Type1& a, const Type2& b, bool exact)
-{
-  bool ret = test_isCwiseApprox(a,b,exact);
-  if(!ret) {
+// verifyIsCwiseApprox is a wrapper to test_isCwiseApprox that outputs the relative difference magnitude if the test
+// fails.
+template <typename Type1, typename Type2>
+inline bool verifyIsCwiseApprox(const Type1& a, const Type2& b, bool exact) {
+  bool ret = test_isCwiseApprox(a, b, exact);
+  if (!ret) {
     if (exact) {
       std::cerr << "Values are not an exact match";
     } else {
       std::cerr << "Difference too large wrt tolerance " << get_test_precision(a);
     }
-    std::cerr << ", relative error is: " << test_relative_error(a,b) << std::endl;
+    std::cerr << ", relative error is: " << test_relative_error(a, b) << std::endl;
   }
   return ret;
 }
@@ -627,37 +637,30 @@
 // we won't issue a false negative.
 // This test could be: abs(a-b) <= eps * ref
 // However, it seems that simply comparing a+ref and b+ref is more sensitive to true error.
-template<typename Scalar,typename ScalarRef>
-inline bool test_isApproxWithRef(const Scalar& a, const Scalar& b, const ScalarRef& ref)
-{
-  return test_isApprox(a+ref, b+ref);
+template <typename Scalar, typename ScalarRef>
+inline bool test_isApproxWithRef(const Scalar& a, const Scalar& b, const ScalarRef& ref) {
+  return test_isApprox(a + ref, b + ref);
 }
 
-template<typename Derived1, typename Derived2>
-inline bool test_isMuchSmallerThan(const MatrixBase<Derived1>& m1,
-                                   const MatrixBase<Derived2>& m2)
-{
+template <typename Derived1, typename Derived2>
+inline bool test_isMuchSmallerThan(const MatrixBase<Derived1>& m1, const MatrixBase<Derived2>& m2) {
   return m1.isMuchSmallerThan(m2, test_precision<typename internal::traits<Derived1>::Scalar>());
 }
 
-template<typename Derived>
+template <typename Derived>
 inline bool test_isMuchSmallerThan(const MatrixBase<Derived>& m,
-                                   const typename NumTraits<typename internal::traits<Derived>::Scalar>::Real& s)
-{
+                                   const typename NumTraits<typename internal::traits<Derived>::Scalar>::Real& s) {
   return m.isMuchSmallerThan(s, test_precision<typename internal::traits<Derived>::Scalar>());
 }
 
-template<typename Derived>
-inline bool test_isUnitary(const MatrixBase<Derived>& m)
-{
+template <typename Derived>
+inline bool test_isUnitary(const MatrixBase<Derived>& m) {
   return m.isUnitary(test_precision<typename internal::traits<Derived>::Scalar>());
 }
 
 // Checks component-wise, works with infs and nans.
-template<typename Derived1, typename Derived2>
-bool test_isCwiseApprox(const DenseBase<Derived1>& m1,
-                        const DenseBase<Derived2>& m2,
-                        bool exact) {
+template <typename Derived1, typename Derived2>
+bool test_isCwiseApprox(const DenseBase<Derived1>& m1, const DenseBase<Derived2>& m2, bool exact) {
   if (m1.rows() != m2.rows()) {
     return false;
   }
@@ -666,9 +669,8 @@
   }
   for (Index r = 0; r < m1.rows(); ++r) {
     for (Index c = 0; c < m1.cols(); ++c) {
-      if (m1(r, c) != m2(r, c)
-          && !((numext::isnan)(m1(r, c)) && (numext::isnan)(m2(r, c))) 
-          && (exact || !test_isApprox(m1(r, c), m2(r, c)))) {
+      if (m1(r, c) != m2(r, c) && !((numext::isnan)(m1(r, c)) && (numext::isnan)(m2(r, c))) &&
+          (exact || !test_isApprox(m1(r, c), m2(r, c)))) {
         return false;
       }
     }
@@ -677,25 +679,18 @@
 }
 
 template <typename Derived1, typename Derived2>
-bool test_isCwiseApprox(const SparseMatrixBase<Derived1>& m1,
-                        const SparseMatrixBase<Derived2>& m2, bool exact) {
+bool test_isCwiseApprox(const SparseMatrixBase<Derived1>& m1, const SparseMatrixBase<Derived2>& m2, bool exact) {
   return test_isCwiseApprox(m1.toDense(), m2.toDense(), exact);
 }
 
-template<typename T, typename U>
-bool test_is_equal(const T& actual, const U& expected, bool expect_equal)
-{
-    if (numext::equal_strict(actual, expected) == expect_equal)
-        return true;
-    // false:
-    std::cerr
-        << "\n    actual   = " << actual
-        << "\n    expected " << (expect_equal ? "= " : "!=") << expected << "\n\n";
-    return false;
+template <typename T, typename U>
+bool test_is_equal(const T& actual, const U& expected, bool expect_equal) {
+  if (numext::equal_strict(actual, expected) == expect_equal) return true;
+  // false:
+  std::cerr << "\n    actual   = " << actual << "\n    expected " << (expect_equal ? "= " : "!=") << expected << "\n\n";
+  return false;
 }
 
-
-
 /**
  * Check if number is "not a number" (NaN).
  *
@@ -703,9 +698,9 @@
  * @param x input value
  * @return true, if input value is "not a number" (NaN)
  */
-template<typename T> bool isNotNaN(const T& x)
-{
-  return x==x;
+template <typename T>
+bool isNotNaN(const T& x) {
+  return x == x;
 }
 
 /**
@@ -715,8 +710,8 @@
  * @param x input value
  * @return true, if input value is plus infinity
  */
-template<typename T> bool isPlusInf(const T& x)
-{
+template <typename T>
+bool isPlusInf(const T& x) {
   return x > NumTraits<T>::highest();
 }
 
@@ -727,33 +722,67 @@
  * @param x input value
  * @return true, if input value is minus infinity
  */
-template<typename T> bool isMinusInf(const T& x)
-{
+template <typename T>
+bool isMinusInf(const T& x) {
   return x < NumTraits<T>::lowest();
 }
 
-} // end namespace Eigen
-
+}  // end namespace Eigen
 
 #include "random_matrix_helper.h"
 
+template <typename T>
+struct GetDifferentType;
 
-template<typename T> struct GetDifferentType;
+template <>
+struct GetDifferentType<float> {
+  typedef double type;
+};
+template <>
+struct GetDifferentType<double> {
+  typedef float type;
+};
+template <typename T>
+struct GetDifferentType<std::complex<T> > {
+  typedef std::complex<typename GetDifferentType<T>::type> type;
+};
 
-template<> struct GetDifferentType<float> { typedef double type; };
-template<> struct GetDifferentType<double> { typedef float type; };
-template<typename T> struct GetDifferentType<std::complex<T> >
-{ typedef std::complex<typename GetDifferentType<T>::type> type; };
-
-template<typename T> std::string type_name()                    { return "other"; }
-template<> std::string type_name<float>()                       { return "float"; }
-template<> std::string type_name<double>()                      { return "double"; }
-template<> std::string type_name<long double>()                 { return "long double"; }
-template<> std::string type_name<int>()                         { return "int"; }
-template<> std::string type_name<std::complex<float> >()        { return "complex<float>"; }
-template<> std::string type_name<std::complex<double> >()       { return "complex<double>"; }
-template<> std::string type_name<std::complex<long double> >()  { return "complex<long double>"; }
-template<> std::string type_name<std::complex<int> >()          { return "complex<int>"; }
+template <typename T>
+std::string type_name() {
+  return "other";
+}
+template <>
+std::string type_name<float>() {
+  return "float";
+}
+template <>
+std::string type_name<double>() {
+  return "double";
+}
+template <>
+std::string type_name<long double>() {
+  return "long double";
+}
+template <>
+std::string type_name<int>() {
+  return "int";
+}
+template <>
+std::string type_name<std::complex<float> >() {
+  return "complex<float>";
+}
+template <>
+std::string type_name<std::complex<double> >() {
+  return "complex<double>";
+}
+template <>
+std::string type_name<std::complex<long double> >() {
+  return "complex<long double>";
+}
+template <>
+std::string type_name<std::complex<int> >() {
+  return "complex<int>";
+}
 
 using namespace Eigen;
 
@@ -762,12 +791,10 @@
  *
  * @param str input string
  */
-inline void set_repeat_from_string(const char *str)
-{
+inline void set_repeat_from_string(const char* str) {
   errno = 0;
   g_repeat = int(strtoul(str, 0, 10));
-  if(errno || g_repeat <= 0)
-  {
+  if (errno || g_repeat <= 0) {
     std::cout << "Invalid repeat value " << str << std::endl;
     exit(EXIT_FAILURE);
   }
@@ -779,105 +806,91 @@
  *
  * @param str input string
  */
-inline void set_seed_from_string(const char *str)
-{
+inline void set_seed_from_string(const char* str) {
   errno = 0;
   g_seed = int(strtoul(str, 0, 10));
-  if(errno || g_seed == 0)
-  {
+  if (errno || g_seed == 0) {
     std::cout << "Invalid seed value " << str << std::endl;
     exit(EXIT_FAILURE);
   }
   g_has_set_seed = true;
 }
 
-int main(int argc, char *argv[])
-{
-    g_has_set_repeat = false;
-    g_has_set_seed = false;
-    bool need_help = false;
+int main(int argc, char* argv[]) {
+  g_has_set_repeat = false;
+  g_has_set_seed = false;
+  bool need_help = false;
 
-    for(int i = 1; i < argc; i++)
-    {
-      if(argv[i][0] == 'r')
-      {
-        if(g_has_set_repeat)
-        {
-          std::cout << "Argument " << argv[i] << " conflicting with a former argument" << std::endl;
-          return 1;
-        }
-        set_repeat_from_string(argv[i]+1);
+  for (int i = 1; i < argc; i++) {
+    if (argv[i][0] == 'r') {
+      if (g_has_set_repeat) {
+        std::cout << "Argument " << argv[i] << " conflicting with a former argument" << std::endl;
+        return 1;
       }
-      else if(argv[i][0] == 's')
-      {
-        if(g_has_set_seed)
-        {
-          std::cout << "Argument " << argv[i] << " conflicting with a former argument" << std::endl;
-          return 1;
-        }
-         set_seed_from_string(argv[i]+1);
+      set_repeat_from_string(argv[i] + 1);
+    } else if (argv[i][0] == 's') {
+      if (g_has_set_seed) {
+        std::cout << "Argument " << argv[i] << " conflicting with a former argument" << std::endl;
+        return 1;
       }
-      else
-      {
-        need_help = true;
-      }
+      set_seed_from_string(argv[i] + 1);
+    } else {
+      need_help = true;
     }
+  }
 
-    if(need_help)
-    {
-      std::cout << "This test application takes the following optional arguments:" << std::endl;
-      std::cout << "  rN     Repeat each test N times (default: " << DEFAULT_REPEAT << ")" << std::endl;
-      std::cout << "  sN     Use N as seed for random numbers (default: based on current time)" << std::endl;
-      std::cout << std::endl;
-      std::cout << "If defined, the environment variables EIGEN_REPEAT and EIGEN_SEED" << std::endl;
-      std::cout << "will be used as default values for these parameters." << std::endl;
-      return 1;
-    }
+  if (need_help) {
+    std::cout << "This test application takes the following optional arguments:" << std::endl;
+    std::cout << "  rN     Repeat each test N times (default: " << DEFAULT_REPEAT << ")" << std::endl;
+    std::cout << "  sN     Use N as seed for random numbers (default: based on current time)" << std::endl;
+    std::cout << std::endl;
+    std::cout << "If defined, the environment variables EIGEN_REPEAT and EIGEN_SEED" << std::endl;
+    std::cout << "will be used as default values for these parameters." << std::endl;
+    return 1;
+  }
 
-    char *env_EIGEN_REPEAT = getenv("EIGEN_REPEAT");
-    if(!g_has_set_repeat && env_EIGEN_REPEAT)
-      set_repeat_from_string(env_EIGEN_REPEAT);
-    char *env_EIGEN_SEED = getenv("EIGEN_SEED");
-    if(!g_has_set_seed && env_EIGEN_SEED)
-      set_seed_from_string(env_EIGEN_SEED);
+  char* env_EIGEN_REPEAT = getenv("EIGEN_REPEAT");
+  if (!g_has_set_repeat && env_EIGEN_REPEAT) set_repeat_from_string(env_EIGEN_REPEAT);
+  char* env_EIGEN_SEED = getenv("EIGEN_SEED");
+  if (!g_has_set_seed && env_EIGEN_SEED) set_seed_from_string(env_EIGEN_SEED);
 
-    if(!g_has_set_seed) g_seed = (unsigned int) time(NULL);
-    if(!g_has_set_repeat) g_repeat = DEFAULT_REPEAT;
+  if (!g_has_set_seed) g_seed = (unsigned int)time(NULL);
+  if (!g_has_set_repeat) g_repeat = DEFAULT_REPEAT;
 
-    std::cout << "Initializing random number generator with seed " << g_seed << std::endl;
-    std::stringstream ss;
-    ss << "Seed: " << g_seed;
-    g_test_stack.push_back(ss.str());
-    srand(g_seed);
-    std::cout << "Repeating each test " << g_repeat << " times" << std::endl;
+  std::cout << "Initializing random number generator with seed " << g_seed << std::endl;
+  std::stringstream ss;
+  ss << "Seed: " << g_seed;
+  g_test_stack.push_back(ss.str());
+  srand(g_seed);
+  std::cout << "Repeating each test " << g_repeat << " times" << std::endl;
 
-    VERIFY(EigenTest::all().size()>0);
+  VERIFY(EigenTest::all().size() > 0);
 
-    for(std::size_t i=0; i<EigenTest::all().size(); ++i)
-    {
-      const EigenTest& current_test = *EigenTest::all()[i];
-      Eigen::g_test_stack.push_back(current_test.name());
-      current_test();
-      Eigen::g_test_stack.pop_back();
-    }
+  for (std::size_t i = 0; i < EigenTest::all().size(); ++i) {
+    const EigenTest& current_test = *EigenTest::all()[i];
+    Eigen::g_test_stack.push_back(current_test.name());
+    current_test();
+    Eigen::g_test_stack.pop_back();
+  }
 
-    return 0;
+  return 0;
 }
 
 // These warning are disabled here such that they are still ON when parsing Eigen's header files.
 #if defined __INTEL_COMPILER
-  // remark #383: value copied to temporary, reference to temporary used
-  //  -> this warning is raised even for legal usage as: g_test_stack.push_back("foo"); where g_test_stack is a std::vector<std::string>
-  // remark #1418: external function definition with no prior declaration
-  //  -> this warning is raised for all our test functions. Declaring them static would fix the issue.
-  // warning #279: controlling expression is constant
-  // remark #1572: floating-point equality and inequality comparisons are unreliable
-  #pragma warning disable 279 383 1418 1572
+// remark #383: value copied to temporary, reference to temporary used
+//  -> this warning is raised even for legal usage as: g_test_stack.push_back("foo"); where g_test_stack is a
+//  std::vector<std::string>
+// remark #1418: external function definition with no prior declaration
+//  -> this warning is raised for all our test functions. Declaring them static would fix the issue.
+// warning #279: controlling expression is constant
+// remark #1572: floating-point equality and inequality comparisons are unreliable
+#pragma warning disable 279 383 1418 1572
 #endif
 
 #ifdef _MSC_VER
-  // 4503 - decorated name length exceeded, name was truncated
-  #pragma warning( disable : 4503)
+// 4503 - decorated name length exceeded, name was truncated
+#pragma warning(disable : 4503)
 #endif
 
 #include "gpu_test_helper.h"
diff --git a/test/mapped_matrix.cpp b/test/mapped_matrix.cpp
index f4638f6..a8d17d9 100644
--- a/test/mapped_matrix.cpp
+++ b/test/mapped_matrix.cpp
@@ -11,24 +11,24 @@
 
 #define EIGEN_TESTMAP_MAX_SIZE 256
 
-template<typename VectorType> void map_class_vector(const VectorType& m)
-{
+template <typename VectorType>
+void map_class_vector(const VectorType& m) {
   typedef typename VectorType::Scalar Scalar;
 
   Index size = m.size();
 
   Scalar* array1 = internal::aligned_new<Scalar>(size);
   Scalar* array2 = internal::aligned_new<Scalar>(size);
-  Scalar* array3 = new Scalar[size+1];
+  Scalar* array3 = new Scalar[size + 1];
   // In case of no alignment, avoid division by zero.
   constexpr int alignment = (std::max<int>)(EIGEN_MAX_ALIGN_BYTES, 1);
-  Scalar* array3unaligned = (std::uintptr_t(array3)%alignment) == 0 ? array3+1 : array3;
-  Scalar  array4[EIGEN_TESTMAP_MAX_SIZE];
+  Scalar* array3unaligned = (std::uintptr_t(array3) % alignment) == 0 ? array3 + 1 : array3;
+  Scalar array4[EIGEN_TESTMAP_MAX_SIZE];
 
   Map<VectorType, AlignedMax>(array1, size) = VectorType::Random(size);
-  Map<VectorType, AlignedMax>(array2, size) = Map<VectorType,AlignedMax>(array1, size);
+  Map<VectorType, AlignedMax>(array2, size) = Map<VectorType, AlignedMax>(array1, size);
   Map<VectorType>(array3unaligned, size) = Map<VectorType>(array1, size);
-  Map<VectorType>(array4, size)          = Map<VectorType,AlignedMax>(array1, size);
+  Map<VectorType>(array4, size) = Map<VectorType, AlignedMax>(array1, size);
   VectorType ma1 = Map<VectorType, AlignedMax>(array1, size);
   VectorType ma2 = Map<VectorType, AlignedMax>(array2, size);
   VectorType ma3 = Map<VectorType>(array3unaligned, size);
@@ -36,48 +36,48 @@
   VERIFY_IS_EQUAL(ma1, ma2);
   VERIFY_IS_EQUAL(ma1, ma3);
   VERIFY_IS_EQUAL(ma1, ma4);
-  #ifdef EIGEN_VECTORIZE
-  if(internal::packet_traits<Scalar>::Vectorizable && size>=AlignedMax)
-    VERIFY_RAISES_ASSERT((Map<VectorType,AlignedMax>(array3unaligned, size)))
-  #endif
+#ifdef EIGEN_VECTORIZE
+  if (internal::packet_traits<Scalar>::Vectorizable && size >= AlignedMax)
+    VERIFY_RAISES_ASSERT((Map<VectorType, AlignedMax>(array3unaligned, size)))
+#endif
 
   internal::aligned_delete(array1, size);
   internal::aligned_delete(array2, size);
   delete[] array3;
 }
 
-template<typename MatrixType> void map_class_matrix(const MatrixType& m)
-{
+template <typename MatrixType>
+void map_class_matrix(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
 
-  Index rows = m.rows(), cols = m.cols(), size = rows*cols;
+  Index rows = m.rows(), cols = m.cols(), size = rows * cols;
   Scalar s1 = internal::random<Scalar>();
 
   // array1 and array2 -> aligned heap allocation
   Scalar* array1 = internal::aligned_new<Scalar>(size);
-  for(int i = 0; i < size; i++) array1[i] = Scalar(1);
+  for (int i = 0; i < size; i++) array1[i] = Scalar(1);
   Scalar* array2 = internal::aligned_new<Scalar>(size);
-  for(int i = 0; i < size; i++) array2[i] = Scalar(1);
+  for (int i = 0; i < size; i++) array2[i] = Scalar(1);
   // array3unaligned -> unaligned pointer to heap
-  Scalar* array3 = new Scalar[size+1];
-  Index sizep1 = size + 1; // <- without this temporary MSVC 2103 generates bad code
-  for(Index i = 0; i < sizep1; i++) array3[i] = Scalar(1);
-    // In case of no alignment, avoid division by zero.
+  Scalar* array3 = new Scalar[size + 1];
+  Index sizep1 = size + 1;  // <- without this temporary MSVC 2103 generates bad code
+  for (Index i = 0; i < sizep1; i++) array3[i] = Scalar(1);
+  // In case of no alignment, avoid division by zero.
   constexpr int alignment = (std::max<int>)(EIGEN_MAX_ALIGN_BYTES, 1);
-  Scalar* array3unaligned = (std::uintptr_t(array3)%alignment) == 0 ? array3+1 : array3;
+  Scalar* array3unaligned = (std::uintptr_t(array3) % alignment) == 0 ? array3 + 1 : array3;
   Scalar array4[256];
-  if(size<=256)
-    for(int i = 0; i < size; i++) array4[i] = Scalar(1);
+  if (size <= 256)
+    for (int i = 0; i < size; i++) array4[i] = Scalar(1);
 
   Map<MatrixType> map1(array1, rows, cols);
   Map<MatrixType, AlignedMax> map2(array2, rows, cols);
   Map<MatrixType> map3(array3unaligned, rows, cols);
   Map<MatrixType> map4(array4, rows, cols);
 
-  VERIFY_IS_EQUAL(map1, MatrixType::Ones(rows,cols));
-  VERIFY_IS_EQUAL(map2, MatrixType::Ones(rows,cols));
-  VERIFY_IS_EQUAL(map3, MatrixType::Ones(rows,cols));
-  map1 = MatrixType::Random(rows,cols);
+  VERIFY_IS_EQUAL(map1, MatrixType::Ones(rows, cols));
+  VERIFY_IS_EQUAL(map2, MatrixType::Ones(rows, cols));
+  VERIFY_IS_EQUAL(map3, MatrixType::Ones(rows, cols));
+  map1 = MatrixType::Random(rows, cols);
   map2 = map1;
   map3 = map1;
   MatrixType ma1 = map1;
@@ -89,28 +89,27 @@
   VERIFY_IS_EQUAL(ma1, ma3);
   VERIFY_IS_EQUAL(ma1, map3);
 
-  VERIFY_IS_APPROX(s1*map1, s1*map2);
-  VERIFY_IS_APPROX(s1*ma1, s1*ma2);
-  VERIFY_IS_EQUAL(s1*ma1, s1*ma3);
-  VERIFY_IS_APPROX(s1*map1, s1*map3);
+  VERIFY_IS_APPROX(s1 * map1, s1 * map2);
+  VERIFY_IS_APPROX(s1 * ma1, s1 * ma2);
+  VERIFY_IS_EQUAL(s1 * ma1, s1 * ma3);
+  VERIFY_IS_APPROX(s1 * map1, s1 * map3);
 
   map2 *= s1;
   map3 *= s1;
-  VERIFY_IS_APPROX(s1*map1, map2);
-  VERIFY_IS_APPROX(s1*map1, map3);
+  VERIFY_IS_APPROX(s1 * map1, map2);
+  VERIFY_IS_APPROX(s1 * map1, map3);
 
-  if(size<=256)
-  {
-    VERIFY_IS_EQUAL(map4, MatrixType::Ones(rows,cols));
+  if (size <= 256) {
+    VERIFY_IS_EQUAL(map4, MatrixType::Ones(rows, cols));
     map4 = map1;
     MatrixType ma4 = map4;
     VERIFY_IS_EQUAL(map1, map4);
     VERIFY_IS_EQUAL(ma1, map4);
     VERIFY_IS_EQUAL(ma1, ma4);
-    VERIFY_IS_APPROX(s1*map1, s1*map4);
+    VERIFY_IS_APPROX(s1 * map1, s1 * map4);
 
     map4 *= s1;
-    VERIFY_IS_APPROX(s1*map1, map4);
+    VERIFY_IS_APPROX(s1 * map1, map4);
   }
 
   internal::aligned_delete(array1, size);
@@ -118,18 +117,18 @@
   delete[] array3;
 }
 
-template<typename VectorType> void map_static_methods(const VectorType& m)
-{
+template <typename VectorType>
+void map_static_methods(const VectorType& m) {
   typedef typename VectorType::Scalar Scalar;
 
   Index size = m.size();
 
   Scalar* array1 = internal::aligned_new<Scalar>(size);
   Scalar* array2 = internal::aligned_new<Scalar>(size);
-  Scalar* array3 = new Scalar[size+1];
-    // In case of no alignment, avoid division by zero.
+  Scalar* array3 = new Scalar[size + 1];
+  // In case of no alignment, avoid division by zero.
   constexpr int alignment = (std::max<int>)(EIGEN_MAX_ALIGN_BYTES, 1);
-  Scalar* array3unaligned = (std::uintptr_t(array3)%alignment) == 0 ? array3+1 : array3;
+  Scalar* array3unaligned = (std::uintptr_t(array3) % alignment) == 0 ? array3 + 1 : array3;
 
   VectorType::MapAligned(array1, size) = VectorType::Random(size);
   VectorType::Map(array2, size) = VectorType::Map(array1, size);
@@ -145,43 +144,42 @@
   delete[] array3;
 }
 
-template<typename PlainObjectType> void check_const_correctness(const PlainObjectType&)
-{
+template <typename PlainObjectType>
+void check_const_correctness(const PlainObjectType&) {
   // there's a lot that we can't test here while still having this test compile!
   // the only possible approach would be to run a script trying to compile stuff and checking that it fails.
   // CMake can help with that.
 
   // verify that map-to-const don't have LvalueBit
   typedef std::add_const_t<PlainObjectType> ConstPlainObjectType;
-  VERIFY( !(internal::traits<Map<ConstPlainObjectType> >::Flags & LvalueBit) );
-  VERIFY( !(internal::traits<Map<ConstPlainObjectType, AlignedMax> >::Flags & LvalueBit) );
-  VERIFY( !(Map<ConstPlainObjectType>::Flags & LvalueBit) );
-  VERIFY( !(Map<ConstPlainObjectType, AlignedMax>::Flags & LvalueBit) );
+  VERIFY(!(internal::traits<Map<ConstPlainObjectType> >::Flags & LvalueBit));
+  VERIFY(!(internal::traits<Map<ConstPlainObjectType, AlignedMax> >::Flags & LvalueBit));
+  VERIFY(!(Map<ConstPlainObjectType>::Flags & LvalueBit));
+  VERIFY(!(Map<ConstPlainObjectType, AlignedMax>::Flags & LvalueBit));
 }
 
-EIGEN_DECLARE_TEST(mapped_matrix)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( map_class_vector(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_1( check_const_correctness(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( map_class_vector(Vector4d()) );
-    CALL_SUBTEST_2( map_class_vector(VectorXd(13)) );
-    CALL_SUBTEST_2( check_const_correctness(Matrix4d()) );
-    CALL_SUBTEST_3( map_class_vector(RowVector4f()) );
-    CALL_SUBTEST_4( map_class_vector(VectorXcf(8)) );
-    CALL_SUBTEST_5( map_class_vector(VectorXi(12)) );
-    CALL_SUBTEST_5( check_const_correctness(VectorXi(12)) );
+EIGEN_DECLARE_TEST(mapped_matrix) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(map_class_vector(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_1(check_const_correctness(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(map_class_vector(Vector4d()));
+    CALL_SUBTEST_2(map_class_vector(VectorXd(13)));
+    CALL_SUBTEST_2(check_const_correctness(Matrix4d()));
+    CALL_SUBTEST_3(map_class_vector(RowVector4f()));
+    CALL_SUBTEST_4(map_class_vector(VectorXcf(8)));
+    CALL_SUBTEST_5(map_class_vector(VectorXi(12)));
+    CALL_SUBTEST_5(check_const_correctness(VectorXi(12)));
 
-    CALL_SUBTEST_1( map_class_matrix(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( map_class_matrix(Matrix4d()) );
-    CALL_SUBTEST_11( map_class_matrix(Matrix<float,3,5>()) );
-    CALL_SUBTEST_4( map_class_matrix(MatrixXcf(internal::random<int>(1,10),internal::random<int>(1,10))) );
-    CALL_SUBTEST_5( map_class_matrix(MatrixXi(internal::random<int>(1,10),internal::random<int>(1,10))) );
+    CALL_SUBTEST_1(map_class_matrix(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(map_class_matrix(Matrix4d()));
+    CALL_SUBTEST_11(map_class_matrix(Matrix<float, 3, 5>()));
+    CALL_SUBTEST_4(map_class_matrix(MatrixXcf(internal::random<int>(1, 10), internal::random<int>(1, 10))));
+    CALL_SUBTEST_5(map_class_matrix(MatrixXi(internal::random<int>(1, 10), internal::random<int>(1, 10))));
 
-    CALL_SUBTEST_6( map_static_methods(Matrix<double, 1, 1>()) );
-    CALL_SUBTEST_7( map_static_methods(Vector3f()) );
-    CALL_SUBTEST_8( map_static_methods(RowVector3d()) );
-    CALL_SUBTEST_9( map_static_methods(VectorXcd(8)) );
-    CALL_SUBTEST_10( map_static_methods(VectorXf(12)) );
+    CALL_SUBTEST_6(map_static_methods(Matrix<double, 1, 1>()));
+    CALL_SUBTEST_7(map_static_methods(Vector3f()));
+    CALL_SUBTEST_8(map_static_methods(RowVector3d()));
+    CALL_SUBTEST_9(map_static_methods(VectorXcd(8)));
+    CALL_SUBTEST_10(map_static_methods(VectorXf(12)));
   }
 }
diff --git a/test/mapstaticmethods.cpp b/test/mapstaticmethods.cpp
index d0128ba..ac90bdc 100644
--- a/test/mapstaticmethods.cpp
+++ b/test/mapstaticmethods.cpp
@@ -12,24 +12,20 @@
 // GCC<=4.8 has spurious shadow warnings, because `ptr` re-appears inside template instantiations
 // workaround: put these in an anonymous namespace
 namespace {
-float *ptr;
-const float *const_ptr;
-}
+float* ptr;
+const float* const_ptr;
+}  // namespace
 
-template<typename PlainObjectType,
-         bool IsDynamicSize = PlainObjectType::SizeAtCompileTime == Dynamic,
-         bool IsVector = PlainObjectType::IsVectorAtCompileTime
->
+template <typename PlainObjectType, bool IsDynamicSize = PlainObjectType::SizeAtCompileTime == Dynamic,
+          bool IsVector = PlainObjectType::IsVectorAtCompileTime>
 struct mapstaticmethods_impl {};
 
-template<typename PlainObjectType, bool IsVector>
-struct mapstaticmethods_impl<PlainObjectType, false, IsVector>
-{
-  static void run(const PlainObjectType& m)
-  {
+template <typename PlainObjectType, bool IsVector>
+struct mapstaticmethods_impl<PlainObjectType, false, IsVector> {
+  static void run(const PlainObjectType& m) {
     mapstaticmethods_impl<PlainObjectType, true, IsVector>::run(m);
 
-    int i = internal::random<int>(2,5), j = internal::random<int>(2,5);
+    int i = internal::random<int>(2, 5), j = internal::random<int>(2, 5);
 
     PlainObjectType::Map(ptr).setZero();
     PlainObjectType::MapAligned(ptr).setZero();
@@ -56,26 +52,24 @@
     PlainObjectType::Map(const_ptr, OuterStride<4>()).sum();
     PlainObjectType::MapAligned(const_ptr, OuterStride<5>()).sum();
 
-    PlainObjectType::Map(ptr, Stride<Dynamic, Dynamic>(i,j)).setZero();
-    PlainObjectType::MapAligned(ptr, Stride<2,Dynamic>(2,i)).setZero();
-    PlainObjectType::Map(const_ptr, Stride<Dynamic,3>(i,3)).sum();
-    PlainObjectType::MapAligned(const_ptr, Stride<Dynamic, Dynamic>(i,j)).sum();
+    PlainObjectType::Map(ptr, Stride<Dynamic, Dynamic>(i, j)).setZero();
+    PlainObjectType::MapAligned(ptr, Stride<2, Dynamic>(2, i)).setZero();
+    PlainObjectType::Map(const_ptr, Stride<Dynamic, 3>(i, 3)).sum();
+    PlainObjectType::MapAligned(const_ptr, Stride<Dynamic, Dynamic>(i, j)).sum();
 
-    PlainObjectType::Map(ptr, Stride<2,3>()).setZero();
-    PlainObjectType::MapAligned(ptr, Stride<3,4>()).setZero();
-    PlainObjectType::Map(const_ptr, Stride<2,4>()).sum();
-    PlainObjectType::MapAligned(const_ptr, Stride<5,3>()).sum();
+    PlainObjectType::Map(ptr, Stride<2, 3>()).setZero();
+    PlainObjectType::MapAligned(ptr, Stride<3, 4>()).setZero();
+    PlainObjectType::Map(const_ptr, Stride<2, 4>()).sum();
+    PlainObjectType::MapAligned(const_ptr, Stride<5, 3>()).sum();
   }
 };
 
-template<typename PlainObjectType>
-struct mapstaticmethods_impl<PlainObjectType, true, false>
-{
-  static void run(const PlainObjectType& m)
-  {
+template <typename PlainObjectType>
+struct mapstaticmethods_impl<PlainObjectType, true, false> {
+  static void run(const PlainObjectType& m) {
     Index rows = m.rows(), cols = m.cols();
 
-    int i = internal::random<int>(2,5), j = internal::random<int>(2,5);
+    int i = internal::random<int>(2, 5), j = internal::random<int>(2, 5);
 
     PlainObjectType::Map(ptr, rows, cols).setZero();
     PlainObjectType::MapAligned(ptr, rows, cols).setZero();
@@ -102,26 +96,24 @@
     PlainObjectType::Map(const_ptr, rows, cols, OuterStride<4>()).sum();
     PlainObjectType::MapAligned(const_ptr, rows, cols, OuterStride<5>()).sum();
 
-    PlainObjectType::Map(ptr, rows, cols, Stride<Dynamic, Dynamic>(i,j)).setZero();
-    PlainObjectType::MapAligned(ptr, rows, cols, Stride<2,Dynamic>(2,i)).setZero();
-    PlainObjectType::Map(const_ptr, rows, cols, Stride<Dynamic,3>(i,3)).sum();
-    PlainObjectType::MapAligned(const_ptr, rows, cols, Stride<Dynamic, Dynamic>(i,j)).sum();
+    PlainObjectType::Map(ptr, rows, cols, Stride<Dynamic, Dynamic>(i, j)).setZero();
+    PlainObjectType::MapAligned(ptr, rows, cols, Stride<2, Dynamic>(2, i)).setZero();
+    PlainObjectType::Map(const_ptr, rows, cols, Stride<Dynamic, 3>(i, 3)).sum();
+    PlainObjectType::MapAligned(const_ptr, rows, cols, Stride<Dynamic, Dynamic>(i, j)).sum();
 
-    PlainObjectType::Map(ptr, rows, cols, Stride<2,3>()).setZero();
-    PlainObjectType::MapAligned(ptr, rows, cols, Stride<3,4>()).setZero();
-    PlainObjectType::Map(const_ptr, rows, cols, Stride<2,4>()).sum();
-    PlainObjectType::MapAligned(const_ptr, rows, cols, Stride<5,3>()).sum();
+    PlainObjectType::Map(ptr, rows, cols, Stride<2, 3>()).setZero();
+    PlainObjectType::MapAligned(ptr, rows, cols, Stride<3, 4>()).setZero();
+    PlainObjectType::Map(const_ptr, rows, cols, Stride<2, 4>()).sum();
+    PlainObjectType::MapAligned(const_ptr, rows, cols, Stride<5, 3>()).sum();
   }
 };
 
-template<typename PlainObjectType>
-struct mapstaticmethods_impl<PlainObjectType, true, true>
-{
-  static void run(const PlainObjectType& v)
-  {
+template <typename PlainObjectType>
+struct mapstaticmethods_impl<PlainObjectType, true, true> {
+  static void run(const PlainObjectType& v) {
     Index size = v.size();
 
-    int i = internal::random<int>(2,5);
+    int i = internal::random<int>(2, 5);
 
     PlainObjectType::Map(ptr, size).setZero();
     PlainObjectType::MapAligned(ptr, size).setZero();
@@ -140,38 +132,35 @@
   }
 };
 
-template<typename PlainObjectType>
-void mapstaticmethods(const PlainObjectType& m)
-{
+template <typename PlainObjectType>
+void mapstaticmethods(const PlainObjectType& m) {
   mapstaticmethods_impl<PlainObjectType>::run(m);
-  VERIFY(true); // just to avoid 'unused function' warning
+  VERIFY(true);  // just to avoid 'unused function' warning
 }
 
-EIGEN_DECLARE_TEST(mapstaticmethods)
-{
+EIGEN_DECLARE_TEST(mapstaticmethods) {
   ptr = internal::aligned_new<float>(1000);
-  for(int i = 0; i < 1000; i++) ptr[i] = float(i);
+  for (int i = 0; i < 1000; i++) ptr[i] = float(i);
 
   const_ptr = ptr;
 
-  CALL_SUBTEST_1(( mapstaticmethods(Matrix<float, 1, 1>()) ));
-  CALL_SUBTEST_1(( mapstaticmethods(Vector2f()) ));
-  CALL_SUBTEST_2(( mapstaticmethods(Vector3f()) ));
-  CALL_SUBTEST_2(( mapstaticmethods(Matrix2f()) ));
-  CALL_SUBTEST_3(( mapstaticmethods(Matrix4f()) ));
-  CALL_SUBTEST_3(( mapstaticmethods(Array4f()) ));
-  CALL_SUBTEST_4(( mapstaticmethods(Array3f()) ));
-  CALL_SUBTEST_4(( mapstaticmethods(Array33f()) ));
-  CALL_SUBTEST_5(( mapstaticmethods(Array44f()) ));
-  CALL_SUBTEST_5(( mapstaticmethods(VectorXf(1)) ));
-  CALL_SUBTEST_5(( mapstaticmethods(VectorXf(8)) ));
-  CALL_SUBTEST_6(( mapstaticmethods(MatrixXf(1,1)) ));
-  CALL_SUBTEST_6(( mapstaticmethods(MatrixXf(5,7)) ));
-  CALL_SUBTEST_7(( mapstaticmethods(ArrayXf(1)) ));
-  CALL_SUBTEST_7(( mapstaticmethods(ArrayXf(5)) ));
-  CALL_SUBTEST_8(( mapstaticmethods(ArrayXXf(1,1)) ));
-  CALL_SUBTEST_8(( mapstaticmethods(ArrayXXf(8,6)) ));
+  CALL_SUBTEST_1((mapstaticmethods(Matrix<float, 1, 1>())));
+  CALL_SUBTEST_1((mapstaticmethods(Vector2f())));
+  CALL_SUBTEST_2((mapstaticmethods(Vector3f())));
+  CALL_SUBTEST_2((mapstaticmethods(Matrix2f())));
+  CALL_SUBTEST_3((mapstaticmethods(Matrix4f())));
+  CALL_SUBTEST_3((mapstaticmethods(Array4f())));
+  CALL_SUBTEST_4((mapstaticmethods(Array3f())));
+  CALL_SUBTEST_4((mapstaticmethods(Array33f())));
+  CALL_SUBTEST_5((mapstaticmethods(Array44f())));
+  CALL_SUBTEST_5((mapstaticmethods(VectorXf(1))));
+  CALL_SUBTEST_5((mapstaticmethods(VectorXf(8))));
+  CALL_SUBTEST_6((mapstaticmethods(MatrixXf(1, 1))));
+  CALL_SUBTEST_6((mapstaticmethods(MatrixXf(5, 7))));
+  CALL_SUBTEST_7((mapstaticmethods(ArrayXf(1))));
+  CALL_SUBTEST_7((mapstaticmethods(ArrayXf(5))));
+  CALL_SUBTEST_8((mapstaticmethods(ArrayXXf(1, 1))));
+  CALL_SUBTEST_8((mapstaticmethods(ArrayXXf(8, 6))));
 
   internal::aligned_delete(ptr, 1000);
 }
-
diff --git a/test/mapstride.cpp b/test/mapstride.cpp
index 107e1e3..224316f 100644
--- a/test/mapstride.cpp
+++ b/test/mapstride.cpp
@@ -9,27 +9,28 @@
 
 #include "main.h"
 
-template<int Alignment,typename VectorType> void map_class_vector(const VectorType& m)
-{
+template <int Alignment, typename VectorType>
+void map_class_vector(const VectorType& m) {
   typedef typename VectorType::Scalar Scalar;
 
   Index size = m.size();
 
   VectorType v = VectorType::Random(size);
 
-  Index arraysize = 3*size;
-  
-  Scalar* a_array = internal::aligned_new<Scalar>(arraysize+1);
+  Index arraysize = 3 * size;
+
+  Scalar* a_array = internal::aligned_new<Scalar>(arraysize + 1);
   Scalar* array = a_array;
-  if(Alignment!=Aligned)
-    array = (Scalar*)(std::intptr_t(a_array) + (internal::packet_traits<Scalar>::AlignedOnScalar?sizeof(Scalar):sizeof(typename NumTraits<Scalar>::Real)));
+  if (Alignment != Aligned)
+    array = (Scalar*)(std::intptr_t(a_array) + (internal::packet_traits<Scalar>::AlignedOnScalar
+                                                    ? sizeof(Scalar)
+                                                    : sizeof(typename NumTraits<Scalar>::Real)));
 
   {
     Map<VectorType, Alignment, InnerStride<3> > map(array, size);
     map = v;
-    for(int i = 0; i < size; ++i)
-    {
-      VERIFY_IS_EQUAL(array[3*i], v[i]);
+    for (int i = 0; i < size; ++i) {
+      VERIFY_IS_EQUAL(array[3 * i], v[i]);
       VERIFY_IS_EQUAL(map[i], v[i]);
     }
   }
@@ -37,227 +38,230 @@
   {
     Map<VectorType, Unaligned, InnerStride<Dynamic> > map(array, size, InnerStride<Dynamic>(2));
     map = v;
-    for(int i = 0; i < size; ++i)
-    {
-      VERIFY_IS_EQUAL(array[2*i], v[i]);
+    for (int i = 0; i < size; ++i) {
+      VERIFY_IS_EQUAL(array[2 * i], v[i]);
       VERIFY_IS_EQUAL(map[i], v[i]);
     }
   }
 
-  internal::aligned_delete(a_array, arraysize+1);
+  internal::aligned_delete(a_array, arraysize + 1);
 }
 
-template<int Alignment,typename MatrixType> void map_class_matrix(const MatrixType& _m)
-{
+template <int Alignment, typename MatrixType>
+void map_class_matrix(const MatrixType& _m) {
   typedef typename MatrixType::Scalar Scalar;
 
   Index rows = _m.rows(), cols = _m.cols();
 
-  MatrixType m = MatrixType::Random(rows,cols);
+  MatrixType m = MatrixType::Random(rows, cols);
   Scalar s1 = internal::random<Scalar>();
 
-  Index arraysize = 4*(rows+4)*(cols+4);
+  Index arraysize = 4 * (rows + 4) * (cols + 4);
 
-  Scalar* a_array1 = internal::aligned_new<Scalar>(arraysize+1);
+  Scalar* a_array1 = internal::aligned_new<Scalar>(arraysize + 1);
   Scalar* array1 = a_array1;
-  if(Alignment!=Aligned)
-    array1 = (Scalar*)(std::intptr_t(a_array1) + (internal::packet_traits<Scalar>::AlignedOnScalar?sizeof(Scalar):sizeof(typename NumTraits<Scalar>::Real)));
+  if (Alignment != Aligned)
+    array1 = (Scalar*)(std::intptr_t(a_array1) + (internal::packet_traits<Scalar>::AlignedOnScalar
+                                                      ? sizeof(Scalar)
+                                                      : sizeof(typename NumTraits<Scalar>::Real)));
 
   Scalar a_array2[256];
   Scalar* array2 = a_array2;
-  if(Alignment!=Aligned) {
-    array2 = (Scalar*)(std::intptr_t(a_array2) + (internal::packet_traits<Scalar>::AlignedOnScalar?sizeof(Scalar):sizeof(typename NumTraits<Scalar>::Real)));
+  if (Alignment != Aligned) {
+    array2 = (Scalar*)(std::intptr_t(a_array2) + (internal::packet_traits<Scalar>::AlignedOnScalar
+                                                      ? sizeof(Scalar)
+                                                      : sizeof(typename NumTraits<Scalar>::Real)));
   } else {
     // In case there is no alignment, default to pointing to the start.
     constexpr int alignment = (std::max<int>)(EIGEN_MAX_ALIGN_BYTES, 1);
-    array2 = (Scalar*)(((std::uintptr_t(a_array2)+alignment-1)/alignment)*alignment);
+    array2 = (Scalar*)(((std::uintptr_t(a_array2) + alignment - 1) / alignment) * alignment);
   }
   Index maxsize2 = a_array2 - array2 + 256;
-  
+
   // test no inner stride and some dynamic outer stride
-  for(int k=0; k<2; ++k)
-  {
-    if(k==1 && (m.innerSize()+1)*m.outerSize() > maxsize2)
-      break;
-    Scalar* array = (k==0 ? array1 : array2);
-    
-    Map<MatrixType, Alignment, OuterStride<Dynamic> > map(array, rows, cols, OuterStride<Dynamic>(m.innerSize()+1));
+  for (int k = 0; k < 2; ++k) {
+    if (k == 1 && (m.innerSize() + 1) * m.outerSize() > maxsize2) break;
+    Scalar* array = (k == 0 ? array1 : array2);
+
+    Map<MatrixType, Alignment, OuterStride<Dynamic> > map(array, rows, cols, OuterStride<Dynamic>(m.innerSize() + 1));
     map = m;
-    VERIFY(map.outerStride() == map.innerSize()+1);
-    for(int i = 0; i < m.outerSize(); ++i)
-      for(int j = 0; j < m.innerSize(); ++j)
-      {
-        VERIFY_IS_EQUAL(array[map.outerStride()*i+j], m.coeffByOuterInner(i,j));
-        VERIFY_IS_EQUAL(map.coeffByOuterInner(i,j), m.coeffByOuterInner(i,j));
+    VERIFY(map.outerStride() == map.innerSize() + 1);
+    for (int i = 0; i < m.outerSize(); ++i)
+      for (int j = 0; j < m.innerSize(); ++j) {
+        VERIFY_IS_EQUAL(array[map.outerStride() * i + j], m.coeffByOuterInner(i, j));
+        VERIFY_IS_EQUAL(map.coeffByOuterInner(i, j), m.coeffByOuterInner(i, j));
       }
-    VERIFY_IS_APPROX(s1*map,s1*m);
+    VERIFY_IS_APPROX(s1 * map, s1 * m);
     map *= s1;
-    VERIFY_IS_APPROX(map,s1*m);
+    VERIFY_IS_APPROX(map, s1 * m);
   }
 
   // test no inner stride and an outer stride of +4. This is quite important as for fixed-size matrices,
   // this allows to hit the special case where it's vectorizable.
-  for(int k=0; k<2; ++k)
-  {
-    if(k==1 && (m.innerSize()+4)*m.outerSize() > maxsize2)
-      break;
-    Scalar* array = (k==0 ? array1 : array2);
-    
+  for (int k = 0; k < 2; ++k) {
+    if (k == 1 && (m.innerSize() + 4) * m.outerSize() > maxsize2) break;
+    Scalar* array = (k == 0 ? array1 : array2);
+
     enum {
       InnerSize = MatrixType::InnerSizeAtCompileTime,
-      OuterStrideAtCompileTime = InnerSize==Dynamic ? Dynamic : InnerSize+4
+      OuterStrideAtCompileTime = InnerSize == Dynamic ? Dynamic : InnerSize + 4
     };
-    Map<MatrixType, Alignment, OuterStride<OuterStrideAtCompileTime> >
-      map(array, rows, cols, OuterStride<OuterStrideAtCompileTime>(m.innerSize()+4));
+    Map<MatrixType, Alignment, OuterStride<OuterStrideAtCompileTime> > map(
+        array, rows, cols, OuterStride<OuterStrideAtCompileTime>(m.innerSize() + 4));
     map = m;
-    VERIFY(map.outerStride() == map.innerSize()+4);
-    for(int i = 0; i < m.outerSize(); ++i)
-      for(int j = 0; j < m.innerSize(); ++j)
-      {
-        VERIFY_IS_EQUAL(array[map.outerStride()*i+j], m.coeffByOuterInner(i,j));
-        VERIFY_IS_EQUAL(map.coeffByOuterInner(i,j), m.coeffByOuterInner(i,j));
+    VERIFY(map.outerStride() == map.innerSize() + 4);
+    for (int i = 0; i < m.outerSize(); ++i)
+      for (int j = 0; j < m.innerSize(); ++j) {
+        VERIFY_IS_EQUAL(array[map.outerStride() * i + j], m.coeffByOuterInner(i, j));
+        VERIFY_IS_EQUAL(map.coeffByOuterInner(i, j), m.coeffByOuterInner(i, j));
       }
-    VERIFY_IS_APPROX(s1*map,s1*m);
+    VERIFY_IS_APPROX(s1 * map, s1 * m);
     map *= s1;
-    VERIFY_IS_APPROX(map,s1*m);
+    VERIFY_IS_APPROX(map, s1 * m);
   }
 
   // test both inner stride and outer stride
-  for(int k=0; k<2; ++k)
-  {
-    if(k==1 && (2*m.innerSize()+1)*(m.outerSize()*2) > maxsize2)
-      break;
-    Scalar* array = (k==0 ? array1 : array2);
-    
-    Map<MatrixType, Alignment, Stride<Dynamic,Dynamic> > map(array, rows, cols, Stride<Dynamic,Dynamic>(2*m.innerSize()+1, 2));
+  for (int k = 0; k < 2; ++k) {
+    if (k == 1 && (2 * m.innerSize() + 1) * (m.outerSize() * 2) > maxsize2) break;
+    Scalar* array = (k == 0 ? array1 : array2);
+
+    Map<MatrixType, Alignment, Stride<Dynamic, Dynamic> > map(array, rows, cols,
+                                                              Stride<Dynamic, Dynamic>(2 * m.innerSize() + 1, 2));
     map = m;
-    VERIFY(map.outerStride() == 2*map.innerSize()+1);
+    VERIFY(map.outerStride() == 2 * map.innerSize() + 1);
     VERIFY(map.innerStride() == 2);
-    for(int i = 0; i < m.outerSize(); ++i)
-      for(int j = 0; j < m.innerSize(); ++j)
-      {
-        VERIFY_IS_EQUAL(array[map.outerStride()*i+map.innerStride()*j], m.coeffByOuterInner(i,j));
-        VERIFY_IS_EQUAL(map.coeffByOuterInner(i,j), m.coeffByOuterInner(i,j));
+    for (int i = 0; i < m.outerSize(); ++i)
+      for (int j = 0; j < m.innerSize(); ++j) {
+        VERIFY_IS_EQUAL(array[map.outerStride() * i + map.innerStride() * j], m.coeffByOuterInner(i, j));
+        VERIFY_IS_EQUAL(map.coeffByOuterInner(i, j), m.coeffByOuterInner(i, j));
       }
-    VERIFY_IS_APPROX(s1*map,s1*m);
+    VERIFY_IS_APPROX(s1 * map, s1 * m);
     map *= s1;
-    VERIFY_IS_APPROX(map,s1*m);
+    VERIFY_IS_APPROX(map, s1 * m);
   }
 
   // test inner stride and no outer stride
-  for(int k=0; k<2; ++k)
-  {
-    if(k==1 && (m.innerSize()*2)*m.outerSize() > maxsize2)
-      break;
-    Scalar* array = (k==0 ? array1 : array2);
+  for (int k = 0; k < 2; ++k) {
+    if (k == 1 && (m.innerSize() * 2) * m.outerSize() > maxsize2) break;
+    Scalar* array = (k == 0 ? array1 : array2);
 
     Map<MatrixType, Alignment, InnerStride<Dynamic> > map(array, rows, cols, InnerStride<Dynamic>(2));
     map = m;
-    VERIFY(map.outerStride() == map.innerSize()*2);
-    for(int i = 0; i < m.outerSize(); ++i)
-      for(int j = 0; j < m.innerSize(); ++j)
-      {
-        VERIFY_IS_EQUAL(array[map.innerSize()*i*2+j*2], m.coeffByOuterInner(i,j));
-        VERIFY_IS_EQUAL(map.coeffByOuterInner(i,j), m.coeffByOuterInner(i,j));
+    VERIFY(map.outerStride() == map.innerSize() * 2);
+    for (int i = 0; i < m.outerSize(); ++i)
+      for (int j = 0; j < m.innerSize(); ++j) {
+        VERIFY_IS_EQUAL(array[map.innerSize() * i * 2 + j * 2], m.coeffByOuterInner(i, j));
+        VERIFY_IS_EQUAL(map.coeffByOuterInner(i, j), m.coeffByOuterInner(i, j));
       }
-    VERIFY_IS_APPROX(s1*map,s1*m);
+    VERIFY_IS_APPROX(s1 * map, s1 * m);
     map *= s1;
-    VERIFY_IS_APPROX(map,s1*m);
+    VERIFY_IS_APPROX(map, s1 * m);
   }
 
   // test negative strides
   {
-    Matrix<Scalar,Dynamic,1>::Map(a_array1, arraysize+1).setRandom();
-    Index outerstride = m.innerSize()+4;
+    Matrix<Scalar, Dynamic, 1>::Map(a_array1, arraysize + 1).setRandom();
+    Index outerstride = m.innerSize() + 4;
     Scalar* array = array1;
 
     {
-      Map<MatrixType, Alignment, OuterStride<> > map1(array, rows, cols, OuterStride<>( outerstride));
-      Map<MatrixType, Unaligned, OuterStride<> > map2(array+(m.outerSize()-1)*outerstride, rows, cols, OuterStride<>(-outerstride));
-      if(MatrixType::IsRowMajor)  VERIFY_IS_APPROX(map1.colwise().reverse(), map2);
-      else                        VERIFY_IS_APPROX(map1.rowwise().reverse(), map2);
+      Map<MatrixType, Alignment, OuterStride<> > map1(array, rows, cols, OuterStride<>(outerstride));
+      Map<MatrixType, Unaligned, OuterStride<> > map2(array + (m.outerSize() - 1) * outerstride, rows, cols,
+                                                      OuterStride<>(-outerstride));
+      if (MatrixType::IsRowMajor)
+        VERIFY_IS_APPROX(map1.colwise().reverse(), map2);
+      else
+        VERIFY_IS_APPROX(map1.rowwise().reverse(), map2);
     }
 
     {
-      Map<MatrixType, Alignment, OuterStride<> > map1(array, rows, cols, OuterStride<>( outerstride));
-      Map<MatrixType, Unaligned, Stride<Dynamic,Dynamic> > map2(array+(m.outerSize()-1)*outerstride+m.innerSize()-1, rows, cols, Stride<Dynamic,Dynamic>(-outerstride,-1));
+      Map<MatrixType, Alignment, OuterStride<> > map1(array, rows, cols, OuterStride<>(outerstride));
+      Map<MatrixType, Unaligned, Stride<Dynamic, Dynamic> > map2(
+          array + (m.outerSize() - 1) * outerstride + m.innerSize() - 1, rows, cols,
+          Stride<Dynamic, Dynamic>(-outerstride, -1));
       VERIFY_IS_APPROX(map1.reverse(), map2);
     }
 
     {
-      Map<MatrixType, Alignment, OuterStride<> > map1(array, rows, cols, OuterStride<>( outerstride));
-      Map<MatrixType, Unaligned, Stride<Dynamic,-1> > map2(array+(m.outerSize()-1)*outerstride+m.innerSize()-1, rows, cols, Stride<Dynamic,-1>(-outerstride,-1));
+      Map<MatrixType, Alignment, OuterStride<> > map1(array, rows, cols, OuterStride<>(outerstride));
+      Map<MatrixType, Unaligned, Stride<Dynamic, -1> > map2(
+          array + (m.outerSize() - 1) * outerstride + m.innerSize() - 1, rows, cols,
+          Stride<Dynamic, -1>(-outerstride, -1));
       VERIFY_IS_APPROX(map1.reverse(), map2);
     }
   }
 
-  internal::aligned_delete(a_array1, arraysize+1);
+  internal::aligned_delete(a_array1, arraysize + 1);
 }
 
 // Additional tests for inner-stride but no outer-stride
-template<int>
-void bug1453()
-{
-  const int data[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31};
-  typedef Matrix<int,Dynamic,Dynamic,RowMajor> RowMatrixXi;
-  typedef Matrix<int,2,3,ColMajor> ColMatrix23i;
-  typedef Matrix<int,3,2,ColMajor> ColMatrix32i;
-  typedef Matrix<int,2,3,RowMajor> RowMatrix23i;
-  typedef Matrix<int,3,2,RowMajor> RowMatrix32i;
+template <int>
+void bug1453() {
+  const int data[] = {0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
+                      16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31};
+  typedef Matrix<int, Dynamic, Dynamic, RowMajor> RowMatrixXi;
+  typedef Matrix<int, 2, 3, ColMajor> ColMatrix23i;
+  typedef Matrix<int, 3, 2, ColMajor> ColMatrix32i;
+  typedef Matrix<int, 2, 3, RowMajor> RowMatrix23i;
+  typedef Matrix<int, 3, 2, RowMajor> RowMatrix32i;
 
-  VERIFY_IS_APPROX(MatrixXi::Map(data, 2, 3, InnerStride<2>()), MatrixXi::Map(data, 2, 3, Stride<4,2>()));
-  VERIFY_IS_APPROX(MatrixXi::Map(data, 2, 3, InnerStride<>(2)), MatrixXi::Map(data, 2, 3, Stride<4,2>()));
-  VERIFY_IS_APPROX(MatrixXi::Map(data, 3, 2, InnerStride<2>()), MatrixXi::Map(data, 3, 2, Stride<6,2>()));
-  VERIFY_IS_APPROX(MatrixXi::Map(data, 3, 2, InnerStride<>(2)), MatrixXi::Map(data, 3, 2, Stride<6,2>()));
+  VERIFY_IS_APPROX(MatrixXi::Map(data, 2, 3, InnerStride<2>()), MatrixXi::Map(data, 2, 3, Stride<4, 2>()));
+  VERIFY_IS_APPROX(MatrixXi::Map(data, 2, 3, InnerStride<>(2)), MatrixXi::Map(data, 2, 3, Stride<4, 2>()));
+  VERIFY_IS_APPROX(MatrixXi::Map(data, 3, 2, InnerStride<2>()), MatrixXi::Map(data, 3, 2, Stride<6, 2>()));
+  VERIFY_IS_APPROX(MatrixXi::Map(data, 3, 2, InnerStride<>(2)), MatrixXi::Map(data, 3, 2, Stride<6, 2>()));
 
-  VERIFY_IS_APPROX(RowMatrixXi::Map(data, 2, 3, InnerStride<2>()), RowMatrixXi::Map(data, 2, 3, Stride<6,2>()));
-  VERIFY_IS_APPROX(RowMatrixXi::Map(data, 2, 3, InnerStride<>(2)), RowMatrixXi::Map(data, 2, 3, Stride<6,2>()));
-  VERIFY_IS_APPROX(RowMatrixXi::Map(data, 3, 2, InnerStride<2>()), RowMatrixXi::Map(data, 3, 2, Stride<4,2>()));
-  VERIFY_IS_APPROX(RowMatrixXi::Map(data, 3, 2, InnerStride<>(2)), RowMatrixXi::Map(data, 3, 2, Stride<4,2>()));
+  VERIFY_IS_APPROX(RowMatrixXi::Map(data, 2, 3, InnerStride<2>()), RowMatrixXi::Map(data, 2, 3, Stride<6, 2>()));
+  VERIFY_IS_APPROX(RowMatrixXi::Map(data, 2, 3, InnerStride<>(2)), RowMatrixXi::Map(data, 2, 3, Stride<6, 2>()));
+  VERIFY_IS_APPROX(RowMatrixXi::Map(data, 3, 2, InnerStride<2>()), RowMatrixXi::Map(data, 3, 2, Stride<4, 2>()));
+  VERIFY_IS_APPROX(RowMatrixXi::Map(data, 3, 2, InnerStride<>(2)), RowMatrixXi::Map(data, 3, 2, Stride<4, 2>()));
 
-  VERIFY_IS_APPROX(ColMatrix23i::Map(data, InnerStride<2>()), MatrixXi::Map(data, 2, 3, Stride<4,2>()));
-  VERIFY_IS_APPROX(ColMatrix23i::Map(data, InnerStride<>(2)), MatrixXi::Map(data, 2, 3, Stride<4,2>()));
-  VERIFY_IS_APPROX(ColMatrix32i::Map(data, InnerStride<2>()), MatrixXi::Map(data, 3, 2, Stride<6,2>()));
-  VERIFY_IS_APPROX(ColMatrix32i::Map(data, InnerStride<>(2)), MatrixXi::Map(data, 3, 2, Stride<6,2>()));
+  VERIFY_IS_APPROX(ColMatrix23i::Map(data, InnerStride<2>()), MatrixXi::Map(data, 2, 3, Stride<4, 2>()));
+  VERIFY_IS_APPROX(ColMatrix23i::Map(data, InnerStride<>(2)), MatrixXi::Map(data, 2, 3, Stride<4, 2>()));
+  VERIFY_IS_APPROX(ColMatrix32i::Map(data, InnerStride<2>()), MatrixXi::Map(data, 3, 2, Stride<6, 2>()));
+  VERIFY_IS_APPROX(ColMatrix32i::Map(data, InnerStride<>(2)), MatrixXi::Map(data, 3, 2, Stride<6, 2>()));
 
-  VERIFY_IS_APPROX(RowMatrix23i::Map(data, InnerStride<2>()), RowMatrixXi::Map(data, 2, 3, Stride<6,2>()));
-  VERIFY_IS_APPROX(RowMatrix23i::Map(data, InnerStride<>(2)), RowMatrixXi::Map(data, 2, 3, Stride<6,2>()));
-  VERIFY_IS_APPROX(RowMatrix32i::Map(data, InnerStride<2>()), RowMatrixXi::Map(data, 3, 2, Stride<4,2>()));
-  VERIFY_IS_APPROX(RowMatrix32i::Map(data, InnerStride<>(2)), RowMatrixXi::Map(data, 3, 2, Stride<4,2>()));
+  VERIFY_IS_APPROX(RowMatrix23i::Map(data, InnerStride<2>()), RowMatrixXi::Map(data, 2, 3, Stride<6, 2>()));
+  VERIFY_IS_APPROX(RowMatrix23i::Map(data, InnerStride<>(2)), RowMatrixXi::Map(data, 2, 3, Stride<6, 2>()));
+  VERIFY_IS_APPROX(RowMatrix32i::Map(data, InnerStride<2>()), RowMatrixXi::Map(data, 3, 2, Stride<4, 2>()));
+  VERIFY_IS_APPROX(RowMatrix32i::Map(data, InnerStride<>(2)), RowMatrixXi::Map(data, 3, 2, Stride<4, 2>()));
 }
 
-EIGEN_DECLARE_TEST(mapstride)
-{
-  for(int i = 0; i < g_repeat; i++) {
+EIGEN_DECLARE_TEST(mapstride) {
+  for (int i = 0; i < g_repeat; i++) {
     int maxn = 3;
-    CALL_SUBTEST_1( map_class_vector<Aligned>(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_1( map_class_vector<Unaligned>(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( map_class_vector<Aligned>(Vector4d()) );
-    CALL_SUBTEST_2( map_class_vector<Unaligned>(Vector4d()) );
-    CALL_SUBTEST_3( map_class_vector<Aligned>(RowVector4f()) );
-    CALL_SUBTEST_3( map_class_vector<Unaligned>(RowVector4f()) );
-    CALL_SUBTEST_4( map_class_vector<Aligned>(VectorXcf(internal::random<int>(1,maxn))) );
-    CALL_SUBTEST_4( map_class_vector<Unaligned>(VectorXcf(internal::random<int>(1,maxn))) );
-    CALL_SUBTEST_5( map_class_vector<Aligned>(VectorXi(internal::random<int>(1,maxn))) );
-    CALL_SUBTEST_5( map_class_vector<Unaligned>(VectorXi(internal::random<int>(1,maxn))) );
+    CALL_SUBTEST_1(map_class_vector<Aligned>(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_1(map_class_vector<Unaligned>(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(map_class_vector<Aligned>(Vector4d()));
+    CALL_SUBTEST_2(map_class_vector<Unaligned>(Vector4d()));
+    CALL_SUBTEST_3(map_class_vector<Aligned>(RowVector4f()));
+    CALL_SUBTEST_3(map_class_vector<Unaligned>(RowVector4f()));
+    CALL_SUBTEST_4(map_class_vector<Aligned>(VectorXcf(internal::random<int>(1, maxn))));
+    CALL_SUBTEST_4(map_class_vector<Unaligned>(VectorXcf(internal::random<int>(1, maxn))));
+    CALL_SUBTEST_5(map_class_vector<Aligned>(VectorXi(internal::random<int>(1, maxn))));
+    CALL_SUBTEST_5(map_class_vector<Unaligned>(VectorXi(internal::random<int>(1, maxn))));
 
-    CALL_SUBTEST_1( map_class_matrix<Aligned>(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_1( map_class_matrix<Unaligned>(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( map_class_matrix<Aligned>(Matrix4d()) );
-    CALL_SUBTEST_2( map_class_matrix<Unaligned>(Matrix4d()) );
-    CALL_SUBTEST_3( map_class_matrix<Aligned>(Matrix<float,3,5>()) );
-    CALL_SUBTEST_3( map_class_matrix<Unaligned>(Matrix<float,3,5>()) );
-    CALL_SUBTEST_3( map_class_matrix<Aligned>(Matrix<float,4,8>()) );
-    CALL_SUBTEST_3( map_class_matrix<Unaligned>(Matrix<float,4,8>()) );
-    CALL_SUBTEST_4( map_class_matrix<Aligned>(MatrixXcf(internal::random<int>(1,maxn),internal::random<int>(1,maxn))) );
-    CALL_SUBTEST_4( map_class_matrix<Unaligned>(MatrixXcf(internal::random<int>(1,maxn),internal::random<int>(1,maxn))) );
-    CALL_SUBTEST_5( map_class_matrix<Aligned>(MatrixXi(internal::random<int>(1,maxn),internal::random<int>(1,maxn))) );
-    CALL_SUBTEST_5( map_class_matrix<Unaligned>(MatrixXi(internal::random<int>(1,maxn),internal::random<int>(1,maxn))) );
-    CALL_SUBTEST_6( map_class_matrix<Aligned>(MatrixXcd(internal::random<int>(1,maxn),internal::random<int>(1,maxn))) );
-    CALL_SUBTEST_6( map_class_matrix<Unaligned>(MatrixXcd(internal::random<int>(1,maxn),internal::random<int>(1,maxn))) );
+    CALL_SUBTEST_1(map_class_matrix<Aligned>(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_1(map_class_matrix<Unaligned>(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(map_class_matrix<Aligned>(Matrix4d()));
+    CALL_SUBTEST_2(map_class_matrix<Unaligned>(Matrix4d()));
+    CALL_SUBTEST_3(map_class_matrix<Aligned>(Matrix<float, 3, 5>()));
+    CALL_SUBTEST_3(map_class_matrix<Unaligned>(Matrix<float, 3, 5>()));
+    CALL_SUBTEST_3(map_class_matrix<Aligned>(Matrix<float, 4, 8>()));
+    CALL_SUBTEST_3(map_class_matrix<Unaligned>(Matrix<float, 4, 8>()));
+    CALL_SUBTEST_4(
+        map_class_matrix<Aligned>(MatrixXcf(internal::random<int>(1, maxn), internal::random<int>(1, maxn))));
+    CALL_SUBTEST_4(
+        map_class_matrix<Unaligned>(MatrixXcf(internal::random<int>(1, maxn), internal::random<int>(1, maxn))));
+    CALL_SUBTEST_5(map_class_matrix<Aligned>(MatrixXi(internal::random<int>(1, maxn), internal::random<int>(1, maxn))));
+    CALL_SUBTEST_5(
+        map_class_matrix<Unaligned>(MatrixXi(internal::random<int>(1, maxn), internal::random<int>(1, maxn))));
+    CALL_SUBTEST_6(
+        map_class_matrix<Aligned>(MatrixXcd(internal::random<int>(1, maxn), internal::random<int>(1, maxn))));
+    CALL_SUBTEST_6(
+        map_class_matrix<Unaligned>(MatrixXcd(internal::random<int>(1, maxn), internal::random<int>(1, maxn))));
 
-    CALL_SUBTEST_5( bug1453<0>() );
-    
+    CALL_SUBTEST_5(bug1453<0>());
+
     TEST_SET_BUT_UNUSED_VARIABLE(maxn);
   }
 }
diff --git a/test/maxsizevector.cpp b/test/maxsizevector.cpp
index 084ea13..7fe691a 100644
--- a/test/maxsizevector.cpp
+++ b/test/maxsizevector.cpp
@@ -4,31 +4,30 @@
 
 #include <Eigen/src/Core/util/MaxSizeVector.h>
 
-struct Foo
-{
+struct Foo {
   static Index object_count;
   static Index object_limit;
   EIGEN_ALIGN_TO_BOUNDARY(128) int dummy;
 
-  Foo(int x=0) : dummy(x)
-  {
+  Foo(int x = 0) : dummy(x) {
 #ifdef EIGEN_EXCEPTIONS
     // TODO: Is this the correct way to handle this?
-    if (Foo::object_count > Foo::object_limit) { std::cout << "\nThrow!\n"; throw Foo::Fail(); }
+    if (Foo::object_count > Foo::object_limit) {
+      std::cout << "\nThrow!\n";
+      throw Foo::Fail();
+    }
 #endif
     std::cout << '+';
     ++Foo::object_count;
     eigen_assert((std::uintptr_t(this) & (127)) == 0);
   }
-  Foo(const Foo&)
-  {
+  Foo(const Foo&) {
     std::cout << 'c';
     ++Foo::object_count;
     eigen_assert((std::uintptr_t(this) & (127)) == 0);
   }
 
-  ~Foo()
-  {
+  ~Foo() {
     std::cout << '~';
     --Foo::object_count;
   }
@@ -39,35 +38,31 @@
 Index Foo::object_count = 0;
 Index Foo::object_limit = 0;
 
-
-
-EIGEN_DECLARE_TEST(cxx11_maxsizevector)
-{
+EIGEN_DECLARE_TEST(cxx11_maxsizevector) {
   typedef MaxSizeVector<Foo> VectorX;
   Foo::object_count = 0;
-  for(int r = 0; r < g_repeat; r++) {
-    Index rows = internal::random<Index>(3,30);
+  for (int r = 0; r < g_repeat; r++) {
+    Index rows = internal::random<Index>(3, 30);
     Foo::object_limit = internal::random<Index>(0, rows - 2);
     std::cout << "object_limit = " << Foo::object_limit << std::endl;
     bool exception_raised = false;
 #ifdef EIGEN_EXCEPTIONS
-    try
-    {
+    try {
 #endif
-      std::cout <<       "\nVectorX m(" << rows << ");\n";
+      std::cout << "\nVectorX m(" << rows << ");\n";
       VectorX vect(rows);
-      for(int i=0; i<rows; ++i)
-          vect.push_back(Foo());
+      for (int i = 0; i < rows; ++i) vect.push_back(Foo());
 #ifdef EIGEN_EXCEPTIONS
       VERIFY(false);  // not reached if exceptions are enabled
+    } catch (const Foo::Fail&) {
+      exception_raised = true;
     }
-    catch (const Foo::Fail&) { exception_raised = true; }
     VERIFY(exception_raised);
 #endif
     VERIFY_IS_EQUAL(Index(0), Foo::object_count);
 
     {
-      Foo::object_limit = rows+1;
+      Foo::object_limit = rows + 1;
       VectorX vect2(rows, Foo());
       VERIFY_IS_EQUAL(Foo::object_count, rows);
     }
diff --git a/test/meta.cpp b/test/meta.cpp
index 7e73706..46269b5 100644
--- a/test/meta.cpp
+++ b/test/meta.cpp
@@ -12,10 +12,9 @@
 #include <array>
 #include <Eigen/src/Core/util/Meta.h>
 
-template<typename From, typename To>
-bool check_is_convertible(const From&, const To&)
-{
-  return internal::is_convertible<From,To>::value;
+template <typename From, typename To>
+bool check_is_convertible(const From&, const To&) {
+  return internal::is_convertible<From, To>::value;
 }
 
 struct FooReturnType {
@@ -30,93 +29,91 @@
   void func() {}
 };
 
-EIGEN_DECLARE_TEST(meta)
-{
-  VERIFY(( internal::is_same<float,float>::value));
-  VERIFY((!internal::is_same<float,double>::value));
-  VERIFY((!internal::is_same<float,float&>::value));
-  VERIFY((!internal::is_same<float,const float&>::value));
+EIGEN_DECLARE_TEST(meta) {
+  VERIFY((internal::is_same<float, float>::value));
+  VERIFY((!internal::is_same<float, double>::value));
+  VERIFY((!internal::is_same<float, float&>::value));
+  VERIFY((!internal::is_same<float, const float&>::value));
 
-  VERIFY(( internal::is_same<float,internal::remove_all_t<const float&> >::value));
-  VERIFY(( internal::is_same<float,internal::remove_all_t<const float*> >::value));
-  VERIFY(( internal::is_same<float,internal::remove_all_t<const float*&> >::value));
-  VERIFY(( internal::is_same<float,internal::remove_all_t<float**> >::value));
-  VERIFY(( internal::is_same<float,internal::remove_all_t<float**&> >::value));
-  VERIFY(( internal::is_same<float,internal::remove_all_t<float* const *&> >::value));
-  VERIFY(( internal::is_same<float,internal::remove_all_t<float* const> >::value));
+  VERIFY((internal::is_same<float, internal::remove_all_t<const float&>>::value));
+  VERIFY((internal::is_same<float, internal::remove_all_t<const float*>>::value));
+  VERIFY((internal::is_same<float, internal::remove_all_t<const float*&>>::value));
+  VERIFY((internal::is_same<float, internal::remove_all_t<float**>>::value));
+  VERIFY((internal::is_same<float, internal::remove_all_t<float**&>>::value));
+  VERIFY((internal::is_same<float, internal::remove_all_t<float* const*&>>::value));
+  VERIFY((internal::is_same<float, internal::remove_all_t<float* const>>::value));
 
   // test add_const_on_value_type
-  VERIFY(( internal::is_same< internal::add_const_on_value_type_t<float&>, float const& >::value));
-  VERIFY(( internal::is_same< internal::add_const_on_value_type_t<float*>, float const* >::value));
+  VERIFY((internal::is_same<internal::add_const_on_value_type_t<float&>, float const&>::value));
+  VERIFY((internal::is_same<internal::add_const_on_value_type_t<float*>, float const*>::value));
 
-  VERIFY(( internal::is_same< internal::add_const_on_value_type_t<float>, const float >::value));
-  VERIFY(( internal::is_same< internal::add_const_on_value_type_t<const float>, const float >::value));
+  VERIFY((internal::is_same<internal::add_const_on_value_type_t<float>, const float>::value));
+  VERIFY((internal::is_same<internal::add_const_on_value_type_t<const float>, const float>::value));
 
-  VERIFY(( internal::is_same< internal::add_const_on_value_type_t<const float* const>, const float* const>::value));
-  VERIFY(( internal::is_same< internal::add_const_on_value_type_t<float* const>, const float* const>::value));
+  VERIFY((internal::is_same<internal::add_const_on_value_type_t<const float* const>, const float* const>::value));
+  VERIFY((internal::is_same<internal::add_const_on_value_type_t<float* const>, const float* const>::value));
 
   // is_convertible
-  STATIC_CHECK(( internal::is_convertible<float,double>::value ));
-  STATIC_CHECK(( internal::is_convertible<int,double>::value ));
-  STATIC_CHECK(( internal::is_convertible<int, short>::value ));
-  STATIC_CHECK(( internal::is_convertible<short, int>::value ));
-  STATIC_CHECK(( internal::is_convertible<double,int>::value ));
-  STATIC_CHECK(( internal::is_convertible<double,std::complex<double> >::value ));
-  STATIC_CHECK((!internal::is_convertible<std::complex<double>,double>::value ));
-  STATIC_CHECK(( internal::is_convertible<Array33f,Matrix3f>::value ));
-  STATIC_CHECK(( internal::is_convertible<Matrix3f&,Matrix3f>::value ));
-  STATIC_CHECK(( internal::is_convertible<Matrix3f&,Matrix3f&>::value ));
-  STATIC_CHECK(( internal::is_convertible<Matrix3f&,const Matrix3f&>::value ));
-  STATIC_CHECK(( internal::is_convertible<const Matrix3f&,Matrix3f>::value ));
-  STATIC_CHECK(( internal::is_convertible<const Matrix3f&,const Matrix3f&>::value ));
-  STATIC_CHECK((!internal::is_convertible<const Matrix3f&,Matrix3f&>::value ));
-  STATIC_CHECK((!internal::is_convertible<const Matrix3f,Matrix3f&>::value ));
-  STATIC_CHECK(!( internal::is_convertible<Matrix3f,Matrix3f&>::value ));
+  STATIC_CHECK((internal::is_convertible<float, double>::value));
+  STATIC_CHECK((internal::is_convertible<int, double>::value));
+  STATIC_CHECK((internal::is_convertible<int, short>::value));
+  STATIC_CHECK((internal::is_convertible<short, int>::value));
+  STATIC_CHECK((internal::is_convertible<double, int>::value));
+  STATIC_CHECK((internal::is_convertible<double, std::complex<double>>::value));
+  STATIC_CHECK((!internal::is_convertible<std::complex<double>, double>::value));
+  STATIC_CHECK((internal::is_convertible<Array33f, Matrix3f>::value));
+  STATIC_CHECK((internal::is_convertible<Matrix3f&, Matrix3f>::value));
+  STATIC_CHECK((internal::is_convertible<Matrix3f&, Matrix3f&>::value));
+  STATIC_CHECK((internal::is_convertible<Matrix3f&, const Matrix3f&>::value));
+  STATIC_CHECK((internal::is_convertible<const Matrix3f&, Matrix3f>::value));
+  STATIC_CHECK((internal::is_convertible<const Matrix3f&, const Matrix3f&>::value));
+  STATIC_CHECK((!internal::is_convertible<const Matrix3f&, Matrix3f&>::value));
+  STATIC_CHECK((!internal::is_convertible<const Matrix3f, Matrix3f&>::value));
+  STATIC_CHECK(!(internal::is_convertible<Matrix3f, Matrix3f&>::value));
 
-  STATIC_CHECK(!( internal::is_convertible<int,int&>::value ));
-  STATIC_CHECK(( internal::is_convertible<const int,const int& >::value ));
+  STATIC_CHECK(!(internal::is_convertible<int, int&>::value));
+  STATIC_CHECK((internal::is_convertible<const int, const int&>::value));
 
-  //STATIC_CHECK((!internal::is_convertible<Matrix3f,Matrix3d>::value )); //does not even compile because the conversion is prevented by a static assertion
-  STATIC_CHECK((!internal::is_convertible<Array33f,int>::value ));
-  STATIC_CHECK((!internal::is_convertible<MatrixXf,float>::value ));
+  // STATIC_CHECK((!internal::is_convertible<Matrix3f,Matrix3d>::value )); //does not even compile because the
+  // conversion is prevented by a static assertion
+  STATIC_CHECK((!internal::is_convertible<Array33f, int>::value));
+  STATIC_CHECK((!internal::is_convertible<MatrixXf, float>::value));
   {
     float f = 0.0f;
     MatrixXf A, B;
     VectorXf a, b;
-    VERIFY(( check_is_convertible(a.dot(b), f) ));
-    VERIFY(( check_is_convertible(a.transpose()*b, f) ));
-    VERIFY((!check_is_convertible(A*B, f) ));
-    VERIFY(( check_is_convertible(A*B, A) ));
+    VERIFY((check_is_convertible(a.dot(b), f)));
+    VERIFY((check_is_convertible(a.transpose() * b, f)));
+    VERIFY((!check_is_convertible(A * B, f)));
+    VERIFY((check_is_convertible(A * B, A)));
   }
 
-  #if (EIGEN_COMP_GNUC_STRICT  && EIGEN_COMP_GNUC  <=  990) \
-   || (EIGEN_COMP_CLANG_STRICT && EIGEN_COMP_CLANG <=  990) \
-   || (EIGEN_COMP_MSVC         && EIGEN_COMP_MSVC  <= 1914)
+#if (EIGEN_COMP_GNUC_STRICT && EIGEN_COMP_GNUC <= 990) || (EIGEN_COMP_CLANG_STRICT && EIGEN_COMP_CLANG <= 990) || \
+    (EIGEN_COMP_MSVC && EIGEN_COMP_MSVC <= 1914)
   // See http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1752,
   // basically, a fix in the c++ standard breaks our c++98 implementation
   // of is_convertible for abstract classes.
   // So the following tests are expected to fail with recent compilers.
 
-  STATIC_CHECK(( !internal::is_convertible<MyInterface, MyImpl>::value ));
-  STATIC_CHECK(( !internal::is_convertible<MyImpl, MyInterface>::value ));
-  STATIC_CHECK((  internal::is_convertible<MyImpl, const MyInterface&>::value ));
+  STATIC_CHECK((!internal::is_convertible<MyInterface, MyImpl>::value));
+  STATIC_CHECK((!internal::is_convertible<MyImpl, MyInterface>::value));
+  STATIC_CHECK((internal::is_convertible<MyImpl, const MyInterface&>::value));
 
-  #endif
+#endif
 
   {
     int i = 0;
-    VERIFY(( check_is_convertible(fix<3>(), i) ));
-    VERIFY((!check_is_convertible(i, fix<DynamicIndex>()) ));
+    VERIFY((check_is_convertible(fix<3>(), i)));
+    VERIFY((!check_is_convertible(i, fix<DynamicIndex>())));
   }
 
-
-  VERIFY((  internal::has_ReturnType<FooReturnType>::value ));
-  VERIFY((  internal::has_ReturnType<ScalarBinaryOpTraits<int,int> >::value ));
-  VERIFY(( !internal::has_ReturnType<MatrixXf>::value ));
-  VERIFY(( !internal::has_ReturnType<int>::value ));
+  VERIFY((internal::has_ReturnType<FooReturnType>::value));
+  VERIFY((internal::has_ReturnType<ScalarBinaryOpTraits<int, int>>::value));
+  VERIFY((!internal::has_ReturnType<MatrixXf>::value));
+  VERIFY((!internal::has_ReturnType<int>::value));
 
   VERIFY(internal::meta_sqrt<1>::ret == 1);
-  #define VERIFY_META_SQRT(X) VERIFY(internal::meta_sqrt<X>::ret == int(std::sqrt(double(X))))
+#define VERIFY_META_SQRT(X) VERIFY(internal::meta_sqrt<X>::ret == int(std::sqrt(double(X))))
   VERIFY_META_SQRT(2);
   VERIFY_META_SQRT(3);
   VERIFY_META_SQRT(4);
@@ -135,40 +132,40 @@
   VERIFY_META_SQRT(1025);
 }
 
-using Eigen::internal::is_same;
-using Eigen::internal::type_list;
-using Eigen::internal::numeric_list;
+using Eigen::internal::apply_op_from_left;
+using Eigen::internal::apply_op_from_right;
+using Eigen::internal::arg_prod;
+using Eigen::internal::arg_sum;
+using Eigen::internal::array_apply;
+using Eigen::internal::array_apply_and_reduce;
+using Eigen::internal::array_prod;
+using Eigen::internal::array_reduce;
+using Eigen::internal::array_reverse;
+using Eigen::internal::array_sum;
+using Eigen::internal::array_zip;
+using Eigen::internal::array_zip_and_reduce;
+using Eigen::internal::concat;
+using Eigen::internal::contained_in_list;
+using Eigen::internal::contained_in_list_gf;
 using Eigen::internal::gen_numeric_list;
+using Eigen::internal::gen_numeric_list_repeated;
 using Eigen::internal::gen_numeric_list_reversed;
 using Eigen::internal::gen_numeric_list_swapped_pair;
-using Eigen::internal::gen_numeric_list_repeated;
-using Eigen::internal::concat;
-using Eigen::internal::mconcat;
-using Eigen::internal::take;
-using Eigen::internal::skip;
-using Eigen::internal::slice;
 using Eigen::internal::get;
 using Eigen::internal::id_numeric;
 using Eigen::internal::id_type;
-using Eigen::internal::is_same_gf;
-using Eigen::internal::apply_op_from_left;
-using Eigen::internal::apply_op_from_right;
-using Eigen::internal::contained_in_list;
-using Eigen::internal::contained_in_list_gf;
-using Eigen::internal::arg_prod;
-using Eigen::internal::arg_sum;
-using Eigen::internal::sum_op;
-using Eigen::internal::product_op;
-using Eigen::internal::array_reverse;
-using Eigen::internal::array_sum;
-using Eigen::internal::array_prod;
-using Eigen::internal::array_reduce;
-using Eigen::internal::array_zip;
-using Eigen::internal::array_zip_and_reduce;
-using Eigen::internal::array_apply;
-using Eigen::internal::array_apply_and_reduce;
-using Eigen::internal::repeat;
 using Eigen::internal::instantiate_by_c_array;
+using Eigen::internal::is_same;
+using Eigen::internal::is_same_gf;
+using Eigen::internal::mconcat;
+using Eigen::internal::numeric_list;
+using Eigen::internal::product_op;
+using Eigen::internal::repeat;
+using Eigen::internal::skip;
+using Eigen::internal::slice;
+using Eigen::internal::sum_op;
+using Eigen::internal::take;
+using Eigen::internal::type_list;
 
 struct dummy_a {};
 struct dummy_b {};
@@ -177,26 +174,74 @@
 struct dummy_e {};
 
 // dummy operation for testing apply
-template<typename A, typename B> struct dummy_op;
-template<> struct dummy_op<dummy_a, dummy_b> { typedef dummy_c type; };
-template<> struct dummy_op<dummy_b, dummy_a> { typedef dummy_d type; };
-template<> struct dummy_op<dummy_b, dummy_c> { typedef dummy_a type; };
-template<> struct dummy_op<dummy_c, dummy_b> { typedef dummy_d type; };
-template<> struct dummy_op<dummy_c, dummy_a> { typedef dummy_b type; };
-template<> struct dummy_op<dummy_a, dummy_c> { typedef dummy_d type; };
-template<> struct dummy_op<dummy_a, dummy_a> { typedef dummy_e type; };
-template<> struct dummy_op<dummy_b, dummy_b> { typedef dummy_e type; };
-template<> struct dummy_op<dummy_c, dummy_c> { typedef dummy_e type; };
+template <typename A, typename B>
+struct dummy_op;
+template <>
+struct dummy_op<dummy_a, dummy_b> {
+  typedef dummy_c type;
+};
+template <>
+struct dummy_op<dummy_b, dummy_a> {
+  typedef dummy_d type;
+};
+template <>
+struct dummy_op<dummy_b, dummy_c> {
+  typedef dummy_a type;
+};
+template <>
+struct dummy_op<dummy_c, dummy_b> {
+  typedef dummy_d type;
+};
+template <>
+struct dummy_op<dummy_c, dummy_a> {
+  typedef dummy_b type;
+};
+template <>
+struct dummy_op<dummy_a, dummy_c> {
+  typedef dummy_d type;
+};
+template <>
+struct dummy_op<dummy_a, dummy_a> {
+  typedef dummy_e type;
+};
+template <>
+struct dummy_op<dummy_b, dummy_b> {
+  typedef dummy_e type;
+};
+template <>
+struct dummy_op<dummy_c, dummy_c> {
+  typedef dummy_e type;
+};
 
-template<typename A, typename B> struct dummy_test { constexpr static bool value = false; constexpr static int global_flags = 0; };
-template<> struct dummy_test<dummy_a, dummy_a>     { constexpr static bool value = true;  constexpr static int global_flags = 1; };
-template<> struct dummy_test<dummy_b, dummy_b>     { constexpr static bool value = true;  constexpr static int global_flags = 2; };
-template<> struct dummy_test<dummy_c, dummy_c>     { constexpr static bool value = true;  constexpr static int global_flags = 4; };
+template <typename A, typename B>
+struct dummy_test {
+  constexpr static bool value = false;
+  constexpr static int global_flags = 0;
+};
+template <>
+struct dummy_test<dummy_a, dummy_a> {
+  constexpr static bool value = true;
+  constexpr static int global_flags = 1;
+};
+template <>
+struct dummy_test<dummy_b, dummy_b> {
+  constexpr static bool value = true;
+  constexpr static int global_flags = 2;
+};
+template <>
+struct dummy_test<dummy_c, dummy_c> {
+  constexpr static bool value = true;
+  constexpr static int global_flags = 4;
+};
 
-struct times2_op { template<typename A> static A run(A v) { return v * 2; } };
+struct times2_op {
+  template <typename A>
+  static A run(A v) {
+    return v * 2;
+  }
+};
 
-struct dummy_inst
-{
+struct dummy_inst {
   int c;
 
   dummy_inst() : c(0) {}
@@ -207,8 +252,7 @@
   dummy_inst(int, int, int, int, int) : c(5) {}
 };
 
-static void test_gen_numeric_list()
-{
+static void test_gen_numeric_list() {
   VERIFY((is_same<typename gen_numeric_list<int, 0>::type, numeric_list<int>>::value));
   VERIFY((is_same<typename gen_numeric_list<int, 1>::type, numeric_list<int, 0>>::value));
   VERIFY((is_same<typename gen_numeric_list<int, 2>::type, numeric_list<int, 0, 1>>::value));
@@ -219,68 +263,88 @@
   VERIFY((is_same<typename gen_numeric_list<int, 1, 42>::type, numeric_list<int, 42>>::value));
   VERIFY((is_same<typename gen_numeric_list<int, 2, 42>::type, numeric_list<int, 42, 43>>::value));
   VERIFY((is_same<typename gen_numeric_list<int, 5, 42>::type, numeric_list<int, 42, 43, 44, 45, 46>>::value));
-  VERIFY((is_same<typename gen_numeric_list<int, 10, 42>::type, numeric_list<int, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51>>::value));
+  VERIFY((is_same<typename gen_numeric_list<int, 10, 42>::type,
+                  numeric_list<int, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51>>::value));
 
   VERIFY((is_same<typename gen_numeric_list_reversed<int, 0>::type, numeric_list<int>>::value));
   VERIFY((is_same<typename gen_numeric_list_reversed<int, 1>::type, numeric_list<int, 0>>::value));
   VERIFY((is_same<typename gen_numeric_list_reversed<int, 2>::type, numeric_list<int, 1, 0>>::value));
   VERIFY((is_same<typename gen_numeric_list_reversed<int, 5>::type, numeric_list<int, 4, 3, 2, 1, 0>>::value));
-  VERIFY((is_same<typename gen_numeric_list_reversed<int, 10>::type, numeric_list<int, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0>>::value));
+  VERIFY((is_same<typename gen_numeric_list_reversed<int, 10>::type,
+                  numeric_list<int, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0>>::value));
 
   VERIFY((is_same<typename gen_numeric_list_reversed<int, 0, 42>::type, numeric_list<int>>::value));
   VERIFY((is_same<typename gen_numeric_list_reversed<int, 1, 42>::type, numeric_list<int, 42>>::value));
   VERIFY((is_same<typename gen_numeric_list_reversed<int, 2, 42>::type, numeric_list<int, 43, 42>>::value));
   VERIFY((is_same<typename gen_numeric_list_reversed<int, 5, 42>::type, numeric_list<int, 46, 45, 44, 43, 42>>::value));
-  VERIFY((is_same<typename gen_numeric_list_reversed<int, 10, 42>::type, numeric_list<int, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42>>::value));
+  VERIFY((is_same<typename gen_numeric_list_reversed<int, 10, 42>::type,
+                  numeric_list<int, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42>>::value));
 
   VERIFY((is_same<typename gen_numeric_list_swapped_pair<int, 0, 2, 3>::type, numeric_list<int>>::value));
   VERIFY((is_same<typename gen_numeric_list_swapped_pair<int, 1, 2, 3>::type, numeric_list<int, 0>>::value));
   VERIFY((is_same<typename gen_numeric_list_swapped_pair<int, 2, 2, 3>::type, numeric_list<int, 0, 1>>::value));
-  VERIFY((is_same<typename gen_numeric_list_swapped_pair<int, 5, 2, 3>::type, numeric_list<int, 0, 1, 3, 2, 4>>::value));
-  VERIFY((is_same<typename gen_numeric_list_swapped_pair<int, 10, 2, 3>::type, numeric_list<int, 0, 1, 3, 2, 4, 5, 6, 7, 8, 9>>::value));
+  VERIFY(
+      (is_same<typename gen_numeric_list_swapped_pair<int, 5, 2, 3>::type, numeric_list<int, 0, 1, 3, 2, 4>>::value));
+  VERIFY((is_same<typename gen_numeric_list_swapped_pair<int, 10, 2, 3>::type,
+                  numeric_list<int, 0, 1, 3, 2, 4, 5, 6, 7, 8, 9>>::value));
 
   VERIFY((is_same<typename gen_numeric_list_swapped_pair<int, 0, 44, 45, 42>::type, numeric_list<int>>::value));
   VERIFY((is_same<typename gen_numeric_list_swapped_pair<int, 1, 44, 45, 42>::type, numeric_list<int, 42>>::value));
   VERIFY((is_same<typename gen_numeric_list_swapped_pair<int, 2, 44, 45, 42>::type, numeric_list<int, 42, 43>>::value));
-  VERIFY((is_same<typename gen_numeric_list_swapped_pair<int, 5, 44, 45, 42>::type, numeric_list<int, 42, 43, 45, 44, 46>>::value));
-  VERIFY((is_same<typename gen_numeric_list_swapped_pair<int, 10, 44, 45, 42>::type, numeric_list<int, 42, 43, 45, 44, 46, 47, 48, 49, 50, 51>>::value));
+  VERIFY((is_same<typename gen_numeric_list_swapped_pair<int, 5, 44, 45, 42>::type,
+                  numeric_list<int, 42, 43, 45, 44, 46>>::value));
+  VERIFY((is_same<typename gen_numeric_list_swapped_pair<int, 10, 44, 45, 42>::type,
+                  numeric_list<int, 42, 43, 45, 44, 46, 47, 48, 49, 50, 51>>::value));
 
   VERIFY((is_same<typename gen_numeric_list_repeated<int, 0, 0>::type, numeric_list<int>>::value));
   VERIFY((is_same<typename gen_numeric_list_repeated<int, 1, 0>::type, numeric_list<int, 0>>::value));
   VERIFY((is_same<typename gen_numeric_list_repeated<int, 2, 0>::type, numeric_list<int, 0, 0>>::value));
   VERIFY((is_same<typename gen_numeric_list_repeated<int, 5, 0>::type, numeric_list<int, 0, 0, 0, 0, 0>>::value));
-  VERIFY((is_same<typename gen_numeric_list_repeated<int, 10, 0>::type, numeric_list<int, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>>::value));
+  VERIFY((is_same<typename gen_numeric_list_repeated<int, 10, 0>::type,
+                  numeric_list<int, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>>::value));
 }
 
-static void test_concat()
-{
-  VERIFY((is_same<typename concat<type_list<dummy_a, dummy_a>, type_list<>>::type, type_list<dummy_a, dummy_a>>::value));
-  VERIFY((is_same<typename concat<type_list<>, type_list<dummy_a, dummy_a>>::type, type_list<dummy_a, dummy_a>>::value));
-  VERIFY((is_same<typename concat<type_list<dummy_a, dummy_a>, type_list<dummy_a, dummy_a>>::type, type_list<dummy_a, dummy_a, dummy_a, dummy_a>>::value));
-  VERIFY((is_same<typename concat<type_list<dummy_a, dummy_a>, type_list<dummy_b, dummy_c>>::type, type_list<dummy_a, dummy_a, dummy_b, dummy_c>>::value));
-  VERIFY((is_same<typename concat<type_list<dummy_a>, type_list<dummy_b, dummy_c>>::type, type_list<dummy_a, dummy_b, dummy_c>>::value));
+static void test_concat() {
+  VERIFY(
+      (is_same<typename concat<type_list<dummy_a, dummy_a>, type_list<>>::type, type_list<dummy_a, dummy_a>>::value));
+  VERIFY(
+      (is_same<typename concat<type_list<>, type_list<dummy_a, dummy_a>>::type, type_list<dummy_a, dummy_a>>::value));
+  VERIFY((is_same<typename concat<type_list<dummy_a, dummy_a>, type_list<dummy_a, dummy_a>>::type,
+                  type_list<dummy_a, dummy_a, dummy_a, dummy_a>>::value));
+  VERIFY((is_same<typename concat<type_list<dummy_a, dummy_a>, type_list<dummy_b, dummy_c>>::type,
+                  type_list<dummy_a, dummy_a, dummy_b, dummy_c>>::value));
+  VERIFY((is_same<typename concat<type_list<dummy_a>, type_list<dummy_b, dummy_c>>::type,
+                  type_list<dummy_a, dummy_b, dummy_c>>::value));
 
   VERIFY((is_same<typename concat<numeric_list<int, 0, 0>, numeric_list<int>>::type, numeric_list<int, 0, 0>>::value));
   VERIFY((is_same<typename concat<numeric_list<int>, numeric_list<int, 0, 0>>::type, numeric_list<int, 0, 0>>::value));
-  VERIFY((is_same<typename concat<numeric_list<int, 0, 0>, numeric_list<int, 0, 0>>::type, numeric_list<int, 0, 0, 0, 0>>::value));
-  VERIFY((is_same<typename concat<numeric_list<int, 0, 0>, numeric_list<int, 1, 2>>::type, numeric_list<int, 0, 0, 1, 2>>::value));
-  VERIFY((is_same<typename concat<numeric_list<int, 0>, numeric_list<int, 1, 2>>::type, numeric_list<int, 0, 1, 2>>::value));
+  VERIFY((is_same<typename concat<numeric_list<int, 0, 0>, numeric_list<int, 0, 0>>::type,
+                  numeric_list<int, 0, 0, 0, 0>>::value));
+  VERIFY((is_same<typename concat<numeric_list<int, 0, 0>, numeric_list<int, 1, 2>>::type,
+                  numeric_list<int, 0, 0, 1, 2>>::value));
+  VERIFY((is_same<typename concat<numeric_list<int, 0>, numeric_list<int, 1, 2>>::type,
+                  numeric_list<int, 0, 1, 2>>::value));
 
   VERIFY((is_same<typename mconcat<type_list<dummy_a>>::type, type_list<dummy_a>>::value));
   VERIFY((is_same<typename mconcat<type_list<dummy_a>, type_list<dummy_b>>::type, type_list<dummy_a, dummy_b>>::value));
-  VERIFY((is_same<typename mconcat<type_list<dummy_a>, type_list<dummy_b>, type_list<dummy_c>>::type, type_list<dummy_a, dummy_b, dummy_c>>::value));
-  VERIFY((is_same<typename mconcat<type_list<dummy_a>, type_list<dummy_b, dummy_c>>::type, type_list<dummy_a, dummy_b, dummy_c>>::value));
-  VERIFY((is_same<typename mconcat<type_list<dummy_a, dummy_b>, type_list<dummy_c>>::type, type_list<dummy_a, dummy_b, dummy_c>>::value));
+  VERIFY((is_same<typename mconcat<type_list<dummy_a>, type_list<dummy_b>, type_list<dummy_c>>::type,
+                  type_list<dummy_a, dummy_b, dummy_c>>::value));
+  VERIFY((is_same<typename mconcat<type_list<dummy_a>, type_list<dummy_b, dummy_c>>::type,
+                  type_list<dummy_a, dummy_b, dummy_c>>::value));
+  VERIFY((is_same<typename mconcat<type_list<dummy_a, dummy_b>, type_list<dummy_c>>::type,
+                  type_list<dummy_a, dummy_b, dummy_c>>::value));
 
   VERIFY((is_same<typename mconcat<numeric_list<int, 0>>::type, numeric_list<int, 0>>::value));
   VERIFY((is_same<typename mconcat<numeric_list<int, 0>, numeric_list<int, 1>>::type, numeric_list<int, 0, 1>>::value));
-  VERIFY((is_same<typename mconcat<numeric_list<int, 0>, numeric_list<int, 1>, numeric_list<int, 2>>::type, numeric_list<int, 0, 1, 2>>::value));
-  VERIFY((is_same<typename mconcat<numeric_list<int, 0>, numeric_list<int, 1, 2>>::type, numeric_list<int, 0, 1, 2>>::value));
-  VERIFY((is_same<typename mconcat<numeric_list<int, 0, 1>, numeric_list<int, 2>>::type, numeric_list<int, 0, 1, 2>>::value));
+  VERIFY((is_same<typename mconcat<numeric_list<int, 0>, numeric_list<int, 1>, numeric_list<int, 2>>::type,
+                  numeric_list<int, 0, 1, 2>>::value));
+  VERIFY((is_same<typename mconcat<numeric_list<int, 0>, numeric_list<int, 1, 2>>::type,
+                  numeric_list<int, 0, 1, 2>>::value));
+  VERIFY((is_same<typename mconcat<numeric_list<int, 0, 1>, numeric_list<int, 2>>::type,
+                  numeric_list<int, 0, 1, 2>>::value));
 }
 
-static void test_slice()
-{
+static void test_slice() {
   typedef type_list<dummy_a, dummy_a, dummy_b, dummy_b, dummy_c, dummy_c> tl;
   typedef numeric_list<int, 0, 1, 2, 3, 4, 5> il;
 
@@ -299,7 +363,7 @@
   VERIFY((is_same<typename take<4, il>::type, numeric_list<int, 0, 1, 2, 3>>::value));
   VERIFY((is_same<typename take<5, il>::type, numeric_list<int, 0, 1, 2, 3, 4>>::value));
   VERIFY((is_same<typename take<6, il>::type, numeric_list<int, 0, 1, 2, 3, 4, 5>>::value));
-  
+
   VERIFY((is_same<typename skip<0, tl>::type, type_list<dummy_a, dummy_a, dummy_b, dummy_b, dummy_c, dummy_c>>::value));
   VERIFY((is_same<typename skip<1, tl>::type, type_list<dummy_a, dummy_b, dummy_b, dummy_c, dummy_c>>::value));
   VERIFY((is_same<typename skip<2, tl>::type, type_list<dummy_b, dummy_b, dummy_c, dummy_c>>::value));
@@ -322,8 +386,7 @@
   VERIFY((is_same<typename slice<1, 3, il>::type, numeric_list<int, 1, 2, 3>>::value));
 }
 
-static void test_get()
-{
+static void test_get() {
   typedef type_list<dummy_a, dummy_a, dummy_b, dummy_b, dummy_c, dummy_c> tl;
   typedef numeric_list<int, 4, 8, 15, 16, 23, 42> il;
 
@@ -342,50 +405,45 @@
   VERIFY_IS_EQUAL(((int)get<5, il>::value), 42);
 }
 
-static void test_id_helper(dummy_a a, dummy_a b, dummy_a c)
-{
+static void test_id_helper(dummy_a a, dummy_a b, dummy_a c) {
   (void)a;
   (void)b;
   (void)c;
 }
 
-template<int... ii>
-static void test_id_numeric()
-{
+template <int... ii>
+static void test_id_numeric() {
   test_id_helper(typename id_numeric<int, ii, dummy_a>::type()...);
 }
 
-template<typename... tt>
-static void test_id_type()
-{
+template <typename... tt>
+static void test_id_type() {
   test_id_helper(typename id_type<tt, dummy_a>::type()...);
 }
 
-static void test_id()
-{
+static void test_id() {
   // don't call VERIFY here, just assume it works if it compiles
   // (otherwise it will complain that it can't find the function)
   test_id_numeric<1, 4, 6>();
   test_id_type<dummy_a, dummy_b, dummy_c>();
 }
 
-static void test_is_same_gf()
-{
+static void test_is_same_gf() {
   VERIFY((!is_same_gf<dummy_a, dummy_b>::value));
   VERIFY((!!is_same_gf<dummy_a, dummy_a>::value));
   VERIFY_IS_EQUAL((!!is_same_gf<dummy_a, dummy_b>::global_flags), false);
   VERIFY_IS_EQUAL((!!is_same_gf<dummy_a, dummy_a>::global_flags), false);
 }
 
-static void test_apply_op()
-{
+static void test_apply_op() {
   typedef type_list<dummy_a, dummy_b, dummy_c> tl;
-  VERIFY((!!is_same<typename apply_op_from_left<dummy_op, dummy_a, tl>::type, type_list<dummy_e, dummy_c, dummy_d>>::value));
-  VERIFY((!!is_same<typename apply_op_from_right<dummy_op, dummy_a, tl>::type, type_list<dummy_e, dummy_d, dummy_b>>::value));
+  VERIFY((!!is_same<typename apply_op_from_left<dummy_op, dummy_a, tl>::type,
+                    type_list<dummy_e, dummy_c, dummy_d>>::value));
+  VERIFY((!!is_same<typename apply_op_from_right<dummy_op, dummy_a, tl>::type,
+                    type_list<dummy_e, dummy_d, dummy_b>>::value));
 }
 
-static void test_contained_in_list()
-{
+static void test_contained_in_list() {
   typedef type_list<dummy_a, dummy_b, dummy_c> tl;
 
   VERIFY((!!contained_in_list<is_same, dummy_a, tl>::value));
@@ -407,16 +465,14 @@
   VERIFY_IS_EQUAL(((int)contained_in_list_gf<dummy_test, dummy_e, tl>::global_flags), 0);
 }
 
-static void test_arg_reductions()
-{
-  VERIFY_IS_EQUAL(arg_sum(1,2,3,4), 10);
-  VERIFY_IS_EQUAL(arg_prod(1,2,3,4), 24);
+static void test_arg_reductions() {
+  VERIFY_IS_EQUAL(arg_sum(1, 2, 3, 4), 10);
+  VERIFY_IS_EQUAL(arg_prod(1, 2, 3, 4), 24);
   VERIFY_IS_APPROX(arg_sum(0.5, 2, 5), 7.5);
   VERIFY_IS_APPROX(arg_prod(0.5, 2, 5), 5.0);
 }
 
-static void test_array_reverse_and_reduce()
-{
+static void test_array_reverse_and_reduce() {
   array<int, 6> a{{4, 8, 15, 16, 23, 42}};
   array<int, 6> b{{42, 23, 16, 15, 8, 4}};
 
@@ -430,8 +486,7 @@
   VERIFY_IS_EQUAL((array_prod(b)), 7418880);
 }
 
-static void test_array_zip_and_apply()
-{
+static void test_array_zip_and_apply() {
   array<int, 6> a{{4, 8, 15, 16, 23, 42}};
   array<int, 6> b{{0, 1, 2, 3, 4, 5}};
   array<int, 6> c{{4, 9, 17, 19, 27, 47}};
@@ -447,14 +502,13 @@
   VERIFY_IS_EQUAL((array_zip_and_reduce<sum_op, product_op>(a, b)), 388);
 }
 
-static void test_array_misc()
-{
+static void test_array_misc() {
   array<int, 3> a3{{1, 1, 1}};
   array<int, 6> a6{{2, 2, 2, 2, 2, 2}};
   VERIFY((repeat<3, int>(1) == a3));
   VERIFY((repeat<6, int>(2) == a6));
 
-  int data[5] = { 0, 1, 2, 3, 4 };
+  int data[5] = {0, 1, 2, 3, 4};
   VERIFY_IS_EQUAL((instantiate_by_c_array<dummy_inst, int, 0>(data).c), 0);
   VERIFY_IS_EQUAL((instantiate_by_c_array<dummy_inst, int, 1>(data).c), 1);
   VERIFY_IS_EQUAL((instantiate_by_c_array<dummy_inst, int, 2>(data).c), 2);
@@ -463,8 +517,7 @@
   VERIFY_IS_EQUAL((instantiate_by_c_array<dummy_inst, int, 5>(data).c), 5);
 }
 
-EIGEN_DECLARE_TEST(cxx11_meta)
-{
+EIGEN_DECLARE_TEST(cxx11_meta) {
   CALL_SUBTEST(test_gen_numeric_list());
   CALL_SUBTEST(test_concat());
   CALL_SUBTEST(test_slice());
diff --git a/test/metis_support.cpp b/test/metis_support.cpp
index b490dac..cfbea3a 100644
--- a/test/metis_support.cpp
+++ b/test/metis_support.cpp
@@ -12,14 +12,11 @@
 #include <Eigen/MetisSupport>
 #include <unsupported/Eigen/SparseExtra>
 
-template<typename T> void test_metis_T()
-{
+template <typename T>
+void test_metis_T() {
   SparseLU<SparseMatrix<T, ColMajor>, MetisOrdering<int> > sparselu_metis;
-  
-  check_sparse_square_solving(sparselu_metis); 
+
+  check_sparse_square_solving(sparselu_metis);
 }
 
-EIGEN_DECLARE_TEST(metis_support)
-{
-  CALL_SUBTEST_1(test_metis_T<double>());
-}
+EIGEN_DECLARE_TEST(metis_support) { CALL_SUBTEST_1(test_metis_T<double>()); }
diff --git a/test/miscmatrices.cpp b/test/miscmatrices.cpp
index e71712f..e3506af 100644
--- a/test/miscmatrices.cpp
+++ b/test/miscmatrices.cpp
@@ -9,8 +9,8 @@
 
 #include "main.h"
 
-template<typename MatrixType> void miscMatrices(const MatrixType& m)
-{
+template <typename MatrixType>
+void miscMatrices(const MatrixType& m) {
   /* this test covers the following files:
      DiagonalMatrix.h Ones.h
   */
@@ -19,28 +19,29 @@
   Index rows = m.rows();
   Index cols = m.cols();
 
-  Index r = internal::random<Index>(0, rows-1), r2 = internal::random<Index>(0, rows-1), c = internal::random<Index>(0, cols-1);
-  VERIFY_IS_APPROX(MatrixType::Ones(rows,cols)(r,c), static_cast<Scalar>(1));
-  MatrixType m1 = MatrixType::Ones(rows,cols);
-  VERIFY_IS_APPROX(m1(r,c), static_cast<Scalar>(1));
+  Index r = internal::random<Index>(0, rows - 1), r2 = internal::random<Index>(0, rows - 1),
+        c = internal::random<Index>(0, cols - 1);
+  VERIFY_IS_APPROX(MatrixType::Ones(rows, cols)(r, c), static_cast<Scalar>(1));
+  MatrixType m1 = MatrixType::Ones(rows, cols);
+  VERIFY_IS_APPROX(m1(r, c), static_cast<Scalar>(1));
   VectorType v1 = VectorType::Random(rows);
   v1[0];
-  Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
-  square(v1.asDiagonal());
-  if(r==r2) VERIFY_IS_APPROX(square(r,r2), v1[r]);
-  else VERIFY_IS_MUCH_SMALLER_THAN(square(r,r2), static_cast<Scalar>(1));
+  Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> square(v1.asDiagonal());
+  if (r == r2)
+    VERIFY_IS_APPROX(square(r, r2), v1[r]);
+  else
+    VERIFY_IS_MUCH_SMALLER_THAN(square(r, r2), static_cast<Scalar>(1));
   square = MatrixType::Zero(rows, rows);
   square.diagonal() = VectorType::Ones(rows);
   VERIFY_IS_APPROX(square, MatrixType::Identity(rows, rows));
 }
 
-EIGEN_DECLARE_TEST(miscmatrices)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( miscMatrices(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( miscMatrices(Matrix4d()) );
-    CALL_SUBTEST_3( miscMatrices(MatrixXcf(3, 3)) );
-    CALL_SUBTEST_4( miscMatrices(MatrixXi(8, 12)) );
-    CALL_SUBTEST_5( miscMatrices(MatrixXcd(20, 20)) );
+EIGEN_DECLARE_TEST(miscmatrices) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(miscMatrices(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(miscMatrices(Matrix4d()));
+    CALL_SUBTEST_3(miscMatrices(MatrixXcf(3, 3)));
+    CALL_SUBTEST_4(miscMatrices(MatrixXi(8, 12)));
+    CALL_SUBTEST_5(miscMatrices(MatrixXcd(20, 20)));
   }
 }
diff --git a/test/mixingtypes.cpp b/test/mixingtypes.cpp
index fe760b7..8f0fff3 100644
--- a/test/mixingtypes.cpp
+++ b/test/mixingtypes.cpp
@@ -13,18 +13,16 @@
 // ignore double-promotion diagnostic for clang and gcc, if we check for static assertion anyway:
 // TODO do the same for MSVC?
 #if defined(__clang__)
-#  if (__clang_major__ * 100 + __clang_minor__) >= 308
-#    pragma clang diagnostic ignored "-Wdouble-promotion"
-#  endif
+#if (__clang_major__ * 100 + __clang_minor__) >= 308
+#pragma clang diagnostic ignored "-Wdouble-promotion"
+#endif
 #elif defined(__GNUC__)
-  // TODO is there a minimal GCC version for this? At least g++-4.7 seems to be fine with this.
-#  pragma GCC diagnostic ignored "-Wdouble-promotion"
+// TODO is there a minimal GCC version for this? At least g++-4.7 seems to be fine with this.
+#pragma GCC diagnostic ignored "-Wdouble-promotion"
 #endif
 
 #endif
 
-
-
 #if defined(EIGEN_TEST_PART_1) || defined(EIGEN_TEST_PART_2) || defined(EIGEN_TEST_PART_3)
 
 #ifndef EIGEN_DONT_VECTORIZE
@@ -34,21 +32,22 @@
 #endif
 
 static bool g_called;
-#define EIGEN_SCALAR_BINARY_OP_PLUGIN { g_called |= (!internal::is_same<LhsScalar,RhsScalar>::value); }
+#define EIGEN_SCALAR_BINARY_OP_PLUGIN \
+  { g_called |= (!internal::is_same<LhsScalar, RhsScalar>::value); }
 
 #include "main.h"
 
 using namespace std;
 
-#define VERIFY_MIX_SCALAR(XPR,REF) \
-  g_called = false; \
-  VERIFY_IS_APPROX(XPR,REF); \
-  VERIFY( g_called && #XPR" not properly optimized");
+#define VERIFY_MIX_SCALAR(XPR, REF) \
+  g_called = false;                 \
+  VERIFY_IS_APPROX(XPR, REF);       \
+  VERIFY(g_called&& #XPR " not properly optimized");
 
-template<int SizeAtCompileType> void mixingtypes(int size = SizeAtCompileType)
-{
-  typedef std::complex<float>   CF;
-  typedef std::complex<double>  CD;
+template <int SizeAtCompileType>
+void mixingtypes(int size = SizeAtCompileType) {
+  typedef std::complex<float> CF;
+  typedef std::complex<double> CD;
   typedef Matrix<float, SizeAtCompileType, SizeAtCompileType> Mat_f;
   typedef Matrix<double, SizeAtCompileType, SizeAtCompileType> Mat_d;
   typedef Matrix<std::complex<float>, SizeAtCompileType, SizeAtCompileType> Mat_cf;
@@ -58,68 +57,68 @@
   typedef Matrix<std::complex<float>, SizeAtCompileType, 1> Vec_cf;
   typedef Matrix<std::complex<double>, SizeAtCompileType, 1> Vec_cd;
 
-  Mat_f mf    = Mat_f::Random(size,size);
-  Mat_d md    = mf.template cast<double>();
-  //Mat_d rd    = md;
-  Mat_cf mcf  = Mat_cf::Random(size,size);
-  Mat_cd mcd  = mcf.template cast<complex<double> >();
+  Mat_f mf = Mat_f::Random(size, size);
+  Mat_d md = mf.template cast<double>();
+  // Mat_d rd    = md;
+  Mat_cf mcf = Mat_cf::Random(size, size);
+  Mat_cd mcd = mcf.template cast<complex<double> >();
   Mat_cd rcd = mcd;
-  Vec_f vf    = Vec_f::Random(size,1);
-  Vec_d vd    = vf.template cast<double>();
-  Vec_cf vcf  = Vec_cf::Random(size,1);
-  Vec_cd vcd  = vcf.template cast<complex<double> >();
-  float           sf  = internal::random<float>();
-  double          sd  = internal::random<double>();
-  complex<float>  scf = internal::random<complex<float> >();
+  Vec_f vf = Vec_f::Random(size, 1);
+  Vec_d vd = vf.template cast<double>();
+  Vec_cf vcf = Vec_cf::Random(size, 1);
+  Vec_cd vcd = vcf.template cast<complex<double> >();
+  float sf = internal::random<float>();
+  double sd = internal::random<double>();
+  complex<float> scf = internal::random<complex<float> >();
   complex<double> scd = internal::random<complex<double> >();
 
-  mf+mf;
+  mf + mf;
 
-  float  epsf = std::sqrt(std::numeric_limits<float> ::min EIGEN_EMPTY ());
-  double epsd = std::sqrt(std::numeric_limits<double>::min EIGEN_EMPTY ());
+  float epsf = std::sqrt(std::numeric_limits<float>::min EIGEN_EMPTY());
+  double epsd = std::sqrt(std::numeric_limits<double>::min EIGEN_EMPTY());
 
-  while(std::abs(sf )<epsf) sf  = internal::random<float>();
-  while(std::abs(sd )<epsd) sd  = internal::random<double>();
-  while(std::abs(scf)<epsf) scf = internal::random<CF>();
-  while(std::abs(scd)<epsd) scd = internal::random<CD>();
+  while (std::abs(sf) < epsf) sf = internal::random<float>();
+  while (std::abs(sd) < epsd) sd = internal::random<double>();
+  while (std::abs(scf) < epsf) scf = internal::random<CF>();
+  while (std::abs(scd) < epsd) scd = internal::random<CD>();
 
   // check scalar products
-  VERIFY_MIX_SCALAR(vcf * sf , vcf * complex<float>(sf));
-  VERIFY_MIX_SCALAR(sd * vcd , complex<double>(sd) * vcd);
-  VERIFY_MIX_SCALAR(vf * scf , vf.template cast<complex<float> >() * scf);
-  VERIFY_MIX_SCALAR(scd * vd , scd * vd.template cast<complex<double> >());
+  VERIFY_MIX_SCALAR(vcf * sf, vcf * complex<float>(sf));
+  VERIFY_MIX_SCALAR(sd * vcd, complex<double>(sd) * vcd);
+  VERIFY_MIX_SCALAR(vf * scf, vf.template cast<complex<float> >() * scf);
+  VERIFY_MIX_SCALAR(scd * vd, scd * vd.template cast<complex<double> >());
 
-  VERIFY_MIX_SCALAR(vcf * 2 , vcf * complex<float>(2));
-  VERIFY_MIX_SCALAR(vcf * 2.1 , vcf * complex<float>(2.1));
+  VERIFY_MIX_SCALAR(vcf * 2, vcf * complex<float>(2));
+  VERIFY_MIX_SCALAR(vcf * 2.1, vcf * complex<float>(2.1));
   VERIFY_MIX_SCALAR(2 * vcf, vcf * complex<float>(2));
-  VERIFY_MIX_SCALAR(2.1 * vcf , vcf * complex<float>(2.1));
+  VERIFY_MIX_SCALAR(2.1 * vcf, vcf * complex<float>(2.1));
 
   // check scalar quotients
-  VERIFY_MIX_SCALAR(vcf / sf , vcf / complex<float>(sf));
-  VERIFY_MIX_SCALAR(vf / scf , vf.template cast<complex<float> >() / scf);
-  VERIFY_MIX_SCALAR(vf.array()  / scf, vf.template cast<complex<float> >().array() / scf);
-  VERIFY_MIX_SCALAR(scd / vd.array() , scd / vd.template cast<complex<double> >().array());
+  VERIFY_MIX_SCALAR(vcf / sf, vcf / complex<float>(sf));
+  VERIFY_MIX_SCALAR(vf / scf, vf.template cast<complex<float> >() / scf);
+  VERIFY_MIX_SCALAR(vf.array() / scf, vf.template cast<complex<float> >().array() / scf);
+  VERIFY_MIX_SCALAR(scd / vd.array(), scd / vd.template cast<complex<double> >().array());
 
   // check scalar increment
-  VERIFY_MIX_SCALAR(vcf.array() + sf , vcf.array() + complex<float>(sf));
-  VERIFY_MIX_SCALAR(sd  + vcd.array(), complex<double>(sd) + vcd.array());
-  VERIFY_MIX_SCALAR(vf.array()  + scf, vf.template cast<complex<float> >().array() + scf);
-  VERIFY_MIX_SCALAR(scd + vd.array() , scd + vd.template cast<complex<double> >().array());
+  VERIFY_MIX_SCALAR(vcf.array() + sf, vcf.array() + complex<float>(sf));
+  VERIFY_MIX_SCALAR(sd + vcd.array(), complex<double>(sd) + vcd.array());
+  VERIFY_MIX_SCALAR(vf.array() + scf, vf.template cast<complex<float> >().array() + scf);
+  VERIFY_MIX_SCALAR(scd + vd.array(), scd + vd.template cast<complex<double> >().array());
 
   // check scalar subtractions
-  VERIFY_MIX_SCALAR(vcf.array() - sf , vcf.array() - complex<float>(sf));
-  VERIFY_MIX_SCALAR(sd  - vcd.array(), complex<double>(sd) - vcd.array());
-  VERIFY_MIX_SCALAR(vf.array()  - scf, vf.template cast<complex<float> >().array() - scf);
-  VERIFY_MIX_SCALAR(scd - vd.array() , scd - vd.template cast<complex<double> >().array());
+  VERIFY_MIX_SCALAR(vcf.array() - sf, vcf.array() - complex<float>(sf));
+  VERIFY_MIX_SCALAR(sd - vcd.array(), complex<double>(sd) - vcd.array());
+  VERIFY_MIX_SCALAR(vf.array() - scf, vf.template cast<complex<float> >().array() - scf);
+  VERIFY_MIX_SCALAR(scd - vd.array(), scd - vd.template cast<complex<double> >().array());
 
   // check scalar powers
   // NOTE: scalar exponents use a unary op.
-  VERIFY_IS_APPROX( pow(vcf.array(), sf),        Eigen::pow(vcf.array(), complex<float>(sf)) );
-  VERIFY_IS_APPROX( vcf.array().pow(sf) ,        Eigen::pow(vcf.array(), complex<float>(sf)) );
-  VERIFY_MIX_SCALAR( pow(sd, vcd.array()),        Eigen::pow(complex<double>(sd), vcd.array()) );
-  VERIFY_IS_APPROX( Eigen::pow(vf.array(), scf), Eigen::pow(vf.template cast<complex<float> >().array(), scf) );
-  VERIFY_IS_APPROX( vf.array().pow(scf) ,        Eigen::pow(vf.template cast<complex<float> >().array(), scf) );
-  VERIFY_MIX_SCALAR( Eigen::pow(scd, vd.array()), Eigen::pow(scd, vd.template cast<complex<double> >().array()) );
+  VERIFY_IS_APPROX(pow(vcf.array(), sf), Eigen::pow(vcf.array(), complex<float>(sf)));
+  VERIFY_IS_APPROX(vcf.array().pow(sf), Eigen::pow(vcf.array(), complex<float>(sf)));
+  VERIFY_MIX_SCALAR(pow(sd, vcd.array()), Eigen::pow(complex<double>(sd), vcd.array()));
+  VERIFY_IS_APPROX(Eigen::pow(vf.array(), scf), Eigen::pow(vf.template cast<complex<float> >().array(), scf));
+  VERIFY_IS_APPROX(vf.array().pow(scf), Eigen::pow(vf.template cast<complex<float> >().array(), scf));
+  VERIFY_MIX_SCALAR(Eigen::pow(scd, vd.array()), Eigen::pow(scd, vd.template cast<complex<double> >().array()));
 
   // check dot product
   vf.dot(vf);
@@ -143,78 +142,91 @@
 
   Mat_cd mcd2 = mcd;
   VERIFY_IS_APPROX(mcd.array() *= md.array(), mcd2.array() *= md.array().template cast<std::complex<double> >());
-  
+
   // check matrix-matrix products
-  VERIFY_IS_APPROX(sd*md*mcd, (sd*md).template cast<CD>().eval()*mcd);
-  VERIFY_IS_APPROX(sd*mcd*md, sd*mcd*md.template cast<CD>());
-  VERIFY_IS_APPROX(scd*md*mcd, scd*md.template cast<CD>().eval()*mcd);
-  VERIFY_IS_APPROX(scd*mcd*md, scd*mcd*md.template cast<CD>());
+  VERIFY_IS_APPROX(sd * md * mcd, (sd * md).template cast<CD>().eval() * mcd);
+  VERIFY_IS_APPROX(sd * mcd * md, sd * mcd * md.template cast<CD>());
+  VERIFY_IS_APPROX(scd * md * mcd, scd * md.template cast<CD>().eval() * mcd);
+  VERIFY_IS_APPROX(scd * mcd * md, scd * mcd * md.template cast<CD>());
 
-  VERIFY_IS_APPROX(sf*mf*mcf, sf*mf.template cast<CF>()*mcf);
-  VERIFY_IS_APPROX(sf*mcf*mf, sf*mcf*mf.template cast<CF>());
-  VERIFY_IS_APPROX(scf*mf*mcf, scf*mf.template cast<CF>()*mcf);
-  VERIFY_IS_APPROX(scf*mcf*mf, scf*mcf*mf.template cast<CF>());
+  VERIFY_IS_APPROX(sf * mf * mcf, sf * mf.template cast<CF>() * mcf);
+  VERIFY_IS_APPROX(sf * mcf * mf, sf * mcf * mf.template cast<CF>());
+  VERIFY_IS_APPROX(scf * mf * mcf, scf * mf.template cast<CF>() * mcf);
+  VERIFY_IS_APPROX(scf * mcf * mf, scf * mcf * mf.template cast<CF>());
 
-  VERIFY_IS_APPROX(sd*md.adjoint()*mcd, (sd*md).template cast<CD>().eval().adjoint()*mcd);
-  VERIFY_IS_APPROX(sd*mcd.adjoint()*md, sd*mcd.adjoint()*md.template cast<CD>());
-  VERIFY_IS_APPROX(sd*md.adjoint()*mcd.adjoint(), (sd*md).template cast<CD>().eval().adjoint()*mcd.adjoint());
-  VERIFY_IS_APPROX(sd*mcd.adjoint()*md.adjoint(), sd*mcd.adjoint()*md.template cast<CD>().adjoint());
-  VERIFY_IS_APPROX(sd*md*mcd.adjoint(), (sd*md).template cast<CD>().eval()*mcd.adjoint());
-  VERIFY_IS_APPROX(sd*mcd*md.adjoint(), sd*mcd*md.template cast<CD>().adjoint());
+  VERIFY_IS_APPROX(sd * md.adjoint() * mcd, (sd * md).template cast<CD>().eval().adjoint() * mcd);
+  VERIFY_IS_APPROX(sd * mcd.adjoint() * md, sd * mcd.adjoint() * md.template cast<CD>());
+  VERIFY_IS_APPROX(sd * md.adjoint() * mcd.adjoint(), (sd * md).template cast<CD>().eval().adjoint() * mcd.adjoint());
+  VERIFY_IS_APPROX(sd * mcd.adjoint() * md.adjoint(), sd * mcd.adjoint() * md.template cast<CD>().adjoint());
+  VERIFY_IS_APPROX(sd * md * mcd.adjoint(), (sd * md).template cast<CD>().eval() * mcd.adjoint());
+  VERIFY_IS_APPROX(sd * mcd * md.adjoint(), sd * mcd * md.template cast<CD>().adjoint());
 
-  VERIFY_IS_APPROX(sf*mf.adjoint()*mcf, (sf*mf).template cast<CF>().eval().adjoint()*mcf);
-  VERIFY_IS_APPROX(sf*mcf.adjoint()*mf, sf*mcf.adjoint()*mf.template cast<CF>());
-  VERIFY_IS_APPROX(sf*mf.adjoint()*mcf.adjoint(), (sf*mf).template cast<CF>().eval().adjoint()*mcf.adjoint());
-  VERIFY_IS_APPROX(sf*mcf.adjoint()*mf.adjoint(), sf*mcf.adjoint()*mf.template cast<CF>().adjoint());
-  VERIFY_IS_APPROX(sf*mf*mcf.adjoint(), (sf*mf).template cast<CF>().eval()*mcf.adjoint());
-  VERIFY_IS_APPROX(sf*mcf*mf.adjoint(), sf*mcf*mf.template cast<CF>().adjoint());
+  VERIFY_IS_APPROX(sf * mf.adjoint() * mcf, (sf * mf).template cast<CF>().eval().adjoint() * mcf);
+  VERIFY_IS_APPROX(sf * mcf.adjoint() * mf, sf * mcf.adjoint() * mf.template cast<CF>());
+  VERIFY_IS_APPROX(sf * mf.adjoint() * mcf.adjoint(), (sf * mf).template cast<CF>().eval().adjoint() * mcf.adjoint());
+  VERIFY_IS_APPROX(sf * mcf.adjoint() * mf.adjoint(), sf * mcf.adjoint() * mf.template cast<CF>().adjoint());
+  VERIFY_IS_APPROX(sf * mf * mcf.adjoint(), (sf * mf).template cast<CF>().eval() * mcf.adjoint());
+  VERIFY_IS_APPROX(sf * mcf * mf.adjoint(), sf * mcf * mf.template cast<CF>().adjoint());
 
-  VERIFY_IS_APPROX(sf*mf*vcf, (sf*mf).template cast<CF>().eval()*vcf);
-  VERIFY_IS_APPROX(scf*mf*vcf,(scf*mf.template cast<CF>()).eval()*vcf);
-  VERIFY_IS_APPROX(sf*mcf*vf, sf*mcf*vf.template cast<CF>());
-  VERIFY_IS_APPROX(scf*mcf*vf,scf*mcf*vf.template cast<CF>());
+  VERIFY_IS_APPROX(sf * mf * vcf, (sf * mf).template cast<CF>().eval() * vcf);
+  VERIFY_IS_APPROX(scf * mf * vcf, (scf * mf.template cast<CF>()).eval() * vcf);
+  VERIFY_IS_APPROX(sf * mcf * vf, sf * mcf * vf.template cast<CF>());
+  VERIFY_IS_APPROX(scf * mcf * vf, scf * mcf * vf.template cast<CF>());
 
-  VERIFY_IS_APPROX(sf*vcf.adjoint()*mf,  sf*vcf.adjoint()*mf.template cast<CF>().eval());
-  VERIFY_IS_APPROX(scf*vcf.adjoint()*mf, scf*vcf.adjoint()*mf.template cast<CF>().eval());
-  VERIFY_IS_APPROX(sf*vf.adjoint()*mcf,  sf*vf.adjoint().template cast<CF>().eval()*mcf);
-  VERIFY_IS_APPROX(scf*vf.adjoint()*mcf, scf*vf.adjoint().template cast<CF>().eval()*mcf);
+  VERIFY_IS_APPROX(sf * vcf.adjoint() * mf, sf * vcf.adjoint() * mf.template cast<CF>().eval());
+  VERIFY_IS_APPROX(scf * vcf.adjoint() * mf, scf * vcf.adjoint() * mf.template cast<CF>().eval());
+  VERIFY_IS_APPROX(sf * vf.adjoint() * mcf, sf * vf.adjoint().template cast<CF>().eval() * mcf);
+  VERIFY_IS_APPROX(scf * vf.adjoint() * mcf, scf * vf.adjoint().template cast<CF>().eval() * mcf);
 
-  VERIFY_IS_APPROX(sd*md*vcd, (sd*md).template cast<CD>().eval()*vcd);
-  VERIFY_IS_APPROX(scd*md*vcd,(scd*md.template cast<CD>()).eval()*vcd);
-  VERIFY_IS_APPROX(sd*mcd*vd, sd*mcd*vd.template cast<CD>().eval());
-  VERIFY_IS_APPROX(scd*mcd*vd,scd*mcd*vd.template cast<CD>().eval());
+  VERIFY_IS_APPROX(sd * md * vcd, (sd * md).template cast<CD>().eval() * vcd);
+  VERIFY_IS_APPROX(scd * md * vcd, (scd * md.template cast<CD>()).eval() * vcd);
+  VERIFY_IS_APPROX(sd * mcd * vd, sd * mcd * vd.template cast<CD>().eval());
+  VERIFY_IS_APPROX(scd * mcd * vd, scd * mcd * vd.template cast<CD>().eval());
 
-  VERIFY_IS_APPROX(sd*vcd.adjoint()*md,  sd*vcd.adjoint()*md.template cast<CD>().eval());
-  VERIFY_IS_APPROX(scd*vcd.adjoint()*md, scd*vcd.adjoint()*md.template cast<CD>().eval());
-  VERIFY_IS_APPROX(sd*vd.adjoint()*mcd,  sd*vd.adjoint().template cast<CD>().eval()*mcd);
-  VERIFY_IS_APPROX(scd*vd.adjoint()*mcd, scd*vd.adjoint().template cast<CD>().eval()*mcd);
+  VERIFY_IS_APPROX(sd * vcd.adjoint() * md, sd * vcd.adjoint() * md.template cast<CD>().eval());
+  VERIFY_IS_APPROX(scd * vcd.adjoint() * md, scd * vcd.adjoint() * md.template cast<CD>().eval());
+  VERIFY_IS_APPROX(sd * vd.adjoint() * mcd, sd * vd.adjoint().template cast<CD>().eval() * mcd);
+  VERIFY_IS_APPROX(scd * vd.adjoint() * mcd, scd * vd.adjoint().template cast<CD>().eval() * mcd);
 
-  VERIFY_IS_APPROX( sd*vcd.adjoint()*md.template triangularView<Upper>(),  sd*vcd.adjoint()*md.template cast<CD>().eval().template triangularView<Upper>());
-  VERIFY_IS_APPROX(scd*vcd.adjoint()*md.template triangularView<Lower>(), scd*vcd.adjoint()*md.template cast<CD>().eval().template triangularView<Lower>());
-  VERIFY_IS_APPROX( sd*vcd.adjoint()*md.transpose().template triangularView<Upper>(),  sd*vcd.adjoint()*md.transpose().template cast<CD>().eval().template triangularView<Upper>());
-  VERIFY_IS_APPROX(scd*vcd.adjoint()*md.transpose().template triangularView<Lower>(), scd*vcd.adjoint()*md.transpose().template cast<CD>().eval().template triangularView<Lower>());
-  VERIFY_IS_APPROX( sd*vd.adjoint()*mcd.template triangularView<Lower>(),  sd*vd.adjoint().template cast<CD>().eval()*mcd.template triangularView<Lower>());
-  VERIFY_IS_APPROX(scd*vd.adjoint()*mcd.template triangularView<Upper>(), scd*vd.adjoint().template cast<CD>().eval()*mcd.template triangularView<Upper>());
-  VERIFY_IS_APPROX( sd*vd.adjoint()*mcd.transpose().template triangularView<Lower>(),  sd*vd.adjoint().template cast<CD>().eval()*mcd.transpose().template triangularView<Lower>());
-  VERIFY_IS_APPROX(scd*vd.adjoint()*mcd.transpose().template triangularView<Upper>(), scd*vd.adjoint().template cast<CD>().eval()*mcd.transpose().template triangularView<Upper>());
+  VERIFY_IS_APPROX(sd * vcd.adjoint() * md.template triangularView<Upper>(),
+                   sd * vcd.adjoint() * md.template cast<CD>().eval().template triangularView<Upper>());
+  VERIFY_IS_APPROX(scd * vcd.adjoint() * md.template triangularView<Lower>(),
+                   scd * vcd.adjoint() * md.template cast<CD>().eval().template triangularView<Lower>());
+  VERIFY_IS_APPROX(sd * vcd.adjoint() * md.transpose().template triangularView<Upper>(),
+                   sd * vcd.adjoint() * md.transpose().template cast<CD>().eval().template triangularView<Upper>());
+  VERIFY_IS_APPROX(scd * vcd.adjoint() * md.transpose().template triangularView<Lower>(),
+                   scd * vcd.adjoint() * md.transpose().template cast<CD>().eval().template triangularView<Lower>());
+  VERIFY_IS_APPROX(sd * vd.adjoint() * mcd.template triangularView<Lower>(),
+                   sd * vd.adjoint().template cast<CD>().eval() * mcd.template triangularView<Lower>());
+  VERIFY_IS_APPROX(scd * vd.adjoint() * mcd.template triangularView<Upper>(),
+                   scd * vd.adjoint().template cast<CD>().eval() * mcd.template triangularView<Upper>());
+  VERIFY_IS_APPROX(sd * vd.adjoint() * mcd.transpose().template triangularView<Lower>(),
+                   sd * vd.adjoint().template cast<CD>().eval() * mcd.transpose().template triangularView<Lower>());
+  VERIFY_IS_APPROX(scd * vd.adjoint() * mcd.transpose().template triangularView<Upper>(),
+                   scd * vd.adjoint().template cast<CD>().eval() * mcd.transpose().template triangularView<Upper>());
 
   // Not supported yet: trmm
-//   VERIFY_IS_APPROX(sd*mcd*md.template triangularView<Lower>(),  sd*mcd*md.template cast<CD>().eval().template triangularView<Lower>());
-//   VERIFY_IS_APPROX(scd*mcd*md.template triangularView<Upper>(), scd*mcd*md.template cast<CD>().eval().template triangularView<Upper>());
-//   VERIFY_IS_APPROX(sd*md*mcd.template triangularView<Lower>(),  sd*md.template cast<CD>().eval()*mcd.template triangularView<Lower>());
-//   VERIFY_IS_APPROX(scd*md*mcd.template triangularView<Upper>(), scd*md.template cast<CD>().eval()*mcd.template triangularView<Upper>());
+  //   VERIFY_IS_APPROX(sd*mcd*md.template triangularView<Lower>(),  sd*mcd*md.template cast<CD>().eval().template
+  //   triangularView<Lower>()); VERIFY_IS_APPROX(scd*mcd*md.template triangularView<Upper>(), scd*mcd*md.template
+  //   cast<CD>().eval().template triangularView<Upper>()); VERIFY_IS_APPROX(sd*md*mcd.template triangularView<Lower>(),
+  //   sd*md.template cast<CD>().eval()*mcd.template triangularView<Lower>()); VERIFY_IS_APPROX(scd*md*mcd.template
+  //   triangularView<Upper>(), scd*md.template cast<CD>().eval()*mcd.template triangularView<Upper>());
 
   // Not supported yet: symv
-//   VERIFY_IS_APPROX(sd*vcd.adjoint()*md.template selfadjointView<Upper>(),  sd*vcd.adjoint()*md.template cast<CD>().eval().template selfadjointView<Upper>());
-//   VERIFY_IS_APPROX(scd*vcd.adjoint()*md.template selfadjointView<Lower>(), scd*vcd.adjoint()*md.template cast<CD>().eval().template selfadjointView<Lower>());
-//   VERIFY_IS_APPROX(sd*vd.adjoint()*mcd.template selfadjointView<Lower>(),  sd*vd.adjoint().template cast<CD>().eval()*mcd.template selfadjointView<Lower>());
-//   VERIFY_IS_APPROX(scd*vd.adjoint()*mcd.template selfadjointView<Upper>(), scd*vd.adjoint().template cast<CD>().eval()*mcd.template selfadjointView<Upper>());
+  //   VERIFY_IS_APPROX(sd*vcd.adjoint()*md.template selfadjointView<Upper>(),  sd*vcd.adjoint()*md.template
+  //   cast<CD>().eval().template selfadjointView<Upper>()); VERIFY_IS_APPROX(scd*vcd.adjoint()*md.template
+  //   selfadjointView<Lower>(), scd*vcd.adjoint()*md.template cast<CD>().eval().template selfadjointView<Lower>());
+  //   VERIFY_IS_APPROX(sd*vd.adjoint()*mcd.template selfadjointView<Lower>(),  sd*vd.adjoint().template
+  //   cast<CD>().eval()*mcd.template selfadjointView<Lower>()); VERIFY_IS_APPROX(scd*vd.adjoint()*mcd.template
+  //   selfadjointView<Upper>(), scd*vd.adjoint().template cast<CD>().eval()*mcd.template selfadjointView<Upper>());
 
   // Not supported yet: symm
-//   VERIFY_IS_APPROX(sd*vcd.adjoint()*md.template selfadjointView<Upper>(),  sd*vcd.adjoint()*md.template cast<CD>().eval().template selfadjointView<Upper>());
-//   VERIFY_IS_APPROX(scd*vcd.adjoint()*md.template selfadjointView<Upper>(), scd*vcd.adjoint()*md.template cast<CD>().eval().template selfadjointView<Upper>());
-//   VERIFY_IS_APPROX(sd*vd.adjoint()*mcd.template selfadjointView<Upper>(),  sd*vd.adjoint().template cast<CD>().eval()*mcd.template selfadjointView<Upper>());
-//   VERIFY_IS_APPROX(scd*vd.adjoint()*mcd.template selfadjointView<Upper>(), scd*vd.adjoint().template cast<CD>().eval()*mcd.template selfadjointView<Upper>());
+  //   VERIFY_IS_APPROX(sd*vcd.adjoint()*md.template selfadjointView<Upper>(),  sd*vcd.adjoint()*md.template
+  //   cast<CD>().eval().template selfadjointView<Upper>()); VERIFY_IS_APPROX(scd*vcd.adjoint()*md.template
+  //   selfadjointView<Upper>(), scd*vcd.adjoint()*md.template cast<CD>().eval().template selfadjointView<Upper>());
+  //   VERIFY_IS_APPROX(sd*vd.adjoint()*mcd.template selfadjointView<Upper>(),  sd*vd.adjoint().template
+  //   cast<CD>().eval()*mcd.template selfadjointView<Upper>()); VERIFY_IS_APPROX(scd*vd.adjoint()*mcd.template
+  //   selfadjointView<Upper>(), scd*vd.adjoint().template cast<CD>().eval()*mcd.template selfadjointView<Upper>());
 
   rcd.setZero();
   VERIFY_IS_APPROX(Mat_cd(rcd.template triangularView<Upper>() = sd * mcd * md),
@@ -226,74 +238,69 @@
   VERIFY_IS_APPROX(Mat_cd(rcd.template triangularView<Upper>() = scd * md * mcd),
                    Mat_cd((scd * md.template cast<CD>().eval() * mcd).template triangularView<Upper>()));
 
+  VERIFY_IS_APPROX(md.array() * mcd.array(), md.template cast<CD>().eval().array() * mcd.array());
+  VERIFY_IS_APPROX(mcd.array() * md.array(), mcd.array() * md.template cast<CD>().eval().array());
 
-  VERIFY_IS_APPROX( md.array()  * mcd.array(), md.template cast<CD>().eval().array() * mcd.array() );
-  VERIFY_IS_APPROX( mcd.array() * md.array(),  mcd.array() * md.template cast<CD>().eval().array() );
+  VERIFY_IS_APPROX(md.array() + mcd.array(), md.template cast<CD>().eval().array() + mcd.array());
+  VERIFY_IS_APPROX(mcd.array() + md.array(), mcd.array() + md.template cast<CD>().eval().array());
 
-  VERIFY_IS_APPROX( md.array()  + mcd.array(), md.template cast<CD>().eval().array() + mcd.array() );
-  VERIFY_IS_APPROX( mcd.array() + md.array(),  mcd.array() + md.template cast<CD>().eval().array() );
+  VERIFY_IS_APPROX(md.array() - mcd.array(), md.template cast<CD>().eval().array() - mcd.array());
+  VERIFY_IS_APPROX(mcd.array() - md.array(), mcd.array() - md.template cast<CD>().eval().array());
 
-  VERIFY_IS_APPROX( md.array()  - mcd.array(), md.template cast<CD>().eval().array() - mcd.array() );
-  VERIFY_IS_APPROX( mcd.array() - md.array(),  mcd.array() - md.template cast<CD>().eval().array() );
-
-  if(mcd.array().abs().minCoeff()>epsd)
-  {
-    VERIFY_IS_APPROX( md.array() / mcd.array(), md.template cast<CD>().eval().array() / mcd.array() );
+  if (mcd.array().abs().minCoeff() > epsd) {
+    VERIFY_IS_APPROX(md.array() / mcd.array(), md.template cast<CD>().eval().array() / mcd.array());
   }
-  if(md.array().abs().minCoeff()>epsd)
-  {
-    VERIFY_IS_APPROX( mcd.array() / md.array(), mcd.array() / md.template cast<CD>().eval().array() );
+  if (md.array().abs().minCoeff() > epsd) {
+    VERIFY_IS_APPROX(mcd.array() / md.array(), mcd.array() / md.template cast<CD>().eval().array());
   }
 
-  if(md.array().abs().minCoeff()>epsd || mcd.array().abs().minCoeff()>epsd)
-  {
-    VERIFY_IS_APPROX( md.array().pow(mcd.array()), md.template cast<CD>().eval().array().pow(mcd.array()) );
-    VERIFY_IS_APPROX( mcd.array().pow(md.array()),  mcd.array().pow(md.template cast<CD>().eval().array()) );
+  if (md.array().abs().minCoeff() > epsd || mcd.array().abs().minCoeff() > epsd) {
+    VERIFY_IS_APPROX(md.array().pow(mcd.array()), md.template cast<CD>().eval().array().pow(mcd.array()));
+    VERIFY_IS_APPROX(mcd.array().pow(md.array()), mcd.array().pow(md.template cast<CD>().eval().array()));
 
-    VERIFY_IS_APPROX( pow(md.array(),mcd.array()), md.template cast<CD>().eval().array().pow(mcd.array()) );
-    VERIFY_IS_APPROX( pow(mcd.array(),md.array()),  mcd.array().pow(md.template cast<CD>().eval().array()) );
+    VERIFY_IS_APPROX(pow(md.array(), mcd.array()), md.template cast<CD>().eval().array().pow(mcd.array()));
+    VERIFY_IS_APPROX(pow(mcd.array(), md.array()), mcd.array().pow(md.template cast<CD>().eval().array()));
   }
 
   rcd = mcd;
-  VERIFY_IS_APPROX( rcd = md, md.template cast<CD>().eval() );
+  VERIFY_IS_APPROX(rcd = md, md.template cast<CD>().eval());
   rcd = mcd;
-  VERIFY_IS_APPROX( rcd += md, mcd + md.template cast<CD>().eval() );
+  VERIFY_IS_APPROX(rcd += md, mcd + md.template cast<CD>().eval());
   rcd = mcd;
-  VERIFY_IS_APPROX( rcd -= md, mcd - md.template cast<CD>().eval() );
+  VERIFY_IS_APPROX(rcd -= md, mcd - md.template cast<CD>().eval());
   rcd = mcd;
-  VERIFY_IS_APPROX( rcd.array() *= md.array(), mcd.array() * md.template cast<CD>().eval().array() );
+  VERIFY_IS_APPROX(rcd.array() *= md.array(), mcd.array() * md.template cast<CD>().eval().array());
   rcd = mcd;
-  if(md.array().abs().minCoeff()>epsd)
-  {
-    VERIFY_IS_APPROX( rcd.array() /= md.array(), mcd.array() / md.template cast<CD>().eval().array() );
+  if (md.array().abs().minCoeff() > epsd) {
+    VERIFY_IS_APPROX(rcd.array() /= md.array(), mcd.array() / md.template cast<CD>().eval().array());
   }
 
   rcd = mcd;
-  VERIFY_IS_APPROX( rcd.noalias() += md + mcd*md, mcd + (md.template cast<CD>().eval()) + mcd*(md.template cast<CD>().eval()));
+  VERIFY_IS_APPROX(rcd.noalias() += md + mcd * md,
+                   mcd + (md.template cast<CD>().eval()) + mcd * (md.template cast<CD>().eval()));
 
-  VERIFY_IS_APPROX( rcd.noalias()  = md*md,       ((md*md).eval().template cast<CD>()) );
+  VERIFY_IS_APPROX(rcd.noalias() = md * md, ((md * md).eval().template cast<CD>()));
   rcd = mcd;
-  VERIFY_IS_APPROX( rcd.noalias() += md*md, mcd + ((md*md).eval().template cast<CD>()) );
+  VERIFY_IS_APPROX(rcd.noalias() += md * md, mcd + ((md * md).eval().template cast<CD>()));
   rcd = mcd;
-  VERIFY_IS_APPROX( rcd.noalias() -= md*md, mcd - ((md*md).eval().template cast<CD>()) );
+  VERIFY_IS_APPROX(rcd.noalias() -= md * md, mcd - ((md * md).eval().template cast<CD>()));
 
-  VERIFY_IS_APPROX( rcd.noalias()  = mcd + md*md,       mcd + ((md*md).eval().template cast<CD>()) );
+  VERIFY_IS_APPROX(rcd.noalias() = mcd + md * md, mcd + ((md * md).eval().template cast<CD>()));
   rcd = mcd;
-  VERIFY_IS_APPROX( rcd.noalias() += mcd + md*md, mcd + mcd + ((md*md).eval().template cast<CD>()) );
+  VERIFY_IS_APPROX(rcd.noalias() += mcd + md * md, mcd + mcd + ((md * md).eval().template cast<CD>()));
   rcd = mcd;
-  VERIFY_IS_APPROX( rcd.noalias() -= mcd + md*md,           - ((md*md).eval().template cast<CD>()) );
+  VERIFY_IS_APPROX(rcd.noalias() -= mcd + md * md, -((md * md).eval().template cast<CD>()));
 }
 
-EIGEN_DECLARE_TEST(mixingtypes)
-{
-  g_called = false; // Silence -Wunneeded-internal-declaration.
-  for(int i = 0; i < g_repeat; i++) {
+EIGEN_DECLARE_TEST(mixingtypes) {
+  g_called = false;  // Silence -Wunneeded-internal-declaration.
+  for (int i = 0; i < g_repeat; i++) {
     CALL_SUBTEST_1(mixingtypes<3>());
     CALL_SUBTEST_2(mixingtypes<4>());
-    CALL_SUBTEST_3(mixingtypes<Dynamic>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE)));
+    CALL_SUBTEST_3(mixingtypes<Dynamic>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE)));
 
     CALL_SUBTEST_4(mixingtypes<3>());
     CALL_SUBTEST_5(mixingtypes<4>());
-    CALL_SUBTEST_6(mixingtypes<Dynamic>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE)));
+    CALL_SUBTEST_6(mixingtypes<Dynamic>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE)));
   }
 }
diff --git a/test/nestbyvalue.cpp b/test/nestbyvalue.cpp
index c25f0bf..f65621a 100644
--- a/test/nestbyvalue.cpp
+++ b/test/nestbyvalue.cpp
@@ -12,28 +12,26 @@
 #include "main.h"
 
 typedef NestByValue<MatrixXd> CpyMatrixXd;
-typedef CwiseBinaryOp<internal::scalar_sum_op<double,double>,const CpyMatrixXd,const CpyMatrixXd> XprType;
+typedef CwiseBinaryOp<internal::scalar_sum_op<double, double>, const CpyMatrixXd, const CpyMatrixXd> XprType;
 
-XprType get_xpr_with_temps(const MatrixXd& a)
-{
+XprType get_xpr_with_temps(const MatrixXd& a) {
   MatrixXd t1 = a.rowwise().reverse();
-  MatrixXd t2 = a+a;
+  MatrixXd t2 = a + a;
   return t1.nestByValue() + t2.nestByValue();
 }
 
-EIGEN_DECLARE_TEST(nestbyvalue)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    Index rows = internal::random<Index>(1,EIGEN_TEST_MAX_SIZE);
-    Index cols = internal::random<Index>(1,EIGEN_TEST_MAX_SIZE);
-    MatrixXd a = MatrixXd::Random(rows,cols);
+EIGEN_DECLARE_TEST(nestbyvalue) {
+  for (int i = 0; i < g_repeat; i++) {
+    Index rows = internal::random<Index>(1, EIGEN_TEST_MAX_SIZE);
+    Index cols = internal::random<Index>(1, EIGEN_TEST_MAX_SIZE);
+    MatrixXd a = MatrixXd::Random(rows, cols);
     nb_temporaries = 0;
     XprType x = get_xpr_with_temps(a);
-    VERIFY_IS_EQUAL(nb_temporaries,6);
+    VERIFY_IS_EQUAL(nb_temporaries, 6);
     MatrixXd b = x;
-    VERIFY_IS_EQUAL(nb_temporaries,6+1);
-    VERIFY_IS_APPROX(b, a.rowwise().reverse().eval() + (a+a).eval());
+    VERIFY_IS_EQUAL(nb_temporaries, 6 + 1);
+    VERIFY_IS_APPROX(b, a.rowwise().reverse().eval() + (a + a).eval());
     // Block expressions work with dense NestByValue.
-    VERIFY_IS_APPROX(b, a.nestByValue().rowwise().reverse().eval() + (a.nestByValue()+a.nestByValue()).eval());
+    VERIFY_IS_APPROX(b, a.nestByValue().rowwise().reverse().eval() + (a.nestByValue() + a.nestByValue()).eval());
   }
 }
diff --git a/test/nesting_ops.cpp b/test/nesting_ops.cpp
index 1350994..ec47e21 100644
--- a/test/nesting_ops.cpp
+++ b/test/nesting_ops.cpp
@@ -13,95 +13,89 @@
 #include "main.h"
 
 template <int N, typename XprType>
-void use_n_times(const XprType &xpr)
-{
-  typename internal::nested_eval<XprType,N>::type mat(xpr);
+void use_n_times(const XprType& xpr) {
+  typename internal::nested_eval<XprType, N>::type mat(xpr);
   typename XprType::PlainObject res(mat.rows(), mat.cols());
-  nb_temporaries--; // remove res
+  nb_temporaries--;  // remove res
   res.setZero();
-  for(int i=0; i<N; ++i)
-    res += mat;
+  for (int i = 0; i < N; ++i) res += mat;
 }
 
 template <int N, typename ReferenceType, typename XprType>
-bool verify_eval_type(const XprType &, const ReferenceType&)
-{
-  typedef typename internal::nested_eval<XprType,N>::type EvalType;
+bool verify_eval_type(const XprType&, const ReferenceType&) {
+  typedef typename internal::nested_eval<XprType, N>::type EvalType;
   return internal::is_same<internal::remove_all_t<EvalType>, internal::remove_all_t<ReferenceType>>::value;
 }
 
-template <typename MatrixType> void run_nesting_ops_1(const MatrixType& _m)
-{
-  typename internal::nested_eval<MatrixType,2>::type m(_m);
+template <typename MatrixType>
+void run_nesting_ops_1(const MatrixType& _m) {
+  typename internal::nested_eval<MatrixType, 2>::type m(_m);
 
   // Make really sure that we are in debug mode!
   VERIFY_RAISES_ASSERT(eigen_assert(false));
 
   // The only intention of these tests is to ensure that this code does
   // not trigger any asserts or segmentation faults... more to come.
-  VERIFY_IS_APPROX( (m.transpose() * m).diagonal().sum(), (m.transpose() * m).diagonal().sum() );
-  VERIFY_IS_APPROX( (m.transpose() * m).diagonal().array().abs().sum(), (m.transpose() * m).diagonal().array().abs().sum() );
+  VERIFY_IS_APPROX((m.transpose() * m).diagonal().sum(), (m.transpose() * m).diagonal().sum());
+  VERIFY_IS_APPROX((m.transpose() * m).diagonal().array().abs().sum(),
+                   (m.transpose() * m).diagonal().array().abs().sum());
 
-  VERIFY_IS_APPROX( (m.transpose() * m).array().abs().sum(), (m.transpose() * m).array().abs().sum() );
+  VERIFY_IS_APPROX((m.transpose() * m).array().abs().sum(), (m.transpose() * m).array().abs().sum());
 }
 
-template <typename MatrixType> void run_nesting_ops_2(const MatrixType& _m)
-{
+template <typename MatrixType>
+void run_nesting_ops_2(const MatrixType& _m) {
   typedef typename MatrixType::Scalar Scalar;
   Index rows = _m.rows();
   Index cols = _m.cols();
-  MatrixType m1 = MatrixType::Random(rows,cols);
-  Matrix<Scalar,MatrixType::RowsAtCompileTime,MatrixType::ColsAtCompileTime,ColMajor> m2;
+  MatrixType m1 = MatrixType::Random(rows, cols);
+  Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime, ColMajor> m2;
 
-  if((MatrixType::SizeAtCompileTime==Dynamic))
-  {
-    VERIFY_EVALUATION_COUNT( use_n_times<1>(m1 + m1*m1), 1 );
-    VERIFY_EVALUATION_COUNT( use_n_times<10>(m1 + m1*m1), 1 );
+  if ((MatrixType::SizeAtCompileTime == Dynamic)) {
+    VERIFY_EVALUATION_COUNT(use_n_times<1>(m1 + m1 * m1), 1);
+    VERIFY_EVALUATION_COUNT(use_n_times<10>(m1 + m1 * m1), 1);
 
-    VERIFY_EVALUATION_COUNT( use_n_times<1>(m1.template triangularView<Lower>().solve(m1.col(0))), 1 );
-    VERIFY_EVALUATION_COUNT( use_n_times<10>(m1.template triangularView<Lower>().solve(m1.col(0))), 1 );
+    VERIFY_EVALUATION_COUNT(use_n_times<1>(m1.template triangularView<Lower>().solve(m1.col(0))), 1);
+    VERIFY_EVALUATION_COUNT(use_n_times<10>(m1.template triangularView<Lower>().solve(m1.col(0))), 1);
 
-    VERIFY_EVALUATION_COUNT( use_n_times<1>(Scalar(2)*m1.template triangularView<Lower>().solve(m1.col(0))), 2 ); // FIXME could be one by applying the scaling in-place on the solve result
-    VERIFY_EVALUATION_COUNT( use_n_times<1>(m1.col(0)+m1.template triangularView<Lower>().solve(m1.col(0))), 2 ); // FIXME could be one by adding m1.col() inplace
-    VERIFY_EVALUATION_COUNT( use_n_times<10>(m1.col(0)+m1.template triangularView<Lower>().solve(m1.col(0))), 2 );
+    VERIFY_EVALUATION_COUNT(use_n_times<1>(Scalar(2) * m1.template triangularView<Lower>().solve(m1.col(0))),
+                            2);  // FIXME could be one by applying the scaling in-place on the solve result
+    VERIFY_EVALUATION_COUNT(use_n_times<1>(m1.col(0) + m1.template triangularView<Lower>().solve(m1.col(0))),
+                            2);  // FIXME could be one by adding m1.col() inplace
+    VERIFY_EVALUATION_COUNT(use_n_times<10>(m1.col(0) + m1.template triangularView<Lower>().solve(m1.col(0))), 2);
   }
 
   {
-    VERIFY( verify_eval_type<10>(m1, m1) );
-    if(!NumTraits<Scalar>::IsComplex)
-    {
-      VERIFY( verify_eval_type<3>(2*m1, 2*m1) );
-      VERIFY( verify_eval_type<4>(2*m1, m1) );
+    VERIFY(verify_eval_type<10>(m1, m1));
+    if (!NumTraits<Scalar>::IsComplex) {
+      VERIFY(verify_eval_type<3>(2 * m1, 2 * m1));
+      VERIFY(verify_eval_type<4>(2 * m1, m1));
+    } else {
+      VERIFY(verify_eval_type<2>(2 * m1, 2 * m1));
+      VERIFY(verify_eval_type<3>(2 * m1, m1));
     }
-    else
-    {
-      VERIFY( verify_eval_type<2>(2*m1, 2*m1) );
-      VERIFY( verify_eval_type<3>(2*m1, m1) );
-    }
-    VERIFY( verify_eval_type<2>(m1+m1, m1+m1) );
-    VERIFY( verify_eval_type<3>(m1+m1, m1) );
-    VERIFY( verify_eval_type<1>(m1*m1.transpose(), m2) );
-    VERIFY( verify_eval_type<1>(m1*(m1+m1).transpose(), m2) );
-    VERIFY( verify_eval_type<2>(m1*m1.transpose(), m2) );
-    VERIFY( verify_eval_type<1>(m1+m1*m1, m1) );
+    VERIFY(verify_eval_type<2>(m1 + m1, m1 + m1));
+    VERIFY(verify_eval_type<3>(m1 + m1, m1));
+    VERIFY(verify_eval_type<1>(m1 * m1.transpose(), m2));
+    VERIFY(verify_eval_type<1>(m1 * (m1 + m1).transpose(), m2));
+    VERIFY(verify_eval_type<2>(m1 * m1.transpose(), m2));
+    VERIFY(verify_eval_type<1>(m1 + m1 * m1, m1));
 
-    VERIFY( verify_eval_type<1>(m1.template triangularView<Lower>().solve(m1), m1) );
-    VERIFY( verify_eval_type<1>(m1+m1.template triangularView<Lower>().solve(m1), m1) );
+    VERIFY(verify_eval_type<1>(m1.template triangularView<Lower>().solve(m1), m1));
+    VERIFY(verify_eval_type<1>(m1 + m1.template triangularView<Lower>().solve(m1), m1));
   }
 }
 
-
-EIGEN_DECLARE_TEST(nesting_ops)
-{
-  CALL_SUBTEST_1(run_nesting_ops_1(MatrixXf::Random(25,25)));
-  CALL_SUBTEST_2(run_nesting_ops_1(MatrixXcd::Random(25,25)));
+EIGEN_DECLARE_TEST(nesting_ops) {
+  CALL_SUBTEST_1(run_nesting_ops_1(MatrixXf::Random(25, 25)));
+  CALL_SUBTEST_2(run_nesting_ops_1(MatrixXcd::Random(25, 25)));
   CALL_SUBTEST_3(run_nesting_ops_1(Matrix4f::Random()));
   CALL_SUBTEST_4(run_nesting_ops_1(Matrix2d::Random()));
 
-  Index s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE);
-  CALL_SUBTEST_1( run_nesting_ops_2(MatrixXf(s,s)) );
-  CALL_SUBTEST_2( run_nesting_ops_2(MatrixXcd(s,s)) );
-  CALL_SUBTEST_3( run_nesting_ops_2(Matrix4f()) );
-  CALL_SUBTEST_4( run_nesting_ops_2(Matrix2d()) );
+  Index s = internal::random<int>(1, EIGEN_TEST_MAX_SIZE);
+  CALL_SUBTEST_1(run_nesting_ops_2(MatrixXf(s, s)));
+  CALL_SUBTEST_2(run_nesting_ops_2(MatrixXcd(s, s)));
+  CALL_SUBTEST_3(run_nesting_ops_2(Matrix4f()));
+  CALL_SUBTEST_4(run_nesting_ops_2(Matrix2d()));
   TEST_SET_BUT_UNUSED_VARIABLE(s)
 }
diff --git a/test/nomalloc.cpp b/test/nomalloc.cpp
index 4b7934f..c9956d3 100644
--- a/test/nomalloc.cpp
+++ b/test/nomalloc.cpp
@@ -20,29 +20,26 @@
 #include <Eigen/QR>
 #include <Eigen/SVD>
 
-template<typename MatrixType> void nomalloc(const MatrixType& m)
-{
+template <typename MatrixType>
+void nomalloc(const MatrixType& m) {
   /* this test check no dynamic memory allocation are issued with fixed-size matrices
-  */
+   */
   typedef typename MatrixType::Scalar Scalar;
 
   Index rows = m.rows();
   Index cols = m.cols();
 
-  MatrixType m1 = MatrixType::Random(rows, cols),
-             m2 = MatrixType::Random(rows, cols),
-             m3(rows, cols);
+  MatrixType m1 = MatrixType::Random(rows, cols), m2 = MatrixType::Random(rows, cols), m3(rows, cols);
 
   Scalar s1 = internal::random<Scalar>();
 
-  Index r = internal::random<Index>(0, rows-1),
-        c = internal::random<Index>(0, cols-1);
+  Index r = internal::random<Index>(0, rows - 1), c = internal::random<Index>(0, cols - 1);
 
-  VERIFY_IS_APPROX((m1+m2)*s1,              s1*m1+s1*m2);
-  VERIFY_IS_APPROX((m1+m2)(r,c), (m1(r,c))+(m2(r,c)));
-  VERIFY_IS_APPROX(m1.cwiseProduct(m1.block(0,0,rows,cols)), (m1.array()*m1.array()).matrix());
-  VERIFY_IS_APPROX((m1*m1.transpose())*m2,  m1*(m1.transpose()*m2));
-  
+  VERIFY_IS_APPROX((m1 + m2) * s1, s1 * m1 + s1 * m2);
+  VERIFY_IS_APPROX((m1 + m2)(r, c), (m1(r, c)) + (m2(r, c)));
+  VERIFY_IS_APPROX(m1.cwiseProduct(m1.block(0, 0, rows, cols)), (m1.array() * m1.array()).matrix());
+  VERIFY_IS_APPROX((m1 * m1.transpose()) * m2, m1 * (m1.transpose() * m2));
+
   m2.col(0).noalias() = m1 * m1.col(0);
   m2.col(0).noalias() -= m1.adjoint() * m1.col(0);
   m2.col(0).noalias() -= m1 * m1.row(0).adjoint();
@@ -52,8 +49,8 @@
   m2.row(0).noalias() -= m1.row(0) * m1.adjoint();
   m2.row(0).noalias() -= m1.col(0).adjoint() * m1;
   m2.row(0).noalias() -= m1.col(0).adjoint() * m1.adjoint();
-  VERIFY_IS_APPROX(m2,m2);
-  
+  VERIFY_IS_APPROX(m2, m2);
+
   m2.col(0).noalias() = m1.template triangularView<Upper>() * m1.col(0);
   m2.col(0).noalias() -= m1.adjoint().template triangularView<Upper>() * m1.col(0);
   m2.col(0).noalias() -= m1.template triangularView<Upper>() * m1.row(0).adjoint();
@@ -63,8 +60,8 @@
   m2.row(0).noalias() -= m1.row(0) * m1.adjoint().template triangularView<Upper>();
   m2.row(0).noalias() -= m1.col(0).adjoint() * m1.template triangularView<Upper>();
   m2.row(0).noalias() -= m1.col(0).adjoint() * m1.adjoint().template triangularView<Upper>();
-  VERIFY_IS_APPROX(m2,m2);
-  
+  VERIFY_IS_APPROX(m2, m2);
+
   m2.col(0).noalias() = m1.template selfadjointView<Upper>() * m1.col(0);
   m2.col(0).noalias() -= m1.adjoint().template selfadjointView<Upper>() * m1.col(0);
   m2.col(0).noalias() -= m1.template selfadjointView<Upper>() * m1.row(0).adjoint();
@@ -74,85 +71,89 @@
   m2.row(0).noalias() -= m1.row(0) * m1.adjoint().template selfadjointView<Upper>();
   m2.row(0).noalias() -= m1.col(0).adjoint() * m1.template selfadjointView<Upper>();
   m2.row(0).noalias() -= m1.col(0).adjoint() * m1.adjoint().template selfadjointView<Upper>();
-  VERIFY_IS_APPROX(m2,m2);
-  
-  m2.template selfadjointView<Lower>().rankUpdate(m1.col(0),-1);
-  m2.template selfadjointView<Upper>().rankUpdate(m1.row(0),-1);
-  m2.template selfadjointView<Lower>().rankUpdate(m1.col(0), m1.col(0)); // rank-2
+  VERIFY_IS_APPROX(m2, m2);
+
+  m2.template selfadjointView<Lower>().rankUpdate(m1.col(0), -1);
+  m2.template selfadjointView<Upper>().rankUpdate(m1.row(0), -1);
+  m2.template selfadjointView<Lower>().rankUpdate(m1.col(0), m1.col(0));  // rank-2
 
   // The following fancy matrix-matrix products are not safe yet regarding static allocation
   m2.template selfadjointView<Lower>().rankUpdate(m1);
   m2 += m2.template triangularView<Upper>() * m1;
   m2.template triangularView<Upper>() = m2 * m2;
   m1 += m1.template selfadjointView<Lower>() * m2;
-  VERIFY_IS_APPROX(m2,m2);
+  VERIFY_IS_APPROX(m2, m2);
 }
 
-template<typename Scalar>
-void ctms_decompositions()
-{
+template <typename Scalar>
+void ctms_decompositions() {
   const int maxSize = 16;
-  const int size    = 12;
+  const int size = 12;
 
-  typedef Eigen::Matrix<Scalar,
-                        Eigen::Dynamic, Eigen::Dynamic,
-                        0,
-                        maxSize, maxSize> Matrix;
+  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, 0, maxSize, maxSize> Matrix;
 
-  typedef Eigen::Matrix<Scalar,
-                        Eigen::Dynamic, 1,
-                        0,
-                        maxSize, 1> Vector;
+  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, 1, 0, maxSize, 1> Vector;
 
-  typedef Eigen::Matrix<std::complex<Scalar>,
-                        Eigen::Dynamic, Eigen::Dynamic,
-                        0,
-                        maxSize, maxSize> ComplexMatrix;
+  typedef Eigen::Matrix<std::complex<Scalar>, Eigen::Dynamic, Eigen::Dynamic, 0, maxSize, maxSize> ComplexMatrix;
 
   const Matrix A(Matrix::Random(size, size)), B(Matrix::Random(size, size));
-  Matrix X(size,size);
+  Matrix X(size, size);
   const ComplexMatrix complexA(ComplexMatrix::Random(size, size));
   const Matrix saA = A.adjoint() * A;
   const Vector b(Vector::Random(size));
   Vector x(size);
 
   // Cholesky module
-  Eigen::LLT<Matrix>  LLT;  LLT.compute(A);
+  Eigen::LLT<Matrix> LLT;
+  LLT.compute(A);
   X = LLT.solve(B);
   x = LLT.solve(b);
-  Eigen::LDLT<Matrix> LDLT; LDLT.compute(A);
+  Eigen::LDLT<Matrix> LDLT;
+  LDLT.compute(A);
   X = LDLT.solve(B);
   x = LDLT.solve(b);
 
   // Eigenvalues module
-  Eigen::HessenbergDecomposition<ComplexMatrix> hessDecomp;        hessDecomp.compute(complexA);
-  Eigen::ComplexSchur<ComplexMatrix>            cSchur(size);      cSchur.compute(complexA);
-  Eigen::ComplexEigenSolver<ComplexMatrix>      cEigSolver;        cEigSolver.compute(complexA);
-  Eigen::EigenSolver<Matrix>                    eigSolver;         eigSolver.compute(A);
-  Eigen::SelfAdjointEigenSolver<Matrix>         saEigSolver(size); saEigSolver.compute(saA);
-  Eigen::Tridiagonalization<Matrix>             tridiag;           tridiag.compute(saA);
+  Eigen::HessenbergDecomposition<ComplexMatrix> hessDecomp;
+  hessDecomp.compute(complexA);
+  Eigen::ComplexSchur<ComplexMatrix> cSchur(size);
+  cSchur.compute(complexA);
+  Eigen::ComplexEigenSolver<ComplexMatrix> cEigSolver;
+  cEigSolver.compute(complexA);
+  Eigen::EigenSolver<Matrix> eigSolver;
+  eigSolver.compute(A);
+  Eigen::SelfAdjointEigenSolver<Matrix> saEigSolver(size);
+  saEigSolver.compute(saA);
+  Eigen::Tridiagonalization<Matrix> tridiag;
+  tridiag.compute(saA);
 
   // LU module
-  Eigen::PartialPivLU<Matrix> ppLU; ppLU.compute(A);
+  Eigen::PartialPivLU<Matrix> ppLU;
+  ppLU.compute(A);
   X = ppLU.solve(B);
   x = ppLU.solve(b);
-  Eigen::FullPivLU<Matrix>    fpLU; fpLU.compute(A);
+  Eigen::FullPivLU<Matrix> fpLU;
+  fpLU.compute(A);
   X = fpLU.solve(B);
   x = fpLU.solve(b);
 
   // QR module
-  Eigen::HouseholderQR<Matrix>        hQR;  hQR.compute(A);
+  Eigen::HouseholderQR<Matrix> hQR;
+  hQR.compute(A);
   X = hQR.solve(B);
   x = hQR.solve(b);
-  Eigen::ColPivHouseholderQR<Matrix>  cpQR; cpQR.compute(A);
+  Eigen::ColPivHouseholderQR<Matrix> cpQR;
+  cpQR.compute(A);
   X = cpQR.solve(B);
   x = cpQR.solve(b);
-  Eigen::FullPivHouseholderQR<Matrix> fpQR; fpQR.compute(A);
+  Eigen::FullPivHouseholderQR<Matrix> fpQR;
+  fpQR.compute(A);
   // FIXME X = fpQR.solve(B);
   x = fpQR.solve(b);
 
   // SVD module
-  Eigen::JacobiSVD<Matrix, ComputeFullU | ComputeFullV> jSVD; jSVD.compute(A);
+  Eigen::JacobiSVD<Matrix, ComputeFullU | ComputeFullV> jSVD;
+  jSVD.compute(A);
 }
 
 void test_zerosized() {
@@ -160,29 +161,30 @@
   Eigen::MatrixXd A;
   Eigen::VectorXd v;
   // explicit zero-sized:
-  Eigen::ArrayXXd A0(0,0);
+  Eigen::ArrayXXd A0(0, 0);
   Eigen::ArrayXd v0(0);
 
   // assigning empty objects to each other:
-  A=A0;
-  v=v0;
+  A = A0;
+  v = v0;
 }
 
-template<typename MatrixType> void test_reference(const MatrixType& m) {
+template <typename MatrixType>
+void test_reference(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
-  enum { Flag          =  MatrixType::IsRowMajor ? Eigen::RowMajor : Eigen::ColMajor};
-  enum { TransposeFlag = !MatrixType::IsRowMajor ? Eigen::RowMajor : Eigen::ColMajor};
-  Index rows = m.rows(), cols=m.cols();
-  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, Flag         > MatrixX;
+  enum { Flag = MatrixType::IsRowMajor ? Eigen::RowMajor : Eigen::ColMajor };
+  enum { TransposeFlag = !MatrixType::IsRowMajor ? Eigen::RowMajor : Eigen::ColMajor };
+  Index rows = m.rows(), cols = m.cols();
+  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, Flag> MatrixX;
   typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, TransposeFlag> MatrixXT;
   // Dynamic reference:
-  typedef Eigen::Ref<const MatrixX  > Ref;
-  typedef Eigen::Ref<const MatrixXT > RefT;
+  typedef Eigen::Ref<const MatrixX> Ref;
+  typedef Eigen::Ref<const MatrixXT> RefT;
 
   Ref r1(m);
-  Ref r2(m.block(rows/3, cols/4, rows/2, cols/2));
+  Ref r2(m.block(rows / 3, cols / 4, rows / 2, cols / 2));
   RefT r3(m.transpose());
-  RefT r4(m.topLeftCorner(rows/2, cols/2).transpose());
+  RefT r4(m.topLeftCorner(rows / 2, cols / 2).transpose());
 
   VERIFY_RAISES_ASSERT(RefT r5(m));
   VERIFY_RAISES_ASSERT(Ref r6(m.transpose()));
@@ -193,36 +195,34 @@
   RefT r9 = r3;
 
   // Initializing from a compatible Ref shall also never malloc
-  Eigen::Ref<const MatrixX, Unaligned, Stride<Dynamic, Dynamic> > r10=r8, r11=m;
+  Eigen::Ref<const MatrixX, Unaligned, Stride<Dynamic, Dynamic> > r10 = r8, r11 = m;
 
   // Initializing from an incompatible Ref will malloc:
   typedef Eigen::Ref<const MatrixX, Aligned> RefAligned;
-  VERIFY_RAISES_ASSERT(RefAligned r12=r10);
-  VERIFY_RAISES_ASSERT(Ref r13=r10); // r10 has more dynamic strides
-
+  VERIFY_RAISES_ASSERT(RefAligned r12 = r10);
+  VERIFY_RAISES_ASSERT(Ref r13 = r10);  // r10 has more dynamic strides
 }
 
-EIGEN_DECLARE_TEST(nomalloc)
-{
+EIGEN_DECLARE_TEST(nomalloc) {
   // create some dynamic objects
-  Eigen::MatrixXd M1 = MatrixXd::Random(3,3);
-  Ref<const MatrixXd> R1 = 2.0*M1; // Ref requires temporary
+  Eigen::MatrixXd M1 = MatrixXd::Random(3, 3);
+  Ref<const MatrixXd> R1 = 2.0 * M1;  // Ref requires temporary
 
   // from here on prohibit malloc:
   Eigen::internal::set_is_malloc_allowed(false);
 
   // check that our operator new is indeed called:
-  VERIFY_RAISES_ASSERT(MatrixXd dummy(MatrixXd::Random(3,3)));
-  CALL_SUBTEST_1(nomalloc(Matrix<float, 1, 1>()) );
-  CALL_SUBTEST_2(nomalloc(Matrix4d()) );
-  CALL_SUBTEST_3(nomalloc(Matrix<float,32,32>()) );
-  
+  VERIFY_RAISES_ASSERT(MatrixXd dummy(MatrixXd::Random(3, 3)));
+  CALL_SUBTEST_1(nomalloc(Matrix<float, 1, 1>()));
+  CALL_SUBTEST_2(nomalloc(Matrix4d()));
+  CALL_SUBTEST_3(nomalloc(Matrix<float, 32, 32>()));
+
   // Check decomposition modules with dynamic matrices that have a known compile-time max size (ctms)
   CALL_SUBTEST_4(ctms_decompositions<float>());
 
   CALL_SUBTEST_5(test_zerosized());
 
-  CALL_SUBTEST_6(test_reference(Matrix<float,32,32>()));
+  CALL_SUBTEST_6(test_reference(Matrix<float, 32, 32>()));
   CALL_SUBTEST_7(test_reference(R1));
   CALL_SUBTEST_8(Ref<MatrixXd> R2 = M1.topRows<2>(); test_reference(R2));
 
diff --git a/test/nullary.cpp b/test/nullary.cpp
index e524837..9f9cfea 100644
--- a/test/nullary.cpp
+++ b/test/nullary.cpp
@@ -10,12 +10,11 @@
 
 #include "main.h"
 
-template<typename MatrixType>
-bool equalsIdentity(const MatrixType& A)
-{
+template <typename MatrixType>
+bool equalsIdentity(const MatrixType& A) {
   bool offDiagOK = true;
   for (Index i = 0; i < A.rows(); ++i) {
-    for (Index j = i+1; j < A.cols(); ++j) {
+    for (Index j = i + 1; j < A.cols(); ++j) {
       offDiagOK = offDiagOK && numext::is_exactly_zero(A(i, j));
     }
   }
@@ -29,190 +28,181 @@
   return offDiagOK && diagOK;
 }
 
-template<typename VectorType>
-void check_extremity_accuracy(const VectorType &v, const typename VectorType::Scalar &low, const typename VectorType::Scalar &high)
-{
+template <typename VectorType>
+void check_extremity_accuracy(const VectorType& v, const typename VectorType::Scalar& low,
+                              const typename VectorType::Scalar& high) {
   typedef typename VectorType::Scalar Scalar;
   typedef typename VectorType::RealScalar RealScalar;
 
-  RealScalar prec = internal::is_same<RealScalar,float>::value ? NumTraits<RealScalar>::dummy_precision()*10 : NumTraits<RealScalar>::dummy_precision()/10;
+  RealScalar prec = internal::is_same<RealScalar, float>::value ? NumTraits<RealScalar>::dummy_precision() * 10
+                                                                : NumTraits<RealScalar>::dummy_precision() / 10;
   Index size = v.size();
 
-  if(size<20)
-    return;
+  if (size < 20) return;
 
-  for (int i=0; i<size; ++i)
-  {
-    if(i<5 || i>size-6)
-    {
-      Scalar ref = (low*RealScalar(size-i-1))/RealScalar(size-1) + (high*RealScalar(i))/RealScalar(size-1);
-      if(std::abs(ref)>1)
-      {
-        if(!internal::isApprox(v(i), ref, prec))
-          std::cout << v(i) << " != " << ref << "  ; relative error: " << std::abs((v(i)-ref)/ref) << "  ; required precision: " << prec << "  ; range: " << low << "," << high << "  ; i: " << i << "\n";
-        VERIFY(internal::isApprox(v(i), (low*RealScalar(size-i-1))/RealScalar(size-1) + (high*RealScalar(i))/RealScalar(size-1), prec));
+  for (int i = 0; i < size; ++i) {
+    if (i < 5 || i > size - 6) {
+      Scalar ref =
+          (low * RealScalar(size - i - 1)) / RealScalar(size - 1) + (high * RealScalar(i)) / RealScalar(size - 1);
+      if (std::abs(ref) > 1) {
+        if (!internal::isApprox(v(i), ref, prec))
+          std::cout << v(i) << " != " << ref << "  ; relative error: " << std::abs((v(i) - ref) / ref)
+                    << "  ; required precision: " << prec << "  ; range: " << low << "," << high << "  ; i: " << i
+                    << "\n";
+        VERIFY(internal::isApprox(
+            v(i),
+            (low * RealScalar(size - i - 1)) / RealScalar(size - 1) + (high * RealScalar(i)) / RealScalar(size - 1),
+            prec));
       }
     }
   }
 }
 
-template<typename VectorType>
-void testVectorType(const VectorType& base)
-{
+template <typename VectorType>
+void testVectorType(const VectorType& base) {
   typedef typename VectorType::Scalar Scalar;
   typedef typename VectorType::RealScalar RealScalar;
 
   const Index size = base.size();
-  
-  Scalar high = internal::random<Scalar>(-500,500);
-  Scalar low = (size == 1 ? high : internal::random<Scalar>(-500,500));
-  if (numext::real(low)>numext::real(high)) std::swap(low,high);
+
+  Scalar high = internal::random<Scalar>(-500, 500);
+  Scalar low = (size == 1 ? high : internal::random<Scalar>(-500, 500));
+  if (numext::real(low) > numext::real(high)) std::swap(low, high);
 
   // check low==high
-  if(internal::random<float>(0.f,1.f)<0.05f)
-    low = high;
+  if (internal::random<float>(0.f, 1.f) < 0.05f) low = high;
   // check abs(low) >> abs(high)
-  else if(size>2 && std::numeric_limits<RealScalar>::max_exponent10>0 && internal::random<float>(0.f,1.f)<0.1f)
-    low = -internal::random<Scalar>(1,2) * RealScalar(std::pow(RealScalar(10),std::numeric_limits<RealScalar>::max_exponent10/2));
+  else if (size > 2 && std::numeric_limits<RealScalar>::max_exponent10 > 0 && internal::random<float>(0.f, 1.f) < 0.1f)
+    low = -internal::random<Scalar>(1, 2) *
+          RealScalar(std::pow(RealScalar(10), std::numeric_limits<RealScalar>::max_exponent10 / 2));
 
-  const Scalar step = ((size == 1) ? 1 : (high-low)/RealScalar(size-1));
+  const Scalar step = ((size == 1) ? 1 : (high - low) / RealScalar(size - 1));
 
   // check whether the result yields what we expect it to do
   VectorType m(base), o(base);
-  m.setLinSpaced(size,low,high);
+  m.setLinSpaced(size, low, high);
   o.setEqualSpaced(size, low, step);
 
-  if(!NumTraits<Scalar>::IsInteger)
-  {
+  if (!NumTraits<Scalar>::IsInteger) {
     VectorType n(size);
-    for (int i=0; i<size; ++i)
-      n(i) = low+RealScalar(i)*step;
-    VERIFY_IS_APPROX(m,n);
-    VERIFY_IS_APPROX(n,o);
+    for (int i = 0; i < size; ++i) n(i) = low + RealScalar(i) * step;
+    VERIFY_IS_APPROX(m, n);
+    VERIFY_IS_APPROX(n, o);
 
-    CALL_SUBTEST( check_extremity_accuracy(m, low, high) );
+    CALL_SUBTEST(check_extremity_accuracy(m, low, high));
   }
 
-  RealScalar range_length = numext::real(high-low);
-  if((!NumTraits<Scalar>::IsInteger) || (range_length>=size && (Index(range_length)%(size-1))==0) || (Index(range_length+1)<size && (size%Index(range_length+1))==0))
-  {
+  RealScalar range_length = numext::real(high - low);
+  if ((!NumTraits<Scalar>::IsInteger) || (range_length >= size && (Index(range_length) % (size - 1)) == 0) ||
+      (Index(range_length + 1) < size && (size % Index(range_length + 1)) == 0)) {
     VectorType n(size);
-    if((!NumTraits<Scalar>::IsInteger) || (range_length>=size))
-      for (int i=0; i<size; ++i)
-        n(i) = size==1 ? low : (low + ((high-low)*Scalar(i))/RealScalar(size-1));
+    if ((!NumTraits<Scalar>::IsInteger) || (range_length >= size))
+      for (int i = 0; i < size; ++i) n(i) = size == 1 ? low : (low + ((high - low) * Scalar(i)) / RealScalar(size - 1));
     else
-      for (int i=0; i<size; ++i)
-        n(i) = size==1 ? low : low + Scalar((double(range_length+1)*double(i))/double(size));
-    VERIFY_IS_APPROX(m,n);
+      for (int i = 0; i < size; ++i)
+        n(i) = size == 1 ? low : low + Scalar((double(range_length + 1) * double(i)) / double(size));
+    VERIFY_IS_APPROX(m, n);
 
     // random access version
-    m = VectorType::LinSpaced(size,low,high);
-    VERIFY_IS_APPROX(m,n);
-    VERIFY( internal::isApprox(m(m.size()-1),high) );
-    VERIFY( size==1 || internal::isApprox(m(0),low) );
-    VERIFY_IS_EQUAL(m(m.size()-1) , high);
-    if(!NumTraits<Scalar>::IsInteger)
-      CALL_SUBTEST( check_extremity_accuracy(m, low, high) );
+    m = VectorType::LinSpaced(size, low, high);
+    VERIFY_IS_APPROX(m, n);
+    VERIFY(internal::isApprox(m(m.size() - 1), high));
+    VERIFY(size == 1 || internal::isApprox(m(0), low));
+    VERIFY_IS_EQUAL(m(m.size() - 1), high);
+    if (!NumTraits<Scalar>::IsInteger) CALL_SUBTEST(check_extremity_accuracy(m, low, high));
   }
 
-  VERIFY( numext::real(m(m.size()-1)) <= numext::real(high) );
-  VERIFY( (m.array().real() <= numext::real(high)).all() );
-  VERIFY( (m.array().real() >= numext::real(low)).all() );
+  VERIFY(numext::real(m(m.size() - 1)) <= numext::real(high));
+  VERIFY((m.array().real() <= numext::real(high)).all());
+  VERIFY((m.array().real() >= numext::real(low)).all());
 
-
-  VERIFY( numext::real(m(m.size()-1)) >= numext::real(low) );
-  if(size>=1)
-  {
-    VERIFY( internal::isApprox(m(0),low) );
-    VERIFY_IS_EQUAL(m(0) , low);
+  VERIFY(numext::real(m(m.size() - 1)) >= numext::real(low));
+  if (size >= 1) {
+    VERIFY(internal::isApprox(m(0), low));
+    VERIFY_IS_EQUAL(m(0), low);
   }
 
   // check whether everything works with row and col major vectors
-  Matrix<Scalar,Dynamic,1> row_vector(size);
-  Matrix<Scalar,1,Dynamic> col_vector(size);
-  row_vector.setLinSpaced(size,low,high);
-  col_vector.setLinSpaced(size,low,high);
+  Matrix<Scalar, Dynamic, 1> row_vector(size);
+  Matrix<Scalar, 1, Dynamic> col_vector(size);
+  row_vector.setLinSpaced(size, low, high);
+  col_vector.setLinSpaced(size, low, high);
   // when using the extended precision (e.g., FPU) the relative error might exceed 1 bit
   // when computing the squared sum in isApprox, thus the 2x factor.
-  VERIFY( row_vector.isApprox(col_vector.transpose(), RealScalar(2)*NumTraits<Scalar>::epsilon()));
+  VERIFY(row_vector.isApprox(col_vector.transpose(), RealScalar(2) * NumTraits<Scalar>::epsilon()));
 
-  Matrix<Scalar,Dynamic,1> size_changer(size+50);
-  size_changer.setLinSpaced(size,low,high);
-  VERIFY( size_changer.size() == size );
+  Matrix<Scalar, Dynamic, 1> size_changer(size + 50);
+  size_changer.setLinSpaced(size, low, high);
+  VERIFY(size_changer.size() == size);
 
-  typedef Matrix<Scalar,1,1> ScalarMatrix;
+  typedef Matrix<Scalar, 1, 1> ScalarMatrix;
   ScalarMatrix scalar;
-  scalar.setLinSpaced(1,low,high);
-  VERIFY_IS_APPROX( scalar, ScalarMatrix::Constant(high) );
-  VERIFY_IS_APPROX( ScalarMatrix::LinSpaced(1,low,high), ScalarMatrix::Constant(high) );
+  scalar.setLinSpaced(1, low, high);
+  VERIFY_IS_APPROX(scalar, ScalarMatrix::Constant(high));
+  VERIFY_IS_APPROX(ScalarMatrix::LinSpaced(1, low, high), ScalarMatrix::Constant(high));
 
   // regression test for bug 526 (linear vectorized transversal)
   if (size > 1 && (!NumTraits<Scalar>::IsInteger)) {
-    m.tail(size-1).setLinSpaced(low, high);
-    VERIFY_IS_APPROX(m(size-1), high);
+    m.tail(size - 1).setLinSpaced(low, high);
+    VERIFY_IS_APPROX(m(size - 1), high);
   }
 
   // regression test for bug 1383 (LinSpaced with empty size/range)
   {
-    Index n0 = VectorType::SizeAtCompileTime==Dynamic ? 0 : VectorType::SizeAtCompileTime;
+    Index n0 = VectorType::SizeAtCompileTime == Dynamic ? 0 : VectorType::SizeAtCompileTime;
     low = internal::random<Scalar>();
-    m = VectorType::LinSpaced(n0,low,low-RealScalar(1));
-    VERIFY(m.size()==n0);
+    m = VectorType::LinSpaced(n0, low, low - RealScalar(1));
+    VERIFY(m.size() == n0);
 
-    if(VectorType::SizeAtCompileTime==Dynamic)
-    {
-      VERIFY_IS_EQUAL(VectorType::LinSpaced(n0,0,Scalar(n0-1)).sum(),Scalar(0));
-      VERIFY_IS_EQUAL(VectorType::LinSpaced(n0,low,low-RealScalar(1)).sum(),Scalar(0));
+    if (VectorType::SizeAtCompileTime == Dynamic) {
+      VERIFY_IS_EQUAL(VectorType::LinSpaced(n0, 0, Scalar(n0 - 1)).sum(), Scalar(0));
+      VERIFY_IS_EQUAL(VectorType::LinSpaced(n0, low, low - RealScalar(1)).sum(), Scalar(0));
     }
 
-    m.setLinSpaced(n0,0,Scalar(n0-1));
-    VERIFY(m.size()==n0);
-    m.setLinSpaced(n0,low,low-RealScalar(1));
-    VERIFY(m.size()==n0);
+    m.setLinSpaced(n0, 0, Scalar(n0 - 1));
+    VERIFY(m.size() == n0);
+    m.setLinSpaced(n0, low, low - RealScalar(1));
+    VERIFY(m.size() == n0);
 
     // empty range only:
-    VERIFY_IS_APPROX(VectorType::LinSpaced(size,low,low),VectorType::Constant(size,low));
-    m.setLinSpaced(size,low,low);
-    VERIFY_IS_APPROX(m,VectorType::Constant(size,low));
+    VERIFY_IS_APPROX(VectorType::LinSpaced(size, low, low), VectorType::Constant(size, low));
+    m.setLinSpaced(size, low, low);
+    VERIFY_IS_APPROX(m, VectorType::Constant(size, low));
 
-    if(NumTraits<Scalar>::IsInteger)
-    {
-      VERIFY_IS_APPROX( VectorType::LinSpaced(size,low,low+Scalar(size-1)), VectorType::LinSpaced(size,low+Scalar(size-1),low).reverse() );
+    if (NumTraits<Scalar>::IsInteger) {
+      VERIFY_IS_APPROX(VectorType::LinSpaced(size, low, low + Scalar(size - 1)),
+                       VectorType::LinSpaced(size, low + Scalar(size - 1), low).reverse());
 
-      if(VectorType::SizeAtCompileTime==Dynamic)
-      {
+      if (VectorType::SizeAtCompileTime == Dynamic) {
         // Check negative multiplicator path:
-        for(Index k=1; k<5; ++k)
-          VERIFY_IS_APPROX( VectorType::LinSpaced(size,low,low+Scalar((size-1)*k)), VectorType::LinSpaced(size,low+Scalar((size-1)*k),low).reverse() );
+        for (Index k = 1; k < 5; ++k)
+          VERIFY_IS_APPROX(VectorType::LinSpaced(size, low, low + Scalar((size - 1) * k)),
+                           VectorType::LinSpaced(size, low + Scalar((size - 1) * k), low).reverse());
         // Check negative divisor path:
-        for(Index k=1; k<5; ++k)
-          VERIFY_IS_APPROX( VectorType::LinSpaced(size*k,low,low+Scalar(size-1)), VectorType::LinSpaced(size*k,low+Scalar(size-1),low).reverse() );
+        for (Index k = 1; k < 5; ++k)
+          VERIFY_IS_APPROX(VectorType::LinSpaced(size * k, low, low + Scalar(size - 1)),
+                           VectorType::LinSpaced(size * k, low + Scalar(size - 1), low).reverse());
       }
     }
   }
 
   // test setUnit()
-  if(m.size()>0)
-  {
-    for(Index k=0; k<10; ++k)
-    {
-      Index i = internal::random<Index>(0,m.size()-1);
+  if (m.size() > 0) {
+    for (Index k = 0; k < 10; ++k) {
+      Index i = internal::random<Index>(0, m.size() - 1);
       m.setUnit(i);
-      VERIFY_IS_APPROX( m, VectorType::Unit(m.size(), i) );
+      VERIFY_IS_APPROX(m, VectorType::Unit(m.size(), i));
     }
-    if(VectorType::SizeAtCompileTime==Dynamic)
-    {
-      Index i = internal::random<Index>(0,2*m.size()-1);
-      m.setUnit(2*m.size(),i);
-      VERIFY_IS_APPROX( m, VectorType::Unit(m.size(),i) );
+    if (VectorType::SizeAtCompileTime == Dynamic) {
+      Index i = internal::random<Index>(0, 2 * m.size() - 1);
+      m.setUnit(2 * m.size(), i);
+      VERIFY_IS_APPROX(m, VectorType::Unit(m.size(), i));
     }
   }
-
 }
 
-template<typename MatrixType>
-void testMatrixType(const MatrixType& m)
-{
+template <typename MatrixType>
+void testMatrixType(const MatrixType& m) {
   using std::abs;
   const Index rows = m.rows();
   const Index cols = m.cols();
@@ -222,40 +212,37 @@
   Scalar s1;
   do {
     s1 = internal::random<Scalar>();
-  } while(abs(s1)<RealScalar(1e-5) && (!NumTraits<Scalar>::IsInteger));
+  } while (abs(s1) < RealScalar(1e-5) && (!NumTraits<Scalar>::IsInteger));
 
   MatrixType A;
   A.setIdentity(rows, cols);
   VERIFY(equalsIdentity(A));
   VERIFY(equalsIdentity(MatrixType::Identity(rows, cols)));
 
-
-  A = MatrixType::Constant(rows,cols,s1);
-  Index i = internal::random<Index>(0,rows-1);
-  Index j = internal::random<Index>(0,cols-1);
-  VERIFY_IS_APPROX( MatrixType::Constant(rows,cols,s1)(i,j), s1 );
-  VERIFY_IS_APPROX( MatrixType::Constant(rows,cols,s1).coeff(i,j), s1 );
-  VERIFY_IS_APPROX( A(i,j), s1 );
+  A = MatrixType::Constant(rows, cols, s1);
+  Index i = internal::random<Index>(0, rows - 1);
+  Index j = internal::random<Index>(0, cols - 1);
+  VERIFY_IS_APPROX(MatrixType::Constant(rows, cols, s1)(i, j), s1);
+  VERIFY_IS_APPROX(MatrixType::Constant(rows, cols, s1).coeff(i, j), s1);
+  VERIFY_IS_APPROX(A(i, j), s1);
 }
 
-template<int>
-void bug79()
-{
+template <int>
+void bug79() {
   // Assignment of a RowVectorXd to a MatrixXd (regression test for bug #79).
-  VERIFY( (MatrixXd(RowVectorXd::LinSpaced(3, 0, 1)) - RowVector3d(0, 0.5, 1)).norm() < std::numeric_limits<double>::epsilon() );
+  VERIFY((MatrixXd(RowVectorXd::LinSpaced(3, 0, 1)) - RowVector3d(0, 0.5, 1)).norm() <
+         std::numeric_limits<double>::epsilon());
 }
 
-template<int>
-void bug1630()
-{
+template <int>
+void bug1630() {
   Array4d x4 = Array4d::LinSpaced(0.0, 1.0);
   Array3d x3(Array4d::LinSpaced(0.0, 1.0).head(3));
   VERIFY_IS_APPROX(x4.head(3), x3);
 }
 
-template<int>
-void nullary_overflow()
-{
+template <int>
+void nullary_overflow() {
   // Check possible overflow issue
   int n = 60000;
   ArrayXi a1(n), a2(n), a_ref(n);
@@ -266,75 +253,73 @@
   VERIFY_IS_APPROX(a2, a_ref);
 }
 
-template<int>
-void nullary_internal_logic()
-{
+template <int>
+void nullary_internal_logic() {
   // check some internal logic
-  VERIFY((  internal::has_nullary_operator<internal::scalar_constant_op<double> >::value ));
-  VERIFY(( !internal::has_unary_operator<internal::scalar_constant_op<double> >::value ));
-  VERIFY(( !internal::has_binary_operator<internal::scalar_constant_op<double> >::value ));
-  VERIFY((  internal::functor_has_linear_access<internal::scalar_constant_op<double> >::ret ));
+  VERIFY((internal::has_nullary_operator<internal::scalar_constant_op<double> >::value));
+  VERIFY((!internal::has_unary_operator<internal::scalar_constant_op<double> >::value));
+  VERIFY((!internal::has_binary_operator<internal::scalar_constant_op<double> >::value));
+  VERIFY((internal::functor_has_linear_access<internal::scalar_constant_op<double> >::ret));
 
-  VERIFY(( !internal::has_nullary_operator<internal::scalar_identity_op<double> >::value ));
-  VERIFY(( !internal::has_unary_operator<internal::scalar_identity_op<double> >::value ));
-  VERIFY((  internal::has_binary_operator<internal::scalar_identity_op<double> >::value ));
-  VERIFY(( !internal::functor_has_linear_access<internal::scalar_identity_op<double> >::ret ));
+  VERIFY((!internal::has_nullary_operator<internal::scalar_identity_op<double> >::value));
+  VERIFY((!internal::has_unary_operator<internal::scalar_identity_op<double> >::value));
+  VERIFY((internal::has_binary_operator<internal::scalar_identity_op<double> >::value));
+  VERIFY((!internal::functor_has_linear_access<internal::scalar_identity_op<double> >::ret));
 
-  VERIFY(( !internal::has_nullary_operator<internal::linspaced_op<float> >::value ));
-  VERIFY((  internal::has_unary_operator<internal::linspaced_op<float> >::value ));
-  VERIFY(( !internal::has_binary_operator<internal::linspaced_op<float> >::value ));
-  VERIFY((  internal::functor_has_linear_access<internal::linspaced_op<float> >::ret ));
+  VERIFY((!internal::has_nullary_operator<internal::linspaced_op<float> >::value));
+  VERIFY((internal::has_unary_operator<internal::linspaced_op<float> >::value));
+  VERIFY((!internal::has_binary_operator<internal::linspaced_op<float> >::value));
+  VERIFY((internal::functor_has_linear_access<internal::linspaced_op<float> >::ret));
 
   // Regression unit test for a weird MSVC bug.
   // Search "nullary_wrapper_workaround_msvc" in CoreEvaluators.h for the details.
   // See also traits<Ref>::match.
   {
-    MatrixXf A = MatrixXf::Random(3,3);
-    Ref<const MatrixXf> R = 2.0*A;
-    VERIFY_IS_APPROX(R, A+A);
+    MatrixXf A = MatrixXf::Random(3, 3);
+    Ref<const MatrixXf> R = 2.0 * A;
+    VERIFY_IS_APPROX(R, A + A);
 
-    Ref<const MatrixXf> R1 = MatrixXf::Random(3,3)+A;
+    Ref<const MatrixXf> R1 = MatrixXf::Random(3, 3) + A;
 
     VectorXi V = VectorXi::Random(3);
-    Ref<const VectorXi> R2 = VectorXi::LinSpaced(3,1,3)+V;
-    VERIFY_IS_APPROX(R2, V+Vector3i(1,2,3));
+    Ref<const VectorXi> R2 = VectorXi::LinSpaced(3, 1, 3) + V;
+    VERIFY_IS_APPROX(R2, V + Vector3i(1, 2, 3));
 
-    VERIFY((  internal::has_nullary_operator<internal::scalar_constant_op<float> >::value ));
-    VERIFY(( !internal::has_unary_operator<internal::scalar_constant_op<float> >::value ));
-    VERIFY(( !internal::has_binary_operator<internal::scalar_constant_op<float> >::value ));
-    VERIFY((  internal::functor_has_linear_access<internal::scalar_constant_op<float> >::ret ));
+    VERIFY((internal::has_nullary_operator<internal::scalar_constant_op<float> >::value));
+    VERIFY((!internal::has_unary_operator<internal::scalar_constant_op<float> >::value));
+    VERIFY((!internal::has_binary_operator<internal::scalar_constant_op<float> >::value));
+    VERIFY((internal::functor_has_linear_access<internal::scalar_constant_op<float> >::ret));
 
-    VERIFY(( !internal::has_nullary_operator<internal::linspaced_op<int> >::value ));
-    VERIFY((  internal::has_unary_operator<internal::linspaced_op<int> >::value ));
-    VERIFY(( !internal::has_binary_operator<internal::linspaced_op<int> >::value ));
-    VERIFY((  internal::functor_has_linear_access<internal::linspaced_op<int> >::ret ));
+    VERIFY((!internal::has_nullary_operator<internal::linspaced_op<int> >::value));
+    VERIFY((internal::has_unary_operator<internal::linspaced_op<int> >::value));
+    VERIFY((!internal::has_binary_operator<internal::linspaced_op<int> >::value));
+    VERIFY((internal::functor_has_linear_access<internal::linspaced_op<int> >::ret));
   }
 }
 
-EIGEN_DECLARE_TEST(nullary)
-{
-  CALL_SUBTEST_1( testMatrixType(Matrix2d()) );
-  CALL_SUBTEST_2( testMatrixType(MatrixXcf(internal::random<int>(1,300),internal::random<int>(1,300))) );
-  CALL_SUBTEST_3( testMatrixType(MatrixXf(internal::random<int>(1,300),internal::random<int>(1,300))) );
-  
-  for(int i = 0; i < g_repeat*10; i++) {
-    CALL_SUBTEST_3( testVectorType(VectorXcd(internal::random<int>(1,30000))) );
-    CALL_SUBTEST_4( testVectorType(VectorXd(internal::random<int>(1,30000))) );
-    CALL_SUBTEST_5( testVectorType(Vector4d()) );  // regression test for bug 232
-    CALL_SUBTEST_6( testVectorType(Vector3d()) );
-    CALL_SUBTEST_7( testVectorType(VectorXf(internal::random<int>(1,30000))) );
-    CALL_SUBTEST_8( testVectorType(Vector3f()) );
-    CALL_SUBTEST_8( testVectorType(Vector4f()) );
-    CALL_SUBTEST_8( testVectorType(Matrix<float,8,1>()) );
-    CALL_SUBTEST_8( testVectorType(Matrix<float,1,1>()) );
+EIGEN_DECLARE_TEST(nullary) {
+  CALL_SUBTEST_1(testMatrixType(Matrix2d()));
+  CALL_SUBTEST_2(testMatrixType(MatrixXcf(internal::random<int>(1, 300), internal::random<int>(1, 300))));
+  CALL_SUBTEST_3(testMatrixType(MatrixXf(internal::random<int>(1, 300), internal::random<int>(1, 300))));
 
-    CALL_SUBTEST_9( testVectorType(VectorXi(internal::random<int>(1,10))) );
-    CALL_SUBTEST_9( testVectorType(VectorXi(internal::random<int>(9,300))) );
-    CALL_SUBTEST_9( testVectorType(Matrix<int,1,1>()) );
+  for (int i = 0; i < g_repeat * 10; i++) {
+    CALL_SUBTEST_3(testVectorType(VectorXcd(internal::random<int>(1, 30000))));
+    CALL_SUBTEST_4(testVectorType(VectorXd(internal::random<int>(1, 30000))));
+    CALL_SUBTEST_5(testVectorType(Vector4d()));  // regression test for bug 232
+    CALL_SUBTEST_6(testVectorType(Vector3d()));
+    CALL_SUBTEST_7(testVectorType(VectorXf(internal::random<int>(1, 30000))));
+    CALL_SUBTEST_8(testVectorType(Vector3f()));
+    CALL_SUBTEST_8(testVectorType(Vector4f()));
+    CALL_SUBTEST_8(testVectorType(Matrix<float, 8, 1>()));
+    CALL_SUBTEST_8(testVectorType(Matrix<float, 1, 1>()));
+
+    CALL_SUBTEST_9(testVectorType(VectorXi(internal::random<int>(1, 10))));
+    CALL_SUBTEST_9(testVectorType(VectorXi(internal::random<int>(9, 300))));
+    CALL_SUBTEST_9(testVectorType(Matrix<int, 1, 1>()));
   }
 
-  CALL_SUBTEST_6( bug79<0>() );
-  CALL_SUBTEST_6( bug1630<0>() );
-  CALL_SUBTEST_9( nullary_overflow<0>() );
-  CALL_SUBTEST_10( nullary_internal_logic<0>() );
+  CALL_SUBTEST_6(bug79<0>());
+  CALL_SUBTEST_6(bug1630<0>());
+  CALL_SUBTEST_9(nullary_overflow<0>());
+  CALL_SUBTEST_10(nullary_internal_logic<0>());
 }
diff --git a/test/num_dimensions.cpp b/test/num_dimensions.cpp
index 528c8f6..dacd8ac 100644
--- a/test/num_dimensions.cpp
+++ b/test/num_dimensions.cpp
@@ -10,14 +10,13 @@
 #include "main.h"
 #include <Eigen/SparseCore>
 
-template<int ExpectedDim,typename Xpr>
-void check_dim(const Xpr& ) {
-  STATIC_CHECK( Xpr::NumDimensions == ExpectedDim );
+template <int ExpectedDim, typename Xpr>
+void check_dim(const Xpr&) {
+  STATIC_CHECK(Xpr::NumDimensions == ExpectedDim);
 }
 
-template<template <typename,int,int> class Object>
-void map_num_dimensions()
-{
+template <template <typename, int, int> class Object>
+void map_num_dimensions() {
   typedef Object<double, 1, 1> ArrayScalarType;
   typedef Object<double, 2, 1> ArrayVectorType;
   typedef Object<double, 1, 2> TransposeArrayVectorType;
@@ -51,34 +50,33 @@
   STATIC_CHECK(DynamicArrayMap::NumDimensions == 2);
 }
 
-template<typename Scalar, int Rows, int Cols>
-using TArray = Array<Scalar,Rows,Cols>;
+template <typename Scalar, int Rows, int Cols>
+using TArray = Array<Scalar, Rows, Cols>;
 
-template<typename Scalar, int Rows, int Cols>
-using TMatrix = Matrix<Scalar,Rows,Cols>;
+template <typename Scalar, int Rows, int Cols>
+using TMatrix = Matrix<Scalar, Rows, Cols>;
 
-EIGEN_DECLARE_TEST(num_dimensions)
-{
+EIGEN_DECLARE_TEST(num_dimensions) {
   int n = 10;
-  ArrayXXd A(n,n);
-  CALL_SUBTEST( check_dim<2>(A) );
-  CALL_SUBTEST( check_dim<2>(A.block(1,1,2,2)) );
-  CALL_SUBTEST( check_dim<1>(A.col(1)) );
-  CALL_SUBTEST( check_dim<1>(A.row(1)) );
+  ArrayXXd A(n, n);
+  CALL_SUBTEST(check_dim<2>(A));
+  CALL_SUBTEST(check_dim<2>(A.block(1, 1, 2, 2)));
+  CALL_SUBTEST(check_dim<1>(A.col(1)));
+  CALL_SUBTEST(check_dim<1>(A.row(1)));
 
-  MatrixXd M(n,n);
-  CALL_SUBTEST( check_dim<0>(M.row(1)*M.col(1)) );
+  MatrixXd M(n, n);
+  CALL_SUBTEST(check_dim<0>(M.row(1) * M.col(1)));
 
-  SparseMatrix<double> S(n,n);
-  CALL_SUBTEST( check_dim<2>(S) );
-  CALL_SUBTEST( check_dim<2>(S.block(1,1,2,2)) );
-  CALL_SUBTEST( check_dim<1>(S.col(1)) );
-  CALL_SUBTEST( check_dim<1>(S.row(1)) );
+  SparseMatrix<double> S(n, n);
+  CALL_SUBTEST(check_dim<2>(S));
+  CALL_SUBTEST(check_dim<2>(S.block(1, 1, 2, 2)));
+  CALL_SUBTEST(check_dim<1>(S.col(1)));
+  CALL_SUBTEST(check_dim<1>(S.row(1)));
 
   SparseVector<double> s(n);
-  CALL_SUBTEST( check_dim<1>(s) );
-  CALL_SUBTEST( check_dim<1>(s.head(2)) );
+  CALL_SUBTEST(check_dim<1>(s));
+  CALL_SUBTEST(check_dim<1>(s.head(2)));
 
-  CALL_SUBTEST( map_num_dimensions<TArray>() );
-  CALL_SUBTEST( map_num_dimensions<TMatrix>() );
+  CALL_SUBTEST(map_num_dimensions<TArray>());
+  CALL_SUBTEST(map_num_dimensions<TMatrix>());
 }
diff --git a/test/numext.cpp b/test/numext.cpp
index cca0411..ac9b66d 100644
--- a/test/numext.cpp
+++ b/test/numext.cpp
@@ -9,79 +9,71 @@
 
 #include "main.h"
 
-template<typename T, typename U>
+template <typename T, typename U>
 bool check_if_equal_or_nans(const T& actual, const U& expected) {
   return (numext::equal_strict(actual, expected) || ((numext::isnan)(actual) && (numext::isnan)(expected)));
 }
 
-template<typename T, typename U>
+template <typename T, typename U>
 bool check_if_equal_or_nans(const std::complex<T>& actual, const std::complex<U>& expected) {
-  return check_if_equal_or_nans(numext::real(actual), numext::real(expected))
-         && check_if_equal_or_nans(numext::imag(actual), numext::imag(expected));
+  return check_if_equal_or_nans(numext::real(actual), numext::real(expected)) &&
+         check_if_equal_or_nans(numext::imag(actual), numext::imag(expected));
 }
 
-template<typename T, typename U>
-bool test_is_equal_or_nans(const T& actual, const U& expected)
-{
-    if (check_if_equal_or_nans(actual, expected)) {
-      return true;
-    }
+template <typename T, typename U>
+bool test_is_equal_or_nans(const T& actual, const U& expected) {
+  if (check_if_equal_or_nans(actual, expected)) {
+    return true;
+  }
 
-    // false:
-    std::cerr
-        << "\n    actual   = " << actual
-        << "\n    expected = " << expected << "\n\n";
-    return false;
+  // false:
+  std::cerr << "\n    actual   = " << actual << "\n    expected = " << expected << "\n\n";
+  return false;
 }
 
 #define VERIFY_IS_EQUAL_OR_NANS(a, b) VERIFY(test_is_equal_or_nans(a, b))
 
-template<typename T>
+template <typename T>
 void check_abs() {
   typedef typename NumTraits<T>::Real Real;
   Real zero(0);
 
-  if(NumTraits<T>::IsSigned)
-    VERIFY_IS_EQUAL(numext::abs(-T(1)), T(1));
+  if (NumTraits<T>::IsSigned) VERIFY_IS_EQUAL(numext::abs(-T(1)), T(1));
   VERIFY_IS_EQUAL(numext::abs(T(0)), T(0));
   VERIFY_IS_EQUAL(numext::abs(T(1)), T(1));
 
-  for(int k=0; k<100; ++k)
-  {
+  for (int k = 0; k < 100; ++k) {
     T x = internal::random<T>();
-    if(!internal::is_same<T,bool>::value)
-      x = x/Real(2);
-    if(NumTraits<T>::IsSigned)
-    {
+    if (!internal::is_same<T, bool>::value) x = x / Real(2);
+    if (NumTraits<T>::IsSigned) {
       VERIFY_IS_EQUAL(numext::abs(x), numext::abs(-x));
-      VERIFY( numext::abs(-x) >= zero );
+      VERIFY(numext::abs(-x) >= zero);
     }
-    VERIFY( numext::abs(x) >= zero );
-    VERIFY_IS_APPROX( numext::abs2(x), numext::abs2(numext::abs(x)) );
+    VERIFY(numext::abs(x) >= zero);
+    VERIFY_IS_APPROX(numext::abs2(x), numext::abs2(numext::abs(x)));
   }
 }
 
-template<typename T>
+template <typename T>
 void check_arg() {
   typedef typename NumTraits<T>::Real Real;
   VERIFY_IS_EQUAL(numext::abs(T(0)), T(0));
   VERIFY_IS_EQUAL(numext::abs(T(1)), T(1));
 
-  for(int k=0; k<100; ++k)
-  {
+  for (int k = 0; k < 100; ++k) {
     T x = internal::random<T>();
     Real y = numext::arg(x);
-    VERIFY_IS_APPROX( y, std::arg(x) );
+    VERIFY_IS_APPROX(y, std::arg(x));
   }
 }
 
-template<typename T>
+template <typename T>
 struct check_sqrt_impl {
   static void run() {
-    for (int i=0; i<1000; ++i) {
+    for (int i = 0; i < 1000; ++i) {
       const T x = numext::abs(internal::random<T>());
       const T sqrtx = numext::sqrt(x);
-      VERIFY_IS_APPROX(sqrtx*sqrtx, x);
+      VERIFY_IS_APPROX(sqrtx * sqrtx, x);
     }
 
     // Corner cases.
@@ -96,15 +88,15 @@
   }
 };
 
-template<typename T>
-struct check_sqrt_impl<std::complex<T>  > {
+template <typename T>
+struct check_sqrt_impl<std::complex<T> > {
   static void run() {
     typedef typename std::complex<T> ComplexT;
 
-    for (int i=0; i<1000; ++i) {
+    for (int i = 0; i < 1000; ++i) {
       const ComplexT x = internal::random<ComplexT>();
       const ComplexT sqrtx = numext::sqrt(x);
-      VERIFY_IS_APPROX(sqrtx*sqrtx, x);
+      VERIFY_IS_APPROX(sqrtx * sqrtx, x);
     }
 
     // Corner cases.
@@ -116,29 +108,19 @@
     // Set of corner cases from https://en.cppreference.com/w/cpp/numeric/complex/sqrt
     const int kNumCorners = 20;
     const ComplexT corners[kNumCorners][2] = {
-      {ComplexT(zero, zero), ComplexT(zero, zero)},
-      {ComplexT(-zero, zero), ComplexT(zero, zero)},
-      {ComplexT(zero, -zero), ComplexT(zero, zero)},
-      {ComplexT(-zero, -zero), ComplexT(zero, zero)},
-      {ComplexT(one, inf), ComplexT(inf, inf)},
-      {ComplexT(nan, inf), ComplexT(inf, inf)},
-      {ComplexT(one, -inf), ComplexT(inf, -inf)},
-      {ComplexT(nan, -inf), ComplexT(inf, -inf)},
-      {ComplexT(-inf, one), ComplexT(zero, inf)},
-      {ComplexT(inf, one), ComplexT(inf, zero)},
-      {ComplexT(-inf, -one), ComplexT(zero, -inf)},
-      {ComplexT(inf, -one), ComplexT(inf, -zero)},
-      {ComplexT(-inf, nan), ComplexT(nan, inf)},
-      {ComplexT(inf, nan), ComplexT(inf, nan)},
-      {ComplexT(zero, nan), ComplexT(nan, nan)},
-      {ComplexT(one, nan), ComplexT(nan, nan)},
-      {ComplexT(nan, zero), ComplexT(nan, nan)},
-      {ComplexT(nan, one), ComplexT(nan, nan)},
-      {ComplexT(nan, -one), ComplexT(nan, nan)},
-      {ComplexT(nan, nan), ComplexT(nan, nan)},
+        {ComplexT(zero, zero), ComplexT(zero, zero)},  {ComplexT(-zero, zero), ComplexT(zero, zero)},
+        {ComplexT(zero, -zero), ComplexT(zero, zero)}, {ComplexT(-zero, -zero), ComplexT(zero, zero)},
+        {ComplexT(one, inf), ComplexT(inf, inf)},      {ComplexT(nan, inf), ComplexT(inf, inf)},
+        {ComplexT(one, -inf), ComplexT(inf, -inf)},    {ComplexT(nan, -inf), ComplexT(inf, -inf)},
+        {ComplexT(-inf, one), ComplexT(zero, inf)},    {ComplexT(inf, one), ComplexT(inf, zero)},
+        {ComplexT(-inf, -one), ComplexT(zero, -inf)},  {ComplexT(inf, -one), ComplexT(inf, -zero)},
+        {ComplexT(-inf, nan), ComplexT(nan, inf)},     {ComplexT(inf, nan), ComplexT(inf, nan)},
+        {ComplexT(zero, nan), ComplexT(nan, nan)},     {ComplexT(one, nan), ComplexT(nan, nan)},
+        {ComplexT(nan, zero), ComplexT(nan, nan)},     {ComplexT(nan, one), ComplexT(nan, nan)},
+        {ComplexT(nan, -one), ComplexT(nan, nan)},     {ComplexT(nan, nan), ComplexT(nan, nan)},
     };
 
-    for (int i=0; i<kNumCorners; ++i) {
+    for (int i = 0; i < kNumCorners; ++i) {
       const ComplexT& x = corners[i][0];
       const ComplexT sqrtx = corners[i][1];
       VERIFY_IS_EQUAL_OR_NANS(numext::sqrt(x), sqrtx);
@@ -146,12 +128,12 @@
   }
 };
 
-template<typename T>
+template <typename T>
 void check_sqrt() {
   check_sqrt_impl<T>::run();
 }
 
-template<typename T>
+template <typename T>
 struct check_rsqrt_impl {
   static void run() {
     const T zero = T(0);
@@ -159,11 +141,11 @@
     const T inf = std::numeric_limits<T>::infinity();
     const T nan = std::numeric_limits<T>::quiet_NaN();
 
-    for (int i=0; i<1000; ++i) {
+    for (int i = 0; i < 1000; ++i) {
       const T x = numext::abs(internal::random<T>());
       const T rsqrtx = numext::rsqrt(x);
       const T invx = one / x;
-      VERIFY_IS_APPROX(rsqrtx*rsqrtx, invx);
+      VERIFY_IS_APPROX(rsqrtx * rsqrtx, invx);
     }
 
     // Corner cases.
@@ -174,7 +156,7 @@
   }
 };
 
-template<typename T>
+template <typename T>
 struct check_rsqrt_impl<std::complex<T> > {
   static void run() {
     typedef typename std::complex<T> ComplexT;
@@ -183,63 +165,62 @@
     const T inf = std::numeric_limits<T>::infinity();
     const T nan = std::numeric_limits<T>::quiet_NaN();
 
-    for (int i=0; i<1000; ++i) {
+    for (int i = 0; i < 1000; ++i) {
       const ComplexT x = internal::random<ComplexT>();
       const ComplexT invx = ComplexT(one, zero) / x;
       const ComplexT rsqrtx = numext::rsqrt(x);
-      VERIFY_IS_APPROX(rsqrtx*rsqrtx, invx);
+      VERIFY_IS_APPROX(rsqrtx * rsqrtx, invx);
     }
 
-    // GCC and MSVC differ in their treatment of 1/(0 + 0i)
-    //   GCC/clang = (inf, nan)
-    //   MSVC = (nan, nan)
-    // and 1 / (x + inf i)
-    //   GCC/clang = (0, 0)
-    //   MSVC = (nan, nan)
-    #if (EIGEN_COMP_GNUC)
+// GCC and MSVC differ in their treatment of 1/(0 + 0i)
+//   GCC/clang = (inf, nan)
+//   MSVC = (nan, nan)
+// and 1 / (x + inf i)
+//   GCC/clang = (0, 0)
+//   MSVC = (nan, nan)
+#if (EIGEN_COMP_GNUC)
     {
       const int kNumCorners = 20;
       const ComplexT corners[kNumCorners][2] = {
-        // Only consistent across GCC, clang
-        {ComplexT(zero, zero), ComplexT(zero, zero)},
-        {ComplexT(-zero, zero), ComplexT(zero, zero)},
-        {ComplexT(zero, -zero), ComplexT(zero, zero)},
-        {ComplexT(-zero, -zero), ComplexT(zero, zero)},
-        {ComplexT(one, inf), ComplexT(inf, inf)},
-        {ComplexT(nan, inf), ComplexT(inf, inf)},
-        {ComplexT(one, -inf), ComplexT(inf, -inf)},
-        {ComplexT(nan, -inf), ComplexT(inf, -inf)},
-        // Consistent across GCC, clang, MSVC
-        {ComplexT(-inf, one), ComplexT(zero, inf)},
-        {ComplexT(inf, one), ComplexT(inf, zero)},
-        {ComplexT(-inf, -one), ComplexT(zero, -inf)},
-        {ComplexT(inf, -one), ComplexT(inf, -zero)},
-        {ComplexT(-inf, nan), ComplexT(nan, inf)},
-        {ComplexT(inf, nan), ComplexT(inf, nan)},
-        {ComplexT(zero, nan), ComplexT(nan, nan)},
-        {ComplexT(one, nan), ComplexT(nan, nan)},
-        {ComplexT(nan, zero), ComplexT(nan, nan)},
-        {ComplexT(nan, one), ComplexT(nan, nan)},
-        {ComplexT(nan, -one), ComplexT(nan, nan)},
-        {ComplexT(nan, nan), ComplexT(nan, nan)},
+          // Only consistent across GCC, clang
+          {ComplexT(zero, zero), ComplexT(zero, zero)},
+          {ComplexT(-zero, zero), ComplexT(zero, zero)},
+          {ComplexT(zero, -zero), ComplexT(zero, zero)},
+          {ComplexT(-zero, -zero), ComplexT(zero, zero)},
+          {ComplexT(one, inf), ComplexT(inf, inf)},
+          {ComplexT(nan, inf), ComplexT(inf, inf)},
+          {ComplexT(one, -inf), ComplexT(inf, -inf)},
+          {ComplexT(nan, -inf), ComplexT(inf, -inf)},
+          // Consistent across GCC, clang, MSVC
+          {ComplexT(-inf, one), ComplexT(zero, inf)},
+          {ComplexT(inf, one), ComplexT(inf, zero)},
+          {ComplexT(-inf, -one), ComplexT(zero, -inf)},
+          {ComplexT(inf, -one), ComplexT(inf, -zero)},
+          {ComplexT(-inf, nan), ComplexT(nan, inf)},
+          {ComplexT(inf, nan), ComplexT(inf, nan)},
+          {ComplexT(zero, nan), ComplexT(nan, nan)},
+          {ComplexT(one, nan), ComplexT(nan, nan)},
+          {ComplexT(nan, zero), ComplexT(nan, nan)},
+          {ComplexT(nan, one), ComplexT(nan, nan)},
+          {ComplexT(nan, -one), ComplexT(nan, nan)},
+          {ComplexT(nan, nan), ComplexT(nan, nan)},
       };
 
-      for (int i=0; i<kNumCorners; ++i) {
+      for (int i = 0; i < kNumCorners; ++i) {
         const ComplexT& x = corners[i][0];
         const ComplexT rsqrtx = ComplexT(one, zero) / corners[i][1];
         VERIFY_IS_EQUAL_OR_NANS(numext::rsqrt(x), rsqrtx);
       }
     }
-    #endif
+#endif
   }
 };
 
-template<typename T>
+template <typename T>
 void check_rsqrt() {
   check_rsqrt_impl<T>::run();
 }
 
-
 template <typename T>
 struct check_signbit_impl {
   static void run() {
@@ -252,10 +233,8 @@
     std::vector<T> non_negative_values;
 
     if (NumTraits<T>::IsInteger) {
-      negative_values = {static_cast<T>(-1),
-        static_cast<T>(NumTraits<T>::lowest())};
-      non_negative_values = {static_cast<T>(0), static_cast<T>(1),
-        static_cast<T>(NumTraits<T>::highest())};
+      negative_values = {static_cast<T>(-1), static_cast<T>(NumTraits<T>::lowest())};
+      non_negative_values = {static_cast<T>(0), static_cast<T>(1), static_cast<T>(NumTraits<T>::highest())};
     } else {
       // has sign bit
       const T neg_zero = static_cast<T>(-0.0);
@@ -271,17 +250,13 @@
       non_negative_values = {pos_zero, pos_one, pos_inf, pos_nan};
     }
 
-
     auto check_all = [](auto values, auto expected) {
       bool all_pass = true;
       for (T val : values) {
         const T numext_val = numext::signbit(val);
-        bool not_same = internal::predux_any(
-            internal::bitwise_helper<T>::bitwise_xor(expected, numext_val));
+        bool not_same = internal::predux_any(internal::bitwise_helper<T>::bitwise_xor(expected, numext_val));
         all_pass = all_pass && !not_same;
-        if (not_same)
-          std::cout << "signbit(" << val << ") = " << numext_val
-                    << " != " << expected << std::endl;
+        if (not_same) std::cout << "signbit(" << val << ") = " << numext_val << " != " << expected << std::endl;
       }
       return all_pass;
     };
@@ -297,51 +272,50 @@
 }
 
 EIGEN_DECLARE_TEST(numext) {
-  for(int k=0; k<g_repeat; ++k)
-  {
-    CALL_SUBTEST( check_abs<bool>() );
-    CALL_SUBTEST( check_abs<signed char>() );
-    CALL_SUBTEST( check_abs<unsigned char>() );
-    CALL_SUBTEST( check_abs<short>() );
-    CALL_SUBTEST( check_abs<unsigned short>() );
-    CALL_SUBTEST( check_abs<int>() );
-    CALL_SUBTEST( check_abs<unsigned int>() );
-    CALL_SUBTEST( check_abs<long>() );
-    CALL_SUBTEST( check_abs<unsigned long>() );
-    CALL_SUBTEST( check_abs<half>() );
-    CALL_SUBTEST( check_abs<bfloat16>() );
-    CALL_SUBTEST( check_abs<float>() );
-    CALL_SUBTEST( check_abs<double>() );
-    CALL_SUBTEST( check_abs<long double>() );
-    CALL_SUBTEST( check_abs<std::complex<float> >() );
-    CALL_SUBTEST( check_abs<std::complex<double> >() );
+  for (int k = 0; k < g_repeat; ++k) {
+    CALL_SUBTEST(check_abs<bool>());
+    CALL_SUBTEST(check_abs<signed char>());
+    CALL_SUBTEST(check_abs<unsigned char>());
+    CALL_SUBTEST(check_abs<short>());
+    CALL_SUBTEST(check_abs<unsigned short>());
+    CALL_SUBTEST(check_abs<int>());
+    CALL_SUBTEST(check_abs<unsigned int>());
+    CALL_SUBTEST(check_abs<long>());
+    CALL_SUBTEST(check_abs<unsigned long>());
+    CALL_SUBTEST(check_abs<half>());
+    CALL_SUBTEST(check_abs<bfloat16>());
+    CALL_SUBTEST(check_abs<float>());
+    CALL_SUBTEST(check_abs<double>());
+    CALL_SUBTEST(check_abs<long double>());
+    CALL_SUBTEST(check_abs<std::complex<float> >());
+    CALL_SUBTEST(check_abs<std::complex<double> >());
 
-    CALL_SUBTEST( check_arg<std::complex<float> >() );
-    CALL_SUBTEST( check_arg<std::complex<double> >() );
+    CALL_SUBTEST(check_arg<std::complex<float> >());
+    CALL_SUBTEST(check_arg<std::complex<double> >());
 
-    CALL_SUBTEST( check_sqrt<float>() );
-    CALL_SUBTEST( check_sqrt<double>() );
-    CALL_SUBTEST( check_sqrt<std::complex<float> >() );
-    CALL_SUBTEST( check_sqrt<std::complex<double> >() );
+    CALL_SUBTEST(check_sqrt<float>());
+    CALL_SUBTEST(check_sqrt<double>());
+    CALL_SUBTEST(check_sqrt<std::complex<float> >());
+    CALL_SUBTEST(check_sqrt<std::complex<double> >());
 
-    CALL_SUBTEST( check_rsqrt<float>() );
-    CALL_SUBTEST( check_rsqrt<double>() );
-    CALL_SUBTEST( check_rsqrt<std::complex<float> >() );
-    CALL_SUBTEST( check_rsqrt<std::complex<double> >() );
+    CALL_SUBTEST(check_rsqrt<float>());
+    CALL_SUBTEST(check_rsqrt<double>());
+    CALL_SUBTEST(check_rsqrt<std::complex<float> >());
+    CALL_SUBTEST(check_rsqrt<std::complex<double> >());
 
-    CALL_SUBTEST( check_signbit<half>());
-    CALL_SUBTEST( check_signbit<bfloat16>());
-    CALL_SUBTEST( check_signbit<float>());
-    CALL_SUBTEST( check_signbit<double>());
+    CALL_SUBTEST(check_signbit<half>());
+    CALL_SUBTEST(check_signbit<bfloat16>());
+    CALL_SUBTEST(check_signbit<float>());
+    CALL_SUBTEST(check_signbit<double>());
 
-    CALL_SUBTEST( check_signbit<uint8_t>());
-    CALL_SUBTEST( check_signbit<uint16_t>());
-    CALL_SUBTEST( check_signbit<uint32_t>());
-    CALL_SUBTEST( check_signbit<uint64_t>());
+    CALL_SUBTEST(check_signbit<uint8_t>());
+    CALL_SUBTEST(check_signbit<uint16_t>());
+    CALL_SUBTEST(check_signbit<uint32_t>());
+    CALL_SUBTEST(check_signbit<uint64_t>());
 
-    CALL_SUBTEST( check_signbit<int8_t>());
-    CALL_SUBTEST( check_signbit<int16_t>());
-    CALL_SUBTEST( check_signbit<int32_t>());
-    CALL_SUBTEST( check_signbit<int64_t>());
+    CALL_SUBTEST(check_signbit<int8_t>());
+    CALL_SUBTEST(check_signbit<int16_t>());
+    CALL_SUBTEST(check_signbit<int32_t>());
+    CALL_SUBTEST(check_signbit<int64_t>());
   }
 }
diff --git a/test/packet_ostream.h b/test/packet_ostream.h
index ece4995..49e1bb0 100644
--- a/test/packet_ostream.h
+++ b/test/packet_ostream.h
@@ -6,13 +6,14 @@
 
 // Include this header to be able to print Packets while debugging.
 
-template<typename Packet, typename EnableIf = std::enable_if_t<Eigen::internal::unpacket_traits<Packet>::vectorizable> >
+template <typename Packet,
+          typename EnableIf = std::enable_if_t<Eigen::internal::unpacket_traits<Packet>::vectorizable> >
 std::ostream& operator<<(std::ostream& os, const Packet& packet) {
   using Scalar = typename Eigen::internal::unpacket_traits<Packet>::type;
   Scalar v[Eigen::internal::unpacket_traits<Packet>::size];
   Eigen::internal::pstoreu(v, packet);
   os << "{" << v[0];
-  for (int i=1; i<Eigen::internal::unpacket_traits<Packet>::size; ++i) {
+  for (int i = 1; i < Eigen::internal::unpacket_traits<Packet>::size; ++i) {
     os << "," << v[i];
   }
   os << "}";
diff --git a/test/packetmath.cpp b/test/packetmath.cpp
index b5b0401..a97cce7 100644
--- a/test/packetmath.cpp
+++ b/test/packetmath.cpp
@@ -257,8 +257,8 @@
     test_cast_runner<Packet, int64_t>::run();
     test_cast_runner<Packet, uint64_t>::run();
     test_cast_runner<Packet, bool>::run();
-    test_cast_runner<Packet, std::complex<float> >::run();
-    test_cast_runner<Packet, std::complex<double> >::run();
+    test_cast_runner<Packet, std::complex<float>>::run();
+    test_cast_runner<Packet, std::complex<double>>::run();
     test_cast_runner<Packet, half>::run();
     test_cast_runner<Packet, bfloat16>::run();
   }
@@ -268,8 +268,8 @@
 template <typename Scalar, typename Packet>
 struct packetmath_pcast_ops_runner<Scalar, Packet, std::enable_if_t<NumTraits<Scalar>::IsComplex>> {
   static void run() {
-    test_cast_runner<Packet, std::complex<float> >::run();
-    test_cast_runner<Packet, std::complex<double> >::run();
+    test_cast_runner<Packet, std::complex<float>>::run();
+    test_cast_runner<Packet, std::complex<double>>::run();
     test_cast_runner<Packet, half>::run();
     test_cast_runner<Packet, bfloat16>::run();
   }
@@ -295,14 +295,14 @@
 
   CHECK_CWISE2_IF(true, internal::pcmp_eq, internal::pcmp_eq);
 
-  //Test (-0) == (0) for signed operations
+  // Test (-0) == (0) for signed operations
   for (int i = 0; i < PacketSize; ++i) {
     data1[i] = Scalar(-0.0);
     data1[i + PacketSize] = internal::random<bool>() ? data1[i] : Scalar(0);
   }
   CHECK_CWISE2_IF(true, internal::pcmp_eq, internal::pcmp_eq);
 
-  //Test NaN
+  // Test NaN
   for (int i = 0; i < PacketSize; ++i) {
     data1[i] = NumTraits<Scalar>::quiet_NaN();
     data1[i + PacketSize] = internal::random<bool>() ? data1[i] : Scalar(0);
@@ -325,14 +325,14 @@
 
   CHECK_CWISE2_IF(true, internal::pcmp_lt_or_nan, internal::pcmp_lt_or_nan);
 
-  //Test (-0) <=/< (0) for signed operations
+  // Test (-0) <=/< (0) for signed operations
   for (int i = 0; i < PacketSize; ++i) {
     data1[i] = Scalar(-0.0);
     data1[i + PacketSize] = internal::random<bool>() ? data1[i] : Scalar(0);
   }
   CHECK_CWISE2_IF(true, internal::pcmp_lt_or_nan, internal::pcmp_lt_or_nan);
 
-  //Test NaN
+  // Test NaN
   for (int i = 0; i < PacketSize; ++i) {
     data1[i] = NumTraits<Scalar>::quiet_NaN();
     data1[i + PacketSize] = internal::random<bool>() ? data1[i] : Scalar(0);
@@ -348,8 +348,7 @@
 template <typename Scalar, typename Packet>
 struct packetmath_boolean_mask_ops_notcomplex_test<
     Scalar, Packet,
-    std::enable_if_t<internal::packet_traits<Scalar>::HasCmp && 
-                     !internal::is_same<Scalar, bool>::value>> {
+    std::enable_if_t<internal::packet_traits<Scalar>::HasCmp && !internal::is_same<Scalar, bool>::value>> {
   static void run() {
     const int PacketSize = internal::unpacket_traits<Packet>::size;
     const int size = 2 * PacketSize;
@@ -365,7 +364,7 @@
     CHECK_CWISE2_IF(true, internal::pcmp_le, internal::pcmp_le);
     CHECK_CWISE2_IF(true, internal::pcmp_lt, internal::pcmp_lt);
 
-  //Test (-0) <=/< (0) for signed operations
+    // Test (-0) <=/< (0) for signed operations
     for (int i = 0; i < PacketSize; ++i) {
       data1[i] = Scalar(-0.0);
       data1[i + PacketSize] = internal::random<bool>() ? data1[i] : Scalar(0);
@@ -373,7 +372,7 @@
     CHECK_CWISE2_IF(true, internal::pcmp_le, internal::pcmp_le);
     CHECK_CWISE2_IF(true, internal::pcmp_lt, internal::pcmp_lt);
 
-  //Test NaN
+    // Test NaN
     for (int i = 0; i < PacketSize; ++i) {
       data1[i] = NumTraits<Scalar>::quiet_NaN();
       data1[i + PacketSize] = internal::random<bool>() ? data1[i] : Scalar(0);
@@ -395,9 +394,7 @@
 };
 
 template <typename Scalar, typename Packet>
-struct packetmath_minus_zero_add_test<
-    Scalar, Packet,
-    std::enable_if_t<!NumTraits<Scalar>::IsInteger>> {
+struct packetmath_minus_zero_add_test<Scalar, Packet, std::enable_if_t<!NumTraits<Scalar>::IsInteger>> {
   static void run() {
     const int PacketSize = internal::unpacket_traits<Packet>::size;
     const int size = 2 * PacketSize;
@@ -417,17 +414,15 @@
 // Only applies to raw types, so will not work for std::complex, Eigen::half
 // or Eigen::bfloat16. For those you would need to refer to an underlying
 // storage element.
-template<typename Packet, typename EnableIf = void>
+template <typename Packet, typename EnableIf = void>
 struct eigen_optimization_barrier_test {
   static void run() {}
 };
 
-template<typename Packet>
-struct eigen_optimization_barrier_test<Packet, std::enable_if_t<
-    !NumTraits<Packet>::IsComplex &&
-    !internal::is_same<Packet, Eigen::half>::value &&
-    !internal::is_same<Packet, Eigen::bfloat16>::value
-  >> {
+template <typename Packet>
+struct eigen_optimization_barrier_test<
+    Packet, std::enable_if_t<!NumTraits<Packet>::IsComplex && !internal::is_same<Packet, Eigen::half>::value &&
+                             !internal::is_same<Packet, Eigen::bfloat16>::value>> {
   static void run() {
     typedef typename internal::unpacket_traits<Packet>::type Scalar;
     Scalar s = internal::random<Scalar>();
@@ -548,7 +543,6 @@
   CHECK_CWISE1(numext::conj, internal::pconj);
   CHECK_CWISE1_IF(PacketTraits::HasSign, numext::sign, internal::psign);
 
-
   for (int offset = 0; offset < 3; ++offset) {
     for (int i = 0; i < PacketSize; ++i) ref[i] = data1[offset];
     internal::pstore(data2, internal::pset1<Packet>(data1[offset]));
@@ -630,7 +624,7 @@
 
   // GeneralBlockPanelKernel also checks PacketBlock<Packet,(PacketSize%4)==0?4:PacketSize>;
   if (PacketSize > 4 && PacketSize % 4 == 0) {
-    internal::PacketBlock<Packet, PacketSize%4==0?4:PacketSize> kernel2;
+    internal::PacketBlock<Packet, PacketSize % 4 == 0 ? 4 : PacketSize> kernel2;
     for (int i = 0; i < 4; ++i) {
       kernel2.packet[i] = internal::pload<Packet>(data1 + i * PacketSize);
     }
@@ -638,13 +632,13 @@
     int data_counter = 0;
     for (int i = 0; i < PacketSize; ++i) {
       for (int j = 0; j < 4; ++j) {
-        data2[data_counter++] = data1[j*PacketSize + i];
+        data2[data_counter++] = data1[j * PacketSize + i];
       }
     }
     for (int i = 0; i < 4; ++i) {
       internal::pstore(data3, kernel2.packet[i]);
       for (int j = 0; j < PacketSize; ++j) {
-        VERIFY(test::isApproxAbs(data3[j], data2[i*PacketSize + j], refvalue) && "ptranspose");
+        VERIFY(test::isApproxAbs(data3[j], data2[i * PacketSize + j], refvalue) && "ptranspose");
       }
     }
   }
@@ -727,11 +721,11 @@
 // Create a functor out of a function so it can be passed (with overloads)
 // to another function as an input argument.
 #define CREATE_FUNCTOR(Name, Func)     \
-struct Name {                          \
-  template<typename T>                 \
-  T operator()(const T& val) const {   \
-    return Func(val);                  \
-  }                                    \
+  struct Name {                        \
+    template <typename T>              \
+    T operator()(const T& val) const { \
+      return Func(val);                \
+    }                                  \
   }
 
 CREATE_FUNCTOR(psqrt_functor, internal::psqrt);
@@ -739,8 +733,7 @@
 
 // TODO(rmlarsen): Run this test for more functions.
 template <bool Cond, typename Scalar, typename Packet, typename RefFunctorT, typename FunctorT>
-void packetmath_test_IEEE_corner_cases(const RefFunctorT& ref_fun,
-                                       const FunctorT& fun) {
+void packetmath_test_IEEE_corner_cases(const RefFunctorT& ref_fun, const FunctorT& fun) {
   const int PacketSize = internal::unpacket_traits<Packet>::size;
   const Scalar norm_min = (std::numeric_limits<Scalar>::min)();
   const Scalar norm_max = (std::numeric_limits<Scalar>::max)();
@@ -755,7 +748,6 @@
 
   // Test for subnormals.
   if (Cond && std::numeric_limits<Scalar>::has_denorm == std::denorm_present && !EIGEN_ARCH_ARM) {
-
     for (int scale = 1; scale < 5; ++scale) {
       // When EIGEN_FAST_MATH is 1 we relax the conditions slightly, and allow the function
       // to return the same value for subnormals as the reference would return for zero with
@@ -765,7 +757,7 @@
       data1[1] = -data1[0];
       test::packet_helper<Cond, Packet> h;
       h.store(data2, fun(h.load(data1)));
-        for (int i=0; i < PacketSize; ++i) {
+      for (int i = 0; i < PacketSize; ++i) {
         const Scalar ref_zero = ref_fun(data1[i] < 0 ? -Scalar(0) : Scalar(0));
         const Scalar ref_val = ref_fun(data1[i]);
         VERIFY(((std::isnan)(data2[i]) && (std::isnan)(ref_val)) || data2[i] == ref_zero ||
@@ -815,12 +807,12 @@
 
   // Negate with -0.
   if (PacketTraits::HasNegate) {
-    test::packet_helper<PacketTraits::HasNegate,Packet> h;
+    test::packet_helper<PacketTraits::HasNegate, Packet> h;
     data1[0] = Scalar{-0};
     h.store(data2, internal::pnegate(h.load(data1)));
     typedef typename internal::make_unsigned<typename internal::make_integer<Scalar>::type>::type Bits;
     Bits bits = numext::bit_cast<Bits>(data2[0]);
-    VERIFY_IS_EQUAL(bits, static_cast<Bits>(Bits(1)<<(sizeof(Scalar)*CHAR_BIT - 1)));
+    VERIFY_IS_EQUAL(bits, static_cast<Bits>(Bits(1) << (sizeof(Scalar) * CHAR_BIT - 1)));
   }
 
   for (int i = 0; i < size; ++i) {
@@ -848,15 +840,14 @@
   CHECK_CWISE1_EXACT_IF(PacketTraits::HasRint, numext::rint, internal::print);
   CHECK_CWISE1_IF(PacketTraits::HasSign, numext::sign, internal::psign);
 
-  packetmath_boolean_mask_ops_real<Scalar,Packet>();
+  packetmath_boolean_mask_ops_real<Scalar, Packet>();
 
   // Rounding edge cases.
   if (PacketTraits::HasRound || PacketTraits::HasCeil || PacketTraits::HasFloor || PacketTraits::HasRint) {
     typedef typename internal::make_integer<Scalar>::type IntType;
     // Start with values that cannot fit inside an integer, work down to less than one.
-    Scalar val = numext::mini(
-        Scalar(2) * static_cast<Scalar>(NumTraits<IntType>::highest()),
-        NumTraits<Scalar>::highest());
+    Scalar val =
+        numext::mini(Scalar(2) * static_cast<Scalar>(NumTraits<IntType>::highest()), NumTraits<Scalar>::highest());
     std::vector<Scalar> values;
     while (val > Scalar(0.25)) {
       // Cover both even and odd, positive and negative cases.
@@ -883,7 +874,7 @@
     values.push_back(-NumTraits<Scalar>::infinity());
     values.push_back(NumTraits<Scalar>::quiet_NaN());
 
-    for (size_t k=0; k<values.size(); ++k) {
+    for (size_t k = 0; k < values.size(); ++k) {
       data1[0] = values[k];
       CHECK_CWISE1_EXACT_IF(PacketTraits::HasRound, numext::round, internal::pround);
       CHECK_CWISE1_EXACT_IF(PacketTraits::HasCeil, numext::ceil, internal::pceil);
@@ -901,7 +892,6 @@
   CHECK_CWISE1_IF(PacketTraits::HasATan, std::atan, internal::patan);
   CHECK_CWISE1_IF(PacketTraits::HasATanh, std::atanh, internal::patanh);
 
-
   for (int i = 0; i < size; ++i) {
     data1[i] = Scalar(internal::random<double>(-87, 88));
     data2[i] = Scalar(internal::random<double>(-87, 88));
@@ -911,28 +901,26 @@
 
   CHECK_CWISE1_BYREF1_IF(PacketTraits::HasExp, REF_FREXP, internal::pfrexp);
   if (PacketTraits::HasExp) {
-    // Check denormals:
-    #if !EIGEN_ARCH_ARM
-    for (int j=0; j<3; ++j) {
-      data1[0] = Scalar(std::ldexp(1, NumTraits<Scalar>::min_exponent()-j));
+// Check denormals:
+#if !EIGEN_ARCH_ARM
+    for (int j = 0; j < 3; ++j) {
+      data1[0] = Scalar(std::ldexp(1, NumTraits<Scalar>::min_exponent() - j));
       CHECK_CWISE1_BYREF1_IF(PacketTraits::HasExp, REF_FREXP, internal::pfrexp);
       data1[0] = -data1[0];
       CHECK_CWISE1_BYREF1_IF(PacketTraits::HasExp, REF_FREXP, internal::pfrexp);
     }
-    #endif
+#endif
 
     // zero
     data1[0] = Scalar(0);
     CHECK_CWISE1_BYREF1_IF(PacketTraits::HasExp, REF_FREXP, internal::pfrexp);
 
     // inf and NaN only compare output fraction, not exponent.
-    test::packet_helper<PacketTraits::HasExp,Packet> h;
+    test::packet_helper<PacketTraits::HasExp, Packet> h;
     Packet pout;
     Scalar sout;
-    Scalar special[] = { NumTraits<Scalar>::infinity(), 
-                        -NumTraits<Scalar>::infinity(),
-                         NumTraits<Scalar>::quiet_NaN()};
-    for (int i=0; i<3; ++i) {
+    Scalar special[] = {NumTraits<Scalar>::infinity(), -NumTraits<Scalar>::infinity(), NumTraits<Scalar>::quiet_NaN()};
+    for (int i = 0; i < 3; ++i) {
       data1[0] = special[i];
       ref[0] = Scalar(REF_FREXP(data1[0], ref[PacketSize]));
       h.store(data2, internal::pfrexp(h.load(data1), h.forward_reference(pout, sout)));
@@ -945,17 +933,17 @@
     data2[i] = Scalar(internal::random<double>(-1, 1));
   }
   for (int i = 0; i < PacketSize; ++i) {
-    data1[i+PacketSize] = Scalar(internal::random<int>(-4, 4));
-    data2[i+PacketSize] = Scalar(internal::random<double>(-4, 4));
+    data1[i + PacketSize] = Scalar(internal::random<int>(-4, 4));
+    data2[i + PacketSize] = Scalar(internal::random<double>(-4, 4));
   }
   CHECK_CWISE2_IF(PacketTraits::HasExp, REF_LDEXP, internal::pldexp);
   if (PacketTraits::HasExp) {
     data1[0] = Scalar(-1);
     // underflow to zero
-    data1[PacketSize] = Scalar(NumTraits<Scalar>::min_exponent()-55);
+    data1[PacketSize] = Scalar(NumTraits<Scalar>::min_exponent() - 55);
     CHECK_CWISE2_IF(PacketTraits::HasExp, REF_LDEXP, internal::pldexp);
     // overflow to inf
-    data1[PacketSize] = Scalar(NumTraits<Scalar>::max_exponent()+10);
+    data1[PacketSize] = Scalar(NumTraits<Scalar>::max_exponent() + 10);
     CHECK_CWISE2_IF(PacketTraits::HasExp, REF_LDEXP, internal::pldexp);
     // NaN stays NaN
     data1[0] = NumTraits<Scalar>::quiet_NaN();
@@ -963,21 +951,19 @@
     VERIFY((numext::isnan)(data2[0]));
     // inf stays inf
     data1[0] = NumTraits<Scalar>::infinity();
-    data1[PacketSize] = Scalar(NumTraits<Scalar>::min_exponent()-10);
+    data1[PacketSize] = Scalar(NumTraits<Scalar>::min_exponent() - 10);
     CHECK_CWISE2_IF(PacketTraits::HasExp, REF_LDEXP, internal::pldexp);
     // zero stays zero
     data1[0] = Scalar(0);
-    data1[PacketSize] = Scalar(NumTraits<Scalar>::max_exponent()+10);
+    data1[PacketSize] = Scalar(NumTraits<Scalar>::max_exponent() + 10);
     CHECK_CWISE2_IF(PacketTraits::HasExp, REF_LDEXP, internal::pldexp);
     // Small number big exponent.
-    data1[0] = Scalar(std::ldexp(Scalar(1.0), NumTraits<Scalar>::min_exponent()-1));
-    data1[PacketSize] = Scalar(-NumTraits<Scalar>::min_exponent()
-                               +NumTraits<Scalar>::max_exponent());
+    data1[0] = Scalar(std::ldexp(Scalar(1.0), NumTraits<Scalar>::min_exponent() - 1));
+    data1[PacketSize] = Scalar(-NumTraits<Scalar>::min_exponent() + NumTraits<Scalar>::max_exponent());
     CHECK_CWISE2_IF(PacketTraits::HasExp, REF_LDEXP, internal::pldexp);
     // Big number small exponent.
-    data1[0] = Scalar(std::ldexp(Scalar(1.0), NumTraits<Scalar>::max_exponent()-1));
-    data1[PacketSize] = Scalar(+NumTraits<Scalar>::min_exponent()
-                               -NumTraits<Scalar>::max_exponent());
+    data1[0] = Scalar(std::ldexp(Scalar(1.0), NumTraits<Scalar>::max_exponent() - 1));
+    data1[PacketSize] = Scalar(+NumTraits<Scalar>::min_exponent() - NumTraits<Scalar>::max_exponent());
     CHECK_CWISE2_IF(PacketTraits::HasExp, REF_LDEXP, internal::pldexp);
   }
 
@@ -1113,9 +1099,8 @@
     packetmath_test_IEEE_corner_cases<PacketTraits::HasRsqrt, Scalar, Packet>(numext::rsqrt<Scalar>, prsqrt_functor());
 
     // TODO(rmlarsen): Re-enable for half and bfloat16.
-    if (PacketTraits::HasCos
-        && !internal::is_same<Scalar, half>::value
-        && !internal::is_same<Scalar, bfloat16>::value) {
+    if (PacketTraits::HasCos && !internal::is_same<Scalar, half>::value &&
+        !internal::is_same<Scalar, bfloat16>::value) {
       test::packet_helper<PacketTraits::HasCos, Packet> h;
       for (Scalar k = Scalar(1); k < Scalar(10000) / NumTraits<Scalar>::epsilon(); k *= Scalar(2)) {
         for (int k1 = 0; k1 <= 1; ++k1) {
@@ -1176,44 +1161,43 @@
     h.store(data2, internal::preciprocal(h.load(data1)));
     VERIFY_IS_EQUAL(data2[0], zero);
     VERIFY_IS_EQUAL(data2[1], -zero);
-
   }
 }
 
-#define CAST_CHECK_CWISE1_IF(COND, REFOP, POP, SCALAR, REFTYPE) if(COND) { \
-  test::packet_helper<COND,Packet> h; \
-  for (int i=0; i<PacketSize; ++i) \
-    ref[i] = SCALAR(REFOP(static_cast<REFTYPE>(data1[i]))); \
-  h.store(data2, POP(h.load(data1))); \
-  VERIFY(test::areApprox(ref, data2, PacketSize) && #POP); \
+#define CAST_CHECK_CWISE1_IF(COND, REFOP, POP, SCALAR, REFTYPE)                                  \
+  if (COND) {                                                                                    \
+    test::packet_helper<COND, Packet> h;                                                         \
+    for (int i = 0; i < PacketSize; ++i) ref[i] = SCALAR(REFOP(static_cast<REFTYPE>(data1[i]))); \
+    h.store(data2, POP(h.load(data1)));                                                          \
+    VERIFY(test::areApprox(ref, data2, PacketSize) && #POP);                                     \
   }
 
 template <typename Scalar>
 Scalar propagate_nan_max(const Scalar& a, const Scalar& b) {
   if ((numext::isnan)(a)) return a;
   if ((numext::isnan)(b)) return b;
-  return (numext::maxi)(a,b);
+  return (numext::maxi)(a, b);
 }
 
 template <typename Scalar>
 Scalar propagate_nan_min(const Scalar& a, const Scalar& b) {
   if ((numext::isnan)(a)) return a;
   if ((numext::isnan)(b)) return b;
-  return (numext::mini)(a,b);
+  return (numext::mini)(a, b);
 }
 
 template <typename Scalar>
 Scalar propagate_number_max(const Scalar& a, const Scalar& b) {
   if ((numext::isnan)(a)) return b;
   if ((numext::isnan)(b)) return a;
-  return (numext::maxi)(a,b);
+  return (numext::maxi)(a, b);
 }
 
 template <typename Scalar>
 Scalar propagate_number_min(const Scalar& a, const Scalar& b) {
   if ((numext::isnan)(a)) return b;
   if ((numext::isnan)(b)) return a;
-  return (numext::mini)(a,b);
+  return (numext::mini)(a, b);
 }
 
 template <typename Scalar, typename Packet>
@@ -1271,28 +1255,31 @@
     }
   }
 
-
   // Test NaN propagation.
   if (!NumTraits<Scalar>::IsInteger) {
     // Test reductions with no NaNs.
     ref[0] = data1[0];
     for (int i = 0; i < PacketSize; ++i) ref[0] = internal::pmin<PropagateNumbers>(ref[0], data1[i]);
-    VERIFY(internal::isApprox(ref[0], internal::predux_min<PropagateNumbers>(internal::pload<Packet>(data1))) && "internal::predux_min<PropagateNumbers>");
+    VERIFY(internal::isApprox(ref[0], internal::predux_min<PropagateNumbers>(internal::pload<Packet>(data1))) &&
+           "internal::predux_min<PropagateNumbers>");
     ref[0] = data1[0];
     for (int i = 0; i < PacketSize; ++i) ref[0] = internal::pmin<PropagateNaN>(ref[0], data1[i]);
-    VERIFY(internal::isApprox(ref[0], internal::predux_min<PropagateNaN>(internal::pload<Packet>(data1))) && "internal::predux_min<PropagateNaN>");
+    VERIFY(internal::isApprox(ref[0], internal::predux_min<PropagateNaN>(internal::pload<Packet>(data1))) &&
+           "internal::predux_min<PropagateNaN>");
     ref[0] = data1[0];
     for (int i = 0; i < PacketSize; ++i) ref[0] = internal::pmax<PropagateNumbers>(ref[0], data1[i]);
-    VERIFY(internal::isApprox(ref[0], internal::predux_max<PropagateNumbers>(internal::pload<Packet>(data1))) && "internal::predux_max<PropagateNumbers>");
+    VERIFY(internal::isApprox(ref[0], internal::predux_max<PropagateNumbers>(internal::pload<Packet>(data1))) &&
+           "internal::predux_max<PropagateNumbers>");
     ref[0] = data1[0];
     for (int i = 0; i < PacketSize; ++i) ref[0] = internal::pmax<PropagateNaN>(ref[0], data1[i]);
-    VERIFY(internal::isApprox(ref[0], internal::predux_max<PropagateNaN>(internal::pload<Packet>(data1))) && "internal::predux_max<PropagateNumbers>");
+    VERIFY(internal::isApprox(ref[0], internal::predux_max<PropagateNaN>(internal::pload<Packet>(data1))) &&
+           "internal::predux_max<PropagateNumbers>");
     // A single NaN.
     const size_t index = std::numeric_limits<size_t>::quiet_NaN() % PacketSize;
     data1[index] = NumTraits<Scalar>::quiet_NaN();
-    VERIFY(PacketSize==1 || !(numext::isnan)(internal::predux_min<PropagateNumbers>(internal::pload<Packet>(data1))));
+    VERIFY(PacketSize == 1 || !(numext::isnan)(internal::predux_min<PropagateNumbers>(internal::pload<Packet>(data1))));
     VERIFY((numext::isnan)(internal::predux_min<PropagateNaN>(internal::pload<Packet>(data1))));
-    VERIFY(PacketSize==1 || !(numext::isnan)(internal::predux_max<PropagateNumbers>(internal::pload<Packet>(data1))));
+    VERIFY(PacketSize == 1 || !(numext::isnan)(internal::predux_max<PropagateNumbers>(internal::pload<Packet>(data1))));
     VERIFY((numext::isnan)(internal::predux_max<PropagateNaN>(internal::pload<Packet>(data1))));
     // All NaNs.
     for (int i = 0; i < 4 * PacketSize; ++i) data1[i] = NumTraits<Scalar>::quiet_NaN();
@@ -1529,8 +1516,8 @@
     CALL_SUBTEST_8(test::runner<uint32_t>::run());
     CALL_SUBTEST_9(test::runner<int64_t>::run());
     CALL_SUBTEST_10(test::runner<uint64_t>::run());
-    CALL_SUBTEST_11(test::runner<std::complex<float> >::run());
-    CALL_SUBTEST_12(test::runner<std::complex<double> >::run());
+    CALL_SUBTEST_11(test::runner<std::complex<float>>::run());
+    CALL_SUBTEST_12(test::runner<std::complex<double>>::run());
     CALL_SUBTEST_13(test::runner<half>::run());
     CALL_SUBTEST_14((packetmath<bool, internal::packet_traits<bool>::type>()));
     CALL_SUBTEST_15(test::runner<bfloat16>::run());
diff --git a/test/packetmath_test_shared.h b/test/packetmath_test_shared.h
index 6fc489f..e1acb68 100644
--- a/test/packetmath_test_shared.h
+++ b/test/packetmath_test_shared.h
@@ -11,8 +11,8 @@
 #include "main.h"
 #include <typeinfo>
 
-#if defined __GNUC__ && __GNUC__>=6
-  #pragma GCC diagnostic ignored "-Wignored-attributes"
+#if defined __GNUC__ && __GNUC__ >= 6
+#pragma GCC diagnostic ignored "-Wignored-attributes"
 #endif
 // using namespace Eigen;
 
@@ -21,74 +21,76 @@
 namespace Eigen {
 namespace internal {
 
-template<typename T> T negate(const T& x) { return -x; }
+template <typename T>
+T negate(const T& x) {
+  return -x;
+}
 
-template<typename T>
-Map<const Array<unsigned char,sizeof(T),1> >
-bits(const T& x) {
-  return Map<const Array<unsigned char,sizeof(T),1> >(reinterpret_cast<const unsigned char *>(&x));
+template <typename T>
+Map<const Array<unsigned char, sizeof(T), 1> > bits(const T& x) {
+  return Map<const Array<unsigned char, sizeof(T), 1> >(reinterpret_cast<const unsigned char*>(&x));
 }
 
 // The following implement bitwise operations on floating point types
-template<typename T,typename Bits,typename Func>
+template <typename T, typename Bits, typename Func>
 T apply_bit_op(Bits a, Bits b, Func f) {
-  Array<unsigned char,sizeof(T),1> data;
+  Array<unsigned char, sizeof(T), 1> data;
   T res;
-  for(Index i = 0; i < data.size(); ++i)
-    data[i] = f(a[i], b[i]);
+  for (Index i = 0; i < data.size(); ++i) data[i] = f(a[i], b[i]);
   // Note: The reinterpret_cast works around GCC's class-memaccess warnings:
   std::memcpy(reinterpret_cast<unsigned char*>(&res), data.data(), sizeof(T));
   return res;
 }
 
-#define EIGEN_TEST_MAKE_BITWISE2(OP,FUNC,T)             \
-  template<> T EIGEN_CAT(p,OP)(const T& a,const T& b) { \
-    return apply_bit_op<T>(bits(a),bits(b),FUNC);     \
+#define EIGEN_TEST_MAKE_BITWISE2(OP, FUNC, T)       \
+  template <>                                       \
+  T EIGEN_CAT(p, OP)(const T& a, const T& b) {      \
+    return apply_bit_op<T>(bits(a), bits(b), FUNC); \
   }
 
-#define EIGEN_TEST_MAKE_BITWISE(OP,FUNC)                  \
-  EIGEN_TEST_MAKE_BITWISE2(OP,FUNC,float)                 \
-  EIGEN_TEST_MAKE_BITWISE2(OP,FUNC,double)                \
-  EIGEN_TEST_MAKE_BITWISE2(OP,FUNC,half)                  \
-  EIGEN_TEST_MAKE_BITWISE2(OP,FUNC,bfloat16)              \
-  EIGEN_TEST_MAKE_BITWISE2(OP,FUNC,std::complex<float>)   \
-  EIGEN_TEST_MAKE_BITWISE2(OP,FUNC,std::complex<double>)
+#define EIGEN_TEST_MAKE_BITWISE(OP, FUNC)                 \
+  EIGEN_TEST_MAKE_BITWISE2(OP, FUNC, float)               \
+  EIGEN_TEST_MAKE_BITWISE2(OP, FUNC, double)              \
+  EIGEN_TEST_MAKE_BITWISE2(OP, FUNC, half)                \
+  EIGEN_TEST_MAKE_BITWISE2(OP, FUNC, bfloat16)            \
+  EIGEN_TEST_MAKE_BITWISE2(OP, FUNC, std::complex<float>) \
+  EIGEN_TEST_MAKE_BITWISE2(OP, FUNC, std::complex<double>)
 
-EIGEN_TEST_MAKE_BITWISE(xor,std::bit_xor<unsigned char>())
-EIGEN_TEST_MAKE_BITWISE(and,std::bit_and<unsigned char>())
+EIGEN_TEST_MAKE_BITWISE(xor, std::bit_xor<unsigned char>())
+EIGEN_TEST_MAKE_BITWISE(and, std::bit_and<unsigned char>())
 EIGEN_TEST_MAKE_BITWISE(or, std::bit_or<unsigned char>())
-struct bit_andnot{
-  template<typename T> T
-  operator()(T a, T b) const { return a & (~b); }
+struct bit_andnot {
+  template <typename T>
+  T operator()(T a, T b) const {
+    return a & (~b);
+  }
 };
 EIGEN_TEST_MAKE_BITWISE(andnot, bit_andnot())
-template<typename T>
+template <typename T>
 bool biteq(T a, T b) {
   return (bits(a) == bits(b)).all();
 }
 
-}
+}  // namespace internal
 
 namespace test {
 
 // NOTE: we disable inlining for this function to workaround a GCC issue when using -O3 and the i387 FPU.
-template<typename Scalar> EIGEN_DONT_INLINE
-bool isApproxAbs(const Scalar& a, const Scalar& b, const typename NumTraits<Scalar>::Real& refvalue)
-{
-  return internal::isMuchSmallerThan(a-b, refvalue);
+template <typename Scalar>
+EIGEN_DONT_INLINE bool isApproxAbs(const Scalar& a, const Scalar& b, const typename NumTraits<Scalar>::Real& refvalue) {
+  return internal::isMuchSmallerThan(a - b, refvalue);
 }
 
-template<typename Scalar>
+template <typename Scalar>
 inline void print_mismatch(const Scalar* ref, const Scalar* vec, int size) {
-  std::cout << "ref: [" << Map<const Matrix<Scalar,1,Dynamic> >(ref,size) << "]" << " != vec: [" << Map<const Matrix<Scalar,1,Dynamic> >(vec,size) << "]\n";
+  std::cout << "ref: [" << Map<const Matrix<Scalar, 1, Dynamic> >(ref, size) << "]"
+            << " != vec: [" << Map<const Matrix<Scalar, 1, Dynamic> >(vec, size) << "]\n";
 }
 
-template<typename Scalar> bool areApproxAbs(const Scalar* a, const Scalar* b, int size, const typename NumTraits<Scalar>::Real& refvalue)
-{
-  for (int i=0; i<size; ++i)
-  {
-    if (!isApproxAbs(a[i],b[i],refvalue))
-    {
+template <typename Scalar>
+bool areApproxAbs(const Scalar* a, const Scalar* b, int size, const typename NumTraits<Scalar>::Real& refvalue) {
+  for (int i = 0; i < size; ++i) {
+    if (!isApproxAbs(a[i], b[i], refvalue)) {
       print_mismatch(a, b, size);
       std::cout << "Values differ in position " << i << ": " << a[i] << " vs " << b[i] << std::endl;
       return false;
@@ -97,13 +99,11 @@
   return true;
 }
 
-template<typename Scalar> bool areApprox(const Scalar* a, const Scalar* b, int size)
-{
-  for (int i=0; i<size; ++i)
-  {
-    if ( numext::not_equal_strict(a[i], b[i]) && !internal::isApprox(a[i],b[i])
-         && !((numext::isnan)(a[i]) && (numext::isnan)(b[i])) )
-    {
+template <typename Scalar>
+bool areApprox(const Scalar* a, const Scalar* b, int size) {
+  for (int i = 0; i < size; ++i) {
+    if (numext::not_equal_strict(a[i], b[i]) && !internal::isApprox(a[i], b[i]) &&
+        !((numext::isnan)(a[i]) && (numext::isnan)(b[i]))) {
       print_mismatch(a, b, size);
       std::cout << "Values differ in position " << i << ": " << a[i] << " vs " << b[i] << std::endl;
       return false;
@@ -112,12 +112,10 @@
   return true;
 }
 
-template<typename Scalar> bool areEqual(const Scalar* a, const Scalar* b, int size)
-{
-  for (int i=0; i<size; ++i)
-  {
-    if ( numext::not_equal_strict(a[i], b[i]) && !((numext::isnan)(a[i]) && (numext::isnan)(b[i])) )
-    {
+template <typename Scalar>
+bool areEqual(const Scalar* a, const Scalar* b, int size) {
+  for (int i = 0; i < size; ++i) {
+    if (numext::not_equal_strict(a[i], b[i]) && !((numext::isnan)(a[i]) && (numext::isnan)(b[i]))) {
       print_mismatch(a, b, size);
       std::cout << "Values differ in position " << i << ": " << a[i] << " vs " << b[i] << std::endl;
       return false;
@@ -126,153 +124,161 @@
   return true;
 }
 
-#define CHECK_CWISE1(REFOP, POP) { \
-  for (int i=0; i<PacketSize; ++i) \
-    ref[i] = REFOP(data1[i]); \
-  internal::pstore(data2, POP(internal::pload<Packet>(data1))); \
-  VERIFY(test::areApprox(ref, data2, PacketSize) && #POP); \
-}
+#define CHECK_CWISE1(REFOP, POP)                                   \
+  {                                                                \
+    for (int i = 0; i < PacketSize; ++i) ref[i] = REFOP(data1[i]); \
+    internal::pstore(data2, POP(internal::pload<Packet>(data1)));  \
+    VERIFY(test::areApprox(ref, data2, PacketSize) && #POP);       \
+  }
 
 // Checks component-wise for input of size N. All of data1, data2, and ref
 // should have size at least ceil(N/PacketSize)*PacketSize to avoid memory
 // access errors.
-#define CHECK_CWISE1_N(REFOP, POP, N) { \
-  for (int i=0; i<N; ++i) \
-    ref[i] = REFOP(data1[i]); \
-  for (int j=0; j<N; j+=PacketSize) \
-    internal::pstore(data2 + j, POP(internal::pload<Packet>(data1 + j))); \
-  VERIFY(test::areApprox(ref, data2, N) && #POP); \
-}
+#define CHECK_CWISE1_N(REFOP, POP, N)                                                                             \
+  {                                                                                                               \
+    for (int i = 0; i < N; ++i) ref[i] = REFOP(data1[i]);                                                         \
+    for (int j = 0; j < N; j += PacketSize) internal::pstore(data2 + j, POP(internal::pload<Packet>(data1 + j))); \
+    VERIFY(test::areApprox(ref, data2, N) && #POP);                                                               \
+  }
 
-template<bool Cond,typename Packet>
-struct packet_helper
-{
-  template<typename T>
-  inline Packet load(const T* from) const { return internal::pload<Packet>(from); }
+template <bool Cond, typename Packet>
+struct packet_helper {
+  template <typename T>
+  inline Packet load(const T* from) const {
+    return internal::pload<Packet>(from);
+  }
 
-  template<typename T>
-  inline Packet loadu(const T* from) const { return internal::ploadu<Packet>(from); }
+  template <typename T>
+  inline Packet loadu(const T* from) const {
+    return internal::ploadu<Packet>(from);
+  }
 
-  template<typename T>
-  inline Packet load(const T* from, unsigned long long umask) const { return internal::ploadu<Packet>(from, umask); }
+  template <typename T>
+  inline Packet load(const T* from, unsigned long long umask) const {
+    return internal::ploadu<Packet>(from, umask);
+  }
 
-  template<typename T>
-  inline void store(T* to, const Packet& x) const { internal::pstore(to,x); }
+  template <typename T>
+  inline void store(T* to, const Packet& x) const {
+    internal::pstore(to, x);
+  }
 
-  template<typename T>
-  inline void store(T* to, const Packet& x, unsigned long long umask) const { internal::pstoreu(to, x, umask); }
+  template <typename T>
+  inline void store(T* to, const Packet& x, unsigned long long umask) const {
+    internal::pstoreu(to, x, umask);
+  }
 
-  template<typename T>
-  inline Packet& forward_reference(Packet& packet, T& /*scalar*/) const { return packet; }
+  template <typename T>
+  inline Packet& forward_reference(Packet& packet, T& /*scalar*/) const {
+    return packet;
+  }
 };
 
-template<typename Packet>
-struct packet_helper<false,Packet>
-{
-  template<typename T>
-  inline T load(const T* from) const { return *from; }
+template <typename Packet>
+struct packet_helper<false, Packet> {
+  template <typename T>
+  inline T load(const T* from) const {
+    return *from;
+  }
 
-  template<typename T>
-  inline T loadu(const T* from) const { return *from; }
+  template <typename T>
+  inline T loadu(const T* from) const {
+    return *from;
+  }
 
-  template<typename T>
-  inline T load(const T* from, unsigned long long) const { return *from; }
+  template <typename T>
+  inline T load(const T* from, unsigned long long) const {
+    return *from;
+  }
 
-  template<typename T>
-  inline void store(T* to, const T& x) const { *to = x; }
+  template <typename T>
+  inline void store(T* to, const T& x) const {
+    *to = x;
+  }
 
-  template<typename T>
-  inline void store(T* to, const T& x, unsigned long long) const { *to = x; }
+  template <typename T>
+  inline void store(T* to, const T& x, unsigned long long) const {
+    *to = x;
+  }
 
-  template<typename T>
-  inline T& forward_reference(Packet& /*packet*/, T& scalar) const { return scalar; }
+  template <typename T>
+  inline T& forward_reference(Packet& /*packet*/, T& scalar) const {
+    return scalar;
+  }
 };
 
-#define CHECK_CWISE1_IF(COND, REFOP, POP) if(COND) { \
-  test::packet_helper<COND,Packet> h; \
-  for (int i=0; i<PacketSize; ++i) \
-    ref[i] = Scalar(REFOP(data1[i])); \
-  h.store(data2, POP(h.load(data1))); \
-  VERIFY(test::areApprox(ref, data2, PacketSize) && #POP); \
-}
+#define CHECK_CWISE1_IF(COND, REFOP, POP)                                  \
+  if (COND) {                                                              \
+    test::packet_helper<COND, Packet> h;                                   \
+    for (int i = 0; i < PacketSize; ++i) ref[i] = Scalar(REFOP(data1[i])); \
+    h.store(data2, POP(h.load(data1)));                                    \
+    VERIFY(test::areApprox(ref, data2, PacketSize) && #POP);               \
+  }
 
-#define CHECK_CWISE1_EXACT_IF(COND, REFOP, POP) if(COND) { \
-  test::packet_helper<COND,Packet> h; \
-  for (int i=0; i<PacketSize; ++i) \
-    ref[i] = Scalar(REFOP(data1[i])); \
-  h.store(data2, POP(h.load(data1))); \
-  VERIFY(test::areEqual(ref, data2, PacketSize) && #POP); \
-}
+#define CHECK_CWISE1_EXACT_IF(COND, REFOP, POP)                            \
+  if (COND) {                                                              \
+    test::packet_helper<COND, Packet> h;                                   \
+    for (int i = 0; i < PacketSize; ++i) ref[i] = Scalar(REFOP(data1[i])); \
+    h.store(data2, POP(h.load(data1)));                                    \
+    VERIFY(test::areEqual(ref, data2, PacketSize) && #POP);                \
+  }
 
-#define CHECK_CWISE2_IF(COND, REFOP, POP) if(COND) { \
-  test::packet_helper<COND,Packet> h; \
-  for (int i=0; i<PacketSize; ++i) \
-    ref[i] = Scalar(REFOP(data1[i], data1[i+PacketSize]));     \
-  h.store(data2, POP(h.load(data1),h.load(data1+PacketSize))); \
-  VERIFY(test::areApprox(ref, data2, PacketSize) && #POP); \
-}
+#define CHECK_CWISE2_IF(COND, REFOP, POP)                                                         \
+  if (COND) {                                                                                     \
+    test::packet_helper<COND, Packet> h;                                                          \
+    for (int i = 0; i < PacketSize; ++i) ref[i] = Scalar(REFOP(data1[i], data1[i + PacketSize])); \
+    h.store(data2, POP(h.load(data1), h.load(data1 + PacketSize)));                               \
+    VERIFY(test::areApprox(ref, data2, PacketSize) && #POP);                                      \
+  }
 
 // One input, one output by reference.
-#define CHECK_CWISE1_BYREF1_IF(COND, REFOP, POP) if(COND) { \
-  test::packet_helper<COND,Packet> h; \
-  for (int i=0; i<PacketSize; ++i) \
-    ref[i] = Scalar(REFOP(data1[i], ref[i+PacketSize]));     \
-  Packet pout; \
-  Scalar sout; \
-  h.store(data2, POP(h.load(data1), h.forward_reference(pout, sout))); \
-  h.store(data2+PacketSize, h.forward_reference(pout, sout)); \
-  VERIFY(test::areApprox(ref, data2, 2 * PacketSize) && #POP); \
-}
+#define CHECK_CWISE1_BYREF1_IF(COND, REFOP, POP)                                                \
+  if (COND) {                                                                                   \
+    test::packet_helper<COND, Packet> h;                                                        \
+    for (int i = 0; i < PacketSize; ++i) ref[i] = Scalar(REFOP(data1[i], ref[i + PacketSize])); \
+    Packet pout;                                                                                \
+    Scalar sout;                                                                                \
+    h.store(data2, POP(h.load(data1), h.forward_reference(pout, sout)));                        \
+    h.store(data2 + PacketSize, h.forward_reference(pout, sout));                               \
+    VERIFY(test::areApprox(ref, data2, 2 * PacketSize) && #POP);                                \
+  }
 
-#define CHECK_CWISE3_IF(COND, REFOP, POP) if (COND) {                      \
-  test::packet_helper<COND, Packet> h;                                     \
-  for (int i = 0; i < PacketSize; ++i)                                     \
-    ref[i] = Scalar(REFOP(data1[i], data1[i + PacketSize],                 \
-                          data1[i + 2 * PacketSize]));                     \
-  h.store(data2, POP(h.load(data1), h.load(data1 + PacketSize),            \
-                     h.load(data1 + 2 * PacketSize)));                     \
-  VERIFY(test::areApprox(ref, data2, PacketSize) && #POP);                 \
-}
+#define CHECK_CWISE3_IF(COND, REFOP, POP)                                                           \
+  if (COND) {                                                                                       \
+    test::packet_helper<COND, Packet> h;                                                            \
+    for (int i = 0; i < PacketSize; ++i)                                                            \
+      ref[i] = Scalar(REFOP(data1[i], data1[i + PacketSize], data1[i + 2 * PacketSize]));           \
+    h.store(data2, POP(h.load(data1), h.load(data1 + PacketSize), h.load(data1 + 2 * PacketSize))); \
+    VERIFY(test::areApprox(ref, data2, PacketSize) && #POP);                                        \
+  }
 
 // Specialize the runall struct in your test file by defining run().
-template<
-  typename Scalar,
-  typename PacketType,
-  bool IsComplex = NumTraits<Scalar>::IsComplex,
-  bool IsInteger = NumTraits<Scalar>::IsInteger>
+template <typename Scalar, typename PacketType, bool IsComplex = NumTraits<Scalar>::IsComplex,
+          bool IsInteger = NumTraits<Scalar>::IsInteger>
 struct runall;
 
-template<
-  typename Scalar,
-  typename PacketType = typename internal::packet_traits<Scalar>::type,
-  bool Vectorized = internal::packet_traits<Scalar>::Vectorizable,
-  bool HasHalf = !internal::is_same<typename internal::unpacket_traits<PacketType>::half,PacketType>::value >
+template <typename Scalar, typename PacketType = typename internal::packet_traits<Scalar>::type,
+          bool Vectorized = internal::packet_traits<Scalar>::Vectorizable,
+          bool HasHalf = !internal::is_same<typename internal::unpacket_traits<PacketType>::half, PacketType>::value>
 struct runner;
 
-template<typename Scalar,typename PacketType>
-struct runner<Scalar,PacketType,true,true>
-{
+template <typename Scalar, typename PacketType>
+struct runner<Scalar, PacketType, true, true> {
   static void run() {
-    runall<Scalar,PacketType>::run();
-    runner<Scalar,typename internal::unpacket_traits<PacketType>::half>::run();
+    runall<Scalar, PacketType>::run();
+    runner<Scalar, typename internal::unpacket_traits<PacketType>::half>::run();
   }
 };
 
-template<typename Scalar,typename PacketType>
-struct runner<Scalar,PacketType,true,false>
-{
-  static void run() {
-    runall<Scalar,PacketType>::run();
-  }
+template <typename Scalar, typename PacketType>
+struct runner<Scalar, PacketType, true, false> {
+  static void run() { runall<Scalar, PacketType>::run(); }
 };
 
-template<typename Scalar,typename PacketType>
-struct runner<Scalar,PacketType,false,false>
-{
-  static void run() {
-    runall<Scalar,PacketType>::run();
-  }
+template <typename Scalar, typename PacketType>
+struct runner<Scalar, PacketType, false, false> {
+  static void run() { runall<Scalar, PacketType>::run(); }
 };
 
-}
-}
+}  // namespace test
+}  // namespace Eigen
diff --git a/test/pardiso_support.cpp b/test/pardiso_support.cpp
index 9c16ded..8358541 100644
--- a/test/pardiso_support.cpp
+++ b/test/pardiso_support.cpp
@@ -1,17 +1,17 @@
-/* 
+/*
    Intel Copyright (C) ....
 */
 
 #include "sparse_solver.h"
 #include <Eigen/PardisoSupport>
 
-template<typename T> void test_pardiso_T()
-{
-  PardisoLLT < SparseMatrix<T, RowMajor>, Lower> pardiso_llt_lower;
-  PardisoLLT < SparseMatrix<T, RowMajor>, Upper> pardiso_llt_upper;
-  PardisoLDLT < SparseMatrix<T, RowMajor>, Lower> pardiso_ldlt_lower;
-  PardisoLDLT < SparseMatrix<T, RowMajor>, Upper> pardiso_ldlt_upper;
-  PardisoLU  < SparseMatrix<T, RowMajor> > pardiso_lu;
+template <typename T>
+void test_pardiso_T() {
+  PardisoLLT<SparseMatrix<T, RowMajor>, Lower> pardiso_llt_lower;
+  PardisoLLT<SparseMatrix<T, RowMajor>, Upper> pardiso_llt_upper;
+  PardisoLDLT<SparseMatrix<T, RowMajor>, Lower> pardiso_ldlt_lower;
+  PardisoLDLT<SparseMatrix<T, RowMajor>, Upper> pardiso_ldlt_upper;
+  PardisoLU<SparseMatrix<T, RowMajor> > pardiso_lu;
 
   check_sparse_spd_solving(pardiso_llt_lower);
   check_sparse_spd_solving(pardiso_llt_upper);
@@ -20,10 +20,9 @@
   check_sparse_square_solving(pardiso_lu);
 }
 
-EIGEN_DECLARE_TEST(pardiso_support)
-{
+EIGEN_DECLARE_TEST(pardiso_support) {
   CALL_SUBTEST_1(test_pardiso_T<float>());
   CALL_SUBTEST_2(test_pardiso_T<double>());
-  CALL_SUBTEST_3(test_pardiso_T< std::complex<float> >());
-  CALL_SUBTEST_4(test_pardiso_T< std::complex<double> >());
+  CALL_SUBTEST_3(test_pardiso_T<std::complex<float> >());
+  CALL_SUBTEST_4(test_pardiso_T<std::complex<double> >());
 }
diff --git a/test/pastix_support.cpp b/test/pastix_support.cpp
index 9b64417..e487dd1 100644
--- a/test/pastix_support.cpp
+++ b/test/pastix_support.cpp
@@ -13,14 +13,13 @@
 #include <Eigen/PaStiXSupport>
 #include <unsupported/Eigen/SparseExtra>
 
-
-template<typename T> void test_pastix_T()
-{
-  PastixLLT< SparseMatrix<T, ColMajor>, Eigen::Lower > pastix_llt_lower;
-  PastixLDLT< SparseMatrix<T, ColMajor>, Eigen::Lower > pastix_ldlt_lower;
-  PastixLLT< SparseMatrix<T, ColMajor>, Eigen::Upper > pastix_llt_upper;
-  PastixLDLT< SparseMatrix<T, ColMajor>, Eigen::Upper > pastix_ldlt_upper;
-  PastixLU< SparseMatrix<T, ColMajor> > pastix_lu;
+template <typename T>
+void test_pastix_T() {
+  PastixLLT<SparseMatrix<T, ColMajor>, Eigen::Lower> pastix_llt_lower;
+  PastixLDLT<SparseMatrix<T, ColMajor>, Eigen::Lower> pastix_ldlt_lower;
+  PastixLLT<SparseMatrix<T, ColMajor>, Eigen::Upper> pastix_llt_upper;
+  PastixLDLT<SparseMatrix<T, ColMajor>, Eigen::Upper> pastix_ldlt_upper;
+  PastixLU<SparseMatrix<T, ColMajor> > pastix_lu;
 
   check_sparse_spd_solving(pastix_llt_lower);
   check_sparse_spd_solving(pastix_ldlt_lower);
@@ -37,18 +36,17 @@
   pastix_lu.dparm();
 }
 
-// There is no support for selfadjoint matrices with PaStiX. 
+// There is no support for selfadjoint matrices with PaStiX.
 // Complex symmetric matrices should pass though
-template<typename T> void test_pastix_T_LU()
-{
-  PastixLU< SparseMatrix<T, ColMajor> > pastix_lu;
+template <typename T>
+void test_pastix_T_LU() {
+  PastixLU<SparseMatrix<T, ColMajor> > pastix_lu;
   check_sparse_square_solving(pastix_lu);
 }
 
-EIGEN_DECLARE_TEST(pastix_support)
-{
+EIGEN_DECLARE_TEST(pastix_support) {
   CALL_SUBTEST_1(test_pastix_T<float>());
   CALL_SUBTEST_2(test_pastix_T<double>());
-  CALL_SUBTEST_3( (test_pastix_T_LU<std::complex<float> >()) );
+  CALL_SUBTEST_3((test_pastix_T_LU<std::complex<float> >()));
   CALL_SUBTEST_4(test_pastix_T_LU<std::complex<double> >());
-} 
+}
diff --git a/test/permutationmatrices.cpp b/test/permutationmatrices.cpp
index d4b68b2..2c83783 100644
--- a/test/permutationmatrices.cpp
+++ b/test/permutationmatrices.cpp
@@ -8,15 +8,14 @@
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #define TEST_ENABLE_TEMPORARY_TRACKING
-  
+
 #include "main.h"
 
 using namespace std;
-template<typename MatrixType> void permutationmatrices(const MatrixType& m)
-{
+template <typename MatrixType>
+void permutationmatrices(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
-  enum { Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime,
-         Options = MatrixType::Options };
+  enum { Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime, Options = MatrixType::Options };
   typedef PermutationMatrix<Rows> LeftPermutationType;
   typedef Transpositions<Rows> LeftTranspositionsType;
   typedef Matrix<int, Rows, 1> LeftPermutationVectorType;
@@ -29,7 +28,7 @@
   Index rows = m.rows();
   Index cols = m.cols();
 
-  MatrixType m_original = MatrixType::Random(rows,cols);
+  MatrixType m_original = MatrixType::Random(rows, cols);
   LeftPermutationVectorType lv;
   randomPermutationVector(lv, rows);
   LeftPermutationType lp(lv);
@@ -38,78 +37,83 @@
   RightPermutationType rp(rv);
   LeftTranspositionsType lt(lv);
   RightTranspositionsType rt(rv);
-  MatrixType m_permuted = MatrixType::Random(rows,cols);
-  
-  VERIFY_EVALUATION_COUNT(m_permuted = lp * m_original * rp, 1); // 1 temp for sub expression "lp * m_original"
+  MatrixType m_permuted = MatrixType::Random(rows, cols);
 
-  for (int i=0; i<rows; i++)
-    for (int j=0; j<cols; j++)
-        VERIFY_IS_APPROX(m_permuted(lv(i),j), m_original(i,rv(j)));
+  VERIFY_EVALUATION_COUNT(m_permuted = lp * m_original * rp, 1);  // 1 temp for sub expression "lp * m_original"
 
-  Matrix<Scalar,Rows,Rows> lm(lp);
-  Matrix<Scalar,Cols,Cols> rm(rp);
+  for (int i = 0; i < rows; i++)
+    for (int j = 0; j < cols; j++) VERIFY_IS_APPROX(m_permuted(lv(i), j), m_original(i, rv(j)));
 
-  VERIFY_IS_APPROX(m_permuted, lm*m_original*rm);
-  
+  Matrix<Scalar, Rows, Rows> lm(lp);
+  Matrix<Scalar, Cols, Cols> rm(rp);
+
+  VERIFY_IS_APPROX(m_permuted, lm * m_original * rm);
+
   m_permuted = m_original;
   VERIFY_EVALUATION_COUNT(m_permuted = lp * m_permuted * rp, 1);
-  VERIFY_IS_APPROX(m_permuted, lm*m_original*rm);
+  VERIFY_IS_APPROX(m_permuted, lm * m_original * rm);
 
   LeftPermutationType lpi;
   lpi = lp.inverse();
-  VERIFY_IS_APPROX(lpi*m_permuted,lp.inverse()*m_permuted);
+  VERIFY_IS_APPROX(lpi * m_permuted, lp.inverse() * m_permuted);
 
-  VERIFY_IS_APPROX(lp.inverse()*m_permuted*rp.inverse(), m_original);
-  VERIFY_IS_APPROX(lv.asPermutation().inverse()*m_permuted*rv.asPermutation().inverse(), m_original);
-  VERIFY_IS_APPROX(MapLeftPerm(lv.data(),lv.size()).inverse()*m_permuted*MapRightPerm(rv.data(),rv.size()).inverse(), m_original);
-  
-  VERIFY((lp*lp.inverse()).toDenseMatrix().isIdentity());
-  VERIFY((lv.asPermutation()*lv.asPermutation().inverse()).toDenseMatrix().isIdentity());
-  VERIFY((MapLeftPerm(lv.data(),lv.size())*MapLeftPerm(lv.data(),lv.size()).inverse()).toDenseMatrix().isIdentity());
+  VERIFY_IS_APPROX(lp.inverse() * m_permuted * rp.inverse(), m_original);
+  VERIFY_IS_APPROX(lv.asPermutation().inverse() * m_permuted * rv.asPermutation().inverse(), m_original);
+  VERIFY_IS_APPROX(
+      MapLeftPerm(lv.data(), lv.size()).inverse() * m_permuted * MapRightPerm(rv.data(), rv.size()).inverse(),
+      m_original);
+
+  VERIFY((lp * lp.inverse()).toDenseMatrix().isIdentity());
+  VERIFY((lv.asPermutation() * lv.asPermutation().inverse()).toDenseMatrix().isIdentity());
+  VERIFY(
+      (MapLeftPerm(lv.data(), lv.size()) * MapLeftPerm(lv.data(), lv.size()).inverse()).toDenseMatrix().isIdentity());
 
   LeftPermutationVectorType lv2;
   randomPermutationVector(lv2, rows);
   LeftPermutationType lp2(lv2);
-  Matrix<Scalar,Rows,Rows> lm2(lp2);
-  VERIFY_IS_APPROX((lp*lp2).toDenseMatrix().template cast<Scalar>(), lm*lm2);
-  VERIFY_IS_APPROX((lv.asPermutation()*lv2.asPermutation()).toDenseMatrix().template cast<Scalar>(), lm*lm2);
-  VERIFY_IS_APPROX((MapLeftPerm(lv.data(),lv.size())*MapLeftPerm(lv2.data(),lv2.size())).toDenseMatrix().template cast<Scalar>(), lm*lm2);
+  Matrix<Scalar, Rows, Rows> lm2(lp2);
+  VERIFY_IS_APPROX((lp * lp2).toDenseMatrix().template cast<Scalar>(), lm * lm2);
+  VERIFY_IS_APPROX((lv.asPermutation() * lv2.asPermutation()).toDenseMatrix().template cast<Scalar>(), lm * lm2);
+  VERIFY_IS_APPROX(
+      (MapLeftPerm(lv.data(), lv.size()) * MapLeftPerm(lv2.data(), lv2.size())).toDenseMatrix().template cast<Scalar>(),
+      lm * lm2);
 
   LeftPermutationType identityp;
   identityp.setIdentity(rows);
-  VERIFY_IS_APPROX(m_original, identityp*m_original);
-  
+  VERIFY_IS_APPROX(m_original, identityp * m_original);
+
   // check inplace permutations
   m_permuted = m_original;
-  VERIFY_EVALUATION_COUNT(m_permuted.noalias()= lp.inverse() * m_permuted, 1); // 1 temp to allocate the mask
-  VERIFY_IS_APPROX(m_permuted, lp.inverse()*m_original);
-  
-  m_permuted = m_original;
-  VERIFY_EVALUATION_COUNT(m_permuted.noalias() = m_permuted * rp.inverse(), 1); // 1 temp to allocate the mask
-  VERIFY_IS_APPROX(m_permuted, m_original*rp.inverse());
-  
-  m_permuted = m_original;
-  VERIFY_EVALUATION_COUNT(m_permuted.noalias() = lp * m_permuted, 1); // 1 temp to allocate the mask
-  VERIFY_IS_APPROX(m_permuted, lp*m_original);
-  
-  m_permuted = m_original;
-  VERIFY_EVALUATION_COUNT(m_permuted.noalias() = m_permuted * rp, 1); // 1 temp to allocate the mask
-  VERIFY_IS_APPROX(m_permuted, m_original*rp);
+  VERIFY_EVALUATION_COUNT(m_permuted.noalias() = lp.inverse() * m_permuted, 1);  // 1 temp to allocate the mask
+  VERIFY_IS_APPROX(m_permuted, lp.inverse() * m_original);
 
-  if(rows>1 && cols>1)
-  {
+  m_permuted = m_original;
+  VERIFY_EVALUATION_COUNT(m_permuted.noalias() = m_permuted * rp.inverse(), 1);  // 1 temp to allocate the mask
+  VERIFY_IS_APPROX(m_permuted, m_original * rp.inverse());
+
+  m_permuted = m_original;
+  VERIFY_EVALUATION_COUNT(m_permuted.noalias() = lp * m_permuted, 1);  // 1 temp to allocate the mask
+  VERIFY_IS_APPROX(m_permuted, lp * m_original);
+
+  m_permuted = m_original;
+  VERIFY_EVALUATION_COUNT(m_permuted.noalias() = m_permuted * rp, 1);  // 1 temp to allocate the mask
+  VERIFY_IS_APPROX(m_permuted, m_original * rp);
+
+  if (rows > 1 && cols > 1) {
     lp2 = lp;
-    Index i = internal::random<Index>(0, rows-1);
+    Index i = internal::random<Index>(0, rows - 1);
     Index j;
-    do j = internal::random<Index>(0, rows-1); while(j==i);
+    do j = internal::random<Index>(0, rows - 1);
+    while (j == i);
     lp2.applyTranspositionOnTheLeft(i, j);
     lm = lp;
     lm.row(i).swap(lm.row(j));
     VERIFY_IS_APPROX(lm, lp2.toDenseMatrix().template cast<Scalar>());
 
     RightPermutationType rp2 = rp;
-    i = internal::random<Index>(0, cols-1);
-    do j = internal::random<Index>(0, cols-1); while(j==i);
+    i = internal::random<Index>(0, cols - 1);
+    do j = internal::random<Index>(0, cols - 1);
+    while (j == i);
     rp2.applyTranspositionOnTheRight(i, j);
     rm = rp;
     rm.col(i).swap(rm.col(j));
@@ -127,9 +131,9 @@
   lp = lt;
   rp = rt;
   VERIFY_EVALUATION_COUNT(m_permuted = lt * m_permuted * rt, 1);
-  VERIFY_IS_APPROX(m_permuted, lp*m_original*rp.transpose());
-  
-  VERIFY_IS_APPROX(lt.inverse()*m_permuted*rt.inverse(), m_original);
+  VERIFY_IS_APPROX(m_permuted, lp * m_original * rp.transpose());
+
+  VERIFY_IS_APPROX(lt.inverse() * m_permuted * rt.inverse(), m_original);
 
   // Check inplace transpositions
   m_permuted = m_original;
@@ -142,40 +146,40 @@
   VERIFY_IS_APPROX(m_permuted = m_permuted * rt.inverse(), m_original * rt.inverse());
 }
 
-template<typename T>
-void bug890()
-{
+template <typename T>
+void bug890() {
   typedef Matrix<T, Dynamic, Dynamic> MatrixType;
   typedef Matrix<T, Dynamic, 1> VectorType;
-  typedef Stride<Dynamic,Dynamic> S;
+  typedef Stride<Dynamic, Dynamic> S;
   typedef Map<MatrixType, Aligned, S> MapType;
   typedef PermutationMatrix<Dynamic> Perm;
-  
+
   VectorType v1(2), v2(2), op(4), rhs(2);
-  v1 << 666,667;
-  op << 1,0,0,1;
-  rhs << 42,42;
-  
+  v1 << 666, 667;
+  op << 1, 0, 0, 1;
+  rhs << 42, 42;
+
   Perm P(2);
   P.indices() << 1, 0;
 
-  MapType(v1.data(),2,1,S(1,1)) = P * MapType(rhs.data(),2,1,S(1,1));
+  MapType(v1.data(), 2, 1, S(1, 1)) = P * MapType(rhs.data(), 2, 1, S(1, 1));
   VERIFY_IS_APPROX(v1, (P * rhs).eval());
 
-  MapType(v1.data(),2,1,S(1,1)) = P.inverse() * MapType(rhs.data(),2,1,S(1,1));
+  MapType(v1.data(), 2, 1, S(1, 1)) = P.inverse() * MapType(rhs.data(), 2, 1, S(1, 1));
   VERIFY_IS_APPROX(v1, (P.inverse() * rhs).eval());
 }
 
-EIGEN_DECLARE_TEST(permutationmatrices)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( permutationmatrices(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( permutationmatrices(Matrix3f()) );
-    CALL_SUBTEST_3( permutationmatrices(Matrix<double,3,3,RowMajor>()) );
-    CALL_SUBTEST_4( permutationmatrices(Matrix4d()) );
-    CALL_SUBTEST_5( permutationmatrices(Matrix<double,40,60>()) );
-    CALL_SUBTEST_6( permutationmatrices(Matrix<double,Dynamic,Dynamic,RowMajor>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_7( permutationmatrices(MatrixXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
+EIGEN_DECLARE_TEST(permutationmatrices) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(permutationmatrices(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(permutationmatrices(Matrix3f()));
+    CALL_SUBTEST_3(permutationmatrices(Matrix<double, 3, 3, RowMajor>()));
+    CALL_SUBTEST_4(permutationmatrices(Matrix4d()));
+    CALL_SUBTEST_5(permutationmatrices(Matrix<double, 40, 60>()));
+    CALL_SUBTEST_6(permutationmatrices(Matrix<double, Dynamic, Dynamic, RowMajor>(
+        internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_7(permutationmatrices(
+        MatrixXcf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
   }
-  CALL_SUBTEST_5( bug890<double>() );
+  CALL_SUBTEST_5(bug890<double>());
 }
diff --git a/test/prec_inverse_4x4.cpp b/test/prec_inverse_4x4.cpp
index 333322f..dc9967f 100644
--- a/test/prec_inverse_4x4.cpp
+++ b/test/prec_inverse_4x4.cpp
@@ -11,33 +11,31 @@
 #include <Eigen/LU>
 #include <algorithm>
 
-template<typename MatrixType> void inverse_permutation_4x4()
-{
-  Vector4i indices(0,1,2,3);
-  for(int i = 0; i < 24; ++i)
-  {
+template <typename MatrixType>
+void inverse_permutation_4x4() {
+  Vector4i indices(0, 1, 2, 3);
+  for (int i = 0; i < 24; ++i) {
     MatrixType m = PermutationMatrix<4>(indices);
     MatrixType inv = m.inverse();
-    VERIFY_IS_APPROX(m*inv, MatrixType::Identity());
-    std::next_permutation(indices.data(),indices.data()+4);
+    VERIFY_IS_APPROX(m * inv, MatrixType::Identity());
+    std::next_permutation(indices.data(), indices.data() + 4);
   }
 }
 
-template<typename MatrixType> void inverse_general_4x4(int repeat)
-{
+template <typename MatrixType>
+void inverse_general_4x4(int repeat) {
   using std::abs;
   typedef typename MatrixType::Scalar Scalar;
   double error_sum = 0., error_max = 0.;
-  for(int i = 0; i < repeat; ++i)
-  {
+  for (int i = 0; i < repeat; ++i) {
     MatrixType m;
     bool is_invertible;
     do {
       m = MatrixType::Random();
       is_invertible = Eigen::FullPivLU<MatrixType>(m).isInvertible();
-    } while(!is_invertible);
+    } while (!is_invertible);
     MatrixType inv = m.inverse();
-    double error = double( (m*inv-MatrixType::Identity()).norm());
+    double error = double((m * inv - MatrixType::Identity()).norm());
     error_sum += error;
     error_max = (std::max)(error_max, error);
   }
@@ -45,34 +43,33 @@
   double error_avg = error_sum / repeat;
   EIGEN_DEBUG_VAR(error_avg);
   EIGEN_DEBUG_VAR(error_max);
-   // FIXME that 1.25 used to be a 1.0 until the NumTraits changes on 28 April 2010, what's going wrong??
-   // FIXME that 1.25 used to be 1.2 until we tested gcc 4.1 on 30 June 2010 and got 1.21.
+  // FIXME that 1.25 used to be a 1.0 until the NumTraits changes on 28 April 2010, what's going wrong??
+  // FIXME that 1.25 used to be 1.2 until we tested gcc 4.1 on 30 June 2010 and got 1.21.
   VERIFY(error_avg < (NumTraits<Scalar>::IsComplex ? 8.0 : 1.25));
   VERIFY(error_max < (NumTraits<Scalar>::IsComplex ? 64.0 : 20.0));
 
   {
-    int s = 5;//internal::random<int>(4,10);
-    int i = 0;//internal::random<int>(0,s-4);
-    int j = 0;//internal::random<int>(0,s-4);
-    Matrix<Scalar,5,5> mat(s,s);
+    int s = 5;  // internal::random<int>(4,10);
+    int i = 0;  // internal::random<int>(0,s-4);
+    int j = 0;  // internal::random<int>(0,s-4);
+    Matrix<Scalar, 5, 5> mat(s, s);
     mat.setRandom();
-    MatrixType submat = mat.template block<4,4>(i,j);
-    MatrixType mat_inv = mat.template block<4,4>(i,j).inverse();
+    MatrixType submat = mat.template block<4, 4>(i, j);
+    MatrixType mat_inv = mat.template block<4, 4>(i, j).inverse();
     VERIFY_IS_APPROX(mat_inv, submat.inverse());
-    mat.template block<4,4>(i,j) = submat.inverse();
-    VERIFY_IS_APPROX(mat_inv, (mat.template block<4,4>(i,j)));
+    mat.template block<4, 4>(i, j) = submat.inverse();
+    VERIFY_IS_APPROX(mat_inv, (mat.template block<4, 4>(i, j)));
   }
 }
 
-EIGEN_DECLARE_TEST(prec_inverse_4x4)
-{
+EIGEN_DECLARE_TEST(prec_inverse_4x4) {
   CALL_SUBTEST_1((inverse_permutation_4x4<Matrix4f>()));
-  CALL_SUBTEST_1(( inverse_general_4x4<Matrix4f>(200000 * g_repeat) ));
-  CALL_SUBTEST_1(( inverse_general_4x4<Matrix<float,4,4,RowMajor> >(200000 * g_repeat) ));
+  CALL_SUBTEST_1((inverse_general_4x4<Matrix4f>(200000 * g_repeat)));
+  CALL_SUBTEST_1((inverse_general_4x4<Matrix<float, 4, 4, RowMajor> >(200000 * g_repeat)));
 
-  CALL_SUBTEST_2((inverse_permutation_4x4<Matrix<double,4,4,RowMajor> >()));
-  CALL_SUBTEST_2(( inverse_general_4x4<Matrix<double,4,4,ColMajor> >(200000 * g_repeat) ));
-  CALL_SUBTEST_2(( inverse_general_4x4<Matrix<double,4,4,RowMajor> >(200000 * g_repeat) ));
+  CALL_SUBTEST_2((inverse_permutation_4x4<Matrix<double, 4, 4, RowMajor> >()));
+  CALL_SUBTEST_2((inverse_general_4x4<Matrix<double, 4, 4, ColMajor> >(200000 * g_repeat)));
+  CALL_SUBTEST_2((inverse_general_4x4<Matrix<double, 4, 4, RowMajor> >(200000 * g_repeat)));
 
   CALL_SUBTEST_3((inverse_permutation_4x4<Matrix4cf>()));
   CALL_SUBTEST_3((inverse_general_4x4<Matrix4cf>(50000 * g_repeat)));
diff --git a/test/product.h b/test/product.h
index b0ce06d..8d46846 100644
--- a/test/product.h
+++ b/test/product.h
@@ -10,39 +10,36 @@
 #include "main.h"
 #include <Eigen/QR>
 
-template<typename Derived1, typename Derived2>
-bool areNotApprox(const MatrixBase<Derived1>& m1, const MatrixBase<Derived2>& m2, typename Derived1::RealScalar epsilon = NumTraits<typename Derived1::RealScalar>::dummy_precision())
-{
-  return !((m1-m2).cwiseAbs2().maxCoeff() < epsilon * epsilon
-                          * (std::max)(m1.cwiseAbs2().maxCoeff(), m2.cwiseAbs2().maxCoeff()));
+template <typename Derived1, typename Derived2>
+bool areNotApprox(const MatrixBase<Derived1>& m1, const MatrixBase<Derived2>& m2,
+                  typename Derived1::RealScalar epsilon = NumTraits<typename Derived1::RealScalar>::dummy_precision()) {
+  return !((m1 - m2).cwiseAbs2().maxCoeff() <
+           epsilon * epsilon * (std::max)(m1.cwiseAbs2().maxCoeff(), m2.cwiseAbs2().maxCoeff()));
 }
 
 // Allow specifying tolerance for verifying error.
-template<typename Type1, typename Type2, typename Tol>
-inline bool verifyIsApprox(const Type1& a, const Type2& b, Tol tol)
-{
+template <typename Type1, typename Type2, typename Tol>
+inline bool verifyIsApprox(const Type1& a, const Type2& b, Tol tol) {
   bool ret = a.isApprox(b, tol);
-  if(!ret)
-  {
-    std::cerr << "Difference too large wrt tolerance " << tol  << ", relative error is: " << test_relative_error(a,b) << std::endl;
+  if (!ret) {
+    std::cerr << "Difference too large wrt tolerance " << tol << ", relative error is: " << test_relative_error(a, b)
+              << std::endl;
   }
   return ret;
 }
 
-
 template <typename LhsType, typename RhsType>
-std::enable_if_t<RhsType::SizeAtCompileTime==Dynamic,void>
-check_mismatched_product(LhsType& lhs, const RhsType& rhs) {
-  VERIFY_RAISES_ASSERT(lhs = rhs*rhs);
+std::enable_if_t<RhsType::SizeAtCompileTime == Dynamic, void> check_mismatched_product(LhsType& lhs,
+                                                                                       const RhsType& rhs) {
+  VERIFY_RAISES_ASSERT(lhs = rhs * rhs);
 }
 
 template <typename LhsType, typename RhsType>
-std::enable_if_t<RhsType::SizeAtCompileTime!=Dynamic,void>
-check_mismatched_product(LhsType& /*unused*/, const RhsType& /*unused*/) {
-}
+std::enable_if_t<RhsType::SizeAtCompileTime != Dynamic, void> check_mismatched_product(LhsType& /*unused*/,
+                                                                                       const RhsType& /*unused*/) {}
 
-template<typename MatrixType> void product(const MatrixType& m)
-{
+template <typename MatrixType>
+void product(const MatrixType& m) {
   /* this test covers the following files:
      Identity.h Product.h
   */
@@ -53,7 +50,8 @@
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> RowSquareMatrixType;
   typedef Matrix<Scalar, MatrixType::ColsAtCompileTime, MatrixType::ColsAtCompileTime> ColSquareMatrixType;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime,
-                         MatrixType::Flags&RowMajorBit?ColMajor:RowMajor> OtherMajorMatrixType;
+                 MatrixType::Flags & RowMajorBit ? ColMajor : RowMajor>
+      OtherMajorMatrixType;
 
   // Wwe want a tighter epsilon for not-approx tests.  Otherwise, for certain
   // low-precision types (e.g. bfloat16), the bound ends up being relatively large
@@ -65,70 +63,61 @@
 
   // this test relies a lot on Random.h, and there's not much more that we can do
   // to test it, hence I consider that we will have tested Random.h
-  MatrixType m1 = MatrixType::Random(rows, cols),
-             m2 = MatrixType::Random(rows, cols),
-             m3(rows, cols);
-  RowSquareMatrixType
-             identity = RowSquareMatrixType::Identity(rows, rows),
-             square = RowSquareMatrixType::Random(rows, rows),
-             res = RowSquareMatrixType::Random(rows, rows);
-  ColSquareMatrixType
-             square2 = ColSquareMatrixType::Random(cols, cols),
-             res2 = ColSquareMatrixType::Random(cols, cols);
+  MatrixType m1 = MatrixType::Random(rows, cols), m2 = MatrixType::Random(rows, cols), m3(rows, cols);
+  RowSquareMatrixType identity = RowSquareMatrixType::Identity(rows, rows),
+                      square = RowSquareMatrixType::Random(rows, rows), res = RowSquareMatrixType::Random(rows, rows);
+  ColSquareMatrixType square2 = ColSquareMatrixType::Random(cols, cols), res2 = ColSquareMatrixType::Random(cols, cols);
   RowVectorType v1 = RowVectorType::Random(rows);
   ColVectorType vc2 = ColVectorType::Random(cols), vcres(cols);
   OtherMajorMatrixType tm1 = m1;
 
   Scalar s1 = internal::random<Scalar>();
 
-  Index r  = internal::random<Index>(0, rows-1),
-        c  = internal::random<Index>(0, cols-1),
-        c2 = internal::random<Index>(0, cols-1);
+  Index r = internal::random<Index>(0, rows - 1), c = internal::random<Index>(0, cols - 1),
+        c2 = internal::random<Index>(0, cols - 1);
 
   // begin testing Product.h: only associativity for now
   // (we use Transpose.h but this doesn't count as a test for it)
   {
     // Increase tolerance, since coefficients here can get relatively large.
     RealScalar tol = RealScalar(2) * get_test_precision(m1);
-    VERIFY(verifyIsApprox((m1*m1.transpose())*m2,  m1*(m1.transpose()*m2), tol));
+    VERIFY(verifyIsApprox((m1 * m1.transpose()) * m2, m1 * (m1.transpose() * m2), tol));
   }
   m3 = m1;
   m3 *= m1.transpose() * m2;
-  VERIFY_IS_APPROX(m3,                      m1 * (m1.transpose()*m2));
-  VERIFY_IS_APPROX(m3,                      m1 * (m1.transpose()*m2));
+  VERIFY_IS_APPROX(m3, m1 * (m1.transpose() * m2));
+  VERIFY_IS_APPROX(m3, m1 * (m1.transpose() * m2));
 
   // continue testing Product.h: distributivity
-  VERIFY_IS_APPROX(square*(m1 + m2),        square*m1+square*m2);
-  VERIFY_IS_APPROX(square*(m1 - m2),        square*m1-square*m2);
+  VERIFY_IS_APPROX(square * (m1 + m2), square * m1 + square * m2);
+  VERIFY_IS_APPROX(square * (m1 - m2), square * m1 - square * m2);
 
   // continue testing Product.h: compatibility with ScalarMultiple.h
-  VERIFY_IS_APPROX(s1*(square*m1),          (s1*square)*m1);
-  VERIFY_IS_APPROX(s1*(square*m1),          square*(m1*s1));
+  VERIFY_IS_APPROX(s1 * (square * m1), (s1 * square) * m1);
+  VERIFY_IS_APPROX(s1 * (square * m1), square * (m1 * s1));
 
   // test Product.h together with Identity.h
-  VERIFY_IS_APPROX(v1,                      identity*v1);
-  VERIFY_IS_APPROX(v1.transpose(),          v1.transpose() * identity);
+  VERIFY_IS_APPROX(v1, identity * v1);
+  VERIFY_IS_APPROX(v1.transpose(), v1.transpose() * identity);
   // again, test operator() to check const-qualification
-  VERIFY_IS_APPROX(MatrixType::Identity(rows, cols)(r,c), static_cast<Scalar>(r==c));
+  VERIFY_IS_APPROX(MatrixType::Identity(rows, cols)(r, c), static_cast<Scalar>(r == c));
 
-  if (rows!=cols) {
+  if (rows != cols) {
     check_mismatched_product(m3, m1);
   }
 
   // test the previous tests were not screwed up because operator* returns 0
   // (we use the more accurate default epsilon)
-  if (!NumTraits<Scalar>::IsInteger && (std::min)(rows,cols)>1)
-  {
-    VERIFY(areNotApprox(m1.transpose()*m2,m2.transpose()*m1, not_approx_epsilon));
+  if (!NumTraits<Scalar>::IsInteger && (std::min)(rows, cols) > 1) {
+    VERIFY(areNotApprox(m1.transpose() * m2, m2.transpose() * m1, not_approx_epsilon));
   }
 
   // test optimized operator+= path
   res = square;
   res.noalias() += m1 * m2.transpose();
   VERIFY_IS_APPROX(res, square + m1 * m2.transpose());
-  if (!NumTraits<Scalar>::IsInteger && (std::min)(rows,cols)>1)
-  {
-    VERIFY(areNotApprox(res,square + m2 * m1.transpose(), not_approx_epsilon));
+  if (!NumTraits<Scalar>::IsInteger && (std::min)(rows, cols) > 1) {
+    VERIFY(areNotApprox(res, square + m2 * m1.transpose(), not_approx_epsilon));
   }
   vcres = vc2;
   vcres.noalias() += m1.transpose() * v1;
@@ -138,9 +127,8 @@
   res = square;
   res.noalias() -= m1 * m2.transpose();
   VERIFY_IS_APPROX(res, square - (m1 * m2.transpose()));
-  if (!NumTraits<Scalar>::IsInteger && (std::min)(rows,cols)>1)
-  {
-    VERIFY(areNotApprox(res,square - m2 * m1.transpose(), not_approx_epsilon));
+  if (!NumTraits<Scalar>::IsInteger && (std::min)(rows, cols) > 1) {
+    VERIFY(areNotApprox(res, square - m2 * m1.transpose(), not_approx_epsilon));
   }
   vcres = vc2;
   vcres.noalias() -= m1.transpose() * v1;
@@ -149,19 +137,19 @@
   // test scaled products
   res = square;
   res.noalias() = s1 * m1 * m2.transpose();
-  VERIFY_IS_APPROX(res, ((s1*m1).eval() * m2.transpose()));
+  VERIFY_IS_APPROX(res, ((s1 * m1).eval() * m2.transpose()));
   res = square;
   res.noalias() += s1 * m1 * m2.transpose();
-  VERIFY_IS_APPROX(res, square + ((s1*m1).eval() * m2.transpose()));
+  VERIFY_IS_APPROX(res, square + ((s1 * m1).eval() * m2.transpose()));
   res = square;
   res.noalias() -= s1 * m1 * m2.transpose();
-  VERIFY_IS_APPROX(res, square - ((s1*m1).eval() * m2.transpose()));
+  VERIFY_IS_APPROX(res, square - ((s1 * m1).eval() * m2.transpose()));
 
   // test d ?= a+b*c rules
   res.noalias() = square + m1 * m2.transpose();
   VERIFY_IS_APPROX(res, square + m1 * m2.transpose());
   res.noalias() += square + m1 * m2.transpose();
-  VERIFY_IS_APPROX(res, Scalar(2)*(square + m1 * m2.transpose()));
+  VERIFY_IS_APPROX(res, Scalar(2) * (square + m1 * m2.transpose()));
   res.noalias() -= square + m1 * m2.transpose();
   VERIFY_IS_APPROX(res, square + m1 * m2.transpose());
 
@@ -169,30 +157,26 @@
   res.noalias() = square - m1 * m2.transpose();
   VERIFY_IS_APPROX(res, square - m1 * m2.transpose());
   res.noalias() += square - m1 * m2.transpose();
-  VERIFY_IS_APPROX(res, Scalar(2)*(square - m1 * m2.transpose()));
+  VERIFY_IS_APPROX(res, Scalar(2) * (square - m1 * m2.transpose()));
   res.noalias() -= square - m1 * m2.transpose();
   VERIFY_IS_APPROX(res, square - m1 * m2.transpose());
 
-
   tm1 = m1;
   VERIFY_IS_APPROX(tm1.transpose() * v1, m1.transpose() * v1);
   VERIFY_IS_APPROX(v1.transpose() * tm1, v1.transpose() * m1);
 
   // test submatrix and matrix/vector product
-  for (int i=0; i<rows; ++i)
-    res.row(i) = m1.row(i) * m2.transpose();
+  for (int i = 0; i < rows; ++i) res.row(i) = m1.row(i) * m2.transpose();
   VERIFY_IS_APPROX(res, m1 * m2.transpose());
   // the other way round:
-  for (int i=0; i<rows; ++i)
-    res.col(i) = m1 * m2.transpose().col(i);
+  for (int i = 0; i < rows; ++i) res.col(i) = m1 * m2.transpose().col(i);
   VERIFY_IS_APPROX(res, m1 * m2.transpose());
 
   res2 = square2;
   res2.noalias() += m1.transpose() * m2;
   VERIFY_IS_APPROX(res2, square2 + m1.transpose() * m2);
-  if (!NumTraits<Scalar>::IsInteger && (std::min)(rows,cols)>1)
-  {
-    VERIFY(areNotApprox(res2,square2 + m2.transpose() * m1, not_approx_epsilon));
+  if (!NumTraits<Scalar>::IsInteger && (std::min)(rows, cols) > 1) {
+    VERIFY(areNotApprox(res2, square2 + m2.transpose() * m1, not_approx_epsilon));
   }
 
   VERIFY_IS_APPROX(res.col(r).noalias() = square.adjoint() * square.col(r), (square.adjoint() * square.col(r)).eval());
@@ -203,38 +187,48 @@
     RowSquareMatrixType ref(square);
     ColSquareMatrixType ref2(square2);
     ref = res = square;
-    VERIFY_IS_APPROX(res.block(0,0,1,rows).noalias() = m1.col(0).transpose() * square.transpose(),            (ref.row(0) = m1.col(0).transpose() * square.transpose()));
-    VERIFY_IS_APPROX(res.block(0,0,1,rows).noalias() = m1.block(0,0,rows,1).transpose() * square.transpose(), (ref.row(0) = m1.col(0).transpose() * square.transpose()));
-    VERIFY_IS_APPROX(res.block(0,0,1,rows).noalias() = m1.col(0).transpose() * square,                        (ref.row(0) = m1.col(0).transpose() * square));
-    VERIFY_IS_APPROX(res.block(0,0,1,rows).noalias() = m1.block(0,0,rows,1).transpose() * square,             (ref.row(0) = m1.col(0).transpose() * square));
+    VERIFY_IS_APPROX(res.block(0, 0, 1, rows).noalias() = m1.col(0).transpose() * square.transpose(),
+                     (ref.row(0) = m1.col(0).transpose() * square.transpose()));
+    VERIFY_IS_APPROX(res.block(0, 0, 1, rows).noalias() = m1.block(0, 0, rows, 1).transpose() * square.transpose(),
+                     (ref.row(0) = m1.col(0).transpose() * square.transpose()));
+    VERIFY_IS_APPROX(res.block(0, 0, 1, rows).noalias() = m1.col(0).transpose() * square,
+                     (ref.row(0) = m1.col(0).transpose() * square));
+    VERIFY_IS_APPROX(res.block(0, 0, 1, rows).noalias() = m1.block(0, 0, rows, 1).transpose() * square,
+                     (ref.row(0) = m1.col(0).transpose() * square));
     ref2 = res2 = square2;
-    VERIFY_IS_APPROX(res2.block(0,0,1,cols).noalias() = m1.row(0) * square2.transpose(),                      (ref2.row(0) = m1.row(0) * square2.transpose()));
-    VERIFY_IS_APPROX(res2.block(0,0,1,cols).noalias() = m1.block(0,0,1,cols) * square2.transpose(),           (ref2.row(0) = m1.row(0) * square2.transpose()));
-    VERIFY_IS_APPROX(res2.block(0,0,1,cols).noalias() = m1.row(0) * square2,                                  (ref2.row(0) = m1.row(0) * square2));
-    VERIFY_IS_APPROX(res2.block(0,0,1,cols).noalias() = m1.block(0,0,1,cols) * square2,                       (ref2.row(0) = m1.row(0) * square2));
+    VERIFY_IS_APPROX(res2.block(0, 0, 1, cols).noalias() = m1.row(0) * square2.transpose(),
+                     (ref2.row(0) = m1.row(0) * square2.transpose()));
+    VERIFY_IS_APPROX(res2.block(0, 0, 1, cols).noalias() = m1.block(0, 0, 1, cols) * square2.transpose(),
+                     (ref2.row(0) = m1.row(0) * square2.transpose()));
+    VERIFY_IS_APPROX(res2.block(0, 0, 1, cols).noalias() = m1.row(0) * square2, (ref2.row(0) = m1.row(0) * square2));
+    VERIFY_IS_APPROX(res2.block(0, 0, 1, cols).noalias() = m1.block(0, 0, 1, cols) * square2,
+                     (ref2.row(0) = m1.row(0) * square2));
   }
 
   // vector.block() (see bug 1283)
   {
     RowVectorType w1(rows);
-    VERIFY_IS_APPROX(square * v1.block(0,0,rows,1), square * v1);
-    VERIFY_IS_APPROX(w1.noalias() = square * v1.block(0,0,rows,1), square * v1);
-    VERIFY_IS_APPROX(w1.block(0,0,rows,1).noalias() = square * v1.block(0,0,rows,1), square * v1);
+    VERIFY_IS_APPROX(square * v1.block(0, 0, rows, 1), square * v1);
+    VERIFY_IS_APPROX(w1.noalias() = square * v1.block(0, 0, rows, 1), square * v1);
+    VERIFY_IS_APPROX(w1.block(0, 0, rows, 1).noalias() = square * v1.block(0, 0, rows, 1), square * v1);
 
-    Matrix<Scalar,1,MatrixType::ColsAtCompileTime> w2(cols);
-    VERIFY_IS_APPROX(vc2.block(0,0,cols,1).transpose() * square2, vc2.transpose() * square2);
-    VERIFY_IS_APPROX(w2.noalias() = vc2.block(0,0,cols,1).transpose() * square2, vc2.transpose() * square2);
-    VERIFY_IS_APPROX(w2.block(0,0,1,cols).noalias() = vc2.block(0,0,cols,1).transpose() * square2, vc2.transpose() * square2);
+    Matrix<Scalar, 1, MatrixType::ColsAtCompileTime> w2(cols);
+    VERIFY_IS_APPROX(vc2.block(0, 0, cols, 1).transpose() * square2, vc2.transpose() * square2);
+    VERIFY_IS_APPROX(w2.noalias() = vc2.block(0, 0, cols, 1).transpose() * square2, vc2.transpose() * square2);
+    VERIFY_IS_APPROX(w2.block(0, 0, 1, cols).noalias() = vc2.block(0, 0, cols, 1).transpose() * square2,
+                     vc2.transpose() * square2);
 
-    vc2 = square2.block(0,0,1,cols).transpose();
-    VERIFY_IS_APPROX(square2.block(0,0,1,cols) * square2, vc2.transpose() * square2);
-    VERIFY_IS_APPROX(w2.noalias() = square2.block(0,0,1,cols) * square2, vc2.transpose() * square2);
-    VERIFY_IS_APPROX(w2.block(0,0,1,cols).noalias() = square2.block(0,0,1,cols) * square2, vc2.transpose() * square2);
+    vc2 = square2.block(0, 0, 1, cols).transpose();
+    VERIFY_IS_APPROX(square2.block(0, 0, 1, cols) * square2, vc2.transpose() * square2);
+    VERIFY_IS_APPROX(w2.noalias() = square2.block(0, 0, 1, cols) * square2, vc2.transpose() * square2);
+    VERIFY_IS_APPROX(w2.block(0, 0, 1, cols).noalias() = square2.block(0, 0, 1, cols) * square2,
+                     vc2.transpose() * square2);
 
-    vc2 = square2.block(0,0,cols,1);
-    VERIFY_IS_APPROX(square2.block(0,0,cols,1).transpose() * square2, vc2.transpose() * square2);
-    VERIFY_IS_APPROX(w2.noalias() = square2.block(0,0,cols,1).transpose() * square2, vc2.transpose() * square2);
-    VERIFY_IS_APPROX(w2.block(0,0,1,cols).noalias() = square2.block(0,0,cols,1).transpose() * square2, vc2.transpose() * square2);
+    vc2 = square2.block(0, 0, cols, 1);
+    VERIFY_IS_APPROX(square2.block(0, 0, cols, 1).transpose() * square2, vc2.transpose() * square2);
+    VERIFY_IS_APPROX(w2.noalias() = square2.block(0, 0, cols, 1).transpose() * square2, vc2.transpose() * square2);
+    VERIFY_IS_APPROX(w2.block(0, 0, 1, cols).noalias() = square2.block(0, 0, cols, 1).transpose() * square2,
+                     vc2.transpose() * square2);
   }
 
   // inner product
@@ -245,46 +239,51 @@
 
   // outer product
   {
-    VERIFY_IS_APPROX(m1.col(c) * m1.row(r), m1.block(0,c,rows,1) * m1.block(r,0,1,cols));
-    VERIFY_IS_APPROX(m1.row(r).transpose() * m1.col(c).transpose(), m1.block(r,0,1,cols).transpose() * m1.block(0,c,rows,1).transpose());
-    VERIFY_IS_APPROX(m1.block(0,c,rows,1) * m1.row(r), m1.block(0,c,rows,1) * m1.block(r,0,1,cols));
-    VERIFY_IS_APPROX(m1.col(c) * m1.block(r,0,1,cols), m1.block(0,c,rows,1) * m1.block(r,0,1,cols));
-    VERIFY_IS_APPROX(m1.leftCols(1) * m1.row(r), m1.block(0,0,rows,1) * m1.block(r,0,1,cols));
-    VERIFY_IS_APPROX(m1.col(c) * m1.topRows(1), m1.block(0,c,rows,1) * m1.block(0,0,1,cols));
+    VERIFY_IS_APPROX(m1.col(c) * m1.row(r), m1.block(0, c, rows, 1) * m1.block(r, 0, 1, cols));
+    VERIFY_IS_APPROX(m1.row(r).transpose() * m1.col(c).transpose(),
+                     m1.block(r, 0, 1, cols).transpose() * m1.block(0, c, rows, 1).transpose());
+    VERIFY_IS_APPROX(m1.block(0, c, rows, 1) * m1.row(r), m1.block(0, c, rows, 1) * m1.block(r, 0, 1, cols));
+    VERIFY_IS_APPROX(m1.col(c) * m1.block(r, 0, 1, cols), m1.block(0, c, rows, 1) * m1.block(r, 0, 1, cols));
+    VERIFY_IS_APPROX(m1.leftCols(1) * m1.row(r), m1.block(0, 0, rows, 1) * m1.block(r, 0, 1, cols));
+    VERIFY_IS_APPROX(m1.col(c) * m1.topRows(1), m1.block(0, c, rows, 1) * m1.block(0, 0, 1, cols));
   }
 
   // Aliasing
   {
-    ColVectorType x(cols); x.setRandom();
+    ColVectorType x(cols);
+    x.setRandom();
     ColVectorType z(x);
-    ColVectorType y(cols); y.setZero();
-    ColSquareMatrixType A(cols,cols); A.setRandom();
+    ColVectorType y(cols);
+    y.setZero();
+    ColSquareMatrixType A(cols, cols);
+    A.setRandom();
     // CwiseBinaryOp
-    VERIFY_IS_APPROX(x = y + A*x, A*z);
+    VERIFY_IS_APPROX(x = y + A * x, A * z);
     x = z;
-    VERIFY_IS_APPROX(x = y - A*x, A*(-z));
+    VERIFY_IS_APPROX(x = y - A * x, A * (-z));
     x = z;
     // CwiseUnaryOp
-    VERIFY_IS_APPROX(x = Scalar(1.)*(A*x), A*z);
+    VERIFY_IS_APPROX(x = Scalar(1.) * (A * x), A * z);
   }
 
   // regression for blas_trais
   {
     // Increase test tolerance, since coefficients can get relatively large.
     RealScalar tol = RealScalar(2) * get_test_precision(square);
-    VERIFY(verifyIsApprox(square * (square*square).transpose(), square * square.transpose() * square.transpose(), tol));
-    VERIFY(verifyIsApprox(square * (-(square*square)), -square * square * square, tol));
-    VERIFY(verifyIsApprox(square * (s1*(square*square)), s1 * square * square * square, tol));
-    VERIFY(verifyIsApprox(square * (square*square).conjugate(), square * square.conjugate() * square.conjugate(), tol));
+    VERIFY(
+        verifyIsApprox(square * (square * square).transpose(), square * square.transpose() * square.transpose(), tol));
+    VERIFY(verifyIsApprox(square * (-(square * square)), -square * square * square, tol));
+    VERIFY(verifyIsApprox(square * (s1 * (square * square)), s1 * square * square * square, tol));
+    VERIFY(
+        verifyIsApprox(square * (square * square).conjugate(), square * square.conjugate() * square.conjugate(), tol));
   }
 
   // destination with a non-default inner-stride
   // see bug 1741
-  if(!MatrixType::IsRowMajor)
-  {
-    typedef Matrix<Scalar,Dynamic,Dynamic> MatrixX;
-    MatrixX buffer(2*rows,2*rows);
-    Map<RowSquareMatrixType,0,Stride<Dynamic,2> > map1(buffer.data(),rows,rows,Stride<Dynamic,2>(2*rows,2));
+  if (!MatrixType::IsRowMajor) {
+    typedef Matrix<Scalar, Dynamic, Dynamic> MatrixX;
+    MatrixX buffer(2 * rows, 2 * rows);
+    Map<RowSquareMatrixType, 0, Stride<Dynamic, 2> > map1(buffer.data(), rows, rows, Stride<Dynamic, 2>(2 * rows, 2));
     buffer.setZero();
     VERIFY_IS_APPROX(map1 = m1 * m2.transpose(), (m1 * m2.transpose()).eval());
     buffer.setZero();
@@ -292,5 +291,4 @@
     buffer.setZero();
     VERIFY_IS_APPROX(map1.noalias() += m1 * m2.transpose(), (m1 * m2.transpose()).eval());
   }
-
 }
diff --git a/test/product_extra.cpp b/test/product_extra.cpp
index 15c6989..ddd77b5 100644
--- a/test/product_extra.cpp
+++ b/test/product_extra.cpp
@@ -9,194 +9,182 @@
 
 #include "main.h"
 
-template<typename MatrixType> void product_extra(const MatrixType& m)
-{
+template <typename MatrixType>
+void product_extra(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
   typedef Matrix<Scalar, 1, Dynamic> RowVectorType;
   typedef Matrix<Scalar, Dynamic, 1> ColVectorType;
-  typedef Matrix<Scalar, Dynamic, Dynamic,
-                         MatrixType::Flags&RowMajorBit> OtherMajorMatrixType;
+  typedef Matrix<Scalar, Dynamic, Dynamic, MatrixType::Flags & RowMajorBit> OtherMajorMatrixType;
 
   Index rows = m.rows();
   Index cols = m.cols();
 
-  MatrixType m1 = MatrixType::Random(rows, cols),
-             m2 = MatrixType::Random(rows, cols),
-             m3(rows, cols),
-             mzero = MatrixType::Zero(rows, cols),
-             identity = MatrixType::Identity(rows, rows),
-             square = MatrixType::Random(rows, rows),
-             res = MatrixType::Random(rows, rows),
-             square2 = MatrixType::Random(cols, cols),
-             res2 = MatrixType::Random(cols, cols);
+  MatrixType m1 = MatrixType::Random(rows, cols), m2 = MatrixType::Random(rows, cols), m3(rows, cols),
+             mzero = MatrixType::Zero(rows, cols), identity = MatrixType::Identity(rows, rows),
+             square = MatrixType::Random(rows, rows), res = MatrixType::Random(rows, rows),
+             square2 = MatrixType::Random(cols, cols), res2 = MatrixType::Random(cols, cols);
   RowVectorType v1 = RowVectorType::Random(rows), vrres(rows);
   ColVectorType vc2 = ColVectorType::Random(cols), vcres(cols);
   OtherMajorMatrixType tm1 = m1;
 
-  Scalar s1 = internal::random<Scalar>(),
-         s2 = internal::random<Scalar>(),
-         s3 = internal::random<Scalar>();
+  Scalar s1 = internal::random<Scalar>(), s2 = internal::random<Scalar>(), s3 = internal::random<Scalar>();
 
-  VERIFY_IS_APPROX(m3.noalias() = m1 * m2.adjoint(),                 m1 * m2.adjoint().eval());
-  VERIFY_IS_APPROX(m3.noalias() = m1.adjoint() * square.adjoint(),   m1.adjoint().eval() * square.adjoint().eval());
-  VERIFY_IS_APPROX(m3.noalias() = m1.adjoint() * m2,                 m1.adjoint().eval() * m2);
-  VERIFY_IS_APPROX(m3.noalias() = (s1 * m1.adjoint()) * m2,          (s1 * m1.adjoint()).eval() * m2);
-  VERIFY_IS_APPROX(m3.noalias() = ((s1 * m1).adjoint()) * m2,        (numext::conj(s1) * m1.adjoint()).eval() * m2);
-  VERIFY_IS_APPROX(m3.noalias() = (- m1.adjoint() * s1) * (s3 * m2), (- m1.adjoint()  * s1).eval() * (s3 * m2).eval());
-  VERIFY_IS_APPROX(m3.noalias() = (s2 * m1.adjoint() * s1) * m2,     (s2 * m1.adjoint()  * s1).eval() * m2);
-  VERIFY_IS_APPROX(m3.noalias() = (-m1*s2) * s1*m2.adjoint(),        (-m1*s2).eval() * (s1*m2.adjoint()).eval());
+  VERIFY_IS_APPROX(m3.noalias() = m1 * m2.adjoint(), m1 * m2.adjoint().eval());
+  VERIFY_IS_APPROX(m3.noalias() = m1.adjoint() * square.adjoint(), m1.adjoint().eval() * square.adjoint().eval());
+  VERIFY_IS_APPROX(m3.noalias() = m1.adjoint() * m2, m1.adjoint().eval() * m2);
+  VERIFY_IS_APPROX(m3.noalias() = (s1 * m1.adjoint()) * m2, (s1 * m1.adjoint()).eval() * m2);
+  VERIFY_IS_APPROX(m3.noalias() = ((s1 * m1).adjoint()) * m2, (numext::conj(s1) * m1.adjoint()).eval() * m2);
+  VERIFY_IS_APPROX(m3.noalias() = (-m1.adjoint() * s1) * (s3 * m2), (-m1.adjoint() * s1).eval() * (s3 * m2).eval());
+  VERIFY_IS_APPROX(m3.noalias() = (s2 * m1.adjoint() * s1) * m2, (s2 * m1.adjoint() * s1).eval() * m2);
+  VERIFY_IS_APPROX(m3.noalias() = (-m1 * s2) * s1 * m2.adjoint(), (-m1 * s2).eval() * (s1 * m2.adjoint()).eval());
 
   // a very tricky case where a scale factor has to be automatically conjugated:
-  VERIFY_IS_APPROX( m1.adjoint() * (s1*m2).conjugate(), (m1.adjoint()).eval() * ((s1*m2).conjugate()).eval());
-
+  VERIFY_IS_APPROX(m1.adjoint() * (s1 * m2).conjugate(), (m1.adjoint()).eval() * ((s1 * m2).conjugate()).eval());
 
   // test all possible conjugate combinations for the four matrix-vector product cases:
 
-  VERIFY_IS_APPROX((-m1.conjugate() * s2) * (s1 * vc2),
-                   (-m1.conjugate()*s2).eval() * (s1 * vc2).eval());
-  VERIFY_IS_APPROX((-m1 * s2) * (s1 * vc2.conjugate()),
-                   (-m1*s2).eval() * (s1 * vc2.conjugate()).eval());
+  VERIFY_IS_APPROX((-m1.conjugate() * s2) * (s1 * vc2), (-m1.conjugate() * s2).eval() * (s1 * vc2).eval());
+  VERIFY_IS_APPROX((-m1 * s2) * (s1 * vc2.conjugate()), (-m1 * s2).eval() * (s1 * vc2.conjugate()).eval());
   VERIFY_IS_APPROX((-m1.conjugate() * s2) * (s1 * vc2.conjugate()),
-                   (-m1.conjugate()*s2).eval() * (s1 * vc2.conjugate()).eval());
+                   (-m1.conjugate() * s2).eval() * (s1 * vc2.conjugate()).eval());
 
   VERIFY_IS_APPROX((s1 * vc2.transpose()) * (-m1.adjoint() * s2),
-                   (s1 * vc2.transpose()).eval() * (-m1.adjoint()*s2).eval());
+                   (s1 * vc2.transpose()).eval() * (-m1.adjoint() * s2).eval());
   VERIFY_IS_APPROX((s1 * vc2.adjoint()) * (-m1.transpose() * s2),
-                   (s1 * vc2.adjoint()).eval() * (-m1.transpose()*s2).eval());
+                   (s1 * vc2.adjoint()).eval() * (-m1.transpose() * s2).eval());
   VERIFY_IS_APPROX((s1 * vc2.adjoint()) * (-m1.adjoint() * s2),
-                   (s1 * vc2.adjoint()).eval() * (-m1.adjoint()*s2).eval());
+                   (s1 * vc2.adjoint()).eval() * (-m1.adjoint() * s2).eval());
 
   VERIFY_IS_APPROX((-m1.adjoint() * s2) * (s1 * v1.transpose()),
-                   (-m1.adjoint()*s2).eval() * (s1 * v1.transpose()).eval());
+                   (-m1.adjoint() * s2).eval() * (s1 * v1.transpose()).eval());
   VERIFY_IS_APPROX((-m1.transpose() * s2) * (s1 * v1.adjoint()),
-                   (-m1.transpose()*s2).eval() * (s1 * v1.adjoint()).eval());
+                   (-m1.transpose() * s2).eval() * (s1 * v1.adjoint()).eval());
   VERIFY_IS_APPROX((-m1.adjoint() * s2) * (s1 * v1.adjoint()),
-                   (-m1.adjoint()*s2).eval() * (s1 * v1.adjoint()).eval());
+                   (-m1.adjoint() * s2).eval() * (s1 * v1.adjoint()).eval());
 
-  VERIFY_IS_APPROX((s1 * v1) * (-m1.conjugate() * s2),
-                   (s1 * v1).eval() * (-m1.conjugate()*s2).eval());
-  VERIFY_IS_APPROX((s1 * v1.conjugate()) * (-m1 * s2),
-                   (s1 * v1.conjugate()).eval() * (-m1*s2).eval());
+  VERIFY_IS_APPROX((s1 * v1) * (-m1.conjugate() * s2), (s1 * v1).eval() * (-m1.conjugate() * s2).eval());
+  VERIFY_IS_APPROX((s1 * v1.conjugate()) * (-m1 * s2), (s1 * v1.conjugate()).eval() * (-m1 * s2).eval());
   VERIFY_IS_APPROX((s1 * v1.conjugate()) * (-m1.conjugate() * s2),
-                   (s1 * v1.conjugate()).eval() * (-m1.conjugate()*s2).eval());
+                   (s1 * v1.conjugate()).eval() * (-m1.conjugate() * s2).eval());
 
   VERIFY_IS_APPROX((-m1.adjoint() * s2) * (s1 * v1.adjoint()),
-                   (-m1.adjoint()*s2).eval() * (s1 * v1.adjoint()).eval());
+                   (-m1.adjoint() * s2).eval() * (s1 * v1.adjoint()).eval());
 
   // test the vector-matrix product with non aligned starts
-  Index i = internal::random<Index>(0,m1.rows()-2);
-  Index j = internal::random<Index>(0,m1.cols()-2);
-  Index r = internal::random<Index>(1,m1.rows()-i);
-  Index c = internal::random<Index>(1,m1.cols()-j);
-  Index i2 = internal::random<Index>(0,m1.rows()-1);
-  Index j2 = internal::random<Index>(0,m1.cols()-1);
+  Index i = internal::random<Index>(0, m1.rows() - 2);
+  Index j = internal::random<Index>(0, m1.cols() - 2);
+  Index r = internal::random<Index>(1, m1.rows() - i);
+  Index c = internal::random<Index>(1, m1.cols() - j);
+  Index i2 = internal::random<Index>(0, m1.rows() - 1);
+  Index j2 = internal::random<Index>(0, m1.cols() - 1);
 
-  VERIFY_IS_APPROX(m1.col(j2).adjoint() * m1.block(0,j,m1.rows(),c), m1.col(j2).adjoint().eval() * m1.block(0,j,m1.rows(),c).eval());
-  VERIFY_IS_APPROX(m1.block(i,0,r,m1.cols()) * m1.row(i2).adjoint(), m1.block(i,0,r,m1.cols()).eval() * m1.row(i2).adjoint().eval());
+  VERIFY_IS_APPROX(m1.col(j2).adjoint() * m1.block(0, j, m1.rows(), c),
+                   m1.col(j2).adjoint().eval() * m1.block(0, j, m1.rows(), c).eval());
+  VERIFY_IS_APPROX(m1.block(i, 0, r, m1.cols()) * m1.row(i2).adjoint(),
+                   m1.block(i, 0, r, m1.cols()).eval() * m1.row(i2).adjoint().eval());
 
   // test negative strides
   {
-    Map<MatrixType,Unaligned,Stride<Dynamic,Dynamic> > map1(&m1(rows-1,cols-1), rows, cols, Stride<Dynamic,Dynamic>(-m1.outerStride(),-1));
-    Map<MatrixType,Unaligned,Stride<Dynamic,Dynamic> > map2(&m2(rows-1,cols-1), rows, cols, Stride<Dynamic,Dynamic>(-m2.outerStride(),-1));
-    Map<RowVectorType,Unaligned,InnerStride<-1> > mapv1(&v1(v1.size()-1), v1.size(), InnerStride<-1>(-1));
-    Map<ColVectorType,Unaligned,InnerStride<-1> > mapvc2(&vc2(vc2.size()-1), vc2.size(), InnerStride<-1>(-1));
+    Map<MatrixType, Unaligned, Stride<Dynamic, Dynamic> > map1(&m1(rows - 1, cols - 1), rows, cols,
+                                                               Stride<Dynamic, Dynamic>(-m1.outerStride(), -1));
+    Map<MatrixType, Unaligned, Stride<Dynamic, Dynamic> > map2(&m2(rows - 1, cols - 1), rows, cols,
+                                                               Stride<Dynamic, Dynamic>(-m2.outerStride(), -1));
+    Map<RowVectorType, Unaligned, InnerStride<-1> > mapv1(&v1(v1.size() - 1), v1.size(), InnerStride<-1>(-1));
+    Map<ColVectorType, Unaligned, InnerStride<-1> > mapvc2(&vc2(vc2.size() - 1), vc2.size(), InnerStride<-1>(-1));
     VERIFY_IS_APPROX(MatrixType(map1), m1.reverse());
     VERIFY_IS_APPROX(MatrixType(map2), m2.reverse());
-    VERIFY_IS_APPROX(m3.noalias() = MatrixType(map1) * MatrixType(map2).adjoint(), m1.reverse() * m2.reverse().adjoint());
+    VERIFY_IS_APPROX(m3.noalias() = MatrixType(map1) * MatrixType(map2).adjoint(),
+                     m1.reverse() * m2.reverse().adjoint());
     VERIFY_IS_APPROX(m3.noalias() = map1 * map2.adjoint(), m1.reverse() * m2.reverse().adjoint());
     VERIFY_IS_APPROX(map1 * vc2, m1.reverse() * vc2);
     VERIFY_IS_APPROX(m1 * mapvc2, m1 * mapvc2);
     VERIFY_IS_APPROX(map1.adjoint() * v1.transpose(), m1.adjoint().reverse() * v1.transpose());
     VERIFY_IS_APPROX(m1.adjoint() * mapv1.transpose(), m1.adjoint() * v1.reverse().transpose());
   }
-  
+
   // regression test
   MatrixType tmp = m1 * m1.adjoint() * s1;
   VERIFY_IS_APPROX(tmp, m1 * m1.adjoint() * s1);
 
   // regression test for bug 1343, assignment to arrays
-  Array<Scalar,Dynamic,1> a1 = m1 * vc2;
-  VERIFY_IS_APPROX(a1.matrix(),m1*vc2);
-  Array<Scalar,Dynamic,1> a2 = s1 * (m1 * vc2);
-  VERIFY_IS_APPROX(a2.matrix(),s1*m1*vc2);
-  Array<Scalar,1,Dynamic> a3 = v1 * m1;
-  VERIFY_IS_APPROX(a3.matrix(),v1*m1);
-  Array<Scalar,Dynamic,Dynamic> a4 = m1 * m2.adjoint();
-  VERIFY_IS_APPROX(a4.matrix(),m1*m2.adjoint());
+  Array<Scalar, Dynamic, 1> a1 = m1 * vc2;
+  VERIFY_IS_APPROX(a1.matrix(), m1 * vc2);
+  Array<Scalar, Dynamic, 1> a2 = s1 * (m1 * vc2);
+  VERIFY_IS_APPROX(a2.matrix(), s1 * m1 * vc2);
+  Array<Scalar, 1, Dynamic> a3 = v1 * m1;
+  VERIFY_IS_APPROX(a3.matrix(), v1 * m1);
+  Array<Scalar, Dynamic, Dynamic> a4 = m1 * m2.adjoint();
+  VERIFY_IS_APPROX(a4.matrix(), m1 * m2.adjoint());
 }
 
 // Regression test for bug reported at http://forum.kde.org/viewtopic.php?f=74&t=96947
-void mat_mat_scalar_scalar_product()
-{
+void mat_mat_scalar_scalar_product() {
   Eigen::Matrix2Xd dNdxy(2, 3);
-  dNdxy << -0.5, 0.5, 0,
-           -0.3, 0, 0.3;
+  dNdxy << -0.5, 0.5, 0, -0.3, 0, 0.3;
   double det = 6.0, wt = 0.5;
-  VERIFY_IS_APPROX(dNdxy.transpose()*dNdxy*det*wt, det*wt*dNdxy.transpose()*dNdxy);
+  VERIFY_IS_APPROX(dNdxy.transpose() * dNdxy * det * wt, det * wt * dNdxy.transpose() * dNdxy);
 }
 
-template <typename MatrixType> 
-void zero_sized_objects(const MatrixType& m)
-{
+template <typename MatrixType>
+void zero_sized_objects(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
-  const int PacketSize  = internal::packet_traits<Scalar>::size;
-  const int PacketSize1 = PacketSize>1 ?  PacketSize-1 : 1;
+  const int PacketSize = internal::packet_traits<Scalar>::size;
+  const int PacketSize1 = PacketSize > 1 ? PacketSize - 1 : 1;
   Index rows = m.rows();
   Index cols = m.cols();
-  
+
   {
-    MatrixType res, a(rows,0), b(0,cols);
-    VERIFY_IS_APPROX( (res=a*b), MatrixType::Zero(rows,cols) );
-    VERIFY_IS_APPROX( (res=a*a.transpose()), MatrixType::Zero(rows,rows) );
-    VERIFY_IS_APPROX( (res=b.transpose()*b), MatrixType::Zero(cols,cols) );
-    VERIFY_IS_APPROX( (res=b.transpose()*a.transpose()), MatrixType::Zero(cols,rows) );
+    MatrixType res, a(rows, 0), b(0, cols);
+    VERIFY_IS_APPROX((res = a * b), MatrixType::Zero(rows, cols));
+    VERIFY_IS_APPROX((res = a * a.transpose()), MatrixType::Zero(rows, rows));
+    VERIFY_IS_APPROX((res = b.transpose() * b), MatrixType::Zero(cols, cols));
+    VERIFY_IS_APPROX((res = b.transpose() * a.transpose()), MatrixType::Zero(cols, rows));
   }
-  
+
   {
-    MatrixType res, a(rows,cols), b(cols,0);
-    res = a*b;
-    VERIFY(res.rows()==rows && res.cols()==0);
-    b.resize(0,rows);
-    res = b*a;
-    VERIFY(res.rows()==0 && res.cols()==cols);
+    MatrixType res, a(rows, cols), b(cols, 0);
+    res = a * b;
+    VERIFY(res.rows() == rows && res.cols() == 0);
+    b.resize(0, rows);
+    res = b * a;
+    VERIFY(res.rows() == 0 && res.cols() == cols);
   }
-  
+
   {
-    Matrix<Scalar,PacketSize,0> a;
-    Matrix<Scalar,0,1> b;
-    Matrix<Scalar,PacketSize,1> res;
-    VERIFY_IS_APPROX( (res=a*b), MatrixType::Zero(PacketSize,1) );
-    VERIFY_IS_APPROX( (res=a.lazyProduct(b)), MatrixType::Zero(PacketSize,1) );
+    Matrix<Scalar, PacketSize, 0> a;
+    Matrix<Scalar, 0, 1> b;
+    Matrix<Scalar, PacketSize, 1> res;
+    VERIFY_IS_APPROX((res = a * b), MatrixType::Zero(PacketSize, 1));
+    VERIFY_IS_APPROX((res = a.lazyProduct(b)), MatrixType::Zero(PacketSize, 1));
   }
-  
+
   {
-    Matrix<Scalar,PacketSize1,0> a;
-    Matrix<Scalar,0,1> b;
-    Matrix<Scalar,PacketSize1,1> res;
-    VERIFY_IS_APPROX( (res=a*b), MatrixType::Zero(PacketSize1,1) );
-    VERIFY_IS_APPROX( (res=a.lazyProduct(b)), MatrixType::Zero(PacketSize1,1) );
+    Matrix<Scalar, PacketSize1, 0> a;
+    Matrix<Scalar, 0, 1> b;
+    Matrix<Scalar, PacketSize1, 1> res;
+    VERIFY_IS_APPROX((res = a * b), MatrixType::Zero(PacketSize1, 1));
+    VERIFY_IS_APPROX((res = a.lazyProduct(b)), MatrixType::Zero(PacketSize1, 1));
   }
-  
+
   {
-    Matrix<Scalar,PacketSize,Dynamic> a(PacketSize,0);
-    Matrix<Scalar,Dynamic,1> b(0,1);
-    Matrix<Scalar,PacketSize,1> res;
-    VERIFY_IS_APPROX( (res=a*b), MatrixType::Zero(PacketSize,1) );
-    VERIFY_IS_APPROX( (res=a.lazyProduct(b)), MatrixType::Zero(PacketSize,1) );
+    Matrix<Scalar, PacketSize, Dynamic> a(PacketSize, 0);
+    Matrix<Scalar, Dynamic, 1> b(0, 1);
+    Matrix<Scalar, PacketSize, 1> res;
+    VERIFY_IS_APPROX((res = a * b), MatrixType::Zero(PacketSize, 1));
+    VERIFY_IS_APPROX((res = a.lazyProduct(b)), MatrixType::Zero(PacketSize, 1));
   }
-  
+
   {
-    Matrix<Scalar,PacketSize1,Dynamic> a(PacketSize1,0);
-    Matrix<Scalar,Dynamic,1> b(0,1);
-    Matrix<Scalar,PacketSize1,1> res;
-    VERIFY_IS_APPROX( (res=a*b), MatrixType::Zero(PacketSize1,1) );
-    VERIFY_IS_APPROX( (res=a.lazyProduct(b)), MatrixType::Zero(PacketSize1,1) );
+    Matrix<Scalar, PacketSize1, Dynamic> a(PacketSize1, 0);
+    Matrix<Scalar, Dynamic, 1> b(0, 1);
+    Matrix<Scalar, PacketSize1, 1> res;
+    VERIFY_IS_APPROX((res = a * b), MatrixType::Zero(PacketSize1, 1));
+    VERIFY_IS_APPROX((res = a.lazyProduct(b)), MatrixType::Zero(PacketSize1, 1));
   }
 }
 
-template<int>
-void bug_127()
-{
+template <int>
+void bug_127() {
   // Bug 127
   //
   // a product of the form lhs*rhs with
@@ -211,35 +199,32 @@
   // RowsAtCompileTime = -1, ColsAtCompileTime = -1
   // MaxRowsAtCompileTime = 5, MaxColsAtCompileTime = 1
   //
-  // was failing on a runtime assertion, because it had been mis-compiled as a dot product because Product.h was using the
-  // max-sizes to detect size 1 indicating vectors, and that didn't account for 0-sized object with max-size 1.
+  // was failing on a runtime assertion, because it had been mis-compiled as a dot product because Product.h was using
+  // the max-sizes to detect size 1 indicating vectors, and that didn't account for 0-sized object with max-size 1.
 
-  Matrix<float,1,Dynamic,RowMajor,1,5> a(1,4);
-  Matrix<float,Dynamic,Dynamic,ColMajor,5,1> b(4,0);
-  a*b;
+  Matrix<float, 1, Dynamic, RowMajor, 1, 5> a(1, 4);
+  Matrix<float, Dynamic, Dynamic, ColMajor, 5, 1> b(4, 0);
+  a* b;
 }
 
-template<int> void bug_817()
-{
-  ArrayXXf B = ArrayXXf::Random(10,10), C;
+template <int>
+void bug_817() {
+  ArrayXXf B = ArrayXXf::Random(10, 10), C;
   VectorXf x = VectorXf::Random(10);
-  C = (x.transpose()*B.matrix());
-  B = (x.transpose()*B.matrix());
-  VERIFY_IS_APPROX(B,C);
+  C = (x.transpose() * B.matrix());
+  B = (x.transpose() * B.matrix());
+  VERIFY_IS_APPROX(B, C);
 }
 
-template<int>
-void unaligned_objects()
-{
+template <int>
+void unaligned_objects() {
   // Regression test for the bug reported here:
   // http://forum.kde.org/viewtopic.php?f=74&t=107541
   // Recall the matrix*vector kernel avoid unaligned loads by loading two packets and then reassemble then.
   // There was a mistake in the computation of the valid range for fully unaligned objects: in some rare cases,
   // memory was read outside the allocated matrix memory. Though the values were not used, this might raise segfault.
-  for(int m=450;m<460;++m)
-  {
-    for(int n=8;n<12;++n)
-    {
+  for (int m = 450; m < 460; ++m) {
+    for (int n = 8; n < 12; ++n) {
       MatrixXf M(m, n);
       VectorXf v1(n), r1(500);
       RowVectorXf v2(m), r2(16);
@@ -247,89 +232,83 @@
       M.setRandom();
       v1.setRandom();
       v2.setRandom();
-      for(int o=0; o<4; ++o)
-      {
-        r1.segment(o,m).noalias() = M * v1;
-        VERIFY_IS_APPROX(r1.segment(o,m), M * MatrixXf(v1));
-        r2.segment(o,n).noalias() = v2 * M;
-        VERIFY_IS_APPROX(r2.segment(o,n), MatrixXf(v2) * M);
+      for (int o = 0; o < 4; ++o) {
+        r1.segment(o, m).noalias() = M * v1;
+        VERIFY_IS_APPROX(r1.segment(o, m), M * MatrixXf(v1));
+        r2.segment(o, n).noalias() = v2 * M;
+        VERIFY_IS_APPROX(r2.segment(o, n), MatrixXf(v2) * M);
       }
     }
   }
 }
 
-template<typename T>
-EIGEN_DONT_INLINE
-Index test_compute_block_size(Index m, Index n, Index k)
-{
+template <typename T>
+EIGEN_DONT_INLINE Index test_compute_block_size(Index m, Index n, Index k) {
   Index mc(m), nc(n), kc(k);
-  internal::computeProductBlockingSizes<T,T>(kc, mc, nc);
-  return kc+mc+nc;
+  internal::computeProductBlockingSizes<T, T>(kc, mc, nc);
+  return kc + mc + nc;
 }
 
-template<typename T>
-Index compute_block_size()
-{
+template <typename T>
+Index compute_block_size() {
   Index ret = 0;
-  ret += test_compute_block_size<T>(0,1,1);
-  ret += test_compute_block_size<T>(1,0,1);
-  ret += test_compute_block_size<T>(1,1,0);
-  ret += test_compute_block_size<T>(0,0,1);
-  ret += test_compute_block_size<T>(0,1,0);
-  ret += test_compute_block_size<T>(1,0,0);
-  ret += test_compute_block_size<T>(0,0,0);
+  ret += test_compute_block_size<T>(0, 1, 1);
+  ret += test_compute_block_size<T>(1, 0, 1);
+  ret += test_compute_block_size<T>(1, 1, 0);
+  ret += test_compute_block_size<T>(0, 0, 1);
+  ret += test_compute_block_size<T>(0, 1, 0);
+  ret += test_compute_block_size<T>(1, 0, 0);
+  ret += test_compute_block_size<T>(0, 0, 0);
   return ret;
 }
 
-template<typename>
-void aliasing_with_resize()
-{
-  Index m = internal::random<Index>(10,50);
-  Index n = internal::random<Index>(10,50);
-  MatrixXd A, B, C(m,n), D(m,m);
+template <typename>
+void aliasing_with_resize() {
+  Index m = internal::random<Index>(10, 50);
+  Index n = internal::random<Index>(10, 50);
+  MatrixXd A, B, C(m, n), D(m, m);
   VectorXd a, b, c(n);
   C.setRandom();
   D.setRandom();
   c.setRandom();
-  double s = internal::random<double>(1,10);
+  double s = internal::random<double>(1, 10);
 
   A = C;
   B = A * A.transpose();
   A = A * A.transpose();
-  VERIFY_IS_APPROX(A,B);
+  VERIFY_IS_APPROX(A, B);
 
   A = C;
-  B = (A * A.transpose())/s;
-  A = (A * A.transpose())/s;
-  VERIFY_IS_APPROX(A,B);
+  B = (A * A.transpose()) / s;
+  A = (A * A.transpose()) / s;
+  VERIFY_IS_APPROX(A, B);
 
   A = C;
   B = (A * A.transpose()) + D;
   A = (A * A.transpose()) + D;
-  VERIFY_IS_APPROX(A,B);
+  VERIFY_IS_APPROX(A, B);
 
   A = C;
   B = D + (A * A.transpose());
   A = D + (A * A.transpose());
-  VERIFY_IS_APPROX(A,B);
+  VERIFY_IS_APPROX(A, B);
 
   A = C;
   B = s * (A * A.transpose());
   A = s * (A * A.transpose());
-  VERIFY_IS_APPROX(A,B);
+  VERIFY_IS_APPROX(A, B);
 
   A = C;
   a = c;
-  b = (A * a)/s;
-  a = (A * a)/s;
-  VERIFY_IS_APPROX(a,b);
+  b = (A * a) / s;
+  a = (A * a) / s;
+  VERIFY_IS_APPROX(a, b);
 }
 
-template<int>
-void bug_1308()
-{
+template <int>
+void bug_1308() {
   int n = 10;
-  MatrixXd r(n,n);
+  MatrixXd r(n, n);
   VectorXd v = VectorXd::Random(n);
   r = v * RowVectorXd::Ones(n);
   VERIFY_IS_APPROX(r, v.rowwise().replicate(n));
@@ -338,25 +317,25 @@
 
   Matrix4d ones44 = Matrix4d::Ones();
   Matrix4d m44 = Matrix4d::Ones() * Matrix4d::Ones();
-  VERIFY_IS_APPROX(m44,Matrix4d::Constant(4));
-  VERIFY_IS_APPROX(m44.noalias()=ones44*Matrix4d::Ones(), Matrix4d::Constant(4));
-  VERIFY_IS_APPROX(m44.noalias()=ones44.transpose()*Matrix4d::Ones(), Matrix4d::Constant(4));
-  VERIFY_IS_APPROX(m44.noalias()=Matrix4d::Ones()*ones44, Matrix4d::Constant(4));
-  VERIFY_IS_APPROX(m44.noalias()=Matrix4d::Ones()*ones44.transpose(), Matrix4d::Constant(4));
+  VERIFY_IS_APPROX(m44, Matrix4d::Constant(4));
+  VERIFY_IS_APPROX(m44.noalias() = ones44 * Matrix4d::Ones(), Matrix4d::Constant(4));
+  VERIFY_IS_APPROX(m44.noalias() = ones44.transpose() * Matrix4d::Ones(), Matrix4d::Constant(4));
+  VERIFY_IS_APPROX(m44.noalias() = Matrix4d::Ones() * ones44, Matrix4d::Constant(4));
+  VERIFY_IS_APPROX(m44.noalias() = Matrix4d::Ones() * ones44.transpose(), Matrix4d::Constant(4));
 
-  typedef Matrix<double,4,4,RowMajor> RMatrix4d;
+  typedef Matrix<double, 4, 4, RowMajor> RMatrix4d;
   RMatrix4d r44 = Matrix4d::Ones() * Matrix4d::Ones();
-  VERIFY_IS_APPROX(r44,Matrix4d::Constant(4));
-  VERIFY_IS_APPROX(r44.noalias()=ones44*Matrix4d::Ones(), Matrix4d::Constant(4));
-  VERIFY_IS_APPROX(r44.noalias()=ones44.transpose()*Matrix4d::Ones(), Matrix4d::Constant(4));
-  VERIFY_IS_APPROX(r44.noalias()=Matrix4d::Ones()*ones44, Matrix4d::Constant(4));
-  VERIFY_IS_APPROX(r44.noalias()=Matrix4d::Ones()*ones44.transpose(), Matrix4d::Constant(4));
-  VERIFY_IS_APPROX(r44.noalias()=ones44*RMatrix4d::Ones(), Matrix4d::Constant(4));
-  VERIFY_IS_APPROX(r44.noalias()=ones44.transpose()*RMatrix4d::Ones(), Matrix4d::Constant(4));
-  VERIFY_IS_APPROX(r44.noalias()=RMatrix4d::Ones()*ones44, Matrix4d::Constant(4));
-  VERIFY_IS_APPROX(r44.noalias()=RMatrix4d::Ones()*ones44.transpose(), Matrix4d::Constant(4));
+  VERIFY_IS_APPROX(r44, Matrix4d::Constant(4));
+  VERIFY_IS_APPROX(r44.noalias() = ones44 * Matrix4d::Ones(), Matrix4d::Constant(4));
+  VERIFY_IS_APPROX(r44.noalias() = ones44.transpose() * Matrix4d::Ones(), Matrix4d::Constant(4));
+  VERIFY_IS_APPROX(r44.noalias() = Matrix4d::Ones() * ones44, Matrix4d::Constant(4));
+  VERIFY_IS_APPROX(r44.noalias() = Matrix4d::Ones() * ones44.transpose(), Matrix4d::Constant(4));
+  VERIFY_IS_APPROX(r44.noalias() = ones44 * RMatrix4d::Ones(), Matrix4d::Constant(4));
+  VERIFY_IS_APPROX(r44.noalias() = ones44.transpose() * RMatrix4d::Ones(), Matrix4d::Constant(4));
+  VERIFY_IS_APPROX(r44.noalias() = RMatrix4d::Ones() * ones44, Matrix4d::Constant(4));
+  VERIFY_IS_APPROX(r44.noalias() = RMatrix4d::Ones() * ones44.transpose(), Matrix4d::Constant(4));
 
-//   RowVector4d r4;
+  //   RowVector4d r4;
   m44.setOnes();
   r44.setZero();
   VERIFY_IS_APPROX(r44.noalias() += m44.row(0).transpose() * RowVector4d::Ones(), ones44);
@@ -368,23 +347,26 @@
   VERIFY_IS_APPROX(r44.noalias() += Vector4d::Ones() * m44.col(0).transpose(), ones44);
 }
 
-EIGEN_DECLARE_TEST(product_extra)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( product_extra(MatrixXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_2( product_extra(MatrixXd(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_2( mat_mat_scalar_scalar_product() );
-    CALL_SUBTEST_3( product_extra(MatrixXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2), internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2))) );
-    CALL_SUBTEST_4( product_extra(MatrixXcd(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2), internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2))) );
-    CALL_SUBTEST_1( zero_sized_objects(MatrixXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
+EIGEN_DECLARE_TEST(product_extra) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(product_extra(
+        MatrixXf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_2(product_extra(
+        MatrixXd(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_2(mat_mat_scalar_scalar_product());
+    CALL_SUBTEST_3(product_extra(MatrixXcf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2),
+                                           internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2))));
+    CALL_SUBTEST_4(product_extra(MatrixXcd(internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2),
+                                           internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2))));
+    CALL_SUBTEST_1(zero_sized_objects(
+        MatrixXf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
   }
-  CALL_SUBTEST_5( bug_127<0>() );
-  CALL_SUBTEST_5( bug_817<0>() );
-  CALL_SUBTEST_5( bug_1308<0>() );
-  CALL_SUBTEST_6( unaligned_objects<0>() );
-  CALL_SUBTEST_7( compute_block_size<float>() );
-  CALL_SUBTEST_7( compute_block_size<double>() );
-  CALL_SUBTEST_7( compute_block_size<std::complex<double> >() );
-  CALL_SUBTEST_8( aliasing_with_resize<void>() );
-
+  CALL_SUBTEST_5(bug_127<0>());
+  CALL_SUBTEST_5(bug_817<0>());
+  CALL_SUBTEST_5(bug_1308<0>());
+  CALL_SUBTEST_6(unaligned_objects<0>());
+  CALL_SUBTEST_7(compute_block_size<float>());
+  CALL_SUBTEST_7(compute_block_size<double>());
+  CALL_SUBTEST_7(compute_block_size<std::complex<double> >());
+  CALL_SUBTEST_8(aliasing_with_resize<void>());
 }
diff --git a/test/product_large.cpp b/test/product_large.cpp
index 8a9d7f8..b3213ec 100644
--- a/test/product_large.cpp
+++ b/test/product_large.cpp
@@ -10,123 +10,141 @@
 #include "product.h"
 #include <Eigen/LU>
 
-template<typename T>
-void test_aliasing()
-{
-  int rows = internal::random<int>(1,12);
-  int cols = internal::random<int>(1,12);
-  typedef Matrix<T,Dynamic,Dynamic> MatrixType;
-  typedef Matrix<T,Dynamic,1> VectorType;
-  VectorType x(cols); x.setRandom();
+template <typename T>
+void test_aliasing() {
+  int rows = internal::random<int>(1, 12);
+  int cols = internal::random<int>(1, 12);
+  typedef Matrix<T, Dynamic, Dynamic> MatrixType;
+  typedef Matrix<T, Dynamic, 1> VectorType;
+  VectorType x(cols);
+  x.setRandom();
   VectorType z(x);
-  VectorType y(rows); y.setZero();
-  MatrixType A(rows,cols); A.setRandom();
+  VectorType y(rows);
+  y.setZero();
+  MatrixType A(rows, cols);
+  A.setRandom();
   // CwiseBinaryOp
-  VERIFY_IS_APPROX(x = y + A*x, A*z);     // OK because "y + A*x" is marked as "assume-aliasing"
+  VERIFY_IS_APPROX(x = y + A * x, A * z);  // OK because "y + A*x" is marked as "assume-aliasing"
   x = z;
   // CwiseUnaryOp
-  VERIFY_IS_APPROX(x = T(1.)*(A*x), A*z); // OK because 1*(A*x) is replaced by (1*A*x) which is a Product<> expression
+  VERIFY_IS_APPROX(x = T(1.) * (A * x),
+                   A * z);  // OK because 1*(A*x) is replaced by (1*A*x) which is a Product<> expression
   x = z;
   // VERIFY_IS_APPROX(x = y-A*x, -A*z);   // Not OK in 3.3 because x is resized before A*x gets evaluated
   x = z;
 }
 
-template<int>
-void product_large_regressions()
-{
+template <int>
+void product_large_regressions() {
   {
     // test a specific issue in DiagonalProduct
     int N = 1000000;
     VectorXf v = VectorXf::Ones(N);
-    MatrixXf m = MatrixXf::Ones(N,3);
-    m = (v+v).asDiagonal() * m;
-    VERIFY_IS_APPROX(m, MatrixXf::Constant(N,3,2));
+    MatrixXf m = MatrixXf::Ones(N, 3);
+    m = (v + v).asDiagonal() * m;
+    VERIFY_IS_APPROX(m, MatrixXf::Constant(N, 3, 2));
   }
 
   {
     // test deferred resizing in Matrix::operator=
-    MatrixXf a = MatrixXf::Random(10,4), b = MatrixXf::Random(4,10), c = a;
+    MatrixXf a = MatrixXf::Random(10, 4), b = MatrixXf::Random(4, 10), c = a;
     VERIFY_IS_APPROX((a = a * b), (c * b).eval());
   }
 
   {
     // check the functions to setup blocking sizes compile and do not segfault
     // FIXME check they do what they are supposed to do !!
-    std::ptrdiff_t l1 = internal::random<int>(10000,20000);
-    std::ptrdiff_t l2 = internal::random<int>(100000,200000);
-    std::ptrdiff_t l3 = internal::random<int>(1000000,2000000);
-    setCpuCacheSizes(l1,l2,l3);
-    VERIFY(l1==l1CacheSize());
-    VERIFY(l2==l2CacheSize());
-    std::ptrdiff_t k1 = internal::random<int>(10,100)*16;
-    std::ptrdiff_t m1 = internal::random<int>(10,100)*16;
-    std::ptrdiff_t n1 = internal::random<int>(10,100)*16;
+    std::ptrdiff_t l1 = internal::random<int>(10000, 20000);
+    std::ptrdiff_t l2 = internal::random<int>(100000, 200000);
+    std::ptrdiff_t l3 = internal::random<int>(1000000, 2000000);
+    setCpuCacheSizes(l1, l2, l3);
+    VERIFY(l1 == l1CacheSize());
+    VERIFY(l2 == l2CacheSize());
+    std::ptrdiff_t k1 = internal::random<int>(10, 100) * 16;
+    std::ptrdiff_t m1 = internal::random<int>(10, 100) * 16;
+    std::ptrdiff_t n1 = internal::random<int>(10, 100) * 16;
     // only makes sure it compiles fine
-    internal::computeProductBlockingSizes<float,float,std::ptrdiff_t>(k1,m1,n1,1);
+    internal::computeProductBlockingSizes<float, float, std::ptrdiff_t>(k1, m1, n1, 1);
   }
 
   {
     // test regression in row-vector by matrix (bad Map type)
-    MatrixXf mat1(10,32); mat1.setRandom();
-    MatrixXf mat2(32,32); mat2.setRandom();
-    MatrixXf r1 = mat1.row(2)*mat2.transpose();
-    VERIFY_IS_APPROX(r1, (mat1.row(2)*mat2.transpose()).eval());
+    MatrixXf mat1(10, 32);
+    mat1.setRandom();
+    MatrixXf mat2(32, 32);
+    mat2.setRandom();
+    MatrixXf r1 = mat1.row(2) * mat2.transpose();
+    VERIFY_IS_APPROX(r1, (mat1.row(2) * mat2.transpose()).eval());
 
-    MatrixXf r2 = mat1.row(2)*mat2;
-    VERIFY_IS_APPROX(r2, (mat1.row(2)*mat2).eval());
+    MatrixXf r2 = mat1.row(2) * mat2;
+    VERIFY_IS_APPROX(r2, (mat1.row(2) * mat2).eval());
   }
 
   {
-    Eigen::MatrixXd A(10,10), B, C;
+    Eigen::MatrixXd A(10, 10), B, C;
     A.setRandom();
     C = A;
-    for(int k=0; k<79; ++k)
-      C = C * A;
-    B.noalias() = (((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A)) * ((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A)))
-                * (((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A)) * ((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A)));
-    VERIFY_IS_APPROX(B,C);
+    for (int k = 0; k < 79; ++k) C = C * A;
+    B.noalias() =
+        (((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A)) *
+         ((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A))) *
+        (((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A)) *
+         ((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A)));
+    VERIFY_IS_APPROX(B, C);
   }
 }
 
-template<int>
+template <int>
 void bug_1622() {
   typedef Matrix<double, 2, -1, 0, 2, -1> Mat2X;
-  Mat2X x(2,2); x.setRandom();
-  MatrixXd y(2,2); y.setRandom();
+  Mat2X x(2, 2);
+  x.setRandom();
+  MatrixXd y(2, 2);
+  y.setRandom();
   const Mat2X K1 = x * y.inverse();
   const Matrix2d K2 = x * y.inverse();
-  VERIFY_IS_APPROX(K1,K2);
+  VERIFY_IS_APPROX(K1, K2);
 }
 
-EIGEN_DECLARE_TEST(product_large)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( product(MatrixXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_2( product(MatrixXd(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_2( product(MatrixXd(internal::random<int>(1,10), internal::random<int>(1,10))) );
+EIGEN_DECLARE_TEST(product_large) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(product(
+        MatrixXf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_2(product(
+        MatrixXd(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_2(product(MatrixXd(internal::random<int>(1, 10), internal::random<int>(1, 10))));
 
-    CALL_SUBTEST_3( product(MatrixXi(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_4( product(MatrixXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2), internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2))) );
-    CALL_SUBTEST_5( product(Matrix<float,Dynamic,Dynamic,RowMajor>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
+    CALL_SUBTEST_3(product(
+        MatrixXi(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_4(product(MatrixXcf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2),
+                                     internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2))));
+    CALL_SUBTEST_5(product(Matrix<float, Dynamic, Dynamic, RowMajor>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE),
+                                                                     internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
 
-    CALL_SUBTEST_1( test_aliasing<float>() );
+    CALL_SUBTEST_1(test_aliasing<float>());
 
-    CALL_SUBTEST_6( bug_1622<1>() );
+    CALL_SUBTEST_6(bug_1622<1>());
 
-    CALL_SUBTEST_7( product(MatrixXcd(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2), internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2))) );
-    CALL_SUBTEST_8( product(Matrix<double,Dynamic,Dynamic,RowMajor>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_9( product(Matrix<std::complex<float>,Dynamic,Dynamic,RowMajor>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_10( product(Matrix<std::complex<double>,Dynamic,Dynamic,RowMajor>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-    CALL_SUBTEST_11( product(Matrix<bfloat16,Dynamic,Dynamic,RowMajor>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
+    CALL_SUBTEST_7(product(MatrixXcd(internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2),
+                                     internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2))));
+    CALL_SUBTEST_8(product(Matrix<double, Dynamic, Dynamic, RowMajor>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE),
+                                                                      internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_9(product(Matrix<std::complex<float>, Dynamic, Dynamic, RowMajor>(
+        internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_10(product(Matrix<std::complex<double>, Dynamic, Dynamic, RowMajor>(
+        internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_11(product(Matrix<bfloat16, Dynamic, Dynamic, RowMajor>(
+        internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
   }
 
-  CALL_SUBTEST_6( product_large_regressions<0>() );
+  CALL_SUBTEST_6(product_large_regressions<0>());
 
   // Regression test for bug 714:
 #if defined EIGEN_HAS_OPENMP
   omp_set_dynamic(1);
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_6( product(Matrix<float,Dynamic,Dynamic>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_6(product(Matrix<float, Dynamic, Dynamic>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE),
+                                                           internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
   }
 #endif
 }
diff --git a/test/product_mmtr.cpp b/test/product_mmtr.cpp
index 8f8c5fe..f177b69 100644
--- a/test/product_mmtr.cpp
+++ b/test/product_mmtr.cpp
@@ -9,66 +9,72 @@
 
 #include "main.h"
 
-#define CHECK_MMTR(DEST, TRI, OP) {                   \
-    ref3 = DEST;                                      \
-    ref2 = ref1 = DEST;                               \
-    DEST.template triangularView<TRI>() OP;           \
-    ref1 OP;                                          \
-    ref2.template triangularView<TRI>()               \
-      = ref1.template triangularView<TRI>();          \
-    VERIFY_IS_APPROX(DEST,ref2);                      \
-    \
-    DEST = ref3;                                      \
-    ref3 = ref2;                                      \
-    ref3.diagonal() = DEST.diagonal();                \
-    DEST.template triangularView<TRI|ZeroDiag>() OP;  \
-    VERIFY_IS_APPROX(DEST,ref3);                      \
+#define CHECK_MMTR(DEST, TRI, OP)                                              \
+  {                                                                            \
+    ref3 = DEST;                                                               \
+    ref2 = ref1 = DEST;                                                        \
+    DEST.template triangularView<TRI>() OP;                                    \
+    ref1 OP;                                                                   \
+    ref2.template triangularView<TRI>() = ref1.template triangularView<TRI>(); \
+    VERIFY_IS_APPROX(DEST, ref2);                                              \
+                                                                               \
+    DEST = ref3;                                                               \
+    ref3 = ref2;                                                               \
+    ref3.diagonal() = DEST.diagonal();                                         \
+    DEST.template triangularView<TRI | ZeroDiag>() OP;                         \
+    VERIFY_IS_APPROX(DEST, ref3);                                              \
   }
 
-template<typename Scalar> void mmtr(int size)
-{
-  typedef Matrix<Scalar,Dynamic,Dynamic,ColMajor> MatrixColMaj;
-  typedef Matrix<Scalar,Dynamic,Dynamic,RowMajor> MatrixRowMaj;
+template <typename Scalar>
+void mmtr(int size) {
+  typedef Matrix<Scalar, Dynamic, Dynamic, ColMajor> MatrixColMaj;
+  typedef Matrix<Scalar, Dynamic, Dynamic, RowMajor> MatrixRowMaj;
 
-  DenseIndex othersize = internal::random<DenseIndex>(1,200);
-  
+  DenseIndex othersize = internal::random<DenseIndex>(1, 200);
+
   MatrixColMaj matc = MatrixColMaj::Zero(size, size);
   MatrixRowMaj matr = MatrixRowMaj::Zero(size, size);
-  MatrixColMaj ref1(size, size), ref2(size, size), ref3(size,size);
-  
-  MatrixColMaj soc(size,othersize); soc.setRandom();
-  MatrixColMaj osc(othersize,size); osc.setRandom();
-  MatrixRowMaj sor(size,othersize); sor.setRandom();
-  MatrixRowMaj osr(othersize,size); osr.setRandom();
-  MatrixColMaj sqc(size,size); sqc.setRandom();
-  MatrixRowMaj sqr(size,size); sqr.setRandom();
-  
+  MatrixColMaj ref1(size, size), ref2(size, size), ref3(size, size);
+
+  MatrixColMaj soc(size, othersize);
+  soc.setRandom();
+  MatrixColMaj osc(othersize, size);
+  osc.setRandom();
+  MatrixRowMaj sor(size, othersize);
+  sor.setRandom();
+  MatrixRowMaj osr(othersize, size);
+  osr.setRandom();
+  MatrixColMaj sqc(size, size);
+  sqc.setRandom();
+  MatrixRowMaj sqr(size, size);
+  sqr.setRandom();
+
   Scalar s = internal::random<Scalar>();
-  
-  CHECK_MMTR(matc, Lower, = s*soc*sor.adjoint());
-  CHECK_MMTR(matc, Upper, = s*(soc*soc.adjoint()));
-  CHECK_MMTR(matr, Lower, = s*soc*soc.adjoint());
-  CHECK_MMTR(matr, Upper, = soc*(s*sor.adjoint()));
-  
-  CHECK_MMTR(matc, Lower, += s*soc*soc.adjoint());
-  CHECK_MMTR(matc, Upper, += s*(soc*sor.transpose()));
-  CHECK_MMTR(matr, Lower, += s*sor*soc.adjoint());
-  CHECK_MMTR(matr, Upper, += soc*(s*soc.adjoint()));
-  
-  CHECK_MMTR(matc, Lower, -= s*soc*soc.adjoint());
-  CHECK_MMTR(matc, Upper, -= s*(osc.transpose()*osc.conjugate()));
-  CHECK_MMTR(matr, Lower, -= s*soc*soc.adjoint());
-  CHECK_MMTR(matr, Upper, -= soc*(s*soc.adjoint()));
-  
-  CHECK_MMTR(matc, Lower, -= s*sqr*sqc.template triangularView<Upper>());
-  CHECK_MMTR(matc, Upper, = s*sqc*sqr.template triangularView<Upper>());
-  CHECK_MMTR(matc, Lower, += s*sqr*sqc.template triangularView<Lower>());
-  CHECK_MMTR(matc, Upper, = s*sqc*sqc.template triangularView<Lower>());
-  
-  CHECK_MMTR(matc, Lower, = (s*sqr).template triangularView<Upper>()*sqc);
-  CHECK_MMTR(matc, Upper, -= (s*sqc).template triangularView<Upper>()*sqc);
-  CHECK_MMTR(matc, Lower, = (s*sqr).template triangularView<Lower>()*sqc);
-  CHECK_MMTR(matc, Upper, += (s*sqc).template triangularView<Lower>()*sqc);
+
+  CHECK_MMTR(matc, Lower, = s * soc * sor.adjoint());
+  CHECK_MMTR(matc, Upper, = s * (soc * soc.adjoint()));
+  CHECK_MMTR(matr, Lower, = s * soc * soc.adjoint());
+  CHECK_MMTR(matr, Upper, = soc * (s * sor.adjoint()));
+
+  CHECK_MMTR(matc, Lower, += s * soc * soc.adjoint());
+  CHECK_MMTR(matc, Upper, += s * (soc * sor.transpose()));
+  CHECK_MMTR(matr, Lower, += s * sor * soc.adjoint());
+  CHECK_MMTR(matr, Upper, += soc * (s * soc.adjoint()));
+
+  CHECK_MMTR(matc, Lower, -= s * soc * soc.adjoint());
+  CHECK_MMTR(matc, Upper, -= s * (osc.transpose() * osc.conjugate()));
+  CHECK_MMTR(matr, Lower, -= s * soc * soc.adjoint());
+  CHECK_MMTR(matr, Upper, -= soc * (s * soc.adjoint()));
+
+  CHECK_MMTR(matc, Lower, -= s * sqr * sqc.template triangularView<Upper>());
+  CHECK_MMTR(matc, Upper, = s * sqc * sqr.template triangularView<Upper>());
+  CHECK_MMTR(matc, Lower, += s * sqr * sqc.template triangularView<Lower>());
+  CHECK_MMTR(matc, Upper, = s * sqc * sqc.template triangularView<Lower>());
+
+  CHECK_MMTR(matc, Lower, = (s * sqr).template triangularView<Upper>() * sqc);
+  CHECK_MMTR(matc, Upper, -= (s * sqc).template triangularView<Upper>() * sqc);
+  CHECK_MMTR(matc, Lower, = (s * sqr).template triangularView<Lower>() * sqc);
+  CHECK_MMTR(matc, Upper, += (s * sqc).template triangularView<Lower>() * sqc);
 
   // check aliasing
   ref2 = ref1 = matc;
@@ -86,21 +92,20 @@
   // destination with a non-default inner-stride
   // see bug 1741
   {
-    typedef Matrix<Scalar,Dynamic,Dynamic> MatrixX;
-    MatrixX buffer(2*size,2*size);
-    Map<MatrixColMaj,0,Stride<Dynamic,Dynamic> > map1(buffer.data(),size,size,Stride<Dynamic,Dynamic>(2*size,2));
+    typedef Matrix<Scalar, Dynamic, Dynamic> MatrixX;
+    MatrixX buffer(2 * size, 2 * size);
+    Map<MatrixColMaj, 0, Stride<Dynamic, Dynamic> > map1(buffer.data(), size, size,
+                                                         Stride<Dynamic, Dynamic>(2 * size, 2));
     buffer.setZero();
-    CHECK_MMTR(map1, Lower, = s*soc*sor.adjoint());
+    CHECK_MMTR(map1, Lower, = s * soc * sor.adjoint());
   }
 }
 
-EIGEN_DECLARE_TEST(product_mmtr)
-{
-  for(int i = 0; i < g_repeat ; i++)
-  {
-    CALL_SUBTEST_1((mmtr<float>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE))));
-    CALL_SUBTEST_2((mmtr<double>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE))));
-    CALL_SUBTEST_3((mmtr<std::complex<float> >(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2))));
-    CALL_SUBTEST_4((mmtr<std::complex<double> >(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2))));
+EIGEN_DECLARE_TEST(product_mmtr) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1((mmtr<float>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_2((mmtr<double>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_3((mmtr<std::complex<float> >(internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2))));
+    CALL_SUBTEST_4((mmtr<std::complex<double> >(internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2))));
   }
 }
diff --git a/test/product_notemporary.cpp b/test/product_notemporary.cpp
index 20cb7c0..77a2969 100644
--- a/test/product_notemporary.cpp
+++ b/test/product_notemporary.cpp
@@ -11,39 +11,36 @@
 
 #include "main.h"
 
-template<typename Dst, typename Lhs, typename Rhs>
-void check_scalar_multiple3(Dst &dst, const Lhs& A, const Rhs& B)
-{
-  VERIFY_EVALUATION_COUNT( (dst.noalias()  = A * B), 0);
-  VERIFY_IS_APPROX( dst, (A.eval() * B.eval()).eval() );
-  VERIFY_EVALUATION_COUNT( (dst.noalias() += A * B), 0);
-  VERIFY_IS_APPROX( dst, 2*(A.eval() * B.eval()).eval() );
-  VERIFY_EVALUATION_COUNT( (dst.noalias() -= A * B), 0);
-  VERIFY_IS_APPROX( dst, (A.eval() * B.eval()).eval() );
+template <typename Dst, typename Lhs, typename Rhs>
+void check_scalar_multiple3(Dst& dst, const Lhs& A, const Rhs& B) {
+  VERIFY_EVALUATION_COUNT((dst.noalias() = A * B), 0);
+  VERIFY_IS_APPROX(dst, (A.eval() * B.eval()).eval());
+  VERIFY_EVALUATION_COUNT((dst.noalias() += A * B), 0);
+  VERIFY_IS_APPROX(dst, 2 * (A.eval() * B.eval()).eval());
+  VERIFY_EVALUATION_COUNT((dst.noalias() -= A * B), 0);
+  VERIFY_IS_APPROX(dst, (A.eval() * B.eval()).eval());
 }
 
-template<typename Dst, typename Lhs, typename Rhs, typename S2>
-void check_scalar_multiple2(Dst &dst, const Lhs& A, const Rhs& B, S2 s2)
-{
-  CALL_SUBTEST( check_scalar_multiple3(dst, A,    B) );
-  CALL_SUBTEST( check_scalar_multiple3(dst, A,   -B) );
-  CALL_SUBTEST( check_scalar_multiple3(dst, A, s2*B) );
-  CALL_SUBTEST( check_scalar_multiple3(dst, A, B*s2) );
-  CALL_SUBTEST( check_scalar_multiple3(dst, A, (B*s2).conjugate()) );
+template <typename Dst, typename Lhs, typename Rhs, typename S2>
+void check_scalar_multiple2(Dst& dst, const Lhs& A, const Rhs& B, S2 s2) {
+  CALL_SUBTEST(check_scalar_multiple3(dst, A, B));
+  CALL_SUBTEST(check_scalar_multiple3(dst, A, -B));
+  CALL_SUBTEST(check_scalar_multiple3(dst, A, s2 * B));
+  CALL_SUBTEST(check_scalar_multiple3(dst, A, B * s2));
+  CALL_SUBTEST(check_scalar_multiple3(dst, A, (B * s2).conjugate()));
 }
 
-template<typename Dst, typename Lhs, typename Rhs, typename S1, typename S2>
-void check_scalar_multiple1(Dst &dst, const Lhs& A, const Rhs& B, S1 s1, S2 s2)
-{
-  CALL_SUBTEST( check_scalar_multiple2(dst,    A, B, s2) );
-  CALL_SUBTEST( check_scalar_multiple2(dst,   -A, B, s2) );
-  CALL_SUBTEST( check_scalar_multiple2(dst, s1*A, B, s2) );
-  CALL_SUBTEST( check_scalar_multiple2(dst, A*s1, B, s2) );
-  CALL_SUBTEST( check_scalar_multiple2(dst, (A*s1).conjugate(), B, s2) );
+template <typename Dst, typename Lhs, typename Rhs, typename S1, typename S2>
+void check_scalar_multiple1(Dst& dst, const Lhs& A, const Rhs& B, S1 s1, S2 s2) {
+  CALL_SUBTEST(check_scalar_multiple2(dst, A, B, s2));
+  CALL_SUBTEST(check_scalar_multiple2(dst, -A, B, s2));
+  CALL_SUBTEST(check_scalar_multiple2(dst, s1 * A, B, s2));
+  CALL_SUBTEST(check_scalar_multiple2(dst, A * s1, B, s2));
+  CALL_SUBTEST(check_scalar_multiple2(dst, (A * s1).conjugate(), B, s2));
 }
 
-template<typename MatrixType> void product_notemporary(const MatrixType& m)
-{
+template <typename MatrixType>
+void product_notemporary(const MatrixType& m) {
   /* This test checks the number of temporaries created
    * during the evaluation of a complex expression */
   typedef typename MatrixType::Scalar Scalar;
@@ -56,154 +53,167 @@
   Index rows = m.rows();
   Index cols = m.cols();
 
-  ColMajorMatrixType m1 = MatrixType::Random(rows, cols),
-                     m2 = MatrixType::Random(rows, cols),
-                     m3(rows, cols);
+  ColMajorMatrixType m1 = MatrixType::Random(rows, cols), m2 = MatrixType::Random(rows, cols), m3(rows, cols);
   RowVectorType rv1 = RowVectorType::Random(rows), rvres(rows);
   ColVectorType cv1 = ColVectorType::Random(cols), cvres(cols);
   RowMajorMatrixType rm3(rows, cols);
 
-  Scalar s1 = internal::random<Scalar>(),
-         s2 = internal::random<Scalar>(),
-         s3 = internal::random<Scalar>();
+  Scalar s1 = internal::random<Scalar>(), s2 = internal::random<Scalar>(), s3 = internal::random<Scalar>();
 
-  Index c0 = internal::random<Index>(4,cols-8),
-        c1 = internal::random<Index>(8,cols-c0),
-        r0 = internal::random<Index>(4,cols-8),
-        r1 = internal::random<Index>(8,rows-r0);
+  Index c0 = internal::random<Index>(4, cols - 8), c1 = internal::random<Index>(8, cols - c0),
+        r0 = internal::random<Index>(4, cols - 8), r1 = internal::random<Index>(8, rows - r0);
 
-  VERIFY_EVALUATION_COUNT( m3 = (m1 * m2.adjoint()), 1);
-  VERIFY_EVALUATION_COUNT( m3 = (m1 * m2.adjoint()).transpose(), 1);
-  VERIFY_EVALUATION_COUNT( m3.noalias() = m1 * m2.adjoint(), 0);
+  VERIFY_EVALUATION_COUNT(m3 = (m1 * m2.adjoint()), 1);
+  VERIFY_EVALUATION_COUNT(m3 = (m1 * m2.adjoint()).transpose(), 1);
+  VERIFY_EVALUATION_COUNT(m3.noalias() = m1 * m2.adjoint(), 0);
 
-  VERIFY_EVALUATION_COUNT( m3 = s1 * (m1 * m2.transpose()), 1);
-//   VERIFY_EVALUATION_COUNT( m3 = m3 + s1 * (m1 * m2.transpose()), 1);
-  VERIFY_EVALUATION_COUNT( m3.noalias() = s1 * (m1 * m2.transpose()), 0);
+  VERIFY_EVALUATION_COUNT(m3 = s1 * (m1 * m2.transpose()), 1);
+  //   VERIFY_EVALUATION_COUNT( m3 = m3 + s1 * (m1 * m2.transpose()), 1);
+  VERIFY_EVALUATION_COUNT(m3.noalias() = s1 * (m1 * m2.transpose()), 0);
 
-  VERIFY_EVALUATION_COUNT( m3 = m3 + (m1 * m2.adjoint()), 1);
-  VERIFY_EVALUATION_COUNT( m3 = m3 - (m1 * m2.adjoint()), 1);
+  VERIFY_EVALUATION_COUNT(m3 = m3 + (m1 * m2.adjoint()), 1);
+  VERIFY_EVALUATION_COUNT(m3 = m3 - (m1 * m2.adjoint()), 1);
 
-  VERIFY_EVALUATION_COUNT( m3 = m3 + (m1 * m2.adjoint()).transpose(), 1);
-  VERIFY_EVALUATION_COUNT( m3.noalias() = m3 + m1 * m2.transpose(), 0);
-  VERIFY_EVALUATION_COUNT( m3.noalias() += m3 + m1 * m2.transpose(), 0);
-  VERIFY_EVALUATION_COUNT( m3.noalias() -= m3 + m1 * m2.transpose(), 0);
-  VERIFY_EVALUATION_COUNT( m3.noalias() =  m3 - m1 * m2.transpose(), 0);
-  VERIFY_EVALUATION_COUNT( m3.noalias() += m3 - m1 * m2.transpose(), 0);
-  VERIFY_EVALUATION_COUNT( m3.noalias() -= m3 - m1 * m2.transpose(), 0);
+  VERIFY_EVALUATION_COUNT(m3 = m3 + (m1 * m2.adjoint()).transpose(), 1);
+  VERIFY_EVALUATION_COUNT(m3.noalias() = m3 + m1 * m2.transpose(), 0);
+  VERIFY_EVALUATION_COUNT(m3.noalias() += m3 + m1 * m2.transpose(), 0);
+  VERIFY_EVALUATION_COUNT(m3.noalias() -= m3 + m1 * m2.transpose(), 0);
+  VERIFY_EVALUATION_COUNT(m3.noalias() = m3 - m1 * m2.transpose(), 0);
+  VERIFY_EVALUATION_COUNT(m3.noalias() += m3 - m1 * m2.transpose(), 0);
+  VERIFY_EVALUATION_COUNT(m3.noalias() -= m3 - m1 * m2.transpose(), 0);
 
-  VERIFY_EVALUATION_COUNT( m3.noalias() = s1 * m1 * s2 * m2.adjoint(), 0);
-  VERIFY_EVALUATION_COUNT( m3.noalias() = s1 * m1 * s2 * (m1*s3+m2*s2).adjoint(), 1);
-  VERIFY_EVALUATION_COUNT( m3.noalias() = (s1 * m1).adjoint() * s2 * m2, 0);
-  VERIFY_EVALUATION_COUNT( m3.noalias() += s1 * (-m1*s3).adjoint() * (s2 * m2 * s3), 0);
-  VERIFY_EVALUATION_COUNT( m3.noalias() -= s1 * (m1.transpose() * m2), 0);
+  VERIFY_EVALUATION_COUNT(m3.noalias() = s1 * m1 * s2 * m2.adjoint(), 0);
+  VERIFY_EVALUATION_COUNT(m3.noalias() = s1 * m1 * s2 * (m1 * s3 + m2 * s2).adjoint(), 1);
+  VERIFY_EVALUATION_COUNT(m3.noalias() = (s1 * m1).adjoint() * s2 * m2, 0);
+  VERIFY_EVALUATION_COUNT(m3.noalias() += s1 * (-m1 * s3).adjoint() * (s2 * m2 * s3), 0);
+  VERIFY_EVALUATION_COUNT(m3.noalias() -= s1 * (m1.transpose() * m2), 0);
 
-  VERIFY_EVALUATION_COUNT(( m3.block(r0,r0,r1,r1).noalias() += -m1.block(r0,c0,r1,c1) * (s2*m2.block(r0,c0,r1,c1)).adjoint() ), 0);
-  VERIFY_EVALUATION_COUNT(( m3.block(r0,r0,r1,r1).noalias() -= s1 * m1.block(r0,c0,r1,c1) * m2.block(c0,r0,c1,r1) ), 0);
+  VERIFY_EVALUATION_COUNT(
+      (m3.block(r0, r0, r1, r1).noalias() += -m1.block(r0, c0, r1, c1) * (s2 * m2.block(r0, c0, r1, c1)).adjoint()), 0);
+  VERIFY_EVALUATION_COUNT(
+      (m3.block(r0, r0, r1, r1).noalias() -= s1 * m1.block(r0, c0, r1, c1) * m2.block(c0, r0, c1, r1)), 0);
 
   // NOTE this is because the Block expression is not handled yet by our expression analyser
-  VERIFY_EVALUATION_COUNT(( m3.block(r0,r0,r1,r1).noalias() = s1 * m1.block(r0,c0,r1,c1) * (s1*m2).block(c0,r0,c1,r1) ), 1);
+  VERIFY_EVALUATION_COUNT(
+      (m3.block(r0, r0, r1, r1).noalias() = s1 * m1.block(r0, c0, r1, c1) * (s1 * m2).block(c0, r0, c1, r1)), 1);
 
-  VERIFY_EVALUATION_COUNT( m3.noalias() -= (s1 * m1).template triangularView<Lower>() * m2, 0);
-  VERIFY_EVALUATION_COUNT( rm3.noalias() = (s1 * m1.adjoint()).template triangularView<Upper>() * (m2+m2), 1);
-  VERIFY_EVALUATION_COUNT( rm3.noalias() = (s1 * m1.adjoint()).template triangularView<UnitUpper>() * m2.adjoint(), 0);
+  VERIFY_EVALUATION_COUNT(m3.noalias() -= (s1 * m1).template triangularView<Lower>() * m2, 0);
+  VERIFY_EVALUATION_COUNT(rm3.noalias() = (s1 * m1.adjoint()).template triangularView<Upper>() * (m2 + m2), 1);
+  VERIFY_EVALUATION_COUNT(rm3.noalias() = (s1 * m1.adjoint()).template triangularView<UnitUpper>() * m2.adjoint(), 0);
 
-  VERIFY_EVALUATION_COUNT( m3.template triangularView<Upper>() = (m1 * m2.adjoint()), 0);
-  VERIFY_EVALUATION_COUNT( m3.template triangularView<Upper>() -= (m1 * m2.adjoint()), 0);
+  VERIFY_EVALUATION_COUNT(m3.template triangularView<Upper>() = (m1 * m2.adjoint()), 0);
+  VERIFY_EVALUATION_COUNT(m3.template triangularView<Upper>() -= (m1 * m2.adjoint()), 0);
 
-  // NOTE this is because the blas_traits require innerstride==1 to avoid a temporary, but that doesn't seem to be actually needed for the triangular products
-  VERIFY_EVALUATION_COUNT( rm3.col(c0).noalias() = (s1 * m1.adjoint()).template triangularView<UnitUpper>() * (s2*m2.row(c0)).adjoint(), 1);
+  // NOTE this is because the blas_traits require innerstride==1 to avoid a temporary, but that doesn't seem to be
+  // actually needed for the triangular products
+  VERIFY_EVALUATION_COUNT(
+      rm3.col(c0).noalias() = (s1 * m1.adjoint()).template triangularView<UnitUpper>() * (s2 * m2.row(c0)).adjoint(),
+      1);
 
-  VERIFY_EVALUATION_COUNT( m1.template triangularView<Lower>().solveInPlace(m3), 0);
-  VERIFY_EVALUATION_COUNT( m1.adjoint().template triangularView<Lower>().solveInPlace(m3.transpose()), 0);
+  VERIFY_EVALUATION_COUNT(m1.template triangularView<Lower>().solveInPlace(m3), 0);
+  VERIFY_EVALUATION_COUNT(m1.adjoint().template triangularView<Lower>().solveInPlace(m3.transpose()), 0);
 
-  VERIFY_EVALUATION_COUNT( m3.noalias() -= (s1 * m1).adjoint().template selfadjointView<Lower>() * (-m2*s3).adjoint(), 0);
-  VERIFY_EVALUATION_COUNT( m3.noalias() = s2 * m2.adjoint() * (s1 * m1.adjoint()).template selfadjointView<Upper>(), 0);
-  VERIFY_EVALUATION_COUNT( rm3.noalias() = (s1 * m1.adjoint()).template selfadjointView<Lower>() * m2.adjoint(), 0);
+  VERIFY_EVALUATION_COUNT(m3.noalias() -= (s1 * m1).adjoint().template selfadjointView<Lower>() * (-m2 * s3).adjoint(),
+                          0);
+  VERIFY_EVALUATION_COUNT(m3.noalias() = s2 * m2.adjoint() * (s1 * m1.adjoint()).template selfadjointView<Upper>(), 0);
+  VERIFY_EVALUATION_COUNT(rm3.noalias() = (s1 * m1.adjoint()).template selfadjointView<Lower>() * m2.adjoint(), 0);
 
-  // NOTE this is because the blas_traits require innerstride==1 to avoid a temporary, but that doesn't seem to be actually needed for the triangular products
-  VERIFY_EVALUATION_COUNT( m3.col(c0).noalias() = (s1 * m1).adjoint().template selfadjointView<Lower>() * (-m2.row(c0)*s3).adjoint(), 1);
-  VERIFY_EVALUATION_COUNT( m3.col(c0).noalias() -= (s1 * m1).adjoint().template selfadjointView<Upper>() * (-m2.row(c0)*s3).adjoint(), 1);
+  // NOTE this is because the blas_traits require innerstride==1 to avoid a temporary, but that doesn't seem to be
+  // actually needed for the triangular products
+  VERIFY_EVALUATION_COUNT(
+      m3.col(c0).noalias() = (s1 * m1).adjoint().template selfadjointView<Lower>() * (-m2.row(c0) * s3).adjoint(), 1);
+  VERIFY_EVALUATION_COUNT(
+      m3.col(c0).noalias() -= (s1 * m1).adjoint().template selfadjointView<Upper>() * (-m2.row(c0) * s3).adjoint(), 1);
 
-  VERIFY_EVALUATION_COUNT( m3.block(r0,c0,r1,c1).noalias() += m1.block(r0,r0,r1,r1).template selfadjointView<Upper>() * (s1*m2.block(r0,c0,r1,c1)), 0);
-  VERIFY_EVALUATION_COUNT( m3.block(r0,c0,r1,c1).noalias() = m1.block(r0,r0,r1,r1).template selfadjointView<Upper>() * m2.block(r0,c0,r1,c1), 0);
+  VERIFY_EVALUATION_COUNT(m3.block(r0, c0, r1, c1).noalias() +=
+                          m1.block(r0, r0, r1, r1).template selfadjointView<Upper>() * (s1 * m2.block(r0, c0, r1, c1)),
+                          0);
+  VERIFY_EVALUATION_COUNT(m3.block(r0, c0, r1, c1).noalias() =
+                              m1.block(r0, r0, r1, r1).template selfadjointView<Upper>() * m2.block(r0, c0, r1, c1),
+                          0);
 
-  VERIFY_EVALUATION_COUNT( m3.template selfadjointView<Lower>().rankUpdate(m2.adjoint()), 0);
+  VERIFY_EVALUATION_COUNT(m3.template selfadjointView<Lower>().rankUpdate(m2.adjoint()), 0);
 
-  // Here we will get 1 temporary for each resize operation of the lhs operator; resize(r1,c1) would lead to zero temporaries
-  m3.resize(1,1);
-  VERIFY_EVALUATION_COUNT( m3.noalias() = m1.block(r0,r0,r1,r1).template selfadjointView<Lower>() * m2.block(r0,c0,r1,c1), 1);
-  m3.resize(1,1);
-  VERIFY_EVALUATION_COUNT( m3.noalias() = m1.block(r0,r0,r1,r1).template triangularView<UnitUpper>()  * m2.block(r0,c0,r1,c1), 1);
+  // Here we will get 1 temporary for each resize operation of the lhs operator; resize(r1,c1) would lead to zero
+  // temporaries
+  m3.resize(1, 1);
+  VERIFY_EVALUATION_COUNT(
+      m3.noalias() = m1.block(r0, r0, r1, r1).template selfadjointView<Lower>() * m2.block(r0, c0, r1, c1), 1);
+  m3.resize(1, 1);
+  VERIFY_EVALUATION_COUNT(
+      m3.noalias() = m1.block(r0, r0, r1, r1).template triangularView<UnitUpper>() * m2.block(r0, c0, r1, c1), 1);
 
   // Zero temporaries for lazy products ...
-  m3.setRandom(rows,cols);
-  VERIFY_EVALUATION_COUNT( Scalar tmp = 0; tmp += Scalar(RealScalar(1)) /  (m3.transpose().lazyProduct(m3)).diagonal().sum(), 0 );
-  VERIFY_EVALUATION_COUNT( m3.noalias() = m1.conjugate().lazyProduct(m2.conjugate()), 0);
+  m3.setRandom(rows, cols);
+  VERIFY_EVALUATION_COUNT(Scalar tmp = 0;
+                          tmp += Scalar(RealScalar(1)) / (m3.transpose().lazyProduct(m3)).diagonal().sum(), 0);
+  VERIFY_EVALUATION_COUNT(m3.noalias() = m1.conjugate().lazyProduct(m2.conjugate()), 0);
 
   // ... and even no temporary for even deeply (>=2) nested products
-  VERIFY_EVALUATION_COUNT( Scalar tmp = 0; tmp += Scalar(RealScalar(1)) /  (m3.transpose() * m3).diagonal().sum(), 0 );
-  VERIFY_EVALUATION_COUNT( Scalar tmp = 0; tmp += Scalar(RealScalar(1)) /  (m3.transpose() * m3).diagonal().array().abs().sum(), 0 );
+  VERIFY_EVALUATION_COUNT(Scalar tmp = 0; tmp += Scalar(RealScalar(1)) / (m3.transpose() * m3).diagonal().sum(), 0);
+  VERIFY_EVALUATION_COUNT(Scalar tmp = 0;
+                          tmp += Scalar(RealScalar(1)) / (m3.transpose() * m3).diagonal().array().abs().sum(), 0);
 
   // Zero temporaries for ... CoeffBasedProductMode
-  VERIFY_EVALUATION_COUNT( m3.col(0).template head<5>() * m3.col(0).transpose() + m3.col(0).template head<5>() * m3.col(0).transpose(), 0 );
+  VERIFY_EVALUATION_COUNT(
+      m3.col(0).template head<5>() * m3.col(0).transpose() + m3.col(0).template head<5>() * m3.col(0).transpose(), 0);
 
   // Check matrix * vectors
-  VERIFY_EVALUATION_COUNT( cvres.noalias() = m1 * cv1, 0 );
-  VERIFY_EVALUATION_COUNT( cvres.noalias() -= m1 * cv1, 0 );
-  VERIFY_EVALUATION_COUNT( cvres.noalias() -= m1 * m2.col(0), 0 );
-  VERIFY_EVALUATION_COUNT( cvres.noalias() -= m1 * rv1.adjoint(), 0 );
-  VERIFY_EVALUATION_COUNT( cvres.noalias() -= m1 * m2.row(0).transpose(), 0 );
+  VERIFY_EVALUATION_COUNT(cvres.noalias() = m1 * cv1, 0);
+  VERIFY_EVALUATION_COUNT(cvres.noalias() -= m1 * cv1, 0);
+  VERIFY_EVALUATION_COUNT(cvres.noalias() -= m1 * m2.col(0), 0);
+  VERIFY_EVALUATION_COUNT(cvres.noalias() -= m1 * rv1.adjoint(), 0);
+  VERIFY_EVALUATION_COUNT(cvres.noalias() -= m1 * m2.row(0).transpose(), 0);
 
-  VERIFY_EVALUATION_COUNT( cvres.noalias() = (m1+m1) * cv1, 0 );
-  VERIFY_EVALUATION_COUNT( cvres.noalias() = (rm3+rm3) * cv1, 0 );
-  VERIFY_EVALUATION_COUNT( cvres.noalias() = (m1+m1) * (m1*cv1), 1 );
-  VERIFY_EVALUATION_COUNT( cvres.noalias() = (rm3+rm3) * (m1*cv1), 1 );
+  VERIFY_EVALUATION_COUNT(cvres.noalias() = (m1 + m1) * cv1, 0);
+  VERIFY_EVALUATION_COUNT(cvres.noalias() = (rm3 + rm3) * cv1, 0);
+  VERIFY_EVALUATION_COUNT(cvres.noalias() = (m1 + m1) * (m1 * cv1), 1);
+  VERIFY_EVALUATION_COUNT(cvres.noalias() = (rm3 + rm3) * (m1 * cv1), 1);
 
-  // Check outer products
-  #ifdef EIGEN_ALLOCA
-  bool temp_via_alloca = m3.rows()*sizeof(Scalar) <= EIGEN_STACK_ALLOCATION_LIMIT;
-  #else
+// Check outer products
+#ifdef EIGEN_ALLOCA
+  bool temp_via_alloca = m3.rows() * sizeof(Scalar) <= EIGEN_STACK_ALLOCATION_LIMIT;
+#else
   bool temp_via_alloca = false;
-  #endif
+#endif
   m3 = cv1 * rv1;
-  VERIFY_EVALUATION_COUNT( m3.noalias() = cv1 * rv1, 0 );
-  VERIFY_EVALUATION_COUNT( m3.noalias() = (cv1+cv1) * (rv1+rv1), temp_via_alloca ? 0 : 1 );
-  VERIFY_EVALUATION_COUNT( m3.noalias() = (m1*cv1) * (rv1), 1 );
-  VERIFY_EVALUATION_COUNT( m3.noalias() += (m1*cv1) * (rv1), 1 );
+  VERIFY_EVALUATION_COUNT(m3.noalias() = cv1 * rv1, 0);
+  VERIFY_EVALUATION_COUNT(m3.noalias() = (cv1 + cv1) * (rv1 + rv1), temp_via_alloca ? 0 : 1);
+  VERIFY_EVALUATION_COUNT(m3.noalias() = (m1 * cv1) * (rv1), 1);
+  VERIFY_EVALUATION_COUNT(m3.noalias() += (m1 * cv1) * (rv1), 1);
   rm3 = cv1 * rv1;
-  VERIFY_EVALUATION_COUNT( rm3.noalias() = cv1 * rv1, 0 );
-  VERIFY_EVALUATION_COUNT( rm3.noalias() = (cv1+cv1) * (rv1+rv1), temp_via_alloca ? 0 : 1 );
-  VERIFY_EVALUATION_COUNT( rm3.noalias() = (cv1) * (rv1 * m1), 1 );
-  VERIFY_EVALUATION_COUNT( rm3.noalias() -= (cv1) * (rv1 * m1), 1 );
-  VERIFY_EVALUATION_COUNT( rm3.noalias() = (m1*cv1) * (rv1 * m1), 2 );
-  VERIFY_EVALUATION_COUNT( rm3.noalias() += (m1*cv1) * (rv1 * m1), 2 );
+  VERIFY_EVALUATION_COUNT(rm3.noalias() = cv1 * rv1, 0);
+  VERIFY_EVALUATION_COUNT(rm3.noalias() = (cv1 + cv1) * (rv1 + rv1), temp_via_alloca ? 0 : 1);
+  VERIFY_EVALUATION_COUNT(rm3.noalias() = (cv1) * (rv1 * m1), 1);
+  VERIFY_EVALUATION_COUNT(rm3.noalias() -= (cv1) * (rv1 * m1), 1);
+  VERIFY_EVALUATION_COUNT(rm3.noalias() = (m1 * cv1) * (rv1 * m1), 2);
+  VERIFY_EVALUATION_COUNT(rm3.noalias() += (m1 * cv1) * (rv1 * m1), 2);
 
   // Check nested products
-  VERIFY_EVALUATION_COUNT( cvres.noalias() = m1.adjoint() * m1 * cv1, 1 );
-  VERIFY_EVALUATION_COUNT( rvres.noalias() = rv1 * (m1 * m2.adjoint()), 1 );
+  VERIFY_EVALUATION_COUNT(cvres.noalias() = m1.adjoint() * m1 * cv1, 1);
+  VERIFY_EVALUATION_COUNT(rvres.noalias() = rv1 * (m1 * m2.adjoint()), 1);
 
   // exhaustively check all scalar multiple combinations:
   {
     // Generic path:
     check_scalar_multiple1(m3, m1, m2, s1, s2);
     // Force fall back to coeff-based:
-    typename ColMajorMatrixType::BlockXpr m3_blck = m3.block(r0,r0,1,1);
-    check_scalar_multiple1(m3_blck, m1.block(r0,c0,1,1), m2.block(c0,r0,1,1), s1, s2);
+    typename ColMajorMatrixType::BlockXpr m3_blck = m3.block(r0, r0, 1, 1);
+    check_scalar_multiple1(m3_blck, m1.block(r0, c0, 1, 1), m2.block(c0, r0, 1, 1), s1, s2);
   }
 }
 
-EIGEN_DECLARE_TEST(product_notemporary)
-{
+EIGEN_DECLARE_TEST(product_notemporary) {
   int s;
-  for(int i = 0; i < g_repeat; i++) {
-    s = internal::random<int>(16,EIGEN_TEST_MAX_SIZE);
-    CALL_SUBTEST_1( product_notemporary(MatrixXf(s, s)) );
-    CALL_SUBTEST_2( product_notemporary(MatrixXd(s, s)) );
+  for (int i = 0; i < g_repeat; i++) {
+    s = internal::random<int>(16, EIGEN_TEST_MAX_SIZE);
+    CALL_SUBTEST_1(product_notemporary(MatrixXf(s, s)));
+    CALL_SUBTEST_2(product_notemporary(MatrixXd(s, s)));
     TEST_SET_BUT_UNUSED_VARIABLE(s)
-    
-    s = internal::random<int>(16,EIGEN_TEST_MAX_SIZE/2);
-    CALL_SUBTEST_3( product_notemporary(MatrixXcf(s,s)) );
-    CALL_SUBTEST_4( product_notemporary(MatrixXcd(s,s)) );
+
+    s = internal::random<int>(16, EIGEN_TEST_MAX_SIZE / 2);
+    CALL_SUBTEST_3(product_notemporary(MatrixXcf(s, s)));
+    CALL_SUBTEST_4(product_notemporary(MatrixXcd(s, s)));
     TEST_SET_BUT_UNUSED_VARIABLE(s)
   }
 }
diff --git a/test/product_selfadjoint.cpp b/test/product_selfadjoint.cpp
index bdccd04..8d1bda5 100644
--- a/test/product_selfadjoint.cpp
+++ b/test/product_selfadjoint.cpp
@@ -9,8 +9,8 @@
 
 #include "main.h"
 
-template<typename MatrixType> void product_selfadjoint(const MatrixType& m)
-{
+template <typename MatrixType>
+void product_selfadjoint(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
   typedef Matrix<Scalar, 1, MatrixType::RowsAtCompileTime> RowVectorType;
@@ -20,67 +20,66 @@
   Index rows = m.rows();
   Index cols = m.cols();
 
-  MatrixType m1 = MatrixType::Random(rows, cols),
-             m2 = MatrixType::Random(rows, cols),
-             m3;
-  VectorType v1 = VectorType::Random(rows),
-             v2 = VectorType::Random(rows),
-             v3(rows);
-  RowVectorType r1 = RowVectorType::Random(rows),
-                r2 = RowVectorType::Random(rows);
-  RhsMatrixType m4 = RhsMatrixType::Random(rows,10);
+  MatrixType m1 = MatrixType::Random(rows, cols), m2 = MatrixType::Random(rows, cols), m3;
+  VectorType v1 = VectorType::Random(rows), v2 = VectorType::Random(rows), v3(rows);
+  RowVectorType r1 = RowVectorType::Random(rows), r2 = RowVectorType::Random(rows);
+  RhsMatrixType m4 = RhsMatrixType::Random(rows, 10);
 
-  Scalar s1 = internal::random<Scalar>(),
-         s2 = internal::random<Scalar>(),
-         s3 = internal::random<Scalar>();
+  Scalar s1 = internal::random<Scalar>(), s2 = internal::random<Scalar>(), s3 = internal::random<Scalar>();
 
   m1 = (m1.adjoint() + m1).eval();
 
   // rank2 update
   m2 = m1.template triangularView<Lower>();
-  m2.template selfadjointView<Lower>().rankUpdate(v1,v2);
-  VERIFY_IS_APPROX(m2, (m1 + v1 * v2.adjoint()+ v2 * v1.adjoint()).template triangularView<Lower>().toDenseMatrix());
+  m2.template selfadjointView<Lower>().rankUpdate(v1, v2);
+  VERIFY_IS_APPROX(m2, (m1 + v1 * v2.adjoint() + v2 * v1.adjoint()).template triangularView<Lower>().toDenseMatrix());
 
   m2 = m1.template triangularView<Upper>();
-  m2.template selfadjointView<Upper>().rankUpdate(-v1,s2*v2,s3);
-  VERIFY_IS_APPROX(m2, (m1 + (s3*(-v1)*(s2*v2).adjoint()+numext::conj(s3)*(s2*v2)*(-v1).adjoint())).template triangularView<Upper>().toDenseMatrix());
+  m2.template selfadjointView<Upper>().rankUpdate(-v1, s2 * v2, s3);
+  VERIFY_IS_APPROX(m2, (m1 + (s3 * (-v1) * (s2 * v2).adjoint() + numext::conj(s3) * (s2 * v2) * (-v1).adjoint()))
+                           .template triangularView<Upper>()
+                           .toDenseMatrix());
 
   m2 = m1.template triangularView<Upper>();
-  m2.template selfadjointView<Upper>().rankUpdate(-s2*r1.adjoint(),r2.adjoint()*s3,s1);
-  VERIFY_IS_APPROX(m2, (m1 + s1*(-s2*r1.adjoint())*(r2.adjoint()*s3).adjoint() + numext::conj(s1)*(r2.adjoint()*s3) * (-s2*r1.adjoint()).adjoint()).template triangularView<Upper>().toDenseMatrix());
+  m2.template selfadjointView<Upper>().rankUpdate(-s2 * r1.adjoint(), r2.adjoint() * s3, s1);
+  VERIFY_IS_APPROX(m2, (m1 + s1 * (-s2 * r1.adjoint()) * (r2.adjoint() * s3).adjoint() +
+                        numext::conj(s1) * (r2.adjoint() * s3) * (-s2 * r1.adjoint()).adjoint())
+                           .template triangularView<Upper>()
+                           .toDenseMatrix());
 
-  if (rows>1)
-  {
+  if (rows > 1) {
     m2 = m1.template triangularView<Lower>();
-    m2.block(1,1,rows-1,cols-1).template selfadjointView<Lower>().rankUpdate(v1.tail(rows-1),v2.head(cols-1));
+    m2.block(1, 1, rows - 1, cols - 1)
+        .template selfadjointView<Lower>()
+        .rankUpdate(v1.tail(rows - 1), v2.head(cols - 1));
     m3 = m1;
-    m3.block(1,1,rows-1,cols-1) += v1.tail(rows-1) * v2.head(cols-1).adjoint()+ v2.head(cols-1) * v1.tail(rows-1).adjoint();
+    m3.block(1, 1, rows - 1, cols - 1) +=
+        v1.tail(rows - 1) * v2.head(cols - 1).adjoint() + v2.head(cols - 1) * v1.tail(rows - 1).adjoint();
     VERIFY_IS_APPROX(m2, m3.template triangularView<Lower>().toDenseMatrix());
   }
 }
 
-EIGEN_DECLARE_TEST(product_selfadjoint)
-{
+EIGEN_DECLARE_TEST(product_selfadjoint) {
   int s = 0;
-  for(int i = 0; i < g_repeat ; i++) {
-    CALL_SUBTEST_1( product_selfadjoint(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( product_selfadjoint(Matrix<float, 2, 2>()) );
-    CALL_SUBTEST_3( product_selfadjoint(Matrix3d()) );
-    
-    s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2);
-    CALL_SUBTEST_4( product_selfadjoint(MatrixXcf(s, s)) );
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(product_selfadjoint(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(product_selfadjoint(Matrix<float, 2, 2>()));
+    CALL_SUBTEST_3(product_selfadjoint(Matrix3d()));
+
+    s = internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2);
+    CALL_SUBTEST_4(product_selfadjoint(MatrixXcf(s, s)));
     TEST_SET_BUT_UNUSED_VARIABLE(s)
-    
-    s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2);
-    CALL_SUBTEST_5( product_selfadjoint(MatrixXcd(s,s)) );
+
+    s = internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2);
+    CALL_SUBTEST_5(product_selfadjoint(MatrixXcd(s, s)));
     TEST_SET_BUT_UNUSED_VARIABLE(s)
-    
-    s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE);
-    CALL_SUBTEST_6( product_selfadjoint(MatrixXd(s,s)) );
+
+    s = internal::random<int>(1, EIGEN_TEST_MAX_SIZE);
+    CALL_SUBTEST_6(product_selfadjoint(MatrixXd(s, s)));
     TEST_SET_BUT_UNUSED_VARIABLE(s)
-    
-    s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE);
-    CALL_SUBTEST_7( product_selfadjoint(Matrix<float,Dynamic,Dynamic,RowMajor>(s,s)) );
+
+    s = internal::random<int>(1, EIGEN_TEST_MAX_SIZE);
+    CALL_SUBTEST_7(product_selfadjoint(Matrix<float, Dynamic, Dynamic, RowMajor>(s, s)));
     TEST_SET_BUT_UNUSED_VARIABLE(s)
   }
 }
diff --git a/test/product_small.cpp b/test/product_small.cpp
index 0fd82c3..1b1eef1 100644
--- a/test/product_small.cpp
+++ b/test/product_small.cpp
@@ -11,260 +11,252 @@
 #include <Eigen/LU>
 
 // regression test for bug 447
-template<int>
-void product1x1()
-{
-  Matrix<float,1,3> matAstatic;
-  Matrix<float,3,1> matBstatic;
+template <int>
+void product1x1() {
+  Matrix<float, 1, 3> matAstatic;
+  Matrix<float, 3, 1> matBstatic;
   matAstatic.setRandom();
   matBstatic.setRandom();
-  VERIFY_IS_APPROX( (matAstatic * matBstatic).coeff(0,0), 
-                    matAstatic.cwiseProduct(matBstatic.transpose()).sum() );
+  VERIFY_IS_APPROX((matAstatic * matBstatic).coeff(0, 0), matAstatic.cwiseProduct(matBstatic.transpose()).sum());
 
-  MatrixXf matAdynamic(1,3);
-  MatrixXf matBdynamic(3,1);
+  MatrixXf matAdynamic(1, 3);
+  MatrixXf matBdynamic(3, 1);
   matAdynamic.setRandom();
   matBdynamic.setRandom();
-  VERIFY_IS_APPROX( (matAdynamic * matBdynamic).coeff(0,0), 
-                    matAdynamic.cwiseProduct(matBdynamic.transpose()).sum() );
+  VERIFY_IS_APPROX((matAdynamic * matBdynamic).coeff(0, 0), matAdynamic.cwiseProduct(matBdynamic.transpose()).sum());
 }
 
-template<typename TC, typename TA, typename TB>
-const TC& ref_prod(TC &C, const TA &A, const TB &B)
-{
-  for(Index i=0;i<C.rows();++i)
-    for(Index j=0;j<C.cols();++j)
-      for(Index k=0;k<A.cols();++k)
-        C.coeffRef(i,j) += A.coeff(i,k) * B.coeff(k,j);
+template <typename TC, typename TA, typename TB>
+const TC &ref_prod(TC &C, const TA &A, const TB &B) {
+  for (Index i = 0; i < C.rows(); ++i)
+    for (Index j = 0; j < C.cols(); ++j)
+      for (Index k = 0; k < A.cols(); ++k) C.coeffRef(i, j) += A.coeff(i, k) * B.coeff(k, j);
   return C;
 }
 
-template<typename T, int Rows, int Cols, int Depth, int OC, int OA, int OB>
-std::enable_if_t<! ( (Rows ==1&&Depth!=1&&OA==ColMajor)
-                              || (Depth==1&&Rows !=1&&OA==RowMajor)
-                              || (Cols ==1&&Depth!=1&&OB==RowMajor)
-                              || (Depth==1&&Cols !=1&&OB==ColMajor)
-                              || (Rows ==1&&Cols !=1&&OC==ColMajor)
-                              || (Cols ==1&&Rows !=1&&OC==RowMajor)),void>
-test_lazy_single(int rows, int cols, int depth)
-{
-  Matrix<T,Rows,Depth,OA> A(rows,depth); A.setRandom();
-  Matrix<T,Depth,Cols,OB> B(depth,cols); B.setRandom();
-  Matrix<T,Rows,Cols,OC>  C(rows,cols);  C.setRandom();
-  Matrix<T,Rows,Cols,OC>  D(C);
-  VERIFY_IS_APPROX(C+=A.lazyProduct(B), ref_prod(D,A,B));
+template <typename T, int Rows, int Cols, int Depth, int OC, int OA, int OB>
+std::enable_if_t<!((Rows == 1 && Depth != 1 && OA == ColMajor) || (Depth == 1 && Rows != 1 && OA == RowMajor) ||
+                   (Cols == 1 && Depth != 1 && OB == RowMajor) || (Depth == 1 && Cols != 1 && OB == ColMajor) ||
+                   (Rows == 1 && Cols != 1 && OC == ColMajor) || (Cols == 1 && Rows != 1 && OC == RowMajor)),
+                 void>
+test_lazy_single(int rows, int cols, int depth) {
+  Matrix<T, Rows, Depth, OA> A(rows, depth);
+  A.setRandom();
+  Matrix<T, Depth, Cols, OB> B(depth, cols);
+  B.setRandom();
+  Matrix<T, Rows, Cols, OC> C(rows, cols);
+  C.setRandom();
+  Matrix<T, Rows, Cols, OC> D(C);
+  VERIFY_IS_APPROX(C += A.lazyProduct(B), ref_prod(D, A, B));
 }
 
-void test_dynamic_bool()
-{
-  int rows = internal::random<int>(1,64);
-  int cols = internal::random<int>(1,64);
-  int depth = internal::random<int>(1,65);
+void test_dynamic_bool() {
+  int rows = internal::random<int>(1, 64);
+  int cols = internal::random<int>(1, 64);
+  int depth = internal::random<int>(1, 65);
 
-  typedef Matrix<bool,Dynamic,Dynamic> MatrixX;
-  MatrixX A(rows,depth); A.setRandom();
-  MatrixX B(depth,cols); B.setRandom();
-  MatrixX C(rows,cols);  C.setRandom();
+  typedef Matrix<bool, Dynamic, Dynamic> MatrixX;
+  MatrixX A(rows, depth);
+  A.setRandom();
+  MatrixX B(depth, cols);
+  B.setRandom();
+  MatrixX C(rows, cols);
+  C.setRandom();
   MatrixX D(C);
-  for(Index i=0;i<C.rows();++i)
-    for(Index j=0;j<C.cols();++j)
-      for(Index k=0;k<A.cols();++k)
-       D.coeffRef(i,j) |= (A.coeff(i,k) && B.coeff(k,j));
+  for (Index i = 0; i < C.rows(); ++i)
+    for (Index j = 0; j < C.cols(); ++j)
+      for (Index k = 0; k < A.cols(); ++k) D.coeffRef(i, j) |= (A.coeff(i, k) && B.coeff(k, j));
   C += A * B;
   VERIFY_IS_EQUAL(C, D);
 
   MatrixX E = B.transpose();
-  for(Index i=0;i<B.rows();++i)
-    for(Index j=0;j<B.cols();++j)
-      VERIFY_IS_EQUAL(B(i,j), E(j,i));
+  for (Index i = 0; i < B.rows(); ++i)
+    for (Index j = 0; j < B.cols(); ++j) VERIFY_IS_EQUAL(B(i, j), E(j, i));
 }
 
-template<typename T, int Rows, int Cols, int Depth, int OC, int OA, int OB>
-std::enable_if_t<  ( (Rows ==1&&Depth!=1&&OA==ColMajor)
-                              || (Depth==1&&Rows !=1&&OA==RowMajor)
-                              || (Cols ==1&&Depth!=1&&OB==RowMajor)
-                              || (Depth==1&&Cols !=1&&OB==ColMajor)
-                              || (Rows ==1&&Cols !=1&&OC==ColMajor)
-                              || (Cols ==1&&Rows !=1&&OC==RowMajor)),void>
-test_lazy_single(int, int, int)
-{
+template <typename T, int Rows, int Cols, int Depth, int OC, int OA, int OB>
+std::enable_if_t<((Rows == 1 && Depth != 1 && OA == ColMajor) || (Depth == 1 && Rows != 1 && OA == RowMajor) ||
+                  (Cols == 1 && Depth != 1 && OB == RowMajor) || (Depth == 1 && Cols != 1 && OB == ColMajor) ||
+                  (Rows == 1 && Cols != 1 && OC == ColMajor) || (Cols == 1 && Rows != 1 && OC == RowMajor)),
+                 void>
+test_lazy_single(int, int, int) {}
+
+template <typename T, int Rows, int Cols, int Depth>
+void test_lazy_all_layout(int rows = Rows, int cols = Cols, int depth = Depth) {
+  CALL_SUBTEST((test_lazy_single<T, Rows, Cols, Depth, ColMajor, ColMajor, ColMajor>(rows, cols, depth)));
+  CALL_SUBTEST((test_lazy_single<T, Rows, Cols, Depth, RowMajor, ColMajor, ColMajor>(rows, cols, depth)));
+  CALL_SUBTEST((test_lazy_single<T, Rows, Cols, Depth, ColMajor, RowMajor, ColMajor>(rows, cols, depth)));
+  CALL_SUBTEST((test_lazy_single<T, Rows, Cols, Depth, RowMajor, RowMajor, ColMajor>(rows, cols, depth)));
+  CALL_SUBTEST((test_lazy_single<T, Rows, Cols, Depth, ColMajor, ColMajor, RowMajor>(rows, cols, depth)));
+  CALL_SUBTEST((test_lazy_single<T, Rows, Cols, Depth, RowMajor, ColMajor, RowMajor>(rows, cols, depth)));
+  CALL_SUBTEST((test_lazy_single<T, Rows, Cols, Depth, ColMajor, RowMajor, RowMajor>(rows, cols, depth)));
+  CALL_SUBTEST((test_lazy_single<T, Rows, Cols, Depth, RowMajor, RowMajor, RowMajor>(rows, cols, depth)));
 }
 
-template<typename T, int Rows, int Cols, int Depth>
-void test_lazy_all_layout(int rows=Rows, int cols=Cols, int depth=Depth)
-{
-  CALL_SUBTEST(( test_lazy_single<T,Rows,Cols,Depth,ColMajor,ColMajor,ColMajor>(rows,cols,depth) ));
-  CALL_SUBTEST(( test_lazy_single<T,Rows,Cols,Depth,RowMajor,ColMajor,ColMajor>(rows,cols,depth) ));
-  CALL_SUBTEST(( test_lazy_single<T,Rows,Cols,Depth,ColMajor,RowMajor,ColMajor>(rows,cols,depth) ));
-  CALL_SUBTEST(( test_lazy_single<T,Rows,Cols,Depth,RowMajor,RowMajor,ColMajor>(rows,cols,depth) ));
-  CALL_SUBTEST(( test_lazy_single<T,Rows,Cols,Depth,ColMajor,ColMajor,RowMajor>(rows,cols,depth) ));
-  CALL_SUBTEST(( test_lazy_single<T,Rows,Cols,Depth,RowMajor,ColMajor,RowMajor>(rows,cols,depth) ));
-  CALL_SUBTEST(( test_lazy_single<T,Rows,Cols,Depth,ColMajor,RowMajor,RowMajor>(rows,cols,depth) ));
-  CALL_SUBTEST(( test_lazy_single<T,Rows,Cols,Depth,RowMajor,RowMajor,RowMajor>(rows,cols,depth) ));
-}  
-
-template<typename T>
-void test_lazy_l1()
-{
-  int rows = internal::random<int>(1,12);
-  int cols = internal::random<int>(1,12);
-  int depth = internal::random<int>(1,12);
+template <typename T>
+void test_lazy_l1() {
+  int rows = internal::random<int>(1, 12);
+  int cols = internal::random<int>(1, 12);
+  int depth = internal::random<int>(1, 12);
 
   // Inner
-  CALL_SUBTEST(( test_lazy_all_layout<T,1,1,1>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,1,1,2>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,1,1,3>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,1,1,8>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,1,1,9>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,1,1,-1>(1,1,depth) ));
+  CALL_SUBTEST((test_lazy_all_layout<T, 1, 1, 1>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 1, 1, 2>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 1, 1, 3>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 1, 1, 8>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 1, 1, 9>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 1, 1, -1>(1, 1, depth)));
 
   // Outer
-  CALL_SUBTEST(( test_lazy_all_layout<T,2,1,1>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,1,2,1>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,2,2,1>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,3,3,1>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,4,4,1>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,4,8,1>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,4,-1,1>(4,cols) ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,7,-1,1>(7,cols) ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,-1,8,1>(rows) ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,-1,3,1>(rows) ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,-1,-1,1>(rows,cols) ));
+  CALL_SUBTEST((test_lazy_all_layout<T, 2, 1, 1>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 1, 2, 1>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 2, 2, 1>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 3, 3, 1>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 4, 4, 1>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 4, 8, 1>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 4, -1, 1>(4, cols)));
+  CALL_SUBTEST((test_lazy_all_layout<T, 7, -1, 1>(7, cols)));
+  CALL_SUBTEST((test_lazy_all_layout<T, -1, 8, 1>(rows)));
+  CALL_SUBTEST((test_lazy_all_layout<T, -1, 3, 1>(rows)));
+  CALL_SUBTEST((test_lazy_all_layout<T, -1, -1, 1>(rows, cols)));
 }
 
-template<typename T>
-void test_lazy_l2()
-{
-  int rows = internal::random<int>(1,12);
-  int cols = internal::random<int>(1,12);
-  int depth = internal::random<int>(1,12);
+template <typename T>
+void test_lazy_l2() {
+  int rows = internal::random<int>(1, 12);
+  int cols = internal::random<int>(1, 12);
+  int depth = internal::random<int>(1, 12);
 
   // mat-vec
-  CALL_SUBTEST(( test_lazy_all_layout<T,2,1,2>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,2,1,4>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,4,1,2>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,4,1,4>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,5,1,4>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,4,1,5>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,4,1,6>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,6,1,4>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,8,1,8>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,-1,1,4>(rows) ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,4,1,-1>(4,1,depth) ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,-1,1,-1>(rows,1,depth) ));
+  CALL_SUBTEST((test_lazy_all_layout<T, 2, 1, 2>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 2, 1, 4>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 4, 1, 2>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 4, 1, 4>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 5, 1, 4>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 4, 1, 5>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 4, 1, 6>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 6, 1, 4>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 8, 1, 8>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, -1, 1, 4>(rows)));
+  CALL_SUBTEST((test_lazy_all_layout<T, 4, 1, -1>(4, 1, depth)));
+  CALL_SUBTEST((test_lazy_all_layout<T, -1, 1, -1>(rows, 1, depth)));
 
   // vec-mat
-  CALL_SUBTEST(( test_lazy_all_layout<T,1,2,2>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,1,2,4>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,1,4,2>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,1,4,4>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,1,5,4>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,1,4,5>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,1,4,6>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,1,6,4>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,1,8,8>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,1,-1, 4>(1,cols) ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,1, 4,-1>(1,4,depth) ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,1,-1,-1>(1,cols,depth) ));
+  CALL_SUBTEST((test_lazy_all_layout<T, 1, 2, 2>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 1, 2, 4>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 1, 4, 2>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 1, 4, 4>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 1, 5, 4>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 1, 4, 5>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 1, 4, 6>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 1, 6, 4>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 1, 8, 8>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 1, -1, 4>(1, cols)));
+  CALL_SUBTEST((test_lazy_all_layout<T, 1, 4, -1>(1, 4, depth)));
+  CALL_SUBTEST((test_lazy_all_layout<T, 1, -1, -1>(1, cols, depth)));
 }
 
-template<typename T>
-void test_lazy_l3()
-{
-  int rows = internal::random<int>(1,12);
-  int cols = internal::random<int>(1,12);
-  int depth = internal::random<int>(1,12);
+template <typename T>
+void test_lazy_l3() {
+  int rows = internal::random<int>(1, 12);
+  int cols = internal::random<int>(1, 12);
+  int depth = internal::random<int>(1, 12);
   // mat-mat
-  CALL_SUBTEST(( test_lazy_all_layout<T,2,4,2>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,2,6,4>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,4,3,2>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,4,8,4>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,5,6,4>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,4,2,5>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,4,7,6>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,6,8,4>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,8,3,8>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,-1,6,4>(rows) ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,4,3,-1>(4,3,depth) ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,-1,6,-1>(rows,6,depth) ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,8,2,2>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,5,2,4>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,4,4,2>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,8,4,4>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,6,5,4>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,4,4,5>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,3,4,6>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,2,6,4>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,7,8,8>() ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,8,-1, 4>(8,cols) ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,3, 4,-1>(3,4,depth) ));
-  CALL_SUBTEST(( test_lazy_all_layout<T,4,-1,-1>(4,cols,depth) ));
+  CALL_SUBTEST((test_lazy_all_layout<T, 2, 4, 2>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 2, 6, 4>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 4, 3, 2>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 4, 8, 4>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 5, 6, 4>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 4, 2, 5>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 4, 7, 6>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 6, 8, 4>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 8, 3, 8>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, -1, 6, 4>(rows)));
+  CALL_SUBTEST((test_lazy_all_layout<T, 4, 3, -1>(4, 3, depth)));
+  CALL_SUBTEST((test_lazy_all_layout<T, -1, 6, -1>(rows, 6, depth)));
+  CALL_SUBTEST((test_lazy_all_layout<T, 8, 2, 2>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 5, 2, 4>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 4, 4, 2>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 8, 4, 4>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 6, 5, 4>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 4, 4, 5>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 3, 4, 6>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 2, 6, 4>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 7, 8, 8>()));
+  CALL_SUBTEST((test_lazy_all_layout<T, 8, -1, 4>(8, cols)));
+  CALL_SUBTEST((test_lazy_all_layout<T, 3, 4, -1>(3, 4, depth)));
+  CALL_SUBTEST((test_lazy_all_layout<T, 4, -1, -1>(4, cols, depth)));
 }
 
-template<typename T,int N,int M,int K>
-void test_linear_but_not_vectorizable()
-{
+template <typename T, int N, int M, int K>
+void test_linear_but_not_vectorizable() {
   // Check tricky cases for which the result of the product is a vector and thus must exhibit the LinearBit flag,
   // but is not vectorizable along the linear dimension.
-  Index n = N==Dynamic ? internal::random<Index>(1,32) : N;
-  Index m = M==Dynamic ? internal::random<Index>(1,32) : M;
-  Index k = K==Dynamic ? internal::random<Index>(1,32) : K;
+  Index n = N == Dynamic ? internal::random<Index>(1, 32) : N;
+  Index m = M == Dynamic ? internal::random<Index>(1, 32) : M;
+  Index k = K == Dynamic ? internal::random<Index>(1, 32) : K;
 
   {
-    Matrix<T,N,M+1> A; A.setRandom(n,m+1);
-    Matrix<T,M*2,K> B; B.setRandom(m*2,k);
-    Matrix<T,1,K> C;
-    Matrix<T,1,K> R;
+    Matrix<T, N, M + 1> A;
+    A.setRandom(n, m + 1);
+    Matrix<T, M * 2, K> B;
+    B.setRandom(m * 2, k);
+    Matrix<T, 1, K> C;
+    Matrix<T, 1, K> R;
 
-    C.noalias() = A.template topLeftCorner<1,M>() * (B.template topRows<M>()+B.template bottomRows<M>());
-    R.noalias() = A.template topLeftCorner<1,M>() * (B.template topRows<M>()+B.template bottomRows<M>()).eval();
-    VERIFY_IS_APPROX(C,R);
+    C.noalias() = A.template topLeftCorner<1, M>() * (B.template topRows<M>() + B.template bottomRows<M>());
+    R.noalias() = A.template topLeftCorner<1, M>() * (B.template topRows<M>() + B.template bottomRows<M>()).eval();
+    VERIFY_IS_APPROX(C, R);
   }
 
   {
-    Matrix<T,M+1,N,RowMajor> A; A.setRandom(m+1,n);
-    Matrix<T,K,M*2,RowMajor> B; B.setRandom(k,m*2);
-    Matrix<T,K,1> C;
-    Matrix<T,K,1> R;
+    Matrix<T, M + 1, N, RowMajor> A;
+    A.setRandom(m + 1, n);
+    Matrix<T, K, M * 2, RowMajor> B;
+    B.setRandom(k, m * 2);
+    Matrix<T, K, 1> C;
+    Matrix<T, K, 1> R;
 
-    C.noalias() = (B.template leftCols<M>()+B.template rightCols<M>())        * A.template topLeftCorner<M,1>();
-    R.noalias() = (B.template leftCols<M>()+B.template rightCols<M>()).eval() * A.template topLeftCorner<M,1>();
-    VERIFY_IS_APPROX(C,R);
+    C.noalias() = (B.template leftCols<M>() + B.template rightCols<M>()) * A.template topLeftCorner<M, 1>();
+    R.noalias() = (B.template leftCols<M>() + B.template rightCols<M>()).eval() * A.template topLeftCorner<M, 1>();
+    VERIFY_IS_APPROX(C, R);
   }
 }
 
-template<int Rows>
-void bug_1311()
-{
-  Matrix< double, Rows, 2 > A;  A.setRandom();
-  Vector2d b = Vector2d::Random() ;
-  Matrix<double,Rows,1> res;
+template <int Rows>
+void bug_1311() {
+  Matrix<double, Rows, 2> A;
+  A.setRandom();
+  Vector2d b = Vector2d::Random();
+  Matrix<double, Rows, 1> res;
   res.noalias() = 1. * (A * b);
-  VERIFY_IS_APPROX(res, A*b);
-  res.noalias() = 1.*A * b;
-  VERIFY_IS_APPROX(res, A*b);
-  res.noalias() = (1.*A).lazyProduct(b);
-  VERIFY_IS_APPROX(res, A*b);
-  res.noalias() = (1.*A).lazyProduct(1.*b);
-  VERIFY_IS_APPROX(res, A*b);
-  res.noalias() = (A).lazyProduct(1.*b);
-  VERIFY_IS_APPROX(res, A*b);
+  VERIFY_IS_APPROX(res, A * b);
+  res.noalias() = 1. * A * b;
+  VERIFY_IS_APPROX(res, A * b);
+  res.noalias() = (1. * A).lazyProduct(b);
+  VERIFY_IS_APPROX(res, A * b);
+  res.noalias() = (1. * A).lazyProduct(1. * b);
+  VERIFY_IS_APPROX(res, A * b);
+  res.noalias() = (A).lazyProduct(1. * b);
+  VERIFY_IS_APPROX(res, A * b);
 }
 
-template<int>
-void product_small_regressions()
-{
+template <int>
+void product_small_regressions() {
   {
     // test compilation of (outer_product) * vector
     Vector3f v = Vector3f::Random();
-    VERIFY_IS_APPROX( (v * v.transpose()) * v, (v * v.transpose()).eval() * v);
+    VERIFY_IS_APPROX((v * v.transpose()) * v, (v * v.transpose()).eval() * v);
   }
-  
+
   {
     // regression test for pull-request #93
-    Eigen::Matrix<double, 1, 1> A;  A.setRandom();
-    Eigen::Matrix<double, 18, 1> B; B.setRandom();
-    Eigen::Matrix<double, 1, 18> C; C.setRandom();
+    Eigen::Matrix<double, 1, 1> A;
+    A.setRandom();
+    Eigen::Matrix<double, 18, 1> B;
+    B.setRandom();
+    Eigen::Matrix<double, 1, 18> C;
+    C.setRandom();
     VERIFY_IS_APPROX(B * A.inverse(), B * A.inverse()[0]);
     VERIFY_IS_APPROX(A.inverse() * C, A.inverse()[0] * C);
   }
@@ -273,15 +265,17 @@
     Eigen::Matrix<double, 10, 10> A, B, C;
     A.setRandom();
     C = A;
-    for(int k=0; k<79; ++k)
-      C = C * A;
-    B.noalias() = (((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A)) * ((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A)))
-                * (((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A)) * ((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A)));
-    VERIFY_IS_APPROX(B,C);
+    for (int k = 0; k < 79; ++k) C = C * A;
+    B.noalias() =
+        (((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A)) *
+         ((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A))) *
+        (((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A)) *
+         ((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A)) * ((A * A) * (A * A)));
+    VERIFY_IS_APPROX(B, C);
   }
 }
 
-template<typename T>
+template <typename T>
 void product_sweep(int max_m, int max_k, int max_n) {
   using Matrix = Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>;
   for (int m = 1; m < max_m; ++m) {
@@ -297,52 +291,51 @@
         VERIFY_IS_APPROX(C, Cref);
       }
     }
-  }   
+  }
 }
 
-EIGEN_DECLARE_TEST(product_small)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( product(Matrix<float, 3, 2>()) );
-    CALL_SUBTEST_2( product(Matrix<int, 3, 17>()) );
-    CALL_SUBTEST_8( product(Matrix<double, 3, 17>()) );
-    CALL_SUBTEST_3( product(Matrix3d()) );
-    CALL_SUBTEST_4( product(Matrix4d()) );
-    CALL_SUBTEST_5( product(Matrix4f()) );
-    CALL_SUBTEST_10( product(Matrix<bfloat16, 3, 2>()) );
-    CALL_SUBTEST_6( product1x1<0>() );
+EIGEN_DECLARE_TEST(product_small) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(product(Matrix<float, 3, 2>()));
+    CALL_SUBTEST_2(product(Matrix<int, 3, 17>()));
+    CALL_SUBTEST_8(product(Matrix<double, 3, 17>()));
+    CALL_SUBTEST_3(product(Matrix3d()));
+    CALL_SUBTEST_4(product(Matrix4d()));
+    CALL_SUBTEST_5(product(Matrix4f()));
+    CALL_SUBTEST_10(product(Matrix<bfloat16, 3, 2>()));
+    CALL_SUBTEST_6(product1x1<0>());
 
-    CALL_SUBTEST_11( test_lazy_l1<float>() );
-    CALL_SUBTEST_12( test_lazy_l2<float>() );
-    CALL_SUBTEST_13( test_lazy_l3<float>() );
+    CALL_SUBTEST_11(test_lazy_l1<float>());
+    CALL_SUBTEST_12(test_lazy_l2<float>());
+    CALL_SUBTEST_13(test_lazy_l3<float>());
 
-    CALL_SUBTEST_21( test_lazy_l1<double>() );
-    CALL_SUBTEST_22( test_lazy_l2<double>() );
-    CALL_SUBTEST_23( test_lazy_l3<double>() );
+    CALL_SUBTEST_21(test_lazy_l1<double>());
+    CALL_SUBTEST_22(test_lazy_l2<double>());
+    CALL_SUBTEST_23(test_lazy_l3<double>());
 
-    CALL_SUBTEST_31( test_lazy_l1<std::complex<float> >() );
-    CALL_SUBTEST_32( test_lazy_l2<std::complex<float> >() );
-    CALL_SUBTEST_33( test_lazy_l3<std::complex<float> >() );
+    CALL_SUBTEST_31(test_lazy_l1<std::complex<float> >());
+    CALL_SUBTEST_32(test_lazy_l2<std::complex<float> >());
+    CALL_SUBTEST_33(test_lazy_l3<std::complex<float> >());
 
-    CALL_SUBTEST_41( test_lazy_l1<std::complex<double> >() );
-    CALL_SUBTEST_42( test_lazy_l2<std::complex<double> >() );
-    CALL_SUBTEST_43( test_lazy_l3<std::complex<double> >() );
+    CALL_SUBTEST_41(test_lazy_l1<std::complex<double> >());
+    CALL_SUBTEST_42(test_lazy_l2<std::complex<double> >());
+    CALL_SUBTEST_43(test_lazy_l3<std::complex<double> >());
 
-    CALL_SUBTEST_7(( test_linear_but_not_vectorizable<float,2,1,Dynamic>() ));
-    CALL_SUBTEST_7(( test_linear_but_not_vectorizable<float,3,1,Dynamic>() ));
-    CALL_SUBTEST_7(( test_linear_but_not_vectorizable<float,2,1,16>() ));
+    CALL_SUBTEST_7((test_linear_but_not_vectorizable<float, 2, 1, Dynamic>()));
+    CALL_SUBTEST_7((test_linear_but_not_vectorizable<float, 3, 1, Dynamic>()));
+    CALL_SUBTEST_7((test_linear_but_not_vectorizable<float, 2, 1, 16>()));
 
-    CALL_SUBTEST_6( bug_1311<3>() );
-    CALL_SUBTEST_6( bug_1311<5>() );
+    CALL_SUBTEST_6(bug_1311<3>());
+    CALL_SUBTEST_6(bug_1311<5>());
 
-    CALL_SUBTEST_9( test_dynamic_bool() );
-    
+    CALL_SUBTEST_9(test_dynamic_bool());
+
     // Commonly specialized vectorized types.
-    CALL_SUBTEST_50( product_sweep<float>(10, 10, 10) );
-    CALL_SUBTEST_51( product_sweep<double>(10, 10, 10) );
-    CALL_SUBTEST_52( product_sweep<Eigen::half>(10, 10, 10) );
-    CALL_SUBTEST_53( product_sweep<Eigen::bfloat16>(10, 10, 10) );
+    CALL_SUBTEST_50(product_sweep<float>(10, 10, 10));
+    CALL_SUBTEST_51(product_sweep<double>(10, 10, 10));
+    CALL_SUBTEST_52(product_sweep<Eigen::half>(10, 10, 10));
+    CALL_SUBTEST_53(product_sweep<Eigen::bfloat16>(10, 10, 10));
   }
 
-  CALL_SUBTEST_6( product_small_regressions<0>() );
+  CALL_SUBTEST_6(product_small_regressions<0>());
 }
diff --git a/test/product_symm.cpp b/test/product_symm.cpp
index ea8d4d5..7c6db2e 100644
--- a/test/product_symm.cpp
+++ b/test/product_symm.cpp
@@ -9,117 +9,121 @@
 
 #include "main.h"
 
-template<typename Scalar, int Size, int OtherSize> void symm(int size = Size, int othersize = OtherSize)
-{
+template <typename Scalar, int Size, int OtherSize>
+void symm(int size = Size, int othersize = OtherSize) {
   typedef Matrix<Scalar, Size, Size> MatrixType;
   typedef Matrix<Scalar, Size, OtherSize> Rhs1;
   typedef Matrix<Scalar, OtherSize, Size> Rhs2;
-  enum { order = OtherSize==1 ? 0 : RowMajor };
-  typedef Matrix<Scalar, Size, OtherSize,order> Rhs3;
+  enum { order = OtherSize == 1 ? 0 : RowMajor };
+  typedef Matrix<Scalar, Size, OtherSize, order> Rhs3;
 
   Index rows = size;
   Index cols = size;
 
-  MatrixType m1 = MatrixType::Random(rows, cols),
-             m2 = MatrixType::Random(rows, cols), m3;
+  MatrixType m1 = MatrixType::Random(rows, cols), m2 = MatrixType::Random(rows, cols), m3;
 
-  m1 = (m1+m1.adjoint()).eval();
+  m1 = (m1 + m1.adjoint()).eval();
 
   Rhs1 rhs1 = Rhs1::Random(cols, othersize), rhs12(cols, othersize), rhs13(cols, othersize);
   Rhs2 rhs2 = Rhs2::Random(othersize, rows), rhs22(othersize, rows), rhs23(othersize, rows);
   Rhs3 rhs3 = Rhs3::Random(cols, othersize), rhs32(cols, othersize), rhs33(cols, othersize);
 
-  Scalar s1 = internal::random<Scalar>(),
-         s2 = internal::random<Scalar>();
+  Scalar s1 = internal::random<Scalar>(), s2 = internal::random<Scalar>();
 
   m2 = m1.template triangularView<Lower>();
   m3 = m2.template selfadjointView<Lower>();
   VERIFY_IS_EQUAL(m1, m3);
-  VERIFY_IS_APPROX(rhs12 = (s1*m2).template selfadjointView<Lower>() * (s2*rhs1),
-                   rhs13 = (s1*m1) * (s2*rhs1));
+  VERIFY_IS_APPROX(rhs12 = (s1 * m2).template selfadjointView<Lower>() * (s2 * rhs1), rhs13 = (s1 * m1) * (s2 * rhs1));
 
-  VERIFY_IS_APPROX(rhs12 = (s1*m2).transpose().template selfadjointView<Upper>() * (s2*rhs1),
-                   rhs13 = (s1*m1.transpose()) * (s2*rhs1));
+  VERIFY_IS_APPROX(rhs12 = (s1 * m2).transpose().template selfadjointView<Upper>() * (s2 * rhs1),
+                   rhs13 = (s1 * m1.transpose()) * (s2 * rhs1));
 
-  VERIFY_IS_APPROX(rhs12 = (s1*m2).template selfadjointView<Lower>().transpose() * (s2*rhs1),
-                   rhs13 = (s1*m1.transpose()) * (s2*rhs1));
+  VERIFY_IS_APPROX(rhs12 = (s1 * m2).template selfadjointView<Lower>().transpose() * (s2 * rhs1),
+                   rhs13 = (s1 * m1.transpose()) * (s2 * rhs1));
 
-  VERIFY_IS_APPROX(rhs12 = (s1*m2).conjugate().template selfadjointView<Lower>() * (s2*rhs1),
-                   rhs13 = (s1*m1).conjugate() * (s2*rhs1));
+  VERIFY_IS_APPROX(rhs12 = (s1 * m2).conjugate().template selfadjointView<Lower>() * (s2 * rhs1),
+                   rhs13 = (s1 * m1).conjugate() * (s2 * rhs1));
 
-  VERIFY_IS_APPROX(rhs12 = (s1*m2).template selfadjointView<Lower>().conjugate() * (s2*rhs1),
-                   rhs13 = (s1*m1).conjugate() * (s2*rhs1));
+  VERIFY_IS_APPROX(rhs12 = (s1 * m2).template selfadjointView<Lower>().conjugate() * (s2 * rhs1),
+                   rhs13 = (s1 * m1).conjugate() * (s2 * rhs1));
 
-  VERIFY_IS_APPROX(rhs12 = (s1*m2).adjoint().template selfadjointView<Upper>() * (s2*rhs1),
-                   rhs13 = (s1*m1).adjoint() * (s2*rhs1));
+  VERIFY_IS_APPROX(rhs12 = (s1 * m2).adjoint().template selfadjointView<Upper>() * (s2 * rhs1),
+                   rhs13 = (s1 * m1).adjoint() * (s2 * rhs1));
 
-  VERIFY_IS_APPROX(rhs12 = (s1*m2).template selfadjointView<Lower>().adjoint() * (s2*rhs1),
-                   rhs13 = (s1*m1).adjoint() * (s2*rhs1));
+  VERIFY_IS_APPROX(rhs12 = (s1 * m2).template selfadjointView<Lower>().adjoint() * (s2 * rhs1),
+                   rhs13 = (s1 * m1).adjoint() * (s2 * rhs1));
 
-  m2 = m1.template triangularView<Upper>(); rhs12.setRandom(); rhs13 = rhs12;
+  m2 = m1.template triangularView<Upper>();
+  rhs12.setRandom();
+  rhs13 = rhs12;
   m3 = m2.template selfadjointView<Upper>();
   VERIFY_IS_EQUAL(m1, m3);
-  VERIFY_IS_APPROX(rhs12 += (s1*m2).template selfadjointView<Upper>() * (s2*rhs1),
-                   rhs13 += (s1*m1) * (s2*rhs1));
+  VERIFY_IS_APPROX(rhs12 += (s1 * m2).template selfadjointView<Upper>() * (s2 * rhs1),
+                   rhs13 += (s1 * m1) * (s2 * rhs1));
 
   m2 = m1.template triangularView<Lower>();
-  VERIFY_IS_APPROX(rhs12 = (s1*m2).template selfadjointView<Lower>() * (s2*rhs2.adjoint()),
-                   rhs13 = (s1*m1) * (s2*rhs2.adjoint()));
+  VERIFY_IS_APPROX(rhs12 = (s1 * m2).template selfadjointView<Lower>() * (s2 * rhs2.adjoint()),
+                   rhs13 = (s1 * m1) * (s2 * rhs2.adjoint()));
 
   m2 = m1.template triangularView<Upper>();
-  VERIFY_IS_APPROX(rhs12 = (s1*m2).template selfadjointView<Upper>() * (s2*rhs2.adjoint()),
-                   rhs13 = (s1*m1) * (s2*rhs2.adjoint()));
+  VERIFY_IS_APPROX(rhs12 = (s1 * m2).template selfadjointView<Upper>() * (s2 * rhs2.adjoint()),
+                   rhs13 = (s1 * m1) * (s2 * rhs2.adjoint()));
 
   m2 = m1.template triangularView<Upper>();
-  VERIFY_IS_APPROX(rhs12 = (s1*m2.adjoint()).template selfadjointView<Lower>() * (s2*rhs2.adjoint()),
-                   rhs13 = (s1*m1.adjoint()) * (s2*rhs2.adjoint()));
+  VERIFY_IS_APPROX(rhs12 = (s1 * m2.adjoint()).template selfadjointView<Lower>() * (s2 * rhs2.adjoint()),
+                   rhs13 = (s1 * m1.adjoint()) * (s2 * rhs2.adjoint()));
 
   // test row major = <...>
-  m2 = m1.template triangularView<Lower>(); rhs32.setRandom(); rhs13 = rhs32;
-  VERIFY_IS_APPROX(rhs32.noalias() -= (s1*m2).template selfadjointView<Lower>() * (s2*rhs3),
-                   rhs13 -= (s1*m1) * (s2 * rhs3));
+  m2 = m1.template triangularView<Lower>();
+  rhs32.setRandom();
+  rhs13 = rhs32;
+  VERIFY_IS_APPROX(rhs32.noalias() -= (s1 * m2).template selfadjointView<Lower>() * (s2 * rhs3),
+                   rhs13 -= (s1 * m1) * (s2 * rhs3));
 
   m2 = m1.template triangularView<Upper>();
-  VERIFY_IS_APPROX(rhs32.noalias() = (s1*m2.adjoint()).template selfadjointView<Lower>() * (s2*rhs3).conjugate(),
-                   rhs13 = (s1*m1.adjoint()) * (s2*rhs3).conjugate());
+  VERIFY_IS_APPROX(rhs32.noalias() = (s1 * m2.adjoint()).template selfadjointView<Lower>() * (s2 * rhs3).conjugate(),
+                   rhs13 = (s1 * m1.adjoint()) * (s2 * rhs3).conjugate());
 
-
-  m2 = m1.template triangularView<Upper>(); rhs13 = rhs12;
-  VERIFY_IS_APPROX(rhs12.noalias() += s1 * ((m2.adjoint()).template selfadjointView<Lower>() * (s2*rhs3).conjugate()),
-                   rhs13 += (s1*m1.adjoint()) * (s2*rhs3).conjugate());
+  m2 = m1.template triangularView<Upper>();
+  rhs13 = rhs12;
+  VERIFY_IS_APPROX(rhs12.noalias() += s1 * ((m2.adjoint()).template selfadjointView<Lower>() * (s2 * rhs3).conjugate()),
+                   rhs13 += (s1 * m1.adjoint()) * (s2 * rhs3).conjugate());
 
   m2 = m1.template triangularView<Lower>();
   VERIFY_IS_APPROX(rhs22 = (rhs2) * (m2).template selfadjointView<Lower>(), rhs23 = (rhs2) * (m1));
-  VERIFY_IS_APPROX(rhs22 = (s2*rhs2) * (s1*m2).template selfadjointView<Lower>(), rhs23 = (s2*rhs2) * (s1*m1));
+  VERIFY_IS_APPROX(rhs22 = (s2 * rhs2) * (s1 * m2).template selfadjointView<Lower>(), rhs23 = (s2 * rhs2) * (s1 * m1));
 
   // destination with a non-default inner-stride
   // see bug 1741
   {
-    typedef Matrix<Scalar,Dynamic,Dynamic> MatrixX;
-    MatrixX buffer(2*cols,2*othersize);
-    Map<Rhs1,0,Stride<Dynamic,2> > map1(buffer.data(),cols,othersize,Stride<Dynamic,2>(2*rows,2));
+    typedef Matrix<Scalar, Dynamic, Dynamic> MatrixX;
+    MatrixX buffer(2 * cols, 2 * othersize);
+    Map<Rhs1, 0, Stride<Dynamic, 2> > map1(buffer.data(), cols, othersize, Stride<Dynamic, 2>(2 * rows, 2));
     buffer.setZero();
-    VERIFY_IS_APPROX( map1.noalias()  = (s1*m2).template selfadjointView<Lower>() * (s2*rhs1),
-                      rhs13 = (s1*m1) * (s2*rhs1));
+    VERIFY_IS_APPROX(map1.noalias() = (s1 * m2).template selfadjointView<Lower>() * (s2 * rhs1),
+                     rhs13 = (s1 * m1) * (s2 * rhs1));
 
-    Map<Rhs2,0,Stride<Dynamic,2> > map2(buffer.data(),rhs22.rows(),rhs22.cols(),Stride<Dynamic,2>(2*rhs22.outerStride(),2));
+    Map<Rhs2, 0, Stride<Dynamic, 2> > map2(buffer.data(), rhs22.rows(), rhs22.cols(),
+                                           Stride<Dynamic, 2>(2 * rhs22.outerStride(), 2));
     buffer.setZero();
     VERIFY_IS_APPROX(map2 = (rhs2) * (m2).template selfadjointView<Lower>(), rhs23 = (rhs2) * (m1));
   }
 }
 
-EIGEN_DECLARE_TEST(product_symm)
-{
-  for(int i = 0; i < g_repeat ; i++)
-  {
-    CALL_SUBTEST_1(( symm<float,Dynamic,Dynamic>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE),internal::random<int>(1,EIGEN_TEST_MAX_SIZE)) ));
-    CALL_SUBTEST_2(( symm<double,Dynamic,Dynamic>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE),internal::random<int>(1,EIGEN_TEST_MAX_SIZE)) ));
-    CALL_SUBTEST_3(( symm<std::complex<float>,Dynamic,Dynamic>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2),internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2)) ));
-    CALL_SUBTEST_4(( symm<std::complex<double>,Dynamic,Dynamic>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2),internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2)) ));
+EIGEN_DECLARE_TEST(product_symm) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1((symm<float, Dynamic, Dynamic>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE),
+                                                  internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_2((symm<double, Dynamic, Dynamic>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE),
+                                                   internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_3((symm<std::complex<float>, Dynamic, Dynamic>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2),
+                                                                internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2))));
+    CALL_SUBTEST_4((symm<std::complex<double>, Dynamic, Dynamic>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2),
+                                                                 internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2))));
 
-    CALL_SUBTEST_5(( symm<float,Dynamic,1>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE)) ));
-    CALL_SUBTEST_6(( symm<double,Dynamic,1>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE)) ));
-    CALL_SUBTEST_7(( symm<std::complex<float>,Dynamic,1>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE)) ));
-    CALL_SUBTEST_8(( symm<std::complex<double>,Dynamic,1>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE)) ));
+    CALL_SUBTEST_5((symm<float, Dynamic, 1>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_6((symm<double, Dynamic, 1>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_7((symm<std::complex<float>, Dynamic, 1>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_8((symm<std::complex<double>, Dynamic, 1>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
   }
 }
diff --git a/test/product_syrk.cpp b/test/product_syrk.cpp
index 16ccb3a..d50f4c4 100644
--- a/test/product_syrk.cpp
+++ b/test/product_syrk.cpp
@@ -9,78 +9,75 @@
 
 #include "main.h"
 
-template<typename MatrixType> void syrk(const MatrixType& m)
-{
+template <typename MatrixType>
+void syrk(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime, RowMajor> RMatrixType;
   typedef Matrix<Scalar, MatrixType::ColsAtCompileTime, Dynamic> Rhs1;
   typedef Matrix<Scalar, Dynamic, MatrixType::RowsAtCompileTime> Rhs2;
-  typedef Matrix<Scalar, MatrixType::ColsAtCompileTime, Dynamic,RowMajor> Rhs3;
+  typedef Matrix<Scalar, MatrixType::ColsAtCompileTime, Dynamic, RowMajor> Rhs3;
 
   Index rows = m.rows();
   Index cols = m.cols();
 
-  MatrixType m1 = MatrixType::Random(rows, cols),
-             m2 = MatrixType::Random(rows, cols),
+  MatrixType m1 = MatrixType::Random(rows, cols), m2 = MatrixType::Random(rows, cols),
              m3 = MatrixType::Random(rows, cols);
   RMatrixType rm2 = MatrixType::Random(rows, cols);
 
-  Rhs1 rhs1 = Rhs1::Random(internal::random<int>(1,320), cols); Rhs1 rhs11 = Rhs1::Random(rhs1.rows(), cols);
-  Rhs2 rhs2 = Rhs2::Random(rows, internal::random<int>(1,320)); Rhs2 rhs22 = Rhs2::Random(rows, rhs2.cols());
-  Rhs3 rhs3 = Rhs3::Random(internal::random<int>(1,320), rows);
+  Rhs1 rhs1 = Rhs1::Random(internal::random<int>(1, 320), cols);
+  Rhs1 rhs11 = Rhs1::Random(rhs1.rows(), cols);
+  Rhs2 rhs2 = Rhs2::Random(rows, internal::random<int>(1, 320));
+  Rhs2 rhs22 = Rhs2::Random(rows, rhs2.cols());
+  Rhs3 rhs3 = Rhs3::Random(internal::random<int>(1, 320), rows);
 
   Scalar s1 = internal::random<Scalar>();
-  
-  Index c = internal::random<Index>(0,cols-1);
+
+  Index c = internal::random<Index>(0, cols - 1);
 
   m2.setZero();
-  VERIFY_IS_APPROX((m2.template selfadjointView<Lower>().rankUpdate(rhs2,s1)._expression()),
+  VERIFY_IS_APPROX((m2.template selfadjointView<Lower>().rankUpdate(rhs2, s1)._expression()),
                    ((s1 * rhs2 * rhs2.adjoint()).eval().template triangularView<Lower>().toDenseMatrix()));
   m2.setZero();
-  VERIFY_IS_APPROX(((m2.template triangularView<Lower>() += s1 * rhs2  * rhs22.adjoint()).nestedExpression()),
+  VERIFY_IS_APPROX(((m2.template triangularView<Lower>() += s1 * rhs2 * rhs22.adjoint()).nestedExpression()),
                    ((s1 * rhs2 * rhs22.adjoint()).eval().template triangularView<Lower>().toDenseMatrix()));
 
-  
   m2.setZero();
-  VERIFY_IS_APPROX(m2.template selfadjointView<Upper>().rankUpdate(rhs2,s1)._expression(),
+  VERIFY_IS_APPROX(m2.template selfadjointView<Upper>().rankUpdate(rhs2, s1)._expression(),
                    (s1 * rhs2 * rhs2.adjoint()).eval().template triangularView<Upper>().toDenseMatrix());
   m2.setZero();
   VERIFY_IS_APPROX((m2.template triangularView<Upper>() += s1 * rhs22 * rhs2.adjoint()).nestedExpression(),
                    (s1 * rhs22 * rhs2.adjoint()).eval().template triangularView<Upper>().toDenseMatrix());
 
-  
   m2.setZero();
-  VERIFY_IS_APPROX(m2.template selfadjointView<Lower>().rankUpdate(rhs1.adjoint(),s1)._expression(),
+  VERIFY_IS_APPROX(m2.template selfadjointView<Lower>().rankUpdate(rhs1.adjoint(), s1)._expression(),
                    (s1 * rhs1.adjoint() * rhs1).eval().template triangularView<Lower>().toDenseMatrix());
   m2.setZero();
   VERIFY_IS_APPROX((m2.template triangularView<Lower>() += s1 * rhs11.adjoint() * rhs1).nestedExpression(),
                    (s1 * rhs11.adjoint() * rhs1).eval().template triangularView<Lower>().toDenseMatrix());
-  
-  
+
   m2.setZero();
-  VERIFY_IS_APPROX(m2.template selfadjointView<Upper>().rankUpdate(rhs1.adjoint(),s1)._expression(),
+  VERIFY_IS_APPROX(m2.template selfadjointView<Upper>().rankUpdate(rhs1.adjoint(), s1)._expression(),
                    (s1 * rhs1.adjoint() * rhs1).eval().template triangularView<Upper>().toDenseMatrix());
   VERIFY_IS_APPROX((m2.template triangularView<Upper>() = s1 * rhs1.adjoint() * rhs11).nestedExpression(),
                    (s1 * rhs1.adjoint() * rhs11).eval().template triangularView<Upper>().toDenseMatrix());
 
-  
   m2.setZero();
-  VERIFY_IS_APPROX(m2.template selfadjointView<Lower>().rankUpdate(rhs3.adjoint(),s1)._expression(),
+  VERIFY_IS_APPROX(m2.template selfadjointView<Lower>().rankUpdate(rhs3.adjoint(), s1)._expression(),
                    (s1 * rhs3.adjoint() * rhs3).eval().template triangularView<Lower>().toDenseMatrix());
 
   m2.setZero();
-  VERIFY_IS_APPROX(m2.template selfadjointView<Upper>().rankUpdate(rhs3.adjoint(),s1)._expression(),
+  VERIFY_IS_APPROX(m2.template selfadjointView<Upper>().rankUpdate(rhs3.adjoint(), s1)._expression(),
                    (s1 * rhs3.adjoint() * rhs3).eval().template triangularView<Upper>().toDenseMatrix());
-                   
+
   m2.setZero();
-  VERIFY_IS_APPROX((m2.template selfadjointView<Lower>().rankUpdate(m1.col(c),s1)._expression()),
+  VERIFY_IS_APPROX((m2.template selfadjointView<Lower>().rankUpdate(m1.col(c), s1)._expression()),
                    ((s1 * m1.col(c) * m1.col(c).adjoint()).eval().template triangularView<Lower>().toDenseMatrix()));
-                   
+
   m2.setZero();
-  VERIFY_IS_APPROX((m2.template selfadjointView<Upper>().rankUpdate(m1.col(c),s1)._expression()),
+  VERIFY_IS_APPROX((m2.template selfadjointView<Upper>().rankUpdate(m1.col(c), s1)._expression()),
                    ((s1 * m1.col(c) * m1.col(c).adjoint()).eval().template triangularView<Upper>().toDenseMatrix()));
   rm2.setZero();
-  VERIFY_IS_APPROX((rm2.template selfadjointView<Upper>().rankUpdate(m1.col(c),s1)._expression()),
+  VERIFY_IS_APPROX((rm2.template selfadjointView<Upper>().rankUpdate(m1.col(c), s1)._expression()),
                    ((s1 * m1.col(c) * m1.col(c).adjoint()).eval().template triangularView<Upper>().toDenseMatrix()));
   m2.setZero();
   VERIFY_IS_APPROX((m2.template triangularView<Upper>() += s1 * m3.col(c) * m1.col(c).adjoint()).nestedExpression(),
@@ -88,60 +85,80 @@
   rm2.setZero();
   VERIFY_IS_APPROX((rm2.template triangularView<Upper>() += s1 * m1.col(c) * m3.col(c).adjoint()).nestedExpression(),
                    ((s1 * m1.col(c) * m3.col(c).adjoint()).eval().template triangularView<Upper>().toDenseMatrix()));
-  
+
   m2.setZero();
-  VERIFY_IS_APPROX((m2.template selfadjointView<Lower>().rankUpdate(m1.col(c).conjugate(),s1)._expression()),
-                   ((s1 * m1.col(c).conjugate() * m1.col(c).conjugate().adjoint()).eval().template triangularView<Lower>().toDenseMatrix()));
-                   
+  VERIFY_IS_APPROX((m2.template selfadjointView<Lower>().rankUpdate(m1.col(c).conjugate(), s1)._expression()),
+                   ((s1 * m1.col(c).conjugate() * m1.col(c).conjugate().adjoint())
+                        .eval()
+                        .template triangularView<Lower>()
+                        .toDenseMatrix()));
+
   m2.setZero();
-  VERIFY_IS_APPROX((m2.template selfadjointView<Upper>().rankUpdate(m1.col(c).conjugate(),s1)._expression()),
-                   ((s1 * m1.col(c).conjugate() * m1.col(c).conjugate().adjoint()).eval().template triangularView<Upper>().toDenseMatrix()));
-  
-  
+  VERIFY_IS_APPROX((m2.template selfadjointView<Upper>().rankUpdate(m1.col(c).conjugate(), s1)._expression()),
+                   ((s1 * m1.col(c).conjugate() * m1.col(c).conjugate().adjoint())
+                        .eval()
+                        .template triangularView<Upper>()
+                        .toDenseMatrix()));
+
   m2.setZero();
-  VERIFY_IS_APPROX((m2.template selfadjointView<Lower>().rankUpdate(m1.row(c),s1)._expression()),
-                   ((s1 * m1.row(c).transpose() * m1.row(c).transpose().adjoint()).eval().template triangularView<Lower>().toDenseMatrix()));
+  VERIFY_IS_APPROX((m2.template selfadjointView<Lower>().rankUpdate(m1.row(c), s1)._expression()),
+                   ((s1 * m1.row(c).transpose() * m1.row(c).transpose().adjoint())
+                        .eval()
+                        .template triangularView<Lower>()
+                        .toDenseMatrix()));
   rm2.setZero();
-  VERIFY_IS_APPROX((rm2.template selfadjointView<Lower>().rankUpdate(m1.row(c),s1)._expression()),
-                   ((s1 * m1.row(c).transpose() * m1.row(c).transpose().adjoint()).eval().template triangularView<Lower>().toDenseMatrix()));
+  VERIFY_IS_APPROX((rm2.template selfadjointView<Lower>().rankUpdate(m1.row(c), s1)._expression()),
+                   ((s1 * m1.row(c).transpose() * m1.row(c).transpose().adjoint())
+                        .eval()
+                        .template triangularView<Lower>()
+                        .toDenseMatrix()));
   m2.setZero();
-  VERIFY_IS_APPROX((m2.template triangularView<Lower>() += s1 * m3.row(c).transpose() * m1.row(c).transpose().adjoint()).nestedExpression(),
-                   ((s1 * m3.row(c).transpose() * m1.row(c).transpose().adjoint()).eval().template triangularView<Lower>().toDenseMatrix()));
+  VERIFY_IS_APPROX((m2.template triangularView<Lower>() += s1 * m3.row(c).transpose() * m1.row(c).transpose().adjoint())
+                       .nestedExpression(),
+                   ((s1 * m3.row(c).transpose() * m1.row(c).transpose().adjoint())
+                        .eval()
+                        .template triangularView<Lower>()
+                        .toDenseMatrix()));
   rm2.setZero();
-  VERIFY_IS_APPROX((rm2.template triangularView<Lower>() += s1 * m3.row(c).transpose() * m1.row(c).transpose().adjoint()).nestedExpression(),
-                   ((s1 * m3.row(c).transpose() * m1.row(c).transpose().adjoint()).eval().template triangularView<Lower>().toDenseMatrix()));
-  
-  
+  VERIFY_IS_APPROX(
+      (rm2.template triangularView<Lower>() += s1 * m3.row(c).transpose() * m1.row(c).transpose().adjoint())
+          .nestedExpression(),
+      ((s1 * m3.row(c).transpose() * m1.row(c).transpose().adjoint())
+           .eval()
+           .template triangularView<Lower>()
+           .toDenseMatrix()));
+
   m2.setZero();
-  VERIFY_IS_APPROX((m2.template selfadjointView<Upper>().rankUpdate(m1.row(c).adjoint(),s1)._expression()),
-                   ((s1 * m1.row(c).adjoint() * m1.row(c).adjoint().adjoint()).eval().template triangularView<Upper>().toDenseMatrix()));
+  VERIFY_IS_APPROX((m2.template selfadjointView<Upper>().rankUpdate(m1.row(c).adjoint(), s1)._expression()),
+                   ((s1 * m1.row(c).adjoint() * m1.row(c).adjoint().adjoint())
+                        .eval()
+                        .template triangularView<Upper>()
+                        .toDenseMatrix()));
 
   // destination with a non-default inner-stride
   // see bug 1741
   {
-    typedef Matrix<Scalar,Dynamic,Dynamic> MatrixX;
-    MatrixX buffer(2*rows,2*cols);
-    Map<MatrixType,0,Stride<Dynamic,2> > map1(buffer.data(),rows,cols,Stride<Dynamic,2>(2*rows,2));
+    typedef Matrix<Scalar, Dynamic, Dynamic> MatrixX;
+    MatrixX buffer(2 * rows, 2 * cols);
+    Map<MatrixType, 0, Stride<Dynamic, 2> > map1(buffer.data(), rows, cols, Stride<Dynamic, 2>(2 * rows, 2));
     buffer.setZero();
-    VERIFY_IS_APPROX((map1.template selfadjointView<Lower>().rankUpdate(rhs2,s1)._expression()),
-                      ((s1 * rhs2 * rhs2.adjoint()).eval().template triangularView<Lower>().toDenseMatrix()));
+    VERIFY_IS_APPROX((map1.template selfadjointView<Lower>().rankUpdate(rhs2, s1)._expression()),
+                     ((s1 * rhs2 * rhs2.adjoint()).eval().template triangularView<Lower>().toDenseMatrix()));
   }
 }
 
-EIGEN_DECLARE_TEST(product_syrk)
-{
-  for(int i = 0; i < g_repeat ; i++)
-  {
+EIGEN_DECLARE_TEST(product_syrk) {
+  for (int i = 0; i < g_repeat; i++) {
     int s;
-    s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE);
-    CALL_SUBTEST_1( syrk(MatrixXf(s, s)) );
-    CALL_SUBTEST_2( syrk(MatrixXd(s, s)) );
+    s = internal::random<int>(1, EIGEN_TEST_MAX_SIZE);
+    CALL_SUBTEST_1(syrk(MatrixXf(s, s)));
+    CALL_SUBTEST_2(syrk(MatrixXd(s, s)));
     TEST_SET_BUT_UNUSED_VARIABLE(s)
-    
-    s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2);
-    CALL_SUBTEST_3( syrk(MatrixXcf(s, s)) );
-    CALL_SUBTEST_4( syrk(MatrixXcd(s, s)) );
-    CALL_SUBTEST_5( syrk(Matrix<bfloat16, Dynamic, Dynamic>(s, s)) );
+
+    s = internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2);
+    CALL_SUBTEST_3(syrk(MatrixXcf(s, s)));
+    CALL_SUBTEST_4(syrk(MatrixXcd(s, s)));
+    CALL_SUBTEST_5(syrk(Matrix<bfloat16, Dynamic, Dynamic>(s, s)));
     TEST_SET_BUT_UNUSED_VARIABLE(s)
   }
 }
diff --git a/test/product_threaded.cpp b/test/product_threaded.cpp
index 95dad79..410f767 100644
--- a/test/product_threaded.cpp
+++ b/test/product_threaded.cpp
@@ -13,21 +13,16 @@
 void test_parallelize_gemm() {
   constexpr int n = 1024;
   constexpr int num_threads = 4;
-  MatrixXf a(n,n);
-  MatrixXf b(n,n);
-  MatrixXf c(n,n);
-  c.noalias() = a*b;
+  MatrixXf a(n, n);
+  MatrixXf b(n, n);
+  MatrixXf c(n, n);
+  c.noalias() = a * b;
 
   ThreadPool pool(num_threads);
-  MatrixXf c_threaded(n,n);
-  c_threaded.noalias() = a*b;
+  MatrixXf c_threaded(n, n);
+  c_threaded.noalias() = a * b;
 
   VERIFY_IS_APPROX(c, c_threaded);
 }
 
-
-
-EIGEN_DECLARE_TEST(product_threaded)
-{
-  CALL_SUBTEST(test_parallelize_gemm());
-}
+EIGEN_DECLARE_TEST(product_threaded) { CALL_SUBTEST(test_parallelize_gemm()); }
diff --git a/test/product_trmm.cpp b/test/product_trmm.cpp
index 2bb4b9e..a8a4220 100644
--- a/test/product_trmm.cpp
+++ b/test/product_trmm.cpp
@@ -9,129 +9,136 @@
 
 #include "main.h"
 
-template<typename T>
-int get_random_size()
-{
+template <typename T>
+int get_random_size() {
   const int factor = NumTraits<T>::ReadCost;
-  const int max_test_size = EIGEN_TEST_MAX_SIZE>2*factor ? EIGEN_TEST_MAX_SIZE/factor : EIGEN_TEST_MAX_SIZE;
-  return internal::random<int>(1,max_test_size);
+  const int max_test_size = EIGEN_TEST_MAX_SIZE > 2 * factor ? EIGEN_TEST_MAX_SIZE / factor : EIGEN_TEST_MAX_SIZE;
+  return internal::random<int>(1, max_test_size);
 }
 
-template<typename Scalar, int Mode, int TriOrder, int OtherOrder, int ResOrder, int OtherCols>
-void trmm(int rows=get_random_size<Scalar>(),
-          int cols=get_random_size<Scalar>(),
-          int otherCols = OtherCols==Dynamic?get_random_size<Scalar>():OtherCols)
-{
-  typedef Matrix<Scalar,Dynamic,Dynamic,TriOrder> TriMatrix;
-  typedef Matrix<Scalar,Dynamic,OtherCols,OtherCols==1?ColMajor:OtherOrder> OnTheRight;
-  typedef Matrix<Scalar,OtherCols,Dynamic,OtherCols==1?RowMajor:OtherOrder> OnTheLeft;
-  
-  typedef Matrix<Scalar,Dynamic,OtherCols,OtherCols==1?ColMajor:ResOrder> ResXS;
-  typedef Matrix<Scalar,OtherCols,Dynamic,OtherCols==1?RowMajor:ResOrder> ResSX;
+template <typename Scalar, int Mode, int TriOrder, int OtherOrder, int ResOrder, int OtherCols>
+void trmm(int rows = get_random_size<Scalar>(), int cols = get_random_size<Scalar>(),
+          int otherCols = OtherCols == Dynamic ? get_random_size<Scalar>() : OtherCols) {
+  typedef Matrix<Scalar, Dynamic, Dynamic, TriOrder> TriMatrix;
+  typedef Matrix<Scalar, Dynamic, OtherCols, OtherCols == 1 ? ColMajor : OtherOrder> OnTheRight;
+  typedef Matrix<Scalar, OtherCols, Dynamic, OtherCols == 1 ? RowMajor : OtherOrder> OnTheLeft;
 
-  TriMatrix  mat(rows,cols), tri(rows,cols), triTr(cols,rows), s1tri(rows,cols), s1triTr(cols,rows);
-  
-  OnTheRight  ge_right(cols,otherCols);
-  OnTheLeft   ge_left(otherCols,rows);
-  ResSX       ge_sx, ge_sx_save;
-  ResXS       ge_xs, ge_xs_save;
+  typedef Matrix<Scalar, Dynamic, OtherCols, OtherCols == 1 ? ColMajor : ResOrder> ResXS;
+  typedef Matrix<Scalar, OtherCols, Dynamic, OtherCols == 1 ? RowMajor : ResOrder> ResSX;
 
-  Scalar s1 = internal::random<Scalar>(),
-         s2 = internal::random<Scalar>();
+  TriMatrix mat(rows, cols), tri(rows, cols), triTr(cols, rows), s1tri(rows, cols), s1triTr(cols, rows);
+
+  OnTheRight ge_right(cols, otherCols);
+  OnTheLeft ge_left(otherCols, rows);
+  ResSX ge_sx, ge_sx_save;
+  ResXS ge_xs, ge_xs_save;
+
+  Scalar s1 = internal::random<Scalar>(), s2 = internal::random<Scalar>();
 
   mat.setRandom();
   tri = mat.template triangularView<Mode>();
   triTr = mat.transpose().template triangularView<Mode>();
-  s1tri = (s1*mat).template triangularView<Mode>();
-  s1triTr = (s1*mat).transpose().template triangularView<Mode>();
+  s1tri = (s1 * mat).template triangularView<Mode>();
+  s1triTr = (s1 * mat).transpose().template triangularView<Mode>();
   ge_right.setRandom();
   ge_left.setRandom();
 
-  VERIFY_IS_APPROX( ge_xs = mat.template triangularView<Mode>() * ge_right, tri * ge_right);
-  VERIFY_IS_APPROX( ge_sx = ge_left * mat.template triangularView<Mode>(), ge_left * tri);
-  
-  VERIFY_IS_APPROX( ge_xs.noalias() = mat.template triangularView<Mode>() * ge_right, tri * ge_right);
-  VERIFY_IS_APPROX( ge_sx.noalias() = ge_left * mat.template triangularView<Mode>(), ge_left * tri);
+  VERIFY_IS_APPROX(ge_xs = mat.template triangularView<Mode>() * ge_right, tri * ge_right);
+  VERIFY_IS_APPROX(ge_sx = ge_left * mat.template triangularView<Mode>(), ge_left * tri);
 
-  if((Mode&UnitDiag)==0)
-    VERIFY_IS_APPROX( ge_xs.noalias() = (s1*mat.adjoint()).template triangularView<Mode>() * (s2*ge_left.transpose()), s1*triTr.conjugate() * (s2*ge_left.transpose()));
-  
-  VERIFY_IS_APPROX( ge_xs.noalias() = (s1*mat.transpose()).template triangularView<Mode>() * (s2*ge_left.transpose()), s1triTr * (s2*ge_left.transpose()));
-  VERIFY_IS_APPROX( ge_sx.noalias() = (s2*ge_left) * (s1*mat).template triangularView<Mode>(), (s2*ge_left)*s1tri);
+  VERIFY_IS_APPROX(ge_xs.noalias() = mat.template triangularView<Mode>() * ge_right, tri * ge_right);
+  VERIFY_IS_APPROX(ge_sx.noalias() = ge_left * mat.template triangularView<Mode>(), ge_left * tri);
 
-  VERIFY_IS_APPROX( ge_sx.noalias() = ge_right.transpose() * mat.adjoint().template triangularView<Mode>(), ge_right.transpose() * triTr.conjugate());
-  VERIFY_IS_APPROX( ge_sx.noalias() = ge_right.adjoint() * mat.adjoint().template triangularView<Mode>(), ge_right.adjoint() * triTr.conjugate());
-  
+  if ((Mode & UnitDiag) == 0)
+    VERIFY_IS_APPROX(
+        ge_xs.noalias() = (s1 * mat.adjoint()).template triangularView<Mode>() * (s2 * ge_left.transpose()),
+        s1 * triTr.conjugate() * (s2 * ge_left.transpose()));
+
+  VERIFY_IS_APPROX(
+      ge_xs.noalias() = (s1 * mat.transpose()).template triangularView<Mode>() * (s2 * ge_left.transpose()),
+      s1triTr * (s2 * ge_left.transpose()));
+  VERIFY_IS_APPROX(ge_sx.noalias() = (s2 * ge_left) * (s1 * mat).template triangularView<Mode>(),
+                   (s2 * ge_left) * s1tri);
+
+  VERIFY_IS_APPROX(ge_sx.noalias() = ge_right.transpose() * mat.adjoint().template triangularView<Mode>(),
+                   ge_right.transpose() * triTr.conjugate());
+  VERIFY_IS_APPROX(ge_sx.noalias() = ge_right.adjoint() * mat.adjoint().template triangularView<Mode>(),
+                   ge_right.adjoint() * triTr.conjugate());
+
   ge_xs_save = ge_xs;
-  if((Mode&UnitDiag)==0)
-    VERIFY_IS_APPROX( (ge_xs_save + s1*triTr.conjugate() * (s2*ge_left.adjoint())).eval(), ge_xs.noalias() += (s1*mat.adjoint()).template triangularView<Mode>() * (s2*ge_left.adjoint()) );
+  if ((Mode & UnitDiag) == 0)
+    VERIFY_IS_APPROX(
+        (ge_xs_save + s1 * triTr.conjugate() * (s2 * ge_left.adjoint())).eval(),
+        ge_xs.noalias() += (s1 * mat.adjoint()).template triangularView<Mode>() * (s2 * ge_left.adjoint()));
   ge_xs_save = ge_xs;
-  VERIFY_IS_APPROX( (ge_xs_save + s1triTr * (s2*ge_left.adjoint())).eval(), ge_xs.noalias() += (s1*mat.transpose()).template triangularView<Mode>() * (s2*ge_left.adjoint()) );
+  VERIFY_IS_APPROX(
+      (ge_xs_save + s1triTr * (s2 * ge_left.adjoint())).eval(),
+      ge_xs.noalias() += (s1 * mat.transpose()).template triangularView<Mode>() * (s2 * ge_left.adjoint()));
   ge_sx.setRandom();
   ge_sx_save = ge_sx;
-  if((Mode&UnitDiag)==0)
-    VERIFY_IS_APPROX( ge_sx_save - (ge_right.adjoint() * (-s1 * triTr).conjugate()).eval(), ge_sx.noalias() -= (ge_right.adjoint() * (-s1 * mat).adjoint().template triangularView<Mode>()).eval());
-  
-  if((Mode&UnitDiag)==0)
-    VERIFY_IS_APPROX( ge_xs = (s1*mat).adjoint().template triangularView<Mode>() * ge_left.adjoint(), numext::conj(s1) * triTr.conjugate() * ge_left.adjoint());
-  VERIFY_IS_APPROX( ge_xs = (s1*mat).transpose().template triangularView<Mode>() * ge_left.adjoint(), s1triTr * ge_left.adjoint());
+  if ((Mode & UnitDiag) == 0)
+    VERIFY_IS_APPROX(
+        ge_sx_save - (ge_right.adjoint() * (-s1 * triTr).conjugate()).eval(),
+        ge_sx.noalias() -= (ge_right.adjoint() * (-s1 * mat).adjoint().template triangularView<Mode>()).eval());
+
+  if ((Mode & UnitDiag) == 0)
+    VERIFY_IS_APPROX(ge_xs = (s1 * mat).adjoint().template triangularView<Mode>() * ge_left.adjoint(),
+                     numext::conj(s1) * triTr.conjugate() * ge_left.adjoint());
+  VERIFY_IS_APPROX(ge_xs = (s1 * mat).transpose().template triangularView<Mode>() * ge_left.adjoint(),
+                   s1triTr * ge_left.adjoint());
 
   // TODO check with sub-matrix expressions ?
 
   // destination with a non-default inner-stride
   // see bug 1741
   {
-    VERIFY_IS_APPROX( ge_xs.noalias() = mat.template triangularView<Mode>() * ge_right, tri * ge_right);
-    typedef Matrix<Scalar,Dynamic,Dynamic> MatrixX;
-    MatrixX buffer(2*ge_xs.rows(),2*ge_xs.cols());
-    Map<ResXS,0,Stride<Dynamic,2> > map1(buffer.data(),ge_xs.rows(),ge_xs.cols(),Stride<Dynamic,2>(2*ge_xs.outerStride(),2));
+    VERIFY_IS_APPROX(ge_xs.noalias() = mat.template triangularView<Mode>() * ge_right, tri * ge_right);
+    typedef Matrix<Scalar, Dynamic, Dynamic> MatrixX;
+    MatrixX buffer(2 * ge_xs.rows(), 2 * ge_xs.cols());
+    Map<ResXS, 0, Stride<Dynamic, 2> > map1(buffer.data(), ge_xs.rows(), ge_xs.cols(),
+                                            Stride<Dynamic, 2>(2 * ge_xs.outerStride(), 2));
     buffer.setZero();
-    VERIFY_IS_APPROX( map1.noalias() = mat.template triangularView<Mode>() * ge_right, tri * ge_right);
+    VERIFY_IS_APPROX(map1.noalias() = mat.template triangularView<Mode>() * ge_right, tri * ge_right);
   }
 }
 
-template<typename Scalar, int Mode, int TriOrder>
-void trmv(int rows=get_random_size<Scalar>(), int cols=get_random_size<Scalar>())
-{
-  trmm<Scalar,Mode,TriOrder,ColMajor,ColMajor,1>(rows,cols,1);
+template <typename Scalar, int Mode, int TriOrder>
+void trmv(int rows = get_random_size<Scalar>(), int cols = get_random_size<Scalar>()) {
+  trmm<Scalar, Mode, TriOrder, ColMajor, ColMajor, 1>(rows, cols, 1);
 }
 
-template<typename Scalar, int Mode, int TriOrder, int OtherOrder, int ResOrder>
-void trmm(int rows=get_random_size<Scalar>(), int cols=get_random_size<Scalar>(), int otherCols = get_random_size<Scalar>())
-{
-  trmm<Scalar,Mode,TriOrder,OtherOrder,ResOrder,Dynamic>(rows,cols,otherCols);
+template <typename Scalar, int Mode, int TriOrder, int OtherOrder, int ResOrder>
+void trmm(int rows = get_random_size<Scalar>(), int cols = get_random_size<Scalar>(),
+          int otherCols = get_random_size<Scalar>()) {
+  trmm<Scalar, Mode, TriOrder, OtherOrder, ResOrder, Dynamic>(rows, cols, otherCols);
 }
 
-#define CALL_ALL_ORDERS(NB,SCALAR,MODE)                                             \
-  EIGEN_CAT(CALL_SUBTEST_,NB)((trmm<SCALAR, MODE, ColMajor,ColMajor,ColMajor>()));  \
-  EIGEN_CAT(CALL_SUBTEST_,NB)((trmm<SCALAR, MODE, ColMajor,ColMajor,RowMajor>()));  \
-  EIGEN_CAT(CALL_SUBTEST_,NB)((trmm<SCALAR, MODE, ColMajor,RowMajor,ColMajor>()));  \
-  EIGEN_CAT(CALL_SUBTEST_,NB)((trmm<SCALAR, MODE, ColMajor,RowMajor,RowMajor>()));  \
-  EIGEN_CAT(CALL_SUBTEST_,NB)((trmm<SCALAR, MODE, RowMajor,ColMajor,ColMajor>()));  \
-  EIGEN_CAT(CALL_SUBTEST_,NB)((trmm<SCALAR, MODE, RowMajor,ColMajor,RowMajor>()));  \
-  EIGEN_CAT(CALL_SUBTEST_,NB)((trmm<SCALAR, MODE, RowMajor,RowMajor,ColMajor>()));  \
-  EIGEN_CAT(CALL_SUBTEST_,NB)((trmm<SCALAR, MODE, RowMajor,RowMajor,RowMajor>()));  \
-  \
-  EIGEN_CAT(CALL_SUBTEST_1,NB)((trmv<SCALAR, MODE, ColMajor>()));                   \
-  EIGEN_CAT(CALL_SUBTEST_1,NB)((trmv<SCALAR, MODE, RowMajor>()));
+#define CALL_ALL_ORDERS(NB, SCALAR, MODE)                                             \
+  EIGEN_CAT(CALL_SUBTEST_, NB)((trmm<SCALAR, MODE, ColMajor, ColMajor, ColMajor>())); \
+  EIGEN_CAT(CALL_SUBTEST_, NB)((trmm<SCALAR, MODE, ColMajor, ColMajor, RowMajor>())); \
+  EIGEN_CAT(CALL_SUBTEST_, NB)((trmm<SCALAR, MODE, ColMajor, RowMajor, ColMajor>())); \
+  EIGEN_CAT(CALL_SUBTEST_, NB)((trmm<SCALAR, MODE, ColMajor, RowMajor, RowMajor>())); \
+  EIGEN_CAT(CALL_SUBTEST_, NB)((trmm<SCALAR, MODE, RowMajor, ColMajor, ColMajor>())); \
+  EIGEN_CAT(CALL_SUBTEST_, NB)((trmm<SCALAR, MODE, RowMajor, ColMajor, RowMajor>())); \
+  EIGEN_CAT(CALL_SUBTEST_, NB)((trmm<SCALAR, MODE, RowMajor, RowMajor, ColMajor>())); \
+  EIGEN_CAT(CALL_SUBTEST_, NB)((trmm<SCALAR, MODE, RowMajor, RowMajor, RowMajor>())); \
+                                                                                      \
+  EIGEN_CAT(CALL_SUBTEST_1, NB)((trmv<SCALAR, MODE, ColMajor>()));                    \
+  EIGEN_CAT(CALL_SUBTEST_1, NB)((trmv<SCALAR, MODE, RowMajor>()));
 
-  
-#define CALL_ALL(NB,SCALAR)                 \
-  CALL_ALL_ORDERS(EIGEN_CAT(1,NB),SCALAR,Upper)          \
-  CALL_ALL_ORDERS(EIGEN_CAT(2,NB),SCALAR,UnitUpper)      \
-  CALL_ALL_ORDERS(EIGEN_CAT(3,NB),SCALAR,StrictlyUpper)  \
-  CALL_ALL_ORDERS(EIGEN_CAT(1,NB),SCALAR,Lower)          \
-  CALL_ALL_ORDERS(EIGEN_CAT(2,NB),SCALAR,UnitLower)      \
-  CALL_ALL_ORDERS(EIGEN_CAT(3,NB),SCALAR,StrictlyLower)
-  
+#define CALL_ALL(NB, SCALAR)                               \
+  CALL_ALL_ORDERS(EIGEN_CAT(1, NB), SCALAR, Upper)         \
+  CALL_ALL_ORDERS(EIGEN_CAT(2, NB), SCALAR, UnitUpper)     \
+  CALL_ALL_ORDERS(EIGEN_CAT(3, NB), SCALAR, StrictlyUpper) \
+  CALL_ALL_ORDERS(EIGEN_CAT(1, NB), SCALAR, Lower)         \
+  CALL_ALL_ORDERS(EIGEN_CAT(2, NB), SCALAR, UnitLower)     \
+  CALL_ALL_ORDERS(EIGEN_CAT(3, NB), SCALAR, StrictlyLower)
 
-EIGEN_DECLARE_TEST(product_trmm)
-{
-  for(int i = 0; i < g_repeat ; i++)
-  {
-    CALL_ALL(1,float);                //  EIGEN_SUFFIXES;11;111;21;121;31;131
-    CALL_ALL(2,double);               //  EIGEN_SUFFIXES;12;112;22;122;32;132
-    CALL_ALL(3,std::complex<float>);  //  EIGEN_SUFFIXES;13;113;23;123;33;133
-    CALL_ALL(4,std::complex<double>); //  EIGEN_SUFFIXES;14;114;24;124;34;134
+EIGEN_DECLARE_TEST(product_trmm) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_ALL(1, float);                 //  EIGEN_SUFFIXES;11;111;21;121;31;131
+    CALL_ALL(2, double);                //  EIGEN_SUFFIXES;12;112;22;122;32;132
+    CALL_ALL(3, std::complex<float>);   //  EIGEN_SUFFIXES;13;113;23;123;33;133
+    CALL_ALL(4, std::complex<double>);  //  EIGEN_SUFFIXES;14;114;24;124;34;134
   }
 }
diff --git a/test/product_trmv.cpp b/test/product_trmv.cpp
index 5eb1b5a..447243f 100644
--- a/test/product_trmv.cpp
+++ b/test/product_trmv.cpp
@@ -9,19 +9,18 @@
 
 #include "main.h"
 
-template<typename MatrixType> void trmv(const MatrixType& m)
-{
+template <typename MatrixType>
+void trmv(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
   typedef typename NumTraits<Scalar>::Real RealScalar;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
 
-  RealScalar largerEps = 10*test_precision<RealScalar>();
+  RealScalar largerEps = 10 * test_precision<RealScalar>();
 
   Index rows = m.rows();
   Index cols = m.cols();
 
-  MatrixType m1 = MatrixType::Random(rows, cols),
-             m3(rows, cols);
+  MatrixType m1 = MatrixType::Random(rows, cols), m3(rows, cols);
   VectorType v1 = VectorType::Random(rows);
 
   Scalar s1 = internal::random<Scalar>();
@@ -40,9 +39,11 @@
 
   // check conjugated and scalar multiple expressions (col-major)
   m3 = m1.template triangularView<Eigen::Lower>();
-  VERIFY(((s1*m3).conjugate() * v1).isApprox((s1*m1).conjugate().template triangularView<Eigen::Lower>() * v1, largerEps));
+  VERIFY(((s1 * m3).conjugate() * v1)
+             .isApprox((s1 * m1).conjugate().template triangularView<Eigen::Lower>() * v1, largerEps));
   m3 = m1.template triangularView<Eigen::Upper>();
-  VERIFY((m3.conjugate() * v1.conjugate()).isApprox(m1.conjugate().template triangularView<Eigen::Upper>() * v1.conjugate(), largerEps));
+  VERIFY((m3.conjugate() * v1.conjugate())
+             .isApprox(m1.conjugate().template triangularView<Eigen::Upper>() * v1.conjugate(), largerEps));
 
   // check with a row-major matrix
   m3 = m1.template triangularView<Eigen::Upper>();
@@ -58,33 +59,34 @@
   m3 = m1.template triangularView<Eigen::Upper>();
   VERIFY((m3.adjoint() * v1).isApprox(m1.adjoint().template triangularView<Eigen::Lower>() * v1, largerEps));
   m3 = m1.template triangularView<Eigen::Lower>();
-  VERIFY((m3.adjoint() * (s1*v1.conjugate())).isApprox(m1.adjoint().template triangularView<Eigen::Upper>() * (s1*v1.conjugate()), largerEps));
+  VERIFY((m3.adjoint() * (s1 * v1.conjugate()))
+             .isApprox(m1.adjoint().template triangularView<Eigen::Upper>() * (s1 * v1.conjugate()), largerEps));
   m3 = m1.template triangularView<Eigen::UnitUpper>();
 
   // check transposed cases:
   m3 = m1.template triangularView<Eigen::Lower>();
   VERIFY((v1.transpose() * m3).isApprox(v1.transpose() * m1.template triangularView<Eigen::Lower>(), largerEps));
   VERIFY((v1.adjoint() * m3).isApprox(v1.adjoint() * m1.template triangularView<Eigen::Lower>(), largerEps));
-  VERIFY((v1.adjoint() * m3.adjoint()).isApprox(v1.adjoint() * m1.template triangularView<Eigen::Lower>().adjoint(), largerEps));
+  VERIFY((v1.adjoint() * m3.adjoint())
+             .isApprox(v1.adjoint() * m1.template triangularView<Eigen::Lower>().adjoint(), largerEps));
 
   // TODO check with sub-matrices
 }
 
-EIGEN_DECLARE_TEST(product_trmv)
-{
+EIGEN_DECLARE_TEST(product_trmv) {
   int s = 0;
-  for(int i = 0; i < g_repeat ; i++) {
-    CALL_SUBTEST_1( trmv(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( trmv(Matrix<float, 2, 2>()) );
-    CALL_SUBTEST_3( trmv(Matrix3d()) );
-    
-    s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2);
-    CALL_SUBTEST_4( trmv(MatrixXcf(s,s)) );
-    CALL_SUBTEST_5( trmv(MatrixXcd(s,s)) );
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(trmv(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(trmv(Matrix<float, 2, 2>()));
+    CALL_SUBTEST_3(trmv(Matrix3d()));
+
+    s = internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2);
+    CALL_SUBTEST_4(trmv(MatrixXcf(s, s)));
+    CALL_SUBTEST_5(trmv(MatrixXcd(s, s)));
     TEST_SET_BUT_UNUSED_VARIABLE(s)
-    
-    s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE);
-    CALL_SUBTEST_6( trmv(Matrix<float,Dynamic,Dynamic,RowMajor>(s, s)) );
+
+    s = internal::random<int>(1, EIGEN_TEST_MAX_SIZE);
+    CALL_SUBTEST_6(trmv(Matrix<float, Dynamic, Dynamic, RowMajor>(s, s)));
     TEST_SET_BUT_UNUSED_VARIABLE(s)
   }
 }
diff --git a/test/product_trsolve.cpp b/test/product_trsolve.cpp
index c59748c..033aa86 100644
--- a/test/product_trsolve.cpp
+++ b/test/product_trsolve.cpp
@@ -9,119 +9,129 @@
 
 #include "main.h"
 
-#define VERIFY_TRSM(TRI,XB) { \
-    (XB).setRandom(); ref = (XB); \
-    (TRI).solveInPlace(XB); \
+#define VERIFY_TRSM(TRI, XB)                             \
+  {                                                      \
+    (XB).setRandom();                                    \
+    ref = (XB);                                          \
+    (TRI).solveInPlace(XB);                              \
     VERIFY_IS_APPROX((TRI).toDenseMatrix() * (XB), ref); \
-    (XB).setRandom(); ref = (XB); \
-    (XB) = (TRI).solve(XB); \
+    (XB).setRandom();                                    \
+    ref = (XB);                                          \
+    (XB) = (TRI).solve(XB);                              \
     VERIFY_IS_APPROX((TRI).toDenseMatrix() * (XB), ref); \
   }
 
-#define VERIFY_TRSM_ONTHERIGHT(TRI,XB) { \
-    (XB).setRandom(); ref = (XB); \
-    (TRI).transpose().template solveInPlace<OnTheRight>(XB.transpose()); \
+#define VERIFY_TRSM_ONTHERIGHT(TRI, XB)                                                      \
+  {                                                                                          \
+    (XB).setRandom();                                                                        \
+    ref = (XB);                                                                              \
+    (TRI).transpose().template solveInPlace<OnTheRight>(XB.transpose());                     \
     VERIFY_IS_APPROX((XB).transpose() * (TRI).transpose().toDenseMatrix(), ref.transpose()); \
-    (XB).setRandom(); ref = (XB); \
-    (XB).transpose() = (TRI).transpose().template solve<OnTheRight>(XB.transpose()); \
+    (XB).setRandom();                                                                        \
+    ref = (XB);                                                                              \
+    (XB).transpose() = (TRI).transpose().template solve<OnTheRight>(XB.transpose());         \
     VERIFY_IS_APPROX((XB).transpose() * (TRI).transpose().toDenseMatrix(), ref.transpose()); \
   }
 
-template<typename Scalar,int Size, int Cols> void trsolve(int size=Size,int cols=Cols)
-{
+template <typename Scalar, int Size, int Cols>
+void trsolve(int size = Size, int cols = Cols) {
   typedef typename NumTraits<Scalar>::Real RealScalar;
 
-  Matrix<Scalar,Size,Size,ColMajor> cmLhs(size,size);
-  Matrix<Scalar,Size,Size,RowMajor> rmLhs(size,size);
+  Matrix<Scalar, Size, Size, ColMajor> cmLhs(size, size);
+  Matrix<Scalar, Size, Size, RowMajor> rmLhs(size, size);
 
-  enum {  colmajor = Size==1 ? RowMajor : ColMajor,
-          rowmajor = Cols==1 ? ColMajor : RowMajor };
-  Matrix<Scalar,Size,Cols,colmajor> cmRhs(size,cols);
-  Matrix<Scalar,Size,Cols,rowmajor> rmRhs(size,cols);
-  Matrix<Scalar,Dynamic,Dynamic,colmajor> ref(size,cols);
+  enum { colmajor = Size == 1 ? RowMajor : ColMajor, rowmajor = Cols == 1 ? ColMajor : RowMajor };
+  Matrix<Scalar, Size, Cols, colmajor> cmRhs(size, cols);
+  Matrix<Scalar, Size, Cols, rowmajor> rmRhs(size, cols);
+  Matrix<Scalar, Dynamic, Dynamic, colmajor> ref(size, cols);
 
-  cmLhs.setRandom(); cmLhs *= static_cast<RealScalar>(0.1); cmLhs.diagonal().array() += static_cast<RealScalar>(1);
-  rmLhs.setRandom(); rmLhs *= static_cast<RealScalar>(0.1); rmLhs.diagonal().array() += static_cast<RealScalar>(1);
+  cmLhs.setRandom();
+  cmLhs *= static_cast<RealScalar>(0.1);
+  cmLhs.diagonal().array() += static_cast<RealScalar>(1);
+  rmLhs.setRandom();
+  rmLhs *= static_cast<RealScalar>(0.1);
+  rmLhs.diagonal().array() += static_cast<RealScalar>(1);
 
   VERIFY_TRSM(cmLhs.conjugate().template triangularView<Lower>(), cmRhs);
-  VERIFY_TRSM(cmLhs.adjoint()  .template triangularView<Lower>(), cmRhs);
-  VERIFY_TRSM(cmLhs            .template triangularView<Upper>(), cmRhs);
-  VERIFY_TRSM(cmLhs            .template triangularView<Lower>(), rmRhs);
+  VERIFY_TRSM(cmLhs.adjoint().template triangularView<Lower>(), cmRhs);
+  VERIFY_TRSM(cmLhs.template triangularView<Upper>(), cmRhs);
+  VERIFY_TRSM(cmLhs.template triangularView<Lower>(), rmRhs);
   VERIFY_TRSM(cmLhs.conjugate().template triangularView<Upper>(), rmRhs);
-  VERIFY_TRSM(cmLhs.adjoint()  .template triangularView<Upper>(), rmRhs);
+  VERIFY_TRSM(cmLhs.adjoint().template triangularView<Upper>(), rmRhs);
 
   VERIFY_TRSM(cmLhs.conjugate().template triangularView<UnitLower>(), cmRhs);
-  VERIFY_TRSM(cmLhs            .template triangularView<UnitUpper>(), rmRhs);
+  VERIFY_TRSM(cmLhs.template triangularView<UnitUpper>(), rmRhs);
 
-  VERIFY_TRSM(rmLhs            .template triangularView<Lower>(), cmRhs);
+  VERIFY_TRSM(rmLhs.template triangularView<Lower>(), cmRhs);
   VERIFY_TRSM(rmLhs.conjugate().template triangularView<UnitUpper>(), rmRhs);
 
-
   VERIFY_TRSM_ONTHERIGHT(cmLhs.conjugate().template triangularView<Lower>(), cmRhs);
-  VERIFY_TRSM_ONTHERIGHT(cmLhs            .template triangularView<Upper>(), cmRhs);
-  VERIFY_TRSM_ONTHERIGHT(cmLhs            .template triangularView<Lower>(), rmRhs);
+  VERIFY_TRSM_ONTHERIGHT(cmLhs.template triangularView<Upper>(), cmRhs);
+  VERIFY_TRSM_ONTHERIGHT(cmLhs.template triangularView<Lower>(), rmRhs);
   VERIFY_TRSM_ONTHERIGHT(cmLhs.conjugate().template triangularView<Upper>(), rmRhs);
 
   VERIFY_TRSM_ONTHERIGHT(cmLhs.conjugate().template triangularView<UnitLower>(), cmRhs);
-  VERIFY_TRSM_ONTHERIGHT(cmLhs            .template triangularView<UnitUpper>(), rmRhs);
+  VERIFY_TRSM_ONTHERIGHT(cmLhs.template triangularView<UnitUpper>(), rmRhs);
 
-  VERIFY_TRSM_ONTHERIGHT(rmLhs            .template triangularView<Lower>(), cmRhs);
+  VERIFY_TRSM_ONTHERIGHT(rmLhs.template triangularView<Lower>(), cmRhs);
   VERIFY_TRSM_ONTHERIGHT(rmLhs.conjugate().template triangularView<UnitUpper>(), rmRhs);
 
-  int c = internal::random<int>(0,cols-1);
+  int c = internal::random<int>(0, cols - 1);
   VERIFY_TRSM(rmLhs.template triangularView<Lower>(), rmRhs.col(c));
   VERIFY_TRSM(cmLhs.template triangularView<Lower>(), rmRhs.col(c));
 
   // destination with a non-default inner-stride
   // see bug 1741
   {
-    typedef Matrix<Scalar,Dynamic,Dynamic> MatrixX;
-    MatrixX buffer(2*cmRhs.rows(),2*cmRhs.cols());
-    Map<Matrix<Scalar,Size,Cols,colmajor>,0,Stride<Dynamic,2> > map1(buffer.data(),cmRhs.rows(),cmRhs.cols(),Stride<Dynamic,2>(2*cmRhs.outerStride(),2));
-    Map<Matrix<Scalar,Size,Cols,rowmajor>,0,Stride<Dynamic,2> > map2(buffer.data(),rmRhs.rows(),rmRhs.cols(),Stride<Dynamic,2>(2*rmRhs.outerStride(),2));
+    typedef Matrix<Scalar, Dynamic, Dynamic> MatrixX;
+    MatrixX buffer(2 * cmRhs.rows(), 2 * cmRhs.cols());
+    Map<Matrix<Scalar, Size, Cols, colmajor>, 0, Stride<Dynamic, 2> > map1(
+        buffer.data(), cmRhs.rows(), cmRhs.cols(), Stride<Dynamic, 2>(2 * cmRhs.outerStride(), 2));
+    Map<Matrix<Scalar, Size, Cols, rowmajor>, 0, Stride<Dynamic, 2> > map2(
+        buffer.data(), rmRhs.rows(), rmRhs.cols(), Stride<Dynamic, 2>(2 * rmRhs.outerStride(), 2));
     buffer.setZero();
     VERIFY_TRSM(cmLhs.conjugate().template triangularView<Lower>(), map1);
     buffer.setZero();
-    VERIFY_TRSM(cmLhs            .template triangularView<Lower>(), map2);
+    VERIFY_TRSM(cmLhs.template triangularView<Lower>(), map2);
   }
 
-  if(Size==Dynamic)
-  {
-    cmLhs.resize(0,0);
-    cmRhs.resize(0,cmRhs.cols());
-    Matrix<Scalar,Size,Cols,colmajor> res = cmLhs.template triangularView<Lower>().solve(cmRhs);
-    VERIFY_IS_EQUAL(res.rows(),0);
-    VERIFY_IS_EQUAL(res.cols(),cmRhs.cols());
+  if (Size == Dynamic) {
+    cmLhs.resize(0, 0);
+    cmRhs.resize(0, cmRhs.cols());
+    Matrix<Scalar, Size, Cols, colmajor> res = cmLhs.template triangularView<Lower>().solve(cmRhs);
+    VERIFY_IS_EQUAL(res.rows(), 0);
+    VERIFY_IS_EQUAL(res.cols(), cmRhs.cols());
     res = cmRhs;
     cmLhs.template triangularView<Lower>().solveInPlace(res);
-    VERIFY_IS_EQUAL(res.rows(),0);
-    VERIFY_IS_EQUAL(res.cols(),cmRhs.cols());
+    VERIFY_IS_EQUAL(res.rows(), 0);
+    VERIFY_IS_EQUAL(res.cols(), cmRhs.cols());
   }
 }
 
-EIGEN_DECLARE_TEST(product_trsolve)
-{
-  for(int i = 0; i < g_repeat ; i++)
-  {
+EIGEN_DECLARE_TEST(product_trsolve) {
+  for (int i = 0; i < g_repeat; i++) {
     // matrices
-    CALL_SUBTEST_1((trsolve<float,Dynamic,Dynamic>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE),internal::random<int>(1,EIGEN_TEST_MAX_SIZE))));
-    CALL_SUBTEST_2((trsolve<double,Dynamic,Dynamic>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE),internal::random<int>(1,EIGEN_TEST_MAX_SIZE))));
-    CALL_SUBTEST_3((trsolve<std::complex<float>,Dynamic,Dynamic>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2),internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2))));
-    CALL_SUBTEST_4((trsolve<std::complex<double>,Dynamic,Dynamic>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2),internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2))));
+    CALL_SUBTEST_1((trsolve<float, Dynamic, Dynamic>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE),
+                                                     internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_2((trsolve<double, Dynamic, Dynamic>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE),
+                                                      internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_3((trsolve<std::complex<float>, Dynamic, Dynamic>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2),
+                                                                   internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2))));
+    CALL_SUBTEST_4((trsolve<std::complex<double>, Dynamic, Dynamic>(
+        internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2), internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2))));
 
     // vectors
-    CALL_SUBTEST_5((trsolve<float,Dynamic,1>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE))));
-    CALL_SUBTEST_6((trsolve<double,Dynamic,1>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE))));
-    CALL_SUBTEST_7((trsolve<std::complex<float>,Dynamic,1>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE))));
-    CALL_SUBTEST_8((trsolve<std::complex<double>,Dynamic,1>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE))));
-    
+    CALL_SUBTEST_5((trsolve<float, Dynamic, 1>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_6((trsolve<double, Dynamic, 1>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_7((trsolve<std::complex<float>, Dynamic, 1>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_8((trsolve<std::complex<double>, Dynamic, 1>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+
     // meta-unrollers
-    CALL_SUBTEST_9((trsolve<float,4,1>()));
-    CALL_SUBTEST_10((trsolve<double,4,1>()));
-    CALL_SUBTEST_11((trsolve<std::complex<float>,4,1>()));
-    CALL_SUBTEST_12((trsolve<float,1,1>()));
-    CALL_SUBTEST_13((trsolve<float,1,2>()));
-    CALL_SUBTEST_14((trsolve<float,3,1>()));
-    
+    CALL_SUBTEST_9((trsolve<float, 4, 1>()));
+    CALL_SUBTEST_10((trsolve<double, 4, 1>()));
+    CALL_SUBTEST_11((trsolve<std::complex<float>, 4, 1>()));
+    CALL_SUBTEST_12((trsolve<float, 1, 1>()));
+    CALL_SUBTEST_13((trsolve<float, 1, 2>()));
+    CALL_SUBTEST_14((trsolve<float, 3, 1>()));
   }
 }
diff --git a/test/qr.cpp b/test/qr.cpp
index 36f3121..de470ca 100644
--- a/test/qr.cpp
+++ b/test/qr.cpp
@@ -11,15 +11,15 @@
 #include <Eigen/QR>
 #include "solverbase.h"
 
-template<typename MatrixType> void qr(const MatrixType& m)
-{
+template <typename MatrixType>
+void qr(const MatrixType& m) {
   Index rows = m.rows();
   Index cols = m.cols();
 
   typedef typename MatrixType::Scalar Scalar;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> MatrixQType;
 
-  MatrixType a = MatrixType::Random(rows,cols);
+  MatrixType a = MatrixType::Random(rows, cols);
   HouseholderQR<MatrixType> qrOfA(a);
 
   MatrixQType q = qrOfA.householderQ();
@@ -29,42 +29,43 @@
   VERIFY_IS_APPROX(a, qrOfA.householderQ() * r);
 }
 
-template<typename MatrixType, int Cols2> void qr_fixedsize()
-{
+template <typename MatrixType, int Cols2>
+void qr_fixedsize() {
   enum { Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime };
   typedef typename MatrixType::Scalar Scalar;
-  Matrix<Scalar,Rows,Cols> m1 = Matrix<Scalar,Rows,Cols>::Random();
-  HouseholderQR<Matrix<Scalar,Rows,Cols> > qr(m1);
+  Matrix<Scalar, Rows, Cols> m1 = Matrix<Scalar, Rows, Cols>::Random();
+  HouseholderQR<Matrix<Scalar, Rows, Cols> > qr(m1);
 
-  Matrix<Scalar,Rows,Cols> r = qr.matrixQR();
+  Matrix<Scalar, Rows, Cols> r = qr.matrixQR();
   // FIXME need better way to construct trapezoid
-  for(int i = 0; i < Rows; i++) for(int j = 0; j < Cols; j++) if(i>j) r(i,j) = Scalar(0);
+  for (int i = 0; i < Rows; i++)
+    for (int j = 0; j < Cols; j++)
+      if (i > j) r(i, j) = Scalar(0);
 
   VERIFY_IS_APPROX(m1, qr.householderQ() * r);
 
-  check_solverbase<Matrix<Scalar,Cols,Cols2>, Matrix<Scalar,Rows,Cols2> >(m1, qr, Rows, Cols, Cols2);
+  check_solverbase<Matrix<Scalar, Cols, Cols2>, Matrix<Scalar, Rows, Cols2> >(m1, qr, Rows, Cols, Cols2);
 }
 
-template<typename MatrixType> void qr_invertible()
-{
-  using std::log;
+template <typename MatrixType>
+void qr_invertible() {
   using std::abs;
-  using std::pow;
+  using std::log;
   using std::max;
+  using std::pow;
   typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar;
   typedef typename MatrixType::Scalar Scalar;
 
-  STATIC_CHECK(( internal::is_same<typename HouseholderQR<MatrixType>::StorageIndex,int>::value ));
+  STATIC_CHECK((internal::is_same<typename HouseholderQR<MatrixType>::StorageIndex, int>::value));
 
-  int size = internal::random<int>(10,50);
+  int size = internal::random<int>(10, 50);
 
   MatrixType m1(size, size), m2(size, size), m3(size, size);
-  m1 = MatrixType::Random(size,size);
+  m1 = MatrixType::Random(size, size);
 
-  if (internal::is_same<RealScalar,float>::value)
-  {
+  if (internal::is_same<RealScalar, float>::value) {
     // let's build a matrix more stable to inverse
-    MatrixType a = MatrixType::Random(size,size*4);
+    MatrixType a = MatrixType::Random(size, size * 4);
     m1 += a * a.adjoint();
   }
 
@@ -74,22 +75,23 @@
 
   // now construct a matrix with prescribed determinant
   m1.setZero();
-  for(int i = 0; i < size; i++) m1(i,i) = internal::random<Scalar>();
+  for (int i = 0; i < size; i++) m1(i, i) = internal::random<Scalar>();
   Scalar det = m1.diagonal().prod();
   RealScalar absdet = abs(det);
-  m3 = qr.householderQ(); // get a unitary
+  m3 = qr.householderQ();  // get a unitary
   m1 = m3 * m1 * m3.adjoint();
   qr.compute(m1);
   VERIFY_IS_APPROX(log(absdet), qr.logAbsDeterminant());
   // This test is tricky if the determinant becomes too small.
   // Since we generate random numbers with magnitude range [0,1], the average determinant is 0.5^size
-  RealScalar tol = numext::maxi(RealScalar(pow(0.5,size)), numext::maxi<RealScalar>(abs(absdet), abs(qr.absDeterminant())));
+  RealScalar tol =
+      numext::maxi(RealScalar(pow(0.5, size)), numext::maxi<RealScalar>(abs(absdet), abs(qr.absDeterminant())));
   VERIFY_IS_MUCH_SMALLER_THAN(abs(det - qr.determinant()), tol);
   VERIFY_IS_MUCH_SMALLER_THAN(abs(absdet - qr.absDeterminant()), tol);
 }
 
-template<typename MatrixType> void qr_verify_assert()
-{
+template <typename MatrixType>
+void qr_verify_assert() {
   MatrixType tmp;
 
   HouseholderQR<MatrixType> qr;
@@ -103,22 +105,23 @@
   VERIFY_RAISES_ASSERT(qr.logAbsDeterminant())
 }
 
-EIGEN_DECLARE_TEST(qr)
-{
-  for(int i = 0; i < g_repeat; i++) {
-   CALL_SUBTEST_1( qr(MatrixXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE),internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-   CALL_SUBTEST_2( qr(MatrixXcd(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2),internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2))) );
-   CALL_SUBTEST_3(( qr_fixedsize<Matrix<float,3,4>, 2 >() ));
-   CALL_SUBTEST_4(( qr_fixedsize<Matrix<double,6,2>, 4 >() ));
-   CALL_SUBTEST_5(( qr_fixedsize<Matrix<double,2,5>, 7 >() ));
-   CALL_SUBTEST_11( qr(Matrix<float,1,1>()) );
+EIGEN_DECLARE_TEST(qr) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(
+        qr(MatrixXf(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_2(qr(MatrixXcd(internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2),
+                                internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 2))));
+    CALL_SUBTEST_3((qr_fixedsize<Matrix<float, 3, 4>, 2>()));
+    CALL_SUBTEST_4((qr_fixedsize<Matrix<double, 6, 2>, 4>()));
+    CALL_SUBTEST_5((qr_fixedsize<Matrix<double, 2, 5>, 7>()));
+    CALL_SUBTEST_11(qr(Matrix<float, 1, 1>()));
   }
 
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( qr_invertible<MatrixXf>() );
-    CALL_SUBTEST_6( qr_invertible<MatrixXd>() );
-    CALL_SUBTEST_7( qr_invertible<MatrixXcf>() );
-    CALL_SUBTEST_8( qr_invertible<MatrixXcd>() );
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(qr_invertible<MatrixXf>());
+    CALL_SUBTEST_6(qr_invertible<MatrixXd>());
+    CALL_SUBTEST_7(qr_invertible<MatrixXcf>());
+    CALL_SUBTEST_8(qr_invertible<MatrixXcd>());
   }
 
   CALL_SUBTEST_9(qr_verify_assert<Matrix3f>());
diff --git a/test/qr_colpivoting.cpp b/test/qr_colpivoting.cpp
index b0cc000..4f8711f 100644
--- a/test/qr_colpivoting.cpp
+++ b/test/qr_colpivoting.cpp
@@ -15,16 +15,13 @@
 
 template <typename MatrixType>
 void cod() {
-
   Index rows = internal::random<Index>(2, EIGEN_TEST_MAX_SIZE);
   Index cols = internal::random<Index>(2, EIGEN_TEST_MAX_SIZE);
   Index cols2 = internal::random<Index>(2, EIGEN_TEST_MAX_SIZE);
   Index rank = internal::random<Index>(1, (std::min)(rows, cols) - 1);
 
   typedef typename MatrixType::Scalar Scalar;
-  typedef Matrix<Scalar, MatrixType::RowsAtCompileTime,
-                 MatrixType::RowsAtCompileTime>
-      MatrixQType;
+  typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> MatrixQType;
   MatrixType matrix;
   createRandomPIMatrixOfRank(rank, rows, cols, matrix);
   CompleteOrthogonalDecomposition<MatrixType> cod(matrix);
@@ -42,8 +39,7 @@
 
   MatrixType t;
   t.setZero(rows, cols);
-  t.topLeftCorner(rank, rank) =
-      cod.matrixT().topLeftCorner(rank, rank).template triangularView<Upper>();
+  t.topLeftCorner(rank, rank) = cod.matrixT().topLeftCorner(rank, rank).template triangularView<Upper>();
 
   MatrixType c = q * t * z * cod.colsPermutation().inverse();
   VERIFY_IS_APPROX(matrix, c);
@@ -64,10 +60,7 @@
 
 template <typename MatrixType, int Cols2>
 void cod_fixedsize() {
-  enum {
-    Rows = MatrixType::RowsAtCompileTime,
-    Cols = MatrixType::ColsAtCompileTime
-  };
+  enum { Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime };
   typedef typename MatrixType::Scalar Scalar;
   typedef CompleteOrthogonalDecomposition<Matrix<Scalar, Rows, Cols> > COD;
   int rank = internal::random<int>(1, (std::min)(int(Rows), int(Cols)) - 1);
@@ -95,18 +88,19 @@
   VERIFY_IS_APPROX(cod_solution, pinv * rhs);
 }
 
-template<typename MatrixType> void qr()
-{
+template <typename MatrixType>
+void qr() {
   using std::sqrt;
 
-  Index rows = internal::random<Index>(2,EIGEN_TEST_MAX_SIZE), cols = internal::random<Index>(2,EIGEN_TEST_MAX_SIZE), cols2 = internal::random<Index>(2,EIGEN_TEST_MAX_SIZE);
-  Index rank = internal::random<Index>(1, (std::min)(rows, cols)-1);
+  Index rows = internal::random<Index>(2, EIGEN_TEST_MAX_SIZE), cols = internal::random<Index>(2, EIGEN_TEST_MAX_SIZE),
+        cols2 = internal::random<Index>(2, EIGEN_TEST_MAX_SIZE);
+  Index rank = internal::random<Index>(1, (std::min)(rows, cols) - 1);
 
   typedef typename MatrixType::Scalar Scalar;
   typedef typename MatrixType::RealScalar RealScalar;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> MatrixQType;
   MatrixType m1;
-  createRandomPIMatrixOfRank(rank,rows,cols,m1);
+  createRandomPIMatrixOfRank(rank, rows, cols, m1);
   ColPivHouseholderQR<MatrixType> qr(m1);
   VERIFY_IS_EQUAL(rank, qr.rank());
   VERIFY_IS_EQUAL(cols - qr.rank(), qr.dimensionOfKernel());
@@ -123,8 +117,7 @@
 
   // Verify that the absolute value of the diagonal elements in R are
   // non-increasing until they reach the singularity threshold.
-  RealScalar threshold =
-      sqrt(RealScalar(rows)) * numext::abs(r(0, 0)) * NumTraits<Scalar>::epsilon();
+  RealScalar threshold = sqrt(RealScalar(rows)) * numext::abs(r(0, 0)) * NumTraits<Scalar>::epsilon();
   for (Index i = 0; i < (std::min)(rows, cols) - 1; ++i) {
     RealScalar x = numext::abs(r(i, i));
     RealScalar y = numext::abs(r(i + 1, i + 1));
@@ -133,8 +126,7 @@
       for (Index j = 0; j < (std::min)(rows, cols); ++j) {
         std::cout << "i = " << j << ", |r_ii| = " << numext::abs(r(j, j)) << std::endl;
       }
-      std::cout << "Failure at i=" << i << ", rank=" << rank
-                << ", threshold=" << threshold << std::endl;
+      std::cout << "Failure at i=" << i << ", rank=" << rank << ", threshold=" << threshold << std::endl;
     }
     VERIFY_IS_APPROX_OR_LESS_THAN(y, x);
   }
@@ -145,43 +137,42 @@
     MatrixType m2, m3;
     Index size = rows;
     do {
-      m1 = MatrixType::Random(size,size);
+      m1 = MatrixType::Random(size, size);
       qr.compute(m1);
-    } while(!qr.isInvertible());
+    } while (!qr.isInvertible());
     MatrixType m1_inv = qr.inverse();
-    m3 = m1 * MatrixType::Random(size,cols2);
+    m3 = m1 * MatrixType::Random(size, cols2);
     m2 = qr.solve(m3);
-    VERIFY_IS_APPROX(m2, m1_inv*m3);
+    VERIFY_IS_APPROX(m2, m1_inv * m3);
   }
 }
 
-template<typename MatrixType, int Cols2> void qr_fixedsize()
-{
-  using std::sqrt;
+template <typename MatrixType, int Cols2>
+void qr_fixedsize() {
   using std::abs;
+  using std::sqrt;
   enum { Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime };
   typedef typename MatrixType::Scalar Scalar;
   typedef typename MatrixType::RealScalar RealScalar;
-  int rank = internal::random<int>(1, (std::min)(int(Rows), int(Cols))-1);
-  Matrix<Scalar,Rows,Cols> m1;
-  createRandomPIMatrixOfRank(rank,Rows,Cols,m1);
-  ColPivHouseholderQR<Matrix<Scalar,Rows,Cols> > qr(m1);
+  int rank = internal::random<int>(1, (std::min)(int(Rows), int(Cols)) - 1);
+  Matrix<Scalar, Rows, Cols> m1;
+  createRandomPIMatrixOfRank(rank, Rows, Cols, m1);
+  ColPivHouseholderQR<Matrix<Scalar, Rows, Cols> > qr(m1);
   VERIFY_IS_EQUAL(rank, qr.rank());
   VERIFY_IS_EQUAL(Cols - qr.rank(), qr.dimensionOfKernel());
   VERIFY_IS_EQUAL(qr.isInjective(), (rank == Rows));
   VERIFY_IS_EQUAL(qr.isSurjective(), (rank == Cols));
   VERIFY_IS_EQUAL(qr.isInvertible(), (qr.isInjective() && qr.isSurjective()));
 
-  Matrix<Scalar,Rows,Cols> r = qr.matrixQR().template triangularView<Upper>();
-  Matrix<Scalar,Rows,Cols> c = qr.householderQ() * r * qr.colsPermutation().inverse();
+  Matrix<Scalar, Rows, Cols> r = qr.matrixQR().template triangularView<Upper>();
+  Matrix<Scalar, Rows, Cols> c = qr.householderQ() * r * qr.colsPermutation().inverse();
   VERIFY_IS_APPROX(m1, c);
 
-  check_solverbase<Matrix<Scalar,Cols,Cols2>, Matrix<Scalar,Rows,Cols2> >(m1, qr, Rows, Cols, Cols2);
+  check_solverbase<Matrix<Scalar, Cols, Cols2>, Matrix<Scalar, Rows, Cols2> >(m1, qr, Rows, Cols, Cols2);
 
   // Verify that the absolute value of the diagonal elements in R are
   // non-increasing until they reache the singularity threshold.
-  RealScalar threshold =
-      sqrt(RealScalar(Rows)) * (std::abs)(r(0, 0)) * NumTraits<Scalar>::epsilon();
+  RealScalar threshold = sqrt(RealScalar(Rows)) * (std::abs)(r(0, 0)) * NumTraits<Scalar>::epsilon();
   for (Index i = 0; i < (std::min)(int(Rows), int(Cols)) - 1; ++i) {
     RealScalar x = numext::abs(r(i, i));
     RealScalar y = numext::abs(r(i + 1, i + 1));
@@ -190,8 +181,7 @@
       for (Index j = 0; j < (std::min)(int(Rows), int(Cols)); ++j) {
         std::cout << "i = " << j << ", |r_ii| = " << numext::abs(r(j, j)) << std::endl;
       }
-      std::cout << "Failure at i=" << i << ", rank=" << rank
-                << ", threshold=" << threshold << std::endl;
+      std::cout << "Failure at i=" << i << ", rank=" << rank << ", threshold=" << threshold << std::endl;
     }
     VERIFY_IS_APPROX_OR_LESS_THAN(y, x);
   }
@@ -204,20 +194,20 @@
 // for rank-revealing QR. See
 // http://www.netlib.org/lapack/lawnspdf/lawn176.pdf
 // page 3 for more detail.
-template<typename MatrixType> void qr_kahan_matrix()
-{
-  using std::sqrt;
+template <typename MatrixType>
+void qr_kahan_matrix() {
   using std::abs;
+  using std::sqrt;
   typedef typename MatrixType::Scalar Scalar;
   typedef typename MatrixType::RealScalar RealScalar;
 
   Index rows = 300, cols = rows;
 
   MatrixType m1;
-  m1.setZero(rows,cols);
+  m1.setZero(rows, cols);
   RealScalar s = std::pow(NumTraits<RealScalar>::epsilon(), 1.0 / rows);
-  RealScalar c = std::sqrt(1 - s*s);
-  RealScalar pow_s_i(1.0); // pow(s,i)
+  RealScalar c = std::sqrt(1 - s * s);
+  RealScalar pow_s_i(1.0);  // pow(s,i)
   for (Index i = 0; i < rows; ++i) {
     m1(i, i) = pow_s_i;
     m1.row(i).tail(rows - i - 1) = -pow_s_i * c * MatrixType::Ones(1, rows - i - 1);
@@ -227,8 +217,7 @@
   ColPivHouseholderQR<MatrixType> qr(m1);
   MatrixType r = qr.matrixQR().template triangularView<Upper>();
 
-  RealScalar threshold =
-      std::sqrt(RealScalar(rows)) * numext::abs(r(0, 0)) * NumTraits<Scalar>::epsilon();
+  RealScalar threshold = std::sqrt(RealScalar(rows)) * numext::abs(r(0, 0)) * NumTraits<Scalar>::epsilon();
   for (Index i = 0; i < (std::min)(rows, cols) - 1; ++i) {
     RealScalar x = numext::abs(r(i, i));
     RealScalar y = numext::abs(r(i + 1, i + 1));
@@ -237,29 +226,27 @@
       for (Index j = 0; j < (std::min)(rows, cols); ++j) {
         std::cout << "i = " << j << ", |r_ii| = " << numext::abs(r(j, j)) << std::endl;
       }
-      std::cout << "Failure at i=" << i << ", rank=" << qr.rank()
-                << ", threshold=" << threshold << std::endl;
+      std::cout << "Failure at i=" << i << ", rank=" << qr.rank() << ", threshold=" << threshold << std::endl;
     }
     VERIFY_IS_APPROX_OR_LESS_THAN(y, x);
   }
 }
 
-template<typename MatrixType> void qr_invertible()
-{
-  using std::log;
+template <typename MatrixType>
+void qr_invertible() {
   using std::abs;
+  using std::log;
   typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar;
   typedef typename MatrixType::Scalar Scalar;
 
-  int size = internal::random<int>(10,50);
+  int size = internal::random<int>(10, 50);
 
   MatrixType m1(size, size), m2(size, size), m3(size, size);
-  m1 = MatrixType::Random(size,size);
+  m1 = MatrixType::Random(size, size);
 
-  if (internal::is_same<RealScalar,float>::value)
-  {
+  if (internal::is_same<RealScalar, float>::value) {
     // let's build a matrix more stable to inverse
-    MatrixType a = MatrixType::Random(size,size*2);
+    MatrixType a = MatrixType::Random(size, size * 2);
     m1 += a * a.adjoint();
   }
 
@@ -269,10 +256,10 @@
 
   // now construct a matrix with prescribed determinant
   m1.setZero();
-  for(int i = 0; i < size; i++) m1(i,i) = internal::random<Scalar>();
+  for (int i = 0; i < size; i++) m1(i, i) = internal::random<Scalar>();
   Scalar det = m1.diagonal().prod();
   RealScalar absdet = abs(det);
-  m3 = qr.householderQ(); // get a unitary
+  m3 = qr.householderQ();  // get a unitary
   m1 = m3 * m1 * m3.adjoint();
   qr.compute(m1);
   VERIFY_IS_APPROX(det, qr.determinant());
@@ -280,8 +267,8 @@
   VERIFY_IS_APPROX(log(absdet), qr.logAbsDeterminant());
 }
 
-template<typename MatrixType> void qr_verify_assert()
-{
+template <typename MatrixType>
+void qr_verify_assert() {
   MatrixType tmp;
 
   ColPivHouseholderQR<MatrixType> qr;
@@ -300,8 +287,8 @@
   VERIFY_RAISES_ASSERT(qr.logAbsDeterminant())
 }
 
-template<typename MatrixType> void cod_verify_assert()
-{
+template <typename MatrixType>
+void cod_verify_assert() {
   MatrixType tmp;
 
   CompleteOrthogonalDecomposition<MatrixType> cod;
@@ -320,31 +307,30 @@
   VERIFY_RAISES_ASSERT(cod.logAbsDeterminant())
 }
 
-EIGEN_DECLARE_TEST(qr_colpivoting)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( qr<MatrixXf>() );
-    CALL_SUBTEST_2( qr<MatrixXd>() );
-    CALL_SUBTEST_3( qr<MatrixXcd>() );
-    CALL_SUBTEST_4(( qr_fixedsize<Matrix<float,3,5>, 4 >() ));
-    CALL_SUBTEST_5(( qr_fixedsize<Matrix<double,6,2>, 3 >() ));
-    CALL_SUBTEST_5(( qr_fixedsize<Matrix<double,1,1>, 1 >() ));
+EIGEN_DECLARE_TEST(qr_colpivoting) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(qr<MatrixXf>());
+    CALL_SUBTEST_2(qr<MatrixXd>());
+    CALL_SUBTEST_3(qr<MatrixXcd>());
+    CALL_SUBTEST_4((qr_fixedsize<Matrix<float, 3, 5>, 4>()));
+    CALL_SUBTEST_5((qr_fixedsize<Matrix<double, 6, 2>, 3>()));
+    CALL_SUBTEST_5((qr_fixedsize<Matrix<double, 1, 1>, 1>()));
   }
 
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( cod<MatrixXf>() );
-    CALL_SUBTEST_2( cod<MatrixXd>() );
-    CALL_SUBTEST_3( cod<MatrixXcd>() );
-    CALL_SUBTEST_4(( cod_fixedsize<Matrix<float,3,5>, 4 >() ));
-    CALL_SUBTEST_5(( cod_fixedsize<Matrix<double,6,2>, 3 >() ));
-    CALL_SUBTEST_5(( cod_fixedsize<Matrix<double,1,1>, 1 >() ));
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(cod<MatrixXf>());
+    CALL_SUBTEST_2(cod<MatrixXd>());
+    CALL_SUBTEST_3(cod<MatrixXcd>());
+    CALL_SUBTEST_4((cod_fixedsize<Matrix<float, 3, 5>, 4>()));
+    CALL_SUBTEST_5((cod_fixedsize<Matrix<double, 6, 2>, 3>()));
+    CALL_SUBTEST_5((cod_fixedsize<Matrix<double, 1, 1>, 1>()));
   }
 
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( qr_invertible<MatrixXf>() );
-    CALL_SUBTEST_2( qr_invertible<MatrixXd>() );
-    CALL_SUBTEST_6( qr_invertible<MatrixXcf>() );
-    CALL_SUBTEST_3( qr_invertible<MatrixXcd>() );
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(qr_invertible<MatrixXf>());
+    CALL_SUBTEST_2(qr_invertible<MatrixXd>());
+    CALL_SUBTEST_6(qr_invertible<MatrixXcf>());
+    CALL_SUBTEST_3(qr_invertible<MatrixXcd>());
   }
 
   CALL_SUBTEST_7(qr_verify_assert<Matrix3f>());
@@ -364,6 +350,6 @@
   // Test problem size constructors
   CALL_SUBTEST_9(ColPivHouseholderQR<MatrixXf>(10, 20));
 
-  CALL_SUBTEST_1( qr_kahan_matrix<MatrixXf>() );
-  CALL_SUBTEST_2( qr_kahan_matrix<MatrixXd>() );
+  CALL_SUBTEST_1(qr_kahan_matrix<MatrixXf>());
+  CALL_SUBTEST_2(qr_kahan_matrix<MatrixXd>());
 }
diff --git a/test/qr_fullpivoting.cpp b/test/qr_fullpivoting.cpp
index bd40881..71f3a51 100644
--- a/test/qr_fullpivoting.cpp
+++ b/test/qr_fullpivoting.cpp
@@ -12,21 +12,20 @@
 #include <Eigen/QR>
 #include "solverbase.h"
 
-template<typename MatrixType> void qr()
-{
-
+template <typename MatrixType>
+void qr() {
   static const int Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime;
   Index max_size = EIGEN_TEST_MAX_SIZE;
-  Index min_size = numext::maxi(1,EIGEN_TEST_MAX_SIZE/10);
-  Index rows  = Rows == Dynamic ? internal::random<Index>(min_size,max_size) : Rows,
-        cols  = Cols == Dynamic ? internal::random<Index>(min_size,max_size) : Cols,
-        cols2 = Cols == Dynamic ? internal::random<Index>(min_size,max_size) : Cols,
-        rank  = internal::random<Index>(1, (std::min)(rows, cols)-1);
+  Index min_size = numext::maxi(1, EIGEN_TEST_MAX_SIZE / 10);
+  Index rows = Rows == Dynamic ? internal::random<Index>(min_size, max_size) : Rows,
+        cols = Cols == Dynamic ? internal::random<Index>(min_size, max_size) : Cols,
+        cols2 = Cols == Dynamic ? internal::random<Index>(min_size, max_size) : Cols,
+        rank = internal::random<Index>(1, (std::min)(rows, cols) - 1);
 
   typedef typename MatrixType::Scalar Scalar;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> MatrixQType;
   MatrixType m1;
-  createRandomPIMatrixOfRank(rank,rows,cols,m1);
+  createRandomPIMatrixOfRank(rank, rows, cols, m1);
   FullPivHouseholderQR<MatrixType> qr(m1);
   VERIFY_IS_EQUAL(rank, qr.rank());
   VERIFY_IS_EQUAL(cols - qr.rank(), qr.dimensionOfKernel());
@@ -35,55 +34,56 @@
   VERIFY(!qr.isSurjective());
 
   MatrixType r = qr.matrixQR();
-  
+
   MatrixQType q = qr.matrixQ();
   VERIFY_IS_UNITARY(q);
-  
+
   // FIXME need better way to construct trapezoid
-  for(int i = 0; i < rows; i++) for(int j = 0; j < cols; j++) if(i>j) r(i,j) = Scalar(0);
+  for (int i = 0; i < rows; i++)
+    for (int j = 0; j < cols; j++)
+      if (i > j) r(i, j) = Scalar(0);
 
   MatrixType c = qr.matrixQ() * r * qr.colsPermutation().inverse();
 
   VERIFY_IS_APPROX(m1, c);
-  
+
   // stress the ReturnByValue mechanism
   MatrixType tmp;
   VERIFY_IS_APPROX(tmp.noalias() = qr.matrixQ() * r, (qr.matrixQ() * r).eval());
-  
+
   check_solverbase<MatrixType, MatrixType>(m1, qr, rows, cols, cols2);
 
   {
     MatrixType m2, m3;
     Index size = rows;
     do {
-      m1 = MatrixType::Random(size,size);
+      m1 = MatrixType::Random(size, size);
       qr.compute(m1);
-    } while(!qr.isInvertible());
+    } while (!qr.isInvertible());
     MatrixType m1_inv = qr.inverse();
-    m3 = m1 * MatrixType::Random(size,cols2);
+    m3 = m1 * MatrixType::Random(size, cols2);
     m2 = qr.solve(m3);
-    VERIFY_IS_APPROX(m2, m1_inv*m3);
+    VERIFY_IS_APPROX(m2, m1_inv * m3);
   }
 }
 
-template<typename MatrixType> void qr_invertible()
-{
-  using std::log;
+template <typename MatrixType>
+void qr_invertible() {
   using std::abs;
+  using std::log;
   typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar;
   typedef typename MatrixType::Scalar Scalar;
 
-  Index max_size = numext::mini(50,EIGEN_TEST_MAX_SIZE);
-  Index min_size = numext::maxi(1,EIGEN_TEST_MAX_SIZE/10);
-  Index size = internal::random<Index>(min_size,max_size);
+  Index max_size = numext::mini(50, EIGEN_TEST_MAX_SIZE);
+  Index min_size = numext::maxi(1, EIGEN_TEST_MAX_SIZE / 10);
+  Index size = internal::random<Index>(min_size, max_size);
 
   MatrixType m1(size, size), m2(size, size), m3(size, size);
-  m1 = MatrixType::Random(size,size);
+  m1 = MatrixType::Random(size, size);
 
-  if (internal::is_same<RealScalar,float>::value)
-  {
+  if (internal::is_same<RealScalar, float>::value) {
     // let's build a matrix more stable to inverse
-    MatrixType a = MatrixType::Random(size,size*2);
+    MatrixType a = MatrixType::Random(size, size * 2);
     m1 += a * a.adjoint();
   }
 
@@ -96,10 +96,10 @@
 
   // now construct a matrix with prescribed determinant
   m1.setZero();
-  for(int i = 0; i < size; i++) m1(i,i) = internal::random<Scalar>();
+  for (int i = 0; i < size; i++) m1(i, i) = internal::random<Scalar>();
   Scalar det = m1.diagonal().prod();
   RealScalar absdet = abs(det);
-  m3 = qr.matrixQ(); // get a unitary
+  m3 = qr.matrixQ();  // get a unitary
   m1 = m3 * m1 * m3.adjoint();
   qr.compute(m1);
   VERIFY_IS_APPROX(det, qr.determinant());
@@ -107,8 +107,8 @@
   VERIFY_IS_APPROX(log(absdet), qr.logAbsDeterminant());
 }
 
-template<typename MatrixType> void qr_verify_assert()
-{
+template <typename MatrixType>
+void qr_verify_assert() {
   MatrixType tmp;
 
   FullPivHouseholderQR<MatrixType> qr;
@@ -127,22 +127,21 @@
   VERIFY_RAISES_ASSERT(qr.logAbsDeterminant())
 }
 
-EIGEN_DECLARE_TEST(qr_fullpivoting)
-{
-  for(int i = 0; i < 1; i++) {
-    CALL_SUBTEST_5( qr<Matrix3f>() );
-    CALL_SUBTEST_6( qr<Matrix3d>() );
-    CALL_SUBTEST_8( qr<Matrix2f>() );
-    CALL_SUBTEST_1( qr<MatrixXf>() );
-    CALL_SUBTEST_2( qr<MatrixXd>() );
-    CALL_SUBTEST_3( qr<MatrixXcd>() );
+EIGEN_DECLARE_TEST(qr_fullpivoting) {
+  for (int i = 0; i < 1; i++) {
+    CALL_SUBTEST_5(qr<Matrix3f>());
+    CALL_SUBTEST_6(qr<Matrix3d>());
+    CALL_SUBTEST_8(qr<Matrix2f>());
+    CALL_SUBTEST_1(qr<MatrixXf>());
+    CALL_SUBTEST_2(qr<MatrixXd>());
+    CALL_SUBTEST_3(qr<MatrixXcd>());
   }
 
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( qr_invertible<MatrixXf>() );
-    CALL_SUBTEST_2( qr_invertible<MatrixXd>() );
-    CALL_SUBTEST_4( qr_invertible<MatrixXcf>() );
-    CALL_SUBTEST_3( qr_invertible<MatrixXcd>() );
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(qr_invertible<MatrixXf>());
+    CALL_SUBTEST_2(qr_invertible<MatrixXd>());
+    CALL_SUBTEST_4(qr_invertible<MatrixXcf>());
+    CALL_SUBTEST_3(qr_invertible<MatrixXcd>());
   }
 
   CALL_SUBTEST_5(qr_verify_assert<Matrix3f>());
@@ -154,8 +153,8 @@
 
   // Test problem size constructors
   CALL_SUBTEST_7(FullPivHouseholderQR<MatrixXf>(10, 20));
-  CALL_SUBTEST_7((FullPivHouseholderQR<Matrix<float,10,20> >(10,20)));
-  CALL_SUBTEST_7((FullPivHouseholderQR<Matrix<float,10,20> >(Matrix<float,10,20>::Random())));
-  CALL_SUBTEST_7((FullPivHouseholderQR<Matrix<float,20,10> >(20,10)));
-  CALL_SUBTEST_7((FullPivHouseholderQR<Matrix<float,20,10> >(Matrix<float,20,10>::Random())));
+  CALL_SUBTEST_7((FullPivHouseholderQR<Matrix<float, 10, 20> >(10, 20)));
+  CALL_SUBTEST_7((FullPivHouseholderQR<Matrix<float, 10, 20> >(Matrix<float, 10, 20>::Random())));
+  CALL_SUBTEST_7((FullPivHouseholderQR<Matrix<float, 20, 10> >(20, 10)));
+  CALL_SUBTEST_7((FullPivHouseholderQR<Matrix<float, 20, 10> >(Matrix<float, 20, 10>::Random())));
 }
diff --git a/test/qtvector.cpp b/test/qtvector.cpp
index 4ec79b1..0f2d907 100644
--- a/test/qtvector.cpp
+++ b/test/qtvector.cpp
@@ -15,49 +15,43 @@
 #include <Eigen/Geometry>
 #include <Eigen/QtAlignedMalloc>
 
-template<typename MatrixType>
-void check_qtvector_matrix(const MatrixType& m)
-{
+template <typename MatrixType>
+void check_qtvector_matrix(const MatrixType& m) {
   Index rows = m.rows();
   Index cols = m.cols();
-  MatrixType x = MatrixType::Random(rows,cols), y = MatrixType::Random(rows,cols);
-  QVector<MatrixType> v(10, MatrixType(rows,cols)), w(20, y);
-  for(int i = 0; i < 20; i++)
-  {
+  MatrixType x = MatrixType::Random(rows, cols), y = MatrixType::Random(rows, cols);
+  QVector<MatrixType> v(10, MatrixType(rows, cols)), w(20, y);
+  for (int i = 0; i < 20; i++) {
     VERIFY_IS_APPROX(w[i], y);
   }
   v[5] = x;
   w[6] = v[5];
   VERIFY_IS_APPROX(w[6], v[5]);
   v = w;
-  for(int i = 0; i < 20; i++)
-  {
+  for (int i = 0; i < 20; i++) {
     VERIFY_IS_APPROX(w[i], v[i]);
   }
 
   v.resize(21);
   v[20] = x;
   VERIFY_IS_APPROX(v[20], x);
-  v.fill(y,22);
+  v.fill(y, 22);
   VERIFY_IS_APPROX(v[21], y);
   v.push_back(x);
   VERIFY_IS_APPROX(v[22], x);
-  VERIFY((size_t)&(v[22]) == (size_t)&(v[21]) + sizeof(MatrixType));
+  VERIFY((size_t) & (v[22]) == (size_t) & (v[21]) + sizeof(MatrixType));
 
   // do a lot of push_back such that the vector gets internally resized
   // (with memory reallocation)
   MatrixType* ref = &w[0];
-  for(int i=0; i<30 || ((ref==&w[0]) && i<300); ++i)
-    v.push_back(w[i%w.size()]);
-  for(int i=23; i<v.size(); ++i)
-  {
-    VERIFY(v[i]==w[(i-23)%w.size()]);
+  for (int i = 0; i < 30 || ((ref == &w[0]) && i < 300); ++i) v.push_back(w[i % w.size()]);
+  for (int i = 23; i < v.size(); ++i) {
+    VERIFY(v[i] == w[(i - 23) % w.size()]);
   }
 }
 
-template<typename TransformType>
-void check_qtvector_transform(const TransformType&)
-{
+template <typename TransformType>
+void check_qtvector_transform(const TransformType&) {
   typedef typename TransformType::MatrixType MatrixType;
   TransformType x(MatrixType::Random()), y(MatrixType::Random());
   QVector<TransformType> v(10), w(20, y);
@@ -65,34 +59,30 @@
   w[6] = v[5];
   VERIFY_IS_APPROX(w[6], v[5]);
   v = w;
-  for(int i = 0; i < 20; i++)
-  {
+  for (int i = 0; i < 20; i++) {
     VERIFY_IS_APPROX(w[i], v[i]);
   }
 
   v.resize(21);
   v[20] = x;
   VERIFY_IS_APPROX(v[20], x);
-  v.fill(y,22);
+  v.fill(y, 22);
   VERIFY_IS_APPROX(v[21], y);
   v.push_back(x);
   VERIFY_IS_APPROX(v[22], x);
-  VERIFY((size_t)&(v[22]) == (size_t)&(v[21]) + sizeof(TransformType));
+  VERIFY((size_t) & (v[22]) == (size_t) & (v[21]) + sizeof(TransformType));
 
   // do a lot of push_back such that the vector gets internally resized
   // (with memory reallocation)
   TransformType* ref = &w[0];
-  for(int i=0; i<30 || ((ref==&w[0]) && i<300); ++i)
-    v.push_back(w[i%w.size()]);
-  for(unsigned int i=23; int(i)<v.size(); ++i)
-  {
-    VERIFY(v[i].matrix()==w[(i-23)%w.size()].matrix());
+  for (int i = 0; i < 30 || ((ref == &w[0]) && i < 300); ++i) v.push_back(w[i % w.size()]);
+  for (unsigned int i = 23; int(i) < v.size(); ++i) {
+    VERIFY(v[i].matrix() == w[(i - 23) % w.size()].matrix());
   }
 }
 
-template<typename QuaternionType>
-void check_qtvector_quaternion(const QuaternionType&)
-{
+template <typename QuaternionType>
+void check_qtvector_quaternion(const QuaternionType&) {
   typedef typename QuaternionType::Coefficients Coefficients;
   QuaternionType x(Coefficients::Random()), y(Coefficients::Random());
   QVector<QuaternionType> v(10), w(20, y);
@@ -100,33 +90,29 @@
   w[6] = v[5];
   VERIFY_IS_APPROX(w[6], v[5]);
   v = w;
-  for(int i = 0; i < 20; i++)
-  {
+  for (int i = 0; i < 20; i++) {
     VERIFY_IS_APPROX(w[i], v[i]);
   }
 
   v.resize(21);
   v[20] = x;
   VERIFY_IS_APPROX(v[20], x);
-  v.fill(y,22);
+  v.fill(y, 22);
   VERIFY_IS_APPROX(v[21], y);
   v.push_back(x);
   VERIFY_IS_APPROX(v[22], x);
-  VERIFY((size_t)&(v[22]) == (size_t)&(v[21]) + sizeof(QuaternionType));
+  VERIFY((size_t) & (v[22]) == (size_t) & (v[21]) + sizeof(QuaternionType));
 
   // do a lot of push_back such that the vector gets internally resized
   // (with memory reallocation)
   QuaternionType* ref = &w[0];
-  for(int i=0; i<30 || ((ref==&w[0]) && i<300); ++i)
-    v.push_back(w[i%w.size()]);
-  for(unsigned int i=23; int(i)<v.size(); ++i)
-  {
-    VERIFY(v[i].coeffs()==w[(i-23)%w.size()].coeffs());
+  for (int i = 0; i < 30 || ((ref == &w[0]) && i < 300); ++i) v.push_back(w[i % w.size()]);
+  for (unsigned int i = 23; int(i) < v.size(); ++i) {
+    VERIFY(v[i].coeffs() == w[(i - 23) % w.size()].coeffs());
   }
 }
 
-EIGEN_DECLARE_TEST(qtvector)
-{
+EIGEN_DECLARE_TEST(qtvector) {
   // some non vectorizable fixed sizes
   CALL_SUBTEST(check_qtvector_matrix(Vector2f()));
   CALL_SUBTEST(check_qtvector_matrix(Matrix3f()));
@@ -139,16 +125,16 @@
   CALL_SUBTEST(check_qtvector_matrix(Matrix4d()));
 
   // some dynamic sizes
-  CALL_SUBTEST(check_qtvector_matrix(MatrixXd(1,1)));
+  CALL_SUBTEST(check_qtvector_matrix(MatrixXd(1, 1)));
   CALL_SUBTEST(check_qtvector_matrix(VectorXd(20)));
   CALL_SUBTEST(check_qtvector_matrix(RowVectorXf(20)));
-  CALL_SUBTEST(check_qtvector_matrix(MatrixXcf(10,10)));
+  CALL_SUBTEST(check_qtvector_matrix(MatrixXcf(10, 10)));
 
   // some Transform
   CALL_SUBTEST(check_qtvector_transform(Affine2f()));
   CALL_SUBTEST(check_qtvector_transform(Affine3f()));
   CALL_SUBTEST(check_qtvector_transform(Affine3d()));
-  //CALL_SUBTEST(check_qtvector_transform(Transform4d()));
+  // CALL_SUBTEST(check_qtvector_transform(Transform4d()));
 
   // some Quaternion
   CALL_SUBTEST(check_qtvector_quaternion(Quaternionf()));
diff --git a/test/rand.cpp b/test/rand.cpp
index 4d686bf..2b193ff 100644
--- a/test/rand.cpp
+++ b/test/rand.cpp
@@ -11,109 +11,105 @@
 
 typedef long long int64;
 
-template<typename Scalar> Scalar check_in_range(Scalar x, Scalar y)
-{
-  Scalar r = internal::random<Scalar>(x,y);
-  VERIFY(r>=x);
-  if(y>=x)
-  {
-    VERIFY(r<=y);
+template <typename Scalar>
+Scalar check_in_range(Scalar x, Scalar y) {
+  Scalar r = internal::random<Scalar>(x, y);
+  VERIFY(r >= x);
+  if (y >= x) {
+    VERIFY(r <= y);
   }
   return r;
 }
 
-template<typename Scalar> void check_all_in_range(Scalar x, Scalar y)
-{
-  Array<int,1,Dynamic> mask(y-x+1);
+template <typename Scalar>
+void check_all_in_range(Scalar x, Scalar y) {
+  Array<int, 1, Dynamic> mask(y - x + 1);
   mask.fill(0);
-  long n = (y-x+1)*32;
-  for(long k=0; k<n; ++k)
-  {
-    mask( check_in_range(x,y)-x )++;
+  long n = (y - x + 1) * 32;
+  for (long k = 0; k < n; ++k) {
+    mask(check_in_range(x, y) - x)++;
   }
-  for(Index i=0; i<mask.size(); ++i)
-    if(mask(i)==0)
-      std::cout << "WARNING: value " << x+i << " not reached." << std::endl;
-  VERIFY( (mask>0).all() );
+  for (Index i = 0; i < mask.size(); ++i)
+    if (mask(i) == 0) std::cout << "WARNING: value " << x + i << " not reached." << std::endl;
+  VERIFY((mask > 0).all());
 }
 
-template<typename Scalar> void check_histogram(Scalar x, Scalar y, int bins)
-{
-  Array<int,1,Dynamic> hist(bins);
+template <typename Scalar>
+void check_histogram(Scalar x, Scalar y, int bins) {
+  Array<int, 1, Dynamic> hist(bins);
   hist.fill(0);
   int f = 100000;
-  int n = bins*f;
-  int64 range = int64(y)-int64(x);
-  int divisor = int((range+1)/bins);
-  assert(((range+1)%bins)==0);
-  for(int k=0; k<n; ++k)
-  {
-    Scalar r = check_in_range(x,y);
-    hist( int((int64(r)-int64(x))/divisor) )++;
+  int n = bins * f;
+  int64 range = int64(y) - int64(x);
+  int divisor = int((range + 1) / bins);
+  assert(((range + 1) % bins) == 0);
+  for (int k = 0; k < n; ++k) {
+    Scalar r = check_in_range(x, y);
+    hist(int((int64(r) - int64(x)) / divisor))++;
   }
-  VERIFY( (((hist.cast<double>()/double(f))-1.0).abs()<0.03).all() );
+  VERIFY((((hist.cast<double>() / double(f)) - 1.0).abs() < 0.03).all());
 }
 
-EIGEN_DECLARE_TEST(rand)
-{
-  long long_ref = NumTraits<long>::highest()/10;
+EIGEN_DECLARE_TEST(rand) {
+  long long_ref = NumTraits<long>::highest() / 10;
   // the minimum guarantees that these conversions are safe
   auto char_offset = static_cast<signed char>((std::min)(g_repeat, 64));
   auto short_offset = static_cast<signed short>((std::min)(g_repeat, 8000));
 
-  for(int i = 0; i < g_repeat*10000; i++) {
-    CALL_SUBTEST(check_in_range<float>(10,11));
-    CALL_SUBTEST(check_in_range<float>(1.24234523f,1.24234523f));
-    CALL_SUBTEST(check_in_range<float>(-1,1));
-    CALL_SUBTEST(check_in_range<float>(-1432.2352f,-1432.2352f));
+  for (int i = 0; i < g_repeat * 10000; i++) {
+    CALL_SUBTEST(check_in_range<float>(10, 11));
+    CALL_SUBTEST(check_in_range<float>(1.24234523f, 1.24234523f));
+    CALL_SUBTEST(check_in_range<float>(-1, 1));
+    CALL_SUBTEST(check_in_range<float>(-1432.2352f, -1432.2352f));
 
-    CALL_SUBTEST(check_in_range<double>(10,11));
-    CALL_SUBTEST(check_in_range<double>(1.24234523,1.24234523));
-    CALL_SUBTEST(check_in_range<double>(-1,1));
-    CALL_SUBTEST(check_in_range<double>(-1432.2352,-1432.2352));
+    CALL_SUBTEST(check_in_range<double>(10, 11));
+    CALL_SUBTEST(check_in_range<double>(1.24234523, 1.24234523));
+    CALL_SUBTEST(check_in_range<double>(-1, 1));
+    CALL_SUBTEST(check_in_range<double>(-1432.2352, -1432.2352));
 
-    CALL_SUBTEST(check_in_range<int>(0,-1));
-    CALL_SUBTEST(check_in_range<short>(0,-1));
-    CALL_SUBTEST(check_in_range<long>(0,-1));
-    CALL_SUBTEST(check_in_range<int>(-673456,673456));
-    CALL_SUBTEST(check_in_range<int>(-RAND_MAX+10,RAND_MAX-10));
-    CALL_SUBTEST(check_in_range<short>(-24345,24345));
-    CALL_SUBTEST(check_in_range<long>(-long_ref,long_ref));
+    CALL_SUBTEST(check_in_range<int>(0, -1));
+    CALL_SUBTEST(check_in_range<short>(0, -1));
+    CALL_SUBTEST(check_in_range<long>(0, -1));
+    CALL_SUBTEST(check_in_range<int>(-673456, 673456));
+    CALL_SUBTEST(check_in_range<int>(-RAND_MAX + 10, RAND_MAX - 10));
+    CALL_SUBTEST(check_in_range<short>(-24345, 24345));
+    CALL_SUBTEST(check_in_range<long>(-long_ref, long_ref));
   }
 
-  CALL_SUBTEST(check_all_in_range<signed char>(11,11));
-  CALL_SUBTEST(check_all_in_range<signed char>(11,11+char_offset));
-  CALL_SUBTEST(check_all_in_range<signed char>(-5,5));
-  CALL_SUBTEST(check_all_in_range<signed char>(-11-char_offset,-11));
-  CALL_SUBTEST(check_all_in_range<signed char>(-126,-126+char_offset));
-  CALL_SUBTEST(check_all_in_range<signed char>(126-char_offset,126));
-  CALL_SUBTEST(check_all_in_range<signed char>(-126,126));
+  CALL_SUBTEST(check_all_in_range<signed char>(11, 11));
+  CALL_SUBTEST(check_all_in_range<signed char>(11, 11 + char_offset));
+  CALL_SUBTEST(check_all_in_range<signed char>(-5, 5));
+  CALL_SUBTEST(check_all_in_range<signed char>(-11 - char_offset, -11));
+  CALL_SUBTEST(check_all_in_range<signed char>(-126, -126 + char_offset));
+  CALL_SUBTEST(check_all_in_range<signed char>(126 - char_offset, 126));
+  CALL_SUBTEST(check_all_in_range<signed char>(-126, 126));
 
-  CALL_SUBTEST(check_all_in_range<short>(11,11));
-  CALL_SUBTEST(check_all_in_range<short>(11,11+short_offset));
-  CALL_SUBTEST(check_all_in_range<short>(-5,5));
-  CALL_SUBTEST(check_all_in_range<short>(-11-short_offset,-11));
-  CALL_SUBTEST(check_all_in_range<short>(-24345,-24345+short_offset));
-  CALL_SUBTEST(check_all_in_range<short>(24345,24345+short_offset));
+  CALL_SUBTEST(check_all_in_range<short>(11, 11));
+  CALL_SUBTEST(check_all_in_range<short>(11, 11 + short_offset));
+  CALL_SUBTEST(check_all_in_range<short>(-5, 5));
+  CALL_SUBTEST(check_all_in_range<short>(-11 - short_offset, -11));
+  CALL_SUBTEST(check_all_in_range<short>(-24345, -24345 + short_offset));
+  CALL_SUBTEST(check_all_in_range<short>(24345, 24345 + short_offset));
 
-  CALL_SUBTEST(check_all_in_range<int>(11,11));
-  CALL_SUBTEST(check_all_in_range<int>(11,11+g_repeat));
-  CALL_SUBTEST(check_all_in_range<int>(-5,5));
-  CALL_SUBTEST(check_all_in_range<int>(-11-g_repeat,-11));
-  CALL_SUBTEST(check_all_in_range<int>(-673456,-673456+g_repeat));
-  CALL_SUBTEST(check_all_in_range<int>(673456,673456+g_repeat));
+  CALL_SUBTEST(check_all_in_range<int>(11, 11));
+  CALL_SUBTEST(check_all_in_range<int>(11, 11 + g_repeat));
+  CALL_SUBTEST(check_all_in_range<int>(-5, 5));
+  CALL_SUBTEST(check_all_in_range<int>(-11 - g_repeat, -11));
+  CALL_SUBTEST(check_all_in_range<int>(-673456, -673456 + g_repeat));
+  CALL_SUBTEST(check_all_in_range<int>(673456, 673456 + g_repeat));
 
-  CALL_SUBTEST(check_all_in_range<long>(11,11));
-  CALL_SUBTEST(check_all_in_range<long>(11,11+g_repeat));
-  CALL_SUBTEST(check_all_in_range<long>(-5,5));
-  CALL_SUBTEST(check_all_in_range<long>(-11-g_repeat,-11));
-  CALL_SUBTEST(check_all_in_range<long>(-long_ref,-long_ref+g_repeat));
-  CALL_SUBTEST(check_all_in_range<long>( long_ref, long_ref+g_repeat));
+  CALL_SUBTEST(check_all_in_range<long>(11, 11));
+  CALL_SUBTEST(check_all_in_range<long>(11, 11 + g_repeat));
+  CALL_SUBTEST(check_all_in_range<long>(-5, 5));
+  CALL_SUBTEST(check_all_in_range<long>(-11 - g_repeat, -11));
+  CALL_SUBTEST(check_all_in_range<long>(-long_ref, -long_ref + g_repeat));
+  CALL_SUBTEST(check_all_in_range<long>(long_ref, long_ref + g_repeat));
 
-  CALL_SUBTEST(check_histogram<int>(-5,5,11));
+  CALL_SUBTEST(check_histogram<int>(-5, 5, 11));
   int bins = 100;
-  CALL_SUBTEST(check_histogram<int>(-3333,-3333+bins*(3333/bins)-1,bins));
+  CALL_SUBTEST(check_histogram<int>(-3333, -3333 + bins * (3333 / bins) - 1, bins));
   bins = 1000;
-  CALL_SUBTEST(check_histogram<int>(-RAND_MAX+10,-RAND_MAX+10+bins*(RAND_MAX/bins)-1,bins));
-  CALL_SUBTEST(check_histogram<int>(-RAND_MAX+10,-int64(RAND_MAX)+10+bins*(2*int64(RAND_MAX)/bins)-1,bins));
+  CALL_SUBTEST(check_histogram<int>(-RAND_MAX + 10, -RAND_MAX + 10 + bins * (RAND_MAX / bins) - 1, bins));
+  CALL_SUBTEST(
+      check_histogram<int>(-RAND_MAX + 10, -int64(RAND_MAX) + 10 + bins * (2 * int64(RAND_MAX) / bins) - 1, bins));
 }
diff --git a/test/random_matrix.cpp b/test/random_matrix.cpp
index a914af1..e95ca47 100644
--- a/test/random_matrix.cpp
+++ b/test/random_matrix.cpp
@@ -10,105 +10,95 @@
 #include "main.h"
 #include <Eigen/SVD>
 
+template <typename MatrixType>
+void check_generateRandomUnitaryMatrix(const Index dim) {
+  const MatrixType Q = generateRandomUnitaryMatrix<MatrixType>(dim);
 
-template<typename MatrixType>
-void check_generateRandomUnitaryMatrix(const Index dim)
-{
-    const MatrixType Q = generateRandomUnitaryMatrix<MatrixType>(dim);
+  // validate dimensions
+  VERIFY_IS_EQUAL(Q.rows(), dim);
+  VERIFY_IS_EQUAL(Q.cols(), dim);
 
-    // validate dimensions
-    VERIFY_IS_EQUAL(Q.rows(), dim);
-    VERIFY_IS_EQUAL(Q.cols(), dim);
-
-    VERIFY_IS_UNITARY(Q);
+  VERIFY_IS_UNITARY(Q);
 }
 
-template<typename VectorType, typename RealScalarType>
-void check_setupRandomSvs(const Index dim, const RealScalarType max)
-{
-    const VectorType v = setupRandomSvs<VectorType, RealScalarType>(dim, max);
+template <typename VectorType, typename RealScalarType>
+void check_setupRandomSvs(const Index dim, const RealScalarType max) {
+  const VectorType v = setupRandomSvs<VectorType, RealScalarType>(dim, max);
 
-    // validate dimensions
-    VERIFY_IS_EQUAL(v.size(), dim);
+  // validate dimensions
+  VERIFY_IS_EQUAL(v.size(), dim);
 
-    // check entries
-    for(Index i = 0; i < v.size(); ++i)
-        VERIFY_GE(v(i), 0);
-    for(Index i = 0; i < v.size()-1; ++i)
-        VERIFY_GE(v(i), v(i+1));
+  // check entries
+  for (Index i = 0; i < v.size(); ++i) VERIFY_GE(v(i), 0);
+  for (Index i = 0; i < v.size() - 1; ++i) VERIFY_GE(v(i), v(i + 1));
 }
 
-template<typename VectorType, typename RealScalarType>
-void check_setupRangeSvs(const Index dim, const RealScalarType min, const RealScalarType max)
-{
-    const VectorType v = setupRangeSvs<VectorType, RealScalarType>(dim, min, max);
+template <typename VectorType, typename RealScalarType>
+void check_setupRangeSvs(const Index dim, const RealScalarType min, const RealScalarType max) {
+  const VectorType v = setupRangeSvs<VectorType, RealScalarType>(dim, min, max);
 
-    // validate dimensions
-    VERIFY_IS_EQUAL(v.size(), dim);
+  // validate dimensions
+  VERIFY_IS_EQUAL(v.size(), dim);
 
-    // check entries
-    if(dim == 1) {
-        VERIFY_IS_APPROX(v(0), min);
-    } else {
-        VERIFY_IS_APPROX(v(0), max);
-        VERIFY_IS_APPROX(v(dim-1), min);
-    }
-    for(Index i = 0; i < v.size()-1; ++i)
-        VERIFY_GE(v(i), v(i+1));
+  // check entries
+  if (dim == 1) {
+    VERIFY_IS_APPROX(v(0), min);
+  } else {
+    VERIFY_IS_APPROX(v(0), max);
+    VERIFY_IS_APPROX(v(dim - 1), min);
+  }
+  for (Index i = 0; i < v.size() - 1; ++i) VERIFY_GE(v(i), v(i + 1));
 }
 
-template<typename MatrixType, typename RealScalar, typename RealVectorType>
-void check_generateRandomMatrixSvs(const Index rows, const Index cols, const Index diag_size,
-                                   const RealScalar min_svs, const RealScalar max_svs)
-{
-    RealVectorType svs = setupRangeSvs<RealVectorType, RealScalar>(diag_size, min_svs, max_svs);
+template <typename MatrixType, typename RealScalar, typename RealVectorType>
+void check_generateRandomMatrixSvs(const Index rows, const Index cols, const Index diag_size, const RealScalar min_svs,
+                                   const RealScalar max_svs) {
+  RealVectorType svs = setupRangeSvs<RealVectorType, RealScalar>(diag_size, min_svs, max_svs);
 
-    MatrixType M = MatrixType::Zero(rows, cols);
-    generateRandomMatrixSvs(svs, rows, cols, M);
+  MatrixType M = MatrixType::Zero(rows, cols);
+  generateRandomMatrixSvs(svs, rows, cols, M);
 
-    // validate dimensions
-    VERIFY_IS_EQUAL(M.rows(), rows);
-    VERIFY_IS_EQUAL(M.cols(), cols);
-    VERIFY_IS_EQUAL(svs.size(), diag_size);
+  // validate dimensions
+  VERIFY_IS_EQUAL(M.rows(), rows);
+  VERIFY_IS_EQUAL(M.cols(), cols);
+  VERIFY_IS_EQUAL(svs.size(), diag_size);
 
-    // validate singular values
-    Eigen::JacobiSVD<MatrixType> SVD(M);
-    VERIFY_IS_APPROX(svs, SVD.singularValues());
+  // validate singular values
+  Eigen::JacobiSVD<MatrixType> SVD(M);
+  VERIFY_IS_APPROX(svs, SVD.singularValues());
 }
 
-template<typename MatrixType>
-void check_random_matrix(const MatrixType &m)
-{
-    enum {
-        Rows = MatrixType::RowsAtCompileTime,
-        Cols = MatrixType::ColsAtCompileTime,
-        DiagSize = internal::min_size_prefer_dynamic(Rows, Cols)
-    };
-    typedef typename MatrixType::Scalar Scalar;
-    typedef typename NumTraits<Scalar>::Real RealScalar;
-    typedef Matrix<RealScalar, DiagSize, 1> RealVectorType;
+template <typename MatrixType>
+void check_random_matrix(const MatrixType &m) {
+  enum {
+    Rows = MatrixType::RowsAtCompileTime,
+    Cols = MatrixType::ColsAtCompileTime,
+    DiagSize = internal::min_size_prefer_dynamic(Rows, Cols)
+  };
+  typedef typename MatrixType::Scalar Scalar;
+  typedef typename NumTraits<Scalar>::Real RealScalar;
+  typedef Matrix<RealScalar, DiagSize, 1> RealVectorType;
 
-    const Index rows = m.rows(), cols = m.cols();
-    const Index diag_size = (std::min)(rows, cols);
-    const RealScalar min_svs = 1.0, max_svs = 1000.0;
+  const Index rows = m.rows(), cols = m.cols();
+  const Index diag_size = (std::min)(rows, cols);
+  const RealScalar min_svs = 1.0, max_svs = 1000.0;
 
-    // check generation of unitary random matrices
-    typedef Matrix<Scalar, Rows, Rows> MatrixAType;
-    typedef Matrix<Scalar, Cols, Cols> MatrixBType;
-    check_generateRandomUnitaryMatrix<MatrixAType>(rows);
-    check_generateRandomUnitaryMatrix<MatrixBType>(cols);
+  // check generation of unitary random matrices
+  typedef Matrix<Scalar, Rows, Rows> MatrixAType;
+  typedef Matrix<Scalar, Cols, Cols> MatrixBType;
+  check_generateRandomUnitaryMatrix<MatrixAType>(rows);
+  check_generateRandomUnitaryMatrix<MatrixBType>(cols);
 
-    // test generators for singular values
-    check_setupRandomSvs<RealVectorType, RealScalar>(diag_size, max_svs);
-    check_setupRangeSvs<RealVectorType, RealScalar>(diag_size, min_svs, max_svs);
+  // test generators for singular values
+  check_setupRandomSvs<RealVectorType, RealScalar>(diag_size, max_svs);
+  check_setupRangeSvs<RealVectorType, RealScalar>(diag_size, min_svs, max_svs);
 
-    // check generation of random matrices
-    check_generateRandomMatrixSvs<MatrixType, RealScalar, RealVectorType>(rows, cols, diag_size, min_svs, max_svs);
+  // check generation of random matrices
+  check_generateRandomMatrixSvs<MatrixType, RealScalar, RealVectorType>(rows, cols, diag_size, min_svs, max_svs);
 }
 
-EIGEN_DECLARE_TEST(random_matrix)
-{
-  for(int i = 0; i < g_repeat; i++) {
+EIGEN_DECLARE_TEST(random_matrix) {
+  for (int i = 0; i < g_repeat; i++) {
     CALL_SUBTEST_1(check_random_matrix(Matrix<float, 1, 1>()));
     CALL_SUBTEST_2(check_random_matrix(Matrix<float, 4, 4>()));
     CALL_SUBTEST_3(check_random_matrix(Matrix<float, 2, 3>()));
diff --git a/test/random_matrix_helper.h b/test/random_matrix_helper.h
index 733dec5..818d686 100644
--- a/test/random_matrix_helper.h
+++ b/test/random_matrix_helper.h
@@ -13,38 +13,35 @@
 #define EIGEN_RANDOM_MATRIX_HELPER
 
 #include <typeinfo>
-#include <Eigen/QR> // required for createRandomPIMatrixOfRank and generateRandomMatrixSvs
-
+#include <Eigen/QR>  // required for createRandomPIMatrixOfRank and generateRandomMatrixSvs
 
 // Forward declarations to avoid ICC warnings
 #if EIGEN_COMP_ICC
 
 namespace Eigen {
 
-template<typename MatrixType>
+template <typename MatrixType>
 void createRandomPIMatrixOfRank(Index desired_rank, Index rows, Index cols, MatrixType& m);
 
-template<typename PermutationVectorType>
+template <typename PermutationVectorType>
 void randomPermutationVector(PermutationVectorType& v, Index size);
 
-template<typename MatrixType>
+template <typename MatrixType>
 MatrixType generateRandomUnitaryMatrix(const Index dim);
 
-template<typename MatrixType, typename RealScalarVectorType>
-void generateRandomMatrixSvs(const RealScalarVectorType &svs, const Index rows, const Index cols, MatrixType& M);
+template <typename MatrixType, typename RealScalarVectorType>
+void generateRandomMatrixSvs(const RealScalarVectorType& svs, const Index rows, const Index cols, MatrixType& M);
 
-template<typename VectorType, typename RealScalar>
+template <typename VectorType, typename RealScalar>
 VectorType setupRandomSvs(const Index dim, const RealScalar max);
 
-template<typename VectorType, typename RealScalar>
+template <typename VectorType, typename RealScalar>
 VectorType setupRangeSvs(const Index dim, const RealScalar min, const RealScalar max);
 
-} // end namespace Eigen
+}  // end namespace Eigen
 
 #endif  // EIGEN_COMP_ICC
 
-
-
 namespace Eigen {
 
 /**
@@ -59,9 +56,8 @@
  * @param cols column dimension of requested random partial isometry matrix
  * @param m random partial isometry matrix
  */
-template<typename MatrixType>
-void createRandomPIMatrixOfRank(Index desired_rank, Index rows, Index cols, MatrixType& m)
-{
+template <typename MatrixType>
+void createRandomPIMatrixOfRank(Index desired_rank, Index rows, Index cols, MatrixType& m) {
   typedef typename internal::traits<MatrixType>::Scalar Scalar;
   enum { Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime };
 
@@ -69,27 +65,25 @@
   typedef Matrix<Scalar, Rows, Rows> MatrixAType;
   typedef Matrix<Scalar, Cols, Cols> MatrixBType;
 
-  if(desired_rank == 0)
-  {
-    m.setZero(rows,cols);
+  if (desired_rank == 0) {
+    m.setZero(rows, cols);
     return;
   }
 
-  if(desired_rank == 1)
-  {
+  if (desired_rank == 1) {
     // here we normalize the vectors to get a partial isometry
     m = VectorType::Random(rows).normalized() * VectorType::Random(cols).normalized().transpose();
     return;
   }
 
-  MatrixAType a = MatrixAType::Random(rows,rows);
-  MatrixType d = MatrixType::Identity(rows,cols);
-  MatrixBType  b = MatrixBType::Random(cols,cols);
+  MatrixAType a = MatrixAType::Random(rows, rows);
+  MatrixType d = MatrixType::Identity(rows, cols);
+  MatrixBType b = MatrixBType::Random(cols, cols);
 
   // set the diagonal such that only desired_rank non-zero entries remain
-  const Index diag_size = (std::min)(d.rows(),d.cols());
-  if(diag_size != desired_rank)
-    d.diagonal().segment(desired_rank, diag_size-desired_rank) = VectorType::Zero(diag_size-desired_rank);
+  const Index diag_size = (std::min)(d.rows(), d.cols());
+  if (diag_size != desired_rank)
+    d.diagonal().segment(desired_rank, diag_size - desired_rank) = VectorType::Zero(diag_size - desired_rank);
 
   HouseholderQR<MatrixAType> qra(a);
   HouseholderQR<MatrixBType> qrb(b);
@@ -103,18 +97,17 @@
  * @param v permutation vector
  * @param size length of permutation vector
  */
-template<typename PermutationVectorType>
-void randomPermutationVector(PermutationVectorType& v, Index size)
-{
+template <typename PermutationVectorType>
+void randomPermutationVector(PermutationVectorType& v, Index size) {
   typedef typename PermutationVectorType::Scalar Scalar;
   v.resize(size);
-  for(Index i = 0; i < size; ++i) v(i) = Scalar(i);
-  if(size == 1) return;
-  for(Index n = 0; n < 3 * size; ++n)
-  {
-    Index i = internal::random<Index>(0, size-1);
+  for (Index i = 0; i < size; ++i) v(i) = Scalar(i);
+  if (size == 1) return;
+  for (Index n = 0; n < 3 * size; ++n) {
+    Index i = internal::random<Index>(0, size - 1);
     Index j;
-    do j = internal::random<Index>(0, size-1); while(j==i);
+    do j = internal::random<Index>(0, size - 1);
+    while (j == i);
     std::swap(v(i), v(j));
   }
 }
@@ -129,16 +122,14 @@
  * @param dim row and column dimension of the requested square matrix
  * @return random unitary matrix
  */
-template<typename MatrixType>
-MatrixType generateRandomUnitaryMatrix(const Index dim)
-{
+template <typename MatrixType>
+MatrixType generateRandomUnitaryMatrix(const Index dim) {
   typedef typename internal::traits<MatrixType>::Scalar Scalar;
   typedef Matrix<Scalar, Dynamic, 1> VectorType;
 
   MatrixType v = MatrixType::Identity(dim, dim);
   VectorType h = VectorType::Zero(dim);
-  for (Index i = 0; i < dim; ++i)
-  {
+  for (Index i = 0; i < dim; ++i) {
     v.col(i).tail(dim - i - 1) = VectorType::Random(dim - i - 1);
     h(i) = 2 / v.col(i).tail(dim - i).squaredNorm();
   }
@@ -174,9 +165,8 @@
  * @param cols column dimension of requested random matrix
  * @param M generated matrix with prescribed singular values
  */
-template<typename MatrixType, typename RealScalarVectorType>
-void generateRandomMatrixSvs(const RealScalarVectorType &svs, const Index rows, const Index cols, MatrixType& M)
-{
+template <typename MatrixType, typename RealScalarVectorType>
+void generateRandomMatrixSvs(const RealScalarVectorType& svs, const Index rows, const Index cols, MatrixType& M) {
   enum { Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime };
   typedef typename internal::traits<MatrixType>::Scalar Scalar;
   typedef Matrix<Scalar, Rows, Rows> MatrixAType;
@@ -206,9 +196,8 @@
  * @param max upper bound for singular values
  * @return vector of singular values
  */
-template<typename VectorType, typename RealScalar>
-VectorType setupRandomSvs(const Index dim, const RealScalar max)
-{
+template <typename VectorType, typename RealScalar>
+VectorType setupRandomSvs(const Index dim, const RealScalar max) {
   VectorType svs = max / RealScalar(2) * (VectorType::Random(dim) + VectorType::Ones(dim));
   std::sort(svs.begin(), svs.end(), std::greater<RealScalar>());
   return svs;
@@ -232,14 +221,11 @@
  * @param max largest singular value to use
  * @return vector of singular values
  */
-template<typename VectorType, typename RealScalar>
-VectorType setupRangeSvs(const Index dim, const RealScalar min, const RealScalar max)
-{
+template <typename VectorType, typename RealScalar>
+VectorType setupRangeSvs(const Index dim, const RealScalar min, const RealScalar max) {
   VectorType svs = VectorType::Random(dim);
-  if(dim == 0)
-    return svs;
-  if(dim == 1)
-  {
+  if (dim == 0) return svs;
+  if (dim == 1) {
     svs(0) = min;
     return svs;
   }
@@ -251,6 +237,6 @@
   return min * (VectorType::Ones(dim) - svs) + max * svs;
 }
 
-} // end namespace Eigen
+}  // end namespace Eigen
 
-#endif // EIGEN_RANDOM_MATRIX_HELPER
+#endif  // EIGEN_RANDOM_MATRIX_HELPER
diff --git a/test/random_without_cast_overflow.h b/test/random_without_cast_overflow.h
index 715bb8e..418f21c 100644
--- a/test/random_without_cast_overflow.h
+++ b/test/random_without_cast_overflow.h
@@ -23,11 +23,11 @@
 template <typename SrcScalar, typename TgtScalar>
 struct random_without_cast_overflow<
     SrcScalar, TgtScalar,
-    std::enable_if_t<NumTraits<SrcScalar>::IsInteger && NumTraits<SrcScalar>::IsSigned && NumTraits<TgtScalar>::IsInteger &&
-                   !NumTraits<TgtScalar>::IsSigned &&
-                   (std::numeric_limits<SrcScalar>::digits < std::numeric_limits<TgtScalar>::digits ||
-                    (std::numeric_limits<SrcScalar>::digits == std::numeric_limits<TgtScalar>::digits &&
-                     NumTraits<SrcScalar>::IsSigned))>> {
+    std::enable_if_t<NumTraits<SrcScalar>::IsInteger && NumTraits<SrcScalar>::IsSigned &&
+                     NumTraits<TgtScalar>::IsInteger && !NumTraits<TgtScalar>::IsSigned &&
+                     (std::numeric_limits<SrcScalar>::digits < std::numeric_limits<TgtScalar>::digits ||
+                      (std::numeric_limits<SrcScalar>::digits == std::numeric_limits<TgtScalar>::digits &&
+                       NumTraits<SrcScalar>::IsSigned))>> {
   static SrcScalar value() {
     SrcScalar a = internal::random<SrcScalar>();
     return a < SrcScalar(0) ? -(a + 1) : a;
@@ -38,11 +38,11 @@
 template <typename SrcScalar, typename TgtScalar>
 struct random_without_cast_overflow<
     SrcScalar, TgtScalar,
-    std::enable_if_t<NumTraits<SrcScalar>::IsInteger && !NumTraits<SrcScalar>::IsSigned && NumTraits<TgtScalar>::IsInteger &&
-                   !NumTraits<TgtScalar>::IsSigned &&
-                   (std::numeric_limits<SrcScalar>::digits < std::numeric_limits<TgtScalar>::digits ||
-                    (std::numeric_limits<SrcScalar>::digits == std::numeric_limits<TgtScalar>::digits &&
-                     NumTraits<SrcScalar>::IsSigned))>> {
+    std::enable_if_t<NumTraits<SrcScalar>::IsInteger && !NumTraits<SrcScalar>::IsSigned &&
+                     NumTraits<TgtScalar>::IsInteger && !NumTraits<TgtScalar>::IsSigned &&
+                     (std::numeric_limits<SrcScalar>::digits < std::numeric_limits<TgtScalar>::digits ||
+                      (std::numeric_limits<SrcScalar>::digits == std::numeric_limits<TgtScalar>::digits &&
+                       NumTraits<SrcScalar>::IsSigned))>> {
   static SrcScalar value() {
     SrcScalar a = internal::random<SrcScalar>();
     return a;
@@ -53,9 +53,9 @@
 template <typename SrcScalar, typename TgtScalar>
 struct random_without_cast_overflow<
     SrcScalar, TgtScalar,
-    std::enable_if_t<
-        NumTraits<SrcScalar>::IsInteger && NumTraits<TgtScalar>::IsInteger && NumTraits<TgtScalar>::IsSigned && !NumTraits<SrcScalar>::IsSigned &&
-        (std::numeric_limits<SrcScalar>::digits > std::numeric_limits<TgtScalar>::digits)>> {
+    std::enable_if_t<NumTraits<SrcScalar>::IsInteger && NumTraits<TgtScalar>::IsInteger &&
+                     NumTraits<TgtScalar>::IsSigned && !NumTraits<SrcScalar>::IsSigned &&
+                     (std::numeric_limits<SrcScalar>::digits > std::numeric_limits<TgtScalar>::digits)>> {
   static SrcScalar value() {
     TgtScalar b = internal::random<TgtScalar>();
     return static_cast<SrcScalar>(b < TgtScalar(0) ? -(b + 1) : b);
@@ -66,9 +66,9 @@
 template <typename SrcScalar, typename TgtScalar>
 struct random_without_cast_overflow<
     SrcScalar, TgtScalar,
-    std::enable_if_t<
-        NumTraits<SrcScalar>::IsInteger && NumTraits<TgtScalar>::IsInteger && !NumTraits<TgtScalar>::IsSigned && !NumTraits<SrcScalar>::IsSigned &&
-        (std::numeric_limits<SrcScalar>::digits > std::numeric_limits<TgtScalar>::digits)>> {
+    std::enable_if_t<NumTraits<SrcScalar>::IsInteger && NumTraits<TgtScalar>::IsInteger &&
+                     !NumTraits<TgtScalar>::IsSigned && !NumTraits<SrcScalar>::IsSigned &&
+                     (std::numeric_limits<SrcScalar>::digits > std::numeric_limits<TgtScalar>::digits)>> {
   static SrcScalar value() {
     TgtScalar b = internal::random<TgtScalar>();
     return static_cast<SrcScalar>(b);
@@ -79,9 +79,9 @@
 template <typename SrcScalar, typename TgtScalar>
 struct random_without_cast_overflow<
     SrcScalar, TgtScalar,
-    std::enable_if_t<
-        NumTraits<SrcScalar>::IsInteger && NumTraits<TgtScalar>::IsInteger && NumTraits<SrcScalar>::IsSigned &&
-        (std::numeric_limits<SrcScalar>::digits > std::numeric_limits<TgtScalar>::digits)>> {
+    std::enable_if_t<NumTraits<SrcScalar>::IsInteger && NumTraits<TgtScalar>::IsInteger &&
+                     NumTraits<SrcScalar>::IsSigned &&
+                     (std::numeric_limits<SrcScalar>::digits > std::numeric_limits<TgtScalar>::digits)>> {
   static SrcScalar value() { return static_cast<SrcScalar>(internal::random<TgtScalar>()); }
 };
 
@@ -91,8 +91,7 @@
     SrcScalar, TgtScalar,
     std::enable_if_t<NumTraits<SrcScalar>::IsInteger && NumTraits<TgtScalar>::IsInteger &&
                      !NumTraits<SrcScalar>::IsSigned && NumTraits<TgtScalar>::IsSigned &&
-                     (std::numeric_limits<SrcScalar>::digits ==
-                      std::numeric_limits<TgtScalar>::digits)>> {
+                     (std::numeric_limits<SrcScalar>::digits == std::numeric_limits<TgtScalar>::digits)>> {
   static SrcScalar value() { return internal::random<SrcScalar>() / 2; }
 };
 
@@ -100,9 +99,9 @@
 template <typename SrcScalar, typename TgtScalar>
 struct random_without_cast_overflow<
     SrcScalar, TgtScalar,
-    std::enable_if_t<
-        !NumTraits<SrcScalar>::IsInteger && !NumTraits<SrcScalar>::IsComplex && NumTraits<TgtScalar>::IsInteger &&
-        (std::numeric_limits<TgtScalar>::digits <= std::numeric_limits<SrcScalar>::digits)>> {
+    std::enable_if_t<!NumTraits<SrcScalar>::IsInteger && !NumTraits<SrcScalar>::IsComplex &&
+                     NumTraits<TgtScalar>::IsInteger &&
+                     (std::numeric_limits<TgtScalar>::digits <= std::numeric_limits<SrcScalar>::digits)>> {
   static SrcScalar value() { return static_cast<SrcScalar>(internal::random<TgtScalar>()); }
 };
 
@@ -110,9 +109,9 @@
 template <typename SrcScalar, typename TgtScalar>
 struct random_without_cast_overflow<
     SrcScalar, TgtScalar,
-    std::enable_if_t<
-        !NumTraits<SrcScalar>::IsInteger && !NumTraits<SrcScalar>::IsComplex && NumTraits<TgtScalar>::IsInteger && NumTraits<TgtScalar>::IsSigned &&
-        (std::numeric_limits<TgtScalar>::digits > std::numeric_limits<SrcScalar>::digits)>> {
+    std::enable_if_t<!NumTraits<SrcScalar>::IsInteger && !NumTraits<SrcScalar>::IsComplex &&
+                     NumTraits<TgtScalar>::IsInteger && NumTraits<TgtScalar>::IsSigned &&
+                     (std::numeric_limits<TgtScalar>::digits > std::numeric_limits<SrcScalar>::digits)>> {
   static SrcScalar value() {
     // NOTE: internal::random<T>() is limited by RAND_MAX, so random<int64_t> is always within that range.
     // This prevents us from simply shifting bits, which would result in only 0 or -1.
@@ -126,9 +125,9 @@
 template <typename SrcScalar, typename TgtScalar>
 struct random_without_cast_overflow<
     SrcScalar, TgtScalar,
-    std::enable_if_t<
-        !NumTraits<SrcScalar>::IsInteger && !NumTraits<SrcScalar>::IsComplex && NumTraits<TgtScalar>::IsInteger && !NumTraits<TgtScalar>::IsSigned &&
-        (std::numeric_limits<TgtScalar>::digits > std::numeric_limits<SrcScalar>::digits)>> {
+    std::enable_if_t<!NumTraits<SrcScalar>::IsInteger && !NumTraits<SrcScalar>::IsComplex &&
+                     NumTraits<TgtScalar>::IsInteger && !NumTraits<TgtScalar>::IsSigned &&
+                     (std::numeric_limits<TgtScalar>::digits > std::numeric_limits<SrcScalar>::digits)>> {
   static SrcScalar value() {
     // NOTE: internal::random<T>() is limited by RAND_MAX, so random<int64_t> is always within that range.
     // This prevents us from simply shifting bits, which would result in only 0 or -1.
@@ -156,16 +155,14 @@
     SrcScalar, TgtScalar,
     std::enable_if_t<!NumTraits<SrcScalar>::IsInteger && !NumTraits<SrcScalar>::IsComplex &&
                      !NumTraits<TgtScalar>::IsInteger && !NumTraits<TgtScalar>::IsComplex &&
-                     (std::numeric_limits<SrcScalar>::digits >
-                      std::numeric_limits<TgtScalar>::digits)>> {
+                     (std::numeric_limits<SrcScalar>::digits > std::numeric_limits<TgtScalar>::digits)>> {
   static SrcScalar value() { return static_cast<SrcScalar>(internal::random<TgtScalar>()); }
 };
 
 // Complex to non-complex.
 template <typename SrcScalar, typename TgtScalar>
 struct random_without_cast_overflow<
-    SrcScalar, TgtScalar,
-    std::enable_if_t<NumTraits<SrcScalar>::IsComplex && !NumTraits<TgtScalar>::IsComplex>> {
+    SrcScalar, TgtScalar, std::enable_if_t<NumTraits<SrcScalar>::IsComplex && !NumTraits<TgtScalar>::IsComplex>> {
   typedef typename NumTraits<SrcScalar>::Real SrcReal;
   static SrcScalar value() { return SrcScalar(random_without_cast_overflow<SrcReal, TgtScalar>::value(), 0); }
 };
@@ -173,8 +170,7 @@
 // Non-complex to complex.
 template <typename SrcScalar, typename TgtScalar>
 struct random_without_cast_overflow<
-    SrcScalar, TgtScalar,
-    std::enable_if_t<!NumTraits<SrcScalar>::IsComplex && NumTraits<TgtScalar>::IsComplex>> {
+    SrcScalar, TgtScalar, std::enable_if_t<!NumTraits<SrcScalar>::IsComplex && NumTraits<TgtScalar>::IsComplex>> {
   typedef typename NumTraits<TgtScalar>::Real TgtReal;
   static SrcScalar value() { return random_without_cast_overflow<SrcScalar, TgtReal>::value(); }
 };
@@ -182,8 +178,7 @@
 // Complex to complex.
 template <typename SrcScalar, typename TgtScalar>
 struct random_without_cast_overflow<
-    SrcScalar, TgtScalar,
-    std::enable_if_t<NumTraits<SrcScalar>::IsComplex && NumTraits<TgtScalar>::IsComplex>> {
+    SrcScalar, TgtScalar, std::enable_if_t<NumTraits<SrcScalar>::IsComplex && NumTraits<TgtScalar>::IsComplex>> {
   typedef typename NumTraits<SrcScalar>::Real SrcReal;
   typedef typename NumTraits<TgtScalar>::Real TgtReal;
   static SrcScalar value() {
diff --git a/test/real_qz.cpp b/test/real_qz.cpp
index ea4a270..50c1e60 100644
--- a/test/real_qz.cpp
+++ b/test/real_qz.cpp
@@ -12,83 +12,83 @@
 #include <limits>
 #include <Eigen/Eigenvalues>
 
-template<typename MatrixType> void real_qz(const MatrixType& m)
-{
+template <typename MatrixType>
+void real_qz(const MatrixType& m) {
   /* this test covers the following files:
      RealQZ.h
   */
   using std::abs;
-  
-  Index dim = m.cols();
-  
-  MatrixType A = MatrixType::Random(dim,dim),
-             B = MatrixType::Random(dim,dim);
 
+  Index dim = m.cols();
+
+  MatrixType A = MatrixType::Random(dim, dim), B = MatrixType::Random(dim, dim);
 
   // Regression test for bug 985: Randomly set rows or columns to zero
-  Index k=internal::random<Index>(0, dim-1);
-  switch(internal::random<int>(0,10)) {
-  case 0:
-    A.row(k).setZero(); break;
-  case 1:
-    A.col(k).setZero(); break;
-  case 2:
-    B.row(k).setZero(); break;
-  case 3:
-    B.col(k).setZero(); break;
-  default:
-    break;
+  Index k = internal::random<Index>(0, dim - 1);
+  switch (internal::random<int>(0, 10)) {
+    case 0:
+      A.row(k).setZero();
+      break;
+    case 1:
+      A.col(k).setZero();
+      break;
+    case 2:
+      B.row(k).setZero();
+      break;
+    case 3:
+      B.col(k).setZero();
+      break;
+    default:
+      break;
   }
 
   RealQZ<MatrixType> qz(dim);
-  // TODO enable full-prealocation of required memory, this probably requires an in-place mode for HessenbergDecomposition
-  //Eigen::internal::set_is_malloc_allowed(false);
-  qz.compute(A,B);
-  //Eigen::internal::set_is_malloc_allowed(true);
-  
+  // TODO enable full-prealocation of required memory, this probably requires an in-place mode for
+  // HessenbergDecomposition
+  // Eigen::internal::set_is_malloc_allowed(false);
+  qz.compute(A, B);
+  // Eigen::internal::set_is_malloc_allowed(true);
+
   VERIFY_IS_EQUAL(qz.info(), Success);
   // check for zeros
   bool all_zeros = true;
-  for (Index i=0; i<A.cols(); i++)
-    for (Index j=0; j<i; j++) {
-      if (!numext::is_exactly_zero(abs(qz.matrixT()(i, j))))
-      {
-        std::cerr << "Error: T(" << i << "," << j << ") = " << qz.matrixT()(i,j) << std::endl;
+  for (Index i = 0; i < A.cols(); i++)
+    for (Index j = 0; j < i; j++) {
+      if (!numext::is_exactly_zero(abs(qz.matrixT()(i, j)))) {
+        std::cerr << "Error: T(" << i << "," << j << ") = " << qz.matrixT()(i, j) << std::endl;
         all_zeros = false;
       }
-      if (j<i-1 && !numext::is_exactly_zero(abs(qz.matrixS()(i, j))))
-      {
-        std::cerr << "Error: S(" << i << "," << j << ") = " << qz.matrixS()(i,j) << std::endl;
+      if (j < i - 1 && !numext::is_exactly_zero(abs(qz.matrixS()(i, j)))) {
+        std::cerr << "Error: S(" << i << "," << j << ") = " << qz.matrixS()(i, j) << std::endl;
         all_zeros = false;
       }
-      if (j==i-1 && j>0 && !numext::is_exactly_zero(abs(qz.matrixS()(i, j))) &&
-              !numext::is_exactly_zero(abs(qz.matrixS()(i - 1, j - 1))))
-      {
-        std::cerr << "Error: S(" << i << "," << j << ") = " << qz.matrixS()(i,j)  << " && S(" << i-1 << "," << j-1 << ") = " << qz.matrixS()(i-1,j-1) << std::endl;
+      if (j == i - 1 && j > 0 && !numext::is_exactly_zero(abs(qz.matrixS()(i, j))) &&
+          !numext::is_exactly_zero(abs(qz.matrixS()(i - 1, j - 1)))) {
+        std::cerr << "Error: S(" << i << "," << j << ") = " << qz.matrixS()(i, j) << " && S(" << i - 1 << "," << j - 1
+                  << ") = " << qz.matrixS()(i - 1, j - 1) << std::endl;
         all_zeros = false;
       }
     }
   VERIFY_IS_EQUAL(all_zeros, true);
-  VERIFY_IS_APPROX(qz.matrixQ()*qz.matrixS()*qz.matrixZ(), A);
-  VERIFY_IS_APPROX(qz.matrixQ()*qz.matrixT()*qz.matrixZ(), B);
-  VERIFY_IS_APPROX(qz.matrixQ()*qz.matrixQ().adjoint(), MatrixType::Identity(dim,dim));
-  VERIFY_IS_APPROX(qz.matrixZ()*qz.matrixZ().adjoint(), MatrixType::Identity(dim,dim));
+  VERIFY_IS_APPROX(qz.matrixQ() * qz.matrixS() * qz.matrixZ(), A);
+  VERIFY_IS_APPROX(qz.matrixQ() * qz.matrixT() * qz.matrixZ(), B);
+  VERIFY_IS_APPROX(qz.matrixQ() * qz.matrixQ().adjoint(), MatrixType::Identity(dim, dim));
+  VERIFY_IS_APPROX(qz.matrixZ() * qz.matrixZ().adjoint(), MatrixType::Identity(dim, dim));
 }
 
-EIGEN_DECLARE_TEST(real_qz)
-{
+EIGEN_DECLARE_TEST(real_qz) {
   int s = 0;
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( real_qz(Matrix4f()) );
-    s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE/4);
-    CALL_SUBTEST_2( real_qz(MatrixXd(s,s)) );
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(real_qz(Matrix4f()));
+    s = internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 4);
+    CALL_SUBTEST_2(real_qz(MatrixXd(s, s)));
 
     // some trivial but implementation-wise tricky cases
-    CALL_SUBTEST_2( real_qz(MatrixXd(1,1)) );
-    CALL_SUBTEST_2( real_qz(MatrixXd(2,2)) );
-    CALL_SUBTEST_3( real_qz(Matrix<double,1,1>()) );
-    CALL_SUBTEST_4( real_qz(Matrix2d()) );
+    CALL_SUBTEST_2(real_qz(MatrixXd(1, 1)));
+    CALL_SUBTEST_2(real_qz(MatrixXd(2, 2)));
+    CALL_SUBTEST_3(real_qz(Matrix<double, 1, 1>()));
+    CALL_SUBTEST_4(real_qz(Matrix2d()));
   }
-  
+
   TEST_SET_BUT_UNUSED_VARIABLE(s)
 }
diff --git a/test/redux.cpp b/test/redux.cpp
index fdbab77..8a8138d 100644
--- a/test/redux.cpp
+++ b/test/redux.cpp
@@ -14,8 +14,8 @@
 
 #include "main.h"
 
-template<typename MatrixType> void matrixRedux(const MatrixType& m)
-{
+template <typename MatrixType>
+void matrixRedux(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
   typedef typename MatrixType::RealScalar RealScalar;
 
@@ -28,76 +28,78 @@
   // failures if we underflow into denormals. Thus, we scale so that entries are close to 1.
   MatrixType m1_for_prod = MatrixType::Ones(rows, cols) + RealScalar(0.2) * m1;
 
-  Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> m2(rows,rows);
+  Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> m2(rows, rows);
   m2.setRandom();
 
   VERIFY_IS_MUCH_SMALLER_THAN(MatrixType::Zero(rows, cols).sum(), Scalar(1));
-  VERIFY_IS_APPROX(MatrixType::Ones(rows, cols).sum(), Scalar(float(rows*cols))); // the float() here to shut up excessive MSVC warning about int->complex conversion being lossy
+  VERIFY_IS_APPROX(
+      MatrixType::Ones(rows, cols).sum(),
+      Scalar(float(
+          rows *
+          cols)));  // the float() here to shut up excessive MSVC warning about int->complex conversion being lossy
   Scalar s(0), p(1), minc(numext::real(m1.coeff(0))), maxc(numext::real(m1.coeff(0)));
-  for(int j = 0; j < cols; j++)
-  for(int i = 0; i < rows; i++)
-  {
-    s += m1(i,j);
-    p *= m1_for_prod(i,j);
-    minc = (std::min)(numext::real(minc), numext::real(m1(i,j)));
-    maxc = (std::max)(numext::real(maxc), numext::real(m1(i,j)));
-  }
-  const Scalar mean = s/Scalar(RealScalar(rows*cols));
+  for (int j = 0; j < cols; j++)
+    for (int i = 0; i < rows; i++) {
+      s += m1(i, j);
+      p *= m1_for_prod(i, j);
+      minc = (std::min)(numext::real(minc), numext::real(m1(i, j)));
+      maxc = (std::max)(numext::real(maxc), numext::real(m1(i, j)));
+    }
+  const Scalar mean = s / Scalar(RealScalar(rows * cols));
 
   VERIFY_IS_APPROX(m1.sum(), s);
   VERIFY_IS_APPROX(m1.mean(), mean);
   VERIFY_IS_APPROX(m1_for_prod.prod(), p);
   VERIFY_IS_APPROX(m1.real().minCoeff(), numext::real(minc));
   VERIFY_IS_APPROX(m1.real().maxCoeff(), numext::real(maxc));
-  
+
   // test that partial reduction works if nested expressions is forced to evaluate early
-  VERIFY_IS_APPROX((m1.matrix() * m1.matrix().transpose())       .cwiseProduct(m2.matrix()).rowwise().sum().sum(), 
+  VERIFY_IS_APPROX((m1.matrix() * m1.matrix().transpose()).cwiseProduct(m2.matrix()).rowwise().sum().sum(),
                    (m1.matrix() * m1.matrix().transpose()).eval().cwiseProduct(m2.matrix()).rowwise().sum().sum());
 
   // test slice vectorization assuming assign is ok
-  Index r0 = internal::random<Index>(0,rows-1);
-  Index c0 = internal::random<Index>(0,cols-1);
-  Index r1 = internal::random<Index>(r0+1,rows)-r0;
-  Index c1 = internal::random<Index>(c0+1,cols)-c0;
-  VERIFY_IS_APPROX(m1.block(r0,c0,r1,c1).sum(), m1.block(r0,c0,r1,c1).eval().sum());
-  VERIFY_IS_APPROX(m1.block(r0,c0,r1,c1).mean(), m1.block(r0,c0,r1,c1).eval().mean());
-  VERIFY_IS_APPROX(m1_for_prod.block(r0,c0,r1,c1).prod(), m1_for_prod.block(r0,c0,r1,c1).eval().prod());
-  VERIFY_IS_APPROX(m1.block(r0,c0,r1,c1).real().minCoeff(), m1.block(r0,c0,r1,c1).real().eval().minCoeff());
-  VERIFY_IS_APPROX(m1.block(r0,c0,r1,c1).real().maxCoeff(), m1.block(r0,c0,r1,c1).real().eval().maxCoeff());
+  Index r0 = internal::random<Index>(0, rows - 1);
+  Index c0 = internal::random<Index>(0, cols - 1);
+  Index r1 = internal::random<Index>(r0 + 1, rows) - r0;
+  Index c1 = internal::random<Index>(c0 + 1, cols) - c0;
+  VERIFY_IS_APPROX(m1.block(r0, c0, r1, c1).sum(), m1.block(r0, c0, r1, c1).eval().sum());
+  VERIFY_IS_APPROX(m1.block(r0, c0, r1, c1).mean(), m1.block(r0, c0, r1, c1).eval().mean());
+  VERIFY_IS_APPROX(m1_for_prod.block(r0, c0, r1, c1).prod(), m1_for_prod.block(r0, c0, r1, c1).eval().prod());
+  VERIFY_IS_APPROX(m1.block(r0, c0, r1, c1).real().minCoeff(), m1.block(r0, c0, r1, c1).real().eval().minCoeff());
+  VERIFY_IS_APPROX(m1.block(r0, c0, r1, c1).real().maxCoeff(), m1.block(r0, c0, r1, c1).real().eval().maxCoeff());
 
   // regression for bug 1090
-  const int R1 = MatrixType::RowsAtCompileTime>=2 ? MatrixType::RowsAtCompileTime/2 : 6;
-  const int C1 = MatrixType::ColsAtCompileTime>=2 ? MatrixType::ColsAtCompileTime/2 : 6;
-  if(R1<=rows-r0 && C1<=cols-c0)
-  {
-    VERIFY_IS_APPROX( (m1.template block<R1,C1>(r0,c0).sum()), m1.block(r0,c0,R1,C1).sum() );
+  const int R1 = MatrixType::RowsAtCompileTime >= 2 ? MatrixType::RowsAtCompileTime / 2 : 6;
+  const int C1 = MatrixType::ColsAtCompileTime >= 2 ? MatrixType::ColsAtCompileTime / 2 : 6;
+  if (R1 <= rows - r0 && C1 <= cols - c0) {
+    VERIFY_IS_APPROX((m1.template block<R1, C1>(r0, c0).sum()), m1.block(r0, c0, R1, C1).sum());
   }
-  
+
   // test empty objects
-  VERIFY_IS_APPROX(m1.block(r0,c0,0,0).sum(),   Scalar(0));
-  VERIFY_IS_APPROX(m1.block(r0,c0,0,0).prod(),  Scalar(1));
+  VERIFY_IS_APPROX(m1.block(r0, c0, 0, 0).sum(), Scalar(0));
+  VERIFY_IS_APPROX(m1.block(r0, c0, 0, 0).prod(), Scalar(1));
 
   // test nesting complex expression
-  VERIFY_EVALUATION_COUNT( (m1.matrix()*m1.matrix().transpose()).sum(), (MatrixType::IsVectorAtCompileTime && MatrixType::SizeAtCompileTime!=1 ? 0 : 1) );
-  VERIFY_EVALUATION_COUNT( ((m1.matrix()*m1.matrix().transpose())+m2).sum(),(MatrixType::IsVectorAtCompileTime && MatrixType::SizeAtCompileTime!=1 ? 0 : 1));
+  VERIFY_EVALUATION_COUNT((m1.matrix() * m1.matrix().transpose()).sum(),
+                          (MatrixType::IsVectorAtCompileTime && MatrixType::SizeAtCompileTime != 1 ? 0 : 1));
+  VERIFY_EVALUATION_COUNT(((m1.matrix() * m1.matrix().transpose()) + m2).sum(),
+                          (MatrixType::IsVectorAtCompileTime && MatrixType::SizeAtCompileTime != 1 ? 0 : 1));
 }
 
-template<typename VectorType> void vectorRedux(const VectorType& w)
-{
+template <typename VectorType>
+void vectorRedux(const VectorType& w) {
   using std::abs;
   typedef typename VectorType::Scalar Scalar;
   typedef typename NumTraits<Scalar>::Real RealScalar;
   Index size = w.size();
 
   VectorType v = VectorType::Random(size);
-  VectorType v_for_prod = VectorType::Ones(size) + Scalar(0.2) * v; // see comment above declaration of m1_for_prod
+  VectorType v_for_prod = VectorType::Ones(size) + Scalar(0.2) * v;  // see comment above declaration of m1_for_prod
 
-  for(int i = 1; i < size; i++)
-  {
+  for (int i = 1; i < size; i++) {
     Scalar s(0), p(1);
     RealScalar minc(numext::real(v.coeff(0))), maxc(numext::real(v.coeff(0)));
-    for(int j = 0; j < i; j++)
-    {
+    for (int j = 0; j < i; j++) {
       s += v[j];
       p *= v_for_prod[j];
       minc = (std::min)(minc, numext::real(v[j]));
@@ -109,75 +111,70 @@
     VERIFY_IS_APPROX(maxc, v.real().head(i).maxCoeff());
   }
 
-  for(int i = 0; i < size-1; i++)
-  {
+  for (int i = 0; i < size - 1; i++) {
     Scalar s(0), p(1);
     RealScalar minc(numext::real(v.coeff(i))), maxc(numext::real(v.coeff(i)));
-    for(int j = i; j < size; j++)
-    {
+    for (int j = i; j < size; j++) {
       s += v[j];
       p *= v_for_prod[j];
       minc = (std::min)(minc, numext::real(v[j]));
       maxc = (std::max)(maxc, numext::real(v[j]));
     }
-    VERIFY_IS_MUCH_SMALLER_THAN(abs(s - v.tail(size-i).sum()), Scalar(1));
-    VERIFY_IS_APPROX(p, v_for_prod.tail(size-i).prod());
-    VERIFY_IS_APPROX(minc, v.real().tail(size-i).minCoeff());
-    VERIFY_IS_APPROX(maxc, v.real().tail(size-i).maxCoeff());
+    VERIFY_IS_MUCH_SMALLER_THAN(abs(s - v.tail(size - i).sum()), Scalar(1));
+    VERIFY_IS_APPROX(p, v_for_prod.tail(size - i).prod());
+    VERIFY_IS_APPROX(minc, v.real().tail(size - i).minCoeff());
+    VERIFY_IS_APPROX(maxc, v.real().tail(size - i).maxCoeff());
   }
 
-  for(int i = 0; i < size/2; i++)
-  {
+  for (int i = 0; i < size / 2; i++) {
     Scalar s(0), p(1);
     RealScalar minc(numext::real(v.coeff(i))), maxc(numext::real(v.coeff(i)));
-    for(int j = i; j < size-i; j++)
-    {
+    for (int j = i; j < size - i; j++) {
       s += v[j];
       p *= v_for_prod[j];
       minc = (std::min)(minc, numext::real(v[j]));
       maxc = (std::max)(maxc, numext::real(v[j]));
     }
-    VERIFY_IS_MUCH_SMALLER_THAN(abs(s - v.segment(i, size-2*i).sum()), Scalar(1));
-    VERIFY_IS_APPROX(p, v_for_prod.segment(i, size-2*i).prod());
-    VERIFY_IS_APPROX(minc, v.real().segment(i, size-2*i).minCoeff());
-    VERIFY_IS_APPROX(maxc, v.real().segment(i, size-2*i).maxCoeff());
+    VERIFY_IS_MUCH_SMALLER_THAN(abs(s - v.segment(i, size - 2 * i).sum()), Scalar(1));
+    VERIFY_IS_APPROX(p, v_for_prod.segment(i, size - 2 * i).prod());
+    VERIFY_IS_APPROX(minc, v.real().segment(i, size - 2 * i).minCoeff());
+    VERIFY_IS_APPROX(maxc, v.real().segment(i, size - 2 * i).maxCoeff());
   }
-  
+
   // test empty objects
-  VERIFY_IS_APPROX(v.head(0).sum(),   Scalar(0));
-  VERIFY_IS_APPROX(v.tail(0).prod(),  Scalar(1));
+  VERIFY_IS_APPROX(v.head(0).sum(), Scalar(0));
+  VERIFY_IS_APPROX(v.tail(0).prod(), Scalar(1));
   VERIFY_RAISES_ASSERT(v.head(0).mean());
   VERIFY_RAISES_ASSERT(v.head(0).minCoeff());
   VERIFY_RAISES_ASSERT(v.head(0).maxCoeff());
 }
 
-EIGEN_DECLARE_TEST(redux)
-{
+EIGEN_DECLARE_TEST(redux) {
   // the max size cannot be too large, otherwise reduxion operations obviously generate large errors.
-  int maxsize = (std::min)(100,EIGEN_TEST_MAX_SIZE);
+  int maxsize = (std::min)(100, EIGEN_TEST_MAX_SIZE);
   TEST_SET_BUT_UNUSED_VARIABLE(maxsize);
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( matrixRedux(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_1( matrixRedux(Array<float, 1, 1>()) );
-    CALL_SUBTEST_2( matrixRedux(Matrix2f()) );
-    CALL_SUBTEST_2( matrixRedux(Array2f()) );
-    CALL_SUBTEST_2( matrixRedux(Array22f()) );
-    CALL_SUBTEST_3( matrixRedux(Matrix4d()) );
-    CALL_SUBTEST_3( matrixRedux(Array4d()) );
-    CALL_SUBTEST_3( matrixRedux(Array44d()) );
-    CALL_SUBTEST_4( matrixRedux(MatrixXcf(internal::random<int>(1,maxsize), internal::random<int>(1,maxsize))) );
-    CALL_SUBTEST_4( matrixRedux(ArrayXXcf(internal::random<int>(1,maxsize), internal::random<int>(1,maxsize))) );
-    CALL_SUBTEST_5( matrixRedux(MatrixXd (internal::random<int>(1,maxsize), internal::random<int>(1,maxsize))) );
-    CALL_SUBTEST_5( matrixRedux(ArrayXXd (internal::random<int>(1,maxsize), internal::random<int>(1,maxsize))) );
-    CALL_SUBTEST_6( matrixRedux(MatrixXi (internal::random<int>(1,maxsize), internal::random<int>(1,maxsize))) );
-    CALL_SUBTEST_6( matrixRedux(ArrayXXi (internal::random<int>(1,maxsize), internal::random<int>(1,maxsize))) );
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(matrixRedux(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_1(matrixRedux(Array<float, 1, 1>()));
+    CALL_SUBTEST_2(matrixRedux(Matrix2f()));
+    CALL_SUBTEST_2(matrixRedux(Array2f()));
+    CALL_SUBTEST_2(matrixRedux(Array22f()));
+    CALL_SUBTEST_3(matrixRedux(Matrix4d()));
+    CALL_SUBTEST_3(matrixRedux(Array4d()));
+    CALL_SUBTEST_3(matrixRedux(Array44d()));
+    CALL_SUBTEST_4(matrixRedux(MatrixXcf(internal::random<int>(1, maxsize), internal::random<int>(1, maxsize))));
+    CALL_SUBTEST_4(matrixRedux(ArrayXXcf(internal::random<int>(1, maxsize), internal::random<int>(1, maxsize))));
+    CALL_SUBTEST_5(matrixRedux(MatrixXd(internal::random<int>(1, maxsize), internal::random<int>(1, maxsize))));
+    CALL_SUBTEST_5(matrixRedux(ArrayXXd(internal::random<int>(1, maxsize), internal::random<int>(1, maxsize))));
+    CALL_SUBTEST_6(matrixRedux(MatrixXi(internal::random<int>(1, maxsize), internal::random<int>(1, maxsize))));
+    CALL_SUBTEST_6(matrixRedux(ArrayXXi(internal::random<int>(1, maxsize), internal::random<int>(1, maxsize))));
   }
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_7( vectorRedux(Vector4f()) );
-    CALL_SUBTEST_7( vectorRedux(Array4f()) );
-    CALL_SUBTEST_5( vectorRedux(VectorXd(internal::random<int>(1,maxsize))) );
-    CALL_SUBTEST_5( vectorRedux(ArrayXd(internal::random<int>(1,maxsize))) );
-    CALL_SUBTEST_8( vectorRedux(VectorXf(internal::random<int>(1,maxsize))) );
-    CALL_SUBTEST_8( vectorRedux(ArrayXf(internal::random<int>(1,maxsize))) );
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_7(vectorRedux(Vector4f()));
+    CALL_SUBTEST_7(vectorRedux(Array4f()));
+    CALL_SUBTEST_5(vectorRedux(VectorXd(internal::random<int>(1, maxsize))));
+    CALL_SUBTEST_5(vectorRedux(ArrayXd(internal::random<int>(1, maxsize))));
+    CALL_SUBTEST_8(vectorRedux(VectorXf(internal::random<int>(1, maxsize))));
+    CALL_SUBTEST_8(vectorRedux(ArrayXf(internal::random<int>(1, maxsize))));
   }
 }
diff --git a/test/ref.cpp b/test/ref.cpp
index f0faa94..deb238f 100644
--- a/test/ref.cpp
+++ b/test/ref.cpp
@@ -22,54 +22,53 @@
 #if EIGEN_ARCH_i386 && !(EIGEN_ARCH_x86_64)
 
 #if EIGEN_COMP_GNUC_STRICT
-#pragma GCC optimize ("-ffloat-store")
+#pragma GCC optimize("-ffloat-store")
 #else
 #undef VERIFY_IS_EQUAL
-#define VERIFY_IS_EQUAL(X,Y) VERIFY_IS_APPROX(X,Y)
+#define VERIFY_IS_EQUAL(X, Y) VERIFY_IS_APPROX(X, Y)
 #endif
 
 #endif
 
-template<typename MatrixType> void ref_matrix(const MatrixType& m)
-{
+template <typename MatrixType>
+void ref_matrix(const MatrixType &m) {
   typedef typename MatrixType::Scalar Scalar;
   typedef typename MatrixType::RealScalar RealScalar;
-  typedef Matrix<Scalar,Dynamic,Dynamic,MatrixType::Options> DynMatrixType;
-  typedef Matrix<RealScalar,Dynamic,Dynamic,MatrixType::Options> RealDynMatrixType;
-  
+  typedef Matrix<Scalar, Dynamic, Dynamic, MatrixType::Options> DynMatrixType;
+  typedef Matrix<RealScalar, Dynamic, Dynamic, MatrixType::Options> RealDynMatrixType;
+
   typedef Ref<MatrixType> RefMat;
   typedef Ref<DynMatrixType> RefDynMat;
   typedef Ref<const DynMatrixType> ConstRefDynMat;
-  typedef Ref<RealDynMatrixType , 0, Stride<Dynamic,Dynamic> > RefRealMatWithStride;
+  typedef Ref<RealDynMatrixType, 0, Stride<Dynamic, Dynamic>> RefRealMatWithStride;
 
   Index rows = m.rows(), cols = m.cols();
-  
-  MatrixType  m1 = MatrixType::Random(rows, cols),
-              m2 = m1;
-  
-  Index i = internal::random<Index>(0,rows-1);
-  Index j = internal::random<Index>(0,cols-1);
-  Index brows = internal::random<Index>(1,rows-i);
-  Index bcols = internal::random<Index>(1,cols-j);
-  
+
+  MatrixType m1 = MatrixType::Random(rows, cols), m2 = m1;
+
+  Index i = internal::random<Index>(0, rows - 1);
+  Index j = internal::random<Index>(0, cols - 1);
+  Index brows = internal::random<Index>(1, rows - i);
+  Index bcols = internal::random<Index>(1, cols - j);
+
   RefMat rm0 = m1;
   VERIFY_IS_EQUAL(rm0, m1);
   RefDynMat rm1 = m1;
   VERIFY_IS_EQUAL(rm1, m1);
-  RefDynMat rm2 = m1.block(i,j,brows,bcols);
-  VERIFY_IS_EQUAL(rm2, m1.block(i,j,brows,bcols));
+  RefDynMat rm2 = m1.block(i, j, brows, bcols);
+  VERIFY_IS_EQUAL(rm2, m1.block(i, j, brows, bcols));
   rm2.setOnes();
-  m2.block(i,j,brows,bcols).setOnes();
+  m2.block(i, j, brows, bcols).setOnes();
   VERIFY_IS_EQUAL(m1, m2);
-  
-  m2.block(i,j,brows,bcols).setRandom();
-  rm2 = m2.block(i,j,brows,bcols);
+
+  m2.block(i, j, brows, bcols).setRandom();
+  rm2 = m2.block(i, j, brows, bcols);
   VERIFY_IS_EQUAL(m1, m2);
-  
-  ConstRefDynMat rm3 = m1.block(i,j,brows,bcols);
-  m1.block(i,j,brows,bcols) *= 2;
-  m2.block(i,j,brows,bcols) *= 2;
-  VERIFY_IS_EQUAL(rm3, m2.block(i,j,brows,bcols));
+
+  ConstRefDynMat rm3 = m1.block(i, j, brows, bcols);
+  m1.block(i, j, brows, bcols) *= 2;
+  m2.block(i, j, brows, bcols) *= 2;
+  VERIFY_IS_EQUAL(rm3, m2.block(i, j, brows, bcols));
   RefRealMatWithStride rm4 = m1.real();
   VERIFY_IS_EQUAL(rm4, m2.real());
   rm4.array() += 1;
@@ -77,57 +76,66 @@
   VERIFY_IS_EQUAL(m1, m2);
 }
 
-template<typename VectorType> void ref_vector(const VectorType& m)
-{
+template <typename VectorType>
+void ref_vector(const VectorType &m) {
   typedef typename VectorType::Scalar Scalar;
   typedef typename VectorType::RealScalar RealScalar;
-  typedef Matrix<Scalar,Dynamic,1,VectorType::Options> DynMatrixType;
-  typedef Matrix<Scalar,Dynamic,Dynamic,ColMajor> MatrixType;
-  typedef Matrix<RealScalar,Dynamic,1,VectorType::Options> RealDynMatrixType;
-  
+  typedef Matrix<Scalar, Dynamic, 1, VectorType::Options> DynMatrixType;
+  typedef Matrix<Scalar, Dynamic, Dynamic, ColMajor> MatrixType;
+  typedef Matrix<RealScalar, Dynamic, 1, VectorType::Options> RealDynMatrixType;
+
   typedef Ref<VectorType> RefMat;
   typedef Ref<DynMatrixType> RefDynMat;
   typedef Ref<const DynMatrixType> ConstRefDynMat;
-  typedef Ref<RealDynMatrixType , 0, InnerStride<> > RefRealMatWithStride;
-  typedef Ref<DynMatrixType , 0, InnerStride<> > RefMatWithStride;
+  typedef Ref<RealDynMatrixType, 0, InnerStride<>> RefRealMatWithStride;
+  typedef Ref<DynMatrixType, 0, InnerStride<>> RefMatWithStride;
 
   Index size = m.size();
-  
-  VectorType  v1 = VectorType::Random(size),
-              v2 = v1;
-  MatrixType mat1 = MatrixType::Random(size,size),
-             mat2 = mat1,
-             mat3 = MatrixType::Random(size,size);
-  
-  Index i = internal::random<Index>(0,size-1);
-  Index bsize = internal::random<Index>(1,size-i);
-  
-  { RefMat    rm0 = v1;                   VERIFY_IS_EQUAL(rm0, v1); }
-  { RefMat    rm0 = v1.block(0,0,size,1); VERIFY_IS_EQUAL(rm0, v1); }
-  { RefDynMat rv1 = v1;                   VERIFY_IS_EQUAL(rv1, v1); }
-  { RefDynMat rv1 = v1.block(0,0,size,1); VERIFY_IS_EQUAL(rv1, v1); }
 
-  RefDynMat rv2 = v1.segment(i,bsize);
-  VERIFY_IS_EQUAL(rv2, v1.segment(i,bsize));
+  VectorType v1 = VectorType::Random(size), v2 = v1;
+  MatrixType mat1 = MatrixType::Random(size, size), mat2 = mat1, mat3 = MatrixType::Random(size, size);
+
+  Index i = internal::random<Index>(0, size - 1);
+  Index bsize = internal::random<Index>(1, size - i);
+
+  {
+    RefMat rm0 = v1;
+    VERIFY_IS_EQUAL(rm0, v1);
+  }
+  {
+    RefMat rm0 = v1.block(0, 0, size, 1);
+    VERIFY_IS_EQUAL(rm0, v1);
+  }
+  {
+    RefDynMat rv1 = v1;
+    VERIFY_IS_EQUAL(rv1, v1);
+  }
+  {
+    RefDynMat rv1 = v1.block(0, 0, size, 1);
+    VERIFY_IS_EQUAL(rv1, v1);
+  }
+
+  RefDynMat rv2 = v1.segment(i, bsize);
+  VERIFY_IS_EQUAL(rv2, v1.segment(i, bsize));
   rv2.setOnes();
-  v2.segment(i,bsize).setOnes();
+  v2.segment(i, bsize).setOnes();
   VERIFY_IS_EQUAL(v1, v2);
-  
-  v2.segment(i,bsize).setRandom();
-  rv2 = v2.segment(i,bsize);
+
+  v2.segment(i, bsize).setRandom();
+  rv2 = v2.segment(i, bsize);
   VERIFY_IS_EQUAL(v1, v2);
-  
-  ConstRefDynMat rm3 = v1.segment(i,bsize);
-  v1.segment(i,bsize) *= 2;
-  v2.segment(i,bsize) *= 2;
-  VERIFY_IS_EQUAL(rm3, v2.segment(i,bsize));
-  
+
+  ConstRefDynMat rm3 = v1.segment(i, bsize);
+  v1.segment(i, bsize) *= 2;
+  v2.segment(i, bsize) *= 2;
+  VERIFY_IS_EQUAL(rm3, v2.segment(i, bsize));
+
   RefRealMatWithStride rm4 = v1.real();
   VERIFY_IS_EQUAL(rm4, v2.real());
   rm4.array() += 1;
   v2.real().array() += 1;
   VERIFY_IS_EQUAL(v1, v2);
-  
+
   RefMatWithStride rm5 = mat1.row(i).transpose();
   VERIFY_IS_EQUAL(rm5, mat1.row(i).transpose());
   rm5.array() += 1;
@@ -138,22 +146,21 @@
   VERIFY_IS_APPROX(mat1, mat2);
 }
 
-template<typename Scalar, int Rows, int Cols>
-void ref_vector_fixed_sizes()
-{
-  typedef Matrix<Scalar,Rows,Cols,RowMajor> RowMajorMatrixType;
-  typedef Matrix<Scalar,Rows,Cols,ColMajor> ColMajorMatrixType;
-  typedef Matrix<Scalar,1,Cols> RowVectorType;
-  typedef Matrix<Scalar,Rows,1> ColVectorType;
-  typedef Matrix<Scalar,Cols,1> RowVectorTransposeType;
-  typedef Matrix<Scalar,1,Rows> ColVectorTransposeType;
+template <typename Scalar, int Rows, int Cols>
+void ref_vector_fixed_sizes() {
+  typedef Matrix<Scalar, Rows, Cols, RowMajor> RowMajorMatrixType;
+  typedef Matrix<Scalar, Rows, Cols, ColMajor> ColMajorMatrixType;
+  typedef Matrix<Scalar, 1, Cols> RowVectorType;
+  typedef Matrix<Scalar, Rows, 1> ColVectorType;
+  typedef Matrix<Scalar, Cols, 1> RowVectorTransposeType;
+  typedef Matrix<Scalar, 1, Rows> ColVectorTransposeType;
   typedef Stride<Dynamic, Dynamic> DynamicStride;
 
   RowMajorMatrixType mr = RowMajorMatrixType::Random();
   ColMajorMatrixType mc = ColMajorMatrixType::Random();
 
-  Index i = internal::random<Index>(0,Rows-1);
-  Index j = internal::random<Index>(0,Cols-1);
+  Index i = internal::random<Index>(0, Rows - 1);
+  Index j = internal::random<Index>(0, Cols - 1);
 
   // Reference ith row.
   Ref<RowVectorType, 0, DynamicStride> mr_ri = mr.row(i);
@@ -178,7 +185,7 @@
   VERIFY_IS_EQUAL(mr_cjt, mr.col(j).transpose());
   Ref<ColVectorTransposeType, 0, DynamicStride> mc_cjt = mc.col(j);
   VERIFY_IS_EQUAL(mc_cjt, mc.col(j).transpose());
-  
+
   // Const references without strides.
   Ref<const RowVectorType> cmr_ri = mr.row(i);
   VERIFY_IS_EQUAL(cmr_ri, mr.row(i));
@@ -201,142 +208,152 @@
   VERIFY_IS_EQUAL(cmc_cjt, mc.col(j).transpose());
 }
 
-template<typename PlainObjectType> void check_const_correctness(const PlainObjectType&)
-{
+template <typename PlainObjectType>
+void check_const_correctness(const PlainObjectType &) {
   // verify that ref-to-const don't have LvalueBit
   typedef std::add_const_t<PlainObjectType> ConstPlainObjectType;
-  VERIFY( !(internal::traits<Ref<ConstPlainObjectType> >::Flags & LvalueBit) );
-  VERIFY( !(internal::traits<Ref<ConstPlainObjectType, Aligned> >::Flags & LvalueBit) );
-  VERIFY( !(Ref<ConstPlainObjectType>::Flags & LvalueBit) );
-  VERIFY( !(Ref<ConstPlainObjectType, Aligned>::Flags & LvalueBit) );
+  VERIFY(!(internal::traits<Ref<ConstPlainObjectType>>::Flags & LvalueBit));
+  VERIFY(!(internal::traits<Ref<ConstPlainObjectType, Aligned>>::Flags & LvalueBit));
+  VERIFY(!(Ref<ConstPlainObjectType>::Flags & LvalueBit));
+  VERIFY(!(Ref<ConstPlainObjectType, Aligned>::Flags & LvalueBit));
 }
 
-template<typename B>
-EIGEN_DONT_INLINE void call_ref_1(Ref<VectorXf> a, const B &b) { VERIFY_IS_EQUAL(a,b); }
-template<typename B>
-EIGEN_DONT_INLINE void call_ref_2(const Ref<const VectorXf>& a, const B &b) { VERIFY_IS_EQUAL(a,b); }
-template<typename B>
-EIGEN_DONT_INLINE void call_ref_3(Ref<VectorXf,0,InnerStride<> > a, const B &b) { VERIFY_IS_EQUAL(a,b); }
-template<typename B>
-EIGEN_DONT_INLINE void call_ref_4(const Ref<const VectorXf,0,InnerStride<> >& a, const B &b) { VERIFY_IS_EQUAL(a,b); }
-template<typename B>
-EIGEN_DONT_INLINE void call_ref_5(Ref<MatrixXf,0,OuterStride<> > a, const B &b) { VERIFY_IS_EQUAL(a,b); }
-template<typename B>
-EIGEN_DONT_INLINE void call_ref_6(const Ref<const MatrixXf,0,OuterStride<> >& a, const B &b) { VERIFY_IS_EQUAL(a,b); }
-template<typename B>
-EIGEN_DONT_INLINE void call_ref_7(Ref<Matrix<float,Dynamic,3> > a, const B &b) { VERIFY_IS_EQUAL(a,b); }
+template <typename B>
+EIGEN_DONT_INLINE void call_ref_1(Ref<VectorXf> a, const B &b) {
+  VERIFY_IS_EQUAL(a, b);
+}
+template <typename B>
+EIGEN_DONT_INLINE void call_ref_2(const Ref<const VectorXf> &a, const B &b) {
+  VERIFY_IS_EQUAL(a, b);
+}
+template <typename B>
+EIGEN_DONT_INLINE void call_ref_3(Ref<VectorXf, 0, InnerStride<>> a, const B &b) {
+  VERIFY_IS_EQUAL(a, b);
+}
+template <typename B>
+EIGEN_DONT_INLINE void call_ref_4(const Ref<const VectorXf, 0, InnerStride<>> &a, const B &b) {
+  VERIFY_IS_EQUAL(a, b);
+}
+template <typename B>
+EIGEN_DONT_INLINE void call_ref_5(Ref<MatrixXf, 0, OuterStride<>> a, const B &b) {
+  VERIFY_IS_EQUAL(a, b);
+}
+template <typename B>
+EIGEN_DONT_INLINE void call_ref_6(const Ref<const MatrixXf, 0, OuterStride<>> &a, const B &b) {
+  VERIFY_IS_EQUAL(a, b);
+}
+template <typename B>
+EIGEN_DONT_INLINE void call_ref_7(Ref<Matrix<float, Dynamic, 3>> a, const B &b) {
+  VERIFY_IS_EQUAL(a, b);
+}
 
-void call_ref()
-{
-  VectorXcf ca  = VectorXcf::Random(10);
-  VectorXf a    = VectorXf::Random(10);
+void call_ref() {
+  VectorXcf ca = VectorXcf::Random(10);
+  VectorXf a = VectorXf::Random(10);
   RowVectorXf b = RowVectorXf::Random(10);
-  MatrixXf A    = MatrixXf::Random(10,10);
+  MatrixXf A = MatrixXf::Random(10, 10);
   RowVector3f c = RowVector3f::Random();
-  const VectorXf& ac(a);
-  VectorBlock<VectorXf> ab(a,0,3);
-  const VectorBlock<VectorXf> abc(a,0,3);
-  
+  const VectorXf &ac(a);
+  VectorBlock<VectorXf> ab(a, 0, 3);
+  const VectorBlock<VectorXf> abc(a, 0, 3);
 
-  VERIFY_EVALUATION_COUNT( call_ref_1(a,a), 0);
-  VERIFY_EVALUATION_COUNT( call_ref_1(b,b.transpose()), 0);
-//   call_ref_1(ac,a<c);           // does not compile because ac is const
-  VERIFY_EVALUATION_COUNT( call_ref_1(ab,ab), 0);
-  VERIFY_EVALUATION_COUNT( call_ref_1(a.head(4),a.head(4)), 0);
-  VERIFY_EVALUATION_COUNT( call_ref_1(abc,abc), 0);
-  VERIFY_EVALUATION_COUNT( call_ref_1(A.col(3),A.col(3)), 0);
-//   call_ref_1(A.row(3),A.row(3));    // does not compile because innerstride!=1
-  VERIFY_EVALUATION_COUNT( call_ref_3(A.row(3),A.row(3).transpose()), 0);
-  VERIFY_EVALUATION_COUNT( call_ref_4(A.row(3),A.row(3).transpose()), 0);
-//   call_ref_1(a+a, a+a);          // does not compile for obvious reason
+  VERIFY_EVALUATION_COUNT(call_ref_1(a, a), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_1(b, b.transpose()), 0);
+  //   call_ref_1(ac,a<c);           // does not compile because ac is const
+  VERIFY_EVALUATION_COUNT(call_ref_1(ab, ab), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_1(a.head(4), a.head(4)), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_1(abc, abc), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_1(A.col(3), A.col(3)), 0);
+  //   call_ref_1(A.row(3),A.row(3));    // does not compile because innerstride!=1
+  VERIFY_EVALUATION_COUNT(call_ref_3(A.row(3), A.row(3).transpose()), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_4(A.row(3), A.row(3).transpose()), 0);
+  //   call_ref_1(a+a, a+a);          // does not compile for obvious reason
 
-  MatrixXf tmp = A*A.col(1);
-  VERIFY_EVALUATION_COUNT( call_ref_2(A*A.col(1), tmp), 1);     // evaluated into a temp
-  VERIFY_EVALUATION_COUNT( call_ref_2(ac.head(5),ac.head(5)), 0);
-  VERIFY_EVALUATION_COUNT( call_ref_2(ac,ac), 0);
-  VERIFY_EVALUATION_COUNT( call_ref_2(a,a), 0);
-  VERIFY_EVALUATION_COUNT( call_ref_2(ab,ab), 0);
-  VERIFY_EVALUATION_COUNT( call_ref_2(a.head(4),a.head(4)), 0);
-  tmp = a+a;
-  VERIFY_EVALUATION_COUNT( call_ref_2(a+a,tmp), 1);            // evaluated into a temp
-  VERIFY_EVALUATION_COUNT( call_ref_2(ca.imag(),ca.imag()), 1);      // evaluated into a temp
+  MatrixXf tmp = A * A.col(1);
+  VERIFY_EVALUATION_COUNT(call_ref_2(A * A.col(1), tmp), 1);  // evaluated into a temp
+  VERIFY_EVALUATION_COUNT(call_ref_2(ac.head(5), ac.head(5)), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_2(ac, ac), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_2(a, a), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_2(ab, ab), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_2(a.head(4), a.head(4)), 0);
+  tmp = a + a;
+  VERIFY_EVALUATION_COUNT(call_ref_2(a + a, tmp), 1);            // evaluated into a temp
+  VERIFY_EVALUATION_COUNT(call_ref_2(ca.imag(), ca.imag()), 1);  // evaluated into a temp
 
-  VERIFY_EVALUATION_COUNT( call_ref_4(ac.head(5),ac.head(5)), 0);
-  tmp = a+a;
-  VERIFY_EVALUATION_COUNT( call_ref_4(a+a,tmp), 1);           // evaluated into a temp
-  VERIFY_EVALUATION_COUNT( call_ref_4(ca.imag(),ca.imag()), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_4(ac.head(5), ac.head(5)), 0);
+  tmp = a + a;
+  VERIFY_EVALUATION_COUNT(call_ref_4(a + a, tmp), 1);  // evaluated into a temp
+  VERIFY_EVALUATION_COUNT(call_ref_4(ca.imag(), ca.imag()), 0);
 
-  VERIFY_EVALUATION_COUNT( call_ref_5(a,a), 0);
-  VERIFY_EVALUATION_COUNT( call_ref_5(a.head(3),a.head(3)), 0);
-  VERIFY_EVALUATION_COUNT( call_ref_5(A,A), 0);
-//   call_ref_5(A.transpose(),A.transpose());   // does not compile because storage order does not match
-  VERIFY_EVALUATION_COUNT( call_ref_5(A.block(1,1,2,2),A.block(1,1,2,2)), 0);
-  VERIFY_EVALUATION_COUNT( call_ref_5(b,b), 0);             // storage order do not match, but this is a degenerate case that should work
-  VERIFY_EVALUATION_COUNT( call_ref_5(a.row(3),a.row(3)), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_5(a, a), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_5(a.head(3), a.head(3)), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_5(A, A), 0);
+  //   call_ref_5(A.transpose(),A.transpose());   // does not compile because storage order does not match
+  VERIFY_EVALUATION_COUNT(call_ref_5(A.block(1, 1, 2, 2), A.block(1, 1, 2, 2)), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_5(b, b),
+                          0);  // storage order do not match, but this is a degenerate case that should work
+  VERIFY_EVALUATION_COUNT(call_ref_5(a.row(3), a.row(3)), 0);
 
-  VERIFY_EVALUATION_COUNT( call_ref_6(a,a), 0);
-  VERIFY_EVALUATION_COUNT( call_ref_6(a.head(3),a.head(3)), 0);
-  VERIFY_EVALUATION_COUNT( call_ref_6(A.row(3),A.row(3)), 1);           // evaluated into a temp thouth it could be avoided by viewing it as a 1xn matrix
-  tmp = A+A;
-  VERIFY_EVALUATION_COUNT( call_ref_6(A+A,tmp), 1);                // evaluated into a temp
-  VERIFY_EVALUATION_COUNT( call_ref_6(A,A), 0);
-  VERIFY_EVALUATION_COUNT( call_ref_6(A.transpose(),A.transpose()), 1);      // evaluated into a temp because the storage orders do not match
-  VERIFY_EVALUATION_COUNT( call_ref_6(A.block(1,1,2,2),A.block(1,1,2,2)), 0);
-  
-  VERIFY_EVALUATION_COUNT( call_ref_7(c,c), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_6(a, a), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_6(a.head(3), a.head(3)), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_6(A.row(3), A.row(3)),
+                          1);  // evaluated into a temp thouth it could be avoided by viewing it as a 1xn matrix
+  tmp = A + A;
+  VERIFY_EVALUATION_COUNT(call_ref_6(A + A, tmp), 1);  // evaluated into a temp
+  VERIFY_EVALUATION_COUNT(call_ref_6(A, A), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_6(A.transpose(), A.transpose()),
+                          1);  // evaluated into a temp because the storage orders do not match
+  VERIFY_EVALUATION_COUNT(call_ref_6(A.block(1, 1, 2, 2), A.block(1, 1, 2, 2)), 0);
+
+  VERIFY_EVALUATION_COUNT(call_ref_7(c, c), 0);
 }
 
-typedef Matrix<double,Dynamic,Dynamic,RowMajor> RowMatrixXd;
-int test_ref_overload_fun1(Ref<MatrixXd> )       { return 1; }
-int test_ref_overload_fun1(Ref<RowMatrixXd> )    { return 2; }
-int test_ref_overload_fun1(Ref<MatrixXf> )       { return 3; }
+typedef Matrix<double, Dynamic, Dynamic, RowMajor> RowMatrixXd;
+int test_ref_overload_fun1(Ref<MatrixXd>) { return 1; }
+int test_ref_overload_fun1(Ref<RowMatrixXd>) { return 2; }
+int test_ref_overload_fun1(Ref<MatrixXf>) { return 3; }
 
-int test_ref_overload_fun2(Ref<const MatrixXd> ) { return 4; }
-int test_ref_overload_fun2(Ref<const MatrixXf> ) { return 5; }
+int test_ref_overload_fun2(Ref<const MatrixXd>) { return 4; }
+int test_ref_overload_fun2(Ref<const MatrixXf>) { return 5; }
 
-void test_ref_ambiguous(const Ref<const ArrayXd> &A, Ref<ArrayXd> B)
-{
+void test_ref_ambiguous(const Ref<const ArrayXd> &A, Ref<ArrayXd> B) {
   B = A;
   B = A - A;
 }
 
 // See also bug 969
-void test_ref_overloads()
-{
+void test_ref_overloads() {
   MatrixXd Ad, Bd;
   RowMatrixXd rAd, rBd;
-  VERIFY( test_ref_overload_fun1(Ad)==1 );
-  VERIFY( test_ref_overload_fun1(rAd)==2 );
-  
+  VERIFY(test_ref_overload_fun1(Ad) == 1);
+  VERIFY(test_ref_overload_fun1(rAd) == 2);
+
   MatrixXf Af, Bf;
-  VERIFY( test_ref_overload_fun2(Ad)==4 );
-  VERIFY( test_ref_overload_fun2(Ad+Bd)==4 );
-  VERIFY( test_ref_overload_fun2(Af+Bf)==5 );
-  
+  VERIFY(test_ref_overload_fun2(Ad) == 4);
+  VERIFY(test_ref_overload_fun2(Ad + Bd) == 4);
+  VERIFY(test_ref_overload_fun2(Af + Bf) == 5);
+
   ArrayXd A, B;
   test_ref_ambiguous(A, B);
 }
 
-template<typename Ref_>
-struct RefDerived
-  : Ref_
-{
+template <typename Ref_>
+struct RefDerived : Ref_ {
   using Ref_::m_object;
 };
 
-template <typename MatrixType, typename Derived> void test_cref_move_ctor(const DenseBase<Derived> &expr) {
+template <typename MatrixType, typename Derived>
+void test_cref_move_ctor(const DenseBase<Derived> &expr) {
   typedef Ref<const MatrixType> CRef;
   typedef RefDerived<CRef> CRefDerived;
 
   const bool owns_data = !bool(internal::traits<CRef>::template match<Derived>::type::value);
   CRef cref1(expr);
-  const double *data1 = cref1.data(),
-               *obj_data1 = static_cast<CRefDerived &>(cref1).m_object.data();
+  const double *data1 = cref1.data(), *obj_data1 = static_cast<CRefDerived &>(cref1).m_object.data();
   VERIFY(test_is_equal(data1, obj_data1, owns_data));
   CRef cref2(std::move(cref1));
   VERIFY_IS_EQUAL(data1, cref1.data());
-  const double *data2 = cref2.data(),
-               *obj_data2 = static_cast<CRefDerived &>(cref2).m_object.data();
+  const double *data2 = cref2.data(), *obj_data2 = static_cast<CRefDerived &>(cref2).m_object.data();
   VERIFY(test_is_equal(data1, data2, MatrixType::MaxSizeAtCompileTime == Dynamic || !owns_data));
   VERIFY(test_is_equal(data1, obj_data2, MatrixType::MaxSizeAtCompileTime == Dynamic && owns_data));
 }
@@ -352,40 +369,39 @@
   VERIFY(test_is_equal(cref.data(), m.data(), true));
 }
 
-EIGEN_DECLARE_TEST(ref)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( ref_vector(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_1( check_const_correctness(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( ref_vector(Vector4d()) );
-    CALL_SUBTEST_2( check_const_correctness(Matrix4d()) );
-    CALL_SUBTEST_3( ref_vector(Vector4cf()) );
-    CALL_SUBTEST_4( ref_vector(VectorXcf(8)) );
-    CALL_SUBTEST_5( ref_vector(VectorXi(12)) );
-    CALL_SUBTEST_5( check_const_correctness(VectorXi(12)) );
+EIGEN_DECLARE_TEST(ref) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(ref_vector(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_1(check_const_correctness(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(ref_vector(Vector4d()));
+    CALL_SUBTEST_2(check_const_correctness(Matrix4d()));
+    CALL_SUBTEST_3(ref_vector(Vector4cf()));
+    CALL_SUBTEST_4(ref_vector(VectorXcf(8)));
+    CALL_SUBTEST_5(ref_vector(VectorXi(12)));
+    CALL_SUBTEST_5(check_const_correctness(VectorXi(12)));
 
-    CALL_SUBTEST_1( ref_matrix(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( ref_matrix(Matrix4d()) );
-    CALL_SUBTEST_1( ref_matrix(Matrix<float,3,5>()) );
-    CALL_SUBTEST_4( ref_matrix(MatrixXcf(internal::random<int>(1,10),internal::random<int>(1,10))) );
-    CALL_SUBTEST_4( ref_matrix(Matrix<std::complex<double>,10,15>()) );
-    CALL_SUBTEST_5( ref_matrix(MatrixXi(internal::random<int>(1,10),internal::random<int>(1,10))) );
-    CALL_SUBTEST_6( call_ref() );
+    CALL_SUBTEST_1(ref_matrix(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(ref_matrix(Matrix4d()));
+    CALL_SUBTEST_1(ref_matrix(Matrix<float, 3, 5>()));
+    CALL_SUBTEST_4(ref_matrix(MatrixXcf(internal::random<int>(1, 10), internal::random<int>(1, 10))));
+    CALL_SUBTEST_4(ref_matrix(Matrix<std::complex<double>, 10, 15>()));
+    CALL_SUBTEST_5(ref_matrix(MatrixXi(internal::random<int>(1, 10), internal::random<int>(1, 10))));
+    CALL_SUBTEST_6(call_ref());
 
-    CALL_SUBTEST_8( (ref_vector_fixed_sizes<float,3,5>()) );
-    CALL_SUBTEST_8( (ref_vector_fixed_sizes<float,15,10>()) );
+    CALL_SUBTEST_8((ref_vector_fixed_sizes<float, 3, 5>()));
+    CALL_SUBTEST_8((ref_vector_fixed_sizes<float, 15, 10>()));
   }
-  
-  CALL_SUBTEST_7( test_ref_overloads() );
 
-  CALL_SUBTEST_9( test_cref_move_ctor<VectorXd>(VectorXd::Ones(9)) );
-  CALL_SUBTEST_9( test_cref_move_ctor<VectorXd>(VectorXd(9)) );
-  CALL_SUBTEST_9( test_cref_move_ctor<Vector3d>(Vector3d::Ones()) );
-  CALL_SUBTEST_9( test_cref_move_ctor<Vector3d>(Vector3d()) );
-  CALL_SUBTEST_9( test_cref_move_ctor<MatrixXd>(MatrixXd::Ones(9, 5)) );
-  CALL_SUBTEST_9( test_cref_move_ctor<MatrixXd>(MatrixXd(9, 5)) );
-  CALL_SUBTEST_9( test_cref_move_ctor<Matrix3d>(Matrix3d::Ones()) );
-  CALL_SUBTEST_9( test_cref_move_ctor<Matrix3d>(Matrix3d()) );
+  CALL_SUBTEST_7(test_ref_overloads());
+
+  CALL_SUBTEST_9(test_cref_move_ctor<VectorXd>(VectorXd::Ones(9)));
+  CALL_SUBTEST_9(test_cref_move_ctor<VectorXd>(VectorXd(9)));
+  CALL_SUBTEST_9(test_cref_move_ctor<Vector3d>(Vector3d::Ones()));
+  CALL_SUBTEST_9(test_cref_move_ctor<Vector3d>(Vector3d()));
+  CALL_SUBTEST_9(test_cref_move_ctor<MatrixXd>(MatrixXd::Ones(9, 5)));
+  CALL_SUBTEST_9(test_cref_move_ctor<MatrixXd>(MatrixXd(9, 5)));
+  CALL_SUBTEST_9(test_cref_move_ctor<Matrix3d>(Matrix3d::Ones()));
+  CALL_SUBTEST_9(test_cref_move_ctor<Matrix3d>(Matrix3d()));
   CALL_SUBTEST_10(test_contiguous_ref_no_copy(VectorXd(9)));
   CALL_SUBTEST_10(test_contiguous_ref_no_copy(Vector3d()));
   CALL_SUBTEST_10(test_contiguous_ref_no_copy(MatrixXd(9, 5)));
diff --git a/test/reshape.cpp b/test/reshape.cpp
index ca7a73e..7c76cd5 100644
--- a/test/reshape.cpp
+++ b/test/reshape.cpp
@@ -10,214 +10,201 @@
 
 #include "main.h"
 
-using Eigen::placeholders::last;
 using Eigen::placeholders::all;
+using Eigen::placeholders::last;
 
-template<typename T1,typename T2>
-std::enable_if_t<internal::is_same<T1,T2>::value,bool>
-is_same_eq(const T1& a, const T2& b)
-{
+template <typename T1, typename T2>
+std::enable_if_t<internal::is_same<T1, T2>::value, bool> is_same_eq(const T1& a, const T2& b) {
   return (a.array() == b.array()).all();
 }
 
-template <int Order,typename MatType>
-void check_auto_reshape4x4(MatType m)
-{
-  internal::VariableAndFixedInt<MatType::SizeAtCompileTime==Dynamic?-1: 1>  v1( 1);
-  internal::VariableAndFixedInt<MatType::SizeAtCompileTime==Dynamic?-1: 2>  v2( 2);
-  internal::VariableAndFixedInt<MatType::SizeAtCompileTime==Dynamic?-1: 4>  v4( 4);
-  internal::VariableAndFixedInt<MatType::SizeAtCompileTime==Dynamic?-1: 8>  v8( 8);
-  internal::VariableAndFixedInt<MatType::SizeAtCompileTime==Dynamic?-1:16> v16(16);
+template <int Order, typename MatType>
+void check_auto_reshape4x4(MatType m) {
+  internal::VariableAndFixedInt<MatType::SizeAtCompileTime == Dynamic ? -1 : 1> v1(1);
+  internal::VariableAndFixedInt<MatType::SizeAtCompileTime == Dynamic ? -1 : 2> v2(2);
+  internal::VariableAndFixedInt<MatType::SizeAtCompileTime == Dynamic ? -1 : 4> v4(4);
+  internal::VariableAndFixedInt<MatType::SizeAtCompileTime == Dynamic ? -1 : 8> v8(8);
+  internal::VariableAndFixedInt<MatType::SizeAtCompileTime == Dynamic ? -1 : 16> v16(16);
 
-  VERIFY(is_same_eq(m.template reshaped<Order>( 1,       AutoSize), m.template reshaped<Order>( 1, 16)));
-  VERIFY(is_same_eq(m.template reshaped<Order>(AutoSize, 16      ), m.template reshaped<Order>( 1, 16)));
-  VERIFY(is_same_eq(m.template reshaped<Order>( 2,       AutoSize), m.template reshaped<Order>( 2,  8)));
-  VERIFY(is_same_eq(m.template reshaped<Order>(AutoSize, 8       ), m.template reshaped<Order>( 2,  8)));
-  VERIFY(is_same_eq(m.template reshaped<Order>( 4,       AutoSize), m.template reshaped<Order>( 4,  4)));
-  VERIFY(is_same_eq(m.template reshaped<Order>(AutoSize, 4       ), m.template reshaped<Order>( 4,  4)));
-  VERIFY(is_same_eq(m.template reshaped<Order>( 8,       AutoSize), m.template reshaped<Order>( 8,  2)));
-  VERIFY(is_same_eq(m.template reshaped<Order>(AutoSize, 2       ), m.template reshaped<Order>( 8,  2)));
-  VERIFY(is_same_eq(m.template reshaped<Order>(16,       AutoSize), m.template reshaped<Order>(16,  1)));
-  VERIFY(is_same_eq(m.template reshaped<Order>(AutoSize, 1       ), m.template reshaped<Order>(16,  1)));
+  VERIFY(is_same_eq(m.template reshaped<Order>(1, AutoSize), m.template reshaped<Order>(1, 16)));
+  VERIFY(is_same_eq(m.template reshaped<Order>(AutoSize, 16), m.template reshaped<Order>(1, 16)));
+  VERIFY(is_same_eq(m.template reshaped<Order>(2, AutoSize), m.template reshaped<Order>(2, 8)));
+  VERIFY(is_same_eq(m.template reshaped<Order>(AutoSize, 8), m.template reshaped<Order>(2, 8)));
+  VERIFY(is_same_eq(m.template reshaped<Order>(4, AutoSize), m.template reshaped<Order>(4, 4)));
+  VERIFY(is_same_eq(m.template reshaped<Order>(AutoSize, 4), m.template reshaped<Order>(4, 4)));
+  VERIFY(is_same_eq(m.template reshaped<Order>(8, AutoSize), m.template reshaped<Order>(8, 2)));
+  VERIFY(is_same_eq(m.template reshaped<Order>(AutoSize, 2), m.template reshaped<Order>(8, 2)));
+  VERIFY(is_same_eq(m.template reshaped<Order>(16, AutoSize), m.template reshaped<Order>(16, 1)));
+  VERIFY(is_same_eq(m.template reshaped<Order>(AutoSize, 1), m.template reshaped<Order>(16, 1)));
 
-  VERIFY(is_same_eq(m.template reshaped<Order>(fix< 1>,   AutoSize),  m.template reshaped<Order>(fix< 1>, v16    )));
-  VERIFY(is_same_eq(m.template reshaped<Order>(AutoSize,  fix<16> ),  m.template reshaped<Order>( v1,     fix<16>)));
-  VERIFY(is_same_eq(m.template reshaped<Order>(fix< 2>,   AutoSize),  m.template reshaped<Order>(fix< 2>, v8     )));
-  VERIFY(is_same_eq(m.template reshaped<Order>(AutoSize,  fix< 8> ),  m.template reshaped<Order>( v2,     fix< 8>)));
-  VERIFY(is_same_eq(m.template reshaped<Order>(fix< 4>,   AutoSize),  m.template reshaped<Order>(fix< 4>, v4     )));
-  VERIFY(is_same_eq(m.template reshaped<Order>(AutoSize,  fix< 4> ),  m.template reshaped<Order>( v4,     fix< 4>)));
-  VERIFY(is_same_eq(m.template reshaped<Order>(fix< 8>,   AutoSize),  m.template reshaped<Order>(fix< 8>, v2     )));
-  VERIFY(is_same_eq(m.template reshaped<Order>(AutoSize,  fix< 2> ),  m.template reshaped<Order>( v8,     fix< 2>)));
-  VERIFY(is_same_eq(m.template reshaped<Order>(fix<16>,   AutoSize),  m.template reshaped<Order>(fix<16>, v1     )));
-  VERIFY(is_same_eq(m.template reshaped<Order>(AutoSize,  fix< 1> ),  m.template reshaped<Order>(v16,     fix< 1>)));
+  VERIFY(is_same_eq(m.template reshaped<Order>(fix<1>, AutoSize), m.template reshaped<Order>(fix<1>, v16)));
+  VERIFY(is_same_eq(m.template reshaped<Order>(AutoSize, fix<16>), m.template reshaped<Order>(v1, fix<16>)));
+  VERIFY(is_same_eq(m.template reshaped<Order>(fix<2>, AutoSize), m.template reshaped<Order>(fix<2>, v8)));
+  VERIFY(is_same_eq(m.template reshaped<Order>(AutoSize, fix<8>), m.template reshaped<Order>(v2, fix<8>)));
+  VERIFY(is_same_eq(m.template reshaped<Order>(fix<4>, AutoSize), m.template reshaped<Order>(fix<4>, v4)));
+  VERIFY(is_same_eq(m.template reshaped<Order>(AutoSize, fix<4>), m.template reshaped<Order>(v4, fix<4>)));
+  VERIFY(is_same_eq(m.template reshaped<Order>(fix<8>, AutoSize), m.template reshaped<Order>(fix<8>, v2)));
+  VERIFY(is_same_eq(m.template reshaped<Order>(AutoSize, fix<2>), m.template reshaped<Order>(v8, fix<2>)));
+  VERIFY(is_same_eq(m.template reshaped<Order>(fix<16>, AutoSize), m.template reshaped<Order>(fix<16>, v1)));
+  VERIFY(is_same_eq(m.template reshaped<Order>(AutoSize, fix<1>), m.template reshaped<Order>(v16, fix<1>)));
 }
 
 template <typename MatType>
-void check_direct_access_reshape4x4(MatType , internal::FixedInt<RowMajorBit>) {}
+void check_direct_access_reshape4x4(MatType, internal::FixedInt<RowMajorBit>) {}
 
 template <typename MatType>
 void check_direct_access_reshape4x4(MatType m, internal::FixedInt<0>) {
-  VERIFY_IS_EQUAL(m.reshaped( 1, 16).data(), m.data());
-  VERIFY_IS_EQUAL(m.reshaped( 1, 16).innerStride(), 1);
+  VERIFY_IS_EQUAL(m.reshaped(1, 16).data(), m.data());
+  VERIFY_IS_EQUAL(m.reshaped(1, 16).innerStride(), 1);
 
-  VERIFY_IS_EQUAL(m.reshaped( 2, 8).data(), m.data());
-  VERIFY_IS_EQUAL(m.reshaped( 2, 8).innerStride(), 1);
-  VERIFY_IS_EQUAL(m.reshaped( 2, 8).outerStride(), 2);
+  VERIFY_IS_EQUAL(m.reshaped(2, 8).data(), m.data());
+  VERIFY_IS_EQUAL(m.reshaped(2, 8).innerStride(), 1);
+  VERIFY_IS_EQUAL(m.reshaped(2, 8).outerStride(), 2);
 }
 
 // just test a 4x4 matrix, enumerate all combination manually
 template <typename MatType>
-void reshape4x4(MatType m)
-{
+void reshape4x4(MatType m) {
   typedef typename MatType::Scalar Scalar;
 
-  internal::VariableAndFixedInt<MatType::SizeAtCompileTime==Dynamic?-1: 1>  v1( 1);
-  internal::VariableAndFixedInt<MatType::SizeAtCompileTime==Dynamic?-1: 2>  v2( 2);
-  internal::VariableAndFixedInt<MatType::SizeAtCompileTime==Dynamic?-1: 4>  v4( 4);
-  internal::VariableAndFixedInt<MatType::SizeAtCompileTime==Dynamic?-1: 8>  v8( 8);
-  internal::VariableAndFixedInt<MatType::SizeAtCompileTime==Dynamic?-1:16> v16(16);
+  internal::VariableAndFixedInt<MatType::SizeAtCompileTime == Dynamic ? -1 : 1> v1(1);
+  internal::VariableAndFixedInt<MatType::SizeAtCompileTime == Dynamic ? -1 : 2> v2(2);
+  internal::VariableAndFixedInt<MatType::SizeAtCompileTime == Dynamic ? -1 : 4> v4(4);
+  internal::VariableAndFixedInt<MatType::SizeAtCompileTime == Dynamic ? -1 : 8> v8(8);
+  internal::VariableAndFixedInt<MatType::SizeAtCompileTime == Dynamic ? -1 : 16> v16(16);
 
-  if((MatType::Flags&RowMajorBit)==0)
-  {
+  if ((MatType::Flags & RowMajorBit) == 0) {
     typedef Map<MatrixXi> MapMat;
     // dynamic
-    VERIFY_IS_EQUAL((m.reshaped( 1, 16)), MapMat(m.data(),  1, 16));
-    VERIFY_IS_EQUAL((m.reshaped( 2,  8)), MapMat(m.data(),  2,  8));
-    VERIFY_IS_EQUAL((m.reshaped( 4,  4)), MapMat(m.data(),  4,  4));
-    VERIFY_IS_EQUAL((m.reshaped( 8,  2)), MapMat(m.data(),  8,  2));
-    VERIFY_IS_EQUAL((m.reshaped(16,  1)), MapMat(m.data(), 16,  1));
+    VERIFY_IS_EQUAL((m.reshaped(1, 16)), MapMat(m.data(), 1, 16));
+    VERIFY_IS_EQUAL((m.reshaped(2, 8)), MapMat(m.data(), 2, 8));
+    VERIFY_IS_EQUAL((m.reshaped(4, 4)), MapMat(m.data(), 4, 4));
+    VERIFY_IS_EQUAL((m.reshaped(8, 2)), MapMat(m.data(), 8, 2));
+    VERIFY_IS_EQUAL((m.reshaped(16, 1)), MapMat(m.data(), 16, 1));
 
     // static
-    VERIFY_IS_EQUAL(m.reshaped(fix< 1>, fix<16>), MapMat(m.data(),  1, 16));
-    VERIFY_IS_EQUAL(m.reshaped(fix< 2>, fix< 8>), MapMat(m.data(),  2,  8));
-    VERIFY_IS_EQUAL(m.reshaped(fix< 4>, fix< 4>), MapMat(m.data(),  4,  4));
-    VERIFY_IS_EQUAL(m.reshaped(fix< 8>, fix< 2>), MapMat(m.data(),  8,  2));
-    VERIFY_IS_EQUAL(m.reshaped(fix<16>, fix< 1>), MapMat(m.data(), 16,  1));
-
+    VERIFY_IS_EQUAL(m.reshaped(fix<1>, fix<16>), MapMat(m.data(), 1, 16));
+    VERIFY_IS_EQUAL(m.reshaped(fix<2>, fix<8>), MapMat(m.data(), 2, 8));
+    VERIFY_IS_EQUAL(m.reshaped(fix<4>, fix<4>), MapMat(m.data(), 4, 4));
+    VERIFY_IS_EQUAL(m.reshaped(fix<8>, fix<2>), MapMat(m.data(), 8, 2));
+    VERIFY_IS_EQUAL(m.reshaped(fix<16>, fix<1>), MapMat(m.data(), 16, 1));
 
     // reshape chain
-    VERIFY_IS_EQUAL(
-      (m
-      .reshaped( 1, 16)
-      .reshaped(fix< 2>,fix< 8>)
-      .reshaped(16,  1)
-      .reshaped(fix< 8>,fix< 2>)
-      .reshaped( 2,  8)
-      .reshaped(fix< 1>,fix<16>)
-      .reshaped( 4,  4)
-      .reshaped(fix<16>,fix< 1>)
-      .reshaped( 8,  2)
-      .reshaped(fix< 4>,fix< 4>)
-      ),
-      MapMat(m.data(), 4,  4)
-    );
+    VERIFY_IS_EQUAL((m.reshaped(1, 16)
+                         .reshaped(fix<2>, fix<8>)
+                         .reshaped(16, 1)
+                         .reshaped(fix<8>, fix<2>)
+                         .reshaped(2, 8)
+                         .reshaped(fix<1>, fix<16>)
+                         .reshaped(4, 4)
+                         .reshaped(fix<16>, fix<1>)
+                         .reshaped(8, 2)
+                         .reshaped(fix<4>, fix<4>)),
+                    MapMat(m.data(), 4, 4));
   }
 
-  VERIFY(is_same_eq(m.reshaped( 1,       AutoSize), m.reshaped( 1, 16)));
-  VERIFY(is_same_eq(m.reshaped(AutoSize, 16),       m.reshaped( 1, 16)));
-  VERIFY(is_same_eq(m.reshaped( 2,       AutoSize), m.reshaped( 2,  8)));
-  VERIFY(is_same_eq(m.reshaped(AutoSize, 8),        m.reshaped( 2,  8)));
-  VERIFY(is_same_eq(m.reshaped( 4,       AutoSize), m.reshaped( 4,  4)));
-  VERIFY(is_same_eq(m.reshaped(AutoSize, 4),        m.reshaped( 4,  4)));
-  VERIFY(is_same_eq(m.reshaped( 8,       AutoSize), m.reshaped( 8,  2)));
-  VERIFY(is_same_eq(m.reshaped(AutoSize, 2),        m.reshaped( 8,  2)));
-  VERIFY(is_same_eq(m.reshaped(16,       AutoSize), m.reshaped(16,  1)));
-  VERIFY(is_same_eq(m.reshaped(AutoSize,  1),       m.reshaped(16,  1)));
+  VERIFY(is_same_eq(m.reshaped(1, AutoSize), m.reshaped(1, 16)));
+  VERIFY(is_same_eq(m.reshaped(AutoSize, 16), m.reshaped(1, 16)));
+  VERIFY(is_same_eq(m.reshaped(2, AutoSize), m.reshaped(2, 8)));
+  VERIFY(is_same_eq(m.reshaped(AutoSize, 8), m.reshaped(2, 8)));
+  VERIFY(is_same_eq(m.reshaped(4, AutoSize), m.reshaped(4, 4)));
+  VERIFY(is_same_eq(m.reshaped(AutoSize, 4), m.reshaped(4, 4)));
+  VERIFY(is_same_eq(m.reshaped(8, AutoSize), m.reshaped(8, 2)));
+  VERIFY(is_same_eq(m.reshaped(AutoSize, 2), m.reshaped(8, 2)));
+  VERIFY(is_same_eq(m.reshaped(16, AutoSize), m.reshaped(16, 1)));
+  VERIFY(is_same_eq(m.reshaped(AutoSize, 1), m.reshaped(16, 1)));
 
-  VERIFY(is_same_eq(m.reshaped(fix< 1>,   AutoSize),  m.reshaped(fix< 1>, v16)));
-  VERIFY(is_same_eq(m.reshaped(AutoSize,  fix<16>),   m.reshaped( v1,     fix<16>)));
-  VERIFY(is_same_eq(m.reshaped(fix< 2>,   AutoSize),  m.reshaped(fix< 2>, v8)));
-  VERIFY(is_same_eq(m.reshaped(AutoSize,  fix< 8>),   m.reshaped( v2,     fix< 8>)));
-  VERIFY(is_same_eq(m.reshaped(fix< 4>,   AutoSize),  m.reshaped(fix< 4>, v4)));
-  VERIFY(is_same_eq(m.reshaped(AutoSize,  fix< 4>),   m.reshaped( v4,     fix< 4>)));
-  VERIFY(is_same_eq(m.reshaped(fix< 8>,   AutoSize),  m.reshaped(fix< 8>, v2)));
-  VERIFY(is_same_eq(m.reshaped(AutoSize,  fix< 2>),   m.reshaped( v8,     fix< 2>)));
-  VERIFY(is_same_eq(m.reshaped(fix<16>,   AutoSize),  m.reshaped(fix<16>, v1)));
-  VERIFY(is_same_eq(m.reshaped(AutoSize,  fix< 1>),   m.reshaped(v16,     fix< 1>)));
+  VERIFY(is_same_eq(m.reshaped(fix<1>, AutoSize), m.reshaped(fix<1>, v16)));
+  VERIFY(is_same_eq(m.reshaped(AutoSize, fix<16>), m.reshaped(v1, fix<16>)));
+  VERIFY(is_same_eq(m.reshaped(fix<2>, AutoSize), m.reshaped(fix<2>, v8)));
+  VERIFY(is_same_eq(m.reshaped(AutoSize, fix<8>), m.reshaped(v2, fix<8>)));
+  VERIFY(is_same_eq(m.reshaped(fix<4>, AutoSize), m.reshaped(fix<4>, v4)));
+  VERIFY(is_same_eq(m.reshaped(AutoSize, fix<4>), m.reshaped(v4, fix<4>)));
+  VERIFY(is_same_eq(m.reshaped(fix<8>, AutoSize), m.reshaped(fix<8>, v2)));
+  VERIFY(is_same_eq(m.reshaped(AutoSize, fix<2>), m.reshaped(v8, fix<2>)));
+  VERIFY(is_same_eq(m.reshaped(fix<16>, AutoSize), m.reshaped(fix<16>, v1)));
+  VERIFY(is_same_eq(m.reshaped(AutoSize, fix<1>), m.reshaped(v16, fix<1>)));
 
-  check_auto_reshape4x4<ColMajor> (m);
-  check_auto_reshape4x4<RowMajor> (m);
+  check_auto_reshape4x4<ColMajor>(m);
+  check_auto_reshape4x4<RowMajor>(m);
   check_auto_reshape4x4<AutoOrder>(m);
-  check_auto_reshape4x4<ColMajor> (m.transpose());
-  check_auto_reshape4x4<ColMajor> (m.transpose());
+  check_auto_reshape4x4<ColMajor>(m.transpose());
+  check_auto_reshape4x4<ColMajor>(m.transpose());
   check_auto_reshape4x4<AutoOrder>(m.transpose());
 
-  check_direct_access_reshape4x4(m,fix<MatType::Flags&RowMajorBit>);
+  check_direct_access_reshape4x4(m, fix<MatType::Flags & RowMajorBit>);
 
-  if((MatType::Flags&RowMajorBit)==0)
-  {
-    VERIFY_IS_EQUAL(m.template reshaped<ColMajor>(2,8),m.reshaped(2,8));
-    VERIFY_IS_EQUAL(m.template reshaped<ColMajor>(2,8),m.template reshaped<AutoOrder>(2,8));
-    VERIFY_IS_EQUAL(m.transpose().template reshaped<RowMajor>(2,8),m.transpose().template reshaped<AutoOrder>(2,8));
-  }
-  else
-  {
-    VERIFY_IS_EQUAL(m.template reshaped<ColMajor>(2,8),m.reshaped(2,8));
-    VERIFY_IS_EQUAL(m.template reshaped<RowMajor>(2,8),m.template reshaped<AutoOrder>(2,8));
-    VERIFY_IS_EQUAL(m.transpose().template reshaped<ColMajor>(2,8),m.transpose().template reshaped<AutoOrder>(2,8));
-    VERIFY_IS_EQUAL(m.transpose().reshaped(2,8),m.transpose().template reshaped<AutoOrder>(2,8));
+  if ((MatType::Flags & RowMajorBit) == 0) {
+    VERIFY_IS_EQUAL(m.template reshaped<ColMajor>(2, 8), m.reshaped(2, 8));
+    VERIFY_IS_EQUAL(m.template reshaped<ColMajor>(2, 8), m.template reshaped<AutoOrder>(2, 8));
+    VERIFY_IS_EQUAL(m.transpose().template reshaped<RowMajor>(2, 8), m.transpose().template reshaped<AutoOrder>(2, 8));
+  } else {
+    VERIFY_IS_EQUAL(m.template reshaped<ColMajor>(2, 8), m.reshaped(2, 8));
+    VERIFY_IS_EQUAL(m.template reshaped<RowMajor>(2, 8), m.template reshaped<AutoOrder>(2, 8));
+    VERIFY_IS_EQUAL(m.transpose().template reshaped<ColMajor>(2, 8), m.transpose().template reshaped<AutoOrder>(2, 8));
+    VERIFY_IS_EQUAL(m.transpose().reshaped(2, 8), m.transpose().template reshaped<AutoOrder>(2, 8));
   }
 
-  MatrixXi m28r1 = m.template reshaped<RowMajor>(2,8);
-  MatrixXi m28r2 = m.transpose().template reshaped<ColMajor>(8,2).transpose();
-  VERIFY_IS_EQUAL( m28r1, m28r2);
+  MatrixXi m28r1 = m.template reshaped<RowMajor>(2, 8);
+  MatrixXi m28r2 = m.transpose().template reshaped<ColMajor>(8, 2).transpose();
+  VERIFY_IS_EQUAL(m28r1, m28r2);
 
-  VERIFY(is_same_eq(m.reshaped(v16,fix<1>), m.reshaped()));
-  VERIFY_IS_EQUAL(m.reshaped(16,1).eval(), m.reshaped().eval());
-  VERIFY_IS_EQUAL(m.reshaped(1,16).eval(), m.reshaped().transpose().eval());
-  VERIFY_IS_EQUAL(m.reshaped().reshaped(2,8), m.reshaped(2,8));
-  VERIFY_IS_EQUAL(m.reshaped().reshaped(4,4), m.reshaped(4,4));
-  VERIFY_IS_EQUAL(m.reshaped().reshaped(8,2), m.reshaped(8,2));
+  VERIFY(is_same_eq(m.reshaped(v16, fix<1>), m.reshaped()));
+  VERIFY_IS_EQUAL(m.reshaped(16, 1).eval(), m.reshaped().eval());
+  VERIFY_IS_EQUAL(m.reshaped(1, 16).eval(), m.reshaped().transpose().eval());
+  VERIFY_IS_EQUAL(m.reshaped().reshaped(2, 8), m.reshaped(2, 8));
+  VERIFY_IS_EQUAL(m.reshaped().reshaped(4, 4), m.reshaped(4, 4));
+  VERIFY_IS_EQUAL(m.reshaped().reshaped(8, 2), m.reshaped(8, 2));
 
   VERIFY_IS_EQUAL(m.reshaped(), m.template reshaped<ColMajor>());
   VERIFY_IS_EQUAL(m.transpose().reshaped(), m.template reshaped<RowMajor>());
-  VERIFY_IS_EQUAL(m.template reshaped<RowMajor>(AutoSize,fix<1>), m.template reshaped<RowMajor>());
-  VERIFY_IS_EQUAL(m.template reshaped<AutoOrder>(AutoSize,fix<1>), m.template reshaped<AutoOrder>());
+  VERIFY_IS_EQUAL(m.template reshaped<RowMajor>(AutoSize, fix<1>), m.template reshaped<RowMajor>());
+  VERIFY_IS_EQUAL(m.template reshaped<AutoOrder>(AutoSize, fix<1>), m.template reshaped<AutoOrder>());
 
-  VERIFY(is_same_eq(m.reshaped(AutoSize,fix<1>), m.reshaped()));
-  VERIFY_IS_EQUAL(m.template reshaped<RowMajor>(fix<1>,AutoSize), m.transpose().reshaped().transpose());
+  VERIFY(is_same_eq(m.reshaped(AutoSize, fix<1>), m.reshaped()));
+  VERIFY_IS_EQUAL(m.template reshaped<RowMajor>(fix<1>, AutoSize), m.transpose().reshaped().transpose());
 
   // check assignment
   {
-    Matrix<Scalar,Dynamic,1> m1x(m.size()); m1x.setRandom();
+    Matrix<Scalar, Dynamic, 1> m1x(m.size());
+    m1x.setRandom();
     VERIFY_IS_APPROX(m.reshaped() = m1x, m1x);
-    VERIFY_IS_APPROX(m, m1x.reshaped(4,4));
-    
-    Matrix<Scalar,Dynamic,Dynamic> m28(2,8); m28.setRandom();
-    VERIFY_IS_APPROX(m.reshaped(2,8) = m28, m28);
-    VERIFY_IS_APPROX(m, m28.reshaped(4,4));
-    VERIFY_IS_APPROX(m.template reshaped<RowMajor>(2,8) = m28, m28);
+    VERIFY_IS_APPROX(m, m1x.reshaped(4, 4));
 
-    Matrix<Scalar,Dynamic,Dynamic> m24(2,4); m24.setRandom();
-    VERIFY_IS_APPROX(m(seq(0,last,2),all).reshaped(2,4) = m24, m24);
+    Matrix<Scalar, Dynamic, Dynamic> m28(2, 8);
+    m28.setRandom();
+    VERIFY_IS_APPROX(m.reshaped(2, 8) = m28, m28);
+    VERIFY_IS_APPROX(m, m28.reshaped(4, 4));
+    VERIFY_IS_APPROX(m.template reshaped<RowMajor>(2, 8) = m28, m28);
+
+    Matrix<Scalar, Dynamic, Dynamic> m24(2, 4);
+    m24.setRandom();
+    VERIFY_IS_APPROX(m(seq(0, last, 2), all).reshaped(2, 4) = m24, m24);
 
     // check constness:
-    m.reshaped(2,8).nestedExpression() = m;
+    m.reshaped(2, 8).nestedExpression() = m;
   }
 }
 
-template<typename BlockType>
+template <typename BlockType>
 void reshape_block(const BlockType& M) {
   auto dense = M.eval();
   Index rows = M.size() / 2;
   Index cols = M.size() / rows;
   VERIFY_IS_EQUAL(dense.reshaped(rows, cols), M.reshaped(rows, cols));
-  
-  for (Index i=0; i<rows; ++i) {
-    VERIFY_IS_EQUAL(dense.reshaped(rows, cols).row(i),
-                    M.reshaped(rows, cols).row(i));
+
+  for (Index i = 0; i < rows; ++i) {
+    VERIFY_IS_EQUAL(dense.reshaped(rows, cols).row(i), M.reshaped(rows, cols).row(i));
   }
-  
-  for (Index j = 0; j<cols; ++j) {
-    VERIFY_IS_EQUAL(dense.reshaped(rows, cols).col(j),
-                    M.reshaped(rows, cols).col(j));
+
+  for (Index j = 0; j < cols; ++j) {
+    VERIFY_IS_EQUAL(dense.reshaped(rows, cols).col(j), M.reshaped(rows, cols).col(j));
   }
 }
 
-EIGEN_DECLARE_TEST(reshape)
-{
-  typedef Matrix<int,Dynamic,Dynamic,RowMajor> RowMatrixXi;
-  typedef Matrix<int,4,4,RowMajor> RowMatrix4i;
+EIGEN_DECLARE_TEST(reshape) {
+  typedef Matrix<int, Dynamic, Dynamic, RowMajor> RowMatrixXi;
+  typedef Matrix<int, 4, 4, RowMajor> RowMatrix4i;
   MatrixXi mx = MatrixXi::Random(4, 4);
   Matrix4i m4 = Matrix4i::Random(4, 4);
   RowMatrixXi rmx = RowMatrixXi::Random(4, 4);
diff --git a/test/resize.cpp b/test/resize.cpp
index 646a75b..69db9b4 100644
--- a/test/resize.cpp
+++ b/test/resize.cpp
@@ -9,9 +9,8 @@
 
 #include "main.h"
 
-template<DenseIndex rows, DenseIndex cols>
-void resizeLikeTest()
-{
+template <DenseIndex rows, DenseIndex cols>
+void resizeLikeTest() {
   MatrixXf A(rows, cols);
   MatrixXf B;
   Matrix<double, rows, cols> C;
@@ -29,13 +28,12 @@
   VERIFY(x.rows() == cols && x.cols() == 1);
 }
 
-void resizeLikeTest12() { resizeLikeTest<1,2>(); }
-void resizeLikeTest1020() { resizeLikeTest<10,20>(); }
-void resizeLikeTest31() { resizeLikeTest<3,1>(); }
+void resizeLikeTest12() { resizeLikeTest<1, 2>(); }
+void resizeLikeTest1020() { resizeLikeTest<10, 20>(); }
+void resizeLikeTest31() { resizeLikeTest<3, 1>(); }
 
-EIGEN_DECLARE_TEST(resize)
-{
-  CALL_SUBTEST(resizeLikeTest12() );
-  CALL_SUBTEST(resizeLikeTest1020() );
-  CALL_SUBTEST(resizeLikeTest31() );
+EIGEN_DECLARE_TEST(resize) {
+  CALL_SUBTEST(resizeLikeTest12());
+  CALL_SUBTEST(resizeLikeTest1020());
+  CALL_SUBTEST(resizeLikeTest31());
 }
diff --git a/test/rvalue_types.cpp b/test/rvalue_types.cpp
index 01df21b..5db28b8 100644
--- a/test/rvalue_types.cpp
+++ b/test/rvalue_types.cpp
@@ -16,21 +16,18 @@
 #include <Eigen/Core>
 
 template <typename MatrixType>
-void rvalue_copyassign(const MatrixType& m)
-{
-
+void rvalue_copyassign(const MatrixType& m) {
   typedef typename internal::traits<MatrixType>::Scalar Scalar;
-  
+
   // create a temporary which we are about to destroy by moving
   MatrixType tmp = m;
   std::uintptr_t src_address = reinterpret_cast<std::uintptr_t>(tmp.data());
-  
-  Eigen::internal::set_is_malloc_allowed(false); // moving from an rvalue reference shall never allocate
+
+  Eigen::internal::set_is_malloc_allowed(false);  // moving from an rvalue reference shall never allocate
   // move the temporary to n
   MatrixType n = std::move(tmp);
   std::uintptr_t dst_address = reinterpret_cast<std::uintptr_t>(n.data());
-  if (MatrixType::RowsAtCompileTime==Dynamic|| MatrixType::ColsAtCompileTime==Dynamic)
-  {
+  if (MatrixType::RowsAtCompileTime == Dynamic || MatrixType::ColsAtCompileTime == Dynamic) {
     // verify that we actually moved the guts
     VERIFY_IS_EQUAL(src_address, dst_address);
     VERIFY_IS_EQUAL(tmp.size(), 0);
@@ -38,20 +35,19 @@
   }
 
   // verify that the content did not change
-  Scalar abs_diff = (m-n).array().abs().sum();
+  Scalar abs_diff = (m - n).array().abs().sum();
   VERIFY_IS_EQUAL(abs_diff, Scalar(0));
   Eigen::internal::set_is_malloc_allowed(true);
 }
-template<typename TranspositionsType>
-void rvalue_transpositions(Index rows)
-{
+template <typename TranspositionsType>
+void rvalue_transpositions(Index rows) {
   typedef typename TranspositionsType::IndicesType PermutationVectorType;
 
   PermutationVectorType vec;
   randomPermutationVector(vec, rows);
   TranspositionsType t0(vec);
 
-  Eigen::internal::set_is_malloc_allowed(false); // moving from an rvalue reference shall never allocate
+  Eigen::internal::set_is_malloc_allowed(false);  // moving from an rvalue reference shall never allocate
 
   std::uintptr_t t0_address = reinterpret_cast<std::uintptr_t>(t0.indices().data());
 
@@ -63,7 +59,6 @@
   VERIFY_IS_EQUAL(t0.size(), 0);
   VERIFY_IS_EQUAL(reinterpret_cast<std::uintptr_t>(t0.indices().data()), std::uintptr_t(0));
 
-
   // Move assignment:
   t0 = std::move(t1);
   t0_address = reinterpret_cast<std::uintptr_t>(t0.indices().data());
@@ -76,67 +71,69 @@
 }
 
 template <typename MatrixType>
-void rvalue_move(const MatrixType& m)
-{
-    // lvalue reference is copied
-    MatrixType b(m);
-    VERIFY_IS_EQUAL(b, m);
+void rvalue_move(const MatrixType& m) {
+  // lvalue reference is copied
+  MatrixType b(m);
+  VERIFY_IS_EQUAL(b, m);
 
-    // lvalue reference is copied
-    MatrixType c{m};
-    VERIFY_IS_EQUAL(c, m);
+  // lvalue reference is copied
+  MatrixType c{m};
+  VERIFY_IS_EQUAL(c, m);
 
-    // lvalue reference is copied
-    MatrixType d = m;
-    VERIFY_IS_EQUAL(d, m);
+  // lvalue reference is copied
+  MatrixType d = m;
+  VERIFY_IS_EQUAL(d, m);
 
-    // rvalue reference is moved - copy constructor.
-    MatrixType e_src(m);
-    VERIFY_IS_EQUAL(e_src, m);
-    MatrixType e_dst(std::move(e_src));
-    VERIFY_IS_EQUAL(e_dst, m);
+  // rvalue reference is moved - copy constructor.
+  MatrixType e_src(m);
+  VERIFY_IS_EQUAL(e_src, m);
+  MatrixType e_dst(std::move(e_src));
+  VERIFY_IS_EQUAL(e_dst, m);
 
-    // rvalue reference is moved - copy constructor.
-    MatrixType f_src(m);
-    VERIFY_IS_EQUAL(f_src, m);
-    MatrixType f_dst = std::move(f_src);
-    VERIFY_IS_EQUAL(f_dst, m);
-    
-    // rvalue reference is moved - copy assignment.
-    MatrixType g_src(m);
-    VERIFY_IS_EQUAL(g_src, m);
-    MatrixType g_dst;
-    g_dst = std::move(g_src);
-    VERIFY_IS_EQUAL(g_dst, m);
+  // rvalue reference is moved - copy constructor.
+  MatrixType f_src(m);
+  VERIFY_IS_EQUAL(f_src, m);
+  MatrixType f_dst = std::move(f_src);
+  VERIFY_IS_EQUAL(f_dst, m);
+
+  // rvalue reference is moved - copy assignment.
+  MatrixType g_src(m);
+  VERIFY_IS_EQUAL(g_src, m);
+  MatrixType g_dst;
+  g_dst = std::move(g_src);
+  VERIFY_IS_EQUAL(g_dst, m);
 }
 
-EIGEN_DECLARE_TEST(rvalue_types)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1(rvalue_copyassign( MatrixXf::Random(50,50).eval() ));
-    CALL_SUBTEST_1(rvalue_copyassign( ArrayXXf::Random(50,50).eval() ));
+EIGEN_DECLARE_TEST(rvalue_types) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(rvalue_copyassign(MatrixXf::Random(50, 50).eval()));
+    CALL_SUBTEST_1(rvalue_copyassign(ArrayXXf::Random(50, 50).eval()));
 
-    CALL_SUBTEST_1(rvalue_copyassign( Matrix<float,1,Dynamic>::Random(50).eval() ));
-    CALL_SUBTEST_1(rvalue_copyassign( Array<float,1,Dynamic>::Random(50).eval() ));
+    CALL_SUBTEST_1(rvalue_copyassign(Matrix<float, 1, Dynamic>::Random(50).eval()));
+    CALL_SUBTEST_1(rvalue_copyassign(Array<float, 1, Dynamic>::Random(50).eval()));
 
-    CALL_SUBTEST_1(rvalue_copyassign( Matrix<float,Dynamic,1>::Random(50).eval() ));
-    CALL_SUBTEST_1(rvalue_copyassign( Array<float,Dynamic,1>::Random(50).eval() ));
+    CALL_SUBTEST_1(rvalue_copyassign(Matrix<float, Dynamic, 1>::Random(50).eval()));
+    CALL_SUBTEST_1(rvalue_copyassign(Array<float, Dynamic, 1>::Random(50).eval()));
 
-    CALL_SUBTEST_2(rvalue_copyassign( Array<float,2,1>::Random().eval() ));
-    CALL_SUBTEST_2(rvalue_copyassign( Array<float,3,1>::Random().eval() ));
-    CALL_SUBTEST_2(rvalue_copyassign( Array<float,4,1>::Random().eval() ));
+    CALL_SUBTEST_2(rvalue_copyassign(Array<float, 2, 1>::Random().eval()));
+    CALL_SUBTEST_2(rvalue_copyassign(Array<float, 3, 1>::Random().eval()));
+    CALL_SUBTEST_2(rvalue_copyassign(Array<float, 4, 1>::Random().eval()));
 
-    CALL_SUBTEST_2(rvalue_copyassign( Array<float,2,2>::Random().eval() ));
-    CALL_SUBTEST_2(rvalue_copyassign( Array<float,3,3>::Random().eval() ));
-    CALL_SUBTEST_2(rvalue_copyassign( Array<float,4,4>::Random().eval() ));
-  
-    CALL_SUBTEST_3((rvalue_transpositions<PermutationMatrix<Dynamic, Dynamic, int> >(internal::random<int>(1,EIGEN_TEST_MAX_SIZE))));
-    CALL_SUBTEST_3((rvalue_transpositions<PermutationMatrix<Dynamic, Dynamic, Index> >(internal::random<int>(1,EIGEN_TEST_MAX_SIZE))));
-    CALL_SUBTEST_4((rvalue_transpositions<Transpositions<Dynamic, Dynamic, int> >(internal::random<int>(1,EIGEN_TEST_MAX_SIZE))));
-    CALL_SUBTEST_4((rvalue_transpositions<Transpositions<Dynamic, Dynamic, Index> >(internal::random<int>(1,EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_2(rvalue_copyassign(Array<float, 2, 2>::Random().eval()));
+    CALL_SUBTEST_2(rvalue_copyassign(Array<float, 3, 3>::Random().eval()));
+    CALL_SUBTEST_2(rvalue_copyassign(Array<float, 4, 4>::Random().eval()));
 
-    CALL_SUBTEST_5(rvalue_move(Eigen::Matrix<MovableScalar<float>,1,3>::Random().eval()));
-    CALL_SUBTEST_5(rvalue_move(Eigen::Matrix<SafeScalar<float>,1,3>::Random().eval()));
-    CALL_SUBTEST_5(rvalue_move(Eigen::Matrix<SafeScalar<float>,Eigen::Dynamic,Eigen::Dynamic>::Random(1,3).eval()));
+    CALL_SUBTEST_3((rvalue_transpositions<PermutationMatrix<Dynamic, Dynamic, int> >(
+        internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_3((rvalue_transpositions<PermutationMatrix<Dynamic, Dynamic, Index> >(
+        internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_4(
+        (rvalue_transpositions<Transpositions<Dynamic, Dynamic, int> >(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_4((rvalue_transpositions<Transpositions<Dynamic, Dynamic, Index> >(
+        internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+
+    CALL_SUBTEST_5(rvalue_move(Eigen::Matrix<MovableScalar<float>, 1, 3>::Random().eval()));
+    CALL_SUBTEST_5(rvalue_move(Eigen::Matrix<SafeScalar<float>, 1, 3>::Random().eval()));
+    CALL_SUBTEST_5(rvalue_move(Eigen::Matrix<SafeScalar<float>, Eigen::Dynamic, Eigen::Dynamic>::Random(1, 3).eval()));
   }
 }
diff --git a/test/schur_complex.cpp b/test/schur_complex.cpp
index 26acb8c..0449896 100644
--- a/test/schur_complex.cpp
+++ b/test/schur_complex.cpp
@@ -11,21 +11,21 @@
 #include <limits>
 #include <Eigen/Eigenvalues>
 
-template<typename MatrixType> void schur(int size = MatrixType::ColsAtCompileTime)
-{
+template <typename MatrixType>
+void schur(int size = MatrixType::ColsAtCompileTime) {
   typedef typename ComplexSchur<MatrixType>::ComplexScalar ComplexScalar;
   typedef typename ComplexSchur<MatrixType>::ComplexMatrixType ComplexMatrixType;
 
   // Test basic functionality: T is triangular and A = U T U*
-  for(int counter = 0; counter < g_repeat; ++counter) {
+  for (int counter = 0; counter < g_repeat; ++counter) {
     MatrixType A = MatrixType::Random(size, size);
     ComplexSchur<MatrixType> schurOfA(A);
     VERIFY_IS_EQUAL(schurOfA.info(), Success);
     ComplexMatrixType U = schurOfA.matrixU();
     ComplexMatrixType T = schurOfA.matrixT();
-    for(int row = 1; row < size; ++row) {
-      for(int col = 0; col < row; ++col) {
-        VERIFY(T(row,col) == (typename MatrixType::Scalar)0);
+    for (int row = 1; row < size; ++row) {
+      for (int col = 0; col < row; ++col) {
+        VERIFY(T(row, col) == (typename MatrixType::Scalar)0);
       }
     }
     VERIFY_IS_APPROX(A.template cast<ComplexScalar>(), U * T * U.adjoint());
@@ -36,7 +36,7 @@
   VERIFY_RAISES_ASSERT(csUninitialized.matrixT());
   VERIFY_RAISES_ASSERT(csUninitialized.matrixU());
   VERIFY_RAISES_ASSERT(csUninitialized.info());
-  
+
   // Test whether compute() and constructor returns same result
   MatrixType A = MatrixType::Random(size, size);
   ComplexSchur<MatrixType> cs1;
@@ -59,8 +59,8 @@
   VERIFY_IS_EQUAL(cs3.getMaxIterations(), 1);
 
   MatrixType Atriangular = A;
-  Atriangular.template triangularView<StrictlyLower>().setZero(); 
-  cs3.setMaxIterations(1).compute(Atriangular); // triangular matrices do not need any iterations
+  Atriangular.template triangularView<StrictlyLower>().setZero();
+  cs3.setMaxIterations(1).compute(Atriangular);  // triangular matrices do not need any iterations
   VERIFY_IS_EQUAL(cs3.info(), Success);
   VERIFY_IS_EQUAL(cs3.matrixT(), Atriangular.template cast<ComplexScalar>());
   VERIFY_IS_EQUAL(cs3.matrixU(), ComplexMatrixType::Identity(size, size));
@@ -71,21 +71,19 @@
   VERIFY_IS_EQUAL(cs1.matrixT(), csOnlyT.matrixT());
   VERIFY_RAISES_ASSERT(csOnlyT.matrixU());
 
-  if (size > 1 && size < 20)
-  {
+  if (size > 1 && size < 20) {
     // Test matrix with NaN
-    A(0,0) = std::numeric_limits<typename MatrixType::RealScalar>::quiet_NaN();
+    A(0, 0) = std::numeric_limits<typename MatrixType::RealScalar>::quiet_NaN();
     ComplexSchur<MatrixType> csNaN(A);
     VERIFY_IS_EQUAL(csNaN.info(), NoConvergence);
   }
 }
 
-EIGEN_DECLARE_TEST(schur_complex)
-{
-  CALL_SUBTEST_1(( schur<Matrix4cd>() ));
-  CALL_SUBTEST_2(( schur<MatrixXcf>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/4)) ));
-  CALL_SUBTEST_3(( schur<Matrix<std::complex<float>, 1, 1> >() ));
-  CALL_SUBTEST_4(( schur<Matrix<float, 3, 3, Eigen::RowMajor> >() ));
+EIGEN_DECLARE_TEST(schur_complex) {
+  CALL_SUBTEST_1((schur<Matrix4cd>()));
+  CALL_SUBTEST_2((schur<MatrixXcf>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 4))));
+  CALL_SUBTEST_3((schur<Matrix<std::complex<float>, 1, 1> >()));
+  CALL_SUBTEST_4((schur<Matrix<float, 3, 3, Eigen::RowMajor> >()));
 
   // Test problem size constructors
   CALL_SUBTEST_5(ComplexSchur<MatrixXf>(10));
diff --git a/test/schur_real.cpp b/test/schur_real.cpp
index 8b40ddd..cd0be92 100644
--- a/test/schur_real.cpp
+++ b/test/schur_real.cpp
@@ -11,34 +11,34 @@
 #include <limits>
 #include <Eigen/Eigenvalues>
 
-template<typename MatrixType> void verifyIsQuasiTriangular(const MatrixType& T)
-{
+template <typename MatrixType>
+void verifyIsQuasiTriangular(const MatrixType& T) {
   const Index size = T.cols();
   typedef typename MatrixType::Scalar Scalar;
 
   // Check T is lower Hessenberg
-  for(int row = 2; row < size; ++row) {
-    for(int col = 0; col < row - 1; ++col) {
-      VERIFY_IS_EQUAL(T(row,col), Scalar(0));
+  for (int row = 2; row < size; ++row) {
+    for (int col = 0; col < row - 1; ++col) {
+      VERIFY_IS_EQUAL(T(row, col), Scalar(0));
     }
   }
 
   // Check that any non-zero on the subdiagonal is followed by a zero and is
   // part of a 2x2 diagonal block with imaginary eigenvalues.
-  for(int row = 1; row < size; ++row) {
+  for (int row = 1; row < size; ++row) {
     if (!numext::is_exactly_zero(T(row, row - 1))) {
-      VERIFY(row == size-1 || numext::is_exactly_zero(T(row + 1, row)));
-      Scalar tr = T(row-1,row-1) + T(row,row);
-      Scalar det = T(row-1,row-1) * T(row,row) - T(row-1,row) * T(row,row-1);
+      VERIFY(row == size - 1 || numext::is_exactly_zero(T(row + 1, row)));
+      Scalar tr = T(row - 1, row - 1) + T(row, row);
+      Scalar det = T(row - 1, row - 1) * T(row, row) - T(row - 1, row) * T(row, row - 1);
       VERIFY(4 * det > tr * tr);
     }
   }
 }
 
-template<typename MatrixType> void schur(int size = MatrixType::ColsAtCompileTime)
-{
+template <typename MatrixType>
+void schur(int size = MatrixType::ColsAtCompileTime) {
   // Test basic functionality: T is quasi-triangular and A = U T U*
-  for(int counter = 0; counter < g_repeat; ++counter) {
+  for (int counter = 0; counter < g_repeat; ++counter) {
     MatrixType A = MatrixType::Random(size, size);
     RealSchur<MatrixType> schurOfA(A);
     VERIFY_IS_EQUAL(schurOfA.info(), Success);
@@ -53,7 +53,7 @@
   VERIFY_RAISES_ASSERT(rsUninitialized.matrixT());
   VERIFY_RAISES_ASSERT(rsUninitialized.matrixU());
   VERIFY_RAISES_ASSERT(rsUninitialized.info());
-  
+
   // Test whether compute() and constructor returns same result
   MatrixType A = MatrixType::Random(size, size);
   RealSchur<MatrixType> rs1;
@@ -77,10 +77,10 @@
   }
 
   MatrixType Atriangular = A;
-  Atriangular.template triangularView<StrictlyLower>().setZero(); 
-  rs3.setMaxIterations(1).compute(Atriangular); // triangular matrices do not need any iterations
+  Atriangular.template triangularView<StrictlyLower>().setZero();
+  rs3.setMaxIterations(1).compute(Atriangular);  // triangular matrices do not need any iterations
   VERIFY_IS_EQUAL(rs3.info(), Success);
-  VERIFY_IS_APPROX(rs3.matrixT(), Atriangular); // approx because of scaling...
+  VERIFY_IS_APPROX(rs3.matrixT(), Atriangular);  // approx because of scaling...
   VERIFY_IS_EQUAL(rs3.matrixU(), MatrixType::Identity(size, size));
 
   // Test computation of only T, not U
@@ -89,21 +89,19 @@
   VERIFY_IS_EQUAL(rs1.matrixT(), rsOnlyT.matrixT());
   VERIFY_RAISES_ASSERT(rsOnlyT.matrixU());
 
-  if (size > 2 && size < 20)
-  {
+  if (size > 2 && size < 20) {
     // Test matrix with NaN
-    A(0,0) = std::numeric_limits<typename MatrixType::Scalar>::quiet_NaN();
+    A(0, 0) = std::numeric_limits<typename MatrixType::Scalar>::quiet_NaN();
     RealSchur<MatrixType> rsNaN(A);
     VERIFY_IS_EQUAL(rsNaN.info(), NoConvergence);
   }
 }
 
-EIGEN_DECLARE_TEST(schur_real)
-{
-  CALL_SUBTEST_1(( schur<Matrix4f>() ));
-  CALL_SUBTEST_2(( schur<MatrixXd>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/4)) ));
-  CALL_SUBTEST_3(( schur<Matrix<float, 1, 1> >() ));
-  CALL_SUBTEST_4(( schur<Matrix<double, 3, 3, Eigen::RowMajor> >() ));
+EIGEN_DECLARE_TEST(schur_real) {
+  CALL_SUBTEST_1((schur<Matrix4f>()));
+  CALL_SUBTEST_2((schur<MatrixXd>(internal::random<int>(1, EIGEN_TEST_MAX_SIZE / 4))));
+  CALL_SUBTEST_3((schur<Matrix<float, 1, 1> >()));
+  CALL_SUBTEST_4((schur<Matrix<double, 3, 3, Eigen::RowMajor> >()));
 
   // Test problem size constructors
   CALL_SUBTEST_5(RealSchur<MatrixXf>(10));
diff --git a/test/selfadjoint.cpp b/test/selfadjoint.cpp
index 74495fb..38075ee 100644
--- a/test/selfadjoint.cpp
+++ b/test/selfadjoint.cpp
@@ -13,17 +13,14 @@
 // This file tests the basic selfadjointView API,
 // the related products and decompositions are tested in specific files.
 
-template<typename MatrixType> void selfadjoint(const MatrixType& m)
-{
+template <typename MatrixType>
+void selfadjoint(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
 
   Index rows = m.rows();
   Index cols = m.cols();
 
-  MatrixType m1 = MatrixType::Random(rows, cols),
-             m2 = MatrixType::Random(rows, cols),
-             m3(rows, cols),
-             m4(rows, cols);
+  MatrixType m1 = MatrixType::Random(rows, cols), m2 = MatrixType::Random(rows, cols), m3(rows, cols), m4(rows, cols);
 
   m1.diagonal() = m1.diagonal().real().template cast<Scalar>();
 
@@ -39,34 +36,31 @@
   m3 = m1.template selfadjointView<Upper>();
   m4 = m2;
   m4 += m1.template selfadjointView<Upper>();
-  VERIFY_IS_APPROX(m4, m2+m3);
+  VERIFY_IS_APPROX(m4, m2 + m3);
 
   m3 = m1.template selfadjointView<Lower>();
   m4 = m2;
   m4 -= m1.template selfadjointView<Lower>();
-  VERIFY_IS_APPROX(m4, m2-m3);
+  VERIFY_IS_APPROX(m4, m2 - m3);
 }
 
-void bug_159()
-{
+void bug_159() {
   Matrix3d m = Matrix3d::Random().selfadjointView<Lower>();
   EIGEN_UNUSED_VARIABLE(m)
 }
 
-EIGEN_DECLARE_TEST(selfadjoint)
-{
-  for(int i = 0; i < g_repeat ; i++)
-  {
-    int s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE);
+EIGEN_DECLARE_TEST(selfadjoint) {
+  for (int i = 0; i < g_repeat; i++) {
+    int s = internal::random<int>(1, EIGEN_TEST_MAX_SIZE);
 
-    CALL_SUBTEST_1( selfadjoint(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( selfadjoint(Matrix<float, 2, 2>()) );
-    CALL_SUBTEST_3( selfadjoint(Matrix3cf()) );
-    CALL_SUBTEST_4( selfadjoint(MatrixXcd(s,s)) );
-    CALL_SUBTEST_5( selfadjoint(Matrix<float,Dynamic,Dynamic,RowMajor>(s, s)) );
-    
+    CALL_SUBTEST_1(selfadjoint(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(selfadjoint(Matrix<float, 2, 2>()));
+    CALL_SUBTEST_3(selfadjoint(Matrix3cf()));
+    CALL_SUBTEST_4(selfadjoint(MatrixXcd(s, s)));
+    CALL_SUBTEST_5(selfadjoint(Matrix<float, Dynamic, Dynamic, RowMajor>(s, s)));
+
     TEST_SET_BUT_UNUSED_VARIABLE(s)
   }
-  
-  CALL_SUBTEST_1( bug_159() );
+
+  CALL_SUBTEST_1(bug_159());
 }
diff --git a/test/serializer.cpp b/test/serializer.cpp
index d3e7ba5..0c8416f 100644
--- a/test/serializer.cpp
+++ b/test/serializer.cpp
@@ -15,9 +15,7 @@
 
 template <typename T>
 struct RandomImpl {
-  static auto Create(Eigen::Index rows, Eigen::Index cols) {
-    return T::Random(rows, cols);
-  }
+  static auto Create(Eigen::Index rows, Eigen::Index cols) { return T::Random(rows, cols); }
 };
 
 template <typename Scalar, int Options, typename DenseIndex>
@@ -85,13 +83,13 @@
 void test_pod_type() {
   MyPodType initial = {1.3, 17, 1.9f};
   MyPodType clone = {-1, -1, -1};
-  
+
   Eigen::Serializer<MyPodType> serializer;
-  
+
   // Determine required size.
   size_t buffer_size = serializer.size(initial);
   VERIFY_IS_EQUAL(buffer_size, sizeof(MyPodType));
-  
+
   // Serialize.
   std::vector<uint8_t> buffer(buffer_size);
   uint8_t* begin = buffer.data();
@@ -99,7 +97,7 @@
   uint8_t* dest = serializer.serialize(begin, end, initial);
   VERIFY(dest != nullptr);
   VERIFY_IS_EQUAL(dest - begin, buffer_size);
-  
+
   // Deserialize.
   const uint8_t* src = serializer.deserialize(begin, end, clone);
   VERIFY(src != nullptr);
@@ -126,7 +124,7 @@
 }
 
 // Matrix, Vector, Array
-template<typename T>
+template <typename T>
 void test_eigen_type(const T& type) {
   const Index rows = type.rows();
   const Index cols = type.cols();
@@ -142,7 +140,7 @@
   uint8_t* dest = serializer.serialize(begin, end, initial);
   VERIFY(dest != nullptr);
   VERIFY_IS_EQUAL(dest - begin, buffer_size);
-  
+
   // Deserialize.
   T clone;
   const uint8_t* src = serializer.deserialize(begin, end, clone);
@@ -168,14 +166,13 @@
 }
 
 // Test a collection of dense types.
-template<typename T1, typename T2, typename T3>
+template <typename T1, typename T2, typename T3>
 void test_dense_types(const T1& type1, const T2& type2, const T3& type3) {
-  
   // Make random inputs.
   const T1 x1 = T1::Random(type1.rows(), type1.cols());
   const T2 x2 = T2::Random(type2.rows(), type2.cols());
   const T3 x3 = T3::Random(type3.rows(), type3.cols());
-  
+
   // Allocate buffer and serialize.
   size_t buffer_size = Eigen::serialize_size(x1, x2, x3);
   std::vector<uint8_t> buffer(buffer_size);
@@ -183,7 +180,7 @@
   uint8_t* end = buffer.data() + buffer.size();
   uint8_t* dest = Eigen::serialize(begin, end, x1, x2, x3);
   VERIFY(dest != nullptr);
-  
+
   // Clone everything.
   T1 y1;
   T2 y2;
@@ -213,21 +210,18 @@
   VERIFY(src == nullptr);
 }
 
-EIGEN_DECLARE_TEST(serializer)
-{
-  CALL_SUBTEST( test_pod_type() );
+EIGEN_DECLARE_TEST(serializer) {
+  CALL_SUBTEST(test_pod_type());
 
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST( test_eigen_type(Eigen::Array33f()) );
-    CALL_SUBTEST( test_eigen_type(Eigen::ArrayXd(10)) );
-    CALL_SUBTEST( test_eigen_type(Eigen::Vector3f()) );
-    CALL_SUBTEST( test_eigen_type(Eigen::Matrix4d()) );
-    CALL_SUBTEST( test_eigen_type(Eigen::MatrixXd(15, 17)) );
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST(test_eigen_type(Eigen::Array33f()));
+    CALL_SUBTEST(test_eigen_type(Eigen::ArrayXd(10)));
+    CALL_SUBTEST(test_eigen_type(Eigen::Vector3f()));
+    CALL_SUBTEST(test_eigen_type(Eigen::Matrix4d()));
+    CALL_SUBTEST(test_eigen_type(Eigen::MatrixXd(15, 17)));
     CALL_SUBTEST(test_eigen_type(Eigen::SparseMatrix<float>(13, 12)));
     CALL_SUBTEST(test_eigen_type(Eigen::SparseVector<float>(17)));
 
-    CALL_SUBTEST( test_dense_types( Eigen::Array33f(),
-                                    Eigen::ArrayXd(10),
-                                    Eigen::MatrixXd(15, 17)) );
+    CALL_SUBTEST(test_dense_types(Eigen::Array33f(), Eigen::ArrayXd(10), Eigen::MatrixXd(15, 17)));
   }
 }
diff --git a/test/simplicial_cholesky.cpp b/test/simplicial_cholesky.cpp
index 538d01a..ca67496 100644
--- a/test/simplicial_cholesky.cpp
+++ b/test/simplicial_cholesky.cpp
@@ -9,17 +9,17 @@
 
 #include "sparse_solver.h"
 
-template<typename T, typename I_, int flag> void test_simplicial_cholesky_T()
-{
-  typedef SparseMatrix<T,flag,I_> SparseMatrixType;
+template <typename T, typename I_, int flag>
+void test_simplicial_cholesky_T() {
+  typedef SparseMatrix<T, flag, I_> SparseMatrixType;
   SimplicialCholesky<SparseMatrixType, Lower> chol_colmajor_lower_amd;
   SimplicialCholesky<SparseMatrixType, Upper> chol_colmajor_upper_amd;
-  SimplicialLLT<     SparseMatrixType, Lower> llt_colmajor_lower_amd;
-  SimplicialLLT<     SparseMatrixType, Upper> llt_colmajor_upper_amd;
-  SimplicialLDLT<    SparseMatrixType, Lower> ldlt_colmajor_lower_amd;
-  SimplicialLDLT<    SparseMatrixType, Upper> ldlt_colmajor_upper_amd;
-  SimplicialLDLT<    SparseMatrixType, Lower, NaturalOrdering<I_> > ldlt_colmajor_lower_nat;
-  SimplicialLDLT<    SparseMatrixType, Upper, NaturalOrdering<I_> > ldlt_colmajor_upper_nat;
+  SimplicialLLT<SparseMatrixType, Lower> llt_colmajor_lower_amd;
+  SimplicialLLT<SparseMatrixType, Upper> llt_colmajor_upper_amd;
+  SimplicialLDLT<SparseMatrixType, Lower> ldlt_colmajor_lower_amd;
+  SimplicialLDLT<SparseMatrixType, Upper> ldlt_colmajor_upper_amd;
+  SimplicialLDLT<SparseMatrixType, Lower, NaturalOrdering<I_> > ldlt_colmajor_lower_nat;
+  SimplicialLDLT<SparseMatrixType, Upper, NaturalOrdering<I_> > ldlt_colmajor_upper_nat;
 
   check_sparse_spd_solving(chol_colmajor_lower_amd);
   check_sparse_spd_solving(chol_colmajor_upper_amd);
@@ -27,24 +27,23 @@
   check_sparse_spd_solving(llt_colmajor_upper_amd);
   check_sparse_spd_solving(ldlt_colmajor_lower_amd);
   check_sparse_spd_solving(ldlt_colmajor_upper_amd);
-  
+
   check_sparse_spd_determinant(chol_colmajor_lower_amd);
   check_sparse_spd_determinant(chol_colmajor_upper_amd);
   check_sparse_spd_determinant(llt_colmajor_lower_amd);
   check_sparse_spd_determinant(llt_colmajor_upper_amd);
   check_sparse_spd_determinant(ldlt_colmajor_lower_amd);
   check_sparse_spd_determinant(ldlt_colmajor_upper_amd);
-  
-  check_sparse_spd_solving(ldlt_colmajor_lower_nat, (std::min)(300,EIGEN_TEST_MAX_SIZE), 1000);
-  check_sparse_spd_solving(ldlt_colmajor_upper_nat, (std::min)(300,EIGEN_TEST_MAX_SIZE), 1000);
+
+  check_sparse_spd_solving(ldlt_colmajor_lower_nat, (std::min)(300, EIGEN_TEST_MAX_SIZE), 1000);
+  check_sparse_spd_solving(ldlt_colmajor_upper_nat, (std::min)(300, EIGEN_TEST_MAX_SIZE), 1000);
 }
 
-EIGEN_DECLARE_TEST(simplicial_cholesky)
-{
-  CALL_SUBTEST_11(( test_simplicial_cholesky_T<double,               int, ColMajor>() ));
-  CALL_SUBTEST_12(( test_simplicial_cholesky_T<std::complex<double>, int, ColMajor>() ));
-  CALL_SUBTEST_13(( test_simplicial_cholesky_T<double,          long int, ColMajor>() ));
-  CALL_SUBTEST_21(( test_simplicial_cholesky_T<double,               int, RowMajor>() ));
-  CALL_SUBTEST_22(( test_simplicial_cholesky_T<std::complex<double>, int, RowMajor>() ));
-  CALL_SUBTEST_23(( test_simplicial_cholesky_T<double,          long int, RowMajor>() ));
+EIGEN_DECLARE_TEST(simplicial_cholesky) {
+  CALL_SUBTEST_11((test_simplicial_cholesky_T<double, int, ColMajor>()));
+  CALL_SUBTEST_12((test_simplicial_cholesky_T<std::complex<double>, int, ColMajor>()));
+  CALL_SUBTEST_13((test_simplicial_cholesky_T<double, long int, ColMajor>()));
+  CALL_SUBTEST_21((test_simplicial_cholesky_T<double, int, RowMajor>()));
+  CALL_SUBTEST_22((test_simplicial_cholesky_T<std::complex<double>, int, RowMajor>()));
+  CALL_SUBTEST_23((test_simplicial_cholesky_T<double, long int, RowMajor>()));
 }
diff --git a/test/sizeof.cpp b/test/sizeof.cpp
index af34e97..4820ee8 100644
--- a/test/sizeof.cpp
+++ b/test/sizeof.cpp
@@ -9,39 +9,39 @@
 
 #include "main.h"
 
-template<typename MatrixType> void verifySizeOf(const MatrixType&)
-{
+template <typename MatrixType>
+void verifySizeOf(const MatrixType&) {
   typedef typename MatrixType::Scalar Scalar;
-  if (MatrixType::RowsAtCompileTime!=Dynamic && MatrixType::ColsAtCompileTime!=Dynamic)
-    VERIFY_IS_EQUAL(std::ptrdiff_t(sizeof(MatrixType)),std::ptrdiff_t(sizeof(Scalar))*std::ptrdiff_t(MatrixType::SizeAtCompileTime));
+  if (MatrixType::RowsAtCompileTime != Dynamic && MatrixType::ColsAtCompileTime != Dynamic)
+    VERIFY_IS_EQUAL(std::ptrdiff_t(sizeof(MatrixType)),
+                    std::ptrdiff_t(sizeof(Scalar)) * std::ptrdiff_t(MatrixType::SizeAtCompileTime));
   else
-    VERIFY_IS_EQUAL(sizeof(MatrixType),sizeof(Scalar*) + 2 * sizeof(Index));
+    VERIFY_IS_EQUAL(sizeof(MatrixType), sizeof(Scalar*) + 2 * sizeof(Index));
 }
 
-EIGEN_DECLARE_TEST(sizeof)
-{
-  CALL_SUBTEST(verifySizeOf(Matrix<float, 1, 1>()) );
-  CALL_SUBTEST(verifySizeOf(Array<float, 2, 1>()) );
-  CALL_SUBTEST(verifySizeOf(Array<float, 3, 1>()) );
-  CALL_SUBTEST(verifySizeOf(Array<float, 4, 1>()) );
-  CALL_SUBTEST(verifySizeOf(Array<float, 5, 1>()) );
-  CALL_SUBTEST(verifySizeOf(Array<float, 6, 1>()) );
-  CALL_SUBTEST(verifySizeOf(Array<float, 7, 1>()) );
-  CALL_SUBTEST(verifySizeOf(Array<float, 8, 1>()) );
-  CALL_SUBTEST(verifySizeOf(Array<float, 9, 1>()) );
-  CALL_SUBTEST(verifySizeOf(Array<float, 10, 1>()) );
-  CALL_SUBTEST(verifySizeOf(Array<float, 11, 1>()) );
-  CALL_SUBTEST(verifySizeOf(Array<float, 12, 1>()) );
-  CALL_SUBTEST(verifySizeOf(Vector2d()) );
-  CALL_SUBTEST(verifySizeOf(Vector4f()) );
-  CALL_SUBTEST(verifySizeOf(Matrix4d()) );
-  CALL_SUBTEST(verifySizeOf(Matrix<double, 4, 2>()) );
-  CALL_SUBTEST(verifySizeOf(Matrix<bool, 7, 5>()) );
-  CALL_SUBTEST(verifySizeOf(MatrixXcf(3, 3)) );
-  CALL_SUBTEST(verifySizeOf(MatrixXi(8, 12)) );
-  CALL_SUBTEST(verifySizeOf(MatrixXcd(20, 20)) );
-  CALL_SUBTEST(verifySizeOf(Matrix<float, 100, 100>()) );
-  
-  VERIFY(sizeof(std::complex<float>) == 2*sizeof(float));
-  VERIFY(sizeof(std::complex<double>) == 2*sizeof(double));
+EIGEN_DECLARE_TEST(sizeof) {
+  CALL_SUBTEST(verifySizeOf(Matrix<float, 1, 1>()));
+  CALL_SUBTEST(verifySizeOf(Array<float, 2, 1>()));
+  CALL_SUBTEST(verifySizeOf(Array<float, 3, 1>()));
+  CALL_SUBTEST(verifySizeOf(Array<float, 4, 1>()));
+  CALL_SUBTEST(verifySizeOf(Array<float, 5, 1>()));
+  CALL_SUBTEST(verifySizeOf(Array<float, 6, 1>()));
+  CALL_SUBTEST(verifySizeOf(Array<float, 7, 1>()));
+  CALL_SUBTEST(verifySizeOf(Array<float, 8, 1>()));
+  CALL_SUBTEST(verifySizeOf(Array<float, 9, 1>()));
+  CALL_SUBTEST(verifySizeOf(Array<float, 10, 1>()));
+  CALL_SUBTEST(verifySizeOf(Array<float, 11, 1>()));
+  CALL_SUBTEST(verifySizeOf(Array<float, 12, 1>()));
+  CALL_SUBTEST(verifySizeOf(Vector2d()));
+  CALL_SUBTEST(verifySizeOf(Vector4f()));
+  CALL_SUBTEST(verifySizeOf(Matrix4d()));
+  CALL_SUBTEST(verifySizeOf(Matrix<double, 4, 2>()));
+  CALL_SUBTEST(verifySizeOf(Matrix<bool, 7, 5>()));
+  CALL_SUBTEST(verifySizeOf(MatrixXcf(3, 3)));
+  CALL_SUBTEST(verifySizeOf(MatrixXi(8, 12)));
+  CALL_SUBTEST(verifySizeOf(MatrixXcd(20, 20)));
+  CALL_SUBTEST(verifySizeOf(Matrix<float, 100, 100>()));
+
+  VERIFY(sizeof(std::complex<float>) == 2 * sizeof(float));
+  VERIFY(sizeof(std::complex<double>) == 2 * sizeof(double));
 }
diff --git a/test/sizeoverflow.cpp b/test/sizeoverflow.cpp
index 4213512..66f820f 100644
--- a/test/sizeoverflow.cpp
+++ b/test/sizeoverflow.cpp
@@ -9,38 +9,37 @@
 
 #include "main.h"
 
-#define VERIFY_THROWS_BADALLOC(a) {                           \
-    bool threw = false;                                       \
-    try {                                                     \
-      a;                                                      \
-    }                                                         \
-    catch (std::bad_alloc&) { threw = true; }                 \
-    VERIFY(threw && "should have thrown bad_alloc: " #a);     \
+#define VERIFY_THROWS_BADALLOC(a)                         \
+  {                                                       \
+    bool threw = false;                                   \
+    try {                                                 \
+      a;                                                  \
+    } catch (std::bad_alloc&) {                           \
+      threw = true;                                       \
+    }                                                     \
+    VERIFY(threw && "should have thrown bad_alloc: " #a); \
   }
 
-template<typename MatrixType>
-void triggerMatrixBadAlloc(Index rows, Index cols)
-{
-  VERIFY_THROWS_BADALLOC( MatrixType m(rows, cols) );
-  VERIFY_THROWS_BADALLOC( MatrixType m; m.resize(rows, cols) );
-  VERIFY_THROWS_BADALLOC( MatrixType m; m.conservativeResize(rows, cols) );
+template <typename MatrixType>
+void triggerMatrixBadAlloc(Index rows, Index cols) {
+  VERIFY_THROWS_BADALLOC(MatrixType m(rows, cols));
+  VERIFY_THROWS_BADALLOC(MatrixType m; m.resize(rows, cols));
+  VERIFY_THROWS_BADALLOC(MatrixType m; m.conservativeResize(rows, cols));
 }
 
-template<typename VectorType>
-void triggerVectorBadAlloc(Index size)
-{
-  VERIFY_THROWS_BADALLOC( VectorType v(size) );
-  VERIFY_THROWS_BADALLOC( VectorType v; v.resize(size) );
-  VERIFY_THROWS_BADALLOC( VectorType v; v.conservativeResize(size) );
+template <typename VectorType>
+void triggerVectorBadAlloc(Index size) {
+  VERIFY_THROWS_BADALLOC(VectorType v(size));
+  VERIFY_THROWS_BADALLOC(VectorType v; v.resize(size));
+  VERIFY_THROWS_BADALLOC(VectorType v; v.conservativeResize(size));
 }
 
-EIGEN_DECLARE_TEST(sizeoverflow)
-{
-  // there are 2 levels of overflow checking. first in PlainObjectBase.h we check for overflow in rows*cols computations.
-  // this is tested in tests of the form times_itself_gives_0 * times_itself_gives_0
-  // Then in Memory.h we check for overflow in size * sizeof(T) computations.
-  // this is tested in tests of the form times_4_gives_0 * sizeof(float)
-  
+EIGEN_DECLARE_TEST(sizeoverflow) {
+  // there are 2 levels of overflow checking. first in PlainObjectBase.h we check for overflow in rows*cols
+  // computations. this is tested in tests of the form times_itself_gives_0 * times_itself_gives_0 Then in Memory.h we
+  // check for overflow in size * sizeof(T) computations. this is tested in tests of the form times_4_gives_0 *
+  // sizeof(float)
+
   size_t times_itself_gives_0 = size_t(1) << (8 * sizeof(Index) / 2);
   VERIFY(times_itself_gives_0 * times_itself_gives_0 == 0);
 
@@ -57,8 +56,8 @@
   triggerMatrixBadAlloc<MatrixXd>(times_itself_gives_0, times_itself_gives_0);
   triggerMatrixBadAlloc<MatrixXd>(times_itself_gives_0 / 8, times_itself_gives_0);
   triggerMatrixBadAlloc<MatrixXd>(times_8_gives_0, 1);
-  
+
   triggerVectorBadAlloc<VectorXf>(times_4_gives_0);
-  
+
   triggerVectorBadAlloc<VectorXd>(times_8_gives_0);
 }
diff --git a/test/skew_symmetric_matrix3.cpp b/test/skew_symmetric_matrix3.cpp
index 6dad003..d45262f 100644
--- a/test/skew_symmetric_matrix3.cpp
+++ b/test/skew_symmetric_matrix3.cpp
@@ -74,16 +74,15 @@
   VERIFY_IS_APPROX((sk1 - sk2).toDenseMatrix(), sq1 - sq2);
 
   SquareMatrix sq3 = v1.asSkewSymmetric();
-  VERIFY_IS_APPROX( sq3 = v1.asSkewSymmetric() + v2.asSkewSymmetric(), sq1 + sq2);
-  VERIFY_IS_APPROX( sq3 = v1.asSkewSymmetric() - v2.asSkewSymmetric(), sq1 - sq2);
-  VERIFY_IS_APPROX( sq3 = v1.asSkewSymmetric() - 2*v2.asSkewSymmetric() + v1.asSkewSymmetric(), sq1 - 2*sq2 + sq1);
+  VERIFY_IS_APPROX(sq3 = v1.asSkewSymmetric() + v2.asSkewSymmetric(), sq1 + sq2);
+  VERIFY_IS_APPROX(sq3 = v1.asSkewSymmetric() - v2.asSkewSymmetric(), sq1 - sq2);
+  VERIFY_IS_APPROX(sq3 = v1.asSkewSymmetric() - 2 * v2.asSkewSymmetric() + v1.asSkewSymmetric(), sq1 - 2 * sq2 + sq1);
 
-  VERIFY_IS_APPROX((sk1 + sk1).vector(), 2*v1);
+  VERIFY_IS_APPROX((sk1 + sk1).vector(), 2 * v1);
   VERIFY((sk1 - sk1).vector().isZero());
   VERIFY((sk1 - sk1).toDenseMatrix().isZero());
 }
 
-
 template <typename Scalar>
 void multiplyScale() {
   typedef Matrix<Scalar, 3, 1> Vector;
@@ -96,8 +95,8 @@
   sk1 = v1.asSkewSymmetric();
 
   const Scalar s1 = internal::random<Scalar>();
-  VERIFY_IS_APPROX(SkewSymmetricMatrix3<Scalar>(sk1*s1).vector(), sk1.vector() * s1);
-  VERIFY_IS_APPROX(SkewSymmetricMatrix3<Scalar>(s1*sk1).vector(), s1 * sk1.vector());
+  VERIFY_IS_APPROX(SkewSymmetricMatrix3<Scalar>(sk1 * s1).vector(), sk1.vector() * s1);
+  VERIFY_IS_APPROX(SkewSymmetricMatrix3<Scalar>(s1 * sk1).vector(), s1 * sk1.vector());
   VERIFY_IS_APPROX(sq1 * (sk1 * s1), (sq1 * sk1) * s1);
 
   const Vector v2 = Vector::Random();
@@ -105,14 +104,14 @@
   sq2 = v2.asSkewSymmetric();
   SkewSymmetricMatrix3<Scalar> sk2;
   sk2 = v2.asSkewSymmetric();
-  VERIFY_IS_APPROX(sk1*sk2, sq1*sq2);
+  VERIFY_IS_APPROX(sk1 * sk2, sq1 * sq2);
 
   // null space
-  VERIFY((sk1*v1).isZero());
-  VERIFY((sk2*v2).isZero());
+  VERIFY((sk1 * v1).isZero());
+  VERIFY((sk2 * v2).isZero());
 }
 
-template<typename Matrix>
+template <typename Matrix>
 void skewSymmetricMultiplication(const Matrix& m) {
   typedef Eigen::Matrix<typename Matrix::Scalar, 3, 1> Vector;
   const Vector v = Vector::Random();
@@ -127,7 +126,7 @@
   typedef Matrix<Scalar, 3, 1> Vector;
   const Vector v = Vector::Random();
   // this does not work, values larger than 1.e-08 can be seen
-  //VERIFY_IS_APPROX(sq.determinant(), static_cast<Scalar>(0));
+  // VERIFY_IS_APPROX(sq.determinant(), static_cast<Scalar>(0));
   VERIFY_IS_APPROX(v.asSkewSymmetric().determinant(), static_cast<Scalar>(0));
   VERIFY_IS_APPROX(v.asSkewSymmetric().toDenseMatrix().trace(), static_cast<Scalar>(0));
 }
@@ -149,10 +148,10 @@
 
   Vector v2 = Vector::Random();
   v2.normalize();
-  VERIFY((2*EIGEN_PI*v2).asSkewSymmetric().exponential().isIdentity());
+  VERIFY((2 * EIGEN_PI * v2).asSkewSymmetric().exponential().isIdentity());
 
   Vector v3;
-  const auto precision = static_cast<Scalar>(1.1)*NumTraits<Scalar>::dummy_precision();
+  const auto precision = static_cast<Scalar>(1.1) * NumTraits<Scalar>::dummy_precision();
   v3 << 0, 0, precision;
   VERIFY(v3.asSkewSymmetric().exponential().isIdentity(precision));
 }
@@ -174,23 +173,20 @@
   // rotation axis is invariant
   const Vector v1 = Vector::Random();
   const SquareMatrix r1 = v1.asSkewSymmetric().exponential();
-  VERIFY_IS_APPROX(r1*v1, v1);
+  VERIFY_IS_APPROX(r1 * v1, v1);
 
   // rotate around z-axis
   Vector v2;
   v2 << 0, 0, EIGEN_PI;
   const SquareMatrix r2 = v2.asSkewSymmetric().exponential();
-  VERIFY_IS_APPROX(r2*(Vector() << 1,0,0).finished(), (Vector() << -1,0,0).finished());
-  VERIFY_IS_APPROX(r2*(Vector() << 0,1,0).finished(), (Vector() << 0,-1,0).finished());
+  VERIFY_IS_APPROX(r2 * (Vector() << 1, 0, 0).finished(), (Vector() << -1, 0, 0).finished());
+  VERIFY_IS_APPROX(r2 * (Vector() << 0, 1, 0).finished(), (Vector() << 0, -1, 0).finished());
 }
 
+}  // namespace
 
-} // namespace
-
-
-EIGEN_DECLARE_TEST(skew_symmetric_matrix3)
-{
-  for(int i = 0; i < g_repeat; i++) {
+EIGEN_DECLARE_TEST(skew_symmetric_matrix3) {
+  for (int i = 0; i < g_repeat; i++) {
     CALL_SUBTEST_1(constructors<float>());
     CALL_SUBTEST_1(constructors<double>());
     CALL_SUBTEST_1(assignments<float>());
@@ -200,8 +196,8 @@
     CALL_SUBTEST_2(plusMinus<double>());
     CALL_SUBTEST_2(multiplyScale<float>());
     CALL_SUBTEST_2(multiplyScale<double>());
-    CALL_SUBTEST_2(skewSymmetricMultiplication(MatrixXf(3,internal::random<int>(1,EIGEN_TEST_MAX_SIZE))));
-    CALL_SUBTEST_2(skewSymmetricMultiplication(MatrixXd(3,internal::random<int>(1,EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_2(skewSymmetricMultiplication(MatrixXf(3, internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+    CALL_SUBTEST_2(skewSymmetricMultiplication(MatrixXd(3, internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
     CALL_SUBTEST_2(traceAndDet<float>());
     CALL_SUBTEST_2(traceAndDet<double>());
     CALL_SUBTEST_2(transpose<float>());
diff --git a/test/smallvectors.cpp b/test/smallvectors.cpp
index d58038f..682b118 100644
--- a/test/smallvectors.cpp
+++ b/test/smallvectors.cpp
@@ -9,15 +9,13 @@
 
 #include "main.h"
 
-template<typename Scalar> void smallVectors()
-{
+template <typename Scalar>
+void smallVectors() {
   typedef Matrix<Scalar, 1, 2> V2;
   typedef Matrix<Scalar, 3, 1> V3;
   typedef Matrix<Scalar, 1, 4> V4;
   typedef Matrix<Scalar, Dynamic, 1> VX;
-  Scalar x1 = internal::random<Scalar>(),
-         x2 = internal::random<Scalar>(),
-         x3 = internal::random<Scalar>(),
+  Scalar x1 = internal::random<Scalar>(), x2 = internal::random<Scalar>(), x3 = internal::random<Scalar>(),
          x4 = internal::random<Scalar>();
   V2 v2(x1, x2);
   V3 v3(x1, x2, x3);
@@ -39,11 +37,10 @@
   VERIFY_RAISES_ASSERT(VX(3, 2))
 }
 
-EIGEN_DECLARE_TEST(smallvectors)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST(smallVectors<int>() );
-    CALL_SUBTEST(smallVectors<float>() );
-    CALL_SUBTEST(smallVectors<double>() );
+EIGEN_DECLARE_TEST(smallvectors) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST(smallVectors<int>());
+    CALL_SUBTEST(smallVectors<float>());
+    CALL_SUBTEST(smallVectors<double>());
   }
 }
diff --git a/test/solverbase.h b/test/solverbase.h
index ba76ba4..f353943 100644
--- a/test/solverbase.h
+++ b/test/solverbase.h
@@ -1,40 +1,39 @@
 #ifndef TEST_SOLVERBASE_H
 #define TEST_SOLVERBASE_H
 
-template<typename DstType, typename RhsType, typename MatrixType, typename SolverType>
-void check_solverbase(const MatrixType& matrix, const SolverType& solver, Index rows, Index cols, Index cols2)
-{
+template <typename DstType, typename RhsType, typename MatrixType, typename SolverType>
+void check_solverbase(const MatrixType& matrix, const SolverType& solver, Index rows, Index cols, Index cols2) {
   // solve
-  DstType m2               = DstType::Random(cols,cols2);
-  RhsType m3               = matrix*m2;
-  DstType solver_solution  = DstType::Random(cols,cols2);
+  DstType m2 = DstType::Random(cols, cols2);
+  RhsType m3 = matrix * m2;
+  DstType solver_solution = DstType::Random(cols, cols2);
   solver._solve_impl(m3, solver_solution);
-  VERIFY_IS_APPROX(m3, matrix*solver_solution);
-  solver_solution          = DstType::Random(cols,cols2);
-  solver_solution          = solver.solve(m3);
-  VERIFY_IS_APPROX(m3, matrix*solver_solution);
+  VERIFY_IS_APPROX(m3, matrix * solver_solution);
+  solver_solution = DstType::Random(cols, cols2);
+  solver_solution = solver.solve(m3);
+  VERIFY_IS_APPROX(m3, matrix * solver_solution);
   // test solve with transposed
-  m3                       = RhsType::Random(rows,cols2);
-  m2                       = matrix.transpose()*m3;
-  RhsType solver_solution2 = RhsType::Random(rows,cols2);
+  m3 = RhsType::Random(rows, cols2);
+  m2 = matrix.transpose() * m3;
+  RhsType solver_solution2 = RhsType::Random(rows, cols2);
   solver.template _solve_impl_transposed<false>(m2, solver_solution2);
-  VERIFY_IS_APPROX(m2, matrix.transpose()*solver_solution2);
-  solver_solution2         = RhsType::Random(rows,cols2);
-  solver_solution2         = solver.transpose().solve(m2);
-  VERIFY_IS_APPROX(m2, matrix.transpose()*solver_solution2);
+  VERIFY_IS_APPROX(m2, matrix.transpose() * solver_solution2);
+  solver_solution2 = RhsType::Random(rows, cols2);
+  solver_solution2 = solver.transpose().solve(m2);
+  VERIFY_IS_APPROX(m2, matrix.transpose() * solver_solution2);
   // test solve with conjugate transposed
-  m3                       = RhsType::Random(rows,cols2);
-  m2                       = matrix.adjoint()*m3;
-  solver_solution2         = RhsType::Random(rows,cols2);
+  m3 = RhsType::Random(rows, cols2);
+  m2 = matrix.adjoint() * m3;
+  solver_solution2 = RhsType::Random(rows, cols2);
   solver.template _solve_impl_transposed<true>(m2, solver_solution2);
-  VERIFY_IS_APPROX(m2, matrix.adjoint()*solver_solution2);
-  solver_solution2         = RhsType::Random(rows,cols2);
-  solver_solution2         = solver.adjoint().solve(m2);
-  VERIFY_IS_APPROX(m2, matrix.adjoint()*solver_solution2);
+  VERIFY_IS_APPROX(m2, matrix.adjoint() * solver_solution2);
+  solver_solution2 = RhsType::Random(rows, cols2);
+  solver_solution2 = solver.adjoint().solve(m2);
+  VERIFY_IS_APPROX(m2, matrix.adjoint() * solver_solution2);
   // test with temporary expression as rhs
-  m2 = DstType::Random(cols,cols2);
-  solver_solution = solver.solve(matrix*m2);
-  VERIFY_IS_APPROX(matrix*m2, matrix*solver_solution);
+  m2 = DstType::Random(cols, cols2);
+  solver_solution = solver.solve(matrix * m2);
+  VERIFY_IS_APPROX(matrix * m2, matrix * solver_solution);
 }
 
-#endif // TEST_SOLVERBASE_H
+#endif  // TEST_SOLVERBASE_H
diff --git a/test/sparse.h b/test/sparse.h
index 78e6619..1f4a166 100644
--- a/test/sparse.h
+++ b/test/sparse.h
@@ -29,12 +29,7 @@
 #include <Eigen/LU>
 #include <Eigen/Sparse>
 
-enum {
-  ForceNonZeroDiag = 1,
-  MakeLowerTriangular = 2,
-  MakeUpperTriangular = 4,
-  ForceRealDiag = 8
-};
+enum { ForceNonZeroDiag = 1, MakeLowerTriangular = 2, MakeUpperTriangular = 4, ForceRealDiag = 8 };
 
 /* Initializes both a sparse and dense matrix with same random values,
  * and a ratio of \a density non zero entries.
@@ -43,113 +38,87 @@
  * \param zeroCoords and nonzeroCoords allows to get the coordinate lists of the non zero,
  *        and zero coefficients respectively.
  */
-template<typename Scalar,int Opt1,int Opt2,typename StorageIndex> void
-initSparse(double density,
-           Matrix<Scalar,Dynamic,Dynamic,Opt1>& refMat,
-           SparseMatrix<Scalar,Opt2,StorageIndex>& sparseMat,
-           int flags = 0,
-           std::vector<Matrix<StorageIndex,2,1> >* zeroCoords = 0,
-           std::vector<Matrix<StorageIndex,2,1> >* nonzeroCoords = 0)
-{
-  enum { IsRowMajor = SparseMatrix<Scalar,Opt2,StorageIndex>::IsRowMajor };
+template <typename Scalar, int Opt1, int Opt2, typename StorageIndex>
+void initSparse(double density, Matrix<Scalar, Dynamic, Dynamic, Opt1>& refMat,
+                SparseMatrix<Scalar, Opt2, StorageIndex>& sparseMat, int flags = 0,
+                std::vector<Matrix<StorageIndex, 2, 1> >* zeroCoords = 0,
+                std::vector<Matrix<StorageIndex, 2, 1> >* nonzeroCoords = 0) {
+  enum { IsRowMajor = SparseMatrix<Scalar, Opt2, StorageIndex>::IsRowMajor };
   sparseMat.setZero();
-  //sparseMat.reserve(int(refMat.rows()*refMat.cols()*density));
+  // sparseMat.reserve(int(refMat.rows()*refMat.cols()*density));
   int nnz = static_cast<int>((1.5 * density) * static_cast<double>(IsRowMajor ? refMat.cols() : refMat.rows()));
   sparseMat.reserve(VectorXi::Constant(IsRowMajor ? refMat.rows() : refMat.cols(), nnz));
 
   Index insert_count = 0;
-  for(Index j=0; j<sparseMat.outerSize(); j++)
-  {
-    //sparseMat.startVec(j);
-    for(Index i=0; i<sparseMat.innerSize(); i++)
-    {
+  for (Index j = 0; j < sparseMat.outerSize(); j++) {
+    // sparseMat.startVec(j);
+    for (Index i = 0; i < sparseMat.innerSize(); i++) {
       Index ai(i), aj(j);
-      if(IsRowMajor)
-        std::swap(ai,aj);
-      Scalar v = (internal::random<double>(0,1) < density) ? internal::random<Scalar>() : Scalar(0);
-      if ((flags&ForceNonZeroDiag) && (i==j))
-      {
+      if (IsRowMajor) std::swap(ai, aj);
+      Scalar v = (internal::random<double>(0, 1) < density) ? internal::random<Scalar>() : Scalar(0);
+      if ((flags & ForceNonZeroDiag) && (i == j)) {
         // FIXME: the following is too conservative
-        v = internal::random<Scalar>()*Scalar(3.);
-        v = v*v;
-        if(numext::real(v)>0) v += Scalar(5);
-        else                  v -= Scalar(5);
+        v = internal::random<Scalar>() * Scalar(3.);
+        v = v * v;
+        if (numext::real(v) > 0)
+          v += Scalar(5);
+        else
+          v -= Scalar(5);
       }
-      if ((flags & MakeLowerTriangular) && aj>ai)
+      if ((flags & MakeLowerTriangular) && aj > ai)
         v = Scalar(0);
-      else if ((flags & MakeUpperTriangular) && aj<ai)
+      else if ((flags & MakeUpperTriangular) && aj < ai)
         v = Scalar(0);
 
-      if ((flags&ForceRealDiag) && (i==j))
-        v = numext::real(v);
+      if ((flags & ForceRealDiag) && (i == j)) v = numext::real(v);
 
-      if (!numext::is_exactly_zero(v))
-      {
-        //sparseMat.insertBackByOuterInner(j,i) = v;
-        sparseMat.insertByOuterInner(j,i) = v;
+      if (!numext::is_exactly_zero(v)) {
+        // sparseMat.insertBackByOuterInner(j,i) = v;
+        sparseMat.insertByOuterInner(j, i) = v;
         ++insert_count;
-        if (nonzeroCoords)
-          nonzeroCoords->push_back(Matrix<StorageIndex,2,1> (ai,aj));
+        if (nonzeroCoords) nonzeroCoords->push_back(Matrix<StorageIndex, 2, 1>(ai, aj));
+      } else if (zeroCoords) {
+        zeroCoords->push_back(Matrix<StorageIndex, 2, 1>(ai, aj));
       }
-      else if (zeroCoords)
-      {
-        zeroCoords->push_back(Matrix<StorageIndex,2,1> (ai,aj));
-      }
-      refMat(ai,aj) = v;
+      refMat(ai, aj) = v;
 
       // make sure we only insert as many as the sparse matrix supports
-      if(insert_count == NumTraits<StorageIndex>::highest()) return;
+      if (insert_count == NumTraits<StorageIndex>::highest()) return;
     }
   }
-  //sparseMat.finalize();
+  // sparseMat.finalize();
 }
 
-template<typename Scalar,int Options,typename Index> void
-initSparse(double density,
-           Matrix<Scalar,Dynamic,1>& refVec,
-           SparseVector<Scalar,Options,Index>& sparseVec,
-           std::vector<int>* zeroCoords = 0,
-           std::vector<int>* nonzeroCoords = 0)
-{
-  sparseVec.reserve(int(refVec.size()*density));
+template <typename Scalar, int Options, typename Index>
+void initSparse(double density, Matrix<Scalar, Dynamic, 1>& refVec, SparseVector<Scalar, Options, Index>& sparseVec,
+                std::vector<int>* zeroCoords = 0, std::vector<int>* nonzeroCoords = 0) {
+  sparseVec.reserve(int(refVec.size() * density));
   sparseVec.setZero();
-  for(int i=0; i<refVec.size(); i++)
-  {
-    Scalar v = (internal::random<double>(0,1) < density) ? internal::random<Scalar>() : Scalar(0);
-    if (!numext::is_exactly_zero(v))
-    {
+  for (int i = 0; i < refVec.size(); i++) {
+    Scalar v = (internal::random<double>(0, 1) < density) ? internal::random<Scalar>() : Scalar(0);
+    if (!numext::is_exactly_zero(v)) {
       sparseVec.insertBack(i) = v;
-      if (nonzeroCoords)
-        nonzeroCoords->push_back(i);
-    }
-    else if (zeroCoords)
-        zeroCoords->push_back(i);
+      if (nonzeroCoords) nonzeroCoords->push_back(i);
+    } else if (zeroCoords)
+      zeroCoords->push_back(i);
     refVec[i] = v;
   }
 }
 
-template<typename Scalar,int Options,typename Index> void
-initSparse(double density,
-           Matrix<Scalar,1,Dynamic>& refVec,
-           SparseVector<Scalar,Options,Index>& sparseVec,
-           std::vector<int>* zeroCoords = 0,
-           std::vector<int>* nonzeroCoords = 0)
-{
-  sparseVec.reserve(int(refVec.size()*density));
+template <typename Scalar, int Options, typename Index>
+void initSparse(double density, Matrix<Scalar, 1, Dynamic>& refVec, SparseVector<Scalar, Options, Index>& sparseVec,
+                std::vector<int>* zeroCoords = 0, std::vector<int>* nonzeroCoords = 0) {
+  sparseVec.reserve(int(refVec.size() * density));
   sparseVec.setZero();
-  for(int i=0; i<refVec.size(); i++)
-  {
-    Scalar v = (internal::random<double>(0,1) < density) ? internal::random<Scalar>() : Scalar(0);
-    if (v!=Scalar(0))
-    {
+  for (int i = 0; i < refVec.size(); i++) {
+    Scalar v = (internal::random<double>(0, 1) < density) ? internal::random<Scalar>() : Scalar(0);
+    if (v != Scalar(0)) {
       sparseVec.insertBack(i) = v;
-      if (nonzeroCoords)
-        nonzeroCoords->push_back(i);
-    }
-    else if (zeroCoords)
-        zeroCoords->push_back(i);
+      if (nonzeroCoords) nonzeroCoords->push_back(i);
+    } else if (zeroCoords)
+      zeroCoords->push_back(i);
     refVec[i] = v;
   }
 }
 
-#endif // EIGEN_TESTSPARSE_H
+#endif  // EIGEN_TESTSPARSE_H
diff --git a/test/sparseLM.cpp b/test/sparseLM.cpp
index a48fcb6..0cb4d3a 100644
--- a/test/sparseLM.cpp
+++ b/test/sparseLM.cpp
@@ -18,159 +18,135 @@
 using namespace Eigen;
 
 template <typename Scalar>
-struct sparseGaussianTest : SparseFunctor<Scalar, int>
-{
-  typedef Matrix<Scalar,Dynamic,1> VectorType;
-  typedef SparseFunctor<Scalar,int> Base;
+struct sparseGaussianTest : SparseFunctor<Scalar, int> {
+  typedef Matrix<Scalar, Dynamic, 1> VectorType;
+  typedef SparseFunctor<Scalar, int> Base;
   typedef typename Base::JacobianType JacobianType;
-  sparseGaussianTest(int inputs, int values) : SparseFunctor<Scalar,int>(inputs,values)
-  { }
-  
-  VectorType model(const VectorType& uv, VectorType& x)
-  {
-    VectorType y; //Change this to use expression template
-    int m = Base::values(); 
+  sparseGaussianTest(int inputs, int values) : SparseFunctor<Scalar, int>(inputs, values) {}
+
+  VectorType model(const VectorType& uv, VectorType& x) {
+    VectorType y;  // Change this to use expression template
+    int m = Base::values();
     int n = Base::inputs();
-    eigen_assert(uv.size()%2 == 0);
+    eigen_assert(uv.size() % 2 == 0);
     eigen_assert(uv.size() == n);
     eigen_assert(x.size() == m);
     y.setZero(m);
-    int half = n/2;
+    int half = n / 2;
     VectorBlock<const VectorType> u(uv, 0, half);
     VectorBlock<const VectorType> v(uv, half, half);
     Scalar coeff;
-    for (int j = 0; j < m; j++)
-    {
-      for (int i = 0; i < half; i++) 
-      {
-        coeff = (x(j)-i)/v(i);
+    for (int j = 0; j < m; j++) {
+      for (int i = 0; i < half; i++) {
+        coeff = (x(j) - i) / v(i);
         coeff *= coeff;
-        if (coeff < 1. && coeff > 0.)
-          y(j) += u(i)*std::pow((1-coeff), 2);
+        if (coeff < 1. && coeff > 0.) y(j) += u(i) * std::pow((1 - coeff), 2);
       }
     }
     return y;
   }
-  void initPoints(VectorType& uv_ref, VectorType& x)
-  {
+  void initPoints(VectorType& uv_ref, VectorType& x) {
     m_x = x;
-    m_y = this->model(uv_ref,x);
+    m_y = this->model(uv_ref, x);
   }
-  int operator()(const VectorType& uv, VectorType& fvec)
-  {
-    int m = Base::values(); 
+  int operator()(const VectorType& uv, VectorType& fvec) {
+    int m = Base::values();
     int n = Base::inputs();
-    eigen_assert(uv.size()%2 == 0);
+    eigen_assert(uv.size() % 2 == 0);
     eigen_assert(uv.size() == n);
-    int half = n/2;
+    int half = n / 2;
     VectorBlock<const VectorType> u(uv, 0, half);
     VectorBlock<const VectorType> v(uv, half, half);
     fvec = m_y;
     Scalar coeff;
-    for (int j = 0; j < m; j++)
-    {
-      for (int i = 0; i < half; i++)
-      {
-        coeff = (m_x(j)-i)/v(i);
+    for (int j = 0; j < m; j++) {
+      for (int i = 0; i < half; i++) {
+        coeff = (m_x(j) - i) / v(i);
         coeff *= coeff;
-        if (coeff < 1. && coeff > 0.)
-          fvec(j) -= u(i)*std::pow((1-coeff), 2);
+        if (coeff < 1. && coeff > 0.) fvec(j) -= u(i) * std::pow((1 - coeff), 2);
       }
     }
     return 0;
   }
-  
-  int df(const VectorType& uv, JacobianType& fjac)
-  {
-    int m = Base::values(); 
+
+  int df(const VectorType& uv, JacobianType& fjac) {
+    int m = Base::values();
     int n = Base::inputs();
     eigen_assert(n == uv.size());
     eigen_assert(fjac.rows() == m);
     eigen_assert(fjac.cols() == n);
-    int half = n/2;
+    int half = n / 2;
     VectorBlock<const VectorType> u(uv, 0, half);
     VectorBlock<const VectorType> v(uv, half, half);
     Scalar coeff;
-    
-    //Derivatives with respect to u
-    for (int col = 0; col < half; col++)
-    {
-      for (int row = 0; row < m; row++)
-      {
-        coeff = (m_x(row)-col)/v(col);
-          coeff = coeff*coeff;
-        if(coeff < 1. && coeff > 0.)
-        {
-          fjac.coeffRef(row,col) = -(1-coeff)*(1-coeff);
+
+    // Derivatives with respect to u
+    for (int col = 0; col < half; col++) {
+      for (int row = 0; row < m; row++) {
+        coeff = (m_x(row) - col) / v(col);
+        coeff = coeff * coeff;
+        if (coeff < 1. && coeff > 0.) {
+          fjac.coeffRef(row, col) = -(1 - coeff) * (1 - coeff);
         }
       }
     }
-    //Derivatives with respect to v
-    for (int col = 0; col < half; col++)
-    {
-      for (int row = 0; row < m; row++)
-      {
-        coeff = (m_x(row)-col)/v(col);
-        coeff = coeff*coeff;
-        if(coeff < 1. && coeff > 0.)
-        {
-          fjac.coeffRef(row,col+half) = -4 * (u(col)/v(col))*coeff*(1-coeff);
+    // Derivatives with respect to v
+    for (int col = 0; col < half; col++) {
+      for (int row = 0; row < m; row++) {
+        coeff = (m_x(row) - col) / v(col);
+        coeff = coeff * coeff;
+        if (coeff < 1. && coeff > 0.) {
+          fjac.coeffRef(row, col + half) = -4 * (u(col) / v(col)) * coeff * (1 - coeff);
         }
       }
     }
     return 0;
   }
-  
-  VectorType m_x, m_y; //Data points
+
+  VectorType m_x, m_y;  // Data points
 };
 
+template <typename T>
+void test_sparseLM_T() {
+  typedef Matrix<T, Dynamic, 1> VectorType;
 
-template<typename T>
-void test_sparseLM_T()
-{
-  typedef Matrix<T,Dynamic,1> VectorType;
-  
   int inputs = 10;
   int values = 2000;
   sparseGaussianTest<T> sparse_gaussian(inputs, values);
-  VectorType uv(inputs),uv_ref(inputs);
+  VectorType uv(inputs), uv_ref(inputs);
   VectorType x(values);
-  // Generate the reference solution 
-  uv_ref << -2, 1, 4 ,8, 6, 1.8, 1.2, 1.1, 1.9 , 3;
-  //Generate the reference data points
+  // Generate the reference solution
+  uv_ref << -2, 1, 4, 8, 6, 1.8, 1.2, 1.1, 1.9, 3;
+  // Generate the reference data points
   x.setRandom();
-  x = 10*x;
+  x = 10 * x;
   x.array() += 10;
   sparse_gaussian.initPoints(uv_ref, x);
-  
-  
-  // Generate the initial parameters 
-  VectorBlock<VectorType> u(uv, 0, inputs/2); 
-  VectorBlock<VectorType> v(uv, inputs/2, inputs/2);
+
+  // Generate the initial parameters
+  VectorBlock<VectorType> u(uv, 0, inputs / 2);
+  VectorBlock<VectorType> v(uv, inputs / 2, inputs / 2);
   v.setOnes();
-  //Generate u or Solve for u from v
+  // Generate u or Solve for u from v
   u.setOnes();
-  
+
   // Solve the optimization problem
   LevenbergMarquardt<sparseGaussianTest<T> > lm(sparse_gaussian);
   int info;
-//   info = lm.minimize(uv);
-  
-  VERIFY_IS_EQUAL(info,1);
-    // Do a step by step solution and save the residual 
+  //   info = lm.minimize(uv);
+
+  VERIFY_IS_EQUAL(info, 1);
+  // Do a step by step solution and save the residual
   int maxiter = 200;
   int iter = 0;
   MatrixXd Err(values, maxiter);
   MatrixXd Mod(values, maxiter);
-  LevenbergMarquardtSpace::Status status; 
+  LevenbergMarquardtSpace::Status status;
   status = lm.minimizeInit(uv);
-  if (status==LevenbergMarquardtSpace::ImproperInputParameters)
-      return ;
-
+  if (status == LevenbergMarquardtSpace::ImproperInputParameters) return;
 }
-EIGEN_DECLARE_TEST(sparseLM)
-{
+EIGEN_DECLARE_TEST(sparseLM) {
   CALL_SUBTEST_1(test_sparseLM_T<double>());
-  
+
   // CALL_SUBTEST_2(test_sparseLM_T<std::complex<double>());
 }
diff --git a/test/sparse_basic.cpp b/test/sparse_basic.cpp
index 298619e..364aac0 100644
--- a/test/sparse_basic.cpp
+++ b/test/sparse_basic.cpp
@@ -15,17 +15,17 @@
 
 static long g_dense_op_sparse_count = 0;
 #define EIGEN_SPARSE_ASSIGNMENT_FROM_DENSE_OP_SPARSE_PLUGIN g_dense_op_sparse_count++;
-#define EIGEN_SPARSE_ASSIGNMENT_FROM_SPARSE_ADD_DENSE_PLUGIN g_dense_op_sparse_count+=10;
-#define EIGEN_SPARSE_ASSIGNMENT_FROM_SPARSE_SUB_DENSE_PLUGIN g_dense_op_sparse_count+=20;
+#define EIGEN_SPARSE_ASSIGNMENT_FROM_SPARSE_ADD_DENSE_PLUGIN g_dense_op_sparse_count += 10;
+#define EIGEN_SPARSE_ASSIGNMENT_FROM_SPARSE_SUB_DENSE_PLUGIN g_dense_op_sparse_count += 20;
 #endif
 
 #include "sparse.h"
 
-template<typename SparseMatrixType> void sparse_basic(const SparseMatrixType& ref)
-{
+template <typename SparseMatrixType>
+void sparse_basic(const SparseMatrixType& ref) {
   typedef typename SparseMatrixType::StorageIndex StorageIndex;
-  typedef Matrix<StorageIndex,2,1> Vector2;
-  
+  typedef Matrix<StorageIndex, 2, 1> Vector2;
+
   const Index rows = ref.rows();
   const Index cols = ref.cols();
   const Index inner = ref.innerSize();
@@ -35,9 +35,9 @@
   typedef typename SparseMatrixType::RealScalar RealScalar;
   enum { Flags = SparseMatrixType::Flags };
 
-  double density = (std::max)(8./(rows*cols), 0.01);
-  typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrix;
-  typedef Matrix<Scalar,Dynamic,1> DenseVector;
+  double density = (std::max)(8. / (rows * cols), 0.01);
+  typedef Matrix<Scalar, Dynamic, Dynamic> DenseMatrix;
+  typedef Matrix<Scalar, Dynamic, 1> DenseVector;
   typedef Matrix<Scalar, Dynamic, Dynamic, SparseMatrixType::IsRowMajor ? RowMajor : ColMajor> CompatibleDenseMatrix;
   Scalar eps = 1e-6;
 
@@ -52,243 +52,230 @@
     initSparse<Scalar>(density, refMat, m, 0, &zeroCoords, &nonzeroCoords);
 
     // test coeff and coeffRef
-    for (std::size_t i=0; i<zeroCoords.size(); ++i)
-    {
-      VERIFY_IS_MUCH_SMALLER_THAN( m.coeff(zeroCoords[i].x(),zeroCoords[i].y()), eps );
-      if(internal::is_same<SparseMatrixType,SparseMatrix<Scalar,Flags> >::value)
-        VERIFY_RAISES_ASSERT( m.coeffRef(zeroCoords[i].x(),zeroCoords[i].y()) = 5 );
+    for (std::size_t i = 0; i < zeroCoords.size(); ++i) {
+      VERIFY_IS_MUCH_SMALLER_THAN(m.coeff(zeroCoords[i].x(), zeroCoords[i].y()), eps);
+      if (internal::is_same<SparseMatrixType, SparseMatrix<Scalar, Flags>>::value)
+        VERIFY_RAISES_ASSERT(m.coeffRef(zeroCoords[i].x(), zeroCoords[i].y()) = 5);
     }
     VERIFY_IS_APPROX(m, refMat);
 
-    if(!nonzeroCoords.empty()) {
+    if (!nonzeroCoords.empty()) {
       m.coeffRef(nonzeroCoords[0].x(), nonzeroCoords[0].y()) = Scalar(5);
       refMat.coeffRef(nonzeroCoords[0].x(), nonzeroCoords[0].y()) = Scalar(5);
     }
 
     VERIFY_IS_APPROX(m, refMat);
 
-      // test assertion
-      VERIFY_RAISES_ASSERT( m.coeffRef(-1,1) = 0 );
-      VERIFY_RAISES_ASSERT( m.coeffRef(0,m.cols()) = 0 );
-    }
+    // test assertion
+    VERIFY_RAISES_ASSERT(m.coeffRef(-1, 1) = 0);
+    VERIFY_RAISES_ASSERT(m.coeffRef(0, m.cols()) = 0);
+  }
 
-    // test insert (inner random)
-    {
-      DenseMatrix m1(rows,cols);
-      m1.setZero();
-      SparseMatrixType m2(rows,cols);
-      bool call_reserve = internal::random<int>()%2;
-      Index nnz = internal::random<int>(1,int(rows)/2);
-      if(call_reserve)
-      {
-        if(internal::random<int>()%2)
-          m2.reserve(VectorXi::Constant(m2.outerSize(), int(nnz)));
-        else
-          m2.reserve(m2.outerSize() * nnz);
-      }
-      g_realloc_count = 0;
-      for (Index j=0; j<cols; ++j)
-      {
-        for (Index k=0; k<nnz; ++k)
-        {
-          Index i = internal::random<Index>(0,rows-1);
-          if (m1.coeff(i, j) == Scalar(0)) {
-            Scalar v = internal::random<Scalar>();
-            if (v == Scalar(0)) v = Scalar(1);
-            m1(i, j) = v;
-            m2.insert(i, j) = v;
-          }
-        }
-      }
-      
-      if(call_reserve && !SparseMatrixType::IsRowMajor)
-      {
-        VERIFY(g_realloc_count==0);
-      }
-      
-      VERIFY_IS_APPROX(m2,m1);
+  // test insert (inner random)
+  {
+    DenseMatrix m1(rows, cols);
+    m1.setZero();
+    SparseMatrixType m2(rows, cols);
+    bool call_reserve = internal::random<int>() % 2;
+    Index nnz = internal::random<int>(1, int(rows) / 2);
+    if (call_reserve) {
+      if (internal::random<int>() % 2)
+        m2.reserve(VectorXi::Constant(m2.outerSize(), int(nnz)));
+      else
+        m2.reserve(m2.outerSize() * nnz);
     }
-
-    // test insert (fully random)
-    {
-      DenseMatrix m1(rows,cols);
-      m1.setZero();
-      SparseMatrixType m2(rows,cols);
-      if(internal::random<int>()%2)
-        m2.reserve(VectorXi::Constant(m2.outerSize(), 2));
-      for (int k=0; k<rows*cols; ++k)
-      {
-        Index i = internal::random<Index>(0,rows-1);
-        Index j = internal::random<Index>(0,cols-1);
-        if ((m1.coeff(i, j) == Scalar(0)) && (internal::random<int>() % 2)) {
-          Scalar v = internal::random<Scalar>();
-          if (v == Scalar(0)) v = Scalar(1);
-          m1(i, j) = v;
-          m2.insert(i, j) = v;
-        }
-        else
-        {
-          Scalar v = internal::random<Scalar>();
-          if (v == Scalar(0)) v = Scalar(1);
-          m1(i, j) = v;
-          m2.coeffRef(i, j) = v;
-        }
-      }
-      VERIFY_IS_APPROX(m2,m1);
-    }
-    
-    // test insert (un-compressed)
-    for(int mode=0;mode<4;++mode)
-    {
-      DenseMatrix m1(rows,cols);
-      m1.setZero();
-      SparseMatrixType m2(rows,cols);
-      VectorXi r(VectorXi::Constant(m2.outerSize(), ((mode%2)==0) ? int(m2.innerSize()) : std::max<int>(1,int(m2.innerSize())/8)));
-      m2.reserve(r);
-      for (Index k=0; k<rows*cols; ++k)
-      {
-        Index i = internal::random<Index>(0,rows-1);
-        Index j = internal::random<Index>(0,cols-1);
+    g_realloc_count = 0;
+    for (Index j = 0; j < cols; ++j) {
+      for (Index k = 0; k < nnz; ++k) {
+        Index i = internal::random<Index>(0, rows - 1);
         if (m1.coeff(i, j) == Scalar(0)) {
           Scalar v = internal::random<Scalar>();
           if (v == Scalar(0)) v = Scalar(1);
           m1(i, j) = v;
           m2.insert(i, j) = v;
         }
-        if(mode==3)
-          m2.reserve(r);
-      }
-      if(internal::random<int>()%2)
-        m2.makeCompressed();
-      VERIFY_IS_APPROX(m2,m1);
-    }
-
-    // test removeOuterVectors / insertEmptyOuterVectors
-    {
-      for (int mode = 0; mode < 4; mode++) {
-        CompatibleDenseMatrix m1(rows, cols);
-        m1.setZero();
-        SparseMatrixType m2(rows, cols);
-        Vector<Index, Dynamic> reserveSizes(outer);
-        for (Index j = 0; j < outer; j++) reserveSizes(j) = internal::random<Index>(1, inner - 1);
-        m2.reserve(reserveSizes);
-        for (Index j = 0; j < outer; j++) {
-          Index i = internal::random<Index>(0, inner - 1);
-          Scalar val = internal::random<Scalar>();
-          m1.coeffRefByOuterInner(j, i) = val;
-          m2.insertByOuterInner(j, i) = val;
-        }
-        if (mode % 2 == 0) m2.makeCompressed();
-
-        if (mode < 2) {
-          Index num = internal::random<Index>(0, outer - 1);
-          Index start = internal::random<Index>(0, outer - num);
-
-          Index newRows = SparseMatrixType::IsRowMajor ? rows - num : rows;
-          Index newCols = SparseMatrixType::IsRowMajor ? cols : cols - num;
-
-          CompatibleDenseMatrix m3(newRows, newCols);
-          m3.setConstant(Scalar(NumTraits<RealScalar>::quiet_NaN()));
-
-          if (SparseMatrixType::IsRowMajor) {
-            m3.topRows(start) = m1.topRows(start);
-            m3.bottomRows(newRows - start) = m1.bottomRows(newRows - start);
-          } else {
-            m3.leftCols(start) = m1.leftCols(start);
-            m3.rightCols(newCols - start) = m1.rightCols(newCols - start);
-          }
-
-          SparseMatrixType m4 = m2;
-          m4.removeOuterVectors(start, num);
-
-          VERIFY_IS_CWISE_EQUAL(m3, m4.toDense());
-        } else {
-          Index num = internal::random<Index>(0, outer - 1);
-          Index start = internal::random<Index>(0, outer - 1);
-
-          Index newRows = SparseMatrixType::IsRowMajor ? rows + num : rows;
-          Index newCols = SparseMatrixType::IsRowMajor ? cols : cols + num;
-
-          CompatibleDenseMatrix m3(newRows, newCols);
-          m3.setConstant(Scalar(NumTraits<RealScalar>::quiet_NaN()));
-
-          if (SparseMatrixType::IsRowMajor) {
-            m3.topRows(start) = m1.topRows(start);
-            m3.middleRows(start, num).setZero();
-            m3.bottomRows(rows - start) = m1.bottomRows(rows - start);
-          } else {
-            m3.leftCols(start) = m1.leftCols(start);
-            m3.middleCols(start, num).setZero();
-            m3.rightCols(cols - start) = m1.rightCols(cols - start);
-          }
-
-          SparseMatrixType m4 = m2;
-          m4.insertEmptyOuterVectors(start, num);
-
-          VERIFY_IS_CWISE_EQUAL(m3, m4.toDense());
-        }
       }
     }
 
+    if (call_reserve && !SparseMatrixType::IsRowMajor) {
+      VERIFY(g_realloc_count == 0);
+    }
 
-    // test sort
-    if (inner > 1) {
-      bool StorageOrdersMatch = int(DenseMatrix::IsRowMajor) == int(SparseMatrixType::IsRowMajor);
-      DenseMatrix m1(rows, cols);
+    VERIFY_IS_APPROX(m2, m1);
+  }
+
+  // test insert (fully random)
+  {
+    DenseMatrix m1(rows, cols);
+    m1.setZero();
+    SparseMatrixType m2(rows, cols);
+    if (internal::random<int>() % 2) m2.reserve(VectorXi::Constant(m2.outerSize(), 2));
+    for (int k = 0; k < rows * cols; ++k) {
+      Index i = internal::random<Index>(0, rows - 1);
+      Index j = internal::random<Index>(0, cols - 1);
+      if ((m1.coeff(i, j) == Scalar(0)) && (internal::random<int>() % 2)) {
+        Scalar v = internal::random<Scalar>();
+        if (v == Scalar(0)) v = Scalar(1);
+        m1(i, j) = v;
+        m2.insert(i, j) = v;
+      } else {
+        Scalar v = internal::random<Scalar>();
+        if (v == Scalar(0)) v = Scalar(1);
+        m1(i, j) = v;
+        m2.coeffRef(i, j) = v;
+      }
+    }
+    VERIFY_IS_APPROX(m2, m1);
+  }
+
+  // test insert (un-compressed)
+  for (int mode = 0; mode < 4; ++mode) {
+    DenseMatrix m1(rows, cols);
+    m1.setZero();
+    SparseMatrixType m2(rows, cols);
+    VectorXi r(VectorXi::Constant(m2.outerSize(),
+                                  ((mode % 2) == 0) ? int(m2.innerSize()) : std::max<int>(1, int(m2.innerSize()) / 8)));
+    m2.reserve(r);
+    for (Index k = 0; k < rows * cols; ++k) {
+      Index i = internal::random<Index>(0, rows - 1);
+      Index j = internal::random<Index>(0, cols - 1);
+      if (m1.coeff(i, j) == Scalar(0)) {
+        Scalar v = internal::random<Scalar>();
+        if (v == Scalar(0)) v = Scalar(1);
+        m1(i, j) = v;
+        m2.insert(i, j) = v;
+      }
+      if (mode == 3) m2.reserve(r);
+    }
+    if (internal::random<int>() % 2) m2.makeCompressed();
+    VERIFY_IS_APPROX(m2, m1);
+  }
+
+  // test removeOuterVectors / insertEmptyOuterVectors
+  {
+    for (int mode = 0; mode < 4; mode++) {
+      CompatibleDenseMatrix m1(rows, cols);
       m1.setZero();
       SparseMatrixType m2(rows, cols);
-      // generate random inner indices with no repeats
-      Vector<Index, Dynamic> innerIndices(inner);
-      innerIndices.setLinSpaced(inner, 0, inner - 1);
-      std::random_device rd;
-      std::mt19937 g(rd());
+      Vector<Index, Dynamic> reserveSizes(outer);
+      for (Index j = 0; j < outer; j++) reserveSizes(j) = internal::random<Index>(1, inner - 1);
+      m2.reserve(reserveSizes);
       for (Index j = 0; j < outer; j++) {
-        std::shuffle(innerIndices.begin(), innerIndices.end(), g);
-        Index nzj = internal::random<Index>(2, inner / 2);
-        for (Index k = 0; k < nzj; k++) {
-          Index i = innerIndices[k];
-          Scalar val = internal::random<Scalar>();
-          m1.coeffRefByOuterInner(StorageOrdersMatch ? j : i, StorageOrdersMatch ? i : j) = val;
-          m2.insertByOuterInner(j, i) = val;
-        }
+        Index i = internal::random<Index>(0, inner - 1);
+        Scalar val = internal::random<Scalar>();
+        m1.coeffRefByOuterInner(j, i) = val;
+        m2.insertByOuterInner(j, i) = val;
       }
+      if (mode % 2 == 0) m2.makeCompressed();
 
-      VERIFY_IS_APPROX(m2, m1);
-      // sort wrt greater
-      m2.template sortInnerIndices<std::greater<>>();
-      // verify that all inner vectors are not sorted wrt less
-      VERIFY_IS_EQUAL(m2.template innerIndicesAreSorted<std::less<>>(), 0);
-      // verify that all inner vectors are sorted wrt greater
-      VERIFY_IS_EQUAL(m2.template innerIndicesAreSorted<std::greater<>>(), m2.outerSize());
-      // verify that sort does not change evaluation
-      VERIFY_IS_APPROX(m2, m1);
-      // sort wrt less
-      m2.template sortInnerIndices<std::less<>>();
-      // verify that all inner vectors are sorted wrt less
-      VERIFY_IS_EQUAL(m2.template innerIndicesAreSorted<std::less<>>(), m2.outerSize());
-      // verify that all inner vectors are not sorted wrt greater
-      VERIFY_IS_EQUAL(m2.template innerIndicesAreSorted<std::greater<>>(), 0);
-      // verify that sort does not change evaluation
-      VERIFY_IS_APPROX(m2, m1);
+      if (mode < 2) {
+        Index num = internal::random<Index>(0, outer - 1);
+        Index start = internal::random<Index>(0, outer - num);
 
-      m2.makeCompressed();
-      // sort wrt greater
-      m2.template sortInnerIndices<std::greater<>>();
-      // verify that all inner vectors are not sorted wrt less
-      VERIFY_IS_EQUAL(m2.template innerIndicesAreSorted<std::less<>>(), 0);
-      // verify that all inner vectors are sorted wrt greater
-      VERIFY_IS_EQUAL(m2.template innerIndicesAreSorted<std::greater<>>(), m2.outerSize());
-      // verify that sort does not change evaluation
-      VERIFY_IS_APPROX(m2, m1);
-      // sort wrt less
-      m2.template sortInnerIndices<std::less<>>();
-      // verify that all inner vectors are sorted wrt less
-      VERIFY_IS_EQUAL(m2.template innerIndicesAreSorted<std::less<>>(), m2.outerSize());
-      // verify that all inner vectors are not sorted wrt greater
-      VERIFY_IS_EQUAL(m2.template innerIndicesAreSorted<std::greater<>>(), 0);
-      // verify that sort does not change evaluation
-      VERIFY_IS_APPROX(m2, m1);
+        Index newRows = SparseMatrixType::IsRowMajor ? rows - num : rows;
+        Index newCols = SparseMatrixType::IsRowMajor ? cols : cols - num;
+
+        CompatibleDenseMatrix m3(newRows, newCols);
+        m3.setConstant(Scalar(NumTraits<RealScalar>::quiet_NaN()));
+
+        if (SparseMatrixType::IsRowMajor) {
+          m3.topRows(start) = m1.topRows(start);
+          m3.bottomRows(newRows - start) = m1.bottomRows(newRows - start);
+        } else {
+          m3.leftCols(start) = m1.leftCols(start);
+          m3.rightCols(newCols - start) = m1.rightCols(newCols - start);
+        }
+
+        SparseMatrixType m4 = m2;
+        m4.removeOuterVectors(start, num);
+
+        VERIFY_IS_CWISE_EQUAL(m3, m4.toDense());
+      } else {
+        Index num = internal::random<Index>(0, outer - 1);
+        Index start = internal::random<Index>(0, outer - 1);
+
+        Index newRows = SparseMatrixType::IsRowMajor ? rows + num : rows;
+        Index newCols = SparseMatrixType::IsRowMajor ? cols : cols + num;
+
+        CompatibleDenseMatrix m3(newRows, newCols);
+        m3.setConstant(Scalar(NumTraits<RealScalar>::quiet_NaN()));
+
+        if (SparseMatrixType::IsRowMajor) {
+          m3.topRows(start) = m1.topRows(start);
+          m3.middleRows(start, num).setZero();
+          m3.bottomRows(rows - start) = m1.bottomRows(rows - start);
+        } else {
+          m3.leftCols(start) = m1.leftCols(start);
+          m3.middleCols(start, num).setZero();
+          m3.rightCols(cols - start) = m1.rightCols(cols - start);
+        }
+
+        SparseMatrixType m4 = m2;
+        m4.insertEmptyOuterVectors(start, num);
+
+        VERIFY_IS_CWISE_EQUAL(m3, m4.toDense());
+      }
     }
+  }
+
+  // test sort
+  if (inner > 1) {
+    bool StorageOrdersMatch = int(DenseMatrix::IsRowMajor) == int(SparseMatrixType::IsRowMajor);
+    DenseMatrix m1(rows, cols);
+    m1.setZero();
+    SparseMatrixType m2(rows, cols);
+    // generate random inner indices with no repeats
+    Vector<Index, Dynamic> innerIndices(inner);
+    innerIndices.setLinSpaced(inner, 0, inner - 1);
+    std::random_device rd;
+    std::mt19937 g(rd());
+    for (Index j = 0; j < outer; j++) {
+      std::shuffle(innerIndices.begin(), innerIndices.end(), g);
+      Index nzj = internal::random<Index>(2, inner / 2);
+      for (Index k = 0; k < nzj; k++) {
+        Index i = innerIndices[k];
+        Scalar val = internal::random<Scalar>();
+        m1.coeffRefByOuterInner(StorageOrdersMatch ? j : i, StorageOrdersMatch ? i : j) = val;
+        m2.insertByOuterInner(j, i) = val;
+      }
+    }
+
+    VERIFY_IS_APPROX(m2, m1);
+    // sort wrt greater
+    m2.template sortInnerIndices<std::greater<>>();
+    // verify that all inner vectors are not sorted wrt less
+    VERIFY_IS_EQUAL(m2.template innerIndicesAreSorted<std::less<>>(), 0);
+    // verify that all inner vectors are sorted wrt greater
+    VERIFY_IS_EQUAL(m2.template innerIndicesAreSorted<std::greater<>>(), m2.outerSize());
+    // verify that sort does not change evaluation
+    VERIFY_IS_APPROX(m2, m1);
+    // sort wrt less
+    m2.template sortInnerIndices<std::less<>>();
+    // verify that all inner vectors are sorted wrt less
+    VERIFY_IS_EQUAL(m2.template innerIndicesAreSorted<std::less<>>(), m2.outerSize());
+    // verify that all inner vectors are not sorted wrt greater
+    VERIFY_IS_EQUAL(m2.template innerIndicesAreSorted<std::greater<>>(), 0);
+    // verify that sort does not change evaluation
+    VERIFY_IS_APPROX(m2, m1);
+
+    m2.makeCompressed();
+    // sort wrt greater
+    m2.template sortInnerIndices<std::greater<>>();
+    // verify that all inner vectors are not sorted wrt less
+    VERIFY_IS_EQUAL(m2.template innerIndicesAreSorted<std::less<>>(), 0);
+    // verify that all inner vectors are sorted wrt greater
+    VERIFY_IS_EQUAL(m2.template innerIndicesAreSorted<std::greater<>>(), m2.outerSize());
+    // verify that sort does not change evaluation
+    VERIFY_IS_APPROX(m2, m1);
+    // sort wrt less
+    m2.template sortInnerIndices<std::less<>>();
+    // verify that all inner vectors are sorted wrt less
+    VERIFY_IS_EQUAL(m2.template innerIndicesAreSorted<std::less<>>(), m2.outerSize());
+    // verify that all inner vectors are not sorted wrt greater
+    VERIFY_IS_EQUAL(m2.template innerIndicesAreSorted<std::greater<>>(), 0);
+    // verify that sort does not change evaluation
+    VERIFY_IS_APPROX(m2, m1);
+  }
 
   // test basic computations
   {
@@ -305,29 +292,28 @@
     initSparse<Scalar>(density, refM3, m3);
     initSparse<Scalar>(density, refM4, m4);
 
-    if(internal::random<bool>())
-      m1.makeCompressed();
+    if (internal::random<bool>()) m1.makeCompressed();
 
     Index m1_nnz = m1.nonZeros();
 
-    VERIFY_IS_APPROX(m1*s1, refM1*s1);
-    VERIFY_IS_APPROX(m1+m2, refM1+refM2);
-    VERIFY_IS_APPROX(m1+m2+m3, refM1+refM2+refM3);
-    VERIFY_IS_APPROX(m3.cwiseProduct(m1+m2), refM3.cwiseProduct(refM1+refM2));
-    VERIFY_IS_APPROX(m1*s1-m2, refM1*s1-refM2);
-    VERIFY_IS_APPROX(m4=m1/s1, refM1/s1);
+    VERIFY_IS_APPROX(m1 * s1, refM1 * s1);
+    VERIFY_IS_APPROX(m1 + m2, refM1 + refM2);
+    VERIFY_IS_APPROX(m1 + m2 + m3, refM1 + refM2 + refM3);
+    VERIFY_IS_APPROX(m3.cwiseProduct(m1 + m2), refM3.cwiseProduct(refM1 + refM2));
+    VERIFY_IS_APPROX(m1 * s1 - m2, refM1 * s1 - refM2);
+    VERIFY_IS_APPROX(m4 = m1 / s1, refM1 / s1);
     VERIFY_IS_EQUAL(m4.nonZeros(), m1_nnz);
 
-    if(SparseMatrixType::IsRowMajor)
+    if (SparseMatrixType::IsRowMajor)
       VERIFY_IS_APPROX(m1.innerVector(0).dot(refM2.row(0)), refM1.row(0).dot(refM2.row(0)));
     else
       VERIFY_IS_APPROX(m1.innerVector(0).dot(refM2.col(0)), refM1.col(0).dot(refM2.col(0)));
 
     DenseVector rv = DenseVector::Random(m1.cols());
     DenseVector cv = DenseVector::Random(m1.rows());
-    Index r = internal::random<Index>(0,m1.rows()-2);
-    Index c = internal::random<Index>(0,m1.cols()-1);
-    VERIFY_IS_APPROX(( m1.template block<1,Dynamic>(r,0,1,m1.cols()).dot(rv)) , refM1.row(r).dot(rv));
+    Index r = internal::random<Index>(0, m1.rows() - 2);
+    Index c = internal::random<Index>(0, m1.cols() - 1);
+    VERIFY_IS_APPROX((m1.template block<1, Dynamic>(r, 0, 1, m1.cols()).dot(rv)), refM1.row(r).dot(rv));
     VERIFY_IS_APPROX(m1.row(r).dot(rv), refM1.row(r).dot(rv));
     VERIFY_IS_APPROX(m1.col(c).dot(cv), refM1.col(c).dot(cv));
 
@@ -339,87 +325,118 @@
     VERIFY_IS_APPROX(m3.cwiseProduct(refM4), refM3.cwiseProduct(refM4));
     // dense cwise* sparse
     VERIFY_IS_APPROX(refM4.cwiseProduct(m3), refM4.cwiseProduct(refM3));
-//     VERIFY_IS_APPROX(m3.cwise()/refM4, refM3.cwise()/refM4);
+    //     VERIFY_IS_APPROX(m3.cwise()/refM4, refM3.cwise()/refM4);
 
     // mixed sparse-dense
     VERIFY_IS_APPROX(refM4 + m3, refM4 + refM3);
     VERIFY_IS_APPROX(m3 + refM4, refM3 + refM4);
     VERIFY_IS_APPROX(refM4 - m3, refM4 - refM3);
     VERIFY_IS_APPROX(m3 - refM4, refM3 - refM4);
-    VERIFY_IS_APPROX((RealScalar(0.5)*refM4 + RealScalar(0.5)*m3).eval(), RealScalar(0.5)*refM4 + RealScalar(0.5)*refM3);
-    VERIFY_IS_APPROX((RealScalar(0.5)*refM4 + m3*RealScalar(0.5)).eval(), RealScalar(0.5)*refM4 + RealScalar(0.5)*refM3);
-    VERIFY_IS_APPROX((RealScalar(0.5)*refM4 + m3.cwiseProduct(m3)).eval(), RealScalar(0.5)*refM4 + refM3.cwiseProduct(refM3));
+    VERIFY_IS_APPROX((RealScalar(0.5) * refM4 + RealScalar(0.5) * m3).eval(),
+                     RealScalar(0.5) * refM4 + RealScalar(0.5) * refM3);
+    VERIFY_IS_APPROX((RealScalar(0.5) * refM4 + m3 * RealScalar(0.5)).eval(),
+                     RealScalar(0.5) * refM4 + RealScalar(0.5) * refM3);
+    VERIFY_IS_APPROX((RealScalar(0.5) * refM4 + m3.cwiseProduct(m3)).eval(),
+                     RealScalar(0.5) * refM4 + refM3.cwiseProduct(refM3));
 
-    VERIFY_IS_APPROX((RealScalar(0.5)*refM4 + RealScalar(0.5)*m3).eval(), RealScalar(0.5)*refM4 + RealScalar(0.5)*refM3);
-    VERIFY_IS_APPROX((RealScalar(0.5)*refM4 + m3*RealScalar(0.5)).eval(), RealScalar(0.5)*refM4 + RealScalar(0.5)*refM3);
-    VERIFY_IS_APPROX((RealScalar(0.5)*refM4 + (m3+m3)).eval(), RealScalar(0.5)*refM4 + (refM3+refM3));
-    VERIFY_IS_APPROX(((refM3+m3)+RealScalar(0.5)*m3).eval(), RealScalar(0.5)*refM3 + (refM3+refM3));
-    VERIFY_IS_APPROX((RealScalar(0.5)*refM4 + (refM3+m3)).eval(), RealScalar(0.5)*refM4 + (refM3+refM3));
-    VERIFY_IS_APPROX((RealScalar(0.5)*refM4 + (m3+refM3)).eval(), RealScalar(0.5)*refM4 + (refM3+refM3));
-
+    VERIFY_IS_APPROX((RealScalar(0.5) * refM4 + RealScalar(0.5) * m3).eval(),
+                     RealScalar(0.5) * refM4 + RealScalar(0.5) * refM3);
+    VERIFY_IS_APPROX((RealScalar(0.5) * refM4 + m3 * RealScalar(0.5)).eval(),
+                     RealScalar(0.5) * refM4 + RealScalar(0.5) * refM3);
+    VERIFY_IS_APPROX((RealScalar(0.5) * refM4 + (m3 + m3)).eval(), RealScalar(0.5) * refM4 + (refM3 + refM3));
+    VERIFY_IS_APPROX(((refM3 + m3) + RealScalar(0.5) * m3).eval(), RealScalar(0.5) * refM3 + (refM3 + refM3));
+    VERIFY_IS_APPROX((RealScalar(0.5) * refM4 + (refM3 + m3)).eval(), RealScalar(0.5) * refM4 + (refM3 + refM3));
+    VERIFY_IS_APPROX((RealScalar(0.5) * refM4 + (m3 + refM3)).eval(), RealScalar(0.5) * refM4 + (refM3 + refM3));
 
     VERIFY_IS_APPROX(m1.sum(), refM1.sum());
 
-    m4 = m1; refM4 = m4;
+    m4 = m1;
+    refM4 = m4;
 
-    VERIFY_IS_APPROX(m1*=s1, refM1*=s1);
+    VERIFY_IS_APPROX(m1 *= s1, refM1 *= s1);
     VERIFY_IS_EQUAL(m1.nonZeros(), m1_nnz);
-    VERIFY_IS_APPROX(m1/=s1, refM1/=s1);
+    VERIFY_IS_APPROX(m1 /= s1, refM1 /= s1);
     VERIFY_IS_EQUAL(m1.nonZeros(), m1_nnz);
 
-    VERIFY_IS_APPROX(m1+=m2, refM1+=refM2);
-    VERIFY_IS_APPROX(m1-=m2, refM1-=refM2);
+    VERIFY_IS_APPROX(m1 += m2, refM1 += refM2);
+    VERIFY_IS_APPROX(m1 -= m2, refM1 -= refM2);
 
     refM3 = refM1;
-    
-    VERIFY_IS_APPROX(refM1+=m2, refM3+=refM2);
-    VERIFY_IS_APPROX(refM1-=m2, refM3-=refM2);
 
-    g_dense_op_sparse_count=0; VERIFY_IS_APPROX(refM1 =m2+refM4, refM3 =refM2+refM4);  VERIFY_IS_EQUAL(g_dense_op_sparse_count,10);
-    g_dense_op_sparse_count=0; VERIFY_IS_APPROX(refM1+=m2+refM4, refM3+=refM2+refM4);  VERIFY_IS_EQUAL(g_dense_op_sparse_count,1);
-    g_dense_op_sparse_count=0; VERIFY_IS_APPROX(refM1-=m2+refM4, refM3-=refM2+refM4);  VERIFY_IS_EQUAL(g_dense_op_sparse_count,1);
-    g_dense_op_sparse_count=0; VERIFY_IS_APPROX(refM1 =refM4+m2, refM3 =refM2+refM4);  VERIFY_IS_EQUAL(g_dense_op_sparse_count,1);
-    g_dense_op_sparse_count=0; VERIFY_IS_APPROX(refM1+=refM4+m2, refM3+=refM2+refM4);  VERIFY_IS_EQUAL(g_dense_op_sparse_count,1);
-    g_dense_op_sparse_count=0; VERIFY_IS_APPROX(refM1-=refM4+m2, refM3-=refM2+refM4);  VERIFY_IS_EQUAL(g_dense_op_sparse_count,1);
+    VERIFY_IS_APPROX(refM1 += m2, refM3 += refM2);
+    VERIFY_IS_APPROX(refM1 -= m2, refM3 -= refM2);
 
-    g_dense_op_sparse_count=0; VERIFY_IS_APPROX(refM1 =m2-refM4, refM3 =refM2-refM4);  VERIFY_IS_EQUAL(g_dense_op_sparse_count,20);
-    g_dense_op_sparse_count=0; VERIFY_IS_APPROX(refM1+=m2-refM4, refM3+=refM2-refM4);  VERIFY_IS_EQUAL(g_dense_op_sparse_count,1);
-    g_dense_op_sparse_count=0; VERIFY_IS_APPROX(refM1-=m2-refM4, refM3-=refM2-refM4);  VERIFY_IS_EQUAL(g_dense_op_sparse_count,1);
-    g_dense_op_sparse_count=0; VERIFY_IS_APPROX(refM1 =refM4-m2, refM3 =refM4-refM2);  VERIFY_IS_EQUAL(g_dense_op_sparse_count,1);
-    g_dense_op_sparse_count=0; VERIFY_IS_APPROX(refM1+=refM4-m2, refM3+=refM4-refM2);  VERIFY_IS_EQUAL(g_dense_op_sparse_count,1);
-    g_dense_op_sparse_count=0; VERIFY_IS_APPROX(refM1-=refM4-m2, refM3-=refM4-refM2);  VERIFY_IS_EQUAL(g_dense_op_sparse_count,1);
+    g_dense_op_sparse_count = 0;
+    VERIFY_IS_APPROX(refM1 = m2 + refM4, refM3 = refM2 + refM4);
+    VERIFY_IS_EQUAL(g_dense_op_sparse_count, 10);
+    g_dense_op_sparse_count = 0;
+    VERIFY_IS_APPROX(refM1 += m2 + refM4, refM3 += refM2 + refM4);
+    VERIFY_IS_EQUAL(g_dense_op_sparse_count, 1);
+    g_dense_op_sparse_count = 0;
+    VERIFY_IS_APPROX(refM1 -= m2 + refM4, refM3 -= refM2 + refM4);
+    VERIFY_IS_EQUAL(g_dense_op_sparse_count, 1);
+    g_dense_op_sparse_count = 0;
+    VERIFY_IS_APPROX(refM1 = refM4 + m2, refM3 = refM2 + refM4);
+    VERIFY_IS_EQUAL(g_dense_op_sparse_count, 1);
+    g_dense_op_sparse_count = 0;
+    VERIFY_IS_APPROX(refM1 += refM4 + m2, refM3 += refM2 + refM4);
+    VERIFY_IS_EQUAL(g_dense_op_sparse_count, 1);
+    g_dense_op_sparse_count = 0;
+    VERIFY_IS_APPROX(refM1 -= refM4 + m2, refM3 -= refM2 + refM4);
+    VERIFY_IS_EQUAL(g_dense_op_sparse_count, 1);
+
+    g_dense_op_sparse_count = 0;
+    VERIFY_IS_APPROX(refM1 = m2 - refM4, refM3 = refM2 - refM4);
+    VERIFY_IS_EQUAL(g_dense_op_sparse_count, 20);
+    g_dense_op_sparse_count = 0;
+    VERIFY_IS_APPROX(refM1 += m2 - refM4, refM3 += refM2 - refM4);
+    VERIFY_IS_EQUAL(g_dense_op_sparse_count, 1);
+    g_dense_op_sparse_count = 0;
+    VERIFY_IS_APPROX(refM1 -= m2 - refM4, refM3 -= refM2 - refM4);
+    VERIFY_IS_EQUAL(g_dense_op_sparse_count, 1);
+    g_dense_op_sparse_count = 0;
+    VERIFY_IS_APPROX(refM1 = refM4 - m2, refM3 = refM4 - refM2);
+    VERIFY_IS_EQUAL(g_dense_op_sparse_count, 1);
+    g_dense_op_sparse_count = 0;
+    VERIFY_IS_APPROX(refM1 += refM4 - m2, refM3 += refM4 - refM2);
+    VERIFY_IS_EQUAL(g_dense_op_sparse_count, 1);
+    g_dense_op_sparse_count = 0;
+    VERIFY_IS_APPROX(refM1 -= refM4 - m2, refM3 -= refM4 - refM2);
+    VERIFY_IS_EQUAL(g_dense_op_sparse_count, 1);
     refM3 = m3;
 
-    if (rows>=2 && cols>=2)
-    {
-      VERIFY_RAISES_ASSERT( m1 += m1.innerVector(0) );
-      VERIFY_RAISES_ASSERT( m1 -= m1.innerVector(0) );
-      VERIFY_RAISES_ASSERT( refM1 -= m1.innerVector(0) );
-      VERIFY_RAISES_ASSERT( refM1 += m1.innerVector(0) );
+    if (rows >= 2 && cols >= 2) {
+      VERIFY_RAISES_ASSERT(m1 += m1.innerVector(0));
+      VERIFY_RAISES_ASSERT(m1 -= m1.innerVector(0));
+      VERIFY_RAISES_ASSERT(refM1 -= m1.innerVector(0));
+      VERIFY_RAISES_ASSERT(refM1 += m1.innerVector(0));
     }
-    m1 = m4; refM1 = refM4;
+    m1 = m4;
+    refM1 = refM4;
 
     // test aliasing
     VERIFY_IS_APPROX((m1 = -m1), (refM1 = -refM1));
     VERIFY_IS_EQUAL(m1.nonZeros(), m1_nnz);
-    m1 = m4; refM1 = refM4;
+    m1 = m4;
+    refM1 = refM4;
     VERIFY_IS_APPROX((m1 = m1.transpose()), (refM1 = refM1.transpose().eval()));
     VERIFY_IS_EQUAL(m1.nonZeros(), m1_nnz);
-    m1 = m4; refM1 = refM4;
+    m1 = m4;
+    refM1 = refM4;
     VERIFY_IS_APPROX((m1 = -m1.transpose()), (refM1 = -refM1.transpose().eval()));
     VERIFY_IS_EQUAL(m1.nonZeros(), m1_nnz);
-    m1 = m4; refM1 = refM4;
+    m1 = m4;
+    refM1 = refM4;
     VERIFY_IS_APPROX((m1 += -m1), (refM1 += -refM1));
     VERIFY_IS_EQUAL(m1.nonZeros(), m1_nnz);
-    m1 = m4; refM1 = refM4;
+    m1 = m4;
+    refM1 = refM4;
 
-    if(m1.isCompressed())
-    {
+    if (m1.isCompressed()) {
       VERIFY_IS_APPROX(m1.coeffs().sum(), m1.sum());
       m1.coeffs() += s1;
-      for(Index j = 0; j<m1.outerSize(); ++j)
-        for(typename SparseMatrixType::InnerIterator it(m1,j); it; ++it)
-          refM1(it.row(), it.col()) += s1;
+      for (Index j = 0; j < m1.outerSize(); ++j)
+        for (typename SparseMatrixType::InnerIterator it(m1, j); it; ++it) refM1(it.row(), it.col()) += s1;
       VERIFY_IS_APPROX(m1, refM1);
     }
 
@@ -429,12 +446,14 @@
       SpBool mb1 = m1.real().template cast<bool>();
       SpBool mb2 = m2.real().template cast<bool>();
       VERIFY_IS_EQUAL(mb1.template cast<int>().sum(), refM1.real().template cast<bool>().count());
-      VERIFY_IS_EQUAL((mb1 && mb2).template cast<int>().sum(), (refM1.real().template cast<bool>() && refM2.real().template cast<bool>()).count());
-      VERIFY_IS_EQUAL((mb1 || mb2).template cast<int>().sum(), (refM1.real().template cast<bool>() || refM2.real().template cast<bool>()).count());
+      VERIFY_IS_EQUAL((mb1 && mb2).template cast<int>().sum(),
+                      (refM1.real().template cast<bool>() && refM2.real().template cast<bool>()).count());
+      VERIFY_IS_EQUAL((mb1 || mb2).template cast<int>().sum(),
+                      (refM1.real().template cast<bool>() || refM2.real().template cast<bool>()).count());
       SpBool mb3 = mb1 && mb2;
-      if(mb1.coeffs().all() && mb2.coeffs().all())
-      {
-        VERIFY_IS_EQUAL(mb3.nonZeros(), (refM1.real().template cast<bool>() && refM2.real().template cast<bool>()).count());
+      if (mb1.coeffs().all() && mb2.coeffs().all()) {
+        VERIFY_IS_EQUAL(mb3.nonZeros(),
+                        (refM1.real().template cast<bool>() && refM2.real().template cast<bool>()).count());
       }
     }
   }
@@ -446,23 +465,20 @@
     initSparse<Scalar>(density, refMat2, m2);
     std::vector<Scalar> ref_value(m2.innerSize());
     std::vector<Index> ref_index(m2.innerSize());
-    if(internal::random<bool>())
-      m2.makeCompressed();
-    for(Index j = 0; j<m2.outerSize(); ++j)
-    {
+    if (internal::random<bool>()) m2.makeCompressed();
+    for (Index j = 0; j < m2.outerSize(); ++j) {
       Index count_forward = 0;
 
-      for(typename SparseMatrixType::InnerIterator it(m2,j); it; ++it)
-      {
-        ref_value[ref_value.size()-1-count_forward] = it.value();
-        ref_index[ref_index.size()-1-count_forward] = it.index();
+      for (typename SparseMatrixType::InnerIterator it(m2, j); it; ++it) {
+        ref_value[ref_value.size() - 1 - count_forward] = it.value();
+        ref_index[ref_index.size() - 1 - count_forward] = it.index();
         count_forward++;
       }
       Index count_reverse = 0;
-      for(typename SparseMatrixType::ReverseInnerIterator it(m2,j); it; --it)
-      {
-        VERIFY_IS_APPROX( std::abs(ref_value[ref_value.size()-count_forward+count_reverse])+1, std::abs(it.value())+1);
-        VERIFY_IS_EQUAL( ref_index[ref_index.size()-count_forward+count_reverse] , it.index());
+      for (typename SparseMatrixType::ReverseInnerIterator it(m2, j); it; --it) {
+        VERIFY_IS_APPROX(std::abs(ref_value[ref_value.size() - count_forward + count_reverse]) + 1,
+                         std::abs(it.value()) + 1);
+        VERIFY_IS_EQUAL(ref_index[ref_index.size() - count_forward + count_reverse], it.index());
         count_reverse++;
       }
       VERIFY_IS_EQUAL(count_forward, count_reverse);
@@ -478,7 +494,7 @@
     VERIFY_IS_APPROX(m2.transpose(), refMat2.transpose());
 
     VERIFY_IS_APPROX(SparseMatrixType(m2.adjoint()), refMat2.adjoint());
-    
+
     // check isApprox handles opposite storage order
     typename Transpose<SparseMatrixType>::PlainObject m3(m2);
     VERIFY(m2.isApprox(m3));
@@ -492,49 +508,40 @@
     int countFalseNonZero = 0;
     int countTrueNonZero = 0;
     m2.reserve(VectorXi::Constant(m2.outerSize(), int(m2.innerSize())));
-    for (Index j=0; j<m2.cols(); ++j)
-    {
-      for (Index i=0; i<m2.rows(); ++i)
-      {
-        float x = internal::random<float>(0,1);
-        if (x<0.1f)
-        {
+    for (Index j = 0; j < m2.cols(); ++j) {
+      for (Index i = 0; i < m2.rows(); ++i) {
+        float x = internal::random<float>(0, 1);
+        if (x < 0.1f) {
           // do nothing
-        }
-        else if (x<0.5f)
-        {
+        } else if (x < 0.5f) {
           countFalseNonZero++;
-          m2.insert(i,j) = Scalar(0);
-        }
-        else
-        {
+          m2.insert(i, j) = Scalar(0);
+        } else {
           countTrueNonZero++;
-          m2.insert(i,j) = Scalar(1);
-          refM2(i,j) = Scalar(1);
+          m2.insert(i, j) = Scalar(1);
+          refM2(i, j) = Scalar(1);
         }
       }
     }
-    if(internal::random<bool>())
-      m2.makeCompressed();
-    VERIFY(countFalseNonZero+countTrueNonZero == m2.nonZeros());
-    if(countTrueNonZero>0)
-      VERIFY_IS_APPROX(m2, refM2);
+    if (internal::random<bool>()) m2.makeCompressed();
+    VERIFY(countFalseNonZero + countTrueNonZero == m2.nonZeros());
+    if (countTrueNonZero > 0) VERIFY_IS_APPROX(m2, refM2);
     m2.prune(Scalar(1));
-    VERIFY(countTrueNonZero==m2.nonZeros());
+    VERIFY(countTrueNonZero == m2.nonZeros());
     VERIFY_IS_APPROX(m2, refM2);
   }
 
   // test setFromTriplets / insertFromTriplets
   {
-    typedef Triplet<Scalar,StorageIndex> TripletType;
+    typedef Triplet<Scalar, StorageIndex> TripletType;
     Index ntriplets = rows * cols;
 
     std::vector<TripletType> triplets;
 
     triplets.reserve(ntriplets);
-    DenseMatrix refMat_sum  = DenseMatrix::Zero(rows,cols);
-    DenseMatrix refMat_prod = DenseMatrix::Zero(rows,cols);
-    DenseMatrix refMat_last = DenseMatrix::Zero(rows,cols);
+    DenseMatrix refMat_sum = DenseMatrix::Zero(rows, cols);
+    DenseMatrix refMat_prod = DenseMatrix::Zero(rows, cols);
+    DenseMatrix refMat_last = DenseMatrix::Zero(rows, cols);
 
     for (Index i = 0; i < ntriplets; ++i) {
       StorageIndex r = internal::random<StorageIndex>(0, StorageIndex(rows - 1));
@@ -568,7 +575,7 @@
       refMat_last_more(r, c) = v;
     }
 
-    SparseMatrixType m(rows,cols);
+    SparseMatrixType m(rows, cols);
 
     // test setFromTriplets / insertFromTriplets
 
@@ -588,7 +595,7 @@
     VERIFY_IS_APPROX(m, refMat_prod_more);
     VERIFY_IS_EQUAL(m.innerIndicesAreSorted(), m.outerSize());
 
-    m.setFromTriplets(triplets.begin(), triplets.end(), [] (Scalar,Scalar b) { return b; });
+    m.setFromTriplets(triplets.begin(), triplets.end(), [](Scalar, Scalar b) { return b; });
     VERIFY_IS_APPROX(m, refMat_last);
     VERIFY_IS_EQUAL(m.innerIndicesAreSorted(), m.outerSize());
     m.setFromTriplets(triplets.begin(), triplets.end(), [](Scalar, Scalar b) { return b; });
@@ -686,7 +693,7 @@
     VERIFY_IS_APPROX(m, refMat_last_more);
     VERIFY_IS_EQUAL(m.innerIndicesAreSorted(), m.outerSize());
   }
-  
+
   // test Map
   {
     DenseMatrix refMat2(rows, cols), refMat3(rows, cols);
@@ -694,22 +701,24 @@
     initSparse<Scalar>(density, refMat2, m2);
     initSparse<Scalar>(density, refMat3, m3);
     {
-      Map<SparseMatrixType> mapMat2(m2.rows(), m2.cols(), m2.nonZeros(), m2.outerIndexPtr(), m2.innerIndexPtr(), m2.valuePtr(), m2.innerNonZeroPtr());
-      Map<SparseMatrixType> mapMat3(m3.rows(), m3.cols(), m3.nonZeros(), m3.outerIndexPtr(), m3.innerIndexPtr(), m3.valuePtr(), m3.innerNonZeroPtr());
-      VERIFY_IS_APPROX(mapMat2+mapMat3, refMat2+refMat3);
-      VERIFY_IS_APPROX(mapMat2+mapMat3, refMat2+refMat3);
+      Map<SparseMatrixType> mapMat2(m2.rows(), m2.cols(), m2.nonZeros(), m2.outerIndexPtr(), m2.innerIndexPtr(),
+                                    m2.valuePtr(), m2.innerNonZeroPtr());
+      Map<SparseMatrixType> mapMat3(m3.rows(), m3.cols(), m3.nonZeros(), m3.outerIndexPtr(), m3.innerIndexPtr(),
+                                    m3.valuePtr(), m3.innerNonZeroPtr());
+      VERIFY_IS_APPROX(mapMat2 + mapMat3, refMat2 + refMat3);
+      VERIFY_IS_APPROX(mapMat2 + mapMat3, refMat2 + refMat3);
     }
 
-    Index i = internal::random<Index>(0,rows-1);
-    Index j = internal::random<Index>(0,cols-1);
-    m2.coeffRef(i,j) = 123;
-    if(internal::random<bool>())
-      m2.makeCompressed();
-    Map<SparseMatrixType> mapMat2(rows, cols, m2.nonZeros(), m2.outerIndexPtr(), m2.innerIndexPtr(), m2.valuePtr(),  m2.innerNonZeroPtr());
-    VERIFY_IS_EQUAL(m2.coeff(i,j),Scalar(123));
-    VERIFY_IS_EQUAL(mapMat2.coeff(i,j),Scalar(123));
-    mapMat2.coeffRef(i,j) = -123;
-    VERIFY_IS_EQUAL(m2.coeff(i,j),Scalar(-123));
+    Index i = internal::random<Index>(0, rows - 1);
+    Index j = internal::random<Index>(0, cols - 1);
+    m2.coeffRef(i, j) = 123;
+    if (internal::random<bool>()) m2.makeCompressed();
+    Map<SparseMatrixType> mapMat2(rows, cols, m2.nonZeros(), m2.outerIndexPtr(), m2.innerIndexPtr(), m2.valuePtr(),
+                                  m2.innerNonZeroPtr());
+    VERIFY_IS_EQUAL(m2.coeff(i, j), Scalar(123));
+    VERIFY_IS_EQUAL(mapMat2.coeff(i, j), Scalar(123));
+    mapMat2.coeffRef(i, j) = -123;
+    VERIFY_IS_EQUAL(m2.coeff(i, j), Scalar(-123));
   }
 
   // test triangularView
@@ -752,10 +761,9 @@
     VERIFY_IS_CWISE_EQUAL(m2.template triangularView<UnitLower>().toDense(), DenseMatrix::Identity(rows, cols));
     VERIFY_IS_CWISE_EQUAL(m2.template triangularView<UnitUpper>().toDense(), DenseMatrix::Identity(rows, cols));
   }
-  
+
   // test selfadjointView
-  if(!SparseMatrixType::IsRowMajor)
-  {
+  if (!SparseMatrixType::IsRowMajor) {
     DenseMatrix refMat2(rows, rows), refMat3(rows, rows);
     SparseMatrixType m2(rows, rows), m3(rows, rows);
     initSparse<Scalar>(density, refMat2, m2);
@@ -772,11 +780,11 @@
     VERIFY_IS_APPROX(m3, refMat3);
 
     // selfadjointView only works for square matrices:
-    SparseMatrixType m4(rows, rows+1);
+    SparseMatrixType m4(rows, rows + 1);
     VERIFY_RAISES_ASSERT(m4.template selfadjointView<Lower>());
     VERIFY_RAISES_ASSERT(m4.template selfadjointView<Upper>());
   }
-  
+
   // test sparseView
   {
     DenseMatrix refMat2 = DenseMatrix::Zero(rows, rows);
@@ -785,10 +793,10 @@
     VERIFY_IS_APPROX(m2.eval(), refMat2.sparseView().eval());
 
     // sparse view on expressions:
-    VERIFY_IS_APPROX((s1*m2).eval(), (s1*refMat2).sparseView().eval());
-    VERIFY_IS_APPROX((m2+m2).eval(), (refMat2+refMat2).sparseView().eval());
-    VERIFY_IS_APPROX((m2*m2).eval(), (refMat2.lazyProduct(refMat2)).sparseView().eval());
-    VERIFY_IS_APPROX((m2*m2).eval(), (refMat2*refMat2).sparseView().eval());
+    VERIFY_IS_APPROX((s1 * m2).eval(), (s1 * refMat2).sparseView().eval());
+    VERIFY_IS_APPROX((m2 + m2).eval(), (refMat2 + refMat2).sparseView().eval());
+    VERIFY_IS_APPROX((m2 * m2).eval(), (refMat2.lazyProduct(refMat2)).sparseView().eval());
+    VERIFY_IS_APPROX((m2 * m2).eval(), (refMat2 * refMat2).sparseView().eval());
   }
 
   // test diagonal
@@ -802,13 +810,13 @@
     d = m2.diagonal().array();
     VERIFY_IS_APPROX(d, refMat2.diagonal().eval());
     VERIFY_IS_APPROX(const_cast<const SparseMatrixType&>(m2).diagonal(), refMat2.diagonal().eval());
-    
+
     initSparse<Scalar>(density, refMat2, m2, ForceNonZeroDiag);
-    m2.diagonal()      += refMat2.diagonal();
+    m2.diagonal() += refMat2.diagonal();
     refMat2.diagonal() += refMat2.diagonal();
     VERIFY_IS_APPROX(m2, refMat2);
   }
-  
+
   // test diagonal to sparse
   {
     DenseVector d = DenseVector::Random(rows);
@@ -821,11 +829,15 @@
     refMat2 += d.asDiagonal();
     m2 += d.asDiagonal();
     VERIFY_IS_APPROX(m2, refMat2);
-    m2.setZero();       m2 += d.asDiagonal();
-    refMat2.setZero();  refMat2 += d.asDiagonal();
+    m2.setZero();
+    m2 += d.asDiagonal();
+    refMat2.setZero();
+    refMat2 += d.asDiagonal();
     VERIFY_IS_APPROX(m2, refMat2);
-    m2.setZero();       m2 -= d.asDiagonal();
-    refMat2.setZero();  refMat2 -= d.asDiagonal();
+    m2.setZero();
+    m2 -= d.asDiagonal();
+    refMat2.setZero();
+    refMat2 -= d.asDiagonal();
     VERIFY_IS_APPROX(m2, refMat2);
 
     initSparse<Scalar>(density, refMat2, m2);
@@ -837,56 +849,50 @@
     initSparse<Scalar>(density, refMat2, m2);
     m2.makeCompressed();
     VectorXi res(rows);
-    for(Index i=0; i<rows; ++i)
-      res(i) = internal::random<int>(0,3);
+    for (Index i = 0; i < rows; ++i) res(i) = internal::random<int>(0, 3);
     m2.reserve(res);
     m2 -= d.asDiagonal();
     refMat2 -= d.asDiagonal();
     VERIFY_IS_APPROX(m2, refMat2);
   }
-  
+
   // test conservative resize
   {
-      std::vector< std::pair<StorageIndex,StorageIndex> > inc;
-      if(rows > 3 && cols > 2)
-        inc.push_back(std::pair<StorageIndex,StorageIndex>(-3,-2));
-      inc.push_back(std::pair<StorageIndex,StorageIndex>(0,0));
-      inc.push_back(std::pair<StorageIndex,StorageIndex>(3,2));
-      inc.push_back(std::pair<StorageIndex,StorageIndex>(3,0));
-      inc.push_back(std::pair<StorageIndex,StorageIndex>(0,3));
-      inc.push_back(std::pair<StorageIndex,StorageIndex>(0,-1));
-      inc.push_back(std::pair<StorageIndex,StorageIndex>(-1,0));
-      inc.push_back(std::pair<StorageIndex,StorageIndex>(-1,-1));
+    std::vector<std::pair<StorageIndex, StorageIndex>> inc;
+    if (rows > 3 && cols > 2) inc.push_back(std::pair<StorageIndex, StorageIndex>(-3, -2));
+    inc.push_back(std::pair<StorageIndex, StorageIndex>(0, 0));
+    inc.push_back(std::pair<StorageIndex, StorageIndex>(3, 2));
+    inc.push_back(std::pair<StorageIndex, StorageIndex>(3, 0));
+    inc.push_back(std::pair<StorageIndex, StorageIndex>(0, 3));
+    inc.push_back(std::pair<StorageIndex, StorageIndex>(0, -1));
+    inc.push_back(std::pair<StorageIndex, StorageIndex>(-1, 0));
+    inc.push_back(std::pair<StorageIndex, StorageIndex>(-1, -1));
 
-      for(size_t i = 0; i< inc.size(); i++) {
-        StorageIndex incRows = inc[i].first;
-        StorageIndex incCols = inc[i].second;
-        SparseMatrixType m1(rows, cols);
-        DenseMatrix refMat1 = DenseMatrix::Zero(rows, cols);
-        initSparse<Scalar>(density, refMat1, m1);
+    for (size_t i = 0; i < inc.size(); i++) {
+      StorageIndex incRows = inc[i].first;
+      StorageIndex incCols = inc[i].second;
+      SparseMatrixType m1(rows, cols);
+      DenseMatrix refMat1 = DenseMatrix::Zero(rows, cols);
+      initSparse<Scalar>(density, refMat1, m1);
 
-        SparseMatrixType m2 = m1;
-        m2.makeCompressed();
+      SparseMatrixType m2 = m1;
+      m2.makeCompressed();
 
-        m1.conservativeResize(rows+incRows, cols+incCols);
-        m2.conservativeResize(rows+incRows, cols+incCols);
-        refMat1.conservativeResize(rows+incRows, cols+incCols);
-        if (incRows > 0) refMat1.bottomRows(incRows).setZero();
-        if (incCols > 0) refMat1.rightCols(incCols).setZero();
+      m1.conservativeResize(rows + incRows, cols + incCols);
+      m2.conservativeResize(rows + incRows, cols + incCols);
+      refMat1.conservativeResize(rows + incRows, cols + incCols);
+      if (incRows > 0) refMat1.bottomRows(incRows).setZero();
+      if (incCols > 0) refMat1.rightCols(incCols).setZero();
 
-        VERIFY_IS_APPROX(m1, refMat1);
-        VERIFY_IS_APPROX(m2, refMat1);
+      VERIFY_IS_APPROX(m1, refMat1);
+      VERIFY_IS_APPROX(m2, refMat1);
 
-        // Insert new values
-        if (incRows > 0) 
-          m1.insert(m1.rows()-1, 0) = refMat1(refMat1.rows()-1, 0) = 1;
-        if (incCols > 0) 
-          m1.insert(0, m1.cols()-1) = refMat1(0, refMat1.cols()-1) = 1;
+      // Insert new values
+      if (incRows > 0) m1.insert(m1.rows() - 1, 0) = refMat1(refMat1.rows() - 1, 0) = 1;
+      if (incCols > 0) m1.insert(0, m1.cols() - 1) = refMat1(0, refMat1.cols() - 1) = 1;
 
-        VERIFY_IS_APPROX(m1, refMat1);
-
-
-      }
+      VERIFY_IS_APPROX(m1, refMat1);
+    }
   }
 
   // test Identity matrix
@@ -895,16 +901,14 @@
     SparseMatrixType m1(rows, rows);
     m1.setIdentity();
     VERIFY_IS_APPROX(m1, refMat1);
-    for(int k=0; k<rows*rows/4; ++k)
-    {
-      Index i = internal::random<Index>(0,rows-1);
-      Index j = internal::random<Index>(0,rows-1);
+    for (int k = 0; k < rows * rows / 4; ++k) {
+      Index i = internal::random<Index>(0, rows - 1);
+      Index j = internal::random<Index>(0, rows - 1);
       Scalar v = internal::random<Scalar>();
-      m1.coeffRef(i,j) = v;
-      refMat1.coeffRef(i,j) = v;
+      m1.coeffRef(i, j) = v;
+      refMat1.coeffRef(i, j) = v;
       VERIFY_IS_APPROX(m1, refMat1);
-      if(internal::random<Index>(0,10)<2)
-        m1.makeCompressed();
+      if (internal::random<Index>(0, 10) < 2) m1.makeCompressed();
     }
     m1.setIdentity();
     refMat1.setIdentity();
@@ -919,111 +923,105 @@
     SparseMatrixType m2(rows, cols);
     initSparse<Scalar>(density, refMat2, m2);
     IteratorType static_array[2];
-    static_array[0] = IteratorType(m2,0);
-    static_array[1] = IteratorType(m2,m2.outerSize()-1);
-    VERIFY( static_array[0] || m2.innerVector(static_array[0].outer()).nonZeros() == 0 );
-    VERIFY( static_array[1] || m2.innerVector(static_array[1].outer()).nonZeros() == 0 );
-    if(static_array[0] && static_array[1])
-    {
+    static_array[0] = IteratorType(m2, 0);
+    static_array[1] = IteratorType(m2, m2.outerSize() - 1);
+    VERIFY(static_array[0] || m2.innerVector(static_array[0].outer()).nonZeros() == 0);
+    VERIFY(static_array[1] || m2.innerVector(static_array[1].outer()).nonZeros() == 0);
+    if (static_array[0] && static_array[1]) {
       ++(static_array[1]);
-      static_array[1] = IteratorType(m2,0);
-      VERIFY( static_array[1] );
-      VERIFY( static_array[1].index() == static_array[0].index() );
-      VERIFY( static_array[1].outer() == static_array[0].outer() );
-      VERIFY( static_array[1].value() == static_array[0].value() );
+      static_array[1] = IteratorType(m2, 0);
+      VERIFY(static_array[1]);
+      VERIFY(static_array[1].index() == static_array[0].index());
+      VERIFY(static_array[1].outer() == static_array[0].outer());
+      VERIFY(static_array[1].value() == static_array[0].value());
     }
 
     std::vector<IteratorType> iters(2);
-    iters[0] = IteratorType(m2,0);
-    iters[1] = IteratorType(m2,m2.outerSize()-1);
+    iters[0] = IteratorType(m2, 0);
+    iters[1] = IteratorType(m2, m2.outerSize() - 1);
   }
 
   // test reserve with empty rows/columns
   {
-    SparseMatrixType m1(0,cols);
-    m1.reserve(ArrayXi::Constant(m1.outerSize(),1));
-    SparseMatrixType m2(rows,0);
-    m2.reserve(ArrayXi::Constant(m2.outerSize(),1));
+    SparseMatrixType m1(0, cols);
+    m1.reserve(ArrayXi::Constant(m1.outerSize(), 1));
+    SparseMatrixType m2(rows, 0);
+    m2.reserve(ArrayXi::Constant(m2.outerSize(), 1));
   }
 }
 
-
-template<typename SparseMatrixType>
+template <typename SparseMatrixType>
 void big_sparse_triplet(Index rows, Index cols, double density) {
   typedef typename SparseMatrixType::StorageIndex StorageIndex;
   typedef typename SparseMatrixType::Scalar Scalar;
-  typedef Triplet<Scalar,Index> TripletType;
+  typedef Triplet<Scalar, Index> TripletType;
   std::vector<TripletType> triplets;
-  double nelements = density * static_cast<double>(rows*cols);
-  VERIFY(nelements>=0 && nelements < static_cast<double>(NumTraits<StorageIndex>::highest()));
+  double nelements = density * static_cast<double>(rows * cols);
+  VERIFY(nelements >= 0 && nelements < static_cast<double>(NumTraits<StorageIndex>::highest()));
   Index ntriplets = Index(nelements);
   triplets.reserve(ntriplets);
   Scalar sum = Scalar(0);
-  for(Index i=0;i<ntriplets;++i)
-  {
-    Index r = internal::random<Index>(0,rows-1);
-    Index c = internal::random<Index>(0,cols-1);
+  for (Index i = 0; i < ntriplets; ++i) {
+    Index r = internal::random<Index>(0, rows - 1);
+    Index c = internal::random<Index>(0, cols - 1);
     // use positive values to prevent numerical cancellation errors in sum
     Scalar v = numext::abs(internal::random<Scalar>());
-    triplets.push_back(TripletType(r,c,v));
+    triplets.push_back(TripletType(r, c, v));
     sum += v;
   }
-  SparseMatrixType m(rows,cols);
+  SparseMatrixType m(rows, cols);
   m.setFromTriplets(triplets.begin(), triplets.end());
   VERIFY(m.nonZeros() <= ntriplets);
   VERIFY_IS_APPROX(sum, m.sum());
 }
 
-template<int>
-void bug1105()
-{
+template <int>
+void bug1105() {
   // Regression test for bug 1105
-  int n = Eigen::internal::random<int>(200,600);
-  SparseMatrix<std::complex<double>,0, long> mat(n, n);
+  int n = Eigen::internal::random<int>(200, 600);
+  SparseMatrix<std::complex<double>, 0, long> mat(n, n);
   std::complex<double> val;
 
-  for(int i=0; i<n; ++i)
-  {
-    mat.coeffRef(i, i%(n/10)) = val;
-    VERIFY(mat.data().allocatedSize()<20*n);
+  for (int i = 0; i < n; ++i) {
+    mat.coeffRef(i, i % (n / 10)) = val;
+    VERIFY(mat.data().allocatedSize() < 20 * n);
   }
 }
 
 #ifndef EIGEN_SPARSE_TEST_INCLUDED_FROM_SPARSE_EXTRA
 
-EIGEN_DECLARE_TEST(sparse_basic)
-{
+EIGEN_DECLARE_TEST(sparse_basic) {
   g_dense_op_sparse_count = 0;  // Suppresses compiler warning.
-  for(int i = 0; i < g_repeat; i++) {
-    int r = Eigen::internal::random<int>(1,200), c = Eigen::internal::random<int>(1,200);
-    if(Eigen::internal::random<int>(0,4) == 0) {
-      r = c; // check square matrices in 25% of tries
+  for (int i = 0; i < g_repeat; i++) {
+    int r = Eigen::internal::random<int>(1, 200), c = Eigen::internal::random<int>(1, 200);
+    if (Eigen::internal::random<int>(0, 4) == 0) {
+      r = c;  // check square matrices in 25% of tries
     }
-    EIGEN_UNUSED_VARIABLE(r+c);
-    CALL_SUBTEST_1(( sparse_basic(SparseMatrix<double>(1, 1)) ));
-    CALL_SUBTEST_1(( sparse_basic(SparseMatrix<double>(8, 8)) ));
-    CALL_SUBTEST_2(( sparse_basic(SparseMatrix<std::complex<double>, ColMajor>(r, c)) ));
-    CALL_SUBTEST_2(( sparse_basic(SparseMatrix<std::complex<double>, RowMajor>(r, c)) ));
-    CALL_SUBTEST_2(( sparse_basic(SparseMatrix<float,  RowMajor>(r, c))));
-    CALL_SUBTEST_2(( sparse_basic(SparseMatrix<float,  ColMajor>(r, c))));
-    CALL_SUBTEST_3(( sparse_basic(SparseMatrix<double, ColMajor>(r, c))));
-    CALL_SUBTEST_3(( sparse_basic(SparseMatrix<double, RowMajor>(r, c))));
-    CALL_SUBTEST_4(( sparse_basic(SparseMatrix<double, ColMajor,long int>(r, c)) ));
-    CALL_SUBTEST_4(( sparse_basic(SparseMatrix<double, RowMajor,long int>(r, c)) ));
-    
-    r = Eigen::internal::random<int>(1,100);
-    c = Eigen::internal::random<int>(1,100);
-    if(Eigen::internal::random<int>(0,4) == 0) {
-      r = c; // check square matrices in 25% of tries
+    EIGEN_UNUSED_VARIABLE(r + c);
+    CALL_SUBTEST_1((sparse_basic(SparseMatrix<double>(1, 1))));
+    CALL_SUBTEST_1((sparse_basic(SparseMatrix<double>(8, 8))));
+    CALL_SUBTEST_2((sparse_basic(SparseMatrix<std::complex<double>, ColMajor>(r, c))));
+    CALL_SUBTEST_2((sparse_basic(SparseMatrix<std::complex<double>, RowMajor>(r, c))));
+    CALL_SUBTEST_2((sparse_basic(SparseMatrix<float, RowMajor>(r, c))));
+    CALL_SUBTEST_2((sparse_basic(SparseMatrix<float, ColMajor>(r, c))));
+    CALL_SUBTEST_3((sparse_basic(SparseMatrix<double, ColMajor>(r, c))));
+    CALL_SUBTEST_3((sparse_basic(SparseMatrix<double, RowMajor>(r, c))));
+    CALL_SUBTEST_4((sparse_basic(SparseMatrix<double, ColMajor, long int>(r, c))));
+    CALL_SUBTEST_4((sparse_basic(SparseMatrix<double, RowMajor, long int>(r, c))));
+
+    r = Eigen::internal::random<int>(1, 100);
+    c = Eigen::internal::random<int>(1, 100);
+    if (Eigen::internal::random<int>(0, 4) == 0) {
+      r = c;  // check square matrices in 25% of tries
     }
-    
-    CALL_SUBTEST_5(( sparse_basic(SparseMatrix<double,ColMajor,short int>(short(r), short(c))) ));
-    CALL_SUBTEST_5(( sparse_basic(SparseMatrix<double,RowMajor,short int>(short(r), short(c))) ));
+
+    CALL_SUBTEST_5((sparse_basic(SparseMatrix<double, ColMajor, short int>(short(r), short(c)))));
+    CALL_SUBTEST_5((sparse_basic(SparseMatrix<double, RowMajor, short int>(short(r), short(c)))));
   }
 
   // Regression test for bug 900: (manually insert higher values here, if you have enough RAM):
-  CALL_SUBTEST_5(( big_sparse_triplet<SparseMatrix<float, RowMajor, int>>(10000, 10000, 0.125)));
-  CALL_SUBTEST_5(( big_sparse_triplet<SparseMatrix<double, ColMajor, long int>>(10000, 10000, 0.125)));
+  CALL_SUBTEST_5((big_sparse_triplet<SparseMatrix<float, RowMajor, int>>(10000, 10000, 0.125)));
+  CALL_SUBTEST_5((big_sparse_triplet<SparseMatrix<double, ColMajor, long int>>(10000, 10000, 0.125)));
 
   CALL_SUBTEST_5(bug1105<0>());
 }
diff --git a/test/sparse_block.cpp b/test/sparse_block.cpp
index 955aa60..d4d036a 100644
--- a/test/sparse_block.cpp
+++ b/test/sparse_block.cpp
@@ -10,22 +10,18 @@
 #include "sparse.h"
 #include "AnnoyingScalar.h"
 
-template<typename T>
-std::enable_if_t<(T::Flags&RowMajorBit)==RowMajorBit, typename T::RowXpr>
-innervec(T& A, Index i)
-{
+template <typename T>
+std::enable_if_t<(T::Flags & RowMajorBit) == RowMajorBit, typename T::RowXpr> innervec(T& A, Index i) {
   return A.row(i);
 }
 
-template<typename T>
-std::enable_if_t<(T::Flags&RowMajorBit)==0, typename T::ColXpr>
-innervec(T& A, Index i)
-{
+template <typename T>
+std::enable_if_t<(T::Flags & RowMajorBit) == 0, typename T::ColXpr> innervec(T& A, Index i) {
   return A.col(i);
 }
 
-template<typename SparseMatrixType> void sparse_block(const SparseMatrixType& ref)
-{
+template <typename SparseMatrixType>
+void sparse_block(const SparseMatrixType& ref) {
   const Index rows = ref.rows();
   const Index cols = ref.cols();
   const Index inner = ref.innerSize();
@@ -35,10 +31,10 @@
   typedef typename SparseMatrixType::RealScalar RealScalar;
   typedef typename SparseMatrixType::StorageIndex StorageIndex;
 
-  double density = (std::max)(8./(rows*cols), 0.01);
-  typedef Matrix<Scalar,Dynamic,Dynamic,SparseMatrixType::IsRowMajor?RowMajor:ColMajor> DenseMatrix;
-  typedef Matrix<Scalar,Dynamic,1> DenseVector;
-  typedef Matrix<Scalar,1,Dynamic> RowDenseVector;
+  double density = (std::max)(8. / (rows * cols), 0.01);
+  typedef Matrix<Scalar, Dynamic, Dynamic, SparseMatrixType::IsRowMajor ? RowMajor : ColMajor> DenseMatrix;
+  typedef Matrix<Scalar, Dynamic, 1> DenseVector;
+  typedef Matrix<Scalar, 1, Dynamic> RowDenseVector;
   typedef SparseVector<Scalar> SparseVectorType;
 
   Scalar s1 = internal::random<Scalar>();
@@ -50,71 +46,59 @@
     VERIFY_IS_APPROX(m, refMat);
 
     // test InnerIterators and Block expressions
-    for (int t=0; t<10; ++t)
-    {
-      Index j = internal::random<Index>(0,cols-2);
-      Index i = internal::random<Index>(0,rows-2);
-      Index w = internal::random<Index>(1,cols-j);
-      Index h = internal::random<Index>(1,rows-i);
+    for (int t = 0; t < 10; ++t) {
+      Index j = internal::random<Index>(0, cols - 2);
+      Index i = internal::random<Index>(0, rows - 2);
+      Index w = internal::random<Index>(1, cols - j);
+      Index h = internal::random<Index>(1, rows - i);
 
-      VERIFY_IS_APPROX(m.block(i,j,h,w), refMat.block(i,j,h,w));
-      for(Index c=0; c<w; c++)
-      {
-        VERIFY_IS_APPROX(m.block(i,j,h,w).col(c), refMat.block(i,j,h,w).col(c));
-        for(Index r=0; r<h; r++)
-        {
-          VERIFY_IS_APPROX(m.block(i,j,h,w).col(c).coeff(r), refMat.block(i,j,h,w).col(c).coeff(r));
-          VERIFY_IS_APPROX(m.block(i,j,h,w).coeff(r,c), refMat.block(i,j,h,w).coeff(r,c));
+      VERIFY_IS_APPROX(m.block(i, j, h, w), refMat.block(i, j, h, w));
+      for (Index c = 0; c < w; c++) {
+        VERIFY_IS_APPROX(m.block(i, j, h, w).col(c), refMat.block(i, j, h, w).col(c));
+        for (Index r = 0; r < h; r++) {
+          VERIFY_IS_APPROX(m.block(i, j, h, w).col(c).coeff(r), refMat.block(i, j, h, w).col(c).coeff(r));
+          VERIFY_IS_APPROX(m.block(i, j, h, w).coeff(r, c), refMat.block(i, j, h, w).coeff(r, c));
         }
       }
-      for(Index r=0; r<h; r++)
-      {
-        VERIFY_IS_APPROX(m.block(i,j,h,w).row(r), refMat.block(i,j,h,w).row(r));
-        for(Index c=0; c<w; c++)
-        {
-          VERIFY_IS_APPROX(m.block(i,j,h,w).row(r).coeff(c), refMat.block(i,j,h,w).row(r).coeff(c));
-          VERIFY_IS_APPROX(m.block(i,j,h,w).coeff(r,c), refMat.block(i,j,h,w).coeff(r,c));
+      for (Index r = 0; r < h; r++) {
+        VERIFY_IS_APPROX(m.block(i, j, h, w).row(r), refMat.block(i, j, h, w).row(r));
+        for (Index c = 0; c < w; c++) {
+          VERIFY_IS_APPROX(m.block(i, j, h, w).row(r).coeff(c), refMat.block(i, j, h, w).row(r).coeff(c));
+          VERIFY_IS_APPROX(m.block(i, j, h, w).coeff(r, c), refMat.block(i, j, h, w).coeff(r, c));
         }
       }
-      
-      VERIFY_IS_APPROX(m.middleCols(j,w), refMat.middleCols(j,w));
-      VERIFY_IS_APPROX(m.middleRows(i,h), refMat.middleRows(i,h));
-      for(Index r=0; r<h; r++)
-      {
-        VERIFY_IS_APPROX(m.middleCols(j,w).row(r), refMat.middleCols(j,w).row(r));
-        VERIFY_IS_APPROX(m.middleRows(i,h).row(r), refMat.middleRows(i,h).row(r));
-        for(Index c=0; c<w; c++)
-        {
+
+      VERIFY_IS_APPROX(m.middleCols(j, w), refMat.middleCols(j, w));
+      VERIFY_IS_APPROX(m.middleRows(i, h), refMat.middleRows(i, h));
+      for (Index r = 0; r < h; r++) {
+        VERIFY_IS_APPROX(m.middleCols(j, w).row(r), refMat.middleCols(j, w).row(r));
+        VERIFY_IS_APPROX(m.middleRows(i, h).row(r), refMat.middleRows(i, h).row(r));
+        for (Index c = 0; c < w; c++) {
           VERIFY_IS_APPROX(m.col(c).coeff(r), refMat.col(c).coeff(r));
           VERIFY_IS_APPROX(m.row(r).coeff(c), refMat.row(r).coeff(c));
-          
-          VERIFY_IS_APPROX(m.middleCols(j,w).coeff(r,c), refMat.middleCols(j,w).coeff(r,c));
-          VERIFY_IS_APPROX(m.middleRows(i,h).coeff(r,c), refMat.middleRows(i,h).coeff(r,c));
-          if(!numext::is_exactly_zero(m.middleCols(j, w).coeff(r, c)))
-          {
-            VERIFY_IS_APPROX(m.middleCols(j,w).coeffRef(r,c), refMat.middleCols(j,w).coeff(r,c));
+
+          VERIFY_IS_APPROX(m.middleCols(j, w).coeff(r, c), refMat.middleCols(j, w).coeff(r, c));
+          VERIFY_IS_APPROX(m.middleRows(i, h).coeff(r, c), refMat.middleRows(i, h).coeff(r, c));
+          if (!numext::is_exactly_zero(m.middleCols(j, w).coeff(r, c))) {
+            VERIFY_IS_APPROX(m.middleCols(j, w).coeffRef(r, c), refMat.middleCols(j, w).coeff(r, c));
           }
-          if(!numext::is_exactly_zero(m.middleRows(i, h).coeff(r, c)))
-          {
-            VERIFY_IS_APPROX(m.middleRows(i,h).coeff(r,c), refMat.middleRows(i,h).coeff(r,c));
+          if (!numext::is_exactly_zero(m.middleRows(i, h).coeff(r, c))) {
+            VERIFY_IS_APPROX(m.middleRows(i, h).coeff(r, c), refMat.middleRows(i, h).coeff(r, c));
           }
         }
       }
-      for(Index c=0; c<w; c++)
-      {
-        VERIFY_IS_APPROX(m.middleCols(j,w).col(c), refMat.middleCols(j,w).col(c));
-        VERIFY_IS_APPROX(m.middleRows(i,h).col(c), refMat.middleRows(i,h).col(c));
+      for (Index c = 0; c < w; c++) {
+        VERIFY_IS_APPROX(m.middleCols(j, w).col(c), refMat.middleCols(j, w).col(c));
+        VERIFY_IS_APPROX(m.middleRows(i, h).col(c), refMat.middleRows(i, h).col(c));
       }
     }
 
-    for(Index c=0; c<cols; c++)
-    {
+    for (Index c = 0; c < cols; c++) {
       VERIFY_IS_APPROX(m.col(c) + m.col(c), (m + m).col(c));
       VERIFY_IS_APPROX(m.col(c) + m.col(c), refMat.col(c) + refMat.col(c));
     }
 
-    for(Index r=0; r<rows; r++)
-    {
+    for (Index r = 0; r < rows; r++) {
       VERIFY_IS_APPROX(m.row(r) + m.row(r), (m + m).row(r));
       VERIFY_IS_APPROX(m.row(r) + m.row(r), refMat.row(r) + refMat.row(r));
     }
@@ -125,16 +109,16 @@
     DenseMatrix refMat2 = DenseMatrix::Zero(rows, cols);
     SparseMatrixType m2(rows, cols);
     initSparse<Scalar>(density, refMat2, m2);
-    Index j0 = internal::random<Index>(0,outer-1);
-    Index j1 = internal::random<Index>(0,outer-1);
-    Index r0 = internal::random<Index>(0,rows-1);
-    Index c0 = internal::random<Index>(0,cols-1);
+    Index j0 = internal::random<Index>(0, outer - 1);
+    Index j1 = internal::random<Index>(0, outer - 1);
+    Index r0 = internal::random<Index>(0, rows - 1);
+    Index c0 = internal::random<Index>(0, cols - 1);
 
-    VERIFY_IS_APPROX(m2.innerVector(j0), innervec(refMat2,j0));
-    VERIFY_IS_APPROX(m2.innerVector(j0)+m2.innerVector(j1), innervec(refMat2,j0)+innervec(refMat2,j1));
+    VERIFY_IS_APPROX(m2.innerVector(j0), innervec(refMat2, j0));
+    VERIFY_IS_APPROX(m2.innerVector(j0) + m2.innerVector(j1), innervec(refMat2, j0) + innervec(refMat2, j1));
 
     m2.innerVector(j0) *= Scalar(2);
-    innervec(refMat2,j0) *= Scalar(2);
+    innervec(refMat2, j0) *= Scalar(2);
     VERIFY_IS_APPROX(m2, refMat2);
 
     m2.row(r0) *= Scalar(3);
@@ -154,33 +138,29 @@
     VERIFY_IS_APPROX(m2, refMat2);
 
     SparseVectorType v1;
-    VERIFY_IS_APPROX(v1 = m2.col(c0) * 4, refMat2.col(c0)*4);
-    VERIFY_IS_APPROX(v1 = m2.row(r0) * 4, refMat2.row(r0).transpose()*4);
+    VERIFY_IS_APPROX(v1 = m2.col(c0) * 4, refMat2.col(c0) * 4);
+    VERIFY_IS_APPROX(v1 = m2.row(r0) * 4, refMat2.row(r0).transpose() * 4);
 
-    SparseMatrixType m3(rows,cols);
-    m3.reserve(VectorXi::Constant(outer,int(inner/2)));
-    for(Index j=0; j<outer; ++j)
-      for(Index k=0; k<(std::min)(j,inner); ++k)
-        m3.insertByOuterInner(j,k) = internal::convert_index<StorageIndex>(k+1);
-    for(Index j=0; j<(std::min)(outer, inner); ++j)
-    {
-      VERIFY(j==numext::real(m3.innerVector(j).nonZeros()));
-      if(j>0)
-        VERIFY_IS_EQUAL(RealScalar(j), numext::real(m3.innerVector(j).lastCoeff()));
+    SparseMatrixType m3(rows, cols);
+    m3.reserve(VectorXi::Constant(outer, int(inner / 2)));
+    for (Index j = 0; j < outer; ++j)
+      for (Index k = 0; k < (std::min)(j, inner); ++k)
+        m3.insertByOuterInner(j, k) = internal::convert_index<StorageIndex>(k + 1);
+    for (Index j = 0; j < (std::min)(outer, inner); ++j) {
+      VERIFY(j == numext::real(m3.innerVector(j).nonZeros()));
+      if (j > 0) VERIFY_IS_EQUAL(RealScalar(j), numext::real(m3.innerVector(j).lastCoeff()));
     }
     m3.makeCompressed();
-    for(Index j=0; j<(std::min)(outer, inner); ++j)
-    {
-      VERIFY(j==numext::real(m3.innerVector(j).nonZeros()));
-      if(j>0)
-        VERIFY_IS_EQUAL(RealScalar(j), numext::real(m3.innerVector(j).lastCoeff()));
+    for (Index j = 0; j < (std::min)(outer, inner); ++j) {
+      VERIFY(j == numext::real(m3.innerVector(j).nonZeros()));
+      if (j > 0) VERIFY_IS_EQUAL(RealScalar(j), numext::real(m3.innerVector(j).lastCoeff()));
     }
 
     VERIFY(m3.innerVector(j0).nonZeros() == m3.transpose().innerVector(j0).nonZeros());
 
-//     m2.innerVector(j0) = 2*m2.innerVector(j1);
-//     refMat2.col(j0) = 2*refMat2.col(j1);
-//     VERIFY_IS_APPROX(m2, refMat2);
+    //     m2.innerVector(j0) = 2*m2.innerVector(j1);
+    //     refMat2.col(j0) = 2*refMat2.col(j1);
+    //     VERIFY_IS_APPROX(m2, refMat2);
   }
 
   // test innerVectors()
@@ -188,31 +168,31 @@
     DenseMatrix refMat2 = DenseMatrix::Zero(rows, cols);
     SparseMatrixType m2(rows, cols);
     initSparse<Scalar>(density, refMat2, m2);
-    if(internal::random<float>(0,1)>0.5f) m2.makeCompressed();
-    Index j0 = internal::random<Index>(0,outer-2);
-    Index j1 = internal::random<Index>(0,outer-2);
-    Index n0 = internal::random<Index>(1,outer-(std::max)(j0,j1));
-    if(SparseMatrixType::IsRowMajor)
-      VERIFY_IS_APPROX(m2.innerVectors(j0,n0), refMat2.block(j0,0,n0,cols));
+    if (internal::random<float>(0, 1) > 0.5f) m2.makeCompressed();
+    Index j0 = internal::random<Index>(0, outer - 2);
+    Index j1 = internal::random<Index>(0, outer - 2);
+    Index n0 = internal::random<Index>(1, outer - (std::max)(j0, j1));
+    if (SparseMatrixType::IsRowMajor)
+      VERIFY_IS_APPROX(m2.innerVectors(j0, n0), refMat2.block(j0, 0, n0, cols));
     else
-      VERIFY_IS_APPROX(m2.innerVectors(j0,n0), refMat2.block(0,j0,rows,n0));
-    if(SparseMatrixType::IsRowMajor)
-      VERIFY_IS_APPROX(m2.innerVectors(j0,n0)+m2.innerVectors(j1,n0),
-                       refMat2.middleRows(j0,n0)+refMat2.middleRows(j1,n0));
+      VERIFY_IS_APPROX(m2.innerVectors(j0, n0), refMat2.block(0, j0, rows, n0));
+    if (SparseMatrixType::IsRowMajor)
+      VERIFY_IS_APPROX(m2.innerVectors(j0, n0) + m2.innerVectors(j1, n0),
+                       refMat2.middleRows(j0, n0) + refMat2.middleRows(j1, n0));
     else
-      VERIFY_IS_APPROX(m2.innerVectors(j0,n0)+m2.innerVectors(j1,n0),
-                      refMat2.block(0,j0,rows,n0)+refMat2.block(0,j1,rows,n0));
-    
+      VERIFY_IS_APPROX(m2.innerVectors(j0, n0) + m2.innerVectors(j1, n0),
+                       refMat2.block(0, j0, rows, n0) + refMat2.block(0, j1, rows, n0));
+
     VERIFY_IS_APPROX(m2, refMat2);
-    
-    VERIFY(m2.innerVectors(j0,n0).nonZeros() == m2.transpose().innerVectors(j0,n0).nonZeros());
-    
-    m2.innerVectors(j0,n0) = m2.innerVectors(j0,n0) + m2.innerVectors(j1,n0);
-    if(SparseMatrixType::IsRowMajor)
-      refMat2.middleRows(j0,n0) = (refMat2.middleRows(j0,n0) + refMat2.middleRows(j1,n0)).eval();
+
+    VERIFY(m2.innerVectors(j0, n0).nonZeros() == m2.transpose().innerVectors(j0, n0).nonZeros());
+
+    m2.innerVectors(j0, n0) = m2.innerVectors(j0, n0) + m2.innerVectors(j1, n0);
+    if (SparseMatrixType::IsRowMajor)
+      refMat2.middleRows(j0, n0) = (refMat2.middleRows(j0, n0) + refMat2.middleRows(j1, n0)).eval();
     else
-      refMat2.middleCols(j0,n0) = (refMat2.middleCols(j0,n0) + refMat2.middleCols(j1,n0)).eval();
-    
+      refMat2.middleCols(j0, n0) = (refMat2.middleCols(j0, n0) + refMat2.middleCols(j1, n0)).eval();
+
     VERIFY_IS_APPROX(m2, refMat2);
   }
 
@@ -221,83 +201,77 @@
     DenseMatrix refMat2 = DenseMatrix::Zero(rows, cols);
     SparseMatrixType m2(rows, cols);
     initSparse<Scalar>(density, refMat2, m2);
-    Index j0 = internal::random<Index>(0,outer-2);
-    Index j1 = internal::random<Index>(0,outer-2);
-    Index n0 = internal::random<Index>(1,outer-(std::max)(j0,j1));
-    if(SparseMatrixType::IsRowMajor)
-      VERIFY_IS_APPROX(m2.block(j0,0,n0,cols), refMat2.block(j0,0,n0,cols));
+    Index j0 = internal::random<Index>(0, outer - 2);
+    Index j1 = internal::random<Index>(0, outer - 2);
+    Index n0 = internal::random<Index>(1, outer - (std::max)(j0, j1));
+    if (SparseMatrixType::IsRowMajor)
+      VERIFY_IS_APPROX(m2.block(j0, 0, n0, cols), refMat2.block(j0, 0, n0, cols));
     else
-      VERIFY_IS_APPROX(m2.block(0,j0,rows,n0), refMat2.block(0,j0,rows,n0));
-    
-    if(SparseMatrixType::IsRowMajor)
-      VERIFY_IS_APPROX(m2.block(j0,0,n0,cols)+m2.block(j1,0,n0,cols),
-                      refMat2.block(j0,0,n0,cols)+refMat2.block(j1,0,n0,cols));
+      VERIFY_IS_APPROX(m2.block(0, j0, rows, n0), refMat2.block(0, j0, rows, n0));
+
+    if (SparseMatrixType::IsRowMajor)
+      VERIFY_IS_APPROX(m2.block(j0, 0, n0, cols) + m2.block(j1, 0, n0, cols),
+                       refMat2.block(j0, 0, n0, cols) + refMat2.block(j1, 0, n0, cols));
     else
-      VERIFY_IS_APPROX(m2.block(0,j0,rows,n0)+m2.block(0,j1,rows,n0),
-                      refMat2.block(0,j0,rows,n0)+refMat2.block(0,j1,rows,n0));
-      
-    Index i = internal::random<Index>(0,m2.outerSize()-1);
-    if(SparseMatrixType::IsRowMajor) {
+      VERIFY_IS_APPROX(m2.block(0, j0, rows, n0) + m2.block(0, j1, rows, n0),
+                       refMat2.block(0, j0, rows, n0) + refMat2.block(0, j1, rows, n0));
+
+    Index i = internal::random<Index>(0, m2.outerSize() - 1);
+    if (SparseMatrixType::IsRowMajor) {
       m2.innerVector(i) = m2.innerVector(i) * s1;
       refMat2.row(i) = refMat2.row(i) * s1;
-      VERIFY_IS_APPROX(m2,refMat2);
+      VERIFY_IS_APPROX(m2, refMat2);
     } else {
       m2.innerVector(i) = m2.innerVector(i) * s1;
       refMat2.col(i) = refMat2.col(i) * s1;
-      VERIFY_IS_APPROX(m2,refMat2);
+      VERIFY_IS_APPROX(m2, refMat2);
     }
-    
-    Index r0 = internal::random<Index>(0,rows-2);
-    Index c0 = internal::random<Index>(0,cols-2);
-    Index r1 = internal::random<Index>(1,rows-r0);
-    Index c1 = internal::random<Index>(1,cols-c0);
-    
+
+    Index r0 = internal::random<Index>(0, rows - 2);
+    Index c0 = internal::random<Index>(0, cols - 2);
+    Index r1 = internal::random<Index>(1, rows - r0);
+    Index c1 = internal::random<Index>(1, cols - c0);
+
     VERIFY_IS_APPROX(DenseVector(m2.col(c0)), refMat2.col(c0));
     VERIFY_IS_APPROX(m2.col(c0), refMat2.col(c0));
-    
+
     VERIFY_IS_APPROX(RowDenseVector(m2.row(r0)), refMat2.row(r0));
     VERIFY_IS_APPROX(m2.row(r0), refMat2.row(r0));
 
-    VERIFY_IS_APPROX(m2.block(r0,c0,r1,c1), refMat2.block(r0,c0,r1,c1));
-    VERIFY_IS_APPROX((2*m2).block(r0,c0,r1,c1), (2*refMat2).block(r0,c0,r1,c1));
+    VERIFY_IS_APPROX(m2.block(r0, c0, r1, c1), refMat2.block(r0, c0, r1, c1));
+    VERIFY_IS_APPROX((2 * m2).block(r0, c0, r1, c1), (2 * refMat2).block(r0, c0, r1, c1));
 
-    if(m2.nonZeros()>0)
-    {
+    if (m2.nonZeros() > 0) {
       VERIFY_IS_APPROX(m2, refMat2);
       SparseMatrixType m3(rows, cols);
-      DenseMatrix refMat3(rows, cols); refMat3.setZero();
-      Index n = internal::random<Index>(1,10);
-      for(Index k=0; k<n; ++k)
-      {
-        Index o1 = internal::random<Index>(0,outer-1);
-        Index o2 = internal::random<Index>(0,outer-1);
-        if(SparseMatrixType::IsRowMajor)
-        {
+      DenseMatrix refMat3(rows, cols);
+      refMat3.setZero();
+      Index n = internal::random<Index>(1, 10);
+      for (Index k = 0; k < n; ++k) {
+        Index o1 = internal::random<Index>(0, outer - 1);
+        Index o2 = internal::random<Index>(0, outer - 1);
+        if (SparseMatrixType::IsRowMajor) {
           m3.innerVector(o1) = m2.row(o2);
           refMat3.row(o1) = refMat2.row(o2);
-        }
-        else
-        {
+        } else {
           m3.innerVector(o1) = m2.col(o2);
           refMat3.col(o1) = refMat2.col(o2);
         }
-        if(internal::random<bool>())
-          m3.makeCompressed();
+        if (internal::random<bool>()) m3.makeCompressed();
       }
-      if(m3.nonZeros()>0)
-      VERIFY_IS_APPROX(m3, refMat3);
+      if (m3.nonZeros() > 0) VERIFY_IS_APPROX(m3, refMat3);
     }
   }
-  
+
   // Explicit inner iterator.
   {
     DenseMatrix refMat2 = DenseMatrix::Zero(rows, cols);
     SparseMatrixType m2(rows, cols);
     initSparse<Scalar>(density, refMat2, m2);
-    
-    Index j0 =internal::random<Index>(0, outer - 1);
+
+    Index j0 = internal::random<Index>(0, outer - 1);
     auto v = innervec(m2, j0);
-    
+
     typename decltype(v)::InnerIterator block_iterator(v);
     typename SparseMatrixType::InnerIterator matrix_iterator(m2, j0);
     while (block_iterator) {
@@ -305,38 +279,36 @@
       ++block_iterator;
       ++matrix_iterator;
     }
-
   }
 }
 
-EIGEN_DECLARE_TEST(sparse_block)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    int r = Eigen::internal::random<int>(1,200), c = Eigen::internal::random<int>(1,200);
-    if(Eigen::internal::random<int>(0,4) == 0) {
-      r = c; // check square matrices in 25% of tries
+EIGEN_DECLARE_TEST(sparse_block) {
+  for (int i = 0; i < g_repeat; i++) {
+    int r = Eigen::internal::random<int>(1, 200), c = Eigen::internal::random<int>(1, 200);
+    if (Eigen::internal::random<int>(0, 4) == 0) {
+      r = c;  // check square matrices in 25% of tries
     }
-    EIGEN_UNUSED_VARIABLE(r+c);
-    CALL_SUBTEST_1(( sparse_block(SparseMatrix<double>(1, 1)) ));
-    CALL_SUBTEST_1(( sparse_block(SparseMatrix<double>(8, 8)) ));
-    CALL_SUBTEST_1(( sparse_block(SparseMatrix<double>(r, c)) ));
-    CALL_SUBTEST_2(( sparse_block(SparseMatrix<std::complex<double>, ColMajor>(r, c)) ));
-    CALL_SUBTEST_2(( sparse_block(SparseMatrix<std::complex<double>, RowMajor>(r, c)) ));
-    
-    CALL_SUBTEST_3(( sparse_block(SparseMatrix<double,ColMajor,long int>(r, c)) ));
-    CALL_SUBTEST_3(( sparse_block(SparseMatrix<double,RowMajor,long int>(r, c)) ));
-    
-    r = Eigen::internal::random<int>(1,100);
-    c = Eigen::internal::random<int>(1,100);
-    if(Eigen::internal::random<int>(0,4) == 0) {
-      r = c; // check square matrices in 25% of tries
+    EIGEN_UNUSED_VARIABLE(r + c);
+    CALL_SUBTEST_1((sparse_block(SparseMatrix<double>(1, 1))));
+    CALL_SUBTEST_1((sparse_block(SparseMatrix<double>(8, 8))));
+    CALL_SUBTEST_1((sparse_block(SparseMatrix<double>(r, c))));
+    CALL_SUBTEST_2((sparse_block(SparseMatrix<std::complex<double>, ColMajor>(r, c))));
+    CALL_SUBTEST_2((sparse_block(SparseMatrix<std::complex<double>, RowMajor>(r, c))));
+
+    CALL_SUBTEST_3((sparse_block(SparseMatrix<double, ColMajor, long int>(r, c))));
+    CALL_SUBTEST_3((sparse_block(SparseMatrix<double, RowMajor, long int>(r, c))));
+
+    r = Eigen::internal::random<int>(1, 100);
+    c = Eigen::internal::random<int>(1, 100);
+    if (Eigen::internal::random<int>(0, 4) == 0) {
+      r = c;  // check square matrices in 25% of tries
     }
-    
-    CALL_SUBTEST_4(( sparse_block(SparseMatrix<double,ColMajor,short int>(short(r), short(c))) ));
-    CALL_SUBTEST_4(( sparse_block(SparseMatrix<double,RowMajor,short int>(short(r), short(c))) ));
+
+    CALL_SUBTEST_4((sparse_block(SparseMatrix<double, ColMajor, short int>(short(r), short(c)))));
+    CALL_SUBTEST_4((sparse_block(SparseMatrix<double, RowMajor, short int>(short(r), short(c)))));
 #ifndef EIGEN_TEST_ANNOYING_SCALAR_DONT_THROW
     AnnoyingScalar::dont_throw = true;
 #endif
-    CALL_SUBTEST_5((  sparse_block(SparseMatrix<AnnoyingScalar>(r,c)) ));
+    CALL_SUBTEST_5((sparse_block(SparseMatrix<AnnoyingScalar>(r, c))));
   }
 }
diff --git a/test/sparse_permutations.cpp b/test/sparse_permutations.cpp
index 3e46bfa..1657236 100644
--- a/test/sparse_permutations.cpp
+++ b/test/sparse_permutations.cpp
@@ -7,155 +7,151 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-
 static long int nb_transposed_copies;
-#define EIGEN_SPARSE_TRANSPOSED_COPY_PLUGIN {nb_transposed_copies++;}
-#define VERIFY_TRANSPOSITION_COUNT(XPR,N) {\
-    nb_transposed_copies = 0; \
-    XPR; \
-    if(nb_transposed_copies!=N) std::cerr << "nb_transposed_copies == " << nb_transposed_copies << "\n"; \
-    VERIFY( (#XPR) && nb_transposed_copies==N ); \
+#define EIGEN_SPARSE_TRANSPOSED_COPY_PLUGIN \
+  { nb_transposed_copies++; }
+#define VERIFY_TRANSPOSITION_COUNT(XPR, N)                                                                  \
+  {                                                                                                         \
+    nb_transposed_copies = 0;                                                                               \
+    XPR;                                                                                                    \
+    if (nb_transposed_copies != N) std::cerr << "nb_transposed_copies == " << nb_transposed_copies << "\n"; \
+    VERIFY((#XPR) && nb_transposed_copies == N);                                                            \
   }
 
 static long int nb_temporaries;
-#define EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN {nb_temporaries++;}
-#define VERIFY_TEMPORARY_COUNT(XPR,N) {\
-    nb_temporaries = 0; \
-    XPR; \
-    if(nb_temporaries!=N) std::cerr << "nb_temporaries == " << nb_temporaries << "\n"; \
-    VERIFY( (#XPR) && nb_temporaries==N ); \
+#define EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN \
+  { nb_temporaries++; }
+#define VERIFY_TEMPORARY_COUNT(XPR, N)                                                    \
+  {                                                                                       \
+    nb_temporaries = 0;                                                                   \
+    XPR;                                                                                  \
+    if (nb_temporaries != N) std::cerr << "nb_temporaries == " << nb_temporaries << "\n"; \
+    VERIFY((#XPR) && nb_temporaries == N);                                                \
   }
 
 #include "sparse.h"
 
-template<typename T>
+template <typename T>
 bool is_sorted(const T& mat) {
-  for(Index k = 0; k<mat.outerSize(); ++k)
-  {
+  for (Index k = 0; k < mat.outerSize(); ++k) {
     Index prev = -1;
-    for(typename T::InnerIterator it(mat,k); it; ++it)
-    {
-      if(prev>=it.index())
-        return false;
+    for (typename T::InnerIterator it(mat, k); it; ++it) {
+      if (prev >= it.index()) return false;
       prev = it.index();
     }
   }
   return true;
 }
 
-template<typename T>
-typename internal::nested_eval<T,1>::type eval(const T &xpr)
-{
-  VERIFY( int(internal::nested_eval<T,1>::type::Flags&RowMajorBit) == int(internal::evaluator<T>::Flags&RowMajorBit) );
+template <typename T>
+typename internal::nested_eval<T, 1>::type eval(const T& xpr) {
+  VERIFY(int(internal::nested_eval<T, 1>::type::Flags & RowMajorBit) ==
+         int(internal::evaluator<T>::Flags & RowMajorBit));
   return xpr;
 }
 
-template<int OtherStorage, typename SparseMatrixType> void sparse_permutations(const SparseMatrixType& ref)
-{
+template <int OtherStorage, typename SparseMatrixType>
+void sparse_permutations(const SparseMatrixType& ref) {
   const Index rows = ref.rows();
   const Index cols = ref.cols();
   typedef typename SparseMatrixType::Scalar Scalar;
   typedef typename SparseMatrixType::StorageIndex StorageIndex;
   typedef SparseMatrix<Scalar, OtherStorage, StorageIndex> OtherSparseMatrixType;
-  typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrix;
-  typedef Matrix<StorageIndex,Dynamic,1> VectorI;
-//   bool IsRowMajor1 = SparseMatrixType::IsRowMajor;
-//   bool IsRowMajor2 = OtherSparseMatrixType::IsRowMajor;
-  
-  double density = (std::max)(8./static_cast<double>(rows*cols), 0.01);
-  
-  SparseMatrixType mat(rows, cols), up(rows,cols), lo(rows,cols);
+  typedef Matrix<Scalar, Dynamic, Dynamic> DenseMatrix;
+  typedef Matrix<StorageIndex, Dynamic, 1> VectorI;
+  //   bool IsRowMajor1 = SparseMatrixType::IsRowMajor;
+  //   bool IsRowMajor2 = OtherSparseMatrixType::IsRowMajor;
+
+  double density = (std::max)(8. / static_cast<double>(rows * cols), 0.01);
+
+  SparseMatrixType mat(rows, cols), up(rows, cols), lo(rows, cols);
   OtherSparseMatrixType res;
   DenseMatrix mat_d = DenseMatrix::Zero(rows, cols), up_sym_d, lo_sym_d, res_d;
-  
+
   initSparse<Scalar>(density, mat_d, mat, 0);
 
   up = mat.template triangularView<Upper>();
   lo = mat.template triangularView<Lower>();
-  
+
   up_sym_d = mat_d.template selfadjointView<Upper>();
   lo_sym_d = mat_d.template selfadjointView<Lower>();
-  
+
   VERIFY_IS_APPROX(mat, mat_d);
   VERIFY_IS_APPROX(up, DenseMatrix(mat_d.template triangularView<Upper>()));
   VERIFY_IS_APPROX(lo, DenseMatrix(mat_d.template triangularView<Lower>()));
-  
+
   PermutationMatrix<Dynamic> p, p_null;
   VectorI pi;
   randomPermutationVector(pi, cols);
   p.indices() = pi;
 
-  VERIFY( is_sorted( ::eval(mat*p) ));
-  VERIFY( is_sorted( res = mat*p ));
-  VERIFY_TRANSPOSITION_COUNT( ::eval(mat*p), 0);
-  VERIFY_TEMPORARY_COUNT(     ::eval(mat*p), 1)
-  res_d = mat_d*p;
+  VERIFY(is_sorted(::eval(mat * p)));
+  VERIFY(is_sorted(res = mat * p));
+  VERIFY_TRANSPOSITION_COUNT(::eval(mat * p), 0);
+  VERIFY_TEMPORARY_COUNT(::eval(mat * p), 1)
+  res_d = mat_d * p;
   VERIFY(res.isApprox(res_d) && "mat*p");
 
-  VERIFY( is_sorted( ::eval(p*mat) ));
-  VERIFY( is_sorted( res = p*mat ));
-  VERIFY_TRANSPOSITION_COUNT( ::eval(p*mat), 0);
-  VERIFY_TEMPORARY_COUNT(     ::eval(p*mat), 1);
-  res_d = p*mat_d;
+  VERIFY(is_sorted(::eval(p * mat)));
+  VERIFY(is_sorted(res = p * mat));
+  VERIFY_TRANSPOSITION_COUNT(::eval(p * mat), 0);
+  VERIFY_TEMPORARY_COUNT(::eval(p * mat), 1);
+  res_d = p * mat_d;
   VERIFY(res.isApprox(res_d) && "p*mat");
 
-  VERIFY( is_sorted( (mat*p).eval() ));
-  VERIFY( is_sorted( res = mat*p.inverse() ));
-  VERIFY_TRANSPOSITION_COUNT( ::eval(mat*p.inverse()), 0);
-  VERIFY_TEMPORARY_COUNT(     ::eval(mat*p.inverse()), 1);
-  res_d = mat*p.inverse();
+  VERIFY(is_sorted((mat * p).eval()));
+  VERIFY(is_sorted(res = mat * p.inverse()));
+  VERIFY_TRANSPOSITION_COUNT(::eval(mat * p.inverse()), 0);
+  VERIFY_TEMPORARY_COUNT(::eval(mat * p.inverse()), 1);
+  res_d = mat * p.inverse();
   VERIFY(res.isApprox(res_d) && "mat*inv(p)");
 
-  VERIFY( is_sorted( (p*mat+p*mat).eval() ));
-  VERIFY( is_sorted( res = p.inverse()*mat ));
-  VERIFY_TRANSPOSITION_COUNT( ::eval(p.inverse()*mat), 0);
-  VERIFY_TEMPORARY_COUNT(     ::eval(p.inverse()*mat), 1);
-  res_d = p.inverse()*mat_d;
+  VERIFY(is_sorted((p * mat + p * mat).eval()));
+  VERIFY(is_sorted(res = p.inverse() * mat));
+  VERIFY_TRANSPOSITION_COUNT(::eval(p.inverse() * mat), 0);
+  VERIFY_TEMPORARY_COUNT(::eval(p.inverse() * mat), 1);
+  res_d = p.inverse() * mat_d;
   VERIFY(res.isApprox(res_d) && "inv(p)*mat");
 
   //
 
-  VERIFY( is_sorted( (p * mat * p.inverse()).eval() ));
-  VERIFY( is_sorted( res = mat.twistedBy(p) ));
-  VERIFY_TRANSPOSITION_COUNT( ::eval(p * mat * p.inverse()), 0);
+  VERIFY(is_sorted((p * mat * p.inverse()).eval()));
+  VERIFY(is_sorted(res = mat.twistedBy(p)));
+  VERIFY_TRANSPOSITION_COUNT(::eval(p * mat * p.inverse()), 0);
   res_d = (p * mat_d) * p.inverse();
   VERIFY(res.isApprox(res_d) && "p*mat*inv(p)");
 
-  
-  VERIFY( is_sorted( res = mat.template selfadjointView<Upper>().twistedBy(p_null) ));
-  res_d = up_sym_d;
-  VERIFY(res.isApprox(res_d) && "full selfadjoint upper to full");
-  
-  VERIFY( is_sorted( res = mat.template selfadjointView<Lower>().twistedBy(p_null) ));
-  res_d = lo_sym_d;
-  VERIFY(res.isApprox(res_d) && "full selfadjoint lower to full");
-  
-  
-  VERIFY( is_sorted( res = up.template selfadjointView<Upper>().twistedBy(p_null) ));
-  res_d = up_sym_d;
-  VERIFY(res.isApprox(res_d) && "upper selfadjoint to full");
-  
-  VERIFY( is_sorted( res = lo.template selfadjointView<Lower>().twistedBy(p_null) ));
-  res_d = lo_sym_d;
-  VERIFY(res.isApprox(res_d) && "lower selfadjoint full");
-
-
-  VERIFY( is_sorted( res = mat.template selfadjointView<Upper>() ));
+  VERIFY(is_sorted(res = mat.template selfadjointView<Upper>().twistedBy(p_null)));
   res_d = up_sym_d;
   VERIFY(res.isApprox(res_d) && "full selfadjoint upper to full");
 
-  VERIFY( is_sorted( res = mat.template selfadjointView<Lower>() ));
+  VERIFY(is_sorted(res = mat.template selfadjointView<Lower>().twistedBy(p_null)));
   res_d = lo_sym_d;
   VERIFY(res.isApprox(res_d) && "full selfadjoint lower to full");
 
-  VERIFY( is_sorted( res = up.template selfadjointView<Upper>() ));
+  VERIFY(is_sorted(res = up.template selfadjointView<Upper>().twistedBy(p_null)));
   res_d = up_sym_d;
   VERIFY(res.isApprox(res_d) && "upper selfadjoint to full");
 
-  VERIFY( is_sorted( res = lo.template selfadjointView<Lower>() ));
+  VERIFY(is_sorted(res = lo.template selfadjointView<Lower>().twistedBy(p_null)));
   res_d = lo_sym_d;
   VERIFY(res.isApprox(res_d) && "lower selfadjoint full");
 
+  VERIFY(is_sorted(res = mat.template selfadjointView<Upper>()));
+  res_d = up_sym_d;
+  VERIFY(res.isApprox(res_d) && "full selfadjoint upper to full");
+
+  VERIFY(is_sorted(res = mat.template selfadjointView<Lower>()));
+  res_d = lo_sym_d;
+  VERIFY(res.isApprox(res_d) && "full selfadjoint lower to full");
+
+  VERIFY(is_sorted(res = up.template selfadjointView<Upper>()));
+  res_d = up_sym_d;
+  VERIFY(res.isApprox(res_d) && "upper selfadjoint to full");
+
+  VERIFY(is_sorted(res = lo.template selfadjointView<Lower>()));
+  res_d = lo_sym_d;
+  VERIFY(res.isApprox(res_d) && "lower selfadjoint full");
 
   res.template selfadjointView<Upper>() = mat.template selfadjointView<Upper>();
   res_d = up_sym_d.template triangularView<Upper>();
@@ -173,78 +169,77 @@
   res_d = lo_sym_d.template triangularView<Lower>();
   VERIFY(res.isApprox(res_d) && "full selfadjoint lower to lower");
 
-  
-  
   res.template selfadjointView<Upper>() = mat.template selfadjointView<Upper>().twistedBy(p);
   res_d = ((p * up_sym_d) * p.inverse()).eval().template triangularView<Upper>();
   VERIFY(res.isApprox(res_d) && "full selfadjoint upper twisted to upper");
-  
+
   res.template selfadjointView<Upper>() = mat.template selfadjointView<Lower>().twistedBy(p);
   res_d = ((p * lo_sym_d) * p.inverse()).eval().template triangularView<Upper>();
   VERIFY(res.isApprox(res_d) && "full selfadjoint lower twisted to upper");
-  
+
   res.template selfadjointView<Lower>() = mat.template selfadjointView<Lower>().twistedBy(p);
   res_d = ((p * lo_sym_d) * p.inverse()).eval().template triangularView<Lower>();
   VERIFY(res.isApprox(res_d) && "full selfadjoint lower twisted to lower");
-  
+
   res.template selfadjointView<Lower>() = mat.template selfadjointView<Upper>().twistedBy(p);
   res_d = ((p * up_sym_d) * p.inverse()).eval().template triangularView<Lower>();
   VERIFY(res.isApprox(res_d) && "full selfadjoint upper twisted to lower");
-  
-  
+
   res.template selfadjointView<Upper>() = up.template selfadjointView<Upper>().twistedBy(p);
   res_d = ((p * up_sym_d) * p.inverse()).eval().template triangularView<Upper>();
   VERIFY(res.isApprox(res_d) && "upper selfadjoint twisted to upper");
-  
+
   res.template selfadjointView<Upper>() = lo.template selfadjointView<Lower>().twistedBy(p);
   res_d = ((p * lo_sym_d) * p.inverse()).eval().template triangularView<Upper>();
   VERIFY(res.isApprox(res_d) && "lower selfadjoint twisted to upper");
-  
+
   res.template selfadjointView<Lower>() = lo.template selfadjointView<Lower>().twistedBy(p);
   res_d = ((p * lo_sym_d) * p.inverse()).eval().template triangularView<Lower>();
   VERIFY(res.isApprox(res_d) && "lower selfadjoint twisted to lower");
-  
+
   res.template selfadjointView<Lower>() = up.template selfadjointView<Upper>().twistedBy(p);
   res_d = ((p * up_sym_d) * p.inverse()).eval().template triangularView<Lower>();
   VERIFY(res.isApprox(res_d) && "upper selfadjoint twisted to lower");
 
-  
-  VERIFY( is_sorted( res = mat.template selfadjointView<Upper>().twistedBy(p) ));
+  VERIFY(is_sorted(res = mat.template selfadjointView<Upper>().twistedBy(p)));
   res_d = (p * up_sym_d) * p.inverse();
   VERIFY(res.isApprox(res_d) && "full selfadjoint upper twisted to full");
-  
-  VERIFY( is_sorted( res = mat.template selfadjointView<Lower>().twistedBy(p) ));
+
+  VERIFY(is_sorted(res = mat.template selfadjointView<Lower>().twistedBy(p)));
   res_d = (p * lo_sym_d) * p.inverse();
   VERIFY(res.isApprox(res_d) && "full selfadjoint lower twisted to full");
-  
-  VERIFY( is_sorted( res = up.template selfadjointView<Upper>().twistedBy(p) ));
+
+  VERIFY(is_sorted(res = up.template selfadjointView<Upper>().twistedBy(p)));
   res_d = (p * up_sym_d) * p.inverse();
   VERIFY(res.isApprox(res_d) && "upper selfadjoint twisted to full");
-  
-  VERIFY( is_sorted( res = lo.template selfadjointView<Lower>().twistedBy(p) ));
+
+  VERIFY(is_sorted(res = lo.template selfadjointView<Lower>().twistedBy(p)));
   res_d = (p * lo_sym_d) * p.inverse();
   VERIFY(res.isApprox(res_d) && "lower selfadjoint twisted to full");
 }
 
-template<typename Scalar> void sparse_permutations_all(int size)
-{
-  CALL_SUBTEST(( sparse_permutations<ColMajor>(SparseMatrix<Scalar, ColMajor>(size,size)) ));
-  CALL_SUBTEST(( sparse_permutations<ColMajor>(SparseMatrix<Scalar, RowMajor>(size,size)) ));
-  CALL_SUBTEST(( sparse_permutations<RowMajor>(SparseMatrix<Scalar, ColMajor>(size,size)) ));
-  CALL_SUBTEST(( sparse_permutations<RowMajor>(SparseMatrix<Scalar, RowMajor>(size,size)) ));
+template <typename Scalar>
+void sparse_permutations_all(int size) {
+  CALL_SUBTEST((sparse_permutations<ColMajor>(SparseMatrix<Scalar, ColMajor>(size, size))));
+  CALL_SUBTEST((sparse_permutations<ColMajor>(SparseMatrix<Scalar, RowMajor>(size, size))));
+  CALL_SUBTEST((sparse_permutations<RowMajor>(SparseMatrix<Scalar, ColMajor>(size, size))));
+  CALL_SUBTEST((sparse_permutations<RowMajor>(SparseMatrix<Scalar, RowMajor>(size, size))));
 }
 
-EIGEN_DECLARE_TEST(sparse_permutations)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    int s = Eigen::internal::random<int>(1,50);
-    CALL_SUBTEST_1((  sparse_permutations_all<double>(s) ));
-    CALL_SUBTEST_2((  sparse_permutations_all<std::complex<double> >(s) ));
+EIGEN_DECLARE_TEST(sparse_permutations) {
+  for (int i = 0; i < g_repeat; i++) {
+    int s = Eigen::internal::random<int>(1, 50);
+    CALL_SUBTEST_1((sparse_permutations_all<double>(s)));
+    CALL_SUBTEST_2((sparse_permutations_all<std::complex<double> >(s)));
   }
 
-  VERIFY((internal::is_same<internal::permutation_matrix_product<SparseMatrix<double>,OnTheRight,false,SparseShape>::ReturnType,
-                            internal::nested_eval<Product<SparseMatrix<double>,PermutationMatrix<Dynamic,Dynamic>,AliasFreeProduct>,1>::type>::value));
+  VERIFY((internal::is_same<
+          internal::permutation_matrix_product<SparseMatrix<double>, OnTheRight, false, SparseShape>::ReturnType,
+          internal::nested_eval<Product<SparseMatrix<double>, PermutationMatrix<Dynamic, Dynamic>, AliasFreeProduct>,
+                                1>::type>::value));
 
-  VERIFY((internal::is_same<internal::permutation_matrix_product<SparseMatrix<double>,OnTheLeft,false,SparseShape>::ReturnType,
-                            internal::nested_eval<Product<PermutationMatrix<Dynamic,Dynamic>,SparseMatrix<double>,AliasFreeProduct>,1>::type>::value));
+  VERIFY((internal::is_same<
+          internal::permutation_matrix_product<SparseMatrix<double>, OnTheLeft, false, SparseShape>::ReturnType,
+          internal::nested_eval<Product<PermutationMatrix<Dynamic, Dynamic>, SparseMatrix<double>, AliasFreeProduct>,
+                                1>::type>::value));
 }
diff --git a/test/sparse_product.cpp b/test/sparse_product.cpp
index dbf549a..1083f3f 100644
--- a/test/sparse_product.cpp
+++ b/test/sparse_product.cpp
@@ -7,10 +7,10 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-#if defined(_MSC_VER) && (_MSC_VER==1800)
+#if defined(_MSC_VER) && (_MSC_VER == 1800)
 // This unit test takes forever to compile in Release mode with MSVC 2013,
 // multiple hours. So let's switch off optimization for this one.
-#pragma optimize("",off)
+#pragma optimize("", off)
 #endif
 
 static long int nb_temporaries;
@@ -20,214 +20,229 @@
   nb_temporaries++;
 }
 
-#define EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN { on_temporary_creation(); }
+#define EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN \
+  { on_temporary_creation(); }
 
 #include "sparse.h"
 
-#define VERIFY_EVALUATION_COUNT(XPR,N) {\
-    nb_temporaries = 0; \
-    CALL_SUBTEST( XPR ); \
-    if(nb_temporaries!=N) std::cerr << "nb_temporaries == " << nb_temporaries << "\n"; \
-    VERIFY( (#XPR) && nb_temporaries==N ); \
+#define VERIFY_EVALUATION_COUNT(XPR, N)                                                   \
+  {                                                                                       \
+    nb_temporaries = 0;                                                                   \
+    CALL_SUBTEST(XPR);                                                                    \
+    if (nb_temporaries != N) std::cerr << "nb_temporaries == " << nb_temporaries << "\n"; \
+    VERIFY((#XPR) && nb_temporaries == N);                                                \
   }
 
-
-
-template<typename SparseMatrixType> void sparse_product()
-{
+template <typename SparseMatrixType>
+void sparse_product() {
   typedef typename SparseMatrixType::StorageIndex StorageIndex;
   Index n = 100;
-  const Index rows  = internal::random<Index>(1,n);
-  const Index cols  = internal::random<Index>(1,n);
-  const Index depth = internal::random<Index>(1,n);
+  const Index rows = internal::random<Index>(1, n);
+  const Index cols = internal::random<Index>(1, n);
+  const Index depth = internal::random<Index>(1, n);
   typedef typename SparseMatrixType::Scalar Scalar;
   enum { Flags = SparseMatrixType::Flags };
 
-  double density = (std::max)(8./(rows*cols), 0.2);
-  typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrix;
-  typedef Matrix<Scalar,Dynamic,1> DenseVector;
-  typedef Matrix<Scalar,1,Dynamic> RowDenseVector;
-  typedef SparseVector<Scalar,0,StorageIndex> ColSpVector;
-  typedef SparseVector<Scalar,RowMajor,StorageIndex> RowSpVector;
+  double density = (std::max)(8. / (rows * cols), 0.2);
+  typedef Matrix<Scalar, Dynamic, Dynamic> DenseMatrix;
+  typedef Matrix<Scalar, Dynamic, 1> DenseVector;
+  typedef Matrix<Scalar, 1, Dynamic> RowDenseVector;
+  typedef SparseVector<Scalar, 0, StorageIndex> ColSpVector;
+  typedef SparseVector<Scalar, RowMajor, StorageIndex> RowSpVector;
 
   Scalar s1 = internal::random<Scalar>();
   Scalar s2 = internal::random<Scalar>();
 
   // test matrix-matrix product
   {
-    DenseMatrix refMat2  = DenseMatrix::Zero(rows, depth);
+    DenseMatrix refMat2 = DenseMatrix::Zero(rows, depth);
     DenseMatrix refMat2t = DenseMatrix::Zero(depth, rows);
-    DenseMatrix refMat3  = DenseMatrix::Zero(depth, cols);
+    DenseMatrix refMat3 = DenseMatrix::Zero(depth, cols);
     DenseMatrix refMat3t = DenseMatrix::Zero(cols, depth);
-    DenseMatrix refMat4  = DenseMatrix::Zero(rows, cols);
+    DenseMatrix refMat4 = DenseMatrix::Zero(rows, cols);
     DenseMatrix refMat4t = DenseMatrix::Zero(cols, rows);
-    DenseMatrix refMat5  = DenseMatrix::Random(depth, cols);
-    DenseMatrix refMat6  = DenseMatrix::Random(rows, rows);
+    DenseMatrix refMat5 = DenseMatrix::Random(depth, cols);
+    DenseMatrix refMat6 = DenseMatrix::Random(rows, rows);
     DenseMatrix dm4 = DenseMatrix::Zero(rows, rows);
-//     DenseVector dv1 = DenseVector::Random(rows);
-    SparseMatrixType m2 (rows, depth);
+    //     DenseVector dv1 = DenseVector::Random(rows);
+    SparseMatrixType m2(rows, depth);
     SparseMatrixType m2t(depth, rows);
-    SparseMatrixType m3 (depth, cols);
+    SparseMatrixType m3(depth, cols);
     SparseMatrixType m3t(cols, depth);
-    SparseMatrixType m4 (rows, cols);
+    SparseMatrixType m4(rows, cols);
     SparseMatrixType m4t(cols, rows);
     SparseMatrixType m6(rows, rows);
-    initSparse(density, refMat2,  m2);
+    initSparse(density, refMat2, m2);
     initSparse(density, refMat2t, m2t);
-    initSparse(density, refMat3,  m3);
+    initSparse(density, refMat3, m3);
     initSparse(density, refMat3t, m3t);
-    initSparse(density, refMat4,  m4);
+    initSparse(density, refMat4, m4);
     initSparse(density, refMat4t, m4t);
     initSparse(density, refMat6, m6);
 
-//     int c = internal::random<int>(0,depth-1);
+    //     int c = internal::random<int>(0,depth-1);
 
     // sparse * sparse
-    VERIFY_IS_APPROX(m4=m2*m3, refMat4=refMat2*refMat3);
-    VERIFY_IS_APPROX(m4=m2t.transpose()*m3, refMat4=refMat2t.transpose()*refMat3);
-    VERIFY_IS_APPROX(m4=m2t.transpose()*m3t.transpose(), refMat4=refMat2t.transpose()*refMat3t.transpose());
-    VERIFY_IS_APPROX(m4=m2*m3t.transpose(), refMat4=refMat2*refMat3t.transpose());
+    VERIFY_IS_APPROX(m4 = m2 * m3, refMat4 = refMat2 * refMat3);
+    VERIFY_IS_APPROX(m4 = m2t.transpose() * m3, refMat4 = refMat2t.transpose() * refMat3);
+    VERIFY_IS_APPROX(m4 = m2t.transpose() * m3t.transpose(), refMat4 = refMat2t.transpose() * refMat3t.transpose());
+    VERIFY_IS_APPROX(m4 = m2 * m3t.transpose(), refMat4 = refMat2 * refMat3t.transpose());
 
-    VERIFY_IS_APPROX(m4 = m2*m3/s1, refMat4 = refMat2*refMat3/s1);
-    VERIFY_IS_APPROX(m4 = m2*m3*s1, refMat4 = refMat2*refMat3*s1);
-    VERIFY_IS_APPROX(m4 = s2*m2*m3*s1, refMat4 = s2*refMat2*refMat3*s1);
-    VERIFY_IS_APPROX(m4 = (m2+m2)*m3, refMat4 = (refMat2+refMat2)*refMat3);
-    VERIFY_IS_APPROX(m4 = m2*m3.leftCols(cols/2), refMat4 = refMat2*refMat3.leftCols(cols/2));
-    VERIFY_IS_APPROX(m4 = m2*(m3+m3).leftCols(cols/2), refMat4 = refMat2*(refMat3+refMat3).leftCols(cols/2));
+    VERIFY_IS_APPROX(m4 = m2 * m3 / s1, refMat4 = refMat2 * refMat3 / s1);
+    VERIFY_IS_APPROX(m4 = m2 * m3 * s1, refMat4 = refMat2 * refMat3 * s1);
+    VERIFY_IS_APPROX(m4 = s2 * m2 * m3 * s1, refMat4 = s2 * refMat2 * refMat3 * s1);
+    VERIFY_IS_APPROX(m4 = (m2 + m2) * m3, refMat4 = (refMat2 + refMat2) * refMat3);
+    VERIFY_IS_APPROX(m4 = m2 * m3.leftCols(cols / 2), refMat4 = refMat2 * refMat3.leftCols(cols / 2));
+    VERIFY_IS_APPROX(m4 = m2 * (m3 + m3).leftCols(cols / 2),
+                     refMat4 = refMat2 * (refMat3 + refMat3).leftCols(cols / 2));
 
-    VERIFY_IS_APPROX(m4=(m2*m3).pruned(0), refMat4=refMat2*refMat3);
-    VERIFY_IS_APPROX(m4=(m2t.transpose()*m3).pruned(0), refMat4=refMat2t.transpose()*refMat3);
-    VERIFY_IS_APPROX(m4=(m2t.transpose()*m3t.transpose()).pruned(0), refMat4=refMat2t.transpose()*refMat3t.transpose());
-    VERIFY_IS_APPROX(m4=(m2*m3t.transpose()).pruned(0), refMat4=refMat2*refMat3t.transpose());
+    VERIFY_IS_APPROX(m4 = (m2 * m3).pruned(0), refMat4 = refMat2 * refMat3);
+    VERIFY_IS_APPROX(m4 = (m2t.transpose() * m3).pruned(0), refMat4 = refMat2t.transpose() * refMat3);
+    VERIFY_IS_APPROX(m4 = (m2t.transpose() * m3t.transpose()).pruned(0),
+                     refMat4 = refMat2t.transpose() * refMat3t.transpose());
+    VERIFY_IS_APPROX(m4 = (m2 * m3t.transpose()).pruned(0), refMat4 = refMat2 * refMat3t.transpose());
 
 #ifndef EIGEN_SPARSE_PRODUCT_IGNORE_TEMPORARY_COUNT
     // make sure the right product implementation is called:
-    if((!SparseMatrixType::IsRowMajor) && m2.rows()<=m3.cols())
-    {
-      VERIFY_EVALUATION_COUNT(m4 = m2*m3, 2); // 2 for transposing and get a sorted result.
-      VERIFY_EVALUATION_COUNT(m4 = (m2*m3).pruned(0), 1);
-      VERIFY_EVALUATION_COUNT(m4 = (m2*m3).eval().pruned(0), 4);
+    if ((!SparseMatrixType::IsRowMajor) && m2.rows() <= m3.cols()) {
+      VERIFY_EVALUATION_COUNT(m4 = m2 * m3, 2);  // 2 for transposing and get a sorted result.
+      VERIFY_EVALUATION_COUNT(m4 = (m2 * m3).pruned(0), 1);
+      VERIFY_EVALUATION_COUNT(m4 = (m2 * m3).eval().pruned(0), 4);
     }
 #endif
 
     // and that pruning is effective:
     {
-      DenseMatrix Ad(2,2);
+      DenseMatrix Ad(2, 2);
       Ad << -1, 1, 1, 1;
-      SparseMatrixType As(Ad.sparseView()), B(2,2);
-      VERIFY_IS_EQUAL( (As*As.transpose()).eval().nonZeros(), 4);
-      VERIFY_IS_EQUAL( (Ad*Ad.transpose()).eval().sparseView().eval().nonZeros(), 2);
-      VERIFY_IS_EQUAL( (As*As.transpose()).pruned(1e-6).eval().nonZeros(), 2);
+      SparseMatrixType As(Ad.sparseView()), B(2, 2);
+      VERIFY_IS_EQUAL((As * As.transpose()).eval().nonZeros(), 4);
+      VERIFY_IS_EQUAL((Ad * Ad.transpose()).eval().sparseView().eval().nonZeros(), 2);
+      VERIFY_IS_EQUAL((As * As.transpose()).pruned(1e-6).eval().nonZeros(), 2);
     }
 
     // dense ?= sparse * sparse
-    VERIFY_IS_APPROX(dm4 =m2*m3, refMat4 =refMat2*refMat3);
-    VERIFY_IS_APPROX(dm4+=m2*m3, refMat4+=refMat2*refMat3);
-    VERIFY_IS_APPROX(dm4-=m2*m3, refMat4-=refMat2*refMat3);
-    VERIFY_IS_APPROX(dm4 =m2t.transpose()*m3, refMat4 =refMat2t.transpose()*refMat3);
-    VERIFY_IS_APPROX(dm4+=m2t.transpose()*m3, refMat4+=refMat2t.transpose()*refMat3);
-    VERIFY_IS_APPROX(dm4-=m2t.transpose()*m3, refMat4-=refMat2t.transpose()*refMat3);
-    VERIFY_IS_APPROX(dm4 =m2t.transpose()*m3t.transpose(), refMat4 =refMat2t.transpose()*refMat3t.transpose());
-    VERIFY_IS_APPROX(dm4+=m2t.transpose()*m3t.transpose(), refMat4+=refMat2t.transpose()*refMat3t.transpose());
-    VERIFY_IS_APPROX(dm4-=m2t.transpose()*m3t.transpose(), refMat4-=refMat2t.transpose()*refMat3t.transpose());
-    VERIFY_IS_APPROX(dm4 =m2*m3t.transpose(), refMat4 =refMat2*refMat3t.transpose());
-    VERIFY_IS_APPROX(dm4+=m2*m3t.transpose(), refMat4+=refMat2*refMat3t.transpose());
-    VERIFY_IS_APPROX(dm4-=m2*m3t.transpose(), refMat4-=refMat2*refMat3t.transpose());
-    VERIFY_IS_APPROX(dm4 = m2*m3*s1, refMat4 = refMat2*refMat3*s1);
+    VERIFY_IS_APPROX(dm4 = m2 * m3, refMat4 = refMat2 * refMat3);
+    VERIFY_IS_APPROX(dm4 += m2 * m3, refMat4 += refMat2 * refMat3);
+    VERIFY_IS_APPROX(dm4 -= m2 * m3, refMat4 -= refMat2 * refMat3);
+    VERIFY_IS_APPROX(dm4 = m2t.transpose() * m3, refMat4 = refMat2t.transpose() * refMat3);
+    VERIFY_IS_APPROX(dm4 += m2t.transpose() * m3, refMat4 += refMat2t.transpose() * refMat3);
+    VERIFY_IS_APPROX(dm4 -= m2t.transpose() * m3, refMat4 -= refMat2t.transpose() * refMat3);
+    VERIFY_IS_APPROX(dm4 = m2t.transpose() * m3t.transpose(), refMat4 = refMat2t.transpose() * refMat3t.transpose());
+    VERIFY_IS_APPROX(dm4 += m2t.transpose() * m3t.transpose(), refMat4 += refMat2t.transpose() * refMat3t.transpose());
+    VERIFY_IS_APPROX(dm4 -= m2t.transpose() * m3t.transpose(), refMat4 -= refMat2t.transpose() * refMat3t.transpose());
+    VERIFY_IS_APPROX(dm4 = m2 * m3t.transpose(), refMat4 = refMat2 * refMat3t.transpose());
+    VERIFY_IS_APPROX(dm4 += m2 * m3t.transpose(), refMat4 += refMat2 * refMat3t.transpose());
+    VERIFY_IS_APPROX(dm4 -= m2 * m3t.transpose(), refMat4 -= refMat2 * refMat3t.transpose());
+    VERIFY_IS_APPROX(dm4 = m2 * m3 * s1, refMat4 = refMat2 * refMat3 * s1);
 
     // test aliasing
-    m4 = m2; refMat4 = refMat2;
-    VERIFY_IS_APPROX(m4=m4*m3, refMat4=refMat4*refMat3);
+    m4 = m2;
+    refMat4 = refMat2;
+    VERIFY_IS_APPROX(m4 = m4 * m3, refMat4 = refMat4 * refMat3);
 
     // sparse * dense matrix
-    VERIFY_IS_APPROX(dm4=m2*refMat3, refMat4=refMat2*refMat3);
-    VERIFY_IS_APPROX(dm4=m2*refMat3t.transpose(), refMat4=refMat2*refMat3t.transpose());
-    VERIFY_IS_APPROX(dm4=m2t.transpose()*refMat3, refMat4=refMat2t.transpose()*refMat3);
-    VERIFY_IS_APPROX(dm4=m2t.transpose()*refMat3t.transpose(), refMat4=refMat2t.transpose()*refMat3t.transpose());
+    VERIFY_IS_APPROX(dm4 = m2 * refMat3, refMat4 = refMat2 * refMat3);
+    VERIFY_IS_APPROX(dm4 = m2 * refMat3t.transpose(), refMat4 = refMat2 * refMat3t.transpose());
+    VERIFY_IS_APPROX(dm4 = m2t.transpose() * refMat3, refMat4 = refMat2t.transpose() * refMat3);
+    VERIFY_IS_APPROX(dm4 = m2t.transpose() * refMat3t.transpose(),
+                     refMat4 = refMat2t.transpose() * refMat3t.transpose());
 
-    VERIFY_IS_APPROX(dm4=m2*refMat3, refMat4=refMat2*refMat3);
-    VERIFY_IS_APPROX(dm4=dm4+m2*refMat3, refMat4=refMat4+refMat2*refMat3);
-    VERIFY_IS_APPROX(dm4+=m2*refMat3, refMat4+=refMat2*refMat3);
-    VERIFY_IS_APPROX(dm4-=m2*refMat3, refMat4-=refMat2*refMat3);
-    VERIFY_IS_APPROX(dm4.noalias()+=m2*refMat3, refMat4+=refMat2*refMat3);
-    VERIFY_IS_APPROX(dm4.noalias()-=m2*refMat3, refMat4-=refMat2*refMat3);
-    VERIFY_IS_APPROX(dm4=m2*(refMat3+refMat3), refMat4=refMat2*(refMat3+refMat3));
-    VERIFY_IS_APPROX(dm4=m2t.transpose()*(refMat3+refMat5)*0.5, refMat4=refMat2t.transpose()*(refMat3+refMat5)*0.5);
+    VERIFY_IS_APPROX(dm4 = m2 * refMat3, refMat4 = refMat2 * refMat3);
+    VERIFY_IS_APPROX(dm4 = dm4 + m2 * refMat3, refMat4 = refMat4 + refMat2 * refMat3);
+    VERIFY_IS_APPROX(dm4 += m2 * refMat3, refMat4 += refMat2 * refMat3);
+    VERIFY_IS_APPROX(dm4 -= m2 * refMat3, refMat4 -= refMat2 * refMat3);
+    VERIFY_IS_APPROX(dm4.noalias() += m2 * refMat3, refMat4 += refMat2 * refMat3);
+    VERIFY_IS_APPROX(dm4.noalias() -= m2 * refMat3, refMat4 -= refMat2 * refMat3);
+    VERIFY_IS_APPROX(dm4 = m2 * (refMat3 + refMat3), refMat4 = refMat2 * (refMat3 + refMat3));
+    VERIFY_IS_APPROX(dm4 = m2t.transpose() * (refMat3 + refMat5) * 0.5,
+                     refMat4 = refMat2t.transpose() * (refMat3 + refMat5) * 0.5);
 
     // sparse * dense vector
-    VERIFY_IS_APPROX(dm4.col(0)=m2*refMat3.col(0), refMat4.col(0)=refMat2*refMat3.col(0));
-    VERIFY_IS_APPROX(dm4.col(0)=m2*refMat3t.transpose().col(0), refMat4.col(0)=refMat2*refMat3t.transpose().col(0));
-    VERIFY_IS_APPROX(dm4.col(0)=m2t.transpose()*refMat3.col(0), refMat4.col(0)=refMat2t.transpose()*refMat3.col(0));
-    VERIFY_IS_APPROX(dm4.col(0)=m2t.transpose()*refMat3t.transpose().col(0), refMat4.col(0)=refMat2t.transpose()*refMat3t.transpose().col(0));
+    VERIFY_IS_APPROX(dm4.col(0) = m2 * refMat3.col(0), refMat4.col(0) = refMat2 * refMat3.col(0));
+    VERIFY_IS_APPROX(dm4.col(0) = m2 * refMat3t.transpose().col(0),
+                     refMat4.col(0) = refMat2 * refMat3t.transpose().col(0));
+    VERIFY_IS_APPROX(dm4.col(0) = m2t.transpose() * refMat3.col(0),
+                     refMat4.col(0) = refMat2t.transpose() * refMat3.col(0));
+    VERIFY_IS_APPROX(dm4.col(0) = m2t.transpose() * refMat3t.transpose().col(0),
+                     refMat4.col(0) = refMat2t.transpose() * refMat3t.transpose().col(0));
 
     // dense * sparse
-    VERIFY_IS_APPROX(dm4=refMat2*m3, refMat4=refMat2*refMat3);
-    VERIFY_IS_APPROX(dm4=dm4+refMat2*m3, refMat4=refMat4+refMat2*refMat3);
-    VERIFY_IS_APPROX(dm4+=refMat2*m3, refMat4+=refMat2*refMat3);
-    VERIFY_IS_APPROX(dm4-=refMat2*m3, refMat4-=refMat2*refMat3);
-    VERIFY_IS_APPROX(dm4.noalias()+=refMat2*m3, refMat4+=refMat2*refMat3);
-    VERIFY_IS_APPROX(dm4.noalias()-=refMat2*m3, refMat4-=refMat2*refMat3);
-    VERIFY_IS_APPROX(dm4=refMat2*m3t.transpose(), refMat4=refMat2*refMat3t.transpose());
-    VERIFY_IS_APPROX(dm4=refMat2t.transpose()*m3, refMat4=refMat2t.transpose()*refMat3);
-    VERIFY_IS_APPROX(dm4=refMat2t.transpose()*m3t.transpose(), refMat4=refMat2t.transpose()*refMat3t.transpose());
+    VERIFY_IS_APPROX(dm4 = refMat2 * m3, refMat4 = refMat2 * refMat3);
+    VERIFY_IS_APPROX(dm4 = dm4 + refMat2 * m3, refMat4 = refMat4 + refMat2 * refMat3);
+    VERIFY_IS_APPROX(dm4 += refMat2 * m3, refMat4 += refMat2 * refMat3);
+    VERIFY_IS_APPROX(dm4 -= refMat2 * m3, refMat4 -= refMat2 * refMat3);
+    VERIFY_IS_APPROX(dm4.noalias() += refMat2 * m3, refMat4 += refMat2 * refMat3);
+    VERIFY_IS_APPROX(dm4.noalias() -= refMat2 * m3, refMat4 -= refMat2 * refMat3);
+    VERIFY_IS_APPROX(dm4 = refMat2 * m3t.transpose(), refMat4 = refMat2 * refMat3t.transpose());
+    VERIFY_IS_APPROX(dm4 = refMat2t.transpose() * m3, refMat4 = refMat2t.transpose() * refMat3);
+    VERIFY_IS_APPROX(dm4 = refMat2t.transpose() * m3t.transpose(),
+                     refMat4 = refMat2t.transpose() * refMat3t.transpose());
 
     // sparse * dense and dense * sparse outer product
     {
-      Index c  = internal::random<Index>(0,depth-1);
-      Index r  = internal::random<Index>(0,rows-1);
-      Index c1 = internal::random<Index>(0,cols-1);
-      Index r1 = internal::random<Index>(0,depth-1);
-      DenseMatrix dm5  = DenseMatrix::Random(depth, cols);
+      Index c = internal::random<Index>(0, depth - 1);
+      Index r = internal::random<Index>(0, rows - 1);
+      Index c1 = internal::random<Index>(0, cols - 1);
+      Index r1 = internal::random<Index>(0, depth - 1);
+      DenseMatrix dm5 = DenseMatrix::Random(depth, cols);
 
-      VERIFY_IS_APPROX( m4=m2.col(c)*dm5.col(c1).transpose(), refMat4=refMat2.col(c)*dm5.col(c1).transpose());
-      VERIFY_IS_EQUAL(m4.nonZeros(), (refMat4.array()!=0).count());
-      VERIFY_IS_APPROX( m4=m2.middleCols(c,1)*dm5.col(c1).transpose(), refMat4=refMat2.col(c)*dm5.col(c1).transpose());
-      VERIFY_IS_EQUAL(m4.nonZeros(), (refMat4.array()!=0).count());
-      VERIFY_IS_APPROX(dm4=m2.col(c)*dm5.col(c1).transpose(), refMat4=refMat2.col(c)*dm5.col(c1).transpose());
+      VERIFY_IS_APPROX(m4 = m2.col(c) * dm5.col(c1).transpose(), refMat4 = refMat2.col(c) * dm5.col(c1).transpose());
+      VERIFY_IS_EQUAL(m4.nonZeros(), (refMat4.array() != 0).count());
+      VERIFY_IS_APPROX(m4 = m2.middleCols(c, 1) * dm5.col(c1).transpose(),
+                       refMat4 = refMat2.col(c) * dm5.col(c1).transpose());
+      VERIFY_IS_EQUAL(m4.nonZeros(), (refMat4.array() != 0).count());
+      VERIFY_IS_APPROX(dm4 = m2.col(c) * dm5.col(c1).transpose(), refMat4 = refMat2.col(c) * dm5.col(c1).transpose());
 
-      VERIFY_IS_APPROX(m4=dm5.col(c1)*m2.col(c).transpose(), refMat4=dm5.col(c1)*refMat2.col(c).transpose());
-      VERIFY_IS_EQUAL(m4.nonZeros(), (refMat4.array()!=0).count());
-      VERIFY_IS_APPROX(m4=dm5.col(c1)*m2.middleCols(c,1).transpose(), refMat4=dm5.col(c1)*refMat2.col(c).transpose());
-      VERIFY_IS_EQUAL(m4.nonZeros(), (refMat4.array()!=0).count());
-      VERIFY_IS_APPROX(dm4=dm5.col(c1)*m2.col(c).transpose(), refMat4=dm5.col(c1)*refMat2.col(c).transpose());
+      VERIFY_IS_APPROX(m4 = dm5.col(c1) * m2.col(c).transpose(), refMat4 = dm5.col(c1) * refMat2.col(c).transpose());
+      VERIFY_IS_EQUAL(m4.nonZeros(), (refMat4.array() != 0).count());
+      VERIFY_IS_APPROX(m4 = dm5.col(c1) * m2.middleCols(c, 1).transpose(),
+                       refMat4 = dm5.col(c1) * refMat2.col(c).transpose());
+      VERIFY_IS_EQUAL(m4.nonZeros(), (refMat4.array() != 0).count());
+      VERIFY_IS_APPROX(dm4 = dm5.col(c1) * m2.col(c).transpose(), refMat4 = dm5.col(c1) * refMat2.col(c).transpose());
 
-      VERIFY_IS_APPROX( m4=dm5.row(r1).transpose()*m2.col(c).transpose(), refMat4=dm5.row(r1).transpose()*refMat2.col(c).transpose());
-      VERIFY_IS_EQUAL(m4.nonZeros(), (refMat4.array()!=0).count());
-      VERIFY_IS_APPROX(dm4=dm5.row(r1).transpose()*m2.col(c).transpose(), refMat4=dm5.row(r1).transpose()*refMat2.col(c).transpose());
+      VERIFY_IS_APPROX(m4 = dm5.row(r1).transpose() * m2.col(c).transpose(),
+                       refMat4 = dm5.row(r1).transpose() * refMat2.col(c).transpose());
+      VERIFY_IS_EQUAL(m4.nonZeros(), (refMat4.array() != 0).count());
+      VERIFY_IS_APPROX(dm4 = dm5.row(r1).transpose() * m2.col(c).transpose(),
+                       refMat4 = dm5.row(r1).transpose() * refMat2.col(c).transpose());
 
-      VERIFY_IS_APPROX( m4=m2.row(r).transpose()*dm5.col(c1).transpose(), refMat4=refMat2.row(r).transpose()*dm5.col(c1).transpose());
-      VERIFY_IS_EQUAL(m4.nonZeros(), (refMat4.array()!=0).count());
-      VERIFY_IS_APPROX( m4=m2.middleRows(r,1).transpose()*dm5.col(c1).transpose(), refMat4=refMat2.row(r).transpose()*dm5.col(c1).transpose());
-      VERIFY_IS_EQUAL(m4.nonZeros(), (refMat4.array()!=0).count());
-      VERIFY_IS_APPROX(dm4=m2.row(r).transpose()*dm5.col(c1).transpose(), refMat4=refMat2.row(r).transpose()*dm5.col(c1).transpose());
+      VERIFY_IS_APPROX(m4 = m2.row(r).transpose() * dm5.col(c1).transpose(),
+                       refMat4 = refMat2.row(r).transpose() * dm5.col(c1).transpose());
+      VERIFY_IS_EQUAL(m4.nonZeros(), (refMat4.array() != 0).count());
+      VERIFY_IS_APPROX(m4 = m2.middleRows(r, 1).transpose() * dm5.col(c1).transpose(),
+                       refMat4 = refMat2.row(r).transpose() * dm5.col(c1).transpose());
+      VERIFY_IS_EQUAL(m4.nonZeros(), (refMat4.array() != 0).count());
+      VERIFY_IS_APPROX(dm4 = m2.row(r).transpose() * dm5.col(c1).transpose(),
+                       refMat4 = refMat2.row(r).transpose() * dm5.col(c1).transpose());
 
-      VERIFY_IS_APPROX( m4=dm5.col(c1)*m2.row(r), refMat4=dm5.col(c1)*refMat2.row(r));
-      VERIFY_IS_EQUAL(m4.nonZeros(), (refMat4.array()!=0).count());
-      VERIFY_IS_APPROX( m4=dm5.col(c1)*m2.middleRows(r,1), refMat4=dm5.col(c1)*refMat2.row(r));
-      VERIFY_IS_EQUAL(m4.nonZeros(), (refMat4.array()!=0).count());
-      VERIFY_IS_APPROX(dm4=dm5.col(c1)*m2.row(r), refMat4=dm5.col(c1)*refMat2.row(r));
+      VERIFY_IS_APPROX(m4 = dm5.col(c1) * m2.row(r), refMat4 = dm5.col(c1) * refMat2.row(r));
+      VERIFY_IS_EQUAL(m4.nonZeros(), (refMat4.array() != 0).count());
+      VERIFY_IS_APPROX(m4 = dm5.col(c1) * m2.middleRows(r, 1), refMat4 = dm5.col(c1) * refMat2.row(r));
+      VERIFY_IS_EQUAL(m4.nonZeros(), (refMat4.array() != 0).count());
+      VERIFY_IS_APPROX(dm4 = dm5.col(c1) * m2.row(r), refMat4 = dm5.col(c1) * refMat2.row(r));
 
-      VERIFY_IS_APPROX( m4=dm5.row(r1).transpose()*m2.row(r), refMat4=dm5.row(r1).transpose()*refMat2.row(r));
-      VERIFY_IS_EQUAL(m4.nonZeros(), (refMat4.array()!=0).count());
-      VERIFY_IS_APPROX(dm4=dm5.row(r1).transpose()*m2.row(r), refMat4=dm5.row(r1).transpose()*refMat2.row(r));
+      VERIFY_IS_APPROX(m4 = dm5.row(r1).transpose() * m2.row(r), refMat4 = dm5.row(r1).transpose() * refMat2.row(r));
+      VERIFY_IS_EQUAL(m4.nonZeros(), (refMat4.array() != 0).count());
+      VERIFY_IS_APPROX(dm4 = dm5.row(r1).transpose() * m2.row(r), refMat4 = dm5.row(r1).transpose() * refMat2.row(r));
     }
 
-    VERIFY_IS_APPROX(m6=m6*m6, refMat6=refMat6*refMat6);
+    VERIFY_IS_APPROX(m6 = m6 * m6, refMat6 = refMat6 * refMat6);
 
     // sparse matrix * sparse vector
     ColSpVector cv0(cols), cv1;
     DenseVector dcv0(cols), dcv1;
-    initSparse(2*density,dcv0, cv0);
+    initSparse(2 * density, dcv0, cv0);
 
     RowSpVector rv0(depth), rv1;
     RowDenseVector drv0(depth), drv1(rv1);
-    initSparse(2*density,drv0, rv0);
+    initSparse(2 * density, drv0, rv0);
 
-    VERIFY_IS_APPROX(cv1=m3*cv0, dcv1=refMat3*dcv0);
-    VERIFY_IS_APPROX(rv1=rv0*m3, drv1=drv0*refMat3);
-    VERIFY_IS_APPROX(cv1=m3t.adjoint()*cv0, dcv1=refMat3t.adjoint()*dcv0);
-    VERIFY_IS_APPROX(cv1=rv0*m3, dcv1=drv0*refMat3);
-    VERIFY_IS_APPROX(rv1=m3*cv0, drv1=refMat3*dcv0);
+    VERIFY_IS_APPROX(cv1 = m3 * cv0, dcv1 = refMat3 * dcv0);
+    VERIFY_IS_APPROX(rv1 = rv0 * m3, drv1 = drv0 * refMat3);
+    VERIFY_IS_APPROX(cv1 = m3t.adjoint() * cv0, dcv1 = refMat3t.adjoint() * dcv0);
+    VERIFY_IS_APPROX(cv1 = rv0 * m3, dcv1 = drv0 * refMat3);
+    VERIFY_IS_APPROX(rv1 = m3 * cv0, drv1 = refMat3 * dcv0);
   }
 
   // test matrix - diagonal product
@@ -235,36 +250,36 @@
     DenseMatrix refM2 = DenseMatrix::Zero(rows, cols);
     DenseMatrix refM3 = DenseMatrix::Zero(rows, cols);
     DenseMatrix d3 = DenseMatrix::Zero(rows, cols);
-    DiagonalMatrix<Scalar,Dynamic> d1(DenseVector::Random(cols));
-    DiagonalMatrix<Scalar,Dynamic> d2(DenseVector::Random(rows));
+    DiagonalMatrix<Scalar, Dynamic> d1(DenseVector::Random(cols));
+    DiagonalMatrix<Scalar, Dynamic> d2(DenseVector::Random(rows));
     SparseMatrixType m2(rows, cols);
     SparseMatrixType m3(rows, cols);
     initSparse<Scalar>(density, refM2, m2);
     initSparse<Scalar>(density, refM3, m3);
-    VERIFY_IS_APPROX(m3=m2*d1, refM3=refM2*d1);
-    VERIFY_IS_APPROX(m3=m2.transpose()*d2, refM3=refM2.transpose()*d2);
-    VERIFY_IS_APPROX(m3=d2*m2, refM3=d2*refM2);
-    VERIFY_IS_APPROX(m3=d1*m2.transpose(), refM3=d1*refM2.transpose());
+    VERIFY_IS_APPROX(m3 = m2 * d1, refM3 = refM2 * d1);
+    VERIFY_IS_APPROX(m3 = m2.transpose() * d2, refM3 = refM2.transpose() * d2);
+    VERIFY_IS_APPROX(m3 = d2 * m2, refM3 = d2 * refM2);
+    VERIFY_IS_APPROX(m3 = d1 * m2.transpose(), refM3 = d1 * refM2.transpose());
 
     // also check with a SparseWrapper:
     DenseVector v1 = DenseVector::Random(cols);
     DenseVector v2 = DenseVector::Random(rows);
     DenseVector v3 = DenseVector::Random(rows);
-    VERIFY_IS_APPROX(m3=m2*v1.asDiagonal(), refM3=refM2*v1.asDiagonal());
-    VERIFY_IS_APPROX(m3=m2.transpose()*v2.asDiagonal(), refM3=refM2.transpose()*v2.asDiagonal());
-    VERIFY_IS_APPROX(m3=v2.asDiagonal()*m2, refM3=v2.asDiagonal()*refM2);
-    VERIFY_IS_APPROX(m3=v1.asDiagonal()*m2.transpose(), refM3=v1.asDiagonal()*refM2.transpose());
+    VERIFY_IS_APPROX(m3 = m2 * v1.asDiagonal(), refM3 = refM2 * v1.asDiagonal());
+    VERIFY_IS_APPROX(m3 = m2.transpose() * v2.asDiagonal(), refM3 = refM2.transpose() * v2.asDiagonal());
+    VERIFY_IS_APPROX(m3 = v2.asDiagonal() * m2, refM3 = v2.asDiagonal() * refM2);
+    VERIFY_IS_APPROX(m3 = v1.asDiagonal() * m2.transpose(), refM3 = v1.asDiagonal() * refM2.transpose());
 
-    VERIFY_IS_APPROX(m3=v2.asDiagonal()*m2*v1.asDiagonal(), refM3=v2.asDiagonal()*refM2*v1.asDiagonal());
+    VERIFY_IS_APPROX(m3 = v2.asDiagonal() * m2 * v1.asDiagonal(), refM3 = v2.asDiagonal() * refM2 * v1.asDiagonal());
 
-    VERIFY_IS_APPROX(v2=m2*v1.asDiagonal()*v1, refM2*v1.asDiagonal()*v1);
-    VERIFY_IS_APPROX(v3=v2.asDiagonal()*m2*v1, v2.asDiagonal()*refM2*v1);
+    VERIFY_IS_APPROX(v2 = m2 * v1.asDiagonal() * v1, refM2 * v1.asDiagonal() * v1);
+    VERIFY_IS_APPROX(v3 = v2.asDiagonal() * m2 * v1, v2.asDiagonal() * refM2 * v1);
 
     // evaluate to a dense matrix to check the .row() and .col() iterator functions
-    VERIFY_IS_APPROX(d3=m2*d1, refM3=refM2*d1);
-    VERIFY_IS_APPROX(d3=m2.transpose()*d2, refM3=refM2.transpose()*d2);
-    VERIFY_IS_APPROX(d3=d2*m2, refM3=d2*refM2);
-    VERIFY_IS_APPROX(d3=d1*m2.transpose(), refM3=d1*refM2.transpose());
+    VERIFY_IS_APPROX(d3 = m2 * d1, refM3 = refM2 * d1);
+    VERIFY_IS_APPROX(d3 = m2.transpose() * d2, refM3 = refM2.transpose() * d2);
+    VERIFY_IS_APPROX(d3 = d2 * m2, refM3 = d2 * refM2);
+    VERIFY_IS_APPROX(d3 = d1 * m2.transpose(), refM3 = d1 * refM2.transpose());
   }
 
   // test self-adjoint and triangular-view products
@@ -282,7 +297,7 @@
     SparseMatrixType mA(rows, rows);
     initSparse<Scalar>(density, refA, mA);
     do {
-      initSparse<Scalar>(density, refUp, mUp, ForceRealDiag|/*ForceNonZeroDiag|*/MakeUpperTriangular);
+      initSparse<Scalar>(density, refUp, mUp, ForceRealDiag | /*ForceNonZeroDiag|*/ MakeUpperTriangular);
     } while (refUp.isZero());
     refLo = refUp.adjoint();
     mLo = mUp.adjoint();
@@ -290,182 +305,189 @@
     refS.diagonal() *= 0.5;
     mS = mUp + mLo;
     // TODO be able to address the diagonal....
-    for (int k=0; k<mS.outerSize(); ++k)
-      for (typename SparseMatrixType::InnerIterator it(mS,k); it; ++it)
-        if (it.index() == k)
-          it.valueRef() *= Scalar(0.5);
+    for (int k = 0; k < mS.outerSize(); ++k)
+      for (typename SparseMatrixType::InnerIterator it(mS, k); it; ++it)
+        if (it.index() == k) it.valueRef() *= Scalar(0.5);
 
     VERIFY_IS_APPROX(refS.adjoint(), refS);
     VERIFY_IS_APPROX(mS.adjoint(), mS);
     VERIFY_IS_APPROX(mS, refS);
-    VERIFY_IS_APPROX(x=mS*b, refX=refS*b);
+    VERIFY_IS_APPROX(x = mS * b, refX = refS * b);
 
     // sparse selfadjointView with dense matrices
-    VERIFY_IS_APPROX(x=mUp.template selfadjointView<Upper>()*b, refX=refS*b);
-    VERIFY_IS_APPROX(x=mLo.template selfadjointView<Lower>()*b, refX=refS*b);
-    VERIFY_IS_APPROX(x=mS.template selfadjointView<Upper|Lower>()*b, refX=refS*b);
+    VERIFY_IS_APPROX(x = mUp.template selfadjointView<Upper>() * b, refX = refS * b);
+    VERIFY_IS_APPROX(x = mLo.template selfadjointView<Lower>() * b, refX = refS * b);
+    VERIFY_IS_APPROX(x = mS.template selfadjointView<Upper | Lower>() * b, refX = refS * b);
 
-    VERIFY_IS_APPROX(x=b * mUp.template selfadjointView<Upper>(),       refX=b*refS);
-    VERIFY_IS_APPROX(x=b * mLo.template selfadjointView<Lower>(),       refX=b*refS);
-    VERIFY_IS_APPROX(x=b * mS.template selfadjointView<Upper|Lower>(),  refX=b*refS);
+    VERIFY_IS_APPROX(x = b * mUp.template selfadjointView<Upper>(), refX = b * refS);
+    VERIFY_IS_APPROX(x = b * mLo.template selfadjointView<Lower>(), refX = b * refS);
+    VERIFY_IS_APPROX(x = b * mS.template selfadjointView<Upper | Lower>(), refX = b * refS);
 
-    VERIFY_IS_APPROX(x.noalias()+=mUp.template selfadjointView<Upper>()*b, refX+=refS*b);
-    VERIFY_IS_APPROX(x.noalias()-=mLo.template selfadjointView<Lower>()*b, refX-=refS*b);
-    VERIFY_IS_APPROX(x.noalias()+=mS.template selfadjointView<Upper|Lower>()*b, refX+=refS*b);
+    VERIFY_IS_APPROX(x.noalias() += mUp.template selfadjointView<Upper>() * b, refX += refS * b);
+    VERIFY_IS_APPROX(x.noalias() -= mLo.template selfadjointView<Lower>() * b, refX -= refS * b);
+    VERIFY_IS_APPROX(x.noalias() += mS.template selfadjointView<Upper | Lower>() * b, refX += refS * b);
 
     // sparse selfadjointView with sparse matrices
-    SparseMatrixType mSres(rows,rows);
-    VERIFY_IS_APPROX(mSres = mLo.template selfadjointView<Lower>()*mS,
-                     refX = refLo.template selfadjointView<Lower>()*refS);
+    SparseMatrixType mSres(rows, rows);
+    VERIFY_IS_APPROX(mSres = mLo.template selfadjointView<Lower>() * mS,
+                     refX = refLo.template selfadjointView<Lower>() * refS);
     VERIFY_IS_APPROX(mSres = mS * mLo.template selfadjointView<Lower>(),
                      refX = refS * refLo.template selfadjointView<Lower>());
 
     // sparse triangularView with dense matrices
-    VERIFY_IS_APPROX(x=mA.template triangularView<Upper>()*b, refX=refA.template triangularView<Upper>()*b);
-    VERIFY_IS_APPROX(x=mA.template triangularView<Lower>()*b, refX=refA.template triangularView<Lower>()*b);
-    VERIFY_IS_APPROX(x=b*mA.template triangularView<Upper>(), refX=b*refA.template triangularView<Upper>());
-    VERIFY_IS_APPROX(x=b*mA.template triangularView<Lower>(), refX=b*refA.template triangularView<Lower>());
+    VERIFY_IS_APPROX(x = mA.template triangularView<Upper>() * b, refX = refA.template triangularView<Upper>() * b);
+    VERIFY_IS_APPROX(x = mA.template triangularView<Lower>() * b, refX = refA.template triangularView<Lower>() * b);
+    VERIFY_IS_APPROX(x = b * mA.template triangularView<Upper>(), refX = b * refA.template triangularView<Upper>());
+    VERIFY_IS_APPROX(x = b * mA.template triangularView<Lower>(), refX = b * refA.template triangularView<Lower>());
 
     // sparse triangularView with sparse matrices
-    VERIFY_IS_APPROX(mSres = mA.template triangularView<Lower>()*mS,   refX = refA.template triangularView<Lower>()*refS);
-    VERIFY_IS_APPROX(mSres = mS * mA.template triangularView<Lower>(), refX = refS * refA.template triangularView<Lower>());
-    VERIFY_IS_APPROX(mSres = mA.template triangularView<Upper>()*mS,   refX = refA.template triangularView<Upper>()*refS);
-    VERIFY_IS_APPROX(mSres = mS * mA.template triangularView<Upper>(), refX = refS * refA.template triangularView<Upper>());
+    VERIFY_IS_APPROX(mSres = mA.template triangularView<Lower>() * mS,
+                     refX = refA.template triangularView<Lower>() * refS);
+    VERIFY_IS_APPROX(mSres = mS * mA.template triangularView<Lower>(),
+                     refX = refS * refA.template triangularView<Lower>());
+    VERIFY_IS_APPROX(mSres = mA.template triangularView<Upper>() * mS,
+                     refX = refA.template triangularView<Upper>() * refS);
+    VERIFY_IS_APPROX(mSres = mS * mA.template triangularView<Upper>(),
+                     refX = refS * refA.template triangularView<Upper>());
   }
 }
 
 // New test for Bug in SparseTimeDenseProduct
-template<typename SparseMatrixType, typename DenseMatrixType> void sparse_product_regression_test()
-{
+template <typename SparseMatrixType, typename DenseMatrixType>
+void sparse_product_regression_test() {
   // This code does not compile with afflicted versions of the bug
-  SparseMatrixType sm1(3,2);
-  DenseMatrixType m2(2,2);
+  SparseMatrixType sm1(3, 2);
+  DenseMatrixType m2(2, 2);
   sm1.setZero();
   m2.setZero();
 
-  DenseMatrixType m3 = sm1*m2;
-
+  DenseMatrixType m3 = sm1 * m2;
 
   // This code produces a segfault with afflicted versions of another SparseTimeDenseProduct
   // bug
 
-  SparseMatrixType sm2(20000,2);
+  SparseMatrixType sm2(20000, 2);
   sm2.setZero();
-  DenseMatrixType m4(sm2*m2);
+  DenseMatrixType m4(sm2 * m2);
 
-  VERIFY_IS_APPROX( m4(0,0), 0.0 );
+  VERIFY_IS_APPROX(m4(0, 0), 0.0);
 }
 
-template<typename Scalar>
-void bug_942()
-{
-  typedef Matrix<Scalar, Dynamic, 1>     Vector;
+template <typename Scalar>
+void bug_942() {
+  typedef Matrix<Scalar, Dynamic, 1> Vector;
   typedef SparseMatrix<Scalar, ColMajor> ColSpMat;
   typedef SparseMatrix<Scalar, RowMajor> RowSpMat;
-  ColSpMat cmA(1,1);
-  cmA.insert(0,0) = 1;
+  ColSpMat cmA(1, 1);
+  cmA.insert(0, 0) = 1;
 
-  RowSpMat rmA(1,1);
-  rmA.insert(0,0) = 1;
+  RowSpMat rmA(1, 1);
+  rmA.insert(0, 0) = 1;
 
   Vector d(1);
   d[0] = 2;
 
   double res = 2;
 
-  VERIFY_IS_APPROX( ( cmA*d.asDiagonal() ).eval().coeff(0,0), res );
-  VERIFY_IS_APPROX( ( d.asDiagonal()*rmA ).eval().coeff(0,0), res );
-  VERIFY_IS_APPROX( ( rmA*d.asDiagonal() ).eval().coeff(0,0), res );
-  VERIFY_IS_APPROX( ( d.asDiagonal()*cmA ).eval().coeff(0,0), res );
+  VERIFY_IS_APPROX((cmA * d.asDiagonal()).eval().coeff(0, 0), res);
+  VERIFY_IS_APPROX((d.asDiagonal() * rmA).eval().coeff(0, 0), res);
+  VERIFY_IS_APPROX((rmA * d.asDiagonal()).eval().coeff(0, 0), res);
+  VERIFY_IS_APPROX((d.asDiagonal() * cmA).eval().coeff(0, 0), res);
 }
 
-template<typename Real>
-void test_mixing_types()
-{
+template <typename Real>
+void test_mixing_types() {
   typedef std::complex<Real> Cplx;
   typedef SparseMatrix<Real> SpMatReal;
   typedef SparseMatrix<Cplx> SpMatCplx;
-  typedef SparseMatrix<Cplx,RowMajor> SpRowMatCplx;
-  typedef Matrix<Real,Dynamic,Dynamic> DenseMatReal;
-  typedef Matrix<Cplx,Dynamic,Dynamic> DenseMatCplx;
+  typedef SparseMatrix<Cplx, RowMajor> SpRowMatCplx;
+  typedef Matrix<Real, Dynamic, Dynamic> DenseMatReal;
+  typedef Matrix<Cplx, Dynamic, Dynamic> DenseMatCplx;
 
-  Index n = internal::random<Index>(1,100);
-  double density = (std::max)(8./static_cast<double>(n*n), 0.2);
+  Index n = internal::random<Index>(1, 100);
+  double density = (std::max)(8. / static_cast<double>(n * n), 0.2);
 
-  SpMatReal sR1(n,n);
-  SpMatCplx sC1(n,n), sC2(n,n), sC3(n,n);
-  SpRowMatCplx sCR(n,n);
-  DenseMatReal dR1(n,n);
-  DenseMatCplx dC1(n,n), dC2(n,n), dC3(n,n);
+  SpMatReal sR1(n, n);
+  SpMatCplx sC1(n, n), sC2(n, n), sC3(n, n);
+  SpRowMatCplx sCR(n, n);
+  DenseMatReal dR1(n, n);
+  DenseMatCplx dC1(n, n), dC2(n, n), dC3(n, n);
 
   initSparse<Real>(density, dR1, sR1);
   initSparse<Cplx>(density, dC1, sC1);
   initSparse<Cplx>(density, dC2, sC2);
 
-  VERIFY_IS_APPROX( sC2 = (sR1 * sC1),                         dC3 = dR1.template cast<Cplx>() * dC1 );
-  VERIFY_IS_APPROX( sC2 = (sC1 * sR1),                         dC3 = dC1 * dR1.template cast<Cplx>() );
-  VERIFY_IS_APPROX( sC2 = (sR1.transpose() * sC1),             dC3 = dR1.template cast<Cplx>().transpose() * dC1 );
-  VERIFY_IS_APPROX( sC2 = (sC1.transpose() * sR1),             dC3 = dC1.transpose() * dR1.template cast<Cplx>() );
-  VERIFY_IS_APPROX( sC2 = (sR1 * sC1.transpose()),             dC3 = dR1.template cast<Cplx>() * dC1.transpose() );
-  VERIFY_IS_APPROX( sC2 = (sC1 * sR1.transpose()),             dC3 = dC1 * dR1.template cast<Cplx>().transpose() );
-  VERIFY_IS_APPROX( sC2 = (sR1.transpose() * sC1.transpose()), dC3 = dR1.template cast<Cplx>().transpose() * dC1.transpose() );
-  VERIFY_IS_APPROX( sC2 = (sC1.transpose() * sR1.transpose()), dC3 = dC1.transpose() * dR1.template cast<Cplx>().transpose() );
+  VERIFY_IS_APPROX(sC2 = (sR1 * sC1), dC3 = dR1.template cast<Cplx>() * dC1);
+  VERIFY_IS_APPROX(sC2 = (sC1 * sR1), dC3 = dC1 * dR1.template cast<Cplx>());
+  VERIFY_IS_APPROX(sC2 = (sR1.transpose() * sC1), dC3 = dR1.template cast<Cplx>().transpose() * dC1);
+  VERIFY_IS_APPROX(sC2 = (sC1.transpose() * sR1), dC3 = dC1.transpose() * dR1.template cast<Cplx>());
+  VERIFY_IS_APPROX(sC2 = (sR1 * sC1.transpose()), dC3 = dR1.template cast<Cplx>() * dC1.transpose());
+  VERIFY_IS_APPROX(sC2 = (sC1 * sR1.transpose()), dC3 = dC1 * dR1.template cast<Cplx>().transpose());
+  VERIFY_IS_APPROX(sC2 = (sR1.transpose() * sC1.transpose()),
+                   dC3 = dR1.template cast<Cplx>().transpose() * dC1.transpose());
+  VERIFY_IS_APPROX(sC2 = (sC1.transpose() * sR1.transpose()),
+                   dC3 = dC1.transpose() * dR1.template cast<Cplx>().transpose());
 
-  VERIFY_IS_APPROX( sCR = (sR1 * sC1),                         dC3 = dR1.template cast<Cplx>() * dC1 );
-  VERIFY_IS_APPROX( sCR = (sC1 * sR1),                         dC3 = dC1 * dR1.template cast<Cplx>() );
-  VERIFY_IS_APPROX( sCR = (sR1.transpose() * sC1),             dC3 = dR1.template cast<Cplx>().transpose() * dC1 );
-  VERIFY_IS_APPROX( sCR = (sC1.transpose() * sR1),             dC3 = dC1.transpose() * dR1.template cast<Cplx>() );
-  VERIFY_IS_APPROX( sCR = (sR1 * sC1.transpose()),             dC3 = dR1.template cast<Cplx>() * dC1.transpose() );
-  VERIFY_IS_APPROX( sCR = (sC1 * sR1.transpose()),             dC3 = dC1 * dR1.template cast<Cplx>().transpose() );
-  VERIFY_IS_APPROX( sCR = (sR1.transpose() * sC1.transpose()), dC3 = dR1.template cast<Cplx>().transpose() * dC1.transpose() );
-  VERIFY_IS_APPROX( sCR = (sC1.transpose() * sR1.transpose()), dC3 = dC1.transpose() * dR1.template cast<Cplx>().transpose() );
+  VERIFY_IS_APPROX(sCR = (sR1 * sC1), dC3 = dR1.template cast<Cplx>() * dC1);
+  VERIFY_IS_APPROX(sCR = (sC1 * sR1), dC3 = dC1 * dR1.template cast<Cplx>());
+  VERIFY_IS_APPROX(sCR = (sR1.transpose() * sC1), dC3 = dR1.template cast<Cplx>().transpose() * dC1);
+  VERIFY_IS_APPROX(sCR = (sC1.transpose() * sR1), dC3 = dC1.transpose() * dR1.template cast<Cplx>());
+  VERIFY_IS_APPROX(sCR = (sR1 * sC1.transpose()), dC3 = dR1.template cast<Cplx>() * dC1.transpose());
+  VERIFY_IS_APPROX(sCR = (sC1 * sR1.transpose()), dC3 = dC1 * dR1.template cast<Cplx>().transpose());
+  VERIFY_IS_APPROX(sCR = (sR1.transpose() * sC1.transpose()),
+                   dC3 = dR1.template cast<Cplx>().transpose() * dC1.transpose());
+  VERIFY_IS_APPROX(sCR = (sC1.transpose() * sR1.transpose()),
+                   dC3 = dC1.transpose() * dR1.template cast<Cplx>().transpose());
 
+  VERIFY_IS_APPROX(sC2 = (sR1 * sC1).pruned(), dC3 = dR1.template cast<Cplx>() * dC1);
+  VERIFY_IS_APPROX(sC2 = (sC1 * sR1).pruned(), dC3 = dC1 * dR1.template cast<Cplx>());
+  VERIFY_IS_APPROX(sC2 = (sR1.transpose() * sC1).pruned(), dC3 = dR1.template cast<Cplx>().transpose() * dC1);
+  VERIFY_IS_APPROX(sC2 = (sC1.transpose() * sR1).pruned(), dC3 = dC1.transpose() * dR1.template cast<Cplx>());
+  VERIFY_IS_APPROX(sC2 = (sR1 * sC1.transpose()).pruned(), dC3 = dR1.template cast<Cplx>() * dC1.transpose());
+  VERIFY_IS_APPROX(sC2 = (sC1 * sR1.transpose()).pruned(), dC3 = dC1 * dR1.template cast<Cplx>().transpose());
+  VERIFY_IS_APPROX(sC2 = (sR1.transpose() * sC1.transpose()).pruned(),
+                   dC3 = dR1.template cast<Cplx>().transpose() * dC1.transpose());
+  VERIFY_IS_APPROX(sC2 = (sC1.transpose() * sR1.transpose()).pruned(),
+                   dC3 = dC1.transpose() * dR1.template cast<Cplx>().transpose());
 
-  VERIFY_IS_APPROX( sC2 = (sR1 * sC1).pruned(),                         dC3 = dR1.template cast<Cplx>() * dC1 );
-  VERIFY_IS_APPROX( sC2 = (sC1 * sR1).pruned(),                         dC3 = dC1 * dR1.template cast<Cplx>() );
-  VERIFY_IS_APPROX( sC2 = (sR1.transpose() * sC1).pruned(),             dC3 = dR1.template cast<Cplx>().transpose() * dC1 );
-  VERIFY_IS_APPROX( sC2 = (sC1.transpose() * sR1).pruned(),             dC3 = dC1.transpose() * dR1.template cast<Cplx>() );
-  VERIFY_IS_APPROX( sC2 = (sR1 * sC1.transpose()).pruned(),             dC3 = dR1.template cast<Cplx>() * dC1.transpose() );
-  VERIFY_IS_APPROX( sC2 = (sC1 * sR1.transpose()).pruned(),             dC3 = dC1 * dR1.template cast<Cplx>().transpose() );
-  VERIFY_IS_APPROX( sC2 = (sR1.transpose() * sC1.transpose()).pruned(), dC3 = dR1.template cast<Cplx>().transpose() * dC1.transpose() );
-  VERIFY_IS_APPROX( sC2 = (sC1.transpose() * sR1.transpose()).pruned(), dC3 = dC1.transpose() * dR1.template cast<Cplx>().transpose() );
+  VERIFY_IS_APPROX(sCR = (sR1 * sC1).pruned(), dC3 = dR1.template cast<Cplx>() * dC1);
+  VERIFY_IS_APPROX(sCR = (sC1 * sR1).pruned(), dC3 = dC1 * dR1.template cast<Cplx>());
+  VERIFY_IS_APPROX(sCR = (sR1.transpose() * sC1).pruned(), dC3 = dR1.template cast<Cplx>().transpose() * dC1);
+  VERIFY_IS_APPROX(sCR = (sC1.transpose() * sR1).pruned(), dC3 = dC1.transpose() * dR1.template cast<Cplx>());
+  VERIFY_IS_APPROX(sCR = (sR1 * sC1.transpose()).pruned(), dC3 = dR1.template cast<Cplx>() * dC1.transpose());
+  VERIFY_IS_APPROX(sCR = (sC1 * sR1.transpose()).pruned(), dC3 = dC1 * dR1.template cast<Cplx>().transpose());
+  VERIFY_IS_APPROX(sCR = (sR1.transpose() * sC1.transpose()).pruned(),
+                   dC3 = dR1.template cast<Cplx>().transpose() * dC1.transpose());
+  VERIFY_IS_APPROX(sCR = (sC1.transpose() * sR1.transpose()).pruned(),
+                   dC3 = dC1.transpose() * dR1.template cast<Cplx>().transpose());
 
-  VERIFY_IS_APPROX( sCR = (sR1 * sC1).pruned(),                         dC3 = dR1.template cast<Cplx>() * dC1 );
-  VERIFY_IS_APPROX( sCR = (sC1 * sR1).pruned(),                         dC3 = dC1 * dR1.template cast<Cplx>() );
-  VERIFY_IS_APPROX( sCR = (sR1.transpose() * sC1).pruned(),             dC3 = dR1.template cast<Cplx>().transpose() * dC1 );
-  VERIFY_IS_APPROX( sCR = (sC1.transpose() * sR1).pruned(),             dC3 = dC1.transpose() * dR1.template cast<Cplx>() );
-  VERIFY_IS_APPROX( sCR = (sR1 * sC1.transpose()).pruned(),             dC3 = dR1.template cast<Cplx>() * dC1.transpose() );
-  VERIFY_IS_APPROX( sCR = (sC1 * sR1.transpose()).pruned(),             dC3 = dC1 * dR1.template cast<Cplx>().transpose() );
-  VERIFY_IS_APPROX( sCR = (sR1.transpose() * sC1.transpose()).pruned(), dC3 = dR1.template cast<Cplx>().transpose() * dC1.transpose() );
-  VERIFY_IS_APPROX( sCR = (sC1.transpose() * sR1.transpose()).pruned(), dC3 = dC1.transpose() * dR1.template cast<Cplx>().transpose() );
+  VERIFY_IS_APPROX(dC2 = (sR1 * sC1), dC3 = dR1.template cast<Cplx>() * dC1);
+  VERIFY_IS_APPROX(dC2 = (sC1 * sR1), dC3 = dC1 * dR1.template cast<Cplx>());
+  VERIFY_IS_APPROX(dC2 = (sR1.transpose() * sC1), dC3 = dR1.template cast<Cplx>().transpose() * dC1);
+  VERIFY_IS_APPROX(dC2 = (sC1.transpose() * sR1), dC3 = dC1.transpose() * dR1.template cast<Cplx>());
+  VERIFY_IS_APPROX(dC2 = (sR1 * sC1.transpose()), dC3 = dR1.template cast<Cplx>() * dC1.transpose());
+  VERIFY_IS_APPROX(dC2 = (sC1 * sR1.transpose()), dC3 = dC1 * dR1.template cast<Cplx>().transpose());
+  VERIFY_IS_APPROX(dC2 = (sR1.transpose() * sC1.transpose()),
+                   dC3 = dR1.template cast<Cplx>().transpose() * dC1.transpose());
+  VERIFY_IS_APPROX(dC2 = (sC1.transpose() * sR1.transpose()),
+                   dC3 = dC1.transpose() * dR1.template cast<Cplx>().transpose());
 
+  VERIFY_IS_APPROX(dC2 = dR1 * sC1, dC3 = dR1.template cast<Cplx>() * sC1);
+  VERIFY_IS_APPROX(dC2 = sR1 * dC1, dC3 = sR1.template cast<Cplx>() * dC1);
+  VERIFY_IS_APPROX(dC2 = dC1 * sR1, dC3 = dC1 * sR1.template cast<Cplx>());
+  VERIFY_IS_APPROX(dC2 = sC1 * dR1, dC3 = sC1 * dR1.template cast<Cplx>());
 
-  VERIFY_IS_APPROX( dC2 = (sR1 * sC1),                         dC3 = dR1.template cast<Cplx>() * dC1 );
-  VERIFY_IS_APPROX( dC2 = (sC1 * sR1),                         dC3 = dC1 * dR1.template cast<Cplx>() );
-  VERIFY_IS_APPROX( dC2 = (sR1.transpose() * sC1),             dC3 = dR1.template cast<Cplx>().transpose() * dC1 );
-  VERIFY_IS_APPROX( dC2 = (sC1.transpose() * sR1),             dC3 = dC1.transpose() * dR1.template cast<Cplx>() );
-  VERIFY_IS_APPROX( dC2 = (sR1 * sC1.transpose()),             dC3 = dR1.template cast<Cplx>() * dC1.transpose() );
-  VERIFY_IS_APPROX( dC2 = (sC1 * sR1.transpose()),             dC3 = dC1 * dR1.template cast<Cplx>().transpose() );
-  VERIFY_IS_APPROX( dC2 = (sR1.transpose() * sC1.transpose()), dC3 = dR1.template cast<Cplx>().transpose() * dC1.transpose() );
-  VERIFY_IS_APPROX( dC2 = (sC1.transpose() * sR1.transpose()), dC3 = dC1.transpose() * dR1.template cast<Cplx>().transpose() );
-
-
-  VERIFY_IS_APPROX( dC2 = dR1 * sC1, dC3 = dR1.template cast<Cplx>() * sC1 );
-  VERIFY_IS_APPROX( dC2 = sR1 * dC1, dC3 = sR1.template cast<Cplx>() * dC1 );
-  VERIFY_IS_APPROX( dC2 = dC1 * sR1, dC3 = dC1 * sR1.template cast<Cplx>() );
-  VERIFY_IS_APPROX( dC2 = sC1 * dR1, dC3 = sC1 * dR1.template cast<Cplx>() );
-
-  VERIFY_IS_APPROX( dC2 = dR1.row(0) * sC1, dC3 = dR1.template cast<Cplx>().row(0) * sC1 );
-  VERIFY_IS_APPROX( dC2 = sR1 * dC1.col(0), dC3 = sR1.template cast<Cplx>() * dC1.col(0) );
-  VERIFY_IS_APPROX( dC2 = dC1.row(0) * sR1, dC3 = dC1.row(0) * sR1.template cast<Cplx>() );
-  VERIFY_IS_APPROX( dC2 = sC1 * dR1.col(0), dC3 = sC1 * dR1.template cast<Cplx>().col(0) );
+  VERIFY_IS_APPROX(dC2 = dR1.row(0) * sC1, dC3 = dR1.template cast<Cplx>().row(0) * sC1);
+  VERIFY_IS_APPROX(dC2 = sR1 * dC1.col(0), dC3 = sR1.template cast<Cplx>() * dC1.col(0));
+  VERIFY_IS_APPROX(dC2 = dC1.row(0) * sR1, dC3 = dC1.row(0) * sR1.template cast<Cplx>());
+  VERIFY_IS_APPROX(dC2 = sC1 * dR1.col(0), dC3 = sC1 * dR1.template cast<Cplx>().col(0));
 }
 
 // Test mixed storage types
-template<int OrderA, int OrderB, int OrderC>
+template <int OrderA, int OrderB, int OrderC>
 void test_mixed_storage_imp() {
   typedef float Real;
-  typedef Matrix<Real,Dynamic,Dynamic> DenseMat;
+  typedef Matrix<Real, Dynamic, Dynamic> DenseMat;
 
   // Case: Large inputs but small result
   {
@@ -481,7 +503,7 @@
     SparseMatrix<Real, OrderC> result_large;
     DenseMat refResult;
 
-    VERIFY_IS_APPROX( result = (A * B), refResult = refA * refB );
+    VERIFY_IS_APPROX(result = (A * B), refResult = refA * refB);
   }
 
   // Case: Small input but large result
@@ -498,7 +520,7 @@
     SparseMatrix<Real, OrderC> result_large;
     DenseMat refResult;
 
-    VERIFY_IS_APPROX( result = (A * B), refResult = refA * refB );
+    VERIFY_IS_APPROX(result = (A * B), refResult = refA * refB);
   }
 }
 
@@ -513,18 +535,18 @@
   test_mixed_storage_imp<ColMajor, ColMajor, ColMajor>();
 }
 
-EIGEN_DECLARE_TEST(sparse_product)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( (sparse_product<SparseMatrix<double,ColMajor> >()) );
-    CALL_SUBTEST_1( (sparse_product<SparseMatrix<double,RowMajor> >()) );
-    CALL_SUBTEST_1( (bug_942<double>()) );
-    CALL_SUBTEST_2( (sparse_product<SparseMatrix<std::complex<double>, ColMajor > >()) );
-    CALL_SUBTEST_2( (sparse_product<SparseMatrix<std::complex<double>, RowMajor > >()) );
-    CALL_SUBTEST_3( (sparse_product<SparseMatrix<float,ColMajor,long int> >()) );
-    CALL_SUBTEST_4( (sparse_product_regression_test<SparseMatrix<double,RowMajor>, Matrix<double, Dynamic, Dynamic, RowMajor> >()) );
+EIGEN_DECLARE_TEST(sparse_product) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1((sparse_product<SparseMatrix<double, ColMajor> >()));
+    CALL_SUBTEST_1((sparse_product<SparseMatrix<double, RowMajor> >()));
+    CALL_SUBTEST_1((bug_942<double>()));
+    CALL_SUBTEST_2((sparse_product<SparseMatrix<std::complex<double>, ColMajor> >()));
+    CALL_SUBTEST_2((sparse_product<SparseMatrix<std::complex<double>, RowMajor> >()));
+    CALL_SUBTEST_3((sparse_product<SparseMatrix<float, ColMajor, long int> >()));
+    CALL_SUBTEST_4((
+        sparse_product_regression_test<SparseMatrix<double, RowMajor>, Matrix<double, Dynamic, Dynamic, RowMajor> >()));
 
-    CALL_SUBTEST_5( (test_mixing_types<float>()) );
-    CALL_SUBTEST_5( (test_mixed_storage()) );
+    CALL_SUBTEST_5((test_mixing_types<float>()));
+    CALL_SUBTEST_5((test_mixed_storage()));
   }
 }
diff --git a/test/sparse_ref.cpp b/test/sparse_ref.cpp
index 098331e..bfedcd9 100644
--- a/test/sparse_ref.cpp
+++ b/test/sparse_ref.cpp
@@ -19,121 +19,129 @@
   nb_temporaries++;
 }
 
-#define EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN { on_temporary_creation(); }
+#define EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN \
+  { on_temporary_creation(); }
 
 #include "main.h"
 #include <Eigen/SparseCore>
 
-#define VERIFY_EVALUATION_COUNT(XPR,N) {\
-    nb_temporaries = 0; \
-    CALL_SUBTEST( XPR ); \
-    if(nb_temporaries!=N) std::cerr << "nb_temporaries == " << nb_temporaries << "\n"; \
-    VERIFY( (#XPR) && nb_temporaries==N ); \
+#define VERIFY_EVALUATION_COUNT(XPR, N)                                                   \
+  {                                                                                       \
+    nb_temporaries = 0;                                                                   \
+    CALL_SUBTEST(XPR);                                                                    \
+    if (nb_temporaries != N) std::cerr << "nb_temporaries == " << nb_temporaries << "\n"; \
+    VERIFY((#XPR) && nb_temporaries == N);                                                \
   }
 
-template<typename PlainObjectType> void check_const_correctness(const PlainObjectType&)
-{
+template <typename PlainObjectType>
+void check_const_correctness(const PlainObjectType &) {
   // verify that ref-to-const don't have LvalueBit
   typedef std::add_const_t<PlainObjectType> ConstPlainObjectType;
-  VERIFY( !(internal::traits<Ref<ConstPlainObjectType> >::Flags & LvalueBit) );
-  VERIFY( !(internal::traits<Ref<ConstPlainObjectType, Aligned> >::Flags & LvalueBit) );
-  VERIFY( !(Ref<ConstPlainObjectType>::Flags & LvalueBit) );
-  VERIFY( !(Ref<ConstPlainObjectType, Aligned>::Flags & LvalueBit) );
+  VERIFY(!(internal::traits<Ref<ConstPlainObjectType> >::Flags & LvalueBit));
+  VERIFY(!(internal::traits<Ref<ConstPlainObjectType, Aligned> >::Flags & LvalueBit));
+  VERIFY(!(Ref<ConstPlainObjectType>::Flags & LvalueBit));
+  VERIFY(!(Ref<ConstPlainObjectType, Aligned>::Flags & LvalueBit));
 }
 
-template<typename B>
-EIGEN_DONT_INLINE void call_ref_1(Ref<SparseMatrix<float> > a, const B &b) { VERIFY_IS_EQUAL(a.toDense(),b.toDense()); }
+template <typename B>
+EIGEN_DONT_INLINE void call_ref_1(Ref<SparseMatrix<float> > a, const B &b) {
+  VERIFY_IS_EQUAL(a.toDense(), b.toDense());
+}
 
-template<typename B>
-EIGEN_DONT_INLINE void call_ref_2(const Ref<const SparseMatrix<float> >& a, const B &b) { VERIFY_IS_EQUAL(a.toDense(),b.toDense()); }
+template <typename B>
+EIGEN_DONT_INLINE void call_ref_2(const Ref<const SparseMatrix<float> > &a, const B &b) {
+  VERIFY_IS_EQUAL(a.toDense(), b.toDense());
+}
 
-template<typename B>
-EIGEN_DONT_INLINE void call_ref_3(const Ref<const SparseMatrix<float>, StandardCompressedFormat>& a, const B &b) {
+template <typename B>
+EIGEN_DONT_INLINE void call_ref_3(const Ref<const SparseMatrix<float>, StandardCompressedFormat> &a, const B &b) {
   VERIFY(a.isCompressed());
-  VERIFY_IS_EQUAL(a.toDense(),b.toDense());
+  VERIFY_IS_EQUAL(a.toDense(), b.toDense());
 }
 
-template<typename B>
-EIGEN_DONT_INLINE void call_ref_4(Ref<SparseVector<float> > a, const B &b) { VERIFY_IS_EQUAL(a.toDense(),b.toDense()); }
+template <typename B>
+EIGEN_DONT_INLINE void call_ref_4(Ref<SparseVector<float> > a, const B &b) {
+  VERIFY_IS_EQUAL(a.toDense(), b.toDense());
+}
 
-template<typename B>
-EIGEN_DONT_INLINE void call_ref_5(const Ref<const SparseVector<float> >& a, const B &b) { VERIFY_IS_EQUAL(a.toDense(),b.toDense()); }
+template <typename B>
+EIGEN_DONT_INLINE void call_ref_5(const Ref<const SparseVector<float> > &a, const B &b) {
+  VERIFY_IS_EQUAL(a.toDense(), b.toDense());
+}
 
-void call_ref()
-{
-  SparseMatrix<float>               A = MatrixXf::Random(10,10).sparseView(0.5,1);
-  SparseMatrix<float,RowMajor>      B = MatrixXf::Random(10,10).sparseView(0.5,1);
-  SparseMatrix<float>               C = MatrixXf::Random(10,10).sparseView(0.5,1);
+void call_ref() {
+  SparseMatrix<float> A = MatrixXf::Random(10, 10).sparseView(0.5, 1);
+  SparseMatrix<float, RowMajor> B = MatrixXf::Random(10, 10).sparseView(0.5, 1);
+  SparseMatrix<float> C = MatrixXf::Random(10, 10).sparseView(0.5, 1);
   C.reserve(VectorXi::Constant(C.outerSize(), 2));
-  const SparseMatrix<float>&        Ac(A);
-  Block<SparseMatrix<float> >       Ab(A,0,1, 3,3);
-  const Block<SparseMatrix<float> > Abc(A,0,1,3,3);
-  SparseVector<float>               vc =  VectorXf::Random(10).sparseView(0.5,1);
-  SparseVector<float,RowMajor>      vr =  VectorXf::Random(10).sparseView(0.5,1);
-  SparseMatrix<float> AA = A*A;
-  
+  const SparseMatrix<float> &Ac(A);
+  Block<SparseMatrix<float> > Ab(A, 0, 1, 3, 3);
+  const Block<SparseMatrix<float> > Abc(A, 0, 1, 3, 3);
+  SparseVector<float> vc = VectorXf::Random(10).sparseView(0.5, 1);
+  SparseVector<float, RowMajor> vr = VectorXf::Random(10).sparseView(0.5, 1);
+  SparseMatrix<float> AA = A * A;
 
-  VERIFY_EVALUATION_COUNT( call_ref_1(A, A),  0);
-//   VERIFY_EVALUATION_COUNT( call_ref_1(Ac, Ac),  0); // does not compile on purpose
-  VERIFY_EVALUATION_COUNT( call_ref_2(A, A),  0);
-  VERIFY_EVALUATION_COUNT( call_ref_3(A, A),  0);
-  VERIFY_EVALUATION_COUNT( call_ref_2(A.transpose(), A.transpose()),  1);
-  VERIFY_EVALUATION_COUNT( call_ref_3(A.transpose(), A.transpose()),  1);
-  VERIFY_EVALUATION_COUNT( call_ref_2(Ac,Ac), 0);
-  VERIFY_EVALUATION_COUNT( call_ref_3(Ac,Ac), 0);
-  VERIFY_EVALUATION_COUNT( call_ref_2(A+A,2*Ac), 1);
-  VERIFY_EVALUATION_COUNT( call_ref_3(A+A,2*Ac), 1);
-  VERIFY_EVALUATION_COUNT( call_ref_2(B, B),  1);
-  VERIFY_EVALUATION_COUNT( call_ref_3(B, B),  1);
-  VERIFY_EVALUATION_COUNT( call_ref_2(B.transpose(), B.transpose()),  0);
-  VERIFY_EVALUATION_COUNT( call_ref_3(B.transpose(), B.transpose()),  0);
-  VERIFY_EVALUATION_COUNT( call_ref_2(A*A, AA),  3);
-  VERIFY_EVALUATION_COUNT( call_ref_3(A*A, AA),  3);
-  
+  VERIFY_EVALUATION_COUNT(call_ref_1(A, A), 0);
+  //   VERIFY_EVALUATION_COUNT( call_ref_1(Ac, Ac),  0); // does not compile on purpose
+  VERIFY_EVALUATION_COUNT(call_ref_2(A, A), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_3(A, A), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_2(A.transpose(), A.transpose()), 1);
+  VERIFY_EVALUATION_COUNT(call_ref_3(A.transpose(), A.transpose()), 1);
+  VERIFY_EVALUATION_COUNT(call_ref_2(Ac, Ac), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_3(Ac, Ac), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_2(A + A, 2 * Ac), 1);
+  VERIFY_EVALUATION_COUNT(call_ref_3(A + A, 2 * Ac), 1);
+  VERIFY_EVALUATION_COUNT(call_ref_2(B, B), 1);
+  VERIFY_EVALUATION_COUNT(call_ref_3(B, B), 1);
+  VERIFY_EVALUATION_COUNT(call_ref_2(B.transpose(), B.transpose()), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_3(B.transpose(), B.transpose()), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_2(A * A, AA), 3);
+  VERIFY_EVALUATION_COUNT(call_ref_3(A * A, AA), 3);
+
   VERIFY(!C.isCompressed());
-  VERIFY_EVALUATION_COUNT( call_ref_3(C, C),  1);
-  
-  Ref<SparseMatrix<float> > Ar(A);
-  VERIFY_IS_APPROX(Ar+Ar, A+A);
-  VERIFY_EVALUATION_COUNT( call_ref_1(Ar, A),  0);
-  VERIFY_EVALUATION_COUNT( call_ref_2(Ar, A),  0);
-  
-  Ref<SparseMatrix<float,RowMajor> > Br(B);
-  VERIFY_EVALUATION_COUNT( call_ref_1(Br.transpose(), Br.transpose()),  0);
-  VERIFY_EVALUATION_COUNT( call_ref_2(Br, Br),  1);
-  VERIFY_EVALUATION_COUNT( call_ref_2(Br.transpose(), Br.transpose()),  0);
-  
-  Ref<const SparseMatrix<float> > Arc(A);
-//   VERIFY_EVALUATION_COUNT( call_ref_1(Arc, Arc),  0); // does not compile on purpose
-  VERIFY_EVALUATION_COUNT( call_ref_2(Arc, Arc),  0);
-  
-  VERIFY_EVALUATION_COUNT( call_ref_2(A.middleCols(1,3), A.middleCols(1,3)),  0);
-  
-  VERIFY_EVALUATION_COUNT( call_ref_2(A.col(2), A.col(2)),  0);
-  VERIFY_EVALUATION_COUNT( call_ref_2(vc, vc),  0);
-  VERIFY_EVALUATION_COUNT( call_ref_2(vr.transpose(), vr.transpose()),  0);
-  VERIFY_EVALUATION_COUNT( call_ref_2(vr, vr.transpose()),  0);
-  
-  VERIFY_EVALUATION_COUNT( call_ref_2(A.block(1,1,3,3), A.block(1,1,3,3)),  1); // should be 0 (allocate starts/nnz only)
+  VERIFY_EVALUATION_COUNT(call_ref_3(C, C), 1);
 
-  VERIFY_EVALUATION_COUNT( call_ref_4(vc, vc),  0);
-  VERIFY_EVALUATION_COUNT( call_ref_4(vr, vr.transpose()),  0);
-  VERIFY_EVALUATION_COUNT( call_ref_5(vc, vc),  0);
-  VERIFY_EVALUATION_COUNT( call_ref_5(vr, vr.transpose()),  0);
-  VERIFY_EVALUATION_COUNT( call_ref_4(A.col(2), A.col(2)),  0);
-  VERIFY_EVALUATION_COUNT( call_ref_5(A.col(2), A.col(2)),  0);
+  Ref<SparseMatrix<float> > Ar(A);
+  VERIFY_IS_APPROX(Ar + Ar, A + A);
+  VERIFY_EVALUATION_COUNT(call_ref_1(Ar, A), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_2(Ar, A), 0);
+
+  Ref<SparseMatrix<float, RowMajor> > Br(B);
+  VERIFY_EVALUATION_COUNT(call_ref_1(Br.transpose(), Br.transpose()), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_2(Br, Br), 1);
+  VERIFY_EVALUATION_COUNT(call_ref_2(Br.transpose(), Br.transpose()), 0);
+
+  Ref<const SparseMatrix<float> > Arc(A);
+  //   VERIFY_EVALUATION_COUNT( call_ref_1(Arc, Arc),  0); // does not compile on purpose
+  VERIFY_EVALUATION_COUNT(call_ref_2(Arc, Arc), 0);
+
+  VERIFY_EVALUATION_COUNT(call_ref_2(A.middleCols(1, 3), A.middleCols(1, 3)), 0);
+
+  VERIFY_EVALUATION_COUNT(call_ref_2(A.col(2), A.col(2)), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_2(vc, vc), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_2(vr.transpose(), vr.transpose()), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_2(vr, vr.transpose()), 0);
+
+  VERIFY_EVALUATION_COUNT(call_ref_2(A.block(1, 1, 3, 3), A.block(1, 1, 3, 3)),
+                          1);  // should be 0 (allocate starts/nnz only)
+
+  VERIFY_EVALUATION_COUNT(call_ref_4(vc, vc), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_4(vr, vr.transpose()), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_5(vc, vc), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_5(vr, vr.transpose()), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_4(A.col(2), A.col(2)), 0);
+  VERIFY_EVALUATION_COUNT(call_ref_5(A.col(2), A.col(2)), 0);
   // VERIFY_EVALUATION_COUNT( call_ref_4(A.row(2), A.row(2).transpose()),  1); // does not compile on purpose
-  VERIFY_EVALUATION_COUNT( call_ref_5(A.row(2), A.row(2).transpose()),  1);
+  VERIFY_EVALUATION_COUNT(call_ref_5(A.row(2), A.row(2).transpose()), 1);
 }
 
-EIGEN_DECLARE_TEST(sparse_ref)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( check_const_correctness(SparseMatrix<float>()) );
-    CALL_SUBTEST_1( check_const_correctness(SparseMatrix<double,RowMajor>()) );
-    CALL_SUBTEST_2( call_ref() );
+EIGEN_DECLARE_TEST(sparse_ref) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(check_const_correctness(SparseMatrix<float>()));
+    CALL_SUBTEST_1(check_const_correctness(SparseMatrix<double, RowMajor>()));
+    CALL_SUBTEST_2(call_ref());
 
-    CALL_SUBTEST_3( check_const_correctness(SparseVector<float>()) );
-    CALL_SUBTEST_3( check_const_correctness(SparseVector<double,RowMajor>()) );
+    CALL_SUBTEST_3(check_const_correctness(SparseVector<float>()));
+    CALL_SUBTEST_3(check_const_correctness(SparseVector<double, RowMajor>()));
   }
 }
diff --git a/test/sparse_solver.h b/test/sparse_solver.h
index 01846e2..e7518e4 100644
--- a/test/sparse_solver.h
+++ b/test/sparse_solver.h
@@ -12,36 +12,33 @@
 #include <Eigen/SparseLU>
 #include <sstream>
 
-template<typename Solver, typename Rhs, typename Guess,typename Result>
-void solve_with_guess(IterativeSolverBase<Solver>& solver, const MatrixBase<Rhs>& b, const Guess& g, Result &x) {
-  if(internal::random<bool>())
-  {
+template <typename Solver, typename Rhs, typename Guess, typename Result>
+void solve_with_guess(IterativeSolverBase<Solver>& solver, const MatrixBase<Rhs>& b, const Guess& g, Result& x) {
+  if (internal::random<bool>()) {
     // With a temporary through evaluator<SolveWithGuess>
-    x = solver.derived().solveWithGuess(b,g) + Result::Zero(x.rows(), x.cols());
-  }
-  else
-  {
+    x = solver.derived().solveWithGuess(b, g) + Result::Zero(x.rows(), x.cols());
+  } else {
     // direct evaluation within x through Assignment<Result,SolveWithGuess>
-    x = solver.derived().solveWithGuess(b.derived(),g);
+    x = solver.derived().solveWithGuess(b.derived(), g);
   }
 }
 
-template<typename Solver, typename Rhs, typename Guess,typename Result>
-void solve_with_guess(SparseSolverBase<Solver>& solver, const MatrixBase<Rhs>& b, const Guess& , Result& x) {
-  if(internal::random<bool>())
+template <typename Solver, typename Rhs, typename Guess, typename Result>
+void solve_with_guess(SparseSolverBase<Solver>& solver, const MatrixBase<Rhs>& b, const Guess&, Result& x) {
+  if (internal::random<bool>())
     x = solver.derived().solve(b) + Result::Zero(x.rows(), x.cols());
   else
     x = solver.derived().solve(b);
 }
 
-template<typename Solver, typename Rhs, typename Guess,typename Result>
-void solve_with_guess(SparseSolverBase<Solver>& solver, const SparseMatrixBase<Rhs>& b, const Guess& , Result& x) {
+template <typename Solver, typename Rhs, typename Guess, typename Result>
+void solve_with_guess(SparseSolverBase<Solver>& solver, const SparseMatrixBase<Rhs>& b, const Guess&, Result& x) {
   x = solver.derived().solve(b);
 }
 
-template<typename Solver, typename Rhs, typename DenseMat, typename DenseRhs>
-void check_sparse_solving(Solver& solver, const typename Solver::MatrixType& A, const Rhs& b, const DenseMat& dA, const DenseRhs& db)
-{
+template <typename Solver, typename Rhs, typename DenseMat, typename DenseRhs>
+void check_sparse_solving(Solver& solver, const typename Solver::MatrixType& A, const Rhs& b, const DenseMat& dA,
+                          const DenseRhs& db) {
   typedef typename Solver::MatrixType Mat;
   typedef typename Mat::Scalar Scalar;
   typedef typename Mat::StorageIndex StorageIndex;
@@ -52,30 +49,28 @@
     Rhs oldb = b;
 
     solver.compute(A);
-    if (solver.info() != Success)
-    {
+    if (solver.info() != Success) {
       std::cerr << "ERROR | sparse solver testing, factorization failed (" << typeid(Solver).name() << ")\n";
       VERIFY(solver.info() == Success);
     }
     x = solver.solve(b);
-    if (solver.info() != Success)
-    {
+    if (solver.info() != Success) {
       std::cerr << "WARNING: sparse solver testing: solving failed (" << typeid(Solver).name() << ")\n";
       // dump call stack:
-      g_test_level++; 
+      g_test_level++;
       VERIFY(solver.info() == Success);
       g_test_level--;
       return;
     }
     VERIFY(oldb.isApprox(b) && "sparse solver testing: the rhs should not be modified!");
-    VERIFY(x.isApprox(refX,test_precision<Scalar>()));
+    VERIFY(x.isApprox(refX, test_precision<Scalar>()));
 
     x.setZero();
     solve_with_guess(solver, b, x, x);
     VERIFY(solver.info() == Success && "solving failed when using solve_with_guess API");
     VERIFY(oldb.isApprox(b) && "sparse solver testing: the rhs should not be modified!");
-    VERIFY(x.isApprox(refX,test_precision<Scalar>()));
-    
+    VERIFY(x.isApprox(refX, test_precision<Scalar>()));
+
     x.setZero();
     // test the analyze/factorize API
     solver.analyzePattern(A);
@@ -84,11 +79,13 @@
     x = solver.solve(b);
     VERIFY(solver.info() == Success && "solving failed when using analyzePattern/factorize API");
     VERIFY(oldb.isApprox(b) && "sparse solver testing: the rhs should not be modified!");
-    VERIFY(x.isApprox(refX,test_precision<Scalar>()));
-    
+    VERIFY(x.isApprox(refX, test_precision<Scalar>()));
+
     x.setZero();
     // test with Map
-    Map<SparseMatrix<Scalar,Mat::Options,StorageIndex>> Am(A.rows(), A.cols(), A.nonZeros(), const_cast<StorageIndex*>(A.outerIndexPtr()), const_cast<StorageIndex*>(A.innerIndexPtr()), const_cast<Scalar*>(A.valuePtr()));
+    Map<SparseMatrix<Scalar, Mat::Options, StorageIndex>> Am(
+        A.rows(), A.cols(), A.nonZeros(), const_cast<StorageIndex*>(A.outerIndexPtr()),
+        const_cast<StorageIndex*>(A.innerIndexPtr()), const_cast<Scalar*>(A.valuePtr()));
     solver.compute(Am);
     VERIFY(solver.info() == Success && "factorization failed when using Map");
     DenseRhs dx(refX);
@@ -98,26 +95,26 @@
     xm = solver.solve(bm);
     VERIFY(solver.info() == Success && "solving failed when using Map");
     VERIFY(oldb.isApprox(bm) && "sparse solver testing: the rhs should not be modified!");
-    VERIFY(xm.isApprox(refX,test_precision<Scalar>()));
-    
+    VERIFY(xm.isApprox(refX, test_precision<Scalar>()));
+
     // Test with a Map and non-unit stride.
-    Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic> out(2*xm.rows(), 2*xm.cols());
+    Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic> out(2 * xm.rows(), 2 * xm.cols());
     out.setZero();
-    Eigen::Map<DenseRhs, 0, Stride<Eigen::Dynamic, 2>> outm(out.data(), xm.rows(), xm.cols(), Stride<Eigen::Dynamic, 2>(2 * xm.rows(), 2));
+    Eigen::Map<DenseRhs, 0, Stride<Eigen::Dynamic, 2>> outm(out.data(), xm.rows(), xm.cols(),
+                                                            Stride<Eigen::Dynamic, 2>(2 * xm.rows(), 2));
     outm = solver.solve(bm);
-    VERIFY(outm.isApprox(refX,test_precision<Scalar>()));
+    VERIFY(outm.isApprox(refX, test_precision<Scalar>()));
   }
-  
+
   // if not too large, do some extra check:
-  if(A.rows()<2000)
-  {
+  if (A.rows() < 2000) {
     // test initialization ctor
     {
       Rhs x(b.rows(), b.cols());
       Solver solver2(A);
       VERIFY(solver2.info() == Success);
       x = solver2.solve(b);
-      VERIFY(x.isApprox(refX,test_precision<Scalar>()));
+      VERIFY(x.isApprox(refX, test_precision<Scalar>()));
     }
 
     // test dense Block as the result and rhs:
@@ -125,46 +122,46 @@
       DenseRhs x(refX.rows(), refX.cols());
       DenseRhs oldb(db);
       x.setZero();
-      x.block(0,0,x.rows(),x.cols()) = solver.solve(db.block(0,0,db.rows(),db.cols()));
+      x.block(0, 0, x.rows(), x.cols()) = solver.solve(db.block(0, 0, db.rows(), db.cols()));
       VERIFY(oldb.isApprox(db) && "sparse solver testing: the rhs should not be modified!");
-      VERIFY(x.isApprox(refX,test_precision<Scalar>()));
+      VERIFY(x.isApprox(refX, test_precision<Scalar>()));
     }
 
     // test uncompressed inputs
     {
       Mat A2 = A;
-      A2.reserve((ArrayXf::Random(A.outerSize())+2).template cast<typename Mat::StorageIndex>().eval());
+      A2.reserve((ArrayXf::Random(A.outerSize()) + 2).template cast<typename Mat::StorageIndex>().eval());
       solver.compute(A2);
       Rhs x = solver.solve(b);
-      VERIFY(x.isApprox(refX,test_precision<Scalar>()));
+      VERIFY(x.isApprox(refX, test_precision<Scalar>()));
     }
 
     // test expression as input
     {
-      solver.compute(0.5*(A+A));
+      solver.compute(0.5 * (A + A));
       Rhs x = solver.solve(b);
-      VERIFY(x.isApprox(refX,test_precision<Scalar>()));
+      VERIFY(x.isApprox(refX, test_precision<Scalar>()));
 
-      Solver solver2(0.5*(A+A));
+      Solver solver2(0.5 * (A + A));
       Rhs x2 = solver2.solve(b);
-      VERIFY(x2.isApprox(refX,test_precision<Scalar>()));
+      VERIFY(x2.isApprox(refX, test_precision<Scalar>()));
     }
   }
 }
 
 // specialization of generic check_sparse_solving for SuperLU in order to also test adjoint and transpose solves
-template<typename Scalar, typename Rhs, typename DenseMat, typename DenseRhs>
-void check_sparse_solving(Eigen::SparseLU<Eigen::SparseMatrix<Scalar> >& solver, const typename Eigen::SparseMatrix<Scalar>& A, const Rhs& b, const DenseMat& dA, const DenseRhs& db)
-{
+template <typename Scalar, typename Rhs, typename DenseMat, typename DenseRhs>
+void check_sparse_solving(Eigen::SparseLU<Eigen::SparseMatrix<Scalar>>& solver,
+                          const typename Eigen::SparseMatrix<Scalar>& A, const Rhs& b, const DenseMat& dA,
+                          const DenseRhs& db) {
   typedef typename Eigen::SparseMatrix<Scalar> Mat;
   typedef typename Mat::StorageIndex StorageIndex;
-  typedef typename Eigen::SparseLU<Eigen::SparseMatrix<Scalar> > Solver;
+  typedef typename Eigen::SparseLU<Eigen::SparseMatrix<Scalar>> Solver;
 
   // reference solutions computed by dense QR solver
-  DenseRhs refX1 = dA.householderQr().solve(db); // solution of A x = db
-  DenseRhs refX2 = dA.transpose().householderQr().solve(db); // solution of A^T * x = db (use transposed matrix A^T)
-  DenseRhs refX3 = dA.adjoint().householderQr().solve(db);  // solution of A^* * x = db (use adjoint matrix A^*)
-
+  DenseRhs refX1 = dA.householderQr().solve(db);              // solution of A x = db
+  DenseRhs refX2 = dA.transpose().householderQr().solve(db);  // solution of A^T * x = db (use transposed matrix A^T)
+  DenseRhs refX3 = dA.adjoint().householderQr().solve(db);    // solution of A^* * x = db (use adjoint matrix A^*)
 
   {
     Rhs x1(A.cols(), b.cols());
@@ -173,37 +170,34 @@
     Rhs oldb = b;
 
     solver.compute(A);
-    if (solver.info() != Success)
-    {
+    if (solver.info() != Success) {
       std::cerr << "ERROR | sparse solver testing, factorization failed (" << typeid(Solver).name() << ")\n";
       VERIFY(solver.info() == Success);
     }
     x1 = solver.solve(b);
-    if (solver.info() != Success)
-    {
+    if (solver.info() != Success) {
       std::cerr << "WARNING | sparse solver testing: solving failed (" << typeid(Solver).name() << ")\n";
       return;
     }
-    VERIFY(oldb.isApprox(b,0.0) && "sparse solver testing: the rhs should not be modified!");
-    VERIFY(x1.isApprox(refX1,test_precision<Scalar>()));
+    VERIFY(oldb.isApprox(b, 0.0) && "sparse solver testing: the rhs should not be modified!");
+    VERIFY(x1.isApprox(refX1, test_precision<Scalar>()));
 
     // test solve with transposed
     x2 = solver.transpose().solve(b);
     VERIFY(oldb.isApprox(b) && "sparse solver testing: the rhs should not be modified!");
-    VERIFY(x2.isApprox(refX2,test_precision<Scalar>()));
-
+    VERIFY(x2.isApprox(refX2, test_precision<Scalar>()));
 
     // test solve with adjoint
-    //solver.template _solve_impl_transposed<true>(b, x3);
+    // solver.template _solve_impl_transposed<true>(b, x3);
     x3 = solver.adjoint().solve(b);
-    VERIFY(oldb.isApprox(b,0.0) && "sparse solver testing: the rhs should not be modified!");
-    VERIFY(x3.isApprox(refX3,test_precision<Scalar>()));
+    VERIFY(oldb.isApprox(b, 0.0) && "sparse solver testing: the rhs should not be modified!");
+    VERIFY(x3.isApprox(refX3, test_precision<Scalar>()));
 
     x1.setZero();
     solve_with_guess(solver, b, x1, x1);
     VERIFY(solver.info() == Success && "solving failed when using analyzePattern/factorize API");
-    VERIFY(oldb.isApprox(b,0.0) && "sparse solver testing: the rhs should not be modified!");
-    VERIFY(x1.isApprox(refX1,test_precision<Scalar>()));
+    VERIFY(oldb.isApprox(b, 0.0) && "sparse solver testing: the rhs should not be modified!");
+    VERIFY(x1.isApprox(refX1, test_precision<Scalar>()));
 
     x1.setZero();
     x2.setZero();
@@ -217,14 +211,16 @@
     x3 = solver.adjoint().solve(b);
 
     VERIFY(solver.info() == Success && "solving failed when using analyzePattern/factorize API");
-    VERIFY(oldb.isApprox(b,0.0) && "sparse solver testing: the rhs should not be modified!");
-    VERIFY(x1.isApprox(refX1,test_precision<Scalar>()));
-    VERIFY(x2.isApprox(refX2,test_precision<Scalar>()));
-    VERIFY(x3.isApprox(refX3,test_precision<Scalar>()));
+    VERIFY(oldb.isApprox(b, 0.0) && "sparse solver testing: the rhs should not be modified!");
+    VERIFY(x1.isApprox(refX1, test_precision<Scalar>()));
+    VERIFY(x2.isApprox(refX2, test_precision<Scalar>()));
+    VERIFY(x3.isApprox(refX3, test_precision<Scalar>()));
 
     x1.setZero();
     // test with Map
-    Map<SparseMatrix<Scalar,Mat::Options,StorageIndex> > Am(A.rows(), A.cols(), A.nonZeros(), const_cast<StorageIndex*>(A.outerIndexPtr()), const_cast<StorageIndex*>(A.innerIndexPtr()), const_cast<Scalar*>(A.valuePtr()));
+    Map<SparseMatrix<Scalar, Mat::Options, StorageIndex>> Am(
+        A.rows(), A.cols(), A.nonZeros(), const_cast<StorageIndex*>(A.outerIndexPtr()),
+        const_cast<StorageIndex*>(A.innerIndexPtr()), const_cast<Scalar*>(A.valuePtr()));
     solver.compute(Am);
     VERIFY(solver.info() == Success && "factorization failed when using Map");
     DenseRhs dx(refX1);
@@ -233,20 +229,19 @@
     Map<const DenseRhs> bm(db.data(), db.rows(), db.cols());
     xm = solver.solve(bm);
     VERIFY(solver.info() == Success && "solving failed when using Map");
-    VERIFY(oldb.isApprox(bm,0.0) && "sparse solver testing: the rhs should not be modified!");
-    VERIFY(xm.isApprox(refX1,test_precision<Scalar>()));
+    VERIFY(oldb.isApprox(bm, 0.0) && "sparse solver testing: the rhs should not be modified!");
+    VERIFY(xm.isApprox(refX1, test_precision<Scalar>()));
   }
 
   // if not too large, do some extra check:
-  if(A.rows()<2000)
-  {
+  if (A.rows() < 2000) {
     // test initialization ctor
     {
       Rhs x(b.rows(), b.cols());
       Solver solver2(A);
       VERIFY(solver2.info() == Success);
       x = solver2.solve(b);
-      VERIFY(x.isApprox(refX1,test_precision<Scalar>()));
+      VERIFY(x.isApprox(refX1, test_precision<Scalar>()));
     }
 
     // test dense Block as the result and rhs:
@@ -254,110 +249,100 @@
       DenseRhs x(refX1.rows(), refX1.cols());
       DenseRhs oldb(db);
       x.setZero();
-      x.block(0,0,x.rows(),x.cols()) = solver.solve(db.block(0,0,db.rows(),db.cols()));
-      VERIFY(oldb.isApprox(db,0.0) && "sparse solver testing: the rhs should not be modified!");
-      VERIFY(x.isApprox(refX1,test_precision<Scalar>()));
+      x.block(0, 0, x.rows(), x.cols()) = solver.solve(db.block(0, 0, db.rows(), db.cols()));
+      VERIFY(oldb.isApprox(db, 0.0) && "sparse solver testing: the rhs should not be modified!");
+      VERIFY(x.isApprox(refX1, test_precision<Scalar>()));
     }
 
     // test uncompressed inputs
     {
       Mat A2 = A;
-      A2.reserve((ArrayXf::Random(A.outerSize())+2).template cast<typename Mat::StorageIndex>().eval());
+      A2.reserve((ArrayXf::Random(A.outerSize()) + 2).template cast<typename Mat::StorageIndex>().eval());
       solver.compute(A2);
       Rhs x = solver.solve(b);
-      VERIFY(x.isApprox(refX1,test_precision<Scalar>()));
+      VERIFY(x.isApprox(refX1, test_precision<Scalar>()));
     }
 
     // test expression as input
     {
-      solver.compute(0.5*(A+A));
+      solver.compute(0.5 * (A + A));
       Rhs x = solver.solve(b);
-      VERIFY(x.isApprox(refX1,test_precision<Scalar>()));
+      VERIFY(x.isApprox(refX1, test_precision<Scalar>()));
 
-      Solver solver2(0.5*(A+A));
+      Solver solver2(0.5 * (A + A));
       Rhs x2 = solver2.solve(b);
-      VERIFY(x2.isApprox(refX1,test_precision<Scalar>()));
+      VERIFY(x2.isApprox(refX1, test_precision<Scalar>()));
     }
   }
 }
 
-
-template<typename Solver, typename Rhs>
-void check_sparse_solving_real_cases(Solver& solver, const typename Solver::MatrixType& A, const Rhs& b, const typename Solver::MatrixType& fullA, const Rhs& refX)
-{
+template <typename Solver, typename Rhs>
+void check_sparse_solving_real_cases(Solver& solver, const typename Solver::MatrixType& A, const Rhs& b,
+                                     const typename Solver::MatrixType& fullA, const Rhs& refX) {
   typedef typename Solver::MatrixType Mat;
   typedef typename Mat::Scalar Scalar;
   typedef typename Mat::RealScalar RealScalar;
-  
+
   Rhs x(A.cols(), b.cols());
 
   solver.compute(A);
-  if (solver.info() != Success)
-  {
+  if (solver.info() != Success) {
     std::cerr << "ERROR | sparse solver testing, factorization failed (" << typeid(Solver).name() << ")\n";
     VERIFY(solver.info() == Success);
   }
   x = solver.solve(b);
-  
-  if (solver.info() != Success)
-  {
+
+  if (solver.info() != Success) {
     std::cerr << "WARNING | sparse solver testing, solving failed (" << typeid(Solver).name() << ")\n";
     return;
   }
-  
-  RealScalar res_error = (fullA*x-b).norm()/b.norm();  
-  VERIFY( (res_error <= test_precision<Scalar>() ) && "sparse solver failed without noticing it"); 
 
-  
-  if(refX.size() != 0 && (refX - x).norm()/refX.norm() > test_precision<Scalar>())
-  {
+  RealScalar res_error = (fullA * x - b).norm() / b.norm();
+  VERIFY((res_error <= test_precision<Scalar>()) && "sparse solver failed without noticing it");
+
+  if (refX.size() != 0 && (refX - x).norm() / refX.norm() > test_precision<Scalar>()) {
     std::cerr << "WARNING | found solution is different from the provided reference one\n";
   }
-  
 }
-template<typename Solver, typename DenseMat>
-void check_sparse_determinant(Solver& solver, const typename Solver::MatrixType& A, const DenseMat& dA)
-{
+template <typename Solver, typename DenseMat>
+void check_sparse_determinant(Solver& solver, const typename Solver::MatrixType& A, const DenseMat& dA) {
   typedef typename Solver::MatrixType Mat;
   typedef typename Mat::Scalar Scalar;
-  
+
   solver.compute(A);
-  if (solver.info() != Success)
-  {
+  if (solver.info() != Success) {
     std::cerr << "WARNING | sparse solver testing: factorization failed (check_sparse_determinant)\n";
     return;
   }
 
   Scalar refDet = dA.determinant();
-  VERIFY_IS_APPROX(refDet,solver.determinant());
+  VERIFY_IS_APPROX(refDet, solver.determinant());
 }
-template<typename Solver, typename DenseMat>
-void check_sparse_abs_determinant(Solver& solver, const typename Solver::MatrixType& A, const DenseMat& dA)
-{
+template <typename Solver, typename DenseMat>
+void check_sparse_abs_determinant(Solver& solver, const typename Solver::MatrixType& A, const DenseMat& dA) {
   using std::abs;
   typedef typename Solver::MatrixType Mat;
   typedef typename Mat::Scalar Scalar;
-  
+
   solver.compute(A);
-  if (solver.info() != Success)
-  {
+  if (solver.info() != Success) {
     std::cerr << "WARNING | sparse solver testing: factorization failed (check_sparse_abs_determinant)\n";
     return;
   }
 
   Scalar refDet = abs(dA.determinant());
-  VERIFY_IS_APPROX(refDet,solver.absDeterminant());
+  VERIFY_IS_APPROX(refDet, solver.absDeterminant());
 }
 
-template<typename Solver, typename DenseMat>
-int generate_sparse_spd_problem(Solver& , typename Solver::MatrixType& A, typename Solver::MatrixType& halfA, DenseMat& dA, int maxSize = 300)
-{
+template <typename Solver, typename DenseMat>
+int generate_sparse_spd_problem(Solver&, typename Solver::MatrixType& A, typename Solver::MatrixType& halfA,
+                                DenseMat& dA, int maxSize = 300) {
   typedef typename Solver::MatrixType Mat;
   typedef typename Mat::Scalar Scalar;
-  typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrix;
+  typedef Matrix<Scalar, Dynamic, Dynamic> DenseMatrix;
 
-  int size = internal::random<int>(1,maxSize);
-  double density = (std::max)(8./static_cast<double>(size*size), 0.01);
+  int size = internal::random<int>(1, maxSize);
+  double density = (std::max)(8. / static_cast<double>(size * size), 0.01);
 
   Mat M(size, size);
   DenseMatrix dM(size, size);
@@ -366,57 +351,53 @@
 
   A = M * M.adjoint();
   dA = dM * dM.adjoint();
-  
-  halfA.resize(size,size);
-  if(Solver::UpLo==(Lower|Upper))
+
+  halfA.resize(size, size);
+  if (Solver::UpLo == (Lower | Upper))
     halfA = A;
   else
     halfA.template selfadjointView<Solver::UpLo>().rankUpdate(M);
-  
+
   return size;
 }
 
-
 #ifdef TEST_REAL_CASES
-template<typename Scalar>
-inline std::string get_matrixfolder()
-{
-  std::string mat_folder = TEST_REAL_CASES; 
-  if( internal::is_same<Scalar, std::complex<float> >::value || internal::is_same<Scalar, std::complex<double> >::value )
-    mat_folder  = mat_folder + static_cast<std::string>("/complex/");
+template <typename Scalar>
+inline std::string get_matrixfolder() {
+  std::string mat_folder = TEST_REAL_CASES;
+  if (internal::is_same<Scalar, std::complex<float>>::value || internal::is_same<Scalar, std::complex<double>>::value)
+    mat_folder = mat_folder + static_cast<std::string>("/complex/");
   else
     mat_folder = mat_folder + static_cast<std::string>("/real/");
   return mat_folder;
 }
-std::string sym_to_string(int sym)
-{
-  if(sym==Symmetric) return "Symmetric ";
-  if(sym==SPD)       return "SPD ";
+std::string sym_to_string(int sym) {
+  if (sym == Symmetric) return "Symmetric ";
+  if (sym == SPD) return "SPD ";
   return "";
 }
-template<typename Derived>
-std::string solver_stats(const IterativeSolverBase<Derived> &solver)
-{
+template <typename Derived>
+std::string solver_stats(const IterativeSolverBase<Derived>& solver) {
   std::stringstream ss;
   ss << solver.iterations() << " iters, error: " << solver.error();
   return ss.str();
 }
-template<typename Derived>
-std::string solver_stats(const SparseSolverBase<Derived> &/*solver*/)
-{
+template <typename Derived>
+std::string solver_stats(const SparseSolverBase<Derived>& /*solver*/) {
   return "";
 }
 #endif
 
-template<typename Solver> void check_sparse_spd_solving(Solver& solver, int maxSize = (std::min)(300,EIGEN_TEST_MAX_SIZE), int maxRealWorldSize = 100000)
-{
+template <typename Solver>
+void check_sparse_spd_solving(Solver& solver, int maxSize = (std::min)(300, EIGEN_TEST_MAX_SIZE),
+                              int maxRealWorldSize = 100000) {
   typedef typename Solver::MatrixType Mat;
   typedef typename Mat::Scalar Scalar;
   typedef typename Mat::StorageIndex StorageIndex;
-  typedef SparseMatrix<Scalar,ColMajor, StorageIndex> SpMat;
+  typedef SparseMatrix<Scalar, ColMajor, StorageIndex> SpMat;
   typedef SparseVector<Scalar, 0, StorageIndex> SpVec;
-  typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrix;
-  typedef Matrix<Scalar,Dynamic,1> DenseVector;
+  typedef Matrix<Scalar, Dynamic, Dynamic> DenseMatrix;
+  typedef Matrix<Scalar, Dynamic, 1> DenseVector;
 
   // generate the problem
   Mat A, halfA;
@@ -425,64 +406,57 @@
     int size = generate_sparse_spd_problem(solver, A, halfA, dA, maxSize);
 
     // generate the right hand sides
-    int rhsCols = internal::random<int>(1,16);
-    double density = (std::max)(8./static_cast<double>(size*rhsCols), 0.1);
-    SpMat B(size,rhsCols);
+    int rhsCols = internal::random<int>(1, 16);
+    double density = (std::max)(8. / static_cast<double>(size * rhsCols), 0.1);
+    SpMat B(size, rhsCols);
     DenseVector b = DenseVector::Random(size);
-    DenseMatrix dB(size,rhsCols);
+    DenseMatrix dB(size, rhsCols);
     initSparse<Scalar>(density, dB, B, ForceNonZeroDiag);
     SpVec c = B.col(0);
     DenseVector dc = dB.col(0);
-  
-    CALL_SUBTEST( check_sparse_solving(solver, A,     b,  dA, b)  );
-    CALL_SUBTEST( check_sparse_solving(solver, halfA, b,  dA, b)  );
-    CALL_SUBTEST( check_sparse_solving(solver, A,     dB, dA, dB) );
-    CALL_SUBTEST( check_sparse_solving(solver, halfA, dB, dA, dB) );
-    CALL_SUBTEST( check_sparse_solving(solver, A,     B,  dA, dB) );
-    CALL_SUBTEST( check_sparse_solving(solver, halfA, B,  dA, dB) );
-    CALL_SUBTEST( check_sparse_solving(solver, A,     c,  dA, dc) );
-    CALL_SUBTEST( check_sparse_solving(solver, halfA, c,  dA, dc) );
-    
+
+    CALL_SUBTEST(check_sparse_solving(solver, A, b, dA, b));
+    CALL_SUBTEST(check_sparse_solving(solver, halfA, b, dA, b));
+    CALL_SUBTEST(check_sparse_solving(solver, A, dB, dA, dB));
+    CALL_SUBTEST(check_sparse_solving(solver, halfA, dB, dA, dB));
+    CALL_SUBTEST(check_sparse_solving(solver, A, B, dA, dB));
+    CALL_SUBTEST(check_sparse_solving(solver, halfA, B, dA, dB));
+    CALL_SUBTEST(check_sparse_solving(solver, A, c, dA, dc));
+    CALL_SUBTEST(check_sparse_solving(solver, halfA, c, dA, dc));
+
     // check only once
-    if(i==0)
-    {
+    if (i == 0) {
       b = DenseVector::Zero(size);
       check_sparse_solving(solver, A, b, dA, b);
     }
   }
-  
-  // First, get the folder 
+
+  // First, get the folder
 #ifdef TEST_REAL_CASES
   // Test real problems with double precision only
-  if (internal::is_same<typename NumTraits<Scalar>::Real, double>::value)
-  {
+  if (internal::is_same<typename NumTraits<Scalar>::Real, double>::value) {
     std::string mat_folder = get_matrixfolder<Scalar>();
     MatrixMarketIterator<Scalar> it(mat_folder);
-    for (; it; ++it)
-    {
-      if (it.sym() == SPD){
+    for (; it; ++it) {
+      if (it.sym() == SPD) {
         A = it.matrix();
-        if(A.diagonal().size() <= maxRealWorldSize)
-        {
+        if (A.diagonal().size() <= maxRealWorldSize) {
           DenseVector b = it.rhs();
           DenseVector refX = it.refX();
           PermutationMatrix<Dynamic, Dynamic, StorageIndex> pnull;
           halfA.resize(A.rows(), A.cols());
-          if(Solver::UpLo == (Lower|Upper))
+          if (Solver::UpLo == (Lower | Upper))
             halfA = A;
           else
             halfA.template selfadjointView<Solver::UpLo>() = A.template triangularView<Eigen::Lower>().twistedBy(pnull);
-          
-          std::cout << "INFO | Testing " << sym_to_string(it.sym()) << "sparse problem " << it.matname()
-                  << " (" << A.rows() << "x" << A.cols() << ") using " << typeid(Solver).name() << "..." << std::endl;
-          CALL_SUBTEST( check_sparse_solving_real_cases(solver, A,     b, A, refX) );
+
+          std::cout << "INFO | Testing " << sym_to_string(it.sym()) << "sparse problem " << it.matname() << " ("
+                    << A.rows() << "x" << A.cols() << ") using " << typeid(Solver).name() << "..." << std::endl;
+          CALL_SUBTEST(check_sparse_solving_real_cases(solver, A, b, A, refX));
           std::string stats = solver_stats(solver);
-          if(stats.size()>0)
-            std::cout << "INFO |  " << stats << std::endl;
-          CALL_SUBTEST( check_sparse_solving_real_cases(solver, halfA, b, A, refX) );
-        }
-        else
-        {
+          if (stats.size() > 0) std::cout << "INFO |  " << stats << std::endl;
+          CALL_SUBTEST(check_sparse_solving_real_cases(solver, halfA, b, A, refX));
+        } else {
           std::cout << "INFO | Skip sparse problem \"" << it.matname() << "\" (too large)" << std::endl;
         }
       }
@@ -493,61 +467,60 @@
 #endif
 }
 
-template<typename Solver> void check_sparse_spd_determinant(Solver& solver)
-{
+template <typename Solver>
+void check_sparse_spd_determinant(Solver& solver) {
   typedef typename Solver::MatrixType Mat;
   typedef typename Mat::Scalar Scalar;
-  typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrix;
+  typedef Matrix<Scalar, Dynamic, Dynamic> DenseMatrix;
 
   // generate the problem
   Mat A, halfA;
   DenseMatrix dA;
   generate_sparse_spd_problem(solver, A, halfA, dA, 30);
-  
+
   for (int i = 0; i < g_repeat; i++) {
-    check_sparse_determinant(solver, A,     dA);
-    check_sparse_determinant(solver, halfA, dA );
+    check_sparse_determinant(solver, A, dA);
+    check_sparse_determinant(solver, halfA, dA);
   }
 }
 
-template<typename Solver, typename DenseMat>
-Index generate_sparse_square_problem(Solver&, typename Solver::MatrixType& A, DenseMat& dA, int maxSize = 300, int options = ForceNonZeroDiag)
-{
+template <typename Solver, typename DenseMat>
+Index generate_sparse_square_problem(Solver&, typename Solver::MatrixType& A, DenseMat& dA, int maxSize = 300,
+                                     int options = ForceNonZeroDiag) {
   typedef typename Solver::MatrixType Mat;
   typedef typename Mat::Scalar Scalar;
 
-  Index size = internal::random<int>(1,maxSize);
-  double density = (std::max)(8./static_cast<double>(size*size), 0.01);
-  
-  A.resize(size,size);
-  dA.resize(size,size);
+  Index size = internal::random<int>(1, maxSize);
+  double density = (std::max)(8. / static_cast<double>(size * size), 0.01);
+
+  A.resize(size, size);
+  dA.resize(size, size);
 
   initSparse<Scalar>(density, dA, A, options);
-  
+
   return size;
 }
 
-
 struct prune_column {
   Index m_col;
   prune_column(Index col) : m_col(col) {}
-  template<class Scalar>
+  template <class Scalar>
   bool operator()(Index, Index col, const Scalar&) const {
     return col != m_col;
   }
 };
 
-
-template<typename Solver> void check_sparse_square_solving(Solver& solver, int maxSize = 300, int maxRealWorldSize = 100000, bool checkDeficient = false)
-{
+template <typename Solver>
+void check_sparse_square_solving(Solver& solver, int maxSize = 300, int maxRealWorldSize = 100000,
+                                 bool checkDeficient = false) {
   typedef typename Solver::MatrixType Mat;
   typedef typename Mat::Scalar Scalar;
-  typedef SparseMatrix<Scalar,ColMajor, typename Mat::StorageIndex> SpMat;
+  typedef SparseMatrix<Scalar, ColMajor, typename Mat::StorageIndex> SpMat;
   typedef SparseVector<Scalar, 0, typename Mat::StorageIndex> SpVec;
-  typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrix;
-  typedef Matrix<Scalar,Dynamic,1> DenseVector;
+  typedef Matrix<Scalar, Dynamic, Dynamic> DenseMatrix;
+  typedef Matrix<Scalar, Dynamic, 1> DenseVector;
 
-  int rhsCols = internal::random<int>(1,16);
+  int rhsCols = internal::random<int>(1, 16);
 
   Mat A;
   DenseMatrix dA;
@@ -556,55 +529,48 @@
 
     A.makeCompressed();
     DenseVector b = DenseVector::Random(size);
-    DenseMatrix dB(size,rhsCols);
-    SpMat B(size,rhsCols);
-    double density = (std::max)(8./double(size*rhsCols), 0.1);
+    DenseMatrix dB(size, rhsCols);
+    SpMat B(size, rhsCols);
+    double density = (std::max)(8. / double(size * rhsCols), 0.1);
     initSparse<Scalar>(density, dB, B, ForceNonZeroDiag);
     B.makeCompressed();
     SpVec c = B.col(0);
     DenseVector dc = dB.col(0);
-    CALL_SUBTEST(check_sparse_solving(solver, A, b,  dA, b));
+    CALL_SUBTEST(check_sparse_solving(solver, A, b, dA, b));
     CALL_SUBTEST(check_sparse_solving(solver, A, dB, dA, dB));
-    CALL_SUBTEST(check_sparse_solving(solver, A, B,  dA, dB));
-    CALL_SUBTEST(check_sparse_solving(solver, A, c,  dA, dc));
-    
+    CALL_SUBTEST(check_sparse_solving(solver, A, B, dA, dB));
+    CALL_SUBTEST(check_sparse_solving(solver, A, c, dA, dc));
+
     // check only once
-    if(i==0)
-    {
+    if (i == 0) {
       CALL_SUBTEST(b = DenseVector::Zero(size); check_sparse_solving(solver, A, b, dA, b));
     }
     // regression test for Bug 792 (structurally rank deficient matrices):
-    if(checkDeficient && size>1) {
-      Index col = internal::random<int>(0,int(size-1));
+    if (checkDeficient && size > 1) {
+      Index col = internal::random<int>(0, int(size - 1));
       A.prune(prune_column(col));
       solver.compute(A);
       VERIFY_IS_EQUAL(solver.info(), NumericalIssue);
     }
   }
-  
-  // First, get the folder 
+
+  // First, get the folder
 #ifdef TEST_REAL_CASES
   // Test real problems with double precision only
-  if (internal::is_same<typename NumTraits<Scalar>::Real, double>::value)
-  {
+  if (internal::is_same<typename NumTraits<Scalar>::Real, double>::value) {
     std::string mat_folder = get_matrixfolder<Scalar>();
     MatrixMarketIterator<Scalar> it(mat_folder);
-    for (; it; ++it)
-    {
+    for (; it; ++it) {
       A = it.matrix();
-      if(A.diagonal().size() <= maxRealWorldSize)
-      {
+      if (A.diagonal().size() <= maxRealWorldSize) {
         DenseVector b = it.rhs();
         DenseVector refX = it.refX();
-        std::cout << "INFO | Testing " << sym_to_string(it.sym()) << "sparse problem " << it.matname()
-                  << " (" << A.rows() << "x" << A.cols() << ") using " << typeid(Solver).name() << "..." << std::endl;
+        std::cout << "INFO | Testing " << sym_to_string(it.sym()) << "sparse problem " << it.matname() << " ("
+                  << A.rows() << "x" << A.cols() << ") using " << typeid(Solver).name() << "..." << std::endl;
         CALL_SUBTEST(check_sparse_solving_real_cases(solver, A, b, A, refX));
         std::string stats = solver_stats(solver);
-        if(stats.size()>0)
-          std::cout << "INFO |  " << stats << std::endl;
-      }
-      else
-      {
+        if (stats.size() > 0) std::cout << "INFO |  " << stats << std::endl;
+      } else {
         std::cout << "INFO | SKIP sparse problem \"" << it.matname() << "\" (too large)" << std::endl;
       }
     }
@@ -612,37 +578,36 @@
 #else
   EIGEN_UNUSED_VARIABLE(maxRealWorldSize);
 #endif
-
 }
 
-template<typename Solver> void check_sparse_square_determinant(Solver& solver)
-{
+template <typename Solver>
+void check_sparse_square_determinant(Solver& solver) {
   typedef typename Solver::MatrixType Mat;
   typedef typename Mat::Scalar Scalar;
-  typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrix;
-  
+  typedef Matrix<Scalar, Dynamic, Dynamic> DenseMatrix;
+
   for (int i = 0; i < g_repeat; i++) {
     // generate the problem
     Mat A;
     DenseMatrix dA;
-    
-    int size = internal::random<int>(1,30);
-    dA.setRandom(size,size);
-    
-    dA = (dA.array().abs()<0.3).select(0,dA);
-    dA.diagonal() = (dA.diagonal().array()==0).select(1,dA.diagonal());
+
+    int size = internal::random<int>(1, 30);
+    dA.setRandom(size, size);
+
+    dA = (dA.array().abs() < 0.3).select(0, dA);
+    dA.diagonal() = (dA.diagonal().array() == 0).select(1, dA.diagonal());
     A = dA.sparseView();
     A.makeCompressed();
-  
+
     check_sparse_determinant(solver, A, dA);
   }
 }
 
-template<typename Solver> void check_sparse_square_abs_determinant(Solver& solver)
-{
+template <typename Solver>
+void check_sparse_square_abs_determinant(Solver& solver) {
   typedef typename Solver::MatrixType Mat;
   typedef typename Mat::Scalar Scalar;
-  typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrix;
+  typedef Matrix<Scalar, Dynamic, Dynamic> DenseMatrix;
 
   for (int i = 0; i < g_repeat; i++) {
     // generate the problem
@@ -654,31 +619,31 @@
   }
 }
 
-template<typename Solver, typename DenseMat>
-void generate_sparse_leastsquare_problem(Solver&, typename Solver::MatrixType& A, DenseMat& dA, int maxSize = 300, int options = ForceNonZeroDiag)
-{
+template <typename Solver, typename DenseMat>
+void generate_sparse_leastsquare_problem(Solver&, typename Solver::MatrixType& A, DenseMat& dA, int maxSize = 300,
+                                         int options = ForceNonZeroDiag) {
   typedef typename Solver::MatrixType Mat;
   typedef typename Mat::Scalar Scalar;
 
-  int rows = internal::random<int>(1,maxSize);
-  int cols = internal::random<int>(1,rows);
-  double density = (std::max)(8./(rows*cols), 0.01);
-  
-  A.resize(rows,cols);
-  dA.resize(rows,cols);
+  int rows = internal::random<int>(1, maxSize);
+  int cols = internal::random<int>(1, rows);
+  double density = (std::max)(8. / (rows * cols), 0.01);
+
+  A.resize(rows, cols);
+  dA.resize(rows, cols);
 
   initSparse<Scalar>(density, dA, A, options);
 }
 
-template<typename Solver> void check_sparse_leastsquare_solving(Solver& solver)
-{
+template <typename Solver>
+void check_sparse_leastsquare_solving(Solver& solver) {
   typedef typename Solver::MatrixType Mat;
   typedef typename Mat::Scalar Scalar;
-  typedef SparseMatrix<Scalar,ColMajor, typename Mat::StorageIndex> SpMat;
-  typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrix;
-  typedef Matrix<Scalar,Dynamic,1> DenseVector;
+  typedef SparseMatrix<Scalar, ColMajor, typename Mat::StorageIndex> SpMat;
+  typedef Matrix<Scalar, Dynamic, Dynamic> DenseMatrix;
+  typedef Matrix<Scalar, Dynamic, 1> DenseVector;
 
-  int rhsCols = internal::random<int>(1,16);
+  int rhsCols = internal::random<int>(1, 16);
 
   Mat A;
   DenseMatrix dA;
@@ -687,18 +652,17 @@
 
     A.makeCompressed();
     DenseVector b = DenseVector::Random(A.rows());
-    DenseMatrix dB(A.rows(),rhsCols);
-    SpMat B(A.rows(),rhsCols);
-    double density = (std::max)(8./(A.rows()*rhsCols), 0.1);
+    DenseMatrix dB(A.rows(), rhsCols);
+    SpMat B(A.rows(), rhsCols);
+    double density = (std::max)(8. / (A.rows() * rhsCols), 0.1);
     initSparse<Scalar>(density, dB, B, ForceNonZeroDiag);
     B.makeCompressed();
-    check_sparse_solving(solver, A, b,  dA, b);
+    check_sparse_solving(solver, A, b, dA, b);
     check_sparse_solving(solver, A, dB, dA, dB);
-    check_sparse_solving(solver, A, B,  dA, dB);
-    
+    check_sparse_solving(solver, A, B, dA, dB);
+
     // check only once
-    if(i==0)
-    {
+    if (i == 0) {
       b = DenseVector::Zero(A.rows());
       check_sparse_solving(solver, A, b, dA, b);
     }
diff --git a/test/sparse_solvers.cpp b/test/sparse_solvers.cpp
index 1f4948a..199dfff 100644
--- a/test/sparse_solvers.cpp
+++ b/test/sparse_solvers.cpp
@@ -9,32 +9,27 @@
 
 #include "sparse.h"
 
-template<typename Scalar> void
-initSPD(double density,
-        Matrix<Scalar,Dynamic,Dynamic>& refMat,
-        SparseMatrix<Scalar>& sparseMat)
-{
-  Matrix<Scalar,Dynamic,Dynamic> aux(refMat.rows(),refMat.cols());
-  initSparse(density,refMat,sparseMat);
+template <typename Scalar>
+void initSPD(double density, Matrix<Scalar, Dynamic, Dynamic>& refMat, SparseMatrix<Scalar>& sparseMat) {
+  Matrix<Scalar, Dynamic, Dynamic> aux(refMat.rows(), refMat.cols());
+  initSparse(density, refMat, sparseMat);
   refMat = refMat * refMat.adjoint();
-  for (int k=0; k<2; ++k)
-  {
-    initSparse(density,aux,sparseMat,ForceNonZeroDiag);
+  for (int k = 0; k < 2; ++k) {
+    initSparse(density, aux, sparseMat, ForceNonZeroDiag);
     refMat += aux * aux.adjoint();
   }
   sparseMat.setZero();
-  for (int j=0 ; j<sparseMat.cols(); ++j)
-    for (int i=j ; i<sparseMat.rows(); ++i)
-      if (refMat(i,j)!=Scalar(0))
-        sparseMat.insert(i,j) = refMat(i,j);
+  for (int j = 0; j < sparseMat.cols(); ++j)
+    for (int i = j; i < sparseMat.rows(); ++i)
+      if (refMat(i, j) != Scalar(0)) sparseMat.insert(i, j) = refMat(i, j);
   sparseMat.finalize();
 }
 
-template<typename Scalar> void sparse_solvers(int rows, int cols)
-{
-  double density = (std::max)(8./(rows*cols), 0.01);
-  typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrix;
-  typedef Matrix<Scalar,Dynamic,1> DenseVector;
+template <typename Scalar>
+void sparse_solvers(int rows, int cols) {
+  double density = (std::max)(8. / (rows * cols), 0.01);
+  typedef Matrix<Scalar, Dynamic, Dynamic> DenseMatrix;
+  typedef Matrix<Scalar, Dynamic, 1> DenseVector;
   // Scalar eps = 1e-6;
 
   DenseVector vec1 = DenseVector::Random(rows);
@@ -49,31 +44,32 @@
     DenseMatrix refMat2 = DenseMatrix::Zero(rows, cols);
 
     // lower - dense
-    initSparse<Scalar>(density, refMat2, m2, ForceNonZeroDiag|MakeLowerTriangular, &zeroCoords, &nonzeroCoords);
+    initSparse<Scalar>(density, refMat2, m2, ForceNonZeroDiag | MakeLowerTriangular, &zeroCoords, &nonzeroCoords);
     VERIFY_IS_APPROX(refMat2.template triangularView<Lower>().solve(vec2),
                      m2.template triangularView<Lower>().solve(vec3));
 
     // upper - dense
-    initSparse<Scalar>(density, refMat2, m2, ForceNonZeroDiag|MakeUpperTriangular, &zeroCoords, &nonzeroCoords);
+    initSparse<Scalar>(density, refMat2, m2, ForceNonZeroDiag | MakeUpperTriangular, &zeroCoords, &nonzeroCoords);
     VERIFY_IS_APPROX(refMat2.template triangularView<Upper>().solve(vec2),
                      m2.template triangularView<Upper>().solve(vec3));
     VERIFY_IS_APPROX(refMat2.conjugate().template triangularView<Upper>().solve(vec2),
                      m2.conjugate().template triangularView<Upper>().solve(vec3));
     {
       SparseMatrix<Scalar> cm2(m2);
-      //Index rows, Index cols, Index nnz, Index* outerIndexPtr, Index* innerIndexPtr, Scalar* valuePtr
-      Map<SparseMatrix<Scalar> > mm2(rows, cols, cm2.nonZeros(), cm2.outerIndexPtr(), cm2.innerIndexPtr(), cm2.valuePtr());
+      // Index rows, Index cols, Index nnz, Index* outerIndexPtr, Index* innerIndexPtr, Scalar* valuePtr
+      Map<SparseMatrix<Scalar> > mm2(rows, cols, cm2.nonZeros(), cm2.outerIndexPtr(), cm2.innerIndexPtr(),
+                                     cm2.valuePtr());
       VERIFY_IS_APPROX(refMat2.conjugate().template triangularView<Upper>().solve(vec2),
                        mm2.conjugate().template triangularView<Upper>().solve(vec3));
     }
 
     // lower - transpose
-    initSparse<Scalar>(density, refMat2, m2, ForceNonZeroDiag|MakeLowerTriangular, &zeroCoords, &nonzeroCoords);
+    initSparse<Scalar>(density, refMat2, m2, ForceNonZeroDiag | MakeLowerTriangular, &zeroCoords, &nonzeroCoords);
     VERIFY_IS_APPROX(refMat2.transpose().template triangularView<Upper>().solve(vec2),
                      m2.transpose().template triangularView<Upper>().solve(vec3));
 
     // upper - transpose
-    initSparse<Scalar>(density, refMat2, m2, ForceNonZeroDiag|MakeUpperTriangular, &zeroCoords, &nonzeroCoords);
+    initSparse<Scalar>(density, refMat2, m2, ForceNonZeroDiag | MakeUpperTriangular, &zeroCoords, &nonzeroCoords);
     VERIFY_IS_APPROX(refMat2.transpose().template triangularView<Lower>().solve(vec2),
                      m2.transpose().template triangularView<Lower>().solve(vec3));
 
@@ -81,45 +77,44 @@
     DenseMatrix refMatB = DenseMatrix::Zero(rows, rows);
 
     // lower - sparse
-    initSparse<Scalar>(density, refMat2, m2, ForceNonZeroDiag|MakeLowerTriangular);
+    initSparse<Scalar>(density, refMat2, m2, ForceNonZeroDiag | MakeLowerTriangular);
     initSparse<Scalar>(density, refMatB, matB);
     refMat2.template triangularView<Lower>().solveInPlace(refMatB);
     m2.template triangularView<Lower>().solveInPlace(matB);
     VERIFY_IS_APPROX(matB.toDense(), refMatB);
 
     // upper - sparse
-    initSparse<Scalar>(density, refMat2, m2, ForceNonZeroDiag|MakeUpperTriangular);
+    initSparse<Scalar>(density, refMat2, m2, ForceNonZeroDiag | MakeUpperTriangular);
     initSparse<Scalar>(density, refMatB, matB);
     refMat2.template triangularView<Upper>().solveInPlace(refMatB);
     m2.template triangularView<Upper>().solveInPlace(matB);
     VERIFY_IS_APPROX(matB, refMatB);
 
     // test deprecated API
-    initSparse<Scalar>(density, refMat2, m2, ForceNonZeroDiag|MakeLowerTriangular, &zeroCoords, &nonzeroCoords);
+    initSparse<Scalar>(density, refMat2, m2, ForceNonZeroDiag | MakeLowerTriangular, &zeroCoords, &nonzeroCoords);
     VERIFY_IS_APPROX(refMat2.template triangularView<Lower>().solve(vec2),
                      m2.template triangularView<Lower>().solve(vec3));
 
     // test empty triangular matrix
     {
-      m2.resize(0,0);
-      refMatB.resize(0,refMatB.cols());
+      m2.resize(0, 0);
+      refMatB.resize(0, refMatB.cols());
       DenseMatrix res = m2.template triangularView<Lower>().solve(refMatB);
-      VERIFY_IS_EQUAL(res.rows(),0);
-      VERIFY_IS_EQUAL(res.cols(),refMatB.cols());
+      VERIFY_IS_EQUAL(res.rows(), 0);
+      VERIFY_IS_EQUAL(res.cols(), refMatB.cols());
       res = refMatB;
       m2.template triangularView<Lower>().solveInPlace(res);
-      VERIFY_IS_EQUAL(res.rows(),0);
-      VERIFY_IS_EQUAL(res.cols(),refMatB.cols());
+      VERIFY_IS_EQUAL(res.rows(), 0);
+      VERIFY_IS_EQUAL(res.cols(), refMatB.cols());
     }
   }
 }
 
-EIGEN_DECLARE_TEST(sparse_solvers)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1(sparse_solvers<double>(8, 8) );
-    int s = internal::random<int>(1,300);
-    CALL_SUBTEST_2(sparse_solvers<std::complex<double> >(s,s) );
-    CALL_SUBTEST_1(sparse_solvers<double>(s,s) );
+EIGEN_DECLARE_TEST(sparse_solvers) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(sparse_solvers<double>(8, 8));
+    int s = internal::random<int>(1, 300);
+    CALL_SUBTEST_2(sparse_solvers<std::complex<double> >(s, s));
+    CALL_SUBTEST_1(sparse_solvers<double>(s, s));
   }
 }
diff --git a/test/sparse_vector.cpp b/test/sparse_vector.cpp
index 0f99879..83ad324 100644
--- a/test/sparse_vector.cpp
+++ b/test/sparse_vector.cpp
@@ -9,23 +9,21 @@
 
 #include "sparse.h"
 
-template<typename Scalar,typename StorageIndex> void sparse_vector(int rows, int cols)
-{
-  double densityMat = (std::max)(8./(rows*cols), 0.01);
-  double densityVec = (std::max)(8./(rows), 0.1);
-  typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrix;
-  typedef Matrix<Scalar,Dynamic,1> DenseVector;
-  typedef Matrix<DenseIndex,Dynamic,1> DenseIndexVector;
-  typedef SparseVector<Scalar,0,StorageIndex> SparseVectorType;
-  typedef SparseMatrix<Scalar,0,StorageIndex> SparseMatrixType;
+template <typename Scalar, typename StorageIndex>
+void sparse_vector(int rows, int cols) {
+  double densityMat = (std::max)(8. / (rows * cols), 0.01);
+  double densityVec = (std::max)(8. / (rows), 0.1);
+  typedef Matrix<Scalar, Dynamic, Dynamic> DenseMatrix;
+  typedef Matrix<Scalar, Dynamic, 1> DenseVector;
+  typedef Matrix<DenseIndex, Dynamic, 1> DenseIndexVector;
+  typedef SparseVector<Scalar, 0, StorageIndex> SparseVectorType;
+  typedef SparseMatrix<Scalar, 0, StorageIndex> SparseMatrixType;
   Scalar eps = 1e-6;
 
-  SparseMatrixType m1(rows,rows);
+  SparseMatrixType m1(rows, rows);
   SparseVectorType v1(rows), v2(rows), v3(rows);
   DenseMatrix refM1 = DenseMatrix::Zero(rows, rows);
-  DenseVector refV1 = DenseVector::Random(rows),
-              refV2 = DenseVector::Random(rows),
-              refV3 = DenseVector::Random(rows);
+  DenseVector refV1 = DenseVector::Random(rows), refV2 = DenseVector::Random(rows), refV3 = DenseVector::Random(rows);
 
   std::vector<int> zerocoords, nonzerocoords;
   initSparse<Scalar>(densityVec, refV1, v1, &zerocoords, &nonzerocoords);
@@ -37,116 +35,109 @@
   Scalar s1 = internal::random<Scalar>();
 
   // test coeff and coeffRef
-  for (unsigned int i=0; i<zerocoords.size(); ++i)
-  {
-    VERIFY_IS_MUCH_SMALLER_THAN( v1.coeff(zerocoords[i]), eps );
-    //VERIFY_RAISES_ASSERT( v1.coeffRef(zerocoords[i]) = 5 );
+  for (unsigned int i = 0; i < zerocoords.size(); ++i) {
+    VERIFY_IS_MUCH_SMALLER_THAN(v1.coeff(zerocoords[i]), eps);
+    // VERIFY_RAISES_ASSERT( v1.coeffRef(zerocoords[i]) = 5 );
   }
   {
     VERIFY(int(nonzerocoords.size()) == v1.nonZeros());
-    int j=0;
-    for (typename SparseVectorType::InnerIterator it(v1); it; ++it,++j)
-    {
-      VERIFY(nonzerocoords[j]==it.index());
+    int j = 0;
+    for (typename SparseVectorType::InnerIterator it(v1); it; ++it, ++j) {
+      VERIFY(nonzerocoords[j] == it.index());
       VERIFY_IS_EQUAL(it.value(), v1.coeff(it.index()));
       VERIFY_IS_EQUAL(it.value(), refV1.coeff(it.index()));
     }
   }
   VERIFY_IS_APPROX(v1, refV1);
-  
+
   // test coeffRef with reallocation
   {
     SparseVectorType v4(rows);
     DenseVector v5 = DenseVector::Zero(rows);
-    for(int k=0; k<rows; ++k)
-    {
-      int i = internal::random<int>(0,rows-1);
+    for (int k = 0; k < rows; ++k) {
+      int i = internal::random<int>(0, rows - 1);
       Scalar v = internal::random<Scalar>();
       v4.coeffRef(i) += v;
       v5.coeffRef(i) += v;
     }
-    VERIFY_IS_APPROX(v4,v5);
+    VERIFY_IS_APPROX(v4, v5);
   }
 
   v1.coeffRef(nonzerocoords[0]) = Scalar(5);
   refV1.coeffRef(nonzerocoords[0]) = Scalar(5);
   VERIFY_IS_APPROX(v1, refV1);
 
-  VERIFY_IS_APPROX(v1+v2, refV1+refV2);
-  VERIFY_IS_APPROX(v1+v2+v3, refV1+refV2+refV3);
+  VERIFY_IS_APPROX(v1 + v2, refV1 + refV2);
+  VERIFY_IS_APPROX(v1 + v2 + v3, refV1 + refV2 + refV3);
 
-  VERIFY_IS_APPROX(v1*s1-v2, refV1*s1-refV2);
+  VERIFY_IS_APPROX(v1 * s1 - v2, refV1 * s1 - refV2);
 
-  VERIFY_IS_APPROX(v1*=s1, refV1*=s1);
-  VERIFY_IS_APPROX(v1/=s1, refV1/=s1);
+  VERIFY_IS_APPROX(v1 *= s1, refV1 *= s1);
+  VERIFY_IS_APPROX(v1 /= s1, refV1 /= s1);
 
-  VERIFY_IS_APPROX(v1+=v2, refV1+=refV2);
-  VERIFY_IS_APPROX(v1-=v2, refV1-=refV2);
+  VERIFY_IS_APPROX(v1 += v2, refV1 += refV2);
+  VERIFY_IS_APPROX(v1 -= v2, refV1 -= refV2);
 
   VERIFY_IS_APPROX(v1.dot(v2), refV1.dot(refV2));
   VERIFY_IS_APPROX(v1.dot(refV2), refV1.dot(refV2));
 
-  VERIFY_IS_APPROX(m1*v2, refM1*refV2);
-  VERIFY_IS_APPROX(v1.dot(m1*v2), refV1.dot(refM1*refV2));
+  VERIFY_IS_APPROX(m1 * v2, refM1 * refV2);
+  VERIFY_IS_APPROX(v1.dot(m1 * v2), refV1.dot(refM1 * refV2));
   {
-    int i = internal::random<int>(0,rows-1);
+    int i = internal::random<int>(0, rows - 1);
     VERIFY_IS_APPROX(v1.dot(m1.col(i)), refV1.dot(refM1.col(i)));
   }
 
-
   VERIFY_IS_APPROX(v1.squaredNorm(), refV1.squaredNorm());
-  
+
   VERIFY_IS_APPROX(v1.blueNorm(), refV1.blueNorm());
 
   // test aliasing
   VERIFY_IS_APPROX((v1 = -v1), (refV1 = -refV1));
   VERIFY_IS_APPROX((v1 = v1.transpose()), (refV1 = refV1.transpose().eval()));
   VERIFY_IS_APPROX((v1 += -v1), (refV1 += -refV1));
-  
+
   // sparse matrix to sparse vector
   SparseMatrixType mv1;
-  VERIFY_IS_APPROX((mv1=v1),v1);
-  VERIFY_IS_APPROX(mv1,(v1=mv1));
-  VERIFY_IS_APPROX(mv1,(v1=mv1.transpose()));
-  
+  VERIFY_IS_APPROX((mv1 = v1), v1);
+  VERIFY_IS_APPROX(mv1, (v1 = mv1));
+  VERIFY_IS_APPROX(mv1, (v1 = mv1.transpose()));
+
   // check copy to dense vector with transpose
   refV3.resize(0);
-  VERIFY_IS_APPROX(refV3 = v1.transpose(),v1.toDense()); 
-  VERIFY_IS_APPROX(DenseVector(v1),v1.toDense());
+  VERIFY_IS_APPROX(refV3 = v1.transpose(), v1.toDense());
+  VERIFY_IS_APPROX(DenseVector(v1), v1.toDense());
 
   // test conservative resize
   {
     std::vector<StorageIndex> inc;
-    if(rows > 3)
-      inc.push_back(-3);
+    if (rows > 3) inc.push_back(-3);
     inc.push_back(0);
     inc.push_back(3);
     inc.push_back(1);
     inc.push_back(10);
 
-    for(std::size_t i = 0; i< inc.size(); i++) {
+    for (std::size_t i = 0; i < inc.size(); i++) {
       StorageIndex incRows = inc[i];
       SparseVectorType vec1(rows);
       DenseVector refVec1 = DenseVector::Zero(rows);
       initSparse<Scalar>(densityVec, refVec1, vec1);
 
-      vec1.conservativeResize(rows+incRows);
-      refVec1.conservativeResize(rows+incRows);
+      vec1.conservativeResize(rows + incRows);
+      refVec1.conservativeResize(rows + incRows);
       if (incRows > 0) refVec1.tail(incRows).setZero();
 
       VERIFY_IS_APPROX(vec1, refVec1);
 
       // Insert new values
-      if (incRows > 0)
-        vec1.insert(vec1.rows()-1) = refVec1(refVec1.rows()-1) = 1;
+      if (incRows > 0) vec1.insert(vec1.rows() - 1) = refVec1(refVec1.rows() - 1) = 1;
 
       VERIFY_IS_APPROX(vec1, refVec1);
     }
   }
 
   // test sort
-  if(rows > 1)
-  {
+  if (rows > 1) {
     SparseVectorType vec1(rows);
     DenseVector refVec1 = DenseVector::Zero(rows);
     DenseIndexVector innerIndices(rows);
@@ -155,12 +146,11 @@
     std::mt19937 g(rd());
     std::shuffle(innerIndices.begin(), innerIndices.end(), g);
     Index nz = internal::random<Index>(2, rows / 2);
-    for (Index k = 0; k < nz; k++)
-    {
-        Index i = innerIndices[k];
-        Scalar val = internal::random<Scalar>();
-        refVec1.coeffRef(i) = val;
-        vec1.insert(i) = val;
+    for (Index k = 0; k < nz; k++) {
+      Index i = innerIndices[k];
+      Scalar val = internal::random<Scalar>();
+      refVec1.coeffRef(i) = val;
+      vec1.insert(i) = val;
     }
 
     vec1.template sortInnerIndices<std::greater<>>();
@@ -172,49 +162,47 @@
     VERIFY_IS_EQUAL(vec1.template innerIndicesAreSorted<std::greater<>>(), 0);
     VERIFY_IS_EQUAL(vec1.template innerIndicesAreSorted<std::less<>>(), 1);
   }
-
 }
 void test_pruning() {
-    using SparseVectorType = SparseVector<double, 0, int>;
+  using SparseVectorType = SparseVector<double, 0, int>;
 
-    SparseVectorType vec;
-    auto init_vec = [&](){;
-        vec.resize(10);
-        vec.insert(3) = 0.1;
-        vec.insert(5) = 1.0;
-        vec.insert(8) = -0.1;
-        vec.insert(9) = -0.2;
-    };
-    init_vec();
+  SparseVectorType vec;
+  auto init_vec = [&]() {
+    ;
+    vec.resize(10);
+    vec.insert(3) = 0.1;
+    vec.insert(5) = 1.0;
+    vec.insert(8) = -0.1;
+    vec.insert(9) = -0.2;
+  };
+  init_vec();
 
-    VERIFY_IS_EQUAL(vec.nonZeros(), 4);
-    VERIFY_IS_EQUAL(vec.prune(0.1, 1.0), 2);
-    VERIFY_IS_EQUAL(vec.nonZeros(), 2);
-    VERIFY_IS_EQUAL(vec.coeff(5), 1.0);
-    VERIFY_IS_EQUAL(vec.coeff(9), -0.2);
+  VERIFY_IS_EQUAL(vec.nonZeros(), 4);
+  VERIFY_IS_EQUAL(vec.prune(0.1, 1.0), 2);
+  VERIFY_IS_EQUAL(vec.nonZeros(), 2);
+  VERIFY_IS_EQUAL(vec.coeff(5), 1.0);
+  VERIFY_IS_EQUAL(vec.coeff(9), -0.2);
 
-    init_vec();
-    VERIFY_IS_EQUAL(vec.prune([](double v) { return v >= 0; }), 2);
-    VERIFY_IS_EQUAL(vec.nonZeros(), 2);
-    VERIFY_IS_EQUAL(vec.coeff(3), 0.1);
-    VERIFY_IS_EQUAL(vec.coeff(5), 1.0);
+  init_vec();
+  VERIFY_IS_EQUAL(vec.prune([](double v) { return v >= 0; }), 2);
+  VERIFY_IS_EQUAL(vec.nonZeros(), 2);
+  VERIFY_IS_EQUAL(vec.coeff(3), 0.1);
+  VERIFY_IS_EQUAL(vec.coeff(5), 1.0);
 }
 
-EIGEN_DECLARE_TEST(sparse_vector)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    int r = Eigen::internal::random<int>(1,500), c = Eigen::internal::random<int>(1,500);
-    if(Eigen::internal::random<int>(0,4) == 0) {
-      r = c; // check square matrices in 25% of tries
+EIGEN_DECLARE_TEST(sparse_vector) {
+  for (int i = 0; i < g_repeat; i++) {
+    int r = Eigen::internal::random<int>(1, 500), c = Eigen::internal::random<int>(1, 500);
+    if (Eigen::internal::random<int>(0, 4) == 0) {
+      r = c;  // check square matrices in 25% of tries
     }
-    EIGEN_UNUSED_VARIABLE(r+c);
+    EIGEN_UNUSED_VARIABLE(r + c);
 
-    CALL_SUBTEST_1(( sparse_vector<double,int>(8, 8) ));
-    CALL_SUBTEST_2(( sparse_vector<std::complex<double>, int>(r, c) ));
-    CALL_SUBTEST_1(( sparse_vector<double,long int>(r, c) ));
-    CALL_SUBTEST_1(( sparse_vector<double,short>(r, c) ));
+    CALL_SUBTEST_1((sparse_vector<double, int>(8, 8)));
+    CALL_SUBTEST_2((sparse_vector<std::complex<double>, int>(r, c)));
+    CALL_SUBTEST_1((sparse_vector<double, long int>(r, c)));
+    CALL_SUBTEST_1((sparse_vector<double, short>(r, c)));
   }
 
   CALL_SUBTEST_1(test_pruning());
 }
-
diff --git a/test/sparselu.cpp b/test/sparselu.cpp
index 0f9d25f..d933136 100644
--- a/test/sparselu.cpp
+++ b/test/sparselu.cpp
@@ -18,27 +18,26 @@
 #include "sparse_solver.h"
 #include <Eigen/SparseLU>
 
-template<typename T> void test_sparselu_T()
-{
-  SparseLU<SparseMatrix<T, ColMajor> /*, COLAMDOrdering<int>*/ > sparselu_colamd; // COLAMDOrdering is the default
-  SparseLU<SparseMatrix<T, ColMajor>, AMDOrdering<int> > sparselu_amd; 
+template <typename T>
+void test_sparselu_T() {
+  SparseLU<SparseMatrix<T, ColMajor> /*, COLAMDOrdering<int>*/> sparselu_colamd;  // COLAMDOrdering is the default
+  SparseLU<SparseMatrix<T, ColMajor>, AMDOrdering<int> > sparselu_amd;
   SparseLU<SparseMatrix<T, ColMajor, long int>, NaturalOrdering<long int> > sparselu_natural;
-  
-  check_sparse_square_solving(sparselu_colamd,  300, 100000, true); 
-  check_sparse_square_solving(sparselu_amd,     300,  10000, true);
-  check_sparse_square_solving(sparselu_natural, 300,   2000, true);
-  
+
+  check_sparse_square_solving(sparselu_colamd, 300, 100000, true);
+  check_sparse_square_solving(sparselu_amd, 300, 10000, true);
+  check_sparse_square_solving(sparselu_natural, 300, 2000, true);
+
   check_sparse_square_abs_determinant(sparselu_colamd);
   check_sparse_square_abs_determinant(sparselu_amd);
-  
+
   check_sparse_square_determinant(sparselu_colamd);
   check_sparse_square_determinant(sparselu_amd);
 }
 
-EIGEN_DECLARE_TEST(sparselu)
-{
-  CALL_SUBTEST_1(test_sparselu_T<float>()); 
+EIGEN_DECLARE_TEST(sparselu) {
+  CALL_SUBTEST_1(test_sparselu_T<float>());
   CALL_SUBTEST_2(test_sparselu_T<double>());
-  CALL_SUBTEST_3(test_sparselu_T<std::complex<float> >()); 
+  CALL_SUBTEST_3(test_sparselu_T<std::complex<float> >());
   CALL_SUBTEST_4(test_sparselu_T<std::complex<double> >());
 }
diff --git a/test/sparseqr.cpp b/test/sparseqr.cpp
index 3576cc6..51ed398 100644
--- a/test/sparseqr.cpp
+++ b/test/sparseqr.cpp
@@ -9,50 +9,48 @@
 #include "sparse.h"
 #include <Eigen/SparseQR>
 
-template<typename MatrixType,typename DenseMat>
-int generate_sparse_rectangular_problem(MatrixType& A, DenseMat& dA, int maxRows = 300, int maxCols = 150)
-{
+template <typename MatrixType, typename DenseMat>
+int generate_sparse_rectangular_problem(MatrixType& A, DenseMat& dA, int maxRows = 300, int maxCols = 150) {
   eigen_assert(maxRows >= maxCols);
   typedef typename MatrixType::Scalar Scalar;
-  int rows = internal::random<int>(1,maxRows);
-  int cols = internal::random<int>(1,maxCols);
-  double density = (std::max)(8./(rows*cols), 0.01);
-  
-  A.resize(rows,cols);
-  dA.resize(rows,cols);
-  initSparse<Scalar>(density, dA, A,ForceNonZeroDiag);
+  int rows = internal::random<int>(1, maxRows);
+  int cols = internal::random<int>(1, maxCols);
+  double density = (std::max)(8. / (rows * cols), 0.01);
+
+  A.resize(rows, cols);
+  dA.resize(rows, cols);
+  initSparse<Scalar>(density, dA, A, ForceNonZeroDiag);
   A.makeCompressed();
-  int nop = internal::random<int>(0, internal::random<double>(0,1) > 0.5 ? cols/2 : 0);
-  for(int k=0; k<nop; ++k)
-  {
-    int j0 = internal::random<int>(0,cols-1);
-    int j1 = internal::random<int>(0,cols-1);
+  int nop = internal::random<int>(0, internal::random<double>(0, 1) > 0.5 ? cols / 2 : 0);
+  for (int k = 0; k < nop; ++k) {
+    int j0 = internal::random<int>(0, cols - 1);
+    int j1 = internal::random<int>(0, cols - 1);
     Scalar s = internal::random<Scalar>();
-    A.col(j0)  = s * A.col(j1);
+    A.col(j0) = s * A.col(j1);
     dA.col(j0) = s * dA.col(j1);
   }
-  
-//   if(rows<cols) {
-//     A.conservativeResize(cols,cols);
-//     dA.conservativeResize(cols,cols);
-//     dA.bottomRows(cols-rows).setZero();
-//   }
-  
+
+  //   if(rows<cols) {
+  //     A.conservativeResize(cols,cols);
+  //     dA.conservativeResize(cols,cols);
+  //     dA.bottomRows(cols-rows).setZero();
+  //   }
+
   return rows;
 }
 
-template<typename Scalar> void test_sparseqr_scalar()
-{
+template <typename Scalar>
+void test_sparseqr_scalar() {
   typedef typename NumTraits<Scalar>::Real RealScalar;
-  typedef SparseMatrix<Scalar,ColMajor> MatrixType; 
-  typedef Matrix<Scalar,Dynamic,Dynamic> DenseMat;
-  typedef Matrix<Scalar,Dynamic,1> DenseVector;
+  typedef SparseMatrix<Scalar, ColMajor> MatrixType;
+  typedef Matrix<Scalar, Dynamic, Dynamic> DenseMat;
+  typedef Matrix<Scalar, Dynamic, 1> DenseVector;
   MatrixType A;
   DenseMat dA;
-  DenseVector refX,x,b; 
-  SparseQR<MatrixType, COLAMDOrdering<int> > solver; 
-  generate_sparse_rectangular_problem(A,dA);
-  
+  DenseVector refX, x, b;
+  SparseQR<MatrixType, COLAMDOrdering<int> > solver;
+  generate_sparse_rectangular_problem(A, dA);
+
   b = dA * DenseVector::Random(A.cols());
   solver.compute(A);
 
@@ -65,29 +63,25 @@
   VERIFY_IS_EQUAL(solver.matrixR().cols(), A.cols());
 
   // Q and R can be multiplied
-  DenseMat recoveredA = solver.matrixQ()
-                      * DenseMat(solver.matrixR().template triangularView<Upper>())
-                      * solver.colsPermutation().transpose();
+  DenseMat recoveredA = solver.matrixQ() * DenseMat(solver.matrixR().template triangularView<Upper>()) *
+                        solver.colsPermutation().transpose();
   VERIFY_IS_EQUAL(recoveredA.rows(), A.rows());
   VERIFY_IS_EQUAL(recoveredA.cols(), A.cols());
 
   // and in the full rank case the original matrix is recovered
-  if (solver.rank() == A.cols())
-  {
-      VERIFY_IS_APPROX(A, recoveredA);
+  if (solver.rank() == A.cols()) {
+    VERIFY_IS_APPROX(A, recoveredA);
   }
 
-  if(internal::random<float>(0,1)>0.5f)
+  if (internal::random<float>(0, 1) > 0.5f)
     solver.factorize(A);  // this checks that calling analyzePattern is not needed if the pattern do not change.
-  if (solver.info() != Success)
-  {
+  if (solver.info() != Success) {
     std::cerr << "sparse QR factorization failed\n";
     exit(0);
     return;
   }
   x = solver.solve(b);
-  if (solver.info() != Success)
-  {
+  if (solver.info() != Success) {
     std::cerr << "sparse QR factorization failed\n";
     exit(0);
     return;
@@ -96,15 +90,14 @@
   // Compare with a dense QR solver
   ColPivHouseholderQR<DenseMat> dqr(dA);
   refX = dqr.solve(b);
-  
-  bool rank_deficient = A.cols()>A.rows() || dqr.rank()<A.cols();
-  if(rank_deficient)
-  {
+
+  bool rank_deficient = A.cols() > A.rows() || dqr.rank() < A.cols();
+  if (rank_deficient) {
     // rank deficient problem -> we might have to increase the threshold
     // to get a correct solution.
-    RealScalar th = RealScalar(20)*dA.colwise().norm().maxCoeff()*(A.rows()+A.cols()) * NumTraits<RealScalar>::epsilon();
-    for(Index k=0; (k<16) && !test_isApprox(A*x,b); ++k)
-    {
+    RealScalar th =
+        RealScalar(20) * dA.colwise().norm().maxCoeff() * (A.rows() + A.cols()) * NumTraits<RealScalar>::epsilon();
+    for (Index k = 0; (k < 16) && !test_isApprox(A * x, b); ++k) {
       th *= RealScalar(10);
       solver.setPivotThreshold(th);
       solver.compute(A);
@@ -113,37 +106,35 @@
   }
 
   VERIFY_IS_APPROX(A * x, b);
-  
+
   // For rank deficient problem, the estimated rank might
   // be slightly off, so let's only raise a warning in such cases.
-  if(rank_deficient) ++g_test_level;
+  if (rank_deficient) ++g_test_level;
   VERIFY_IS_EQUAL(solver.rank(), dqr.rank());
-  if(rank_deficient) --g_test_level;
+  if (rank_deficient) --g_test_level;
 
-  if(solver.rank()==A.cols()) // full rank
+  if (solver.rank() == A.cols())  // full rank
     VERIFY_IS_APPROX(x, refX);
-//   else
-//     VERIFY((dA * refX - b).norm() * 2 > (A * x - b).norm() );
+  //   else
+  //     VERIFY((dA * refX - b).norm() * 2 > (A * x - b).norm() );
 
   // Compute explicitly the matrix Q
   MatrixType Q, QtQ, idM;
   Q = solver.matrixQ();
-  //Check  ||Q' * Q - I ||
+  // Check  ||Q' * Q - I ||
   QtQ = Q * Q.adjoint();
-  idM.resize(Q.rows(), Q.rows()); idM.setIdentity();
+  idM.resize(Q.rows(), Q.rows());
+  idM.setIdentity();
   VERIFY(idM.isApprox(QtQ));
-  
+
   // Q to dense
   DenseMat dQ;
   dQ = solver.matrixQ();
   VERIFY_IS_APPROX(Q, dQ);
 }
-EIGEN_DECLARE_TEST(sparseqr)
-{
-  for(int i=0; i<g_repeat; ++i)
-  {
+EIGEN_DECLARE_TEST(sparseqr) {
+  for (int i = 0; i < g_repeat; ++i) {
     CALL_SUBTEST_1(test_sparseqr_scalar<double>());
     CALL_SUBTEST_2(test_sparseqr_scalar<std::complex<double> >());
   }
 }
-
diff --git a/test/special_numbers.cpp b/test/special_numbers.cpp
index 1e1a636..943f650 100644
--- a/test/special_numbers.cpp
+++ b/test/special_numbers.cpp
@@ -9,50 +9,46 @@
 
 #include "main.h"
 
-template<typename Scalar> void special_numbers()
-{
-  typedef Matrix<Scalar, Dynamic,Dynamic> MatType;
-  int rows = internal::random<int>(1,300);
-  int cols = internal::random<int>(1,300);
-  
+template <typename Scalar>
+void special_numbers() {
+  typedef Matrix<Scalar, Dynamic, Dynamic> MatType;
+  int rows = internal::random<int>(1, 300);
+  int cols = internal::random<int>(1, 300);
+
   Scalar nan = std::numeric_limits<Scalar>::quiet_NaN();
   Scalar inf = std::numeric_limits<Scalar>::infinity();
   Scalar s1 = internal::random<Scalar>();
-  
-  MatType m1    = MatType::Random(rows,cols),
-          mnan  = MatType::Random(rows,cols),
-          minf  = MatType::Random(rows,cols),
-          mboth = MatType::Random(rows,cols);
-          
-  int n = internal::random<int>(1,10);
-  for(int k=0; k<n; ++k)
-  {
-    mnan(internal::random<int>(0,rows-1), internal::random<int>(0,cols-1)) = nan;
-    minf(internal::random<int>(0,rows-1), internal::random<int>(0,cols-1)) = inf;
+
+  MatType m1 = MatType::Random(rows, cols), mnan = MatType::Random(rows, cols), minf = MatType::Random(rows, cols),
+          mboth = MatType::Random(rows, cols);
+
+  int n = internal::random<int>(1, 10);
+  for (int k = 0; k < n; ++k) {
+    mnan(internal::random<int>(0, rows - 1), internal::random<int>(0, cols - 1)) = nan;
+    minf(internal::random<int>(0, rows - 1), internal::random<int>(0, cols - 1)) = inf;
   }
   mboth = mnan + minf;
-  
+
   VERIFY(!m1.hasNaN());
   VERIFY(m1.allFinite());
-  
+
   VERIFY(mnan.hasNaN());
-  VERIFY((s1*mnan).hasNaN());
+  VERIFY((s1 * mnan).hasNaN());
   VERIFY(!minf.hasNaN());
-  VERIFY(!(2*minf).hasNaN());
+  VERIFY(!(2 * minf).hasNaN());
   VERIFY(mboth.hasNaN());
   VERIFY(mboth.array().hasNaN());
-  
+
   VERIFY(!mnan.allFinite());
   VERIFY(!minf.allFinite());
-  VERIFY(!(minf-mboth).allFinite());
+  VERIFY(!(minf - mboth).allFinite());
   VERIFY(!mboth.allFinite());
   VERIFY(!mboth.array().allFinite());
 }
 
-EIGEN_DECLARE_TEST(special_numbers)
-{
-  for(int i = 0; i < 10*g_repeat; i++) {
-    CALL_SUBTEST_1( special_numbers<float>() );
-    CALL_SUBTEST_1( special_numbers<double>() );
+EIGEN_DECLARE_TEST(special_numbers) {
+  for (int i = 0; i < 10 * g_repeat; i++) {
+    CALL_SUBTEST_1(special_numbers<float>());
+    CALL_SUBTEST_1(special_numbers<double>());
   }
 }
diff --git a/test/split_test_helper.h b/test/split_test_helper.h
index 82e82aa..63c809c 100644
--- a/test/split_test_helper.h
+++ b/test/split_test_helper.h
@@ -5991,4 +5991,3 @@
 #else
 #define CALL_SUBTEST_999(FUNC)
 #endif
-
diff --git a/test/spqr_support.cpp b/test/spqr_support.cpp
index 79c2c12..cd75825 100644
--- a/test/spqr_support.cpp
+++ b/test/spqr_support.cpp
@@ -10,55 +10,50 @@
 #include "sparse.h"
 #include <Eigen/SPQRSupport>
 
-
-template<typename MatrixType,typename DenseMat>
-int generate_sparse_rectangular_problem(MatrixType& A, DenseMat& dA, int maxRows = 300, int maxCols = 300)
-{
+template <typename MatrixType, typename DenseMat>
+int generate_sparse_rectangular_problem(MatrixType& A, DenseMat& dA, int maxRows = 300, int maxCols = 300) {
   eigen_assert(maxRows >= maxCols);
   typedef typename MatrixType::Scalar Scalar;
-  int rows = internal::random<int>(1,maxRows);
-  int cols = internal::random<int>(1,rows);
-  double density = (std::max)(8./(rows*cols), 0.01);
-  
-  A.resize(rows,cols);
-  dA.resize(rows,cols);
-  initSparse<Scalar>(density, dA, A,ForceNonZeroDiag);
+  int rows = internal::random<int>(1, maxRows);
+  int cols = internal::random<int>(1, rows);
+  double density = (std::max)(8. / (rows * cols), 0.01);
+
+  A.resize(rows, cols);
+  dA.resize(rows, cols);
+  initSparse<Scalar>(density, dA, A, ForceNonZeroDiag);
   A.makeCompressed();
   return rows;
 }
 
-template<typename Scalar> void test_spqr_scalar()
-{
-  typedef SparseMatrix<Scalar,ColMajor> MatrixType; 
+template <typename Scalar>
+void test_spqr_scalar() {
+  typedef SparseMatrix<Scalar, ColMajor> MatrixType;
   MatrixType A;
-  Matrix<Scalar,Dynamic,Dynamic> dA;
-  typedef Matrix<Scalar,Dynamic,1> DenseVector;
-  DenseVector refX,x,b; 
-  SPQR<MatrixType> solver; 
-  generate_sparse_rectangular_problem(A,dA);
-  
+  Matrix<Scalar, Dynamic, Dynamic> dA;
+  typedef Matrix<Scalar, Dynamic, 1> DenseVector;
+  DenseVector refX, x, b;
+  SPQR<MatrixType> solver;
+  generate_sparse_rectangular_problem(A, dA);
+
   Index m = A.rows();
   b = DenseVector::Random(m);
   solver.compute(A);
-  if (solver.info() != Success)
-  {
+  if (solver.info() != Success) {
     std::cerr << "sparse QR factorization failed\n";
     exit(0);
     return;
   }
   x = solver.solve(b);
-  if (solver.info() != Success)
-  {
+  if (solver.info() != Success) {
     std::cerr << "sparse QR factorization failed\n";
     exit(0);
     return;
-  }  
-  //Compare with a dense solver
+  }
+  // Compare with a dense solver
   refX = dA.colPivHouseholderQr().solve(b);
-  VERIFY(x.isApprox(refX,test_precision<Scalar>()));
+  VERIFY(x.isApprox(refX, test_precision<Scalar>()));
 }
-EIGEN_DECLARE_TEST(spqr_support)
-{
+EIGEN_DECLARE_TEST(spqr_support) {
   CALL_SUBTEST_1(test_spqr_scalar<double>());
   CALL_SUBTEST_2(test_spqr_scalar<std::complex<double> >());
 }
diff --git a/test/stable_norm.cpp b/test/stable_norm.cpp
index cb8a80c..130284a 100644
--- a/test/stable_norm.cpp
+++ b/test/stable_norm.cpp
@@ -9,21 +9,21 @@
 
 #include "main.h"
 
-template<typename T> EIGEN_DONT_INLINE T copy(const T& x)
-{
+template <typename T>
+EIGEN_DONT_INLINE T copy(const T& x) {
   return x;
 }
 
-template<typename MatrixType> void stable_norm(const MatrixType& m)
-{
+template <typename MatrixType>
+void stable_norm(const MatrixType& m) {
   /* this test covers the following files:
      StableNorm.h
   */
-  using std::sqrt;
   using std::abs;
+  using std::sqrt;
   typedef typename MatrixType::Scalar Scalar;
   typedef typename NumTraits<Scalar>::Real RealScalar;
-  
+
   bool complex_real_product_ok = true;
 
   // Check the basic machine-dependent constants.
@@ -31,151 +31,165 @@
     int ibeta, it, iemin, iemax;
 
     ibeta = std::numeric_limits<RealScalar>::radix;         // base for floating-point numbers
-    it    = std::numeric_limits<RealScalar>::digits;        // number of base-beta digits in mantissa
+    it = std::numeric_limits<RealScalar>::digits;           // number of base-beta digits in mantissa
     iemin = std::numeric_limits<RealScalar>::min_exponent;  // minimum exponent
     iemax = std::numeric_limits<RealScalar>::max_exponent;  // maximum exponent
 
-    VERIFY( (!(iemin > 1 - 2*it || 1+it>iemax || (it==2 && ibeta<5) || (it<=4 && ibeta <= 3 ) || it<2))
-           && "the stable norm algorithm cannot be guaranteed on this computer");
-    
+    VERIFY((!(iemin > 1 - 2 * it || 1 + it > iemax || (it == 2 && ibeta < 5) || (it <= 4 && ibeta <= 3) || it < 2)) &&
+           "the stable norm algorithm cannot be guaranteed on this computer");
+
     Scalar inf = std::numeric_limits<RealScalar>::infinity();
-    if(NumTraits<Scalar>::IsComplex && (numext::isnan)(inf*RealScalar(1)) )
-    {
+    if (NumTraits<Scalar>::IsComplex && (numext::isnan)(inf * RealScalar(1))) {
       complex_real_product_ok = false;
       static bool first = true;
-      if(first)
-        std::cerr << "WARNING: compiler mess up complex*real product, " << inf << " * " << 1.0 << " = " << inf*RealScalar(1) << std::endl;
+      if (first)
+        std::cerr << "WARNING: compiler mess up complex*real product, " << inf << " * " << 1.0 << " = "
+                  << inf * RealScalar(1) << std::endl;
       first = false;
     }
   }
 
-
   Index rows = m.rows();
   Index cols = m.cols();
 
   // get a non-zero random factor
   Scalar factor = internal::random<Scalar>();
-  while(numext::abs2(factor)<RealScalar(1e-4))
-    factor = internal::random<Scalar>();
+  while (numext::abs2(factor) < RealScalar(1e-4)) factor = internal::random<Scalar>();
   Scalar big = factor * ((std::numeric_limits<RealScalar>::max)() * RealScalar(1e-4));
-  
+
   factor = internal::random<Scalar>();
-  while(numext::abs2(factor)<RealScalar(1e-4))
-    factor = internal::random<Scalar>();
+  while (numext::abs2(factor) < RealScalar(1e-4)) factor = internal::random<Scalar>();
   Scalar small = factor * ((std::numeric_limits<RealScalar>::min)() * RealScalar(1e4));
 
   Scalar one(1);
 
-  MatrixType  vzero = MatrixType::Zero(rows, cols),
-              vrand = MatrixType::Random(rows, cols),
-              vbig(rows, cols),
-              vsmall(rows,cols);
+  MatrixType vzero = MatrixType::Zero(rows, cols), vrand = MatrixType::Random(rows, cols), vbig(rows, cols),
+             vsmall(rows, cols);
 
   vbig.fill(big);
   vsmall.fill(small);
 
   VERIFY_IS_MUCH_SMALLER_THAN(vzero.norm(), static_cast<RealScalar>(1));
-  VERIFY_IS_APPROX(vrand.stableNorm(),      vrand.norm());
-  VERIFY_IS_APPROX(vrand.blueNorm(),        vrand.norm());
-  VERIFY_IS_APPROX(vrand.hypotNorm(),       vrand.norm());
+  VERIFY_IS_APPROX(vrand.stableNorm(), vrand.norm());
+  VERIFY_IS_APPROX(vrand.blueNorm(), vrand.norm());
+  VERIFY_IS_APPROX(vrand.hypotNorm(), vrand.norm());
 
   // test with expressions as input
-  VERIFY_IS_APPROX((one*vrand).stableNorm(),      vrand.norm());
-  VERIFY_IS_APPROX((one*vrand).blueNorm(),        vrand.norm());
-  VERIFY_IS_APPROX((one*vrand).hypotNorm(),       vrand.norm());
-  VERIFY_IS_APPROX((one*vrand+one*vrand-one*vrand).stableNorm(),      vrand.norm());
-  VERIFY_IS_APPROX((one*vrand+one*vrand-one*vrand).blueNorm(),        vrand.norm());
-  VERIFY_IS_APPROX((one*vrand+one*vrand-one*vrand).hypotNorm(),       vrand.norm());
+  VERIFY_IS_APPROX((one * vrand).stableNorm(), vrand.norm());
+  VERIFY_IS_APPROX((one * vrand).blueNorm(), vrand.norm());
+  VERIFY_IS_APPROX((one * vrand).hypotNorm(), vrand.norm());
+  VERIFY_IS_APPROX((one * vrand + one * vrand - one * vrand).stableNorm(), vrand.norm());
+  VERIFY_IS_APPROX((one * vrand + one * vrand - one * vrand).blueNorm(), vrand.norm());
+  VERIFY_IS_APPROX((one * vrand + one * vrand - one * vrand).hypotNorm(), vrand.norm());
 
   RealScalar size = static_cast<RealScalar>(m.size());
 
   // test numext::isfinite
-  VERIFY(!(numext::isfinite)( std::numeric_limits<RealScalar>::infinity()));
+  VERIFY(!(numext::isfinite)(std::numeric_limits<RealScalar>::infinity()));
   VERIFY(!(numext::isfinite)(sqrt(-abs(big))));
 
   // test overflow
-  VERIFY((numext::isfinite)(sqrt(size)*abs(big)));
-  VERIFY_IS_NOT_APPROX(sqrt(copy(vbig.squaredNorm())), abs(sqrt(size)*big)); // here the default norm must fail
-  VERIFY_IS_APPROX(vbig.stableNorm(), sqrt(size)*abs(big));
-  VERIFY_IS_APPROX(vbig.blueNorm(),   sqrt(size)*abs(big));
-  VERIFY_IS_APPROX(vbig.hypotNorm(),  sqrt(size)*abs(big));
+  VERIFY((numext::isfinite)(sqrt(size) * abs(big)));
+  VERIFY_IS_NOT_APPROX(sqrt(copy(vbig.squaredNorm())), abs(sqrt(size) * big));  // here the default norm must fail
+  VERIFY_IS_APPROX(vbig.stableNorm(), sqrt(size) * abs(big));
+  VERIFY_IS_APPROX(vbig.blueNorm(), sqrt(size) * abs(big));
+  VERIFY_IS_APPROX(vbig.hypotNorm(), sqrt(size) * abs(big));
 
   // test underflow
-  VERIFY((numext::isfinite)(sqrt(size)*abs(small)));
-  VERIFY_IS_NOT_APPROX(sqrt(copy(vsmall.squaredNorm())),   abs(sqrt(size)*small)); // here the default norm must fail
-  VERIFY_IS_APPROX(vsmall.stableNorm(), sqrt(size)*abs(small));
-  VERIFY_IS_APPROX(vsmall.blueNorm(),   sqrt(size)*abs(small));
-  VERIFY_IS_APPROX(vsmall.hypotNorm(),  sqrt(size)*abs(small));
+  VERIFY((numext::isfinite)(sqrt(size) * abs(small)));
+  VERIFY_IS_NOT_APPROX(sqrt(copy(vsmall.squaredNorm())), abs(sqrt(size) * small));  // here the default norm must fail
+  VERIFY_IS_APPROX(vsmall.stableNorm(), sqrt(size) * abs(small));
+  VERIFY_IS_APPROX(vsmall.blueNorm(), sqrt(size) * abs(small));
+  VERIFY_IS_APPROX(vsmall.hypotNorm(), sqrt(size) * abs(small));
 
   // Test compilation of cwise() version
-  VERIFY_IS_APPROX(vrand.colwise().stableNorm(),      vrand.colwise().norm());
-  VERIFY_IS_APPROX(vrand.colwise().blueNorm(),        vrand.colwise().norm());
-  VERIFY_IS_APPROX(vrand.colwise().hypotNorm(),       vrand.colwise().norm());
-  VERIFY_IS_APPROX(vrand.rowwise().stableNorm(),      vrand.rowwise().norm());
-  VERIFY_IS_APPROX(vrand.rowwise().blueNorm(),        vrand.rowwise().norm());
-  VERIFY_IS_APPROX(vrand.rowwise().hypotNorm(),       vrand.rowwise().norm());
-  
-  // test NaN, +inf, -inf 
+  VERIFY_IS_APPROX(vrand.colwise().stableNorm(), vrand.colwise().norm());
+  VERIFY_IS_APPROX(vrand.colwise().blueNorm(), vrand.colwise().norm());
+  VERIFY_IS_APPROX(vrand.colwise().hypotNorm(), vrand.colwise().norm());
+  VERIFY_IS_APPROX(vrand.rowwise().stableNorm(), vrand.rowwise().norm());
+  VERIFY_IS_APPROX(vrand.rowwise().blueNorm(), vrand.rowwise().norm());
+  VERIFY_IS_APPROX(vrand.rowwise().hypotNorm(), vrand.rowwise().norm());
+
+  // test NaN, +inf, -inf
   MatrixType v;
-  Index i = internal::random<Index>(0,rows-1);
-  Index j = internal::random<Index>(0,cols-1);
+  Index i = internal::random<Index>(0, rows - 1);
+  Index j = internal::random<Index>(0, cols - 1);
 
   // NaN
   {
     v = vrand;
-    v(i,j) = std::numeric_limits<RealScalar>::quiet_NaN();
-    VERIFY(!(numext::isfinite)(v.squaredNorm()));   VERIFY((numext::isnan)(v.squaredNorm()));
-    VERIFY(!(numext::isfinite)(v.norm()));          VERIFY((numext::isnan)(v.norm()));
-    VERIFY(!(numext::isfinite)(v.stableNorm()));    VERIFY((numext::isnan)(v.stableNorm()));
-    VERIFY(!(numext::isfinite)(v.blueNorm()));      VERIFY((numext::isnan)(v.blueNorm()));
-    VERIFY(!(numext::isfinite)(v.hypotNorm()));     VERIFY((numext::isnan)(v.hypotNorm()));
+    v(i, j) = std::numeric_limits<RealScalar>::quiet_NaN();
+    VERIFY(!(numext::isfinite)(v.squaredNorm()));
+    VERIFY((numext::isnan)(v.squaredNorm()));
+    VERIFY(!(numext::isfinite)(v.norm()));
+    VERIFY((numext::isnan)(v.norm()));
+    VERIFY(!(numext::isfinite)(v.stableNorm()));
+    VERIFY((numext::isnan)(v.stableNorm()));
+    VERIFY(!(numext::isfinite)(v.blueNorm()));
+    VERIFY((numext::isnan)(v.blueNorm()));
+    VERIFY(!(numext::isfinite)(v.hypotNorm()));
+    VERIFY((numext::isnan)(v.hypotNorm()));
   }
-  
+
   // +inf
   {
     v = vrand;
-    v(i,j) = std::numeric_limits<RealScalar>::infinity();
-    VERIFY(!(numext::isfinite)(v.squaredNorm()));   VERIFY(isPlusInf(v.squaredNorm()));
-    VERIFY(!(numext::isfinite)(v.norm()));          VERIFY(isPlusInf(v.norm()));
+    v(i, j) = std::numeric_limits<RealScalar>::infinity();
+    VERIFY(!(numext::isfinite)(v.squaredNorm()));
+    VERIFY(isPlusInf(v.squaredNorm()));
+    VERIFY(!(numext::isfinite)(v.norm()));
+    VERIFY(isPlusInf(v.norm()));
     VERIFY(!(numext::isfinite)(v.stableNorm()));
-    if(complex_real_product_ok){
+    if (complex_real_product_ok) {
       VERIFY(isPlusInf(v.stableNorm()));
     }
-    VERIFY(!(numext::isfinite)(v.blueNorm()));      VERIFY(isPlusInf(v.blueNorm()));
-    VERIFY(!(numext::isfinite)(v.hypotNorm()));     VERIFY(isPlusInf(v.hypotNorm()));
+    VERIFY(!(numext::isfinite)(v.blueNorm()));
+    VERIFY(isPlusInf(v.blueNorm()));
+    VERIFY(!(numext::isfinite)(v.hypotNorm()));
+    VERIFY(isPlusInf(v.hypotNorm()));
   }
-  
+
   // -inf
   {
     v = vrand;
-    v(i,j) = -std::numeric_limits<RealScalar>::infinity();
-    VERIFY(!(numext::isfinite)(v.squaredNorm()));   VERIFY(isPlusInf(v.squaredNorm()));
-    VERIFY(!(numext::isfinite)(v.norm()));          VERIFY(isPlusInf(v.norm()));
+    v(i, j) = -std::numeric_limits<RealScalar>::infinity();
+    VERIFY(!(numext::isfinite)(v.squaredNorm()));
+    VERIFY(isPlusInf(v.squaredNorm()));
+    VERIFY(!(numext::isfinite)(v.norm()));
+    VERIFY(isPlusInf(v.norm()));
     VERIFY(!(numext::isfinite)(v.stableNorm()));
-    if(complex_real_product_ok) {
+    if (complex_real_product_ok) {
       VERIFY(isPlusInf(v.stableNorm()));
     }
-    VERIFY(!(numext::isfinite)(v.blueNorm()));      VERIFY(isPlusInf(v.blueNorm()));
-    VERIFY(!(numext::isfinite)(v.hypotNorm()));     VERIFY(isPlusInf(v.hypotNorm()));
+    VERIFY(!(numext::isfinite)(v.blueNorm()));
+    VERIFY(isPlusInf(v.blueNorm()));
+    VERIFY(!(numext::isfinite)(v.hypotNorm()));
+    VERIFY(isPlusInf(v.hypotNorm()));
   }
-  
+
   // mix
   {
-    Index i2 = internal::random<Index>(0,rows-1);
-    Index j2 = internal::random<Index>(0,cols-1);
+    Index i2 = internal::random<Index>(0, rows - 1);
+    Index j2 = internal::random<Index>(0, cols - 1);
     v = vrand;
-    v(i,j) = -std::numeric_limits<RealScalar>::infinity();
-    v(i2,j2) = std::numeric_limits<RealScalar>::quiet_NaN();
-    VERIFY(!(numext::isfinite)(v.squaredNorm()));   VERIFY((numext::isnan)(v.squaredNorm()));
-    VERIFY(!(numext::isfinite)(v.norm()));          VERIFY((numext::isnan)(v.norm()));
-    VERIFY(!(numext::isfinite)(v.stableNorm()));    VERIFY((numext::isnan)(v.stableNorm()));
-    VERIFY(!(numext::isfinite)(v.blueNorm()));      VERIFY((numext::isnan)(v.blueNorm()));
+    v(i, j) = -std::numeric_limits<RealScalar>::infinity();
+    v(i2, j2) = std::numeric_limits<RealScalar>::quiet_NaN();
+    VERIFY(!(numext::isfinite)(v.squaredNorm()));
+    VERIFY((numext::isnan)(v.squaredNorm()));
+    VERIFY(!(numext::isfinite)(v.norm()));
+    VERIFY((numext::isnan)(v.norm()));
+    VERIFY(!(numext::isfinite)(v.stableNorm()));
+    VERIFY((numext::isnan)(v.stableNorm()));
+    VERIFY(!(numext::isfinite)(v.blueNorm()));
+    VERIFY((numext::isnan)(v.blueNorm()));
     if (i2 != i || j2 != j) {
       // hypot propagates inf over NaN.
-      VERIFY(!(numext::isfinite)(v.hypotNorm()));     VERIFY((numext::isinf)(v.hypotNorm()));
+      VERIFY(!(numext::isfinite)(v.hypotNorm()));
+      VERIFY((numext::isinf)(v.hypotNorm()));
     } else {
       // inf is overwritten by NaN, expect norm to be NaN.
-      VERIFY(!(numext::isfinite)(v.hypotNorm()));     VERIFY((numext::isnan)(v.hypotNorm()));
+      VERIFY(!(numext::isfinite)(v.hypotNorm()));
+      VERIFY((numext::isnan)(v.hypotNorm()));
     }
   }
 
@@ -190,56 +204,49 @@
     VERIFY_IS_APPROX((vbig.stableNormalized()).norm(), RealScalar(1));
     VERIFY_IS_APPROX((vsmall.stableNormalized()).norm(), RealScalar(1));
     RealScalar big_scaling = ((std::numeric_limits<RealScalar>::max)() * RealScalar(1e-4));
-    VERIFY_IS_APPROX(vbig/big_scaling, (vbig.stableNorm() * vbig.stableNormalized()).eval()/big_scaling);
+    VERIFY_IS_APPROX(vbig / big_scaling, (vbig.stableNorm() * vbig.stableNormalized()).eval() / big_scaling);
     VERIFY_IS_APPROX(vsmall, vsmall.stableNorm() * vsmall.stableNormalized());
   }
 }
 
-template<typename Scalar>
-void test_hypot()
-{
+template <typename Scalar>
+void test_hypot() {
   typedef typename NumTraits<Scalar>::Real RealScalar;
   Scalar factor = internal::random<Scalar>();
-  while(numext::abs2(factor)<RealScalar(1e-4))
-    factor = internal::random<Scalar>();
+  while (numext::abs2(factor) < RealScalar(1e-4)) factor = internal::random<Scalar>();
   Scalar big = factor * ((std::numeric_limits<RealScalar>::max)() * RealScalar(1e-4));
-  
+
   factor = internal::random<Scalar>();
-  while(numext::abs2(factor)<RealScalar(1e-4))
-    factor = internal::random<Scalar>();
+  while (numext::abs2(factor) < RealScalar(1e-4)) factor = internal::random<Scalar>();
   Scalar small = factor * ((std::numeric_limits<RealScalar>::min)() * RealScalar(1e4));
 
-  Scalar  one   (1),
-          zero  (0),
-          sqrt2 (std::sqrt(2)),
-          nan   (std::numeric_limits<RealScalar>::quiet_NaN());
+  Scalar one(1), zero(0), sqrt2(std::sqrt(2)), nan(std::numeric_limits<RealScalar>::quiet_NaN());
 
-  Scalar a = internal::random<Scalar>(-1,1);
-  Scalar b = internal::random<Scalar>(-1,1);
-  VERIFY_IS_APPROX(numext::hypot(a,b),std::sqrt(numext::abs2(a)+numext::abs2(b)));
-  VERIFY_IS_EQUAL(numext::hypot(zero,zero), zero);
+  Scalar a = internal::random<Scalar>(-1, 1);
+  Scalar b = internal::random<Scalar>(-1, 1);
+  VERIFY_IS_APPROX(numext::hypot(a, b), std::sqrt(numext::abs2(a) + numext::abs2(b)));
+  VERIFY_IS_EQUAL(numext::hypot(zero, zero), zero);
   VERIFY_IS_APPROX(numext::hypot(one, one), sqrt2);
-  VERIFY_IS_APPROX(numext::hypot(big,big), sqrt2*numext::abs(big));
-  VERIFY_IS_APPROX(numext::hypot(small,small), sqrt2*numext::abs(small));
-  VERIFY_IS_APPROX(numext::hypot(small,big), numext::abs(big));
-  VERIFY((numext::isnan)(numext::hypot(nan,a)));
-  VERIFY((numext::isnan)(numext::hypot(a,nan)));
+  VERIFY_IS_APPROX(numext::hypot(big, big), sqrt2 * numext::abs(big));
+  VERIFY_IS_APPROX(numext::hypot(small, small), sqrt2 * numext::abs(small));
+  VERIFY_IS_APPROX(numext::hypot(small, big), numext::abs(big));
+  VERIFY((numext::isnan)(numext::hypot(nan, a)));
+  VERIFY((numext::isnan)(numext::hypot(a, nan)));
 }
 
-EIGEN_DECLARE_TEST(stable_norm)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_3( test_hypot<double>() );
-    CALL_SUBTEST_4( test_hypot<float>() );
-    CALL_SUBTEST_5( test_hypot<std::complex<double> >() );
-    CALL_SUBTEST_6( test_hypot<std::complex<float> >() );
+EIGEN_DECLARE_TEST(stable_norm) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_3(test_hypot<double>());
+    CALL_SUBTEST_4(test_hypot<float>());
+    CALL_SUBTEST_5(test_hypot<std::complex<double> >());
+    CALL_SUBTEST_6(test_hypot<std::complex<float> >());
 
-    CALL_SUBTEST_1( stable_norm(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( stable_norm(Vector4d()) );
-    CALL_SUBTEST_3( stable_norm(VectorXd(internal::random<int>(10,2000))) );
-    CALL_SUBTEST_3( stable_norm(MatrixXd(internal::random<int>(10,200), internal::random<int>(10,200))) );
-    CALL_SUBTEST_4( stable_norm(VectorXf(internal::random<int>(10,2000))) );
-    CALL_SUBTEST_5( stable_norm(VectorXcd(internal::random<int>(10,2000))) );
-    CALL_SUBTEST_6( stable_norm(VectorXcf(internal::random<int>(10,2000))) );
+    CALL_SUBTEST_1(stable_norm(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(stable_norm(Vector4d()));
+    CALL_SUBTEST_3(stable_norm(VectorXd(internal::random<int>(10, 2000))));
+    CALL_SUBTEST_3(stable_norm(MatrixXd(internal::random<int>(10, 200), internal::random<int>(10, 200))));
+    CALL_SUBTEST_4(stable_norm(VectorXf(internal::random<int>(10, 2000))));
+    CALL_SUBTEST_5(stable_norm(VectorXcd(internal::random<int>(10, 2000))));
+    CALL_SUBTEST_6(stable_norm(VectorXcf(internal::random<int>(10, 2000))));
   }
 }
diff --git a/test/stddeque.cpp b/test/stddeque.cpp
index ea85ea9..45608d7 100644
--- a/test/stddeque.cpp
+++ b/test/stddeque.cpp
@@ -12,96 +12,89 @@
 #include <Eigen/StdDeque>
 #include <Eigen/Geometry>
 
-template<typename MatrixType>
-void check_stddeque_matrix(const MatrixType& m)
-{
+template <typename MatrixType>
+void check_stddeque_matrix(const MatrixType& m) {
   Index rows = m.rows();
   Index cols = m.cols();
-  MatrixType x = MatrixType::Random(rows,cols), y = MatrixType::Random(rows,cols);
-  std::deque<MatrixType,Eigen::aligned_allocator<MatrixType> > v(10, MatrixType::Zero(rows,cols)), w(20, y);
+  MatrixType x = MatrixType::Random(rows, cols), y = MatrixType::Random(rows, cols);
+  std::deque<MatrixType, Eigen::aligned_allocator<MatrixType> > v(10, MatrixType::Zero(rows, cols)), w(20, y);
   v.front() = x;
   w.front() = w.back();
   VERIFY_IS_APPROX(w.front(), w.back());
   v = w;
 
-  typename std::deque<MatrixType,Eigen::aligned_allocator<MatrixType> >::iterator vi = v.begin();
-  typename std::deque<MatrixType,Eigen::aligned_allocator<MatrixType> >::iterator wi = w.begin();
-  for(int i = 0; i < 20; i++)
-  {
+  typename std::deque<MatrixType, Eigen::aligned_allocator<MatrixType> >::iterator vi = v.begin();
+  typename std::deque<MatrixType, Eigen::aligned_allocator<MatrixType> >::iterator wi = w.begin();
+  for (int i = 0; i < 20; i++) {
     VERIFY_IS_APPROX(*vi, *wi);
     ++vi;
     ++wi;
   }
 
-  v.resize(21,MatrixType::Zero(rows,cols));  
+  v.resize(21, MatrixType::Zero(rows, cols));
   v.back() = x;
   VERIFY_IS_APPROX(v.back(), x);
-  v.resize(22,y);
+  v.resize(22, y);
   VERIFY_IS_APPROX(v.back(), y);
   v.push_back(x);
   VERIFY_IS_APPROX(v.back(), x);
 }
 
-template<typename TransformType>
-void check_stddeque_transform(const TransformType&)
-{
+template <typename TransformType>
+void check_stddeque_transform(const TransformType&) {
   typedef typename TransformType::MatrixType MatrixType;
-  TransformType x(MatrixType::Random()), y(MatrixType::Random()), ti=TransformType::Identity();
-  std::deque<TransformType,Eigen::aligned_allocator<TransformType> > v(10,ti), w(20, y);
+  TransformType x(MatrixType::Random()), y(MatrixType::Random()), ti = TransformType::Identity();
+  std::deque<TransformType, Eigen::aligned_allocator<TransformType> > v(10, ti), w(20, y);
   v.front() = x;
   w.front() = w.back();
   VERIFY_IS_APPROX(w.front(), w.back());
   v = w;
 
-  typename std::deque<TransformType,Eigen::aligned_allocator<TransformType> >::iterator vi = v.begin();
-  typename std::deque<TransformType,Eigen::aligned_allocator<TransformType> >::iterator wi = w.begin();
-  for(int i = 0; i < 20; i++)
-  {
+  typename std::deque<TransformType, Eigen::aligned_allocator<TransformType> >::iterator vi = v.begin();
+  typename std::deque<TransformType, Eigen::aligned_allocator<TransformType> >::iterator wi = w.begin();
+  for (int i = 0; i < 20; i++) {
     VERIFY_IS_APPROX(*vi, *wi);
     ++vi;
     ++wi;
   }
 
-  v.resize(21,ti);
+  v.resize(21, ti);
   v.back() = x;
   VERIFY_IS_APPROX(v.back(), x);
-  v.resize(22,y);
+  v.resize(22, y);
   VERIFY_IS_APPROX(v.back(), y);
   v.push_back(x);
   VERIFY_IS_APPROX(v.back(), x);
 }
 
-template<typename QuaternionType>
-void check_stddeque_quaternion(const QuaternionType&)
-{
+template <typename QuaternionType>
+void check_stddeque_quaternion(const QuaternionType&) {
   typedef typename QuaternionType::Coefficients Coefficients;
-  QuaternionType x(Coefficients::Random()), y(Coefficients::Random()), qi=QuaternionType::Identity();
-  std::deque<QuaternionType,Eigen::aligned_allocator<QuaternionType> > v(10,qi), w(20, y);
+  QuaternionType x(Coefficients::Random()), y(Coefficients::Random()), qi = QuaternionType::Identity();
+  std::deque<QuaternionType, Eigen::aligned_allocator<QuaternionType> > v(10, qi), w(20, y);
   v.front() = x;
   w.front() = w.back();
   VERIFY_IS_APPROX(w.front(), w.back());
   v = w;
 
-  typename std::deque<QuaternionType,Eigen::aligned_allocator<QuaternionType> >::iterator vi = v.begin();
-  typename std::deque<QuaternionType,Eigen::aligned_allocator<QuaternionType> >::iterator wi = w.begin();
-  for(int i = 0; i < 20; i++)
-  {
+  typename std::deque<QuaternionType, Eigen::aligned_allocator<QuaternionType> >::iterator vi = v.begin();
+  typename std::deque<QuaternionType, Eigen::aligned_allocator<QuaternionType> >::iterator wi = w.begin();
+  for (int i = 0; i < 20; i++) {
     VERIFY_IS_APPROX(*vi, *wi);
     ++vi;
     ++wi;
   }
 
-  v.resize(21,qi);
+  v.resize(21, qi);
   v.back() = x;
   VERIFY_IS_APPROX(v.back(), x);
-  v.resize(22,y);
+  v.resize(22, y);
   VERIFY_IS_APPROX(v.back(), y);
   v.push_back(x);
   VERIFY_IS_APPROX(v.back(), x);
 }
 
-EIGEN_DECLARE_TEST(stddeque)
-{
+EIGEN_DECLARE_TEST(stddeque) {
   // some non vectorizable fixed sizes
   CALL_SUBTEST_1(check_stddeque_matrix(Vector2f()));
   CALL_SUBTEST_1(check_stddeque_matrix(Matrix3f()));
@@ -114,10 +107,10 @@
   CALL_SUBTEST_2(check_stddeque_matrix(Matrix4d()));
 
   // some dynamic sizes
-  CALL_SUBTEST_3(check_stddeque_matrix(MatrixXd(1,1)));
+  CALL_SUBTEST_3(check_stddeque_matrix(MatrixXd(1, 1)));
   CALL_SUBTEST_3(check_stddeque_matrix(VectorXd(20)));
   CALL_SUBTEST_3(check_stddeque_matrix(RowVectorXf(20)));
-  CALL_SUBTEST_3(check_stddeque_matrix(MatrixXcf(10,10)));
+  CALL_SUBTEST_3(check_stddeque_matrix(MatrixXcf(10, 10)));
 
   // some Transform
   CALL_SUBTEST_4(check_stddeque_transform(Affine2f()));
diff --git a/test/stddeque_overload.cpp b/test/stddeque_overload.cpp
index 0f59f06..d0fb261 100644
--- a/test/stddeque_overload.cpp
+++ b/test/stddeque_overload.cpp
@@ -25,26 +25,24 @@
 EIGEN_DEFINE_STL_DEQUE_SPECIALIZATION(Quaternionf)
 EIGEN_DEFINE_STL_DEQUE_SPECIALIZATION(Quaterniond)
 
-template<typename MatrixType>
-void check_stddeque_matrix(const MatrixType& m)
-{
+template <typename MatrixType>
+void check_stddeque_matrix(const MatrixType& m) {
   Index rows = m.rows();
   Index cols = m.cols();
-  MatrixType x = MatrixType::Random(rows,cols), y = MatrixType::Random(rows,cols);
-  std::deque<MatrixType> v(10, MatrixType::Zero(rows,cols)), w(20, y);
+  MatrixType x = MatrixType::Random(rows, cols), y = MatrixType::Random(rows, cols);
+  std::deque<MatrixType> v(10, MatrixType::Zero(rows, cols)), w(20, y);
   v[5] = x;
   w[6] = v[5];
   VERIFY_IS_APPROX(w[6], v[5]);
   v = w;
-  for(int i = 0; i < 20; i++)
-  {
+  for (int i = 0; i < 20; i++) {
     VERIFY_IS_APPROX(w[i], v[i]);
   }
 
   v.resize(21);
   v[20] = x;
   VERIFY_IS_APPROX(v[20], x);
-  v.resize(22,y);
+  v.resize(22, y);
   VERIFY_IS_APPROX(v[21], y);
   v.push_back(x);
   VERIFY_IS_APPROX(v[22], x);
@@ -52,33 +50,29 @@
   // do a lot of push_back such that the deque gets internally resized
   // (with memory reallocation)
   MatrixType* ref = &w[0];
-  for(int i=0; i<30 || ((ref==&w[0]) && i<300); ++i)
-    v.push_back(w[i%w.size()]);
-  for(unsigned int i=23; i<v.size(); ++i)
-  {
-    VERIFY(v[i]==w[(i-23)%w.size()]);
+  for (int i = 0; i < 30 || ((ref == &w[0]) && i < 300); ++i) v.push_back(w[i % w.size()]);
+  for (unsigned int i = 23; i < v.size(); ++i) {
+    VERIFY(v[i] == w[(i - 23) % w.size()]);
   }
 }
 
-template<typename TransformType>
-void check_stddeque_transform(const TransformType&)
-{
+template <typename TransformType>
+void check_stddeque_transform(const TransformType&) {
   typedef typename TransformType::MatrixType MatrixType;
-  TransformType x(MatrixType::Random()), y(MatrixType::Random()), ti=TransformType::Identity();
-  std::deque<TransformType> v(10,ti), w(20, y);
+  TransformType x(MatrixType::Random()), y(MatrixType::Random()), ti = TransformType::Identity();
+  std::deque<TransformType> v(10, ti), w(20, y);
   v[5] = x;
   w[6] = v[5];
   VERIFY_IS_APPROX(w[6], v[5]);
   v = w;
-  for(int i = 0; i < 20; i++)
-  {
+  for (int i = 0; i < 20; i++) {
     VERIFY_IS_APPROX(w[i], v[i]);
   }
 
-  v.resize(21,ti);
+  v.resize(21, ti);
   v[20] = x;
   VERIFY_IS_APPROX(v[20], x);
-  v.resize(22,y);
+  v.resize(22, y);
   VERIFY_IS_APPROX(v[21], y);
   v.push_back(x);
   VERIFY_IS_APPROX(v[22], x);
@@ -86,33 +80,29 @@
   // do a lot of push_back such that the deque gets internally resized
   // (with memory reallocation)
   TransformType* ref = &w[0];
-  for(int i=0; i<30 || ((ref==&w[0]) && i<300); ++i)
-    v.push_back(w[i%w.size()]);
-  for(unsigned int i=23; i<v.size(); ++i)
-  {
-    VERIFY(v[i].matrix()==w[(i-23)%w.size()].matrix());
+  for (int i = 0; i < 30 || ((ref == &w[0]) && i < 300); ++i) v.push_back(w[i % w.size()]);
+  for (unsigned int i = 23; i < v.size(); ++i) {
+    VERIFY(v[i].matrix() == w[(i - 23) % w.size()].matrix());
   }
 }
 
-template<typename QuaternionType>
-void check_stddeque_quaternion(const QuaternionType&)
-{
+template <typename QuaternionType>
+void check_stddeque_quaternion(const QuaternionType&) {
   typedef typename QuaternionType::Coefficients Coefficients;
-  QuaternionType x(Coefficients::Random()), y(Coefficients::Random()), qi=QuaternionType::Identity();
-  std::deque<QuaternionType> v(10,qi), w(20, y);
+  QuaternionType x(Coefficients::Random()), y(Coefficients::Random()), qi = QuaternionType::Identity();
+  std::deque<QuaternionType> v(10, qi), w(20, y);
   v[5] = x;
   w[6] = v[5];
   VERIFY_IS_APPROX(w[6], v[5]);
   v = w;
-  for(int i = 0; i < 20; i++)
-  {
+  for (int i = 0; i < 20; i++) {
     VERIFY_IS_APPROX(w[i], v[i]);
   }
 
-  v.resize(21,qi);
+  v.resize(21, qi);
   v[20] = x;
   VERIFY_IS_APPROX(v[20], x);
-  v.resize(22,y);
+  v.resize(22, y);
   VERIFY_IS_APPROX(v[21], y);
   v.push_back(x);
   VERIFY_IS_APPROX(v[22], x);
@@ -120,16 +110,13 @@
   // do a lot of push_back such that the deque gets internally resized
   // (with memory reallocation)
   QuaternionType* ref = &w[0];
-  for(int i=0; i<30 || ((ref==&w[0]) && i<300); ++i)
-    v.push_back(w[i%w.size()]);
-  for(unsigned int i=23; i<v.size(); ++i)
-  {
-    VERIFY(v[i].coeffs()==w[(i-23)%w.size()].coeffs());
+  for (int i = 0; i < 30 || ((ref == &w[0]) && i < 300); ++i) v.push_back(w[i % w.size()]);
+  for (unsigned int i = 23; i < v.size(); ++i) {
+    VERIFY(v[i].coeffs() == w[(i - 23) % w.size()].coeffs());
   }
 }
 
-EIGEN_DECLARE_TEST(stddeque_overload)
-{
+EIGEN_DECLARE_TEST(stddeque_overload) {
   // some non vectorizable fixed sizes
   CALL_SUBTEST_1(check_stddeque_matrix(Vector2f()));
   CALL_SUBTEST_1(check_stddeque_matrix(Matrix3f()));
@@ -142,13 +129,13 @@
   CALL_SUBTEST_2(check_stddeque_matrix(Matrix4d()));
 
   // some dynamic sizes
-  CALL_SUBTEST_3(check_stddeque_matrix(MatrixXd(1,1)));
+  CALL_SUBTEST_3(check_stddeque_matrix(MatrixXd(1, 1)));
   CALL_SUBTEST_3(check_stddeque_matrix(VectorXd(20)));
   CALL_SUBTEST_3(check_stddeque_matrix(RowVectorXf(20)));
-  CALL_SUBTEST_3(check_stddeque_matrix(MatrixXcf(10,10)));
+  CALL_SUBTEST_3(check_stddeque_matrix(MatrixXcf(10, 10)));
 
   // some Transform
-  CALL_SUBTEST_4(check_stddeque_transform(Affine2f())); // does not need the specialization (2+1)^2 = 9
+  CALL_SUBTEST_4(check_stddeque_transform(Affine2f()));  // does not need the specialization (2+1)^2 = 9
   CALL_SUBTEST_4(check_stddeque_transform(Affine3f()));
   CALL_SUBTEST_4(check_stddeque_transform(Affine3d()));
 
diff --git a/test/stdlist.cpp b/test/stdlist.cpp
index 1af9e6e..fe32067 100644
--- a/test/stdlist.cpp
+++ b/test/stdlist.cpp
@@ -12,51 +12,47 @@
 #include <Eigen/StdList>
 #include <Eigen/Geometry>
 
-template<typename MatrixType>
-void check_stdlist_matrix(const MatrixType& m)
-{
+template <typename MatrixType>
+void check_stdlist_matrix(const MatrixType& m) {
   Index rows = m.rows();
   Index cols = m.cols();
-  MatrixType x = MatrixType::Random(rows,cols), y = MatrixType::Random(rows,cols);
-  std::list<MatrixType,Eigen::aligned_allocator<MatrixType> > v(10, MatrixType::Zero(rows,cols)), w(20, y);
+  MatrixType x = MatrixType::Random(rows, cols), y = MatrixType::Random(rows, cols);
+  std::list<MatrixType, Eigen::aligned_allocator<MatrixType> > v(10, MatrixType::Zero(rows, cols)), w(20, y);
   v.front() = x;
   w.front() = w.back();
   VERIFY_IS_APPROX(w.front(), w.back());
   v = w;
 
-  typename std::list<MatrixType,Eigen::aligned_allocator<MatrixType> >::iterator vi = v.begin();
-  typename std::list<MatrixType,Eigen::aligned_allocator<MatrixType> >::iterator wi = w.begin();
-  for(int i = 0; i < 20; i++)
-  {
+  typename std::list<MatrixType, Eigen::aligned_allocator<MatrixType> >::iterator vi = v.begin();
+  typename std::list<MatrixType, Eigen::aligned_allocator<MatrixType> >::iterator wi = w.begin();
+  for (int i = 0; i < 20; i++) {
     VERIFY_IS_APPROX(*vi, *wi);
     ++vi;
     ++wi;
   }
 
-  v.resize(21, MatrixType::Zero(rows,cols));  
+  v.resize(21, MatrixType::Zero(rows, cols));
   v.back() = x;
   VERIFY_IS_APPROX(v.back(), x);
-  v.resize(22,y);
+  v.resize(22, y);
   VERIFY_IS_APPROX(v.back(), y);
   v.push_back(x);
   VERIFY_IS_APPROX(v.back(), x);
 }
 
-template<typename TransformType>
-void check_stdlist_transform(const TransformType&)
-{
+template <typename TransformType>
+void check_stdlist_transform(const TransformType&) {
   typedef typename TransformType::MatrixType MatrixType;
-  TransformType x(MatrixType::Random()), y(MatrixType::Random()), ti=TransformType::Identity();
-  std::list<TransformType,Eigen::aligned_allocator<TransformType> > v(10,ti), w(20, y);
+  TransformType x(MatrixType::Random()), y(MatrixType::Random()), ti = TransformType::Identity();
+  std::list<TransformType, Eigen::aligned_allocator<TransformType> > v(10, ti), w(20, y);
   v.front() = x;
   w.front() = w.back();
   VERIFY_IS_APPROX(w.front(), w.back());
   v = w;
 
-  typename std::list<TransformType,Eigen::aligned_allocator<TransformType> >::iterator vi = v.begin();
-  typename std::list<TransformType,Eigen::aligned_allocator<TransformType> >::iterator wi = w.begin();
-  for(int i = 0; i < 20; i++)
-  {
+  typename std::list<TransformType, Eigen::aligned_allocator<TransformType> >::iterator vi = v.begin();
+  typename std::list<TransformType, Eigen::aligned_allocator<TransformType> >::iterator wi = w.begin();
+  for (int i = 0; i < 20; i++) {
     VERIFY_IS_APPROX(*vi, *wi);
     ++vi;
     ++wi;
@@ -65,43 +61,40 @@
   v.resize(21, ti);
   v.back() = x;
   VERIFY_IS_APPROX(v.back(), x);
-  v.resize(22,y);
+  v.resize(22, y);
   VERIFY_IS_APPROX(v.back(), y);
   v.push_back(x);
   VERIFY_IS_APPROX(v.back(), x);
 }
 
-template<typename QuaternionType>
-void check_stdlist_quaternion(const QuaternionType&)
-{
+template <typename QuaternionType>
+void check_stdlist_quaternion(const QuaternionType&) {
   typedef typename QuaternionType::Coefficients Coefficients;
-  QuaternionType x(Coefficients::Random()), y(Coefficients::Random()), qi=QuaternionType::Identity();
-  std::list<QuaternionType,Eigen::aligned_allocator<QuaternionType> > v(10,qi), w(20, y);
+  QuaternionType x(Coefficients::Random()), y(Coefficients::Random()), qi = QuaternionType::Identity();
+  std::list<QuaternionType, Eigen::aligned_allocator<QuaternionType> > v(10, qi), w(20, y);
   v.front() = x;
   w.front() = w.back();
   VERIFY_IS_APPROX(w.front(), w.back());
   v = w;
 
-  typename std::list<QuaternionType,Eigen::aligned_allocator<QuaternionType> >::iterator vi = v.begin();
-  typename std::list<QuaternionType,Eigen::aligned_allocator<QuaternionType> >::iterator wi = w.begin();
-  for(int i = 0; i < 20; i++)
-  {
+  typename std::list<QuaternionType, Eigen::aligned_allocator<QuaternionType> >::iterator vi = v.begin();
+  typename std::list<QuaternionType, Eigen::aligned_allocator<QuaternionType> >::iterator wi = w.begin();
+  for (int i = 0; i < 20; i++) {
     VERIFY_IS_APPROX(*vi, *wi);
     ++vi;
     ++wi;
   }
 
-  v.resize(21,qi);
+  v.resize(21, qi);
   v.back() = x;
   VERIFY_IS_APPROX(v.back(), x);
-  v.resize(22,y);
+  v.resize(22, y);
   VERIFY_IS_APPROX(v.back(), y);
   v.push_back(x);
   VERIFY_IS_APPROX(v.back(), x);
 }
 
-EIGEN_DECLARE_TEST(stdlist)
-{
+EIGEN_DECLARE_TEST(stdlist) {
   // some non vectorizable fixed sizes
   CALL_SUBTEST_1(check_stdlist_matrix(Vector2f()));
   CALL_SUBTEST_1(check_stdlist_matrix(Matrix3f()));
@@ -114,10 +107,10 @@
   CALL_SUBTEST_2(check_stdlist_matrix(Matrix4d()));
 
   // some dynamic sizes
-  CALL_SUBTEST_3(check_stdlist_matrix(MatrixXd(1,1)));
+  CALL_SUBTEST_3(check_stdlist_matrix(MatrixXd(1, 1)));
   CALL_SUBTEST_3(check_stdlist_matrix(VectorXd(20)));
   CALL_SUBTEST_3(check_stdlist_matrix(RowVectorXf(20)));
-  CALL_SUBTEST_3(check_stdlist_matrix(MatrixXcf(10,10)));
+  CALL_SUBTEST_3(check_stdlist_matrix(MatrixXcf(10, 10)));
 
   // some Transform
   CALL_SUBTEST_4(check_stdlist_transform(Affine2f()));
diff --git a/test/stdlist_overload.cpp b/test/stdlist_overload.cpp
index a78516e..77781db 100644
--- a/test/stdlist_overload.cpp
+++ b/test/stdlist_overload.cpp
@@ -26,28 +26,25 @@
 EIGEN_DEFINE_STL_LIST_SPECIALIZATION(Quaterniond)
 
 template <class Container, class Position>
-typename Container::iterator get(Container & c, Position position)
-{
+typename Container::iterator get(Container& c, Position position) {
   typename Container::iterator it = c.begin();
   std::advance(it, position);
   return it;
 }
 
 template <class Container, class Position, class Value>
-void set(Container & c, Position position, const Value & value)
-{
+void set(Container& c, Position position, const Value& value) {
   typename Container::iterator it = c.begin();
   std::advance(it, position);
   *it = value;
 }
 
-template<typename MatrixType>
-void check_stdlist_matrix(const MatrixType& m)
-{
+template <typename MatrixType>
+void check_stdlist_matrix(const MatrixType& m) {
   Index rows = m.rows();
   Index cols = m.cols();
-  MatrixType x = MatrixType::Random(rows,cols), y = MatrixType::Random(rows,cols);
-  std::list<MatrixType> v(10, MatrixType::Zero(rows,cols)), w(20, y);
+  MatrixType x = MatrixType::Random(rows, cols), y = MatrixType::Random(rows, cols);
+  std::list<MatrixType> v(10, MatrixType::Zero(rows, cols)), w(20, y);
   typename std::list<MatrixType>::iterator itv = get(v, 5);
   typename std::list<MatrixType>::iterator itw = get(w, 6);
   *itv = x;
@@ -56,8 +53,7 @@
   v = w;
   itv = v.begin();
   itw = w.begin();
-  for(int i = 0; i < 20; i++)
-  {
+  for (int i = 0; i < 20; i++) {
     VERIFY_IS_APPROX(*itw, *itv);
     ++itv;
     ++itw;
@@ -66,7 +62,7 @@
   v.resize(21);
   set(v, 20, x);
   VERIFY_IS_APPROX(*get(v, 20), x);
-  v.resize(22,y);
+  v.resize(22, y);
   VERIFY_IS_APPROX(*get(v, 21), y);
   v.push_back(x);
   VERIFY_IS_APPROX(*get(v, 22), x);
@@ -74,20 +70,17 @@
   // do a lot of push_back such that the list gets internally resized
   // (with memory reallocation)
   MatrixType* ref = &(*get(w, 0));
-  for(int i=0; i<30 || ((ref==&(*get(w, 0))) && i<300); ++i)
-    v.push_back(*get(w, i%w.size()));
-  for(unsigned int i=23; i<v.size(); ++i)
-  {
-    VERIFY((*get(v, i))==(*get(w, (i-23)%w.size())));
+  for (int i = 0; i < 30 || ((ref == &(*get(w, 0))) && i < 300); ++i) v.push_back(*get(w, i % w.size()));
+  for (unsigned int i = 23; i < v.size(); ++i) {
+    VERIFY((*get(v, i)) == (*get(w, (i - 23) % w.size())));
   }
 }
 
-template<typename TransformType>
-void check_stdlist_transform(const TransformType&)
-{
+template <typename TransformType>
+void check_stdlist_transform(const TransformType&) {
   typedef typename TransformType::MatrixType MatrixType;
-  TransformType x(MatrixType::Random()), y(MatrixType::Random()), ti=TransformType::Identity();
-  std::list<TransformType> v(10,ti), w(20, y);
+  TransformType x(MatrixType::Random()), y(MatrixType::Random()), ti = TransformType::Identity();
+  std::list<TransformType> v(10, ti), w(20, y);
   typename std::list<TransformType>::iterator itv = get(v, 5);
   typename std::list<TransformType>::iterator itw = get(w, 6);
   *itv = x;
@@ -96,8 +89,7 @@
   v = w;
   itv = v.begin();
   itw = w.begin();
-  for(int i = 0; i < 20; i++)
-  {
+  for (int i = 0; i < 20; i++) {
     VERIFY_IS_APPROX(*itw, *itv);
     ++itv;
     ++itw;
@@ -106,7 +98,7 @@
   v.resize(21, ti);
   set(v, 20, x);
   VERIFY_IS_APPROX(*get(v, 20), x);
-  v.resize(22,y);
+  v.resize(22, y);
   VERIFY_IS_APPROX(*get(v, 21), y);
   v.push_back(x);
   VERIFY_IS_APPROX(*get(v, 22), x);
@@ -114,20 +106,17 @@
   // do a lot of push_back such that the list gets internally resized
   // (with memory reallocation)
   TransformType* ref = &(*get(w, 0));
-  for(int i=0; i<30 || ((ref==&(*get(w, 0))) && i<300); ++i)
-    v.push_back(*get(w, i%w.size()));
-  for(unsigned int i=23; i<v.size(); ++i)
-  {
-    VERIFY(get(v, i)->matrix()==get(w, (i-23)%w.size())->matrix());
+  for (int i = 0; i < 30 || ((ref == &(*get(w, 0))) && i < 300); ++i) v.push_back(*get(w, i % w.size()));
+  for (unsigned int i = 23; i < v.size(); ++i) {
+    VERIFY(get(v, i)->matrix() == get(w, (i - 23) % w.size())->matrix());
   }
 }
 
-template<typename QuaternionType>
-void check_stdlist_quaternion(const QuaternionType&)
-{
+template <typename QuaternionType>
+void check_stdlist_quaternion(const QuaternionType&) {
   typedef typename QuaternionType::Coefficients Coefficients;
-  QuaternionType x(Coefficients::Random()), y(Coefficients::Random()), qi=QuaternionType::Identity();
-  std::list<QuaternionType> v(10,qi), w(20, y);
+  QuaternionType x(Coefficients::Random()), y(Coefficients::Random()), qi = QuaternionType::Identity();
+  std::list<QuaternionType> v(10, qi), w(20, y);
   typename std::list<QuaternionType>::iterator itv = get(v, 5);
   typename std::list<QuaternionType>::iterator itw = get(w, 6);
   *itv = x;
@@ -136,17 +125,16 @@
   v = w;
   itv = v.begin();
   itw = w.begin();
-  for(int i = 0; i < 20; i++)
-  {
+  for (int i = 0; i < 20; i++) {
     VERIFY_IS_APPROX(*itw, *itv);
     ++itv;
     ++itw;
   }
 
-  v.resize(21,qi);
+  v.resize(21, qi);
   set(v, 20, x);
   VERIFY_IS_APPROX(*get(v, 20), x);
-  v.resize(22,y);
+  v.resize(22, y);
   VERIFY_IS_APPROX(*get(v, 21), y);
   v.push_back(x);
   VERIFY_IS_APPROX(*get(v, 22), x);
@@ -154,16 +142,13 @@
   // do a lot of push_back such that the list gets internally resized
   // (with memory reallocation)
   QuaternionType* ref = &(*get(w, 0));
-  for(int i=0; i<30 || ((ref==&(*get(w, 0))) && i<300); ++i)
-    v.push_back(*get(w, i%w.size()));
-  for(unsigned int i=23; i<v.size(); ++i)
-  {
-    VERIFY(get(v, i)->coeffs()==get(w, (i-23)%w.size())->coeffs());
+  for (int i = 0; i < 30 || ((ref == &(*get(w, 0))) && i < 300); ++i) v.push_back(*get(w, i % w.size()));
+  for (unsigned int i = 23; i < v.size(); ++i) {
+    VERIFY(get(v, i)->coeffs() == get(w, (i - 23) % w.size())->coeffs());
   }
 }
 
-EIGEN_DECLARE_TEST(stdlist_overload)
-{
+EIGEN_DECLARE_TEST(stdlist_overload) {
   // some non vectorizable fixed sizes
   CALL_SUBTEST_1(check_stdlist_matrix(Vector2f()));
   CALL_SUBTEST_1(check_stdlist_matrix(Matrix3f()));
@@ -176,13 +161,13 @@
   CALL_SUBTEST_2(check_stdlist_matrix(Matrix4d()));
 
   // some dynamic sizes
-  CALL_SUBTEST_3(check_stdlist_matrix(MatrixXd(1,1)));
+  CALL_SUBTEST_3(check_stdlist_matrix(MatrixXd(1, 1)));
   CALL_SUBTEST_3(check_stdlist_matrix(VectorXd(20)));
   CALL_SUBTEST_3(check_stdlist_matrix(RowVectorXf(20)));
-  CALL_SUBTEST_3(check_stdlist_matrix(MatrixXcf(10,10)));
+  CALL_SUBTEST_3(check_stdlist_matrix(MatrixXcf(10, 10)));
 
   // some Transform
-  CALL_SUBTEST_4(check_stdlist_transform(Affine2f())); // does not need the specialization (2+1)^2 = 9
+  CALL_SUBTEST_4(check_stdlist_transform(Affine2f()));  // does not need the specialization (2+1)^2 = 9
   CALL_SUBTEST_4(check_stdlist_transform(Affine3f()));
   CALL_SUBTEST_4(check_stdlist_transform(Affine3d()));
 
diff --git a/test/stdvector.cpp b/test/stdvector.cpp
index 1d44e42..93acfa5 100644
--- a/test/stdvector.cpp
+++ b/test/stdvector.cpp
@@ -11,124 +11,110 @@
 #include <Eigen/StdVector>
 #include <Eigen/Geometry>
 
-template<typename MatrixType>
-void check_stdvector_matrix(const MatrixType& m)
-{
+template <typename MatrixType>
+void check_stdvector_matrix(const MatrixType& m) {
   Index rows = m.rows();
   Index cols = m.cols();
-  MatrixType x = MatrixType::Random(rows,cols), y = MatrixType::Random(rows,cols);
-  std::vector<MatrixType,Eigen::aligned_allocator<MatrixType> > v(10, MatrixType::Zero(rows,cols)), w(20, y);
+  MatrixType x = MatrixType::Random(rows, cols), y = MatrixType::Random(rows, cols);
+  std::vector<MatrixType, Eigen::aligned_allocator<MatrixType> > v(10, MatrixType::Zero(rows, cols)), w(20, y);
   v[5] = x;
   w[6] = v[5];
   VERIFY_IS_APPROX(w[6], v[5]);
   v = w;
-  for(int i = 0; i < 20; i++)
-  {
+  for (int i = 0; i < 20; i++) {
     VERIFY_IS_APPROX(w[i], v[i]);
   }
 
   v.resize(21);
   v[20] = x;
   VERIFY_IS_APPROX(v[20], x);
-  v.resize(22,y);
+  v.resize(22, y);
   VERIFY_IS_APPROX(v[21], y);
   v.push_back(x);
   VERIFY_IS_APPROX(v[22], x);
-  VERIFY((std::uintptr_t)&(v[22]) == (std::uintptr_t)&(v[21]) + sizeof(MatrixType));
+  VERIFY((std::uintptr_t) & (v[22]) == (std::uintptr_t) & (v[21]) + sizeof(MatrixType));
 
   // do a lot of push_back such that the vector gets internally resized
   // (with memory reallocation)
   MatrixType* ref = &w[0];
-  for(int i=0; i<30 || ((ref==&w[0]) && i<300); ++i)
-    v.push_back(w[i%w.size()]);
-  for(unsigned int i=23; i<v.size(); ++i)
-  {
-    VERIFY(v[i]==w[(i-23)%w.size()]);
+  for (int i = 0; i < 30 || ((ref == &w[0]) && i < 300); ++i) v.push_back(w[i % w.size()]);
+  for (unsigned int i = 23; i < v.size(); ++i) {
+    VERIFY(v[i] == w[(i - 23) % w.size()]);
   }
 }
 
-template<typename TransformType>
-void check_stdvector_transform(const TransformType&)
-{
+template <typename TransformType>
+void check_stdvector_transform(const TransformType&) {
   typedef typename TransformType::MatrixType MatrixType;
   TransformType x(MatrixType::Random()), y(MatrixType::Random());
-  std::vector<TransformType,Eigen::aligned_allocator<TransformType> > v(10), w(20, y);
+  std::vector<TransformType, Eigen::aligned_allocator<TransformType> > v(10), w(20, y);
   v[5] = x;
   w[6] = v[5];
   VERIFY_IS_APPROX(w[6], v[5]);
   v = w;
-  for(int i = 0; i < 20; i++)
-  {
+  for (int i = 0; i < 20; i++) {
     VERIFY_IS_APPROX(w[i], v[i]);
   }
 
   v.resize(21);
   v[20] = x;
   VERIFY_IS_APPROX(v[20], x);
-  v.resize(22,y);
+  v.resize(22, y);
   VERIFY_IS_APPROX(v[21], y);
   v.push_back(x);
   VERIFY_IS_APPROX(v[22], x);
-  VERIFY((std::uintptr_t)&(v[22]) == (std::uintptr_t)&(v[21]) + sizeof(TransformType));
+  VERIFY((std::uintptr_t) & (v[22]) == (std::uintptr_t) & (v[21]) + sizeof(TransformType));
 
   // do a lot of push_back such that the vector gets internally resized
   // (with memory reallocation)
   TransformType* ref = &w[0];
-  for(int i=0; i<30 || ((ref==&w[0]) && i<300); ++i)
-    v.push_back(w[i%w.size()]);
-  for(unsigned int i=23; i<v.size(); ++i)
-  {
-    VERIFY(v[i].matrix()==w[(i-23)%w.size()].matrix());
+  for (int i = 0; i < 30 || ((ref == &w[0]) && i < 300); ++i) v.push_back(w[i % w.size()]);
+  for (unsigned int i = 23; i < v.size(); ++i) {
+    VERIFY(v[i].matrix() == w[(i - 23) % w.size()].matrix());
   }
 }
 
-template<typename QuaternionType>
-void check_stdvector_quaternion(const QuaternionType&)
-{
+template <typename QuaternionType>
+void check_stdvector_quaternion(const QuaternionType&) {
   typedef typename QuaternionType::Coefficients Coefficients;
-  QuaternionType x(Coefficients::Random()), y(Coefficients::Random()), qi=QuaternionType::Identity();
-  std::vector<QuaternionType,Eigen::aligned_allocator<QuaternionType> > v(10,qi), w(20, y);
+  QuaternionType x(Coefficients::Random()), y(Coefficients::Random()), qi = QuaternionType::Identity();
+  std::vector<QuaternionType, Eigen::aligned_allocator<QuaternionType> > v(10, qi), w(20, y);
   v[5] = x;
   w[6] = v[5];
   VERIFY_IS_APPROX(w[6], v[5]);
   v = w;
-  for(int i = 0; i < 20; i++)
-  {
+  for (int i = 0; i < 20; i++) {
     VERIFY_IS_APPROX(w[i], v[i]);
   }
 
   v.resize(21);
   v[20] = x;
   VERIFY_IS_APPROX(v[20], x);
-  v.resize(22,y);
+  v.resize(22, y);
   VERIFY_IS_APPROX(v[21], y);
   v.push_back(x);
   VERIFY_IS_APPROX(v[22], x);
-  VERIFY((std::uintptr_t)&(v[22]) == (std::uintptr_t)&(v[21]) + sizeof(QuaternionType));
+  VERIFY((std::uintptr_t) & (v[22]) == (std::uintptr_t) & (v[21]) + sizeof(QuaternionType));
 
   // do a lot of push_back such that the vector gets internally resized
   // (with memory reallocation)
   QuaternionType* ref = &w[0];
-  for(int i=0; i<30 || ((ref==&w[0]) && i<300); ++i)
-    v.push_back(w[i%w.size()]);
-  for(unsigned int i=23; i<v.size(); ++i)
-  {
-    VERIFY(v[i].coeffs()==w[(i-23)%w.size()].coeffs());
+  for (int i = 0; i < 30 || ((ref == &w[0]) && i < 300); ++i) v.push_back(w[i % w.size()]);
+  for (unsigned int i = 23; i < v.size(); ++i) {
+    VERIFY(v[i].coeffs() == w[(i - 23) % w.size()].coeffs());
   }
 }
 
 // the code below triggered an invalid warning with gcc >= 7
-// eigen/Eigen/src/Core/util/Memory.h:189:12: warning: argument 1 value '18446744073709551612' exceeds maximum object size 9223372036854775807
-// This has been reported to gcc there: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87544
-void std_vector_gcc_warning()
-{
+// eigen/Eigen/src/Core/util/Memory.h:189:12: warning: argument 1 value '18446744073709551612' exceeds maximum object
+// size 9223372036854775807 This has been reported to gcc there: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87544
+void std_vector_gcc_warning() {
   typedef Eigen::Vector3f T;
   std::vector<T, Eigen::aligned_allocator<T> > v;
-  v.push_back(T(1.0f,2.0f,3.0f));
+  v.push_back(T(1.0f, 2.0f, 3.0f));
 }
 
-EIGEN_DECLARE_TEST(stdvector)
-{
+EIGEN_DECLARE_TEST(stdvector) {
   // some non vectorizable fixed sizes
   CALL_SUBTEST_1(check_stdvector_matrix(Vector2f()));
   CALL_SUBTEST_1(check_stdvector_matrix(Matrix3f()));
@@ -141,16 +127,16 @@
   CALL_SUBTEST_2(check_stdvector_matrix(Matrix4d()));
 
   // some dynamic sizes
-  CALL_SUBTEST_3(check_stdvector_matrix(MatrixXd(1,1)));
+  CALL_SUBTEST_3(check_stdvector_matrix(MatrixXd(1, 1)));
   CALL_SUBTEST_3(check_stdvector_matrix(VectorXd(20)));
   CALL_SUBTEST_3(check_stdvector_matrix(RowVectorXf(20)));
-  CALL_SUBTEST_3(check_stdvector_matrix(MatrixXcf(10,10)));
+  CALL_SUBTEST_3(check_stdvector_matrix(MatrixXcf(10, 10)));
 
   // some Transform
   CALL_SUBTEST_4(check_stdvector_transform(Projective2f()));
   CALL_SUBTEST_4(check_stdvector_transform(Projective3f()));
   CALL_SUBTEST_4(check_stdvector_transform(Projective3d()));
-  //CALL_SUBTEST(heck_stdvector_transform(Projective4d()));
+  // CALL_SUBTEST(heck_stdvector_transform(Projective4d()));
 
   // some Quaternion
   CALL_SUBTEST_5(check_stdvector_quaternion(Quaternionf()));
diff --git a/test/stdvector_overload.cpp b/test/stdvector_overload.cpp
index 2fbbb31..57d06ca 100644
--- a/test/stdvector_overload.cpp
+++ b/test/stdvector_overload.cpp
@@ -25,45 +25,40 @@
 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Quaternionf)
 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Quaterniond)
 
-template<typename MatrixType>
-void check_stdvector_matrix(const MatrixType& m)
-{
+template <typename MatrixType>
+void check_stdvector_matrix(const MatrixType& m) {
   Index rows = m.rows();
   Index cols = m.cols();
-  MatrixType x = MatrixType::Random(rows,cols), y = MatrixType::Random(rows,cols);
-  std::vector<MatrixType> v(10, MatrixType::Zero(rows,cols)), w(20, y);
+  MatrixType x = MatrixType::Random(rows, cols), y = MatrixType::Random(rows, cols);
+  std::vector<MatrixType> v(10, MatrixType::Zero(rows, cols)), w(20, y);
   v[5] = x;
   w[6] = v[5];
   VERIFY_IS_APPROX(w[6], v[5]);
   v = w;
-  for(int i = 0; i < 20; i++)
-  {
+  for (int i = 0; i < 20; i++) {
     VERIFY_IS_APPROX(w[i], v[i]);
   }
 
   v.resize(21);
   v[20] = x;
   VERIFY_IS_APPROX(v[20], x);
-  v.resize(22,y);
+  v.resize(22, y);
   VERIFY_IS_APPROX(v[21], y);
   v.push_back(x);
   VERIFY_IS_APPROX(v[22], x);
-  VERIFY((std::uintptr_t)&(v[22]) == (std::uintptr_t)&(v[21]) + sizeof(MatrixType));
+  VERIFY((std::uintptr_t) & (v[22]) == (std::uintptr_t) & (v[21]) + sizeof(MatrixType));
 
   // do a lot of push_back such that the vector gets internally resized
   // (with memory reallocation)
   MatrixType* ref = &w[0];
-  for(int i=0; i<30 || ((ref==&w[0]) && i<300); ++i)
-    v.push_back(w[i%w.size()]);
-  for(unsigned int i=23; i<v.size(); ++i)
-  {
-    VERIFY(v[i]==w[(i-23)%w.size()]);
+  for (int i = 0; i < 30 || ((ref == &w[0]) && i < 300); ++i) v.push_back(w[i % w.size()]);
+  for (unsigned int i = 23; i < v.size(); ++i) {
+    VERIFY(v[i] == w[(i - 23) % w.size()]);
   }
 }
 
-template<typename TransformType>
-void check_stdvector_transform(const TransformType&)
-{
+template <typename TransformType>
+void check_stdvector_transform(const TransformType&) {
   typedef typename TransformType::MatrixType MatrixType;
   TransformType x(MatrixType::Random()), y(MatrixType::Random());
   std::vector<TransformType> v(10), w(20, y);
@@ -71,68 +66,60 @@
   w[6] = v[5];
   VERIFY_IS_APPROX(w[6], v[5]);
   v = w;
-  for(int i = 0; i < 20; i++)
-  {
+  for (int i = 0; i < 20; i++) {
     VERIFY_IS_APPROX(w[i], v[i]);
   }
 
   v.resize(21);
   v[20] = x;
   VERIFY_IS_APPROX(v[20], x);
-  v.resize(22,y);
+  v.resize(22, y);
   VERIFY_IS_APPROX(v[21], y);
   v.push_back(x);
   VERIFY_IS_APPROX(v[22], x);
-  VERIFY((std::uintptr_t)&(v[22]) == (std::uintptr_t)&(v[21]) + sizeof(TransformType));
+  VERIFY((std::uintptr_t) & (v[22]) == (std::uintptr_t) & (v[21]) + sizeof(TransformType));
 
   // do a lot of push_back such that the vector gets internally resized
   // (with memory reallocation)
   TransformType* ref = &w[0];
-  for(int i=0; i<30 || ((ref==&w[0]) && i<300); ++i)
-    v.push_back(w[i%w.size()]);
-  for(unsigned int i=23; i<v.size(); ++i)
-  {
-    VERIFY(v[i].matrix()==w[(i-23)%w.size()].matrix());
+  for (int i = 0; i < 30 || ((ref == &w[0]) && i < 300); ++i) v.push_back(w[i % w.size()]);
+  for (unsigned int i = 23; i < v.size(); ++i) {
+    VERIFY(v[i].matrix() == w[(i - 23) % w.size()].matrix());
   }
 }
 
-template<typename QuaternionType>
-void check_stdvector_quaternion(const QuaternionType&)
-{
+template <typename QuaternionType>
+void check_stdvector_quaternion(const QuaternionType&) {
   typedef typename QuaternionType::Coefficients Coefficients;
-  QuaternionType x(Coefficients::Random()), y(Coefficients::Random()), qi=QuaternionType::Identity();
-  std::vector<QuaternionType> v(10,qi), w(20, y);
+  QuaternionType x(Coefficients::Random()), y(Coefficients::Random()), qi = QuaternionType::Identity();
+  std::vector<QuaternionType> v(10, qi), w(20, y);
   v[5] = x;
   w[6] = v[5];
   VERIFY_IS_APPROX(w[6], v[5]);
   v = w;
-  for(int i = 0; i < 20; i++)
-  {
+  for (int i = 0; i < 20; i++) {
     VERIFY_IS_APPROX(w[i], v[i]);
   }
 
   v.resize(21);
   v[20] = x;
   VERIFY_IS_APPROX(v[20], x);
-  v.resize(22,y);
+  v.resize(22, y);
   VERIFY_IS_APPROX(v[21], y);
   v.push_back(x);
   VERIFY_IS_APPROX(v[22], x);
-  VERIFY((std::uintptr_t)&(v[22]) == (std::uintptr_t)&(v[21]) + sizeof(QuaternionType));
+  VERIFY((std::uintptr_t) & (v[22]) == (std::uintptr_t) & (v[21]) + sizeof(QuaternionType));
 
   // do a lot of push_back such that the vector gets internally resized
   // (with memory reallocation)
   QuaternionType* ref = &w[0];
-  for(int i=0; i<30 || ((ref==&w[0]) && i<300); ++i)
-    v.push_back(w[i%w.size()]);
-  for(unsigned int i=23; i<v.size(); ++i)
-  {
-    VERIFY(v[i].coeffs()==w[(i-23)%w.size()].coeffs());
+  for (int i = 0; i < 30 || ((ref == &w[0]) && i < 300); ++i) v.push_back(w[i % w.size()]);
+  for (unsigned int i = 23; i < v.size(); ++i) {
+    VERIFY(v[i].coeffs() == w[(i - 23) % w.size()].coeffs());
   }
 }
 
-EIGEN_DECLARE_TEST(stdvector_overload)
-{
+EIGEN_DECLARE_TEST(stdvector_overload) {
   // some non vectorizable fixed sizes
   CALL_SUBTEST_1(check_stdvector_matrix(Vector2f()));
   CALL_SUBTEST_1(check_stdvector_matrix(Matrix3f()));
@@ -145,13 +132,13 @@
   CALL_SUBTEST_2(check_stdvector_matrix(Matrix4d()));
 
   // some dynamic sizes
-  CALL_SUBTEST_3(check_stdvector_matrix(MatrixXd(1,1)));
+  CALL_SUBTEST_3(check_stdvector_matrix(MatrixXd(1, 1)));
   CALL_SUBTEST_3(check_stdvector_matrix(VectorXd(20)));
   CALL_SUBTEST_3(check_stdvector_matrix(RowVectorXf(20)));
-  CALL_SUBTEST_3(check_stdvector_matrix(MatrixXcf(10,10)));
+  CALL_SUBTEST_3(check_stdvector_matrix(MatrixXcf(10, 10)));
 
   // some Transform
-  CALL_SUBTEST_4(check_stdvector_transform(Affine2f())); // does not need the specialization (2+1)^2 = 9
+  CALL_SUBTEST_4(check_stdvector_transform(Affine2f()));  // does not need the specialization (2+1)^2 = 9
   CALL_SUBTEST_4(check_stdvector_transform(Affine3f()));
   CALL_SUBTEST_4(check_stdvector_transform(Affine3d()));
 
diff --git a/test/stl_iterators.cpp b/test/stl_iterators.cpp
index 121eb86..7a62673 100644
--- a/test/stl_iterators.cpp
+++ b/test/stl_iterators.cpp
@@ -11,48 +11,56 @@
 #include <iterator>
 #include <numeric>
 
-template< class Iterator >
-std::reverse_iterator<Iterator>
-make_reverse_iterator( Iterator i )
-{
+template <class Iterator>
+std::reverse_iterator<Iterator> make_reverse_iterator(Iterator i) {
   return std::reverse_iterator<Iterator>(i);
 }
 
 using std::is_sorted;
 
-template<typename XprType>
-bool is_pointer_based_stl_iterator(const internal::pointer_based_stl_iterator<XprType> &) { return true; }
+template <typename XprType>
+bool is_pointer_based_stl_iterator(const internal::pointer_based_stl_iterator<XprType>&) {
+  return true;
+}
 
-template<typename XprType>
-bool is_generic_randaccess_stl_iterator(const internal::generic_randaccess_stl_iterator<XprType> &) { return true; }
+template <typename XprType>
+bool is_generic_randaccess_stl_iterator(const internal::generic_randaccess_stl_iterator<XprType>&) {
+  return true;
+}
 
-template<typename Iter>
-bool is_default_constructible_and_assignable(const Iter& it)
-{
+template <typename Iter>
+bool is_default_constructible_and_assignable(const Iter& it) {
   VERIFY(std::is_default_constructible<Iter>::value);
   VERIFY(std::is_nothrow_default_constructible<Iter>::value);
   Iter it2;
   it2 = it;
-  return (it==it2);
+  return (it == it2);
 }
 
-template<typename Xpr>
-void check_begin_end_for_loop(Xpr xpr)
-{
+template <typename Xpr>
+void check_begin_end_for_loop(Xpr xpr) {
   const Xpr& cxpr(xpr);
   Index i = 0;
 
   i = 0;
-  for(typename Xpr::iterator it = xpr.begin(); it!=xpr.end(); ++it) { VERIFY_IS_EQUAL(*it,xpr[i++]); }
+  for (typename Xpr::iterator it = xpr.begin(); it != xpr.end(); ++it) {
+    VERIFY_IS_EQUAL(*it, xpr[i++]);
+  }
 
   i = 0;
-  for(typename Xpr::const_iterator it = xpr.cbegin(); it!=xpr.cend(); ++it) { VERIFY_IS_EQUAL(*it,xpr[i++]); }
+  for (typename Xpr::const_iterator it = xpr.cbegin(); it != xpr.cend(); ++it) {
+    VERIFY_IS_EQUAL(*it, xpr[i++]);
+  }
 
   i = 0;
-  for(typename Xpr::const_iterator it = cxpr.begin(); it!=cxpr.end(); ++it) { VERIFY_IS_EQUAL(*it,xpr[i++]); }
+  for (typename Xpr::const_iterator it = cxpr.begin(); it != cxpr.end(); ++it) {
+    VERIFY_IS_EQUAL(*it, xpr[i++]);
+  }
 
   i = 0;
-  for(typename Xpr::const_iterator it = xpr.begin(); it!=xpr.end(); ++it) { VERIFY_IS_EQUAL(*it,xpr[i++]); }
+  for (typename Xpr::const_iterator it = xpr.begin(); it != xpr.end(); ++it) {
+    VERIFY_IS_EQUAL(*it, xpr[i++]);
+  }
 
   {
     // simple API check
@@ -60,24 +68,24 @@
     cit = xpr.cbegin();
 
     auto tmp1 = xpr.begin();
-    VERIFY(tmp1==xpr.begin());
+    VERIFY(tmp1 == xpr.begin());
     auto tmp2 = xpr.cbegin();
-    VERIFY(tmp2==xpr.cbegin());
+    VERIFY(tmp2 == xpr.cbegin());
   }
 
-  VERIFY( xpr.end() -xpr.begin()  == xpr.size() );
-  VERIFY( xpr.cend()-xpr.begin()  == xpr.size() );
-  VERIFY( xpr.end() -xpr.cbegin() == xpr.size() );
-  VERIFY( xpr.cend()-xpr.cbegin() == xpr.size() );
+  VERIFY(xpr.end() - xpr.begin() == xpr.size());
+  VERIFY(xpr.cend() - xpr.begin() == xpr.size());
+  VERIFY(xpr.end() - xpr.cbegin() == xpr.size());
+  VERIFY(xpr.cend() - xpr.cbegin() == xpr.size());
 
-  if(xpr.size()>0) {
+  if (xpr.size() > 0) {
     VERIFY(xpr.begin() != xpr.end());
     VERIFY(xpr.begin() < xpr.end());
     VERIFY(xpr.begin() <= xpr.end());
     VERIFY(!(xpr.begin() == xpr.end()));
     VERIFY(!(xpr.begin() > xpr.end()));
     VERIFY(!(xpr.begin() >= xpr.end()));
-    
+
     VERIFY(xpr.cbegin() != xpr.end());
     VERIFY(xpr.cbegin() < xpr.end());
     VERIFY(xpr.cbegin() <= xpr.end());
@@ -94,74 +102,73 @@
   }
 }
 
-template<typename Scalar, int Rows, int Cols>
-void test_stl_iterators(int rows=Rows, int cols=Cols)
-{
-  typedef Matrix<Scalar,Rows,1> VectorType;
-  typedef Matrix<Scalar,1,Cols> RowVectorType;
-  typedef Matrix<Scalar,Rows,Cols,ColMajor> ColMatrixType;
-  typedef Matrix<Scalar,Rows,Cols,RowMajor> RowMatrixType;
+template <typename Scalar, int Rows, int Cols>
+void test_stl_iterators(int rows = Rows, int cols = Cols) {
+  typedef Matrix<Scalar, Rows, 1> VectorType;
+  typedef Matrix<Scalar, 1, Cols> RowVectorType;
+  typedef Matrix<Scalar, Rows, Cols, ColMajor> ColMatrixType;
+  typedef Matrix<Scalar, Rows, Cols, RowMajor> RowMatrixType;
   VectorType v = VectorType::Random(rows);
   const VectorType& cv(v);
-  ColMatrixType A = ColMatrixType::Random(rows,cols);
+  ColMatrixType A = ColMatrixType::Random(rows, cols);
   const ColMatrixType& cA(A);
-  RowMatrixType B = RowMatrixType::Random(rows,cols);
+  RowMatrixType B = RowMatrixType::Random(rows, cols);
   using Eigen::placeholders::last;
-  
+
   Index i, j;
 
   // Verify that iterators are default constructible (See bug #1900)
   {
-    VERIFY( is_default_constructible_and_assignable(v.begin()));
-    VERIFY( is_default_constructible_and_assignable(v.end()));
-    VERIFY( is_default_constructible_and_assignable(cv.begin()));
-    VERIFY( is_default_constructible_and_assignable(cv.end()));
+    VERIFY(is_default_constructible_and_assignable(v.begin()));
+    VERIFY(is_default_constructible_and_assignable(v.end()));
+    VERIFY(is_default_constructible_and_assignable(cv.begin()));
+    VERIFY(is_default_constructible_and_assignable(cv.end()));
 
-    VERIFY( is_default_constructible_and_assignable(A.row(0).begin()));
-    VERIFY( is_default_constructible_and_assignable(A.row(0).end()));
-    VERIFY( is_default_constructible_and_assignable(cA.row(0).begin()));
-    VERIFY( is_default_constructible_and_assignable(cA.row(0).end()));
+    VERIFY(is_default_constructible_and_assignable(A.row(0).begin()));
+    VERIFY(is_default_constructible_and_assignable(A.row(0).end()));
+    VERIFY(is_default_constructible_and_assignable(cA.row(0).begin()));
+    VERIFY(is_default_constructible_and_assignable(cA.row(0).end()));
 
-    VERIFY( is_default_constructible_and_assignable(B.row(0).begin()));
-    VERIFY( is_default_constructible_and_assignable(B.row(0).end()));
+    VERIFY(is_default_constructible_and_assignable(B.row(0).begin()));
+    VERIFY(is_default_constructible_and_assignable(B.row(0).end()));
   }
 
   // Check we got a fast pointer-based iterator when expected
   {
-    VERIFY( is_pointer_based_stl_iterator(v.begin()) );
-    VERIFY( is_pointer_based_stl_iterator(v.end()) );
-    VERIFY( is_pointer_based_stl_iterator(cv.begin()) );
-    VERIFY( is_pointer_based_stl_iterator(cv.end()) );
+    VERIFY(is_pointer_based_stl_iterator(v.begin()));
+    VERIFY(is_pointer_based_stl_iterator(v.end()));
+    VERIFY(is_pointer_based_stl_iterator(cv.begin()));
+    VERIFY(is_pointer_based_stl_iterator(cv.end()));
 
-    j = internal::random<Index>(0,A.cols()-1);
-    VERIFY( is_pointer_based_stl_iterator(A.col(j).begin()) );
-    VERIFY( is_pointer_based_stl_iterator(A.col(j).end()) );
-    VERIFY( is_pointer_based_stl_iterator(cA.col(j).begin()) );
-    VERIFY( is_pointer_based_stl_iterator(cA.col(j).end()) );
+    j = internal::random<Index>(0, A.cols() - 1);
+    VERIFY(is_pointer_based_stl_iterator(A.col(j).begin()));
+    VERIFY(is_pointer_based_stl_iterator(A.col(j).end()));
+    VERIFY(is_pointer_based_stl_iterator(cA.col(j).begin()));
+    VERIFY(is_pointer_based_stl_iterator(cA.col(j).end()));
 
-    i = internal::random<Index>(0,A.rows()-1);
-    VERIFY( is_pointer_based_stl_iterator(A.row(i).begin()) );
-    VERIFY( is_pointer_based_stl_iterator(A.row(i).end()) );
-    VERIFY( is_pointer_based_stl_iterator(cA.row(i).begin()) );
-    VERIFY( is_pointer_based_stl_iterator(cA.row(i).end()) );
+    i = internal::random<Index>(0, A.rows() - 1);
+    VERIFY(is_pointer_based_stl_iterator(A.row(i).begin()));
+    VERIFY(is_pointer_based_stl_iterator(A.row(i).end()));
+    VERIFY(is_pointer_based_stl_iterator(cA.row(i).begin()));
+    VERIFY(is_pointer_based_stl_iterator(cA.row(i).end()));
 
-    VERIFY( is_pointer_based_stl_iterator(A.reshaped().begin()) );
-    VERIFY( is_pointer_based_stl_iterator(A.reshaped().end()) );
-    VERIFY( is_pointer_based_stl_iterator(cA.reshaped().begin()) );
-    VERIFY( is_pointer_based_stl_iterator(cA.reshaped().end()) );
+    VERIFY(is_pointer_based_stl_iterator(A.reshaped().begin()));
+    VERIFY(is_pointer_based_stl_iterator(A.reshaped().end()));
+    VERIFY(is_pointer_based_stl_iterator(cA.reshaped().begin()));
+    VERIFY(is_pointer_based_stl_iterator(cA.reshaped().end()));
 
-    VERIFY( is_pointer_based_stl_iterator(B.template reshaped<AutoOrder>().begin()) );
-    VERIFY( is_pointer_based_stl_iterator(B.template reshaped<AutoOrder>().end()) );
+    VERIFY(is_pointer_based_stl_iterator(B.template reshaped<AutoOrder>().begin()));
+    VERIFY(is_pointer_based_stl_iterator(B.template reshaped<AutoOrder>().end()));
 
-    VERIFY( is_generic_randaccess_stl_iterator(A.template reshaped<RowMajor>().begin()) );
-    VERIFY( is_generic_randaccess_stl_iterator(A.template reshaped<RowMajor>().end()) );
+    VERIFY(is_generic_randaccess_stl_iterator(A.template reshaped<RowMajor>().begin()));
+    VERIFY(is_generic_randaccess_stl_iterator(A.template reshaped<RowMajor>().end()));
   }
 
   {
     check_begin_end_for_loop(v);
-    check_begin_end_for_loop(A.col(internal::random<Index>(0,A.cols()-1)));
-    check_begin_end_for_loop(A.row(internal::random<Index>(0,A.rows()-1)));
-    check_begin_end_for_loop(v+v);
+    check_begin_end_for_loop(A.col(internal::random<Index>(0, A.cols() - 1)));
+    check_begin_end_for_loop(A.row(internal::random<Index>(0, A.rows() - 1)));
+    check_begin_end_for_loop(v + v);
   }
 
   // check swappable
@@ -171,13 +178,13 @@
     {
       VectorType v_copy = v;
       auto a = v.begin();
-      auto b = v.end()-1;
-      swap(a,b);
-      VERIFY_IS_EQUAL(v,v_copy);
-      VERIFY_IS_EQUAL(*b,*v.begin());
-      VERIFY_IS_EQUAL(*b,v(0));
-      VERIFY_IS_EQUAL(*a,v.end()[-1]);
-      VERIFY_IS_EQUAL(*a,v(last));
+      auto b = v.end() - 1;
+      swap(a, b);
+      VERIFY_IS_EQUAL(v, v_copy);
+      VERIFY_IS_EQUAL(*b, *v.begin());
+      VERIFY_IS_EQUAL(*b, v(0));
+      VERIFY_IS_EQUAL(*a, v.end()[-1]);
+      VERIFY_IS_EQUAL(*a, v(last));
     }
 
     // generic
@@ -185,178 +192,200 @@
       RowMatrixType B_copy = B;
       auto Br = B.reshaped();
       auto a = Br.begin();
-      auto b = Br.end()-1;
-      swap(a,b);
-      VERIFY_IS_EQUAL(B,B_copy);
-      VERIFY_IS_EQUAL(*b,*Br.begin());
-      VERIFY_IS_EQUAL(*b,Br(0));
-      VERIFY_IS_EQUAL(*a,Br.end()[-1]);
-      VERIFY_IS_EQUAL(*a,Br(last));
+      auto b = Br.end() - 1;
+      swap(a, b);
+      VERIFY_IS_EQUAL(B, B_copy);
+      VERIFY_IS_EQUAL(*b, *Br.begin());
+      VERIFY_IS_EQUAL(*b, Br(0));
+      VERIFY_IS_EQUAL(*a, Br.end()[-1]);
+      VERIFY_IS_EQUAL(*a, Br(last));
     }
   }
 
   // check non-const iterator with for-range loops
   {
     i = 0;
-    for(auto x : v) { VERIFY_IS_EQUAL(x,v[i++]); }
+    for (auto x : v) {
+      VERIFY_IS_EQUAL(x, v[i++]);
+    }
 
-    j = internal::random<Index>(0,A.cols()-1);
+    j = internal::random<Index>(0, A.cols() - 1);
     i = 0;
-    for(auto x : A.col(j)) { VERIFY_IS_EQUAL(x,A(i++,j)); }
+    for (auto x : A.col(j)) {
+      VERIFY_IS_EQUAL(x, A(i++, j));
+    }
 
     i = 0;
-    for(auto x : (v+A.col(j))) { VERIFY_IS_APPROX(x,v(i)+A(i,j)); ++i; }
+    for (auto x : (v + A.col(j))) {
+      VERIFY_IS_APPROX(x, v(i) + A(i, j));
+      ++i;
+    }
 
     j = 0;
-    i = internal::random<Index>(0,A.rows()-1);
-    for(auto x : A.row(i)) { VERIFY_IS_EQUAL(x,A(i,j++)); }
+    i = internal::random<Index>(0, A.rows() - 1);
+    for (auto x : A.row(i)) {
+      VERIFY_IS_EQUAL(x, A(i, j++));
+    }
 
     i = 0;
-    for(auto x : A.reshaped()) { VERIFY_IS_EQUAL(x,A(i++)); }
+    for (auto x : A.reshaped()) {
+      VERIFY_IS_EQUAL(x, A(i++));
+    }
   }
 
   // same for const_iterator
   {
     i = 0;
-    for(auto x : cv) { VERIFY_IS_EQUAL(x,v[i++]); }
+    for (auto x : cv) {
+      VERIFY_IS_EQUAL(x, v[i++]);
+    }
 
     i = 0;
-    for(auto x : cA.reshaped()) { VERIFY_IS_EQUAL(x,A(i++)); }
+    for (auto x : cA.reshaped()) {
+      VERIFY_IS_EQUAL(x, A(i++));
+    }
 
     j = 0;
-    i = internal::random<Index>(0,A.rows()-1);
-    for(auto x : cA.row(i)) { VERIFY_IS_EQUAL(x,A(i,j++)); }
+    i = internal::random<Index>(0, A.rows() - 1);
+    for (auto x : cA.row(i)) {
+      VERIFY_IS_EQUAL(x, A(i, j++));
+    }
   }
 
   // check reshaped() on row-major
   {
     i = 0;
-    Matrix<Scalar,Dynamic,Dynamic,ColMajor> Bc = B;
-    for(auto x : B.reshaped()) { VERIFY_IS_EQUAL(x,Bc(i++)); }
+    Matrix<Scalar, Dynamic, Dynamic, ColMajor> Bc = B;
+    for (auto x : B.reshaped()) {
+      VERIFY_IS_EQUAL(x, Bc(i++));
+    }
   }
 
   // check write access
   {
     VectorType w(v.size());
     i = 0;
-    for(auto& x : w) { x = v(i++); }
-    VERIFY_IS_EQUAL(v,w);
+    for (auto& x : w) {
+      x = v(i++);
+    }
+    VERIFY_IS_EQUAL(v, w);
   }
 
   // check for dangling pointers
   {
     // no dangling because pointer-based
     {
-      j = internal::random<Index>(0,A.cols()-1);
+      j = internal::random<Index>(0, A.cols() - 1);
       auto it = A.col(j).begin();
-      for(i=0;i<rows;++i) {
-        VERIFY_IS_EQUAL(it[i],A(i,j));
+      for (i = 0; i < rows; ++i) {
+        VERIFY_IS_EQUAL(it[i], A(i, j));
       }
     }
 
     // no dangling because pointer-based
     {
-      i = internal::random<Index>(0,A.rows()-1);
+      i = internal::random<Index>(0, A.rows() - 1);
       auto it = A.row(i).begin();
-      for(j=0;j<cols;++j) { VERIFY_IS_EQUAL(it[j],A(i,j)); }
+      for (j = 0; j < cols; ++j) {
+        VERIFY_IS_EQUAL(it[j], A(i, j));
+      }
     }
 
     {
-      j = internal::random<Index>(0,A.cols()-1);
+      j = internal::random<Index>(0, A.cols() - 1);
       // this would produce a dangling pointer:
-      // auto it = (A+2*A).col(j).begin(); 
+      // auto it = (A+2*A).col(j).begin();
       // we need to name the temporary expression:
-      auto tmp = (A+2*A).col(j);
+      auto tmp = (A + 2 * A).col(j);
       auto it = tmp.begin();
-      for(i=0;i<rows;++i) {
-        VERIFY_IS_APPROX(it[i],3*A(i,j));
+      for (i = 0; i < rows; ++i) {
+        VERIFY_IS_APPROX(it[i], 3 * A(i, j));
       }
     }
   }
 
   {
     // check basic for loop on vector-wise iterators
-    j=0;
+    j = 0;
     for (auto it = A.colwise().cbegin(); it != A.colwise().cend(); ++it, ++j) {
-      VERIFY_IS_APPROX( it->coeff(0), A(0,j) );
-      VERIFY_IS_APPROX( (*it).coeff(0), A(0,j) );
+      VERIFY_IS_APPROX(it->coeff(0), A(0, j));
+      VERIFY_IS_APPROX((*it).coeff(0), A(0, j));
     }
-    j=0;
+    j = 0;
     for (auto it = A.colwise().begin(); it != A.colwise().end(); ++it, ++j) {
-      (*it).coeffRef(0) = (*it).coeff(0); // compilation check
-      it->coeffRef(0) = it->coeff(0);     // compilation check
-      VERIFY_IS_APPROX( it->coeff(0), A(0,j) );
-      VERIFY_IS_APPROX( (*it).coeff(0), A(0,j) );
+      (*it).coeffRef(0) = (*it).coeff(0);  // compilation check
+      it->coeffRef(0) = it->coeff(0);      // compilation check
+      VERIFY_IS_APPROX(it->coeff(0), A(0, j));
+      VERIFY_IS_APPROX((*it).coeff(0), A(0, j));
     }
 
     // check valuetype gives us a copy
-    j=0;
+    j = 0;
     for (auto it = A.colwise().cbegin(); it != A.colwise().cend(); ++it, ++j) {
       typename decltype(it)::value_type tmp = *it;
-      VERIFY_IS_NOT_EQUAL( tmp.data() , it->data() );
-      VERIFY_IS_APPROX( tmp, A.col(j) );
+      VERIFY_IS_NOT_EQUAL(tmp.data(), it->data());
+      VERIFY_IS_APPROX(tmp, A.col(j));
     }
   }
 
-  if(rows>=3) {
-    VERIFY_IS_EQUAL((v.begin()+rows/2)[1], v(rows/2+1));
+  if (rows >= 3) {
+    VERIFY_IS_EQUAL((v.begin() + rows / 2)[1], v(rows / 2 + 1));
 
-    VERIFY_IS_EQUAL((A.rowwise().begin()+rows/2)[1], A.row(rows/2+1));
+    VERIFY_IS_EQUAL((A.rowwise().begin() + rows / 2)[1], A.row(rows / 2 + 1));
   }
 
-  if(cols>=3) {
-    VERIFY_IS_EQUAL((A.colwise().begin()+cols/2)[1], A.col(cols/2+1));
+  if (cols >= 3) {
+    VERIFY_IS_EQUAL((A.colwise().begin() + cols / 2)[1], A.col(cols / 2 + 1));
   }
 
   // check std::sort
   {
     // first check that is_sorted returns false when required
-    if(rows>=2)
-    {
-      v(1) = v(0)-Scalar(1);
-      VERIFY(!is_sorted(std::begin(v),std::end(v)));
+    if (rows >= 2) {
+      v(1) = v(0) - Scalar(1);
+      VERIFY(!is_sorted(std::begin(v), std::end(v)));
     }
 
     // on a vector
     {
-      std::sort(v.begin(),v.end());
-      VERIFY(is_sorted(v.begin(),v.end()));
-      VERIFY(!::is_sorted(make_reverse_iterator(v.end()),make_reverse_iterator(v.begin())));
+      std::sort(v.begin(), v.end());
+      VERIFY(is_sorted(v.begin(), v.end()));
+      VERIFY(!::is_sorted(make_reverse_iterator(v.end()), make_reverse_iterator(v.begin())));
     }
 
     // on a column of a column-major matrix -> pointer-based iterator and default increment
     {
-      j = internal::random<Index>(0,A.cols()-1);
+      j = internal::random<Index>(0, A.cols() - 1);
       // std::sort(begin(A.col(j)),end(A.col(j))); // does not compile because this returns const iterators
       typename ColMatrixType::ColXpr Acol = A.col(j);
-      std::sort(Acol.begin(),Acol.end());
-      VERIFY(is_sorted(Acol.cbegin(),Acol.cend()));
+      std::sort(Acol.begin(), Acol.end());
+      VERIFY(is_sorted(Acol.cbegin(), Acol.cend()));
       A.setRandom();
 
-      std::sort(A.col(j).begin(),A.col(j).end());
-      VERIFY(is_sorted(A.col(j).cbegin(),A.col(j).cend()));
+      std::sort(A.col(j).begin(), A.col(j).end());
+      VERIFY(is_sorted(A.col(j).cbegin(), A.col(j).cend()));
       A.setRandom();
     }
 
     // on a row of a rowmajor matrix -> pointer-based iterator and runtime increment
     {
-      i = internal::random<Index>(0,A.rows()-1);
+      i = internal::random<Index>(0, A.rows() - 1);
       typename ColMatrixType::RowXpr Arow = A.row(i);
-      VERIFY_IS_EQUAL( std::distance(Arow.begin(),Arow.end()), cols);
-      std::sort(Arow.begin(),Arow.end());
-      VERIFY(is_sorted(Arow.cbegin(),Arow.cend()));
+      VERIFY_IS_EQUAL(std::distance(Arow.begin(), Arow.end()), cols);
+      std::sort(Arow.begin(), Arow.end());
+      VERIFY(is_sorted(Arow.cbegin(), Arow.cend()));
       A.setRandom();
 
-      std::sort(A.row(i).begin(),A.row(i).end());
-      VERIFY(is_sorted(A.row(i).cbegin(),A.row(i).cend()));
+      std::sort(A.row(i).begin(), A.row(i).end());
+      VERIFY(is_sorted(A.row(i).cbegin(), A.row(i).cend()));
       A.setRandom();
     }
 
     // with a generic iterator
     {
-      Reshaped<RowMatrixType,RowMatrixType::SizeAtCompileTime,1> B1 = B.reshaped();
-      std::sort(B1.begin(),B1.end());
-      VERIFY(is_sorted(B1.cbegin(),B1.cend()));
+      Reshaped<RowMatrixType, RowMatrixType::SizeAtCompileTime, 1> B1 = B.reshaped();
+      std::sort(B1.begin(), B1.end());
+      VERIFY(is_sorted(B1.cbegin(), B1.cend()));
       B.setRandom();
 
       // assertion because nested expressions are different
@@ -368,10 +397,10 @@
 
   // check with partial_sum
   {
-    j = internal::random<Index>(0,A.cols()-1);
+    j = internal::random<Index>(0, A.cols() - 1);
     typename ColMatrixType::ColXpr Acol = A.col(j);
     std::partial_sum(Acol.begin(), Acol.end(), v.begin());
-    VERIFY_IS_APPROX(v(seq(1,last)), v(seq(0,last-1))+Acol(seq(1,last)));
+    VERIFY_IS_APPROX(v(seq(1, last)), v(seq(0, last - 1)) + Acol(seq(1, last)));
 
     // inplace
     std::partial_sum(Acol.begin(), Acol.end(), Acol.begin());
@@ -379,85 +408,123 @@
   }
 
   // stress random access as required by std::nth_element
-  if(rows>=3)
-  {
+  if (rows >= 3) {
     v.setRandom();
     VectorType v1 = v;
-    std::sort(v1.begin(),v1.end());
-    std::nth_element(v.begin(), v.begin()+rows/2, v.end());
-    VERIFY_IS_APPROX(v1(rows/2), v(rows/2));
+    std::sort(v1.begin(), v1.end());
+    std::nth_element(v.begin(), v.begin() + rows / 2, v.end());
+    VERIFY_IS_APPROX(v1(rows / 2), v(rows / 2));
 
     v.setRandom();
     v1 = v;
-    std::sort(v1.begin()+rows/2,v1.end());
-    std::nth_element(v.begin()+rows/2, v.begin()+rows/4, v.end());
-    VERIFY_IS_APPROX(v1(rows/4), v(rows/4));
+    std::sort(v1.begin() + rows / 2, v1.end());
+    std::nth_element(v.begin() + rows / 2, v.begin() + rows / 4, v.end());
+    VERIFY_IS_APPROX(v1(rows / 4), v(rows / 4));
   }
 
   // check rows/cols iterators with range-for loops
   {
     j = 0;
-    for(auto c : A.colwise()) { VERIFY_IS_APPROX(c.sum(), A.col(j).sum()); ++j; }
+    for (auto c : A.colwise()) {
+      VERIFY_IS_APPROX(c.sum(), A.col(j).sum());
+      ++j;
+    }
     j = 0;
-    for(auto c : B.colwise()) { VERIFY_IS_APPROX(c.sum(), B.col(j).sum()); ++j; }
+    for (auto c : B.colwise()) {
+      VERIFY_IS_APPROX(c.sum(), B.col(j).sum());
+      ++j;
+    }
 
     j = 0;
-    for(auto c : B.colwise()) {
+    for (auto c : B.colwise()) {
       i = 0;
-      for(auto& x : c) {
-        VERIFY_IS_EQUAL(x, B(i,j));
-        x = A(i,j);
+      for (auto& x : c) {
+        VERIFY_IS_EQUAL(x, B(i, j));
+        x = A(i, j);
         ++i;
       }
       ++j;
     }
-    VERIFY_IS_APPROX(A,B);
+    VERIFY_IS_APPROX(A, B);
     B.setRandom();
-    
-    i = 0;
-    for(auto r : A.rowwise()) { VERIFY_IS_APPROX(r.sum(), A.row(i).sum()); ++i; }
-    i = 0;
-    for(auto r : B.rowwise()) { VERIFY_IS_APPROX(r.sum(), B.row(i).sum()); ++i; }
-  }
 
+    i = 0;
+    for (auto r : A.rowwise()) {
+      VERIFY_IS_APPROX(r.sum(), A.row(i).sum());
+      ++i;
+    }
+    i = 0;
+    for (auto r : B.rowwise()) {
+      VERIFY_IS_APPROX(r.sum(), B.row(i).sum());
+      ++i;
+    }
+  }
 
   // check rows/cols iterators with STL algorithms
   {
     RowVectorType row = RowVectorType::Random(cols);
     A.rowwise() = row;
-    VERIFY( std::all_of(A.rowwise().begin(),  A.rowwise().end(),  [&row](typename ColMatrixType::RowXpr x) { return internal::isApprox(x.squaredNorm(),row.squaredNorm()); }) );
-    VERIFY( std::all_of(A.rowwise().rbegin(), A.rowwise().rend(), [&row](typename ColMatrixType::RowXpr x) { return internal::isApprox(x.squaredNorm(),row.squaredNorm()); }) );
+    VERIFY(std::all_of(A.rowwise().begin(), A.rowwise().end(), [&row](typename ColMatrixType::RowXpr x) {
+      return internal::isApprox(x.squaredNorm(), row.squaredNorm());
+    }));
+    VERIFY(std::all_of(A.rowwise().rbegin(), A.rowwise().rend(), [&row](typename ColMatrixType::RowXpr x) {
+      return internal::isApprox(x.squaredNorm(), row.squaredNorm());
+    }));
 
     VectorType col = VectorType::Random(rows);
     A.colwise() = col;
-    VERIFY( std::all_of(A.colwise().begin(),   A.colwise().end(),   [&col](typename ColMatrixType::ColXpr x) { return internal::isApprox(x.squaredNorm(),col.squaredNorm()); }) );
-    VERIFY( std::all_of(A.colwise().rbegin(),  A.colwise().rend(),  [&col](typename ColMatrixType::ColXpr x) { return internal::isApprox(x.squaredNorm(),col.squaredNorm()); }) );
-    VERIFY( std::all_of(A.colwise().cbegin(),  A.colwise().cend(),  [&col](typename ColMatrixType::ConstColXpr x) { return internal::isApprox(x.squaredNorm(),col.squaredNorm()); }) );
-    VERIFY( std::all_of(A.colwise().crbegin(), A.colwise().crend(), [&col](typename ColMatrixType::ConstColXpr x) { return internal::isApprox(x.squaredNorm(),col.squaredNorm()); }) );
+    VERIFY(std::all_of(A.colwise().begin(), A.colwise().end(), [&col](typename ColMatrixType::ColXpr x) {
+      return internal::isApprox(x.squaredNorm(), col.squaredNorm());
+    }));
+    VERIFY(std::all_of(A.colwise().rbegin(), A.colwise().rend(), [&col](typename ColMatrixType::ColXpr x) {
+      return internal::isApprox(x.squaredNorm(), col.squaredNorm());
+    }));
+    VERIFY(std::all_of(A.colwise().cbegin(), A.colwise().cend(), [&col](typename ColMatrixType::ConstColXpr x) {
+      return internal::isApprox(x.squaredNorm(), col.squaredNorm());
+    }));
+    VERIFY(std::all_of(A.colwise().crbegin(), A.colwise().crend(), [&col](typename ColMatrixType::ConstColXpr x) {
+      return internal::isApprox(x.squaredNorm(), col.squaredNorm());
+    }));
 
-    i = internal::random<Index>(0,A.rows()-1);
+    i = internal::random<Index>(0, A.rows() - 1);
     A.setRandom();
     A.row(i).setZero();
-    VERIFY_IS_EQUAL(std::find_if(A.rowwise().begin(),  A.rowwise().end(),  [](typename ColMatrixType::RowXpr x) { return numext::is_exactly_zero(x.squaredNorm()); }) - A.rowwise().begin(), i );
-    VERIFY_IS_EQUAL(std::find_if(A.rowwise().rbegin(), A.rowwise().rend(), [](typename ColMatrixType::RowXpr x) { return numext::is_exactly_zero(x.squaredNorm()); }) - A.rowwise().rbegin(), (A.rows() - 1) - i );
+    VERIFY_IS_EQUAL(
+        std::find_if(A.rowwise().begin(), A.rowwise().end(),
+                     [](typename ColMatrixType::RowXpr x) { return numext::is_exactly_zero(x.squaredNorm()); }) -
+            A.rowwise().begin(),
+        i);
+    VERIFY_IS_EQUAL(
+        std::find_if(A.rowwise().rbegin(), A.rowwise().rend(),
+                     [](typename ColMatrixType::RowXpr x) { return numext::is_exactly_zero(x.squaredNorm()); }) -
+            A.rowwise().rbegin(),
+        (A.rows() - 1) - i);
 
-    j = internal::random<Index>(0,A.cols()-1);
+    j = internal::random<Index>(0, A.cols() - 1);
     A.setRandom();
     A.col(j).setZero();
-    VERIFY_IS_EQUAL(std::find_if(A.colwise().begin(),  A.colwise().end(),  [](typename ColMatrixType::ColXpr x) { return numext::is_exactly_zero(x.squaredNorm()); }) - A.colwise().begin(), j );
-    VERIFY_IS_EQUAL(std::find_if(A.colwise().rbegin(), A.colwise().rend(), [](typename ColMatrixType::ColXpr x) { return numext::is_exactly_zero(x.squaredNorm()); }) - A.colwise().rbegin(), (A.cols() - 1) - j );
+    VERIFY_IS_EQUAL(
+        std::find_if(A.colwise().begin(), A.colwise().end(),
+                     [](typename ColMatrixType::ColXpr x) { return numext::is_exactly_zero(x.squaredNorm()); }) -
+            A.colwise().begin(),
+        j);
+    VERIFY_IS_EQUAL(
+        std::find_if(A.colwise().rbegin(), A.colwise().rend(),
+                     [](typename ColMatrixType::ColXpr x) { return numext::is_exactly_zero(x.squaredNorm()); }) -
+            A.colwise().rbegin(),
+        (A.cols() - 1) - j);
   }
 
   {
     using VecOp = VectorwiseOp<ArrayXXi, 0>;
-    STATIC_CHECK(( internal::is_same<VecOp::const_iterator, decltype(std::declval<const VecOp&>().cbegin())>::value ));
-    STATIC_CHECK(( internal::is_same<VecOp::const_iterator, decltype(std::declval<const VecOp&>().cend  ())>::value ));
-    STATIC_CHECK(( internal::is_same<VecOp::const_iterator, decltype(std::cbegin(std::declval<const VecOp&>()))>::value ));
-    STATIC_CHECK(( internal::is_same<VecOp::const_iterator, decltype(std::cend  (std::declval<const VecOp&>()))>::value ));
+    STATIC_CHECK((internal::is_same<VecOp::const_iterator, decltype(std::declval<const VecOp&>().cbegin())>::value));
+    STATIC_CHECK((internal::is_same<VecOp::const_iterator, decltype(std::declval<const VecOp&>().cend())>::value));
+    STATIC_CHECK(
+        (internal::is_same<VecOp::const_iterator, decltype(std::cbegin(std::declval<const VecOp&>()))>::value));
+    STATIC_CHECK((internal::is_same<VecOp::const_iterator, decltype(std::cend(std::declval<const VecOp&>()))>::value));
   }
 }
 
-
 // When the compiler sees expression IsContainerTest<C>(0), if C is an
 // STL-style container class, the first overload of IsContainerTest
 // will be viable (since both C::iterator* and C::const_iterator* are
@@ -466,23 +533,23 @@
 // the type of argument 0.  If C::iterator or C::const_iterator is not
 // a valid type, the first overload is not viable, and the second
 // overload will be picked.
-template <class C,
-          class Iterator = decltype(::std::declval<const C&>().begin()),
-          class = decltype(::std::declval<const C&>().end()),
-          class = decltype(++::std::declval<Iterator&>()),
-          class = decltype(*::std::declval<Iterator>()),
-          class = typename C::const_iterator>
-bool IsContainerType(int /* dummy */) { return true; }
+template <class C, class Iterator = decltype(::std::declval<const C&>().begin()),
+          class = decltype(::std::declval<const C&>().end()), class = decltype(++::std::declval<Iterator&>()),
+          class = decltype(*::std::declval<Iterator>()), class = typename C::const_iterator>
+bool IsContainerType(int /* dummy */) {
+  return true;
+}
 
 template <class C>
-bool IsContainerType(long /* dummy */) { return false; }
+bool IsContainerType(long /* dummy */) {
+  return false;
+}
 
 template <typename Scalar, int Rows, int Cols>
-void test_stl_container_detection(int rows=Rows, int cols=Cols)
-{
-  typedef Matrix<Scalar,Rows,1> VectorType;
-  typedef Matrix<Scalar,Rows,Cols,ColMajor> ColMatrixType;
-  typedef Matrix<Scalar,Rows,Cols,RowMajor> RowMatrixType;
+void test_stl_container_detection(int rows = Rows, int cols = Cols) {
+  typedef Matrix<Scalar, Rows, 1> VectorType;
+  typedef Matrix<Scalar, Rows, Cols, ColMajor> ColMatrixType;
+  typedef Matrix<Scalar, Rows, Cols, RowMajor> RowMatrixType;
 
   ColMatrixType A = ColMatrixType::Random(rows, cols);
   RowMatrixType B = RowMatrixType::Random(rows, cols);
@@ -506,15 +573,16 @@
   VERIFY_IS_EQUAL(IsContainerType<RowMatrixType>(0), rows == 1 || cols == 1);
 }
 
-EIGEN_DECLARE_TEST(stl_iterators)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1(( test_stl_iterators<double,2,3>() ));
-    CALL_SUBTEST_1(( test_stl_iterators<float,7,5>() ));
-    CALL_SUBTEST_1(( test_stl_iterators<int,Dynamic,Dynamic>(internal::random<int>(5,10), internal::random<int>(5,10)) ));
-    CALL_SUBTEST_1(( test_stl_iterators<int,Dynamic,Dynamic>(internal::random<int>(10,200), internal::random<int>(10,200)) ));
+EIGEN_DECLARE_TEST(stl_iterators) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1((test_stl_iterators<double, 2, 3>()));
+    CALL_SUBTEST_1((test_stl_iterators<float, 7, 5>()));
+    CALL_SUBTEST_1(
+        (test_stl_iterators<int, Dynamic, Dynamic>(internal::random<int>(5, 10), internal::random<int>(5, 10))));
+    CALL_SUBTEST_1(
+        (test_stl_iterators<int, Dynamic, Dynamic>(internal::random<int>(10, 200), internal::random<int>(10, 200))));
   }
 
-  CALL_SUBTEST_1(( test_stl_container_detection<float,1,1>() ));
-  CALL_SUBTEST_1(( test_stl_container_detection<float,5,5>() ));
+  CALL_SUBTEST_1((test_stl_container_detection<float, 1, 1>()));
+  CALL_SUBTEST_1((test_stl_container_detection<float, 5, 5>()));
 }
diff --git a/test/superlu_support.cpp b/test/superlu_support.cpp
index 55450c8..51cc3df 100644
--- a/test/superlu_support.cpp
+++ b/test/superlu_support.cpp
@@ -12,12 +12,11 @@
 
 #include <Eigen/SuperLUSupport>
 
-EIGEN_DECLARE_TEST(superlu_support)
-{
+EIGEN_DECLARE_TEST(superlu_support) {
   SuperLU<SparseMatrix<double> > superlu_double_colmajor;
   SuperLU<SparseMatrix<std::complex<double> > > superlu_cplxdouble_colmajor;
-  CALL_SUBTEST_1( check_sparse_square_solving(superlu_double_colmajor)      );
-  CALL_SUBTEST_2( check_sparse_square_solving(superlu_cplxdouble_colmajor)  );
-  CALL_SUBTEST_1( check_sparse_square_determinant(superlu_double_colmajor)      );
-  CALL_SUBTEST_2( check_sparse_square_determinant(superlu_cplxdouble_colmajor)  );
+  CALL_SUBTEST_1(check_sparse_square_solving(superlu_double_colmajor));
+  CALL_SUBTEST_2(check_sparse_square_solving(superlu_cplxdouble_colmajor));
+  CALL_SUBTEST_1(check_sparse_square_determinant(superlu_double_colmajor));
+  CALL_SUBTEST_2(check_sparse_square_determinant(superlu_cplxdouble_colmajor));
 }
diff --git a/test/svd_common.h b/test/svd_common.h
index e43adc4..dd520f5 100644
--- a/test/svd_common.h
+++ b/test/svd_common.h
@@ -25,34 +25,27 @@
 
 // Check that the matrix m is properly reconstructed and that the U and V factors are unitary
 // The SVD must have already been computed.
-template<typename SvdType, typename MatrixType>
-void svd_check_full(const MatrixType& m, const SvdType& svd)
-{
+template <typename SvdType, typename MatrixType>
+void svd_check_full(const MatrixType& m, const SvdType& svd) {
   Index rows = m.rows();
   Index cols = m.cols();
 
-  enum {
-    RowsAtCompileTime = MatrixType::RowsAtCompileTime,
-    ColsAtCompileTime = MatrixType::ColsAtCompileTime
-  };
+  enum { RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime };
 
   typedef typename MatrixType::Scalar Scalar;
   typedef typename MatrixType::RealScalar RealScalar;
   typedef Matrix<Scalar, RowsAtCompileTime, RowsAtCompileTime> MatrixUType;
   typedef Matrix<Scalar, ColsAtCompileTime, ColsAtCompileTime> MatrixVType;
 
-  MatrixType sigma = MatrixType::Zero(rows,cols);
+  MatrixType sigma = MatrixType::Zero(rows, cols);
   sigma.diagonal() = svd.singularValues().template cast<Scalar>();
   MatrixUType u = svd.matrixU();
   MatrixVType v = svd.matrixV();
   RealScalar scaling = m.cwiseAbs().maxCoeff();
-  if(scaling<(std::numeric_limits<RealScalar>::min)())
-  {
+  if (scaling < (std::numeric_limits<RealScalar>::min)()) {
     VERIFY(sigma.cwiseAbs().maxCoeff() <= (std::numeric_limits<RealScalar>::min)());
-  }
-  else
-  {
-    VERIFY_IS_APPROX(m/scaling, u * (sigma/scaling) * v.adjoint());
+  } else {
+    VERIFY_IS_APPROX(m / scaling, u * (sigma / scaling) * v.adjoint());
   }
   VERIFY_IS_UNITARY(u);
   VERIFY_IS_UNITARY(v);
@@ -72,15 +65,20 @@
   VERIFY_IS_APPROX(svd.singularValues(), referenceSvd.singularValues());
 
   if (Options & (ComputeFullV | ComputeThinV)) {
-    VERIFY( (svd.matrixV().adjoint()*svd.matrixV()).isIdentity(prec) );
-    VERIFY_IS_APPROX( svd.matrixV().leftCols(diagSize) * svd.singularValues().asDiagonal() * svd.matrixV().leftCols(diagSize).adjoint(),
-                      referenceSvd.matrixV().leftCols(diagSize) * referenceSvd.singularValues().asDiagonal() * referenceSvd.matrixV().leftCols(diagSize).adjoint());
+    VERIFY((svd.matrixV().adjoint() * svd.matrixV()).isIdentity(prec));
+    VERIFY_IS_APPROX(svd.matrixV().leftCols(diagSize) * svd.singularValues().asDiagonal() *
+                         svd.matrixV().leftCols(diagSize).adjoint(),
+                     referenceSvd.matrixV().leftCols(diagSize) * referenceSvd.singularValues().asDiagonal() *
+                         referenceSvd.matrixV().leftCols(diagSize).adjoint());
   }
 
   if (Options & (ComputeFullU | ComputeThinU)) {
-    VERIFY( (svd.matrixU().adjoint()*svd.matrixU()).isIdentity(prec) );
-    VERIFY_IS_APPROX( svd.matrixU().leftCols(diagSize) * svd.singularValues().cwiseAbs2().asDiagonal() * svd.matrixU().leftCols(diagSize).adjoint(),
-                      referenceSvd.matrixU().leftCols(diagSize) * referenceSvd.singularValues().cwiseAbs2().asDiagonal() * referenceSvd.matrixU().leftCols(diagSize).adjoint());
+    VERIFY((svd.matrixU().adjoint() * svd.matrixU()).isIdentity(prec));
+    VERIFY_IS_APPROX(svd.matrixU().leftCols(diagSize) * svd.singularValues().cwiseAbs2().asDiagonal() *
+                         svd.matrixU().leftCols(diagSize).adjoint(),
+                     referenceSvd.matrixU().leftCols(diagSize) *
+                         referenceSvd.singularValues().cwiseAbs2().asDiagonal() *
+                         referenceSvd.matrixU().leftCols(diagSize).adjoint());
   }
 
   // The following checks are not critical.
@@ -102,10 +100,7 @@
   Index rows = m.rows();
   Index cols = m.cols();
 
-  enum {
-    RowsAtCompileTime = MatrixType::RowsAtCompileTime,
-    ColsAtCompileTime = MatrixType::ColsAtCompileTime
-  };
+  enum { RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime };
 
   typedef Matrix<Scalar, RowsAtCompileTime, Dynamic> RhsType;
   typedef Matrix<Scalar, ColsAtCompileTime, Dynamic> SolutionType;
@@ -113,49 +108,48 @@
   RhsType rhs = RhsType::Random(rows, internal::random<Index>(1, cols));
   SvdType svd(m);
 
-  if (internal::is_same<RealScalar, double>::value)  svd.setThreshold(RealScalar(1e-8));
-  else if(internal::is_same<RealScalar,float>::value)  svd.setThreshold(RealScalar(2e-4));
+  if (internal::is_same<RealScalar, double>::value)
+    svd.setThreshold(RealScalar(1e-8));
+  else if (internal::is_same<RealScalar, float>::value)
+    svd.setThreshold(RealScalar(2e-4));
 
   SolutionType x = svd.solve(rhs);
-   
-  RealScalar residual = (m*x-rhs).norm();
+
+  RealScalar residual = (m * x - rhs).norm();
   RealScalar rhs_norm = rhs.norm();
-  if(!test_isMuchSmallerThan(residual,rhs.norm()))
-  {
+  if (!test_isMuchSmallerThan(residual, rhs.norm())) {
     // ^^^ If the residual is very small, then we have an exact solution, so we are already good.
-    
+
     // evaluate normal equation which works also for least-squares solutions
-    if(internal::is_same<RealScalar,double>::value || svd.rank()==m.diagonal().size())
-    {
+    if (internal::is_same<RealScalar, double>::value || svd.rank() == m.diagonal().size()) {
       using std::sqrt;
       // This test is not stable with single precision.
-      // This is probably because squaring m signicantly affects the precision.      
-      if(internal::is_same<RealScalar,float>::value) ++g_test_level;
-      
-      VERIFY_IS_APPROX(m.adjoint()*(m*x),m.adjoint()*rhs);
-      
-      if(internal::is_same<RealScalar,float>::value) --g_test_level;
+      // This is probably because squaring m signicantly affects the precision.
+      if (internal::is_same<RealScalar, float>::value) ++g_test_level;
+
+      VERIFY_IS_APPROX(m.adjoint() * (m * x), m.adjoint() * rhs);
+
+      if (internal::is_same<RealScalar, float>::value) --g_test_level;
     }
-    
+
     // Check that there is no significantly better solution in the neighborhood of x
-    for(Index k=0;k<x.rows();++k)
-    {
+    for (Index k = 0; k < x.rows(); ++k) {
       using std::abs;
-      
+
       SolutionType y(x);
-      y.row(k) = (RealScalar(1)+2*NumTraits<RealScalar>::epsilon())*x.row(k);
-      RealScalar residual_y = (m*y-rhs).norm();
-      VERIFY( test_isMuchSmallerThan(abs(residual_y-residual), rhs_norm) || residual < residual_y );
-      if(internal::is_same<RealScalar,float>::value) ++g_test_level;
-      VERIFY( test_isApprox(residual_y,residual) || residual < residual_y );
-      if(internal::is_same<RealScalar,float>::value) --g_test_level;
-      
-      y.row(k) = (RealScalar(1)-2*NumTraits<RealScalar>::epsilon())*x.row(k);
-      residual_y = (m*y-rhs).norm();
-      VERIFY( test_isMuchSmallerThan(abs(residual_y-residual), rhs_norm) || residual < residual_y );
-      if(internal::is_same<RealScalar,float>::value) ++g_test_level;
-      VERIFY( test_isApprox(residual_y,residual) || residual < residual_y );
-      if(internal::is_same<RealScalar,float>::value) --g_test_level;
+      y.row(k) = (RealScalar(1) + 2 * NumTraits<RealScalar>::epsilon()) * x.row(k);
+      RealScalar residual_y = (m * y - rhs).norm();
+      VERIFY(test_isMuchSmallerThan(abs(residual_y - residual), rhs_norm) || residual < residual_y);
+      if (internal::is_same<RealScalar, float>::value) ++g_test_level;
+      VERIFY(test_isApprox(residual_y, residual) || residual < residual_y);
+      if (internal::is_same<RealScalar, float>::value) --g_test_level;
+
+      y.row(k) = (RealScalar(1) - 2 * NumTraits<RealScalar>::epsilon()) * x.row(k);
+      residual_y = (m * y - rhs).norm();
+      VERIFY(test_isMuchSmallerThan(abs(residual_y - residual), rhs_norm) || residual < residual_y);
+      if (internal::is_same<RealScalar, float>::value) ++g_test_level;
+      VERIFY(test_isApprox(residual_y, residual) || residual < residual_y);
+      if (internal::is_same<RealScalar, float>::value) --g_test_level;
     }
   }
 }
@@ -166,83 +160,84 @@
   typedef typename MatrixType::Scalar Scalar;
   Index cols = m.cols();
 
-  enum {
-    ColsAtCompileTime = MatrixType::ColsAtCompileTime
-  };
+  enum { ColsAtCompileTime = MatrixType::ColsAtCompileTime };
 
   typedef Matrix<Scalar, ColsAtCompileTime, Dynamic> SolutionType;
 
   // generate a full-rank m x n problem with m<n
   enum {
-    RankAtCompileTime2 = ColsAtCompileTime==Dynamic ? Dynamic : (ColsAtCompileTime)/2+1,
-    RowsAtCompileTime3 = ColsAtCompileTime==Dynamic ? Dynamic : ColsAtCompileTime+1
+    RankAtCompileTime2 = ColsAtCompileTime == Dynamic ? Dynamic : (ColsAtCompileTime) / 2 + 1,
+    RowsAtCompileTime3 = ColsAtCompileTime == Dynamic ? Dynamic : ColsAtCompileTime + 1
   };
   typedef Matrix<Scalar, RankAtCompileTime2, ColsAtCompileTime> MatrixType2;
   typedef Matrix<Scalar, RankAtCompileTime2, 1> RhsType2;
   typedef Matrix<Scalar, ColsAtCompileTime, RankAtCompileTime2> MatrixType2T;
-  Index rank = RankAtCompileTime2==Dynamic ? internal::random<Index>(1,cols) : Index(RankAtCompileTime2);
-  MatrixType2 m2(rank,cols);
+  Index rank = RankAtCompileTime2 == Dynamic ? internal::random<Index>(1, cols) : Index(RankAtCompileTime2);
+  MatrixType2 m2(rank, cols);
   int guard = 0;
   do {
     m2.setRandom();
-  } while(SVD_FOR_MIN_NORM(MatrixType2)(m2).setThreshold(test_precision<Scalar>()).rank()!=rank && (++guard)<10);
-  VERIFY(guard<10);
+  } while (SVD_FOR_MIN_NORM(MatrixType2)(m2).setThreshold(test_precision<Scalar>()).rank() != rank && (++guard) < 10);
+  VERIFY(guard < 10);
 
   RhsType2 rhs2 = RhsType2::Random(rank);
   // use QR to find a reference minimal norm solution
   HouseholderQR<MatrixType2T> qr(m2.adjoint());
-  Matrix<Scalar,Dynamic,1> tmp = qr.matrixQR().topLeftCorner(rank,rank).template triangularView<Upper>().adjoint().solve(rhs2);
+  Matrix<Scalar, Dynamic, 1> tmp =
+      qr.matrixQR().topLeftCorner(rank, rank).template triangularView<Upper>().adjoint().solve(rhs2);
   tmp.conservativeResize(cols);
-  tmp.tail(cols-rank).setZero();
+  tmp.tail(cols - rank).setZero();
   SolutionType x21 = qr.householderQ() * tmp;
   // now check with SVD
   SVD_STATIC_OPTIONS(MatrixType2, Options) svd2(m2);
   SolutionType x22 = svd2.solve(rhs2);
-  VERIFY_IS_APPROX(m2*x21, rhs2);
-  VERIFY_IS_APPROX(m2*x22, rhs2);
+  VERIFY_IS_APPROX(m2 * x21, rhs2);
+  VERIFY_IS_APPROX(m2 * x22, rhs2);
   VERIFY_IS_APPROX(x21, x22);
 
   // Now check with a rank deficient matrix
   typedef Matrix<Scalar, RowsAtCompileTime3, ColsAtCompileTime> MatrixType3;
   typedef Matrix<Scalar, RowsAtCompileTime3, 1> RhsType3;
-  Index rows3 = RowsAtCompileTime3==Dynamic ? internal::random<Index>(rank+1,2*cols) : Index(RowsAtCompileTime3);
-  Matrix<Scalar,RowsAtCompileTime3,Dynamic> C = Matrix<Scalar,RowsAtCompileTime3,Dynamic>::Random(rows3,rank);
+  Index rows3 = RowsAtCompileTime3 == Dynamic ? internal::random<Index>(rank + 1, 2 * cols) : Index(RowsAtCompileTime3);
+  Matrix<Scalar, RowsAtCompileTime3, Dynamic> C = Matrix<Scalar, RowsAtCompileTime3, Dynamic>::Random(rows3, rank);
   MatrixType3 m3 = C * m2;
   RhsType3 rhs3 = C * rhs2;
   SVD_STATIC_OPTIONS(MatrixType3, Options) svd3(m3);
   SolutionType x3 = svd3.solve(rhs3);
-  VERIFY_IS_APPROX(m3*x3, rhs3);
-  VERIFY_IS_APPROX(m3*x21, rhs3);
-  VERIFY_IS_APPROX(m2*x3, rhs2);
+  VERIFY_IS_APPROX(m3 * x3, rhs3);
+  VERIFY_IS_APPROX(m3 * x21, rhs3);
+  VERIFY_IS_APPROX(m2 * x3, rhs2);
   VERIFY_IS_APPROX(x21, x3);
 }
 
-template<typename MatrixType, typename SolverType>
+template <typename MatrixType, typename SolverType>
 void svd_test_solvers(const MatrixType& m, const SolverType& solver) {
-    Index rows, cols, cols2;
+  Index rows, cols, cols2;
 
-    rows = m.rows();
-    cols = m.cols();
+  rows = m.rows();
+  cols = m.cols();
 
-    if(MatrixType::ColsAtCompileTime==Dynamic)
-    {
-      cols2 = internal::random<int>(2,EIGEN_TEST_MAX_SIZE);
-    }
-    else
-    {
-      cols2 = cols;
-    }
-    typedef Matrix<typename MatrixType::Scalar, MatrixType::ColsAtCompileTime, MatrixType::ColsAtCompileTime> CMatrixType;
-    check_solverbase<CMatrixType, MatrixType>(m, solver, rows, cols, cols2);
+  if (MatrixType::ColsAtCompileTime == Dynamic) {
+    cols2 = internal::random<int>(2, EIGEN_TEST_MAX_SIZE);
+  } else {
+    cols2 = cols;
+  }
+  typedef Matrix<typename MatrixType::Scalar, MatrixType::ColsAtCompileTime, MatrixType::ColsAtCompileTime> CMatrixType;
+  check_solverbase<CMatrixType, MatrixType>(m, solver, rows, cols, cols2);
 }
 
 // work around stupid msvc error when constructing at compile time an expression that involves
 // a division by zero, even if the numeric type has floating point
-template<typename Scalar>
-EIGEN_DONT_INLINE Scalar zero() { return Scalar(0); }
+template <typename Scalar>
+EIGEN_DONT_INLINE Scalar zero() {
+  return Scalar(0);
+}
 
 // workaround aggressive optimization in ICC
-template<typename T> EIGEN_DONT_INLINE  T sub(T a, T b) { return a - b; }
+template <typename T>
+EIGEN_DONT_INLINE T sub(T a, T b) {
+  return a - b;
+}
 
 // This function verifies we don't iterate infinitely on nan/inf values,
 // and that info() returns InvalidInput.
@@ -258,87 +253,78 @@
   Scalar nan = std::numeric_limits<Scalar>::quiet_NaN();
   VERIFY(nan != nan);
   svd.compute(MatrixType::Constant(10, 10, nan));
-  VERIFY(svd.info() == InvalidInput);  
+  VERIFY(svd.info() == InvalidInput);
 
-  MatrixType m = MatrixType::Zero(10,10);
-  m(internal::random<int>(0,9), internal::random<int>(0,9)) = some_inf;
+  MatrixType m = MatrixType::Zero(10, 10);
+  m(internal::random<int>(0, 9), internal::random<int>(0, 9)) = some_inf;
   svd.compute(m);
   VERIFY(svd.info() == InvalidInput);
 
-  m = MatrixType::Zero(10,10);
-  m(internal::random<int>(0,9), internal::random<int>(0,9)) = nan;
+  m = MatrixType::Zero(10, 10);
+  m(internal::random<int>(0, 9), internal::random<int>(0, 9)) = nan;
   svd.compute(m);
   VERIFY(svd.info() == InvalidInput);
-  
+
   // regression test for bug 791
-  m.resize(3,3);
-  m << 0,    2*NumTraits<Scalar>::epsilon(),  0.5,
-       0,   -0.5,                             0,
-       nan,  0,                               0;
+  m.resize(3, 3);
+  m << 0, 2 * NumTraits<Scalar>::epsilon(), 0.5, 0, -0.5, 0, nan, 0, 0;
   svd.compute(m);
   VERIFY(svd.info() == InvalidInput);
-  
+
   Scalar min = (std::numeric_limits<Scalar>::min)();
-  m.resize(4,4);
-  m <<  1, 0, 0, 0,
-        0, 3, 1, min,
-        1, 0, 1, nan,
-        0, nan, nan, 0;
+  m.resize(4, 4);
+  m << 1, 0, 0, 0, 0, 3, 1, min, 1, 0, 1, nan, 0, nan, nan, 0;
   svd.compute(m);
   VERIFY(svd.info() == InvalidInput);
 }
 
 // Regression test for bug 286: JacobiSVD loops indefinitely with some
 // matrices containing denormal numbers.
-template<typename>
-void svd_underoverflow()
-{
+template <typename>
+void svd_underoverflow() {
 #if defined __INTEL_COMPILER
 // shut up warning #239: floating point underflow
 #pragma warning push
 #pragma warning disable 239
 #endif
   Matrix2d M;
-  M << -7.90884e-313, -4.94e-324,
-                 0, 5.60844e-313;
+  M << -7.90884e-313, -4.94e-324, 0, 5.60844e-313;
   SVD_STATIC_OPTIONS(Matrix2d, ComputeFullU | ComputeFullV) svd;
   svd.compute(M);
-  CALL_SUBTEST( svd_check_full(M,svd) );
-  
+  CALL_SUBTEST(svd_check_full(M, svd));
+
   // Check all 2x2 matrices made with the following coefficients:
   VectorXd value_set(9);
   value_set << 0, 1, -1, 5.60844e-313, -5.60844e-313, 4.94e-324, -4.94e-324, -4.94e-223, 4.94e-223;
-  Array4i id(0,0,0,0);
+  Array4i id(0, 0, 0, 0);
   int k = 0;
-  do
-  {
+  do {
     M << value_set(id(0)), value_set(id(1)), value_set(id(2)), value_set(id(3));
     svd.compute(M);
-    CALL_SUBTEST( svd_check_full(M,svd) );
+    CALL_SUBTEST(svd_check_full(M, svd));
 
     id(k)++;
-    if(id(k)>=value_set.size())
-    {
-      while(k<3 && id(k)>=value_set.size()) id(++k)++;
+    if (id(k) >= value_set.size()) {
+      while (k < 3 && id(k) >= value_set.size()) id(++k)++;
       id.head(k).setZero();
-      k=0;
+      k = 0;
     }
 
-  } while((id<int(value_set.size())).all());
-  
+  } while ((id < int(value_set.size())).all());
+
 #if defined __INTEL_COMPILER
 #pragma warning pop
 #endif
-  
+
   // Check for overflow:
   Matrix3d M3;
-  M3 << 4.4331978442502944e+307, -5.8585363752028680e+307,  6.4527017443412964e+307,
-        3.7841695601406358e+307,  2.4331702789740617e+306, -3.5235707140272905e+307,
-       -8.7190887618028355e+307, -7.3453213709232193e+307, -2.4367363684472105e+307;
+  M3 << 4.4331978442502944e+307, -5.8585363752028680e+307, 6.4527017443412964e+307, 3.7841695601406358e+307,
+      2.4331702789740617e+306, -3.5235707140272905e+307, -8.7190887618028355e+307, -7.3453213709232193e+307,
+      -2.4367363684472105e+307;
 
   SVD_STATIC_OPTIONS(Matrix3d, ComputeFullU | ComputeFullV) svd3;
   svd3.compute(M3);  // just check we don't loop indefinitely
-  CALL_SUBTEST( svd_check_full(M3,svd3) );
+  CALL_SUBTEST(svd_check_full(M3, svd3));
 }
 
 template <typename MatrixType>
@@ -346,28 +332,25 @@
   MatrixType M;
   VectorXd value_set(3);
   value_set << 0, 1, -1;
-  Array4i id(0,0,0,0);
+  Array4i id(0, 0, 0, 0);
   int k = 0;
-  do
-  {
+  do {
     M << value_set(id(0)), value_set(id(1)), value_set(id(2)), value_set(id(3));
 
     cb(M);
 
     id(k)++;
-    if(id(k)>=value_set.size())
-    {
-      while(k<3 && id(k)>=value_set.size()) id(++k)++;
+    if (id(k) >= value_set.size()) {
+      while (k < 3 && id(k) >= value_set.size()) id(++k)++;
       id.head(k).setZero();
-      k=0;
+      k = 0;
     }
-    
-  } while((id<int(value_set.size())).all());
+
+  } while ((id < int(value_set.size())).all());
 }
 
-template<typename>
-void svd_preallocate()
-{
+template <typename>
+void svd_preallocate() {
   Vector3f v(3.f, 2.f, 1.f);
   MatrixXf m = v.asDiagonal();
 
@@ -395,12 +378,12 @@
 template <typename MatrixType, int QRPreconditioner = 0>
 void svd_verify_assert_full_only(const MatrixType& input = MatrixType()) {
   enum { RowsAtCompileTime = MatrixType::RowsAtCompileTime };
-  
+
   typedef Matrix<typename MatrixType::Scalar, RowsAtCompileTime, 1> RhsType;
   RhsType rhs = RhsType::Zero(input.rows());
   MatrixType m(input.rows(), input.cols());
   svd_fill_random(m);
-  
+
   SVD_STATIC_OPTIONS(MatrixType, QRPreconditioner) svd0;
   VERIFY_RAISES_ASSERT((svd0.matrixU()));
   VERIFY_RAISES_ASSERT((svd0.singularValues()));
@@ -550,11 +533,8 @@
 void svd_verify_constructor_options_assert(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
   Index rows = m.rows();
-  
-  enum {
-    RowsAtCompileTime = MatrixType::RowsAtCompileTime,
-    ColsAtCompileTime = MatrixType::ColsAtCompileTime
-  };
+
+  enum { RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime };
 
   typedef Matrix<Scalar, RowsAtCompileTime, 1> RhsType;
   RhsType rhs(rows);
diff --git a/test/svd_fill.h b/test/svd_fill.h
index 6411f57..d092e83 100644
--- a/test/svd_fill.h
+++ b/test/svd_fill.h
@@ -7,115 +7,103 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-template<typename T>
-Array<T,4,1> four_denorms();
+template <typename T>
+Array<T, 4, 1> four_denorms();
 
-template<>
-Array4f four_denorms() { return Array4f(5.60844e-39f, -5.60844e-39f, 4.94e-44f, -4.94e-44f); }
-template<>
-Array4d four_denorms() { return Array4d(5.60844e-313, -5.60844e-313, 4.94e-324, -4.94e-324); }
-template<typename T>
-Array<T,4,1> four_denorms() { return four_denorms<double>().cast<T>(); }
+template <>
+Array4f four_denorms() {
+  return Array4f(5.60844e-39f, -5.60844e-39f, 4.94e-44f, -4.94e-44f);
+}
+template <>
+Array4d four_denorms() {
+  return Array4d(5.60844e-313, -5.60844e-313, 4.94e-324, -4.94e-324);
+}
+template <typename T>
+Array<T, 4, 1> four_denorms() {
+  return four_denorms<double>().cast<T>();
+}
 
-template<typename MatrixType>
-void svd_fill_random(MatrixType &m, int Option = 0)
-{
+template <typename MatrixType>
+void svd_fill_random(MatrixType &m, int Option = 0) {
   using std::pow;
   typedef typename MatrixType::Scalar Scalar;
   typedef typename MatrixType::RealScalar RealScalar;
   Index diagSize = (std::min)(m.rows(), m.cols());
-  RealScalar s = std::numeric_limits<RealScalar>::max_exponent10/4;
-  s = internal::random<RealScalar>(1,s);
-  Matrix<RealScalar,Dynamic,1> d =  Matrix<RealScalar,Dynamic,1>::Random(diagSize);
-  for(Index k=0; k<diagSize; ++k)
-    d(k) = d(k)*pow(RealScalar(10),internal::random<RealScalar>(-s,s));
+  RealScalar s = std::numeric_limits<RealScalar>::max_exponent10 / 4;
+  s = internal::random<RealScalar>(1, s);
+  Matrix<RealScalar, Dynamic, 1> d = Matrix<RealScalar, Dynamic, 1>::Random(diagSize);
+  for (Index k = 0; k < diagSize; ++k) d(k) = d(k) * pow(RealScalar(10), internal::random<RealScalar>(-s, s));
 
-  bool dup     = internal::random<int>(0,10) < 3;
-  bool unit_uv = internal::random<int>(0,10) < (dup?7:3); // if we duplicate some diagonal entries, then increase the chance to preserve them using unitary U and V factors
-  
+  bool dup = internal::random<int>(0, 10) < 3;
+  bool unit_uv =
+      internal::random<int>(0, 10) < (dup ? 7 : 3);  // if we duplicate some diagonal entries, then increase the chance
+                                                     // to preserve them using unitary U and V factors
+
   // duplicate some singular values
-  if(dup)
-  {
-    Index n = internal::random<Index>(0,d.size()-1);
-    for(Index i=0; i<n; ++i)
-      d(internal::random<Index>(0,d.size()-1)) = d(internal::random<Index>(0,d.size()-1));
+  if (dup) {
+    Index n = internal::random<Index>(0, d.size() - 1);
+    for (Index i = 0; i < n; ++i)
+      d(internal::random<Index>(0, d.size() - 1)) = d(internal::random<Index>(0, d.size() - 1));
   }
-  
-  Matrix<Scalar,Dynamic,Dynamic> U(m.rows(),diagSize);
-  Matrix<Scalar,Dynamic,Dynamic> VT(diagSize,m.cols());
-  if(unit_uv)
-  {
+
+  Matrix<Scalar, Dynamic, Dynamic> U(m.rows(), diagSize);
+  Matrix<Scalar, Dynamic, Dynamic> VT(diagSize, m.cols());
+  if (unit_uv) {
     // in very rare cases let's try with a pure diagonal matrix
-    if(internal::random<int>(0,10) < 1)
-    {
+    if (internal::random<int>(0, 10) < 1) {
       U.setIdentity();
       VT.setIdentity();
+    } else {
+      createRandomPIMatrixOfRank(diagSize, U.rows(), U.cols(), U);
+      createRandomPIMatrixOfRank(diagSize, VT.rows(), VT.cols(), VT);
     }
-    else
-    {
-      createRandomPIMatrixOfRank(diagSize,U.rows(), U.cols(), U);
-      createRandomPIMatrixOfRank(diagSize,VT.rows(), VT.cols(), VT);
-    }
-  }
-  else
-  {
+  } else {
     U.setRandom();
     VT.setRandom();
   }
-  
-  Matrix<Scalar,Dynamic,1> samples(9);
-  samples << Scalar(0), four_denorms<RealScalar>(),
-            -RealScalar(1)/NumTraits<RealScalar>::highest(),
-            RealScalar(1)/NumTraits<RealScalar>::highest(),
-            (std::numeric_limits<RealScalar>::min)(),
-            pow((std::numeric_limits<RealScalar>::min)(), RealScalar(0.8));
-  
-  if(Option==Symmetric)
-  {
+
+  Matrix<Scalar, Dynamic, 1> samples(9);
+  samples << Scalar(0), four_denorms<RealScalar>(), -RealScalar(1) / NumTraits<RealScalar>::highest(),
+      RealScalar(1) / NumTraits<RealScalar>::highest(), (std::numeric_limits<RealScalar>::min)(),
+      pow((std::numeric_limits<RealScalar>::min)(), RealScalar(0.8));
+
+  if (Option == Symmetric) {
     m = U * d.asDiagonal() * U.transpose();
-    
+
     // randomly nullify some rows/columns
     {
-      Index count = internal::random<Index>(-diagSize,diagSize);
-      for(Index k=0; k<count; ++k)
-      {
-        Index i = internal::random<Index>(0,diagSize-1);
+      Index count = internal::random<Index>(-diagSize, diagSize);
+      for (Index k = 0; k < count; ++k) {
+        Index i = internal::random<Index>(0, diagSize - 1);
         m.row(i).setZero();
         m.col(i).setZero();
       }
-      if(count<0)
-      // (partly) cancel some coeffs
-      if(!(dup && unit_uv))
-      {
-        
-        Index n = internal::random<Index>(0,m.size()-1);
-        for(Index k=0; k<n; ++k)
-        {
-          Index i = internal::random<Index>(0,m.rows()-1);
-          Index j = internal::random<Index>(0,m.cols()-1);
-          m(j,i) = m(i,j) = samples(internal::random<Index>(0,samples.size()-1));
-          if(NumTraits<Scalar>::IsComplex)
-            *(&numext::real_ref(m(j,i))+1) = *(&numext::real_ref(m(i,j))+1) = samples.real()(internal::random<Index>(0,samples.size()-1));
+      if (count < 0)
+        // (partly) cancel some coeffs
+        if (!(dup && unit_uv)) {
+          Index n = internal::random<Index>(0, m.size() - 1);
+          for (Index k = 0; k < n; ++k) {
+            Index i = internal::random<Index>(0, m.rows() - 1);
+            Index j = internal::random<Index>(0, m.cols() - 1);
+            m(j, i) = m(i, j) = samples(internal::random<Index>(0, samples.size() - 1));
+            if (NumTraits<Scalar>::IsComplex)
+              *(&numext::real_ref(m(j, i)) + 1) = *(&numext::real_ref(m(i, j)) + 1) =
+                  samples.real()(internal::random<Index>(0, samples.size() - 1));
+          }
         }
-      }
     }
-  }
-  else
-  {
+  } else {
     m = U * d.asDiagonal() * VT;
     // (partly) cancel some coeffs
-    if(!(dup && unit_uv))
-    {
-      Index n = internal::random<Index>(0,m.size()-1);
-      for(Index k=0; k<n; ++k)
-      {
-        Index i = internal::random<Index>(0,m.rows()-1);
-        Index j = internal::random<Index>(0,m.cols()-1);
-        m(i,j) = samples(internal::random<Index>(0,samples.size()-1));
-        if(NumTraits<Scalar>::IsComplex)
-          *(&numext::real_ref(m(i,j))+1) = samples.real()(internal::random<Index>(0,samples.size()-1));
+    if (!(dup && unit_uv)) {
+      Index n = internal::random<Index>(0, m.size() - 1);
+      for (Index k = 0; k < n; ++k) {
+        Index i = internal::random<Index>(0, m.rows() - 1);
+        Index j = internal::random<Index>(0, m.cols() - 1);
+        m(i, j) = samples(internal::random<Index>(0, samples.size() - 1));
+        if (NumTraits<Scalar>::IsComplex)
+          *(&numext::real_ref(m(i, j)) + 1) = samples.real()(internal::random<Index>(0, samples.size() - 1));
       }
     }
   }
 }
-
diff --git a/test/swap.cpp b/test/swap.cpp
index e8d6881..bc29704 100644
--- a/test/swap.cpp
+++ b/test/swap.cpp
@@ -9,22 +9,19 @@
 
 #include "main.h"
 
-template<typename T>
-struct other_matrix_type
-{
+template <typename T>
+struct other_matrix_type {
   typedef int type;
 };
 
-template<typename Scalar_, int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
-struct other_matrix_type<Matrix<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_> >
-{
-  typedef Matrix<Scalar_, Rows_, Cols_, Options_^RowMajor, MaxRows_, MaxCols_> type;
+template <typename Scalar_, int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
+struct other_matrix_type<Matrix<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_> > {
+  typedef Matrix<Scalar_, Rows_, Cols_, Options_ ^ RowMajor, MaxRows_, MaxCols_> type;
 };
 
 template <typename MatrixType>
-std::enable_if_t<(MatrixType::RowsAtCompileTime==1 || MatrixType::RowsAtCompileTime==Dynamic), void>
-check_row_swap(MatrixType& m1) {
-  
+std::enable_if_t<(MatrixType::RowsAtCompileTime == 1 || MatrixType::RowsAtCompileTime == Dynamic), void> check_row_swap(
+    MatrixType& m1) {
   if (m1.rows() != 1) {
     // test assertion on mismatching size -- matrix case
     VERIFY_RAISES_ASSERT(m1.swap(m1.row(0)));
@@ -34,71 +31,68 @@
 }
 
 template <typename MatrixType>
-std::enable_if_t<!(MatrixType::RowsAtCompileTime==1 || MatrixType::RowsAtCompileTime==Dynamic), void>
-check_row_swap(MatrixType& /* unused */) {
-}
+std::enable_if_t<!(MatrixType::RowsAtCompileTime == 1 || MatrixType::RowsAtCompileTime == Dynamic), void>
+check_row_swap(MatrixType& /* unused */) {}
 
-template<typename MatrixType> void swap(const MatrixType& m)
-{
+template <typename MatrixType>
+void swap(const MatrixType& m) {
   typedef typename other_matrix_type<MatrixType>::type OtherMatrixType;
   typedef typename MatrixType::Scalar Scalar;
 
-  eigen_assert((!internal::is_same<MatrixType,OtherMatrixType>::value));
+  eigen_assert((!internal::is_same<MatrixType, OtherMatrixType>::value));
   Index rows = m.rows();
   Index cols = m.cols();
-  
+
   // construct 3 matrix guaranteed to be distinct
-  MatrixType m1 = MatrixType::Random(rows,cols);
-  MatrixType m2 = MatrixType::Random(rows,cols) + Scalar(100) * MatrixType::Identity(rows,cols);
-  OtherMatrixType m3 = OtherMatrixType::Random(rows,cols) + Scalar(200) * OtherMatrixType::Identity(rows,cols);
-  
+  MatrixType m1 = MatrixType::Random(rows, cols);
+  MatrixType m2 = MatrixType::Random(rows, cols) + Scalar(100) * MatrixType::Identity(rows, cols);
+  OtherMatrixType m3 = OtherMatrixType::Random(rows, cols) + Scalar(200) * OtherMatrixType::Identity(rows, cols);
+
   MatrixType m1_copy = m1;
   MatrixType m2_copy = m2;
   OtherMatrixType m3_copy = m3;
-  
+
   // test swapping 2 matrices of same type
-  Scalar *d1=m1.data(), *d2=m2.data();
+  Scalar *d1 = m1.data(), *d2 = m2.data();
   m1.swap(m2);
-  VERIFY_IS_APPROX(m1,m2_copy);
-  VERIFY_IS_APPROX(m2,m1_copy);
-  if(MatrixType::SizeAtCompileTime==Dynamic)
-  {
-    VERIFY(m1.data()==d2);
-    VERIFY(m2.data()==d1);
+  VERIFY_IS_APPROX(m1, m2_copy);
+  VERIFY_IS_APPROX(m2, m1_copy);
+  if (MatrixType::SizeAtCompileTime == Dynamic) {
+    VERIFY(m1.data() == d2);
+    VERIFY(m2.data() == d1);
   }
   m1 = m1_copy;
   m2 = m2_copy;
-  
+
   // test swapping 2 matrices of different types
   m1.swap(m3);
-  VERIFY_IS_APPROX(m1,m3_copy);
-  VERIFY_IS_APPROX(m3,m1_copy);
+  VERIFY_IS_APPROX(m1, m3_copy);
+  VERIFY_IS_APPROX(m3, m1_copy);
   m1 = m1_copy;
   m3 = m3_copy;
-  
+
   // test swapping matrix with expression
-  m1.swap(m2.block(0,0,rows,cols));
-  VERIFY_IS_APPROX(m1,m2_copy);
-  VERIFY_IS_APPROX(m2,m1_copy);
+  m1.swap(m2.block(0, 0, rows, cols));
+  VERIFY_IS_APPROX(m1, m2_copy);
+  VERIFY_IS_APPROX(m2, m1_copy);
   m1 = m1_copy;
   m2 = m2_copy;
 
   // test swapping two expressions of different types
   m1.transpose().swap(m3.transpose());
-  VERIFY_IS_APPROX(m1,m3_copy);
-  VERIFY_IS_APPROX(m3,m1_copy);
+  VERIFY_IS_APPROX(m1, m3_copy);
+  VERIFY_IS_APPROX(m3, m1_copy);
   m1 = m1_copy;
   m3 = m3_copy;
 
   check_row_swap(m1);
 }
 
-EIGEN_DECLARE_TEST(swap)
-{
-  int s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE);
-  CALL_SUBTEST_1( swap(Matrix3f()) ); // fixed size, no vectorization 
-  CALL_SUBTEST_2( swap(Matrix4d()) ); // fixed size, possible vectorization 
-  CALL_SUBTEST_3( swap(MatrixXd(s,s)) ); // dyn size, no vectorization 
-  CALL_SUBTEST_4( swap(MatrixXf(s,s)) ); // dyn size, possible vectorization 
+EIGEN_DECLARE_TEST(swap) {
+  int s = internal::random<int>(1, EIGEN_TEST_MAX_SIZE);
+  CALL_SUBTEST_1(swap(Matrix3f()));      // fixed size, no vectorization
+  CALL_SUBTEST_2(swap(Matrix4d()));      // fixed size, possible vectorization
+  CALL_SUBTEST_3(swap(MatrixXd(s, s)));  // dyn size, no vectorization
+  CALL_SUBTEST_4(swap(MatrixXf(s, s)));  // dyn size, possible vectorization
   TEST_SET_BUT_UNUSED_VARIABLE(s)
 }
diff --git a/test/symbolic_index.cpp b/test/symbolic_index.cpp
index 53eb55d..1bd5bd8 100644
--- a/test/symbolic_index.cpp
+++ b/test/symbolic_index.cpp
@@ -9,67 +9,65 @@
 
 #include "main.h"
 
+using Eigen::placeholders::all;
 using Eigen::placeholders::last;
 using Eigen::placeholders::lastp1;
-using Eigen::placeholders::all;
 
-template<typename T1,typename T2>
-bool is_same_symb(const T1& a, const T2& b, Index size)
-{
-  return a.eval(last=size-1) == b.eval(last=size-1);
+template <typename T1, typename T2>
+bool is_same_symb(const T1& a, const T2& b, Index size) {
+  return a.eval(last = size - 1) == b.eval(last = size - 1);
 }
 
-template<typename T>
+template <typename T>
 void check_is_symbolic(const T&) {
-  STATIC_CHECK(( symbolic::is_symbolic<T>::value ))
+  STATIC_CHECK((symbolic::is_symbolic<T>::value))
 }
 
-template<typename T>
+template <typename T>
 void check_isnot_symbolic(const T&) {
-  STATIC_CHECK(( !symbolic::is_symbolic<T>::value ))
+  STATIC_CHECK((!symbolic::is_symbolic<T>::value))
 }
 
-#define VERIFY_EQ_INT(A,B) VERIFY_IS_APPROX(int(A),int(B))
+#define VERIFY_EQ_INT(A, B) VERIFY_IS_APPROX(int(A), int(B))
 
-void check_symbolic_index()
-{
+void check_symbolic_index() {
   check_is_symbolic(last);
   check_is_symbolic(lastp1);
-  check_is_symbolic(last+1);
-  check_is_symbolic(last-lastp1);
-  check_is_symbolic(2*last-lastp1/2);
+  check_is_symbolic(last + 1);
+  check_is_symbolic(last - lastp1);
+  check_is_symbolic(2 * last - lastp1 / 2);
   check_isnot_symbolic(fix<3>());
 
-  Index size=100;
+  Index size = 100;
 
   // First, let's check FixedInt arithmetic:
-  VERIFY( is_same_type( (fix<5>()-fix<3>())*fix<9>()/(-fix<3>()), fix<-(5-3)*9/3>() ) );
-  VERIFY( is_same_type( (fix<5>()-fix<3>())*fix<9>()/fix<2>(), fix<(5-3)*9/2>() ) );
-  VERIFY( is_same_type( fix<9>()/fix<2>(), fix<9/2>() ) );
-  VERIFY( is_same_type( fix<9>()%fix<2>(), fix<9%2>() ) );
-  VERIFY( is_same_type( fix<9>()&fix<2>(), fix<9&2>() ) );
-  VERIFY( is_same_type( fix<9>()|fix<2>(), fix<9|2>() ) );
-  VERIFY( is_same_type( fix<9>()/2, int(9/2) ) );
+  VERIFY(is_same_type((fix<5>() - fix<3>()) * fix<9>() / (-fix<3>()), fix<-(5 - 3) * 9 / 3>()));
+  VERIFY(is_same_type((fix<5>() - fix<3>()) * fix<9>() / fix<2>(), fix<(5 - 3) * 9 / 2>()));
+  VERIFY(is_same_type(fix<9>() / fix<2>(), fix<9 / 2>()));
+  VERIFY(is_same_type(fix<9>() % fix<2>(), fix<9 % 2>()));
+  VERIFY(is_same_type(fix<9>() & fix<2>(), fix<9 & 2>()));
+  VERIFY(is_same_type(fix<9>() | fix<2>(), fix<9 | 2>()));
+  VERIFY(is_same_type(fix<9>() / 2, int(9 / 2)));
 
-  VERIFY( is_same_symb( lastp1-1, last, size) );
-  VERIFY( is_same_symb( lastp1-fix<1>(), last, size) );
+  VERIFY(is_same_symb(lastp1 - 1, last, size));
+  VERIFY(is_same_symb(lastp1 - fix<1>(), last, size));
 
-  VERIFY_IS_EQUAL( ( (last*5-2)/3 ).eval(last=size-1), ((size-1)*5-2)/3 );
-  VERIFY_IS_EQUAL( ( (last*fix<5>()-fix<2>())/fix<3>() ).eval(last=size-1), ((size-1)*5-2)/3 );
-  VERIFY_IS_EQUAL( ( -last*lastp1  ).eval(last=size-1), -(size-1)*size );
-  VERIFY_IS_EQUAL( ( lastp1-3*last  ).eval(last=size-1), size- 3*(size-1) );
-  VERIFY_IS_EQUAL( ( (lastp1-3*last)/lastp1  ).eval(last=size-1), (size- 3*(size-1))/size );
+  VERIFY_IS_EQUAL(((last * 5 - 2) / 3).eval(last = size - 1), ((size - 1) * 5 - 2) / 3);
+  VERIFY_IS_EQUAL(((last * fix<5>() - fix<2>()) / fix<3>()).eval(last = size - 1), ((size - 1) * 5 - 2) / 3);
+  VERIFY_IS_EQUAL((-last * lastp1).eval(last = size - 1), -(size - 1) * size);
+  VERIFY_IS_EQUAL((lastp1 - 3 * last).eval(last = size - 1), size - 3 * (size - 1));
+  VERIFY_IS_EQUAL(((lastp1 - 3 * last) / lastp1).eval(last = size - 1), (size - 3 * (size - 1)) / size);
 
   {
-    struct x_tag {};  static const symbolic::SymbolExpr<x_tag> x;
-    struct y_tag {};  static const symbolic::SymbolExpr<y_tag> y;
-    struct z_tag {};  static const symbolic::SymbolExpr<z_tag> z;
+    struct x_tag {};
+    static const symbolic::SymbolExpr<x_tag> x;
+    struct y_tag {};
+    static const symbolic::SymbolExpr<y_tag> y;
+    struct z_tag {};
+    static const symbolic::SymbolExpr<z_tag> z;
 
-    VERIFY_IS_APPROX( int(((x+3)/y+z).eval(x=6,y=3,z=-13)), (6+3)/3+(-13) );
+    VERIFY_IS_APPROX(int(((x + 3) / y + z).eval(x = 6, y = 3, z = -13)), (6 + 3) / 3 + (-13));
   }
 }
 
-EIGEN_DECLARE_TEST(symbolic_index)
-{
-  CALL_SUBTEST_1( check_symbolic_index() );
-}
+EIGEN_DECLARE_TEST(symbolic_index) { CALL_SUBTEST_1(check_symbolic_index()); }
diff --git a/test/threads_eventcount.cpp b/test/threads_eventcount.cpp
index 76fab31..bd6e9a8 100644
--- a/test/threads_eventcount.cpp
+++ b/test/threads_eventcount.cpp
@@ -23,8 +23,7 @@
 #endif
 }
 
-static void test_basic_eventcount()
-{
+static void test_basic_eventcount() {
   MaxSizeVector<EventCount::Waiter> waiters(1);
   waiters.resize(1);
   EventCount ec(waiters);
@@ -52,8 +51,7 @@
       VERIFY_GE(val, 0);
       VERIFY_LE(val, kQueueSize);
       if (val == kQueueSize) return false;
-      if (val_.compare_exchange_weak(val, val + 1, std::memory_order_relaxed))
-        return true;
+      if (val_.compare_exchange_weak(val, val + 1, std::memory_order_relaxed)) return true;
     }
   }
 
@@ -63,8 +61,7 @@
       VERIFY_GE(val, 0);
       VERIFY_LE(val, kQueueSize);
       if (val == 0) return false;
-      if (val_.compare_exchange_weak(val, val - 1, std::memory_order_relaxed))
-        return true;
+      if (val_.compare_exchange_weak(val, val - 1, std::memory_order_relaxed)) return true;
     }
   }
 
@@ -76,8 +73,7 @@
 // A number of producers send messages to a set of consumers using a set of
 // fake queues. Ensure that it does not crash, consumers don't deadlock and
 // number of blocked and unblocked threads match.
-static void test_stress_eventcount()
-{
+static void test_stress_eventcount() {
   const int kThreads = std::thread::hardware_concurrency();
   static const int kEvents = 1 << 16;
   static const int kQueues = 10;
@@ -135,8 +131,7 @@
   }
 }
 
-EIGEN_DECLARE_TEST(cxx11_eventcount)
-{
+EIGEN_DECLARE_TEST(cxx11_eventcount) {
   CALL_SUBTEST(test_basic_eventcount());
   CALL_SUBTEST(test_stress_eventcount());
 }
diff --git a/test/threads_non_blocking_thread_pool.cpp b/test/threads_non_blocking_thread_pool.cpp
index 25ba96c..2f0cf58 100644
--- a/test/threads_non_blocking_thread_pool.cpp
+++ b/test/threads_non_blocking_thread_pool.cpp
@@ -12,8 +12,7 @@
 #include "main.h"
 #include "Eigen/ThreadPool"
 
-static void test_create_destroy_empty_pool()
-{
+static void test_create_destroy_empty_pool() {
   // Just create and destroy the pool. This will wind up and tear down worker
   // threads. Ensure there are no issues in that logic.
   for (int i = 0; i < 16; ++i) {
@@ -21,9 +20,7 @@
   }
 }
 
-
-static void test_parallelism(bool allow_spinning)
-{
+static void test_parallelism(bool allow_spinning) {
   // Test we never-ever fail to match available tasks with idle threads.
   const int kThreads = 16;  // code below expects that this is a multiple of 4
   ThreadPool tp(kThreads, allow_spinning);
@@ -100,17 +97,13 @@
   }
 }
 
-
-static void test_cancel()
-{
+static void test_cancel() {
   ThreadPool tp(2);
 
   // Schedule a large number of closure that each sleeps for one second. This
   // will keep the thread pool busy for much longer than the default test timeout.
   for (int i = 0; i < 1000; ++i) {
-    tp.Schedule([]() {
-      std::this_thread::sleep_for(std::chrono::milliseconds(2000));
-    });
+    tp.Schedule([]() { std::this_thread::sleep_for(std::chrono::milliseconds(2000)); });
   }
 
   // Cancel the processing of all the closures that are still pending.
@@ -168,9 +161,7 @@
   phase = 2;
 }
 
-
-EIGEN_DECLARE_TEST(cxx11_non_blocking_thread_pool)
-{
+EIGEN_DECLARE_TEST(cxx11_non_blocking_thread_pool) {
   CALL_SUBTEST(test_create_destroy_empty_pool());
   CALL_SUBTEST(test_parallelism(true));
   CALL_SUBTEST(test_parallelism(false));
diff --git a/test/threads_runqueue.cpp b/test/threads_runqueue.cpp
index 99668e7..4847eae 100644
--- a/test/threads_runqueue.cpp
+++ b/test/threads_runqueue.cpp
@@ -13,7 +13,6 @@
 #include "main.h"
 #include <Eigen/ThreadPool>
 
-
 // Visual studio doesn't implement a rand_r() function since its
 // implementation of rand() is already thread safe
 int rand_reentrant(unsigned int* s) {
@@ -25,8 +24,7 @@
 #endif
 }
 
-void test_basic_runqueue()
-{
+void test_basic_runqueue() {
   RunQueue<int, 4> q;
   // Check empty state.
   VERIFY(q.Empty());
@@ -117,8 +115,7 @@
 // 1 element (either front or back at random). So queue always contains at least
 // 1 element, but otherwise changes chaotically. Another thread constantly tests
 // that the queue is not claimed to be empty.
-void test_empty_runqueue()
-{
+void test_empty_runqueue() {
   RunQueue<int, 4> q;
   q.PushFront(1);
   std::atomic<bool> done(false);
@@ -157,8 +154,7 @@
 // Stress is a chaotic random test.
 // One thread (owner) calls PushFront/PopFront, other threads call PushBack/
 // PopBack. Ensure that we don't crash, deadlock, and all sanity checks pass.
-void test_stress_runqueue()
-{
+void test_stress_runqueue() {
   static const int kEvents = 1 << 18;
   RunQueue<int, 8> q;
   std::atomic<int> total(0);
@@ -227,8 +223,7 @@
   VERIFY(total.load() == 0);
 }
 
-EIGEN_DECLARE_TEST(cxx11_runqueue)
-{
+EIGEN_DECLARE_TEST(cxx11_runqueue) {
   CALL_SUBTEST_1(test_basic_runqueue());
   CALL_SUBTEST_2(test_empty_runqueue());
   CALL_SUBTEST_3(test_stress_runqueue());
diff --git a/test/triangular.cpp b/test/triangular.cpp
index 0578b08..62bb774 100644
--- a/test/triangular.cpp
+++ b/test/triangular.cpp
@@ -8,73 +8,67 @@
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #if defined(EIGEN_TEST_PART_100) || defined(EIGEN_TEST_PART_ALL)
-#  define EIGEN_NO_DEPRECATED_WARNING
+#define EIGEN_NO_DEPRECATED_WARNING
 #endif
 
 #include "main.h"
 
-
-template<typename MatrixType> void triangular_deprecated(const MatrixType &m)
-{
+template <typename MatrixType>
+void triangular_deprecated(const MatrixType& m) {
   Index rows = m.rows();
   Index cols = m.cols();
   MatrixType m1, m2, m3, m4;
-  m1.setRandom(rows,cols);
-  m2.setRandom(rows,cols);
-  m3 = m1; m4 = m2;
+  m1.setRandom(rows, cols);
+  m2.setRandom(rows, cols);
+  m3 = m1;
+  m4 = m2;
   // deprecated method:
   m1.template triangularView<Eigen::Upper>().swap(m2);
   // use this method instead:
   m3.template triangularView<Eigen::Upper>().swap(m4.template triangularView<Eigen::Upper>());
-  VERIFY_IS_APPROX(m1,m3);
-  VERIFY_IS_APPROX(m2,m4);
+  VERIFY_IS_APPROX(m1, m3);
+  VERIFY_IS_APPROX(m2, m4);
   // deprecated method:
   m1.template triangularView<Eigen::Lower>().swap(m4);
   // use this method instead:
   m3.template triangularView<Eigen::Lower>().swap(m2.template triangularView<Eigen::Lower>());
-  VERIFY_IS_APPROX(m1,m3);
-  VERIFY_IS_APPROX(m2,m4);
+  VERIFY_IS_APPROX(m1, m3);
+  VERIFY_IS_APPROX(m2, m4);
 }
 
-
-template<typename MatrixType> void triangular_square(const MatrixType& m)
-{
+template <typename MatrixType>
+void triangular_square(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
   typedef typename NumTraits<Scalar>::Real RealScalar;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
 
-  RealScalar largerEps = 10*test_precision<RealScalar>();
+  RealScalar largerEps = 10 * test_precision<RealScalar>();
 
   Index rows = m.rows();
   Index cols = m.cols();
 
-  MatrixType m1 = MatrixType::Random(rows, cols),
-             m2 = MatrixType::Random(rows, cols),
-             m3(rows, cols),
-             m4(rows, cols),
-             r1(rows, cols),
-             r2(rows, cols);
+  MatrixType m1 = MatrixType::Random(rows, cols), m2 = MatrixType::Random(rows, cols), m3(rows, cols), m4(rows, cols),
+             r1(rows, cols), r2(rows, cols);
   VectorType v2 = VectorType::Random(rows);
   VectorType v3 = VectorType::Zero(rows);
 
   MatrixType m1up = m1.template triangularView<Upper>();
   MatrixType m2up = m2.template triangularView<Upper>();
 
-  if (rows*cols>1)
-  {
+  if (rows * cols > 1) {
     VERIFY(m1up.isUpperTriangular());
     VERIFY(m2up.transpose().isLowerTriangular());
     VERIFY(!m2.isLowerTriangular());
   }
 
-//   VERIFY_IS_APPROX(m1up.transpose() * m2, m1.upper().transpose().lower() * m2);
+  //   VERIFY_IS_APPROX(m1up.transpose() * m2, m1.upper().transpose().lower() * m2);
 
   // test overloaded operator+=
   r1.setZero();
   r2.setZero();
-  r1.template triangularView<Upper>() +=  m1;
+  r1.template triangularView<Upper>() += m1;
   r2 += m1up;
-  VERIFY_IS_APPROX(r1,r2);
+  VERIFY_IS_APPROX(r1, r2);
 
   // test overloaded operator=
   m1.setZero();
@@ -91,8 +85,8 @@
                    m3.conjugate().template triangularView<Lower>().toDenseMatrix());
 
   m1 = MatrixType::Random(rows, cols);
-  for (int i=0; i<rows; ++i)
-    while (numext::abs2(m1(i,i))<RealScalar(1e-1)) m1(i,i) = internal::random<Scalar>();
+  for (int i = 0; i < rows; ++i)
+    while (numext::abs2(m1(i, i)) < RealScalar(1e-1)) m1(i, i) = internal::random<Scalar>();
 
   Transpose<MatrixType> trm4(m4);
   // test back and forward substitution with a vector as the rhs
@@ -138,8 +132,8 @@
   m3 = m1.template triangularView<UnitUpper>();
   VERIFY(m2.isApprox(m3 * (m1.template triangularView<UnitUpper>().solve(m2)), largerEps));
 
-//   VERIFY((  m1.template triangularView<Upper>()
-//           * m2.template triangularView<Upper>()).isUpperTriangular());
+  //   VERIFY((  m1.template triangularView<Upper>()
+  //           * m2.template triangularView<Upper>()).isUpperTriangular());
 
   // test swap
   m1.setOnes();
@@ -147,63 +141,64 @@
   m2.template triangularView<Upper>().swap(m1.template triangularView<Eigen::Upper>());
   m3.setZero();
   m3.template triangularView<Upper>().setOnes();
-  VERIFY_IS_APPROX(m2,m3);
+  VERIFY_IS_APPROX(m2, m3);
 
   m1.setRandom();
   m3 = m1.template triangularView<Upper>();
-  Matrix<Scalar, MatrixType::ColsAtCompileTime, Dynamic> m5(cols, internal::random<int>(1,20));  m5.setRandom();
-  Matrix<Scalar, Dynamic, MatrixType::RowsAtCompileTime> m6(internal::random<int>(1,20), rows);  m6.setRandom();
-  VERIFY_IS_APPROX(m1.template triangularView<Upper>() * m5, m3*m5);
-  VERIFY_IS_APPROX(m6*m1.template triangularView<Upper>(), m6*m3);
+  Matrix<Scalar, MatrixType::ColsAtCompileTime, Dynamic> m5(cols, internal::random<int>(1, 20));
+  m5.setRandom();
+  Matrix<Scalar, Dynamic, MatrixType::RowsAtCompileTime> m6(internal::random<int>(1, 20), rows);
+  m6.setRandom();
+  VERIFY_IS_APPROX(m1.template triangularView<Upper>() * m5, m3 * m5);
+  VERIFY_IS_APPROX(m6 * m1.template triangularView<Upper>(), m6 * m3);
 
   m1up = m1.template triangularView<Upper>();
   VERIFY_IS_APPROX(m1.template selfadjointView<Upper>().template triangularView<Upper>().toDenseMatrix(), m1up);
   VERIFY_IS_APPROX(m1up.template selfadjointView<Upper>().template triangularView<Upper>().toDenseMatrix(), m1up);
-  VERIFY_IS_APPROX(m1.template selfadjointView<Upper>().template triangularView<Lower>().toDenseMatrix(), m1up.adjoint());
-  VERIFY_IS_APPROX(m1up.template selfadjointView<Upper>().template triangularView<Lower>().toDenseMatrix(), m1up.adjoint());
+  VERIFY_IS_APPROX(m1.template selfadjointView<Upper>().template triangularView<Lower>().toDenseMatrix(),
+                   m1up.adjoint());
+  VERIFY_IS_APPROX(m1up.template selfadjointView<Upper>().template triangularView<Lower>().toDenseMatrix(),
+                   m1up.adjoint());
 
   VERIFY_IS_APPROX(m1.template selfadjointView<Upper>().diagonal(), m1.diagonal());
 
   m3.setRandom();
   const MatrixType& m3c(m3);
-  VERIFY( is_same_type(m3c.template triangularView<Lower>(),m3.template triangularView<Lower>().template conjugateIf<false>()) );
-  VERIFY( is_same_type(m3c.template triangularView<Lower>().conjugate(),m3.template triangularView<Lower>().template conjugateIf<true>()) );
+  VERIFY(is_same_type(m3c.template triangularView<Lower>(),
+                      m3.template triangularView<Lower>().template conjugateIf<false>()));
+  VERIFY(is_same_type(m3c.template triangularView<Lower>().conjugate(),
+                      m3.template triangularView<Lower>().template conjugateIf<true>()));
   VERIFY_IS_APPROX(m3.template triangularView<Lower>().template conjugateIf<true>().toDenseMatrix(),
                    m3.conjugate().template triangularView<Lower>().toDenseMatrix());
   VERIFY_IS_APPROX(m3.template triangularView<Lower>().template conjugateIf<false>().toDenseMatrix(),
                    m3.template triangularView<Lower>().toDenseMatrix());
 
-  VERIFY( is_same_type(m3c.template selfadjointView<Lower>(),m3.template selfadjointView<Lower>().template conjugateIf<false>()) );
-  VERIFY( is_same_type(m3c.template selfadjointView<Lower>().conjugate(),m3.template selfadjointView<Lower>().template conjugateIf<true>()) );
+  VERIFY(is_same_type(m3c.template selfadjointView<Lower>(),
+                      m3.template selfadjointView<Lower>().template conjugateIf<false>()));
+  VERIFY(is_same_type(m3c.template selfadjointView<Lower>().conjugate(),
+                      m3.template selfadjointView<Lower>().template conjugateIf<true>()));
   VERIFY_IS_APPROX(m3.template selfadjointView<Lower>().template conjugateIf<true>().toDenseMatrix(),
                    m3.conjugate().template selfadjointView<Lower>().toDenseMatrix());
   VERIFY_IS_APPROX(m3.template selfadjointView<Lower>().template conjugateIf<false>().toDenseMatrix(),
                    m3.template selfadjointView<Lower>().toDenseMatrix());
-
 }
 
-
-template<typename MatrixType> void triangular_rect(const MatrixType& m)
-{
+template <typename MatrixType>
+void triangular_rect(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
   typedef typename NumTraits<Scalar>::Real RealScalar;
-  enum { Rows =  MatrixType::RowsAtCompileTime, Cols =  MatrixType::ColsAtCompileTime };
+  enum { Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime };
 
   Index rows = m.rows();
   Index cols = m.cols();
 
-  MatrixType m1 = MatrixType::Random(rows, cols),
-             m2 = MatrixType::Random(rows, cols),
-             m3(rows, cols),
-             m4(rows, cols),
-             r1(rows, cols),
-             r2(rows, cols);
+  MatrixType m1 = MatrixType::Random(rows, cols), m2 = MatrixType::Random(rows, cols), m3(rows, cols), m4(rows, cols),
+             r1(rows, cols), r2(rows, cols);
 
   MatrixType m1up = m1.template triangularView<Upper>();
   MatrixType m2up = m2.template triangularView<Upper>();
 
-  if (rows>1 && cols>1)
-  {
+  if (rows > 1 && cols > 1) {
     VERIFY(m1up.isUpperTriangular());
     VERIFY(m2up.transpose().isLowerTriangular());
     VERIFY(!m2.isLowerTriangular());
@@ -212,9 +207,9 @@
   // test overloaded operator+=
   r1.setZero();
   r2.setZero();
-  r1.template triangularView<Upper>() +=  m1;
+  r1.template triangularView<Upper>() += m1;
   r2 += m1up;
-  VERIFY_IS_APPROX(r1,r2);
+  VERIFY_IS_APPROX(r1, r2);
 
   // test overloaded operator=
   m1.setZero();
@@ -222,7 +217,6 @@
   m3 = 3 * m2;
   VERIFY_IS_APPROX(m3.template triangularView<Upper>().toDenseMatrix(), m1);
 
-
   m1.setZero();
   m1.template triangularView<Lower>() = 3 * m2;
   VERIFY_IS_APPROX(m3.template triangularView<Lower>().toDenseMatrix(), m1);
@@ -231,7 +225,6 @@
   m1.template triangularView<StrictlyUpper>() = 3 * m2;
   VERIFY_IS_APPROX(m3.template triangularView<StrictlyUpper>().toDenseMatrix(), m1);
 
-
   m1.setZero();
   m1.template triangularView<StrictlyLower>() = 3 * m2;
   VERIFY_IS_APPROX(m3.template triangularView<StrictlyLower>().toDenseMatrix(), m1);
@@ -262,39 +255,38 @@
   m2.template triangularView<Upper>().swap(m1.template triangularView<Eigen::Upper>());
   m3.setZero();
   m3.template triangularView<Upper>().setOnes();
-  VERIFY_IS_APPROX(m2,m3);
+  VERIFY_IS_APPROX(m2, m3);
 }
 
-void bug_159()
-{
+void bug_159() {
   Matrix3d m = Matrix3d::Random().triangularView<Lower>();
   EIGEN_UNUSED_VARIABLE(m)
 }
 
-EIGEN_DECLARE_TEST(triangular)
-{
-  int maxsize = (std::min)(EIGEN_TEST_MAX_SIZE,20);
-  for(int i = 0; i < g_repeat ; i++)
-  {
-    int r = internal::random<int>(2,maxsize); TEST_SET_BUT_UNUSED_VARIABLE(r)
-    int c = internal::random<int>(2,maxsize); TEST_SET_BUT_UNUSED_VARIABLE(c)
+EIGEN_DECLARE_TEST(triangular) {
+  int maxsize = (std::min)(EIGEN_TEST_MAX_SIZE, 20);
+  for (int i = 0; i < g_repeat; i++) {
+    int r = internal::random<int>(2, maxsize);
+    TEST_SET_BUT_UNUSED_VARIABLE(r)
+    int c = internal::random<int>(2, maxsize);
+    TEST_SET_BUT_UNUSED_VARIABLE(c)
 
-    CALL_SUBTEST_1( triangular_square(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( triangular_square(Matrix<float, 2, 2>()) );
-    CALL_SUBTEST_3( triangular_square(Matrix3d()) );
-    CALL_SUBTEST_4( triangular_square(Matrix<std::complex<float>,8, 8>()) );
-    CALL_SUBTEST_5( triangular_square(MatrixXcd(r,r)) );
-    CALL_SUBTEST_6( triangular_square(Matrix<float,Dynamic,Dynamic,RowMajor>(r, r)) );
+    CALL_SUBTEST_1(triangular_square(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(triangular_square(Matrix<float, 2, 2>()));
+    CALL_SUBTEST_3(triangular_square(Matrix3d()));
+    CALL_SUBTEST_4(triangular_square(Matrix<std::complex<float>, 8, 8>()));
+    CALL_SUBTEST_5(triangular_square(MatrixXcd(r, r)));
+    CALL_SUBTEST_6(triangular_square(Matrix<float, Dynamic, Dynamic, RowMajor>(r, r)));
 
-    CALL_SUBTEST_7( triangular_rect(Matrix<float, 4, 5>()) );
-    CALL_SUBTEST_8( triangular_rect(Matrix<double, 6, 2>()) );
-    CALL_SUBTEST_9( triangular_rect(MatrixXcf(r, c)) );
-    CALL_SUBTEST_5( triangular_rect(MatrixXcd(r, c)) );
-    CALL_SUBTEST_6( triangular_rect(Matrix<float,Dynamic,Dynamic,RowMajor>(r, c)) );
+    CALL_SUBTEST_7(triangular_rect(Matrix<float, 4, 5>()));
+    CALL_SUBTEST_8(triangular_rect(Matrix<double, 6, 2>()));
+    CALL_SUBTEST_9(triangular_rect(MatrixXcf(r, c)));
+    CALL_SUBTEST_5(triangular_rect(MatrixXcd(r, c)));
+    CALL_SUBTEST_6(triangular_rect(Matrix<float, Dynamic, Dynamic, RowMajor>(r, c)));
 
-    CALL_SUBTEST_100( triangular_deprecated(Matrix<float, 5, 7>()) );
-    CALL_SUBTEST_100( triangular_deprecated(MatrixXd(r,c)) );
+    CALL_SUBTEST_100(triangular_deprecated(Matrix<float, 5, 7>()));
+    CALL_SUBTEST_100(triangular_deprecated(MatrixXd(r, c)));
   }
-  
-  CALL_SUBTEST_1( bug_159() );
+
+  CALL_SUBTEST_1(bug_159());
 }
diff --git a/test/tuple_test.cpp b/test/tuple_test.cpp
index c3bbe37..33bebd2 100644
--- a/test/tuple_test.cpp
+++ b/test/tuple_test.cpp
@@ -14,13 +14,13 @@
 
 using namespace Eigen::internal;
 using Eigen::internal::tuple_impl::tuple;
-  
-void basic_tuple_test() {  
+
+void basic_tuple_test() {
   // Construction.
-  tuple<> tuple0 {};
-  tuple<int> tuple1 {1};
-  tuple<int, float> tuple2 {3, 5.0f};
-  tuple<int, float, double> tuple3 {7, 11.0f, 13.0};
+  tuple<> tuple0{};
+  tuple<int> tuple1{1};
+  tuple<int, float> tuple2{3, 5.0f};
+  tuple<int, float, double> tuple3{7, 11.0f, 13.0};
   // Default construction.
   tuple<> tuple0default;
   EIGEN_UNUSED_VARIABLE(tuple0default)
@@ -30,7 +30,7 @@
   EIGEN_UNUSED_VARIABLE(tuple2default)
   tuple<int, float, double> tuple3default;
   EIGEN_UNUSED_VARIABLE(tuple3default)
-  
+
   // Assignment.
   tuple<> tuple0b = tuple0;
   EIGEN_UNUSED_VARIABLE(tuple0b)
@@ -40,18 +40,18 @@
   EIGEN_UNUSED_VARIABLE(tuple2b)
   decltype(tuple3) tuple3b = tuple3;
   EIGEN_UNUSED_VARIABLE(tuple3b)
-  
+
   // get.
   VERIFY_IS_EQUAL(tuple_impl::get<0>(tuple3), 7);
   VERIFY_IS_EQUAL(tuple_impl::get<1>(tuple3), 11.0f);
   VERIFY_IS_EQUAL(tuple_impl::get<2>(tuple3), 13.0);
-  
+
   // tuple_impl::tuple_size.
   VERIFY_IS_EQUAL(tuple_impl::tuple_size<decltype(tuple0)>::value, size_t(0));
   VERIFY_IS_EQUAL(tuple_impl::tuple_size<decltype(tuple1)>::value, size_t(1));
   VERIFY_IS_EQUAL(tuple_impl::tuple_size<decltype(tuple2)>::value, size_t(2));
   VERIFY_IS_EQUAL(tuple_impl::tuple_size<decltype(tuple3)>::value, size_t(3));
-  
+
   // tuple_impl::tuple_cat.
   auto tuple2cat3 = tuple_impl::tuple_cat(tuple2, tuple3);
   VERIFY_IS_EQUAL(tuple_impl::tuple_size<decltype(tuple2cat3)>::value, size_t(5));
@@ -65,32 +65,29 @@
   VERIFY_IS_EQUAL(tuple_impl::tuple_size<decltype(emptycat)>::value, size_t(0));
   auto tuple0cat1cat2cat3 = tuple_impl::tuple_cat(tuple0, tuple1, tuple2, tuple3);
   VERIFY_IS_EQUAL(tuple_impl::tuple_size<decltype(tuple0cat1cat2cat3)>::value, size_t(6));
-  
+
   // make_tuple.
   // The tuple types should uses values for the second and fourth parameters.
   double tmp = 20;
   auto tuple_make = tuple_impl::make_tuple(int(10), tmp, float(20.0f), tuple0);
-  VERIFY( (std::is_same<decltype(tuple_make), tuple<int, double, float, tuple<> > >::value) );
+  VERIFY((std::is_same<decltype(tuple_make), tuple<int, double, float, tuple<> > >::value));
   VERIFY_IS_EQUAL(tuple_impl::get<1>(tuple_make), tmp);
-  
+
   // forward_as_tuple.
   // The tuple types should uses references for the second and fourth parameters.
   auto tuple_forward = tuple_impl::forward_as_tuple(int(10), tmp, float(20.0f), tuple0);
-  VERIFY( (std::is_same<decltype(tuple_forward), tuple<int, double&, float, tuple<>& > >::value) );
+  VERIFY((std::is_same<decltype(tuple_forward), tuple<int, double&, float, tuple<>&> >::value));
   VERIFY_IS_EQUAL(tuple_impl::get<1>(tuple_forward), tmp);
-  
+
   // tie.
   auto tuple_tie = tuple_impl::tie(tuple0, tuple1, tuple2, tuple3);
-  VERIFY( (std::is_same<decltype(tuple_tie), 
-                        tuple<decltype(tuple0)&,
-                              decltype(tuple1)&,
-                              decltype(tuple2)&,
-                              decltype(tuple3)&> >::value) );
-  VERIFY_IS_EQUAL( (tuple_impl::get<1>(tuple_impl::get<2>(tuple_tie))), 5.0f );
+  VERIFY((std::is_same<decltype(tuple_tie),
+                       tuple<decltype(tuple0)&, decltype(tuple1)&, decltype(tuple2)&, decltype(tuple3)&> >::value));
+  VERIFY_IS_EQUAL((tuple_impl::get<1>(tuple_impl::get<2>(tuple_tie))), 5.0f);
   // Modify value and ensure tuple2 is updated.
   tuple_impl::get<1>(tuple_impl::get<2>(tuple_tie)) = 10.0f;
-  VERIFY_IS_EQUAL( (tuple_impl::get<1>(tuple2)), 10.0f );
-  
+  VERIFY_IS_EQUAL((tuple_impl::get<1>(tuple2)), 10.0f);
+
   // Assignment.
   int x = -1;
   float y = -1;
@@ -110,14 +107,13 @@
   tuple<Eigen::Matrix3d, Eigen::MatrixXd> tuple;
   tuple_impl::get<0>(tuple).setRandom();
   tuple_impl::get<1>(tuple).setRandom(10, 10);
-  
+
   auto tuple_tie = tuple_impl::tie(tuple_impl::get<0>(tuple), tuple_impl::get<1>(tuple));
   tuple_impl::get<1>(tuple_tie).setIdentity();
   VERIFY(tuple_impl::get<1>(tuple).isIdentity());
 }
 
-EIGEN_DECLARE_TEST(tuple)
-{
+EIGEN_DECLARE_TEST(tuple) {
   CALL_SUBTEST(basic_tuple_test());
   CALL_SUBTEST(eigen_tuple_test());
 }
diff --git a/test/type_alias.cpp b/test/type_alias.cpp
index 0a223d9..1619d83 100644
--- a/test/type_alias.cpp
+++ b/test/type_alias.cpp
@@ -9,35 +9,33 @@
 
 #include "main.h"
 
-EIGEN_DECLARE_TEST(type_alias)
-{
+EIGEN_DECLARE_TEST(type_alias) {
   using namespace internal;
 
   // To warm up, some basic checks:
-  STATIC_CHECK((is_same<MatrixXd,Matrix<double,Dynamic,Dynamic> >::value));
-  STATIC_CHECK((is_same<Matrix2f,Matrix<float,2,2> >::value));
-  STATIC_CHECK((is_same<Array33i,Array<int,3,3> >::value));
+  STATIC_CHECK((is_same<MatrixXd, Matrix<double, Dynamic, Dynamic> >::value));
+  STATIC_CHECK((is_same<Matrix2f, Matrix<float, 2, 2> >::value));
+  STATIC_CHECK((is_same<Array33i, Array<int, 3, 3> >::value));
 
-  STATIC_CHECK((is_same<MatrixX<double>,    MatrixXd>::value));
-  STATIC_CHECK((is_same<MatrixX<int>,       MatrixXi>::value));
-  STATIC_CHECK((is_same<Matrix2<int>,       Matrix2i>::value));
-  STATIC_CHECK((is_same<Matrix2X<float>,    Matrix2Xf>::value));
-  STATIC_CHECK((is_same<MatrixX4<double>,   MatrixX4d>::value));
-  STATIC_CHECK((is_same<VectorX<int>,       VectorXi>::value));
-  STATIC_CHECK((is_same<Vector2<float>,     Vector2f>::value));
-  STATIC_CHECK((is_same<RowVectorX<int>,    RowVectorXi>::value));
-  STATIC_CHECK((is_same<RowVector2<float>,  RowVector2f>::value));
+  STATIC_CHECK((is_same<MatrixX<double>, MatrixXd>::value));
+  STATIC_CHECK((is_same<MatrixX<int>, MatrixXi>::value));
+  STATIC_CHECK((is_same<Matrix2<int>, Matrix2i>::value));
+  STATIC_CHECK((is_same<Matrix2X<float>, Matrix2Xf>::value));
+  STATIC_CHECK((is_same<MatrixX4<double>, MatrixX4d>::value));
+  STATIC_CHECK((is_same<VectorX<int>, VectorXi>::value));
+  STATIC_CHECK((is_same<Vector2<float>, Vector2f>::value));
+  STATIC_CHECK((is_same<RowVectorX<int>, RowVectorXi>::value));
+  STATIC_CHECK((is_same<RowVector2<float>, RowVector2f>::value));
 
-  STATIC_CHECK((is_same<ArrayXX<float>,     ArrayXXf>::value));
-  STATIC_CHECK((is_same<Array33<int>,       Array33i>::value));
-  STATIC_CHECK((is_same<Array2X<float>,     Array2Xf>::value));
-  STATIC_CHECK((is_same<ArrayX4<double>,    ArrayX4d>::value));
-  STATIC_CHECK((is_same<ArrayX<double>,     ArrayXd>::value));
-  STATIC_CHECK((is_same<Array4<double>,     Array4d>::value));
+  STATIC_CHECK((is_same<ArrayXX<float>, ArrayXXf>::value));
+  STATIC_CHECK((is_same<Array33<int>, Array33i>::value));
+  STATIC_CHECK((is_same<Array2X<float>, Array2Xf>::value));
+  STATIC_CHECK((is_same<ArrayX4<double>, ArrayX4d>::value));
+  STATIC_CHECK((is_same<ArrayX<double>, ArrayXd>::value));
+  STATIC_CHECK((is_same<Array4<double>, Array4d>::value));
 
-  STATIC_CHECK((is_same<Vector<float,3>,        Vector3f>::value));
-  STATIC_CHECK((is_same<Vector<int,Dynamic>,    VectorXi>::value));
-  STATIC_CHECK((is_same<RowVector<float,3>,     RowVector3f>::value));
-  STATIC_CHECK((is_same<RowVector<int,Dynamic>, RowVectorXi>::value));
-
+  STATIC_CHECK((is_same<Vector<float, 3>, Vector3f>::value));
+  STATIC_CHECK((is_same<Vector<int, Dynamic>, VectorXi>::value));
+  STATIC_CHECK((is_same<RowVector<float, 3>, RowVector3f>::value));
+  STATIC_CHECK((is_same<RowVector<int, Dynamic>, RowVectorXi>::value));
 }
diff --git a/test/umeyama.cpp b/test/umeyama.cpp
index 170c28a..2f6fe34 100644
--- a/test/umeyama.cpp
+++ b/test/umeyama.cpp
@@ -12,15 +12,14 @@
 #include <Eigen/Core>
 #include <Eigen/Geometry>
 
-#include <Eigen/LU> // required for MatrixBase::determinant
-#include <Eigen/SVD> // required for SVD
+#include <Eigen/LU>   // required for MatrixBase::determinant
+#include <Eigen/SVD>  // required for SVD
 
 using namespace Eigen;
 
 //  Constructs a random matrix from the unitary group U(size).
 template <typename T>
-Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> randMatrixUnitary(int size)
-{
+Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> randMatrixUnitary(int size) {
   typedef T Scalar;
   typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic> MatrixType;
 
@@ -29,32 +28,27 @@
   int max_tries = 40;
   bool is_unitary = false;
 
-  while (!is_unitary && max_tries > 0)
-  {
+  while (!is_unitary && max_tries > 0) {
     // initialize random matrix
     Q = MatrixType::Random(size, size);
 
     // orthogonalize columns using the Gram-Schmidt algorithm
-    for (int col = 0; col < size; ++col)
-    {
+    for (int col = 0; col < size; ++col) {
       typename MatrixType::ColXpr colVec = Q.col(col);
-      for (int prevCol = 0; prevCol < col; ++prevCol)
-      {
+      for (int prevCol = 0; prevCol < col; ++prevCol) {
         typename MatrixType::ColXpr prevColVec = Q.col(prevCol);
-        colVec -= colVec.dot(prevColVec)*prevColVec;
+        colVec -= colVec.dot(prevColVec) * prevColVec;
       }
       Q.col(col) = colVec.normalized();
     }
 
     // this additional orthogonalization is not necessary in theory but should enhance
     // the numerical orthogonality of the matrix
-    for (int row = 0; row < size; ++row)
-    {
+    for (int row = 0; row < size; ++row) {
       typename MatrixType::RowXpr rowVec = Q.row(row);
-      for (int prevRow = 0; prevRow < row; ++prevRow)
-      {
+      for (int prevRow = 0; prevRow < row; ++prevRow) {
         typename MatrixType::RowXpr prevRowVec = Q.row(prevRow);
-        rowVec -= rowVec.dot(prevRowVec)*prevRowVec;
+        rowVec -= rowVec.dot(prevRowVec) * prevRowVec;
       }
       Q.row(row) = rowVec.normalized();
     }
@@ -64,16 +58,14 @@
     --max_tries;
   }
 
-  if (max_tries == 0)
-    eigen_assert(false && "randMatrixUnitary: Could not construct unitary matrix!");
+  if (max_tries == 0) eigen_assert(false && "randMatrixUnitary: Could not construct unitary matrix!");
 
   return Q;
 }
 
 //  Constructs a random matrix from the special unitary group SU(size).
 template <typename T>
-Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> randMatrixSpecialUnitary(int size)
-{
+Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> randMatrixSpecialUnitary(int size) {
   typedef T Scalar;
 
   typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic> MatrixType;
@@ -88,8 +80,7 @@
 }
 
 template <typename MatrixType>
-void run_test(int dim, int num_elements)
-{
+void run_test(int dim, int num_elements) {
   using std::abs;
   typedef typename internal::traits<MatrixType>::Scalar Scalar;
   typedef Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic> MatrixX;
@@ -100,29 +91,28 @@
   const Scalar c = abs(internal::random<Scalar>());
 
   MatrixX R = randMatrixSpecialUnitary<Scalar>(dim);
-  VectorX t = Scalar(50)*VectorX::Random(dim,1);
+  VectorX t = Scalar(50) * VectorX::Random(dim, 1);
 
-  MatrixX cR_t = MatrixX::Identity(dim+1,dim+1);
-  cR_t.block(0,0,dim,dim) = c*R;
-  cR_t.block(0,dim,dim,1) = t;
+  MatrixX cR_t = MatrixX::Identity(dim + 1, dim + 1);
+  cR_t.block(0, 0, dim, dim) = c * R;
+  cR_t.block(0, dim, dim, 1) = t;
 
-  MatrixX src = MatrixX::Random(dim+1, num_elements);
+  MatrixX src = MatrixX::Random(dim + 1, num_elements);
   src.row(dim) = Matrix<Scalar, 1, Dynamic>::Constant(num_elements, Scalar(1));
 
-  MatrixX dst = cR_t*src;
+  MatrixX dst = cR_t * src;
 
-  MatrixX cR_t_umeyama = umeyama(src.block(0,0,dim,num_elements), dst.block(0,0,dim,num_elements));
+  MatrixX cR_t_umeyama = umeyama(src.block(0, 0, dim, num_elements), dst.block(0, 0, dim, num_elements));
 
-  const Scalar error = ( cR_t_umeyama*src - dst ).norm() / dst.norm();
-  VERIFY(error < Scalar(40)*std::numeric_limits<Scalar>::epsilon());
+  const Scalar error = (cR_t_umeyama * src - dst).norm() / dst.norm();
+  VERIFY(error < Scalar(40) * std::numeric_limits<Scalar>::epsilon());
 }
 
-template<typename Scalar, int Dimension>
-void run_fixed_size_test(int num_elements)
-{
+template <typename Scalar, int Dimension>
+void run_fixed_size_test(int num_elements) {
   using std::abs;
-  typedef Matrix<Scalar, Dimension+1, Dynamic> MatrixX;
-  typedef Matrix<Scalar, Dimension+1, Dimension+1> HomMatrix;
+  typedef Matrix<Scalar, Dimension + 1, Dynamic> MatrixX;
+  typedef Matrix<Scalar, Dimension + 1, Dimension + 1> HomMatrix;
   typedef Matrix<Scalar, Dimension, Dimension> FixedMatrix;
   typedef Matrix<Scalar, Dimension, 1> FixedVector;
 
@@ -134,36 +124,33 @@
   const Scalar c = internal::random<Scalar>(0.5, 2.0);
 
   FixedMatrix R = randMatrixSpecialUnitary<Scalar>(dim);
-  FixedVector t = Scalar(32)*FixedVector::Random(dim,1);
+  FixedVector t = Scalar(32) * FixedVector::Random(dim, 1);
 
-  HomMatrix cR_t = HomMatrix::Identity(dim+1,dim+1);
-  cR_t.block(0,0,dim,dim) = c*R;
-  cR_t.block(0,dim,dim,1) = t;
+  HomMatrix cR_t = HomMatrix::Identity(dim + 1, dim + 1);
+  cR_t.block(0, 0, dim, dim) = c * R;
+  cR_t.block(0, dim, dim, 1) = t;
 
-  MatrixX src = MatrixX::Random(dim+1, num_elements);
+  MatrixX src = MatrixX::Random(dim + 1, num_elements);
   src.row(dim) = Matrix<Scalar, 1, Dynamic>::Constant(num_elements, Scalar(1));
 
-  MatrixX dst = cR_t*src;
+  MatrixX dst = cR_t * src;
 
-  Block<MatrixX, Dimension, Dynamic> src_block(src,0,0,dim,num_elements);
-  Block<MatrixX, Dimension, Dynamic> dst_block(dst,0,0,dim,num_elements);
+  Block<MatrixX, Dimension, Dynamic> src_block(src, 0, 0, dim, num_elements);
+  Block<MatrixX, Dimension, Dynamic> dst_block(dst, 0, 0, dim, num_elements);
 
   HomMatrix cR_t_umeyama = umeyama(src_block, dst_block);
 
-  const Scalar error = ( cR_t_umeyama*src - dst ).squaredNorm();
+  const Scalar error = (cR_t_umeyama * src - dst).squaredNorm();
 
-  VERIFY(error < Scalar(16)*std::numeric_limits<Scalar>::epsilon());
+  VERIFY(error < Scalar(16) * std::numeric_limits<Scalar>::epsilon());
 }
 
-EIGEN_DECLARE_TEST(umeyama)
-{
-  for (int i=0; i<g_repeat; ++i)
-  {
-    const int num_elements = internal::random<int>(40,500);
+EIGEN_DECLARE_TEST(umeyama) {
+  for (int i = 0; i < g_repeat; ++i) {
+    const int num_elements = internal::random<int>(40, 500);
 
     // works also for dimensions bigger than 3...
-    for (int dim=2; dim<8; ++dim)
-    {
+    for (int dim = 2; dim < 8; ++dim) {
       CALL_SUBTEST_1(run_test<MatrixXd>(dim, num_elements));
       CALL_SUBTEST_2(run_test<MatrixXf>(dim, num_elements));
     }
diff --git a/test/umfpack_support.cpp b/test/umfpack_support.cpp
index d8f2a6f..94aa5cc 100644
--- a/test/umfpack_support.cpp
+++ b/test/umfpack_support.cpp
@@ -12,23 +12,21 @@
 
 #include <Eigen/UmfPackSupport>
 
-template<typename T1, typename T2> void test_umfpack_support_T()
-{
+template <typename T1, typename T2>
+void test_umfpack_support_T() {
   UmfPackLU<SparseMatrix<T1, ColMajor, T2> > umfpack_colmajor;
   UmfPackLU<SparseMatrix<T1, RowMajor, T2> > umfpack_rowmajor;
-  
+
   check_sparse_square_solving(umfpack_colmajor);
   check_sparse_square_solving(umfpack_rowmajor);
-  
+
   check_sparse_square_determinant(umfpack_colmajor);
   check_sparse_square_determinant(umfpack_rowmajor);
 }
 
-EIGEN_DECLARE_TEST(umfpack_support)
-{
+EIGEN_DECLARE_TEST(umfpack_support) {
   CALL_SUBTEST_1((test_umfpack_support_T<double, int>()));
   CALL_SUBTEST_2((test_umfpack_support_T<std::complex<double>, int>()));
-  CALL_SUBTEST_3((test_umfpack_support_T<double, long >()));
+  CALL_SUBTEST_3((test_umfpack_support_T<double, long>()));
   CALL_SUBTEST_4((test_umfpack_support_T<std::complex<double>, long>()));
 }
-
diff --git a/test/unalignedcount.cpp b/test/unalignedcount.cpp
index 40b9ab8..f508b1a 100644
--- a/test/unalignedcount.cpp
+++ b/test/unalignedcount.cpp
@@ -12,52 +12,58 @@
 static int nb_store;
 static int nb_storeu;
 
-#define EIGEN_DEBUG_ALIGNED_LOAD    { nb_load++;    }
-#define EIGEN_DEBUG_UNALIGNED_LOAD  { nb_loadu++;   }
-#define EIGEN_DEBUG_ALIGNED_STORE   { nb_store++;   }
-#define EIGEN_DEBUG_UNALIGNED_STORE { nb_storeu++;  }
+#define EIGEN_DEBUG_ALIGNED_LOAD \
+  { nb_load++; }
+#define EIGEN_DEBUG_UNALIGNED_LOAD \
+  { nb_loadu++; }
+#define EIGEN_DEBUG_ALIGNED_STORE \
+  { nb_store++; }
+#define EIGEN_DEBUG_UNALIGNED_STORE \
+  { nb_storeu++; }
 
-#define VERIFY_ALIGNED_UNALIGNED_COUNT(XPR,AL,UL,AS,US) {\
-    nb_load = nb_loadu = nb_store = nb_storeu = 0; \
-    XPR; \
-    if(!(nb_load==AL && nb_loadu==UL && nb_store==AS && nb_storeu==US)) \
+#define VERIFY_ALIGNED_UNALIGNED_COUNT(XPR, AL, UL, AS, US)                                                \
+  {                                                                                                        \
+    nb_load = nb_loadu = nb_store = nb_storeu = 0;                                                         \
+    XPR;                                                                                                   \
+    if (!(nb_load == AL && nb_loadu == UL && nb_store == AS && nb_storeu == US))                           \
       std::cerr << " >> " << nb_load << ", " << nb_loadu << ", " << nb_store << ", " << nb_storeu << "\n"; \
-    VERIFY( (#XPR) && nb_load==AL && nb_loadu==UL && nb_store==AS && nb_storeu==US ); \
+    VERIFY((#XPR) && nb_load == AL && nb_loadu == UL && nb_store == AS && nb_storeu == US);                \
   }
 
-
 #include "main.h"
 
-EIGEN_DECLARE_TEST(unalignedcount)
-{
-  #if defined(EIGEN_VECTORIZE_AVX512)
+EIGEN_DECLARE_TEST(unalignedcount) {
+#if defined(EIGEN_VECTORIZE_AVX512)
   VectorXf a(48), b(48);
-  a.fill(0); b.fill(1);
+  a.fill(0);
+  b.fill(1);
   VERIFY_ALIGNED_UNALIGNED_COUNT(a += b, 6, 0, 3, 0);
-  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0,48) += b.segment(0,48), 3, 3, 3, 0);
-  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0,48) -= b.segment(0,48), 3, 3, 3, 0);
-  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0,48) *= 3.5, 3, 0, 3, 0);
-  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0,48) /= 3.5, 3, 0, 3, 0);
-  #elif defined(EIGEN_VECTORIZE_AVX)
+  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0, 48) += b.segment(0, 48), 3, 3, 3, 0);
+  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0, 48) -= b.segment(0, 48), 3, 3, 3, 0);
+  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0, 48) *= 3.5, 3, 0, 3, 0);
+  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0, 48) /= 3.5, 3, 0, 3, 0);
+#elif defined(EIGEN_VECTORIZE_AVX)
   VectorXf a(40), b(40);
-  a.fill(0); b.fill(1);
+  a.fill(0);
+  b.fill(1);
   VERIFY_ALIGNED_UNALIGNED_COUNT(a += b, 10, 0, 5, 0);
-  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0,40) += b.segment(0,40), 5, 5, 5, 0);
-  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0,40) -= b.segment(0,40), 5, 5, 5, 0);
-  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0,40) *= 3.5, 5, 0, 5, 0);
-  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0,40) /= 3.5, 5, 0, 5, 0);
-  #elif defined(EIGEN_VECTORIZE_SSE)
+  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0, 40) += b.segment(0, 40), 5, 5, 5, 0);
+  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0, 40) -= b.segment(0, 40), 5, 5, 5, 0);
+  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0, 40) *= 3.5, 5, 0, 5, 0);
+  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0, 40) /= 3.5, 5, 0, 5, 0);
+#elif defined(EIGEN_VECTORIZE_SSE)
   VectorXf a(40), b(40);
-  a.fill(0); b.fill(1);
+  a.fill(0);
+  b.fill(1);
   VERIFY_ALIGNED_UNALIGNED_COUNT(a += b, 20, 0, 10, 0);
-  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0,40) += b.segment(0,40), 10, 10, 10, 0);
-  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0,40) -= b.segment(0,40), 10, 10, 10, 0);
-  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0,40) *= 3.5, 10, 0, 10, 0);
-  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0,40) /= 3.5, 10, 0, 10, 0);
-  #else
+  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0, 40) += b.segment(0, 40), 10, 10, 10, 0);
+  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0, 40) -= b.segment(0, 40), 10, 10, 10, 0);
+  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0, 40) *= 3.5, 10, 0, 10, 0);
+  VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0, 40) /= 3.5, 10, 0, 10, 0);
+#else
   // The following line is to eliminate "variable not used" warnings
   nb_load = nb_loadu = nb_store = nb_storeu = 0;
   int a(0), b(0);
-  VERIFY(a==b);
-  #endif
+  VERIFY(a == b);
+#endif
 }
diff --git a/test/unaryviewstride.cpp b/test/unaryviewstride.cpp
index 03a770b..490a5b7 100644
--- a/test/unaryviewstride.cpp
+++ b/test/unaryviewstride.cpp
@@ -9,30 +9,27 @@
 
 #include "main.h"
 
-template<int OuterStride,int InnerStride,typename VectorType> void unaryview_stride(const VectorType& m)
-{
+template <int OuterStride, int InnerStride, typename VectorType>
+void unaryview_stride(const VectorType& m) {
   typedef typename VectorType::Scalar Scalar;
   Index rows = m.rows();
   Index cols = m.cols();
   VectorType vec = VectorType::Random(rows, cols);
 
   struct view_op {
-    EIGEN_DEVICE_FUNC
-    EIGEN_STRONG_INLINE const Scalar&
-      operator()(const Scalar& v) const { return v; }
+    EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar& operator()(const Scalar& v) const { return v; }
   };
 
-  CwiseUnaryView<view_op, VectorType, Stride<OuterStride,InnerStride>> vec_view(vec);
+  CwiseUnaryView<view_op, VectorType, Stride<OuterStride, InnerStride>> vec_view(vec);
   VERIFY(vec_view.outerStride() == (OuterStride == 0 ? 0 : OuterStride));
   VERIFY(vec_view.innerStride() == (InnerStride == 0 ? 1 : InnerStride));
 }
 
-EIGEN_DECLARE_TEST(unaryviewstride)
-{
-    CALL_SUBTEST_1(( unaryview_stride<1,2>(MatrixXf()) ));
-    CALL_SUBTEST_1(( unaryview_stride<0,0>(MatrixXf()) ));
-    CALL_SUBTEST_2(( unaryview_stride<1,2>(VectorXf()) ));
-    CALL_SUBTEST_2(( unaryview_stride<0,0>(VectorXf()) ));
-    CALL_SUBTEST_3(( unaryview_stride<1,2>(RowVectorXf()) ));
-    CALL_SUBTEST_3(( unaryview_stride<0,0>(RowVectorXf()) ));
+EIGEN_DECLARE_TEST(unaryviewstride) {
+  CALL_SUBTEST_1((unaryview_stride<1, 2>(MatrixXf())));
+  CALL_SUBTEST_1((unaryview_stride<0, 0>(MatrixXf())));
+  CALL_SUBTEST_2((unaryview_stride<1, 2>(VectorXf())));
+  CALL_SUBTEST_2((unaryview_stride<0, 0>(VectorXf())));
+  CALL_SUBTEST_3((unaryview_stride<1, 2>(RowVectorXf())));
+  CALL_SUBTEST_3((unaryview_stride<0, 0>(RowVectorXf())));
 }
diff --git a/test/upperbidiagonalization.cpp b/test/upperbidiagonalization.cpp
index 945c999..ce4647f 100644
--- a/test/upperbidiagonalization.cpp
+++ b/test/upperbidiagonalization.cpp
@@ -10,34 +10,35 @@
 #include "main.h"
 #include <Eigen/SVD>
 
-template<typename MatrixType> void upperbidiag(const MatrixType& m)
-{
+template <typename MatrixType>
+void upperbidiag(const MatrixType& m) {
   const Index rows = m.rows();
   const Index cols = m.cols();
 
-  typedef Matrix<typename MatrixType::RealScalar, MatrixType::RowsAtCompileTime,  MatrixType::ColsAtCompileTime> RealMatrixType;
-  typedef Matrix<typename MatrixType::Scalar, MatrixType::ColsAtCompileTime,  MatrixType::RowsAtCompileTime> TransposeMatrixType;
+  typedef Matrix<typename MatrixType::RealScalar, MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime>
+      RealMatrixType;
+  typedef Matrix<typename MatrixType::Scalar, MatrixType::ColsAtCompileTime, MatrixType::RowsAtCompileTime>
+      TransposeMatrixType;
 
-  MatrixType a = MatrixType::Random(rows,cols);
+  MatrixType a = MatrixType::Random(rows, cols);
   internal::UpperBidiagonalization<MatrixType> ubd(a);
   RealMatrixType b(rows, cols);
   b.setZero();
-  b.block(0,0,cols,cols) = ubd.bidiagonal();
+  b.block(0, 0, cols, cols) = ubd.bidiagonal();
   MatrixType c = ubd.householderU() * b * ubd.householderV().adjoint();
-  VERIFY_IS_APPROX(a,c);
+  VERIFY_IS_APPROX(a, c);
   TransposeMatrixType d = ubd.householderV() * b.adjoint() * ubd.householderU().adjoint();
-  VERIFY_IS_APPROX(a.adjoint(),d);
+  VERIFY_IS_APPROX(a.adjoint(), d);
 }
 
-EIGEN_DECLARE_TEST(upperbidiagonalization)
-{
-  for(int i = 0; i < g_repeat; i++) {
-   CALL_SUBTEST_1( upperbidiag(MatrixXf(3,3)) );
-   CALL_SUBTEST_2( upperbidiag(MatrixXd(17,12)) );
-   CALL_SUBTEST_3( upperbidiag(MatrixXcf(20,20)) );
-   CALL_SUBTEST_4( upperbidiag(Matrix<std::complex<double>,Dynamic,Dynamic,RowMajor>(16,15)) );
-   CALL_SUBTEST_5( upperbidiag(Matrix<float,6,4>()) );
-   CALL_SUBTEST_6( upperbidiag(Matrix<float,5,5>()) );
-   CALL_SUBTEST_7( upperbidiag(Matrix<double,4,3>()) );
+EIGEN_DECLARE_TEST(upperbidiagonalization) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(upperbidiag(MatrixXf(3, 3)));
+    CALL_SUBTEST_2(upperbidiag(MatrixXd(17, 12)));
+    CALL_SUBTEST_3(upperbidiag(MatrixXcf(20, 20)));
+    CALL_SUBTEST_4(upperbidiag(Matrix<std::complex<double>, Dynamic, Dynamic, RowMajor>(16, 15)));
+    CALL_SUBTEST_5(upperbidiag(Matrix<float, 6, 4>()));
+    CALL_SUBTEST_6(upperbidiag(Matrix<float, 5, 5>()));
+    CALL_SUBTEST_7(upperbidiag(Matrix<double, 4, 3>()));
   }
 }
diff --git a/test/vectorization_logic.cpp b/test/vectorization_logic.cpp
index a66e9c8..aac7248 100644
--- a/test/vectorization_logic.cpp
+++ b/test/vectorization_logic.cpp
@@ -26,354 +26,396 @@
 // for packet_traits<Packet*>
 // => The only workaround would be to wrap _m128 and the likes
 //    within wrappers.
-#if EIGEN_GNUC_STRICT_AT_LEAST(6,0,0)
-    #pragma GCC diagnostic ignored "-Wignored-attributes"
+#if EIGEN_GNUC_STRICT_AT_LEAST(6, 0, 0)
+#pragma GCC diagnostic ignored "-Wignored-attributes"
 #endif
 
 using internal::demangle_flags;
 using internal::demangle_traversal;
 using internal::demangle_unrolling;
 
-template<typename Dst, typename Src>
-bool test_assign(const Dst&, const Src&, int traversal, int unrolling)
-{
-  EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Dst,Src);
-  typedef internal::copy_using_evaluator_traits<internal::evaluator<Dst>,internal::evaluator<Src>, internal::assign_op<typename Dst::Scalar,typename Src::Scalar> > traits;
+template <typename Dst, typename Src>
+bool test_assign(const Dst&, const Src&, int traversal, int unrolling) {
+  EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Dst, Src);
+  typedef internal::copy_using_evaluator_traits<internal::evaluator<Dst>, internal::evaluator<Src>,
+                                                internal::assign_op<typename Dst::Scalar, typename Src::Scalar> >
+      traits;
   // If traversal or unrolling are negative, ignore.
-  bool res = traversal > -1 ? traits::Traversal==traversal : true;
+  bool res = traversal > -1 ? traits::Traversal == traversal : true;
   if (unrolling > -1) {
-    if(unrolling==InnerUnrolling+CompleteUnrolling) {
-      res = res && (int(traits::Unrolling)==InnerUnrolling || int(traits::Unrolling)==CompleteUnrolling);
+    if (unrolling == InnerUnrolling + CompleteUnrolling) {
+      res = res && (int(traits::Unrolling) == InnerUnrolling || int(traits::Unrolling) == CompleteUnrolling);
     } else {
-      res = res && int(traits::Unrolling)==unrolling;
+      res = res && int(traits::Unrolling) == unrolling;
     }
   }
-  if(!res)
-  {
+  if (!res) {
     std::cerr << "Src: " << demangle_flags(Src::Flags) << std::endl;
     std::cerr << "     " << demangle_flags(internal::evaluator<Src>::Flags) << std::endl;
     std::cerr << "Dst: " << demangle_flags(Dst::Flags) << std::endl;
     std::cerr << "     " << demangle_flags(internal::evaluator<Dst>::Flags) << std::endl;
     traits::debug();
-    std::cerr << " Expected Traversal == " << demangle_traversal(traversal)
-              << " got " << demangle_traversal(traits::Traversal) << "\n";
-    std::cerr << " Expected Unrolling == " << demangle_unrolling(unrolling)
-              << " got " << demangle_unrolling(traits::Unrolling) << "\n";
+    std::cerr << " Expected Traversal == " << demangle_traversal(traversal) << " got "
+              << demangle_traversal(traits::Traversal) << "\n";
+    std::cerr << " Expected Unrolling == " << demangle_unrolling(unrolling) << " got "
+              << demangle_unrolling(traits::Unrolling) << "\n";
   }
   return res;
 }
 
-template<typename Dst, typename Src>
-bool test_assign(int traversal, int unrolling)
-{
-  EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Dst,Src);
-  typedef internal::copy_using_evaluator_traits<internal::evaluator<Dst>,internal::evaluator<Src>, internal::assign_op<typename Dst::Scalar,typename Src::Scalar> > traits;
-  bool res = traits::Traversal==traversal && traits::Unrolling==unrolling;
-  if(!res)
-  {
+template <typename Dst, typename Src>
+bool test_assign(int traversal, int unrolling) {
+  EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Dst, Src);
+  typedef internal::copy_using_evaluator_traits<internal::evaluator<Dst>, internal::evaluator<Src>,
+                                                internal::assign_op<typename Dst::Scalar, typename Src::Scalar> >
+      traits;
+  bool res = traits::Traversal == traversal && traits::Unrolling == unrolling;
+  if (!res) {
     std::cerr << "Src: " << demangle_flags(Src::Flags) << std::endl;
     std::cerr << "     " << demangle_flags(internal::evaluator<Src>::Flags) << std::endl;
     std::cerr << "Dst: " << demangle_flags(Dst::Flags) << std::endl;
     std::cerr << "     " << demangle_flags(internal::evaluator<Dst>::Flags) << std::endl;
     traits::debug();
-    std::cerr << " Expected Traversal == " << demangle_traversal(traversal)
-              << " got " << demangle_traversal(traits::Traversal) << "\n";
-    std::cerr << " Expected Unrolling == " << demangle_unrolling(unrolling)
-              << " got " << demangle_unrolling(traits::Unrolling) << "\n";
+    std::cerr << " Expected Traversal == " << demangle_traversal(traversal) << " got "
+              << demangle_traversal(traits::Traversal) << "\n";
+    std::cerr << " Expected Unrolling == " << demangle_unrolling(unrolling) << " got "
+              << demangle_unrolling(traits::Unrolling) << "\n";
   }
   return res;
 }
 
-template<typename Xpr>
-bool test_redux(const Xpr&, int traversal, int unrolling)
-{
+template <typename Xpr>
+bool test_redux(const Xpr&, int traversal, int unrolling) {
   typedef typename Xpr::Scalar Scalar;
-  typedef internal::redux_traits<internal::scalar_sum_op<Scalar,Scalar>,internal::redux_evaluator<Xpr> > traits;
-  
-  bool res = traits::Traversal==traversal && traits::Unrolling==unrolling;
-  if(!res)
-  {
+  typedef internal::redux_traits<internal::scalar_sum_op<Scalar, Scalar>, internal::redux_evaluator<Xpr> > traits;
+
+  bool res = traits::Traversal == traversal && traits::Unrolling == unrolling;
+  if (!res) {
     std::cerr << demangle_flags(Xpr::Flags) << std::endl;
     std::cerr << demangle_flags(internal::evaluator<Xpr>::Flags) << std::endl;
     traits::debug();
-    
-    std::cerr << " Expected Traversal == " << demangle_traversal(traversal)
-              << " got " << demangle_traversal(traits::Traversal) << "\n";
-    std::cerr << " Expected Unrolling == " << demangle_unrolling(unrolling)
-              << " got " << demangle_unrolling(traits::Unrolling) << "\n";
+
+    std::cerr << " Expected Traversal == " << demangle_traversal(traversal) << " got "
+              << demangle_traversal(traits::Traversal) << "\n";
+    std::cerr << " Expected Unrolling == " << demangle_unrolling(unrolling) << " got "
+              << demangle_unrolling(traits::Unrolling) << "\n";
   }
   return res;
 }
 
-template<typename Scalar, bool Enable = internal::packet_traits<Scalar>::Vectorizable>
-struct vectorization_logic
-{
+template <typename Scalar, bool Enable = internal::packet_traits<Scalar>::Vectorizable>
+struct vectorization_logic {
   typedef internal::packet_traits<Scalar> PacketTraits;
-  
+
   typedef typename internal::packet_traits<Scalar>::type PacketType;
   typedef typename internal::unpacket_traits<PacketType>::half HalfPacketType;
   enum {
     PacketSize = internal::unpacket_traits<PacketType>::size,
     HalfPacketSize = internal::unpacket_traits<HalfPacketType>::size
   };
-  static void run()
-  {
-    
-    typedef Matrix<Scalar,PacketSize,1> Vector1;
-    typedef Matrix<Scalar,Dynamic,1> VectorX;
-    typedef Matrix<Scalar,Dynamic,Dynamic> MatrixXX;
-    typedef Matrix<Scalar,PacketSize,PacketSize> Matrix11;
-    typedef Matrix<Scalar,(Matrix11::Flags&RowMajorBit)?8:2*PacketSize,(Matrix11::Flags&RowMajorBit)?2*PacketSize:8>   Matrix22;
-    typedef Matrix<Scalar,(Matrix11::Flags&RowMajorBit)?16:4*PacketSize,(Matrix11::Flags&RowMajorBit)?4*PacketSize:16> Matrix44;
-    typedef Matrix<Scalar,(Matrix11::Flags&RowMajorBit)?16:4*PacketSize,(Matrix11::Flags&RowMajorBit)?4*PacketSize:16,DontAlign|EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION> Matrix44u;
-    typedef Matrix<Scalar,4*PacketSize,4*PacketSize,ColMajor> Matrix44c;
-    typedef Matrix<Scalar,4*PacketSize,4*PacketSize,RowMajor> Matrix44r;
+  static void run() {
+    typedef Matrix<Scalar, PacketSize, 1> Vector1;
+    typedef Matrix<Scalar, Dynamic, 1> VectorX;
+    typedef Matrix<Scalar, Dynamic, Dynamic> MatrixXX;
+    typedef Matrix<Scalar, PacketSize, PacketSize> Matrix11;
+    typedef Matrix<Scalar, (Matrix11::Flags & RowMajorBit) ? 8 : 2 * PacketSize,
+                   (Matrix11::Flags & RowMajorBit) ? 2 * PacketSize : 8>
+        Matrix22;
+    typedef Matrix<Scalar, (Matrix11::Flags & RowMajorBit) ? 16 : 4 * PacketSize,
+                   (Matrix11::Flags & RowMajorBit) ? 4 * PacketSize : 16>
+        Matrix44;
+    typedef Matrix<Scalar, (Matrix11::Flags & RowMajorBit) ? 16 : 4 * PacketSize,
+                   (Matrix11::Flags & RowMajorBit) ? 4 * PacketSize : 16,
+                   DontAlign | EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION>
+        Matrix44u;
+    typedef Matrix<Scalar, 4 * PacketSize, 4 * PacketSize, ColMajor> Matrix44c;
+    typedef Matrix<Scalar, 4 * PacketSize, 4 * PacketSize, RowMajor> Matrix44r;
 
     typedef Matrix<Scalar,
-        (PacketSize==16 ? 8 : PacketSize==8 ? 4 : PacketSize==4 ? 2 : PacketSize==2 ? 1 : /*PacketSize==1 ?*/ 1),
-        (PacketSize==16 ? 2 : PacketSize==8 ? 2 : PacketSize==4 ? 2 : PacketSize==2 ? 2 : /*PacketSize==1 ?*/ 1)
-      > Matrix1;
+                   (PacketSize == 16  ? 8
+                    : PacketSize == 8 ? 4
+                    : PacketSize == 4 ? 2
+                    : PacketSize == 2 ? 1
+                                      : /*PacketSize==1 ?*/ 1),
+                   (PacketSize == 16  ? 2
+                    : PacketSize == 8 ? 2
+                    : PacketSize == 4 ? 2
+                    : PacketSize == 2 ? 2
+                                      : /*PacketSize==1 ?*/ 1)>
+        Matrix1;
 
     typedef Matrix<Scalar,
-        (PacketSize==16 ? 8 : PacketSize==8 ? 4 : PacketSize==4 ? 2 : PacketSize==2 ? 1 : /*PacketSize==1 ?*/ 1),
-        (PacketSize==16 ? 2 : PacketSize==8 ? 2 : PacketSize==4 ? 2 : PacketSize==2 ? 2 : /*PacketSize==1 ?*/ 1),
-      DontAlign|((Matrix1::Flags&RowMajorBit)?RowMajor:ColMajor)> Matrix1u;
+                   (PacketSize == 16  ? 8
+                    : PacketSize == 8 ? 4
+                    : PacketSize == 4 ? 2
+                    : PacketSize == 2 ? 1
+                                      : /*PacketSize==1 ?*/ 1),
+                   (PacketSize == 16  ? 2
+                    : PacketSize == 8 ? 2
+                    : PacketSize == 4 ? 2
+                    : PacketSize == 2 ? 2
+                                      : /*PacketSize==1 ?*/ 1),
+                   DontAlign | ((Matrix1::Flags & RowMajorBit) ? RowMajor : ColMajor)>
+        Matrix1u;
 
     // this type is made such that it can only be vectorized when viewed as a linear 1D vector
     typedef Matrix<Scalar,
-        (PacketSize==16 ?  4 : PacketSize==8 ? 4 : PacketSize==4 ? 6 : PacketSize==2 ? ((Matrix11::Flags&RowMajorBit)?2:3) : /*PacketSize==1 ?*/ 1),
-        (PacketSize==16 ? 12 : PacketSize==8 ? 6 : PacketSize==4 ? 2 : PacketSize==2 ? ((Matrix11::Flags&RowMajorBit)?3:2) : /*PacketSize==1 ?*/ 3)
-      > Matrix3;
-    
-    #if !EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT
-    VERIFY(test_assign(Vector1(),Vector1(),
-      InnerVectorizedTraversal,CompleteUnrolling));
-    VERIFY(test_assign(Vector1(),Vector1()+Vector1(),
-      InnerVectorizedTraversal,CompleteUnrolling));
-    VERIFY(test_assign(Vector1(),Vector1().cwiseProduct(Vector1()),
-      InnerVectorizedTraversal,CompleteUnrolling));
-    VERIFY(test_assign(Vector1(),Vector1().template cast<Scalar>(),
-      InnerVectorizedTraversal,CompleteUnrolling));
+                   (PacketSize == 16  ? 4
+                    : PacketSize == 8 ? 4
+                    : PacketSize == 4 ? 6
+                    : PacketSize == 2 ? ((Matrix11::Flags & RowMajorBit) ? 2 : 3)
+                                      : /*PacketSize==1 ?*/ 1),
+                   (PacketSize == 16  ? 12
+                    : PacketSize == 8 ? 6
+                    : PacketSize == 4 ? 2
+                    : PacketSize == 2 ? ((Matrix11::Flags & RowMajorBit) ? 3 : 2)
+                                      : /*PacketSize==1 ?*/ 3)>
+        Matrix3;
 
-    VERIFY(test_assign(Matrix44(),Matrix44()+Matrix44(),
-      InnerVectorizedTraversal,InnerUnrolling));
+#if !EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT
+    VERIFY(test_assign(Vector1(), Vector1(), InnerVectorizedTraversal, CompleteUnrolling));
+    VERIFY(test_assign(Vector1(), Vector1() + Vector1(), InnerVectorizedTraversal, CompleteUnrolling));
+    VERIFY(test_assign(Vector1(), Vector1().cwiseProduct(Vector1()), InnerVectorizedTraversal, CompleteUnrolling));
+    VERIFY(test_assign(Vector1(), Vector1().template cast<Scalar>(), InnerVectorizedTraversal, CompleteUnrolling));
 
-    VERIFY(test_assign(Matrix44u(),Matrix44()+Matrix44(),
-      EIGEN_UNALIGNED_VECTORIZE ? InnerVectorizedTraversal : LinearTraversal,
-      EIGEN_UNALIGNED_VECTORIZE ? InnerUnrolling : NoUnrolling));
+    VERIFY(test_assign(Matrix44(), Matrix44() + Matrix44(), InnerVectorizedTraversal, InnerUnrolling));
 
-    VERIFY(test_assign(Matrix1(),Matrix1()+Matrix1(),
-      (int(Matrix1::InnerSizeAtCompileTime) % int(PacketSize))==0 ? InnerVectorizedTraversal : LinearVectorizedTraversal,
-      CompleteUnrolling));
+    VERIFY(test_assign(Matrix44u(), Matrix44() + Matrix44(),
+                       EIGEN_UNALIGNED_VECTORIZE ? InnerVectorizedTraversal : LinearTraversal,
+                       EIGEN_UNALIGNED_VECTORIZE ? InnerUnrolling : NoUnrolling));
 
-    VERIFY(test_assign(Matrix1u(),Matrix1()+Matrix1(),
-      EIGEN_UNALIGNED_VECTORIZE ? ((int(Matrix1::InnerSizeAtCompileTime) % int(PacketSize))==0 ? InnerVectorizedTraversal : LinearVectorizedTraversal)
-                                : LinearTraversal, CompleteUnrolling));
+    VERIFY(test_assign(Matrix1(), Matrix1() + Matrix1(),
+                       (int(Matrix1::InnerSizeAtCompileTime) % int(PacketSize)) == 0 ? InnerVectorizedTraversal
+                                                                                     : LinearVectorizedTraversal,
+                       CompleteUnrolling));
 
-    VERIFY(test_assign(Matrix44c().col(1),Matrix44c().col(2)+Matrix44c().col(3),
-      InnerVectorizedTraversal,CompleteUnrolling));
+    VERIFY(test_assign(Matrix1u(), Matrix1() + Matrix1(),
+                       EIGEN_UNALIGNED_VECTORIZE
+                           ? ((int(Matrix1::InnerSizeAtCompileTime) % int(PacketSize)) == 0 ? InnerVectorizedTraversal
+                                                                                            : LinearVectorizedTraversal)
+                           : LinearTraversal,
+                       CompleteUnrolling));
 
-    VERIFY(test_assign(Matrix44r().row(2),Matrix44r().row(1)+Matrix44r().row(1),
-      InnerVectorizedTraversal,CompleteUnrolling));
+    VERIFY(test_assign(Matrix44c().col(1), Matrix44c().col(2) + Matrix44c().col(3), InnerVectorizedTraversal,
+                       CompleteUnrolling));
 
-    if(PacketSize>1)
-    {
-      typedef Matrix<Scalar,3,3,ColMajor> Matrix33c;
-      typedef Matrix<Scalar,3,1,ColMajor> Vector3;
-      VERIFY(test_assign(Matrix33c().row(2),Matrix33c().row(1)+Matrix33c().row(1),
-        LinearTraversal,CompleteUnrolling));
+    VERIFY(test_assign(Matrix44r().row(2), Matrix44r().row(1) + Matrix44r().row(1), InnerVectorizedTraversal,
+                       CompleteUnrolling));
+
+    if (PacketSize > 1) {
+      typedef Matrix<Scalar, 3, 3, ColMajor> Matrix33c;
+      typedef Matrix<Scalar, 3, 1, ColMajor> Vector3;
+      VERIFY(
+          test_assign(Matrix33c().row(2), Matrix33c().row(1) + Matrix33c().row(1), LinearTraversal, CompleteUnrolling));
       // Vectorization depends on too many factors - ignore.
-      VERIFY(test_assign(Vector3(),Vector3()+Vector3(), -1, CompleteUnrolling));
+      VERIFY(test_assign(Vector3(), Vector3() + Vector3(), -1, CompleteUnrolling));
 
-      VERIFY(test_assign(Matrix3(),Matrix3().cwiseProduct(Matrix3()),
-        LinearVectorizedTraversal,CompleteUnrolling));
+      VERIFY(test_assign(Matrix3(), Matrix3().cwiseProduct(Matrix3()), LinearVectorizedTraversal, CompleteUnrolling));
 
       // Vectorization depends on too many factors - ignore.
-      VERIFY(test_assign(Matrix<Scalar,17,17>(),Matrix<Scalar,17,17>()+Matrix<Scalar,17,17>(),
-        -1, NoUnrolling));
+      VERIFY(
+          test_assign(Matrix<Scalar, 17, 17>(), Matrix<Scalar, 17, 17>() + Matrix<Scalar, 17, 17>(), -1, NoUnrolling));
 
-      VERIFY(test_assign(Matrix11(), Matrix11()+Matrix11(),InnerVectorizedTraversal,CompleteUnrolling));
+      VERIFY(test_assign(Matrix11(), Matrix11() + Matrix11(), InnerVectorizedTraversal, CompleteUnrolling));
 
+      VERIFY(test_assign(Matrix11(),
+                         Matrix<Scalar, 21, 21>().template block<PacketSize, PacketSize>(2, 3) +
+                             Matrix<Scalar, 21, 21>().template block<PacketSize, PacketSize>(3, 2),
+                         (EIGEN_UNALIGNED_VECTORIZE) ? InnerVectorizedTraversal : DefaultTraversal,
+                         CompleteUnrolling | InnerUnrolling));
 
-      VERIFY(test_assign(Matrix11(),Matrix<Scalar,21,21>().template block<PacketSize,PacketSize>(2,3)+Matrix<Scalar,21,21>().template block<PacketSize,PacketSize>(3,2),
-        (EIGEN_UNALIGNED_VECTORIZE) ? InnerVectorizedTraversal : DefaultTraversal, CompleteUnrolling|InnerUnrolling));
+      VERIFY(test_assign(Vector1(), Matrix11() * Vector1(), InnerVectorizedTraversal, CompleteUnrolling));
 
-      VERIFY(test_assign(Vector1(),Matrix11()*Vector1(),
-                         InnerVectorizedTraversal,CompleteUnrolling));
-
-      VERIFY(test_assign(Matrix11(),Matrix11().lazyProduct(Matrix11()),
-                         InnerVectorizedTraversal,InnerUnrolling+CompleteUnrolling));
+      VERIFY(test_assign(Matrix11(), Matrix11().lazyProduct(Matrix11()), InnerVectorizedTraversal,
+                         InnerUnrolling + CompleteUnrolling));
     }
 
-    VERIFY(test_redux(Vector1(),
-      LinearVectorizedTraversal,CompleteUnrolling));
+    VERIFY(test_redux(Vector1(), LinearVectorizedTraversal, CompleteUnrolling));
 
-    VERIFY(test_redux(Vector1().array()*Vector1().array(),
-      LinearVectorizedTraversal,CompleteUnrolling));
+    VERIFY(test_redux(Vector1().array() * Vector1().array(), LinearVectorizedTraversal, CompleteUnrolling));
 
-    VERIFY(test_redux((Vector1().array()*Vector1().array()).col(0),
-      LinearVectorizedTraversal,CompleteUnrolling));
+    VERIFY(test_redux((Vector1().array() * Vector1().array()).col(0), LinearVectorizedTraversal, CompleteUnrolling));
 
-    VERIFY(test_redux(Matrix<Scalar,PacketSize,3>(),
-      LinearVectorizedTraversal,CompleteUnrolling));
+    VERIFY(test_redux(Matrix<Scalar, PacketSize, 3>(), LinearVectorizedTraversal, CompleteUnrolling));
 
-    VERIFY(test_redux(Matrix3(),
-      LinearVectorizedTraversal,CompleteUnrolling));
+    VERIFY(test_redux(Matrix3(), LinearVectorizedTraversal, CompleteUnrolling));
 
-    VERIFY(test_redux(Matrix44(),
-      LinearVectorizedTraversal,NoUnrolling));
+    VERIFY(test_redux(Matrix44(), LinearVectorizedTraversal, NoUnrolling));
 
-    if(PacketSize>1) {
-      VERIFY(test_redux(Matrix44().template block<(Matrix1::Flags&RowMajorBit)?4:PacketSize,(Matrix1::Flags&RowMajorBit)?PacketSize:4>(1,2),
-        SliceVectorizedTraversal,CompleteUnrolling));
+    if (PacketSize > 1) {
+      VERIFY(test_redux(Matrix44().template block < (Matrix1::Flags & RowMajorBit) ? 4 : PacketSize,
+                        (Matrix1::Flags & RowMajorBit) ? PacketSize : 4 > (1, 2), SliceVectorizedTraversal,
+                        CompleteUnrolling));
 
-      VERIFY(test_redux(Matrix44().template block<(Matrix1::Flags&RowMajorBit)?2:PacketSize,(Matrix1::Flags&RowMajorBit)?PacketSize:2>(1,2),
-        DefaultTraversal,CompleteUnrolling));
+      VERIFY(test_redux(Matrix44().template block < (Matrix1::Flags & RowMajorBit) ? 2 : PacketSize,
+                        (Matrix1::Flags & RowMajorBit) ? PacketSize : 2 > (1, 2), DefaultTraversal, CompleteUnrolling));
     }
 
-    VERIFY(test_redux(Matrix44c().template block<2*PacketSize,1>(1,2),
-      LinearVectorizedTraversal,CompleteUnrolling));
+    VERIFY(
+        test_redux(Matrix44c().template block<2 * PacketSize, 1>(1, 2), LinearVectorizedTraversal, CompleteUnrolling));
 
-    VERIFY(test_redux(Matrix44r().template block<1,2*PacketSize>(2,1),
-      LinearVectorizedTraversal,CompleteUnrolling));
+    VERIFY(
+        test_redux(Matrix44r().template block<1, 2 * PacketSize>(2, 1), LinearVectorizedTraversal, CompleteUnrolling));
+
+    VERIFY((test_assign<Map<Matrix22, AlignedMax, OuterStride<3 * PacketSize> >, Matrix22>(InnerVectorizedTraversal,
+                                                                                           CompleteUnrolling)));
 
     VERIFY((test_assign<
-            Map<Matrix22, AlignedMax, OuterStride<3*PacketSize> >,
-            Matrix22
-            >(InnerVectorizedTraversal,CompleteUnrolling)));
+            Map<Matrix<Scalar, internal::plain_enum_max(2, PacketSize), internal::plain_enum_max(2, PacketSize)>,
+                AlignedMax, InnerStride<3 * PacketSize> >,
+            Matrix<Scalar, internal::plain_enum_max(2, PacketSize), internal::plain_enum_max(2, PacketSize)> >(
+        DefaultTraversal, PacketSize >= 8 ? InnerUnrolling : CompleteUnrolling)));
 
-    VERIFY((test_assign<
-            Map<Matrix<Scalar, internal::plain_enum_max(2,PacketSize), internal::plain_enum_max(2, PacketSize)>, AlignedMax, InnerStride<3*PacketSize> >,
-            Matrix<Scalar, internal::plain_enum_max(2, PacketSize), internal::plain_enum_max(2, PacketSize)>
-            >(DefaultTraversal,PacketSize>=8?InnerUnrolling:CompleteUnrolling)));
-
-    VERIFY((test_assign(Matrix11(), Matrix<Scalar,PacketSize, internal::plain_enum_min(2, PacketSize)>()*Matrix<Scalar, internal::plain_enum_min(2, PacketSize),PacketSize>(),
+    VERIFY((test_assign(Matrix11(),
+                        Matrix<Scalar, PacketSize, internal::plain_enum_min(2, PacketSize)>() *
+                            Matrix<Scalar, internal::plain_enum_min(2, PacketSize), PacketSize>(),
                         InnerVectorizedTraversal, CompleteUnrolling)));
-    #endif
+#endif
 
-    VERIFY(test_assign(MatrixXX(10,10),MatrixXX(20,20).block(10,10,2,3),
-      SliceVectorizedTraversal,NoUnrolling));
+    VERIFY(test_assign(MatrixXX(10, 10), MatrixXX(20, 20).block(10, 10, 2, 3), SliceVectorizedTraversal, NoUnrolling));
 
-    VERIFY(test_redux(VectorX(10),
-      LinearVectorizedTraversal,NoUnrolling));
+    VERIFY(test_redux(VectorX(10), LinearVectorizedTraversal, NoUnrolling));
   }
 };
 
-template<typename Scalar> struct vectorization_logic<Scalar,false>
-{
+template <typename Scalar>
+struct vectorization_logic<Scalar, false> {
   static void run() {}
 };
 
-template<typename Scalar, bool Enable = !internal::is_same<typename internal::unpacket_traits<typename internal::packet_traits<Scalar>::type>::half,
-                                                           typename internal::packet_traits<Scalar>::type>::value >
-struct vectorization_logic_half
-{
+template <typename Scalar, bool Enable = !internal::is_same<
+                               typename internal::unpacket_traits<typename internal::packet_traits<Scalar>::type>::half,
+                               typename internal::packet_traits<Scalar>::type>::value>
+struct vectorization_logic_half {
   typedef internal::packet_traits<Scalar> PacketTraits;
   typedef typename internal::unpacket_traits<typename internal::packet_traits<Scalar>::type>::half PacketType;
   static constexpr int PacketSize = internal::unpacket_traits<PacketType>::size;
 
-  static void run()
-  {
+  static void run() {
     // Some half-packets have a byte size < EIGEN_MIN_ALIGN_BYTES (e.g. Packet2f),
     // which causes many of these tests to fail since they don't vectorize if
     // EIGEN_UNALIGNED_VECTORIZE is 0 (the matrix is assumed unaligned).
     // Adjust the matrix sizes to account for these alignment issues.
-    constexpr int PacketBytes = sizeof(Scalar)*PacketSize;
+    constexpr int PacketBytes = sizeof(Scalar) * PacketSize;
     constexpr int MinVSize = int(EIGEN_UNALIGNED_VECTORIZE) ? PacketSize
-                             : PacketBytes >= EIGEN_MIN_ALIGN_BYTES ? PacketSize
-                             : (EIGEN_MIN_ALIGN_BYTES + sizeof(Scalar) - 1) / sizeof(Scalar);
-    
-    typedef Matrix<Scalar,MinVSize,1> Vector1;
-    typedef Matrix<Scalar,MinVSize,MinVSize> Matrix11;
-    typedef Matrix<Scalar,5*MinVSize,7,ColMajor> Matrix57;
-    typedef Matrix<Scalar,3*MinVSize,5,ColMajor> Matrix35;
-    typedef Matrix<Scalar,5*MinVSize,7,DontAlign|ColMajor> Matrix57u;
+                             : PacketBytes >= EIGEN_MIN_ALIGN_BYTES
+                                 ? PacketSize
+                                 : (EIGEN_MIN_ALIGN_BYTES + sizeof(Scalar) - 1) / sizeof(Scalar);
+
+    typedef Matrix<Scalar, MinVSize, 1> Vector1;
+    typedef Matrix<Scalar, MinVSize, MinVSize> Matrix11;
+    typedef Matrix<Scalar, 5 * MinVSize, 7, ColMajor> Matrix57;
+    typedef Matrix<Scalar, 3 * MinVSize, 5, ColMajor> Matrix35;
+    typedef Matrix<Scalar, 5 * MinVSize, 7, DontAlign | ColMajor> Matrix57u;
 
     typedef Matrix<Scalar,
-        (PacketSize==16 ? 8 : PacketSize==8 ? 4 : PacketSize==4 ? 2 : PacketSize==2 ? 1 : /*PacketSize==1 ?*/ 1),
-        (PacketSize==16 ? 2 : PacketSize==8 ? 2 : PacketSize==4 ? 2 : PacketSize==2 ? 2 : /*PacketSize==1 ?*/ 1)
-      > Matrix1;
+                   (PacketSize == 16  ? 8
+                    : PacketSize == 8 ? 4
+                    : PacketSize == 4 ? 2
+                    : PacketSize == 2 ? 1
+                                      : /*PacketSize==1 ?*/ 1),
+                   (PacketSize == 16  ? 2
+                    : PacketSize == 8 ? 2
+                    : PacketSize == 4 ? 2
+                    : PacketSize == 2 ? 2
+                                      : /*PacketSize==1 ?*/ 1)>
+        Matrix1;
 
     typedef Matrix<Scalar,
-        (PacketSize==16 ? 8 : PacketSize==8 ? 4 : PacketSize==4 ? 2 : PacketSize==2 ? 1 : /*PacketSize==1 ?*/ 1),
-        (PacketSize==16 ? 2 : PacketSize==8 ? 2 : PacketSize==4 ? 2 : PacketSize==2 ? 2 : /*PacketSize==1 ?*/ 1),
-      DontAlign|((Matrix1::Flags&RowMajorBit)?RowMajor:ColMajor)> Matrix1u;
+                   (PacketSize == 16  ? 8
+                    : PacketSize == 8 ? 4
+                    : PacketSize == 4 ? 2
+                    : PacketSize == 2 ? 1
+                                      : /*PacketSize==1 ?*/ 1),
+                   (PacketSize == 16  ? 2
+                    : PacketSize == 8 ? 2
+                    : PacketSize == 4 ? 2
+                    : PacketSize == 2 ? 2
+                                      : /*PacketSize==1 ?*/ 1),
+                   DontAlign | ((Matrix1::Flags & RowMajorBit) ? RowMajor : ColMajor)>
+        Matrix1u;
 
     // this type is made such that it can only be vectorized when viewed as a linear 1D vector
     typedef Matrix<Scalar,
-        (MinVSize==16 ?  4 : MinVSize==8 ? 4 : MinVSize==4 ? 6 : MinVSize==2 ? ((Matrix11::Flags&RowMajorBit)?2:3) : /*PacketSize==1 ?*/ 1),
-        (MinVSize==16 ? 12 : MinVSize==8 ? 6 : MinVSize==4 ? 2 : MinVSize==2 ? ((Matrix11::Flags&RowMajorBit)?3:2) : /*PacketSize==1 ?*/ 3)
-      > Matrix3;
-    
+                   (MinVSize == 16  ? 4
+                    : MinVSize == 8 ? 4
+                    : MinVSize == 4 ? 6
+                    : MinVSize == 2 ? ((Matrix11::Flags & RowMajorBit) ? 2 : 3)
+                                    : /*PacketSize==1 ?*/ 1),
+                   (MinVSize == 16  ? 12
+                    : MinVSize == 8 ? 6
+                    : MinVSize == 4 ? 2
+                    : MinVSize == 2 ? ((Matrix11::Flags & RowMajorBit) ? 3 : 2)
+                                    : /*PacketSize==1 ?*/ 3)>
+        Matrix3;
+
 #if !EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT
-    VERIFY(test_assign(Vector1(),Vector1(),
-      InnerVectorizedTraversal,CompleteUnrolling));
-    VERIFY(test_assign(Vector1(),Vector1()+Vector1(),
-      InnerVectorizedTraversal,CompleteUnrolling));
-    VERIFY(test_assign(Vector1(),Vector1().template segment<MinVSize>(0).derived(),
-      EIGEN_UNALIGNED_VECTORIZE ? InnerVectorizedTraversal : LinearVectorizedTraversal,CompleteUnrolling));
-    VERIFY(test_assign(Vector1(),Scalar(2.1)*Vector1()-Vector1(),
-      InnerVectorizedTraversal,CompleteUnrolling));
-    VERIFY(test_assign(Vector1(),(Scalar(2.1)*Vector1().template segment<MinVSize>(0)-Vector1().template segment<MinVSize>(0)).derived(),
-      EIGEN_UNALIGNED_VECTORIZE ? InnerVectorizedTraversal : LinearVectorizedTraversal,CompleteUnrolling));
-    VERIFY(test_assign(Vector1(),Vector1().cwiseProduct(Vector1()),
-      InnerVectorizedTraversal,CompleteUnrolling));
-    VERIFY(test_assign(Vector1(),Vector1().template cast<Scalar>(),
-      InnerVectorizedTraversal,CompleteUnrolling));
+    VERIFY(test_assign(Vector1(), Vector1(), InnerVectorizedTraversal, CompleteUnrolling));
+    VERIFY(test_assign(Vector1(), Vector1() + Vector1(), InnerVectorizedTraversal, CompleteUnrolling));
+    VERIFY(test_assign(Vector1(), Vector1().template segment<MinVSize>(0).derived(),
+                       EIGEN_UNALIGNED_VECTORIZE ? InnerVectorizedTraversal : LinearVectorizedTraversal,
+                       CompleteUnrolling));
+    VERIFY(test_assign(Vector1(), Scalar(2.1) * Vector1() - Vector1(), InnerVectorizedTraversal, CompleteUnrolling));
+    VERIFY(test_assign(
+        Vector1(),
+        (Scalar(2.1) * Vector1().template segment<MinVSize>(0) - Vector1().template segment<MinVSize>(0)).derived(),
+        EIGEN_UNALIGNED_VECTORIZE ? InnerVectorizedTraversal : LinearVectorizedTraversal, CompleteUnrolling));
+    VERIFY(test_assign(Vector1(), Vector1().cwiseProduct(Vector1()), InnerVectorizedTraversal, CompleteUnrolling));
+    VERIFY(test_assign(Vector1(), Vector1().template cast<Scalar>(), InnerVectorizedTraversal, CompleteUnrolling));
 
-    VERIFY(test_assign(Matrix57(),Matrix57()+Matrix57(),
-      InnerVectorizedTraversal,InnerUnrolling));
+    VERIFY(test_assign(Matrix57(), Matrix57() + Matrix57(), InnerVectorizedTraversal, InnerUnrolling));
 
-    VERIFY(test_assign(Matrix57u(),Matrix57()+Matrix57(),
-      EIGEN_UNALIGNED_VECTORIZE ? InnerVectorizedTraversal : LinearTraversal,
-      EIGEN_UNALIGNED_VECTORIZE ? InnerUnrolling : NoUnrolling));
+    VERIFY(test_assign(Matrix57u(), Matrix57() + Matrix57(),
+                       EIGEN_UNALIGNED_VECTORIZE ? InnerVectorizedTraversal : LinearTraversal,
+                       EIGEN_UNALIGNED_VECTORIZE ? InnerUnrolling : NoUnrolling));
 
-    VERIFY(test_assign(Matrix1u(),Matrix1()+Matrix1(),
-      EIGEN_UNALIGNED_VECTORIZE ? ((int(Matrix1::InnerSizeAtCompileTime) % int(PacketSize))==0 ? InnerVectorizedTraversal : LinearVectorizedTraversal) : LinearTraversal,CompleteUnrolling));
-        
-    if(PacketSize>1)
-    {
-      typedef Matrix<Scalar,3,3,ColMajor> Matrix33c;
-      VERIFY(test_assign(Matrix33c().row(2),Matrix33c().row(1)+Matrix33c().row(1),
-        LinearTraversal,CompleteUnrolling));
+    VERIFY(test_assign(Matrix1u(), Matrix1() + Matrix1(),
+                       EIGEN_UNALIGNED_VECTORIZE
+                           ? ((int(Matrix1::InnerSizeAtCompileTime) % int(PacketSize)) == 0 ? InnerVectorizedTraversal
+                                                                                            : LinearVectorizedTraversal)
+                           : LinearTraversal,
+                       CompleteUnrolling));
 
-      // Unrolling depends on read costs and unroll limits, which vary - ignore.   
-      VERIFY(test_assign(Matrix3(),Matrix3().cwiseQuotient(Matrix3()),
-        PacketTraits::HasDiv ? LinearVectorizedTraversal : LinearTraversal, -1));
-        
-      VERIFY(test_assign(Matrix<Scalar,17,17>(),Matrix<Scalar,17,17>()+Matrix<Scalar,17,17>(),
-        sizeof(Scalar)==16 ? InnerVectorizedTraversal : (EIGEN_UNALIGNED_VECTORIZE ? LinearVectorizedTraversal : LinearTraversal),
-        NoUnrolling));
-        
-      VERIFY(test_assign(Matrix11(),Matrix<Scalar,17,17>().template block<MinVSize,MinVSize>(2,3)+Matrix<Scalar,17,17>().template block<MinVSize,MinVSize>(8,4),
-        EIGEN_UNALIGNED_VECTORIZE ? InnerVectorizedTraversal : DefaultTraversal,InnerUnrolling+CompleteUnrolling));
-  
+    if (PacketSize > 1) {
+      typedef Matrix<Scalar, 3, 3, ColMajor> Matrix33c;
+      VERIFY(
+          test_assign(Matrix33c().row(2), Matrix33c().row(1) + Matrix33c().row(1), LinearTraversal, CompleteUnrolling));
 
-      VERIFY(test_assign(Vector1(),Matrix11()*Vector1(),
-                         InnerVectorizedTraversal,CompleteUnrolling));
+      // Unrolling depends on read costs and unroll limits, which vary - ignore.
+      VERIFY(test_assign(Matrix3(), Matrix3().cwiseQuotient(Matrix3()),
+                         PacketTraits::HasDiv ? LinearVectorizedTraversal : LinearTraversal, -1));
 
-      VERIFY(test_assign(Matrix11(),Matrix11().lazyProduct(Matrix11()),
-                         InnerVectorizedTraversal,InnerUnrolling+CompleteUnrolling));
+      VERIFY(test_assign(Matrix<Scalar, 17, 17>(), Matrix<Scalar, 17, 17>() + Matrix<Scalar, 17, 17>(),
+                         sizeof(Scalar) == 16
+                             ? InnerVectorizedTraversal
+                             : (EIGEN_UNALIGNED_VECTORIZE ? LinearVectorizedTraversal : LinearTraversal),
+                         NoUnrolling));
+
+      VERIFY(test_assign(Matrix11(),
+                         Matrix<Scalar, 17, 17>().template block<MinVSize, MinVSize>(2, 3) +
+                             Matrix<Scalar, 17, 17>().template block<MinVSize, MinVSize>(8, 4),
+                         EIGEN_UNALIGNED_VECTORIZE ? InnerVectorizedTraversal : DefaultTraversal,
+                         InnerUnrolling + CompleteUnrolling));
+
+      VERIFY(test_assign(Vector1(), Matrix11() * Vector1(), InnerVectorizedTraversal, CompleteUnrolling));
+
+      VERIFY(test_assign(Matrix11(), Matrix11().lazyProduct(Matrix11()), InnerVectorizedTraversal,
+                         InnerUnrolling + CompleteUnrolling));
     }
-    
-    VERIFY(test_redux(Vector1(),
-      LinearVectorizedTraversal,CompleteUnrolling));
 
-    VERIFY(test_redux(Matrix<Scalar,MinVSize,3>(),
-      LinearVectorizedTraversal,CompleteUnrolling));
+    VERIFY(test_redux(Vector1(), LinearVectorizedTraversal, CompleteUnrolling));
 
-    VERIFY(test_redux(Matrix3(),
-      LinearVectorizedTraversal,CompleteUnrolling));
+    VERIFY(test_redux(Matrix<Scalar, MinVSize, 3>(), LinearVectorizedTraversal, CompleteUnrolling));
 
-    VERIFY(test_redux(Matrix35(),
-      LinearVectorizedTraversal,CompleteUnrolling));
+    VERIFY(test_redux(Matrix3(), LinearVectorizedTraversal, CompleteUnrolling));
 
-    VERIFY(test_redux(Matrix57().template block<PacketSize==1?2:PacketSize,3>(1,0),
-      SliceVectorizedTraversal,CompleteUnrolling));
+    VERIFY(test_redux(Matrix35(), LinearVectorizedTraversal, CompleteUnrolling));
 
-    if(PacketSize>1) {
-      VERIFY(test_redux(Matrix57().template block<PacketSize,2>(1,0),
-        DefaultTraversal,CompleteUnrolling));
+    VERIFY(test_redux(Matrix57().template block < PacketSize == 1 ? 2 : PacketSize, 3 > (1, 0),
+                      SliceVectorizedTraversal, CompleteUnrolling));
+
+    if (PacketSize > 1) {
+      VERIFY(test_redux(Matrix57().template block<PacketSize, 2>(1, 0), DefaultTraversal, CompleteUnrolling));
     }
 
     VERIFY((test_assign<
@@ -388,45 +430,52 @@
   }
 };
 
-template<typename Scalar> struct vectorization_logic_half<Scalar,false>
-{
+template <typename Scalar>
+struct vectorization_logic_half<Scalar, false> {
   static void run() {}
 };
 
-EIGEN_DECLARE_TEST(vectorization_logic)
-{
-
+EIGEN_DECLARE_TEST(vectorization_logic) {
 #ifdef EIGEN_VECTORIZE
 
-  CALL_SUBTEST( vectorization_logic<int>::run() );
-  CALL_SUBTEST( vectorization_logic<float>::run() );
-  CALL_SUBTEST( vectorization_logic<double>::run() );
-  CALL_SUBTEST( vectorization_logic<std::complex<float> >::run() );
-  CALL_SUBTEST( vectorization_logic<std::complex<double> >::run() );
-  
-  CALL_SUBTEST( vectorization_logic_half<int>::run() );
-  CALL_SUBTEST( vectorization_logic_half<float>::run() );
-  CALL_SUBTEST( vectorization_logic_half<double>::run() );
-  CALL_SUBTEST( vectorization_logic_half<std::complex<float> >::run() );
-  CALL_SUBTEST( vectorization_logic_half<std::complex<double> >::run() );
-  
-  if(internal::packet_traits<float>::Vectorizable)
-  {
-    VERIFY(test_assign(Matrix<float,3,3>(),Matrix<float,3,3>()+Matrix<float,3,3>(),
-      internal::packet_traits<float>::Vectorizable && EIGEN_UNALIGNED_VECTORIZE ? LinearVectorizedTraversal : LinearTraversal,CompleteUnrolling));
-      
-    VERIFY(test_redux(Matrix<float,5,2>(),
-      internal::packet_traits<float>::Vectorizable && EIGEN_UNALIGNED_VECTORIZE ? LinearVectorizedTraversal : LinearTraversal,CompleteUnrolling));
-  }
-  
-  if(internal::packet_traits<double>::Vectorizable)
-  {
-    VERIFY(test_assign(Matrix<double,3,3>(),Matrix<double,3,3>()+Matrix<double,3,3>(),
-      internal::packet_traits<double>::Vectorizable && EIGEN_UNALIGNED_VECTORIZE ? LinearVectorizedTraversal : LinearTraversal,CompleteUnrolling));
-    
-    VERIFY(test_redux(Matrix<double,7,3>(),
-      internal::packet_traits<double>::Vectorizable && EIGEN_UNALIGNED_VECTORIZE ? LinearVectorizedTraversal : LinearTraversal,CompleteUnrolling));
-  }
-#endif // EIGEN_VECTORIZE
+  CALL_SUBTEST(vectorization_logic<int>::run());
+  CALL_SUBTEST(vectorization_logic<float>::run());
+  CALL_SUBTEST(vectorization_logic<double>::run());
+  CALL_SUBTEST(vectorization_logic<std::complex<float> >::run());
+  CALL_SUBTEST(vectorization_logic<std::complex<double> >::run());
 
+  CALL_SUBTEST(vectorization_logic_half<int>::run());
+  CALL_SUBTEST(vectorization_logic_half<float>::run());
+  CALL_SUBTEST(vectorization_logic_half<double>::run());
+  CALL_SUBTEST(vectorization_logic_half<std::complex<float> >::run());
+  CALL_SUBTEST(vectorization_logic_half<std::complex<double> >::run());
+
+  if (internal::packet_traits<float>::Vectorizable) {
+    VERIFY(test_assign(Matrix<float, 3, 3>(), Matrix<float, 3, 3>() + Matrix<float, 3, 3>(),
+                       internal::packet_traits<float>::Vectorizable && EIGEN_UNALIGNED_VECTORIZE
+                           ? LinearVectorizedTraversal
+                           : LinearTraversal,
+                       CompleteUnrolling));
+
+    VERIFY(test_redux(Matrix<float, 5, 2>(),
+                      internal::packet_traits<float>::Vectorizable && EIGEN_UNALIGNED_VECTORIZE
+                          ? LinearVectorizedTraversal
+                          : LinearTraversal,
+                      CompleteUnrolling));
+  }
+
+  if (internal::packet_traits<double>::Vectorizable) {
+    VERIFY(test_assign(Matrix<double, 3, 3>(), Matrix<double, 3, 3>() + Matrix<double, 3, 3>(),
+                       internal::packet_traits<double>::Vectorizable && EIGEN_UNALIGNED_VECTORIZE
+                           ? LinearVectorizedTraversal
+                           : LinearTraversal,
+                       CompleteUnrolling));
+
+    VERIFY(test_redux(Matrix<double, 7, 3>(),
+                      internal::packet_traits<double>::Vectorizable && EIGEN_UNALIGNED_VECTORIZE
+                          ? LinearVectorizedTraversal
+                          : LinearTraversal,
+                      CompleteUnrolling));
+  }
+#endif  // EIGEN_VECTORIZE
 }
diff --git a/test/vectorwiseop.cpp b/test/vectorwiseop.cpp
index 4369789..0d1896b 100644
--- a/test/vectorwiseop.cpp
+++ b/test/vectorwiseop.cpp
@@ -12,20 +12,17 @@
 
 #include "main.h"
 
-template<typename ArrayType> void vectorwiseop_array(const ArrayType& m)
-{
+template <typename ArrayType>
+void vectorwiseop_array(const ArrayType& m) {
   typedef typename ArrayType::Scalar Scalar;
   typedef Array<Scalar, ArrayType::RowsAtCompileTime, 1> ColVectorType;
   typedef Array<Scalar, 1, ArrayType::ColsAtCompileTime> RowVectorType;
 
   Index rows = m.rows();
   Index cols = m.cols();
-  Index r = internal::random<Index>(0, rows-1),
-        c = internal::random<Index>(0, cols-1);
+  Index r = internal::random<Index>(0, rows - 1), c = internal::random<Index>(0, cols - 1);
 
-  ArrayType m1 = ArrayType::Random(rows, cols),
-            m2(rows, cols),
-            m3(rows, cols);
+  ArrayType m1 = ArrayType::Random(rows, cols), m2(rows, cols), m3(rows, cols);
 
   ColVectorType colvec = ColVectorType::Random(rows);
   RowVectorType rowvec = RowVectorType::Random(cols);
@@ -78,43 +75,39 @@
   // yes, there might be an aliasing issue there but ".rowwise() /="
   // is supposed to evaluate " m2.colwise().sum()" into a temporary to avoid
   // evaluating the reduction multiple times
-  if(ArrayType::RowsAtCompileTime>2 || ArrayType::RowsAtCompileTime==Dynamic)
-  {
+  if (ArrayType::RowsAtCompileTime > 2 || ArrayType::RowsAtCompileTime == Dynamic) {
     m2.rowwise() /= m2.colwise().sum();
     VERIFY_IS_APPROX(m2, m1.rowwise() / m1.colwise().sum());
   }
 
   // all/any
-  Array<bool,Dynamic,Dynamic> mb(rows,cols);
-  mb = (m1.real()<=0.7).colwise().all();
-  VERIFY( (mb.col(c) == (m1.real().col(c)<=0.7).all()).all() );
-  mb = (m1.real()<=0.7).rowwise().all();
-  VERIFY( (mb.row(r) == (m1.real().row(r)<=0.7).all()).all() );
+  Array<bool, Dynamic, Dynamic> mb(rows, cols);
+  mb = (m1.real() <= 0.7).colwise().all();
+  VERIFY((mb.col(c) == (m1.real().col(c) <= 0.7).all()).all());
+  mb = (m1.real() <= 0.7).rowwise().all();
+  VERIFY((mb.row(r) == (m1.real().row(r) <= 0.7).all()).all());
 
-  mb = (m1.real()>=0.7).colwise().any();
-  VERIFY( (mb.col(c) == (m1.real().col(c)>=0.7).any()).all() );
-  mb = (m1.real()>=0.7).rowwise().any();
-  VERIFY( (mb.row(r) == (m1.real().row(r)>=0.7).any()).all() );
+  mb = (m1.real() >= 0.7).colwise().any();
+  VERIFY((mb.col(c) == (m1.real().col(c) >= 0.7).any()).all());
+  mb = (m1.real() >= 0.7).rowwise().any();
+  VERIFY((mb.row(r) == (m1.real().row(r) >= 0.7).any()).all());
 }
 
-template<typename MatrixType> void vectorwiseop_matrix(const MatrixType& m)
-{
+template <typename MatrixType>
+void vectorwiseop_matrix(const MatrixType& m) {
   typedef typename MatrixType::Scalar Scalar;
   typedef typename NumTraits<Scalar>::Real RealScalar;
   typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> ColVectorType;
   typedef Matrix<Scalar, 1, MatrixType::ColsAtCompileTime> RowVectorType;
   typedef Matrix<RealScalar, MatrixType::RowsAtCompileTime, 1> RealColVectorType;
   typedef Matrix<RealScalar, 1, MatrixType::ColsAtCompileTime> RealRowVectorType;
-  typedef Matrix<Scalar,Dynamic,Dynamic> MatrixX;
+  typedef Matrix<Scalar, Dynamic, Dynamic> MatrixX;
 
   Index rows = m.rows();
   Index cols = m.cols();
-  Index r = internal::random<Index>(0, rows-1),
-        c = internal::random<Index>(0, cols-1);
+  Index r = internal::random<Index>(0, rows - 1), c = internal::random<Index>(0, cols - 1);
 
-  MatrixType m1 = MatrixType::Random(rows, cols),
-            m2(rows, cols),
-            m3(rows, cols);
+  MatrixType m1 = MatrixType::Random(rows, cols), m2(rows, cols), m3(rows, cols);
 
   ColVectorType colvec = ColVectorType::Random(rows);
   RowVectorType rowvec = RowVectorType::Random(cols);
@@ -124,11 +117,9 @@
   // test broadcast assignment
   m2 = m1;
   m2.colwise() = colvec;
-  for(Index j=0; j<cols; ++j)
-    VERIFY_IS_APPROX(m2.col(j), colvec);
+  for (Index j = 0; j < cols; ++j) VERIFY_IS_APPROX(m2.col(j), colvec);
   m2.rowwise() = rowvec;
-  for(Index i=0; i<rows; ++i)
-    VERIFY_IS_APPROX(m2.row(i), rowvec);
+  for (Index i = 0; i < rows; ++i) VERIFY_IS_APPROX(m2.row(i), rowvec);
 
   // test addition
   m2 = m1;
@@ -141,7 +132,6 @@
   VERIFY_IS_APPROX(m2, m1.rowwise() + rowvec);
   VERIFY_IS_APPROX(m2.row(r), m1.row(r) + rowvec);
 
-
   // test subtraction
   m2 = m1;
   m2.colwise() -= colvec;
@@ -153,24 +143,24 @@
   VERIFY_IS_APPROX(m2, m1.rowwise() - rowvec);
   VERIFY_IS_APPROX(m2.row(r), m1.row(r) - rowvec);
 
-
   // ------ partial reductions ------
 
-  #define TEST_PARTIAL_REDUX_BASIC(FUNC,ROW,COL,PREPROCESS) {                          \
-    ROW = m1 PREPROCESS .colwise().FUNC ;                                              \
-    for(Index k=0; k<cols; ++k) VERIFY_IS_APPROX(ROW(k), m1.col(k) PREPROCESS .FUNC ); \
-    COL = m1 PREPROCESS .rowwise().FUNC ;                                              \
-    for(Index k=0; k<rows; ++k) VERIFY_IS_APPROX(COL(k), m1.row(k) PREPROCESS .FUNC ); \
+#define TEST_PARTIAL_REDUX_BASIC(FUNC, ROW, COL, PREPROCESS)                              \
+  {                                                                                       \
+    ROW = m1 PREPROCESS.colwise().FUNC;                                                   \
+    for (Index k = 0; k < cols; ++k) VERIFY_IS_APPROX(ROW(k), m1.col(k) PREPROCESS.FUNC); \
+    COL = m1 PREPROCESS.rowwise().FUNC;                                                   \
+    for (Index k = 0; k < rows; ++k) VERIFY_IS_APPROX(COL(k), m1.row(k) PREPROCESS.FUNC); \
   }
 
-  TEST_PARTIAL_REDUX_BASIC(sum(),        rowvec,colvec,EIGEN_EMPTY);
-  TEST_PARTIAL_REDUX_BASIC(prod(),       rowvec,colvec,EIGEN_EMPTY);
-  TEST_PARTIAL_REDUX_BASIC(mean(),       rowvec,colvec,EIGEN_EMPTY);
-  TEST_PARTIAL_REDUX_BASIC(minCoeff(),   rrres, rcres, .real());
-  TEST_PARTIAL_REDUX_BASIC(maxCoeff(),   rrres, rcres, .real());
-  TEST_PARTIAL_REDUX_BASIC(norm(),       rrres, rcres, EIGEN_EMPTY);
-  TEST_PARTIAL_REDUX_BASIC(squaredNorm(),rrres, rcres, EIGEN_EMPTY);
-  TEST_PARTIAL_REDUX_BASIC(redux(internal::scalar_sum_op<Scalar,Scalar>()),rowvec,colvec,EIGEN_EMPTY);
+  TEST_PARTIAL_REDUX_BASIC(sum(), rowvec, colvec, EIGEN_EMPTY);
+  TEST_PARTIAL_REDUX_BASIC(prod(), rowvec, colvec, EIGEN_EMPTY);
+  TEST_PARTIAL_REDUX_BASIC(mean(), rowvec, colvec, EIGEN_EMPTY);
+  TEST_PARTIAL_REDUX_BASIC(minCoeff(), rrres, rcres, .real());
+  TEST_PARTIAL_REDUX_BASIC(maxCoeff(), rrres, rcres, .real());
+  TEST_PARTIAL_REDUX_BASIC(norm(), rrres, rcres, EIGEN_EMPTY);
+  TEST_PARTIAL_REDUX_BASIC(squaredNorm(), rrres, rcres, EIGEN_EMPTY);
+  TEST_PARTIAL_REDUX_BASIC(redux(internal::scalar_sum_op<Scalar, Scalar>()), rowvec, colvec, EIGEN_EMPTY);
 
   VERIFY_IS_APPROX(m1.cwiseAbs().colwise().sum(), m1.colwise().template lpNorm<1>());
   VERIFY_IS_APPROX(m1.cwiseAbs().rowwise().sum(), m1.rowwise().template lpNorm<1>());
@@ -195,44 +185,45 @@
   VERIFY_IS_APPROX(m2.row(r), m1.row(r).normalized());
 
   // test with partial reduction of products
-  Matrix<Scalar,MatrixType::RowsAtCompileTime,MatrixType::RowsAtCompileTime> m1m1 = m1 * m1.transpose();
-  VERIFY_IS_APPROX( (m1 * m1.transpose()).colwise().sum(), m1m1.colwise().sum());
-  Matrix<Scalar,1,MatrixType::RowsAtCompileTime> tmp(rows);
-  VERIFY_EVALUATION_COUNT( tmp = (m1 * m1.transpose()).colwise().sum(), 1);
+  Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> m1m1 = m1 * m1.transpose();
+  VERIFY_IS_APPROX((m1 * m1.transpose()).colwise().sum(), m1m1.colwise().sum());
+  Matrix<Scalar, 1, MatrixType::RowsAtCompileTime> tmp(rows);
+  VERIFY_EVALUATION_COUNT(tmp = (m1 * m1.transpose()).colwise().sum(), 1);
 
-  m2 = m1.rowwise() - (m1.colwise().sum()/RealScalar(m1.rows())).eval();
-  m1 = m1.rowwise() - (m1.colwise().sum()/RealScalar(m1.rows()));
-  VERIFY_IS_APPROX( m1, m2 );
-  VERIFY_EVALUATION_COUNT( m2 = (m1.rowwise() - m1.colwise().sum()/RealScalar(m1.rows())), (MatrixType::RowsAtCompileTime!=1 ? 1 : 0) );
+  m2 = m1.rowwise() - (m1.colwise().sum() / RealScalar(m1.rows())).eval();
+  m1 = m1.rowwise() - (m1.colwise().sum() / RealScalar(m1.rows()));
+  VERIFY_IS_APPROX(m1, m2);
+  VERIFY_EVALUATION_COUNT(m2 = (m1.rowwise() - m1.colwise().sum() / RealScalar(m1.rows())),
+                          (MatrixType::RowsAtCompileTime != 1 ? 1 : 0));
 
   // test empty expressions
-  VERIFY_IS_APPROX(m1.matrix().middleCols(0,0).rowwise().sum().eval(), MatrixX::Zero(rows,1));
-  VERIFY_IS_APPROX(m1.matrix().middleRows(0,0).colwise().sum().eval(), MatrixX::Zero(1,cols));
-  VERIFY_IS_APPROX(m1.matrix().middleCols(0,fix<0>).rowwise().sum().eval(), MatrixX::Zero(rows,1));
-  VERIFY_IS_APPROX(m1.matrix().middleRows(0,fix<0>).colwise().sum().eval(), MatrixX::Zero(1,cols));
+  VERIFY_IS_APPROX(m1.matrix().middleCols(0, 0).rowwise().sum().eval(), MatrixX::Zero(rows, 1));
+  VERIFY_IS_APPROX(m1.matrix().middleRows(0, 0).colwise().sum().eval(), MatrixX::Zero(1, cols));
+  VERIFY_IS_APPROX(m1.matrix().middleCols(0, fix<0>).rowwise().sum().eval(), MatrixX::Zero(rows, 1));
+  VERIFY_IS_APPROX(m1.matrix().middleRows(0, fix<0>).colwise().sum().eval(), MatrixX::Zero(1, cols));
 
-  VERIFY_IS_APPROX(m1.matrix().middleCols(0,0).rowwise().prod().eval(), MatrixX::Ones(rows,1));
-  VERIFY_IS_APPROX(m1.matrix().middleRows(0,0).colwise().prod().eval(), MatrixX::Ones(1,cols));
-  VERIFY_IS_APPROX(m1.matrix().middleCols(0,fix<0>).rowwise().prod().eval(), MatrixX::Ones(rows,1));
-  VERIFY_IS_APPROX(m1.matrix().middleRows(0,fix<0>).colwise().prod().eval(), MatrixX::Ones(1,cols));
-  VERIFY_IS_APPROX(m1.matrix().middleCols(0,0).rowwise().squaredNorm().eval(), MatrixX::Zero(rows,1));
+  VERIFY_IS_APPROX(m1.matrix().middleCols(0, 0).rowwise().prod().eval(), MatrixX::Ones(rows, 1));
+  VERIFY_IS_APPROX(m1.matrix().middleRows(0, 0).colwise().prod().eval(), MatrixX::Ones(1, cols));
+  VERIFY_IS_APPROX(m1.matrix().middleCols(0, fix<0>).rowwise().prod().eval(), MatrixX::Ones(rows, 1));
+  VERIFY_IS_APPROX(m1.matrix().middleRows(0, fix<0>).colwise().prod().eval(), MatrixX::Ones(1, cols));
+  VERIFY_IS_APPROX(m1.matrix().middleCols(0, 0).rowwise().squaredNorm().eval(), MatrixX::Zero(rows, 1));
 
-  VERIFY_IS_EQUAL(m1.real().middleRows(0,0).rowwise().maxCoeff().eval().rows(),0);
-  VERIFY_IS_EQUAL(m1.real().middleCols(0,0).colwise().maxCoeff().eval().cols(),0);
-  VERIFY_IS_EQUAL(m1.real().middleRows(0,fix<0>).rowwise().maxCoeff().eval().rows(),0);
-  VERIFY_IS_EQUAL(m1.real().middleCols(0,fix<0>).colwise().maxCoeff().eval().cols(),0);
+  VERIFY_IS_EQUAL(m1.real().middleRows(0, 0).rowwise().maxCoeff().eval().rows(), 0);
+  VERIFY_IS_EQUAL(m1.real().middleCols(0, 0).colwise().maxCoeff().eval().cols(), 0);
+  VERIFY_IS_EQUAL(m1.real().middleRows(0, fix<0>).rowwise().maxCoeff().eval().rows(), 0);
+  VERIFY_IS_EQUAL(m1.real().middleCols(0, fix<0>).colwise().maxCoeff().eval().cols(), 0);
 }
 
-EIGEN_DECLARE_TEST(vectorwiseop)
-{
-  CALL_SUBTEST_1( vectorwiseop_array(Array22cd()) );
-  CALL_SUBTEST_2( vectorwiseop_array(Array<double, 3, 2>()) );
-  CALL_SUBTEST_3( vectorwiseop_array(ArrayXXf(3, 4)) );
-  CALL_SUBTEST_4( vectorwiseop_matrix(Matrix4cf()) );
-  CALL_SUBTEST_5( vectorwiseop_matrix(Matrix4f()) );
-  CALL_SUBTEST_5( vectorwiseop_matrix(Vector4f()) );
-  CALL_SUBTEST_5( vectorwiseop_matrix(Matrix<float,4,5>()) );
-  CALL_SUBTEST_6( vectorwiseop_matrix(MatrixXd(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-  CALL_SUBTEST_7( vectorwiseop_matrix(VectorXd(internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
-  CALL_SUBTEST_7( vectorwiseop_matrix(RowVectorXd(internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
+EIGEN_DECLARE_TEST(vectorwiseop) {
+  CALL_SUBTEST_1(vectorwiseop_array(Array22cd()));
+  CALL_SUBTEST_2(vectorwiseop_array(Array<double, 3, 2>()));
+  CALL_SUBTEST_3(vectorwiseop_array(ArrayXXf(3, 4)));
+  CALL_SUBTEST_4(vectorwiseop_matrix(Matrix4cf()));
+  CALL_SUBTEST_5(vectorwiseop_matrix(Matrix4f()));
+  CALL_SUBTEST_5(vectorwiseop_matrix(Vector4f()));
+  CALL_SUBTEST_5(vectorwiseop_matrix(Matrix<float, 4, 5>()));
+  CALL_SUBTEST_6(vectorwiseop_matrix(
+      MatrixXd(internal::random<int>(1, EIGEN_TEST_MAX_SIZE), internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+  CALL_SUBTEST_7(vectorwiseop_matrix(VectorXd(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
+  CALL_SUBTEST_7(vectorwiseop_matrix(RowVectorXd(internal::random<int>(1, EIGEN_TEST_MAX_SIZE))));
 }
diff --git a/test/visitor.cpp b/test/visitor.cpp
index ca97c6f..a37b358 100644
--- a/test/visitor.cpp
+++ b/test/visitor.cpp
@@ -9,8 +9,8 @@
 
 #include "main.h"
 
-template<typename MatrixType> void matrixVisitor(const MatrixType& p)
-{
+template <typename MatrixType>
+void matrixVisitor(const MatrixType& p) {
   typedef typename MatrixType::Scalar Scalar;
 
   Index rows = p.rows();
@@ -19,33 +19,30 @@
   // construct a random matrix where all coefficients are different
   MatrixType m;
   m = MatrixType::Random(rows, cols);
-  for(Index i = 0; i < m.size(); i++)
-    for(Index i2 = 0; i2 < i; i2++)
-      while(numext::equal_strict(m(i), m(i2))) // yes, strict equality
+  for (Index i = 0; i < m.size(); i++)
+    for (Index i2 = 0; i2 < i; i2++)
+      while (numext::equal_strict(m(i), m(i2)))  // yes, strict equality
         m(i) = internal::random<Scalar>();
-  
+
   Scalar minc = Scalar(1000), maxc = Scalar(-1000);
-  Index minrow=0,mincol=0,maxrow=0,maxcol=0;
-  for(Index j = 0; j < cols; j++)
-  for(Index i = 0; i < rows; i++)
-  {
-    if(m(i,j) < minc)
-    {
-      minc = m(i,j);
-      minrow = i;
-      mincol = j;
+  Index minrow = 0, mincol = 0, maxrow = 0, maxcol = 0;
+  for (Index j = 0; j < cols; j++)
+    for (Index i = 0; i < rows; i++) {
+      if (m(i, j) < minc) {
+        minc = m(i, j);
+        minrow = i;
+        mincol = j;
+      }
+      if (m(i, j) > maxc) {
+        maxc = m(i, j);
+        maxrow = i;
+        maxcol = j;
+      }
     }
-    if(m(i,j) > maxc)
-    {
-      maxc = m(i,j);
-      maxrow = i;
-      maxcol = j;
-    }
-  }
   Index eigen_minrow, eigen_mincol, eigen_maxrow, eigen_maxcol;
   Scalar eigen_minc, eigen_maxc;
-  eigen_minc = m.minCoeff(&eigen_minrow,&eigen_mincol);
-  eigen_maxc = m.maxCoeff(&eigen_maxrow,&eigen_maxcol);
+  eigen_minc = m.minCoeff(&eigen_minrow, &eigen_mincol);
+  eigen_maxc = m.maxCoeff(&eigen_maxrow, &eigen_maxcol);
   VERIFY(minrow == eigen_minrow);
   VERIFY(maxrow == eigen_maxrow);
   VERIFY(mincol == eigen_mincol);
@@ -55,9 +52,9 @@
   VERIFY_IS_APPROX(minc, m.minCoeff());
   VERIFY_IS_APPROX(maxc, m.maxCoeff());
 
-  eigen_maxc = (m.adjoint()*m).maxCoeff(&eigen_maxrow,&eigen_maxcol);
-  Index maxrow2=0,maxcol2=0;
-  eigen_maxc = (m.adjoint()*m).eval().maxCoeff(&maxrow2,&maxcol2);
+  eigen_maxc = (m.adjoint() * m).maxCoeff(&eigen_maxrow, &eigen_maxcol);
+  Index maxrow2 = 0, maxcol2 = 0;
+  eigen_maxc = (m.adjoint() * m).eval().maxCoeff(&maxrow2, &maxcol2);
   VERIFY(maxrow2 == eigen_maxrow);
   VERIFY(maxcol2 == eigen_maxcol);
 
@@ -66,9 +63,8 @@
     bool stop = false;
     for (Index j = 0; j < cols && !stop; ++j) {
       for (Index i = 0; i < rows && !stop; ++i) {
-        if (!(j == mincol && i == minrow) &&
-            !(j == maxcol && i == maxrow)) {
-          m(i,j) = NumTraits<Scalar>::quiet_NaN();
+        if (!(j == mincol && i == minrow) && !(j == maxcol && i == maxrow)) {
+          m(i, j) = NumTraits<Scalar>::quiet_NaN();
           stop = true;
           break;
         }
@@ -124,8 +120,8 @@
   }
 }
 
-template<typename VectorType> void vectorVisitor(const VectorType& w)
-{
+template <typename VectorType>
+void vectorVisitor(const VectorType& w) {
   typedef typename VectorType::Scalar Scalar;
 
   Index size = w.size();
@@ -133,22 +129,19 @@
   // construct a random vector where all coefficients are different
   VectorType v;
   v = VectorType::Random(size);
-  for(Index i = 0; i < size; i++)
-    for(Index i2 = 0; i2 < i; i2++)
-      while(v(i) == v(i2)) // yes, ==
+  for (Index i = 0; i < size; i++)
+    for (Index i2 = 0; i2 < i; i2++)
+      while (v(i) == v(i2))  // yes, ==
         v(i) = internal::random<Scalar>();
-  
+
   Scalar minc = v(0), maxc = v(0);
-  Index minidx=0, maxidx=0;
-  for(Index i = 0; i < size; i++)
-  {
-    if(v(i) < minc)
-    {
+  Index minidx = 0, maxidx = 0;
+  for (Index i = 0; i < size; i++) {
+    if (v(i) < minc) {
       minc = v(i);
       minidx = i;
     }
-    if(v(i) > maxc)
-    {
+    if (v(i) > maxc) {
       maxc = v(i);
       maxidx = i;
     }
@@ -163,8 +156,8 @@
   VERIFY_IS_APPROX(maxc, eigen_maxc);
   VERIFY_IS_APPROX(minc, v.minCoeff());
   VERIFY_IS_APPROX(maxc, v.maxCoeff());
-  
-  Index idx0 = internal::random<Index>(0,size-1);
+
+  Index idx0 = internal::random<Index>(0, size - 1);
   Index idx1 = eigen_minidx;
   Index idx2 = eigen_maxidx;
   VectorType v1(v), v2(v);
@@ -172,8 +165,8 @@
   v2(idx0) = v2(idx2);
   v1.minCoeff(&eigen_minidx);
   v2.maxCoeff(&eigen_maxidx);
-  VERIFY(eigen_minidx == (std::min)(idx0,idx1));
-  VERIFY(eigen_maxidx == (std::min)(idx0,idx2));
+  VERIFY(eigen_minidx == (std::min)(idx0, idx1));
+  VERIFY(eigen_maxidx == (std::min)(idx0, idx2));
 
   if (!NumTraits<Scalar>::IsInteger && size > 2) {
     // Test NaN propagation by replacing an element with NaN.
@@ -236,8 +229,8 @@
 namespace Eigen {
 namespace internal {
 
-template<typename T, bool Vectorizable>
-struct functor_traits<TrackedVisitor<T, Vectorizable> > {
+template <typename T, bool Vectorizable>
+struct functor_traits<TrackedVisitor<T, Vectorizable>> {
   enum { PacketAccess = Vectorizable, LinearAccess = false, Cost = 1 };
 };
 
@@ -271,7 +264,6 @@
 }
 
 void checkOptimalTraversal() {
-    
   using Scalar = float;
   constexpr int PacketSize = Eigen::internal::packet_traits<Scalar>::size;
   // use sizes that mix vector and scalar ops
@@ -286,7 +278,7 @@
   using DynamicRowMajor = Matrix<Scalar, Dynamic, Dynamic, RowMajor>;
 
   // Scalar-only visitors
-  checkOptimalTraversal_impl<UnrollColMajor, false>(UnrollColMajor(Rows,Cols));
+  checkOptimalTraversal_impl<UnrollColMajor, false>(UnrollColMajor(Rows, Cols));
   checkOptimalTraversal_impl<UnrollRowMajor, false>(UnrollRowMajor(Rows, Cols));
   checkOptimalTraversal_impl<DynamicColMajor, false>(DynamicColMajor(rows, cols));
   checkOptimalTraversal_impl<DynamicRowMajor, false>(DynamicRowMajor(rows, cols));
@@ -298,22 +290,21 @@
   checkOptimalTraversal_impl<DynamicRowMajor, true>(DynamicRowMajor(rows, cols));
 }
 
-EIGEN_DECLARE_TEST(visitor)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( matrixVisitor(Matrix<float, 1, 1>()) );
-    CALL_SUBTEST_2( matrixVisitor(Matrix2f()) );
-    CALL_SUBTEST_3( matrixVisitor(Matrix4d()) );
-    CALL_SUBTEST_4( matrixVisitor(MatrixXd(8, 12)) );
-    CALL_SUBTEST_5( matrixVisitor(Matrix<double,Dynamic,Dynamic,RowMajor>(20, 20)) );
-    CALL_SUBTEST_6( matrixVisitor(MatrixXi(8, 12)) );
+EIGEN_DECLARE_TEST(visitor) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(matrixVisitor(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_2(matrixVisitor(Matrix2f()));
+    CALL_SUBTEST_3(matrixVisitor(Matrix4d()));
+    CALL_SUBTEST_4(matrixVisitor(MatrixXd(8, 12)));
+    CALL_SUBTEST_5(matrixVisitor(Matrix<double, Dynamic, Dynamic, RowMajor>(20, 20)));
+    CALL_SUBTEST_6(matrixVisitor(MatrixXi(8, 12)));
   }
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_7( vectorVisitor(Vector4f()) );
-    CALL_SUBTEST_7( vectorVisitor(Matrix<int,12,1>()) );
-    CALL_SUBTEST_8( vectorVisitor(VectorXd(10)) );
-    CALL_SUBTEST_9( vectorVisitor(RowVectorXd(10)) );
-    CALL_SUBTEST_10( vectorVisitor(VectorXf(33)) );
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_7(vectorVisitor(Vector4f()));
+    CALL_SUBTEST_7(vectorVisitor(Matrix<int, 12, 1>()));
+    CALL_SUBTEST_8(vectorVisitor(VectorXd(10)));
+    CALL_SUBTEST_9(vectorVisitor(RowVectorXd(10)));
+    CALL_SUBTEST_10(vectorVisitor(VectorXf(33)));
   }
   CALL_SUBTEST_11(checkOptimalTraversal());
 }
diff --git a/test/zerosized.cpp b/test/zerosized.cpp
index 86aa5eb..7001327 100644
--- a/test/zerosized.cpp
+++ b/test/zerosized.cpp
@@ -9,89 +9,83 @@
 
 #include "main.h"
 
-
-template<typename MatrixType> void zeroReduction(const MatrixType& m) {
+template <typename MatrixType>
+void zeroReduction(const MatrixType& m) {
   // Reductions that must hold for zero sized objects
   VERIFY(m.all());
   VERIFY(!m.any());
-  VERIFY(m.prod()==1);
-  VERIFY(m.sum()==0);
-  VERIFY(m.norm()==0);
-  VERIFY(m.squaredNorm()==0);
-  VERIFY(m.count()==0);
+  VERIFY(m.prod() == 1);
+  VERIFY(m.sum() == 0);
+  VERIFY(m.norm() == 0);
+  VERIFY(m.squaredNorm() == 0);
+  VERIFY(m.count() == 0);
   VERIFY(m.allFinite());
   VERIFY(!m.hasNaN());
-  VERIFY_RAISES_ASSERT( m.minCoeff() );
-  VERIFY_RAISES_ASSERT( m.maxCoeff() );
-  Index i,j;
-  VERIFY_RAISES_ASSERT( m.minCoeff(&i,&j) );
-  VERIFY_RAISES_ASSERT( m.maxCoeff(&i,&j) );
-  VERIFY_RAISES_ASSERT( m.reshaped().minCoeff(&i) );
-  VERIFY_RAISES_ASSERT( m.reshaped().maxCoeff(&i) );
+  VERIFY_RAISES_ASSERT(m.minCoeff());
+  VERIFY_RAISES_ASSERT(m.maxCoeff());
+  Index i, j;
+  VERIFY_RAISES_ASSERT(m.minCoeff(&i, &j));
+  VERIFY_RAISES_ASSERT(m.maxCoeff(&i, &j));
+  VERIFY_RAISES_ASSERT(m.reshaped().minCoeff(&i));
+  VERIFY_RAISES_ASSERT(m.reshaped().maxCoeff(&i));
 }
 
-
-template<typename MatrixType> void zeroSizedMatrix()
-{
+template <typename MatrixType>
+void zeroSizedMatrix() {
   MatrixType t1;
   typedef typename MatrixType::Scalar Scalar;
 
-  if (MatrixType::SizeAtCompileTime == Dynamic || MatrixType::SizeAtCompileTime == 0)
-  {
+  if (MatrixType::SizeAtCompileTime == Dynamic || MatrixType::SizeAtCompileTime == 0) {
     zeroReduction(t1);
-    if (MatrixType::RowsAtCompileTime == Dynamic)
-      VERIFY(t1.rows() == 0);
-    if (MatrixType::ColsAtCompileTime == Dynamic)
-      VERIFY(t1.cols() == 0);
+    if (MatrixType::RowsAtCompileTime == Dynamic) VERIFY(t1.rows() == 0);
+    if (MatrixType::ColsAtCompileTime == Dynamic) VERIFY(t1.cols() == 0);
 
-    if (MatrixType::RowsAtCompileTime == Dynamic && MatrixType::ColsAtCompileTime == Dynamic)
-    {
-
+    if (MatrixType::RowsAtCompileTime == Dynamic && MatrixType::ColsAtCompileTime == Dynamic) {
       MatrixType t2(0, 0);
       VERIFY(t2.rows() == 0);
       VERIFY(t2.cols() == 0);
 
       zeroReduction(t2);
-      VERIFY(t1==t2);
+      VERIFY(t1 == t2);
     }
   }
 
-  if(MatrixType::MaxColsAtCompileTime!=0 && MatrixType::MaxRowsAtCompileTime!=0)
-  {
-    Index rows = MatrixType::RowsAtCompileTime==Dynamic ? internal::random<Index>(1,10) : Index(MatrixType::RowsAtCompileTime);
-    Index cols = MatrixType::ColsAtCompileTime==Dynamic ? internal::random<Index>(1,10) : Index(MatrixType::ColsAtCompileTime);
-    MatrixType m(rows,cols);
-    zeroReduction(m.template block<0,MatrixType::ColsAtCompileTime>(0,0,0,cols));
-    zeroReduction(m.template block<MatrixType::RowsAtCompileTime,0>(0,0,rows,0));
-    zeroReduction(m.template block<0,1>(0,0));
-    zeroReduction(m.template block<1,0>(0,0));
-    Matrix<Scalar,Dynamic,Dynamic> prod = m.template block<MatrixType::RowsAtCompileTime,0>(0,0,rows,0) * m.template block<0,MatrixType::ColsAtCompileTime>(0,0,0,cols);
-    VERIFY(prod.rows()==rows && prod.cols()==cols);
+  if (MatrixType::MaxColsAtCompileTime != 0 && MatrixType::MaxRowsAtCompileTime != 0) {
+    Index rows = MatrixType::RowsAtCompileTime == Dynamic ? internal::random<Index>(1, 10)
+                                                          : Index(MatrixType::RowsAtCompileTime);
+    Index cols = MatrixType::ColsAtCompileTime == Dynamic ? internal::random<Index>(1, 10)
+                                                          : Index(MatrixType::ColsAtCompileTime);
+    MatrixType m(rows, cols);
+    zeroReduction(m.template block<0, MatrixType::ColsAtCompileTime>(0, 0, 0, cols));
+    zeroReduction(m.template block<MatrixType::RowsAtCompileTime, 0>(0, 0, rows, 0));
+    zeroReduction(m.template block<0, 1>(0, 0));
+    zeroReduction(m.template block<1, 0>(0, 0));
+    Matrix<Scalar, Dynamic, Dynamic> prod = m.template block<MatrixType::RowsAtCompileTime, 0>(0, 0, rows, 0) *
+                                            m.template block<0, MatrixType::ColsAtCompileTime>(0, 0, 0, cols);
+    VERIFY(prod.rows() == rows && prod.cols() == cols);
     VERIFY(prod.isZero());
-    prod = m.template block<1,0>(0,0) * m.template block<0,1>(0,0);
-    VERIFY(prod.size()==1);
+    prod = m.template block<1, 0>(0, 0) * m.template block<0, 1>(0, 0);
+    VERIFY(prod.size() == 1);
     VERIFY(prod.isZero());
   }
 }
 
-template<typename VectorType> void zeroSizedVector()
-{
+template <typename VectorType>
+void zeroSizedVector() {
   VectorType t1;
 
-  if (VectorType::SizeAtCompileTime == Dynamic || VectorType::SizeAtCompileTime==0)
-  {
+  if (VectorType::SizeAtCompileTime == Dynamic || VectorType::SizeAtCompileTime == 0) {
     zeroReduction(t1);
     VERIFY(t1.size() == 0);
-    VectorType t2(DenseIndex(0)); // DenseIndex disambiguates with 0-the-null-pointer (error with gcc 4.4 and MSVC8)
+    VectorType t2(DenseIndex(0));  // DenseIndex disambiguates with 0-the-null-pointer (error with gcc 4.4 and MSVC8)
     VERIFY(t2.size() == 0);
     zeroReduction(t2);
 
-    VERIFY(t1==t2);
+    VERIFY(t1 == t2);
   }
 }
 
-EIGEN_DECLARE_TEST(zerosized)
-{
+EIGEN_DECLARE_TEST(zerosized) {
   zeroSizedMatrix<Matrix2d>();
   zeroSizedMatrix<Matrix3i>();
   zeroSizedMatrix<Matrix<float, 2, Dynamic> >();
diff --git a/unsupported/bench/bench_svd.cpp b/unsupported/bench/bench_svd.cpp
index e7028a2..40a989b 100644
--- a/unsupported/bench/bench_svd.cpp
+++ b/unsupported/bench/bench_svd.cpp
@@ -16,7 +16,6 @@
 #include <bench/BenchTimer.h>
 #include <unsupported/Eigen/SVD>
 
-
 using namespace Eigen;
 using namespace std;
 
@@ -30,94 +29,83 @@
 #define NUMBER_SAMPLE 2
 #endif
 
-template<typename MatrixType>
-void bench_svd(const MatrixType& a = MatrixType())
-{
+template <typename MatrixType>
+void bench_svd(const MatrixType& a = MatrixType()) {
   MatrixType m = MatrixType::Random(a.rows(), a.cols());
   BenchTimer timerJacobi;
   BenchTimer timerBDC;
   timerJacobi.reset();
   timerBDC.reset();
 
-  cout << " Only compute Singular Values" <<endl;
-  for (int k=1; k<=NUMBER_SAMPLE; ++k)
-  {
+  cout << " Only compute Singular Values" << endl;
+  for (int k = 1; k <= NUMBER_SAMPLE; ++k) {
     timerBDC.start();
-    for (int i=0; i<REPEAT; ++i) 
-    {
+    for (int i = 0; i < REPEAT; ++i) {
       BDCSVD<MatrixType> bdc_matrix(m);
     }
     timerBDC.stop();
-    
+
     timerJacobi.start();
-    for (int i=0; i<REPEAT; ++i) 
-    {
+    for (int i = 0; i < REPEAT; ++i) {
       JacobiSVD<MatrixType> jacobi_matrix(m);
     }
     timerJacobi.stop();
 
-
     cout << "Sample " << k << " : " << REPEAT << " computations :  Jacobi : " << fixed << timerJacobi.value() << "s ";
-    cout << " || " << " BDC : " << timerBDC.value() << "s " <<endl <<endl;
-      
-    if (timerBDC.value() >= timerJacobi.value())  
-      cout << "KO : BDC is " <<  timerJacobi.value() / timerBDC.value() << "  times faster than Jacobi" <<endl;
-    else 
-      cout << "OK : BDC is " << timerJacobi.value() / timerBDC.value() << "  times faster than Jacobi"  <<endl;
-      
+    cout << " || "
+         << " BDC : " << timerBDC.value() << "s " << endl
+         << endl;
+
+    if (timerBDC.value() >= timerJacobi.value())
+      cout << "KO : BDC is " << timerJacobi.value() / timerBDC.value() << "  times faster than Jacobi" << endl;
+    else
+      cout << "OK : BDC is " << timerJacobi.value() / timerBDC.value() << "  times faster than Jacobi" << endl;
   }
-  cout << "       =================" <<endl;
-  std::cout<< std::endl;
+  cout << "       =================" << endl;
+  std::cout << std::endl;
   timerJacobi.reset();
   timerBDC.reset();
-  cout << " Computes rotation matrix" <<endl;
-  for (int k=1; k<=NUMBER_SAMPLE; ++k)
-  {
+  cout << " Computes rotation matrix" << endl;
+  for (int k = 1; k <= NUMBER_SAMPLE; ++k) {
     timerBDC.start();
-    for (int i=0; i<REPEAT; ++i) 
-    {
-      BDCSVD<MatrixType> bdc_matrix(m, ComputeFullU|ComputeFullV);
+    for (int i = 0; i < REPEAT; ++i) {
+      BDCSVD<MatrixType> bdc_matrix(m, ComputeFullU | ComputeFullV);
     }
     timerBDC.stop();
-    
+
     timerJacobi.start();
-    for (int i=0; i<REPEAT; ++i) 
-    {
-      JacobiSVD<MatrixType> jacobi_matrix(m, ComputeFullU|ComputeFullV);
+    for (int i = 0; i < REPEAT; ++i) {
+      JacobiSVD<MatrixType> jacobi_matrix(m, ComputeFullU | ComputeFullV);
     }
     timerJacobi.stop();
 
-
     cout << "Sample " << k << " : " << REPEAT << " computations :  Jacobi : " << fixed << timerJacobi.value() << "s ";
-    cout << " || " << " BDC : " << timerBDC.value() << "s " <<endl <<endl;
-      
-    if (timerBDC.value() >= timerJacobi.value())  
-      cout << "KO : BDC is " <<  timerJacobi.value() / timerBDC.value() << "  times faster than Jacobi" <<endl;
-    else 
-      cout << "OK : BDC is " << timerJacobi.value() / timerBDC.value() << "  times faster than Jacobi"  <<endl;
-      
+    cout << " || "
+         << " BDC : " << timerBDC.value() << "s " << endl
+         << endl;
+
+    if (timerBDC.value() >= timerJacobi.value())
+      cout << "KO : BDC is " << timerJacobi.value() / timerBDC.value() << "  times faster than Jacobi" << endl;
+    else
+      cout << "OK : BDC is " << timerJacobi.value() / timerBDC.value() << "  times faster than Jacobi" << endl;
   }
-  std::cout<< std::endl;
+  std::cout << std::endl;
 }
 
+int main(int argc, char* argv[]) {
+  std::cout << std::endl;
 
+  std::cout << "On a (Dynamic, Dynamic) (6, 6) Matrix" << std::endl;
+  bench_svd<Matrix<double, Dynamic, Dynamic> >(Matrix<double, Dynamic, Dynamic>(6, 6));
 
-int main(int argc, char* argv[])
-{
-  std::cout<< std::endl;
+  std::cout << "On a (Dynamic, Dynamic) (32, 32) Matrix" << std::endl;
+  bench_svd<Matrix<double, Dynamic, Dynamic> >(Matrix<double, Dynamic, Dynamic>(32, 32));
 
-  std::cout<<"On a (Dynamic, Dynamic) (6, 6) Matrix" <<std::endl;
-  bench_svd<Matrix<double,Dynamic,Dynamic> >(Matrix<double,Dynamic,Dynamic>(6, 6));
-  
-  std::cout<<"On a (Dynamic, Dynamic) (32, 32) Matrix" <<std::endl;
-  bench_svd<Matrix<double,Dynamic,Dynamic> >(Matrix<double,Dynamic,Dynamic>(32, 32));
+  // std::cout<<"On a (Dynamic, Dynamic) (128, 128) Matrix" <<std::endl;
+  // bench_svd<Matrix<double,Dynamic,Dynamic> >(Matrix<double,Dynamic,Dynamic>(128, 128));
 
-  //std::cout<<"On a (Dynamic, Dynamic) (128, 128) Matrix" <<std::endl;
-  //bench_svd<Matrix<double,Dynamic,Dynamic> >(Matrix<double,Dynamic,Dynamic>(128, 128));
+  std::cout << "On a (Dynamic, Dynamic) (160, 160) Matrix" << std::endl;
+  bench_svd<Matrix<double, Dynamic, Dynamic> >(Matrix<double, Dynamic, Dynamic>(160, 160));
 
-  std::cout<<"On a (Dynamic, Dynamic) (160, 160) Matrix" <<std::endl;
-  bench_svd<Matrix<double,Dynamic,Dynamic> >(Matrix<double,Dynamic,Dynamic>(160, 160));
-  
-  std::cout<< "--------------------------------------------------------------------"<< std::endl;
-           
+  std::cout << "--------------------------------------------------------------------" << std::endl;
 }
diff --git a/unsupported/doc/examples/BVH_Example.cpp b/unsupported/doc/examples/BVH_Example.cpp
index afb0c94..8c37d71 100644
--- a/unsupported/doc/examples/BVH_Example.cpp
+++ b/unsupported/doc/examples/BVH_Example.cpp
@@ -6,27 +6,38 @@
 typedef AlignedBox<double, 2> Box2d;
 
 namespace Eigen {
-  Box2d bounding_box(const Vector2d &v) { return Box2d(v, v); } //compute the bounding box of a single point
-}
+Box2d bounding_box(const Vector2d &v) { return Box2d(v, v); }  // compute the bounding box of a single point
+}  // namespace Eigen
 
-struct PointPointMinimizer //how to compute squared distances between points and rectangles
+struct PointPointMinimizer  // how to compute squared distances between points and rectangles
 {
   PointPointMinimizer() : calls(0) {}
   typedef double Scalar;
 
-  double minimumOnVolumeVolume(const Box2d &r1, const Box2d &r2) { ++calls; return r1.squaredExteriorDistance(r2); }
-  double minimumOnVolumeObject(const Box2d &r, const Vector2d &v) { ++calls; return r.squaredExteriorDistance(v); }
-  double minimumOnObjectVolume(const Vector2d &v, const Box2d &r) { ++calls; return r.squaredExteriorDistance(v); }
-  double minimumOnObjectObject(const Vector2d &v1, const Vector2d &v2) { ++calls; return (v1 - v2).squaredNorm(); }
+  double minimumOnVolumeVolume(const Box2d &r1, const Box2d &r2) {
+    ++calls;
+    return r1.squaredExteriorDistance(r2);
+  }
+  double minimumOnVolumeObject(const Box2d &r, const Vector2d &v) {
+    ++calls;
+    return r.squaredExteriorDistance(v);
+  }
+  double minimumOnObjectVolume(const Vector2d &v, const Box2d &r) {
+    ++calls;
+    return r.squaredExteriorDistance(v);
+  }
+  double minimumOnObjectObject(const Vector2d &v1, const Vector2d &v2) {
+    ++calls;
+    return (v1 - v2).squaredNorm();
+  }
 
   int calls;
 };
 
-int main()
-{
+int main() {
   typedef std::vector<Vector2d, aligned_allocator<Vector2d> > StdVectorOfVector2d;
   StdVectorOfVector2d redPoints, bluePoints;
-  for(int i = 0; i < 100; ++i) { //initialize random set of red points and blue points
+  for (int i = 0; i < 100; ++i) {  // initialize random set of red points and blue points
     redPoints.push_back(Vector2d::Random());
     bluePoints.push_back(Vector2d::Random());
   }
@@ -34,16 +45,17 @@
   PointPointMinimizer minimizer;
   double minDistSq = std::numeric_limits<double>::max();
 
-  //brute force to find closest red-blue pair
-  for(int i = 0; i < (int)redPoints.size(); ++i)
-    for(int j = 0; j < (int)bluePoints.size(); ++j)
+  // brute force to find closest red-blue pair
+  for (int i = 0; i < (int)redPoints.size(); ++i)
+    for (int j = 0; j < (int)bluePoints.size(); ++j)
       minDistSq = std::min(minDistSq, minimizer.minimumOnObjectObject(redPoints[i], bluePoints[j]));
   std::cout << "Brute force distance = " << sqrt(minDistSq) << ", calls = " << minimizer.calls << std::endl;
 
-  //using BVH to find closest red-blue pair
+  // using BVH to find closest red-blue pair
   minimizer.calls = 0;
-  KdBVH<double, 2, Vector2d> redTree(redPoints.begin(), redPoints.end()), blueTree(bluePoints.begin(), bluePoints.end()); //construct the trees
-  minDistSq = BVMinimize(redTree, blueTree, minimizer); //actual BVH minimization call
+  KdBVH<double, 2, Vector2d> redTree(redPoints.begin(), redPoints.end()),
+      blueTree(bluePoints.begin(), bluePoints.end());    // construct the trees
+  minDistSq = BVMinimize(redTree, blueTree, minimizer);  // actual BVH minimization call
   std::cout << "BVH distance         = " << sqrt(minDistSq) << ", calls = " << minimizer.calls << std::endl;
 
   return 0;
diff --git a/unsupported/doc/examples/EulerAngles.cpp b/unsupported/doc/examples/EulerAngles.cpp
index 3f8ca8c..5694770 100644
--- a/unsupported/doc/examples/EulerAngles.cpp
+++ b/unsupported/doc/examples/EulerAngles.cpp
@@ -3,8 +3,7 @@
 
 using namespace Eigen;
 
-int main()
-{
+int main() {
   // A common Euler system by many armies around the world,
   //  where the first one is the azimuth(the angle from the north -
   //   the same angle that is show in compass)
@@ -14,33 +13,32 @@
   // Keep remembering we're using radian angles here!
   typedef EulerSystem<-EULER_Z, EULER_Y, EULER_X> MyArmySystem;
   typedef EulerAngles<double, MyArmySystem> MyArmyAngles;
-  
-  MyArmyAngles vehicleAngles(
-    3.14/*PI*/ / 2, /* heading to east, notice that this angle is counter-clockwise */
-    -0.3, /* going down from a mountain */
-    0.1); /* slightly rolled to the right */
-  
+
+  MyArmyAngles vehicleAngles(3.14 /*PI*/ / 2, /* heading to east, notice that this angle is counter-clockwise */
+                             -0.3,            /* going down from a mountain */
+                             0.1);            /* slightly rolled to the right */
+
   // Some Euler angles representation that our plane use.
   EulerAnglesZYZd planeAngles(0.78474, 0.5271, -0.513794);
-  
+
   MyArmyAngles planeAnglesInMyArmyAngles(planeAngles);
-  
+
   std::cout << "vehicle angles(MyArmy):     " << vehicleAngles << std::endl;
   std::cout << "plane angles(ZYZ):        " << planeAngles << std::endl;
   std::cout << "plane angles(MyArmy):     " << planeAnglesInMyArmyAngles << std::endl;
-  
+
   // Now lets rotate the plane a little bit
   std::cout << "==========================================================\n";
   std::cout << "rotating plane now!\n";
   std::cout << "==========================================================\n";
-  
+
   Quaterniond planeRotated = AngleAxisd(-0.342, Vector3d::UnitY()) * planeAngles;
-  
+
   planeAngles = planeRotated;
   planeAnglesInMyArmyAngles = planeRotated;
-  
+
   std::cout << "new plane angles(ZYZ):     " << planeAngles << std::endl;
   std::cout << "new plane angles(MyArmy): " << planeAnglesInMyArmyAngles << std::endl;
-  
+
   return 0;
 }
diff --git a/unsupported/doc/examples/FFT.cpp b/unsupported/doc/examples/FFT.cpp
index 85e8a02..bf24de5 100644
--- a/unsupported/doc/examples/FFT.cpp
+++ b/unsupported/doc/examples/FFT.cpp
@@ -1,5 +1,5 @@
 //  To use the simple FFT implementation
-//  g++ -o demofft -I.. -Wall -O3 FFT.cpp 
+//  g++ -o demofft -I.. -Wall -O3 FFT.cpp
 
 //  To use the FFTW implementation
 //  g++ -o demofft -I.. -DUSE_FFTW -Wall -O3 FFT.cpp -lfftw3 -lfftw3f -lfftw3l
@@ -20,99 +20,84 @@
 using namespace Eigen;
 
 template <typename T>
-T mag2(T a)
-{
-    return a*a;
+T mag2(T a) {
+  return a * a;
 }
 template <typename T>
-T mag2(std::complex<T> a)
-{
-    return norm(a);
+T mag2(std::complex<T> a) {
+  return norm(a);
 }
 
 template <typename T>
-T mag2(const std::vector<T> & vec)
-{
-    T out=0;
-    for (size_t k=0;k<vec.size();++k)
-        out += mag2(vec[k]);
-    return out;
+T mag2(const std::vector<T>& vec) {
+  T out = 0;
+  for (size_t k = 0; k < vec.size(); ++k) out += mag2(vec[k]);
+  return out;
 }
 
 template <typename T>
-T mag2(const std::vector<std::complex<T> > & vec)
-{
-    T out=0;
-    for (size_t k=0;k<vec.size();++k)
-        out += mag2(vec[k]);
-    return out;
+T mag2(const std::vector<std::complex<T> >& vec) {
+  T out = 0;
+  for (size_t k = 0; k < vec.size(); ++k) out += mag2(vec[k]);
+  return out;
 }
 
 template <typename T>
-vector<T> operator-(const vector<T> & a,const vector<T> & b )
-{
-    vector<T> c(a);
-    for (size_t k=0;k<b.size();++k) 
-        c[k] -= b[k];
-    return c;
+vector<T> operator-(const vector<T>& a, const vector<T>& b) {
+  vector<T> c(a);
+  for (size_t k = 0; k < b.size(); ++k) c[k] -= b[k];
+  return c;
 }
 
 template <typename T>
-void RandomFill(std::vector<T> & vec)
-{
-    for (size_t k=0;k<vec.size();++k)
-        vec[k] = T( rand() )/T(RAND_MAX) - T(.5);
+void RandomFill(std::vector<T>& vec) {
+  for (size_t k = 0; k < vec.size(); ++k) vec[k] = T(rand()) / T(RAND_MAX) - T(.5);
 }
 
 template <typename T>
-void RandomFill(std::vector<std::complex<T> > & vec)
-{
-    for (size_t k=0;k<vec.size();++k)
-        vec[k] = std::complex<T> ( T( rand() )/T(RAND_MAX) - T(.5), T( rand() )/T(RAND_MAX) - T(.5));
+void RandomFill(std::vector<std::complex<T> >& vec) {
+  for (size_t k = 0; k < vec.size(); ++k)
+    vec[k] = std::complex<T>(T(rand()) / T(RAND_MAX) - T(.5), T(rand()) / T(RAND_MAX) - T(.5));
 }
 
-template <typename T_time,typename T_freq>
-void fwd_inv(size_t nfft)
-{
-    typedef typename NumTraits<T_freq>::Real Scalar;
-    vector<T_time> timebuf(nfft);
-    RandomFill(timebuf);
+template <typename T_time, typename T_freq>
+void fwd_inv(size_t nfft) {
+  typedef typename NumTraits<T_freq>::Real Scalar;
+  vector<T_time> timebuf(nfft);
+  RandomFill(timebuf);
 
-    vector<T_freq> freqbuf;
-    static FFT<Scalar> fft;
-    fft.fwd(freqbuf,timebuf);
+  vector<T_freq> freqbuf;
+  static FFT<Scalar> fft;
+  fft.fwd(freqbuf, timebuf);
 
-    vector<T_time> timebuf2;
-    fft.inv(timebuf2,freqbuf);
+  vector<T_time> timebuf2;
+  fft.inv(timebuf2, freqbuf);
 
-    T_time rmse = mag2(timebuf - timebuf2) / mag2(timebuf);
-    cout << "roundtrip rmse: " << rmse << endl;
+  T_time rmse = mag2(timebuf - timebuf2) / mag2(timebuf);
+  cout << "roundtrip rmse: " << rmse << endl;
 }
 
 template <typename T_scalar>
-void two_demos(int nfft)
-{
-    cout << "     scalar ";
-    fwd_inv<T_scalar,std::complex<T_scalar> >(nfft);
-    cout << "    complex ";
-    fwd_inv<std::complex<T_scalar>,std::complex<T_scalar> >(nfft);
+void two_demos(int nfft) {
+  cout << "     scalar ";
+  fwd_inv<T_scalar, std::complex<T_scalar> >(nfft);
+  cout << "    complex ";
+  fwd_inv<std::complex<T_scalar>, std::complex<T_scalar> >(nfft);
 }
 
-void demo_all_types(int nfft)
-{
-    cout << "nfft=" << nfft << endl;
-    cout << "   float" << endl;
-    two_demos<float>(nfft);
-    cout << "   double" << endl;
-    two_demos<double>(nfft);
-    cout << "   long double" << endl;
-    two_demos<long double>(nfft);
+void demo_all_types(int nfft) {
+  cout << "nfft=" << nfft << endl;
+  cout << "   float" << endl;
+  two_demos<float>(nfft);
+  cout << "   double" << endl;
+  two_demos<double>(nfft);
+  cout << "   long double" << endl;
+  two_demos<long double>(nfft);
 }
 
-int main()
-{
-    demo_all_types( 2*3*4*5*7 );
-    demo_all_types( 2*9*16*25 );
-    demo_all_types( 1024 );
-    return 0;
+int main() {
+  demo_all_types(2 * 3 * 4 * 5 * 7);
+  demo_all_types(2 * 9 * 16 * 25);
+  demo_all_types(1024);
+  return 0;
 }
diff --git a/unsupported/doc/examples/MatrixExponential.cpp b/unsupported/doc/examples/MatrixExponential.cpp
index ebd3b96..eab7a5e 100644
--- a/unsupported/doc/examples/MatrixExponential.cpp
+++ b/unsupported/doc/examples/MatrixExponential.cpp
@@ -3,14 +3,11 @@
 
 using namespace Eigen;
 
-int main()
-{
+int main() {
   const double pi = std::acos(-1.0);
 
-  MatrixXd A(3,3);
-  A << 0,    -pi/4, 0,
-       pi/4, 0,     0,
-       0,    0,     0;
+  MatrixXd A(3, 3);
+  A << 0, -pi / 4, 0, pi / 4, 0, 0, 0, 0, 0;
   std::cout << "The matrix A is:\n" << A << "\n\n";
   std::cout << "The matrix exponential of A is:\n" << A.exp() << "\n\n";
 }
diff --git a/unsupported/doc/examples/MatrixFunction.cpp b/unsupported/doc/examples/MatrixFunction.cpp
index a4172e4..d72f62a 100644
--- a/unsupported/doc/examples/MatrixFunction.cpp
+++ b/unsupported/doc/examples/MatrixFunction.cpp
@@ -3,21 +3,14 @@
 
 using namespace Eigen;
 
-std::complex<double> expfn(std::complex<double> x, int)
-{
-  return std::exp(x);
-}
+std::complex<double> expfn(std::complex<double> x, int) { return std::exp(x); }
 
-int main()
-{
+int main() {
   const double pi = std::acos(-1.0);
 
-  MatrixXd A(3,3);
-  A << 0,    -pi/4, 0,
-       pi/4, 0,     0,
-       0,    0,     0;
+  MatrixXd A(3, 3);
+  A << 0, -pi / 4, 0, pi / 4, 0, 0, 0, 0, 0;
 
   std::cout << "The matrix A is:\n" << A << "\n\n";
-  std::cout << "The matrix exponential of A is:\n" 
-            << A.matrixFunction(expfn) << "\n\n";
+  std::cout << "The matrix exponential of A is:\n" << A.matrixFunction(expfn) << "\n\n";
 }
diff --git a/unsupported/doc/examples/MatrixLogarithm.cpp b/unsupported/doc/examples/MatrixLogarithm.cpp
index 8c5d970..41b7ff6 100644
--- a/unsupported/doc/examples/MatrixLogarithm.cpp
+++ b/unsupported/doc/examples/MatrixLogarithm.cpp
@@ -3,13 +3,10 @@
 
 using namespace Eigen;
 
-int main()
-{
+int main() {
   using std::sqrt;
-  MatrixXd A(3,3);
-  A << 0.5*sqrt(2), -0.5*sqrt(2), 0,
-       0.5*sqrt(2),  0.5*sqrt(2), 0,
-       0,            0,           1;
+  MatrixXd A(3, 3);
+  A << 0.5 * sqrt(2), -0.5 * sqrt(2), 0, 0.5 * sqrt(2), 0.5 * sqrt(2), 0, 0, 0, 1;
   std::cout << "The matrix A is:\n" << A << "\n\n";
   std::cout << "The matrix logarithm of A is:\n" << A.log() << "\n";
 }
diff --git a/unsupported/doc/examples/MatrixPower.cpp b/unsupported/doc/examples/MatrixPower.cpp
index 2224524..35501b6 100644
--- a/unsupported/doc/examples/MatrixPower.cpp
+++ b/unsupported/doc/examples/MatrixPower.cpp
@@ -3,14 +3,14 @@
 
 using namespace Eigen;
 
-int main()
-{
+int main() {
   const double pi = std::acos(-1.0);
   Matrix3d A;
-  A << cos(1), -sin(1), 0,
-       sin(1),  cos(1), 0,
-	   0 ,      0 , 1;
-  std::cout << "The matrix A is:\n" << A << "\n\n"
-	       "The matrix power A^(pi/4) is:\n" << A.pow(pi/4) << std::endl;
+  A << cos(1), -sin(1), 0, sin(1), cos(1), 0, 0, 0, 1;
+  std::cout << "The matrix A is:\n"
+            << A
+            << "\n\n"
+               "The matrix power A^(pi/4) is:\n"
+            << A.pow(pi / 4) << std::endl;
   return 0;
 }
diff --git a/unsupported/doc/examples/MatrixPower_optimal.cpp b/unsupported/doc/examples/MatrixPower_optimal.cpp
index 86470ba..5f5f3e4 100644
--- a/unsupported/doc/examples/MatrixPower_optimal.cpp
+++ b/unsupported/doc/examples/MatrixPower_optimal.cpp
@@ -3,15 +3,23 @@
 
 using namespace Eigen;
 
-int main()
-{
+int main() {
   Matrix4cd A = Matrix4cd::Random();
   MatrixPower<Matrix4cd> Apow(A);
 
-  std::cout << "The matrix A is:\n" << A << "\n\n"
-	       "A^3.1 is:\n" << Apow(3.1) << "\n\n"
-	       "A^3.3 is:\n" << Apow(3.3) << "\n\n"
-	       "A^3.7 is:\n" << Apow(3.7) << "\n\n"
-	       "A^3.9 is:\n" << Apow(3.9) << std::endl;
+  std::cout << "The matrix A is:\n"
+            << A
+            << "\n\n"
+               "A^3.1 is:\n"
+            << Apow(3.1)
+            << "\n\n"
+               "A^3.3 is:\n"
+            << Apow(3.3)
+            << "\n\n"
+               "A^3.7 is:\n"
+            << Apow(3.7)
+            << "\n\n"
+               "A^3.9 is:\n"
+            << Apow(3.9) << std::endl;
   return 0;
 }
diff --git a/unsupported/doc/examples/MatrixSine.cpp b/unsupported/doc/examples/MatrixSine.cpp
index 9eea9a0..eeafa50 100644
--- a/unsupported/doc/examples/MatrixSine.cpp
+++ b/unsupported/doc/examples/MatrixSine.cpp
@@ -3,9 +3,8 @@
 
 using namespace Eigen;
 
-int main()
-{
-  MatrixXd A = MatrixXd::Random(3,3);
+int main() {
+  MatrixXd A = MatrixXd::Random(3, 3);
   std::cout << "A = \n" << A << "\n\n";
 
   MatrixXd sinA = A.sin();
@@ -13,8 +12,8 @@
 
   MatrixXd cosA = A.cos();
   std::cout << "cos(A) = \n" << cosA << "\n\n";
-  
-  // The matrix functions satisfy sin^2(A) + cos^2(A) = I, 
+
+  // The matrix functions satisfy sin^2(A) + cos^2(A) = I,
   // like the scalar functions.
-  std::cout << "sin^2(A) + cos^2(A) = \n" << sinA*sinA + cosA*cosA << "\n\n";
+  std::cout << "sin^2(A) + cos^2(A) = \n" << sinA * sinA + cosA * cosA << "\n\n";
 }
diff --git a/unsupported/doc/examples/MatrixSinh.cpp b/unsupported/doc/examples/MatrixSinh.cpp
index f771867..1aabbb3 100644
--- a/unsupported/doc/examples/MatrixSinh.cpp
+++ b/unsupported/doc/examples/MatrixSinh.cpp
@@ -3,9 +3,8 @@
 
 using namespace Eigen;
 
-int main()
-{
-  MatrixXf A = MatrixXf::Random(3,3);
+int main() {
+  MatrixXf A = MatrixXf::Random(3, 3);
   std::cout << "A = \n" << A << "\n\n";
 
   MatrixXf sinhA = A.sinh();
@@ -13,8 +12,8 @@
 
   MatrixXf coshA = A.cosh();
   std::cout << "cosh(A) = \n" << coshA << "\n\n";
-  
-  // The matrix functions satisfy cosh^2(A) - sinh^2(A) = I, 
+
+  // The matrix functions satisfy cosh^2(A) - sinh^2(A) = I,
   // like the scalar functions.
-  std::cout << "cosh^2(A) - sinh^2(A) = \n" << coshA*coshA - sinhA*sinhA << "\n\n";
+  std::cout << "cosh^2(A) - sinh^2(A) = \n" << coshA * coshA - sinhA * sinhA << "\n\n";
 }
diff --git a/unsupported/doc/examples/MatrixSquareRoot.cpp b/unsupported/doc/examples/MatrixSquareRoot.cpp
index 88e7557..0ac4fdc 100644
--- a/unsupported/doc/examples/MatrixSquareRoot.cpp
+++ b/unsupported/doc/examples/MatrixSquareRoot.cpp
@@ -3,13 +3,11 @@
 
 using namespace Eigen;
 
-int main()
-{
+int main() {
   const double pi = std::acos(-1.0);
 
-  MatrixXd A(2,2);
-  A << cos(pi/3), -sin(pi/3), 
-       sin(pi/3),  cos(pi/3);
+  MatrixXd A(2, 2);
+  A << cos(pi / 3), -sin(pi / 3), sin(pi / 3), cos(pi / 3);
   std::cout << "The matrix A is:\n" << A << "\n\n";
   std::cout << "The matrix square root of A is:\n" << A.sqrt() << "\n\n";
   std::cout << "The square of the last matrix is:\n" << A.sqrt() * A.sqrt() << "\n";
diff --git a/unsupported/doc/examples/PolynomialSolver1.cpp b/unsupported/doc/examples/PolynomialSolver1.cpp
index cd777a4..c1bf976 100644
--- a/unsupported/doc/examples/PolynomialSolver1.cpp
+++ b/unsupported/doc/examples/PolynomialSolver1.cpp
@@ -5,49 +5,48 @@
 using namespace Eigen;
 using namespace std;
 
-int main()
-{
-  typedef Matrix<double,5,1> Vector5d;
+int main() {
+  typedef Matrix<double, 5, 1> Vector5d;
 
   Vector5d roots = Vector5d::Random();
   cout << "Roots: " << roots.transpose() << endl;
-  Eigen::Matrix<double,6,1> polynomial;
-  roots_to_monicPolynomial( roots, polynomial );
+  Eigen::Matrix<double, 6, 1> polynomial;
+  roots_to_monicPolynomial(roots, polynomial);
 
-  PolynomialSolver<double,5> psolve( polynomial );
+  PolynomialSolver<double, 5> psolve(polynomial);
   cout << "Complex roots: " << psolve.roots().transpose() << endl;
 
   std::vector<double> realRoots;
-  psolve.realRoots( realRoots );
-  Map<Vector5d> mapRR( &realRoots[0] );
+  psolve.realRoots(realRoots);
+  Map<Vector5d> mapRR(&realRoots[0]);
   cout << "Real roots: " << mapRR.transpose() << endl;
 
   cout << endl;
   cout << "Illustration of the convergence problem with the QR algorithm: " << endl;
   cout << "---------------------------------------------------------------" << endl;
-  Eigen::Matrix<float,7,1> hardCase_polynomial;
-  hardCase_polynomial <<
-  -0.957, 0.9219, 0.3516, 0.9453, -0.4023, -0.5508, -0.03125;
+  Eigen::Matrix<float, 7, 1> hardCase_polynomial;
+  hardCase_polynomial << -0.957, 0.9219, 0.3516, 0.9453, -0.4023, -0.5508, -0.03125;
   cout << "Hard case polynomial defined by floats: " << hardCase_polynomial.transpose() << endl;
-  PolynomialSolver<float,6> psolvef( hardCase_polynomial );
+  PolynomialSolver<float, 6> psolvef(hardCase_polynomial);
   cout << "Complex roots: " << psolvef.roots().transpose() << endl;
-  Eigen::Matrix<float,6,1> evals;
-  for( int i=0; i<6; ++i ){ evals[i] = std::abs( poly_eval( hardCase_polynomial, psolvef.roots()[i] ) ); }
+  Eigen::Matrix<float, 6, 1> evals;
+  for (int i = 0; i < 6; ++i) {
+    evals[i] = std::abs(poly_eval(hardCase_polynomial, psolvef.roots()[i]));
+  }
   cout << "Norms of the evaluations of the polynomial at the roots: " << evals.transpose() << endl << endl;
 
   cout << "Using double's almost always solves the problem for small degrees: " << endl;
   cout << "-------------------------------------------------------------------" << endl;
-  PolynomialSolver<double,6> psolve6d( hardCase_polynomial.cast<double>() );
+  PolynomialSolver<double, 6> psolve6d(hardCase_polynomial.cast<double>());
   cout << "Complex roots: " << psolve6d.roots().transpose() << endl;
-  for( int i=0; i<6; ++i )
-  {
-    std::complex<float> castedRoot( psolve6d.roots()[i].real(), psolve6d.roots()[i].imag() );
-    evals[i] = std::abs( poly_eval( hardCase_polynomial, castedRoot ) );
+  for (int i = 0; i < 6; ++i) {
+    std::complex<float> castedRoot(psolve6d.roots()[i].real(), psolve6d.roots()[i].imag());
+    evals[i] = std::abs(poly_eval(hardCase_polynomial, castedRoot));
   }
   cout << "Norms of the evaluations of the polynomial at the roots: " << evals.transpose() << endl << endl;
 
   cout.precision(10);
   cout << "The last root in float then in double: " << psolvef.roots()[5] << "\t" << psolve6d.roots()[5] << endl;
-  std::complex<float> castedRoot( psolve6d.roots()[5].real(), psolve6d.roots()[5].imag() );
-  cout << "Norm of the difference: " << std::abs( psolvef.roots()[5] - castedRoot ) << endl;
+  std::complex<float> castedRoot(psolve6d.roots()[5].real(), psolve6d.roots()[5].imag());
+  cout << "Norm of the difference: " << std::abs(psolvef.roots()[5] - castedRoot) << endl;
 }
diff --git a/unsupported/doc/examples/PolynomialUtils1.cpp b/unsupported/doc/examples/PolynomialUtils1.cpp
index dbfe520..a050b01 100644
--- a/unsupported/doc/examples/PolynomialUtils1.cpp
+++ b/unsupported/doc/examples/PolynomialUtils1.cpp
@@ -4,17 +4,19 @@
 using namespace Eigen;
 using namespace std;
 
-int main()
-{
+int main() {
   Vector4d roots = Vector4d::Random();
   cout << "Roots: " << roots.transpose() << endl;
-  Eigen::Matrix<double,5,1> polynomial;
-  roots_to_monicPolynomial( roots, polynomial );
+  Eigen::Matrix<double, 5, 1> polynomial;
+  roots_to_monicPolynomial(roots, polynomial);
   cout << "Polynomial: ";
-  for( int i=0; i<4; ++i ){ cout << polynomial[i] << ".x^" << i << "+ "; }
+  for (int i = 0; i < 4; ++i) {
+    cout << polynomial[i] << ".x^" << i << "+ ";
+  }
   cout << polynomial[4] << ".x^4" << endl;
   Vector4d evaluation;
-  for( int i=0; i<4; ++i ){
-    evaluation[i] = poly_eval( polynomial, roots[i] ); }
+  for (int i = 0; i < 4; ++i) {
+    evaluation[i] = poly_eval(polynomial, roots[i]);
+  }
   cout << "Evaluation of the polynomial at the roots: " << evaluation.transpose();
 }
diff --git a/unsupported/doc/examples/SYCL/CwiseMul.cpp b/unsupported/doc/examples/SYCL/CwiseMul.cpp
index a7c3314..eac5b46 100644
--- a/unsupported/doc/examples/SYCL/CwiseMul.cpp
+++ b/unsupported/doc/examples/SYCL/CwiseMul.cpp
@@ -7,8 +7,7 @@
 using Eigen::Tensor;
 using Eigen::TensorMap;
 
-int main()
-{
+int main() {
   using DataType = float;
   using IndexType = int64_t;
   constexpr auto DataLayout = Eigen::RowMajor;
@@ -17,7 +16,7 @@
   const auto device_selector = *devices.begin();
   Eigen::QueueInterface queueInterface(device_selector);
   auto sycl_device = Eigen::SyclDevice(&queueInterface);
-  
+
   // create the tensors to be used in the operation
   IndexType sizeDim1 = 3;
   IndexType sizeDim2 = 3;
@@ -25,37 +24,38 @@
   array<IndexType, 3> tensorRange = {{sizeDim1, sizeDim2, sizeDim3}};
 
   // initialize the tensors with the data we want manipulate to
-  Tensor<DataType, 3,DataLayout, IndexType> in1(tensorRange);
-  Tensor<DataType, 3,DataLayout, IndexType> in2(tensorRange);
-  Tensor<DataType, 3,DataLayout, IndexType> out(tensorRange);
+  Tensor<DataType, 3, DataLayout, IndexType> in1(tensorRange);
+  Tensor<DataType, 3, DataLayout, IndexType> in2(tensorRange);
+  Tensor<DataType, 3, DataLayout, IndexType> out(tensorRange);
 
   // set up some random data in the tensors to be multiplied
   in1 = in1.random();
   in2 = in2.random();
 
   // allocate memory for the tensors
-  DataType * gpu_in1_data  = static_cast<DataType*>(sycl_device.allocate(in1.size()*sizeof(DataType)));
-  DataType * gpu_in2_data  = static_cast<DataType*>(sycl_device.allocate(in2.size()*sizeof(DataType)));
-  DataType * gpu_out_data =  static_cast<DataType*>(sycl_device.allocate(out.size()*sizeof(DataType)));
+  DataType* gpu_in1_data = static_cast<DataType*>(sycl_device.allocate(in1.size() * sizeof(DataType)));
+  DataType* gpu_in2_data = static_cast<DataType*>(sycl_device.allocate(in2.size() * sizeof(DataType)));
+  DataType* gpu_out_data = static_cast<DataType*>(sycl_device.allocate(out.size() * sizeof(DataType)));
 
-  // 
+  //
   TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> gpu_in1(gpu_in1_data, tensorRange);
   TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> gpu_in2(gpu_in2_data, tensorRange);
   TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> gpu_out(gpu_out_data, tensorRange);
 
   // copy the memory to the device and do the c=a*b calculation
-  sycl_device.memcpyHostToDevice(gpu_in1_data, in1.data(),(in1.size())*sizeof(DataType));
-  sycl_device.memcpyHostToDevice(gpu_in2_data, in2.data(),(in2.size())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in1_data, in1.data(), (in1.size()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in2_data, in2.data(), (in2.size()) * sizeof(DataType));
   gpu_out.device(sycl_device) = gpu_in1 * gpu_in2;
-  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data,(out.size())*sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data, (out.size()) * sizeof(DataType));
   sycl_device.synchronize();
 
   // print out the results
-   for (IndexType i = 0; i < sizeDim1; ++i) {
+  for (IndexType i = 0; i < sizeDim1; ++i) {
     for (IndexType j = 0; j < sizeDim2; ++j) {
       for (IndexType k = 0; k < sizeDim3; ++k) {
-        std::cout << "device_out" << "(" << i << ", " << j << ", " << k << ") : " << out(i,j,k) 
-                  << " vs host_out" << "(" << i << ", " << j << ", " << k << ") : " << in1(i,j,k) * in2(i,j,k) << "\n";
+        std::cout << "device_out"
+                  << "(" << i << ", " << j << ", " << k << ") : " << out(i, j, k) << " vs host_out"
+                  << "(" << i << ", " << j << ", " << k << ") : " << in1(i, j, k) * in2(i, j, k) << "\n";
       }
     }
   }
diff --git a/unsupported/test/BVH.cpp b/unsupported/test/BVH.cpp
index d8c39d5..54ecc5c 100644
--- a/unsupported/test/BVH.cpp
+++ b/unsupported/test/BVH.cpp
@@ -14,15 +14,16 @@
 
 namespace Eigen {
 
-template<typename Scalar, int Dim> AlignedBox<Scalar, Dim> bounding_box(const Matrix<Scalar, Dim, 1> &v) { return AlignedBox<Scalar, Dim>(v); }
-
+template <typename Scalar, int Dim>
+AlignedBox<Scalar, Dim> bounding_box(const Matrix<Scalar, Dim, 1> &v) {
+  return AlignedBox<Scalar, Dim>(v);
 }
 
+}  // namespace Eigen
 
-template<int Dim>
-struct Ball
-{
-EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(double, Dim)
+template <int Dim>
+struct Ball {
+  EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(double, Dim)
 
   typedef Matrix<double, Dim, 1> VectorType;
 
@@ -32,13 +33,16 @@
   VectorType center;
   double radius;
 };
-template<int Dim> AlignedBox<double, Dim> bounding_box(const Ball<Dim> &b)
-{ return AlignedBox<double, Dim>(b.center.array() - b.radius, b.center.array() + b.radius); }
+template <int Dim>
+AlignedBox<double, Dim> bounding_box(const Ball<Dim> &b) {
+  return AlignedBox<double, Dim>(b.center.array() - b.radius, b.center.array() + b.radius);
+}
 
 inline double SQR(double x) { return x * x; }
 
-template<int Dim>
-struct BallPointStuff //this class provides functions to be both an intersector and a minimizer, both for a ball and a point and for two trees
+template <int Dim>
+struct BallPointStuff  // this class provides functions to be both an intersector and a minimizer, both for a ball and a
+                       // point and for two trees
 {
   typedef double Scalar;
   typedef Matrix<double, Dim, 1> VectorType;
@@ -48,80 +52,110 @@
   BallPointStuff() : calls(0), count(0) {}
   BallPointStuff(const VectorType &inP) : p(inP), calls(0), count(0) {}
 
-
-  bool intersectVolume(const BoxType &r) { ++calls; return r.contains(p); }
+  bool intersectVolume(const BoxType &r) {
+    ++calls;
+    return r.contains(p);
+  }
   bool intersectObject(const BallType &b) {
     ++calls;
-    if((b.center - p).squaredNorm() < SQR(b.radius))
-      ++count;
-    return false; //continue
+    if ((b.center - p).squaredNorm() < SQR(b.radius)) ++count;
+    return false;  // continue
   }
 
-  bool intersectVolumeVolume(const BoxType &r1, const BoxType &r2) { ++calls; return !(r1.intersection(r2)).isNull(); }
-  bool intersectVolumeObject(const BoxType &r, const BallType &b) { ++calls; return r.squaredExteriorDistance(b.center) < SQR(b.radius); }
-  bool intersectObjectVolume(const BallType &b, const BoxType &r) { ++calls; return r.squaredExteriorDistance(b.center) < SQR(b.radius); }
-  bool intersectObjectObject(const BallType &b1, const BallType &b2){
+  bool intersectVolumeVolume(const BoxType &r1, const BoxType &r2) {
     ++calls;
-    if((b1.center - b2.center).norm() < b1.radius + b2.radius)
-      ++count;
+    return !(r1.intersection(r2)).isNull();
+  }
+  bool intersectVolumeObject(const BoxType &r, const BallType &b) {
+    ++calls;
+    return r.squaredExteriorDistance(b.center) < SQR(b.radius);
+  }
+  bool intersectObjectVolume(const BallType &b, const BoxType &r) {
+    ++calls;
+    return r.squaredExteriorDistance(b.center) < SQR(b.radius);
+  }
+  bool intersectObjectObject(const BallType &b1, const BallType &b2) {
+    ++calls;
+    if ((b1.center - b2.center).norm() < b1.radius + b2.radius) ++count;
     return false;
   }
-  bool intersectVolumeObject(const BoxType &r, const VectorType &v) { ++calls; return r.contains(v); }
-  bool intersectObjectObject(const BallType &b, const VectorType &v){
+  bool intersectVolumeObject(const BoxType &r, const VectorType &v) {
     ++calls;
-    if((b.center - v).squaredNorm() < SQR(b.radius))
-      ++count;
+    return r.contains(v);
+  }
+  bool intersectObjectObject(const BallType &b, const VectorType &v) {
+    ++calls;
+    if ((b.center - v).squaredNorm() < SQR(b.radius)) ++count;
     return false;
   }
 
-  double minimumOnVolume(const BoxType &r) { ++calls; return r.squaredExteriorDistance(p); }
-  double minimumOnObject(const BallType &b) { ++calls; return (std::max)(0., (b.center - p).squaredNorm() - SQR(b.radius)); }
-  double minimumOnVolumeVolume(const BoxType &r1, const BoxType &r2) { ++calls; return r1.squaredExteriorDistance(r2); }
-  double minimumOnVolumeObject(const BoxType &r, const BallType &b) { ++calls; return SQR((std::max)(0., r.exteriorDistance(b.center) - b.radius)); }
-  double minimumOnObjectVolume(const BallType &b, const BoxType &r) { ++calls; return SQR((std::max)(0., r.exteriorDistance(b.center) - b.radius)); }
-  double minimumOnObjectObject(const BallType &b1, const BallType &b2){ ++calls; return SQR((std::max)(0., (b1.center - b2.center).norm() - b1.radius - b2.radius)); }
-  double minimumOnVolumeObject(const BoxType &r, const VectorType &v) { ++calls; return r.squaredExteriorDistance(v); }
-  double minimumOnObjectObject(const BallType &b, const VectorType &v){ ++calls; return SQR((std::max)(0., (b.center - v).norm() - b.radius)); }
+  double minimumOnVolume(const BoxType &r) {
+    ++calls;
+    return r.squaredExteriorDistance(p);
+  }
+  double minimumOnObject(const BallType &b) {
+    ++calls;
+    return (std::max)(0., (b.center - p).squaredNorm() - SQR(b.radius));
+  }
+  double minimumOnVolumeVolume(const BoxType &r1, const BoxType &r2) {
+    ++calls;
+    return r1.squaredExteriorDistance(r2);
+  }
+  double minimumOnVolumeObject(const BoxType &r, const BallType &b) {
+    ++calls;
+    return SQR((std::max)(0., r.exteriorDistance(b.center) - b.radius));
+  }
+  double minimumOnObjectVolume(const BallType &b, const BoxType &r) {
+    ++calls;
+    return SQR((std::max)(0., r.exteriorDistance(b.center) - b.radius));
+  }
+  double minimumOnObjectObject(const BallType &b1, const BallType &b2) {
+    ++calls;
+    return SQR((std::max)(0., (b1.center - b2.center).norm() - b1.radius - b2.radius));
+  }
+  double minimumOnVolumeObject(const BoxType &r, const VectorType &v) {
+    ++calls;
+    return r.squaredExteriorDistance(v);
+  }
+  double minimumOnObjectObject(const BallType &b, const VectorType &v) {
+    ++calls;
+    return SQR((std::max)(0., (b.center - v).norm() - b.radius));
+  }
 
   VectorType p;
   int calls;
   int count;
 };
 
-
-template<int Dim>
-struct TreeTest
-{
+template <int Dim>
+struct TreeTest {
   typedef Matrix<double, Dim, 1> VectorType;
   typedef std::vector<VectorType, aligned_allocator<VectorType> > VectorTypeList;
   typedef Ball<Dim> BallType;
   typedef std::vector<BallType, aligned_allocator<BallType> > BallTypeList;
   typedef AlignedBox<double, Dim> BoxType;
 
-  void testIntersect1()
-  {
+  void testIntersect1() {
     BallTypeList b;
-    for(int i = 0; i < 500; ++i) {
-        b.push_back(BallType(VectorType::Random(), 0.5 * internal::random(0., 1.)));
+    for (int i = 0; i < 500; ++i) {
+      b.push_back(BallType(VectorType::Random(), 0.5 * internal::random(0., 1.)));
     }
     KdBVH<double, Dim, BallType> tree(b.begin(), b.end());
 
     VectorType pt = VectorType::Random();
     BallPointStuff<Dim> i1(pt), i2(pt);
 
-    for(int i = 0; i < (int)b.size(); ++i)
-      i1.intersectObject(b[i]);
+    for (int i = 0; i < (int)b.size(); ++i) i1.intersectObject(b[i]);
 
     BVIntersect(tree, i2);
 
     VERIFY(i1.count == i2.count);
   }
 
-  void testMinimize1()
-  {
+  void testMinimize1() {
     BallTypeList b;
-    for(int i = 0; i < 500; ++i) {
-        b.push_back(BallType(VectorType::Random(), 0.01 * internal::random(0., 1.)));
+    for (int i = 0; i < 500; ++i) {
+      b.push_back(BallType(VectorType::Random(), 0.01 * internal::random(0., 1.)));
     }
     KdBVH<double, Dim, BallType> tree(b.begin(), b.end());
 
@@ -130,23 +164,20 @@
 
     double m1 = (std::numeric_limits<double>::max)(), m2 = m1;
 
-    for(int i = 0; i < (int)b.size(); ++i)
-      m1 = (std::min)(m1, i1.minimumOnObject(b[i]));
+    for (int i = 0; i < (int)b.size(); ++i) m1 = (std::min)(m1, i1.minimumOnObject(b[i]));
 
     m2 = BVMinimize(tree, i2);
 
     VERIFY_IS_APPROX(m1, m2);
   }
 
-  void testIntersect2()
-  {
+  void testIntersect2() {
     BallTypeList b;
     VectorTypeList v;
 
-    for(int i = 0; i < 50; ++i) {
-        b.push_back(BallType(VectorType::Random(), 0.5 * internal::random(0., 1.)));
-        for(int j = 0; j < 3; ++j)
-            v.push_back(VectorType::Random());
+    for (int i = 0; i < 50; ++i) {
+      b.push_back(BallType(VectorType::Random(), 0.5 * internal::random(0., 1.)));
+      for (int j = 0; j < 3; ++j) v.push_back(VectorType::Random());
     }
 
     KdBVH<double, Dim, BallType> tree(b.begin(), b.end());
@@ -154,24 +185,21 @@
 
     BallPointStuff<Dim> i1, i2;
 
-    for(int i = 0; i < (int)b.size(); ++i)
-        for(int j = 0; j < (int)v.size(); ++j)
-            i1.intersectObjectObject(b[i], v[j]);
+    for (int i = 0; i < (int)b.size(); ++i)
+      for (int j = 0; j < (int)v.size(); ++j) i1.intersectObjectObject(b[i], v[j]);
 
     BVIntersect(tree, vTree, i2);
 
     VERIFY(i1.count == i2.count);
   }
 
-  void testMinimize2()
-  {
+  void testMinimize2() {
     BallTypeList b;
     VectorTypeList v;
 
-    for(int i = 0; i < 50; ++i) {
-        b.push_back(BallType(VectorType::Random(), 1e-7 + 1e-6 * internal::random(0., 1.)));
-        for(int j = 0; j < 3; ++j)
-            v.push_back(VectorType::Random());
+    for (int i = 0; i < 50; ++i) {
+      b.push_back(BallType(VectorType::Random(), 1e-7 + 1e-6 * internal::random(0., 1.)));
+      for (int j = 0; j < 3; ++j) v.push_back(VectorType::Random());
     }
 
     KdBVH<double, Dim, BallType> tree(b.begin(), b.end());
@@ -181,9 +209,8 @@
 
     double m1 = (std::numeric_limits<double>::max)(), m2 = m1;
 
-    for(int i = 0; i < (int)b.size(); ++i)
-        for(int j = 0; j < (int)v.size(); ++j)
-            m1 = (std::min)(m1, i1.minimumOnObjectObject(b[i], v[j]));
+    for (int i = 0; i < (int)b.size(); ++i)
+      for (int j = 0; j < (int)v.size(); ++j) m1 = (std::min)(m1, i1.minimumOnObjectObject(b[i], v[j]));
 
     m2 = BVMinimize(tree, vTree, i2);
 
@@ -191,10 +218,8 @@
   }
 };
 
-
-EIGEN_DECLARE_TEST(BVH)
-{
-  for(int i = 0; i < g_repeat; i++) {
+EIGEN_DECLARE_TEST(BVH) {
+  for (int i = 0; i < g_repeat; i++) {
 #ifdef EIGEN_TEST_PART_1
     TreeTest<2> test2;
     CALL_SUBTEST(test2.testIntersect1());
diff --git a/unsupported/test/EulerAngles.cpp b/unsupported/test/EulerAngles.cpp
index 8452577..a65e5f5 100644
--- a/unsupported/test/EulerAngles.cpp
+++ b/unsupported/test/EulerAngles.cpp
@@ -17,67 +17,55 @@
 
 // Unfortunately, we need to specialize it in order to work. (We could add it in main.h test framework)
 template <typename Scalar, class System>
-bool verifyIsApprox(const Eigen::EulerAngles<Scalar, System>& a, const Eigen::EulerAngles<Scalar, System>& b)
-{
+bool verifyIsApprox(const Eigen::EulerAngles<Scalar, System>& a, const Eigen::EulerAngles<Scalar, System>& b) {
   return verifyIsApprox(a.angles(), b.angles());
 }
 
 // Verify that x is in the approxed range [a, b]
-#define VERIFY_APPROXED_RANGE(a, x, b) \
-  do { \
-  VERIFY_IS_APPROX_OR_LESS_THAN(a, x); \
-  VERIFY_IS_APPROX_OR_LESS_THAN(x, b); \
-  } while(0)
+#define VERIFY_APPROXED_RANGE(a, x, b)   \
+  do {                                   \
+    VERIFY_IS_APPROX_OR_LESS_THAN(a, x); \
+    VERIFY_IS_APPROX_OR_LESS_THAN(x, b); \
+  } while (0)
 
 const char X = EULER_X;
 const char Y = EULER_Y;
 const char Z = EULER_Z;
 
-template<typename Scalar, class EulerSystem>
-void verify_euler(const EulerAngles<Scalar, EulerSystem>& e)
-{
+template <typename Scalar, class EulerSystem>
+void verify_euler(const EulerAngles<Scalar, EulerSystem>& e) {
   typedef EulerAngles<Scalar, EulerSystem> EulerAnglesType;
-  typedef Matrix<Scalar,3,3> Matrix3;
-  typedef Matrix<Scalar,3,1> Vector3;
+  typedef Matrix<Scalar, 3, 3> Matrix3;
+  typedef Matrix<Scalar, 3, 1> Vector3;
   typedef Quaternion<Scalar> QuaternionType;
   typedef AngleAxis<Scalar> AngleAxisType;
-  
+
   const Scalar ONE = Scalar(1);
   const Scalar HALF_PI = Scalar(EIGEN_PI / 2);
   const Scalar PI = Scalar(EIGEN_PI);
-  
+
   // It's very important calc the acceptable precision depending on the distance from the pole.
-  const Scalar longitudeRadius = std::abs(
-    EulerSystem::IsTaitBryan ?
-    std::cos(e.beta()) :
-    std::sin(e.beta())
-    );
+  const Scalar longitudeRadius = std::abs(EulerSystem::IsTaitBryan ? std::cos(e.beta()) : std::sin(e.beta()));
   Scalar precision = test_precision<Scalar>() / longitudeRadius;
-  
+
   Scalar betaRangeStart, betaRangeEnd;
-  if (EulerSystem::IsTaitBryan)
-  {
+  if (EulerSystem::IsTaitBryan) {
     betaRangeStart = -HALF_PI;
     betaRangeEnd = HALF_PI;
-  }
-  else
-  {
-    if (!EulerSystem::IsBetaOpposite)
-    {
+  } else {
+    if (!EulerSystem::IsBetaOpposite) {
       betaRangeStart = 0;
       betaRangeEnd = PI;
-    }
-    else
-    {
+    } else {
       betaRangeStart = -PI;
       betaRangeEnd = 0;
     }
   }
-  
+
   const Vector3 I_ = EulerAnglesType::AlphaAxisVector();
   const Vector3 J_ = EulerAnglesType::BetaAxisVector();
   const Vector3 K_ = EulerAnglesType::GammaAxisVector();
-  
+
   // Is approx checks
   VERIFY(e.isApprox(e));
   VERIFY_IS_APPROX(e, e);
@@ -87,19 +75,19 @@
   VERIFY_IS_APPROX(Scalar(m.determinant()), ONE);
 
   EulerAnglesType ebis(m);
-  
+
   // When no roll(acting like polar representation), we have the best precision.
   // One of those cases is when the Euler angles are on the pole, and because it's singular case,
   //  the computation returns no roll.
-  if (ebis.beta() == 0)
-    precision = test_precision<Scalar>();
-  
+  if (ebis.beta() == 0) precision = test_precision<Scalar>();
+
   // Check that eabis in range
   VERIFY_APPROXED_RANGE(-PI, ebis.alpha(), PI);
   VERIFY_APPROXED_RANGE(betaRangeStart, ebis.beta(), betaRangeEnd);
   VERIFY_APPROXED_RANGE(-PI, ebis.gamma(), PI);
 
-  const Matrix3 mbis(AngleAxisType(ebis.alpha(), I_) * AngleAxisType(ebis.beta(), J_) * AngleAxisType(ebis.gamma(), K_));
+  const Matrix3 mbis(AngleAxisType(ebis.alpha(), I_) * AngleAxisType(ebis.beta(), J_) *
+                     AngleAxisType(ebis.gamma(), K_));
   VERIFY_IS_APPROX(Scalar(mbis.determinant()), ONE);
   VERIFY_IS_APPROX(mbis, ebis.toRotationMatrix());
   /*std::cout << "===================\n" <<
@@ -120,104 +108,101 @@
   // TODO: Make this test work well, and use range saturation function.
   /*// If I==K, and ea[1]==0, then there no unique solution.
   // The remark apply in the case where I!=K, and |ea[1]| is close to +-pi/2.
-  if( (i!=k || ea[1]!=0) && (i==k || !internal::isApprox(abs(ea[1]),Scalar(EIGEN_PI/2),test_precision<Scalar>())) ) 
+  if( (i!=k || ea[1]!=0) && (i==k || !internal::isApprox(abs(ea[1]),Scalar(EIGEN_PI/2),test_precision<Scalar>())) )
       VERIFY_IS_APPROX(ea, eabis);*/
-  
+
   // Quaternions
   const QuaternionType q(e);
   ebis = q;
   const QuaternionType qbis(ebis);
   VERIFY(internal::isApprox<Scalar>(std::abs(q.dot(qbis)), ONE, precision));
-  //VERIFY_IS_APPROX(eabis, eabis2);// Verify that the euler angles are still the same
-  
+  // VERIFY_IS_APPROX(eabis, eabis2);// Verify that the euler angles are still the same
+
   // A suggestion for simple product test when will be supported.
   /*EulerAnglesType e2(PI/2, PI/2, PI/2);
   Matrix3 m2(e2);
   VERIFY_IS_APPROX(e*e2, m*m2);*/
 }
 
-template<signed char A, signed char B, signed char C, typename Scalar>
-void verify_euler_vec(const Matrix<Scalar,3,1>& ea)
-{
+template <signed char A, signed char B, signed char C, typename Scalar>
+void verify_euler_vec(const Matrix<Scalar, 3, 1>& ea) {
   verify_euler(EulerAngles<Scalar, EulerSystem<A, B, C> >(ea[0], ea[1], ea[2]));
 }
 
-template<signed char A, signed char B, signed char C, typename Scalar>
-void verify_euler_all_neg(const Matrix<Scalar,3,1>& ea)
-{
-  verify_euler_vec<+A,+B,+C>(ea);
-  verify_euler_vec<+A,+B,-C>(ea);
-  verify_euler_vec<+A,-B,+C>(ea);
-  verify_euler_vec<+A,-B,-C>(ea);
-  
-  verify_euler_vec<-A,+B,+C>(ea);
-  verify_euler_vec<-A,+B,-C>(ea);
-  verify_euler_vec<-A,-B,+C>(ea);
-  verify_euler_vec<-A,-B,-C>(ea);
+template <signed char A, signed char B, signed char C, typename Scalar>
+void verify_euler_all_neg(const Matrix<Scalar, 3, 1>& ea) {
+  verify_euler_vec<+A, +B, +C>(ea);
+  verify_euler_vec<+A, +B, -C>(ea);
+  verify_euler_vec<+A, -B, +C>(ea);
+  verify_euler_vec<+A, -B, -C>(ea);
+
+  verify_euler_vec<-A, +B, +C>(ea);
+  verify_euler_vec<-A, +B, -C>(ea);
+  verify_euler_vec<-A, -B, +C>(ea);
+  verify_euler_vec<-A, -B, -C>(ea);
 }
 
-template<typename Scalar> void check_all_var(const Matrix<Scalar,3,1>& ea)
-{
-  verify_euler_all_neg<X,Y,Z>(ea);
-  verify_euler_all_neg<X,Y,X>(ea);
-  verify_euler_all_neg<X,Z,Y>(ea);
-  verify_euler_all_neg<X,Z,X>(ea);
-  
-  verify_euler_all_neg<Y,Z,X>(ea);
-  verify_euler_all_neg<Y,Z,Y>(ea);
-  verify_euler_all_neg<Y,X,Z>(ea);
-  verify_euler_all_neg<Y,X,Y>(ea);
-  
-  verify_euler_all_neg<Z,X,Y>(ea);
-  verify_euler_all_neg<Z,X,Z>(ea);
-  verify_euler_all_neg<Z,Y,X>(ea);
-  verify_euler_all_neg<Z,Y,Z>(ea);
+template <typename Scalar>
+void check_all_var(const Matrix<Scalar, 3, 1>& ea) {
+  verify_euler_all_neg<X, Y, Z>(ea);
+  verify_euler_all_neg<X, Y, X>(ea);
+  verify_euler_all_neg<X, Z, Y>(ea);
+  verify_euler_all_neg<X, Z, X>(ea);
+
+  verify_euler_all_neg<Y, Z, X>(ea);
+  verify_euler_all_neg<Y, Z, Y>(ea);
+  verify_euler_all_neg<Y, X, Z>(ea);
+  verify_euler_all_neg<Y, X, Y>(ea);
+
+  verify_euler_all_neg<Z, X, Y>(ea);
+  verify_euler_all_neg<Z, X, Z>(ea);
+  verify_euler_all_neg<Z, Y, X>(ea);
+  verify_euler_all_neg<Z, Y, Z>(ea);
 }
 
-template<typename Scalar> void check_singular_cases(const Scalar& singularBeta)
-{
-  typedef Matrix<Scalar,3,1> Vector3;
+template <typename Scalar>
+void check_singular_cases(const Scalar& singularBeta) {
+  typedef Matrix<Scalar, 3, 1> Vector3;
   const Scalar PI = Scalar(EIGEN_PI);
-  
-  for (Scalar epsilon = NumTraits<Scalar>::epsilon(); epsilon < 1; epsilon *= Scalar(1.2))
-  {
-    check_all_var(Vector3(PI/4, singularBeta, PI/3));
-    check_all_var(Vector3(PI/4, singularBeta - epsilon, PI/3));
-    check_all_var(Vector3(PI/4, singularBeta - Scalar(1.5)*epsilon, PI/3));
-    check_all_var(Vector3(PI/4, singularBeta - 2*epsilon, PI/3));
-    check_all_var(Vector3(PI*Scalar(0.8), singularBeta - epsilon, Scalar(0.9)*PI));
-    check_all_var(Vector3(PI*Scalar(-0.9), singularBeta + epsilon, PI*Scalar(0.3)));
-    check_all_var(Vector3(PI*Scalar(-0.6), singularBeta + Scalar(1.5)*epsilon, PI*Scalar(0.3)));
-    check_all_var(Vector3(PI*Scalar(-0.5), singularBeta + 2*epsilon, PI*Scalar(0.4)));
-    check_all_var(Vector3(PI*Scalar(0.9), singularBeta + epsilon, Scalar(0.8)*PI));
+
+  for (Scalar epsilon = NumTraits<Scalar>::epsilon(); epsilon < 1; epsilon *= Scalar(1.2)) {
+    check_all_var(Vector3(PI / 4, singularBeta, PI / 3));
+    check_all_var(Vector3(PI / 4, singularBeta - epsilon, PI / 3));
+    check_all_var(Vector3(PI / 4, singularBeta - Scalar(1.5) * epsilon, PI / 3));
+    check_all_var(Vector3(PI / 4, singularBeta - 2 * epsilon, PI / 3));
+    check_all_var(Vector3(PI * Scalar(0.8), singularBeta - epsilon, Scalar(0.9) * PI));
+    check_all_var(Vector3(PI * Scalar(-0.9), singularBeta + epsilon, PI * Scalar(0.3)));
+    check_all_var(Vector3(PI * Scalar(-0.6), singularBeta + Scalar(1.5) * epsilon, PI * Scalar(0.3)));
+    check_all_var(Vector3(PI * Scalar(-0.5), singularBeta + 2 * epsilon, PI * Scalar(0.4)));
+    check_all_var(Vector3(PI * Scalar(0.9), singularBeta + epsilon, Scalar(0.8) * PI));
   }
-  
+
   // This one for sanity, it had a problem with near pole cases in float scalar.
-  check_all_var(Vector3(PI*Scalar(0.8), singularBeta - Scalar(1E-6), Scalar(0.9)*PI));
+  check_all_var(Vector3(PI * Scalar(0.8), singularBeta - Scalar(1E-6), Scalar(0.9) * PI));
 }
 
-template<typename Scalar> void eulerangles_manual()
-{
-  typedef Matrix<Scalar,3,1> Vector3;
-  typedef Matrix<Scalar,Dynamic,1> VectorX;
+template <typename Scalar>
+void eulerangles_manual() {
+  typedef Matrix<Scalar, 3, 1> Vector3;
+  typedef Matrix<Scalar, Dynamic, 1> VectorX;
   const Vector3 Zero = Vector3::Zero();
   const Scalar PI = Scalar(EIGEN_PI);
-  
+
   check_all_var(Zero);
-  
+
   // singular cases
-  check_singular_cases(PI/2);
-  check_singular_cases(-PI/2);
-  
+  check_singular_cases(PI / 2);
+  check_singular_cases(-PI / 2);
+
   check_singular_cases(Scalar(0));
   check_singular_cases(Scalar(-0));
-  
+
   check_singular_cases(PI);
   check_singular_cases(-PI);
-  
+
   // non-singular cases
   VectorX alpha = VectorX::LinSpaced(20, Scalar(-0.99) * PI, PI);
-  VectorX beta =  VectorX::LinSpaced(20, Scalar(-0.49) * PI, Scalar(0.49) * PI);
+  VectorX beta = VectorX::LinSpaced(20, Scalar(-0.49) * PI, Scalar(0.49) * PI);
   VectorX gamma = VectorX::LinSpaced(20, Scalar(-0.99) * PI, PI);
   for (int i = 0; i < alpha.size(); ++i) {
     for (int j = 0; j < beta.size(); ++j) {
@@ -228,11 +213,11 @@
   }
 }
 
-template<typename Scalar> void eulerangles_rand()
-{
-  typedef Matrix<Scalar,3,3> Matrix3;
-  typedef Matrix<Scalar,3,1> Vector3;
-  typedef Array<Scalar,3,1> Array3;
+template <typename Scalar>
+void eulerangles_rand() {
+  typedef Matrix<Scalar, 3, 3> Matrix3;
+  typedef Matrix<Scalar, 3, 1> Vector3;
+  typedef Array<Scalar, 3, 1> Array3;
   typedef Quaternion<Scalar> Quaternionx;
   typedef AngleAxis<Scalar> AngleAxisType;
 
@@ -241,42 +226,41 @@
   q1 = AngleAxisType(a, Vector3::Random().normalized());
   Matrix3 m;
   m = q1;
-  
-  Vector3 ea = m.eulerAngles(0,1,2);
+
+  Vector3 ea = m.eulerAngles(0, 1, 2);
   check_all_var(ea);
-  ea = m.eulerAngles(0,1,0);
+  ea = m.eulerAngles(0, 1, 0);
   check_all_var(ea);
-  
+
   // Check with purely random Quaternion:
   q1.coeffs() = Quaternionx::Coefficients::Random().normalized();
   m = q1;
-  ea = m.eulerAngles(0,1,2);
+  ea = m.eulerAngles(0, 1, 2);
   check_all_var(ea);
-  ea = m.eulerAngles(0,1,0);
+  ea = m.eulerAngles(0, 1, 0);
   check_all_var(ea);
-  
+
   // Check with random angles in range [0:pi]x[-pi:pi]x[-pi:pi].
-  ea = (Array3::Random() + Array3(1,0,0))*Scalar(EIGEN_PI)*Array3(0.5,1,1);
+  ea = (Array3::Random() + Array3(1, 0, 0)) * Scalar(EIGEN_PI) * Array3(0.5, 1, 1);
   check_all_var(ea);
-  
-  ea[2] = ea[0] = internal::random<Scalar>(0,Scalar(EIGEN_PI));
+
+  ea[2] = ea[0] = internal::random<Scalar>(0, Scalar(EIGEN_PI));
   check_all_var(ea);
-  
-  ea[0] = ea[1] = internal::random<Scalar>(0,Scalar(EIGEN_PI));
+
+  ea[0] = ea[1] = internal::random<Scalar>(0, Scalar(EIGEN_PI));
   check_all_var(ea);
-  
+
   ea[1] = 0;
   check_all_var(ea);
-  
+
   ea.head(2).setZero();
   check_all_var(ea);
-  
+
   ea.setZero();
   check_all_var(ea);
 }
 
-EIGEN_DECLARE_TEST(EulerAngles)
-{
+EIGEN_DECLARE_TEST(EulerAngles) {
   // Simple cast test
   EulerAnglesXYZd onesEd(1, 1, 1);
   EulerAnglesXYZf onesEf = onesEd.cast<float>();
@@ -284,15 +268,15 @@
 
   // Simple Construction from Vector3 test
   VERIFY_IS_APPROX(onesEd, EulerAnglesXYZd(Vector3d::Ones()));
-  
-  CALL_SUBTEST_1( eulerangles_manual<float>() );
-  CALL_SUBTEST_2( eulerangles_manual<double>() );
-  
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_3( eulerangles_rand<float>() );
-    CALL_SUBTEST_4( eulerangles_rand<double>() );
+
+  CALL_SUBTEST_1(eulerangles_manual<float>());
+  CALL_SUBTEST_2(eulerangles_manual<double>());
+
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_3(eulerangles_rand<float>());
+    CALL_SUBTEST_4(eulerangles_rand<double>());
   }
-  
+
   // TODO: Add tests for auto diff
   // TODO: Add tests for complex numbers
 }
diff --git a/unsupported/test/FFTW.cpp b/unsupported/test/FFTW.cpp
index d69867c..7302196 100644
--- a/unsupported/test/FFTW.cpp
+++ b/unsupported/test/FFTW.cpp
@@ -1,2 +1,2 @@
-#define EIGEN_FFTW_DEFAULT 1 
+#define EIGEN_FFTW_DEFAULT 1
 #include "fft_test_shared.h"
diff --git a/unsupported/test/NNLS.cpp b/unsupported/test/NNLS.cpp
index 58092ef..f01b562 100644
--- a/unsupported/test/NNLS.cpp
+++ b/unsupported/test/NNLS.cpp
@@ -12,7 +12,6 @@
 #include "main.h"
 #include <unsupported/Eigen/NNLS>
 
-
 /// Check that 'x' solves the NNLS optimization problem `min ||A*x-b|| s.t. 0 <= x`.
 /// The \p tolerance parameter is the absolute tolerance on the gradient, A'*(A*x-b).
 template <typename MatrixType, typename VectorB, typename VectorX, typename Scalar>
@@ -54,7 +53,7 @@
 }
 
 template <typename MatrixType>
-void test_nnls_random_problem(const MatrixType&) {
+void test_nnls_random_problem(const MatrixType &) {
   //
   // SETUP
   //
diff --git a/unsupported/test/NonLinearOptimization.cpp b/unsupported/test/NonLinearOptimization.cpp
index aaa96ec..c847420 100644
--- a/unsupported/test/NonLinearOptimization.cpp
+++ b/unsupported/test/NonLinearOptimization.cpp
@@ -15,59 +15,56 @@
 // tolerance for checking number of iterations
 #define LM_EVAL_COUNT_TOL 2
 
-#define LM_CHECK_N_ITERS(SOLVER,NFEV,NJEV) { \
-            VERIFY(SOLVER.nfev <= NFEV * LM_EVAL_COUNT_TOL); \
-            VERIFY(SOLVER.njev <= NJEV * LM_EVAL_COUNT_TOL); \
-        }
+#define LM_CHECK_N_ITERS(SOLVER, NFEV, NJEV)         \
+  {                                                  \
+    VERIFY(SOLVER.nfev <= NFEV * LM_EVAL_COUNT_TOL); \
+    VERIFY(SOLVER.njev <= NJEV * LM_EVAL_COUNT_TOL); \
+  }
 
-int fcn_chkder(const VectorXd &x, VectorXd &fvec, MatrixXd &fjac, int iflag)
-{
-    /*      subroutine fcn for chkder example. */
+int fcn_chkder(const VectorXd &x, VectorXd &fvec, MatrixXd &fjac, int iflag) {
+  /*      subroutine fcn for chkder example. */
 
-    int i;
-    assert(15 ==  fvec.size());
-    assert(3 ==  x.size());
-    double tmp1, tmp2, tmp3, tmp4;
-    static const double y[15]={1.4e-1, 1.8e-1, 2.2e-1, 2.5e-1, 2.9e-1, 3.2e-1, 3.5e-1,
-        3.9e-1, 3.7e-1, 5.8e-1, 7.3e-1, 9.6e-1, 1.34, 2.1, 4.39};
+  int i;
+  assert(15 == fvec.size());
+  assert(3 == x.size());
+  double tmp1, tmp2, tmp3, tmp4;
+  static const double y[15] = {1.4e-1, 1.8e-1, 2.2e-1, 2.5e-1, 2.9e-1, 3.2e-1, 3.5e-1, 3.9e-1,
+                               3.7e-1, 5.8e-1, 7.3e-1, 9.6e-1, 1.34,   2.1,    4.39};
 
+  if (iflag == 0) return 0;
 
-    if (iflag == 0)
-        return 0;
-
-    if (iflag != 2)
-        for (i=0; i<15; i++) {
-            tmp1 = i+1;
-            tmp2 = 16-i-1;
-            tmp3 = tmp1;
-            if (i >= 8) tmp3 = tmp2;
-            fvec[i] = y[i] - (x[0] + tmp1/(x[1]*tmp2 + x[2]*tmp3));
-        }
-    else {
-        for (i = 0; i < 15; i++) {
-            tmp1 = i+1;
-            tmp2 = 16-i-1;
-
-            /* error introduced into next statement for illustration. */
-            /* corrected statement should read    tmp3 = tmp1 . */
-
-            tmp3 = tmp2;
-            if (i >= 8) tmp3 = tmp2;
-            tmp4 = (x[1]*tmp2 + x[2]*tmp3); tmp4=tmp4*tmp4;
-            fjac(i,0) = -1.;
-            fjac(i,1) = tmp1*tmp2/tmp4;
-            fjac(i,2) = tmp1*tmp3/tmp4;
-        }
+  if (iflag != 2)
+    for (i = 0; i < 15; i++) {
+      tmp1 = i + 1;
+      tmp2 = 16 - i - 1;
+      tmp3 = tmp1;
+      if (i >= 8) tmp3 = tmp2;
+      fvec[i] = y[i] - (x[0] + tmp1 / (x[1] * tmp2 + x[2] * tmp3));
     }
-    return 0;
+  else {
+    for (i = 0; i < 15; i++) {
+      tmp1 = i + 1;
+      tmp2 = 16 - i - 1;
+
+      /* error introduced into next statement for illustration. */
+      /* corrected statement should read    tmp3 = tmp1 . */
+
+      tmp3 = tmp2;
+      if (i >= 8) tmp3 = tmp2;
+      tmp4 = (x[1] * tmp2 + x[2] * tmp3);
+      tmp4 = tmp4 * tmp4;
+      fjac(i, 0) = -1.;
+      fjac(i, 1) = tmp1 * tmp2 / tmp4;
+      fjac(i, 2) = tmp1 * tmp3 / tmp4;
+    }
+  }
+  return 0;
 }
 
-
-void testChkder()
-{
-  const int m=15, n=3;
+void testChkder() {
+  const int m = 15, n = 3;
   VectorXd x(n), fvec(m), xp, fvecp(m), err;
-  MatrixXd fjac(m,n);
+  MatrixXd fjac(m, n);
   VectorXi ipvt;
 
   /*      the following values should be suitable for */
@@ -84,24 +81,11 @@
 
   // check those
   VectorXd fvec_ref(m), fvecp_ref(m), err_ref(m);
-  fvec_ref <<
-      -1.181606, -1.429655, -1.606344,
-      -1.745269, -1.840654, -1.921586,
-      -1.984141, -2.022537, -2.468977,
-      -2.827562, -3.473582, -4.437612,
-      -6.047662, -9.267761, -18.91806;
-  fvecp_ref <<
-      -7.724666e-09, -3.432406e-09, -2.034843e-10,
-      2.313685e-09,  4.331078e-09,  5.984096e-09,
-      7.363281e-09,   8.53147e-09,  1.488591e-08,
-      2.33585e-08,  3.522012e-08,  5.301255e-08,
-      8.26666e-08,  1.419747e-07,   3.19899e-07;
-  err_ref <<
-      0.1141397,  0.09943516,  0.09674474,
-      0.09980447,  0.1073116, 0.1220445,
-      0.1526814, 1, 1,
-      1, 1, 1,
-      1, 1, 1;
+  fvec_ref << -1.181606, -1.429655, -1.606344, -1.745269, -1.840654, -1.921586, -1.984141, -2.022537, -2.468977,
+      -2.827562, -3.473582, -4.437612, -6.047662, -9.267761, -18.91806;
+  fvecp_ref << -7.724666e-09, -3.432406e-09, -2.034843e-10, 2.313685e-09, 4.331078e-09, 5.984096e-09, 7.363281e-09,
+      8.53147e-09, 1.488591e-08, 2.33585e-08, 3.522012e-08, 5.301255e-08, 8.26666e-08, 1.419747e-07, 3.19899e-07;
+  err_ref << 0.1141397, 0.09943516, 0.09674474, 0.09980447, 0.1073116, 0.1220445, 0.1526814, 1, 1, 1, 1, 1, 1, 1, 1;
 
   VERIFY_IS_APPROX(fvec, fvec_ref);
   VERIFY_IS_APPROX(fvecp, fvecp_ref);
@@ -109,17 +93,13 @@
 }
 
 // Generic functor
-template<typename Scalar_, int NX=Dynamic, int NY=Dynamic>
-struct Functor
-{
+template <typename Scalar_, int NX = Dynamic, int NY = Dynamic>
+struct Functor {
   typedef Scalar_ Scalar;
-  enum {
-    InputsAtCompileTime = NX,
-    ValuesAtCompileTime = NY
-  };
-  typedef Matrix<Scalar,InputsAtCompileTime,1> InputType;
-  typedef Matrix<Scalar,ValuesAtCompileTime,1> ValueType;
-  typedef Matrix<Scalar,ValuesAtCompileTime,InputsAtCompileTime> JacobianType;
+  enum { InputsAtCompileTime = NX, ValuesAtCompileTime = NY };
+  typedef Matrix<Scalar, InputsAtCompileTime, 1> InputType;
+  typedef Matrix<Scalar, ValuesAtCompileTime, 1> ValueType;
+  typedef Matrix<Scalar, ValuesAtCompileTime, InputsAtCompileTime> JacobianType;
 
   const int m_inputs, m_values;
 
@@ -130,48 +110,43 @@
   int values() const { return m_values; }
 
   // you should define that in the subclass :
-//  void operator() (const InputType& x, ValueType* v, JacobianType* _j=0) const;
+  //  void operator() (const InputType& x, ValueType* v, JacobianType* _j=0) const;
 };
 
-struct lmder_functor : Functor<double>
-{
-    lmder_functor(void): Functor<double>(3,15) {}
-    int operator()(const VectorXd &x, VectorXd &fvec) const
-    {
-        double tmp1, tmp2, tmp3;
-        static const double y[15] = {1.4e-1, 1.8e-1, 2.2e-1, 2.5e-1, 2.9e-1, 3.2e-1, 3.5e-1,
-            3.9e-1, 3.7e-1, 5.8e-1, 7.3e-1, 9.6e-1, 1.34, 2.1, 4.39};
+struct lmder_functor : Functor<double> {
+  lmder_functor(void) : Functor<double>(3, 15) {}
+  int operator()(const VectorXd &x, VectorXd &fvec) const {
+    double tmp1, tmp2, tmp3;
+    static const double y[15] = {1.4e-1, 1.8e-1, 2.2e-1, 2.5e-1, 2.9e-1, 3.2e-1, 3.5e-1, 3.9e-1,
+                                 3.7e-1, 5.8e-1, 7.3e-1, 9.6e-1, 1.34,   2.1,    4.39};
 
-        for (int i = 0; i < values(); i++)
-        {
-            tmp1 = i+1;
-            tmp2 = 16 - i - 1;
-            tmp3 = (i>=8)? tmp2 : tmp1;
-            fvec[i] = y[i] - (x[0] + tmp1/(x[1]*tmp2 + x[2]*tmp3));
-        }
-        return 0;
+    for (int i = 0; i < values(); i++) {
+      tmp1 = i + 1;
+      tmp2 = 16 - i - 1;
+      tmp3 = (i >= 8) ? tmp2 : tmp1;
+      fvec[i] = y[i] - (x[0] + tmp1 / (x[1] * tmp2 + x[2] * tmp3));
     }
+    return 0;
+  }
 
-    int df(const VectorXd &x, MatrixXd &fjac) const
-    {
-        double tmp1, tmp2, tmp3, tmp4;
-        for (int i = 0; i < values(); i++)
-        {
-            tmp1 = i+1;
-            tmp2 = 16 - i - 1;
-            tmp3 = (i>=8)? tmp2 : tmp1;
-            tmp4 = (x[1]*tmp2 + x[2]*tmp3); tmp4 = tmp4*tmp4;
-            fjac(i,0) = -1;
-            fjac(i,1) = tmp1*tmp2/tmp4;
-            fjac(i,2) = tmp1*tmp3/tmp4;
-        }
-        return 0;
+  int df(const VectorXd &x, MatrixXd &fjac) const {
+    double tmp1, tmp2, tmp3, tmp4;
+    for (int i = 0; i < values(); i++) {
+      tmp1 = i + 1;
+      tmp2 = 16 - i - 1;
+      tmp3 = (i >= 8) ? tmp2 : tmp1;
+      tmp4 = (x[1] * tmp2 + x[2] * tmp3);
+      tmp4 = tmp4 * tmp4;
+      fjac(i, 0) = -1;
+      fjac(i, 1) = tmp1 * tmp2 / tmp4;
+      fjac(i, 2) = tmp1 * tmp3 / tmp4;
     }
+    return 0;
+  }
 };
 
-void testLmder1()
-{
-  int n=3, info;
+void testLmder1() {
+  int n = 3, info;
 
   VectorXd x;
 
@@ -197,9 +172,8 @@
   VERIFY_IS_APPROX(x, x_ref);
 }
 
-void testLmder()
-{
-  const int m=15, n=3;
+void testLmder() {
+  const int m = 15, n = 3;
   int info;
   double fnorm, covfac;
   VectorXd x;
@@ -227,65 +201,55 @@
   VERIFY_IS_APPROX(x, x_ref);
 
   // check covariance
-  covfac = fnorm*fnorm/(m-n);
-  internal::covar(lm.fjac, lm.permutation.indices()); // TODO : move this as a function of lm
+  covfac = fnorm * fnorm / (m - n);
+  internal::covar(lm.fjac, lm.permutation.indices());  // TODO : move this as a function of lm
 
-  MatrixXd cov_ref(n,n);
-  cov_ref <<
-      0.0001531202,   0.002869941,  -0.002656662,
-      0.002869941,    0.09480935,   -0.09098995,
-      -0.002656662,   -0.09098995,    0.08778727;
+  MatrixXd cov_ref(n, n);
+  cov_ref << 0.0001531202, 0.002869941, -0.002656662, 0.002869941, 0.09480935, -0.09098995, -0.002656662, -0.09098995,
+      0.08778727;
 
-//  std::cout << fjac*covfac << std::endl;
+  //  std::cout << fjac*covfac << std::endl;
 
   MatrixXd cov;
-  cov =  covfac*lm.fjac.topLeftCorner<n,n>();
-  VERIFY_IS_APPROX( cov, cov_ref);
+  cov = covfac * lm.fjac.topLeftCorner<n, n>();
+  VERIFY_IS_APPROX(cov, cov_ref);
   // TODO: why isn't this allowed ? :
   // VERIFY_IS_APPROX( covfac*fjac.topLeftCorner<n,n>() , cov_ref);
 }
 
-struct hybrj_functor : Functor<double>
-{
-    hybrj_functor(void) : Functor<double>(9,9) {}
+struct hybrj_functor : Functor<double> {
+  hybrj_functor(void) : Functor<double>(9, 9) {}
 
-    int operator()(const VectorXd &x, VectorXd &fvec)
-    {
-        double temp, temp1, temp2;
-        const VectorXd::Index n = x.size();
-        assert(fvec.size()==n);
-        for (VectorXd::Index k = 0; k < n; k++)
-        {
-            temp = (3. - 2.*x[k])*x[k];
-            temp1 = 0.;
-            if (k) temp1 = x[k-1];
-            temp2 = 0.;
-            if (k != n-1) temp2 = x[k+1];
-            fvec[k] = temp - temp1 - 2.*temp2 + 1.;
-        }
-        return 0;
+  int operator()(const VectorXd &x, VectorXd &fvec) {
+    double temp, temp1, temp2;
+    const VectorXd::Index n = x.size();
+    assert(fvec.size() == n);
+    for (VectorXd::Index k = 0; k < n; k++) {
+      temp = (3. - 2. * x[k]) * x[k];
+      temp1 = 0.;
+      if (k) temp1 = x[k - 1];
+      temp2 = 0.;
+      if (k != n - 1) temp2 = x[k + 1];
+      fvec[k] = temp - temp1 - 2. * temp2 + 1.;
     }
-    int df(const VectorXd &x, MatrixXd &fjac)
-    {
-        const VectorXd::Index n = x.size();
-        assert(fjac.rows()==n);
-        assert(fjac.cols()==n);
-        for (VectorXd::Index k = 0; k < n; k++)
-        {
-            for (VectorXd::Index j = 0; j < n; j++)
-                fjac(k,j) = 0.;
-            fjac(k,k) = 3.- 4.*x[k];
-            if (k) fjac(k,k-1) = -1.;
-            if (k != n-1) fjac(k,k+1) = -2.;
-        }
-        return 0;
+    return 0;
+  }
+  int df(const VectorXd &x, MatrixXd &fjac) {
+    const VectorXd::Index n = x.size();
+    assert(fjac.rows() == n);
+    assert(fjac.cols() == n);
+    for (VectorXd::Index k = 0; k < n; k++) {
+      for (VectorXd::Index j = 0; j < n; j++) fjac(k, j) = 0.;
+      fjac(k, k) = 3. - 4. * x[k];
+      if (k) fjac(k, k - 1) = -1.;
+      if (k != n - 1) fjac(k, k + 1) = -2.;
     }
+    return 0;
+  }
 };
 
-
-void testHybrj1()
-{
-  const int n=9;
+void testHybrj1() {
+  const int n = 9;
   int info;
   VectorXd x(n);
 
@@ -305,26 +269,20 @@
   // check norm
   VERIFY_IS_APPROX(solver.fvec.blueNorm(), 1.192636e-08);
 
-
-// check x
+  // check x
   VectorXd x_ref(n);
-  x_ref <<
-     -0.5706545,    -0.6816283,    -0.7017325,
-     -0.7042129,     -0.701369,    -0.6918656,
-     -0.665792,    -0.5960342,    -0.4164121;
+  x_ref << -0.5706545, -0.6816283, -0.7017325, -0.7042129, -0.701369, -0.6918656, -0.665792, -0.5960342, -0.4164121;
   VERIFY_IS_APPROX(x, x_ref);
 }
 
-void testHybrj()
-{
-  const int n=9;
+void testHybrj() {
+  const int n = 9;
   int info;
   VectorXd x(n);
 
   /* the following starting values provide a rough fit. */
   x.setConstant(n, -1.);
 
-
   // do the computation
   hybrj_functor functor;
   HybridNonLinearSolver<hybrj_functor> solver(functor);
@@ -340,42 +298,33 @@
   // check norm
   VERIFY_IS_APPROX(solver.fvec.blueNorm(), 1.192636e-08);
 
-
-// check x
+  // check x
   VectorXd x_ref(n);
-  x_ref <<
-     -0.5706545,    -0.6816283,    -0.7017325,
-     -0.7042129,     -0.701369,    -0.6918656,
-     -0.665792,    -0.5960342,    -0.4164121;
+  x_ref << -0.5706545, -0.6816283, -0.7017325, -0.7042129, -0.701369, -0.6918656, -0.665792, -0.5960342, -0.4164121;
   VERIFY_IS_APPROX(x, x_ref);
-
 }
 
-struct hybrd_functor : Functor<double>
-{
-    hybrd_functor(void) : Functor<double>(9,9) {}
-    int operator()(const VectorXd &x, VectorXd &fvec) const
-    {
-        double temp, temp1, temp2;
-        const VectorXd::Index n = x.size();
+struct hybrd_functor : Functor<double> {
+  hybrd_functor(void) : Functor<double>(9, 9) {}
+  int operator()(const VectorXd &x, VectorXd &fvec) const {
+    double temp, temp1, temp2;
+    const VectorXd::Index n = x.size();
 
-        assert(fvec.size()==n);
-        for (VectorXd::Index k=0; k < n; k++)
-        {
-            temp = (3. - 2.*x[k])*x[k];
-            temp1 = 0.;
-            if (k) temp1 = x[k-1];
-            temp2 = 0.;
-            if (k != n-1) temp2 = x[k+1];
-            fvec[k] = temp - temp1 - 2.*temp2 + 1.;
-        }
-        return 0;
+    assert(fvec.size() == n);
+    for (VectorXd::Index k = 0; k < n; k++) {
+      temp = (3. - 2. * x[k]) * x[k];
+      temp1 = 0.;
+      if (k) temp1 = x[k - 1];
+      temp2 = 0.;
+      if (k != n - 1) temp2 = x[k + 1];
+      fvec[k] = temp - temp1 - 2. * temp2 + 1.;
     }
+    return 0;
+  }
 };
 
-void testHybrd1()
-{
-  int n=9, info;
+void testHybrd1() {
+  int n = 9, info;
   VectorXd x(n);
 
   /* the following starting values provide a rough solution. */
@@ -389,7 +338,7 @@
 
   // check return value
   // VERIFY_IS_EQUAL(info, 1);
-  VERIFY(solver.nfev <= 20*LM_EVAL_COUNT_TOL);
+  VERIFY(solver.nfev <= 20 * LM_EVAL_COUNT_TOL);
 
   // check norm
   VERIFY_IS_APPROX(solver.fvec.blueNorm(), 1.192636e-08);
@@ -400,9 +349,8 @@
   VERIFY_IS_APPROX(x, x_ref);
 }
 
-void testHybrd()
-{
-  const int n=9;
+void testHybrd() {
+  const int n = 9;
   int info;
   VectorXd x;
 
@@ -421,63 +369,56 @@
 
   // check return value
   // VERIFY_IS_EQUAL(info, 1);
-  VERIFY(solver.nfev <= 14*LM_EVAL_COUNT_TOL);
+  VERIFY(solver.nfev <= 14 * LM_EVAL_COUNT_TOL);
 
   // check norm
   VERIFY_IS_APPROX(solver.fvec.blueNorm(), 1.192636e-08);
 
   // check x
   VectorXd x_ref(n);
-  x_ref <<
-      -0.5706545,    -0.6816283,    -0.7017325,
-      -0.7042129,     -0.701369,    -0.6918656,
-      -0.665792,    -0.5960342,    -0.4164121;
+  x_ref << -0.5706545, -0.6816283, -0.7017325, -0.7042129, -0.701369, -0.6918656, -0.665792, -0.5960342, -0.4164121;
   VERIFY_IS_APPROX(x, x_ref);
 }
 
-struct lmstr_functor : Functor<double>
-{
-    lmstr_functor(void) : Functor<double>(3,15) {}
-    int operator()(const VectorXd &x, VectorXd &fvec)
-    {
-        /*  subroutine fcn for lmstr1 example. */
-        double tmp1, tmp2, tmp3;
-        static const double y[15]={1.4e-1, 1.8e-1, 2.2e-1, 2.5e-1, 2.9e-1, 3.2e-1, 3.5e-1,
-            3.9e-1, 3.7e-1, 5.8e-1, 7.3e-1, 9.6e-1, 1.34, 2.1, 4.39};
+struct lmstr_functor : Functor<double> {
+  lmstr_functor(void) : Functor<double>(3, 15) {}
+  int operator()(const VectorXd &x, VectorXd &fvec) {
+    /*  subroutine fcn for lmstr1 example. */
+    double tmp1, tmp2, tmp3;
+    static const double y[15] = {1.4e-1, 1.8e-1, 2.2e-1, 2.5e-1, 2.9e-1, 3.2e-1, 3.5e-1, 3.9e-1,
+                                 3.7e-1, 5.8e-1, 7.3e-1, 9.6e-1, 1.34,   2.1,    4.39};
 
-        assert(15==fvec.size());
-        assert(3==x.size());
+    assert(15 == fvec.size());
+    assert(3 == x.size());
 
-        for (int i=0; i<15; i++)
-        {
-            tmp1 = i+1;
-            tmp2 = 16 - i - 1;
-            tmp3 = (i>=8)? tmp2 : tmp1;
-            fvec[i] = y[i] - (x[0] + tmp1/(x[1]*tmp2 + x[2]*tmp3));
-        }
-        return 0;
+    for (int i = 0; i < 15; i++) {
+      tmp1 = i + 1;
+      tmp2 = 16 - i - 1;
+      tmp3 = (i >= 8) ? tmp2 : tmp1;
+      fvec[i] = y[i] - (x[0] + tmp1 / (x[1] * tmp2 + x[2] * tmp3));
     }
-    int df(const VectorXd &x, VectorXd &jac_row, VectorXd::Index rownb)
-    {
-        assert(x.size()==3);
-        assert(jac_row.size()==x.size());
-        double tmp1, tmp2, tmp3, tmp4;
+    return 0;
+  }
+  int df(const VectorXd &x, VectorXd &jac_row, VectorXd::Index rownb) {
+    assert(x.size() == 3);
+    assert(jac_row.size() == x.size());
+    double tmp1, tmp2, tmp3, tmp4;
 
-        VectorXd::Index i = rownb-2;
-        tmp1 = i+1;
-        tmp2 = 16 - i - 1;
-        tmp3 = (i>=8)? tmp2 : tmp1;
-        tmp4 = (x[1]*tmp2 + x[2]*tmp3); tmp4 = tmp4*tmp4;
-        jac_row[0] = -1;
-        jac_row[1] = tmp1*tmp2/tmp4;
-        jac_row[2] = tmp1*tmp3/tmp4;
-        return 0;
-    }
+    VectorXd::Index i = rownb - 2;
+    tmp1 = i + 1;
+    tmp2 = 16 - i - 1;
+    tmp3 = (i >= 8) ? tmp2 : tmp1;
+    tmp4 = (x[1] * tmp2 + x[2] * tmp3);
+    tmp4 = tmp4 * tmp4;
+    jac_row[0] = -1;
+    jac_row[1] = tmp1 * tmp2 / tmp4;
+    jac_row[2] = tmp1 * tmp3 / tmp4;
+    return 0;
+  }
 };
 
-void testLmstr1()
-{
-  const int n=3;
+void testLmstr1() {
+  const int n = 3;
   int info;
 
   VectorXd x(n);
@@ -500,13 +441,12 @@
 
   // check x
   VectorXd x_ref(n);
-  x_ref << 0.08241058, 1.133037, 2.343695 ;
+  x_ref << 0.08241058, 1.133037, 2.343695;
   VERIFY_IS_APPROX(x, x_ref);
 }
 
-void testLmstr()
-{
-  const int n=3;
+void testLmstr() {
+  const int n = 3;
   int info;
   double fnorm;
   VectorXd x(n);
@@ -532,37 +472,32 @@
   VectorXd x_ref(n);
   x_ref << 0.08241058, 1.133037, 2.343695;
   VERIFY_IS_APPROX(x, x_ref);
-
 }
 
-struct lmdif_functor : Functor<double>
-{
-    lmdif_functor(void) : Functor<double>(3,15) {}
-    int operator()(const VectorXd &x, VectorXd &fvec) const
-    {
-        int i;
-        double tmp1,tmp2,tmp3;
-        static const double y[15]={1.4e-1,1.8e-1,2.2e-1,2.5e-1,2.9e-1,3.2e-1,3.5e-1,3.9e-1,
-            3.7e-1,5.8e-1,7.3e-1,9.6e-1,1.34e0,2.1e0,4.39e0};
+struct lmdif_functor : Functor<double> {
+  lmdif_functor(void) : Functor<double>(3, 15) {}
+  int operator()(const VectorXd &x, VectorXd &fvec) const {
+    int i;
+    double tmp1, tmp2, tmp3;
+    static const double y[15] = {1.4e-1, 1.8e-1, 2.2e-1, 2.5e-1, 2.9e-1, 3.2e-1, 3.5e-1, 3.9e-1,
+                                 3.7e-1, 5.8e-1, 7.3e-1, 9.6e-1, 1.34e0, 2.1e0,  4.39e0};
 
-        assert(x.size()==3);
-        assert(fvec.size()==15);
-        for (i=0; i<15; i++)
-        {
-            tmp1 = i+1;
-            tmp2 = 15 - i;
-            tmp3 = tmp1;
+    assert(x.size() == 3);
+    assert(fvec.size() == 15);
+    for (i = 0; i < 15; i++) {
+      tmp1 = i + 1;
+      tmp2 = 15 - i;
+      tmp3 = tmp1;
 
-            if (i >= 8) tmp3 = tmp2;
-            fvec[i] = y[i] - (x[0] + tmp1/(x[1]*tmp2 + x[2]*tmp3));
-        }
-        return 0;
+      if (i >= 8) tmp3 = tmp2;
+      fvec[i] = y[i] - (x[0] + tmp1 / (x[1] * tmp2 + x[2] * tmp3));
     }
+    return 0;
+  }
 };
 
-void testLmdif1()
-{
-  const int n=3;
+void testLmdif1() {
+  const int n = 3;
   int info;
 
   VectorXd x(n), fvec(15);
@@ -572,13 +507,13 @@
 
   // do the computation
   lmdif_functor functor;
-  DenseIndex nfev = -1; // initialize to avoid maybe-uninitialized warning
+  DenseIndex nfev = -1;  // initialize to avoid maybe-uninitialized warning
   info = LevenbergMarquardt<lmdif_functor>::lmdif1(functor, x, &nfev);
   EIGEN_UNUSED_VARIABLE(info)
 
   // check return value
   // VERIFY_IS_EQUAL(info, 1);
-  VERIFY( nfev <= 26*LM_EVAL_COUNT_TOL);
+  VERIFY(nfev <= 26 * LM_EVAL_COUNT_TOL);
 
   // check norm
   functor(x, fvec);
@@ -588,12 +523,10 @@
   VectorXd x_ref(n);
   x_ref << 0.0824106, 1.1330366, 2.3436947;
   VERIFY_IS_APPROX(x, x_ref);
-
 }
 
-void testLmdif()
-{
-  const int m=15, n=3;
+void testLmdif() {
+  const int m = 15, n = 3;
   int info;
   double fnorm, covfac;
   VectorXd x(n);
@@ -610,7 +543,7 @@
 
   // check return values
   // VERIFY_IS_EQUAL(info, 1);
-  VERIFY(lm.nfev <= 26*LM_EVAL_COUNT_TOL);
+  VERIFY(lm.nfev <= 26 * LM_EVAL_COUNT_TOL);
 
   // check norm
   fnorm = lm.fvec.blueNorm();
@@ -622,64 +555,69 @@
   VERIFY_IS_APPROX(x, x_ref);
 
   // check covariance
-  covfac = fnorm*fnorm/(m-n);
-  internal::covar(lm.fjac, lm.permutation.indices()); // TODO : move this as a function of lm
+  covfac = fnorm * fnorm / (m - n);
+  internal::covar(lm.fjac, lm.permutation.indices());  // TODO : move this as a function of lm
 
-  MatrixXd cov_ref(n,n);
-  cov_ref <<
-      0.0001531202,   0.002869942,  -0.002656662,
-      0.002869942,    0.09480937,   -0.09098997,
-      -0.002656662,   -0.09098997,    0.08778729;
+  MatrixXd cov_ref(n, n);
+  cov_ref << 0.0001531202, 0.002869942, -0.002656662, 0.002869942, 0.09480937, -0.09098997, -0.002656662, -0.09098997,
+      0.08778729;
 
-//  std::cout << fjac*covfac << std::endl;
+  //  std::cout << fjac*covfac << std::endl;
 
   MatrixXd cov;
-  cov =  covfac*lm.fjac.topLeftCorner<n,n>();
-  VERIFY_IS_APPROX( cov, cov_ref);
+  cov = covfac * lm.fjac.topLeftCorner<n, n>();
+  VERIFY_IS_APPROX(cov, cov_ref);
   // TODO: why isn't this allowed ? :
   // VERIFY_IS_APPROX( covfac*fjac.topLeftCorner<n,n>() , cov_ref);
 }
 
-struct chwirut2_functor : Functor<double>
-{
-    chwirut2_functor(void) : Functor<double>(3,54) {}
-    static const double m_x[54];
-    static const double m_y[54];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        int i;
+struct chwirut2_functor : Functor<double> {
+  chwirut2_functor(void) : Functor<double>(3, 54) {}
+  static const double m_x[54];
+  static const double m_y[54];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    int i;
 
-        assert(b.size()==3);
-        assert(fvec.size()==54);
-        for(i=0; i<54; i++) {
-            double x = m_x[i];
-            fvec[i] = exp(-b[0]*x)/(b[1]+b[2]*x) - m_y[i];
-        }
-        return 0;
+    assert(b.size() == 3);
+    assert(fvec.size() == 54);
+    for (i = 0; i < 54; i++) {
+      double x = m_x[i];
+      fvec[i] = exp(-b[0] * x) / (b[1] + b[2] * x) - m_y[i];
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==3);
-        assert(fjac.rows()==54);
-        assert(fjac.cols()==3);
-        for(int i=0; i<54; i++) {
-            double x = m_x[i];
-            double factor = 1./(b[1]+b[2]*x);
-            double e = exp(-b[0]*x);
-            fjac(i,0) = -x*e*factor;
-            fjac(i,1) = -e*factor*factor;
-            fjac(i,2) = -x*e*factor*factor;
-        }
-        return 0;
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 3);
+    assert(fjac.rows() == 54);
+    assert(fjac.cols() == 3);
+    for (int i = 0; i < 54; i++) {
+      double x = m_x[i];
+      double factor = 1. / (b[1] + b[2] * x);
+      double e = exp(-b[0] * x);
+      fjac(i, 0) = -x * e * factor;
+      fjac(i, 1) = -e * factor * factor;
+      fjac(i, 2) = -x * e * factor * factor;
     }
+    return 0;
+  }
 };
-const double chwirut2_functor::m_x[54] = { 0.500E0, 1.000E0, 1.750E0, 3.750E0, 5.750E0, 0.875E0, 2.250E0, 3.250E0, 5.250E0, 0.750E0, 1.750E0, 2.750E0, 4.750E0, 0.625E0, 1.250E0, 2.250E0, 4.250E0, .500E0, 3.000E0, .750E0, 3.000E0, 1.500E0, 6.000E0, 3.000E0, 6.000E0, 1.500E0, 3.000E0, .500E0, 2.000E0, 4.000E0, .750E0, 2.000E0, 5.000E0, .750E0, 2.250E0, 3.750E0, 5.750E0, 3.000E0, .750E0, 2.500E0, 4.000E0, .750E0, 2.500E0, 4.000E0, .750E0, 2.500E0, 4.000E0, .500E0, 6.000E0, 3.000E0, .500E0, 2.750E0, .500E0, 1.750E0};
-const double chwirut2_functor::m_y[54] = { 92.9000E0 ,57.1000E0 ,31.0500E0 ,11.5875E0 ,8.0250E0 ,63.6000E0 ,21.4000E0 ,14.2500E0 ,8.4750E0 ,63.8000E0 ,26.8000E0 ,16.4625E0 ,7.1250E0 ,67.3000E0 ,41.0000E0 ,21.1500E0 ,8.1750E0 ,81.5000E0 ,13.1200E0 ,59.9000E0 ,14.6200E0 ,32.9000E0 ,5.4400E0 ,12.5600E0 ,5.4400E0 ,32.0000E0 ,13.9500E0 ,75.8000E0 ,20.0000E0 ,10.4200E0 ,59.5000E0 ,21.6700E0 ,8.5500E0 ,62.0000E0 ,20.2000E0 ,7.7600E0 ,3.7500E0 ,11.8100E0 ,54.7000E0 ,23.7000E0 ,11.5500E0 ,61.3000E0 ,17.7000E0 ,8.7400E0 ,59.2000E0 ,16.3000E0 ,8.6200E0 ,81.0000E0 ,4.8700E0 ,14.6200E0 ,81.7000E0 ,17.1700E0 ,81.3000E0 ,28.9000E0  };
+const double chwirut2_functor::m_x[54] = {
+    0.500E0, 1.000E0, 1.750E0, 3.750E0, 5.750E0, 0.875E0, 2.250E0, 3.250E0, 5.250E0, 0.750E0, 1.750E0,
+    2.750E0, 4.750E0, 0.625E0, 1.250E0, 2.250E0, 4.250E0, .500E0,  3.000E0, .750E0,  3.000E0, 1.500E0,
+    6.000E0, 3.000E0, 6.000E0, 1.500E0, 3.000E0, .500E0,  2.000E0, 4.000E0, .750E0,  2.000E0, 5.000E0,
+    .750E0,  2.250E0, 3.750E0, 5.750E0, 3.000E0, .750E0,  2.500E0, 4.000E0, .750E0,  2.500E0, 4.000E0,
+    .750E0,  2.500E0, 4.000E0, .500E0,  6.000E0, 3.000E0, .500E0,  2.750E0, .500E0,  1.750E0};
+const double chwirut2_functor::m_y[54] = {
+    92.9000E0, 57.1000E0, 31.0500E0, 11.5875E0, 8.0250E0,  63.6000E0, 21.4000E0, 14.2500E0, 8.4750E0,
+    63.8000E0, 26.8000E0, 16.4625E0, 7.1250E0,  67.3000E0, 41.0000E0, 21.1500E0, 8.1750E0,  81.5000E0,
+    13.1200E0, 59.9000E0, 14.6200E0, 32.9000E0, 5.4400E0,  12.5600E0, 5.4400E0,  32.0000E0, 13.9500E0,
+    75.8000E0, 20.0000E0, 10.4200E0, 59.5000E0, 21.6700E0, 8.5500E0,  62.0000E0, 20.2000E0, 7.7600E0,
+    3.7500E0,  11.8100E0, 54.7000E0, 23.7000E0, 11.5500E0, 61.3000E0, 17.7000E0, 8.7400E0,  59.2000E0,
+    16.3000E0, 8.6200E0,  81.0000E0, 4.8700E0,  14.6200E0, 81.7000E0, 17.1700E0, 81.3000E0, 28.9000E0};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/chwirut2.shtml
-void testNistChwirut2(void)
-{
-  const int n=3;
+void testNistChwirut2(void) {
+  const int n = 3;
   int info;
 
   VectorXd x(n);
@@ -687,7 +625,7 @@
   /*
    * First try
    */
-  x<< 0.1, 0.01, 0.02;
+  x << 0.1, 0.01, 0.02;
   // do the computation
   chwirut2_functor functor;
   LevenbergMarquardt<chwirut2_functor> lm(functor);
@@ -707,11 +645,11 @@
   /*
    * Second try
    */
-  x<< 0.15, 0.008, 0.010;
+  x << 0.15, 0.008, 0.010;
   // do the computation
   lm.resetParameters();
-  lm.parameters.ftol = 1.E6*NumTraits<double>::epsilon();
-  lm.parameters.xtol = 1.E6*NumTraits<double>::epsilon();
+  lm.parameters.ftol = 1.E6 * NumTraits<double>::epsilon();
+  lm.parameters.xtol = 1.E6 * NumTraits<double>::epsilon();
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
 
@@ -726,40 +664,37 @@
   VERIFY_IS_APPROX(x[2], 1.2150007096E-02);
 }
 
-
-struct misra1a_functor : Functor<double>
-{
-    misra1a_functor(void) : Functor<double>(2,14) {}
-    static const double m_x[14];
-    static const double m_y[14];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        assert(b.size()==2);
-        assert(fvec.size()==14);
-        for(int i=0; i<14; i++) {
-            fvec[i] = b[0]*(1.-exp(-b[1]*m_x[i])) - m_y[i] ;
-        }
-        return 0;
+struct misra1a_functor : Functor<double> {
+  misra1a_functor(void) : Functor<double>(2, 14) {}
+  static const double m_x[14];
+  static const double m_y[14];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    assert(b.size() == 2);
+    assert(fvec.size() == 14);
+    for (int i = 0; i < 14; i++) {
+      fvec[i] = b[0] * (1. - exp(-b[1] * m_x[i])) - m_y[i];
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==2);
-        assert(fjac.rows()==14);
-        assert(fjac.cols()==2);
-        for(int i=0; i<14; i++) {
-            fjac(i,0) = (1.-exp(-b[1]*m_x[i]));
-            fjac(i,1) = (b[0]*m_x[i]*exp(-b[1]*m_x[i]));
-        }
-        return 0;
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 2);
+    assert(fjac.rows() == 14);
+    assert(fjac.cols() == 2);
+    for (int i = 0; i < 14; i++) {
+      fjac(i, 0) = (1. - exp(-b[1] * m_x[i]));
+      fjac(i, 1) = (b[0] * m_x[i] * exp(-b[1] * m_x[i]));
     }
+    return 0;
+  }
 };
-const double misra1a_functor::m_x[14] = { 77.6E0, 114.9E0, 141.1E0, 190.8E0, 239.9E0, 289.0E0, 332.8E0, 378.4E0, 434.8E0, 477.3E0, 536.8E0, 593.1E0, 689.1E0, 760.0E0};
-const double misra1a_functor::m_y[14] = { 10.07E0, 14.73E0, 17.94E0, 23.93E0, 29.61E0, 35.18E0, 40.02E0, 44.82E0, 50.76E0, 55.05E0, 61.01E0, 66.40E0, 75.47E0, 81.78E0};
+const double misra1a_functor::m_x[14] = {77.6E0,  114.9E0, 141.1E0, 190.8E0, 239.9E0, 289.0E0, 332.8E0,
+                                         378.4E0, 434.8E0, 477.3E0, 536.8E0, 593.1E0, 689.1E0, 760.0E0};
+const double misra1a_functor::m_y[14] = {10.07E0, 14.73E0, 17.94E0, 23.93E0, 29.61E0, 35.18E0, 40.02E0,
+                                         44.82E0, 50.76E0, 55.05E0, 61.01E0, 66.40E0, 75.47E0, 81.78E0};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/misra1a.shtml
-void testNistMisra1a(void)
-{
-  const int n=2;
+void testNistMisra1a(void) {
+  const int n = 2;
   int info;
 
   VectorXd x(n);
@@ -767,7 +702,7 @@
   /*
    * First try
    */
-  x<< 500., 0.0001;
+  x << 500., 0.0001;
   // do the computation
   misra1a_functor functor;
   LevenbergMarquardt<misra1a_functor> lm(functor);
@@ -786,7 +721,7 @@
   /*
    * Second try
    */
-  x<< 250., 0.0005;
+  x << 250., 0.0005;
   // do the computation
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
@@ -801,55 +736,92 @@
   VERIFY_IS_APPROX(x[1], 5.5015643181E-04);
 }
 
-struct hahn1_functor : Functor<double>
-{
-    hahn1_functor(void) : Functor<double>(7,236) {}
-    static const double m_x[236];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        static const double m_y[236] = { .591E0 , 1.547E0 , 2.902E0 , 2.894E0 , 4.703E0 , 6.307E0 , 7.03E0  , 7.898E0 , 9.470E0 , 9.484E0 , 10.072E0 , 10.163E0 , 11.615E0 , 12.005E0 , 12.478E0 , 12.982E0 , 12.970E0 , 13.926E0 , 14.452E0 , 14.404E0 , 15.190E0 , 15.550E0 , 15.528E0 , 15.499E0 , 16.131E0 , 16.438E0 , 16.387E0 , 16.549E0 , 16.872E0 , 16.830E0 , 16.926E0 , 16.907E0 , 16.966E0 , 17.060E0 , 17.122E0 , 17.311E0 , 17.355E0 , 17.668E0 , 17.767E0 , 17.803E0 , 17.765E0 , 17.768E0 , 17.736E0 , 17.858E0 , 17.877E0 , 17.912E0 , 18.046E0 , 18.085E0 , 18.291E0 , 18.357E0 , 18.426E0 , 18.584E0 , 18.610E0 , 18.870E0 , 18.795E0 , 19.111E0 , .367E0 , .796E0 , 0.892E0 , 1.903E0 , 2.150E0 , 3.697E0 , 5.870E0 , 6.421E0 , 7.422E0 , 9.944E0 , 11.023E0 , 11.87E0  , 12.786E0 , 14.067E0 , 13.974E0 , 14.462E0 , 14.464E0 , 15.381E0 , 15.483E0 , 15.59E0  , 16.075E0 , 16.347E0 , 16.181E0 , 16.915E0 , 17.003E0 , 16.978E0 , 17.756E0 , 17.808E0 , 17.868E0 , 18.481E0 , 18.486E0 , 19.090E0 , 16.062E0 , 16.337E0 , 16.345E0 ,
-        16.388E0 , 17.159E0 , 17.116E0 , 17.164E0 , 17.123E0 , 17.979E0 , 17.974E0 , 18.007E0 , 17.993E0 , 18.523E0 , 18.669E0 , 18.617E0 , 19.371E0 , 19.330E0 , 0.080E0 , 0.248E0 , 1.089E0 , 1.418E0 , 2.278E0 , 3.624E0 , 4.574E0 , 5.556E0 , 7.267E0 , 7.695E0 , 9.136E0 , 9.959E0 , 9.957E0 , 11.600E0 , 13.138E0 , 13.564E0 , 13.871E0 , 13.994E0 , 14.947E0 , 15.473E0 , 15.379E0 , 15.455E0 , 15.908E0 , 16.114E0 , 17.071E0 , 17.135E0 , 17.282E0 , 17.368E0 , 17.483E0 , 17.764E0 , 18.185E0 , 18.271E0 , 18.236E0 , 18.237E0 , 18.523E0 , 18.627E0 , 18.665E0 , 19.086E0 , 0.214E0 , 0.943E0 , 1.429E0 , 2.241E0 , 2.951E0 , 3.782E0 , 4.757E0 , 5.602E0 , 7.169E0 , 8.920E0 , 10.055E0 , 12.035E0 , 12.861E0 , 13.436E0 , 14.167E0 , 14.755E0 , 15.168E0 , 15.651E0 , 15.746E0 , 16.216E0 , 16.445E0 , 16.965E0 , 17.121E0 , 17.206E0 , 17.250E0 , 17.339E0 , 17.793E0 , 18.123E0 , 18.49E0  , 18.566E0 , 18.645E0 , 18.706E0 , 18.924E0 , 19.1E0   , 0.375E0 , 0.471E0 , 1.504E0 , 2.204E0 , 2.813E0 , 4.765E0 , 9.835E0 , 10.040E0 , 11.946E0 , 12.596E0 , 
-13.303E0 , 13.922E0 , 14.440E0 , 14.951E0 , 15.627E0 , 15.639E0 , 15.814E0 , 16.315E0 , 16.334E0 , 16.430E0 , 16.423E0 , 17.024E0 , 17.009E0 , 17.165E0 , 17.134E0 , 17.349E0 , 17.576E0 , 17.848E0 , 18.090E0 , 18.276E0 , 18.404E0 , 18.519E0 , 19.133E0 , 19.074E0 , 19.239E0 , 19.280E0 , 19.101E0 , 19.398E0 , 19.252E0 , 19.89E0  , 20.007E0 , 19.929E0 , 19.268E0 , 19.324E0 , 20.049E0 , 20.107E0 , 20.062E0 , 20.065E0 , 19.286E0 , 19.972E0 , 20.088E0 , 20.743E0 , 20.83E0  , 20.935E0 , 21.035E0 , 20.93E0  , 21.074E0 , 21.085E0 , 20.935E0 };
+struct hahn1_functor : Functor<double> {
+  hahn1_functor(void) : Functor<double>(7, 236) {}
+  static const double m_x[236];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    static const double m_y[236] = {
+        .591E0,   1.547E0,  2.902E0,  2.894E0,  4.703E0,  6.307E0,  7.03E0,   7.898E0,  9.470E0,  9.484E0,  10.072E0,
+        10.163E0, 11.615E0, 12.005E0, 12.478E0, 12.982E0, 12.970E0, 13.926E0, 14.452E0, 14.404E0, 15.190E0, 15.550E0,
+        15.528E0, 15.499E0, 16.131E0, 16.438E0, 16.387E0, 16.549E0, 16.872E0, 16.830E0, 16.926E0, 16.907E0, 16.966E0,
+        17.060E0, 17.122E0, 17.311E0, 17.355E0, 17.668E0, 17.767E0, 17.803E0, 17.765E0, 17.768E0, 17.736E0, 17.858E0,
+        17.877E0, 17.912E0, 18.046E0, 18.085E0, 18.291E0, 18.357E0, 18.426E0, 18.584E0, 18.610E0, 18.870E0, 18.795E0,
+        19.111E0, .367E0,   .796E0,   0.892E0,  1.903E0,  2.150E0,  3.697E0,  5.870E0,  6.421E0,  7.422E0,  9.944E0,
+        11.023E0, 11.87E0,  12.786E0, 14.067E0, 13.974E0, 14.462E0, 14.464E0, 15.381E0, 15.483E0, 15.59E0,  16.075E0,
+        16.347E0, 16.181E0, 16.915E0, 17.003E0, 16.978E0, 17.756E0, 17.808E0, 17.868E0, 18.481E0, 18.486E0, 19.090E0,
+        16.062E0, 16.337E0, 16.345E0, 16.388E0, 17.159E0, 17.116E0, 17.164E0, 17.123E0, 17.979E0, 17.974E0, 18.007E0,
+        17.993E0, 18.523E0, 18.669E0, 18.617E0, 19.371E0, 19.330E0, 0.080E0,  0.248E0,  1.089E0,  1.418E0,  2.278E0,
+        3.624E0,  4.574E0,  5.556E0,  7.267E0,  7.695E0,  9.136E0,  9.959E0,  9.957E0,  11.600E0, 13.138E0, 13.564E0,
+        13.871E0, 13.994E0, 14.947E0, 15.473E0, 15.379E0, 15.455E0, 15.908E0, 16.114E0, 17.071E0, 17.135E0, 17.282E0,
+        17.368E0, 17.483E0, 17.764E0, 18.185E0, 18.271E0, 18.236E0, 18.237E0, 18.523E0, 18.627E0, 18.665E0, 19.086E0,
+        0.214E0,  0.943E0,  1.429E0,  2.241E0,  2.951E0,  3.782E0,  4.757E0,  5.602E0,  7.169E0,  8.920E0,  10.055E0,
+        12.035E0, 12.861E0, 13.436E0, 14.167E0, 14.755E0, 15.168E0, 15.651E0, 15.746E0, 16.216E0, 16.445E0, 16.965E0,
+        17.121E0, 17.206E0, 17.250E0, 17.339E0, 17.793E0, 18.123E0, 18.49E0,  18.566E0, 18.645E0, 18.706E0, 18.924E0,
+        19.1E0,   0.375E0,  0.471E0,  1.504E0,  2.204E0,  2.813E0,  4.765E0,  9.835E0,  10.040E0, 11.946E0, 12.596E0,
+        13.303E0, 13.922E0, 14.440E0, 14.951E0, 15.627E0, 15.639E0, 15.814E0, 16.315E0, 16.334E0, 16.430E0, 16.423E0,
+        17.024E0, 17.009E0, 17.165E0, 17.134E0, 17.349E0, 17.576E0, 17.848E0, 18.090E0, 18.276E0, 18.404E0, 18.519E0,
+        19.133E0, 19.074E0, 19.239E0, 19.280E0, 19.101E0, 19.398E0, 19.252E0, 19.89E0,  20.007E0, 19.929E0, 19.268E0,
+        19.324E0, 20.049E0, 20.107E0, 20.062E0, 20.065E0, 19.286E0, 19.972E0, 20.088E0, 20.743E0, 20.83E0,  20.935E0,
+        21.035E0, 20.93E0,  21.074E0, 21.085E0, 20.935E0};
 
-        //        int called=0; printf("call hahn1_functor with  iflag=%d, called=%d\n", iflag, called); if (iflag==1) called++;
+    //        int called=0; printf("call hahn1_functor with  iflag=%d, called=%d\n", iflag, called); if (iflag==1)
+    //        called++;
 
-        assert(b.size()==7);
-        assert(fvec.size()==236);
-        for(int i=0; i<236; i++) {
-            double x=m_x[i], xx=x*x, xxx=xx*x;
-            fvec[i] = (b[0]+b[1]*x+b[2]*xx+b[3]*xxx) / (1.+b[4]*x+b[5]*xx+b[6]*xxx) - m_y[i];
-        }
-        return 0;
+    assert(b.size() == 7);
+    assert(fvec.size() == 236);
+    for (int i = 0; i < 236; i++) {
+      double x = m_x[i], xx = x * x, xxx = xx * x;
+      fvec[i] = (b[0] + b[1] * x + b[2] * xx + b[3] * xxx) / (1. + b[4] * x + b[5] * xx + b[6] * xxx) - m_y[i];
     }
+    return 0;
+  }
 
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==7);
-        assert(fjac.rows()==236);
-        assert(fjac.cols()==7);
-        for(int i=0; i<236; i++) {
-            double x=m_x[i], xx=x*x, xxx=xx*x;
-            double fact = 1./(1.+b[4]*x+b[5]*xx+b[6]*xxx);
-            fjac(i,0) = 1.*fact;
-            fjac(i,1) = x*fact;
-            fjac(i,2) = xx*fact;
-            fjac(i,3) = xxx*fact;
-            fact = - (b[0]+b[1]*x+b[2]*xx+b[3]*xxx) * fact * fact;
-            fjac(i,4) = x*fact;
-            fjac(i,5) = xx*fact;
-            fjac(i,6) = xxx*fact;
-        }
-        return 0;
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 7);
+    assert(fjac.rows() == 236);
+    assert(fjac.cols() == 7);
+    for (int i = 0; i < 236; i++) {
+      double x = m_x[i], xx = x * x, xxx = xx * x;
+      double fact = 1. / (1. + b[4] * x + b[5] * xx + b[6] * xxx);
+      fjac(i, 0) = 1. * fact;
+      fjac(i, 1) = x * fact;
+      fjac(i, 2) = xx * fact;
+      fjac(i, 3) = xxx * fact;
+      fact = -(b[0] + b[1] * x + b[2] * xx + b[3] * xxx) * fact * fact;
+      fjac(i, 4) = x * fact;
+      fjac(i, 5) = xx * fact;
+      fjac(i, 6) = xxx * fact;
     }
+    return 0;
+  }
 };
-const double hahn1_functor::m_x[236] = { 24.41E0 , 34.82E0 , 44.09E0 , 45.07E0 , 54.98E0 , 65.51E0 , 70.53E0 , 75.70E0 , 89.57E0 , 91.14E0 , 96.40E0 , 97.19E0 , 114.26E0 , 120.25E0 , 127.08E0 , 133.55E0 , 133.61E0 , 158.67E0 , 172.74E0 , 171.31E0 , 202.14E0 , 220.55E0 , 221.05E0 , 221.39E0 , 250.99E0 , 268.99E0 , 271.80E0 , 271.97E0 , 321.31E0 , 321.69E0 , 330.14E0 , 333.03E0 , 333.47E0 , 340.77E0 , 345.65E0 , 373.11E0 , 373.79E0 , 411.82E0 , 419.51E0 , 421.59E0 , 422.02E0 , 422.47E0 , 422.61E0 , 441.75E0 , 447.41E0 , 448.7E0  , 472.89E0 , 476.69E0 , 522.47E0 , 522.62E0 , 524.43E0 , 546.75E0 , 549.53E0 , 575.29E0 , 576.00E0 , 625.55E0 , 20.15E0 , 28.78E0 , 29.57E0 , 37.41E0 , 39.12E0 , 50.24E0 , 61.38E0 , 66.25E0 , 73.42E0 , 95.52E0 , 107.32E0 , 122.04E0 , 134.03E0 , 163.19E0 , 163.48E0 , 175.70E0 , 179.86E0 , 211.27E0 , 217.78E0 , 219.14E0 , 262.52E0 , 268.01E0 , 268.62E0 , 336.25E0 , 337.23E0 , 339.33E0 , 427.38E0 , 428.58E0 , 432.68E0 , 528.99E0 , 531.08E0 , 628.34E0 , 253.24E0 , 273.13E0 , 273.66E0 ,
-282.10E0 , 346.62E0 , 347.19E0 , 348.78E0 , 351.18E0 , 450.10E0 , 450.35E0 , 451.92E0 , 455.56E0 , 552.22E0 , 553.56E0 , 555.74E0 , 652.59E0 , 656.20E0 , 14.13E0 , 20.41E0 , 31.30E0 , 33.84E0 , 39.70E0 , 48.83E0 , 54.50E0 , 60.41E0 , 72.77E0 , 75.25E0 , 86.84E0 , 94.88E0 , 96.40E0 , 117.37E0 , 139.08E0 , 147.73E0 , 158.63E0 , 161.84E0 , 192.11E0 , 206.76E0 , 209.07E0 , 213.32E0 , 226.44E0 , 237.12E0 , 330.90E0 , 358.72E0 , 370.77E0 , 372.72E0 , 396.24E0 , 416.59E0 , 484.02E0 , 495.47E0 , 514.78E0 , 515.65E0 , 519.47E0 , 544.47E0 , 560.11E0 , 620.77E0 , 18.97E0 , 28.93E0 , 33.91E0 , 40.03E0 , 44.66E0 , 49.87E0 , 55.16E0 , 60.90E0 , 72.08E0 , 85.15E0 , 97.06E0 , 119.63E0 , 133.27E0 , 143.84E0 , 161.91E0 , 180.67E0 , 198.44E0 , 226.86E0 , 229.65E0 , 258.27E0 , 273.77E0 , 339.15E0 , 350.13E0 , 362.75E0 , 371.03E0 , 393.32E0 , 448.53E0 , 473.78E0 , 511.12E0 , 524.70E0 , 548.75E0 , 551.64E0 , 574.02E0 , 623.86E0 , 21.46E0 , 24.33E0 , 33.43E0 , 39.22E0 , 44.18E0 , 55.02E0 , 94.33E0 , 96.44E0 , 118.82E0 , 128.48E0 ,
-141.94E0 , 156.92E0 , 171.65E0 , 190.00E0 , 223.26E0 , 223.88E0 , 231.50E0 , 265.05E0 , 269.44E0 , 271.78E0 , 273.46E0 , 334.61E0 , 339.79E0 , 349.52E0 , 358.18E0 , 377.98E0 , 394.77E0 , 429.66E0 , 468.22E0 , 487.27E0 , 519.54E0 , 523.03E0 , 612.99E0 , 638.59E0 , 641.36E0 , 622.05E0 , 631.50E0 , 663.97E0 , 646.9E0  , 748.29E0 , 749.21E0 , 750.14E0 , 647.04E0 , 646.89E0 , 746.9E0  , 748.43E0 , 747.35E0 , 749.27E0 , 647.61E0 , 747.78E0 , 750.51E0 , 851.37E0 , 845.97E0 , 847.54E0 , 849.93E0 , 851.61E0 , 849.75E0 , 850.98E0 , 848.23E0};
+const double hahn1_functor::m_x[236] = {
+    24.41E0,  34.82E0,  44.09E0,  45.07E0,  54.98E0,  65.51E0,  70.53E0,  75.70E0,  89.57E0,  91.14E0,  96.40E0,
+    97.19E0,  114.26E0, 120.25E0, 127.08E0, 133.55E0, 133.61E0, 158.67E0, 172.74E0, 171.31E0, 202.14E0, 220.55E0,
+    221.05E0, 221.39E0, 250.99E0, 268.99E0, 271.80E0, 271.97E0, 321.31E0, 321.69E0, 330.14E0, 333.03E0, 333.47E0,
+    340.77E0, 345.65E0, 373.11E0, 373.79E0, 411.82E0, 419.51E0, 421.59E0, 422.02E0, 422.47E0, 422.61E0, 441.75E0,
+    447.41E0, 448.7E0,  472.89E0, 476.69E0, 522.47E0, 522.62E0, 524.43E0, 546.75E0, 549.53E0, 575.29E0, 576.00E0,
+    625.55E0, 20.15E0,  28.78E0,  29.57E0,  37.41E0,  39.12E0,  50.24E0,  61.38E0,  66.25E0,  73.42E0,  95.52E0,
+    107.32E0, 122.04E0, 134.03E0, 163.19E0, 163.48E0, 175.70E0, 179.86E0, 211.27E0, 217.78E0, 219.14E0, 262.52E0,
+    268.01E0, 268.62E0, 336.25E0, 337.23E0, 339.33E0, 427.38E0, 428.58E0, 432.68E0, 528.99E0, 531.08E0, 628.34E0,
+    253.24E0, 273.13E0, 273.66E0, 282.10E0, 346.62E0, 347.19E0, 348.78E0, 351.18E0, 450.10E0, 450.35E0, 451.92E0,
+    455.56E0, 552.22E0, 553.56E0, 555.74E0, 652.59E0, 656.20E0, 14.13E0,  20.41E0,  31.30E0,  33.84E0,  39.70E0,
+    48.83E0,  54.50E0,  60.41E0,  72.77E0,  75.25E0,  86.84E0,  94.88E0,  96.40E0,  117.37E0, 139.08E0, 147.73E0,
+    158.63E0, 161.84E0, 192.11E0, 206.76E0, 209.07E0, 213.32E0, 226.44E0, 237.12E0, 330.90E0, 358.72E0, 370.77E0,
+    372.72E0, 396.24E0, 416.59E0, 484.02E0, 495.47E0, 514.78E0, 515.65E0, 519.47E0, 544.47E0, 560.11E0, 620.77E0,
+    18.97E0,  28.93E0,  33.91E0,  40.03E0,  44.66E0,  49.87E0,  55.16E0,  60.90E0,  72.08E0,  85.15E0,  97.06E0,
+    119.63E0, 133.27E0, 143.84E0, 161.91E0, 180.67E0, 198.44E0, 226.86E0, 229.65E0, 258.27E0, 273.77E0, 339.15E0,
+    350.13E0, 362.75E0, 371.03E0, 393.32E0, 448.53E0, 473.78E0, 511.12E0, 524.70E0, 548.75E0, 551.64E0, 574.02E0,
+    623.86E0, 21.46E0,  24.33E0,  33.43E0,  39.22E0,  44.18E0,  55.02E0,  94.33E0,  96.44E0,  118.82E0, 128.48E0,
+    141.94E0, 156.92E0, 171.65E0, 190.00E0, 223.26E0, 223.88E0, 231.50E0, 265.05E0, 269.44E0, 271.78E0, 273.46E0,
+    334.61E0, 339.79E0, 349.52E0, 358.18E0, 377.98E0, 394.77E0, 429.66E0, 468.22E0, 487.27E0, 519.54E0, 523.03E0,
+    612.99E0, 638.59E0, 641.36E0, 622.05E0, 631.50E0, 663.97E0, 646.9E0,  748.29E0, 749.21E0, 750.14E0, 647.04E0,
+    646.89E0, 746.9E0,  748.43E0, 747.35E0, 749.27E0, 647.61E0, 747.78E0, 750.51E0, 851.37E0, 845.97E0, 847.54E0,
+    849.93E0, 851.61E0, 849.75E0, 850.98E0, 848.23E0};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/hahn1.shtml
-void testNistHahn1(void)
-{
-  const int  n=7;
+void testNistHahn1(void) {
+  const int n = 7;
   int info;
 
   VectorXd x(n);
@@ -857,7 +829,7 @@
   /*
    * First try
    */
-  x<< 10., -1., .05, -.00001, -.05, .001, -.000001;
+  x << 10., -1., .05, -.00001, -.05, .001, -.000001;
   // do the computation
   hahn1_functor functor;
   LevenbergMarquardt<hahn1_functor> lm(functor);
@@ -871,17 +843,17 @@
   VERIFY_IS_APPROX(lm.fvec.squaredNorm(), 1.5324382854E+00);
   // check x
   VERIFY_IS_APPROX(x[0], 1.0776351733E+00);
-  VERIFY_IS_APPROX(x[1],-1.2269296921E-01);
+  VERIFY_IS_APPROX(x[1], -1.2269296921E-01);
   VERIFY_IS_APPROX(x[2], 4.0863750610E-03);
-  VERIFY_IS_APPROX(x[3],-1.426264e-06); // shoulde be : -1.4262662514E-06
-  VERIFY_IS_APPROX(x[4],-5.7609940901E-03);
+  VERIFY_IS_APPROX(x[3], -1.426264e-06);  // shoulde be : -1.4262662514E-06
+  VERIFY_IS_APPROX(x[4], -5.7609940901E-03);
   VERIFY_IS_APPROX(x[5], 2.4053735503E-04);
-  VERIFY_IS_APPROX(x[6],-1.2314450199E-07);
+  VERIFY_IS_APPROX(x[6], -1.2314450199E-07);
 
   /*
    * Second try
    */
-  x<< .1, -.1, .005, -.000001, -.005, .0001, -.0000001;
+  x << .1, -.1, .005, -.000001, -.005, .0001, -.0000001;
   // do the computation
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
@@ -892,50 +864,47 @@
   // check norm^2
   VERIFY_IS_APPROX(lm.fvec.squaredNorm(), 1.5324382854E+00);
   // check x
-  VERIFY_IS_APPROX(x[0], 1.077640); // should be :  1.0776351733E+00
-  VERIFY_IS_APPROX(x[1], -0.1226933); // should be : -1.2269296921E-01
-  VERIFY_IS_APPROX(x[2], 0.004086383); // should be : 4.0863750610E-03
-  VERIFY_IS_APPROX(x[3], -1.426277e-06); // shoulde be : -1.4262662514E-06
-  VERIFY_IS_APPROX(x[4],-5.7609940901E-03);
-  VERIFY_IS_APPROX(x[5], 0.00024053772); // should be : 2.4053735503E-04
-  VERIFY_IS_APPROX(x[6], -1.231450e-07); // should be : -1.2314450199E-07
-
+  VERIFY_IS_APPROX(x[0], 1.077640);       // should be :  1.0776351733E+00
+  VERIFY_IS_APPROX(x[1], -0.1226933);     // should be : -1.2269296921E-01
+  VERIFY_IS_APPROX(x[2], 0.004086383);    // should be : 4.0863750610E-03
+  VERIFY_IS_APPROX(x[3], -1.426277e-06);  // shoulde be : -1.4262662514E-06
+  VERIFY_IS_APPROX(x[4], -5.7609940901E-03);
+  VERIFY_IS_APPROX(x[5], 0.00024053772);  // should be : 2.4053735503E-04
+  VERIFY_IS_APPROX(x[6], -1.231450e-07);  // should be : -1.2314450199E-07
 }
 
-struct misra1d_functor : Functor<double>
-{
-    misra1d_functor(void) : Functor<double>(2,14) {}
-    static const double x[14];
-    static const double y[14];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        assert(b.size()==2);
-        assert(fvec.size()==14);
-        for(int i=0; i<14; i++) {
-            fvec[i] = b[0]*b[1]*x[i]/(1.+b[1]*x[i]) - y[i];
-        }
-        return 0;
+struct misra1d_functor : Functor<double> {
+  misra1d_functor(void) : Functor<double>(2, 14) {}
+  static const double x[14];
+  static const double y[14];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    assert(b.size() == 2);
+    assert(fvec.size() == 14);
+    for (int i = 0; i < 14; i++) {
+      fvec[i] = b[0] * b[1] * x[i] / (1. + b[1] * x[i]) - y[i];
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==2);
-        assert(fjac.rows()==14);
-        assert(fjac.cols()==2);
-        for(int i=0; i<14; i++) {
-            double den = 1.+b[1]*x[i];
-            fjac(i,0) = b[1]*x[i] / den;
-            fjac(i,1) = b[0]*x[i]*(den-b[1]*x[i])/den/den;
-        }
-        return 0;
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 2);
+    assert(fjac.rows() == 14);
+    assert(fjac.cols() == 2);
+    for (int i = 0; i < 14; i++) {
+      double den = 1. + b[1] * x[i];
+      fjac(i, 0) = b[1] * x[i] / den;
+      fjac(i, 1) = b[0] * x[i] * (den - b[1] * x[i]) / den / den;
     }
+    return 0;
+  }
 };
-const double misra1d_functor::x[14] = { 77.6E0, 114.9E0, 141.1E0, 190.8E0, 239.9E0, 289.0E0, 332.8E0, 378.4E0, 434.8E0, 477.3E0, 536.8E0, 593.1E0, 689.1E0, 760.0E0};
-const double misra1d_functor::y[14] = { 10.07E0, 14.73E0, 17.94E0, 23.93E0, 29.61E0, 35.18E0, 40.02E0, 44.82E0, 50.76E0, 55.05E0, 61.01E0, 66.40E0, 75.47E0, 81.78E0};
+const double misra1d_functor::x[14] = {77.6E0,  114.9E0, 141.1E0, 190.8E0, 239.9E0, 289.0E0, 332.8E0,
+                                       378.4E0, 434.8E0, 477.3E0, 536.8E0, 593.1E0, 689.1E0, 760.0E0};
+const double misra1d_functor::y[14] = {10.07E0, 14.73E0, 17.94E0, 23.93E0, 29.61E0, 35.18E0, 40.02E0,
+                                       44.82E0, 50.76E0, 55.05E0, 61.01E0, 66.40E0, 75.47E0, 81.78E0};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/misra1d.shtml
-void testNistMisra1d(void)
-{
-  const int n=2;
+void testNistMisra1d(void) {
+  const int n = 2;
   int info;
 
   VectorXd x(n);
@@ -943,7 +912,7 @@
   /*
    * First try
    */
-  x<< 500., 0.0001;
+  x << 500., 0.0001;
   // do the computation
   misra1d_functor functor;
   LevenbergMarquardt<misra1d_functor> lm(functor);
@@ -962,7 +931,7 @@
   /*
    * Second try
    */
-  x<< 450., 0.0003;
+  x << 450., 0.0003;
   // do the computation
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
@@ -977,43 +946,48 @@
   VERIFY_IS_APPROX(x[1], 3.0227324449E-04);
 }
 
-
-struct lanczos1_functor : Functor<double>
-{
-    lanczos1_functor(void) : Functor<double>(6,24) {}
-    static const double x[24];
-    static const double y[24];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        assert(b.size()==6);
-        assert(fvec.size()==24);
-        for(int i=0; i<24; i++)
-            fvec[i] = b[0]*exp(-b[1]*x[i]) + b[2]*exp(-b[3]*x[i]) + b[4]*exp(-b[5]*x[i])  - y[i];
-        return 0;
+struct lanczos1_functor : Functor<double> {
+  lanczos1_functor(void) : Functor<double>(6, 24) {}
+  static const double x[24];
+  static const double y[24];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    assert(b.size() == 6);
+    assert(fvec.size() == 24);
+    for (int i = 0; i < 24; i++)
+      fvec[i] = b[0] * exp(-b[1] * x[i]) + b[2] * exp(-b[3] * x[i]) + b[4] * exp(-b[5] * x[i]) - y[i];
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 6);
+    assert(fjac.rows() == 24);
+    assert(fjac.cols() == 6);
+    for (int i = 0; i < 24; i++) {
+      fjac(i, 0) = exp(-b[1] * x[i]);
+      fjac(i, 1) = -b[0] * x[i] * exp(-b[1] * x[i]);
+      fjac(i, 2) = exp(-b[3] * x[i]);
+      fjac(i, 3) = -b[2] * x[i] * exp(-b[3] * x[i]);
+      fjac(i, 4) = exp(-b[5] * x[i]);
+      fjac(i, 5) = -b[4] * x[i] * exp(-b[5] * x[i]);
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==6);
-        assert(fjac.rows()==24);
-        assert(fjac.cols()==6);
-        for(int i=0; i<24; i++) {
-            fjac(i,0) = exp(-b[1]*x[i]);
-            fjac(i,1) = -b[0]*x[i]*exp(-b[1]*x[i]);
-            fjac(i,2) = exp(-b[3]*x[i]);
-            fjac(i,3) = -b[2]*x[i]*exp(-b[3]*x[i]);
-            fjac(i,4) = exp(-b[5]*x[i]);
-            fjac(i,5) = -b[4]*x[i]*exp(-b[5]*x[i]);
-        }
-        return 0;
-    }
+    return 0;
+  }
 };
-const double lanczos1_functor::x[24] = { 0.000000000000E+00, 5.000000000000E-02, 1.000000000000E-01, 1.500000000000E-01, 2.000000000000E-01, 2.500000000000E-01, 3.000000000000E-01, 3.500000000000E-01, 4.000000000000E-01, 4.500000000000E-01, 5.000000000000E-01, 5.500000000000E-01, 6.000000000000E-01, 6.500000000000E-01, 7.000000000000E-01, 7.500000000000E-01, 8.000000000000E-01, 8.500000000000E-01, 9.000000000000E-01, 9.500000000000E-01, 1.000000000000E+00, 1.050000000000E+00, 1.100000000000E+00, 1.150000000000E+00 };
-const double lanczos1_functor::y[24] = { 2.513400000000E+00 ,2.044333373291E+00 ,1.668404436564E+00 ,1.366418021208E+00 ,1.123232487372E+00 ,9.268897180037E-01 ,7.679338563728E-01 ,6.388775523106E-01 ,5.337835317402E-01 ,4.479363617347E-01 ,3.775847884350E-01 ,3.197393199326E-01 ,2.720130773746E-01 ,2.324965529032E-01 ,1.996589546065E-01 ,1.722704126914E-01 ,1.493405660168E-01 ,1.300700206922E-01 ,1.138119324644E-01 ,1.000415587559E-01 ,8.833209084540E-02 ,7.833544019350E-02 ,6.976693743449E-02 ,6.239312536719E-02 };
+const double lanczos1_functor::x[24] = {0.000000000000E+00, 5.000000000000E-02, 1.000000000000E-01, 1.500000000000E-01,
+                                        2.000000000000E-01, 2.500000000000E-01, 3.000000000000E-01, 3.500000000000E-01,
+                                        4.000000000000E-01, 4.500000000000E-01, 5.000000000000E-01, 5.500000000000E-01,
+                                        6.000000000000E-01, 6.500000000000E-01, 7.000000000000E-01, 7.500000000000E-01,
+                                        8.000000000000E-01, 8.500000000000E-01, 9.000000000000E-01, 9.500000000000E-01,
+                                        1.000000000000E+00, 1.050000000000E+00, 1.100000000000E+00, 1.150000000000E+00};
+const double lanczos1_functor::y[24] = {2.513400000000E+00, 2.044333373291E+00, 1.668404436564E+00, 1.366418021208E+00,
+                                        1.123232487372E+00, 9.268897180037E-01, 7.679338563728E-01, 6.388775523106E-01,
+                                        5.337835317402E-01, 4.479363617347E-01, 3.775847884350E-01, 3.197393199326E-01,
+                                        2.720130773746E-01, 2.324965529032E-01, 1.996589546065E-01, 1.722704126914E-01,
+                                        1.493405660168E-01, 1.300700206922E-01, 1.138119324644E-01, 1.000415587559E-01,
+                                        8.833209084540E-02, 7.833544019350E-02, 6.976693743449E-02, 6.239312536719E-02};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/lanczos1.shtml
-void testNistLanczos1(void)
-{
-  const int n=6;
+void testNistLanczos1(void) {
+  const int n = 6;
   int info;
 
   VectorXd x(n);
@@ -1021,7 +995,7 @@
   /*
    * First try
    */
-  x<< 1.2, 0.3, 5.6, 5.5, 6.5, 7.6;
+  x << 1.2, 0.3, 5.6, 5.5, 6.5, 7.6;
   // do the computation
   lanczos1_functor functor;
   LevenbergMarquardt<lanczos1_functor> lm(functor);
@@ -1046,7 +1020,7 @@
   /*
    * Second try
    */
-  x<< 0.5, 0.7, 3.6, 4.2, 4., 6.3;
+  x << 0.5, 0.7, 3.6, 4.2, 4., 6.3;
   // do the computation
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
@@ -1063,45 +1037,42 @@
   VERIFY_IS_APPROX(x[3], 3.0000000002E+00);
   VERIFY_IS_APPROX(x[4], 1.5575999998E+00);
   VERIFY_IS_APPROX(x[5], 5.0000000001E+00);
-
 }
 
-struct rat42_functor : Functor<double>
-{
-    rat42_functor(void) : Functor<double>(3,9) {}
-    static const double x[9];
-    static const double y[9];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        assert(b.size()==3);
-        assert(fvec.size()==9);
-        for(int i=0; i<9; i++) {
-            fvec[i] = b[0] / (1.+exp(b[1]-b[2]*x[i])) - y[i];
-        }
-        return 0;
+struct rat42_functor : Functor<double> {
+  rat42_functor(void) : Functor<double>(3, 9) {}
+  static const double x[9];
+  static const double y[9];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    assert(b.size() == 3);
+    assert(fvec.size() == 9);
+    for (int i = 0; i < 9; i++) {
+      fvec[i] = b[0] / (1. + exp(b[1] - b[2] * x[i])) - y[i];
     }
+    return 0;
+  }
 
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==3);
-        assert(fjac.rows()==9);
-        assert(fjac.cols()==3);
-        for(int i=0; i<9; i++) {
-            double e = exp(b[1]-b[2]*x[i]);
-            fjac(i,0) = 1./(1.+e);
-            fjac(i,1) = -b[0]*e/(1.+e)/(1.+e);
-            fjac(i,2) = +b[0]*e*x[i]/(1.+e)/(1.+e);
-        }
-        return 0;
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 3);
+    assert(fjac.rows() == 9);
+    assert(fjac.cols() == 3);
+    for (int i = 0; i < 9; i++) {
+      double e = exp(b[1] - b[2] * x[i]);
+      fjac(i, 0) = 1. / (1. + e);
+      fjac(i, 1) = -b[0] * e / (1. + e) / (1. + e);
+      fjac(i, 2) = +b[0] * e * x[i] / (1. + e) / (1. + e);
     }
+    return 0;
+  }
 };
-const double rat42_functor::x[9] = { 9.000E0, 14.000E0, 21.000E0, 28.000E0, 42.000E0, 57.000E0, 63.000E0, 70.000E0, 79.000E0 };
-const double rat42_functor::y[9] = { 8.930E0 ,10.800E0 ,18.590E0 ,22.330E0 ,39.350E0 ,56.110E0 ,61.730E0 ,64.620E0 ,67.080E0 };
+const double rat42_functor::x[9] = {9.000E0,  14.000E0, 21.000E0, 28.000E0, 42.000E0,
+                                    57.000E0, 63.000E0, 70.000E0, 79.000E0};
+const double rat42_functor::y[9] = {8.930E0,  10.800E0, 18.590E0, 22.330E0, 39.350E0,
+                                    56.110E0, 61.730E0, 64.620E0, 67.080E0};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/ratkowsky2.shtml
-void testNistRat42(void)
-{
-  const int n=3;
+void testNistRat42(void) {
+  const int n = 3;
   int info;
 
   VectorXd x(n);
@@ -1109,7 +1080,7 @@
   /*
    * First try
    */
-  x<< 100., 1., 0.1;
+  x << 100., 1., 0.1;
   // do the computation
   rat42_functor functor;
   LevenbergMarquardt<rat42_functor> lm(functor);
@@ -1129,7 +1100,7 @@
   /*
    * Second try
    */
-  x<< 75., 2.5, 0.07;
+  x << 75., 2.5, 0.07;
   // do the computation
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
@@ -1145,41 +1116,40 @@
   VERIFY_IS_APPROX(x[2], 6.7359200066E-02);
 }
 
-struct MGH10_functor : Functor<double>
-{
-    MGH10_functor(void) : Functor<double>(3,16) {}
-    static const double x[16];
-    static const double y[16];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        assert(b.size()==3);
-        assert(fvec.size()==16);
-        for(int i=0; i<16; i++)
-            fvec[i] =  b[0] * exp(b[1]/(x[i]+b[2])) - y[i];
-        return 0;
+struct MGH10_functor : Functor<double> {
+  MGH10_functor(void) : Functor<double>(3, 16) {}
+  static const double x[16];
+  static const double y[16];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    assert(b.size() == 3);
+    assert(fvec.size() == 16);
+    for (int i = 0; i < 16; i++) fvec[i] = b[0] * exp(b[1] / (x[i] + b[2])) - y[i];
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 3);
+    assert(fjac.rows() == 16);
+    assert(fjac.cols() == 3);
+    for (int i = 0; i < 16; i++) {
+      double factor = 1. / (x[i] + b[2]);
+      double e = exp(b[1] * factor);
+      fjac(i, 0) = e;
+      fjac(i, 1) = b[0] * factor * e;
+      fjac(i, 2) = -b[1] * b[0] * factor * factor * e;
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==3);
-        assert(fjac.rows()==16);
-        assert(fjac.cols()==3);
-        for(int i=0; i<16; i++) {
-            double factor = 1./(x[i]+b[2]);
-            double e = exp(b[1]*factor);
-            fjac(i,0) = e;
-            fjac(i,1) = b[0]*factor*e;
-            fjac(i,2) = -b[1]*b[0]*factor*factor*e;
-        }
-        return 0;
-    }
+    return 0;
+  }
 };
-const double MGH10_functor::x[16] = { 5.000000E+01, 5.500000E+01, 6.000000E+01, 6.500000E+01, 7.000000E+01, 7.500000E+01, 8.000000E+01, 8.500000E+01, 9.000000E+01, 9.500000E+01, 1.000000E+02, 1.050000E+02, 1.100000E+02, 1.150000E+02, 1.200000E+02, 1.250000E+02 };
-const double MGH10_functor::y[16] = { 3.478000E+04, 2.861000E+04, 2.365000E+04, 1.963000E+04, 1.637000E+04, 1.372000E+04, 1.154000E+04, 9.744000E+03, 8.261000E+03, 7.030000E+03, 6.005000E+03, 5.147000E+03, 4.427000E+03, 3.820000E+03, 3.307000E+03, 2.872000E+03 };
+const double MGH10_functor::x[16] = {5.000000E+01, 5.500000E+01, 6.000000E+01, 6.500000E+01, 7.000000E+01, 7.500000E+01,
+                                     8.000000E+01, 8.500000E+01, 9.000000E+01, 9.500000E+01, 1.000000E+02, 1.050000E+02,
+                                     1.100000E+02, 1.150000E+02, 1.200000E+02, 1.250000E+02};
+const double MGH10_functor::y[16] = {3.478000E+04, 2.861000E+04, 2.365000E+04, 1.963000E+04, 1.637000E+04, 1.372000E+04,
+                                     1.154000E+04, 9.744000E+03, 8.261000E+03, 7.030000E+03, 6.005000E+03, 5.147000E+03,
+                                     4.427000E+03, 3.820000E+03, 3.307000E+03, 2.872000E+03};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/mgh10.shtml
-void testNistMGH10(void)
-{
-  const int n=3;
+void testNistMGH10(void) {
+  const int n = 3;
   int info;
 
   VectorXd x(n);
@@ -1187,7 +1157,7 @@
   /*
    * First try
    */
-  x<< 2., 400000., 25000.;
+  x << 2., 400000., 25000.;
   // do the computation
   MGH10_functor functor;
   LevenbergMarquardt<MGH10_functor> lm(functor);
@@ -1195,8 +1165,8 @@
   EIGEN_UNUSED_VARIABLE(info)
 
   // check return value
-  // VERIFY_IS_EQUAL(info, 2); 
-  LM_CHECK_N_ITERS(lm, 284, 249); 
+  // VERIFY_IS_EQUAL(info, 2);
+  LM_CHECK_N_ITERS(lm, 284, 249);
   // check norm^2
   VERIFY_IS_APPROX(lm.fvec.squaredNorm(), 8.7945855171E+01);
   // check x
@@ -1207,7 +1177,7 @@
   /*
    * Second try
    */
-  x<< 0.02, 4000., 250.;
+  x << 0.02, 4000., 250.;
   // do the computation
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
@@ -1223,39 +1193,33 @@
   VERIFY_IS_APPROX(x[2], 3.4522363462E+02);
 }
 
-
-struct BoxBOD_functor : Functor<double>
-{
-    BoxBOD_functor(void) : Functor<double>(2,6) {}
-    static const double x[6];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        static const double y[6] = { 109., 149., 149., 191., 213., 224. };
-        assert(b.size()==2);
-        assert(fvec.size()==6);
-        for(int i=0; i<6; i++)
-            fvec[i] =  b[0]*(1.-exp(-b[1]*x[i])) - y[i];
-        return 0;
+struct BoxBOD_functor : Functor<double> {
+  BoxBOD_functor(void) : Functor<double>(2, 6) {}
+  static const double x[6];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    static const double y[6] = {109., 149., 149., 191., 213., 224.};
+    assert(b.size() == 2);
+    assert(fvec.size() == 6);
+    for (int i = 0; i < 6; i++) fvec[i] = b[0] * (1. - exp(-b[1] * x[i])) - y[i];
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 2);
+    assert(fjac.rows() == 6);
+    assert(fjac.cols() == 2);
+    for (int i = 0; i < 6; i++) {
+      double e = exp(-b[1] * x[i]);
+      fjac(i, 0) = 1. - e;
+      fjac(i, 1) = b[0] * x[i] * e;
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==2);
-        assert(fjac.rows()==6);
-        assert(fjac.cols()==2);
-        for(int i=0; i<6; i++) {
-            double e = exp(-b[1]*x[i]);
-            fjac(i,0) = 1.-e;
-            fjac(i,1) = b[0]*x[i]*e;
-        }
-        return 0;
-    }
+    return 0;
+  }
 };
-const double BoxBOD_functor::x[6] = { 1., 2., 3., 5., 7., 10. };
+const double BoxBOD_functor::x[6] = {1., 2., 3., 5., 7., 10.};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/boxbod.shtml
-void testNistBoxBOD(void)
-{
-  const int n=2;
+void testNistBoxBOD(void) {
+  const int n = 2;
   int info;
 
   VectorXd x(n);
@@ -1263,12 +1227,12 @@
   /*
    * First try
    */
-  x<< 1., 1.;
+  x << 1., 1.;
   // do the computation
   BoxBOD_functor functor;
   LevenbergMarquardt<BoxBOD_functor> lm(functor);
-  lm.parameters.ftol = 1.E6*NumTraits<double>::epsilon();
-  lm.parameters.xtol = 1.E6*NumTraits<double>::epsilon();
+  lm.parameters.ftol = 1.E6 * NumTraits<double>::epsilon();
+  lm.parameters.xtol = 1.E6 * NumTraits<double>::epsilon();
   lm.parameters.factor = 10.;
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
@@ -1285,7 +1249,7 @@
   /*
    * Second try
    */
-  x<< 100., 0.75;
+  x << 100., 0.75;
   // do the computation
   lm.resetParameters();
   lm.parameters.ftol = NumTraits<double>::epsilon();
@@ -1303,41 +1267,46 @@
   VERIFY_IS_APPROX(x[1], 5.4723748542E-01);
 }
 
-struct MGH17_functor : Functor<double>
-{
-    MGH17_functor(void) : Functor<double>(5,33) {}
-    static const double x[33];
-    static const double y[33];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        assert(b.size()==5);
-        assert(fvec.size()==33);
-        for(int i=0; i<33; i++)
-            fvec[i] =  b[0] + b[1]*exp(-b[3]*x[i]) +  b[2]*exp(-b[4]*x[i]) - y[i];
-        return 0;
+struct MGH17_functor : Functor<double> {
+  MGH17_functor(void) : Functor<double>(5, 33) {}
+  static const double x[33];
+  static const double y[33];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    assert(b.size() == 5);
+    assert(fvec.size() == 33);
+    for (int i = 0; i < 33; i++) fvec[i] = b[0] + b[1] * exp(-b[3] * x[i]) + b[2] * exp(-b[4] * x[i]) - y[i];
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 5);
+    assert(fjac.rows() == 33);
+    assert(fjac.cols() == 5);
+    for (int i = 0; i < 33; i++) {
+      fjac(i, 0) = 1.;
+      fjac(i, 1) = exp(-b[3] * x[i]);
+      fjac(i, 2) = exp(-b[4] * x[i]);
+      fjac(i, 3) = -x[i] * b[1] * exp(-b[3] * x[i]);
+      fjac(i, 4) = -x[i] * b[2] * exp(-b[4] * x[i]);
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==5);
-        assert(fjac.rows()==33);
-        assert(fjac.cols()==5);
-        for(int i=0; i<33; i++) {
-            fjac(i,0) = 1.;
-            fjac(i,1) = exp(-b[3]*x[i]);
-            fjac(i,2) = exp(-b[4]*x[i]);
-            fjac(i,3) = -x[i]*b[1]*exp(-b[3]*x[i]);
-            fjac(i,4) = -x[i]*b[2]*exp(-b[4]*x[i]);
-        }
-        return 0;
-    }
+    return 0;
+  }
 };
-const double MGH17_functor::x[33] = { 0.000000E+00, 1.000000E+01, 2.000000E+01, 3.000000E+01, 4.000000E+01, 5.000000E+01, 6.000000E+01, 7.000000E+01, 8.000000E+01, 9.000000E+01, 1.000000E+02, 1.100000E+02, 1.200000E+02, 1.300000E+02, 1.400000E+02, 1.500000E+02, 1.600000E+02, 1.700000E+02, 1.800000E+02, 1.900000E+02, 2.000000E+02, 2.100000E+02, 2.200000E+02, 2.300000E+02, 2.400000E+02, 2.500000E+02, 2.600000E+02, 2.700000E+02, 2.800000E+02, 2.900000E+02, 3.000000E+02, 3.100000E+02, 3.200000E+02 };
-const double MGH17_functor::y[33] = { 8.440000E-01, 9.080000E-01, 9.320000E-01, 9.360000E-01, 9.250000E-01, 9.080000E-01, 8.810000E-01, 8.500000E-01, 8.180000E-01, 7.840000E-01, 7.510000E-01, 7.180000E-01, 6.850000E-01, 6.580000E-01, 6.280000E-01, 6.030000E-01, 5.800000E-01, 5.580000E-01, 5.380000E-01, 5.220000E-01, 5.060000E-01, 4.900000E-01, 4.780000E-01, 4.670000E-01, 4.570000E-01, 4.480000E-01, 4.380000E-01, 4.310000E-01, 4.240000E-01, 4.200000E-01, 4.140000E-01, 4.110000E-01, 4.060000E-01 };
+const double MGH17_functor::x[33] = {0.000000E+00, 1.000000E+01, 2.000000E+01, 3.000000E+01, 4.000000E+01, 5.000000E+01,
+                                     6.000000E+01, 7.000000E+01, 8.000000E+01, 9.000000E+01, 1.000000E+02, 1.100000E+02,
+                                     1.200000E+02, 1.300000E+02, 1.400000E+02, 1.500000E+02, 1.600000E+02, 1.700000E+02,
+                                     1.800000E+02, 1.900000E+02, 2.000000E+02, 2.100000E+02, 2.200000E+02, 2.300000E+02,
+                                     2.400000E+02, 2.500000E+02, 2.600000E+02, 2.700000E+02, 2.800000E+02, 2.900000E+02,
+                                     3.000000E+02, 3.100000E+02, 3.200000E+02};
+const double MGH17_functor::y[33] = {8.440000E-01, 9.080000E-01, 9.320000E-01, 9.360000E-01, 9.250000E-01, 9.080000E-01,
+                                     8.810000E-01, 8.500000E-01, 8.180000E-01, 7.840000E-01, 7.510000E-01, 7.180000E-01,
+                                     6.850000E-01, 6.580000E-01, 6.280000E-01, 6.030000E-01, 5.800000E-01, 5.580000E-01,
+                                     5.380000E-01, 5.220000E-01, 5.060000E-01, 4.900000E-01, 4.780000E-01, 4.670000E-01,
+                                     4.570000E-01, 4.480000E-01, 4.380000E-01, 4.310000E-01, 4.240000E-01, 4.200000E-01,
+                                     4.140000E-01, 4.110000E-01, 4.060000E-01};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/mgh17.shtml
-void testNistMGH17(void)
-{
-  const int n=5;
+void testNistMGH17(void) {
+  const int n = 5;
   int info;
 
   VectorXd x(n);
@@ -1345,7 +1314,7 @@
   /*
    * First try
    */
-  x<< 50., 150., -100., 1., 2.;
+  x << 50., 150., -100., 1., 2.;
   // do the computation
   MGH17_functor functor;
   LevenbergMarquardt<MGH17_functor> lm(functor);
@@ -1363,15 +1332,15 @@
   VERIFY_IS_APPROX(x[2], -1.4646871366E+00);
   VERIFY_IS_APPROX(x[3], 1.2867534640E-02);
   VERIFY_IS_APPROX(x[4], 2.2122699662E-02);
-  
+
   // check return value
-  // VERIFY_IS_EQUAL(info, 2); 
+  // VERIFY_IS_EQUAL(info, 2);
   LM_CHECK_N_ITERS(lm, 602, 545);
 
   /*
    * Second try
    */
-  x<< 0.5  ,1.5  ,-1   ,0.01 ,0.02;
+  x << 0.5, 1.5, -1, 0.01, 0.02;
   // do the computation
   lm.resetParameters();
   info = lm.minimize(x);
@@ -1390,44 +1359,42 @@
   VERIFY_IS_APPROX(x[4], 2.2122699662E-02);
 }
 
-struct MGH09_functor : Functor<double>
-{
-    MGH09_functor(void) : Functor<double>(4,11) {}
-    static const double _x[11];
-    static const double y[11];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        assert(b.size()==4);
-        assert(fvec.size()==11);
-        for(int i=0; i<11; i++) {
-            double x = _x[i], xx=x*x;
-            fvec[i] = b[0]*(xx+x*b[1])/(xx+x*b[2]+b[3]) - y[i];
-        }
-        return 0;
+struct MGH09_functor : Functor<double> {
+  MGH09_functor(void) : Functor<double>(4, 11) {}
+  static const double _x[11];
+  static const double y[11];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    assert(b.size() == 4);
+    assert(fvec.size() == 11);
+    for (int i = 0; i < 11; i++) {
+      double x = _x[i], xx = x * x;
+      fvec[i] = b[0] * (xx + x * b[1]) / (xx + x * b[2] + b[3]) - y[i];
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==4);
-        assert(fjac.rows()==11);
-        assert(fjac.cols()==4);
-        for(int i=0; i<11; i++) {
-            double x = _x[i], xx=x*x;
-            double factor = 1./(xx+x*b[2]+b[3]);
-            fjac(i,0) = (xx+x*b[1]) * factor;
-            fjac(i,1) = b[0]*x* factor;
-            fjac(i,2) = - b[0]*(xx+x*b[1]) * x * factor * factor;
-            fjac(i,3) = - b[0]*(xx+x*b[1]) * factor * factor;
-        }
-        return 0;
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 4);
+    assert(fjac.rows() == 11);
+    assert(fjac.cols() == 4);
+    for (int i = 0; i < 11; i++) {
+      double x = _x[i], xx = x * x;
+      double factor = 1. / (xx + x * b[2] + b[3]);
+      fjac(i, 0) = (xx + x * b[1]) * factor;
+      fjac(i, 1) = b[0] * x * factor;
+      fjac(i, 2) = -b[0] * (xx + x * b[1]) * x * factor * factor;
+      fjac(i, 3) = -b[0] * (xx + x * b[1]) * factor * factor;
     }
+    return 0;
+  }
 };
-const double MGH09_functor::_x[11] = { 4., 2., 1., 5.E-1 , 2.5E-01, 1.670000E-01, 1.250000E-01,  1.E-01, 8.330000E-02, 7.140000E-02, 6.250000E-02 };
-const double MGH09_functor::y[11] = { 1.957000E-01, 1.947000E-01, 1.735000E-01, 1.600000E-01, 8.440000E-02, 6.270000E-02, 4.560000E-02, 3.420000E-02, 3.230000E-02, 2.350000E-02, 2.460000E-02 };
+const double MGH09_functor::_x[11] = {4.,           2.,     1.,           5.E-1,        2.5E-01,     1.670000E-01,
+                                      1.250000E-01, 1.E-01, 8.330000E-02, 7.140000E-02, 6.250000E-02};
+const double MGH09_functor::y[11] = {1.957000E-01, 1.947000E-01, 1.735000E-01, 1.600000E-01, 8.440000E-02, 6.270000E-02,
+                                     4.560000E-02, 3.420000E-02, 3.230000E-02, 2.350000E-02, 2.460000E-02};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/mgh09.shtml
-void testNistMGH09(void)
-{
-  const int n=4;
+void testNistMGH09(void) {
+  const int n = 4;
   int info;
 
   VectorXd x(n);
@@ -1435,7 +1402,7 @@
   /*
    * First try
    */
-  x<< 25., 39, 41.5, 39.;
+  x << 25., 39, 41.5, 39.;
   // do the computation
   MGH09_functor functor;
   LevenbergMarquardt<MGH09_functor> lm(functor);
@@ -1449,15 +1416,15 @@
   // check norm^2
   VERIFY_IS_APPROX(lm.fvec.squaredNorm(), 3.0750560385E-04);
   // check x
-  VERIFY_IS_APPROX(x[0], 0.1928077089); // should be 1.9280693458E-01
-  VERIFY_IS_APPROX(x[1], 0.19126423573); // should be 1.9128232873E-01
-  VERIFY_IS_APPROX(x[2], 0.12305309914); // should be 1.2305650693E-01
-  VERIFY_IS_APPROX(x[3], 0.13605395375); // should be 1.3606233068E-01
+  VERIFY_IS_APPROX(x[0], 0.1928077089);   // should be 1.9280693458E-01
+  VERIFY_IS_APPROX(x[1], 0.19126423573);  // should be 1.9128232873E-01
+  VERIFY_IS_APPROX(x[2], 0.12305309914);  // should be 1.2305650693E-01
+  VERIFY_IS_APPROX(x[3], 0.13605395375);  // should be 1.3606233068E-01
 
   /*
    * Second try
    */
-  x<< 0.25, 0.39, 0.415, 0.39;
+  x << 0.25, 0.39, 0.415, 0.39;
   // do the computation
   lm.resetParameters();
   info = lm.minimize(x);
@@ -1469,51 +1436,79 @@
   // check norm^2
   VERIFY_IS_APPROX(lm.fvec.squaredNorm(), 3.0750560385E-04);
   // check x
-  VERIFY_IS_APPROX(x[0], 0.19280781); // should be 1.9280693458E-01
-  VERIFY_IS_APPROX(x[1], 0.19126265); // should be 1.9128232873E-01
-  VERIFY_IS_APPROX(x[2], 0.12305280); // should be 1.2305650693E-01
-  VERIFY_IS_APPROX(x[3], 0.13605322); // should be 1.3606233068E-01
+  VERIFY_IS_APPROX(x[0], 0.19280781);  // should be 1.9280693458E-01
+  VERIFY_IS_APPROX(x[1], 0.19126265);  // should be 1.9128232873E-01
+  VERIFY_IS_APPROX(x[2], 0.12305280);  // should be 1.2305650693E-01
+  VERIFY_IS_APPROX(x[3], 0.13605322);  // should be 1.3606233068E-01
 }
 
-
-
-struct Bennett5_functor : Functor<double>
-{
-    Bennett5_functor(void) : Functor<double>(3,154) {}
-    static const double x[154];
-    static const double y[154];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        assert(b.size()==3);
-        assert(fvec.size()==154);
-        for(int i=0; i<154; i++)
-            fvec[i] = b[0]* pow(b[1]+x[i],-1./b[2]) - y[i];
-        return 0;
+struct Bennett5_functor : Functor<double> {
+  Bennett5_functor(void) : Functor<double>(3, 154) {}
+  static const double x[154];
+  static const double y[154];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    assert(b.size() == 3);
+    assert(fvec.size() == 154);
+    for (int i = 0; i < 154; i++) fvec[i] = b[0] * pow(b[1] + x[i], -1. / b[2]) - y[i];
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 3);
+    assert(fjac.rows() == 154);
+    assert(fjac.cols() == 3);
+    for (int i = 0; i < 154; i++) {
+      double e = pow(b[1] + x[i], -1. / b[2]);
+      fjac(i, 0) = e;
+      fjac(i, 1) = -b[0] * e / b[2] / (b[1] + x[i]);
+      fjac(i, 2) = b[0] * e * log(b[1] + x[i]) / b[2] / b[2];
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==3);
-        assert(fjac.rows()==154);
-        assert(fjac.cols()==3);
-        for(int i=0; i<154; i++) {
-            double e = pow(b[1]+x[i],-1./b[2]);
-            fjac(i,0) = e;
-            fjac(i,1) = - b[0]*e/b[2]/(b[1]+x[i]);
-            fjac(i,2) = b[0]*e*log(b[1]+x[i])/b[2]/b[2];
-        }
-        return 0;
-    }
+    return 0;
+  }
 };
-const double Bennett5_functor::x[154] = { 7.447168E0, 8.102586E0, 8.452547E0, 8.711278E0, 8.916774E0, 9.087155E0, 9.232590E0, 9.359535E0, 9.472166E0, 9.573384E0, 9.665293E0, 9.749461E0, 9.827092E0, 9.899128E0, 9.966321E0, 10.029280E0, 10.088510E0, 10.144430E0, 10.197380E0, 10.247670E0, 10.295560E0, 10.341250E0, 10.384950E0, 10.426820E0, 10.467000E0, 10.505640E0, 10.542830E0, 10.578690E0, 10.613310E0, 10.646780E0, 10.679150E0, 10.710520E0, 10.740920E0, 10.770440E0, 10.799100E0, 10.826970E0, 10.854080E0, 10.880470E0, 10.906190E0, 10.931260E0, 10.955720E0, 10.979590E0, 11.002910E0, 11.025700E0, 11.047980E0, 11.069770E0, 11.091100E0, 11.111980E0, 11.132440E0, 11.152480E0, 11.172130E0, 11.191410E0, 11.210310E0, 11.228870E0, 11.247090E0, 11.264980E0, 11.282560E0, 11.299840E0, 11.316820E0, 11.333520E0, 11.349940E0, 11.366100E0, 11.382000E0, 11.397660E0, 11.413070E0, 11.428240E0, 11.443200E0, 11.457930E0, 11.472440E0, 11.486750E0, 11.500860E0, 11.514770E0, 11.528490E0, 11.542020E0, 11.555380E0, 11.568550E0,
-11.581560E0, 11.594420E0, 11.607121E0, 11.619640E0, 11.632000E0, 11.644210E0, 11.656280E0, 11.668200E0, 11.679980E0, 11.691620E0, 11.703130E0, 11.714510E0, 11.725760E0, 11.736880E0, 11.747890E0, 11.758780E0, 11.769550E0, 11.780200E0, 11.790730E0, 11.801160E0, 11.811480E0, 11.821700E0, 11.831810E0, 11.841820E0, 11.851730E0, 11.861550E0, 11.871270E0, 11.880890E0, 11.890420E0, 11.899870E0, 11.909220E0, 11.918490E0, 11.927680E0, 11.936780E0, 11.945790E0, 11.954730E0, 11.963590E0, 11.972370E0, 11.981070E0, 11.989700E0, 11.998260E0, 12.006740E0, 12.015150E0, 12.023490E0, 12.031760E0, 12.039970E0, 12.048100E0, 12.056170E0, 12.064180E0, 12.072120E0, 12.080010E0, 12.087820E0, 12.095580E0, 12.103280E0, 12.110920E0, 12.118500E0, 12.126030E0, 12.133500E0, 12.140910E0, 12.148270E0, 12.155570E0, 12.162830E0, 12.170030E0, 12.177170E0, 12.184270E0, 12.191320E0, 12.198320E0, 12.205270E0, 12.212170E0, 12.219030E0, 12.225840E0, 12.232600E0, 12.239320E0, 12.245990E0, 12.252620E0, 12.259200E0, 12.265750E0, 12.272240E0 };
-const double Bennett5_functor::y[154] = { -34.834702E0 ,-34.393200E0 ,-34.152901E0 ,-33.979099E0 ,-33.845901E0 ,-33.732899E0 ,-33.640301E0 ,-33.559200E0 ,-33.486801E0 ,-33.423100E0 ,-33.365101E0 ,-33.313000E0 ,-33.260899E0 ,-33.217400E0 ,-33.176899E0 ,-33.139198E0 ,-33.101601E0 ,-33.066799E0 ,-33.035000E0 ,-33.003101E0 ,-32.971298E0 ,-32.942299E0 ,-32.916302E0 ,-32.890202E0 ,-32.864101E0 ,-32.841000E0 ,-32.817799E0 ,-32.797501E0 ,-32.774300E0 ,-32.757000E0 ,-32.733799E0 ,-32.716400E0 ,-32.699100E0 ,-32.678799E0 ,-32.661400E0 ,-32.644001E0 ,-32.626701E0 ,-32.612202E0 ,-32.597698E0 ,-32.583199E0 ,-32.568699E0 ,-32.554298E0 ,-32.539799E0 ,-32.525299E0 ,-32.510799E0 ,-32.499199E0 ,-32.487598E0 ,-32.473202E0 ,-32.461601E0 ,-32.435501E0 ,-32.435501E0 ,-32.426800E0 ,-32.412300E0 ,-32.400799E0 ,-32.392101E0 ,-32.380501E0 ,-32.366001E0 ,-32.357300E0 ,-32.348598E0 ,-32.339901E0 ,-32.328400E0 ,-32.319698E0 ,-32.311001E0 ,-32.299400E0 ,-32.290699E0 ,-32.282001E0 ,-32.273300E0 ,-32.264599E0 ,-32.256001E0 ,-32.247299E0
-,-32.238602E0 ,-32.229900E0 ,-32.224098E0 ,-32.215401E0 ,-32.203800E0 ,-32.198002E0 ,-32.189400E0 ,-32.183601E0 ,-32.174900E0 ,-32.169102E0 ,-32.163300E0 ,-32.154598E0 ,-32.145901E0 ,-32.140099E0 ,-32.131401E0 ,-32.125599E0 ,-32.119801E0 ,-32.111198E0 ,-32.105400E0 ,-32.096699E0 ,-32.090900E0 ,-32.088001E0 ,-32.079300E0 ,-32.073502E0 ,-32.067699E0 ,-32.061901E0 ,-32.056099E0 ,-32.050301E0 ,-32.044498E0 ,-32.038799E0 ,-32.033001E0 ,-32.027199E0 ,-32.024300E0 ,-32.018501E0 ,-32.012699E0 ,-32.004002E0 ,-32.001099E0 ,-31.995300E0 ,-31.989500E0 ,-31.983700E0 ,-31.977900E0 ,-31.972099E0 ,-31.969299E0 ,-31.963501E0 ,-31.957701E0 ,-31.951900E0 ,-31.946100E0 ,-31.940300E0 ,-31.937401E0 ,-31.931601E0 ,-31.925800E0 ,-31.922899E0 ,-31.917101E0 ,-31.911301E0 ,-31.908400E0 ,-31.902599E0 ,-31.896900E0 ,-31.893999E0 ,-31.888201E0 ,-31.885300E0 ,-31.882401E0 ,-31.876600E0 ,-31.873699E0 ,-31.867901E0 ,-31.862101E0 ,-31.859200E0 ,-31.856300E0 ,-31.850500E0 ,-31.844700E0 ,-31.841801E0 ,-31.838900E0 ,-31.833099E0 ,-31.830200E0 ,
--31.827299E0 ,-31.821600E0 ,-31.818701E0 ,-31.812901E0 ,-31.809999E0 ,-31.807100E0 ,-31.801300E0 ,-31.798401E0 ,-31.795500E0 ,-31.789700E0 ,-31.786800E0 };
+const double Bennett5_functor::x[154] = {
+    7.447168E0,  8.102586E0,  8.452547E0,  8.711278E0,  8.916774E0,  9.087155E0,  9.232590E0,  9.359535E0,  9.472166E0,
+    9.573384E0,  9.665293E0,  9.749461E0,  9.827092E0,  9.899128E0,  9.966321E0,  10.029280E0, 10.088510E0, 10.144430E0,
+    10.197380E0, 10.247670E0, 10.295560E0, 10.341250E0, 10.384950E0, 10.426820E0, 10.467000E0, 10.505640E0, 10.542830E0,
+    10.578690E0, 10.613310E0, 10.646780E0, 10.679150E0, 10.710520E0, 10.740920E0, 10.770440E0, 10.799100E0, 10.826970E0,
+    10.854080E0, 10.880470E0, 10.906190E0, 10.931260E0, 10.955720E0, 10.979590E0, 11.002910E0, 11.025700E0, 11.047980E0,
+    11.069770E0, 11.091100E0, 11.111980E0, 11.132440E0, 11.152480E0, 11.172130E0, 11.191410E0, 11.210310E0, 11.228870E0,
+    11.247090E0, 11.264980E0, 11.282560E0, 11.299840E0, 11.316820E0, 11.333520E0, 11.349940E0, 11.366100E0, 11.382000E0,
+    11.397660E0, 11.413070E0, 11.428240E0, 11.443200E0, 11.457930E0, 11.472440E0, 11.486750E0, 11.500860E0, 11.514770E0,
+    11.528490E0, 11.542020E0, 11.555380E0, 11.568550E0, 11.581560E0, 11.594420E0, 11.607121E0, 11.619640E0, 11.632000E0,
+    11.644210E0, 11.656280E0, 11.668200E0, 11.679980E0, 11.691620E0, 11.703130E0, 11.714510E0, 11.725760E0, 11.736880E0,
+    11.747890E0, 11.758780E0, 11.769550E0, 11.780200E0, 11.790730E0, 11.801160E0, 11.811480E0, 11.821700E0, 11.831810E0,
+    11.841820E0, 11.851730E0, 11.861550E0, 11.871270E0, 11.880890E0, 11.890420E0, 11.899870E0, 11.909220E0, 11.918490E0,
+    11.927680E0, 11.936780E0, 11.945790E0, 11.954730E0, 11.963590E0, 11.972370E0, 11.981070E0, 11.989700E0, 11.998260E0,
+    12.006740E0, 12.015150E0, 12.023490E0, 12.031760E0, 12.039970E0, 12.048100E0, 12.056170E0, 12.064180E0, 12.072120E0,
+    12.080010E0, 12.087820E0, 12.095580E0, 12.103280E0, 12.110920E0, 12.118500E0, 12.126030E0, 12.133500E0, 12.140910E0,
+    12.148270E0, 12.155570E0, 12.162830E0, 12.170030E0, 12.177170E0, 12.184270E0, 12.191320E0, 12.198320E0, 12.205270E0,
+    12.212170E0, 12.219030E0, 12.225840E0, 12.232600E0, 12.239320E0, 12.245990E0, 12.252620E0, 12.259200E0, 12.265750E0,
+    12.272240E0};
+const double Bennett5_functor::y[154] = {
+    -34.834702E0, -34.393200E0, -34.152901E0, -33.979099E0, -33.845901E0, -33.732899E0, -33.640301E0, -33.559200E0,
+    -33.486801E0, -33.423100E0, -33.365101E0, -33.313000E0, -33.260899E0, -33.217400E0, -33.176899E0, -33.139198E0,
+    -33.101601E0, -33.066799E0, -33.035000E0, -33.003101E0, -32.971298E0, -32.942299E0, -32.916302E0, -32.890202E0,
+    -32.864101E0, -32.841000E0, -32.817799E0, -32.797501E0, -32.774300E0, -32.757000E0, -32.733799E0, -32.716400E0,
+    -32.699100E0, -32.678799E0, -32.661400E0, -32.644001E0, -32.626701E0, -32.612202E0, -32.597698E0, -32.583199E0,
+    -32.568699E0, -32.554298E0, -32.539799E0, -32.525299E0, -32.510799E0, -32.499199E0, -32.487598E0, -32.473202E0,
+    -32.461601E0, -32.435501E0, -32.435501E0, -32.426800E0, -32.412300E0, -32.400799E0, -32.392101E0, -32.380501E0,
+    -32.366001E0, -32.357300E0, -32.348598E0, -32.339901E0, -32.328400E0, -32.319698E0, -32.311001E0, -32.299400E0,
+    -32.290699E0, -32.282001E0, -32.273300E0, -32.264599E0, -32.256001E0, -32.247299E0, -32.238602E0, -32.229900E0,
+    -32.224098E0, -32.215401E0, -32.203800E0, -32.198002E0, -32.189400E0, -32.183601E0, -32.174900E0, -32.169102E0,
+    -32.163300E0, -32.154598E0, -32.145901E0, -32.140099E0, -32.131401E0, -32.125599E0, -32.119801E0, -32.111198E0,
+    -32.105400E0, -32.096699E0, -32.090900E0, -32.088001E0, -32.079300E0, -32.073502E0, -32.067699E0, -32.061901E0,
+    -32.056099E0, -32.050301E0, -32.044498E0, -32.038799E0, -32.033001E0, -32.027199E0, -32.024300E0, -32.018501E0,
+    -32.012699E0, -32.004002E0, -32.001099E0, -31.995300E0, -31.989500E0, -31.983700E0, -31.977900E0, -31.972099E0,
+    -31.969299E0, -31.963501E0, -31.957701E0, -31.951900E0, -31.946100E0, -31.940300E0, -31.937401E0, -31.931601E0,
+    -31.925800E0, -31.922899E0, -31.917101E0, -31.911301E0, -31.908400E0, -31.902599E0, -31.896900E0, -31.893999E0,
+    -31.888201E0, -31.885300E0, -31.882401E0, -31.876600E0, -31.873699E0, -31.867901E0, -31.862101E0, -31.859200E0,
+    -31.856300E0, -31.850500E0, -31.844700E0, -31.841801E0, -31.838900E0, -31.833099E0, -31.830200E0, -31.827299E0,
+    -31.821600E0, -31.818701E0, -31.812901E0, -31.809999E0, -31.807100E0, -31.801300E0, -31.798401E0, -31.795500E0,
+    -31.789700E0, -31.786800E0};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/bennett5.shtml
-void testNistBennett5(void)
-{
-  const int  n=3;
+void testNistBennett5(void) {
+  const int n = 3;
   int info;
 
   VectorXd x(n);
@@ -1521,7 +1516,7 @@
   /*
    * First try
    */
-  x<< -2000., 50., 0.8;
+  x << -2000., 50., 0.8;
   // do the computation
   Bennett5_functor functor;
   LevenbergMarquardt<Bennett5_functor> lm(functor);
@@ -1541,7 +1536,7 @@
   /*
    * Second try
    */
-  x<< -1500., 45., 0.85;
+  x << -1500., 45., 0.85;
   // do the computation
   lm.resetParameters();
   info = lm.minimize(x);
@@ -1553,54 +1548,60 @@
   // check norm^2
   VERIFY_IS_APPROX(lm.fvec.squaredNorm(), 5.2404744073E-04);
   // check x
-  VERIFY_IS_APPROX(x[0], -2523.3007865); // should be -2.5235058043E+03
-  VERIFY_IS_APPROX(x[1], 46.735705771); // should be 4.6736564644E+01);
-  VERIFY_IS_APPROX(x[2], 0.93219881891); // should be 9.3218483193E-01);
+  VERIFY_IS_APPROX(x[0], -2523.3007865);  // should be -2.5235058043E+03
+  VERIFY_IS_APPROX(x[1], 46.735705771);   // should be 4.6736564644E+01);
+  VERIFY_IS_APPROX(x[2], 0.93219881891);  // should be 9.3218483193E-01);
 }
 
-struct thurber_functor : Functor<double>
-{
-    thurber_functor(void) : Functor<double>(7,37) {}
-    static const double _x[37];
-    static const double _y[37];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        //        int called=0; printf("call hahn1_functor with  iflag=%d, called=%d\n", iflag, called); if (iflag==1) called++;
-        assert(b.size()==7);
-        assert(fvec.size()==37);
-        for(int i=0; i<37; i++) {
-            double x=_x[i], xx=x*x, xxx=xx*x;
-            fvec[i] = (b[0]+b[1]*x+b[2]*xx+b[3]*xxx) / (1.+b[4]*x+b[5]*xx+b[6]*xxx) - _y[i];
-        }
-        return 0;
+struct thurber_functor : Functor<double> {
+  thurber_functor(void) : Functor<double>(7, 37) {}
+  static const double _x[37];
+  static const double _y[37];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    //        int called=0; printf("call hahn1_functor with  iflag=%d, called=%d\n", iflag, called); if (iflag==1)
+    //        called++;
+    assert(b.size() == 7);
+    assert(fvec.size() == 37);
+    for (int i = 0; i < 37; i++) {
+      double x = _x[i], xx = x * x, xxx = xx * x;
+      fvec[i] = (b[0] + b[1] * x + b[2] * xx + b[3] * xxx) / (1. + b[4] * x + b[5] * xx + b[6] * xxx) - _y[i];
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==7);
-        assert(fjac.rows()==37);
-        assert(fjac.cols()==7);
-        for(int i=0; i<37; i++) {
-            double x=_x[i], xx=x*x, xxx=xx*x;
-            double fact = 1./(1.+b[4]*x+b[5]*xx+b[6]*xxx);
-            fjac(i,0) = 1.*fact;
-            fjac(i,1) = x*fact;
-            fjac(i,2) = xx*fact;
-            fjac(i,3) = xxx*fact;
-            fact = - (b[0]+b[1]*x+b[2]*xx+b[3]*xxx) * fact * fact;
-            fjac(i,4) = x*fact;
-            fjac(i,5) = xx*fact;
-            fjac(i,6) = xxx*fact;
-        }
-        return 0;
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 7);
+    assert(fjac.rows() == 37);
+    assert(fjac.cols() == 7);
+    for (int i = 0; i < 37; i++) {
+      double x = _x[i], xx = x * x, xxx = xx * x;
+      double fact = 1. / (1. + b[4] * x + b[5] * xx + b[6] * xxx);
+      fjac(i, 0) = 1. * fact;
+      fjac(i, 1) = x * fact;
+      fjac(i, 2) = xx * fact;
+      fjac(i, 3) = xxx * fact;
+      fact = -(b[0] + b[1] * x + b[2] * xx + b[3] * xxx) * fact * fact;
+      fjac(i, 4) = x * fact;
+      fjac(i, 5) = xx * fact;
+      fjac(i, 6) = xxx * fact;
     }
+    return 0;
+  }
 };
-const double thurber_functor::_x[37] = { -3.067E0, -2.981E0, -2.921E0, -2.912E0, -2.840E0, -2.797E0, -2.702E0, -2.699E0, -2.633E0, -2.481E0, -2.363E0, -2.322E0, -1.501E0, -1.460E0, -1.274E0, -1.212E0, -1.100E0, -1.046E0, -0.915E0, -0.714E0, -0.566E0, -0.545E0, -0.400E0, -0.309E0, -0.109E0, -0.103E0, 0.010E0, 0.119E0, 0.377E0, 0.790E0, 0.963E0, 1.006E0, 1.115E0, 1.572E0, 1.841E0, 2.047E0, 2.200E0 };
-const double thurber_functor::_y[37] = { 80.574E0, 84.248E0, 87.264E0, 87.195E0, 89.076E0, 89.608E0, 89.868E0, 90.101E0, 92.405E0, 95.854E0, 100.696E0, 101.060E0, 401.672E0, 390.724E0, 567.534E0, 635.316E0, 733.054E0, 759.087E0, 894.206E0, 990.785E0, 1090.109E0, 1080.914E0, 1122.643E0, 1178.351E0, 1260.531E0, 1273.514E0, 1288.339E0, 1327.543E0, 1353.863E0, 1414.509E0, 1425.208E0, 1421.384E0, 1442.962E0, 1464.350E0, 1468.705E0, 1447.894E0, 1457.628E0};
+const double thurber_functor::_x[37] = {-3.067E0, -2.981E0, -2.921E0, -2.912E0, -2.840E0, -2.797E0, -2.702E0, -2.699E0,
+                                        -2.633E0, -2.481E0, -2.363E0, -2.322E0, -1.501E0, -1.460E0, -1.274E0, -1.212E0,
+                                        -1.100E0, -1.046E0, -0.915E0, -0.714E0, -0.566E0, -0.545E0, -0.400E0, -0.309E0,
+                                        -0.109E0, -0.103E0, 0.010E0,  0.119E0,  0.377E0,  0.790E0,  0.963E0,  1.006E0,
+                                        1.115E0,  1.572E0,  1.841E0,  2.047E0,  2.200E0};
+const double thurber_functor::_y[37] = {
+    80.574E0,   84.248E0,   87.264E0,   87.195E0,   89.076E0,   89.608E0,   89.868E0,   90.101E0,
+    92.405E0,   95.854E0,   100.696E0,  101.060E0,  401.672E0,  390.724E0,  567.534E0,  635.316E0,
+    733.054E0,  759.087E0,  894.206E0,  990.785E0,  1090.109E0, 1080.914E0, 1122.643E0, 1178.351E0,
+    1260.531E0, 1273.514E0, 1288.339E0, 1327.543E0, 1353.863E0, 1414.509E0, 1425.208E0, 1421.384E0,
+    1442.962E0, 1464.350E0, 1468.705E0, 1447.894E0, 1457.628E0};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/thurber.shtml
-void testNistThurber(void)
-{
-  const int n=7;
+void testNistThurber(void) {
+  const int n = 7;
   int info;
 
   VectorXd x(n);
@@ -1608,18 +1609,18 @@
   /*
    * First try
    */
-  x<< 1000 ,1000 ,400 ,40 ,0.7,0.3,0.0 ;
+  x << 1000, 1000, 400, 40, 0.7, 0.3, 0.0;
   // do the computation
   thurber_functor functor;
   LevenbergMarquardt<thurber_functor> lm(functor);
-  lm.parameters.ftol = 1.E4*NumTraits<double>::epsilon();
-  lm.parameters.xtol = 1.E4*NumTraits<double>::epsilon();
+  lm.parameters.ftol = 1.E4 * NumTraits<double>::epsilon();
+  lm.parameters.xtol = 1.E4 * NumTraits<double>::epsilon();
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
 
   // check return value
   // VERIFY_IS_EQUAL(info, 1);
-  LM_CHECK_N_ITERS(lm, 39,36);
+  LM_CHECK_N_ITERS(lm, 39, 36);
   // check norm^2
   VERIFY_IS_APPROX(lm.fvec.squaredNorm(), 5.6427082397E+03);
   // check x
@@ -1634,11 +1635,11 @@
   /*
    * Second try
    */
-  x<< 1300 ,1500 ,500  ,75   ,1    ,0.4  ,0.05  ;
+  x << 1300, 1500, 500, 75, 1, 0.4, 0.05;
   // do the computation
   lm.resetParameters();
-  lm.parameters.ftol = 1.E4*NumTraits<double>::epsilon();
-  lm.parameters.xtol = 1.E4*NumTraits<double>::epsilon();
+  lm.parameters.ftol = 1.E4 * NumTraits<double>::epsilon();
+  lm.parameters.xtol = 1.E4 * NumTraits<double>::epsilon();
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
 
@@ -1657,42 +1658,38 @@
   VERIFY_IS_APPROX(x[6], 4.9727297349E-02);
 }
 
-struct rat43_functor : Functor<double>
-{
-    rat43_functor(void) : Functor<double>(4,15) {}
-    static const double x[15];
-    static const double y[15];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        assert(b.size()==4);
-        assert(fvec.size()==15);
-        for(int i=0; i<15; i++)
-            fvec[i] = b[0] * pow(1.+exp(b[1]-b[2]*x[i]),-1./b[3]) - y[i];
-        return 0;
+struct rat43_functor : Functor<double> {
+  rat43_functor(void) : Functor<double>(4, 15) {}
+  static const double x[15];
+  static const double y[15];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    assert(b.size() == 4);
+    assert(fvec.size() == 15);
+    for (int i = 0; i < 15; i++) fvec[i] = b[0] * pow(1. + exp(b[1] - b[2] * x[i]), -1. / b[3]) - y[i];
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 4);
+    assert(fjac.rows() == 15);
+    assert(fjac.cols() == 4);
+    for (int i = 0; i < 15; i++) {
+      double e = exp(b[1] - b[2] * x[i]);
+      double power = -1. / b[3];
+      fjac(i, 0) = pow(1. + e, power);
+      fjac(i, 1) = power * b[0] * e * pow(1. + e, power - 1.);
+      fjac(i, 2) = -power * b[0] * e * x[i] * pow(1. + e, power - 1.);
+      fjac(i, 3) = b[0] * power * power * log(1. + e) * pow(1. + e, power);
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==4);
-        assert(fjac.rows()==15);
-        assert(fjac.cols()==4);
-        for(int i=0; i<15; i++) {
-            double e = exp(b[1]-b[2]*x[i]);
-            double power = -1./b[3];
-            fjac(i,0) = pow(1.+e, power);
-            fjac(i,1) = power*b[0]*e*pow(1.+e, power-1.);
-            fjac(i,2) = -power*b[0]*e*x[i]*pow(1.+e, power-1.);
-            fjac(i,3) = b[0]*power*power*log(1.+e)*pow(1.+e, power);
-        }
-        return 0;
-    }
+    return 0;
+  }
 };
-const double rat43_functor::x[15] = { 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15. };
-const double rat43_functor::y[15] = { 16.08, 33.83, 65.80, 97.20, 191.55, 326.20, 386.87, 520.53, 590.03, 651.92, 724.93, 699.56, 689.96, 637.56, 717.41 };
+const double rat43_functor::x[15] = {1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.};
+const double rat43_functor::y[15] = {16.08,  33.83,  65.80,  97.20,  191.55, 326.20, 386.87, 520.53,
+                                     590.03, 651.92, 724.93, 699.56, 689.96, 637.56, 717.41};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/ratkowsky3.shtml
-void testNistRat43(void)
-{
-  const int n=4;
+void testNistRat43(void) {
+  const int n = 4;
   int info;
 
   VectorXd x(n);
@@ -1700,12 +1697,12 @@
   /*
    * First try
    */
-  x<< 100., 10., 1., 1.;
+  x << 100., 10., 1., 1.;
   // do the computation
   rat43_functor functor;
   LevenbergMarquardt<rat43_functor> lm(functor);
-  lm.parameters.ftol = 1.E6*NumTraits<double>::epsilon();
-  lm.parameters.xtol = 1.E6*NumTraits<double>::epsilon();
+  lm.parameters.ftol = 1.E6 * NumTraits<double>::epsilon();
+  lm.parameters.xtol = 1.E6 * NumTraits<double>::epsilon();
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
 
@@ -1723,11 +1720,11 @@
   /*
    * Second try
    */
-  x<< 700., 5., 0.75, 1.3;
+  x << 700., 5., 0.75, 1.3;
   // do the computation
   lm.resetParameters();
-  lm.parameters.ftol = 1.E5*NumTraits<double>::epsilon();
-  lm.parameters.xtol = 1.E5*NumTraits<double>::epsilon();
+  lm.parameters.ftol = 1.E5 * NumTraits<double>::epsilon();
+  lm.parameters.xtol = 1.E5 * NumTraits<double>::epsilon();
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
 
@@ -1743,43 +1740,44 @@
   VERIFY_IS_APPROX(x[3], 1.2792483859E+00);
 }
 
-
-
-struct eckerle4_functor : Functor<double>
-{
-    eckerle4_functor(void) : Functor<double>(3,35) {}
-    static const double x[35];
-    static const double y[35];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        assert(b.size()==3);
-        assert(fvec.size()==35);
-        for(int i=0; i<35; i++)
-            fvec[i] = b[0]/b[1] * exp(-0.5*(x[i]-b[2])*(x[i]-b[2])/(b[1]*b[1])) - y[i];
-        return 0;
+struct eckerle4_functor : Functor<double> {
+  eckerle4_functor(void) : Functor<double>(3, 35) {}
+  static const double x[35];
+  static const double y[35];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    assert(b.size() == 3);
+    assert(fvec.size() == 35);
+    for (int i = 0; i < 35; i++)
+      fvec[i] = b[0] / b[1] * exp(-0.5 * (x[i] - b[2]) * (x[i] - b[2]) / (b[1] * b[1])) - y[i];
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 3);
+    assert(fjac.rows() == 35);
+    assert(fjac.cols() == 3);
+    for (int i = 0; i < 35; i++) {
+      double b12 = b[1] * b[1];
+      double e = exp(-0.5 * (x[i] - b[2]) * (x[i] - b[2]) / b12);
+      fjac(i, 0) = e / b[1];
+      fjac(i, 1) = ((x[i] - b[2]) * (x[i] - b[2]) / b12 - 1.) * b[0] * e / b12;
+      fjac(i, 2) = (x[i] - b[2]) * e * b[0] / b[1] / b12;
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==3);
-        assert(fjac.rows()==35);
-        assert(fjac.cols()==3);
-        for(int i=0; i<35; i++) {
-            double b12 = b[1]*b[1];
-            double e = exp(-0.5*(x[i]-b[2])*(x[i]-b[2])/b12);
-            fjac(i,0) = e / b[1];
-            fjac(i,1) = ((x[i]-b[2])*(x[i]-b[2])/b12-1.) * b[0]*e/b12;
-            fjac(i,2) = (x[i]-b[2])*e*b[0]/b[1]/b12;
-        }
-        return 0;
-    }
+    return 0;
+  }
 };
-const double eckerle4_functor::x[35] = { 400.0, 405.0, 410.0, 415.0, 420.0, 425.0, 430.0, 435.0, 436.5, 438.0, 439.5, 441.0, 442.5, 444.0, 445.5, 447.0, 448.5, 450.0, 451.5, 453.0, 454.5, 456.0, 457.5, 459.0, 460.5, 462.0, 463.5, 465.0, 470.0, 475.0, 480.0, 485.0, 490.0, 495.0, 500.0};
-const double eckerle4_functor::y[35] = { 0.0001575, 0.0001699, 0.0002350, 0.0003102, 0.0004917, 0.0008710, 0.0017418, 0.0046400, 0.0065895, 0.0097302, 0.0149002, 0.0237310, 0.0401683, 0.0712559, 0.1264458, 0.2073413, 0.2902366, 0.3445623, 0.3698049, 0.3668534, 0.3106727, 0.2078154, 0.1164354, 0.0616764, 0.0337200, 0.0194023, 0.0117831, 0.0074357, 0.0022732, 0.0008800, 0.0004579, 0.0002345, 0.0001586, 0.0001143, 0.0000710 };
+const double eckerle4_functor::x[35] = {400.0, 405.0, 410.0, 415.0, 420.0, 425.0, 430.0, 435.0, 436.5,
+                                        438.0, 439.5, 441.0, 442.5, 444.0, 445.5, 447.0, 448.5, 450.0,
+                                        451.5, 453.0, 454.5, 456.0, 457.5, 459.0, 460.5, 462.0, 463.5,
+                                        465.0, 470.0, 475.0, 480.0, 485.0, 490.0, 495.0, 500.0};
+const double eckerle4_functor::y[35] = {0.0001575, 0.0001699, 0.0002350, 0.0003102, 0.0004917, 0.0008710, 0.0017418,
+                                        0.0046400, 0.0065895, 0.0097302, 0.0149002, 0.0237310, 0.0401683, 0.0712559,
+                                        0.1264458, 0.2073413, 0.2902366, 0.3445623, 0.3698049, 0.3668534, 0.3106727,
+                                        0.2078154, 0.1164354, 0.0616764, 0.0337200, 0.0194023, 0.0117831, 0.0074357,
+                                        0.0022732, 0.0008800, 0.0004579, 0.0002345, 0.0001586, 0.0001143, 0.0000710};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/eckerle4.shtml
-void testNistEckerle4(void)
-{
-  const int n=3;
+void testNistEckerle4(void) {
+  const int n = 3;
   int info;
 
   VectorXd x(n);
@@ -1787,7 +1785,7 @@
   /*
    * First try
    */
-  x<< 1., 10., 500.;
+  x << 1., 10., 500.;
   // do the computation
   eckerle4_functor functor;
   LevenbergMarquardt<eckerle4_functor> lm(functor);
@@ -1807,7 +1805,7 @@
   /*
    * Second try
    */
-  x<< 1.5, 5., 450.;
+  x << 1.5, 5., 450.;
   // do the computation
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
@@ -1823,40 +1821,39 @@
   VERIFY_IS_APPROX(x[2], 4.5154121844E+02);
 }
 
-EIGEN_DECLARE_TEST(NonLinearOptimization)
-{
-    // Tests using the examples provided by (c)minpack
-    CALL_SUBTEST/*_1*/(testChkder());
-    CALL_SUBTEST/*_1*/(testLmder1());
-    CALL_SUBTEST/*_1*/(testLmder());
-    CALL_SUBTEST/*_2*/(testHybrj1());
-    CALL_SUBTEST/*_2*/(testHybrj());
-    CALL_SUBTEST/*_2*/(testHybrd1());
-    CALL_SUBTEST/*_2*/(testHybrd());
-    CALL_SUBTEST/*_3*/(testLmstr1());
-    CALL_SUBTEST/*_3*/(testLmstr());
-    CALL_SUBTEST/*_3*/(testLmdif1());
-    CALL_SUBTEST/*_3*/(testLmdif());
+EIGEN_DECLARE_TEST(NonLinearOptimization) {
+  // Tests using the examples provided by (c)minpack
+  CALL_SUBTEST /*_1*/ (testChkder());
+  CALL_SUBTEST /*_1*/ (testLmder1());
+  CALL_SUBTEST /*_1*/ (testLmder());
+  CALL_SUBTEST /*_2*/ (testHybrj1());
+  CALL_SUBTEST /*_2*/ (testHybrj());
+  CALL_SUBTEST /*_2*/ (testHybrd1());
+  CALL_SUBTEST /*_2*/ (testHybrd());
+  CALL_SUBTEST /*_3*/ (testLmstr1());
+  CALL_SUBTEST /*_3*/ (testLmstr());
+  CALL_SUBTEST /*_3*/ (testLmdif1());
+  CALL_SUBTEST /*_3*/ (testLmdif());
 
-    // NIST tests, level of difficulty = "Lower"
-    CALL_SUBTEST/*_4*/(testNistMisra1a());
-    CALL_SUBTEST/*_4*/(testNistChwirut2());
+  // NIST tests, level of difficulty = "Lower"
+  CALL_SUBTEST /*_4*/ (testNistMisra1a());
+  CALL_SUBTEST /*_4*/ (testNistChwirut2());
 
-    // NIST tests, level of difficulty = "Average"
-    CALL_SUBTEST/*_5*/(testNistHahn1());
-    CALL_SUBTEST/*_6*/(testNistMisra1d());
-    CALL_SUBTEST/*_7*/(testNistMGH17());
-    CALL_SUBTEST/*_8*/(testNistLanczos1());
+  // NIST tests, level of difficulty = "Average"
+  CALL_SUBTEST /*_5*/ (testNistHahn1());
+  CALL_SUBTEST /*_6*/ (testNistMisra1d());
+  CALL_SUBTEST /*_7*/ (testNistMGH17());
+  CALL_SUBTEST /*_8*/ (testNistLanczos1());
 
-//     // NIST tests, level of difficulty = "Higher"
-    CALL_SUBTEST/*_9*/(testNistRat42());
-//     CALL_SUBTEST/*_10*/(testNistMGH10());
-    CALL_SUBTEST/*_11*/(testNistBoxBOD());
-//     CALL_SUBTEST/*_12*/(testNistMGH09());
-    CALL_SUBTEST/*_13*/(testNistBennett5());
-    CALL_SUBTEST/*_14*/(testNistThurber());
-    CALL_SUBTEST/*_15*/(testNistRat43());
-    CALL_SUBTEST/*_16*/(testNistEckerle4());
+  //     // NIST tests, level of difficulty = "Higher"
+  CALL_SUBTEST /*_9*/ (testNistRat42());
+  //     CALL_SUBTEST/*_10*/(testNistMGH10());
+  CALL_SUBTEST /*_11*/ (testNistBoxBOD());
+  //     CALL_SUBTEST/*_12*/(testNistMGH09());
+  CALL_SUBTEST /*_13*/ (testNistBennett5());
+  CALL_SUBTEST /*_14*/ (testNistThurber());
+  CALL_SUBTEST /*_15*/ (testNistRat43());
+  CALL_SUBTEST /*_16*/ (testNistEckerle4());
 }
 
 /*
@@ -1880,4 +1877,3 @@
   std::cout << x[2] << std::endl;
   std::cout << x[3] << std::endl;
 */
-
diff --git a/unsupported/test/NumericalDiff.cpp b/unsupported/test/NumericalDiff.cpp
index 96e7f19..543f34f 100644
--- a/unsupported/test/NumericalDiff.cpp
+++ b/unsupported/test/NumericalDiff.cpp
@@ -7,108 +7,96 @@
 
 #include "main.h"
 #include <unsupported/Eigen/NumericalDiff>
-    
+
 // Generic functor
-template<typename Scalar_, int NX=Dynamic, int NY=Dynamic>
-struct Functor
-{
+template <typename Scalar_, int NX = Dynamic, int NY = Dynamic>
+struct Functor {
   typedef Scalar_ Scalar;
-  enum {
-    InputsAtCompileTime = NX,
-    ValuesAtCompileTime = NY
-  };
-  typedef Matrix<Scalar,InputsAtCompileTime,1> InputType;
-  typedef Matrix<Scalar,ValuesAtCompileTime,1> ValueType;
-  typedef Matrix<Scalar,ValuesAtCompileTime,InputsAtCompileTime> JacobianType;
-  
+  enum { InputsAtCompileTime = NX, ValuesAtCompileTime = NY };
+  typedef Matrix<Scalar, InputsAtCompileTime, 1> InputType;
+  typedef Matrix<Scalar, ValuesAtCompileTime, 1> ValueType;
+  typedef Matrix<Scalar, ValuesAtCompileTime, InputsAtCompileTime> JacobianType;
+
   int m_inputs, m_values;
-  
+
   Functor() : m_inputs(InputsAtCompileTime), m_values(ValuesAtCompileTime) {}
   Functor(int inputs_, int values_) : m_inputs(inputs_), m_values(values_) {}
-  
+
   int inputs() const { return m_inputs; }
   int values() const { return m_values; }
-
 };
 
-struct my_functor : Functor<double>
-{
-    my_functor(void): Functor<double>(3,15) {}
-    int operator()(const VectorXd &x, VectorXd &fvec) const
-    {
-        double tmp1, tmp2, tmp3;
-        double y[15] = {1.4e-1, 1.8e-1, 2.2e-1, 2.5e-1, 2.9e-1, 3.2e-1, 3.5e-1,
-            3.9e-1, 3.7e-1, 5.8e-1, 7.3e-1, 9.6e-1, 1.34, 2.1, 4.39};
+struct my_functor : Functor<double> {
+  my_functor(void) : Functor<double>(3, 15) {}
+  int operator()(const VectorXd &x, VectorXd &fvec) const {
+    double tmp1, tmp2, tmp3;
+    double y[15] = {1.4e-1, 1.8e-1, 2.2e-1, 2.5e-1, 2.9e-1, 3.2e-1, 3.5e-1, 3.9e-1,
+                    3.7e-1, 5.8e-1, 7.3e-1, 9.6e-1, 1.34,   2.1,    4.39};
 
-        for (int i = 0; i < values(); i++)
-        {
-            tmp1 = i+1;
-            tmp2 = 16 - i - 1;
-            tmp3 = (i>=8)? tmp2 : tmp1;
-            fvec[i] = y[i] - (x[0] + tmp1/(x[1]*tmp2 + x[2]*tmp3));
-        }
-        return 0;
+    for (int i = 0; i < values(); i++) {
+      tmp1 = i + 1;
+      tmp2 = 16 - i - 1;
+      tmp3 = (i >= 8) ? tmp2 : tmp1;
+      fvec[i] = y[i] - (x[0] + tmp1 / (x[1] * tmp2 + x[2] * tmp3));
     }
+    return 0;
+  }
 
-    int actual_df(const VectorXd &x, MatrixXd &fjac) const
-    {
-        double tmp1, tmp2, tmp3, tmp4;
-        for (int i = 0; i < values(); i++)
-        {
-            tmp1 = i+1;
-            tmp2 = 16 - i - 1;
-            tmp3 = (i>=8)? tmp2 : tmp1;
-            tmp4 = (x[1]*tmp2 + x[2]*tmp3); tmp4 = tmp4*tmp4;
-            fjac(i,0) = -1;
-            fjac(i,1) = tmp1*tmp2/tmp4;
-            fjac(i,2) = tmp1*tmp3/tmp4;
-        }
-        return 0;
+  int actual_df(const VectorXd &x, MatrixXd &fjac) const {
+    double tmp1, tmp2, tmp3, tmp4;
+    for (int i = 0; i < values(); i++) {
+      tmp1 = i + 1;
+      tmp2 = 16 - i - 1;
+      tmp3 = (i >= 8) ? tmp2 : tmp1;
+      tmp4 = (x[1] * tmp2 + x[2] * tmp3);
+      tmp4 = tmp4 * tmp4;
+      fjac(i, 0) = -1;
+      fjac(i, 1) = tmp1 * tmp2 / tmp4;
+      fjac(i, 2) = tmp1 * tmp3 / tmp4;
     }
+    return 0;
+  }
 };
 
-void test_forward()
-{
-    VectorXd x(3);
-    MatrixXd jac(15,3);
-    MatrixXd actual_jac(15,3);
-    my_functor functor;
+void test_forward() {
+  VectorXd x(3);
+  MatrixXd jac(15, 3);
+  MatrixXd actual_jac(15, 3);
+  my_functor functor;
 
-    x << 0.082, 1.13, 2.35;
+  x << 0.082, 1.13, 2.35;
 
-    // real one 
-    functor.actual_df(x, actual_jac);
-//    std::cout << actual_jac << std::endl << std::endl;
+  // real one
+  functor.actual_df(x, actual_jac);
+  //    std::cout << actual_jac << std::endl << std::endl;
 
-    // using NumericalDiff
-    NumericalDiff<my_functor> numDiff(functor);
-    numDiff.df(x, jac);
-//    std::cout << jac << std::endl;
+  // using NumericalDiff
+  NumericalDiff<my_functor> numDiff(functor);
+  numDiff.df(x, jac);
+  //    std::cout << jac << std::endl;
 
-    VERIFY_IS_APPROX(jac, actual_jac);
+  VERIFY_IS_APPROX(jac, actual_jac);
 }
 
-void test_central()
-{
-    VectorXd x(3);
-    MatrixXd jac(15,3);
-    MatrixXd actual_jac(15,3);
-    my_functor functor;
+void test_central() {
+  VectorXd x(3);
+  MatrixXd jac(15, 3);
+  MatrixXd actual_jac(15, 3);
+  my_functor functor;
 
-    x << 0.082, 1.13, 2.35;
+  x << 0.082, 1.13, 2.35;
 
-    // real one 
-    functor.actual_df(x, actual_jac);
+  // real one
+  functor.actual_df(x, actual_jac);
 
-    // using NumericalDiff
-    NumericalDiff<my_functor,Central> numDiff(functor);
-    numDiff.df(x, jac);
+  // using NumericalDiff
+  NumericalDiff<my_functor, Central> numDiff(functor);
+  numDiff.df(x, jac);
 
-    VERIFY_IS_APPROX(jac, actual_jac);
+  VERIFY_IS_APPROX(jac, actual_jac);
 }
 
-EIGEN_DECLARE_TEST(NumericalDiff)
-{
-    CALL_SUBTEST(test_forward());
-    CALL_SUBTEST(test_central());
+EIGEN_DECLARE_TEST(NumericalDiff) {
+  CALL_SUBTEST(test_forward());
+  CALL_SUBTEST(test_central());
 }
diff --git a/unsupported/test/alignedvector3.cpp b/unsupported/test/alignedvector3.cpp
index 1fc6d62..838eaea 100644
--- a/unsupported/test/alignedvector3.cpp
+++ b/unsupported/test/alignedvector3.cpp
@@ -14,76 +14,73 @@
 
 namespace Eigen {
 
-template<typename T,typename Derived>
-T test_relative_error(const AlignedVector3<T> &a, const MatrixBase<Derived> &b)
-{
+template <typename T, typename Derived>
+T test_relative_error(const AlignedVector3<T> &a, const MatrixBase<Derived> &b) {
   return test_relative_error(a.coeffs().template head<3>(), b);
 }
 
-}
+}  // namespace Eigen
 
-template<typename Scalar>
-void alignedvector3()
-{
+template <typename Scalar>
+void alignedvector3() {
   Scalar s1 = internal::random<Scalar>();
   Scalar s2 = internal::random<Scalar>();
-  typedef Matrix<Scalar,3,1> RefType;
-  typedef Matrix<Scalar,3,3> Mat33;
+  typedef Matrix<Scalar, 3, 1> RefType;
+  typedef Matrix<Scalar, 3, 3> Mat33;
   typedef AlignedVector3<Scalar> FastType;
-  RefType  r1(RefType::Random()), r2(RefType::Random()), r3(RefType::Random()),
-           r4(RefType::Random()), r5(RefType::Random());
+  RefType r1(RefType::Random()), r2(RefType::Random()), r3(RefType::Random()), r4(RefType::Random()),
+      r5(RefType::Random());
   FastType f1(r1), f2(r2), f3(r3), f4(r4), f5(r5);
   Mat33 m1(Mat33::Random());
-  
-  VERIFY_IS_APPROX(f1,r1);
-  VERIFY_IS_APPROX(f4,r4);
 
-  VERIFY_IS_APPROX(f4+f1,r4+r1);
-  VERIFY_IS_APPROX(f4-f1,r4-r1);
-  VERIFY_IS_APPROX(f4+f1-f2,r4+r1-r2);
-  VERIFY_IS_APPROX(f4+=f3,r4+=r3);
-  VERIFY_IS_APPROX(f4-=f5,r4-=r5);
-  VERIFY_IS_APPROX(f4-=f5+f1,r4-=r5+r1);
-  VERIFY_IS_APPROX(f5+f1-s1*f2,r5+r1-s1*r2);
-  VERIFY_IS_APPROX(f5+f1/s2-s1*f2,r5+r1/s2-s1*r2);
-  
-  VERIFY_IS_APPROX(m1*f4,m1*r4);
-  VERIFY_IS_APPROX(f4.transpose()*m1,r4.transpose()*m1);
-  
-  VERIFY_IS_APPROX(f2.dot(f3),r2.dot(r3));
-  VERIFY_IS_APPROX(f2.cross(f3),r2.cross(r3));
-  VERIFY_IS_APPROX(f2.norm(),r2.norm());
+  VERIFY_IS_APPROX(f1, r1);
+  VERIFY_IS_APPROX(f4, r4);
 
-  VERIFY_IS_APPROX(f2.normalized(),r2.normalized());
+  VERIFY_IS_APPROX(f4 + f1, r4 + r1);
+  VERIFY_IS_APPROX(f4 - f1, r4 - r1);
+  VERIFY_IS_APPROX(f4 + f1 - f2, r4 + r1 - r2);
+  VERIFY_IS_APPROX(f4 += f3, r4 += r3);
+  VERIFY_IS_APPROX(f4 -= f5, r4 -= r5);
+  VERIFY_IS_APPROX(f4 -= f5 + f1, r4 -= r5 + r1);
+  VERIFY_IS_APPROX(f5 + f1 - s1 * f2, r5 + r1 - s1 * r2);
+  VERIFY_IS_APPROX(f5 + f1 / s2 - s1 * f2, r5 + r1 / s2 - s1 * r2);
 
-  VERIFY_IS_APPROX((f2+f1).normalized(),(r2+r1).normalized());
-  
+  VERIFY_IS_APPROX(m1 * f4, m1 * r4);
+  VERIFY_IS_APPROX(f4.transpose() * m1, r4.transpose() * m1);
+
+  VERIFY_IS_APPROX(f2.dot(f3), r2.dot(r3));
+  VERIFY_IS_APPROX(f2.cross(f3), r2.cross(r3));
+  VERIFY_IS_APPROX(f2.norm(), r2.norm());
+
+  VERIFY_IS_APPROX(f2.normalized(), r2.normalized());
+
+  VERIFY_IS_APPROX((f2 + f1).normalized(), (r2 + r1).normalized());
+
   f2.normalize();
   r2.normalize();
-  VERIFY_IS_APPROX(f2,r2);
-  
+  VERIFY_IS_APPROX(f2, r2);
+
   {
     FastType f6 = RefType::Zero();
     FastType f7 = FastType::Zero();
-    VERIFY_IS_APPROX(f6,f7);
-    f6 = r4+r1;
-    VERIFY_IS_APPROX(f6,r4+r1);
-    f6 -= Scalar(2)*r4;
-    VERIFY_IS_APPROX(f6,r1-r4);
+    VERIFY_IS_APPROX(f6, f7);
+    f6 = r4 + r1;
+    VERIFY_IS_APPROX(f6, r4 + r1);
+    f6 -= Scalar(2) * r4;
+    VERIFY_IS_APPROX(f6, r1 - r4);
   }
-  
-  FastType f8, f9(0,0,0);
-  VERIFY_IS_APPROX(f9-f1,-f1);
+
+  FastType f8, f9(0, 0, 0);
+  VERIFY_IS_APPROX(f9 - f1, -f1);
 
   std::stringstream ss1, ss2;
   ss1 << f1;
   ss2 << r1;
-  VERIFY(ss1.str()==ss2.str());
+  VERIFY(ss1.str() == ss2.str());
 }
 
-EIGEN_DECLARE_TEST(alignedvector3)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST( alignedvector3<float>() );
+EIGEN_DECLARE_TEST(alignedvector3) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST(alignedvector3<float>());
   }
 }
diff --git a/unsupported/test/autodiff.cpp b/unsupported/test/autodiff.cpp
index 0addf2c..9ea4e7d 100644
--- a/unsupported/test/autodiff.cpp
+++ b/unsupported/test/autodiff.cpp
@@ -10,36 +10,31 @@
 #include "main.h"
 #include <unsupported/Eigen/AutoDiff>
 
-template<typename Scalar>
-EIGEN_DONT_INLINE Scalar foo(const Scalar& x, const Scalar& y)
-{
+template <typename Scalar>
+EIGEN_DONT_INLINE Scalar foo(const Scalar& x, const Scalar& y) {
   using namespace std;
-//   return x+std::sin(y);
+  //   return x+std::sin(y);
   EIGEN_ASM_COMMENT("mybegin");
   // pow(float, int) promotes to pow(double, double)
-  return x*2 - 1 + static_cast<Scalar>(pow(1+x,2)) + 2*sqrt(y*y+0) - 4 * sin(0+x) + 2 * cos(y+0) - exp(Scalar(-0.5)*x*x+0);
-  //return x+2*y*x;//x*2 -std::pow(x,2);//(2*y/x);// - y*2;
+  return x * 2 - 1 + static_cast<Scalar>(pow(1 + x, 2)) + 2 * sqrt(y * y + 0) - 4 * sin(0 + x) + 2 * cos(y + 0) -
+         exp(Scalar(-0.5) * x * x + 0);
+  // return x+2*y*x;//x*2 -std::pow(x,2);//(2*y/x);// - y*2;
   EIGEN_ASM_COMMENT("myend");
 }
 
-template<typename Vector>
-EIGEN_DONT_INLINE typename Vector::Scalar foo(const Vector& p)
-{
+template <typename Vector>
+EIGEN_DONT_INLINE typename Vector::Scalar foo(const Vector& p) {
   typedef typename Vector::Scalar Scalar;
-  return (p-Vector(Scalar(-1),Scalar(1.))).norm() + (p.array() * p.array()).sum() + p.dot(p);
+  return (p - Vector(Scalar(-1), Scalar(1.))).norm() + (p.array() * p.array()).sum() + p.dot(p);
 }
 
-template<typename Scalar_, int NX=Dynamic, int NY=Dynamic>
-struct TestFunc1
-{
+template <typename Scalar_, int NX = Dynamic, int NY = Dynamic>
+struct TestFunc1 {
   typedef Scalar_ Scalar;
-  enum {
-    InputsAtCompileTime = NX,
-    ValuesAtCompileTime = NY
-  };
-  typedef Matrix<Scalar,InputsAtCompileTime,1> InputType;
-  typedef Matrix<Scalar,ValuesAtCompileTime,1> ValueType;
-  typedef Matrix<Scalar,ValuesAtCompileTime,InputsAtCompileTime> JacobianType;
+  enum { InputsAtCompileTime = NX, ValuesAtCompileTime = NY };
+  typedef Matrix<Scalar, InputsAtCompileTime, 1> InputType;
+  typedef Matrix<Scalar, ValuesAtCompileTime, 1> ValueType;
+  typedef Matrix<Scalar, ValuesAtCompileTime, InputsAtCompileTime> JacobianType;
 
   int m_inputs, m_values;
 
@@ -49,186 +44,168 @@
   int inputs() const { return m_inputs; }
   int values() const { return m_values; }
 
-  template<typename T>
-  void operator() (const Matrix<T,InputsAtCompileTime,1>& x, Matrix<T,ValuesAtCompileTime,1>* _v) const
-  {
-    Matrix<T,ValuesAtCompileTime,1>& v = *_v;
+  template <typename T>
+  void operator()(const Matrix<T, InputsAtCompileTime, 1>& x, Matrix<T, ValuesAtCompileTime, 1>* _v) const {
+    Matrix<T, ValuesAtCompileTime, 1>& v = *_v;
 
     v[0] = 2 * x[0] * x[0] + x[0] * x[1];
     v[1] = 3 * x[1] * x[0] + 0.5 * x[1] * x[1];
-    if(inputs()>2)
-    {
+    if (inputs() > 2) {
       v[0] += 0.5 * x[2];
       v[1] += x[2];
     }
-    if(values()>2)
-    {
+    if (values() > 2) {
       v[2] = 3 * x[1] * x[0] * x[0];
     }
-    if (inputs()>2 && values()>2)
-      v[2] *= x[2];
+    if (inputs() > 2 && values() > 2) v[2] *= x[2];
   }
 
-  void operator() (const InputType& x, ValueType* v, JacobianType* _j) const
-  {
+  void operator()(const InputType& x, ValueType* v, JacobianType* _j) const {
     (*this)(x, v);
 
-    if(_j)
-    {
+    if (_j) {
       JacobianType& j = *_j;
 
-      j(0,0) = 4 * x[0] + x[1];
-      j(1,0) = 3 * x[1];
+      j(0, 0) = 4 * x[0] + x[1];
+      j(1, 0) = 3 * x[1];
 
-      j(0,1) = x[0];
-      j(1,1) = 3 * x[0] + 2 * 0.5 * x[1];
+      j(0, 1) = x[0];
+      j(1, 1) = 3 * x[0] + 2 * 0.5 * x[1];
 
-      if (inputs()>2)
-      {
-        j(0,2) = 0.5;
-        j(1,2) = 1;
+      if (inputs() > 2) {
+        j(0, 2) = 0.5;
+        j(1, 2) = 1;
       }
-      if(values()>2)
-      {
-        j(2,0) = 3 * x[1] * 2 * x[0];
-        j(2,1) = 3 * x[0] * x[0];
+      if (values() > 2) {
+        j(2, 0) = 3 * x[1] * 2 * x[0];
+        j(2, 1) = 3 * x[0] * x[0];
       }
-      if (inputs()>2 && values()>2)
-      {
-        j(2,0) *= x[2];
-        j(2,1) *= x[2];
+      if (inputs() > 2 && values() > 2) {
+        j(2, 0) *= x[2];
+        j(2, 1) *= x[2];
 
-        j(2,2) = 3 * x[1] * x[0] * x[0];
-        j(2,2) = 3 * x[1] * x[0] * x[0];
+        j(2, 2) = 3 * x[1] * x[0] * x[0];
+        j(2, 2) = 3 * x[1] * x[0] * x[0];
       }
     }
   }
 };
 
-
 /* Test functor for the C++11 features. */
 template <typename Scalar>
-struct integratorFunctor
-{
-    typedef Matrix<Scalar, 2, 1> InputType;
-    typedef Matrix<Scalar, 2, 1> ValueType;
+struct integratorFunctor {
+  typedef Matrix<Scalar, 2, 1> InputType;
+  typedef Matrix<Scalar, 2, 1> ValueType;
 
-    /*
-     * Implementation starts here.
-     */
-    integratorFunctor(const Scalar gain) : _gain(gain) {}
-    integratorFunctor(const integratorFunctor& f) : _gain(f._gain) {}
-    const Scalar _gain;
+  /*
+   * Implementation starts here.
+   */
+  integratorFunctor(const Scalar gain) : _gain(gain) {}
+  integratorFunctor(const integratorFunctor& f) : _gain(f._gain) {}
+  const Scalar _gain;
 
-    template <typename T1, typename T2>
-    void operator() (const T1 &input, T2 *output, const Scalar dt) const
-    {
-        T2 &o = *output;
+  template <typename T1, typename T2>
+  void operator()(const T1& input, T2* output, const Scalar dt) const {
+    T2& o = *output;
 
-        /* Integrator to test the AD. */
-        o[0] = input[0] + input[1] * dt * _gain;
-        o[1] = input[1] * _gain;
+    /* Integrator to test the AD. */
+    o[0] = input[0] + input[1] * dt * _gain;
+    o[1] = input[1] * _gain;
+  }
+
+  /* Only needed for the test */
+  template <typename T1, typename T2, typename T3>
+  void operator()(const T1& input, T2* output, T3* jacobian, const Scalar dt) const {
+    T2& o = *output;
+
+    /* Integrator to test the AD. */
+    o[0] = input[0] + input[1] * dt * _gain;
+    o[1] = input[1] * _gain;
+
+    if (jacobian) {
+      T3& j = *jacobian;
+
+      j(0, 0) = 1;
+      j(0, 1) = dt * _gain;
+      j(1, 0) = 0;
+      j(1, 1) = _gain;
     }
-
-    /* Only needed for the test */
-    template <typename T1, typename T2, typename T3>
-    void operator() (const T1 &input, T2 *output, T3 *jacobian, const Scalar dt) const
-    {
-        T2 &o = *output;
-
-        /* Integrator to test the AD. */
-        o[0] = input[0] + input[1] * dt * _gain;
-        o[1] = input[1] * _gain;
-
-        if (jacobian)
-        {
-            T3 &j = *jacobian;
-
-            j(0, 0) = 1;
-            j(0, 1) = dt * _gain;
-            j(1, 0) = 0;
-            j(1, 1) = _gain;
-        }
-    }
-
+  }
 };
 
-template<typename Func> void forward_jacobian_cpp11(const Func& f)
-{
-    typedef typename Func::ValueType::Scalar Scalar;
-    typedef typename Func::ValueType ValueType;
-    typedef typename Func::InputType InputType;
-    typedef typename AutoDiffJacobian<Func>::JacobianType JacobianType;
+template <typename Func>
+void forward_jacobian_cpp11(const Func& f) {
+  typedef typename Func::ValueType::Scalar Scalar;
+  typedef typename Func::ValueType ValueType;
+  typedef typename Func::InputType InputType;
+  typedef typename AutoDiffJacobian<Func>::JacobianType JacobianType;
 
-    InputType x = InputType::Random(InputType::RowsAtCompileTime);
-    ValueType y, yref;
-    JacobianType j, jref;
+  InputType x = InputType::Random(InputType::RowsAtCompileTime);
+  ValueType y, yref;
+  JacobianType j, jref;
 
-    const Scalar dt = internal::random<double>();
+  const Scalar dt = internal::random<double>();
 
-    jref.setZero();
-    yref.setZero();
-    f(x, &yref, &jref, dt);
+  jref.setZero();
+  yref.setZero();
+  f(x, &yref, &jref, dt);
 
-    //std::cerr << "y, yref, jref: " << "\n";
-    //std::cerr << y.transpose() << "\n\n";
-    //std::cerr << yref << "\n\n";
-    //std::cerr << jref << "\n\n";
+  // std::cerr << "y, yref, jref: " << "\n";
+  // std::cerr << y.transpose() << "\n\n";
+  // std::cerr << yref << "\n\n";
+  // std::cerr << jref << "\n\n";
 
-    AutoDiffJacobian<Func> autoj(f);
-    autoj(x, &y, &j, dt);
+  AutoDiffJacobian<Func> autoj(f);
+  autoj(x, &y, &j, dt);
 
-    //std::cerr << "y j (via autodiff): " << "\n";
-    //std::cerr << y.transpose() << "\n\n";
-    //std::cerr << j << "\n\n";
+  // std::cerr << "y j (via autodiff): " << "\n";
+  // std::cerr << y.transpose() << "\n\n";
+  // std::cerr << j << "\n\n";
 
-    VERIFY_IS_APPROX(y, yref);
-    VERIFY_IS_APPROX(j, jref);
+  VERIFY_IS_APPROX(y, yref);
+  VERIFY_IS_APPROX(j, jref);
 }
 
-template<typename Func> void forward_jacobian(const Func& f)
-{
-    typename Func::InputType x = Func::InputType::Random(f.inputs());
-    typename Func::ValueType y(f.values()), yref(f.values());
-    typename Func::JacobianType j(f.values(),f.inputs()), jref(f.values(),f.inputs());
+template <typename Func>
+void forward_jacobian(const Func& f) {
+  typename Func::InputType x = Func::InputType::Random(f.inputs());
+  typename Func::ValueType y(f.values()), yref(f.values());
+  typename Func::JacobianType j(f.values(), f.inputs()), jref(f.values(), f.inputs());
 
-    jref.setZero();
-    yref.setZero();
-    f(x,&yref,&jref);
-//     std::cerr << y.transpose() << "\n\n";;
-//     std::cerr << j << "\n\n";;
+  jref.setZero();
+  yref.setZero();
+  f(x, &yref, &jref);
+  //     std::cerr << y.transpose() << "\n\n";;
+  //     std::cerr << j << "\n\n";;
 
-    j.setZero();
-    y.setZero();
-    AutoDiffJacobian<Func> autoj(f);
-    autoj(x, &y, &j);
-//     std::cerr << y.transpose() << "\n\n";;
-//     std::cerr << j << "\n\n";;
+  j.setZero();
+  y.setZero();
+  AutoDiffJacobian<Func> autoj(f);
+  autoj(x, &y, &j);
+  //     std::cerr << y.transpose() << "\n\n";;
+  //     std::cerr << j << "\n\n";;
 
-    VERIFY_IS_APPROX(y, yref);
-    VERIFY_IS_APPROX(j, jref);
+  VERIFY_IS_APPROX(y, yref);
+  VERIFY_IS_APPROX(j, jref);
 }
 
 // TODO also check actual derivatives!
 template <int>
-void test_autodiff_scalar()
-{
+void test_autodiff_scalar() {
   Vector2f p = Vector2f::Random();
   typedef AutoDiffScalar<Vector2f> AD;
-  AD ax(p.x(),Vector2f::UnitX());
-  AD ay(p.y(),Vector2f::UnitY());
-  AD res = foo<AD>(ax,ay);
-  VERIFY_IS_APPROX(res.value(), foo(p.x(),p.y()));
+  AD ax(p.x(), Vector2f::UnitX());
+  AD ay(p.y(), Vector2f::UnitY());
+  AD res = foo<AD>(ax, ay);
+  VERIFY_IS_APPROX(res.value(), foo(p.x(), p.y()));
 }
 
-
 // TODO also check actual derivatives!
 template <int>
-void test_autodiff_vector()
-{
+void test_autodiff_vector() {
   Vector2f p = Vector2f::Random();
   typedef AutoDiffScalar<Vector2f> AD;
-  typedef Matrix<AD,2,1> VectorAD;
+  typedef Matrix<AD, 2, 1> VectorAD;
   VectorAD ap = p.cast<AD>();
   ap.x().derivatives() = Vector2f::UnitX();
   ap.y().derivatives() = Vector2f::UnitY();
@@ -238,59 +215,57 @@
 }
 
 template <int>
-void test_autodiff_jacobian()
-{
-  CALL_SUBTEST(( forward_jacobian(TestFunc1<double,2,2>()) ));
-  CALL_SUBTEST(( forward_jacobian(TestFunc1<double,2,3>()) ));
-  CALL_SUBTEST(( forward_jacobian(TestFunc1<double,3,2>()) ));
-  CALL_SUBTEST(( forward_jacobian(TestFunc1<double,3,3>()) ));
-  CALL_SUBTEST(( forward_jacobian(TestFunc1<double>(3,3)) ));
-  CALL_SUBTEST(( forward_jacobian_cpp11(integratorFunctor<double>(10)) ));
+void test_autodiff_jacobian() {
+  CALL_SUBTEST((forward_jacobian(TestFunc1<double, 2, 2>())));
+  CALL_SUBTEST((forward_jacobian(TestFunc1<double, 2, 3>())));
+  CALL_SUBTEST((forward_jacobian(TestFunc1<double, 3, 2>())));
+  CALL_SUBTEST((forward_jacobian(TestFunc1<double, 3, 3>())));
+  CALL_SUBTEST((forward_jacobian(TestFunc1<double>(3, 3))));
+  CALL_SUBTEST((forward_jacobian_cpp11(integratorFunctor<double>(10))));
 }
 
-
 template <int>
-void test_autodiff_hessian()
-{
+void test_autodiff_hessian() {
   typedef AutoDiffScalar<VectorXd> AD;
-  typedef Matrix<AD,Eigen::Dynamic,1> VectorAD;
+  typedef Matrix<AD, Eigen::Dynamic, 1> VectorAD;
   typedef AutoDiffScalar<VectorAD> ADD;
-  typedef Matrix<ADD,Eigen::Dynamic,1> VectorADD;
+  typedef Matrix<ADD, Eigen::Dynamic, 1> VectorADD;
   VectorADD x(2);
-  double s1 = internal::random<double>(), s2 = internal::random<double>(), s3 = internal::random<double>(), s4 = internal::random<double>();
-  x(0).value()=s1;
-  x(1).value()=s2;
+  double s1 = internal::random<double>(), s2 = internal::random<double>(), s3 = internal::random<double>(),
+         s4 = internal::random<double>();
+  x(0).value() = s1;
+  x(1).value() = s2;
 
-  //set unit vectors for the derivative directions (partial derivatives of the input vector)
+  // set unit vectors for the derivative directions (partial derivatives of the input vector)
   x(0).derivatives().resize(2);
   x(0).derivatives().setZero();
-  x(0).derivatives()(0)= 1;
+  x(0).derivatives()(0) = 1;
   x(1).derivatives().resize(2);
   x(1).derivatives().setZero();
-  x(1).derivatives()(1)=1;
+  x(1).derivatives()(1) = 1;
 
-  //repeat partial derivatives for the inner AutoDiffScalar
-  x(0).value().derivatives() = VectorXd::Unit(2,0);
-  x(1).value().derivatives() = VectorXd::Unit(2,1);
+  // repeat partial derivatives for the inner AutoDiffScalar
+  x(0).value().derivatives() = VectorXd::Unit(2, 0);
+  x(1).value().derivatives() = VectorXd::Unit(2, 1);
 
-  //set the hessian matrix to zero
-  for(int idx=0; idx<2; idx++) {
-      x(0).derivatives()(idx).derivatives()  = VectorXd::Zero(2);
-      x(1).derivatives()(idx).derivatives()  = VectorXd::Zero(2);
+  // set the hessian matrix to zero
+  for (int idx = 0; idx < 2; idx++) {
+    x(0).derivatives()(idx).derivatives() = VectorXd::Zero(2);
+    x(1).derivatives()(idx).derivatives() = VectorXd::Zero(2);
   }
 
-  ADD y = sin(AD(s3)*x(0) + AD(s4)*x(1));
+  ADD y = sin(AD(s3) * x(0) + AD(s4) * x(1));
 
   VERIFY_IS_APPROX(y.value().derivatives()(0), y.derivatives()(0).value());
   VERIFY_IS_APPROX(y.value().derivatives()(1), y.derivatives()(1).value());
-  VERIFY_IS_APPROX(y.value().derivatives()(0), s3*std::cos(s1*s3+s2*s4));
-  VERIFY_IS_APPROX(y.value().derivatives()(1), s4*std::cos(s1*s3+s2*s4));
-  VERIFY_IS_APPROX(y.derivatives()(0).derivatives(), -std::sin(s1*s3+s2*s4)*Vector2d(s3*s3,s4*s3));
-  VERIFY_IS_APPROX(y.derivatives()(1).derivatives(),  -std::sin(s1*s3+s2*s4)*Vector2d(s3*s4,s4*s4));
+  VERIFY_IS_APPROX(y.value().derivatives()(0), s3 * std::cos(s1 * s3 + s2 * s4));
+  VERIFY_IS_APPROX(y.value().derivatives()(1), s4 * std::cos(s1 * s3 + s2 * s4));
+  VERIFY_IS_APPROX(y.derivatives()(0).derivatives(), -std::sin(s1 * s3 + s2 * s4) * Vector2d(s3 * s3, s4 * s3));
+  VERIFY_IS_APPROX(y.derivatives()(1).derivatives(), -std::sin(s1 * s3 + s2 * s4) * Vector2d(s3 * s4, s4 * s4));
 
-  ADD z = x(0)*x(1);
-  VERIFY_IS_APPROX(z.derivatives()(0).derivatives(), Vector2d(0,1));
-  VERIFY_IS_APPROX(z.derivatives()(1).derivatives(), Vector2d(1,0));
+  ADD z = x(0) * x(1);
+  VERIFY_IS_APPROX(z.derivatives()(0).derivatives(), Vector2d(0, 1));
+  VERIFY_IS_APPROX(z.derivatives()(1).derivatives(), Vector2d(1, 0));
 }
 
 double bug_1222() {
@@ -312,12 +287,12 @@
   const AD chi_3 = 1.0;
   const AD denom = 1.0;
 
-  // failed because implementation of min attempts to construct ADS<DerType&> via constructor AutoDiffScalar(const Real& value)
-  // without initializing m_derivatives (which is a reference in this case)
-  #define EIGEN_TEST_SPACE
-  const AD t = min EIGEN_TEST_SPACE (denom / chi_3, 1.0);
+// failed because implementation of min attempts to construct ADS<DerType&> via constructor AutoDiffScalar(const Real&
+// value) without initializing m_derivatives (which is a reference in this case)
+#define EIGEN_TEST_SPACE
+  const AD t = min EIGEN_TEST_SPACE(denom / chi_3, 1.0);
 
-  const AD t2 = min EIGEN_TEST_SPACE (denom / (chi_3 * _cv1_3), 1.0);
+  const AD t2 = min EIGEN_TEST_SPACE(denom / (chi_3 * _cv1_3), 1.0);
 
   return t.value() + t2.value();
 }
@@ -326,15 +301,15 @@
 void bug_1260() {
   Matrix4d A = Matrix4d::Ones();
   Vector4d v = Vector4d::Ones();
-  A*v;
+  A* v;
 }
 
 // check a compilation issue with numext::max
 double bug_1261() {
   typedef AutoDiffScalar<Matrix2d> AD;
-  typedef Matrix<AD,2,1> VectorAD;
+  typedef Matrix<AD, 2, 1> VectorAD;
 
-  VectorAD v(0.,0.);
+  VectorAD v(0., 0.);
   const AD maxVal = v.maxCoeff();
   const AD minVal = v.minCoeff();
   return maxVal.value() + minVal.value();
@@ -343,7 +318,7 @@
 double bug_1264() {
   typedef AutoDiffScalar<Vector2d> AD;
   const AD s = 0.;
-  const Matrix<AD, 3, 1> v1(0.,0.,0.);
+  const Matrix<AD, 3, 1> v1(0., 0., 0.);
   const Matrix<AD, 3, 1> v2 = (s + 3.0) * v1;
   return v2(0).value();
 }
@@ -353,31 +328,29 @@
   int n = 2;
   typedef AutoDiffScalar<VectorXd> AD;
   const AD c = 1.;
-  AD x0(2,n,0);
-  AD y1 = (AD(c)+AD(c))*x0;
-  y1 = x0 * (AD(c)+AD(c));
-  AD y2 = (-AD(c))+x0;
-  y2 = x0+(-AD(c));
-  AD y3 = (AD(c)*(-AD(c))+AD(c))*x0;
-  y3 = x0 * (AD(c)*(-AD(c))+AD(c));
-  return (y1+y2+y3).value();
+  AD x0(2, n, 0);
+  AD y1 = (AD(c) + AD(c)) * x0;
+  y1 = x0 * (AD(c) + AD(c));
+  AD y2 = (-AD(c)) + x0;
+  y2 = x0 + (-AD(c));
+  AD y3 = (AD(c) * (-AD(c)) + AD(c)) * x0;
+  y3 = x0 * (AD(c) * (-AD(c)) + AD(c));
+  return (y1 + y2 + y3).value();
 }
 
 #endif
 
-EIGEN_DECLARE_TEST(autodiff)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( test_autodiff_scalar<1>() );
-    CALL_SUBTEST_2( test_autodiff_vector<1>() );
-    CALL_SUBTEST_3( test_autodiff_jacobian<1>() );
-    CALL_SUBTEST_4( test_autodiff_hessian<1>() );
+EIGEN_DECLARE_TEST(autodiff) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(test_autodiff_scalar<1>());
+    CALL_SUBTEST_2(test_autodiff_vector<1>());
+    CALL_SUBTEST_3(test_autodiff_jacobian<1>());
+    CALL_SUBTEST_4(test_autodiff_hessian<1>());
   }
 
-  CALL_SUBTEST_5( bug_1222() );
-  CALL_SUBTEST_5( bug_1223() );
-  CALL_SUBTEST_5( bug_1260() );
-  CALL_SUBTEST_5( bug_1261() );
-  CALL_SUBTEST_5( bug_1281() );
+  CALL_SUBTEST_5(bug_1222());
+  CALL_SUBTEST_5(bug_1223());
+  CALL_SUBTEST_5(bug_1260());
+  CALL_SUBTEST_5(bug_1261());
+  CALL_SUBTEST_5(bug_1281());
 }
-
diff --git a/unsupported/test/autodiff_scalar.cpp b/unsupported/test/autodiff_scalar.cpp
index 1dbf585..a0bff91 100644
--- a/unsupported/test/autodiff_scalar.cpp
+++ b/unsupported/test/autodiff_scalar.cpp
@@ -15,36 +15,36 @@
  * TODO add more tests!
  */
 
-template<typename Scalar> void check_atan2()
-{
+template <typename Scalar>
+void check_atan2() {
   typedef Matrix<Scalar, 1, 1> Deriv1;
   typedef AutoDiffScalar<Deriv1> AD;
-  
+
   AD x(internal::random<Scalar>(-3.0, 3.0), Deriv1::UnitX());
-  
+
   using std::exp;
   Scalar r = exp(internal::random<Scalar>(-10, 10));
-  
+
   AD s = sin(x), c = cos(x);
-  AD res = atan2(r*s, r*c);
-  
+  AD res = atan2(r * s, r * c);
+
   VERIFY_IS_APPROX(res.value(), x.value());
   VERIFY_IS_APPROX(res.derivatives(), x.derivatives());
 
-  res = atan2(r*s+0, r*c+0);
+  res = atan2(r * s + 0, r * c + 0);
   VERIFY_IS_APPROX(res.value(), x.value());
   VERIFY_IS_APPROX(res.derivatives(), x.derivatives());
 }
 
-template<typename Scalar> void check_hyperbolic_functions()
-{
-  using std::sinh;
+template <typename Scalar>
+void check_hyperbolic_functions() {
   using std::cosh;
+  using std::sinh;
   using std::tanh;
   typedef Matrix<Scalar, 1, 1> Deriv1;
   typedef AutoDiffScalar<Deriv1> AD;
   Deriv1 p = Deriv1::Random();
-  AD val(p.x(),Deriv1::UnitX());
+  AD val(p.x(), Deriv1::UnitX());
 
   Scalar cosh_px = std::cosh(p.x());
   AD res1 = tanh(val);
@@ -60,8 +60,8 @@
   VERIFY_IS_APPROX(res3.derivatives().x(), std::sinh(p.x()));
 
   // Check constant values.
-  const Scalar sample_point = Scalar(1) / Scalar(3); 
-  val = AD(sample_point,Deriv1::UnitX());
+  const Scalar sample_point = Scalar(1) / Scalar(3);
+  val = AD(sample_point, Deriv1::UnitX());
   res1 = tanh(val);
   VERIFY_IS_APPROX(res1.derivatives().x(), Scalar(0.896629559604914));
 
@@ -73,8 +73,7 @@
 }
 
 template <typename Scalar>
-void check_limits_specialization()
-{
+void check_limits_specialization() {
   typedef Eigen::Matrix<Scalar, 1, 1> Deriv;
   typedef Eigen::AutoDiffScalar<Deriv> AD;
 
@@ -87,13 +86,12 @@
   VERIFY(bool(std::is_base_of<B, A>::value));
 }
 
-EIGEN_DECLARE_TEST(autodiff_scalar)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST_1( check_atan2<float>() );
-    CALL_SUBTEST_2( check_atan2<double>() );
-    CALL_SUBTEST_3( check_hyperbolic_functions<float>() );
-    CALL_SUBTEST_4( check_hyperbolic_functions<double>() );
-    CALL_SUBTEST_5( check_limits_specialization<double>());
+EIGEN_DECLARE_TEST(autodiff_scalar) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(check_atan2<float>());
+    CALL_SUBTEST_2(check_atan2<double>());
+    CALL_SUBTEST_3(check_hyperbolic_functions<float>());
+    CALL_SUBTEST_4(check_hyperbolic_functions<double>());
+    CALL_SUBTEST_5(check_limits_specialization<double>());
   }
 }
diff --git a/unsupported/test/bessel_functions.cpp b/unsupported/test/bessel_functions.cpp
index 06765bf..86adfc1 100644
--- a/unsupported/test/bessel_functions.cpp
+++ b/unsupported/test/bessel_functions.cpp
@@ -10,41 +10,35 @@
 #include "main.h"
 #include "../Eigen/SpecialFunctions"
 
-template<typename X, typename Y>
-void verify_component_wise(const X& x, const Y& y)
-{
-  for(Index i=0; i<x.size(); ++i)
-  {
-    if((numext::isfinite)(y(i))) {
-      VERIFY_IS_APPROX( x(i), y(i) );
-    }
-    else if((numext::isnan)(y(i)))
+template <typename X, typename Y>
+void verify_component_wise(const X& x, const Y& y) {
+  for (Index i = 0; i < x.size(); ++i) {
+    if ((numext::isfinite)(y(i))) {
+      VERIFY_IS_APPROX(x(i), y(i));
+    } else if ((numext::isnan)(y(i)))
       VERIFY((numext::isnan)(x(i)));
     else
-      VERIFY_IS_EQUAL( x(i), y(i) );
+      VERIFY_IS_EQUAL(x(i), y(i));
   }
 }
 
-template<typename ArrayType> void array_bessel_functions() 
-{
+template <typename ArrayType>
+void array_bessel_functions() {
   // Test Bessel function i0. Reference results obtained with SciPy.
   {
     ArrayType x(21);
     ArrayType expected(21);
     ArrayType res(21);
 
-    x << -20.0, -18.0, -16.0, -14.0, -12.0, -10.0, -8.0, -6.0, -4.0, -2.0, 0.0,
-        2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0;
+    x << -20.0, -18.0, -16.0, -14.0, -12.0, -10.0, -8.0, -6.0, -4.0, -2.0, 0.0, 2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0,
+        16.0, 18.0, 20.0;
 
-    expected << 4.35582826e+07, 6.21841242e+06, 8.93446228e+05, 1.29418563e+05,
-       1.89489253e+04, 2.81571663e+03, 4.27564116e+02, 6.72344070e+01,
-       1.13019220e+01, 2.27958530e+00, 1.00000000e+00, 2.27958530e+00,
-       1.13019220e+01, 6.72344070e+01, 4.27564116e+02, 2.81571663e+03,
-       1.89489253e+04, 1.29418563e+05, 8.93446228e+05, 6.21841242e+06,
-       4.35582826e+07;
+    expected << 4.35582826e+07, 6.21841242e+06, 8.93446228e+05, 1.29418563e+05, 1.89489253e+04, 2.81571663e+03,
+        4.27564116e+02, 6.72344070e+01, 1.13019220e+01, 2.27958530e+00, 1.00000000e+00, 2.27958530e+00, 1.13019220e+01,
+        6.72344070e+01, 4.27564116e+02, 2.81571663e+03, 1.89489253e+04, 1.29418563e+05, 8.93446228e+05, 6.21841242e+06,
+        4.35582826e+07;
 
-    CALL_SUBTEST(res = bessel_i0(x);
-                 verify_component_wise(res, expected););
+    CALL_SUBTEST(res = bessel_i0(x); verify_component_wise(res, expected););
   }
 
   // Test Bessel function i0e. Reference results obtained with SciPy.
@@ -53,18 +47,15 @@
     ArrayType expected(21);
     ArrayType res(21);
 
-    x << -20.0, -18.0, -16.0, -14.0, -12.0, -10.0, -8.0, -6.0, -4.0, -2.0, 0.0,
-        2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0;
+    x << -20.0, -18.0, -16.0, -14.0, -12.0, -10.0, -8.0, -6.0, -4.0, -2.0, 0.0, 2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0,
+        16.0, 18.0, 20.0;
 
-    expected << 0.0897803118848, 0.0947062952128, 0.100544127361,
-        0.107615251671, 0.116426221213, 0.127833337163, 0.143431781857,
-        0.16665743264, 0.207001921224, 0.308508322554, 1.0, 0.308508322554,
-        0.207001921224, 0.16665743264, 0.143431781857, 0.127833337163,
-        0.116426221213, 0.107615251671, 0.100544127361, 0.0947062952128,
+    expected << 0.0897803118848, 0.0947062952128, 0.100544127361, 0.107615251671, 0.116426221213, 0.127833337163,
+        0.143431781857, 0.16665743264, 0.207001921224, 0.308508322554, 1.0, 0.308508322554, 0.207001921224,
+        0.16665743264, 0.143431781857, 0.127833337163, 0.116426221213, 0.107615251671, 0.100544127361, 0.0947062952128,
         0.0897803118848;
 
-    CALL_SUBTEST(res = bessel_i0e(x);
-                 verify_component_wise(res, expected););
+    CALL_SUBTEST(res = bessel_i0e(x); verify_component_wise(res, expected););
   }
 
   // Test Bessel function i1. Reference results obtained with SciPy.
@@ -73,18 +64,15 @@
     ArrayType expected(21);
     ArrayType res(21);
 
-    x << -20.0, -18.0, -16.0, -14.0, -12.0, -10.0, -8.0, -6.0, -4.0, -2.0, 0.0,
-        2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0;
+    x << -20.0, -18.0, -16.0, -14.0, -12.0, -10.0, -8.0, -6.0, -4.0, -2.0, 0.0, 2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0,
+        16.0, 18.0, 20.0;
 
-    expected << -4.24549734e+07, -6.04313324e+06, -8.65059436e+05, -1.24707259e+05,
-       -1.81413488e+04, -2.67098830e+03, -3.99873137e+02, -6.13419368e+01,
-       -9.75946515e+00, -1.59063685e+00,  0.00000000e+00,  1.59063685e+00,
-        9.75946515e+00,  6.13419368e+01,  3.99873137e+02,  2.67098830e+03,
-        1.81413488e+04,  1.24707259e+05,  8.65059436e+05,  6.04313324e+06,
-        4.24549734e+07;
+    expected << -4.24549734e+07, -6.04313324e+06, -8.65059436e+05, -1.24707259e+05, -1.81413488e+04, -2.67098830e+03,
+        -3.99873137e+02, -6.13419368e+01, -9.75946515e+00, -1.59063685e+00, 0.00000000e+00, 1.59063685e+00,
+        9.75946515e+00, 6.13419368e+01, 3.99873137e+02, 2.67098830e+03, 1.81413488e+04, 1.24707259e+05, 8.65059436e+05,
+        6.04313324e+06, 4.24549734e+07;
 
-    CALL_SUBTEST(res = bessel_i1(x);
-                 verify_component_wise(res, expected););
+    CALL_SUBTEST(res = bessel_i1(x); verify_component_wise(res, expected););
   }
 
   // Test Bessel function i1e. Reference results obtained with SciPy.
@@ -93,18 +81,15 @@
     ArrayType expected(21);
     ArrayType res(21);
 
-    x << -20.0, -18.0, -16.0, -14.0, -12.0, -10.0, -8.0, -6.0, -4.0, -2.0, 0.0,
-        2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0;
+    x << -20.0, -18.0, -16.0, -14.0, -12.0, -10.0, -8.0, -6.0, -4.0, -2.0, 0.0, 2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0,
+        16.0, 18.0, 20.0;
 
-    expected << -0.0875062221833, -0.092036796872, -0.0973496147565,
-        -0.103697667463, -0.11146429929, -0.121262681384, -0.134142493293,
-        -0.152051459309, -0.178750839502, -0.215269289249, 0.0, 0.215269289249,
-        0.178750839502, 0.152051459309, 0.134142493293, 0.121262681384,
-        0.11146429929, 0.103697667463, 0.0973496147565, 0.092036796872,
+    expected << -0.0875062221833, -0.092036796872, -0.0973496147565, -0.103697667463, -0.11146429929, -0.121262681384,
+        -0.134142493293, -0.152051459309, -0.178750839502, -0.215269289249, 0.0, 0.215269289249, 0.178750839502,
+        0.152051459309, 0.134142493293, 0.121262681384, 0.11146429929, 0.103697667463, 0.0973496147565, 0.092036796872,
         0.0875062221833;
 
-    CALL_SUBTEST(res = bessel_i1e(x);
-                 verify_component_wise(res, expected););
+    CALL_SUBTEST(res = bessel_i1e(x); verify_component_wise(res, expected););
   }
 
   // Test Bessel function j0. Reference results obtained with SciPy.
@@ -113,34 +98,22 @@
     ArrayType expected(77);
     ArrayType res(77);
 
-    x << -38., -37., -36., -35., -34., -33., -32., -31., -30.,
-      -29., -28., -27., -26., -25., -24., -23., -22., -21., -20., -19.,
-      -18., -17., -16., -15., -14., -13., -12., -11., -10.,  -9.,  -8.,
-       -7.,  -6.,  -5.,  -4.,  -3.,  -2.,  -1.,   0.,   1.,   2.,   3.,
-        4.,   5.,   6.,   7.,   8.,   9.,  10.,  11.,  12.,  13.,  14.,
-       15.,  16.,  17.,  18.,  19.,  20.,  21.,  22.,  23.,  24.,  25.,
-       26.,  27.,  28.,  29.,  30.,  31.,  32.,  33.,  34.,  35.,  36.,
-       37.,  38.;
+    x << -38., -37., -36., -35., -34., -33., -32., -31., -30., -29., -28., -27., -26., -25., -24., -23., -22., -21.,
+        -20., -19., -18., -17., -16., -15., -14., -13., -12., -11., -10., -9., -8., -7., -6., -5., -4., -3., -2., -1.,
+        0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23.,
+        24., 25., 26., 27., 28., 29., 30., 31., 32., 33., 34., 35., 36., 37., 38.;
 
-    expected << 0.11433274,  0.01086237, -0.10556738,
-             -0.12684568, -0.03042119,  0.09727067,  0.13807901,  0.05120815,
-             -0.08636798, -0.14784876, -0.07315701,  0.07274192,  0.15599932,
-              0.09626678, -0.05623027, -0.16241278, -0.12065148,  0.03657907,
-              0.16702466,  0.14662944, -0.01335581, -0.16985425, -0.17489907,
-             -0.01422447,  0.17107348,  0.2069261 ,  0.04768931, -0.1711903 ,
-             -0.24593576, -0.09033361,  0.17165081,  0.30007927,  0.15064526,
-             -0.17759677, -0.39714981, -0.26005195,  0.22389078,  0.76519769,
-              1.        ,  0.76519769,  0.22389078, -0.26005195, -0.39714981,
-             -0.17759677,  0.15064526,  0.30007927,  0.17165081, -0.09033361,
-             -0.24593576, -0.1711903 ,  0.04768931,  0.2069261 ,  0.17107348,
-             -0.01422447, -0.17489907, -0.16985425, -0.01335581,  0.14662944,
-              0.16702466,  0.03657907, -0.12065148, -0.16241278, -0.05623027,
-              0.09626678,  0.15599932,  0.07274192, -0.07315701, -0.14784876,
-             -0.08636798,  0.05120815,  0.13807901,  0.09727067, -0.03042119,
-             -0.12684568, -0.10556738,  0.01086237,  0.11433274;
+    expected << 0.11433274, 0.01086237, -0.10556738, -0.12684568, -0.03042119, 0.09727067, 0.13807901, 0.05120815,
+        -0.08636798, -0.14784876, -0.07315701, 0.07274192, 0.15599932, 0.09626678, -0.05623027, -0.16241278,
+        -0.12065148, 0.03657907, 0.16702466, 0.14662944, -0.01335581, -0.16985425, -0.17489907, -0.01422447, 0.17107348,
+        0.2069261, 0.04768931, -0.1711903, -0.24593576, -0.09033361, 0.17165081, 0.30007927, 0.15064526, -0.17759677,
+        -0.39714981, -0.26005195, 0.22389078, 0.76519769, 1., 0.76519769, 0.22389078, -0.26005195, -0.39714981,
+        -0.17759677, 0.15064526, 0.30007927, 0.17165081, -0.09033361, -0.24593576, -0.1711903, 0.04768931, 0.2069261,
+        0.17107348, -0.01422447, -0.17489907, -0.16985425, -0.01335581, 0.14662944, 0.16702466, 0.03657907, -0.12065148,
+        -0.16241278, -0.05623027, 0.09626678, 0.15599932, 0.07274192, -0.07315701, -0.14784876, -0.08636798, 0.05120815,
+        0.13807901, 0.09727067, -0.03042119, -0.12684568, -0.10556738, 0.01086237, 0.11433274;
 
-    CALL_SUBTEST(res = bessel_j0(x);
-                 verify_component_wise(res, expected););
+    CALL_SUBTEST(res = bessel_j0(x); verify_component_wise(res, expected););
   }
 
   // Test Bessel function j1. Reference results obtained with SciPy.
@@ -149,35 +122,23 @@
     ArrayType expected(81);
     ArrayType res(81);
 
-    x << -40., -39., -38., -37., -36., -35., -34., -33., -32., -31., -30.,
-      -29., -28., -27., -26., -25., -24., -23., -22., -21., -20., -19.,
-      -18., -17., -16., -15., -14., -13., -12., -11., -10.,  -9.,  -8.,
-       -7.,  -6.,  -5.,  -4.,  -3.,  -2.,  -1.,   0.,   1.,   2.,   3.,
-        4.,   5.,   6.,   7.,   8.,   9.,  10.,  11.,  12.,  13.,  14.,
-       15.,  16.,  17.,  18.,  19.,  20.,  21.,  22.,  23.,  24.,  25.,
-       26.,  27.,  28.,  29.,  30.,  31.,  32.,  33.,  34.,  35.,  36.,
-       37.,  38.,  39.,  40.;
+    x << -40., -39., -38., -37., -36., -35., -34., -33., -32., -31., -30., -29., -28., -27., -26., -25., -24., -23.,
+        -22., -21., -20., -19., -18., -17., -16., -15., -14., -13., -12., -11., -10., -9., -8., -7., -6., -5., -4., -3.,
+        -2., -1., 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21.,
+        22., 23., 24., 25., 26., 27., 28., 29., 30., 31., 32., 33., 34., 35., 36., 37., 38., 39., 40.;
 
-    expected << -0.12603832, -0.0640561 ,  0.05916189,  0.13058004,  0.08232981,
-             -0.04399094, -0.13297118, -0.10061965,  0.02658903,  0.13302432,
-              0.11875106, -0.0069342 , -0.13055149, -0.13658472, -0.01504573,
-              0.12535025,  0.15403807,  0.03951932, -0.11717779, -0.17112027,
-             -0.06683312,  0.10570143,  0.18799489,  0.09766849, -0.09039718,
-             -0.20510404, -0.13337515,  0.07031805,  0.2234471 ,  0.1767853 ,
-             -0.04347275, -0.24531179, -0.23463635,  0.00468282,  0.27668386,
-              0.32757914,  0.06604333, -0.33905896, -0.57672481, -0.44005059,
-              0.        ,  0.44005059,  0.57672481,  0.33905896, -0.06604333,
-             -0.32757914, -0.27668386, -0.00468282,  0.23463635,  0.24531179,
-              0.04347275, -0.1767853 , -0.2234471 , -0.07031805,  0.13337515,
-              0.20510404,  0.09039718, -0.09766849, -0.18799489, -0.10570143,
-              0.06683312,  0.17112027,  0.11717779, -0.03951932, -0.15403807,
-             -0.12535025,  0.01504573,  0.13658472,  0.13055149,  0.0069342 ,
-             -0.11875106, -0.13302432, -0.02658903,  0.10061965,  0.13297118,
-              0.04399094, -0.08232981, -0.13058004, -0.05916189,  0.0640561 ,
-              0.12603832;
+    expected << -0.12603832, -0.0640561, 0.05916189, 0.13058004, 0.08232981, -0.04399094, -0.13297118, -0.10061965,
+        0.02658903, 0.13302432, 0.11875106, -0.0069342, -0.13055149, -0.13658472, -0.01504573, 0.12535025, 0.15403807,
+        0.03951932, -0.11717779, -0.17112027, -0.06683312, 0.10570143, 0.18799489, 0.09766849, -0.09039718, -0.20510404,
+        -0.13337515, 0.07031805, 0.2234471, 0.1767853, -0.04347275, -0.24531179, -0.23463635, 0.00468282, 0.27668386,
+        0.32757914, 0.06604333, -0.33905896, -0.57672481, -0.44005059, 0., 0.44005059, 0.57672481, 0.33905896,
+        -0.06604333, -0.32757914, -0.27668386, -0.00468282, 0.23463635, 0.24531179, 0.04347275, -0.1767853, -0.2234471,
+        -0.07031805, 0.13337515, 0.20510404, 0.09039718, -0.09766849, -0.18799489, -0.10570143, 0.06683312, 0.17112027,
+        0.11717779, -0.03951932, -0.15403807, -0.12535025, 0.01504573, 0.13658472, 0.13055149, 0.0069342, -0.11875106,
+        -0.13302432, -0.02658903, 0.10061965, 0.13297118, 0.04399094, -0.08232981, -0.13058004, -0.05916189, 0.0640561,
+        0.12603832;
 
-    CALL_SUBTEST(res = bessel_j1(x);
-                 verify_component_wise(res, expected););
+    CALL_SUBTEST(res = bessel_j1(x); verify_component_wise(res, expected););
   }
   // Test Bessel function k0e. Reference results obtained with SciPy.
   {
@@ -185,23 +146,16 @@
     ArrayType expected(42);
     ArrayType res(42);
 
-    x << 0.25, 0.5,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9., 10., 11., 12.,
-       13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25.,
-       26., 27., 28., 29., 30., 31., 32., 33., 34., 35., 36., 37., 38.,
-       39., 40.;
+    x << 0.25, 0.5, 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22.,
+        23., 24., 25., 26., 27., 28., 29., 30., 31., 32., 33., 34., 35., 36., 37., 38., 39., 40.;
 
-    expected << 1.97933385, 1.52410939, 1.14446308, 0.84156822,
-             0.6977616 , 0.60929767, 0.54780756, 0.50186313, 0.4658451 ,
-             0.43662302, 0.41229555, 0.39163193, 0.3737955 , 0.35819488,
-             0.34439865, 0.33208364, 0.32100235, 0.31096159, 0.30180802,
-             0.29341821, 0.28569149, 0.27854488, 0.2719092 , 0.26572635,
-             0.25994703, 0.25452917, 0.2494366 , 0.24463801, 0.24010616,
-             0.23581722, 0.23175022, 0.22788667, 0.22421014, 0.22070602,
-             0.21736123, 0.21416406, 0.21110397, 0.20817141, 0.20535778,
-             0.20265524, 0.20005668, 0.19755558;
+    expected << 1.97933385, 1.52410939, 1.14446308, 0.84156822, 0.6977616, 0.60929767, 0.54780756, 0.50186313,
+        0.4658451, 0.43662302, 0.41229555, 0.39163193, 0.3737955, 0.35819488, 0.34439865, 0.33208364, 0.32100235,
+        0.31096159, 0.30180802, 0.29341821, 0.28569149, 0.27854488, 0.2719092, 0.26572635, 0.25994703, 0.25452917,
+        0.2494366, 0.24463801, 0.24010616, 0.23581722, 0.23175022, 0.22788667, 0.22421014, 0.22070602, 0.21736123,
+        0.21416406, 0.21110397, 0.20817141, 0.20535778, 0.20265524, 0.20005668, 0.19755558;
 
-    CALL_SUBTEST(res = bessel_k0e(x);
-                 verify_component_wise(res, expected););
+    CALL_SUBTEST(res = bessel_k0e(x); verify_component_wise(res, expected););
   }
 
   // Test Bessel function k0. Reference results obtained with SciPy.
@@ -210,25 +164,17 @@
     ArrayType expected(42);
     ArrayType res(42);
 
-    x << 0.25, 0.5,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9., 10., 11., 12.,
-       13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25.,
-       26., 27., 28., 29., 30., 31., 32., 33., 34., 35., 36., 37., 38.,
-       39., 40.;
+    x << 0.25, 0.5, 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22.,
+        23., 24., 25., 26., 27., 28., 29., 30., 31., 32., 33., 34., 35., 36., 37., 38., 39., 40.;
 
-    expected << 1.54150675, 0.92441907, 4.21024438e-01, 1.13893873e-01,
-             3.47395044e-02, 1.11596761e-02, 3.69109833e-03, 1.24399433e-03,
-             4.24795742e-04, 1.46470705e-04, 5.08813130e-05, 1.77800623e-05,
-             6.24302055e-06, 2.20082540e-06, 7.78454386e-07, 2.76137082e-07,
-             9.81953648e-08, 3.49941166e-08, 1.24946640e-08, 4.46875334e-09,
-             1.60067129e-09, 5.74123782e-10, 2.06176797e-10, 7.41235161e-11,
-             2.66754511e-11, 9.60881878e-12, 3.46416156e-12, 1.24987740e-12,
-             4.51286453e-13, 1.63053459e-13, 5.89495073e-14, 2.13247750e-14,
-             7.71838266e-15, 2.79505752e-15, 1.01266123e-15, 3.67057597e-16,
-             1.33103515e-16, 4.82858338e-17, 1.75232770e-17, 6.36161716e-18,
-             2.31029936e-18, 8.39286110e-19;
+    expected << 1.54150675, 0.92441907, 4.21024438e-01, 1.13893873e-01, 3.47395044e-02, 1.11596761e-02, 3.69109833e-03,
+        1.24399433e-03, 4.24795742e-04, 1.46470705e-04, 5.08813130e-05, 1.77800623e-05, 6.24302055e-06, 2.20082540e-06,
+        7.78454386e-07, 2.76137082e-07, 9.81953648e-08, 3.49941166e-08, 1.24946640e-08, 4.46875334e-09, 1.60067129e-09,
+        5.74123782e-10, 2.06176797e-10, 7.41235161e-11, 2.66754511e-11, 9.60881878e-12, 3.46416156e-12, 1.24987740e-12,
+        4.51286453e-13, 1.63053459e-13, 5.89495073e-14, 2.13247750e-14, 7.71838266e-15, 2.79505752e-15, 1.01266123e-15,
+        3.67057597e-16, 1.33103515e-16, 4.82858338e-17, 1.75232770e-17, 6.36161716e-18, 2.31029936e-18, 8.39286110e-19;
 
-    CALL_SUBTEST(res = bessel_k0(x);
-                 verify_component_wise(res, expected););
+    CALL_SUBTEST(res = bessel_k0(x); verify_component_wise(res, expected););
   }
 
   // Test Bessel function k0e. Reference results obtained with SciPy.
@@ -237,25 +183,16 @@
     ArrayType expected(42);
     ArrayType res(42);
 
-    x << 0.25, 0.5,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9., 10., 11., 12.,
-       13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25.,
-       26., 27., 28., 29., 30., 31., 32., 33., 34., 35., 36., 37., 38.,
-       39., 40.;
+    x << 0.25, 0.5, 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22.,
+        23., 24., 25., 26., 27., 28., 29., 30., 31., 32., 33., 34., 35., 36., 37., 38., 39., 40.;
 
-    expected << 1.97933385, 1.52410939, 1.14446308, 0.84156822,
-             0.6977616 , 0.60929767, 0.54780756, 0.50186313,
-             0.4658451 , 0.43662302, 0.41229555, 0.39163193,
-             0.3737955 , 0.35819488, 0.34439865, 0.33208364,
-             0.32100235, 0.31096159, 0.30180802, 0.29341821,
-             0.28569149, 0.27854488, 0.2719092 , 0.26572635,
-             0.25994703, 0.25452917, 0.2494366 , 0.24463801,
-             0.24010616, 0.23581722, 0.23175022, 0.22788667,
-             0.22421014, 0.22070602, 0.21736123, 0.21416406,
-             0.21110397, 0.20817141, 0.20535778, 0.20265524,
-             0.20005668, 0.19755558;
+    expected << 1.97933385, 1.52410939, 1.14446308, 0.84156822, 0.6977616, 0.60929767, 0.54780756, 0.50186313,
+        0.4658451, 0.43662302, 0.41229555, 0.39163193, 0.3737955, 0.35819488, 0.34439865, 0.33208364, 0.32100235,
+        0.31096159, 0.30180802, 0.29341821, 0.28569149, 0.27854488, 0.2719092, 0.26572635, 0.25994703, 0.25452917,
+        0.2494366, 0.24463801, 0.24010616, 0.23581722, 0.23175022, 0.22788667, 0.22421014, 0.22070602, 0.21736123,
+        0.21416406, 0.21110397, 0.20817141, 0.20535778, 0.20265524, 0.20005668, 0.19755558;
 
-    CALL_SUBTEST(res = bessel_k0e(x);
-                 verify_component_wise(res, expected););
+    CALL_SUBTEST(res = bessel_k0e(x); verify_component_wise(res, expected););
   }
 
   // Test Bessel function k1. Reference results obtained with SciPy.
@@ -264,25 +201,17 @@
     ArrayType expected(42);
     ArrayType res(42);
 
-    x << 0.25, 0.5,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9., 10., 11., 12.,
-       13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25.,
-       26., 27., 28., 29., 30., 31., 32., 33., 34., 35., 36., 37., 38.,
-       39., 40.;
+    x << 0.25, 0.5, 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22.,
+        23., 24., 25., 26., 27., 28., 29., 30., 31., 32., 33., 34., 35., 36., 37., 38., 39., 40.;
 
-    expected << 3.74702597, 1.65644112, 6.01907230e-01, 1.39865882e-01,
-             4.01564311e-02, 1.24834989e-02, 4.04461345e-03, 1.34391972e-03,
-             4.54182487e-04, 1.55369212e-04, 5.36370164e-05, 1.86487735e-05,
-             6.52086067e-06, 2.29075746e-06, 8.07858841e-07, 2.85834365e-07,
-             1.01417294e-07, 3.60715712e-08, 1.28570417e-08, 4.59124963e-09,
-             1.64226697e-09, 5.88305797e-10, 2.11029922e-10, 7.57898116e-11,
-             2.72493059e-11, 9.80699893e-12, 3.53277807e-12, 1.27369078e-12,
-             4.59568940e-13, 1.65940011e-13, 5.99574032e-14, 2.16773200e-14,
-             7.84189960e-15, 2.83839927e-15, 1.02789171e-15, 3.72416929e-16,
-             1.34991783e-16, 4.89519373e-17, 1.77585196e-17, 6.44478588e-18,
-             2.33973340e-18, 8.49713195e-19;
+    expected << 3.74702597, 1.65644112, 6.01907230e-01, 1.39865882e-01, 4.01564311e-02, 1.24834989e-02, 4.04461345e-03,
+        1.34391972e-03, 4.54182487e-04, 1.55369212e-04, 5.36370164e-05, 1.86487735e-05, 6.52086067e-06, 2.29075746e-06,
+        8.07858841e-07, 2.85834365e-07, 1.01417294e-07, 3.60715712e-08, 1.28570417e-08, 4.59124963e-09, 1.64226697e-09,
+        5.88305797e-10, 2.11029922e-10, 7.57898116e-11, 2.72493059e-11, 9.80699893e-12, 3.53277807e-12, 1.27369078e-12,
+        4.59568940e-13, 1.65940011e-13, 5.99574032e-14, 2.16773200e-14, 7.84189960e-15, 2.83839927e-15, 1.02789171e-15,
+        3.72416929e-16, 1.34991783e-16, 4.89519373e-17, 1.77585196e-17, 6.44478588e-18, 2.33973340e-18, 8.49713195e-19;
 
-    CALL_SUBTEST(res = bessel_k1(x);
-                 verify_component_wise(res, expected););
+    CALL_SUBTEST(res = bessel_k1(x); verify_component_wise(res, expected););
   }
 
   // Test Bessel function k1e. Reference results obtained with SciPy.
@@ -291,25 +220,16 @@
     ArrayType expected(42);
     ArrayType res(42);
 
-    x << 0.25, 0.5,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9., 10., 11., 12.,
-       13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25.,
-       26., 27., 28., 29., 30., 31., 32., 33., 34., 35., 36., 37., 38.,
-       39., 40.;
+    x << 0.25, 0.5, 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22.,
+        23., 24., 25., 26., 27., 28., 29., 30., 31., 32., 33., 34., 35., 36., 37., 38., 39., 40.;
 
-    expected << 4.81127659, 2.73100971, 1.63615349, 1.03347685,
-             0.80656348, 0.68157595, 0.60027386, 0.54217591,
-             0.49807158, 0.46314909, 0.43462525, 0.41076657,
-             0.39043094, 0.37283175, 0.35740757, 0.34374563,
-             0.33153489, 0.32053597, 0.31056123, 0.30146131,
-             0.29311559, 0.2854255 , 0.27830958, 0.27169987,
-             0.26553913, 0.25977879, 0.25437733, 0.249299  ,
-             0.24451285, 0.23999191, 0.2357126 , 0.23165413,
-             0.22779816, 0.22412841, 0.22063036, 0.21729103,
-             0.21409878, 0.21104314, 0.20811462, 0.20530466,
-             0.20260547, 0.20000997;
+    expected << 4.81127659, 2.73100971, 1.63615349, 1.03347685, 0.80656348, 0.68157595, 0.60027386, 0.54217591,
+        0.49807158, 0.46314909, 0.43462525, 0.41076657, 0.39043094, 0.37283175, 0.35740757, 0.34374563, 0.33153489,
+        0.32053597, 0.31056123, 0.30146131, 0.29311559, 0.2854255, 0.27830958, 0.27169987, 0.26553913, 0.25977879,
+        0.25437733, 0.249299, 0.24451285, 0.23999191, 0.2357126, 0.23165413, 0.22779816, 0.22412841, 0.22063036,
+        0.21729103, 0.21409878, 0.21104314, 0.20811462, 0.20530466, 0.20260547, 0.20000997;
 
-    CALL_SUBTEST(res = bessel_k1e(x);
-                 verify_component_wise(res, expected););
+    CALL_SUBTEST(res = bessel_k1e(x); verify_component_wise(res, expected););
   }
 
   // Test Bessel function y0. Reference results obtained with SciPy.
@@ -318,23 +238,16 @@
     ArrayType expected(42);
     ArrayType res(42);
 
-    x << 0.25, 0.5,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9., 10., 11., 12.,
-       13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25.,
-       26., 27., 28., 29., 30., 31., 32., 33., 34., 35., 36., 37., 38.,
-       39., 40.;
+    x << 0.25, 0.5, 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22.,
+        23., 24., 25., 26., 27., 28., 29., 30., 31., 32., 33., 34., 35., 36., 37., 38., 39., 40.;
 
-    expected << -0.93157302, -0.44451873, 0.08825696,  0.51037567,  0.37685001,
-             -0.01694074, -0.30851763, -0.28819468, -0.02594974,  0.22352149,
-             0.2499367 ,  0.05567117, -0.16884732, -0.22523731, -0.07820786,
-             0.12719257,  0.2054643 , 0.095811  , -0.0926372 , -0.18755216,
-             -0.10951969,  0.0626406 , 0.17020176,  0.1198876 , -0.03598179,
-             -0.15283403, -0.12724943, 0.01204463,  0.13521498,  0.13183647,
-             0.00948116, -0.11729573, -0.13383266, -0.02874248,  0.09913483,
-             0.13340405,  0.04579799, -0.08085609, -0.13071488, -0.06066076,
-             0.06262353,  0.12593642;
+    expected << -0.93157302, -0.44451873, 0.08825696, 0.51037567, 0.37685001, -0.01694074, -0.30851763, -0.28819468,
+        -0.02594974, 0.22352149, 0.2499367, 0.05567117, -0.16884732, -0.22523731, -0.07820786, 0.12719257, 0.2054643,
+        0.095811, -0.0926372, -0.18755216, -0.10951969, 0.0626406, 0.17020176, 0.1198876, -0.03598179, -0.15283403,
+        -0.12724943, 0.01204463, 0.13521498, 0.13183647, 0.00948116, -0.11729573, -0.13383266, -0.02874248, 0.09913483,
+        0.13340405, 0.04579799, -0.08085609, -0.13071488, -0.06066076, 0.06262353, 0.12593642;
 
-    CALL_SUBTEST(res = bessel_y0(x);
-                 verify_component_wise(res, expected););
+    CALL_SUBTEST(res = bessel_y0(x); verify_component_wise(res, expected););
   }
 
   // Test Bessel function y1. Reference results obtained with SciPy.
@@ -343,28 +256,20 @@
     ArrayType expected(42);
     ArrayType res(42);
 
-    x << 0.25, 0.5,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9., 10., 11., 12.,
-       13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25.,
-       26., 27., 28., 29., 30., 31., 32., 33., 34., 35., 36., 37., 38.,
-       39., 40.;
+    x << 0.25, 0.5, 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22.,
+        23., 24., 25., 26., 27., 28., 29., 30., 31., 32., 33., 34., 35., 36., 37., 38., 39., 40.;
 
-    expected << -2.70410523, -1.47147239, -0.78121282, -0.10703243,
-             0.32467442,  0.39792571,  0.14786314, -0.17501034, -0.30266724,
-             -0.15806046,  0.10431458,  0.24901542, 0.16370554, -0.05709922,
-             -0.21008141, -0.16664484,  0.02107363, 0.17797517,  0.16720504,
-             0.00815513, -0.14956011, -0.16551161, -0.03253926,  0.12340586,
-             0.1616692 ,  0.05305978, -0.09882996, -0.15579655, -0.07025124,
-             0.07552213,  0.14803412,  0.08442557, -0.05337283, -0.13854483,
-             -0.09578012,  0.03238588,  0.12751273, 0.10445477, -0.01262946,
-             -0.11514066, -0.11056411, -0.00579351;
+    expected << -2.70410523, -1.47147239, -0.78121282, -0.10703243, 0.32467442, 0.39792571, 0.14786314, -0.17501034,
+        -0.30266724, -0.15806046, 0.10431458, 0.24901542, 0.16370554, -0.05709922, -0.21008141, -0.16664484, 0.02107363,
+        0.17797517, 0.16720504, 0.00815513, -0.14956011, -0.16551161, -0.03253926, 0.12340586, 0.1616692, 0.05305978,
+        -0.09882996, -0.15579655, -0.07025124, 0.07552213, 0.14803412, 0.08442557, -0.05337283, -0.13854483,
+        -0.09578012, 0.03238588, 0.12751273, 0.10445477, -0.01262946, -0.11514066, -0.11056411, -0.00579351;
 
-    CALL_SUBTEST(res = bessel_y1(x);
-                 verify_component_wise(res, expected););
+    CALL_SUBTEST(res = bessel_y1(x); verify_component_wise(res, expected););
   }
 }
 
-EIGEN_DECLARE_TEST(bessel_functions)
-{
+EIGEN_DECLARE_TEST(bessel_functions) {
   CALL_SUBTEST_1(array_bessel_functions<ArrayXf>());
   CALL_SUBTEST_2(array_bessel_functions<ArrayXd>());
 }
diff --git a/unsupported/test/bicgstabl.cpp b/unsupported/test/bicgstabl.cpp
index 302848c..4761e39 100644
--- a/unsupported/test/bicgstabl.cpp
+++ b/unsupported/test/bicgstabl.cpp
@@ -11,21 +11,20 @@
 #include "../../test/sparse_solver.h"
 #include <Eigen/IterativeSolvers>
 
-template<typename T> void test_bicgstabl_T()
-{
+template <typename T>
+void test_bicgstabl_T() {
   BiCGSTABL<SparseMatrix<T>, DiagonalPreconditioner<T> > bicgstabl_colmajor_diag;
-  BiCGSTABL<SparseMatrix<T>, IncompleteLUT<T> >           bicgstabl_colmajor_ilut;
+  BiCGSTABL<SparseMatrix<T>, IncompleteLUT<T> > bicgstabl_colmajor_ilut;
 
-  //This does not change the tolerance of the test, only the tolerance of the solver.
-  bicgstabl_colmajor_diag.setTolerance(NumTraits<T>::epsilon()*20);
-  bicgstabl_colmajor_ilut.setTolerance(NumTraits<T>::epsilon()*20);
+  // This does not change the tolerance of the test, only the tolerance of the solver.
+  bicgstabl_colmajor_diag.setTolerance(NumTraits<T>::epsilon() * 20);
+  bicgstabl_colmajor_ilut.setTolerance(NumTraits<T>::epsilon() * 20);
 
-  CALL_SUBTEST( check_sparse_square_solving(bicgstabl_colmajor_diag)  );
-  CALL_SUBTEST( check_sparse_square_solving(bicgstabl_colmajor_ilut)     );
+  CALL_SUBTEST(check_sparse_square_solving(bicgstabl_colmajor_diag));
+  CALL_SUBTEST(check_sparse_square_solving(bicgstabl_colmajor_ilut));
 }
 
-EIGEN_DECLARE_TEST(bicgstabl)
-{
+EIGEN_DECLARE_TEST(bicgstabl) {
   CALL_SUBTEST_1(test_bicgstabl_T<double>());
   CALL_SUBTEST_2(test_bicgstabl_T<std::complex<double> >());
 }
diff --git a/unsupported/test/cxx11_tensor_argmax.cpp b/unsupported/test/cxx11_tensor_argmax.cpp
index 8be622b..b86d84c 100644
--- a/unsupported/test/cxx11_tensor_argmax.cpp
+++ b/unsupported/test/cxx11_tensor_argmax.cpp
@@ -12,21 +12,20 @@
 
 #include <Eigen/CXX11/Tensor>
 
-using Eigen::Tensor;
 using Eigen::array;
 using Eigen::Pair;
+using Eigen::Tensor;
 
 template <int DataLayout>
-static void test_simple_index_pairs()
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,5,7);
+static void test_simple_index_pairs() {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
   tensor = (tensor + tensor.constant(0.5)).log();
 
-  Tensor<Pair<DenseIndex, float>, 4, DataLayout> index_pairs(2,3,5,7);
+  Tensor<Pair<DenseIndex, float>, 4, DataLayout> index_pairs(2, 3, 5, 7);
   index_pairs = tensor.index_pairs();
 
-  for (DenseIndex n = 0; n < 2*3*5*7; ++n) {
+  for (DenseIndex n = 0; n < 2 * 3 * 5 * 7; ++n) {
     const Pair<DenseIndex, float>& v = index_pairs.coeff(n);
     VERIFY_IS_EQUAL(v.first, n);
     VERIFY_IS_EQUAL(v.second, tensor.coeff(n));
@@ -34,37 +33,34 @@
 }
 
 template <int DataLayout>
-static void test_index_pairs_dim()
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,5,7);
+static void test_index_pairs_dim() {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
   tensor = (tensor + tensor.constant(0.5)).log();
 
-  Tensor<Pair<DenseIndex, float>, 4, DataLayout> index_pairs(2,3,5,7);
+  Tensor<Pair<DenseIndex, float>, 4, DataLayout> index_pairs(2, 3, 5, 7);
 
   index_pairs = tensor.index_pairs();
 
   for (Eigen::DenseIndex n = 0; n < tensor.size(); ++n) {
-    const Pair<DenseIndex, float>& v = index_pairs(n); //(i, j, k, l);
+    const Pair<DenseIndex, float>& v = index_pairs(n);  //(i, j, k, l);
     VERIFY_IS_EQUAL(v.first, n);
     VERIFY_IS_EQUAL(v.second, tensor(n));
   }
 }
 
 template <int DataLayout>
-static void test_argmax_pair_reducer()
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,5,7);
+static void test_argmax_pair_reducer() {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
   tensor = (tensor + tensor.constant(0.5)).log();
 
-  Tensor<Pair<DenseIndex, float>, 4, DataLayout> index_pairs(2,3,5,7);
+  Tensor<Pair<DenseIndex, float>, 4, DataLayout> index_pairs(2, 3, 5, 7);
   index_pairs = tensor.index_pairs();
 
   Tensor<Pair<DenseIndex, float>, 0, DataLayout> reduced;
   DimensionList<DenseIndex, 4> dims;
-  reduced = index_pairs.reduce(
-      dims, internal::ArgMaxPairReducer<Pair<DenseIndex, float> >());
+  reduced = index_pairs.reduce(dims, internal::ArgMaxPairReducer<Pair<DenseIndex, float> >());
 
   Tensor<float, 0, DataLayout> maxi = tensor.maximum();
 
@@ -73,8 +69,7 @@
   array<DenseIndex, 3> reduce_dims;
   for (int d = 0; d < 3; ++d) reduce_dims[d] = d;
   Tensor<Pair<DenseIndex, float>, 1, DataLayout> reduced_by_dims(7);
-  reduced_by_dims = index_pairs.reduce(
-      reduce_dims, internal::ArgMaxPairReducer<Pair<DenseIndex, float> >());
+  reduced_by_dims = index_pairs.reduce(reduce_dims, internal::ArgMaxPairReducer<Pair<DenseIndex, float> >());
 
   Tensor<float, 1, DataLayout> max_by_dims = tensor.maximum(reduce_dims);
 
@@ -84,19 +79,17 @@
 }
 
 template <int DataLayout>
-static void test_argmin_pair_reducer()
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,5,7);
+static void test_argmin_pair_reducer() {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
   tensor = (tensor + tensor.constant(0.5)).log();
 
-  Tensor<Pair<DenseIndex, float>, 4, DataLayout> index_pairs(2,3,5,7);
+  Tensor<Pair<DenseIndex, float>, 4, DataLayout> index_pairs(2, 3, 5, 7);
   index_pairs = tensor.index_pairs();
 
   Tensor<Pair<DenseIndex, float>, 0, DataLayout> reduced;
   DimensionList<DenseIndex, 4> dims;
-  reduced = index_pairs.reduce(
-      dims, internal::ArgMinPairReducer<Pair<DenseIndex, float> >());
+  reduced = index_pairs.reduce(dims, internal::ArgMinPairReducer<Pair<DenseIndex, float> >());
 
   Tensor<float, 0, DataLayout> mini = tensor.minimum();
 
@@ -105,8 +98,7 @@
   array<DenseIndex, 3> reduce_dims;
   for (int d = 0; d < 3; ++d) reduce_dims[d] = d;
   Tensor<Pair<DenseIndex, float>, 1, DataLayout> reduced_by_dims(7);
-  reduced_by_dims = index_pairs.reduce(
-      reduce_dims, internal::ArgMinPairReducer<Pair<DenseIndex, float> >());
+  reduced_by_dims = index_pairs.reduce(reduce_dims, internal::ArgMinPairReducer<Pair<DenseIndex, float> >());
 
   Tensor<float, 1, DataLayout> min_by_dims = tensor.minimum(reduce_dims);
 
@@ -116,12 +108,11 @@
 }
 
 template <int DataLayout>
-static void test_simple_argmax()
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,5,7);
+static void test_simple_argmax() {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
   tensor = (tensor + tensor.constant(0.5)).log();
-  tensor(0,0,0,0) = 10.0;
+  tensor(0, 0, 0, 0) = 10.0;
 
   Tensor<DenseIndex, 0, DataLayout> tensor_argmax;
 
@@ -129,20 +120,19 @@
 
   VERIFY_IS_EQUAL(tensor_argmax(0), 0);
 
-  tensor(1,2,4,6) = 20.0;
+  tensor(1, 2, 4, 6) = 20.0;
 
   tensor_argmax = tensor.argmax();
 
-  VERIFY_IS_EQUAL(tensor_argmax(0), 2*3*5*7 - 1);
+  VERIFY_IS_EQUAL(tensor_argmax(0), 2 * 3 * 5 * 7 - 1);
 }
 
 template <int DataLayout>
-static void test_simple_argmin()
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,5,7);
+static void test_simple_argmin() {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
   tensor = (tensor + tensor.constant(0.5)).log();
-  tensor(0,0,0,0) = -10.0;
+  tensor(0, 0, 0, 0) = -10.0;
 
   Tensor<DenseIndex, 0, DataLayout> tensor_argmin;
 
@@ -150,18 +140,17 @@
 
   VERIFY_IS_EQUAL(tensor_argmin(0), 0);
 
-  tensor(1,2,4,6) = -20.0;
+  tensor(1, 2, 4, 6) = -20.0;
 
   tensor_argmin = tensor.argmin();
 
-  VERIFY_IS_EQUAL(tensor_argmin(0), 2*3*5*7 - 1);
+  VERIFY_IS_EQUAL(tensor_argmin(0), 2 * 3 * 5 * 7 - 1);
 }
 
 template <int DataLayout>
-static void test_argmax_dim()
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,5,7);
-  std::vector<int> dims {2, 3, 5, 7};
+static void test_argmax_dim() {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
+  std::vector<int> dims{2, 3, 5, 7};
 
   for (int dim = 0; dim < 4; ++dim) {
     tensor.setRandom();
@@ -173,7 +162,10 @@
       for (int j = 0; j < 3; ++j) {
         for (int k = 0; k < 5; ++k) {
           for (int l = 0; l < 7; ++l) {
-            ix[0] = i; ix[1] = j; ix[2] = k; ix[3] = l;
+            ix[0] = i;
+            ix[1] = j;
+            ix[2] = k;
+            ix[3] = l;
             if (ix[dim] != 0) continue;
             // suppose dim == 1, then for all i, k, l, set tensor(i, 0, k, l) = 10.0
             tensor(ix) = 10.0;
@@ -184,8 +176,7 @@
 
     tensor_argmax = tensor.argmax(dim);
 
-    VERIFY_IS_EQUAL(tensor_argmax.size(),
-                    ptrdiff_t(2*3*5*7 / tensor.dimension(dim)));
+    VERIFY_IS_EQUAL(tensor_argmax.size(), ptrdiff_t(2 * 3 * 5 * 7 / tensor.dimension(dim)));
     for (ptrdiff_t n = 0; n < tensor_argmax.size(); ++n) {
       // Expect max to be in the first index of the reduced dimension
       VERIFY_IS_EQUAL(tensor_argmax.data()[n], 0);
@@ -195,7 +186,10 @@
       for (int j = 0; j < 3; ++j) {
         for (int k = 0; k < 5; ++k) {
           for (int l = 0; l < 7; ++l) {
-            ix[0] = i; ix[1] = j; ix[2] = k; ix[3] = l;
+            ix[0] = i;
+            ix[1] = j;
+            ix[2] = k;
+            ix[3] = l;
             if (ix[dim] != tensor.dimension(dim) - 1) continue;
             // suppose dim == 1, then for all i, k, l, set tensor(i, 2, k, l) = 20.0
             tensor(ix) = 20.0;
@@ -206,8 +200,7 @@
 
     tensor_argmax = tensor.argmax(dim);
 
-    VERIFY_IS_EQUAL(tensor_argmax.size(),
-                    ptrdiff_t(2*3*5*7 / tensor.dimension(dim)));
+    VERIFY_IS_EQUAL(tensor_argmax.size(), ptrdiff_t(2 * 3 * 5 * 7 / tensor.dimension(dim)));
     for (ptrdiff_t n = 0; n < tensor_argmax.size(); ++n) {
       // Expect max to be in the last index of the reduced dimension
       VERIFY_IS_EQUAL(tensor_argmax.data()[n], tensor.dimension(dim) - 1);
@@ -216,10 +209,9 @@
 }
 
 template <int DataLayout>
-static void test_argmin_dim()
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,5,7);
-  std::vector<int> dims {2, 3, 5, 7};
+static void test_argmin_dim() {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
+  std::vector<int> dims{2, 3, 5, 7};
 
   for (int dim = 0; dim < 4; ++dim) {
     tensor.setRandom();
@@ -231,7 +223,10 @@
       for (int j = 0; j < 3; ++j) {
         for (int k = 0; k < 5; ++k) {
           for (int l = 0; l < 7; ++l) {
-            ix[0] = i; ix[1] = j; ix[2] = k; ix[3] = l;
+            ix[0] = i;
+            ix[1] = j;
+            ix[2] = k;
+            ix[3] = l;
             if (ix[dim] != 0) continue;
             // suppose dim == 1, then for all i, k, l, set tensor(i, 0, k, l) = -10.0
             tensor(ix) = -10.0;
@@ -242,8 +237,7 @@
 
     tensor_argmin = tensor.argmin(dim);
 
-    VERIFY_IS_EQUAL(tensor_argmin.size(),
-                    ptrdiff_t(2*3*5*7 / tensor.dimension(dim)));
+    VERIFY_IS_EQUAL(tensor_argmin.size(), ptrdiff_t(2 * 3 * 5 * 7 / tensor.dimension(dim)));
     for (ptrdiff_t n = 0; n < tensor_argmin.size(); ++n) {
       // Expect min to be in the first index of the reduced dimension
       VERIFY_IS_EQUAL(tensor_argmin.data()[n], 0);
@@ -253,7 +247,10 @@
       for (int j = 0; j < 3; ++j) {
         for (int k = 0; k < 5; ++k) {
           for (int l = 0; l < 7; ++l) {
-            ix[0] = i; ix[1] = j; ix[2] = k; ix[3] = l;
+            ix[0] = i;
+            ix[1] = j;
+            ix[2] = k;
+            ix[3] = l;
             if (ix[dim] != tensor.dimension(dim) - 1) continue;
             // suppose dim == 1, then for all i, k, l, set tensor(i, 2, k, l) = -20.0
             tensor(ix) = -20.0;
@@ -264,8 +261,7 @@
 
     tensor_argmin = tensor.argmin(dim);
 
-    VERIFY_IS_EQUAL(tensor_argmin.size(),
-                    ptrdiff_t(2*3*5*7 / tensor.dimension(dim)));
+    VERIFY_IS_EQUAL(tensor_argmin.size(), ptrdiff_t(2 * 3 * 5 * 7 / tensor.dimension(dim)));
     for (ptrdiff_t n = 0; n < tensor_argmin.size(); ++n) {
       // Expect min to be in the last index of the reduced dimension
       VERIFY_IS_EQUAL(tensor_argmin.data()[n], tensor.dimension(dim) - 1);
@@ -273,8 +269,7 @@
   }
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_argmax)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_argmax) {
   CALL_SUBTEST(test_simple_index_pairs<RowMajor>());
   CALL_SUBTEST(test_simple_index_pairs<ColMajor>());
   CALL_SUBTEST(test_index_pairs_dim<RowMajor>());
diff --git a/unsupported/test/cxx11_tensor_argmax_gpu.cu b/unsupported/test/cxx11_tensor_argmax_gpu.cu
index d9d5da4..83058be 100644
--- a/unsupported/test/cxx11_tensor_argmax_gpu.cu
+++ b/unsupported/test/cxx11_tensor_argmax_gpu.cu
@@ -7,7 +7,6 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-
 #define EIGEN_TEST_NO_LONGDOUBLE
 
 #define EIGEN_USE_GPU
@@ -20,9 +19,8 @@
 using Eigen::Tensor;
 
 template <int Layout>
-void test_gpu_simple_argmax()
-{
-  Tensor<double, 3, Layout> in(Eigen::array<DenseIndex, 3>(72,53,97));
+void test_gpu_simple_argmax() {
+  Tensor<double, 3, Layout> in(Eigen::array<DenseIndex, 3>(72, 53, 97));
   Tensor<DenseIndex, 0, Layout> out_max;
   Tensor<DenseIndex, 0, Layout> out_min;
   in.setRandom();
@@ -45,18 +43,20 @@
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
-  Eigen::TensorMap<Eigen::Tensor<double, 3, Layout>, Aligned > gpu_in(d_in, Eigen::array<DenseIndex, 3>(72,53,97));
-  Eigen::TensorMap<Eigen::Tensor<DenseIndex, 0, Layout>, Aligned > gpu_out_max(d_out_max);
-  Eigen::TensorMap<Eigen::Tensor<DenseIndex, 0, Layout>, Aligned > gpu_out_min(d_out_min);
+  Eigen::TensorMap<Eigen::Tensor<double, 3, Layout>, Aligned> gpu_in(d_in, Eigen::array<DenseIndex, 3>(72, 53, 97));
+  Eigen::TensorMap<Eigen::Tensor<DenseIndex, 0, Layout>, Aligned> gpu_out_max(d_out_max);
+  Eigen::TensorMap<Eigen::Tensor<DenseIndex, 0, Layout>, Aligned> gpu_out_min(d_out_min);
 
   gpu_out_max.device(gpu_device) = gpu_in.argmax();
   gpu_out_min.device(gpu_device) = gpu_in.argmin();
 
-  assert(gpuMemcpyAsync(out_max.data(), d_out_max, out_bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) == gpuSuccess);
-  assert(gpuMemcpyAsync(out_min.data(), d_out_min, out_bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) == gpuSuccess);
+  assert(gpuMemcpyAsync(out_max.data(), d_out_max, out_bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) ==
+         gpuSuccess);
+  assert(gpuMemcpyAsync(out_min.data(), d_out_min, out_bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) ==
+         gpuSuccess);
   assert(gpuStreamSynchronize(gpu_device.stream()) == gpuSuccess);
 
-  VERIFY_IS_EQUAL(out_max(), 72*53*97 - 1);
+  VERIFY_IS_EQUAL(out_max(), 72 * 53 * 97 - 1);
   VERIFY_IS_EQUAL(out_min(), 0);
 
   gpuFree(d_in);
@@ -65,18 +65,20 @@
 }
 
 template <int DataLayout>
-void test_gpu_argmax_dim()
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,5,7);
+void test_gpu_argmax_dim() {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   std::vector<int> dims;
-  dims.push_back(2); dims.push_back(3); dims.push_back(5); dims.push_back(7);
+  dims.push_back(2);
+  dims.push_back(3);
+  dims.push_back(5);
+  dims.push_back(7);
 
   for (int dim = 0; dim < 4; ++dim) {
     tensor.setRandom();
     tensor = (tensor + tensor.constant(0.5)).log();
 
     array<DenseIndex, 3> out_shape;
-    for (int d = 0; d < 3; ++d) out_shape[d] = (d < dim) ? dims[d] : dims[d+1];
+    for (int d = 0; d < 3; ++d) out_shape[d] = (d < dim) ? dims[d] : dims[d + 1];
 
     Tensor<DenseIndex, 3, DataLayout> tensor_arg(out_shape);
 
@@ -85,7 +87,10 @@
       for (int j = 0; j < 3; ++j) {
         for (int k = 0; k < 5; ++k) {
           for (int l = 0; l < 7; ++l) {
-            ix[0] = i; ix[1] = j; ix[2] = k; ix[3] = l;
+            ix[0] = i;
+            ix[1] = j;
+            ix[2] = k;
+            ix[3] = l;
             if (ix[dim] != 0) continue;
             // suppose dim == 1, then for all i, k, l, set tensor(i, 0, k, l) = 10.0
             tensor(ix) = 10.0;
@@ -107,16 +112,17 @@
     Eigen::GpuStreamDevice stream;
     Eigen::GpuDevice gpu_device(&stream);
 
-    Eigen::TensorMap<Eigen::Tensor<float, 4, DataLayout>, Aligned > gpu_in(d_in, Eigen::array<DenseIndex, 4>(2, 3, 5, 7));
-    Eigen::TensorMap<Eigen::Tensor<DenseIndex, 3, DataLayout>, Aligned > gpu_out(d_out, out_shape);
+    Eigen::TensorMap<Eigen::Tensor<float, 4, DataLayout>, Aligned> gpu_in(d_in,
+                                                                          Eigen::array<DenseIndex, 4>(2, 3, 5, 7));
+    Eigen::TensorMap<Eigen::Tensor<DenseIndex, 3, DataLayout>, Aligned> gpu_out(d_out, out_shape);
 
     gpu_out.device(gpu_device) = gpu_in.argmax(dim);
 
-    assert(gpuMemcpyAsync(tensor_arg.data(), d_out, out_bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) == gpuSuccess);
+    assert(gpuMemcpyAsync(tensor_arg.data(), d_out, out_bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) ==
+           gpuSuccess);
     assert(gpuStreamSynchronize(gpu_device.stream()) == gpuSuccess);
 
-    VERIFY_IS_EQUAL(tensor_arg.size(),
-                    size_t(2*3*5*7 / tensor.dimension(dim)));
+    VERIFY_IS_EQUAL(tensor_arg.size(), size_t(2 * 3 * 5 * 7 / tensor.dimension(dim)));
 
     for (DenseIndex n = 0; n < tensor_arg.size(); ++n) {
       // Expect max to be in the first index of the reduced dimension
@@ -127,7 +133,10 @@
       for (int j = 0; j < 3; ++j) {
         for (int k = 0; k < 5; ++k) {
           for (int l = 0; l < 7; ++l) {
-            ix[0] = i; ix[1] = j; ix[2] = k; ix[3] = l;
+            ix[0] = i;
+            ix[1] = j;
+            ix[2] = k;
+            ix[3] = l;
             if (ix[dim] != tensor.dimension(dim) - 1) continue;
             // suppose dim == 1, then for all i, k, l, set tensor(i, 2, k, l) = 20.0
             tensor(ix) = 20.0;
@@ -140,7 +149,8 @@
 
     gpu_out.device(gpu_device) = gpu_in.argmax(dim);
 
-    assert(gpuMemcpyAsync(tensor_arg.data(), d_out, out_bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) == gpuSuccess);
+    assert(gpuMemcpyAsync(tensor_arg.data(), d_out, out_bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) ==
+           gpuSuccess);
     assert(gpuStreamSynchronize(gpu_device.stream()) == gpuSuccess);
 
     for (DenseIndex n = 0; n < tensor_arg.size(); ++n) {
@@ -154,18 +164,20 @@
 }
 
 template <int DataLayout>
-void test_gpu_argmin_dim()
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,5,7);
+void test_gpu_argmin_dim() {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   std::vector<int> dims;
-  dims.push_back(2); dims.push_back(3); dims.push_back(5); dims.push_back(7);
+  dims.push_back(2);
+  dims.push_back(3);
+  dims.push_back(5);
+  dims.push_back(7);
 
   for (int dim = 0; dim < 4; ++dim) {
     tensor.setRandom();
     tensor = (tensor + tensor.constant(0.5)).log();
 
     array<DenseIndex, 3> out_shape;
-    for (int d = 0; d < 3; ++d) out_shape[d] = (d < dim) ? dims[d] : dims[d+1];
+    for (int d = 0; d < 3; ++d) out_shape[d] = (d < dim) ? dims[d] : dims[d + 1];
 
     Tensor<DenseIndex, 3, DataLayout> tensor_arg(out_shape);
 
@@ -174,7 +186,10 @@
       for (int j = 0; j < 3; ++j) {
         for (int k = 0; k < 5; ++k) {
           for (int l = 0; l < 7; ++l) {
-            ix[0] = i; ix[1] = j; ix[2] = k; ix[3] = l;
+            ix[0] = i;
+            ix[1] = j;
+            ix[2] = k;
+            ix[3] = l;
             if (ix[dim] != 0) continue;
             // suppose dim == 1, then for all i, k, l, set tensor(i, 0, k, l) = 10.0
             tensor(ix) = -10.0;
@@ -196,16 +211,17 @@
     Eigen::GpuStreamDevice stream;
     Eigen::GpuDevice gpu_device(&stream);
 
-    Eigen::TensorMap<Eigen::Tensor<float, 4, DataLayout>, Aligned > gpu_in(d_in, Eigen::array<DenseIndex, 4>(2, 3, 5, 7));
-    Eigen::TensorMap<Eigen::Tensor<DenseIndex, 3, DataLayout>, Aligned > gpu_out(d_out, out_shape);
+    Eigen::TensorMap<Eigen::Tensor<float, 4, DataLayout>, Aligned> gpu_in(d_in,
+                                                                          Eigen::array<DenseIndex, 4>(2, 3, 5, 7));
+    Eigen::TensorMap<Eigen::Tensor<DenseIndex, 3, DataLayout>, Aligned> gpu_out(d_out, out_shape);
 
     gpu_out.device(gpu_device) = gpu_in.argmin(dim);
 
-    assert(gpuMemcpyAsync(tensor_arg.data(), d_out, out_bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) == gpuSuccess);
+    assert(gpuMemcpyAsync(tensor_arg.data(), d_out, out_bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) ==
+           gpuSuccess);
     assert(gpuStreamSynchronize(gpu_device.stream()) == gpuSuccess);
 
-    VERIFY_IS_EQUAL(tensor_arg.size(),
-                    2*3*5*7 / tensor.dimension(dim));
+    VERIFY_IS_EQUAL(tensor_arg.size(), 2 * 3 * 5 * 7 / tensor.dimension(dim));
 
     for (DenseIndex n = 0; n < tensor_arg.size(); ++n) {
       // Expect min to be in the first index of the reduced dimension
@@ -216,7 +232,10 @@
       for (int j = 0; j < 3; ++j) {
         for (int k = 0; k < 5; ++k) {
           for (int l = 0; l < 7; ++l) {
-            ix[0] = i; ix[1] = j; ix[2] = k; ix[3] = l;
+            ix[0] = i;
+            ix[1] = j;
+            ix[2] = k;
+            ix[3] = l;
             if (ix[dim] != tensor.dimension(dim) - 1) continue;
             // suppose dim == 1, then for all i, k, l, set tensor(i, 2, k, l) = 20.0
             tensor(ix) = -20.0;
@@ -229,7 +248,8 @@
 
     gpu_out.device(gpu_device) = gpu_in.argmin(dim);
 
-    assert(gpuMemcpyAsync(tensor_arg.data(), d_out, out_bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) == gpuSuccess);
+    assert(gpuMemcpyAsync(tensor_arg.data(), d_out, out_bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) ==
+           gpuSuccess);
     assert(gpuStreamSynchronize(gpu_device.stream()) == gpuSuccess);
 
     for (DenseIndex n = 0; n < tensor_arg.size(); ++n) {
@@ -242,8 +262,7 @@
   }
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_argmax_gpu)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_argmax_gpu) {
   CALL_SUBTEST_1(test_gpu_simple_argmax<RowMajor>());
   CALL_SUBTEST_1(test_gpu_simple_argmax<ColMajor>());
   CALL_SUBTEST_2(test_gpu_argmax_dim<RowMajor>());
diff --git a/unsupported/test/cxx11_tensor_assign.cpp b/unsupported/test/cxx11_tensor_assign.cpp
index 015865e..993249d 100644
--- a/unsupported/test/cxx11_tensor_assign.cpp
+++ b/unsupported/test/cxx11_tensor_assign.cpp
@@ -11,19 +11,24 @@
 
 #include <Eigen/CXX11/Tensor>
 
-using Eigen::Tensor;
 using Eigen::RowMajor;
+using Eigen::Tensor;
 
-static void test_1d()
-{
+static void test_1d() {
   Tensor<int, 1> vec1(6);
   Tensor<int, 1, RowMajor> vec2(6);
-  vec1(0) = 4;  vec2(0) = 0;
-  vec1(1) = 8;  vec2(1) = 1;
-  vec1(2) = 15; vec2(2) = 2;
-  vec1(3) = 16; vec2(3) = 3;
-  vec1(4) = 23; vec2(4) = 4;
-  vec1(5) = 42; vec2(5) = 5;
+  vec1(0) = 4;
+  vec2(0) = 0;
+  vec1(1) = 8;
+  vec2(1) = 1;
+  vec1(2) = 15;
+  vec2(2) = 2;
+  vec1(3) = 16;
+  vec2(3) = 3;
+  vec1(4) = 23;
+  vec2(4) = 4;
+  vec1(5) = 42;
+  vec2(5) = 5;
 
   int col_major[6] = {0};
   int row_major[6] = {0};
@@ -67,24 +72,23 @@
   VERIFY_IS_EQUAL(vec2(5), 5);
 }
 
-static void test_2d()
-{
-  Tensor<int, 2> mat1(2,3);
-  Tensor<int, 2, RowMajor> mat2(2,3);
+static void test_2d() {
+  Tensor<int, 2> mat1(2, 3);
+  Tensor<int, 2, RowMajor> mat2(2, 3);
 
-  mat1(0,0) = 0;
-  mat1(0,1) = 1;
-  mat1(0,2) = 2;
-  mat1(1,0) = 3;
-  mat1(1,1) = 4;
-  mat1(1,2) = 5;
+  mat1(0, 0) = 0;
+  mat1(0, 1) = 1;
+  mat1(0, 2) = 2;
+  mat1(1, 0) = 3;
+  mat1(1, 1) = 4;
+  mat1(1, 2) = 5;
 
-  mat2(0,0) = 0;
-  mat2(0,1) = 1;
-  mat2(0,2) = 2;
-  mat2(1,0) = 3;
-  mat2(1,1) = 4;
-  mat2(1,2) = 5;
+  mat2(0, 0) = 0;
+  mat2(0, 1) = 1;
+  mat2(0, 2) = 2;
+  mat2(1, 0) = 3;
+  mat2(1, 1) = 4;
+  mat2(1, 2) = 5;
 
   int col_major[6] = {0};
   int row_major[6] = {0};
@@ -94,58 +98,57 @@
   mat3 = mat1;
   mat4 = mat2;
 
-  VERIFY_IS_EQUAL(mat3(0,0), 0);
-  VERIFY_IS_EQUAL(mat3(0,1), 1);
-  VERIFY_IS_EQUAL(mat3(0,2), 2);
-  VERIFY_IS_EQUAL(mat3(1,0), 3);
-  VERIFY_IS_EQUAL(mat3(1,1), 4);
-  VERIFY_IS_EQUAL(mat3(1,2), 5);
+  VERIFY_IS_EQUAL(mat3(0, 0), 0);
+  VERIFY_IS_EQUAL(mat3(0, 1), 1);
+  VERIFY_IS_EQUAL(mat3(0, 2), 2);
+  VERIFY_IS_EQUAL(mat3(1, 0), 3);
+  VERIFY_IS_EQUAL(mat3(1, 1), 4);
+  VERIFY_IS_EQUAL(mat3(1, 2), 5);
 
-  VERIFY_IS_EQUAL(mat4(0,0), 0);
-  VERIFY_IS_EQUAL(mat4(0,1), 1);
-  VERIFY_IS_EQUAL(mat4(0,2), 2);
-  VERIFY_IS_EQUAL(mat4(1,0), 3);
-  VERIFY_IS_EQUAL(mat4(1,1), 4);
-  VERIFY_IS_EQUAL(mat4(1,2), 5);
+  VERIFY_IS_EQUAL(mat4(0, 0), 0);
+  VERIFY_IS_EQUAL(mat4(0, 1), 1);
+  VERIFY_IS_EQUAL(mat4(0, 2), 2);
+  VERIFY_IS_EQUAL(mat4(1, 0), 3);
+  VERIFY_IS_EQUAL(mat4(1, 1), 4);
+  VERIFY_IS_EQUAL(mat4(1, 2), 5);
 
   mat1.setZero();
   mat2.setZero();
   mat1 = mat3;
   mat2 = mat4;
 
-  VERIFY_IS_EQUAL(mat1(0,0), 0);
-  VERIFY_IS_EQUAL(mat1(0,1), 1);
-  VERIFY_IS_EQUAL(mat1(0,2), 2);
-  VERIFY_IS_EQUAL(mat1(1,0), 3);
-  VERIFY_IS_EQUAL(mat1(1,1), 4);
-  VERIFY_IS_EQUAL(mat1(1,2), 5);
+  VERIFY_IS_EQUAL(mat1(0, 0), 0);
+  VERIFY_IS_EQUAL(mat1(0, 1), 1);
+  VERIFY_IS_EQUAL(mat1(0, 2), 2);
+  VERIFY_IS_EQUAL(mat1(1, 0), 3);
+  VERIFY_IS_EQUAL(mat1(1, 1), 4);
+  VERIFY_IS_EQUAL(mat1(1, 2), 5);
 
-  VERIFY_IS_EQUAL(mat2(0,0), 0);
-  VERIFY_IS_EQUAL(mat2(0,1), 1);
-  VERIFY_IS_EQUAL(mat2(0,2), 2);
-  VERIFY_IS_EQUAL(mat2(1,0), 3);
-  VERIFY_IS_EQUAL(mat2(1,1), 4);
-  VERIFY_IS_EQUAL(mat2(1,2), 5);
+  VERIFY_IS_EQUAL(mat2(0, 0), 0);
+  VERIFY_IS_EQUAL(mat2(0, 1), 1);
+  VERIFY_IS_EQUAL(mat2(0, 2), 2);
+  VERIFY_IS_EQUAL(mat2(1, 0), 3);
+  VERIFY_IS_EQUAL(mat2(1, 1), 4);
+  VERIFY_IS_EQUAL(mat2(1, 2), 5);
 }
 
-static void test_3d()
-{
-  Tensor<int, 3> mat1(2,3,7);
-  Tensor<int, 3, RowMajor> mat2(2,3,7);
+static void test_3d() {
+  Tensor<int, 3> mat1(2, 3, 7);
+  Tensor<int, 3, RowMajor> mat2(2, 3, 7);
 
   int val = 0;
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        mat1(i,j,k) = val;
-        mat2(i,j,k) = val;
+        mat1(i, j, k) = val;
+        mat2(i, j, k) = val;
         val++;
       }
     }
   }
 
-  int col_major[2*3*7] = {0};
-  int row_major[2*3*7] = {0};
+  int col_major[2 * 3 * 7] = {0};
+  int row_major[2 * 3 * 7] = {0};
   TensorMap<Tensor<int, 3> > mat3(col_major, 2, 3, 7);
   TensorMap<Tensor<int, 3, RowMajor> > mat4(row_major, 2, 3, 7);
 
@@ -156,8 +159,8 @@
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_EQUAL(mat3(i,j,k), val);
-        VERIFY_IS_EQUAL(mat4(i,j,k), val);
+        VERIFY_IS_EQUAL(mat3(i, j, k), val);
+        VERIFY_IS_EQUAL(mat4(i, j, k), val);
         val++;
       }
     }
@@ -172,16 +175,15 @@
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_EQUAL(mat1(i,j,k), val);
-        VERIFY_IS_EQUAL(mat2(i,j,k), val);
+        VERIFY_IS_EQUAL(mat1(i, j, k), val);
+        VERIFY_IS_EQUAL(mat2(i, j, k), val);
         val++;
       }
     }
   }
 }
 
-static void test_same_type()
-{
+static void test_same_type() {
   Tensor<int, 1> orig_tensor(5);
   Tensor<int, 1> dest_tensor(5);
   orig_tensor.setRandom();
@@ -218,12 +220,11 @@
   VERIFY_IS_EQUAL(orig_map.data(), orig_data);
   VERIFY_IS_EQUAL(dest_map.data(), dest_data);
   for (int i = 0; i < 5; ++i) {
-    VERIFY_IS_EQUAL(dest[i], i+1);
+    VERIFY_IS_EQUAL(dest[i], i + 1);
   }
 }
 
-static void test_auto_resize()
-{
+static void test_auto_resize() {
   Tensor<int, 1> tensor1;
   Tensor<int, 1> tensor2(3);
   Tensor<int, 1> tensor3(5);
@@ -246,9 +247,7 @@
   }
 }
 
-
-static void test_compound_assign()
-{
+static void test_compound_assign() {
   Tensor<int, 1> start_tensor(10);
   Tensor<int, 1> offset_tensor(10);
   start_tensor.setRandom();
@@ -321,9 +320,8 @@
   VERIFY_IS_EQUAL(b(1, 2), 5);
 
   Eigen::Tensor<int, 3> c(3, 2, 4);
-  c.setValues({{{0, 1, 2, 3}, {4, 5, 6, 7}},
-               {{10, 11, 12, 13}, {14, 15, 16, 17}},
-               {{20, 21, 22, 23}, {24, 25, 26, 27}}});
+  c.setValues(
+      {{{0, 1, 2, 3}, {4, 5, 6, 7}}, {{10, 11, 12, 13}, {14, 15, 16, 17}}, {{20, 21, 22, 23}, {24, 25, 26, 27}}});
   VERIFY_IS_EQUAL(c(0, 0, 0), 0);
   VERIFY_IS_EQUAL(c(0, 0, 1), 1);
   VERIFY_IS_EQUAL(c(0, 0, 2), 2);
@@ -350,8 +348,7 @@
   VERIFY_IS_EQUAL(c(2, 1, 3), 27);
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_assign)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_assign) {
   CALL_SUBTEST(test_1d());
   CALL_SUBTEST(test_2d());
   CALL_SUBTEST(test_3d());
diff --git a/unsupported/test/cxx11_tensor_block_access.cpp b/unsupported/test/cxx11_tensor_block_access.cpp
index 5fb12e0..7c5203d 100644
--- a/unsupported/test/cxx11_tensor_block_access.cpp
+++ b/unsupported/test/cxx11_tensor_block_access.cpp
@@ -15,23 +15,21 @@
 
 #include <Eigen/CXX11/Tensor>
 
-using Eigen::Tensor;
+using Eigen::ColMajor;
 using Eigen::Index;
 using Eigen::RowMajor;
-using Eigen::ColMajor;
+using Eigen::Tensor;
 using Eigen::internal::TensorBlockShapeType;
 
 static TensorOpCost zeroCost() { return {0, 0, 0}; }
 
-template<typename T>
+template <typename T>
 static const T& choose(int layout, const T& col, const T& row) {
   return layout == ColMajor ? col : row;
 }
 
 static TensorBlockShapeType RandomShape() {
-  return internal::random<bool>()
-         ? TensorBlockShapeType::kUniformAllDims
-         : TensorBlockShapeType::kSkewedInnerDims;
+  return internal::random<bool>() ? TensorBlockShapeType::kUniformAllDims : TensorBlockShapeType::kSkewedInnerDims;
 }
 
 template <int NumDims>
@@ -66,15 +64,13 @@
 }
 
 template <int Layout>
-static void test_block_mapper_sanity()
-{
+static void test_block_mapper_sanity() {
   typedef internal::TensorBlockMapper<2, Layout> TensorBlockMapper;
 
   DSizes<Index, 2> tensor_dims(100, 100);
 
   // Test uniform blocks.
-  TensorBlockMapper uniform_block_mapper(
-      tensor_dims, {TensorBlockShapeType::kUniformAllDims, 100, zeroCost()});
+  TensorBlockMapper uniform_block_mapper(tensor_dims, {TensorBlockShapeType::kUniformAllDims, 100, zeroCost()});
 
   VERIFY_IS_EQUAL(uniform_block_mapper.blockCount(), 100);
   VERIFY_IS_EQUAL(uniform_block_mapper.blockTotalSize(), 100);
@@ -85,8 +81,7 @@
   VERIFY_IS_EQUAL(uniform_b0.dimensions().at(1), 10);
 
   // Test skewed to inner dims blocks.
-  TensorBlockMapper skewed_block_mapper(
-      tensor_dims, {TensorBlockShapeType::kSkewedInnerDims, 100, zeroCost()});
+  TensorBlockMapper skewed_block_mapper(tensor_dims, {TensorBlockShapeType::kSkewedInnerDims, 100, zeroCost()});
 
   VERIFY_IS_EQUAL(skewed_block_mapper.blockCount(), 100);
   VERIFY_IS_EQUAL(skewed_block_mapper.blockTotalSize(), 100);
@@ -99,11 +94,10 @@
 
 // Given a TensorBlock "visit" every element accessible though it, and a keep an
 // index in the visited set. Verify that every coeff accessed only once.
-template<int NumDims, int Layout>
-static void UpdateCoeffSet(
-    const DSizes<Index, NumDims>& tensor_strides,
-    const internal::TensorBlockDescriptor<NumDims>& block,
-    Index first_coeff_index, int dim_index, std::set<Index>* visited_coeffs) {
+template <int NumDims, int Layout>
+static void UpdateCoeffSet(const DSizes<Index, NumDims>& tensor_strides,
+                           const internal::TensorBlockDescriptor<NumDims>& block, Index first_coeff_index,
+                           int dim_index, std::set<Index>* visited_coeffs) {
   const DSizes<Index, NumDims>& block_sizes = block.dimensions();
 
   for (int i = 0; i < block_sizes[dim_index]; ++i) {
@@ -113,8 +107,7 @@
       VERIFY_IS_EQUAL(inserted.second, true);
     } else {
       int next_dim_index = dim_index + choose(Layout, -1, 1);
-      UpdateCoeffSet<NumDims, Layout>(tensor_strides, block, first_coeff_index,
-                                         next_dim_index, visited_coeffs);
+      UpdateCoeffSet<NumDims, Layout>(tensor_strides, block, first_coeff_index, next_dim_index, visited_coeffs);
       first_coeff_index += tensor_strides[dim_index];
     }
   }
@@ -131,14 +124,11 @@
   std::set<Index> coeff_set;
 
   // Try different combinations of block types and sizes.
-  TensorBlockMapper block_mapper(
-      dims, {RandomShape(), RandomTargetSize(dims), zeroCost()});
+  TensorBlockMapper block_mapper(dims, {RandomShape(), RandomTargetSize(dims), zeroCost()});
 
   for (int i = 0; i < block_mapper.blockCount(); ++i) {
     auto block = block_mapper.blockDescriptor(i);
-    UpdateCoeffSet<NumDims, Layout>(strides, block, block.offset(),
-                                    choose(Layout, NumDims - 1, 0),
-                                    &coeff_set);
+    UpdateCoeffSet<NumDims, Layout>(strides, block, block.offset(), choose(Layout, NumDims - 1, 0), &coeff_set);
   }
 
   // Verify that every coefficient in the original Tensor is accessible through
@@ -150,10 +140,8 @@
 }
 
 template <int Layout, int NumDims>
-static Index GetInputIndex(Index output_index,
-                         const array<Index, NumDims>& output_to_input_dim_map,
-                         const array<Index, NumDims>& input_strides,
-                         const array<Index, NumDims>& output_strides) {
+static Index GetInputIndex(Index output_index, const array<Index, NumDims>& output_to_input_dim_map,
+                           const array<Index, NumDims>& input_strides, const array<Index, NumDims>& output_strides) {
   int input_index = 0;
   if (Layout == ColMajor) {
     for (int i = NumDims - 1; i > 0; --i) {
@@ -161,22 +149,19 @@
       input_index += idx * input_strides[output_to_input_dim_map[i]];
       output_index -= idx * output_strides[i];
     }
-    return input_index +
-           output_index * input_strides[output_to_input_dim_map[0]];
+    return input_index + output_index * input_strides[output_to_input_dim_map[0]];
   } else {
     for (int i = 0; i < NumDims - 1; ++i) {
       const Index idx = output_index / output_strides[i];
       input_index += idx * input_strides[output_to_input_dim_map[i]];
       output_index -= idx * output_strides[i];
     }
-    return input_index +
-           output_index * input_strides[output_to_input_dim_map[NumDims - 1]];
+    return input_index + output_index * input_strides[output_to_input_dim_map[NumDims - 1]];
   }
 }
 
 template <int Layout, int NumDims>
-static array<Index, NumDims> ComputeStrides(
-    const array<Index, NumDims>& sizes) {
+static array<Index, NumDims> ComputeStrides(const array<Index, NumDims>& sizes) {
   array<Index, NumDims> strides;
   if (Layout == ColMajor) {
     strides[0] = 1;
@@ -192,42 +177,37 @@
   return strides;
 }
 
-template<typename Scalar, typename StorageIndex, int Dim>
-class EqualityChecker
-{
-    const Scalar* input_data;
-    const DSizes<StorageIndex, Dim> &input_dims, &input_strides, &output_dims, &output_strides;
-    void check_recursive(const Scalar* input, const Scalar* output, int depth=0) const
-    {
-        if(depth==Dim)
-        {
-            VERIFY_IS_EQUAL(*input, *output);
-            return;
-        }
-
-        for(int i=0; i<output_dims[depth]; ++i)
-        {
-            check_recursive(input + i % input_dims[depth] * input_strides[depth], output + i*output_strides[depth], depth+1);
-        }
+template <typename Scalar, typename StorageIndex, int Dim>
+class EqualityChecker {
+  const Scalar* input_data;
+  const DSizes<StorageIndex, Dim>&input_dims, &input_strides, &output_dims, &output_strides;
+  void check_recursive(const Scalar* input, const Scalar* output, int depth = 0) const {
+    if (depth == Dim) {
+      VERIFY_IS_EQUAL(*input, *output);
+      return;
     }
-public:
-    EqualityChecker(const Scalar* input_data_,
-            const DSizes<StorageIndex, Dim> &input_dims_, const DSizes<StorageIndex, Dim> &input_strides_,
-            const DSizes<StorageIndex, Dim> &output_dims_, const DSizes<StorageIndex, Dim> &output_strides_)
-        : input_data(input_data_)
-        , input_dims(input_dims_), input_strides(input_strides_)
-        , output_dims(output_dims_), output_strides(output_strides_)
-        {}
 
-    void operator()(const Scalar* output_data) const
-    {
-        check_recursive(input_data, output_data);
+    for (int i = 0; i < output_dims[depth]; ++i) {
+      check_recursive(input + i % input_dims[depth] * input_strides[depth], output + i * output_strides[depth],
+                      depth + 1);
     }
+  }
+
+ public:
+  EqualityChecker(const Scalar* input_data_, const DSizes<StorageIndex, Dim>& input_dims_,
+                  const DSizes<StorageIndex, Dim>& input_strides_, const DSizes<StorageIndex, Dim>& output_dims_,
+                  const DSizes<StorageIndex, Dim>& output_strides_)
+      : input_data(input_data_),
+        input_dims(input_dims_),
+        input_strides(input_strides_),
+        output_dims(output_dims_),
+        output_strides(output_strides_) {}
+
+  void operator()(const Scalar* output_data) const { check_recursive(input_data, output_data); }
 };
 
 template <int Layout>
-static void test_uniform_block_shape()
-{
+static void test_uniform_block_shape() {
   typedef internal::TensorBlockDescriptor<5> TensorBlock;
   typedef internal::TensorBlockMapper<5, Layout> TensorBlockMapper;
 
@@ -235,8 +215,7 @@
     // Test shape 'UniformAllDims' with uniform 'max_coeff count'.
     DSizes<Index, 5> dims(11, 5, 6, 17, 7);
     const Index max_coeff_count = 5 * 5 * 5 * 5 * 5;
-    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kUniformAllDims,
-                                          max_coeff_count, zeroCost()});
+    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kUniformAllDims, max_coeff_count, zeroCost()});
     TensorBlock block = block_mapper.blockDescriptor(0);
     for (int i = 0; i < 5; ++i) {
       VERIFY_IS_EQUAL(5, block.dimensions()[i]);
@@ -249,8 +228,7 @@
   if (Layout == ColMajor) {
     DSizes<Index, 5> dims(11, 5, 6, 17, 7);
     const Index max_coeff_count = 7 * 5 * 5 * 5 * 5;
-    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kUniformAllDims,
-                                          max_coeff_count, zeroCost()});
+    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kUniformAllDims, max_coeff_count, zeroCost()});
     TensorBlock block = block_mapper.blockDescriptor(0);
     VERIFY_IS_EQUAL(7, block.dimensions()[0]);
     for (int i = 1; i < 5; ++i) {
@@ -260,8 +238,7 @@
   } else {
     DSizes<Index, 5> dims(11, 5, 6, 17, 7);
     const Index max_coeff_count = 5 * 5 * 5 * 5 * 6;
-    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kUniformAllDims,
-                                          max_coeff_count, zeroCost()});
+    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kUniformAllDims, max_coeff_count, zeroCost()});
     TensorBlock block = block_mapper.blockDescriptor(0);
     VERIFY_IS_EQUAL(6, block.dimensions()[4]);
     for (int i = 3; i >= 0; --i) {
@@ -275,8 +252,7 @@
   if (Layout == ColMajor) {
     DSizes<Index, 5> dims(11, 5, 6, 17, 7);
     const Index max_coeff_count = 11 * 5 * 5 * 5 * 5;
-    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kUniformAllDims,
-                                          max_coeff_count, zeroCost()});
+    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kUniformAllDims, max_coeff_count, zeroCost()});
     TensorBlock block = block_mapper.blockDescriptor(0);
     VERIFY_IS_EQUAL(11, block.dimensions()[0]);
     for (int i = 1; i < 5; ++i) {
@@ -286,8 +262,7 @@
   } else {
     DSizes<Index, 5> dims(11, 5, 6, 17, 7);
     const Index max_coeff_count = 5 * 5 * 5 * 5 * 7;
-    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kUniformAllDims,
-                                          max_coeff_count, zeroCost()});
+    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kUniformAllDims, max_coeff_count, zeroCost()});
     TensorBlock block = block_mapper.blockDescriptor(0);
     VERIFY_IS_EQUAL(7, block.dimensions()[4]);
     for (int i = 3; i >= 0; --i) {
@@ -301,8 +276,7 @@
   if (Layout == ColMajor) {
     DSizes<Index, 5> dims(7, 5, 6, 17, 7);
     const Index max_coeff_count = 7 * 5 * 6 * 7 * 5;
-    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kUniformAllDims,
-                                          max_coeff_count, zeroCost()});
+    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kUniformAllDims, max_coeff_count, zeroCost()});
     TensorBlock block = block_mapper.blockDescriptor(0);
     VERIFY_IS_EQUAL(7, block.dimensions()[0]);
     VERIFY_IS_EQUAL(5, block.dimensions()[1]);
@@ -313,8 +287,7 @@
   } else {
     DSizes<Index, 5> dims(7, 5, 6, 9, 7);
     const Index max_coeff_count = 5 * 5 * 5 * 6 * 7;
-    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kUniformAllDims,
-                                          max_coeff_count, zeroCost()});
+    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kUniformAllDims, max_coeff_count, zeroCost()});
     TensorBlock block = block_mapper.blockDescriptor(0);
     VERIFY_IS_EQUAL(7, block.dimensions()[4]);
     VERIFY_IS_EQUAL(6, block.dimensions()[3]);
@@ -328,8 +301,7 @@
   if (Layout == ColMajor) {
     DSizes<Index, 5> dims(7, 5, 6, 17, 7);
     const Index max_coeff_count = 7 * 5 * 6 * 17 * 7;
-    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kUniformAllDims,
-                                          max_coeff_count, zeroCost()});
+    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kUniformAllDims, max_coeff_count, zeroCost()});
     TensorBlock block = block_mapper.blockDescriptor(0);
     VERIFY_IS_EQUAL(7, block.dimensions()[0]);
     VERIFY_IS_EQUAL(5, block.dimensions()[1]);
@@ -340,8 +312,7 @@
   } else {
     DSizes<Index, 5> dims(7, 5, 6, 9, 7);
     const Index max_coeff_count = 7 * 5 * 6 * 9 * 7;
-    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kUniformAllDims,
-                                          max_coeff_count, zeroCost()});
+    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kUniformAllDims, max_coeff_count, zeroCost()});
     TensorBlock block = block_mapper.blockDescriptor(0);
     VERIFY_IS_EQUAL(7, block.dimensions()[4]);
     VERIFY_IS_EQUAL(9, block.dimensions()[3]);
@@ -353,8 +324,7 @@
 }
 
 template <int Layout>
-static void test_skewed_inner_dim_block_shape()
-{
+static void test_skewed_inner_dim_block_shape() {
   typedef internal::TensorBlockDescriptor<5> TensorBlock;
   typedef internal::TensorBlockMapper<5, Layout> TensorBlockMapper;
 
@@ -362,9 +332,7 @@
   if (Layout == ColMajor) {
     DSizes<Index, 5> dims(11, 5, 6, 17, 7);
     const Index max_coeff_count = 10 * 1 * 1 * 1 * 1;
-    TensorBlockMapper block_mapper(
-        dims,
-        {TensorBlockShapeType::kSkewedInnerDims, max_coeff_count, zeroCost()});
+    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kSkewedInnerDims, max_coeff_count, zeroCost()});
     TensorBlock block = block_mapper.blockDescriptor(0);
     VERIFY_IS_EQUAL(10, block.dimensions()[0]);
     for (int i = 1; i < 5; ++i) {
@@ -374,9 +342,7 @@
   } else {
     DSizes<Index, 5> dims(11, 5, 6, 17, 7);
     const Index max_coeff_count = 1 * 1 * 1 * 1 * 6;
-    TensorBlockMapper block_mapper(
-        dims,
-        {TensorBlockShapeType::kSkewedInnerDims, max_coeff_count, zeroCost()});
+    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kSkewedInnerDims, max_coeff_count, zeroCost()});
     TensorBlock block = block_mapper.blockDescriptor(0);
     VERIFY_IS_EQUAL(6, block.dimensions()[4]);
     for (int i = 3; i >= 0; --i) {
@@ -389,9 +355,7 @@
   if (Layout == ColMajor) {
     DSizes<Index, 5> dims(11, 5, 6, 17, 7);
     const Index max_coeff_count = 11 * 1 * 1 * 1 * 1;
-    TensorBlockMapper block_mapper(
-        dims,
-        {TensorBlockShapeType::kSkewedInnerDims, max_coeff_count, zeroCost()});
+    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kSkewedInnerDims, max_coeff_count, zeroCost()});
     TensorBlock block = block_mapper.blockDescriptor(0);
     VERIFY_IS_EQUAL(11, block.dimensions()[0]);
     for (int i = 1; i < 5; ++i) {
@@ -401,9 +365,7 @@
   } else {
     DSizes<Index, 5> dims(11, 5, 6, 17, 7);
     const Index max_coeff_count = 1 * 1 * 1 * 1 * 7;
-    TensorBlockMapper block_mapper(
-        dims,
-        {TensorBlockShapeType::kSkewedInnerDims, max_coeff_count, zeroCost()});
+    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kSkewedInnerDims, max_coeff_count, zeroCost()});
     TensorBlock block = block_mapper.blockDescriptor(0);
     VERIFY_IS_EQUAL(7, block.dimensions()[4]);
     for (int i = 3; i >= 0; --i) {
@@ -417,9 +379,7 @@
   if (Layout == ColMajor) {
     DSizes<Index, 5> dims(11, 5, 6, 17, 7);
     const Index max_coeff_count = 11 * 3 * 1 * 1 * 1;
-    TensorBlockMapper block_mapper(
-        dims,
-        {TensorBlockShapeType::kSkewedInnerDims, max_coeff_count, zeroCost()});
+    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kSkewedInnerDims, max_coeff_count, zeroCost()});
     TensorBlock block = block_mapper.blockDescriptor(0);
     VERIFY_IS_EQUAL(11, block.dimensions()[0]);
     VERIFY_IS_EQUAL(3, block.dimensions()[1]);
@@ -430,9 +390,7 @@
   } else {
     DSizes<Index, 5> dims(11, 5, 6, 17, 7);
     const Index max_coeff_count = 1 * 1 * 1 * 15 * 7;
-    TensorBlockMapper block_mapper(
-        dims,
-        {TensorBlockShapeType::kSkewedInnerDims, max_coeff_count, zeroCost()});
+    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kSkewedInnerDims, max_coeff_count, zeroCost()});
     TensorBlock block = block_mapper.blockDescriptor(0);
     VERIFY_IS_EQUAL(7, block.dimensions()[4]);
     VERIFY_IS_EQUAL(15, block.dimensions()[3]);
@@ -447,9 +405,7 @@
   if (Layout == ColMajor) {
     DSizes<Index, 5> dims(11, 5, 6, 17, 7);
     const Index max_coeff_count = 11 * 5 * 5 * 1 * 1;
-    TensorBlockMapper block_mapper(
-        dims,
-        {TensorBlockShapeType::kSkewedInnerDims, max_coeff_count, zeroCost()});
+    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kSkewedInnerDims, max_coeff_count, zeroCost()});
     TensorBlock block = block_mapper.blockDescriptor(0);
     VERIFY_IS_EQUAL(11, block.dimensions()[0]);
     VERIFY_IS_EQUAL(5, block.dimensions()[1]);
@@ -461,9 +417,7 @@
   } else {
     DSizes<Index, 5> dims(11, 5, 6, 17, 7);
     const Index max_coeff_count = 1 * 1 * 5 * 17 * 7;
-    TensorBlockMapper block_mapper(
-        dims,
-        {TensorBlockShapeType::kSkewedInnerDims, max_coeff_count, zeroCost()});
+    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kSkewedInnerDims, max_coeff_count, zeroCost()});
     TensorBlock block = block_mapper.blockDescriptor(0);
     VERIFY_IS_EQUAL(7, block.dimensions()[4]);
     VERIFY_IS_EQUAL(17, block.dimensions()[3]);
@@ -478,9 +432,7 @@
   if (Layout == ColMajor) {
     DSizes<Index, 5> dims(11, 5, 6, 17, 7);
     const Index max_coeff_count = 11 * 5 * 6 * 17 * 7;
-    TensorBlockMapper block_mapper(
-        dims,
-        {TensorBlockShapeType::kSkewedInnerDims, max_coeff_count, zeroCost()});
+    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kSkewedInnerDims, max_coeff_count, zeroCost()});
     TensorBlock block = block_mapper.blockDescriptor(0);
     VERIFY_IS_EQUAL(11, block.dimensions()[0]);
     VERIFY_IS_EQUAL(5, block.dimensions()[1]);
@@ -491,9 +443,7 @@
   } else {
     DSizes<Index, 5> dims(11, 5, 6, 17, 7);
     const Index max_coeff_count = 11 * 5 * 6 * 17 * 7;
-    TensorBlockMapper block_mapper(
-        dims,
-        {TensorBlockShapeType::kSkewedInnerDims, max_coeff_count, zeroCost()});
+    TensorBlockMapper block_mapper(dims, {TensorBlockShapeType::kSkewedInnerDims, max_coeff_count, zeroCost()});
     TensorBlock block = block_mapper.blockDescriptor(0);
     VERIFY_IS_EQUAL(7, block.dimensions()[4]);
     VERIFY_IS_EQUAL(17, block.dimensions()[3]);
@@ -505,8 +455,7 @@
 }
 
 template <int Layout>
-static void test_empty_dims(const internal::TensorBlockShapeType block_shape)
-{
+static void test_empty_dims(const internal::TensorBlockShapeType block_shape) {
   // Test blocking of tensors with zero dimensions:
   //  - we must not crash on asserts and divisions by zero
   //  - we must not return block with zero dimensions
@@ -517,8 +466,7 @@
 
     DSizes<Index, 1> dims(0);
     for (size_t max_coeff_count = 0; max_coeff_count < 2; ++max_coeff_count) {
-      TensorBlockMapper block_mapper(
-          dims, {block_shape, max_coeff_count, zeroCost()});
+      TensorBlockMapper block_mapper(dims, {block_shape, max_coeff_count, zeroCost()});
       VERIFY_IS_EQUAL(block_mapper.blockCount(), 0);
       VERIFY(block_mapper.blockTotalSize() >= 1);
     }
@@ -531,8 +479,7 @@
       for (int dim2 = 0; dim2 < 3; ++dim2) {
         DSizes<Index, 2> dims(dim1, dim2);
         for (size_t max_coeff_count = 0; max_coeff_count < 2; ++max_coeff_count) {
-          TensorBlockMapper block_mapper(
-              dims, {block_shape, max_coeff_count, zeroCost()});
+          TensorBlockMapper block_mapper(dims, {block_shape, max_coeff_count, zeroCost()});
           if (dim1 * dim2 == 0) {
             VERIFY_IS_EQUAL(block_mapper.blockCount(), 0);
           }
@@ -543,7 +490,7 @@
   }
 }
 
-#define TEST_LAYOUTS(NAME) \
+#define TEST_LAYOUTS(NAME)        \
   CALL_SUBTEST(NAME<ColMajor>()); \
   CALL_SUBTEST(NAME<RowMajor>())
 
@@ -560,7 +507,7 @@
   CALL_SUBTEST((NAME<TYPE, 5, RowMajor>()))
 
 #define TEST_LAYOUTS_WITH_ARG(NAME, ARG) \
-  CALL_SUBTEST(NAME<ColMajor>(ARG)); \
+  CALL_SUBTEST(NAME<ColMajor>(ARG));     \
   CALL_SUBTEST(NAME<RowMajor>(ARG))
 
 EIGEN_DECLARE_TEST(cxx11_tensor_block_access) {
diff --git a/unsupported/test/cxx11_tensor_block_eval.cpp b/unsupported/test/cxx11_tensor_block_eval.cpp
index d66a63e..75e2b8c 100644
--- a/unsupported/test/cxx11_tensor_block_eval.cpp
+++ b/unsupported/test/cxx11_tensor_block_eval.cpp
@@ -35,8 +35,7 @@
 };
 
 template <int Layout, int NumDims>
-static TensorBlockParams<NumDims> RandomBlock(DSizes<Index, NumDims> dims,
-                                              Index min, Index max) {
+static TensorBlockParams<NumDims> RandomBlock(DSizes<Index, NumDims> dims, Index min, Index max) {
   // Choose random offsets and sizes along all tensor dimensions.
   DSizes<Index, NumDims> offsets(RandomDims<NumDims>(min, max));
   DSizes<Index, NumDims> sizes(RandomDims<NumDims>(min, max));
@@ -59,13 +58,11 @@
 // Generate block with block sizes skewed towards inner dimensions. This type of
 // block is required for evaluating broadcast expressions.
 template <int Layout, int NumDims>
-static TensorBlockParams<NumDims> SkewedInnerBlock(
-    DSizes<Index, NumDims> dims) {
+static TensorBlockParams<NumDims> SkewedInnerBlock(DSizes<Index, NumDims> dims) {
   using BlockMapper = internal::TensorBlockMapper<NumDims, Layout, Index>;
-  BlockMapper block_mapper(dims,
-                           {internal::TensorBlockShapeType::kSkewedInnerDims,
-                            internal::random<size_t>(1, dims.TotalSize()),
-                            {0, 0, 0}});
+  BlockMapper block_mapper(
+      dims,
+      {internal::TensorBlockShapeType::kSkewedInnerDims, internal::random<size_t>(1, dims.TotalSize()), {0, 0, 0}});
 
   Index total_blocks = block_mapper.blockCount();
   Index block_index = internal::random<Index>(0, total_blocks - 1);
@@ -119,8 +116,7 @@
 // Verify that block expression evaluation produces the same result as a
 // TensorSliceOp (reading a tensor block is same to taking a tensor slice).
 
-template <typename T, int NumDims, int Layout, typename Expression,
-          typename GenBlockParams>
+template <typename T, int NumDims, int Layout, typename Expression, typename GenBlockParams>
 static void VerifyBlockEvaluator(Expression expr, GenBlockParams gen_block) {
   using Device = DefaultDevice;
   auto d = Device();
@@ -154,8 +150,7 @@
   Tensor<T, NumDims, Layout> dst(dst_dims);
   dst.setZero();
   if (internal::random<bool>()) {
-    block_params.desc.template AddDestinationBuffer<Layout>(
-        dst.data(), internal::strides<Layout>(dst.dimensions()));
+    block_params.desc.template AddDestinationBuffer<Layout>(dst.data(), internal::strides<Layout>(dst.dimensions()));
   }
 
   const bool root_of_expr = internal::random<bool>();
@@ -178,8 +173,7 @@
     // We explicitly disable vectorization and tiling, to run a simple coefficient
     // wise assignment loop, because it's very simple and should be correct.
     using BlockAssign = TensorAssignOp<decltype(block), const decltype(b_expr)>;
-    using BlockExecutor = TensorExecutor<const BlockAssign, Device, false,
-                                         internal::TiledEvaluation::Off>;
+    using BlockExecutor = TensorExecutor<const BlockAssign, Device, false, internal::TiledEvaluation::Off>;
     BlockExecutor::run(BlockAssign(block, b_expr), d);
   }
 
@@ -192,8 +186,7 @@
 
   // Explicitly use coefficient assignment to evaluate slice expression.
   using SliceAssign = TensorAssignOp<decltype(slice), const decltype(s_expr)>;
-  using SliceExecutor = TensorExecutor<const SliceAssign, Device, false,
-                                       internal::TiledEvaluation::Off>;
+  using SliceExecutor = TensorExecutor<const SliceAssign, Device, false, internal::TiledEvaluation::Off>;
   SliceExecutor::run(SliceAssign(slice, s_expr), d);
 
   // Tensor block and tensor slice must be the same.
@@ -211,8 +204,7 @@
   input.setRandom();
 
   // Identity tensor expression transformation.
-  VerifyBlockEvaluator<T, NumDims, Layout>(
-      input, [&dims]() { return RandomBlock<Layout>(dims, 1, 10); });
+  VerifyBlockEvaluator<T, NumDims, Layout>(input, [&dims]() { return RandomBlock<Layout>(dims, 1, 10); });
 }
 
 template <typename T, int NumDims, int Layout>
@@ -221,8 +213,7 @@
   Tensor<T, NumDims, Layout> input(dims);
   input.setRandom();
 
-  VerifyBlockEvaluator<T, NumDims, Layout>(
-      input.abs(), [&dims]() { return RandomBlock<Layout>(dims, 1, 10); });
+  VerifyBlockEvaluator<T, NumDims, Layout>(input.abs(), [&dims]() { return RandomBlock<Layout>(dims, 1, 10); });
 }
 
 template <typename T, int NumDims, int Layout>
@@ -232,8 +223,7 @@
   lhs.setRandom();
   rhs.setRandom();
 
-  VerifyBlockEvaluator<T, NumDims, Layout>(
-      lhs * rhs, [&dims]() { return RandomBlock<Layout>(dims, 1, 10); });
+  VerifyBlockEvaluator<T, NumDims, Layout>(lhs * rhs, [&dims]() { return RandomBlock<Layout>(dims, 1, 10); });
 }
 
 template <typename T, int NumDims, int Layout>
@@ -243,9 +233,8 @@
   lhs.setRandom();
   rhs.setRandom();
 
-  VerifyBlockEvaluator<T, NumDims, Layout>(
-      (lhs.abs() + rhs.abs()).sqrt(),
-      [&dims]() { return RandomBlock<Layout>(dims, 1, 10); });
+  VerifyBlockEvaluator<T, NumDims, Layout>((lhs.abs() + rhs.abs()).sqrt(),
+                                           [&dims]() { return RandomBlock<Layout>(dims, 1, 10); });
 }
 
 template <typename T, int NumDims, int Layout>
@@ -259,23 +248,19 @@
   DSizes<Index, NumDims> bcasted_dims;
   for (int i = 0; i < NumDims; ++i) bcasted_dims[i] = dims[i] * bcast[i];
 
-  VerifyBlockEvaluator<T, NumDims, Layout>(
-      input.broadcast(bcast),
-      [&bcasted_dims]() { return SkewedInnerBlock<Layout>(bcasted_dims); });
+  VerifyBlockEvaluator<T, NumDims, Layout>(input.broadcast(bcast),
+                                           [&bcasted_dims]() { return SkewedInnerBlock<Layout>(bcasted_dims); });
 
-  VerifyBlockEvaluator<T, NumDims, Layout>(
-      input.broadcast(bcast),
-      [&bcasted_dims]() { return RandomBlock<Layout>(bcasted_dims, 5, 10); });
+  VerifyBlockEvaluator<T, NumDims, Layout>(input.broadcast(bcast),
+                                           [&bcasted_dims]() { return RandomBlock<Layout>(bcasted_dims, 5, 10); });
 
-  VerifyBlockEvaluator<T, NumDims, Layout>(
-      input.broadcast(bcast),
-      [&bcasted_dims]() { return FixedSizeBlock(bcasted_dims); });
+  VerifyBlockEvaluator<T, NumDims, Layout>(input.broadcast(bcast),
+                                           [&bcasted_dims]() { return FixedSizeBlock(bcasted_dims); });
 
   // Check that desc.destination() memory is not shared between two broadcast
   // materializations.
-  VerifyBlockEvaluator<T, NumDims, Layout>(
-      input.broadcast(bcast) * input.abs().broadcast(bcast),
-      [&bcasted_dims]() { return SkewedInnerBlock<Layout>(bcasted_dims); });
+  VerifyBlockEvaluator<T, NumDims, Layout>(input.broadcast(bcast) * input.abs().broadcast(bcast),
+                                           [&bcasted_dims]() { return SkewedInnerBlock<Layout>(bcasted_dims); });
 }
 
 template <typename T, int NumDims, int Layout>
@@ -288,13 +273,11 @@
   Tensor<T, NumDims, Layout> input(dims);
   input.setRandom();
 
-  VerifyBlockEvaluator<T, NumDims, Layout>(
-      input.reshape(shuffled),
-      [&shuffled]() { return RandomBlock<Layout>(shuffled, 1, 10); });
+  VerifyBlockEvaluator<T, NumDims, Layout>(input.reshape(shuffled),
+                                           [&shuffled]() { return RandomBlock<Layout>(shuffled, 1, 10); });
 
-  VerifyBlockEvaluator<T, NumDims, Layout>(
-      input.reshape(shuffled),
-      [&shuffled]() { return SkewedInnerBlock<Layout>(shuffled); });
+  VerifyBlockEvaluator<T, NumDims, Layout>(input.reshape(shuffled),
+                                           [&shuffled]() { return SkewedInnerBlock<Layout>(shuffled); });
 }
 
 template <typename T, int NumDims, int Layout>
@@ -303,9 +286,8 @@
   Tensor<T, NumDims, Layout> input(dims);
   input.setRandom();
 
-  VerifyBlockEvaluator<T, NumDims, Layout>(
-      input.template cast<int>().template cast<T>(),
-      [&dims]() { return RandomBlock<Layout>(dims, 1, 10); });
+  VerifyBlockEvaluator<T, NumDims, Layout>(input.template cast<int>().template cast<T>(),
+                                           [&dims]() { return RandomBlock<Layout>(dims, 1, 10); });
 }
 
 template <typename T, int NumDims, int Layout>
@@ -318,9 +300,8 @@
   rhs.setRandom();
   cond.setRandom();
 
-  VerifyBlockEvaluator<T, NumDims, Layout>(cond.select(lhs, rhs), [&dims]() {
-    return RandomBlock<Layout>(dims, 1, 20);
-  });
+  VerifyBlockEvaluator<T, NumDims, Layout>(cond.select(lhs, rhs),
+                                           [&dims]() { return RandomBlock<Layout>(dims, 1, 20); });
 }
 
 template <typename T, int NumDims, int Layout>
@@ -350,17 +331,14 @@
     padded_dims[i] = dims[i] + pad_before[i] + pad_after[i];
   }
 
-  VerifyBlockEvaluator<T, NumDims, Layout>(
-      input.pad(paddings),
-      [&padded_dims]() { return FixedSizeBlock(padded_dims); });
+  VerifyBlockEvaluator<T, NumDims, Layout>(input.pad(paddings),
+                                           [&padded_dims]() { return FixedSizeBlock(padded_dims); });
 
-  VerifyBlockEvaluator<T, NumDims, Layout>(
-      input.pad(paddings),
-      [&padded_dims]() { return RandomBlock<Layout>(padded_dims, 1, 10); });
+  VerifyBlockEvaluator<T, NumDims, Layout>(input.pad(paddings),
+                                           [&padded_dims]() { return RandomBlock<Layout>(padded_dims, 1, 10); });
 
-  VerifyBlockEvaluator<T, NumDims, Layout>(
-      input.pad(paddings),
-      [&padded_dims]() { return SkewedInnerBlock<Layout>(padded_dims); });
+  VerifyBlockEvaluator<T, NumDims, Layout>(input.pad(paddings),
+                                           [&padded_dims]() { return SkewedInnerBlock<Layout>(padded_dims); });
 }
 
 template <typename T, int NumDims, int Layout>
@@ -381,26 +359,21 @@
   }
 
   // Block buffer forwarding.
-  VerifyBlockEvaluator<T, NumDims - 1, Layout>(
-      input.chip(chip_offset, chip_dim),
-      [&chipped_dims]() { return FixedSizeBlock(chipped_dims); });
+  VerifyBlockEvaluator<T, NumDims - 1, Layout>(input.chip(chip_offset, chip_dim),
+                                               [&chipped_dims]() { return FixedSizeBlock(chipped_dims); });
 
-  VerifyBlockEvaluator<T, NumDims - 1, Layout>(
-      input.chip(chip_offset, chip_dim),
-      [&chipped_dims]() { return RandomBlock<Layout>(chipped_dims, 1, 10); });
+  VerifyBlockEvaluator<T, NumDims - 1, Layout>(input.chip(chip_offset, chip_dim),
+                                               [&chipped_dims]() { return RandomBlock<Layout>(chipped_dims, 1, 10); });
 
   // Block expression assignment.
-  VerifyBlockEvaluator<T, NumDims - 1, Layout>(
-      input.abs().chip(chip_offset, chip_dim),
-      [&chipped_dims]() { return FixedSizeBlock(chipped_dims); });
+  VerifyBlockEvaluator<T, NumDims - 1, Layout>(input.abs().chip(chip_offset, chip_dim),
+                                               [&chipped_dims]() { return FixedSizeBlock(chipped_dims); });
 
-  VerifyBlockEvaluator<T, NumDims - 1, Layout>(
-      input.abs().chip(chip_offset, chip_dim),
-      [&chipped_dims]() { return RandomBlock<Layout>(chipped_dims, 1, 10); });
+  VerifyBlockEvaluator<T, NumDims - 1, Layout>(input.abs().chip(chip_offset, chip_dim),
+                                               [&chipped_dims]() { return RandomBlock<Layout>(chipped_dims, 1, 10); });
 }
 
-
-template<typename T, int NumDims>
+template <typename T, int NumDims>
 struct SimpleTensorGenerator {
   T operator()(const array<Index, NumDims>& coords) const {
     T result = static_cast<T>(0);
@@ -412,7 +385,7 @@
 };
 
 // Boolean specialization to avoid -Wint-in-bool-context warnings on GCC.
-template<int NumDims>
+template <int NumDims>
 struct SimpleTensorGenerator<bool, NumDims> {
   bool operator()(const array<Index, NumDims>& coords) const {
     bool result = false;
@@ -423,7 +396,6 @@
   }
 };
 
-
 template <typename T, int NumDims, int Layout>
 static void test_eval_tensor_generator() {
   DSizes<Index, NumDims> dims = RandomDims<NumDims>(10, 20);
@@ -432,12 +404,10 @@
 
   auto generator = SimpleTensorGenerator<T, NumDims>();
 
-  VerifyBlockEvaluator<T, NumDims, Layout>(
-      input.generate(generator), [&dims]() { return FixedSizeBlock(dims); });
+  VerifyBlockEvaluator<T, NumDims, Layout>(input.generate(generator), [&dims]() { return FixedSizeBlock(dims); });
 
-  VerifyBlockEvaluator<T, NumDims, Layout>(
-      input.generate(generator),
-      [&dims]() { return RandomBlock<Layout>(dims, 1, 10); });
+  VerifyBlockEvaluator<T, NumDims, Layout>(input.generate(generator),
+                                           [&dims]() { return RandomBlock<Layout>(dims, 1, 10); });
 }
 
 template <typename T, int NumDims, int Layout>
@@ -450,12 +420,10 @@
   Eigen::DSizes<bool, NumDims> reverse;
   for (int i = 0; i < NumDims; ++i) reverse[i] = internal::random<bool>();
 
-  VerifyBlockEvaluator<T, NumDims, Layout>(
-      input.reverse(reverse), [&dims]() { return FixedSizeBlock(dims); });
+  VerifyBlockEvaluator<T, NumDims, Layout>(input.reverse(reverse), [&dims]() { return FixedSizeBlock(dims); });
 
-  VerifyBlockEvaluator<T, NumDims, Layout>(input.reverse(reverse), [&dims]() {
-    return RandomBlock<Layout>(dims, 1, 10);
-  });
+  VerifyBlockEvaluator<T, NumDims, Layout>(input.reverse(reverse),
+                                           [&dims]() { return RandomBlock<Layout>(dims, 1, 10); });
 }
 
 template <typename T, int NumDims, int Layout>
@@ -474,13 +442,11 @@
     slice_size[i] = numext::mini(slice_size[i], dims[i] - slice_start[i]);
   }
 
-  VerifyBlockEvaluator<T, NumDims, Layout>(
-      input.slice(slice_start, slice_size),
-      [&slice_size]() { return FixedSizeBlock(slice_size); });
+  VerifyBlockEvaluator<T, NumDims, Layout>(input.slice(slice_start, slice_size),
+                                           [&slice_size]() { return FixedSizeBlock(slice_size); });
 
-  VerifyBlockEvaluator<T, NumDims, Layout>(
-      input.slice(slice_start, slice_size),
-      [&slice_size]() { return RandomBlock<Layout>(slice_size, 1, 10); });
+  VerifyBlockEvaluator<T, NumDims, Layout>(input.slice(slice_start, slice_size),
+                                           [&slice_size]() { return RandomBlock<Layout>(slice_size, 1, 10); });
 }
 
 template <typename T, int NumDims, int Layout>
@@ -496,14 +462,11 @@
     DSizes<Index, NumDims> shuffled_dims;
     for (int i = 0; i < NumDims; ++i) shuffled_dims[i] = dims[shuffle[i]];
 
-    VerifyBlockEvaluator<T, NumDims, Layout>(
-        input.shuffle(shuffle),
-        [&shuffled_dims]() { return FixedSizeBlock(shuffled_dims); });
+    VerifyBlockEvaluator<T, NumDims, Layout>(input.shuffle(shuffle),
+                                             [&shuffled_dims]() { return FixedSizeBlock(shuffled_dims); });
 
-    VerifyBlockEvaluator<T, NumDims, Layout>(
-        input.shuffle(shuffle), [&shuffled_dims]() {
-          return RandomBlock<Layout>(shuffled_dims, 1, 5);
-        });
+    VerifyBlockEvaluator<T, NumDims, Layout>(input.shuffle(shuffle),
+                                             [&shuffled_dims]() { return RandomBlock<Layout>(shuffled_dims, 1, 5); });
 
     break;
 
@@ -528,8 +491,7 @@
   DSizes<Index, 2> dims(dim, dim);
 
   VerifyBlockEvaluator<T, 2, Layout>(
-      lhs.reshape(reshapeLhs).broadcast(bcastLhs) *
-          rhs.reshape(reshapeRhs).broadcast(bcastRhs),
+      lhs.reshape(reshapeLhs).broadcast(bcastLhs) * rhs.reshape(reshapeRhs).broadcast(bcastRhs),
       [dims]() { return SkewedInnerBlock<Layout, 2>(dims); });
 }
 
@@ -547,13 +509,11 @@
 
   DSizes<Index, 2> dims(dim, dim);
 
-  VerifyBlockEvaluator<T, 2, Layout>(
-      (lhs.broadcast(bcastLhs) * rhs.broadcast(bcastRhs)).eval().reshape(dims),
-      [dims]() { return SkewedInnerBlock<Layout, 2>(dims); });
+  VerifyBlockEvaluator<T, 2, Layout>((lhs.broadcast(bcastLhs) * rhs.broadcast(bcastRhs)).eval().reshape(dims),
+                                     [dims]() { return SkewedInnerBlock<Layout, 2>(dims); });
 
-  VerifyBlockEvaluator<T, 2, Layout>(
-      (lhs.broadcast(bcastLhs) * rhs.broadcast(bcastRhs)).eval().reshape(dims),
-      [dims]() { return RandomBlock<Layout, 2>(dims, 1, 50); });
+  VerifyBlockEvaluator<T, 2, Layout>((lhs.broadcast(bcastLhs) * rhs.broadcast(bcastRhs)).eval().reshape(dims),
+                                     [dims]() { return RandomBlock<Layout, 2>(dims, 1, 50); });
 }
 
 template <typename T, int Layout>
@@ -570,17 +530,14 @@
   Eigen::array<Index, 3> bcast = {{dim0, 1, 1}};
   DSizes<Index, 2> chipped_dims(dim0, dim2);
 
-  VerifyBlockEvaluator<T, 2, Layout>(
-      input.broadcast(bcast).chip(0, 1),
-      [chipped_dims]() { return FixedSizeBlock(chipped_dims); });
+  VerifyBlockEvaluator<T, 2, Layout>(input.broadcast(bcast).chip(0, 1),
+                                     [chipped_dims]() { return FixedSizeBlock(chipped_dims); });
 
-  VerifyBlockEvaluator<T, 2, Layout>(
-      input.broadcast(bcast).chip(0, 1),
-      [chipped_dims]() { return SkewedInnerBlock<Layout, 2>(chipped_dims); });
+  VerifyBlockEvaluator<T, 2, Layout>(input.broadcast(bcast).chip(0, 1),
+                                     [chipped_dims]() { return SkewedInnerBlock<Layout, 2>(chipped_dims); });
 
-  VerifyBlockEvaluator<T, 2, Layout>(
-      input.broadcast(bcast).chip(0, 1),
-      [chipped_dims]() { return RandomBlock<Layout, 2>(chipped_dims, 1, 5); });
+  VerifyBlockEvaluator<T, 2, Layout>(input.broadcast(bcast).chip(0, 1),
+                                     [chipped_dims]() { return RandomBlock<Layout, 2>(chipped_dims, 1, 5); });
 }
 
 // -------------------------------------------------------------------------- //
@@ -588,10 +545,8 @@
 // as an assignment to TensorSliceOp (writing a block is is identical to
 // assigning one tensor to a slice of another tensor).
 
-template <typename T, int NumDims, int Layout, int NumExprDims = NumDims,
-          typename Expression, typename GenBlockParams>
-static void VerifyBlockAssignment(Tensor<T, NumDims, Layout>& tensor,
-                                  Expression expr, GenBlockParams gen_block) {
+template <typename T, int NumDims, int Layout, int NumExprDims = NumDims, typename Expression, typename GenBlockParams>
+static void VerifyBlockAssignment(Tensor<T, NumDims, Layout>& tensor, Expression expr, GenBlockParams gen_block) {
   using Device = DefaultDevice;
   auto d = Device();
 
@@ -609,8 +564,8 @@
   // (1) Assignment from a block.
 
   // Construct a materialize block from a random generated block tensor.
-  internal::TensorMaterializedBlock<T, NumExprDims, Layout> blk(
-      internal::TensorBlockKind::kView, block.data(), block.dimensions());
+  internal::TensorMaterializedBlock<T, NumExprDims, Layout> blk(internal::TensorBlockKind::kView, block.data(),
+                                                                block.dimensions());
 
   // Reset all underlying tensor values to zero.
   tensor.setZero();
@@ -632,8 +587,7 @@
 
   // Explicitly use coefficient assignment to evaluate slice expression.
   using SliceAssign = TensorAssignOp<decltype(s_expr), const decltype(block)>;
-  using SliceExecutor = TensorExecutor<const SliceAssign, Device, false,
-                                       internal::TiledEvaluation::Off>;
+  using SliceExecutor = TensorExecutor<const SliceAssign, Device, false, internal::TiledEvaluation::Off>;
   SliceExecutor::run(SliceAssign(s_expr, block), d);
 
   // Make a copy of the result after assignment.
@@ -653,10 +607,8 @@
 
   TensorMap<Tensor<T, NumDims, Layout>> map(tensor.data(), dims);
 
-  VerifyBlockAssignment<T, NumDims, Layout>(
-      tensor, map, [&dims]() { return RandomBlock<Layout>(dims, 10, 20); });
-  VerifyBlockAssignment<T, NumDims, Layout>(
-      tensor, map, [&dims]() { return FixedSizeBlock(dims); });
+  VerifyBlockAssignment<T, NumDims, Layout>(tensor, map, [&dims]() { return RandomBlock<Layout>(dims, 10, 20); });
+  VerifyBlockAssignment<T, NumDims, Layout>(tensor, map, [&dims]() { return FixedSizeBlock(dims); });
 }
 
 template <typename T, int NumDims, int Layout>
@@ -669,17 +621,14 @@
   DSizes<Index, NumDims> shuffled = dims;
   std::shuffle(&shuffled[0], &shuffled[NumDims - 1], std::mt19937(g_seed));
 
-  VerifyBlockAssignment<T, NumDims, Layout>(
-      tensor, map.reshape(shuffled),
-      [&shuffled]() { return RandomBlock<Layout>(shuffled, 1, 10); });
+  VerifyBlockAssignment<T, NumDims, Layout>(tensor, map.reshape(shuffled),
+                                            [&shuffled]() { return RandomBlock<Layout>(shuffled, 1, 10); });
 
-  VerifyBlockAssignment<T, NumDims, Layout>(
-      tensor, map.reshape(shuffled),
-      [&shuffled]() { return SkewedInnerBlock<Layout>(shuffled); });
+  VerifyBlockAssignment<T, NumDims, Layout>(tensor, map.reshape(shuffled),
+                                            [&shuffled]() { return SkewedInnerBlock<Layout>(shuffled); });
 
-  VerifyBlockAssignment<T, NumDims, Layout>(
-      tensor, map.reshape(shuffled),
-      [&shuffled]() { return FixedSizeBlock(shuffled); });
+  VerifyBlockAssignment<T, NumDims, Layout>(tensor, map.reshape(shuffled),
+                                            [&shuffled]() { return FixedSizeBlock(shuffled); });
 }
 
 template <typename T, int NumDims, int Layout>
@@ -701,16 +650,13 @@
   TensorMap<Tensor<T, NumDims, Layout>> map(tensor.data(), dims);
 
   VerifyBlockAssignment<T, NumDims, Layout, NumDims - 1>(
-      tensor, map.chip(chip_offset, chip_dim),
-      [&chipped_dims]() { return RandomBlock<Layout>(chipped_dims, 1, 10); });
+      tensor, map.chip(chip_offset, chip_dim), [&chipped_dims]() { return RandomBlock<Layout>(chipped_dims, 1, 10); });
 
   VerifyBlockAssignment<T, NumDims, Layout, NumDims - 1>(
-      tensor, map.chip(chip_offset, chip_dim),
-      [&chipped_dims]() { return SkewedInnerBlock<Layout>(chipped_dims); });
+      tensor, map.chip(chip_offset, chip_dim), [&chipped_dims]() { return SkewedInnerBlock<Layout>(chipped_dims); });
 
-  VerifyBlockAssignment<T, NumDims, Layout, NumDims - 1>(
-      tensor, map.chip(chip_offset, chip_dim),
-      [&chipped_dims]() { return FixedSizeBlock(chipped_dims); });
+  VerifyBlockAssignment<T, NumDims, Layout, NumDims - 1>(tensor, map.chip(chip_offset, chip_dim),
+                                                         [&chipped_dims]() { return FixedSizeBlock(chipped_dims); });
 }
 
 template <typename T, int NumDims, int Layout>
@@ -730,17 +676,14 @@
 
   TensorMap<Tensor<T, NumDims, Layout>> map(tensor.data(), dims);
 
-  VerifyBlockAssignment<T, NumDims, Layout>(
-      tensor, map.slice(slice_start, slice_size),
-      [&slice_size]() { return RandomBlock<Layout>(slice_size, 1, 10); });
+  VerifyBlockAssignment<T, NumDims, Layout>(tensor, map.slice(slice_start, slice_size),
+                                            [&slice_size]() { return RandomBlock<Layout>(slice_size, 1, 10); });
 
-  VerifyBlockAssignment<T, NumDims, Layout>(
-      tensor, map.slice(slice_start, slice_size),
-      [&slice_size]() { return SkewedInnerBlock<Layout>(slice_size); });
+  VerifyBlockAssignment<T, NumDims, Layout>(tensor, map.slice(slice_start, slice_size),
+                                            [&slice_size]() { return SkewedInnerBlock<Layout>(slice_size); });
 
-  VerifyBlockAssignment<T, NumDims, Layout>(
-      tensor, map.slice(slice_start, slice_size),
-      [&slice_size]() { return FixedSizeBlock(slice_size); });
+  VerifyBlockAssignment<T, NumDims, Layout>(tensor, map.slice(slice_start, slice_size),
+                                            [&slice_size]() { return FixedSizeBlock(slice_size); });
 }
 
 template <typename T, int NumDims, int Layout>
@@ -757,24 +700,20 @@
     DSizes<Index, NumDims> shuffled_dims;
     for (int i = 0; i < NumDims; ++i) shuffled_dims[i] = dims[shuffle[i]];
 
-    VerifyBlockAssignment<T, NumDims, Layout>(
-        tensor, map.shuffle(shuffle),
-        [&shuffled_dims]() { return FixedSizeBlock(shuffled_dims); });
+    VerifyBlockAssignment<T, NumDims, Layout>(tensor, map.shuffle(shuffle),
+                                              [&shuffled_dims]() { return FixedSizeBlock(shuffled_dims); });
 
-    VerifyBlockAssignment<T, NumDims, Layout>(
-        tensor, map.shuffle(shuffle), [&shuffled_dims]() {
-          return RandomBlock<Layout>(shuffled_dims, 1, 5);
-        });
+    VerifyBlockAssignment<T, NumDims, Layout>(tensor, map.shuffle(shuffle),
+                                              [&shuffled_dims]() { return RandomBlock<Layout>(shuffled_dims, 1, 5); });
 
   } while (std::next_permutation(&shuffle[0], &shuffle[0] + NumDims));
 }
 
 // -------------------------------------------------------------------------- //
 
-#define CALL_SUBTEST_PART(PART) \
-  CALL_SUBTEST_##PART
+#define CALL_SUBTEST_PART(PART) CALL_SUBTEST_##PART
 
-#define CALL_SUBTESTS_DIMS_LAYOUTS_TYPES(PART, NAME)           \
+#define CALL_SUBTESTS_DIMS_LAYOUTS_TYPES(PART, NAME)     \
   CALL_SUBTEST_PART(PART)((NAME<float, 1, RowMajor>())); \
   CALL_SUBTEST_PART(PART)((NAME<float, 2, RowMajor>())); \
   CALL_SUBTEST_PART(PART)((NAME<float, 3, RowMajor>())); \
@@ -785,28 +724,28 @@
   CALL_SUBTEST_PART(PART)((NAME<float, 4, ColMajor>())); \
   CALL_SUBTEST_PART(PART)((NAME<float, 4, ColMajor>())); \
   CALL_SUBTEST_PART(PART)((NAME<float, 5, ColMajor>())); \
-  CALL_SUBTEST_PART(PART)((NAME<int, 1, RowMajor>())); \
-  CALL_SUBTEST_PART(PART)((NAME<int, 2, RowMajor>())); \
-  CALL_SUBTEST_PART(PART)((NAME<int, 3, RowMajor>())); \
-  CALL_SUBTEST_PART(PART)((NAME<int, 4, RowMajor>())); \
-  CALL_SUBTEST_PART(PART)((NAME<int, 5, RowMajor>())); \
-  CALL_SUBTEST_PART(PART)((NAME<int, 1, ColMajor>())); \
-  CALL_SUBTEST_PART(PART)((NAME<int, 2, ColMajor>())); \
-  CALL_SUBTEST_PART(PART)((NAME<int, 4, ColMajor>())); \
-  CALL_SUBTEST_PART(PART)((NAME<int, 4, ColMajor>())); \
-  CALL_SUBTEST_PART(PART)((NAME<int, 5, ColMajor>())); \
-  CALL_SUBTEST_PART(PART)((NAME<bool, 1, RowMajor>())); \
-  CALL_SUBTEST_PART(PART)((NAME<bool, 2, RowMajor>())); \
-  CALL_SUBTEST_PART(PART)((NAME<bool, 3, RowMajor>())); \
-  CALL_SUBTEST_PART(PART)((NAME<bool, 4, RowMajor>())); \
-  CALL_SUBTEST_PART(PART)((NAME<bool, 5, RowMajor>())); \
-  CALL_SUBTEST_PART(PART)((NAME<bool, 1, ColMajor>())); \
-  CALL_SUBTEST_PART(PART)((NAME<bool, 2, ColMajor>())); \
-  CALL_SUBTEST_PART(PART)((NAME<bool, 4, ColMajor>())); \
-  CALL_SUBTEST_PART(PART)((NAME<bool, 4, ColMajor>())); \
+  CALL_SUBTEST_PART(PART)((NAME<int, 1, RowMajor>()));   \
+  CALL_SUBTEST_PART(PART)((NAME<int, 2, RowMajor>()));   \
+  CALL_SUBTEST_PART(PART)((NAME<int, 3, RowMajor>()));   \
+  CALL_SUBTEST_PART(PART)((NAME<int, 4, RowMajor>()));   \
+  CALL_SUBTEST_PART(PART)((NAME<int, 5, RowMajor>()));   \
+  CALL_SUBTEST_PART(PART)((NAME<int, 1, ColMajor>()));   \
+  CALL_SUBTEST_PART(PART)((NAME<int, 2, ColMajor>()));   \
+  CALL_SUBTEST_PART(PART)((NAME<int, 4, ColMajor>()));   \
+  CALL_SUBTEST_PART(PART)((NAME<int, 4, ColMajor>()));   \
+  CALL_SUBTEST_PART(PART)((NAME<int, 5, ColMajor>()));   \
+  CALL_SUBTEST_PART(PART)((NAME<bool, 1, RowMajor>()));  \
+  CALL_SUBTEST_PART(PART)((NAME<bool, 2, RowMajor>()));  \
+  CALL_SUBTEST_PART(PART)((NAME<bool, 3, RowMajor>()));  \
+  CALL_SUBTEST_PART(PART)((NAME<bool, 4, RowMajor>()));  \
+  CALL_SUBTEST_PART(PART)((NAME<bool, 5, RowMajor>()));  \
+  CALL_SUBTEST_PART(PART)((NAME<bool, 1, ColMajor>()));  \
+  CALL_SUBTEST_PART(PART)((NAME<bool, 2, ColMajor>()));  \
+  CALL_SUBTEST_PART(PART)((NAME<bool, 4, ColMajor>()));  \
+  CALL_SUBTEST_PART(PART)((NAME<bool, 4, ColMajor>()));  \
   CALL_SUBTEST_PART(PART)((NAME<bool, 5, ColMajor>()))
 
-#define CALL_SUBTESTS_DIMS_LAYOUTS(PART, NAME)     \
+#define CALL_SUBTESTS_DIMS_LAYOUTS(PART, NAME)           \
   CALL_SUBTEST_PART(PART)((NAME<float, 1, RowMajor>())); \
   CALL_SUBTEST_PART(PART)((NAME<float, 2, RowMajor>())); \
   CALL_SUBTEST_PART(PART)((NAME<float, 3, RowMajor>())); \
@@ -820,8 +759,8 @@
 
 #define CALL_SUBTESTS_LAYOUTS_TYPES(PART, NAME)       \
   CALL_SUBTEST_PART(PART)((NAME<float, RowMajor>())); \
-  CALL_SUBTEST_PART(PART)((NAME<float, ColMajor>()));  \
-  CALL_SUBTEST_PART(PART)((NAME<bool, RowMajor>())); \
+  CALL_SUBTEST_PART(PART)((NAME<float, ColMajor>())); \
+  CALL_SUBTEST_PART(PART)((NAME<bool, RowMajor>()));  \
   CALL_SUBTEST_PART(PART)((NAME<bool, ColMajor>()))
 
 EIGEN_DECLARE_TEST(cxx11_tensor_block_eval) {
diff --git a/unsupported/test/cxx11_tensor_block_io.cpp b/unsupported/test/cxx11_tensor_block_io.cpp
index 52f7dde..509c10e 100644
--- a/unsupported/test/cxx11_tensor_block_io.cpp
+++ b/unsupported/test/cxx11_tensor_block_io.cpp
@@ -23,9 +23,8 @@
 }
 
 static internal::TensorBlockShapeType RandomBlockShape() {
-  return internal::random<bool>()
-         ? internal::TensorBlockShapeType::kUniformAllDims
-         : internal::TensorBlockShapeType::kSkewedInnerDims;
+  return internal::random<bool>() ? internal::TensorBlockShapeType::kUniformAllDims
+                                  : internal::TensorBlockShapeType::kSkewedInnerDims;
 }
 
 template <int NumDims>
@@ -34,10 +33,8 @@
 }
 
 template <int Layout, int NumDims>
-static Index GetInputIndex(Index output_index,
-                           const array<Index, NumDims>& output_to_input_dim_map,
-                           const array<Index, NumDims>& input_strides,
-                           const array<Index, NumDims>& output_strides) {
+static Index GetInputIndex(Index output_index, const array<Index, NumDims>& output_to_input_dim_map,
+                           const array<Index, NumDims>& input_strides, const array<Index, NumDims>& output_strides) {
   int input_index = 0;
   if (Layout == ColMajor) {
     for (int i = NumDims - 1; i > 0; --i) {
@@ -45,16 +42,14 @@
       input_index += idx * input_strides[output_to_input_dim_map[i]];
       output_index -= idx * output_strides[i];
     }
-    return input_index +
-           output_index * input_strides[output_to_input_dim_map[0]];
+    return input_index + output_index * input_strides[output_to_input_dim_map[0]];
   } else {
     for (int i = 0; i < NumDims - 1; ++i) {
       const Index idx = output_index / output_strides[i];
       input_index += idx * input_strides[output_to_input_dim_map[i]];
       output_index -= idx * output_strides[i];
     }
-    return input_index +
-           output_index * input_strides[output_to_input_dim_map[NumDims - 1]];
+    return input_index + output_index * input_strides[output_to_input_dim_map[NumDims - 1]];
   }
 }
 
@@ -73,10 +68,8 @@
   Tensor<T, NumDims, Layout> output(dims);
 
   // Construct a tensor block mapper.
-  using TensorBlockMapper =
-      internal::TensorBlockMapper<NumDims, Layout, Index>;
-  TensorBlockMapper block_mapper(
-      dims, {RandomBlockShape(), RandomTargetBlockSize(dims), {0, 0, 0}});
+  using TensorBlockMapper = internal::TensorBlockMapper<NumDims, Layout, Index>;
+  TensorBlockMapper block_mapper(dims, {RandomBlockShape(), RandomTargetBlockSize(dims), {0, 0, 0}});
 
   // We will copy data from input to output through this buffer.
   Tensor<T, NumDims, Layout> block(block_mapper.blockDimensions());
@@ -144,12 +137,9 @@
 
   // Construct a tensor block mapper.
   // NOTE: Tensor block mapper works with shuffled dimensions.
-  using TensorBlockMapper =
-      internal::TensorBlockMapper<NumDims, Layout, Index>;
+  using TensorBlockMapper = internal::TensorBlockMapper<NumDims, Layout, Index>;
   TensorBlockMapper block_mapper(output_tensor_dims,
-                                 {RandomBlockShape(),
-                                  RandomTargetBlockSize(output_tensor_dims),
-                                  {0, 0, 0}});
+                                 {RandomBlockShape(), RandomTargetBlockSize(output_tensor_dims), {0, 0, 0}});
 
   // We will copy data from input to output through this buffer.
   Tensor<T, NumDims, Layout> block(block_mapper.blockDimensions());
@@ -165,9 +155,8 @@
   for (Index i = 0; i < block_mapper.blockCount(); ++i) {
     auto desc = block_mapper.blockDescriptor(i);
 
-    const Index first_coeff_index = GetInputIndex<Layout, NumDims>(
-        desc.offset(), output_to_input_dim_map, input_strides,
-        output_strides);
+    const Index first_coeff_index =
+        GetInputIndex<Layout, NumDims>(desc.offset(), output_to_input_dim_map, input_strides, output_strides);
 
     // NOTE: Block dimensions are in the same order as output dimensions.
 
@@ -185,8 +174,7 @@
 
       // TODO(ezhulenev): Remove when fully switched to TensorBlock.
       DSizes<int, NumDims> dim_map;
-      for (int j = 0; j < NumDims; ++j)
-        dim_map[j] = static_cast<int>(output_to_input_dim_map[j]);
+      for (int j = 0; j < NumDims; ++j) dim_map[j] = static_cast<int>(output_to_input_dim_map[j]);
       TensorBlockIO::Copy(dst, src, /*dst_to_src_dim_map=*/dim_map);
     }
 
@@ -203,8 +191,7 @@
 
       // TODO(ezhulenev): Remove when fully switched to TensorBlock.
       DSizes<int, NumDims> dim_map;
-      for (int j = 0; j < NumDims; ++j)
-        dim_map[j] = static_cast<int>(input_to_output_dim_map[j]);
+      for (int j = 0; j < NumDims; ++j) dim_map[j] = static_cast<int>(input_to_output_dim_map[j]);
       TensorBlockIO::Copy(dst, src, /*dst_to_src_dim_map=*/dim_map);
     }
   }
@@ -416,13 +403,13 @@
   CALL_SUBTEST((NAME<float, 2, ColMajor>())); \
   CALL_SUBTEST((NAME<float, 4, ColMajor>())); \
   CALL_SUBTEST((NAME<float, 5, ColMajor>())); \
-  CALL_SUBTEST((NAME<bool, 1, RowMajor>())); \
-  CALL_SUBTEST((NAME<bool, 2, RowMajor>())); \
-  CALL_SUBTEST((NAME<bool, 4, RowMajor>())); \
-  CALL_SUBTEST((NAME<bool, 5, RowMajor>())); \
-  CALL_SUBTEST((NAME<bool, 1, ColMajor>())); \
-  CALL_SUBTEST((NAME<bool, 2, ColMajor>())); \
-  CALL_SUBTEST((NAME<bool, 4, ColMajor>())); \
+  CALL_SUBTEST((NAME<bool, 1, RowMajor>()));  \
+  CALL_SUBTEST((NAME<bool, 2, RowMajor>()));  \
+  CALL_SUBTEST((NAME<bool, 4, RowMajor>()));  \
+  CALL_SUBTEST((NAME<bool, 5, RowMajor>()));  \
+  CALL_SUBTEST((NAME<bool, 1, ColMajor>()));  \
+  CALL_SUBTEST((NAME<bool, 2, ColMajor>()));  \
+  CALL_SUBTEST((NAME<bool, 4, ColMajor>()));  \
   CALL_SUBTEST((NAME<bool, 5, ColMajor>()))
 
 EIGEN_DECLARE_TEST(cxx11_tensor_block_io) {
diff --git a/unsupported/test/cxx11_tensor_broadcast_sycl.cpp b/unsupported/test/cxx11_tensor_broadcast_sycl.cpp
index 6ca5ac7..d255568 100644
--- a/unsupported/test/cxx11_tensor_broadcast_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_broadcast_sycl.cpp
@@ -26,47 +26,44 @@
 using Eigen::TensorMap;
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_broadcast_sycl_fixed(const Eigen::SyclDevice &sycl_device){
-
+static void test_broadcast_sycl_fixed(const Eigen::SyclDevice& sycl_device) {
   // BROADCAST test:
-  IndexType inDim1=2;
-  IndexType inDim2=3;
-  IndexType inDim3=5;
-  IndexType inDim4=7;
-  IndexType bDim1=2;
-  IndexType bDim2=3;
-  IndexType bDim3=1;
-  IndexType bDim4=4;
-  array<IndexType, 4> in_range   = {{inDim1, inDim2, inDim3, inDim4}};
+  IndexType inDim1 = 2;
+  IndexType inDim2 = 3;
+  IndexType inDim3 = 5;
+  IndexType inDim4 = 7;
+  IndexType bDim1 = 2;
+  IndexType bDim2 = 3;
+  IndexType bDim3 = 1;
+  IndexType bDim4 = 4;
+  array<IndexType, 4> in_range = {{inDim1, inDim2, inDim3, inDim4}};
   array<IndexType, 4> broadcasts = {{bDim1, bDim2, bDim3, bDim4}};
   array<IndexType, 4> out_range;  // = in_range * broadcasts
-  for (size_t i = 0; i < out_range.size(); ++i)
-    out_range[i] = in_range[i] * broadcasts[i];
+  for (size_t i = 0; i < out_range.size(); ++i) out_range[i] = in_range[i] * broadcasts[i];
 
-  Tensor<DataType, 4, DataLayout, IndexType>  input(in_range);
+  Tensor<DataType, 4, DataLayout, IndexType> input(in_range);
   Tensor<DataType, 4, DataLayout, IndexType> out(out_range);
 
-  for (size_t i = 0; i < in_range.size(); ++i)
-    VERIFY_IS_EQUAL(out.dimension(i), out_range[i]);
+  for (size_t i = 0; i < in_range.size(); ++i) VERIFY_IS_EQUAL(out.dimension(i), out_range[i]);
 
+  for (IndexType i = 0; i < input.size(); ++i) input(i) = static_cast<DataType>(i);
 
-  for (IndexType i = 0; i < input.size(); ++i)
-    input(i) = static_cast<DataType>(i);
-
-  DataType * gpu_in_data  = static_cast<DataType*>(sycl_device.allocate(input.dimensions().TotalSize()*sizeof(DataType)));
-  DataType * gpu_out_data  = static_cast<DataType*>(sycl_device.allocate(out.dimensions().TotalSize()*sizeof(DataType)));
+  DataType* gpu_in_data =
+      static_cast<DataType*>(sycl_device.allocate(input.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_out_data =
+      static_cast<DataType*>(sycl_device.allocate(out.dimensions().TotalSize() * sizeof(DataType)));
 
   TensorMap<TensorFixedSize<DataType, Sizes<2, 3, 5, 7>, DataLayout, IndexType>> gpu_in(gpu_in_data, in_range);
   TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_out(gpu_out_data, out_range);
-  sycl_device.memcpyHostToDevice(gpu_in_data, input.data(),(input.dimensions().TotalSize())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in_data, input.data(), (input.dimensions().TotalSize()) * sizeof(DataType));
   gpu_out.device(sycl_device) = gpu_in.broadcast(broadcasts);
-  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data,(out.dimensions().TotalSize())*sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data, (out.dimensions().TotalSize()) * sizeof(DataType));
 
-  for (IndexType i = 0; i < inDim1*bDim1; ++i) {
-    for (IndexType j = 0; j < inDim2*bDim2; ++j) {
-      for (IndexType k = 0; k < inDim3*bDim3; ++k) {
-        for (IndexType l = 0; l < inDim4*bDim4; ++l) {
-          VERIFY_IS_APPROX(input(i%2,j%3,k%5,l%7), out(i,j,k,l));
+  for (IndexType i = 0; i < inDim1 * bDim1; ++i) {
+    for (IndexType j = 0; j < inDim2 * bDim2; ++j) {
+      for (IndexType k = 0; k < inDim3 * bDim3; ++k) {
+        for (IndexType l = 0; l < inDim4 * bDim4; ++l) {
+          VERIFY_IS_APPROX(input(i % 2, j % 3, k % 5, l % 7), out(i, j, k, l));
         }
       }
     }
@@ -77,47 +74,44 @@
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_broadcast_sycl(const Eigen::SyclDevice &sycl_device){
-
+static void test_broadcast_sycl(const Eigen::SyclDevice& sycl_device) {
   // BROADCAST test:
-  IndexType inDim1=2;
-  IndexType inDim2=3;
-  IndexType inDim3=5;
-  IndexType inDim4=7;
-  IndexType bDim1=2;
-  IndexType bDim2=3;
-  IndexType bDim3=1;
-  IndexType bDim4=4;
-  array<IndexType, 4> in_range   = {{inDim1, inDim2, inDim3, inDim4}};
+  IndexType inDim1 = 2;
+  IndexType inDim2 = 3;
+  IndexType inDim3 = 5;
+  IndexType inDim4 = 7;
+  IndexType bDim1 = 2;
+  IndexType bDim2 = 3;
+  IndexType bDim3 = 1;
+  IndexType bDim4 = 4;
+  array<IndexType, 4> in_range = {{inDim1, inDim2, inDim3, inDim4}};
   array<IndexType, 4> broadcasts = {{bDim1, bDim2, bDim3, bDim4}};
   array<IndexType, 4> out_range;  // = in_range * broadcasts
-  for (size_t i = 0; i < out_range.size(); ++i)
-    out_range[i] = in_range[i] * broadcasts[i];
+  for (size_t i = 0; i < out_range.size(); ++i) out_range[i] = in_range[i] * broadcasts[i];
 
-  Tensor<DataType, 4, DataLayout, IndexType>  input(in_range);
+  Tensor<DataType, 4, DataLayout, IndexType> input(in_range);
   Tensor<DataType, 4, DataLayout, IndexType> out(out_range);
 
-  for (size_t i = 0; i < in_range.size(); ++i)
-    VERIFY_IS_EQUAL(out.dimension(i), out_range[i]);
+  for (size_t i = 0; i < in_range.size(); ++i) VERIFY_IS_EQUAL(out.dimension(i), out_range[i]);
 
+  for (IndexType i = 0; i < input.size(); ++i) input(i) = static_cast<DataType>(i);
 
-  for (IndexType i = 0; i < input.size(); ++i)
-    input(i) = static_cast<DataType>(i);
+  DataType* gpu_in_data =
+      static_cast<DataType*>(sycl_device.allocate(input.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_out_data =
+      static_cast<DataType*>(sycl_device.allocate(out.dimensions().TotalSize() * sizeof(DataType)));
 
-  DataType * gpu_in_data  = static_cast<DataType*>(sycl_device.allocate(input.dimensions().TotalSize()*sizeof(DataType)));
-  DataType * gpu_out_data  = static_cast<DataType*>(sycl_device.allocate(out.dimensions().TotalSize()*sizeof(DataType)));
-
-  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>>  gpu_in(gpu_in_data, in_range);
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_in(gpu_in_data, in_range);
   TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_out(gpu_out_data, out_range);
-  sycl_device.memcpyHostToDevice(gpu_in_data, input.data(),(input.dimensions().TotalSize())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in_data, input.data(), (input.dimensions().TotalSize()) * sizeof(DataType));
   gpu_out.device(sycl_device) = gpu_in.broadcast(broadcasts);
-  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data,(out.dimensions().TotalSize())*sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data, (out.dimensions().TotalSize()) * sizeof(DataType));
 
-  for (IndexType i = 0; i < inDim1*bDim1; ++i) {
-    for (IndexType j = 0; j < inDim2*bDim2; ++j) {
-      for (IndexType k = 0; k < inDim3*bDim3; ++k) {
-        for (IndexType l = 0; l < inDim4*bDim4; ++l) {
-          VERIFY_IS_APPROX(input(i%inDim1,j%inDim2,k%inDim3,l%inDim4), out(i,j,k,l));
+  for (IndexType i = 0; i < inDim1 * bDim1; ++i) {
+    for (IndexType j = 0; j < inDim2 * bDim2; ++j) {
+      for (IndexType k = 0; k < inDim3 * bDim3; ++k) {
+        for (IndexType l = 0; l < inDim4 * bDim4; ++l) {
+          VERIFY_IS_APPROX(input(i % inDim1, j % inDim2, k % inDim3, l % inDim4), out(i, j, k, l));
         }
       }
     }
@@ -127,7 +121,8 @@
   sycl_device.deallocate(gpu_out_data);
 }
 
-template<typename DataType> void sycl_broadcast_test_per_device(const cl::sycl::device& d){
+template <typename DataType>
+void sycl_broadcast_test_per_device(const cl::sycl::device& d) {
   std::cout << "Running on " << d.template get_info<cl::sycl::info::device::name>() << std::endl;
   QueueInterface queueInterface(d);
   auto sycl_device = Eigen::SyclDevice(&queueInterface);
@@ -138,7 +133,7 @@
 }
 
 EIGEN_DECLARE_TEST(cxx11_tensor_broadcast_sycl) {
-  for (const auto& device :Eigen::get_sycl_supported_devices()) {
+  for (const auto& device : Eigen::get_sycl_supported_devices()) {
     CALL_SUBTEST(sycl_broadcast_test_per_device<half>(device));
     CALL_SUBTEST(sycl_broadcast_test_per_device<float>(device));
   }
diff --git a/unsupported/test/cxx11_tensor_broadcasting.cpp b/unsupported/test/cxx11_tensor_broadcasting.cpp
index 2da35e4..6f43d6a 100644
--- a/unsupported/test/cxx11_tensor_broadcasting.cpp
+++ b/unsupported/test/cxx11_tensor_broadcasting.cpp
@@ -14,9 +14,8 @@
 using Eigen::Tensor;
 
 template <int DataLayout>
-static void test_simple_broadcasting()
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,5,7);
+static void test_simple_broadcasting() {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
   array<ptrdiff_t, 4> broadcasts;
   broadcasts[0] = 1;
@@ -36,7 +35,7 @@
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 5; ++k) {
         for (int l = 0; l < 7; ++l) {
-          VERIFY_IS_EQUAL(tensor(i,j,k,l), no_broadcast(i,j,k,l));
+          VERIFY_IS_EQUAL(tensor(i, j, k, l), no_broadcast(i, j, k, l));
         }
       }
     }
@@ -58,18 +57,16 @@
     for (int j = 0; j < 9; ++j) {
       for (int k = 0; k < 5; ++k) {
         for (int l = 0; l < 28; ++l) {
-          VERIFY_IS_EQUAL(tensor(i%2,j%3,k%5,l%7), broadcast(i,j,k,l));
+          VERIFY_IS_EQUAL(tensor(i % 2, j % 3, k % 5, l % 7), broadcast(i, j, k, l));
         }
       }
     }
   }
 }
 
-
 template <int DataLayout>
-static void test_vectorized_broadcasting()
-{
-  Tensor<float, 3, DataLayout> tensor(8,3,5);
+static void test_vectorized_broadcasting() {
+  Tensor<float, 3, DataLayout> tensor(8, 3, 5);
   tensor.setRandom();
   array<ptrdiff_t, 3> broadcasts;
   broadcasts[0] = 2;
@@ -86,12 +83,12 @@
   for (int i = 0; i < 16; ++i) {
     for (int j = 0; j < 9; ++j) {
       for (int k = 0; k < 20; ++k) {
-        VERIFY_IS_EQUAL(tensor(i%8,j%3,k%5), broadcast(i,j,k));
+        VERIFY_IS_EQUAL(tensor(i % 8, j % 3, k % 5), broadcast(i, j, k));
       }
     }
   }
 
-  tensor.resize(11,3,5);
+  tensor.resize(11, 3, 5);
 
   tensor.setRandom();
   broadcast = tensor.broadcast(broadcasts);
@@ -103,17 +100,15 @@
   for (int i = 0; i < 22; ++i) {
     for (int j = 0; j < 9; ++j) {
       for (int k = 0; k < 20; ++k) {
-        VERIFY_IS_EQUAL(tensor(i%11,j%3,k%5), broadcast(i,j,k));
+        VERIFY_IS_EQUAL(tensor(i % 11, j % 3, k % 5), broadcast(i, j, k));
       }
     }
   }
 }
 
-
 template <int DataLayout>
-static void test_static_broadcasting()
-{
-  Tensor<float, 3, DataLayout> tensor(8,3,5);
+static void test_static_broadcasting() {
+  Tensor<float, 3, DataLayout> tensor(8, 3, 5);
   tensor.setRandom();
 
   Eigen::IndexList<Eigen::type2index<2>, Eigen::type2index<3>, Eigen::type2index<4>> broadcasts;
@@ -127,12 +122,12 @@
   for (int i = 0; i < 16; ++i) {
     for (int j = 0; j < 9; ++j) {
       for (int k = 0; k < 20; ++k) {
-        VERIFY_IS_EQUAL(tensor(i%8,j%3,k%5), broadcast(i,j,k));
+        VERIFY_IS_EQUAL(tensor(i % 8, j % 3, k % 5), broadcast(i, j, k));
       }
     }
   }
 
-  tensor.resize(11,3,5);
+  tensor.resize(11, 3, 5);
 
   tensor.setRandom();
   broadcast = tensor.broadcast(broadcasts);
@@ -144,16 +139,14 @@
   for (int i = 0; i < 22; ++i) {
     for (int j = 0; j < 9; ++j) {
       for (int k = 0; k < 20; ++k) {
-        VERIFY_IS_EQUAL(tensor(i%11,j%3,k%5), broadcast(i,j,k));
+        VERIFY_IS_EQUAL(tensor(i % 11, j % 3, k % 5), broadcast(i, j, k));
       }
     }
   }
 }
 
-
 template <int DataLayout>
-static void test_fixed_size_broadcasting()
-{
+static void test_fixed_size_broadcasting() {
   // Need to add a [] operator to the Size class for this to work
 #if 0
   Tensor<float, 1, DataLayout> t1(10);
@@ -175,9 +168,8 @@
 }
 
 template <int DataLayout>
-static void test_simple_broadcasting_one_by_n()
-{
-  Tensor<float, 4, DataLayout> tensor(1,13,5,7);
+static void test_simple_broadcasting_one_by_n() {
+  Tensor<float, 4, DataLayout> tensor(1, 13, 5, 7);
   tensor.setRandom();
   array<ptrdiff_t, 4> broadcasts;
   broadcasts[0] = 9;
@@ -196,7 +188,7 @@
     for (int j = 0; j < 13; ++j) {
       for (int k = 0; k < 5; ++k) {
         for (int l = 0; l < 7; ++l) {
-          VERIFY_IS_EQUAL(tensor(i%1,j%13,k%5,l%7), broadcast(i,j,k,l));
+          VERIFY_IS_EQUAL(tensor(i % 1, j % 13, k % 5, l % 7), broadcast(i, j, k, l));
         }
       }
     }
@@ -204,9 +196,8 @@
 }
 
 template <int DataLayout>
-static void test_simple_broadcasting_n_by_one()
-{
-  Tensor<float, 4, DataLayout> tensor(7,3,5,1);
+static void test_simple_broadcasting_n_by_one() {
+  Tensor<float, 4, DataLayout> tensor(7, 3, 5, 1);
   tensor.setRandom();
   array<ptrdiff_t, 4> broadcasts;
   broadcasts[0] = 1;
@@ -225,7 +216,7 @@
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 5; ++k) {
         for (int l = 0; l < 19; ++l) {
-          VERIFY_IS_EQUAL(tensor(i%7,j%3,k%5,l%1), broadcast(i,j,k,l));
+          VERIFY_IS_EQUAL(tensor(i % 7, j % 3, k % 5, l % 1), broadcast(i, j, k, l));
         }
       }
     }
@@ -233,8 +224,7 @@
 }
 
 template <int DataLayout>
-static void test_size_one_broadcasting()
-{
+static void test_size_one_broadcasting() {
   Tensor<float, 1, DataLayout> tensor(1);
   tensor.setRandom();
   array<ptrdiff_t, 1> broadcasts = {64};
@@ -249,9 +239,8 @@
 }
 
 template <int DataLayout>
-static void test_simple_broadcasting_one_by_n_by_one_1d()
-{
-  Tensor<float, 3, DataLayout> tensor(1,7,1);
+static void test_simple_broadcasting_one_by_n_by_one_1d() {
+  Tensor<float, 3, DataLayout> tensor(1, 7, 1);
   tensor.setRandom();
   array<ptrdiff_t, 3> broadcasts;
   broadcasts[0] = 5;
@@ -267,16 +256,15 @@
   for (int i = 0; i < 5; ++i) {
     for (int j = 0; j < 7; ++j) {
       for (int k = 0; k < 13; ++k) {
-        VERIFY_IS_EQUAL(tensor(0,j%7,0), broadcasted(i,j,k));
+        VERIFY_IS_EQUAL(tensor(0, j % 7, 0), broadcasted(i, j, k));
       }
     }
   }
 }
 
 template <int DataLayout>
-static void test_simple_broadcasting_one_by_n_by_one_2d()
-{
-  Tensor<float, 4, DataLayout> tensor(1,7,13,1);
+static void test_simple_broadcasting_one_by_n_by_one_2d() {
+  Tensor<float, 4, DataLayout> tensor(1, 7, 13, 1);
   tensor.setRandom();
   array<ptrdiff_t, 4> broadcasts;
   broadcasts[0] = 5;
@@ -295,15 +283,14 @@
     for (int j = 0; j < 7; ++j) {
       for (int k = 0; k < 13; ++k) {
         for (int l = 0; l < 19; ++l) {
-          VERIFY_IS_EQUAL(tensor(0,j%7,k%13,0), broadcast(i,j,k,l));
+          VERIFY_IS_EQUAL(tensor(0, j % 7, k % 13, 0), broadcast(i, j, k, l));
         }
       }
     }
   }
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_broadcasting)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_broadcasting) {
   CALL_SUBTEST(test_simple_broadcasting<ColMajor>());
   CALL_SUBTEST(test_simple_broadcasting<RowMajor>());
   CALL_SUBTEST(test_vectorized_broadcasting<ColMajor>());
diff --git a/unsupported/test/cxx11_tensor_builtins_sycl.cpp b/unsupported/test/cxx11_tensor_builtins_sycl.cpp
index c8668d8..c8e0a6d 100644
--- a/unsupported/test/cxx11_tensor_builtins_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_builtins_sycl.cpp
@@ -29,148 +29,192 @@
 // the equivalent on the host
 namespace SYCL {
 
-template <typename T> T abs(T x) {
+template <typename T>
+T abs(T x) {
   return cl::sycl::abs(x);
 }
-template <> Eigen::half abs(Eigen::half x) {
+template <>
+Eigen::half abs(Eigen::half x) {
   return Eigen::half(cl::sycl::fabs(static_cast<cl::sycl::half>(x)));
 }
 
-template <> float abs(float x) {
+template <>
+float abs(float x) {
   return cl::sycl::fabs(x);
 }
 
-template <> double abs(double x) {
+template <>
+double abs(double x) {
   return cl::sycl::fabs(x);
 }
 
-template <typename T> T square(T x) { return x * x; }
-template <typename T> T cube(T x) { return x * x * x; }
-template <typename T> T inverse(T x) { return T(1) / x; }
-template <typename T> T cwiseMax(T x, T y) {
+template <typename T>
+T square(T x) {
+  return x * x;
+}
+template <typename T>
+T cube(T x) {
+  return x * x * x;
+}
+template <typename T>
+T inverse(T x) {
+  return T(1) / x;
+}
+template <typename T>
+T cwiseMax(T x, T y) {
   return cl::sycl::max(x, y);
 }
-template <> Eigen::half cwiseMax(Eigen::half x, Eigen::half y) {
-return Eigen::half(cl::sycl::max(static_cast<cl::sycl::half>(x), static_cast<cl::sycl::half>(y)));
+template <>
+Eigen::half cwiseMax(Eigen::half x, Eigen::half y) {
+  return Eigen::half(cl::sycl::max(static_cast<cl::sycl::half>(x), static_cast<cl::sycl::half>(y)));
 }
 
-template <typename T> T cwiseMin(T x, T y) {
+template <typename T>
+T cwiseMin(T x, T y) {
   return cl::sycl::min(x, y);
 }
-template <> Eigen::half cwiseMin(Eigen::half x, Eigen::half y) {
+template <>
+Eigen::half cwiseMin(Eigen::half x, Eigen::half y) {
   return Eigen::half(cl::sycl::min(static_cast<cl::sycl::half>(x), static_cast<cl::sycl::half>(y)));
 }
 
-template <typename T> T sqrt(T x) {
+template <typename T>
+T sqrt(T x) {
   return cl::sycl::sqrt(x);
 }
-template <> Eigen::half sqrt(Eigen::half x) {
+template <>
+Eigen::half sqrt(Eigen::half x) {
   return Eigen::half(cl::sycl::sqrt(static_cast<cl::sycl::half>(x)));
 }
 
-template <typename T> T rsqrt(T x) {
+template <typename T>
+T rsqrt(T x) {
   return cl::sycl::rsqrt(x);
 }
-template <> Eigen::half rsqrt(Eigen::half x) {
+template <>
+Eigen::half rsqrt(Eigen::half x) {
   return Eigen::half(cl::sycl::rsqrt(static_cast<cl::sycl::half>(x)));
 }
 
-template <typename T> T tanh(T x) {
+template <typename T>
+T tanh(T x) {
   return cl::sycl::tanh(x);
 }
-template <> Eigen::half tanh(Eigen::half x) {
+template <>
+Eigen::half tanh(Eigen::half x) {
   return Eigen::half(cl::sycl::tanh(static_cast<cl::sycl::half>(x)));
 }
 
-template <typename T> T exp(T x) {
+template <typename T>
+T exp(T x) {
   return cl::sycl::exp(x);
 }
-template <> Eigen::half exp(Eigen::half x) {
+template <>
+Eigen::half exp(Eigen::half x) {
   return Eigen::half(cl::sycl::exp(static_cast<cl::sycl::half>(x)));
 }
 
-template <typename T> T expm1(T x) {
+template <typename T>
+T expm1(T x) {
   return cl::sycl::expm1(x);
 }
-template <> Eigen::half expm1(Eigen::half x) {
+template <>
+Eigen::half expm1(Eigen::half x) {
   return Eigen::half(cl::sycl::expm1(static_cast<cl::sycl::half>(x)));
 }
 
-template <typename T> T log(T x) {
+template <typename T>
+T log(T x) {
   return cl::sycl::log(x);
 }
-template <> Eigen::half log(Eigen::half x) {
+template <>
+Eigen::half log(Eigen::half x) {
   return Eigen::half(cl::sycl::log(static_cast<cl::sycl::half>(x)));
 }
 
-template <typename T> T ceil(T x) {
+template <typename T>
+T ceil(T x) {
   return cl::sycl::ceil(x);
 }
-template <> Eigen::half ceil(Eigen::half x) {
+template <>
+Eigen::half ceil(Eigen::half x) {
   return Eigen::half(cl::sycl::ceil(static_cast<cl::sycl::half>(x)));
 }
 
-template <typename T> T floor(T x) {
+template <typename T>
+T floor(T x) {
   return cl::sycl::floor(x);
 }
-template <> Eigen::half floor(Eigen::half x) {
+template <>
+Eigen::half floor(Eigen::half x) {
   return Eigen::half(cl::sycl::floor(static_cast<cl::sycl::half>(x)));
 }
 
-template <typename T> T round(T x) {
+template <typename T>
+T round(T x) {
   return cl::sycl::round(x);
 }
-template <> Eigen::half round(Eigen::half x) {
+template <>
+Eigen::half round(Eigen::half x) {
   return Eigen::half(cl::sycl::round(static_cast<cl::sycl::half>(x)));
 }
 
-template <typename T> T log1p(T x) {
+template <typename T>
+T log1p(T x) {
   return cl::sycl::log1p(x);
 }
-template <> Eigen::half log1p(Eigen::half x) {
+template <>
+Eigen::half log1p(Eigen::half x) {
   return Eigen::half(cl::sycl::log1p(static_cast<cl::sycl::half>(x)));
 }
 
-template <typename T> T sign(T x) {
+template <typename T>
+T sign(T x) {
   return cl::sycl::sign(x);
 }
-template <> Eigen::half sign(Eigen::half x) {
+template <>
+Eigen::half sign(Eigen::half x) {
   return Eigen::half(cl::sycl::sign(static_cast<cl::sycl::half>(x)));
 }
 
-template <typename T> T isnan(T x) {
+template <typename T>
+T isnan(T x) {
   return cl::sycl::isnan(x);
 }
-template <> Eigen::half isnan(Eigen::half x) {
+template <>
+Eigen::half isnan(Eigen::half x) {
   return Eigen::half(cl::sycl::isnan(static_cast<cl::sycl::half>(x)));
 }
 
-template <typename T> T isfinite(T x) {
+template <typename T>
+T isfinite(T x) {
   return cl::sycl::isfinite(x);
 }
-template <> Eigen::half isfinite(Eigen::half x) {
+template <>
+Eigen::half isfinite(Eigen::half x) {
   return Eigen::half(cl::sycl::isfinite(static_cast<cl::sycl::half>(x)));
 }
 
-template <typename T> T isinf(T x) {
+template <typename T>
+T isinf(T x) {
   return cl::sycl::isinf(x);
 }
-template <> Eigen::half isinf(Eigen::half x) {
+template <>
+Eigen::half isinf(Eigen::half x) {
   return Eigen::half(cl::sycl::isinf(static_cast<cl::sycl::half>(x)));
 }
-}
+}  // namespace SYCL
 
-
-#define DECLARE_UNARY_STRUCT_NON_SYCL(FUNC)                        \
-  struct op_##FUNC {                                               \
-    template <typename T>                                          \
-    auto operator()(const T& x)  {                                 \
-      return SYCL::FUNC(x);                                        \
-    }                                                              \
-    template <typename T>                                          \
-    auto operator()(const TensorMap<T>& x) {                       \
-      return x.FUNC();                                             \
-    }                                                              \
+#define DECLARE_UNARY_STRUCT_NON_SYCL(FUNC)  \
+  struct op_##FUNC {                         \
+    template <typename T>                    \
+    auto operator()(const T& x) {            \
+      return SYCL::FUNC(x);                  \
+    }                                        \
+    template <typename T>                    \
+    auto operator()(const TensorMap<T>& x) { \
+      return x.FUNC();                       \
+    }                                        \
   };
 
 DECLARE_UNARY_STRUCT_NON_SYCL(abs)
@@ -178,36 +222,37 @@
 DECLARE_UNARY_STRUCT_NON_SYCL(cube)
 DECLARE_UNARY_STRUCT_NON_SYCL(inverse)
 
-#define DECLARE_BINARY_STRUCT_NON_SYCL(FUNC)                                                 \
-  struct op_##FUNC {                                                                         \
-    template <typename T1, typename T2>                                                      \
-    auto operator()(const T1& x, const T2& y){                                               \
-      return SYCL::FUNC(x, y);                                                               \
-    }                                                                                        \
-    template <typename T1, typename T2>                                                      \
-    auto operator()(const TensorMap<T1>& x, const TensorMap<T2>& y) {                        \
-      return x.FUNC(y);                                                                      \
-    }                                                                                        \
+#define DECLARE_BINARY_STRUCT_NON_SYCL(FUNC)                          \
+  struct op_##FUNC {                                                  \
+    template <typename T1, typename T2>                               \
+    auto operator()(const T1& x, const T2& y) {                       \
+      return SYCL::FUNC(x, y);                                        \
+    }                                                                 \
+    template <typename T1, typename T2>                               \
+    auto operator()(const TensorMap<T1>& x, const TensorMap<T2>& y) { \
+      return x.FUNC(y);                                               \
+    }                                                                 \
   };
 
 DECLARE_BINARY_STRUCT_NON_SYCL(cwiseMax)
 DECLARE_BINARY_STRUCT_NON_SYCL(cwiseMin)
 
-
 struct EqualAssignment {
   template <typename Lhs, typename Rhs>
-  void operator()(Lhs& lhs, const Rhs& rhs) { lhs = rhs; }
+  void operator()(Lhs& lhs, const Rhs& rhs) {
+    lhs = rhs;
+  }
 };
 
 struct PlusEqualAssignment {
   template <typename Lhs, typename Rhs>
-  void operator()(Lhs& lhs, const Rhs& rhs) { lhs += rhs; }
+  void operator()(Lhs& lhs, const Rhs& rhs) {
+    lhs += rhs;
+  }
 };
 
-template <typename DataType, int DataLayout,
-          typename Assignment, typename Operator>
-void test_unary_builtins_for_scalar(const Eigen::SyclDevice& sycl_device,
-                                    const array<int64_t, 3>& tensor_range) {
+template <typename DataType, int DataLayout, typename Assignment, typename Operator>
+void test_unary_builtins_for_scalar(const Eigen::SyclDevice& sycl_device, const array<int64_t, 3>& tensor_range) {
   Operator op;
   Assignment asgn;
   {
@@ -217,20 +262,15 @@
     in = in.random() + DataType(0.01);
     out = out.random() + DataType(0.01);
     Tensor<DataType, 3, DataLayout, int64_t> reference(out);
-    DataType *gpu_data = static_cast<DataType *>(
-        sycl_device.allocate(in.size() * sizeof(DataType)));
-    DataType *gpu_data_out = static_cast<DataType *>(
-        sycl_device.allocate(out.size() * sizeof(DataType)));
+    DataType* gpu_data = static_cast<DataType*>(sycl_device.allocate(in.size() * sizeof(DataType)));
+    DataType* gpu_data_out = static_cast<DataType*>(sycl_device.allocate(out.size() * sizeof(DataType)));
     TensorMap<Tensor<DataType, 3, DataLayout, int64_t>> gpu(gpu_data, tensor_range);
     TensorMap<Tensor<DataType, 3, DataLayout, int64_t>> gpu_out(gpu_data_out, tensor_range);
-    sycl_device.memcpyHostToDevice(gpu_data, in.data(),
-                                   (in.size()) * sizeof(DataType));
-    sycl_device.memcpyHostToDevice(gpu_data_out, out.data(),
-                                   (out.size()) * sizeof(DataType));
+    sycl_device.memcpyHostToDevice(gpu_data, in.data(), (in.size()) * sizeof(DataType));
+    sycl_device.memcpyHostToDevice(gpu_data_out, out.data(), (out.size()) * sizeof(DataType));
     auto device_expr = gpu_out.device(sycl_device);
     asgn(device_expr, op(gpu));
-    sycl_device.memcpyDeviceToHost(out.data(), gpu_data_out,
-                                   (out.size()) * sizeof(DataType));
+    sycl_device.memcpyDeviceToHost(out.data(), gpu_data_out, (out.size()) * sizeof(DataType));
     for (int64_t i = 0; i < out.size(); ++i) {
       DataType ver = reference(i);
       asgn(ver, op(in(i)));
@@ -245,15 +285,12 @@
     // Offset with 1 to avoid tiny output (< 1e-6) as they can easily fail.
     out = out.random() + DataType(1);
     Tensor<DataType, 3, DataLayout, int64_t> reference(out);
-    DataType *gpu_data_out = static_cast<DataType *>(
-        sycl_device.allocate(out.size() * sizeof(DataType)));
+    DataType* gpu_data_out = static_cast<DataType*>(sycl_device.allocate(out.size() * sizeof(DataType)));
     TensorMap<Tensor<DataType, 3, DataLayout, int64_t>> gpu_out(gpu_data_out, tensor_range);
-    sycl_device.memcpyHostToDevice(gpu_data_out, out.data(),
-                                   (out.size()) * sizeof(DataType));
+    sycl_device.memcpyHostToDevice(gpu_data_out, out.data(), (out.size()) * sizeof(DataType));
     auto device_expr = gpu_out.device(sycl_device);
     asgn(device_expr, op(gpu_out));
-    sycl_device.memcpyDeviceToHost(out.data(), gpu_data_out,
-                                   (out.size()) * sizeof(DataType));
+    sycl_device.memcpyDeviceToHost(out.data(), gpu_data_out, (out.size()) * sizeof(DataType));
     for (int64_t i = 0; i < out.size(); ++i) {
       DataType ver = reference(i);
       asgn(ver, op(reference(i)));
@@ -266,14 +303,14 @@
 #define DECLARE_UNARY_STRUCT(FUNC)                                 \
   struct op_##FUNC {                                               \
     template <typename T>                                          \
-    auto operator()(const T& x) -> decltype(SYCL::FUNC(x)) {   \
-      return SYCL::FUNC(x);                                    \
+    auto operator()(const T& x) -> decltype(SYCL::FUNC(x)) {       \
+      return SYCL::FUNC(x);                                        \
     }                                                              \
     template <typename T>                                          \
     auto operator()(const TensorMap<T>& x) -> decltype(x.FUNC()) { \
       return x.FUNC();                                             \
     }                                                              \
-};
+  };
 
 DECLARE_UNARY_STRUCT(sqrt)
 DECLARE_UNARY_STRUCT(rsqrt)
@@ -291,11 +328,9 @@
 DECLARE_UNARY_STRUCT(isinf)
 
 template <typename DataType, int DataLayout, typename Assignment>
-void test_unary_builtins_for_assignement(const Eigen::SyclDevice& sycl_device,
-                                         const array<int64_t, 3>& tensor_range) {
+void test_unary_builtins_for_assignement(const Eigen::SyclDevice& sycl_device, const array<int64_t, 3>& tensor_range) {
 #define RUN_UNARY_TEST(FUNC) \
-  test_unary_builtins_for_scalar<DataType, DataLayout, Assignment, \
-                                 op_##FUNC>(sycl_device, tensor_range)
+  test_unary_builtins_for_scalar<DataType, DataLayout, Assignment, op_##FUNC>(sycl_device, tensor_range)
   RUN_UNARY_TEST(abs);
   RUN_UNARY_TEST(sqrt);
   RUN_UNARY_TEST(rsqrt);
@@ -314,24 +349,19 @@
 }
 
 template <typename DataType, int DataLayout, typename Operator>
-void test_unary_builtins_return_bool(const Eigen::SyclDevice& sycl_device,
-                                     const array<int64_t, 3>& tensor_range) {
+void test_unary_builtins_return_bool(const Eigen::SyclDevice& sycl_device, const array<int64_t, 3>& tensor_range) {
   /* out = op(in) */
   Operator op;
   Tensor<DataType, 3, DataLayout, int64_t> in(tensor_range);
   Tensor<bool, 3, DataLayout, int64_t> out(tensor_range);
   in = in.random() + DataType(0.01);
-  DataType *gpu_data = static_cast<DataType *>(
-      sycl_device.allocate(in.size() * sizeof(DataType)));
-  bool *gpu_data_out =
-      static_cast<bool *>(sycl_device.allocate(out.size() * sizeof(bool)));
+  DataType* gpu_data = static_cast<DataType*>(sycl_device.allocate(in.size() * sizeof(DataType)));
+  bool* gpu_data_out = static_cast<bool*>(sycl_device.allocate(out.size() * sizeof(bool)));
   TensorMap<Tensor<DataType, 3, DataLayout, int64_t>> gpu(gpu_data, tensor_range);
   TensorMap<Tensor<bool, 3, DataLayout, int64_t>> gpu_out(gpu_data_out, tensor_range);
-  sycl_device.memcpyHostToDevice(gpu_data, in.data(),
-                                 (in.size()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_data, in.data(), (in.size()) * sizeof(DataType));
   gpu_out.device(sycl_device) = op(gpu);
-  sycl_device.memcpyDeviceToHost(out.data(), gpu_data_out,
-                                 (out.size()) * sizeof(bool));
+  sycl_device.memcpyDeviceToHost(out.data(), gpu_data_out, (out.size()) * sizeof(bool));
   for (int64_t i = 0; i < out.size(); ++i) {
     VERIFY_IS_EQUAL(out(i), op(in(i)));
   }
@@ -340,22 +370,16 @@
 }
 
 template <typename DataType, int DataLayout>
-void test_unary_builtins(const Eigen::SyclDevice& sycl_device,
-                         const array<int64_t, 3>& tensor_range) {
-  test_unary_builtins_for_assignement<DataType, DataLayout,
-                                      PlusEqualAssignment>(sycl_device, tensor_range);
-  test_unary_builtins_for_assignement<DataType, DataLayout,
-                                      EqualAssignment>(sycl_device, tensor_range);
-  test_unary_builtins_return_bool<DataType, DataLayout,
-                                  op_isnan>(sycl_device, tensor_range);
-  test_unary_builtins_return_bool<DataType, DataLayout,
-                                  op_isfinite>(sycl_device, tensor_range);
-  test_unary_builtins_return_bool<DataType, DataLayout,
-                                  op_isinf>(sycl_device, tensor_range);
+void test_unary_builtins(const Eigen::SyclDevice& sycl_device, const array<int64_t, 3>& tensor_range) {
+  test_unary_builtins_for_assignement<DataType, DataLayout, PlusEqualAssignment>(sycl_device, tensor_range);
+  test_unary_builtins_for_assignement<DataType, DataLayout, EqualAssignment>(sycl_device, tensor_range);
+  test_unary_builtins_return_bool<DataType, DataLayout, op_isnan>(sycl_device, tensor_range);
+  test_unary_builtins_return_bool<DataType, DataLayout, op_isfinite>(sycl_device, tensor_range);
+  test_unary_builtins_return_bool<DataType, DataLayout, op_isinf>(sycl_device, tensor_range);
 }
 
 template <typename DataType>
-static void test_builtin_unary_sycl(const Eigen::SyclDevice &sycl_device) {
+static void test_builtin_unary_sycl(const Eigen::SyclDevice& sycl_device) {
   int64_t sizeDim1 = 10;
   int64_t sizeDim2 = 10;
   int64_t sizeDim3 = 10;
@@ -366,8 +390,7 @@
 }
 
 template <typename DataType, int DataLayout, typename Operator>
-void test_binary_builtins_func(const Eigen::SyclDevice& sycl_device,
-                               const array<int64_t, 3>& tensor_range) {
+void test_binary_builtins_func(const Eigen::SyclDevice& sycl_device, const array<int64_t, 3>& tensor_range) {
   /* out = op(in_1, in_2) */
   Operator op;
   Tensor<DataType, 3, DataLayout, int64_t> in_1(tensor_range);
@@ -376,22 +399,16 @@
   in_1 = in_1.random() + DataType(0.01);
   in_2 = in_2.random() + DataType(0.01);
   Tensor<DataType, 3, DataLayout, int64_t> reference(out);
-  DataType *gpu_data_1 = static_cast<DataType *>(
-      sycl_device.allocate(in_1.size() * sizeof(DataType)));
-  DataType *gpu_data_2 = static_cast<DataType *>(
-      sycl_device.allocate(in_2.size() * sizeof(DataType)));
-  DataType *gpu_data_out = static_cast<DataType *>(
-      sycl_device.allocate(out.size() * sizeof(DataType)));
+  DataType* gpu_data_1 = static_cast<DataType*>(sycl_device.allocate(in_1.size() * sizeof(DataType)));
+  DataType* gpu_data_2 = static_cast<DataType*>(sycl_device.allocate(in_2.size() * sizeof(DataType)));
+  DataType* gpu_data_out = static_cast<DataType*>(sycl_device.allocate(out.size() * sizeof(DataType)));
   TensorMap<Tensor<DataType, 3, DataLayout, int64_t>> gpu_1(gpu_data_1, tensor_range);
   TensorMap<Tensor<DataType, 3, DataLayout, int64_t>> gpu_2(gpu_data_2, tensor_range);
   TensorMap<Tensor<DataType, 3, DataLayout, int64_t>> gpu_out(gpu_data_out, tensor_range);
-  sycl_device.memcpyHostToDevice(gpu_data_1, in_1.data(),
-                                 (in_1.size()) * sizeof(DataType));
-  sycl_device.memcpyHostToDevice(gpu_data_2, in_2.data(),
-                                 (in_2.size()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_data_1, in_1.data(), (in_1.size()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_data_2, in_2.data(), (in_2.size()) * sizeof(DataType));
   gpu_out.device(sycl_device) = op(gpu_1, gpu_2);
-  sycl_device.memcpyDeviceToHost(out.data(), gpu_data_out,
-                                 (out.size()) * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(out.data(), gpu_data_out, (out.size()) * sizeof(DataType));
   for (int64_t i = 0; i < out.size(); ++i) {
     VERIFY_IS_APPROX(out(i), op(in_1(i), in_2(i)));
   }
@@ -401,8 +418,7 @@
 }
 
 template <typename DataType, int DataLayout, typename Operator>
-void test_binary_builtins_fixed_arg2(const Eigen::SyclDevice& sycl_device,
-                                     const array<int64_t, 3>& tensor_range) {
+void test_binary_builtins_fixed_arg2(const Eigen::SyclDevice& sycl_device, const array<int64_t, 3>& tensor_range) {
   /* out = op(in_1, 2) */
   Operator op;
   const DataType arg2(2);
@@ -410,17 +426,13 @@
   Tensor<DataType, 3, DataLayout, int64_t> out(tensor_range);
   in_1 = in_1.random();
   Tensor<DataType, 3, DataLayout, int64_t> reference(out);
-  DataType *gpu_data_1 = static_cast<DataType *>(
-      sycl_device.allocate(in_1.size() * sizeof(DataType)));
-  DataType *gpu_data_out = static_cast<DataType *>(
-      sycl_device.allocate(out.size() * sizeof(DataType)));
+  DataType* gpu_data_1 = static_cast<DataType*>(sycl_device.allocate(in_1.size() * sizeof(DataType)));
+  DataType* gpu_data_out = static_cast<DataType*>(sycl_device.allocate(out.size() * sizeof(DataType)));
   TensorMap<Tensor<DataType, 3, DataLayout, int64_t>> gpu_1(gpu_data_1, tensor_range);
   TensorMap<Tensor<DataType, 3, DataLayout, int64_t>> gpu_out(gpu_data_out, tensor_range);
-  sycl_device.memcpyHostToDevice(gpu_data_1, in_1.data(),
-                                 (in_1.size()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_data_1, in_1.data(), (in_1.size()) * sizeof(DataType));
   gpu_out.device(sycl_device) = op(gpu_1, arg2);
-  sycl_device.memcpyDeviceToHost(out.data(), gpu_data_out,
-                                 (out.size()) * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(out.data(), gpu_data_out, (out.size()) * sizeof(DataType));
   for (int64_t i = 0; i < out.size(); ++i) {
     VERIFY_IS_APPROX(out(i), op(in_1(i), arg2));
   }
@@ -440,7 +452,6 @@
     }                                                                                        \
   };
 
-
 #define DECLARE_BINARY_STRUCT_OP(NAME, OPERATOR)                          \
   struct op_##NAME {                                                      \
     template <typename T1, typename T2>                                   \
@@ -456,24 +467,17 @@
 DECLARE_BINARY_STRUCT_OP(modulo, %)
 
 template <typename DataType, int DataLayout>
-void test_binary_builtins(const Eigen::SyclDevice& sycl_device,
-                          const array<int64_t, 3>& tensor_range) {
-  test_binary_builtins_func<DataType, DataLayout,
-                            op_cwiseMax>(sycl_device, tensor_range);
-  test_binary_builtins_func<DataType, DataLayout,
-                            op_cwiseMin>(sycl_device, tensor_range);
-  test_binary_builtins_func<DataType, DataLayout,
-                            op_plus>(sycl_device, tensor_range);
-  test_binary_builtins_func<DataType, DataLayout,
-                            op_minus>(sycl_device, tensor_range);
-  test_binary_builtins_func<DataType, DataLayout,
-                            op_times>(sycl_device, tensor_range);
-  test_binary_builtins_func<DataType, DataLayout,
-                            op_divide>(sycl_device, tensor_range);
+void test_binary_builtins(const Eigen::SyclDevice& sycl_device, const array<int64_t, 3>& tensor_range) {
+  test_binary_builtins_func<DataType, DataLayout, op_cwiseMax>(sycl_device, tensor_range);
+  test_binary_builtins_func<DataType, DataLayout, op_cwiseMin>(sycl_device, tensor_range);
+  test_binary_builtins_func<DataType, DataLayout, op_plus>(sycl_device, tensor_range);
+  test_binary_builtins_func<DataType, DataLayout, op_minus>(sycl_device, tensor_range);
+  test_binary_builtins_func<DataType, DataLayout, op_times>(sycl_device, tensor_range);
+  test_binary_builtins_func<DataType, DataLayout, op_divide>(sycl_device, tensor_range);
 }
 
 template <typename DataType>
-static void test_floating_builtin_binary_sycl(const Eigen::SyclDevice &sycl_device) {
+static void test_floating_builtin_binary_sycl(const Eigen::SyclDevice& sycl_device) {
   int64_t sizeDim1 = 10;
   int64_t sizeDim2 = 10;
   int64_t sizeDim3 = 10;
@@ -483,19 +487,17 @@
 }
 
 template <typename DataType>
-static void test_integer_builtin_binary_sycl(const Eigen::SyclDevice &sycl_device) {
+static void test_integer_builtin_binary_sycl(const Eigen::SyclDevice& sycl_device) {
   int64_t sizeDim1 = 10;
   int64_t sizeDim2 = 10;
   int64_t sizeDim3 = 10;
   array<int64_t, 3> tensor_range = {{sizeDim1, sizeDim2, sizeDim3}};
-  test_binary_builtins_fixed_arg2<DataType, RowMajor,
-                                  op_modulo>(sycl_device, tensor_range);
-  test_binary_builtins_fixed_arg2<DataType, ColMajor,
-                                  op_modulo>(sycl_device, tensor_range);
+  test_binary_builtins_fixed_arg2<DataType, RowMajor, op_modulo>(sycl_device, tensor_range);
+  test_binary_builtins_fixed_arg2<DataType, ColMajor, op_modulo>(sycl_device, tensor_range);
 }
 
 EIGEN_DECLARE_TEST(cxx11_tensor_builtins_sycl) {
-  for (const auto& device :Eigen::get_sycl_supported_devices()) {
+  for (const auto& device : Eigen::get_sycl_supported_devices()) {
     QueueInterface queueInterface(device);
     Eigen::SyclDevice sycl_device(&queueInterface);
     CALL_SUBTEST_1(test_builtin_unary_sycl<half>(sycl_device));
diff --git a/unsupported/test/cxx11_tensor_cast_float16_gpu.cu b/unsupported/test/cxx11_tensor_cast_float16_gpu.cu
index 97923d1..ce5c4c3 100644
--- a/unsupported/test/cxx11_tensor_cast_float16_gpu.cu
+++ b/unsupported/test/cxx11_tensor_cast_float16_gpu.cu
@@ -30,22 +30,19 @@
   Eigen::half* d_half = (Eigen::half*)gpu_device.allocate(num_elem * sizeof(Eigen::half));
   float* d_conv = (float*)gpu_device.allocate(num_elem * sizeof(float));
 
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(
-      d_float, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 1>, Eigen::Aligned> gpu_half(
-      d_half, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_conv(
-      d_conv, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(d_float, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 1>, Eigen::Aligned> gpu_half(d_half, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_conv(d_conv, num_elem);
 
-  gpu_device.memcpyHostToDevice(d_float, floats.data(), num_elem*sizeof(float));
+  gpu_device.memcpyHostToDevice(d_float, floats.data(), num_elem * sizeof(float));
 
   gpu_half.device(gpu_device) = gpu_float.cast<Eigen::half>();
   gpu_conv.device(gpu_device) = gpu_half.cast<float>();
 
   Tensor<float, 1> initial(num_elem);
   Tensor<float, 1> final(num_elem);
-  gpu_device.memcpyDeviceToHost(initial.data(), d_float, num_elem*sizeof(float));
-  gpu_device.memcpyDeviceToHost(final.data(), d_conv, num_elem*sizeof(float));
+  gpu_device.memcpyDeviceToHost(initial.data(), d_float, num_elem * sizeof(float));
+  gpu_device.memcpyDeviceToHost(final.data(), d_conv, num_elem * sizeof(float));
   gpu_device.synchronize();
 
   for (int i = 0; i < num_elem; ++i) {
@@ -57,7 +54,6 @@
   gpu_device.deallocate(d_conv);
 }
 
-
 void test_fallback_conversion() {
   int num_elem = 101;
   Tensor<float, 1> floats(num_elem);
@@ -71,9 +67,7 @@
   }
 }
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_cast_float16_gpu)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_cast_float16_gpu) {
   CALL_SUBTEST(test_gpu_conversion());
   CALL_SUBTEST(test_fallback_conversion());
 }
diff --git a/unsupported/test/cxx11_tensor_casts.cpp b/unsupported/test/cxx11_tensor_casts.cpp
index 7976dcb..9cd377c 100644
--- a/unsupported/test/cxx11_tensor_casts.cpp
+++ b/unsupported/test/cxx11_tensor_casts.cpp
@@ -12,8 +12,8 @@
 
 #include <Eigen/CXX11/Tensor>
 
-using Eigen::Tensor;
 using Eigen::array;
+using Eigen::Tensor;
 
 template <typename FromType, typename ToType>
 static void test_type_cast() {
@@ -21,7 +21,7 @@
   // Generate random values for a valid cast.
   for (int i = 0; i < 101; ++i) {
     for (int j = 0; j < 201; ++j) {
-      ftensor(i, j) = internal::random_without_cast_overflow<FromType,ToType>::value();
+      ftensor(i, j) = internal::random_without_cast_overflow<FromType, ToType>::value();
     }
   }
 
@@ -36,7 +36,7 @@
   }
 }
 
-template<typename Scalar, typename EnableIf = void>
+template <typename Scalar, typename EnableIf = void>
 struct test_cast_runner {
   static void run() {
     test_type_cast<Scalar, bool>();
@@ -58,7 +58,7 @@
 };
 
 // Only certain types allow cast from std::complex<>.
-template<typename Scalar>
+template <typename Scalar>
 struct test_cast_runner<Scalar, std::enable_if_t<NumTraits<Scalar>::IsComplex>> {
   static void run() {
     test_type_cast<Scalar, half>();
@@ -68,9 +68,7 @@
   }
 };
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_casts)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_casts) {
   CALL_SUBTEST(test_cast_runner<bool>::run());
   CALL_SUBTEST(test_cast_runner<int8_t>::run());
   CALL_SUBTEST(test_cast_runner<int16_t>::run());
@@ -86,5 +84,4 @@
   CALL_SUBTEST(test_cast_runner<double>::run());
   CALL_SUBTEST(test_cast_runner<std::complex<float>>::run());
   CALL_SUBTEST(test_cast_runner<std::complex<double>>::run());
-
 }
diff --git a/unsupported/test/cxx11_tensor_chipping.cpp b/unsupported/test/cxx11_tensor_chipping.cpp
index 9222744..dbbd89d 100644
--- a/unsupported/test/cxx11_tensor_chipping.cpp
+++ b/unsupported/test/cxx11_tensor_chipping.cpp
@@ -13,10 +13,9 @@
 
 using Eigen::Tensor;
 
-template<int DataLayout>
-static void test_simple_chip()
-{
-  Tensor<float, 5, DataLayout> tensor(2,3,5,7,11);
+template <int DataLayout>
+static void test_simple_chip() {
+  Tensor<float, 5, DataLayout> tensor(2, 3, 5, 7, 11);
   tensor.setRandom();
 
   Tensor<float, 4, DataLayout> chip1;
@@ -31,7 +30,7 @@
     for (int j = 0; j < 5; ++j) {
       for (int k = 0; k < 7; ++k) {
         for (int l = 0; l < 11; ++l) {
-          VERIFY_IS_EQUAL(chip1(i,j,k,l), tensor(1,i,j,k,l));
+          VERIFY_IS_EQUAL(chip1(i, j, k, l), tensor(1, i, j, k, l));
         }
       }
     }
@@ -46,7 +45,7 @@
     for (int j = 0; j < 5; ++j) {
       for (int k = 0; k < 7; ++k) {
         for (int l = 0; l < 11; ++l) {
-          VERIFY_IS_EQUAL(chip2(i,j,k,l), tensor(i,1,j,k,l));
+          VERIFY_IS_EQUAL(chip2(i, j, k, l), tensor(i, 1, j, k, l));
         }
       }
     }
@@ -61,7 +60,7 @@
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
         for (int l = 0; l < 11; ++l) {
-          VERIFY_IS_EQUAL(chip3(i,j,k,l), tensor(i,j,2,k,l));
+          VERIFY_IS_EQUAL(chip3(i, j, k, l), tensor(i, j, 2, k, l));
         }
       }
     }
@@ -76,7 +75,7 @@
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 5; ++k) {
         for (int l = 0; l < 11; ++l) {
-          VERIFY_IS_EQUAL(chip4(i,j,k,l), tensor(i,j,k,5,l));
+          VERIFY_IS_EQUAL(chip4(i, j, k, l), tensor(i, j, k, 5, l));
         }
       }
     }
@@ -91,17 +90,16 @@
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 5; ++k) {
         for (int l = 0; l < 7; ++l) {
-          VERIFY_IS_EQUAL(chip5(i,j,k,l), tensor(i,j,k,l,7));
+          VERIFY_IS_EQUAL(chip5(i, j, k, l), tensor(i, j, k, l, 7));
         }
       }
     }
   }
 }
 
-template<int DataLayout>
-static void test_dynamic_chip()
-{
-  Tensor<float, 5, DataLayout> tensor(2,3,5,7,11);
+template <int DataLayout>
+static void test_dynamic_chip() {
+  Tensor<float, 5, DataLayout> tensor(2, 3, 5, 7, 11);
   tensor.setRandom();
 
   Tensor<float, 4, DataLayout> chip1;
@@ -114,7 +112,7 @@
     for (int j = 0; j < 5; ++j) {
       for (int k = 0; k < 7; ++k) {
         for (int l = 0; l < 11; ++l) {
-          VERIFY_IS_EQUAL(chip1(i,j,k,l), tensor(1,i,j,k,l));
+          VERIFY_IS_EQUAL(chip1(i, j, k, l), tensor(1, i, j, k, l));
         }
       }
     }
@@ -129,7 +127,7 @@
     for (int j = 0; j < 5; ++j) {
       for (int k = 0; k < 7; ++k) {
         for (int l = 0; l < 11; ++l) {
-          VERIFY_IS_EQUAL(chip2(i,j,k,l), tensor(i,1,j,k,l));
+          VERIFY_IS_EQUAL(chip2(i, j, k, l), tensor(i, 1, j, k, l));
         }
       }
     }
@@ -144,7 +142,7 @@
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
         for (int l = 0; l < 11; ++l) {
-          VERIFY_IS_EQUAL(chip3(i,j,k,l), tensor(i,j,2,k,l));
+          VERIFY_IS_EQUAL(chip3(i, j, k, l), tensor(i, j, 2, k, l));
         }
       }
     }
@@ -159,7 +157,7 @@
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 5; ++k) {
         for (int l = 0; l < 11; ++l) {
-          VERIFY_IS_EQUAL(chip4(i,j,k,l), tensor(i,j,k,5,l));
+          VERIFY_IS_EQUAL(chip4(i, j, k, l), tensor(i, j, k, 5, l));
         }
       }
     }
@@ -174,18 +172,18 @@
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 5; ++k) {
         for (int l = 0; l < 7; ++l) {
-          VERIFY_IS_EQUAL(chip5(i,j,k,l), tensor(i,j,k,l,7));
+          VERIFY_IS_EQUAL(chip5(i, j, k, l), tensor(i, j, k, l, 7));
         }
       }
     }
   }
 }
 
-template<int DataLayout>
+template <int DataLayout>
 static void test_chip_in_expr() {
-  Tensor<float, 5, DataLayout> input1(2,3,5,7,11);
+  Tensor<float, 5, DataLayout> input1(2, 3, 5, 7, 11);
   input1.setRandom();
-  Tensor<float, 4, DataLayout> input2(3,5,7,11);
+  Tensor<float, 4, DataLayout> input2(3, 5, 7, 11);
   input2.setRandom();
 
   Tensor<float, 4, DataLayout> result = input1.template chip<0>(0) + input2;
@@ -193,33 +191,32 @@
     for (int j = 0; j < 5; ++j) {
       for (int k = 0; k < 7; ++k) {
         for (int l = 0; l < 11; ++l) {
-          float expected = input1(0,i,j,k,l) + input2(i,j,k,l);
-          VERIFY_IS_EQUAL(result(i,j,k,l), expected);
+          float expected = input1(0, i, j, k, l) + input2(i, j, k, l);
+          VERIFY_IS_EQUAL(result(i, j, k, l), expected);
         }
       }
     }
   }
 
-  Tensor<float, 3, DataLayout> input3(3,7,11);
+  Tensor<float, 3, DataLayout> input3(3, 7, 11);
   input3.setRandom();
   Tensor<float, 3, DataLayout> result2 = input1.template chip<0>(0).template chip<1>(2) + input3;
   for (int i = 0; i < 3; ++i) {
     for (int j = 0; j < 7; ++j) {
       for (int k = 0; k < 11; ++k) {
-        float expected = input1(0,i,2,j,k) + input3(i,j,k);
-        VERIFY_IS_EQUAL(result2(i,j,k), expected);
+        float expected = input1(0, i, 2, j, k) + input3(i, j, k);
+        VERIFY_IS_EQUAL(result2(i, j, k), expected);
       }
     }
   }
 }
 
-template<int DataLayout>
-static void test_chip_as_lvalue()
-{
-  Tensor<float, 5, DataLayout> input1(2,3,5,7,11);
+template <int DataLayout>
+static void test_chip_as_lvalue() {
+  Tensor<float, 5, DataLayout> input1(2, 3, 5, 7, 11);
   input1.setRandom();
 
-  Tensor<float, 4, DataLayout> input2(3,5,7,11);
+  Tensor<float, 4, DataLayout> input2(3, 5, 7, 11);
   input2.setRandom();
   Tensor<float, 5, DataLayout> tensor = input1;
   tensor.template chip<0>(1) = input2;
@@ -229,9 +226,9 @@
         for (int l = 0; l < 7; ++l) {
           for (int m = 0; m < 11; ++m) {
             if (i != 1) {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input1(i,j,k,l,m));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input1(i, j, k, l, m));
             } else {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input2(j,k,l,m));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input2(j, k, l, m));
             }
           }
         }
@@ -239,7 +236,7 @@
     }
   }
 
-  Tensor<float, 4, DataLayout> input3(2,5,7,11);
+  Tensor<float, 4, DataLayout> input3(2, 5, 7, 11);
   input3.setRandom();
   tensor = input1;
   tensor.template chip<1>(1) = input3;
@@ -249,9 +246,9 @@
         for (int l = 0; l < 7; ++l) {
           for (int m = 0; m < 11; ++m) {
             if (j != 1) {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input1(i,j,k,l,m));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input1(i, j, k, l, m));
             } else {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input3(i,k,l,m));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input3(i, k, l, m));
             }
           }
         }
@@ -259,7 +256,7 @@
     }
   }
 
-  Tensor<float, 4, DataLayout> input4(2,3,7,11);
+  Tensor<float, 4, DataLayout> input4(2, 3, 7, 11);
   input4.setRandom();
   tensor = input1;
   tensor.template chip<2>(3) = input4;
@@ -269,9 +266,9 @@
         for (int l = 0; l < 7; ++l) {
           for (int m = 0; m < 11; ++m) {
             if (k != 3) {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input1(i,j,k,l,m));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input1(i, j, k, l, m));
             } else {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input4(i,j,l,m));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input4(i, j, l, m));
             }
           }
         }
@@ -279,7 +276,7 @@
     }
   }
 
-  Tensor<float, 4, DataLayout> input5(2,3,5,11);
+  Tensor<float, 4, DataLayout> input5(2, 3, 5, 11);
   input5.setRandom();
   tensor = input1;
   tensor.template chip<3>(4) = input5;
@@ -289,9 +286,9 @@
         for (int l = 0; l < 7; ++l) {
           for (int m = 0; m < 11; ++m) {
             if (l != 4) {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input1(i,j,k,l,m));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input1(i, j, k, l, m));
             } else {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input5(i,j,k,m));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input5(i, j, k, m));
             }
           }
         }
@@ -299,7 +296,7 @@
     }
   }
 
-  Tensor<float, 4, DataLayout> input6(2,3,5,7);
+  Tensor<float, 4, DataLayout> input6(2, 3, 5, 7);
   input6.setRandom();
   tensor = input1;
   tensor.template chip<4>(5) = input6;
@@ -309,9 +306,9 @@
         for (int l = 0; l < 7; ++l) {
           for (int m = 0; m < 11; ++m) {
             if (m != 5) {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input1(i,j,k,l,m));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input1(i, j, k, l, m));
             } else {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input6(i,j,k,l));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input6(i, j, k, l));
             }
           }
         }
@@ -319,7 +316,7 @@
     }
   }
 
-  Tensor<float, 5, DataLayout> input7(2,3,5,7,11);
+  Tensor<float, 5, DataLayout> input7(2, 3, 5, 7, 11);
   input7.setRandom();
   tensor = input1;
   tensor.chip(0, 0) = input7.chip(0, 0);
@@ -329,9 +326,9 @@
         for (int l = 0; l < 7; ++l) {
           for (int m = 0; m < 11; ++m) {
             if (i != 0) {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input1(i,j,k,l,m));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input1(i, j, k, l, m));
             } else {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input7(i,j,k,l,m));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input7(i, j, k, l, m));
             }
           }
         }
@@ -340,9 +337,8 @@
   }
 }
 
-static void test_chip_raw_data_col_major()
-{
-  Tensor<float, 5, ColMajor> tensor(2,3,5,7,11);
+static void test_chip_raw_data_col_major() {
+  Tensor<float, 5, ColMajor> tensor(2, 3, 5, 7, 11);
   tensor.setRandom();
 
   typedef TensorEvaluator<decltype(tensor.chip<4>(3)), DefaultDevice> Evaluator4;
@@ -352,7 +348,7 @@
       for (int k = 0; k < 5; ++k) {
         for (int l = 0; l < 7; ++l) {
           int chip_index = i + 2 * (j + 3 * (k + 5 * l));
-          VERIFY_IS_EQUAL(chip.data()[chip_index], tensor(i,j,k,l,3));
+          VERIFY_IS_EQUAL(chip.data()[chip_index], tensor(i, j, k, l, 3));
         }
       }
     }
@@ -375,9 +371,8 @@
   VERIFY_IS_EQUAL(chip3.data(), static_cast<float*>(0));
 }
 
-static void test_chip_raw_data_row_major()
-{
-  Tensor<float, 5, RowMajor> tensor(11,7,5,3,2);
+static void test_chip_raw_data_row_major() {
+  Tensor<float, 5, RowMajor> tensor(11, 7, 5, 3, 2);
   tensor.setRandom();
 
   typedef TensorEvaluator<decltype(tensor.chip<0>(3)), DefaultDevice> Evaluator0;
@@ -387,7 +382,7 @@
       for (int k = 0; k < 3; ++k) {
         for (int l = 0; l < 2; ++l) {
           int chip_index = l + 2 * (k + 3 * (j + 5 * i));
-          VERIFY_IS_EQUAL(chip.data()[chip_index], tensor(3,i,j,k,l));
+          VERIFY_IS_EQUAL(chip.data()[chip_index], tensor(3, i, j, k, l));
         }
       }
     }
@@ -410,8 +405,7 @@
   VERIFY_IS_EQUAL(chip4.data(), static_cast<float*>(0));
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_chipping)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_chipping) {
   CALL_SUBTEST(test_simple_chip<ColMajor>());
   CALL_SUBTEST(test_simple_chip<RowMajor>());
   CALL_SUBTEST(test_dynamic_chip<ColMajor>());
diff --git a/unsupported/test/cxx11_tensor_chipping_sycl.cpp b/unsupported/test/cxx11_tensor_chipping_sycl.cpp
index b018da8..cab0ae8 100644
--- a/unsupported/test/cxx11_tensor_chipping_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_chipping_sycl.cpp
@@ -12,7 +12,6 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-
 #define EIGEN_TEST_NO_LONGDOUBLE
 #define EIGEN_TEST_NO_COMPLEX
 
@@ -26,8 +25,7 @@
 using Eigen::Tensor;
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_static_chip_sycl(const Eigen::SyclDevice& sycl_device)
-{
+static void test_static_chip_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType sizeDim1 = 2;
   IndexType sizeDim2 = 3;
   IndexType sizeDim3 = 5;
@@ -37,21 +35,21 @@
   array<IndexType, 5> tensorRange = {{sizeDim1, sizeDim2, sizeDim3, sizeDim4, sizeDim5}};
   array<IndexType, 4> chip1TensorRange = {{sizeDim2, sizeDim3, sizeDim4, sizeDim5}};
 
-  Tensor<DataType, 5, DataLayout,IndexType> tensor(tensorRange);
-  Tensor<DataType, 4, DataLayout,IndexType> chip1(chip1TensorRange);
+  Tensor<DataType, 5, DataLayout, IndexType> tensor(tensorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> chip1(chip1TensorRange);
 
   tensor.setRandom();
 
-  const size_t tensorBuffSize =tensor.size()*sizeof(DataType);
-  const size_t chip1TensorBuffSize =chip1.size()*sizeof(DataType);
-  DataType* gpu_data_tensor  = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
-  DataType* gpu_data_chip1  = static_cast<DataType*>(sycl_device.allocate(chip1TensorBuffSize));
+  const size_t tensorBuffSize = tensor.size() * sizeof(DataType);
+  const size_t chip1TensorBuffSize = chip1.size() * sizeof(DataType);
+  DataType* gpu_data_tensor = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
+  DataType* gpu_data_chip1 = static_cast<DataType*>(sycl_device.allocate(chip1TensorBuffSize));
 
-  TensorMap<Tensor<DataType, 5, DataLayout,IndexType>> gpu_tensor(gpu_data_tensor, tensorRange);
-  TensorMap<Tensor<DataType, 4, DataLayout,IndexType>> gpu_chip1(gpu_data_chip1, chip1TensorRange);
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu_tensor(gpu_data_tensor, tensorRange);
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_chip1(gpu_data_chip1, chip1TensorRange);
 
   sycl_device.memcpyHostToDevice(gpu_data_tensor, tensor.data(), tensorBuffSize);
-  gpu_chip1.device(sycl_device)=gpu_tensor.template chip<0l>(1l);
+  gpu_chip1.device(sycl_device) = gpu_tensor.template chip<0l>(1l);
   sycl_device.memcpyDeviceToHost(chip1.data(), gpu_data_chip1, chip1TensorBuffSize);
 
   VERIFY_IS_EQUAL(chip1.dimension(0), sizeDim2);
@@ -63,19 +61,19 @@
     for (IndexType j = 0; j < sizeDim3; ++j) {
       for (IndexType k = 0; k < sizeDim4; ++k) {
         for (IndexType l = 0; l < sizeDim5; ++l) {
-          VERIFY_IS_EQUAL(chip1(i,j,k,l), tensor(1l,i,j,k,l));
+          VERIFY_IS_EQUAL(chip1(i, j, k, l), tensor(1l, i, j, k, l));
         }
       }
     }
   }
 
   array<IndexType, 4> chip2TensorRange = {{sizeDim1, sizeDim3, sizeDim4, sizeDim5}};
-  Tensor<DataType, 4, DataLayout,IndexType> chip2(chip2TensorRange);
-  const size_t chip2TensorBuffSize =chip2.size()*sizeof(DataType);
-  DataType* gpu_data_chip2  = static_cast<DataType*>(sycl_device.allocate(chip2TensorBuffSize));
-  TensorMap<Tensor<DataType, 4, DataLayout,IndexType>> gpu_chip2(gpu_data_chip2, chip2TensorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> chip2(chip2TensorRange);
+  const size_t chip2TensorBuffSize = chip2.size() * sizeof(DataType);
+  DataType* gpu_data_chip2 = static_cast<DataType*>(sycl_device.allocate(chip2TensorBuffSize));
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_chip2(gpu_data_chip2, chip2TensorRange);
 
-  gpu_chip2.device(sycl_device)=gpu_tensor.template chip<1l>(1l);
+  gpu_chip2.device(sycl_device) = gpu_tensor.template chip<1l>(1l);
   sycl_device.memcpyDeviceToHost(chip2.data(), gpu_data_chip2, chip2TensorBuffSize);
 
   VERIFY_IS_EQUAL(chip2.dimension(0), sizeDim1);
@@ -87,19 +85,19 @@
     for (IndexType j = 0; j < sizeDim3; ++j) {
       for (IndexType k = 0; k < sizeDim4; ++k) {
         for (IndexType l = 0; l < sizeDim5; ++l) {
-          VERIFY_IS_EQUAL(chip2(i,j,k,l), tensor(i,1l,j,k,l));
+          VERIFY_IS_EQUAL(chip2(i, j, k, l), tensor(i, 1l, j, k, l));
         }
       }
     }
   }
 
   array<IndexType, 4> chip3TensorRange = {{sizeDim1, sizeDim2, sizeDim4, sizeDim5}};
-  Tensor<DataType, 4, DataLayout,IndexType> chip3(chip3TensorRange);
-  const size_t chip3TensorBuffSize =chip3.size()*sizeof(DataType);
-  DataType* gpu_data_chip3  = static_cast<DataType*>(sycl_device.allocate(chip3TensorBuffSize));
-  TensorMap<Tensor<DataType, 4, DataLayout,IndexType>> gpu_chip3(gpu_data_chip3, chip3TensorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> chip3(chip3TensorRange);
+  const size_t chip3TensorBuffSize = chip3.size() * sizeof(DataType);
+  DataType* gpu_data_chip3 = static_cast<DataType*>(sycl_device.allocate(chip3TensorBuffSize));
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_chip3(gpu_data_chip3, chip3TensorRange);
 
-  gpu_chip3.device(sycl_device)=gpu_tensor.template chip<2l>(2l);
+  gpu_chip3.device(sycl_device) = gpu_tensor.template chip<2l>(2l);
   sycl_device.memcpyDeviceToHost(chip3.data(), gpu_data_chip3, chip3TensorBuffSize);
 
   VERIFY_IS_EQUAL(chip3.dimension(0), sizeDim1);
@@ -111,19 +109,19 @@
     for (IndexType j = 0; j < sizeDim2; ++j) {
       for (IndexType k = 0; k < sizeDim4; ++k) {
         for (IndexType l = 0; l < sizeDim5; ++l) {
-          VERIFY_IS_EQUAL(chip3(i,j,k,l), tensor(i,j,2l,k,l));
+          VERIFY_IS_EQUAL(chip3(i, j, k, l), tensor(i, j, 2l, k, l));
         }
       }
     }
   }
 
   array<IndexType, 4> chip4TensorRange = {{sizeDim1, sizeDim2, sizeDim3, sizeDim5}};
-  Tensor<DataType, 4, DataLayout,IndexType> chip4(chip4TensorRange);
-  const size_t chip4TensorBuffSize =chip4.size()*sizeof(DataType);
-  DataType* gpu_data_chip4  = static_cast<DataType*>(sycl_device.allocate(chip4TensorBuffSize));
-  TensorMap<Tensor<DataType, 4, DataLayout,IndexType>> gpu_chip4(gpu_data_chip4, chip4TensorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> chip4(chip4TensorRange);
+  const size_t chip4TensorBuffSize = chip4.size() * sizeof(DataType);
+  DataType* gpu_data_chip4 = static_cast<DataType*>(sycl_device.allocate(chip4TensorBuffSize));
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_chip4(gpu_data_chip4, chip4TensorRange);
 
-  gpu_chip4.device(sycl_device)=gpu_tensor.template chip<3l>(5l);
+  gpu_chip4.device(sycl_device) = gpu_tensor.template chip<3l>(5l);
   sycl_device.memcpyDeviceToHost(chip4.data(), gpu_data_chip4, chip4TensorBuffSize);
 
   VERIFY_IS_EQUAL(chip4.dimension(0), sizeDim1);
@@ -135,20 +133,19 @@
     for (IndexType j = 0; j < sizeDim2; ++j) {
       for (IndexType k = 0; k < sizeDim3; ++k) {
         for (IndexType l = 0; l < sizeDim5; ++l) {
-          VERIFY_IS_EQUAL(chip4(i,j,k,l), tensor(i,j,k,5l,l));
+          VERIFY_IS_EQUAL(chip4(i, j, k, l), tensor(i, j, k, 5l, l));
         }
       }
     }
   }
 
-
   array<IndexType, 4> chip5TensorRange = {{sizeDim1, sizeDim2, sizeDim3, sizeDim4}};
-  Tensor<DataType, 4, DataLayout,IndexType> chip5(chip5TensorRange);
-  const size_t chip5TensorBuffSize =chip5.size()*sizeof(DataType);
-  DataType* gpu_data_chip5  = static_cast<DataType*>(sycl_device.allocate(chip5TensorBuffSize));
-  TensorMap<Tensor<DataType, 4, DataLayout,IndexType>> gpu_chip5(gpu_data_chip5, chip5TensorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> chip5(chip5TensorRange);
+  const size_t chip5TensorBuffSize = chip5.size() * sizeof(DataType);
+  DataType* gpu_data_chip5 = static_cast<DataType*>(sycl_device.allocate(chip5TensorBuffSize));
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_chip5(gpu_data_chip5, chip5TensorRange);
 
-  gpu_chip5.device(sycl_device)=gpu_tensor.template chip<4l>(7l);
+  gpu_chip5.device(sycl_device) = gpu_tensor.template chip<4l>(7l);
   sycl_device.memcpyDeviceToHost(chip5.data(), gpu_data_chip5, chip5TensorBuffSize);
 
   VERIFY_IS_EQUAL(chip5.dimension(0), sizeDim1);
@@ -160,7 +157,7 @@
     for (IndexType j = 0; j < sizeDim2; ++j) {
       for (IndexType k = 0; k < sizeDim3; ++k) {
         for (IndexType l = 0; l < sizeDim4; ++l) {
-          VERIFY_IS_EQUAL(chip5(i,j,k,l), tensor(i,j,k,l,7l));
+          VERIFY_IS_EQUAL(chip5(i, j, k, l), tensor(i, j, k, l, 7l));
         }
       }
     }
@@ -175,8 +172,7 @@
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_dynamic_chip_sycl(const Eigen::SyclDevice& sycl_device)
-{
+static void test_dynamic_chip_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType sizeDim1 = 2;
   IndexType sizeDim2 = 3;
   IndexType sizeDim3 = 5;
@@ -186,21 +182,21 @@
   array<IndexType, 5> tensorRange = {{sizeDim1, sizeDim2, sizeDim3, sizeDim4, sizeDim5}};
   array<IndexType, 4> chip1TensorRange = {{sizeDim2, sizeDim3, sizeDim4, sizeDim5}};
 
-  Tensor<DataType, 5, DataLayout,IndexType> tensor(tensorRange);
-  Tensor<DataType, 4, DataLayout,IndexType> chip1(chip1TensorRange);
+  Tensor<DataType, 5, DataLayout, IndexType> tensor(tensorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> chip1(chip1TensorRange);
 
   tensor.setRandom();
 
-  const size_t tensorBuffSize =tensor.size()*sizeof(DataType);
-  const size_t chip1TensorBuffSize =chip1.size()*sizeof(DataType);
-  DataType* gpu_data_tensor  = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
-  DataType* gpu_data_chip1  = static_cast<DataType*>(sycl_device.allocate(chip1TensorBuffSize));
+  const size_t tensorBuffSize = tensor.size() * sizeof(DataType);
+  const size_t chip1TensorBuffSize = chip1.size() * sizeof(DataType);
+  DataType* gpu_data_tensor = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
+  DataType* gpu_data_chip1 = static_cast<DataType*>(sycl_device.allocate(chip1TensorBuffSize));
 
-  TensorMap<Tensor<DataType, 5, DataLayout,IndexType>> gpu_tensor(gpu_data_tensor, tensorRange);
-  TensorMap<Tensor<DataType, 4, DataLayout,IndexType>> gpu_chip1(gpu_data_chip1, chip1TensorRange);
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu_tensor(gpu_data_tensor, tensorRange);
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_chip1(gpu_data_chip1, chip1TensorRange);
 
   sycl_device.memcpyHostToDevice(gpu_data_tensor, tensor.data(), tensorBuffSize);
-  gpu_chip1.device(sycl_device)=gpu_tensor.chip(1l,0l);
+  gpu_chip1.device(sycl_device) = gpu_tensor.chip(1l, 0l);
   sycl_device.memcpyDeviceToHost(chip1.data(), gpu_data_chip1, chip1TensorBuffSize);
 
   VERIFY_IS_EQUAL(chip1.dimension(0), sizeDim2);
@@ -212,19 +208,19 @@
     for (IndexType j = 0; j < sizeDim3; ++j) {
       for (IndexType k = 0; k < sizeDim4; ++k) {
         for (IndexType l = 0; l < sizeDim5; ++l) {
-          VERIFY_IS_EQUAL(chip1(i,j,k,l), tensor(1l,i,j,k,l));
+          VERIFY_IS_EQUAL(chip1(i, j, k, l), tensor(1l, i, j, k, l));
         }
       }
     }
   }
 
   array<IndexType, 4> chip2TensorRange = {{sizeDim1, sizeDim3, sizeDim4, sizeDim5}};
-  Tensor<DataType, 4, DataLayout,IndexType> chip2(chip2TensorRange);
-  const size_t chip2TensorBuffSize =chip2.size()*sizeof(DataType);
-  DataType* gpu_data_chip2  = static_cast<DataType*>(sycl_device.allocate(chip2TensorBuffSize));
-  TensorMap<Tensor<DataType, 4, DataLayout,IndexType>> gpu_chip2(gpu_data_chip2, chip2TensorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> chip2(chip2TensorRange);
+  const size_t chip2TensorBuffSize = chip2.size() * sizeof(DataType);
+  DataType* gpu_data_chip2 = static_cast<DataType*>(sycl_device.allocate(chip2TensorBuffSize));
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_chip2(gpu_data_chip2, chip2TensorRange);
 
-  gpu_chip2.device(sycl_device)=gpu_tensor.chip(1l,1l);
+  gpu_chip2.device(sycl_device) = gpu_tensor.chip(1l, 1l);
   sycl_device.memcpyDeviceToHost(chip2.data(), gpu_data_chip2, chip2TensorBuffSize);
 
   VERIFY_IS_EQUAL(chip2.dimension(0), sizeDim1);
@@ -236,19 +232,19 @@
     for (IndexType j = 0; j < sizeDim3; ++j) {
       for (IndexType k = 0; k < sizeDim4; ++k) {
         for (IndexType l = 0; l < sizeDim5; ++l) {
-          VERIFY_IS_EQUAL(chip2(i,j,k,l), tensor(i,1l,j,k,l));
+          VERIFY_IS_EQUAL(chip2(i, j, k, l), tensor(i, 1l, j, k, l));
         }
       }
     }
   }
 
   array<IndexType, 4> chip3TensorRange = {{sizeDim1, sizeDim2, sizeDim4, sizeDim5}};
-  Tensor<DataType, 4, DataLayout,IndexType> chip3(chip3TensorRange);
-  const size_t chip3TensorBuffSize =chip3.size()*sizeof(DataType);
-  DataType* gpu_data_chip3  = static_cast<DataType*>(sycl_device.allocate(chip3TensorBuffSize));
-  TensorMap<Tensor<DataType, 4, DataLayout,IndexType>> gpu_chip3(gpu_data_chip3, chip3TensorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> chip3(chip3TensorRange);
+  const size_t chip3TensorBuffSize = chip3.size() * sizeof(DataType);
+  DataType* gpu_data_chip3 = static_cast<DataType*>(sycl_device.allocate(chip3TensorBuffSize));
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_chip3(gpu_data_chip3, chip3TensorRange);
 
-  gpu_chip3.device(sycl_device)=gpu_tensor.chip(2l,2l);
+  gpu_chip3.device(sycl_device) = gpu_tensor.chip(2l, 2l);
   sycl_device.memcpyDeviceToHost(chip3.data(), gpu_data_chip3, chip3TensorBuffSize);
 
   VERIFY_IS_EQUAL(chip3.dimension(0), sizeDim1);
@@ -260,19 +256,19 @@
     for (IndexType j = 0; j < sizeDim2; ++j) {
       for (IndexType k = 0; k < sizeDim4; ++k) {
         for (IndexType l = 0; l < sizeDim5; ++l) {
-          VERIFY_IS_EQUAL(chip3(i,j,k,l), tensor(i,j,2l,k,l));
+          VERIFY_IS_EQUAL(chip3(i, j, k, l), tensor(i, j, 2l, k, l));
         }
       }
     }
   }
 
   array<IndexType, 4> chip4TensorRange = {{sizeDim1, sizeDim2, sizeDim3, sizeDim5}};
-  Tensor<DataType, 4, DataLayout,IndexType> chip4(chip4TensorRange);
-  const size_t chip4TensorBuffSize =chip4.size()*sizeof(DataType);
-  DataType* gpu_data_chip4  = static_cast<DataType*>(sycl_device.allocate(chip4TensorBuffSize));
-  TensorMap<Tensor<DataType, 4, DataLayout,IndexType>> gpu_chip4(gpu_data_chip4, chip4TensorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> chip4(chip4TensorRange);
+  const size_t chip4TensorBuffSize = chip4.size() * sizeof(DataType);
+  DataType* gpu_data_chip4 = static_cast<DataType*>(sycl_device.allocate(chip4TensorBuffSize));
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_chip4(gpu_data_chip4, chip4TensorRange);
 
-  gpu_chip4.device(sycl_device)=gpu_tensor.chip(5l,3l);
+  gpu_chip4.device(sycl_device) = gpu_tensor.chip(5l, 3l);
   sycl_device.memcpyDeviceToHost(chip4.data(), gpu_data_chip4, chip4TensorBuffSize);
 
   VERIFY_IS_EQUAL(chip4.dimension(0), sizeDim1);
@@ -284,20 +280,19 @@
     for (IndexType j = 0; j < sizeDim2; ++j) {
       for (IndexType k = 0; k < sizeDim3; ++k) {
         for (IndexType l = 0; l < sizeDim5; ++l) {
-          VERIFY_IS_EQUAL(chip4(i,j,k,l), tensor(i,j,k,5l,l));
+          VERIFY_IS_EQUAL(chip4(i, j, k, l), tensor(i, j, k, 5l, l));
         }
       }
     }
   }
 
-
   array<IndexType, 4> chip5TensorRange = {{sizeDim1, sizeDim2, sizeDim3, sizeDim4}};
-  Tensor<DataType, 4, DataLayout,IndexType> chip5(chip5TensorRange);
-  const size_t chip5TensorBuffSize =chip5.size()*sizeof(DataType);
-  DataType* gpu_data_chip5  = static_cast<DataType*>(sycl_device.allocate(chip5TensorBuffSize));
-  TensorMap<Tensor<DataType, 4, DataLayout,IndexType>> gpu_chip5(gpu_data_chip5, chip5TensorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> chip5(chip5TensorRange);
+  const size_t chip5TensorBuffSize = chip5.size() * sizeof(DataType);
+  DataType* gpu_data_chip5 = static_cast<DataType*>(sycl_device.allocate(chip5TensorBuffSize));
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_chip5(gpu_data_chip5, chip5TensorRange);
 
-  gpu_chip5.device(sycl_device)=gpu_tensor.chip(7l,4l);
+  gpu_chip5.device(sycl_device) = gpu_tensor.chip(7l, 4l);
   sycl_device.memcpyDeviceToHost(chip5.data(), gpu_data_chip5, chip5TensorBuffSize);
 
   VERIFY_IS_EQUAL(chip5.dimension(0), sizeDim1);
@@ -309,7 +304,7 @@
     for (IndexType j = 0; j < sizeDim2; ++j) {
       for (IndexType k = 0; k < sizeDim3; ++k) {
         for (IndexType l = 0; l < sizeDim4; ++l) {
-          VERIFY_IS_EQUAL(chip5(i,j,k,l), tensor(i,j,k,l,7l));
+          VERIFY_IS_EQUAL(chip5(i, j, k, l), tensor(i, j, k, l, 7l));
         }
       }
     }
@@ -324,7 +319,6 @@
 
 template <typename DataType, int DataLayout, typename IndexType>
 static void test_chip_in_expr(const Eigen::SyclDevice& sycl_device) {
-
   IndexType sizeDim1 = 2;
   IndexType sizeDim2 = 3;
   IndexType sizeDim3 = 5;
@@ -334,59 +328,58 @@
   array<IndexType, 5> tensorRange = {{sizeDim1, sizeDim2, sizeDim3, sizeDim4, sizeDim5}};
   array<IndexType, 4> chip1TensorRange = {{sizeDim2, sizeDim3, sizeDim4, sizeDim5}};
 
-  Tensor<DataType, 5, DataLayout,IndexType> tensor(tensorRange);
+  Tensor<DataType, 5, DataLayout, IndexType> tensor(tensorRange);
 
-  Tensor<DataType, 4, DataLayout,IndexType> chip1(chip1TensorRange);
-  Tensor<DataType, 4, DataLayout,IndexType> tensor1(chip1TensorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> chip1(chip1TensorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> tensor1(chip1TensorRange);
   tensor.setRandom();
   tensor1.setRandom();
 
-  const size_t tensorBuffSize =tensor.size()*sizeof(DataType);
-  const size_t chip1TensorBuffSize =chip1.size()*sizeof(DataType);
-  DataType* gpu_data_tensor  = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
-  DataType* gpu_data_chip1  = static_cast<DataType*>(sycl_device.allocate(chip1TensorBuffSize));
-  DataType* gpu_data_tensor1  = static_cast<DataType*>(sycl_device.allocate(chip1TensorBuffSize));
+  const size_t tensorBuffSize = tensor.size() * sizeof(DataType);
+  const size_t chip1TensorBuffSize = chip1.size() * sizeof(DataType);
+  DataType* gpu_data_tensor = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
+  DataType* gpu_data_chip1 = static_cast<DataType*>(sycl_device.allocate(chip1TensorBuffSize));
+  DataType* gpu_data_tensor1 = static_cast<DataType*>(sycl_device.allocate(chip1TensorBuffSize));
 
-  TensorMap<Tensor<DataType, 5, DataLayout,IndexType>> gpu_tensor(gpu_data_tensor, tensorRange);
-  TensorMap<Tensor<DataType, 4, DataLayout,IndexType>> gpu_chip1(gpu_data_chip1, chip1TensorRange);
-  TensorMap<Tensor<DataType, 4, DataLayout,IndexType>> gpu_tensor1(gpu_data_tensor1, chip1TensorRange);
-
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu_tensor(gpu_data_tensor, tensorRange);
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_chip1(gpu_data_chip1, chip1TensorRange);
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_tensor1(gpu_data_tensor1, chip1TensorRange);
 
   sycl_device.memcpyHostToDevice(gpu_data_tensor, tensor.data(), tensorBuffSize);
   sycl_device.memcpyHostToDevice(gpu_data_tensor1, tensor1.data(), chip1TensorBuffSize);
-  gpu_chip1.device(sycl_device)=gpu_tensor.template chip<0l>(0l) + gpu_tensor1;
+  gpu_chip1.device(sycl_device) = gpu_tensor.template chip<0l>(0l) + gpu_tensor1;
   sycl_device.memcpyDeviceToHost(chip1.data(), gpu_data_chip1, chip1TensorBuffSize);
 
   for (int i = 0; i < sizeDim2; ++i) {
     for (int j = 0; j < sizeDim3; ++j) {
       for (int k = 0; k < sizeDim4; ++k) {
         for (int l = 0; l < sizeDim5; ++l) {
-          float expected = tensor(0l,i,j,k,l) + tensor1(i,j,k,l);
-          VERIFY_IS_EQUAL(chip1(i,j,k,l), expected);
+          float expected = tensor(0l, i, j, k, l) + tensor1(i, j, k, l);
+          VERIFY_IS_EQUAL(chip1(i, j, k, l), expected);
         }
       }
     }
   }
 
   array<IndexType, 3> chip2TensorRange = {{sizeDim2, sizeDim4, sizeDim5}};
-  Tensor<DataType, 3, DataLayout,IndexType> tensor2(chip2TensorRange);
-  Tensor<DataType, 3, DataLayout,IndexType> chip2(chip2TensorRange);
+  Tensor<DataType, 3, DataLayout, IndexType> tensor2(chip2TensorRange);
+  Tensor<DataType, 3, DataLayout, IndexType> chip2(chip2TensorRange);
   tensor2.setRandom();
-  const size_t chip2TensorBuffSize =tensor2.size()*sizeof(DataType);
-  DataType* gpu_data_tensor2  = static_cast<DataType*>(sycl_device.allocate(chip2TensorBuffSize));
-  DataType* gpu_data_chip2  = static_cast<DataType*>(sycl_device.allocate(chip2TensorBuffSize));
-  TensorMap<Tensor<DataType, 3, DataLayout,IndexType>> gpu_tensor2(gpu_data_tensor2, chip2TensorRange);
-  TensorMap<Tensor<DataType, 3, DataLayout,IndexType>> gpu_chip2(gpu_data_chip2, chip2TensorRange);
+  const size_t chip2TensorBuffSize = tensor2.size() * sizeof(DataType);
+  DataType* gpu_data_tensor2 = static_cast<DataType*>(sycl_device.allocate(chip2TensorBuffSize));
+  DataType* gpu_data_chip2 = static_cast<DataType*>(sycl_device.allocate(chip2TensorBuffSize));
+  TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> gpu_tensor2(gpu_data_tensor2, chip2TensorRange);
+  TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> gpu_chip2(gpu_data_chip2, chip2TensorRange);
 
   sycl_device.memcpyHostToDevice(gpu_data_tensor2, tensor2.data(), chip2TensorBuffSize);
-  gpu_chip2.device(sycl_device)=gpu_tensor.template chip<0l>(0l).template chip<1l>(2l) + gpu_tensor2;
+  gpu_chip2.device(sycl_device) = gpu_tensor.template chip<0l>(0l).template chip<1l>(2l) + gpu_tensor2;
   sycl_device.memcpyDeviceToHost(chip2.data(), gpu_data_chip2, chip2TensorBuffSize);
 
   for (int i = 0; i < sizeDim2; ++i) {
     for (int j = 0; j < sizeDim4; ++j) {
       for (int k = 0; k < sizeDim5; ++k) {
-        float expected = tensor(0l,i,2l,j,k) + tensor2(i,j,k);
-        VERIFY_IS_EQUAL(chip2(i,j,k), expected);
+        float expected = tensor(0l, i, 2l, j, k) + tensor2(i, j, k);
+        VERIFY_IS_EQUAL(chip2(i, j, k), expected);
       }
     }
   }
@@ -398,9 +391,7 @@
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_chip_as_lvalue_sycl(const Eigen::SyclDevice& sycl_device)
-{
-
+static void test_chip_as_lvalue_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType sizeDim1 = 2;
   IndexType sizeDim2 = 3;
   IndexType sizeDim3 = 5;
@@ -410,28 +401,27 @@
   array<IndexType, 5> tensorRange = {{sizeDim1, sizeDim2, sizeDim3, sizeDim4, sizeDim5}};
   array<IndexType, 4> input2TensorRange = {{sizeDim2, sizeDim3, sizeDim4, sizeDim5}};
 
-  Tensor<DataType, 5, DataLayout,IndexType> tensor(tensorRange);
-  Tensor<DataType, 5, DataLayout,IndexType> input1(tensorRange);
-  Tensor<DataType, 4, DataLayout,IndexType> input2(input2TensorRange);
+  Tensor<DataType, 5, DataLayout, IndexType> tensor(tensorRange);
+  Tensor<DataType, 5, DataLayout, IndexType> input1(tensorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> input2(input2TensorRange);
   input1.setRandom();
   input2.setRandom();
 
+  const size_t tensorBuffSize = tensor.size() * sizeof(DataType);
+  const size_t input2TensorBuffSize = input2.size() * sizeof(DataType);
+  std::cout << tensorBuffSize << " , " << input2TensorBuffSize << std::endl;
+  DataType* gpu_data_tensor = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
+  DataType* gpu_data_input1 = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
+  DataType* gpu_data_input2 = static_cast<DataType*>(sycl_device.allocate(input2TensorBuffSize));
 
-  const size_t tensorBuffSize =tensor.size()*sizeof(DataType);
-  const size_t input2TensorBuffSize =input2.size()*sizeof(DataType);
-  std::cout << tensorBuffSize << " , "<<  input2TensorBuffSize << std::endl;
-  DataType* gpu_data_tensor  = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
-  DataType* gpu_data_input1  = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
-  DataType* gpu_data_input2  = static_cast<DataType*>(sycl_device.allocate(input2TensorBuffSize));
-
-  TensorMap<Tensor<DataType, 5, DataLayout,IndexType>> gpu_tensor(gpu_data_tensor, tensorRange);
-  TensorMap<Tensor<DataType, 5, DataLayout,IndexType>> gpu_input1(gpu_data_input1, tensorRange);
-  TensorMap<Tensor<DataType, 4, DataLayout,IndexType>> gpu_input2(gpu_data_input2, input2TensorRange);
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu_tensor(gpu_data_tensor, tensorRange);
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu_input1(gpu_data_input1, tensorRange);
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_input2(gpu_data_input2, input2TensorRange);
 
   sycl_device.memcpyHostToDevice(gpu_data_input1, input1.data(), tensorBuffSize);
-  gpu_tensor.device(sycl_device)=gpu_input1;
+  gpu_tensor.device(sycl_device) = gpu_input1;
   sycl_device.memcpyHostToDevice(gpu_data_input2, input2.data(), input2TensorBuffSize);
-  gpu_tensor.template chip<0l>(1l).device(sycl_device)=gpu_input2;
+  gpu_tensor.template chip<0l>(1l).device(sycl_device) = gpu_input2;
   sycl_device.memcpyDeviceToHost(tensor.data(), gpu_data_tensor, tensorBuffSize);
 
   for (int i = 0; i < sizeDim1; ++i) {
@@ -440,9 +430,9 @@
         for (int l = 0; l < sizeDim4; ++l) {
           for (int m = 0; m < sizeDim5; ++m) {
             if (i != 1) {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input1(i,j,k,l,m));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input1(i, j, k, l, m));
             } else {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input2(j,k,l,m));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input2(j, k, l, m));
             }
           }
         }
@@ -450,28 +440,28 @@
     }
   }
 
-  gpu_tensor.device(sycl_device)=gpu_input1;
+  gpu_tensor.device(sycl_device) = gpu_input1;
   array<IndexType, 4> input3TensorRange = {{sizeDim1, sizeDim3, sizeDim4, sizeDim5}};
-  Tensor<DataType, 4, DataLayout,IndexType> input3(input3TensorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> input3(input3TensorRange);
   input3.setRandom();
 
-  const size_t input3TensorBuffSize =input3.size()*sizeof(DataType);
-  DataType* gpu_data_input3  = static_cast<DataType*>(sycl_device.allocate(input3TensorBuffSize));
-  TensorMap<Tensor<DataType, 4, DataLayout,IndexType>> gpu_input3(gpu_data_input3, input3TensorRange);
+  const size_t input3TensorBuffSize = input3.size() * sizeof(DataType);
+  DataType* gpu_data_input3 = static_cast<DataType*>(sycl_device.allocate(input3TensorBuffSize));
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_input3(gpu_data_input3, input3TensorRange);
 
   sycl_device.memcpyHostToDevice(gpu_data_input3, input3.data(), input3TensorBuffSize);
-  gpu_tensor.template chip<1l>(1l).device(sycl_device)=gpu_input3;
+  gpu_tensor.template chip<1l>(1l).device(sycl_device) = gpu_input3;
   sycl_device.memcpyDeviceToHost(tensor.data(), gpu_data_tensor, tensorBuffSize);
 
   for (int i = 0; i < sizeDim1; ++i) {
     for (int j = 0; j < sizeDim2; ++j) {
-      for (int k = 0; k <sizeDim3; ++k) {
+      for (int k = 0; k < sizeDim3; ++k) {
         for (int l = 0; l < sizeDim4; ++l) {
           for (int m = 0; m < sizeDim5; ++m) {
             if (j != 1) {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input1(i,j,k,l,m));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input1(i, j, k, l, m));
             } else {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input3(i,k,l,m));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input3(i, k, l, m));
             }
           }
         }
@@ -479,28 +469,28 @@
     }
   }
 
-  gpu_tensor.device(sycl_device)=gpu_input1;
+  gpu_tensor.device(sycl_device) = gpu_input1;
   array<IndexType, 4> input4TensorRange = {{sizeDim1, sizeDim2, sizeDim4, sizeDim5}};
-  Tensor<DataType, 4, DataLayout,IndexType> input4(input4TensorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> input4(input4TensorRange);
   input4.setRandom();
 
-  const size_t input4TensorBuffSize =input4.size()*sizeof(DataType);
-  DataType* gpu_data_input4  = static_cast<DataType*>(sycl_device.allocate(input4TensorBuffSize));
-  TensorMap<Tensor<DataType, 4, DataLayout,IndexType>> gpu_input4(gpu_data_input4, input4TensorRange);
+  const size_t input4TensorBuffSize = input4.size() * sizeof(DataType);
+  DataType* gpu_data_input4 = static_cast<DataType*>(sycl_device.allocate(input4TensorBuffSize));
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_input4(gpu_data_input4, input4TensorRange);
 
   sycl_device.memcpyHostToDevice(gpu_data_input4, input4.data(), input4TensorBuffSize);
-  gpu_tensor.template chip<2l>(3l).device(sycl_device)=gpu_input4;
+  gpu_tensor.template chip<2l>(3l).device(sycl_device) = gpu_input4;
   sycl_device.memcpyDeviceToHost(tensor.data(), gpu_data_tensor, tensorBuffSize);
 
   for (int i = 0; i < sizeDim1; ++i) {
     for (int j = 0; j < sizeDim2; ++j) {
-      for (int k = 0; k <sizeDim3; ++k) {
+      for (int k = 0; k < sizeDim3; ++k) {
         for (int l = 0; l < sizeDim4; ++l) {
           for (int m = 0; m < sizeDim5; ++m) {
             if (k != 3) {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input1(i,j,k,l,m));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input1(i, j, k, l, m));
             } else {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input4(i,j,l,m));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input4(i, j, l, m));
             }
           }
         }
@@ -508,56 +498,56 @@
     }
   }
 
-  gpu_tensor.device(sycl_device)=gpu_input1;
+  gpu_tensor.device(sycl_device) = gpu_input1;
   array<IndexType, 4> input5TensorRange = {{sizeDim1, sizeDim2, sizeDim3, sizeDim5}};
-  Tensor<DataType, 4, DataLayout,IndexType> input5(input5TensorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> input5(input5TensorRange);
   input5.setRandom();
 
-  const size_t input5TensorBuffSize =input5.size()*sizeof(DataType);
-  DataType* gpu_data_input5  = static_cast<DataType*>(sycl_device.allocate(input5TensorBuffSize));
-  TensorMap<Tensor<DataType, 4, DataLayout,IndexType>> gpu_input5(gpu_data_input5, input5TensorRange);
+  const size_t input5TensorBuffSize = input5.size() * sizeof(DataType);
+  DataType* gpu_data_input5 = static_cast<DataType*>(sycl_device.allocate(input5TensorBuffSize));
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_input5(gpu_data_input5, input5TensorRange);
 
   sycl_device.memcpyHostToDevice(gpu_data_input5, input5.data(), input5TensorBuffSize);
-  gpu_tensor.template chip<3l>(4l).device(sycl_device)=gpu_input5;
+  gpu_tensor.template chip<3l>(4l).device(sycl_device) = gpu_input5;
   sycl_device.memcpyDeviceToHost(tensor.data(), gpu_data_tensor, tensorBuffSize);
 
   for (int i = 0; i < sizeDim1; ++i) {
     for (int j = 0; j < sizeDim2; ++j) {
-      for (int k = 0; k <sizeDim3; ++k) {
+      for (int k = 0; k < sizeDim3; ++k) {
         for (int l = 0; l < sizeDim4; ++l) {
           for (int m = 0; m < sizeDim5; ++m) {
             if (l != 4) {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input1(i,j,k,l,m));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input1(i, j, k, l, m));
             } else {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input5(i,j,k,m));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input5(i, j, k, m));
             }
           }
         }
       }
     }
   }
-  gpu_tensor.device(sycl_device)=gpu_input1;
+  gpu_tensor.device(sycl_device) = gpu_input1;
   array<IndexType, 4> input6TensorRange = {{sizeDim1, sizeDim2, sizeDim3, sizeDim4}};
-  Tensor<DataType, 4, DataLayout,IndexType> input6(input6TensorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> input6(input6TensorRange);
   input6.setRandom();
 
-  const size_t input6TensorBuffSize =input6.size()*sizeof(DataType);
-  DataType* gpu_data_input6  = static_cast<DataType*>(sycl_device.allocate(input6TensorBuffSize));
-  TensorMap<Tensor<DataType, 4, DataLayout,IndexType>> gpu_input6(gpu_data_input6, input6TensorRange);
+  const size_t input6TensorBuffSize = input6.size() * sizeof(DataType);
+  DataType* gpu_data_input6 = static_cast<DataType*>(sycl_device.allocate(input6TensorBuffSize));
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_input6(gpu_data_input6, input6TensorRange);
 
   sycl_device.memcpyHostToDevice(gpu_data_input6, input6.data(), input6TensorBuffSize);
-  gpu_tensor.template chip<4l>(5l).device(sycl_device)=gpu_input6;
+  gpu_tensor.template chip<4l>(5l).device(sycl_device) = gpu_input6;
   sycl_device.memcpyDeviceToHost(tensor.data(), gpu_data_tensor, tensorBuffSize);
 
   for (int i = 0; i < sizeDim1; ++i) {
     for (int j = 0; j < sizeDim2; ++j) {
-      for (int k = 0; k <sizeDim3; ++k) {
+      for (int k = 0; k < sizeDim3; ++k) {
         for (int l = 0; l < sizeDim4; ++l) {
           for (int m = 0; m < sizeDim5; ++m) {
             if (m != 5) {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input1(i,j,k,l,m));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input1(i, j, k, l, m));
             } else {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input6(i,j,k,l));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input6(i, j, k, l));
             }
           }
         }
@@ -565,27 +555,26 @@
     }
   }
 
-
-  gpu_tensor.device(sycl_device)=gpu_input1;
-  Tensor<DataType, 5, DataLayout,IndexType> input7(tensorRange);
+  gpu_tensor.device(sycl_device) = gpu_input1;
+  Tensor<DataType, 5, DataLayout, IndexType> input7(tensorRange);
   input7.setRandom();
 
-  DataType* gpu_data_input7  = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
-  TensorMap<Tensor<DataType, 5, DataLayout,IndexType>> gpu_input7(gpu_data_input7, tensorRange);
+  DataType* gpu_data_input7 = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu_input7(gpu_data_input7, tensorRange);
 
   sycl_device.memcpyHostToDevice(gpu_data_input7, input7.data(), tensorBuffSize);
-  gpu_tensor.chip(0l,0l).device(sycl_device)=gpu_input7.chip(0l,0l);
+  gpu_tensor.chip(0l, 0l).device(sycl_device) = gpu_input7.chip(0l, 0l);
   sycl_device.memcpyDeviceToHost(tensor.data(), gpu_data_tensor, tensorBuffSize);
 
   for (int i = 0; i < sizeDim1; ++i) {
     for (int j = 0; j < sizeDim2; ++j) {
-      for (int k = 0; k <sizeDim3; ++k) {
+      for (int k = 0; k < sizeDim3; ++k) {
         for (int l = 0; l < sizeDim4; ++l) {
           for (int m = 0; m < sizeDim5; ++m) {
             if (i != 0) {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input1(i,j,k,l,m));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input1(i, j, k, l, m));
             } else {
-              VERIFY_IS_EQUAL(tensor(i,j,k,l,m), input7(i,j,k,l,m));
+              VERIFY_IS_EQUAL(tensor(i, j, k, l, m), input7(i, j, k, l, m));
             }
           }
         }
@@ -600,24 +589,23 @@
   sycl_device.deallocate(gpu_data_input5);
   sycl_device.deallocate(gpu_data_input6);
   sycl_device.deallocate(gpu_data_input7);
-
 }
 
-template<typename DataType, typename dev_Selector> void sycl_chipping_test_per_device(dev_Selector s){
+template <typename DataType, typename dev_Selector>
+void sycl_chipping_test_per_device(dev_Selector s) {
   QueueInterface queueInterface(s);
   auto sycl_device = Eigen::SyclDevice(&queueInterface);
- /* test_static_chip_sycl<DataType, RowMajor, int64_t>(sycl_device);
-  test_static_chip_sycl<DataType, ColMajor, int64_t>(sycl_device);
-  test_dynamic_chip_sycl<DataType, RowMajor, int64_t>(sycl_device);
-  test_dynamic_chip_sycl<DataType, ColMajor, int64_t>(sycl_device);
-  test_chip_in_expr<DataType, RowMajor, int64_t>(sycl_device);
-  test_chip_in_expr<DataType, ColMajor, int64_t>(sycl_device);*/
+  /* test_static_chip_sycl<DataType, RowMajor, int64_t>(sycl_device);
+   test_static_chip_sycl<DataType, ColMajor, int64_t>(sycl_device);
+   test_dynamic_chip_sycl<DataType, RowMajor, int64_t>(sycl_device);
+   test_dynamic_chip_sycl<DataType, ColMajor, int64_t>(sycl_device);
+   test_chip_in_expr<DataType, RowMajor, int64_t>(sycl_device);
+   test_chip_in_expr<DataType, ColMajor, int64_t>(sycl_device);*/
   test_chip_as_lvalue_sycl<DataType, RowMajor, int64_t>(sycl_device);
- // test_chip_as_lvalue_sycl<DataType, ColMajor, int64_t>(sycl_device);
+  // test_chip_as_lvalue_sycl<DataType, ColMajor, int64_t>(sycl_device);
 }
-EIGEN_DECLARE_TEST(cxx11_tensor_chipping_sycl)
-{
-  for (const auto& device :Eigen::get_sycl_supported_devices()) {
+EIGEN_DECLARE_TEST(cxx11_tensor_chipping_sycl) {
+  for (const auto& device : Eigen::get_sycl_supported_devices()) {
     CALL_SUBTEST(sycl_chipping_test_per_device<float>(device));
     CALL_SUBTEST(sycl_chipping_test_per_device<half>(device));
   }
diff --git a/unsupported/test/cxx11_tensor_comparisons.cpp b/unsupported/test/cxx11_tensor_comparisons.cpp
index e0bd90d..3565b62 100644
--- a/unsupported/test/cxx11_tensor_comparisons.cpp
+++ b/unsupported/test/cxx11_tensor_comparisons.cpp
@@ -11,8 +11,8 @@
 
 #include <Eigen/CXX11/Tensor>
 
-using Eigen::Tensor;
 using Eigen::RowMajor;
+using Eigen::Tensor;
 
 using Scalar = float;
 
@@ -23,18 +23,17 @@
 using TypedEQOp = internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_EQ, true>;
 using TypedNEOp = internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_NEQ, true>;
 
-static void test_orderings()
-{
-  Tensor<Scalar, 3> mat1(2,3,7);
-  Tensor<Scalar, 3> mat2(2,3,7);
+static void test_orderings() {
+  Tensor<Scalar, 3> mat1(2, 3, 7);
+  Tensor<Scalar, 3> mat2(2, 3, 7);
 
   mat1.setRandom();
   mat2.setRandom();
 
-  Tensor<bool, 3> lt(2,3,7);
-  Tensor<bool, 3> le(2,3,7);
-  Tensor<bool, 3> gt(2,3,7);
-  Tensor<bool, 3> ge(2,3,7);
+  Tensor<bool, 3> lt(2, 3, 7);
+  Tensor<bool, 3> le(2, 3, 7);
+  Tensor<bool, 3> gt(2, 3, 7);
+  Tensor<bool, 3> ge(2, 3, 7);
 
   Tensor<Scalar, 3> typed_lt(2, 3, 7);
   Tensor<Scalar, 3> typed_le(2, 3, 7);
@@ -54,10 +53,10 @@
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_EQUAL(lt(i,j,k), mat1(i,j,k) < mat2(i,j,k));
-        VERIFY_IS_EQUAL(le(i,j,k), mat1(i,j,k) <= mat2(i,j,k));
-        VERIFY_IS_EQUAL(gt(i,j,k), mat1(i,j,k) > mat2(i,j,k));
-        VERIFY_IS_EQUAL(ge(i,j,k), mat1(i,j,k) >= mat2(i,j,k));
+        VERIFY_IS_EQUAL(lt(i, j, k), mat1(i, j, k) < mat2(i, j, k));
+        VERIFY_IS_EQUAL(le(i, j, k), mat1(i, j, k) <= mat2(i, j, k));
+        VERIFY_IS_EQUAL(gt(i, j, k), mat1(i, j, k) > mat2(i, j, k));
+        VERIFY_IS_EQUAL(ge(i, j, k), mat1(i, j, k) >= mat2(i, j, k));
 
         VERIFY_IS_EQUAL(lt(i, j, k), (bool)typed_lt(i, j, k));
         VERIFY_IS_EQUAL(le(i, j, k), (bool)typed_le(i, j, k));
@@ -68,11 +67,9 @@
   }
 }
 
-
-static void test_equality()
-{
-  Tensor<Scalar, 3> mat1(2,3,7);
-  Tensor<Scalar, 3> mat2(2,3,7);
+static void test_equality() {
+  Tensor<Scalar, 3> mat1(2, 3, 7);
+  Tensor<Scalar, 3> mat2(2, 3, 7);
 
   mat1.setRandom();
   mat2.setRandom();
@@ -80,14 +77,14 @@
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
         if (internal::random<bool>()) {
-          mat2(i,j,k) = mat1(i,j,k);
+          mat2(i, j, k) = mat1(i, j, k);
         }
       }
     }
   }
 
-  Tensor<bool, 3> eq(2,3,7);
-  Tensor<bool, 3> ne(2,3,7);
+  Tensor<bool, 3> eq(2, 3, 7);
+  Tensor<bool, 3> ne(2, 3, 7);
 
   Tensor<Scalar, 3> typed_eq(2, 3, 7);
   Tensor<Scalar, 3> typed_ne(2, 3, 7);
@@ -101,46 +98,41 @@
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_EQUAL(eq(i,j,k), mat1(i,j,k) == mat2(i,j,k));
-        VERIFY_IS_EQUAL(ne(i,j,k), mat1(i,j,k) != mat2(i,j,k));
+        VERIFY_IS_EQUAL(eq(i, j, k), mat1(i, j, k) == mat2(i, j, k));
+        VERIFY_IS_EQUAL(ne(i, j, k), mat1(i, j, k) != mat2(i, j, k));
 
-        VERIFY_IS_EQUAL(eq(i, j, k), (bool)typed_eq(i,j,k));
-        VERIFY_IS_EQUAL(ne(i, j, k), (bool)typed_ne(i,j,k));
+        VERIFY_IS_EQUAL(eq(i, j, k), (bool)typed_eq(i, j, k));
+        VERIFY_IS_EQUAL(ne(i, j, k), (bool)typed_ne(i, j, k));
       }
     }
   }
 }
 
-
-
-static void test_isnan()
-{
-  Tensor<Scalar, 3> mat(2,3,7);
+static void test_isnan() {
+  Tensor<Scalar, 3> mat(2, 3, 7);
 
   mat.setRandom();
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
         if (internal::random<bool>()) {
-          mat(i,j,k) = std::numeric_limits<Scalar>::quiet_NaN();
+          mat(i, j, k) = std::numeric_limits<Scalar>::quiet_NaN();
         }
       }
     }
   }
-  Tensor<bool, 3> nan(2,3,7);
+  Tensor<bool, 3> nan(2, 3, 7);
   nan = (mat.isnan)();
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_EQUAL(nan(i,j,k), (std::isnan)(mat(i,j,k)));
+        VERIFY_IS_EQUAL(nan(i, j, k), (std::isnan)(mat(i, j, k)));
       }
     }
   }
-
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_comparisons)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_comparisons) {
   CALL_SUBTEST(test_orderings());
   CALL_SUBTEST(test_equality());
   CALL_SUBTEST(test_isnan());
diff --git a/unsupported/test/cxx11_tensor_complex_cwise_ops_gpu.cu b/unsupported/test/cxx11_tensor_complex_cwise_ops_gpu.cu
index 99447b2..6daa0a7 100644
--- a/unsupported/test/cxx11_tensor_complex_cwise_ops_gpu.cu
+++ b/unsupported/test/cxx11_tensor_complex_cwise_ops_gpu.cu
@@ -16,7 +16,7 @@
 
 using Eigen::Tensor;
 
-template<typename T>
+template <typename T>
 void test_cuda_complex_cwise_ops() {
   const int kNumItems = 2;
   std::size_t complex_bytes = kNumItems * sizeof(std::complex<T>);
@@ -31,12 +31,9 @@
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
-  Eigen::TensorMap<Eigen::Tensor<std::complex<T>, 1, 0, int>, Eigen::Aligned> gpu_in1(
-      d_in1, kNumItems);
-  Eigen::TensorMap<Eigen::Tensor<std::complex<T>, 1, 0, int>, Eigen::Aligned> gpu_in2(
-      d_in2, kNumItems);
-  Eigen::TensorMap<Eigen::Tensor<std::complex<T>, 1, 0, int>, Eigen::Aligned> gpu_out(
-      d_out, kNumItems);
+  Eigen::TensorMap<Eigen::Tensor<std::complex<T>, 1, 0, int>, Eigen::Aligned> gpu_in1(d_in1, kNumItems);
+  Eigen::TensorMap<Eigen::Tensor<std::complex<T>, 1, 0, int>, Eigen::Aligned> gpu_in2(d_in2, kNumItems);
+  Eigen::TensorMap<Eigen::Tensor<std::complex<T>, 1, 0, int>, Eigen::Aligned> gpu_out(d_out, kNumItems);
 
   const std::complex<T> a(3.14f, 2.7f);
   const std::complex<T> b(-10.6f, 1.4f);
@@ -44,14 +41,7 @@
   gpu_in1.device(gpu_device) = gpu_in1.constant(a);
   gpu_in2.device(gpu_device) = gpu_in2.constant(b);
 
-  enum CwiseOp {
-    Add = 0,
-    Sub,
-    Mul,
-    Div,
-    Neg,
-    NbOps
-  };
+  enum CwiseOp { Add = 0, Sub, Mul, Div, Neg, NbOps };
 
   Tensor<std::complex<T>, 1, 0, int> actual(kNumItems);
   for (int op = Add; op < NbOps; op++) {
@@ -80,8 +70,8 @@
       case NbOps:
         break;
     }
-    assert(cudaMemcpyAsync(actual.data(), d_out, complex_bytes, cudaMemcpyDeviceToHost,
-                           gpu_device.stream()) == cudaSuccess);
+    assert(cudaMemcpyAsync(actual.data(), d_out, complex_bytes, cudaMemcpyDeviceToHost, gpu_device.stream()) ==
+           cudaSuccess);
     assert(cudaStreamSynchronize(gpu_device.stream()) == cudaSuccess);
 
     for (int i = 0; i < kNumItems; ++i) {
@@ -94,9 +84,7 @@
   cudaFree(d_out);
 }
 
-
-EIGEN_DECLARE_TEST(test_cxx11_tensor_complex_cwise_ops)
-{
+EIGEN_DECLARE_TEST(test_cxx11_tensor_complex_cwise_ops) {
   CALL_SUBTEST(test_cuda_complex_cwise_ops<float>());
   CALL_SUBTEST(test_cuda_complex_cwise_ops<double>());
 }
diff --git a/unsupported/test/cxx11_tensor_complex_gpu.cu b/unsupported/test/cxx11_tensor_complex_gpu.cu
index f8b8ae7..12f11e0 100644
--- a/unsupported/test/cxx11_tensor_complex_gpu.cu
+++ b/unsupported/test/cxx11_tensor_complex_gpu.cu
@@ -37,12 +37,9 @@
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
-  Eigen::TensorMap<Eigen::Tensor<std::complex<float>, 1, 0, int>, Eigen::Aligned> gpu_in1(
-      d_in1, 2);
-  Eigen::TensorMap<Eigen::Tensor<std::complex<float>, 1, 0, int>, Eigen::Aligned> gpu_in2(
-      d_in2, 2);
-  Eigen::TensorMap<Eigen::Tensor<float, 1, 0, int>, Eigen::Aligned> gpu_out2(
-      d_out2, 2);
+  Eigen::TensorMap<Eigen::Tensor<std::complex<float>, 1, 0, int>, Eigen::Aligned> gpu_in1(d_in1, 2);
+  Eigen::TensorMap<Eigen::Tensor<std::complex<float>, 1, 0, int>, Eigen::Aligned> gpu_in2(d_in2, 2);
+  Eigen::TensorMap<Eigen::Tensor<float, 1, 0, int>, Eigen::Aligned> gpu_out2(d_out2, 2);
 
   gpu_in1.device(gpu_device) = gpu_in1.constant(std::complex<float>(3.14f, 2.7f));
   gpu_out2.device(gpu_device) = gpu_in2.abs();
@@ -50,10 +47,9 @@
   Tensor<std::complex<float>, 1, 0, int> new1(2);
   Tensor<float, 1, 0, int> new2(2);
 
-  assert(cudaMemcpyAsync(new1.data(), d_in1, complex_bytes, cudaMemcpyDeviceToHost,
-                         gpu_device.stream()) == cudaSuccess);
-  assert(cudaMemcpyAsync(new2.data(), d_out2, float_bytes, cudaMemcpyDeviceToHost,
-                         gpu_device.stream()) == cudaSuccess);
+  assert(cudaMemcpyAsync(new1.data(), d_in1, complex_bytes, cudaMemcpyDeviceToHost, gpu_device.stream()) ==
+         cudaSuccess);
+  assert(cudaMemcpyAsync(new2.data(), d_out2, float_bytes, cudaMemcpyDeviceToHost, gpu_device.stream()) == cudaSuccess);
 
   assert(cudaStreamSynchronize(gpu_device.stream()) == cudaSuccess);
 
@@ -67,14 +63,12 @@
   cudaFree(d_out2);
 }
 
-
 static void test_cuda_sum_reductions() {
-
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
-  const int num_rows = internal::random<int>(1024, 5*1024);
-  const int num_cols = internal::random<int>(1024, 5*1024);
+  const int num_rows = internal::random<int>(1024, 5 * 1024);
+  const int num_cols = internal::random<int>(1024, 5 * 1024);
 
   Tensor<std::complex<float>, 2> in(num_rows, num_cols);
   in.setRandom();
@@ -105,12 +99,11 @@
 }
 
 static void test_cuda_mean_reductions() {
-
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
-  const int num_rows = internal::random<int>(1024, 5*1024);
-  const int num_cols = internal::random<int>(1024, 5*1024);
+  const int num_rows = internal::random<int>(1024, 5 * 1024);
+  const int num_cols = internal::random<int>(1024, 5 * 1024);
 
   Tensor<std::complex<float>, 2> in(num_rows, num_cols);
   in.setRandom();
@@ -141,12 +134,11 @@
 }
 
 static void test_cuda_product_reductions() {
-
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
-  const int num_rows = internal::random<int>(1024, 5*1024);
-  const int num_cols = internal::random<int>(1024, 5*1024);
+  const int num_rows = internal::random<int>(1024, 5 * 1024);
+  const int num_cols = internal::random<int>(1024, 5 * 1024);
 
   Tensor<std::complex<float>, 2> in(num_rows, num_cols);
   in.setRandom();
@@ -176,9 +168,7 @@
   gpu_device.deallocate(gpu_out_ptr);
 }
 
-
-EIGEN_DECLARE_TEST(test_cxx11_tensor_complex)
-{
+EIGEN_DECLARE_TEST(test_cxx11_tensor_complex) {
   CALL_SUBTEST(test_cuda_nullary());
   CALL_SUBTEST(test_cuda_sum_reductions());
   CALL_SUBTEST(test_cuda_mean_reductions());
diff --git a/unsupported/test/cxx11_tensor_concatenation.cpp b/unsupported/test/cxx11_tensor_concatenation.cpp
index bb9418d..ce78892 100644
--- a/unsupported/test/cxx11_tensor_concatenation.cpp
+++ b/unsupported/test/cxx11_tensor_concatenation.cpp
@@ -13,9 +13,8 @@
 
 using Eigen::Tensor;
 
-template<int DataLayout>
-static void test_dimension_failures()
-{
+template <int DataLayout>
+static void test_dimension_failures() {
   Tensor<int, 3, DataLayout> left(2, 3, 1);
   Tensor<int, 3, DataLayout> right(3, 3, 1);
   left.setRandom();
@@ -33,9 +32,8 @@
   VERIFY_RAISES_ASSERT(concatenation = left.concatenate(right, -1));
 }
 
-template<int DataLayout>
-static void test_static_dimension_failure()
-{
+template <int DataLayout>
+static void test_static_dimension_failure() {
   Tensor<int, 2, DataLayout> left(2, 3);
   Tensor<int, 3, DataLayout> right(2, 3, 1);
 
@@ -46,22 +44,18 @@
 #endif
 
   // This can be worked around in this case.
-  Tensor<int, 3, DataLayout> concatenation = left
-      .reshape(Tensor<int, 3>::Dimensions(2, 3, 1))
-      .concatenate(right, 0);
+  Tensor<int, 3, DataLayout> concatenation = left.reshape(Tensor<int, 3>::Dimensions(2, 3, 1)).concatenate(right, 0);
   Tensor<int, 2, DataLayout> alternative = left
-   // Clang compiler break with {{{}}} with an ambiguous error on copy constructor
-  // the variadic DSize constructor added for #ifndef EIGEN_EMULATE_CXX11_META_H.
-  // Solution:
-  // either the code should change to 
-  //  Tensor<int, 2>::Dimensions{{2, 3}}
-  // or Tensor<int, 2>::Dimensions{Tensor<int, 2>::Dimensions{{2, 3}}}
-      .concatenate(right.reshape(Tensor<int, 2>::Dimensions(2, 3)), 0);
+                                               // Clang compiler break with {{{}}} with an ambiguous error on copy
+                                               // constructor the variadic DSize constructor added for #ifndef
+                                               // EIGEN_EMULATE_CXX11_META_H. Solution: either the code should change to
+                                               //  Tensor<int, 2>::Dimensions{{2, 3}}
+                                               // or Tensor<int, 2>::Dimensions{Tensor<int, 2>::Dimensions{{2, 3}}}
+                                               .concatenate(right.reshape(Tensor<int, 2>::Dimensions(2, 3)), 0);
 }
 
-template<int DataLayout>
-static void test_simple_concatenation()
-{
+template <int DataLayout>
+static void test_simple_concatenation() {
   Tensor<int, 3, DataLayout> left(2, 3, 1);
   Tensor<int, 3, DataLayout> right(2, 3, 1);
   left.setRandom();
@@ -105,12 +99,10 @@
   }
 }
 
-
 // TODO(phli): Add test once we have a real vectorized implementation.
 // static void test_vectorized_concatenation() {}
 
-static void test_concatenation_as_lvalue()
-{
+static void test_concatenation_as_lvalue() {
   Tensor<int, 2> t1(2, 3);
   Tensor<int, 2> t2(2, 3);
   t1.setRandom();
@@ -123,21 +115,18 @@
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       VERIFY_IS_EQUAL(t1(i, j), result(i, j));
-      VERIFY_IS_EQUAL(t2(i, j), result(i+2, j));
+      VERIFY_IS_EQUAL(t2(i, j), result(i + 2, j));
     }
   }
 }
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_concatenation)
-{
-   CALL_SUBTEST(test_dimension_failures<ColMajor>());
-   CALL_SUBTEST(test_dimension_failures<RowMajor>());
-   CALL_SUBTEST(test_static_dimension_failure<ColMajor>());
-   CALL_SUBTEST(test_static_dimension_failure<RowMajor>());
-   CALL_SUBTEST(test_simple_concatenation<ColMajor>());
-   CALL_SUBTEST(test_simple_concatenation<RowMajor>());
-   // CALL_SUBTEST(test_vectorized_concatenation());
-   CALL_SUBTEST(test_concatenation_as_lvalue());
-
+EIGEN_DECLARE_TEST(cxx11_tensor_concatenation) {
+  CALL_SUBTEST(test_dimension_failures<ColMajor>());
+  CALL_SUBTEST(test_dimension_failures<RowMajor>());
+  CALL_SUBTEST(test_static_dimension_failure<ColMajor>());
+  CALL_SUBTEST(test_static_dimension_failure<RowMajor>());
+  CALL_SUBTEST(test_simple_concatenation<ColMajor>());
+  CALL_SUBTEST(test_simple_concatenation<RowMajor>());
+  // CALL_SUBTEST(test_vectorized_concatenation());
+  CALL_SUBTEST(test_concatenation_as_lvalue());
 }
diff --git a/unsupported/test/cxx11_tensor_concatenation_sycl.cpp b/unsupported/test/cxx11_tensor_concatenation_sycl.cpp
index 18dc95b..fccf165 100644
--- a/unsupported/test/cxx11_tensor_concatenation_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_concatenation_sycl.cpp
@@ -22,9 +22,8 @@
 
 using Eigen::Tensor;
 
-template<typename DataType, int DataLayout, typename IndexType>
-static void test_simple_concatenation(const Eigen::SyclDevice& sycl_device)
-{
+template <typename DataType, int DataLayout, typename IndexType>
+static void test_simple_concatenation(const Eigen::SyclDevice& sycl_device) {
   IndexType leftDim1 = 2;
   IndexType leftDim2 = 3;
   IndexType leftDim3 = 1;
@@ -34,31 +33,36 @@
   IndexType rightDim3 = 1;
   Eigen::array<IndexType, 3> rightRange = {{rightDim1, rightDim2, rightDim3}};
 
-  //IndexType concatDim1 = 3;
-//	IndexType concatDim2 = 3;
-//	IndexType concatDim3 = 1;
-  //Eigen::array<IndexType, 3> concatRange = {{concatDim1, concatDim2, concatDim3}};
+  // IndexType concatDim1 = 3;
+  //	IndexType concatDim2 = 3;
+  //	IndexType concatDim3 = 1;
+  // Eigen::array<IndexType, 3> concatRange = {{concatDim1, concatDim2, concatDim3}};
 
   Tensor<DataType, 3, DataLayout, IndexType> left(leftRange);
   Tensor<DataType, 3, DataLayout, IndexType> right(rightRange);
   left.setRandom();
   right.setRandom();
 
-  DataType * gpu_in1_data  = static_cast<DataType*>(sycl_device.allocate(left.dimensions().TotalSize()*sizeof(DataType)));
-  DataType * gpu_in2_data  = static_cast<DataType*>(sycl_device.allocate(right.dimensions().TotalSize()*sizeof(DataType)));
+  DataType* gpu_in1_data =
+      static_cast<DataType*>(sycl_device.allocate(left.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_in2_data =
+      static_cast<DataType*>(sycl_device.allocate(right.dimensions().TotalSize() * sizeof(DataType)));
 
   Eigen::TensorMap<Eigen::Tensor<DataType, 3, DataLayout, IndexType>> gpu_in1(gpu_in1_data, leftRange);
   Eigen::TensorMap<Eigen::Tensor<DataType, 3, DataLayout, IndexType>> gpu_in2(gpu_in2_data, rightRange);
-  sycl_device.memcpyHostToDevice(gpu_in1_data, left.data(),(left.dimensions().TotalSize())*sizeof(DataType));
-  sycl_device.memcpyHostToDevice(gpu_in2_data, right.data(),(right.dimensions().TotalSize())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in1_data, left.data(), (left.dimensions().TotalSize()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in2_data, right.data(), (right.dimensions().TotalSize()) * sizeof(DataType));
   ///
-  Tensor<DataType, 3, DataLayout, IndexType> concatenation1(leftDim1+rightDim1, leftDim2, leftDim3);
-  DataType * gpu_out_data1 =  static_cast<DataType*>(sycl_device.allocate(concatenation1.dimensions().TotalSize()*sizeof(DataType)));
-  Eigen::TensorMap<Eigen::Tensor<DataType, 3, DataLayout, IndexType>> gpu_out1(gpu_out_data1, concatenation1.dimensions());
+  Tensor<DataType, 3, DataLayout, IndexType> concatenation1(leftDim1 + rightDim1, leftDim2, leftDim3);
+  DataType* gpu_out_data1 =
+      static_cast<DataType*>(sycl_device.allocate(concatenation1.dimensions().TotalSize() * sizeof(DataType)));
+  Eigen::TensorMap<Eigen::Tensor<DataType, 3, DataLayout, IndexType>> gpu_out1(gpu_out_data1,
+                                                                               concatenation1.dimensions());
 
-  //concatenation = left.concatenate(right, 0);
-  gpu_out1.device(sycl_device) =gpu_in1.concatenate(gpu_in2, 0);
-  sycl_device.memcpyDeviceToHost(concatenation1.data(), gpu_out_data1,(concatenation1.dimensions().TotalSize())*sizeof(DataType));
+  // concatenation = left.concatenate(right, 0);
+  gpu_out1.device(sycl_device) = gpu_in1.concatenate(gpu_in2, 0);
+  sycl_device.memcpyDeviceToHost(concatenation1.data(), gpu_out_data1,
+                                 (concatenation1.dimensions().TotalSize()) * sizeof(DataType));
 
   VERIFY_IS_EQUAL(concatenation1.dimension(0), 4);
   VERIFY_IS_EQUAL(concatenation1.dimension(1), 3);
@@ -73,13 +77,16 @@
   }
 
   sycl_device.deallocate(gpu_out_data1);
-  Tensor<DataType, 3, DataLayout, IndexType> concatenation2(leftDim1, leftDim2 +rightDim2, leftDim3);
-  DataType * gpu_out_data2 =  static_cast<DataType*>(sycl_device.allocate(concatenation2.dimensions().TotalSize()*sizeof(DataType)));
-  Eigen::TensorMap<Eigen::Tensor<DataType, 3, DataLayout, IndexType>> gpu_out2(gpu_out_data2, concatenation2.dimensions());
-  gpu_out2.device(sycl_device) =gpu_in1.concatenate(gpu_in2, 1);
-  sycl_device.memcpyDeviceToHost(concatenation2.data(), gpu_out_data2,(concatenation2.dimensions().TotalSize())*sizeof(DataType));
+  Tensor<DataType, 3, DataLayout, IndexType> concatenation2(leftDim1, leftDim2 + rightDim2, leftDim3);
+  DataType* gpu_out_data2 =
+      static_cast<DataType*>(sycl_device.allocate(concatenation2.dimensions().TotalSize() * sizeof(DataType)));
+  Eigen::TensorMap<Eigen::Tensor<DataType, 3, DataLayout, IndexType>> gpu_out2(gpu_out_data2,
+                                                                               concatenation2.dimensions());
+  gpu_out2.device(sycl_device) = gpu_in1.concatenate(gpu_in2, 1);
+  sycl_device.memcpyDeviceToHost(concatenation2.data(), gpu_out_data2,
+                                 (concatenation2.dimensions().TotalSize()) * sizeof(DataType));
 
-  //concatenation = left.concatenate(right, 1);
+  // concatenation = left.concatenate(right, 1);
   VERIFY_IS_EQUAL(concatenation2.dimension(0), 2);
   VERIFY_IS_EQUAL(concatenation2.dimension(1), 6);
   VERIFY_IS_EQUAL(concatenation2.dimension(2), 1);
@@ -92,13 +99,16 @@
     }
   }
   sycl_device.deallocate(gpu_out_data2);
-  Tensor<DataType, 3, DataLayout, IndexType> concatenation3(leftDim1, leftDim2, leftDim3+rightDim3);
-  DataType * gpu_out_data3 =  static_cast<DataType*>(sycl_device.allocate(concatenation3.dimensions().TotalSize()*sizeof(DataType)));
-  Eigen::TensorMap<Eigen::Tensor<DataType, 3, DataLayout, IndexType>> gpu_out3(gpu_out_data3, concatenation3.dimensions());
-  gpu_out3.device(sycl_device) =gpu_in1.concatenate(gpu_in2, 2);
-  sycl_device.memcpyDeviceToHost(concatenation3.data(), gpu_out_data3,(concatenation3.dimensions().TotalSize())*sizeof(DataType));
+  Tensor<DataType, 3, DataLayout, IndexType> concatenation3(leftDim1, leftDim2, leftDim3 + rightDim3);
+  DataType* gpu_out_data3 =
+      static_cast<DataType*>(sycl_device.allocate(concatenation3.dimensions().TotalSize() * sizeof(DataType)));
+  Eigen::TensorMap<Eigen::Tensor<DataType, 3, DataLayout, IndexType>> gpu_out3(gpu_out_data3,
+                                                                               concatenation3.dimensions());
+  gpu_out3.device(sycl_device) = gpu_in1.concatenate(gpu_in2, 2);
+  sycl_device.memcpyDeviceToHost(concatenation3.data(), gpu_out_data3,
+                                 (concatenation3.dimensions().TotalSize()) * sizeof(DataType));
 
-  //concatenation = left.concatenate(right, 2);
+  // concatenation = left.concatenate(right, 2);
   VERIFY_IS_EQUAL(concatenation3.dimension(0), 2);
   VERIFY_IS_EQUAL(concatenation3.dimension(1), 3);
   VERIFY_IS_EQUAL(concatenation3.dimension(2), 2);
@@ -112,10 +122,8 @@
   sycl_device.deallocate(gpu_in1_data);
   sycl_device.deallocate(gpu_in2_data);
 }
-template<typename DataType, int DataLayout, typename IndexType>
-static void test_concatenation_as_lvalue(const Eigen::SyclDevice& sycl_device)
-{
-
+template <typename DataType, int DataLayout, typename IndexType>
+static void test_concatenation_as_lvalue(const Eigen::SyclDevice& sycl_device) {
   IndexType leftDim1 = 2;
   IndexType leftDim2 = 3;
   Eigen::array<IndexType, 2> leftRange = {{leftDim1, leftDim2}};
@@ -136,28 +144,30 @@
   right.setRandom();
   result.setRandom();
 
-  DataType * gpu_in1_data  = static_cast<DataType*>(sycl_device.allocate(left.dimensions().TotalSize()*sizeof(DataType)));
-  DataType * gpu_in2_data  = static_cast<DataType*>(sycl_device.allocate(right.dimensions().TotalSize()*sizeof(DataType)));
-  DataType * gpu_out_data =  static_cast<DataType*>(sycl_device.allocate(result.dimensions().TotalSize()*sizeof(DataType)));
-
+  DataType* gpu_in1_data =
+      static_cast<DataType*>(sycl_device.allocate(left.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_in2_data =
+      static_cast<DataType*>(sycl_device.allocate(right.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_out_data =
+      static_cast<DataType*>(sycl_device.allocate(result.dimensions().TotalSize() * sizeof(DataType)));
 
   Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>> gpu_in1(gpu_in1_data, leftRange);
   Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>> gpu_in2(gpu_in2_data, rightRange);
   Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>> gpu_out(gpu_out_data, resRange);
 
-  sycl_device.memcpyHostToDevice(gpu_in1_data, left.data(),(left.dimensions().TotalSize())*sizeof(DataType));
-  sycl_device.memcpyHostToDevice(gpu_in2_data, right.data(),(right.dimensions().TotalSize())*sizeof(DataType));
-  sycl_device.memcpyHostToDevice(gpu_out_data, result.data(),(result.dimensions().TotalSize())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in1_data, left.data(), (left.dimensions().TotalSize()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in2_data, right.data(), (right.dimensions().TotalSize()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_out_data, result.data(), (result.dimensions().TotalSize()) * sizeof(DataType));
 
-//  t1.concatenate(t2, 0) = result;
- gpu_in1.concatenate(gpu_in2, 0).device(sycl_device) =gpu_out;
- sycl_device.memcpyDeviceToHost(left.data(), gpu_in1_data,(left.dimensions().TotalSize())*sizeof(DataType));
- sycl_device.memcpyDeviceToHost(right.data(), gpu_in2_data,(right.dimensions().TotalSize())*sizeof(DataType));
+  //  t1.concatenate(t2, 0) = result;
+  gpu_in1.concatenate(gpu_in2, 0).device(sycl_device) = gpu_out;
+  sycl_device.memcpyDeviceToHost(left.data(), gpu_in1_data, (left.dimensions().TotalSize()) * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(right.data(), gpu_in2_data, (right.dimensions().TotalSize()) * sizeof(DataType));
 
   for (IndexType i = 0; i < 2; ++i) {
     for (IndexType j = 0; j < 3; ++j) {
       VERIFY_IS_EQUAL(left(i, j), result(i, j));
-      VERIFY_IS_EQUAL(right(i, j), result(i+2, j));
+      VERIFY_IS_EQUAL(right(i, j), result(i + 2, j));
     }
   }
   sycl_device.deallocate(gpu_in1_data);
@@ -165,8 +175,8 @@
   sycl_device.deallocate(gpu_out_data);
 }
 
-
-template <typename DataType, typename Dev_selector> void tensorConcat_perDevice(Dev_selector s){
+template <typename DataType, typename Dev_selector>
+void tensorConcat_perDevice(Dev_selector s) {
   QueueInterface queueInterface(s);
   auto sycl_device = Eigen::SyclDevice(&queueInterface);
   test_simple_concatenation<DataType, RowMajor, int64_t>(sycl_device);
@@ -174,7 +184,7 @@
   test_concatenation_as_lvalue<DataType, ColMajor, int64_t>(sycl_device);
 }
 EIGEN_DECLARE_TEST(cxx11_tensor_concatenation_sycl) {
-  for (const auto& device :Eigen::get_sycl_supported_devices()) {
+  for (const auto& device : Eigen::get_sycl_supported_devices()) {
     CALL_SUBTEST(tensorConcat_perDevice<half>(device));
     CALL_SUBTEST(tensorConcat_perDevice<float>(device));
   }
diff --git a/unsupported/test/cxx11_tensor_const.cpp b/unsupported/test/cxx11_tensor_const.cpp
index 9d806ee..78a6506 100644
--- a/unsupported/test/cxx11_tensor_const.cpp
+++ b/unsupported/test/cxx11_tensor_const.cpp
@@ -12,29 +12,25 @@
 #include <Eigen/CXX11/Tensor>
 using Eigen::Tensor;
 
-
-static void test_simple_assign()
-{
-  Tensor<int, 3> random(2,3,7);
+static void test_simple_assign() {
+  Tensor<int, 3> random(2, 3, 7);
   random.setRandom();
 
   TensorMap<Tensor<const int, 3> > constant(random.data(), 2, 3, 7);
-  Tensor<int, 3> result(2,3,7);
+  Tensor<int, 3> result(2, 3, 7);
   result = constant;
 
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_EQUAL((result(i,j,k)), random(i,j,k));
+        VERIFY_IS_EQUAL((result(i, j, k)), random(i, j, k));
       }
     }
   }
 }
 
-
-static void test_assign_of_const_tensor()
-{
-  Tensor<int, 3> random(2,3,7);
+static void test_assign_of_const_tensor() {
+  Tensor<int, 3> random(2, 3, 7);
   random.setRandom();
 
   TensorMap<Tensor<const int, 3> > constant1(random.data(), 2, 3, 7);
@@ -47,16 +43,14 @@
 
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
-      VERIFY_IS_EQUAL((result1(i,j)), random(i,j,0));
-      VERIFY_IS_EQUAL((result2(i,j)), random(i,j,0));
-      VERIFY_IS_EQUAL((result3(i,j)), random(i,j,0));
+      VERIFY_IS_EQUAL((result1(i, j)), random(i, j, 0));
+      VERIFY_IS_EQUAL((result2(i, j)), random(i, j, 0));
+      VERIFY_IS_EQUAL((result3(i, j)), random(i, j, 0));
     }
   }
 }
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_const)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_const) {
   CALL_SUBTEST(test_simple_assign());
   CALL_SUBTEST(test_assign_of_const_tensor());
 }
diff --git a/unsupported/test/cxx11_tensor_contract_gpu.cu b/unsupported/test/cxx11_tensor_contract_gpu.cu
index 5abf213..7088d6f 100644
--- a/unsupported/test/cxx11_tensor_contract_gpu.cu
+++ b/unsupported/test/cxx11_tensor_contract_gpu.cu
@@ -22,9 +22,8 @@
 using Eigen::Tensor;
 typedef Tensor<float, 1>::DimensionPair DimPair;
 
-template<int DataLayout>
-void test_gpu_contraction(int m_size, int k_size, int n_size)
-{
+template <int DataLayout>
+void test_gpu_contraction(int m_size, int k_size, int n_size) {
   Tensor<float, 2, DataLayout> t_left(m_size, k_size);
   Tensor<float, 2, DataLayout> t_right(k_size, n_size);
   Tensor<float, 2, DataLayout> t_result(m_size, n_size);
@@ -34,7 +33,7 @@
   t_left.setRandom();
   t_right.setRandom();
 
-  std::size_t t_left_bytes = t_left.size()  * sizeof(float);
+  std::size_t t_left_bytes = t_left.size() * sizeof(float);
   std::size_t t_right_bytes = t_right.size() * sizeof(float);
   std::size_t t_result_bytes = t_result.size() * sizeof(float);
 
@@ -52,13 +51,9 @@
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
-  Eigen::TensorMap<Eigen::Tensor<float, 2, DataLayout> >
-      gpu_t_left(d_t_left, Eigen::array<int, 2>(m_size, k_size));
-  Eigen::TensorMap<Eigen::Tensor<float, 2, DataLayout> >
-      gpu_t_right(d_t_right, Eigen::array<int, 2>(k_size, n_size));
-  Eigen::TensorMap<Eigen::Tensor<float, 2, DataLayout> >
-      gpu_t_result(d_t_result, Eigen::array<int, 2>(m_size, n_size));
-
+  Eigen::TensorMap<Eigen::Tensor<float, 2, DataLayout> > gpu_t_left(d_t_left, Eigen::array<int, 2>(m_size, k_size));
+  Eigen::TensorMap<Eigen::Tensor<float, 2, DataLayout> > gpu_t_right(d_t_right, Eigen::array<int, 2>(k_size, n_size));
+  Eigen::TensorMap<Eigen::Tensor<float, 2, DataLayout> > gpu_t_result(d_t_result, Eigen::array<int, 2>(m_size, n_size));
 
   gpu_t_result.device(gpu_device) = gpu_t_left.contract(gpu_t_right, dims);
   t_result = t_left.contract(t_right, dims);
@@ -71,8 +66,7 @@
     if (Eigen::internal::isApprox(t_result(i), t_result_gpu(i), 1e-4f)) {
       continue;
     }
-    std::cout << "mismatch detected at index " << i << ": " << t_result(i)
-              << " vs " <<  t_result_gpu(i) << std::endl;
+    std::cout << "mismatch detected at index " << i << ": " << t_result(i) << " vs " << t_result_gpu(i) << std::endl;
     assert(false);
   }
 
@@ -81,10 +75,8 @@
   gpuFree((void*)d_t_result);
 }
 
-
-template<int DataLayout>
-void test_scalar(int m_size, int k_size, int n_size)
-{
+template <int DataLayout>
+void test_scalar(int m_size, int k_size, int n_size) {
   std::cout << "Testing for (" << m_size << "," << k_size << "," << n_size << ")" << std::endl;
   // with these dimensions, the output has 300 * 140 elements, which is
   // more than 30 * 1024, which is the number of threads in blocks on
@@ -98,7 +90,7 @@
   t_left.setRandom();
   t_right.setRandom();
 
-  std::size_t t_left_bytes = t_left.size()  * sizeof(float);
+  std::size_t t_left_bytes = t_left.size() * sizeof(float);
   std::size_t t_right_bytes = t_right.size() * sizeof(float);
   std::size_t t_result_bytes = sizeof(float);
 
@@ -116,21 +108,16 @@
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
-  Eigen::TensorMap<Eigen::Tensor<float, 2, DataLayout> >
-      gpu_t_left(d_t_left, m_size, k_size);
-  Eigen::TensorMap<Eigen::Tensor<float, 2, DataLayout> >
-      gpu_t_right(d_t_right, k_size, n_size);
-  Eigen::TensorMap<Eigen::Tensor<float, 0, DataLayout> >
-      gpu_t_result(d_t_result);
+  Eigen::TensorMap<Eigen::Tensor<float, 2, DataLayout> > gpu_t_left(d_t_left, m_size, k_size);
+  Eigen::TensorMap<Eigen::Tensor<float, 2, DataLayout> > gpu_t_right(d_t_right, k_size, n_size);
+  Eigen::TensorMap<Eigen::Tensor<float, 0, DataLayout> > gpu_t_result(d_t_result);
 
   gpu_t_result.device(gpu_device) = gpu_t_left.contract(gpu_t_right, dims);
   t_result = t_left.contract(t_right, dims);
 
   gpuMemcpy(t_result_gpu.data(), d_t_result, t_result_bytes, gpuMemcpyDeviceToHost);
-  if (fabs(t_result() - t_result_gpu()) > 1e-4f &&
-      !Eigen::internal::isApprox(t_result(), t_result_gpu(), 1e-4f)) {
-    std::cout << "mismatch detected: " << t_result()
-              << " vs " <<  t_result_gpu() << std::endl;
+  if (fabs(t_result() - t_result_gpu()) > 1e-4f && !Eigen::internal::isApprox(t_result(), t_result_gpu(), 1e-4f)) {
+    std::cout << "mismatch detected: " << t_result() << " vs " << t_result_gpu() << std::endl;
     assert(false);
   }
 
@@ -139,8 +126,7 @@
   gpuFree((void*)d_t_result);
 }
 
-
-template<int DataLayout>
+template <int DataLayout>
 void test_gpu_contraction_m() {
   for (int k = 32; k < 256; k++) {
     test_gpu_contraction<ColMajor>(k, 128, 128);
@@ -148,7 +134,7 @@
   }
 }
 
-template<int DataLayout>
+template <int DataLayout>
 void test_gpu_contraction_k() {
   for (int k = 32; k < 256; k++) {
     test_gpu_contraction<ColMajor>(128, k, 128);
@@ -156,7 +142,7 @@
   }
 }
 
-template<int DataLayout>
+template <int DataLayout>
 void test_gpu_contraction_n() {
   for (int k = 32; k < 256; k++) {
     test_gpu_contraction<ColMajor>(128, 128, k);
@@ -164,20 +150,13 @@
   }
 }
 
-
-template<int DataLayout>
+template <int DataLayout>
 void test_gpu_contraction_sizes() {
-  int m_sizes[3][5] = {{ 31,  39,   63,   64,   65},
-                       {127, 129,  255,  257 , 511},
-                       {512, 513, 1023, 1024, 1025}};
+  int m_sizes[3][5] = {{31, 39, 63, 64, 65}, {127, 129, 255, 257, 511}, {512, 513, 1023, 1024, 1025}};
 
-  int n_sizes[3][5] = {{ 31,  39,   63,   64,   65},
-                       {127, 129,  255,  257,  511},
-                       {512, 513, 1023, 1024, 1025}};
+  int n_sizes[3][5] = {{31, 39, 63, 64, 65}, {127, 129, 255, 257, 511}, {512, 513, 1023, 1024, 1025}};
 
-  int k_sizes[3][6] = {{ 31,   39,  63,  64,   65,   95},
-                       { 96, 127, 129,  255,  257,  511},
-                       {512, 513, 725, 1023, 1024, 1025}};
+  int k_sizes[3][6] = {{31, 39, 63, 64, 65, 95}, {96, 127, 129, 255, 257, 511}, {512, 513, 725, 1023, 1024, 1025}};
 
   // Some selection of specific cases.
   //  - m changes rows each iteration
@@ -209,8 +188,7 @@
   }
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_contract_gpu)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_contract_gpu) {
   CALL_SUBTEST_1(test_gpu_contraction<ColMajor>(128, 128, 128));
   CALL_SUBTEST_1(test_gpu_contraction<RowMajor>(128, 128, 128));
 
@@ -227,8 +205,8 @@
   CALL_SUBTEST_7(test_gpu_contraction_n<RowMajor>());
 
 #if !defined(EIGEN_USE_HIP)
-// disable these subtests for HIP
+  // disable these subtests for HIP
   CALL_SUBTEST_8(test_gpu_contraction_sizes<ColMajor>());
   CALL_SUBTEST_9(test_gpu_contraction_sizes<RowMajor>());
-#endif	
+#endif
 }
diff --git a/unsupported/test/cxx11_tensor_contract_sycl.cpp b/unsupported/test/cxx11_tensor_contract_sycl.cpp
index fbcc293..120681b 100644
--- a/unsupported/test/cxx11_tensor_contract_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_contract_sycl.cpp
@@ -31,12 +31,9 @@
 using Eigen::Tensor;
 using Eigen::TensorMap;
 
-template <int DataLayout, typename DataType, typename IndexType,
-          typename Device>
-void static test_sycl_contraction(const Device &sycl_device, IndexType m_size,
-                                  IndexType k_size, IndexType n_size) {
-  typedef typename Tensor<DataType, 1, DataLayout, IndexType>::DimensionPair
-      DimPair;
+template <int DataLayout, typename DataType, typename IndexType, typename Device>
+void static test_sycl_contraction(const Device &sycl_device, IndexType m_size, IndexType k_size, IndexType n_size) {
+  typedef typename Tensor<DataType, 1, DataLayout, IndexType>::DimensionPair DimPair;
   static const DataType error_threshold = DataType(1e-4);
   // with these dimensions, the output has 300 * 140 elements, which is
   // more than 30 * 1024, which is the number of threads in blocks on
@@ -57,42 +54,32 @@
   std::size_t t_right_bytes = t_right.size() * sizeof(DataType);
   std::size_t t_result_bytes = t_result.size() * sizeof(DataType);
 
-  DataType *d_t_left =
-      static_cast<DataType *>(sycl_device.allocate(t_left_bytes));
-  DataType *d_t_right =
-      static_cast<DataType *>(sycl_device.allocate(t_right_bytes));
-  DataType *d_t_result =
-      static_cast<DataType *>(sycl_device.allocate(t_result_bytes));
+  DataType *d_t_left = static_cast<DataType *>(sycl_device.allocate(t_left_bytes));
+  DataType *d_t_right = static_cast<DataType *>(sycl_device.allocate(t_right_bytes));
+  DataType *d_t_result = static_cast<DataType *>(sycl_device.allocate(t_result_bytes));
 
-  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>>
-      gpu_t_left(d_t_left, left_dims);
-  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>>
-      gpu_t_right(d_t_right, right_dims);
-  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>>
-      gpu_t_result(d_t_result, result_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>> gpu_t_left(d_t_left, left_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>> gpu_t_right(d_t_right, right_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>> gpu_t_result(d_t_result, result_dims);
 
   sycl_device.memcpyHostToDevice(d_t_left, t_left.data(), t_left_bytes);
   sycl_device.memcpyHostToDevice(d_t_right, t_right.data(), t_right_bytes);
 
   gpu_t_result.device(sycl_device) = gpu_t_left.contract(gpu_t_right, dims);
-  sycl_device.memcpyDeviceToHost(t_result_gpu.data(), d_t_result,
-                                 t_result_bytes);
+  sycl_device.memcpyDeviceToHost(t_result_gpu.data(), d_t_result, t_result_bytes);
 
   t_result = t_left.contract(t_right, dims);
 
   for (IndexType i = 0; i < t_result.size(); i++) {
-    if (static_cast<DataType>(std::fabs(static_cast<DataType>(
-            t_result(i) - t_result_gpu(i)))) < error_threshold) {
+    if (static_cast<DataType>(std::fabs(static_cast<DataType>(t_result(i) - t_result_gpu(i)))) < error_threshold) {
       continue;
     }
-    if (Eigen::internal::isApprox(t_result(i), t_result_gpu(i),
-                                  error_threshold)) {
+    if (Eigen::internal::isApprox(t_result(i), t_result_gpu(i), error_threshold)) {
       continue;
     }
 
-    std::cout << "M : " << m_size << ", N : " << n_size << ", K : " << k_size
-              << ", mismatch detected at IndexType " << i << ": " << t_result(i)
-              << " vs " << t_result_gpu(i) << std::endl;
+    std::cout << "M : " << m_size << ", N : " << n_size << ", K : " << k_size << ", mismatch detected at IndexType "
+              << i << ": " << t_result(i) << " vs " << t_result_gpu(i) << std::endl;
     VERIFY_IS_APPROX(t_result_gpu(i), t_result(i));
   }
   sycl_device.deallocate(d_t_left);
@@ -100,61 +87,47 @@
   sycl_device.deallocate(d_t_result);
 }
 
-template <int DataLayout, typename DataType, typename IndexType,
-          typename Device>
+template <int DataLayout, typename DataType, typename IndexType, typename Device>
 void test_sycl_contraction_m(const Device &sycl_device) {
   for (IndexType k = 32; k < 256; k++) {
-    test_sycl_contraction<DataLayout, DataType, IndexType>(sycl_device, k, 128,
-                                                           128);
+    test_sycl_contraction<DataLayout, DataType, IndexType>(sycl_device, k, 128, 128);
   }
 }
 
-template <int DataLayout, typename DataType, typename IndexType,
-          typename Device>
+template <int DataLayout, typename DataType, typename IndexType, typename Device>
 void test_sycl_contraction_k(const Device &sycl_device) {
   for (IndexType k = 32; k < 256; k++) {
-    test_sycl_contraction<DataLayout, DataType, IndexType>(sycl_device, 128, k,
-                                                           128);
+    test_sycl_contraction<DataLayout, DataType, IndexType>(sycl_device, 128, k, 128);
   }
 }
 
-template <int DataLayout, typename DataType, typename IndexType,
-          typename Device>
+template <int DataLayout, typename DataType, typename IndexType, typename Device>
 void test_sycl_contraction_n(const Device &sycl_device) {
   for (IndexType k = 32; k < 256; k++) {
-    test_sycl_contraction<DataLayout, DataType, IndexType>(sycl_device, 128,
-                                                           128, k);
+    test_sycl_contraction<DataLayout, DataType, IndexType>(sycl_device, 128, 128, k);
   }
 }
 
-template <int DataLayout, typename DataType, typename IndexType,
-          typename Device>
+template <int DataLayout, typename DataType, typename IndexType, typename Device>
 void test_sycl_contraction_sizes(const Device &sycl_device) {
-  IndexType m_sizes[] = {31,  39,  63,  64,  65,   127,  129, 255,
-                         257, 511, 512, 513, 1023, 1024, 1025};
+  IndexType m_sizes[] = {31, 39, 63, 64, 65, 127, 129, 255, 257, 511, 512, 513, 1023, 1024, 1025};
 
-  IndexType n_sizes[] = {31,  39,  63,  64,  65,   127,  129, 255,
-                         257, 511, 512, 513, 1023, 1024, 1025};
+  IndexType n_sizes[] = {31, 39, 63, 64, 65, 127, 129, 255, 257, 511, 512, 513, 1023, 1024, 1025};
 
-  IndexType k_sizes[] = {31,  39,  63,  64,  65,  95,   96,   127, 129,
-                         255, 257, 511, 512, 513, 1023, 1024, 1025};
+  IndexType k_sizes[] = {31, 39, 63, 64, 65, 95, 96, 127, 129, 255, 257, 511, 512, 513, 1023, 1024, 1025};
 
   for (IndexType i = 0; i < 15; i++) {
     for (IndexType j = 0; j < 15; j++) {
       for (IndexType k = 0; k < 17; k++) {
-        test_sycl_contraction<DataLayout, DataType, IndexType>(
-            sycl_device, m_sizes[i], n_sizes[j], k_sizes[k]);
+        test_sycl_contraction<DataLayout, DataType, IndexType>(sycl_device, m_sizes[i], n_sizes[j], k_sizes[k]);
       }
     }
   }
 }
 
-template <int DataLayout, typename DataType, typename IndexType,
-          typename Device>
-void static test_no_out_of_bounds(const Device &sycl_device, IndexType m_size,
-                                  IndexType k_size, IndexType n_size) {
-  typedef typename Tensor<DataType, 1, DataLayout, IndexType>::DimensionPair
-      DimPair;
+template <int DataLayout, typename DataType, typename IndexType, typename Device>
+void static test_no_out_of_bounds(const Device &sycl_device, IndexType m_size, IndexType k_size, IndexType n_size) {
+  typedef typename Tensor<DataType, 1, DataLayout, IndexType>::DimensionPair DimPair;
   static const DataType error_threshold = DataType(1e-4);
   Tensor<DataType, 2, DataLayout, IndexType> t_left(m_size, k_size);
   Tensor<DataType, 2, DataLayout, IndexType> t_right(k_size, n_size);
@@ -177,20 +150,14 @@
   std::size_t t_right_bytes = padded_right_size * sizeof(DataType);
   std::size_t t_result_bytes = padded_result_size * sizeof(DataType);
 
-  DataType *d_t_left =
-      static_cast<DataType *>(sycl_device.allocate(t_left_bytes));
-  DataType *d_t_right =
-      static_cast<DataType *>(sycl_device.allocate(t_right_bytes));
-  DataType *d_t_result =
-      static_cast<DataType *>(sycl_device.allocate(t_result_bytes));
+  DataType *d_t_left = static_cast<DataType *>(sycl_device.allocate(t_left_bytes));
+  DataType *d_t_right = static_cast<DataType *>(sycl_device.allocate(t_right_bytes));
+  DataType *d_t_result = static_cast<DataType *>(sycl_device.allocate(t_result_bytes));
 
   // TensorMaps are still of the same size than the Tensors
-  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>>
-      gpu_t_left(d_t_left, left_dims);
-  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>>
-      gpu_t_right(d_t_right, right_dims);
-  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>>
-      gpu_t_result(d_t_result, result_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>> gpu_t_left(d_t_left, left_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>> gpu_t_right(d_t_right, right_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>> gpu_t_result(d_t_result, result_dims);
 
   // Write nan after the actual buffer to propagate nans everywhere in case of
   // invalid reads
@@ -214,22 +181,19 @@
   t_result = t_left.contract(t_right, dims);
 
   for (IndexType i = 0; i < t_result.size(); i++) {
-    if (static_cast<DataType>(std::fabs(static_cast<DataType>(
-            t_result(i) - host_result_data[i]))) < error_threshold) {
+    if (static_cast<DataType>(std::fabs(static_cast<DataType>(t_result(i) - host_result_data[i]))) < error_threshold) {
       continue;
     }
-    if (Eigen::internal::isApprox(t_result(i), host_result_data[i],
-                                  error_threshold)) {
+    if (Eigen::internal::isApprox(t_result(i), host_result_data[i], error_threshold)) {
       continue;
     }
     if (std::isnan(host_result_data[i])) {
       std::cout << "M : " << m_size << ", N : " << n_size << ", K : " << k_size
-                << ", invalid read detected at IndexType " << i << ": "
-                << t_result(i) << " vs " << host_result_data[i] << std::endl;
+                << ", invalid read detected at IndexType " << i << ": " << t_result(i) << " vs " << host_result_data[i]
+                << std::endl;
     } else {
-      std::cout << "M : " << m_size << ", N : " << n_size << ", K : " << k_size
-                << ", mismatch detected at IndexType " << i << ": "
-                << t_result(i) << " vs " << host_result_data[i] << std::endl;
+      std::cout << "M : " << m_size << ", N : " << n_size << ", K : " << k_size << ", mismatch detected at IndexType "
+                << i << ": " << t_result(i) << " vs " << host_result_data[i] << std::endl;
     }
     VERIFY_IS_APPROX(host_result_data[i], t_result(i));
   }
@@ -239,8 +203,7 @@
       continue;
     }
     std::cout << "M : " << m_size << ", N : " << n_size << ", K : " << k_size
-              << ", invalid write detected at IndexType " << i << ": "
-              << host_result_data[i] << std::endl;
+              << ", invalid write detected at IndexType " << i << ": " << host_result_data[i] << std::endl;
     VERIFY_IS_APPROX(host_result_data[i], t_result(i));
   }
   sycl_device.deallocate(d_t_left);
@@ -252,17 +215,14 @@
   delete[] host_result_data;
 }
 
-template <int DataLayout, typename DataType, typename IndexType,
-          typename Device>
-void test_scalar(const Device &sycl_device, IndexType m_size, IndexType k_size,
-                 IndexType n_size) {
+template <int DataLayout, typename DataType, typename IndexType, typename Device>
+void test_scalar(const Device &sycl_device, IndexType m_size, IndexType k_size, IndexType n_size) {
   // std::cout << "Testing for (" << m_size << "," << k_size << "," << n_size <<
   // ")" << std::endl;
   // with these dimensions, the output has 300 * 140 elements, which is
   // more than 30 * 1024, which is the number of threads in blocks on
   // a 15 SM GK110 GPU
-  typedef typename Tensor<DataType, 1, DataLayout, IndexType>::DimensionPair
-      DimPair;
+  typedef typename Tensor<DataType, 1, DataLayout, IndexType>::DimensionPair DimPair;
   static const DataType error_threshold = DataType(1e-4);
   Tensor<DataType, 2, DataLayout, IndexType> t_left(m_size, k_size);
   Tensor<DataType, 2, DataLayout, IndexType> t_right(k_size, n_size);
@@ -278,35 +238,26 @@
   std::size_t t_right_bytes = t_right.size() * sizeof(DataType);
   std::size_t t_result_bytes = sizeof(DataType);
 
-  DataType *d_t_left =
-      static_cast<DataType *>(sycl_device.allocate(t_left_bytes));
-  DataType *d_t_right =
-      static_cast<DataType *>(sycl_device.allocate(t_right_bytes));
-  DataType *d_t_result =
-      static_cast<DataType *>(sycl_device.allocate(t_result_bytes));
+  DataType *d_t_left = static_cast<DataType *>(sycl_device.allocate(t_left_bytes));
+  DataType *d_t_right = static_cast<DataType *>(sycl_device.allocate(t_right_bytes));
+  DataType *d_t_result = static_cast<DataType *>(sycl_device.allocate(t_result_bytes));
 
-  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>>
-      gpu_t_left(d_t_left, left_dims);
-  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>>
-      gpu_t_right(d_t_right, right_dims);
-  Eigen::TensorMap<Eigen::Tensor<DataType, 0, DataLayout, IndexType>>
-      gpu_t_result(d_t_result);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>> gpu_t_left(d_t_left, left_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>> gpu_t_right(d_t_right, right_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 0, DataLayout, IndexType>> gpu_t_result(d_t_result);
 
   sycl_device.memcpyHostToDevice(d_t_left, t_left.data(), t_left_bytes);
   sycl_device.memcpyHostToDevice(d_t_right, t_right.data(), t_right_bytes);
 
   gpu_t_result.device(sycl_device) = gpu_t_left.contract(gpu_t_right, dims);
-  sycl_device.memcpyDeviceToHost(t_result_gpu.data(), d_t_result,
-                                 t_result_bytes);
+  sycl_device.memcpyDeviceToHost(t_result_gpu.data(), d_t_result, t_result_bytes);
 
   t_result = t_left.contract(t_right, dims);
 
-  if (static_cast<DataType>(std::fabs(static_cast<DataType>(
-          t_result() - t_result_gpu()))) > error_threshold &&
+  if (static_cast<DataType>(std::fabs(static_cast<DataType>(t_result() - t_result_gpu()))) > error_threshold &&
       !Eigen::internal::isApprox(t_result(), t_result_gpu(), error_threshold)) {
-    std::cout << "K: " << k_size << ", N: " << n_size << ", M: " << m_size
-              << " : mismatch detected: " << t_result() << " vs "
-              << t_result_gpu() << std::endl;
+    std::cout << "K: " << k_size << ", N: " << n_size << ", M: " << m_size << " : mismatch detected: " << t_result()
+              << " vs " << t_result_gpu() << std::endl;
     VERIFY_IS_APPROX(t_result_gpu(), t_result());
   }
 
@@ -315,13 +266,10 @@
   sycl_device.deallocate(d_t_result);
 }
 
-template <int DataLayout, typename DataType, typename IndexType,
-          typename Device>
-void contraction_batch(const Device &sycl_device, IndexType m_size,
-                       IndexType k_size, IndexType n_size, IndexType m_batch,
-                       IndexType start, IndexType limit) {
-  typedef typename Tensor<DataType, 1, DataLayout, IndexType>::DimensionPair
-      DimPair;
+template <int DataLayout, typename DataType, typename IndexType, typename Device>
+void contraction_batch(const Device &sycl_device, IndexType m_size, IndexType k_size, IndexType n_size,
+                       IndexType m_batch, IndexType start, IndexType limit) {
+  typedef typename Tensor<DataType, 1, DataLayout, IndexType>::DimensionPair DimPair;
   static const DataType error_threshold = DataType(1e-4);
   typedef Eigen::array<IndexType, 3> TensorDim;
   typedef Eigen::Tensor<DataType, 3, DataLayout, IndexType> TensorType;
@@ -342,12 +290,9 @@
   std::size_t t_right_bytes = t_right.size() * sizeof(DataType);
   std::size_t t_result_bytes = t_result.size() * sizeof(DataType);
 
-  DataType *d_t_left =
-      static_cast<DataType *>(sycl_device.allocate(t_left_bytes));
-  DataType *d_t_right =
-      static_cast<DataType *>(sycl_device.allocate(t_right_bytes));
-  DataType *d_t_result =
-      static_cast<DataType *>(sycl_device.allocate(t_result_bytes));
+  DataType *d_t_left = static_cast<DataType *>(sycl_device.allocate(t_left_bytes));
+  DataType *d_t_right = static_cast<DataType *>(sycl_device.allocate(t_right_bytes));
+  DataType *d_t_result = static_cast<DataType *>(sycl_device.allocate(t_result_bytes));
 
   Eigen::TensorMap<TensorType> gpu_t_left(d_t_left, left_dims);
   Eigen::TensorMap<TensorType> gpu_t_right(d_t_right, right_dims);
@@ -361,8 +306,7 @@
     auto z = gpu_t_result.template chip<0>(i);
     z.device(sycl_device) = x.contract(y, contract_pairs);
   }
-  sycl_device.memcpyDeviceToHost(t_result_gpu.data(), d_t_result,
-                                 t_result_bytes);
+  sycl_device.memcpyDeviceToHost(t_result_gpu.data(), d_t_result, t_result_bytes);
 
   for (int i = start; i < limit; ++i) {
     auto x = t_left.template chip<0>(i);
@@ -372,16 +316,14 @@
   }
 
   for (IndexType i = 0; i < t_result.size(); i++) {
-    if (static_cast<DataType>(std::fabs(static_cast<DataType>(
-            t_result(i) - t_result_gpu(i)))) < error_threshold) {
+    if (static_cast<DataType>(std::fabs(static_cast<DataType>(t_result(i) - t_result_gpu(i)))) < error_threshold) {
       continue;
     }
-    if (Eigen::internal::isApprox(t_result(i), t_result_gpu(i),
-                                  error_threshold)) {
+    if (Eigen::internal::isApprox(t_result(i), t_result_gpu(i), error_threshold)) {
       continue;
     }
-    std::cout << "mismatch detected at IndexType " << i << ": " << t_result(i)
-              << " vs " << t_result_gpu(i) << std::endl;
+    std::cout << "mismatch detected at IndexType " << i << ": " << t_result(i) << " vs " << t_result_gpu(i)
+              << std::endl;
     VERIFY_IS_APPROX(t_result_gpu(i), t_result(i));
   }
   sycl_device.deallocate(d_t_left);
@@ -389,12 +331,9 @@
   sycl_device.deallocate(d_t_result);
 }
 
-template <int DataLayout, typename DataType, typename IndexType,
-          typename Device>
-void contraction_rhs_transposed(const Device &sycl_device, IndexType m_size,
-                                IndexType k_size, IndexType n_size) {
-  typedef typename Tensor<DataType, 1, DataLayout, IndexType>::DimensionPair
-      DimPair;
+template <int DataLayout, typename DataType, typename IndexType, typename Device>
+void contraction_rhs_transposed(const Device &sycl_device, IndexType m_size, IndexType k_size, IndexType n_size) {
+  typedef typename Tensor<DataType, 1, DataLayout, IndexType>::DimensionPair DimPair;
   static const DataType error_threshold = DataType(1e-4);
   Eigen::array<IndexType, 2> left_dims = {{m_size, k_size}};
   Eigen::array<IndexType, 2> right_dims = {{n_size, k_size}};
@@ -413,42 +352,33 @@
   std::size_t t_right_bytes = t_right.size() * sizeof(DataType);
   std::size_t t_result_bytes = t_result.size() * sizeof(DataType);
 
-  DataType *d_t_left =
-      static_cast<DataType *>(sycl_device.allocate(t_left_bytes));
-  DataType *d_t_right =
-      static_cast<DataType *>(sycl_device.allocate(t_right_bytes));
-  DataType *d_t_result =
-      static_cast<DataType *>(sycl_device.allocate(t_result_bytes));
+  DataType *d_t_left = static_cast<DataType *>(sycl_device.allocate(t_left_bytes));
+  DataType *d_t_right = static_cast<DataType *>(sycl_device.allocate(t_right_bytes));
+  DataType *d_t_result = static_cast<DataType *>(sycl_device.allocate(t_result_bytes));
 
-  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>>
-      gpu_t_left(d_t_left, left_dims);
-  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>>
-      gpu_t_right(d_t_right, right_dims);
-  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>>
-      gpu_t_result(d_t_result, res_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>> gpu_t_left(d_t_left, left_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>> gpu_t_right(d_t_right, right_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>> gpu_t_result(d_t_result, res_dims);
 
   sycl_device.memcpyHostToDevice(d_t_left, t_left.data(), t_left_bytes);
   sycl_device.memcpyHostToDevice(d_t_right, t_right.data(), t_right_bytes);
 
   gpu_t_result.device(sycl_device) = gpu_t_left.contract(gpu_t_right, dims);
-  sycl_device.memcpyDeviceToHost(t_result_gpu.data(), d_t_result,
-                                 t_result_bytes);
+  sycl_device.memcpyDeviceToHost(t_result_gpu.data(), d_t_result, t_result_bytes);
 
   t_result = t_left.contract(t_right, dims);
 
   for (IndexType j = 0; j < m_size; j++) {
     for (IndexType i = 0; i < n_size; i++) {
-      if (static_cast<DataType>(std::fabs(static_cast<DataType>(
-              t_result(j, i) - t_result_gpu(j, i)))) < error_threshold) {
+      if (static_cast<DataType>(std::fabs(static_cast<DataType>(t_result(j, i) - t_result_gpu(j, i)))) <
+          error_threshold) {
         continue;
       }
-      if (Eigen::internal::isApprox(t_result(j, i), t_result_gpu(j, i),
-                                    error_threshold)) {
+      if (Eigen::internal::isApprox(t_result(j, i), t_result_gpu(j, i), error_threshold)) {
         continue;
       }
       std::cout << "M : " << m_size << ", N : " << n_size << ", K : " << k_size
-                << ", mismatch detected at IndexType m: " << j << " n: " << i
-                << " CPU : " << t_result(j, i)
+                << ", mismatch detected at IndexType m: " << j << " n: " << i << " CPU : " << t_result(j, i)
                 << " vs SYCL:" << t_result_gpu(j, i) << std::endl;
       VERIFY_IS_APPROX(t_result_gpu(j, i), t_result(j, i));
     }
@@ -458,12 +388,9 @@
   sycl_device.deallocate(d_t_result);
 }
 
-template <int DataLayout, typename DataType, typename IndexType,
-          typename Device>
-void contraction_lhs_transposed(const Device &sycl_device, IndexType m_size,
-                                IndexType k_size, IndexType n_size) {
-  typedef typename Tensor<DataType, 1, DataLayout, IndexType>::DimensionPair
-      DimPair;
+template <int DataLayout, typename DataType, typename IndexType, typename Device>
+void contraction_lhs_transposed(const Device &sycl_device, IndexType m_size, IndexType k_size, IndexType n_size) {
+  typedef typename Tensor<DataType, 1, DataLayout, IndexType>::DimensionPair DimPair;
   static const DataType error_threshold = DataType(1e-4);
   Eigen::array<IndexType, 2> left_dims = {{k_size, m_size}};
   Eigen::array<IndexType, 2> right_dims = {{k_size, n_size}};
@@ -482,41 +409,31 @@
   std::size_t t_right_bytes = t_right.size() * sizeof(DataType);
   std::size_t t_result_bytes = t_result.size() * sizeof(DataType);
 
-  DataType *d_t_left =
-      static_cast<DataType *>(sycl_device.allocate(t_left_bytes));
-  DataType *d_t_right =
-      static_cast<DataType *>(sycl_device.allocate(t_right_bytes));
-  DataType *d_t_result =
-      static_cast<DataType *>(sycl_device.allocate(t_result_bytes));
+  DataType *d_t_left = static_cast<DataType *>(sycl_device.allocate(t_left_bytes));
+  DataType *d_t_right = static_cast<DataType *>(sycl_device.allocate(t_right_bytes));
+  DataType *d_t_result = static_cast<DataType *>(sycl_device.allocate(t_result_bytes));
 
-  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>>
-      gpu_t_left(d_t_left, left_dims);
-  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>>
-      gpu_t_right(d_t_right, right_dims);
-  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>>
-      gpu_t_result(d_t_result, res_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>> gpu_t_left(d_t_left, left_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>> gpu_t_right(d_t_right, right_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>> gpu_t_result(d_t_result, res_dims);
 
   sycl_device.memcpyHostToDevice(d_t_left, t_left.data(), t_left_bytes);
   sycl_device.memcpyHostToDevice(d_t_right, t_right.data(), t_right_bytes);
 
   gpu_t_result.device(sycl_device) = gpu_t_left.contract(gpu_t_right, dims);
-  sycl_device.memcpyDeviceToHost(t_result_gpu.data(), d_t_result,
-                                 t_result_bytes);
+  sycl_device.memcpyDeviceToHost(t_result_gpu.data(), d_t_result, t_result_bytes);
 
   t_result = t_left.contract(t_right, dims);
 
   for (IndexType i = 0; i < t_result.size(); i++) {
-    if (static_cast<DataType>(std::fabs(static_cast<DataType>(
-            t_result(i) - t_result_gpu(i)))) < error_threshold) {
+    if (static_cast<DataType>(std::fabs(static_cast<DataType>(t_result(i) - t_result_gpu(i)))) < error_threshold) {
       continue;
     }
-    if (Eigen::internal::isApprox(t_result(i), t_result_gpu(i),
-                                  error_threshold)) {
+    if (Eigen::internal::isApprox(t_result(i), t_result_gpu(i), error_threshold)) {
       continue;
     }
-    std::cout << "M : " << m_size << ", N : " << n_size << ", K : " << k_size
-              << ", mismatch detected at IndexType " << i << ": " << t_result(i)
-              << " vs " << t_result_gpu(i) << std::endl;
+    std::cout << "M : " << m_size << ", N : " << n_size << ", K : " << k_size << ", mismatch detected at IndexType "
+              << i << ": " << t_result(i) << " vs " << t_result_gpu(i) << std::endl;
     VERIFY_IS_APPROX(t_result_gpu(i), t_result(i));
   }
   sycl_device.deallocate(d_t_left);
@@ -524,12 +441,9 @@
   sycl_device.deallocate(d_t_result);
 }
 
-template <int DataLayout, typename DataType, typename IndexType,
-          typename Device>
-void contraction_both_transposed(const Device &sycl_device, IndexType m_size,
-                                 IndexType k_size, IndexType n_size) {
-  typedef typename Tensor<DataType, 1, DataLayout, IndexType>::DimensionPair
-      DimPair;
+template <int DataLayout, typename DataType, typename IndexType, typename Device>
+void contraction_both_transposed(const Device &sycl_device, IndexType m_size, IndexType k_size, IndexType n_size) {
+  typedef typename Tensor<DataType, 1, DataLayout, IndexType>::DimensionPair DimPair;
   static const DataType error_threshold = DataType(1e-4);
   Eigen::array<IndexType, 2> left_dims = {{k_size, m_size}};
   Eigen::array<IndexType, 2> right_dims = {{n_size, k_size}};
@@ -548,41 +462,31 @@
   std::size_t t_right_bytes = t_right.size() * sizeof(DataType);
   std::size_t t_result_bytes = t_result.size() * sizeof(DataType);
 
-  DataType *d_t_left =
-      static_cast<DataType *>(sycl_device.allocate(t_left_bytes));
-  DataType *d_t_right =
-      static_cast<DataType *>(sycl_device.allocate(t_right_bytes));
-  DataType *d_t_result =
-      static_cast<DataType *>(sycl_device.allocate(t_result_bytes));
+  DataType *d_t_left = static_cast<DataType *>(sycl_device.allocate(t_left_bytes));
+  DataType *d_t_right = static_cast<DataType *>(sycl_device.allocate(t_right_bytes));
+  DataType *d_t_result = static_cast<DataType *>(sycl_device.allocate(t_result_bytes));
 
-  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>>
-      gpu_t_left(d_t_left, left_dims);
-  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>>
-      gpu_t_right(d_t_right, right_dims);
-  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>>
-      gpu_t_result(d_t_result, res_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>> gpu_t_left(d_t_left, left_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>> gpu_t_right(d_t_right, right_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType>> gpu_t_result(d_t_result, res_dims);
 
   sycl_device.memcpyHostToDevice(d_t_left, t_left.data(), t_left_bytes);
   sycl_device.memcpyHostToDevice(d_t_right, t_right.data(), t_right_bytes);
 
   gpu_t_result.device(sycl_device) = gpu_t_left.contract(gpu_t_right, dims);
-  sycl_device.memcpyDeviceToHost(t_result_gpu.data(), d_t_result,
-                                 t_result_bytes);
+  sycl_device.memcpyDeviceToHost(t_result_gpu.data(), d_t_result, t_result_bytes);
 
   t_result = t_left.contract(t_right, dims);
 
   for (IndexType i = 0; i < t_result.size(); i++) {
-    if (static_cast<DataType>(std::fabs(static_cast<DataType>(
-            t_result(i) - t_result_gpu(i)))) < error_threshold) {
+    if (static_cast<DataType>(std::fabs(static_cast<DataType>(t_result(i) - t_result_gpu(i)))) < error_threshold) {
       continue;
     }
-    if (Eigen::internal::isApprox(t_result(i), t_result_gpu(i),
-                                  error_threshold)) {
+    if (Eigen::internal::isApprox(t_result(i), t_result_gpu(i), error_threshold)) {
       continue;
     }
-    std::cout << "M : " << m_size << ", N : " << n_size << ", K : " << k_size
-              << ", mismatch detected at IndexType " << i << ": " << t_result(i)
-              << " vs " << t_result_gpu(i) << std::endl;
+    std::cout << "M : " << m_size << ", N : " << n_size << ", K : " << k_size << ", mismatch detected at IndexType "
+              << i << ": " << t_result(i) << " vs " << t_result_gpu(i) << std::endl;
 
     VERIFY_IS_APPROX(t_result_gpu(i), t_result(i));
   }
@@ -598,31 +502,20 @@
   std::chrono::time_point<std::chrono::system_clock> start, end;
   start = std::chrono::system_clock::now();
   // Test out of bound for Tensor-Tensor
-  test_no_out_of_bounds<RowMajor, DataType, IndexType>(sycl_device, 10, 1024,
-                                                       1024);
-  test_no_out_of_bounds<RowMajor, DataType, IndexType>(sycl_device, 1024, 1024,
-                                                       4096);
-  test_no_out_of_bounds<RowMajor, DataType, IndexType>(sycl_device, 4096, 1024,
-                                                       2048);
-  test_no_out_of_bounds<ColMajor, DataType, IndexType>(sycl_device, 784, 2048,
-                                                       1024);
-  test_no_out_of_bounds<ColMajor, DataType, IndexType>(sycl_device, 2048, 1024,
-                                                       784);
-  test_no_out_of_bounds<RowMajor, DataType, IndexType>(sycl_device, 10, 1024,
-                                                       10);
-  test_no_out_of_bounds<RowMajor, DataType, IndexType>(sycl_device, 513, 4096,
-                                                       513);
-  test_no_out_of_bounds<RowMajor, DataType, IndexType>(sycl_device, 783, 1024,
-                                                       783);
-  test_no_out_of_bounds<ColMajor, DataType, IndexType>(sycl_device, 784, 2048,
-                                                       784);
-  test_no_out_of_bounds<ColMajor, DataType, IndexType>(sycl_device, 11, 1024,
-                                                       11);
+  test_no_out_of_bounds<RowMajor, DataType, IndexType>(sycl_device, 10, 1024, 1024);
+  test_no_out_of_bounds<RowMajor, DataType, IndexType>(sycl_device, 1024, 1024, 4096);
+  test_no_out_of_bounds<RowMajor, DataType, IndexType>(sycl_device, 4096, 1024, 2048);
+  test_no_out_of_bounds<ColMajor, DataType, IndexType>(sycl_device, 784, 2048, 1024);
+  test_no_out_of_bounds<ColMajor, DataType, IndexType>(sycl_device, 2048, 1024, 784);
+  test_no_out_of_bounds<RowMajor, DataType, IndexType>(sycl_device, 10, 1024, 10);
+  test_no_out_of_bounds<RowMajor, DataType, IndexType>(sycl_device, 513, 4096, 513);
+  test_no_out_of_bounds<RowMajor, DataType, IndexType>(sycl_device, 783, 1024, 783);
+  test_no_out_of_bounds<ColMajor, DataType, IndexType>(sycl_device, 784, 2048, 784);
+  test_no_out_of_bounds<ColMajor, DataType, IndexType>(sycl_device, 11, 1024, 11);
   end = std::chrono::system_clock::now();
   std::chrono::duration<double> elapsed_seconds = end - start;
   std::time_t end_time = std::chrono::system_clock::to_time_t(end);
-  std::cout << "tensor out of bound tests finished computation at "
-            << std::ctime(&end_time)
+  std::cout << "tensor out of bound tests finished computation at " << std::ctime(&end_time)
             << "elapsed time: " << elapsed_seconds.count() << "s\n";
 }
 
@@ -633,15 +526,12 @@
   std::chrono::time_point<std::chrono::system_clock> start, end;
   start = std::chrono::system_clock::now();
   // Tensor Tensor Contraction
-  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 128, 128,
-                                                       128);
-  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 128, 128,
-                                                       128);
+  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 128, 128, 128);
+  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 128, 128, 128);
   end = std::chrono::system_clock::now();
   std::chrono::duration<double> elapsed_seconds = end - start;
   std::time_t end_time = std::chrono::system_clock::to_time_t(end);
-  std::cout << "tensor tensor tests finished computation at "
-            << std::ctime(&end_time)
+  std::cout << "tensor tensor tests finished computation at " << std::ctime(&end_time)
             << "elapsed time: " << elapsed_seconds.count() << "s\n";
 }
 
@@ -658,8 +548,7 @@
   end = std::chrono::system_clock::now();
   std::chrono::duration<double> elapsed_seconds = end - start;
   std::time_t end_time = std::chrono::system_clock::to_time_t(end);
-  std::cout << "tensor tensor tests finished computation at "
-            << std::ctime(&end_time)
+  std::cout << "tensor tensor tests finished computation at " << std::ctime(&end_time)
             << "elapsed time: " << elapsed_seconds.count() << "s\n";
 }
 
@@ -676,8 +565,7 @@
   end = std::chrono::system_clock::now();
   std::chrono::duration<double> elapsed_seconds = end - start;
   std::time_t end_time = std::chrono::system_clock::to_time_t(end);
-  std::cout << "tensor tensor tests finished computation at "
-            << std::ctime(&end_time)
+  std::cout << "tensor tensor tests finished computation at " << std::ctime(&end_time)
             << "elapsed time: " << elapsed_seconds.count() << "s\n";
 }
 
@@ -693,8 +581,7 @@
   end = std::chrono::system_clock::now();
   std::chrono::duration<double> elapsed_seconds = end - start;
   std::time_t end_time = std::chrono::system_clock::to_time_t(end);
-  std::cout << "tensor tensor tests finished computation at "
-            << std::ctime(&end_time)
+  std::cout << "tensor tensor tests finished computation at " << std::ctime(&end_time)
             << "elapsed time: " << elapsed_seconds.count() << "s\n";
 }
 
@@ -711,8 +598,7 @@
   end = std::chrono::system_clock::now();
   std::chrono::duration<double> elapsed_seconds = end - start;
   std::time_t end_time = std::chrono::system_clock::to_time_t(end);
-  std::cout << "tensor tensor tests finished computation at "
-            << std::ctime(&end_time)
+  std::cout << "tensor tensor tests finished computation at " << std::ctime(&end_time)
             << "elapsed time: " << elapsed_seconds.count() << "s\n";
 }
 template <typename Dev>
@@ -722,24 +608,17 @@
   std::chrono::time_point<std::chrono::system_clock> start, end;
   start = std::chrono::system_clock::now();
   // VECTOR-VECTOR
-  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1025, 1,
-                                                       1025);
-  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1025, 1,
-                                                       1025);
-  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1024, 1,
-                                                       1024);
-  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1024, 1,
-                                                       1024);
-  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1023, 1,
-                                                       1023);
-  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1023, 1,
-                                                       1023);
+  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1025, 1, 1025);
+  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1025, 1, 1025);
+  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1024, 1, 1024);
+  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1024, 1, 1024);
+  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1023, 1, 1023);
+  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1023, 1, 1023);
 
   end = std::chrono::system_clock::now();
   std::chrono::duration<double> elapsed_seconds = end - start;
   std::time_t end_time = std::chrono::system_clock::to_time_t(end);
-  std::cout << "contracted tensor tests finished computation at "
-            << std::ctime(&end_time)
+  std::cout << "contracted tensor tests finished computation at " << std::ctime(&end_time)
             << "elapsed time: " << elapsed_seconds.count() << "s\n";
 }
 
@@ -750,39 +629,26 @@
   std::chrono::time_point<std::chrono::system_clock> start, end;
   start = std::chrono::system_clock::now();
   // Vector-Tensor
-  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1, 1025,
-                                                       1025);
-  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1, 1025,
-                                                       1025);
-  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1, 1024,
-                                                       1024);
-  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1, 1024,
-                                                       1024);
-  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1, 1023,
-                                                       1023);
-  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1, 1023,
-                                                       1023);
+  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1, 1025, 1025);
+  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1, 1025, 1025);
+  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1, 1024, 1024);
+  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1, 1024, 1024);
+  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1, 1023, 1023);
+  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1, 1023, 1023);
 
-  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1, 4097,
-                                                       4097);
-  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1, 4097,
-                                                       4097);
-  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1, 4096,
-                                                       4096);
-  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1, 4096,
-                                                       4096);
-  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1, 4095,
-                                                       4095);
-  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1, 4095,
-                                                       4095);
-  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1, 802816,
-                                                       32);
+  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1, 4097, 4097);
+  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1, 4097, 4097);
+  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1, 4096, 4096);
+  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1, 4096, 4096);
+  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1, 4095, 4095);
+  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1, 4095, 4095);
+  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1, 802816, 32);
 
   end = std::chrono::system_clock::now();
   std::chrono::duration<double> elapsed_seconds = end - start;
   std::time_t end_time = std::chrono::system_clock::to_time_t(end);
-  std::cout << "finished computation at " << std::ctime(&end_time)
-            << "elapsed time: " << elapsed_seconds.count() << "s\n";
+  std::cout << "finished computation at " << std::ctime(&end_time) << "elapsed time: " << elapsed_seconds.count()
+            << "s\n";
 }
 
 template <typename Dev>
@@ -792,45 +658,32 @@
   std::chrono::time_point<std::chrono::system_clock> start, end;
   start = std::chrono::system_clock::now();
   // Matrix-Vector
-  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1025, 1025,
-                                                       1);
-  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1125, 1025,
-                                                       1);
-  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1224, 1024,
-                                                       1);
-  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1024, 1024,
-                                                       1);
-  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1023, 1023,
-                                                       1);
-  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1023, 1023,
-                                                       1);
-  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 4097, 4197,
-                                                       1);
-  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 4097, 4097,
-                                                       1);
-  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 4096, 4096,
-                                                       1);
-  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 4096, 8196,
-                                                       1);
-  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 4095, 4095,
-                                                       1);
-  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 4095, 4095,
-                                                       1);
+  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1025, 1025, 1);
+  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1125, 1025, 1);
+  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1224, 1024, 1);
+  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1024, 1024, 1);
+  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 1023, 1023, 1);
+  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 1023, 1023, 1);
+  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 4097, 4197, 1);
+  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 4097, 4097, 1);
+  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 4096, 4096, 1);
+  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 4096, 8196, 1);
+  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 4095, 4095, 1);
+  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 4095, 4095, 1);
 // If the GEMV disabled it will creates one kernel to calculate the contraction.
 // Therefore the acumuation of float number will overflow the precision
 // threshold for float and cause the test to fail. While it the GMV multiple
 // kernel will be created and each one run the overflow of accumutation breaks
 // among the kernels.
 #ifndef EIGEN_SYCL_DISABLE_GEMV
-  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 32, 802032,
-                                                       1);
+  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 32, 802032, 1);
 #endif
 
   end = std::chrono::system_clock::now();
   std::chrono::duration<double> elapsed_seconds = end - start;
   std::time_t end_time = std::chrono::system_clock::to_time_t(end);
-  std::cout << "finished computation at " << std::ctime(&end_time)
-            << "elapsed time: " << elapsed_seconds.count() << "s\n";
+  std::cout << "finished computation at " << std::ctime(&end_time) << "elapsed time: " << elapsed_seconds.count()
+            << "s\n";
 }
 
 template <typename Dev>
@@ -850,8 +703,8 @@
   end = std::chrono::system_clock::now();
   std::chrono::duration<double> elapsed_seconds = end - start;
   std::time_t end_time = std::chrono::system_clock::to_time_t(end);
-  std::cout << "finished computation at " << std::ctime(&end_time)
-            << "elapsed time: " << elapsed_seconds.count() << "s\n";
+  std::cout << "finished computation at " << std::ctime(&end_time) << "elapsed time: " << elapsed_seconds.count()
+            << "s\n";
 }
 
 template <typename Dev>
@@ -862,19 +715,15 @@
   start = std::chrono::system_clock::now();
   // Tensor Tensor Contraction
   test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 16, 4, 16);
-  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 257, 131073,
-                                                       257);
-  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 256, 131072,
-                                                       256);
-  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 16, 131073,
-                                                       16);
-  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 17, 131072,
-                                                       17);
+  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 257, 131073, 257);
+  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 256, 131072, 256);
+  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 16, 131073, 16);
+  test_sycl_contraction<RowMajor, DataType, IndexType>(sycl_device, 17, 131072, 17);
   end = std::chrono::system_clock::now();
   std::chrono::duration<double> elapsed_seconds = end - start;
   std::time_t end_time = std::chrono::system_clock::to_time_t(end);
-  std::cout << "finished computation at " << std::ctime(&end_time)
-            << "elapsed time: " << elapsed_seconds.count() << "s\n";
+  std::cout << "finished computation at " << std::ctime(&end_time) << "elapsed time: " << elapsed_seconds.count()
+            << "s\n";
 }
 
 template <typename Dev>
@@ -885,19 +734,15 @@
   start = std::chrono::system_clock::now();
   // Tensor Tensor Contraction
   test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 16, 4, 16);
-  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 257, 131073,
-                                                       257);
-  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 256, 131072,
-                                                       256);
-  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 16, 131073,
-                                                       16);
-  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 17, 131072,
-                                                       17);
+  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 257, 131073, 257);
+  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 256, 131072, 256);
+  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 16, 131073, 16);
+  test_sycl_contraction<ColMajor, DataType, IndexType>(sycl_device, 17, 131072, 17);
   end = std::chrono::system_clock::now();
   std::chrono::duration<double> elapsed_seconds = end - start;
   std::time_t end_time = std::chrono::system_clock::to_time_t(end);
-  std::cout << "finished computation at " << std::ctime(&end_time)
-            << "elapsed time: " << elapsed_seconds.count() << "s\n";
+  std::cout << "finished computation at " << std::ctime(&end_time) << "elapsed time: " << elapsed_seconds.count()
+            << "s\n";
 }
 
 template <typename Dev>
@@ -907,103 +752,78 @@
   std::chrono::time_point<std::chrono::system_clock> start, end;
   start = std::chrono::system_clock::now();
 
-  contraction_batch<RowMajor, DataType, IndexType>(sycl_device, 64, 75, 30, 4,
-                                                   0, 4);
-  contraction_batch<ColMajor, DataType, IndexType>(sycl_device, 64, 75, 30, 4,
-                                                   0, 4);
+  contraction_batch<RowMajor, DataType, IndexType>(sycl_device, 64, 75, 30, 4, 0, 4);
+  contraction_batch<ColMajor, DataType, IndexType>(sycl_device, 64, 75, 30, 4, 0, 4);
   end = std::chrono::system_clock::now();
   std::chrono::duration<double> elapsed_seconds = end - start;
   std::time_t end_time = std::chrono::system_clock::to_time_t(end);
-  std::cout << "finished computation at " << std::ctime(&end_time)
-            << "elapsed time: " << elapsed_seconds.count() << "s\n";
+  std::cout << "finished computation at " << std::ctime(&end_time) << "elapsed time: " << elapsed_seconds.count()
+            << "s\n";
 }
 
 template <typename Dev>
-void inline tensor_contraction_lhs_transposed_per_device(
-    const Dev &sycl_device) {
+void inline tensor_contraction_lhs_transposed_per_device(const Dev &sycl_device) {
   typedef float DataType;
   typedef int64_t IndexType;
   std::chrono::time_point<std::chrono::system_clock> start, end;
   start = std::chrono::system_clock::now();
 
-  contraction_lhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 8, 4,
-                                                            8);
-  contraction_lhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 32, 8,
-                                                            32);
-  contraction_lhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 64, 16,
-                                                            64);
-  contraction_lhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 784,
-                                                            2048, 1024);
-  contraction_lhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 1024,
-                                                            10, 1024);
-  contraction_lhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 4096,
-                                                            1024, 1024);
-  contraction_lhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 2048,
-                                                            4096, 1024);
+  contraction_lhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 8, 4, 8);
+  contraction_lhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 32, 8, 32);
+  contraction_lhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 64, 16, 64);
+  contraction_lhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 784, 2048, 1024);
+  contraction_lhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 1024, 10, 1024);
+  contraction_lhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 4096, 1024, 1024);
+  contraction_lhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 2048, 4096, 1024);
   end = std::chrono::system_clock::now();
   std::chrono::duration<double> elapsed_seconds = end - start;
   std::time_t end_time = std::chrono::system_clock::to_time_t(end);
-  std::cout << "finished computation at " << std::ctime(&end_time)
-            << "elapsed time: " << elapsed_seconds.count() << "s\n";
+  std::cout << "finished computation at " << std::ctime(&end_time) << "elapsed time: " << elapsed_seconds.count()
+            << "s\n";
 }
 
 template <typename Dev>
-void inline tensor_contraction_rhs_transposed_per_device(
-    const Dev &sycl_device) {
+void inline tensor_contraction_rhs_transposed_per_device(const Dev &sycl_device) {
   typedef float DataType;
   typedef int64_t IndexType;
   std::chrono::time_point<std::chrono::system_clock> start, end;
   start = std::chrono::system_clock::now();
 
-  contraction_rhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 16, 4,
-                                                            16);
-  contraction_rhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 17, 5,
-                                                            17);
-  contraction_rhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 32, 8,
-                                                            32);
-  contraction_rhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 64, 16,
-                                                            64);
-  contraction_rhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 10,
-                                                            1024, 1024);
-  contraction_rhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 1024,
-                                                            1024, 4096);
-  contraction_rhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 4096,
-                                                            1024, 2048);
-  contraction_rhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 2048,
-                                                            1024, 784);
+  contraction_rhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 16, 4, 16);
+  contraction_rhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 17, 5, 17);
+  contraction_rhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 32, 8, 32);
+  contraction_rhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 64, 16, 64);
+  contraction_rhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 10, 1024, 1024);
+  contraction_rhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 1024, 1024, 4096);
+  contraction_rhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 4096, 1024, 2048);
+  contraction_rhs_transposed<RowMajor, DataType, IndexType>(sycl_device, 2048, 1024, 784);
   end = std::chrono::system_clock::now();
   std::chrono::duration<double> elapsed_seconds = end - start;
   std::time_t end_time = std::chrono::system_clock::to_time_t(end);
-  std::cout << "finished computation at " << std::ctime(&end_time)
-            << "elapsed time: " << elapsed_seconds.count() << "s\n";
+  std::cout << "finished computation at " << std::ctime(&end_time) << "elapsed time: " << elapsed_seconds.count()
+            << "s\n";
 }
 
 template <typename Dev>
-void inline tensor_contraction_both_transposed_per_device(
-    const Dev &sycl_device) {
+void inline tensor_contraction_both_transposed_per_device(const Dev &sycl_device) {
   typedef float DataType;
   typedef int64_t IndexType;
   std::chrono::time_point<std::chrono::system_clock> start, end;
   start = std::chrono::system_clock::now();
 
-  contraction_both_transposed<RowMajor, DataType, IndexType>(sycl_device, 17, 5,
-                                                             17);
-  contraction_both_transposed<RowMajor, DataType, IndexType>(sycl_device, 32, 8,
-                                                             32);
-  contraction_both_transposed<RowMajor, DataType, IndexType>(sycl_device, 64,
-                                                             16, 64);
+  contraction_both_transposed<RowMajor, DataType, IndexType>(sycl_device, 17, 5, 17);
+  contraction_both_transposed<RowMajor, DataType, IndexType>(sycl_device, 32, 8, 32);
+  contraction_both_transposed<RowMajor, DataType, IndexType>(sycl_device, 64, 16, 64);
   end = std::chrono::system_clock::now();
   std::chrono::duration<double> elapsed_seconds = end - start;
   std::time_t end_time = std::chrono::system_clock::to_time_t(end);
-  std::cout << "finished computation at " << std::ctime(&end_time)
-            << "elapsed time: " << elapsed_seconds.count() << "s\n";
+  std::cout << "finished computation at " << std::ctime(&end_time) << "elapsed time: " << elapsed_seconds.count()
+            << "s\n";
 }
 
 EIGEN_DECLARE_TEST(cxx11_tensor_contract_sycl) {
   for (const auto &device : Eigen::get_sycl_supported_devices()) {
-    std::cout << "Running on "
-              << device.template get_info<cl::sycl::info::device::name>()
-              << std::endl;
+    std::cout << "Running on " << device.template get_info<cl::sycl::info::device::name>() << std::endl;
     QueueInterface queueInterface(device);
     auto sycl_device = Eigen::SyclDevice(&queueInterface);
     CALL_SUBTEST_1(tensorOutofBound(sycl_device));
diff --git a/unsupported/test/cxx11_tensor_contraction.cpp b/unsupported/test/cxx11_tensor_contraction.cpp
index 3b5c6a1..2949c14 100644
--- a/unsupported/test/cxx11_tensor_contraction.cpp
+++ b/unsupported/test/cxx11_tensor_contraction.cpp
@@ -16,9 +16,8 @@
 
 typedef Tensor<float, 1>::DimensionPair DimPair;
 
-template<int DataLayout>
-static void test_evals()
-{
+template <int DataLayout>
+static void test_evals() {
   Tensor<float, 2, DataLayout> mat1(2, 3);
   Tensor<float, 2, DataLayout> mat2(2, 3);
   Tensor<float, 2, DataLayout> mat3(3, 2);
@@ -27,60 +26,59 @@
   mat2.setRandom();
   mat3.setRandom();
 
-  Tensor<float, 2, DataLayout> mat4(3,3);
+  Tensor<float, 2, DataLayout> mat4(3, 3);
   mat4.setZero();
   Eigen::array<DimPair, 1> dims3 = {{DimPair(0, 0)}};
   typedef TensorEvaluator<decltype(mat1.contract(mat2, dims3)), DefaultDevice> Evaluator;
   Evaluator eval(mat1.contract(mat2, dims3), DefaultDevice());
   eval.evalTo(mat4.data());
-  EIGEN_STATIC_ASSERT(Evaluator::NumDims==2ul, YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT(Evaluator::NumDims == 2ul, YOU_MADE_A_PROGRAMMING_MISTAKE);
   VERIFY_IS_EQUAL(eval.dimensions()[0], 3);
   VERIFY_IS_EQUAL(eval.dimensions()[1], 3);
 
-  VERIFY_IS_APPROX(mat4(0,0), mat1(0,0)*mat2(0,0) + mat1(1,0)*mat2(1,0));
-  VERIFY_IS_APPROX(mat4(0,1), mat1(0,0)*mat2(0,1) + mat1(1,0)*mat2(1,1));
-  VERIFY_IS_APPROX(mat4(0,2), mat1(0,0)*mat2(0,2) + mat1(1,0)*mat2(1,2));
-  VERIFY_IS_APPROX(mat4(1,0), mat1(0,1)*mat2(0,0) + mat1(1,1)*mat2(1,0));
-  VERIFY_IS_APPROX(mat4(1,1), mat1(0,1)*mat2(0,1) + mat1(1,1)*mat2(1,1));
-  VERIFY_IS_APPROX(mat4(1,2), mat1(0,1)*mat2(0,2) + mat1(1,1)*mat2(1,2));
-  VERIFY_IS_APPROX(mat4(2,0), mat1(0,2)*mat2(0,0) + mat1(1,2)*mat2(1,0));
-  VERIFY_IS_APPROX(mat4(2,1), mat1(0,2)*mat2(0,1) + mat1(1,2)*mat2(1,1));
-  VERIFY_IS_APPROX(mat4(2,2), mat1(0,2)*mat2(0,2) + mat1(1,2)*mat2(1,2));
+  VERIFY_IS_APPROX(mat4(0, 0), mat1(0, 0) * mat2(0, 0) + mat1(1, 0) * mat2(1, 0));
+  VERIFY_IS_APPROX(mat4(0, 1), mat1(0, 0) * mat2(0, 1) + mat1(1, 0) * mat2(1, 1));
+  VERIFY_IS_APPROX(mat4(0, 2), mat1(0, 0) * mat2(0, 2) + mat1(1, 0) * mat2(1, 2));
+  VERIFY_IS_APPROX(mat4(1, 0), mat1(0, 1) * mat2(0, 0) + mat1(1, 1) * mat2(1, 0));
+  VERIFY_IS_APPROX(mat4(1, 1), mat1(0, 1) * mat2(0, 1) + mat1(1, 1) * mat2(1, 1));
+  VERIFY_IS_APPROX(mat4(1, 2), mat1(0, 1) * mat2(0, 2) + mat1(1, 1) * mat2(1, 2));
+  VERIFY_IS_APPROX(mat4(2, 0), mat1(0, 2) * mat2(0, 0) + mat1(1, 2) * mat2(1, 0));
+  VERIFY_IS_APPROX(mat4(2, 1), mat1(0, 2) * mat2(0, 1) + mat1(1, 2) * mat2(1, 1));
+  VERIFY_IS_APPROX(mat4(2, 2), mat1(0, 2) * mat2(0, 2) + mat1(1, 2) * mat2(1, 2));
 
-  Tensor<float, 2, DataLayout> mat5(2,2);
+  Tensor<float, 2, DataLayout> mat5(2, 2);
   mat5.setZero();
   Eigen::array<DimPair, 1> dims4 = {{DimPair(1, 1)}};
   typedef TensorEvaluator<decltype(mat1.contract(mat2, dims4)), DefaultDevice> Evaluator2;
   Evaluator2 eval2(mat1.contract(mat2, dims4), DefaultDevice());
   eval2.evalTo(mat5.data());
-  EIGEN_STATIC_ASSERT(Evaluator2::NumDims==2ul, YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT(Evaluator2::NumDims == 2ul, YOU_MADE_A_PROGRAMMING_MISTAKE);
   VERIFY_IS_EQUAL(eval2.dimensions()[0], 2);
   VERIFY_IS_EQUAL(eval2.dimensions()[1], 2);
 
-  VERIFY_IS_APPROX(mat5(0,0), mat1(0,0)*mat2(0,0) + mat1(0,1)*mat2(0,1) + mat1(0,2)*mat2(0,2));
-  VERIFY_IS_APPROX(mat5(0,1), mat1(0,0)*mat2(1,0) + mat1(0,1)*mat2(1,1) + mat1(0,2)*mat2(1,2));
-  VERIFY_IS_APPROX(mat5(1,0), mat1(1,0)*mat2(0,0) + mat1(1,1)*mat2(0,1) + mat1(1,2)*mat2(0,2));
-  VERIFY_IS_APPROX(mat5(1,1), mat1(1,0)*mat2(1,0) + mat1(1,1)*mat2(1,1) + mat1(1,2)*mat2(1,2));
+  VERIFY_IS_APPROX(mat5(0, 0), mat1(0, 0) * mat2(0, 0) + mat1(0, 1) * mat2(0, 1) + mat1(0, 2) * mat2(0, 2));
+  VERIFY_IS_APPROX(mat5(0, 1), mat1(0, 0) * mat2(1, 0) + mat1(0, 1) * mat2(1, 1) + mat1(0, 2) * mat2(1, 2));
+  VERIFY_IS_APPROX(mat5(1, 0), mat1(1, 0) * mat2(0, 0) + mat1(1, 1) * mat2(0, 1) + mat1(1, 2) * mat2(0, 2));
+  VERIFY_IS_APPROX(mat5(1, 1), mat1(1, 0) * mat2(1, 0) + mat1(1, 1) * mat2(1, 1) + mat1(1, 2) * mat2(1, 2));
 
-  Tensor<float, 2, DataLayout> mat6(2,2);
+  Tensor<float, 2, DataLayout> mat6(2, 2);
   mat6.setZero();
   Eigen::array<DimPair, 1> dims6 = {{DimPair(1, 0)}};
   typedef TensorEvaluator<decltype(mat1.contract(mat3, dims6)), DefaultDevice> Evaluator3;
   Evaluator3 eval3(mat1.contract(mat3, dims6), DefaultDevice());
   eval3.evalTo(mat6.data());
-  EIGEN_STATIC_ASSERT(Evaluator3::NumDims==2ul, YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT(Evaluator3::NumDims == 2ul, YOU_MADE_A_PROGRAMMING_MISTAKE);
   VERIFY_IS_EQUAL(eval3.dimensions()[0], 2);
   VERIFY_IS_EQUAL(eval3.dimensions()[1], 2);
 
-  VERIFY_IS_APPROX(mat6(0,0), mat1(0,0)*mat3(0,0) + mat1(0,1)*mat3(1,0) + mat1(0,2)*mat3(2,0));
-  VERIFY_IS_APPROX(mat6(0,1), mat1(0,0)*mat3(0,1) + mat1(0,1)*mat3(1,1) + mat1(0,2)*mat3(2,1));
-  VERIFY_IS_APPROX(mat6(1,0), mat1(1,0)*mat3(0,0) + mat1(1,1)*mat3(1,0) + mat1(1,2)*mat3(2,0));
-  VERIFY_IS_APPROX(mat6(1,1), mat1(1,0)*mat3(0,1) + mat1(1,1)*mat3(1,1) + mat1(1,2)*mat3(2,1));
+  VERIFY_IS_APPROX(mat6(0, 0), mat1(0, 0) * mat3(0, 0) + mat1(0, 1) * mat3(1, 0) + mat1(0, 2) * mat3(2, 0));
+  VERIFY_IS_APPROX(mat6(0, 1), mat1(0, 0) * mat3(0, 1) + mat1(0, 1) * mat3(1, 1) + mat1(0, 2) * mat3(2, 1));
+  VERIFY_IS_APPROX(mat6(1, 0), mat1(1, 0) * mat3(0, 0) + mat1(1, 1) * mat3(1, 0) + mat1(1, 2) * mat3(2, 0));
+  VERIFY_IS_APPROX(mat6(1, 1), mat1(1, 0) * mat3(0, 1) + mat1(1, 1) * mat3(1, 1) + mat1(1, 2) * mat3(2, 1));
 }
 
-template<int DataLayout>
-static void test_scalar()
-{
+template <int DataLayout>
+static void test_scalar() {
   Tensor<float, 1, DataLayout> vec1({6});
   Tensor<float, 1, DataLayout> vec2({6});
 
@@ -97,9 +95,8 @@
   VERIFY_IS_APPROX(scalar(), expected);
 }
 
-template<int DataLayout>
-static void test_multidims()
-{
+template <int DataLayout>
+static void test_multidims() {
   Tensor<float, 3, DataLayout> mat1(2, 2, 2);
   Tensor<float, 4, DataLayout> mat2(2, 2, 2, 2);
 
@@ -112,27 +109,27 @@
   typedef TensorEvaluator<decltype(mat1.contract(mat2, dims)), DefaultDevice> Evaluator;
   Evaluator eval(mat1.contract(mat2, dims), DefaultDevice());
   eval.evalTo(mat3.data());
-  EIGEN_STATIC_ASSERT(Evaluator::NumDims==3ul, YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT(Evaluator::NumDims == 3ul, YOU_MADE_A_PROGRAMMING_MISTAKE);
   VERIFY_IS_EQUAL(eval.dimensions()[0], 2);
   VERIFY_IS_EQUAL(eval.dimensions()[1], 2);
   VERIFY_IS_EQUAL(eval.dimensions()[2], 2);
 
-  VERIFY_IS_APPROX(mat3(0,0,0), mat1(0,0,0)*mat2(0,0,0,0) + mat1(0,1,0)*mat2(0,0,1,0) +
-                                mat1(0,0,1)*mat2(0,0,0,1) + mat1(0,1,1)*mat2(0,0,1,1));
-  VERIFY_IS_APPROX(mat3(0,0,1), mat1(0,0,0)*mat2(0,1,0,0) + mat1(0,1,0)*mat2(0,1,1,0) +
-                                mat1(0,0,1)*mat2(0,1,0,1) + mat1(0,1,1)*mat2(0,1,1,1));
-  VERIFY_IS_APPROX(mat3(0,1,0), mat1(0,0,0)*mat2(1,0,0,0) + mat1(0,1,0)*mat2(1,0,1,0) +
-                                mat1(0,0,1)*mat2(1,0,0,1) + mat1(0,1,1)*mat2(1,0,1,1));
-  VERIFY_IS_APPROX(mat3(0,1,1), mat1(0,0,0)*mat2(1,1,0,0) + mat1(0,1,0)*mat2(1,1,1,0) +
-                                mat1(0,0,1)*mat2(1,1,0,1) + mat1(0,1,1)*mat2(1,1,1,1));
-  VERIFY_IS_APPROX(mat3(1,0,0), mat1(1,0,0)*mat2(0,0,0,0) + mat1(1,1,0)*mat2(0,0,1,0) +
-                                mat1(1,0,1)*mat2(0,0,0,1) + mat1(1,1,1)*mat2(0,0,1,1));
-  VERIFY_IS_APPROX(mat3(1,0,1), mat1(1,0,0)*mat2(0,1,0,0) + mat1(1,1,0)*mat2(0,1,1,0) +
-                                mat1(1,0,1)*mat2(0,1,0,1) + mat1(1,1,1)*mat2(0,1,1,1));
-  VERIFY_IS_APPROX(mat3(1,1,0), mat1(1,0,0)*mat2(1,0,0,0) + mat1(1,1,0)*mat2(1,0,1,0) +
-                                mat1(1,0,1)*mat2(1,0,0,1) + mat1(1,1,1)*mat2(1,0,1,1));
-  VERIFY_IS_APPROX(mat3(1,1,1), mat1(1,0,0)*mat2(1,1,0,0) + mat1(1,1,0)*mat2(1,1,1,0) +
-                                mat1(1,0,1)*mat2(1,1,0,1) + mat1(1,1,1)*mat2(1,1,1,1));
+  VERIFY_IS_APPROX(mat3(0, 0, 0), mat1(0, 0, 0) * mat2(0, 0, 0, 0) + mat1(0, 1, 0) * mat2(0, 0, 1, 0) +
+                                      mat1(0, 0, 1) * mat2(0, 0, 0, 1) + mat1(0, 1, 1) * mat2(0, 0, 1, 1));
+  VERIFY_IS_APPROX(mat3(0, 0, 1), mat1(0, 0, 0) * mat2(0, 1, 0, 0) + mat1(0, 1, 0) * mat2(0, 1, 1, 0) +
+                                      mat1(0, 0, 1) * mat2(0, 1, 0, 1) + mat1(0, 1, 1) * mat2(0, 1, 1, 1));
+  VERIFY_IS_APPROX(mat3(0, 1, 0), mat1(0, 0, 0) * mat2(1, 0, 0, 0) + mat1(0, 1, 0) * mat2(1, 0, 1, 0) +
+                                      mat1(0, 0, 1) * mat2(1, 0, 0, 1) + mat1(0, 1, 1) * mat2(1, 0, 1, 1));
+  VERIFY_IS_APPROX(mat3(0, 1, 1), mat1(0, 0, 0) * mat2(1, 1, 0, 0) + mat1(0, 1, 0) * mat2(1, 1, 1, 0) +
+                                      mat1(0, 0, 1) * mat2(1, 1, 0, 1) + mat1(0, 1, 1) * mat2(1, 1, 1, 1));
+  VERIFY_IS_APPROX(mat3(1, 0, 0), mat1(1, 0, 0) * mat2(0, 0, 0, 0) + mat1(1, 1, 0) * mat2(0, 0, 1, 0) +
+                                      mat1(1, 0, 1) * mat2(0, 0, 0, 1) + mat1(1, 1, 1) * mat2(0, 0, 1, 1));
+  VERIFY_IS_APPROX(mat3(1, 0, 1), mat1(1, 0, 0) * mat2(0, 1, 0, 0) + mat1(1, 1, 0) * mat2(0, 1, 1, 0) +
+                                      mat1(1, 0, 1) * mat2(0, 1, 0, 1) + mat1(1, 1, 1) * mat2(0, 1, 1, 1));
+  VERIFY_IS_APPROX(mat3(1, 1, 0), mat1(1, 0, 0) * mat2(1, 0, 0, 0) + mat1(1, 1, 0) * mat2(1, 0, 1, 0) +
+                                      mat1(1, 0, 1) * mat2(1, 0, 0, 1) + mat1(1, 1, 1) * mat2(1, 0, 1, 1));
+  VERIFY_IS_APPROX(mat3(1, 1, 1), mat1(1, 0, 0) * mat2(1, 1, 0, 0) + mat1(1, 1, 0) * mat2(1, 1, 1, 0) +
+                                      mat1(1, 0, 1) * mat2(1, 1, 0, 1) + mat1(1, 1, 1) * mat2(1, 1, 1, 1));
 
   Tensor<float, 2, DataLayout> mat4(2, 2);
   Tensor<float, 3, DataLayout> mat5(2, 2, 2);
@@ -146,16 +143,16 @@
   typedef TensorEvaluator<decltype(mat4.contract(mat5, dims2)), DefaultDevice> Evaluator2;
   Evaluator2 eval2(mat4.contract(mat5, dims2), DefaultDevice());
   eval2.evalTo(mat6.data());
-  EIGEN_STATIC_ASSERT(Evaluator2::NumDims==1ul, YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT(Evaluator2::NumDims == 1ul, YOU_MADE_A_PROGRAMMING_MISTAKE);
   VERIFY_IS_EQUAL(eval2.dimensions()[0], 2);
 
-  VERIFY_IS_APPROX(mat6(0), mat4(0,0)*mat5(0,0,0) + mat4(1,0)*mat5(0,1,0) +
-                   mat4(0,1)*mat5(1,0,0) + mat4(1,1)*mat5(1,1,0));
-  VERIFY_IS_APPROX(mat6(1), mat4(0,0)*mat5(0,0,1) + mat4(1,0)*mat5(0,1,1) +
-                   mat4(0,1)*mat5(1,0,1) + mat4(1,1)*mat5(1,1,1));
+  VERIFY_IS_APPROX(mat6(0), mat4(0, 0) * mat5(0, 0, 0) + mat4(1, 0) * mat5(0, 1, 0) + mat4(0, 1) * mat5(1, 0, 0) +
+                                mat4(1, 1) * mat5(1, 1, 0));
+  VERIFY_IS_APPROX(mat6(1), mat4(0, 0) * mat5(0, 0, 1) + mat4(1, 0) * mat5(0, 1, 1) + mat4(0, 1) * mat5(1, 0, 1) +
+                                mat4(1, 1) * mat5(1, 1, 1));
 }
 
-template<int DataLayout>
+template <int DataLayout>
 static void test_holes() {
   Tensor<float, 4, DataLayout> t1(2, 5, 7, 3);
   Tensor<float, 5, DataLayout> t2(2, 7, 11, 13, 3);
@@ -176,12 +173,9 @@
         for (int l = 0; l < 5; ++l) {
           for (int m = 0; m < 5; ++m) {
             VERIFY_IS_APPROX(result(i, j, k, l, m),
-                             t1(0, i, j, 0) * t2(0, k, l, m, 0) +
-                             t1(1, i, j, 0) * t2(1, k, l, m, 0) +
-                             t1(0, i, j, 1) * t2(0, k, l, m, 1) +
-                             t1(1, i, j, 1) * t2(1, k, l, m, 1) +
-                             t1(0, i, j, 2) * t2(0, k, l, m, 2) +
-                             t1(1, i, j, 2) * t2(1, k, l, m, 2));
+                             t1(0, i, j, 0) * t2(0, k, l, m, 0) + t1(1, i, j, 0) * t2(1, k, l, m, 0) +
+                                 t1(0, i, j, 1) * t2(0, k, l, m, 1) + t1(1, i, j, 1) * t2(1, k, l, m, 1) +
+                                 t1(0, i, j, 2) * t2(0, k, l, m, 2) + t1(1, i, j, 2) * t2(1, k, l, m, 2));
           }
         }
       }
@@ -189,9 +183,8 @@
   }
 }
 
-template<int DataLayout>
-static void test_full_redux()
-{
+template <int DataLayout>
+static void test_full_redux() {
   Tensor<float, 2, DataLayout> t1(2, 2);
   Tensor<float, 3, DataLayout> t2(2, 2, 2);
   t1.setRandom();
@@ -200,24 +193,23 @@
   Eigen::array<DimPair, 2> dims = {{DimPair(0, 0), DimPair(1, 1)}};
   Tensor<float, 1, DataLayout> result = t1.contract(t2, dims);
   VERIFY_IS_EQUAL(result.dimension(0), 2);
-  VERIFY_IS_APPROX(result(0), t1(0, 0) * t2(0, 0, 0) +  t1(1, 0) * t2(1, 0, 0)
-                            + t1(0, 1) * t2(0, 1, 0) +  t1(1, 1) * t2(1, 1, 0));
-  VERIFY_IS_APPROX(result(1), t1(0, 0) * t2(0, 0, 1) +  t1(1, 0) * t2(1, 0, 1)
-                            + t1(0, 1) * t2(0, 1, 1) +  t1(1, 1) * t2(1, 1, 1));
+  VERIFY_IS_APPROX(result(0),
+                   t1(0, 0) * t2(0, 0, 0) + t1(1, 0) * t2(1, 0, 0) + t1(0, 1) * t2(0, 1, 0) + t1(1, 1) * t2(1, 1, 0));
+  VERIFY_IS_APPROX(result(1),
+                   t1(0, 0) * t2(0, 0, 1) + t1(1, 0) * t2(1, 0, 1) + t1(0, 1) * t2(0, 1, 1) + t1(1, 1) * t2(1, 1, 1));
 
   dims[0] = DimPair(1, 0);
   dims[1] = DimPair(2, 1);
   result = t2.contract(t1, dims);
   VERIFY_IS_EQUAL(result.dimension(0), 2);
-  VERIFY_IS_APPROX(result(0), t1(0, 0) * t2(0, 0, 0) +  t1(1, 0) * t2(0, 1, 0)
-                            + t1(0, 1) * t2(0, 0, 1) +  t1(1, 1) * t2(0, 1, 1));
-  VERIFY_IS_APPROX(result(1), t1(0, 0) * t2(1, 0, 0) +  t1(1, 0) * t2(1, 1, 0)
-                            + t1(0, 1) * t2(1, 0, 1) +  t1(1, 1) * t2(1, 1, 1));
+  VERIFY_IS_APPROX(result(0),
+                   t1(0, 0) * t2(0, 0, 0) + t1(1, 0) * t2(0, 1, 0) + t1(0, 1) * t2(0, 0, 1) + t1(1, 1) * t2(0, 1, 1));
+  VERIFY_IS_APPROX(result(1),
+                   t1(0, 0) * t2(1, 0, 0) + t1(1, 0) * t2(1, 1, 0) + t1(0, 1) * t2(1, 0, 1) + t1(1, 1) * t2(1, 1, 1));
 }
 
-template<int DataLayout>
-static void test_contraction_of_contraction()
-{
+template <int DataLayout>
+static void test_contraction_of_contraction() {
   Tensor<float, 2, DataLayout> t1(2, 2);
   Tensor<float, 2, DataLayout> t2(2, 2);
   Tensor<float, 2, DataLayout> t3(2, 2);
@@ -236,11 +228,9 @@
   VERIFY_IS_EQUAL(result.dimension(0), 2);
   VERIFY_IS_EQUAL(result.dimension(1), 2);
 
-  Eigen::Map<Eigen::Matrix<float, Dynamic, Dynamic, DataLayout>>
-      m1(t1.data(), 2, 2), m2(t2.data(), 2, 2), m3(t3.data(), 2, 2),
-      m4(t4.data(), 2, 2);
-  Eigen::Matrix<float, Dynamic, Dynamic, DataLayout>
-      expected = (m1 * m4) * (m3 - m1 * m2);
+  Eigen::Map<Eigen::Matrix<float, Dynamic, Dynamic, DataLayout>> m1(t1.data(), 2, 2), m2(t2.data(), 2, 2),
+      m3(t3.data(), 2, 2), m4(t4.data(), 2, 2);
+  Eigen::Matrix<float, Dynamic, Dynamic, DataLayout> expected = (m1 * m4) * (m3 - m1 * m2);
 
   VERIFY_IS_APPROX(result(0, 0), expected(0, 0));
   VERIFY_IS_APPROX(result(0, 1), expected(0, 1));
@@ -248,28 +238,26 @@
   VERIFY_IS_APPROX(result(1, 1), expected(1, 1));
 }
 
-template<int DataLayout>
-static void test_expr()
-{
+template <int DataLayout>
+static void test_expr() {
   Tensor<float, 2, DataLayout> mat1(2, 3);
   Tensor<float, 2, DataLayout> mat2(3, 2);
   mat1.setRandom();
   mat2.setRandom();
 
-  Tensor<float, 2, DataLayout> mat3(2,2);
+  Tensor<float, 2, DataLayout> mat3(2, 2);
 
   Eigen::array<DimPair, 1> dims = {{DimPair(1, 0)}};
   mat3 = mat1.contract(mat2, dims);
 
-  VERIFY_IS_APPROX(mat3(0,0), mat1(0,0)*mat2(0,0) + mat1(0,1)*mat2(1,0) + mat1(0,2)*mat2(2,0));
-  VERIFY_IS_APPROX(mat3(0,1), mat1(0,0)*mat2(0,1) + mat1(0,1)*mat2(1,1) + mat1(0,2)*mat2(2,1));
-  VERIFY_IS_APPROX(mat3(1,0), mat1(1,0)*mat2(0,0) + mat1(1,1)*mat2(1,0) + mat1(1,2)*mat2(2,0));
-  VERIFY_IS_APPROX(mat3(1,1), mat1(1,0)*mat2(0,1) + mat1(1,1)*mat2(1,1) + mat1(1,2)*mat2(2,1));
+  VERIFY_IS_APPROX(mat3(0, 0), mat1(0, 0) * mat2(0, 0) + mat1(0, 1) * mat2(1, 0) + mat1(0, 2) * mat2(2, 0));
+  VERIFY_IS_APPROX(mat3(0, 1), mat1(0, 0) * mat2(0, 1) + mat1(0, 1) * mat2(1, 1) + mat1(0, 2) * mat2(2, 1));
+  VERIFY_IS_APPROX(mat3(1, 0), mat1(1, 0) * mat2(0, 0) + mat1(1, 1) * mat2(1, 0) + mat1(1, 2) * mat2(2, 0));
+  VERIFY_IS_APPROX(mat3(1, 1), mat1(1, 0) * mat2(0, 1) + mat1(1, 1) * mat2(1, 1) + mat1(1, 2) * mat2(2, 1));
 }
 
-template<int DataLayout>
-static void test_out_of_order_contraction()
-{
+template <int DataLayout>
+static void test_out_of_order_contraction() {
   Tensor<float, 3, DataLayout> mat1(2, 2, 2);
   Tensor<float, 3, DataLayout> mat2(2, 2, 2);
 
@@ -281,40 +269,30 @@
   Eigen::array<DimPair, 2> dims = {{DimPair(2, 0), DimPair(0, 2)}};
   mat3 = mat1.contract(mat2, dims);
 
-  VERIFY_IS_APPROX(mat3(0, 0),
-                   mat1(0,0,0)*mat2(0,0,0) + mat1(1,0,0)*mat2(0,0,1) +
-                   mat1(0,0,1)*mat2(1,0,0) + mat1(1,0,1)*mat2(1,0,1));
-  VERIFY_IS_APPROX(mat3(1, 0),
-                   mat1(0,1,0)*mat2(0,0,0) + mat1(1,1,0)*mat2(0,0,1) +
-                   mat1(0,1,1)*mat2(1,0,0) + mat1(1,1,1)*mat2(1,0,1));
-  VERIFY_IS_APPROX(mat3(0, 1),
-                   mat1(0,0,0)*mat2(0,1,0) + mat1(1,0,0)*mat2(0,1,1) +
-                   mat1(0,0,1)*mat2(1,1,0) + mat1(1,0,1)*mat2(1,1,1));
-  VERIFY_IS_APPROX(mat3(1, 1),
-                   mat1(0,1,0)*mat2(0,1,0) + mat1(1,1,0)*mat2(0,1,1) +
-                   mat1(0,1,1)*mat2(1,1,0) + mat1(1,1,1)*mat2(1,1,1));
+  VERIFY_IS_APPROX(mat3(0, 0), mat1(0, 0, 0) * mat2(0, 0, 0) + mat1(1, 0, 0) * mat2(0, 0, 1) +
+                                   mat1(0, 0, 1) * mat2(1, 0, 0) + mat1(1, 0, 1) * mat2(1, 0, 1));
+  VERIFY_IS_APPROX(mat3(1, 0), mat1(0, 1, 0) * mat2(0, 0, 0) + mat1(1, 1, 0) * mat2(0, 0, 1) +
+                                   mat1(0, 1, 1) * mat2(1, 0, 0) + mat1(1, 1, 1) * mat2(1, 0, 1));
+  VERIFY_IS_APPROX(mat3(0, 1), mat1(0, 0, 0) * mat2(0, 1, 0) + mat1(1, 0, 0) * mat2(0, 1, 1) +
+                                   mat1(0, 0, 1) * mat2(1, 1, 0) + mat1(1, 0, 1) * mat2(1, 1, 1));
+  VERIFY_IS_APPROX(mat3(1, 1), mat1(0, 1, 0) * mat2(0, 1, 0) + mat1(1, 1, 0) * mat2(0, 1, 1) +
+                                   mat1(0, 1, 1) * mat2(1, 1, 0) + mat1(1, 1, 1) * mat2(1, 1, 1));
 
   Eigen::array<DimPair, 2> dims2 = {{DimPair(0, 2), DimPair(2, 0)}};
   mat3 = mat1.contract(mat2, dims2);
 
-  VERIFY_IS_APPROX(mat3(0, 0),
-                   mat1(0,0,0)*mat2(0,0,0) + mat1(1,0,0)*mat2(0,0,1) +
-                   mat1(0,0,1)*mat2(1,0,0) + mat1(1,0,1)*mat2(1,0,1));
-  VERIFY_IS_APPROX(mat3(1, 0),
-                   mat1(0,1,0)*mat2(0,0,0) + mat1(1,1,0)*mat2(0,0,1) +
-                   mat1(0,1,1)*mat2(1,0,0) + mat1(1,1,1)*mat2(1,0,1));
-  VERIFY_IS_APPROX(mat3(0, 1),
-                   mat1(0,0,0)*mat2(0,1,0) + mat1(1,0,0)*mat2(0,1,1) +
-                   mat1(0,0,1)*mat2(1,1,0) + mat1(1,0,1)*mat2(1,1,1));
-  VERIFY_IS_APPROX(mat3(1, 1),
-                   mat1(0,1,0)*mat2(0,1,0) + mat1(1,1,0)*mat2(0,1,1) +
-                   mat1(0,1,1)*mat2(1,1,0) + mat1(1,1,1)*mat2(1,1,1));
-
+  VERIFY_IS_APPROX(mat3(0, 0), mat1(0, 0, 0) * mat2(0, 0, 0) + mat1(1, 0, 0) * mat2(0, 0, 1) +
+                                   mat1(0, 0, 1) * mat2(1, 0, 0) + mat1(1, 0, 1) * mat2(1, 0, 1));
+  VERIFY_IS_APPROX(mat3(1, 0), mat1(0, 1, 0) * mat2(0, 0, 0) + mat1(1, 1, 0) * mat2(0, 0, 1) +
+                                   mat1(0, 1, 1) * mat2(1, 0, 0) + mat1(1, 1, 1) * mat2(1, 0, 1));
+  VERIFY_IS_APPROX(mat3(0, 1), mat1(0, 0, 0) * mat2(0, 1, 0) + mat1(1, 0, 0) * mat2(0, 1, 1) +
+                                   mat1(0, 0, 1) * mat2(1, 1, 0) + mat1(1, 0, 1) * mat2(1, 1, 1));
+  VERIFY_IS_APPROX(mat3(1, 1), mat1(0, 1, 0) * mat2(0, 1, 0) + mat1(1, 1, 0) * mat2(0, 1, 1) +
+                                   mat1(0, 1, 1) * mat2(1, 1, 0) + mat1(1, 1, 1) * mat2(1, 1, 1));
 }
 
-template<int DataLayout>
-static void test_consistency()
-{
+template <int DataLayout>
+static void test_consistency() {
   // this does something like testing (A*B)^T = (B^T * A^T)
 
   Tensor<float, 3, DataLayout> mat1(4, 3, 5);
@@ -349,9 +327,8 @@
   }
 }
 
-template<int DataLayout>
-static void test_large_contraction()
-{
+template <int DataLayout>
+static void test_large_contraction() {
   Tensor<float, 4, DataLayout> t_left(30, 50, 8, 31);
   Tensor<float, 5, DataLayout> t_right(8, 31, 7, 20, 10);
   Tensor<float, 5, DataLayout> t_result(30, 50, 7, 20, 10);
@@ -381,9 +358,8 @@
   }
 }
 
-template<int DataLayout>
-static void test_matrix_vector()
-{
+template <int DataLayout>
+static void test_matrix_vector() {
   Tensor<float, 2, DataLayout> t_left(30, 50);
   Tensor<float, 1, DataLayout> t_right(50);
   Tensor<float, 1, DataLayout> t_result(30);
@@ -408,10 +384,8 @@
   }
 }
 
-
-template<int DataLayout>
-static void test_tensor_vector()
-{
+template <int DataLayout>
+static void test_tensor_vector() {
   Tensor<float, 3, DataLayout> t_left(7, 13, 17);
   Tensor<float, 2, DataLayout> t_right(1, 7);
 
@@ -423,7 +397,7 @@
   Tensor<float, 3, DataLayout> t_result = t_left.contract(t_right, dim_pair01);
 
   typedef Map<Eigen::Matrix<float, Dynamic, Dynamic, DataLayout>> MapXf;
-  MapXf m_left(t_left.data(), 7, 13*17);
+  MapXf m_left(t_left.data(), 7, 13 * 17);
   MapXf m_right(t_right.data(), 1, 7);
   Eigen::Matrix<float, Dynamic, Dynamic, DataLayout> m_result = m_left.transpose() * m_right.transpose();
 
@@ -432,10 +406,8 @@
   }
 }
 
-
-template<int DataLayout>
-static void test_small_blocking_factors()
-{
+template <int DataLayout>
+static void test_small_blocking_factors() {
   Tensor<float, 4, DataLayout> t_left(30, 5, 3, 31);
   Tensor<float, 5, DataLayout> t_right(3, 31, 7, 20, 1);
   t_left.setRandom();
@@ -463,9 +435,8 @@
   }
 }
 
-template<int DataLayout>
-static void test_tensor_product()
-{
+template <int DataLayout>
+static void test_tensor_product() {
   Tensor<float, 2, DataLayout> mat1(2, 3);
   Tensor<float, 2, DataLayout> mat2(4, 1);
   mat1.setRandom();
@@ -482,42 +453,39 @@
     for (int j = 0; j < result.dimension(1); ++j) {
       for (int k = 0; k < result.dimension(2); ++k) {
         for (int l = 0; l < result.dimension(3); ++l) {
-			VERIFY_IS_APPROX(result(i, j, k, l), mat1(i, j) * mat2(k, l) );
+          VERIFY_IS_APPROX(result(i, j, k, l), mat1(i, j) * mat2(k, l));
         }
       }
     }
   }
 }
 
-
-template<int DataLayout>
-static void test_const_inputs()
-{
+template <int DataLayout>
+static void test_const_inputs() {
   Tensor<float, 2, DataLayout> in1(2, 3);
   Tensor<float, 2, DataLayout> in2(3, 2);
   in1.setRandom();
   in2.setRandom();
 
-  TensorMap<Tensor<const float, 2, DataLayout> > mat1(in1.data(), 2, 3);
-  TensorMap<Tensor<const float, 2, DataLayout> > mat2(in2.data(), 3, 2);
-  Tensor<float, 2, DataLayout> mat3(2,2);
+  TensorMap<Tensor<const float, 2, DataLayout>> mat1(in1.data(), 2, 3);
+  TensorMap<Tensor<const float, 2, DataLayout>> mat2(in2.data(), 3, 2);
+  Tensor<float, 2, DataLayout> mat3(2, 2);
 
   Eigen::array<DimPair, 1> dims = {{DimPair(1, 0)}};
   mat3 = mat1.contract(mat2, dims);
 
-  VERIFY_IS_APPROX(mat3(0,0), mat1(0,0)*mat2(0,0) + mat1(0,1)*mat2(1,0) + mat1(0,2)*mat2(2,0));
-  VERIFY_IS_APPROX(mat3(0,1), mat1(0,0)*mat2(0,1) + mat1(0,1)*mat2(1,1) + mat1(0,2)*mat2(2,1));
-  VERIFY_IS_APPROX(mat3(1,0), mat1(1,0)*mat2(0,0) + mat1(1,1)*mat2(1,0) + mat1(1,2)*mat2(2,0));
-  VERIFY_IS_APPROX(mat3(1,1), mat1(1,0)*mat2(0,1) + mat1(1,1)*mat2(1,1) + mat1(1,2)*mat2(2,1));
+  VERIFY_IS_APPROX(mat3(0, 0), mat1(0, 0) * mat2(0, 0) + mat1(0, 1) * mat2(1, 0) + mat1(0, 2) * mat2(2, 0));
+  VERIFY_IS_APPROX(mat3(0, 1), mat1(0, 0) * mat2(0, 1) + mat1(0, 1) * mat2(1, 1) + mat1(0, 2) * mat2(2, 1));
+  VERIFY_IS_APPROX(mat3(1, 0), mat1(1, 0) * mat2(0, 0) + mat1(1, 1) * mat2(1, 0) + mat1(1, 2) * mat2(2, 0));
+  VERIFY_IS_APPROX(mat3(1, 1), mat1(1, 0) * mat2(0, 1) + mat1(1, 1) * mat2(1, 1) + mat1(1, 2) * mat2(2, 1));
 }
 
 // Apply Sqrt to all output elements.
 struct SqrtOutputKernel {
   template <typename Index, typename Scalar>
-  EIGEN_ALWAYS_INLINE void operator()(
-      const internal::blas_data_mapper<Scalar, Index, ColMajor>& output_mapper,
-      const TensorContractionParams&, Index, Index, Index num_rows,
-      Index num_cols) const {
+  EIGEN_ALWAYS_INLINE void operator()(const internal::blas_data_mapper<Scalar, Index, ColMajor>& output_mapper,
+                                      const TensorContractionParams&, Index, Index, Index num_rows,
+                                      Index num_cols) const {
     for (int i = 0; i < num_rows; ++i) {
       for (int j = 0; j < num_cols; ++j) {
         output_mapper(i, j) = std::sqrt(output_mapper(i, j));
@@ -560,8 +528,7 @@
   }
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_contraction)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_contraction) {
   CALL_SUBTEST_1(test_evals<ColMajor>());
   CALL_SUBTEST_1(test_evals<RowMajor>());
   CALL_SUBTEST_1(test_scalar<ColMajor>());
@@ -597,5 +564,4 @@
 
   // Force CMake to split this test.
   // EIGEN_SUFFIXES;1;2;3;4;5;6;7;8
-
 }
diff --git a/unsupported/test/cxx11_tensor_convolution.cpp b/unsupported/test/cxx11_tensor_convolution.cpp
index c3688f6..c921865 100644
--- a/unsupported/test/cxx11_tensor_convolution.cpp
+++ b/unsupported/test/cxx11_tensor_convolution.cpp
@@ -11,19 +11,18 @@
 
 #include <Eigen/CXX11/Tensor>
 
-using Eigen::Tensor;
 using Eigen::DefaultDevice;
+using Eigen::Tensor;
 
 template <int DataLayout>
-static void test_evals()
-{
+static void test_evals() {
   Tensor<float, 2, DataLayout> input(3, 3);
   Tensor<float, 1, DataLayout> kernel(2);
 
   input.setRandom();
   kernel.setRandom();
 
-  Tensor<float, 2, DataLayout> result(2,3);
+  Tensor<float, 2, DataLayout> result(2, 3);
   result.setZero();
   Eigen::array<Tensor<float, 2>::Index, 1> dims3;
   dims3[0] = 0;
@@ -31,40 +30,39 @@
   typedef TensorEvaluator<decltype(input.convolve(kernel, dims3)), DefaultDevice> Evaluator;
   Evaluator eval(input.convolve(kernel, dims3), DefaultDevice());
   eval.evalTo(result.data());
-  EIGEN_STATIC_ASSERT(Evaluator::NumDims==2ul, YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT(Evaluator::NumDims == 2ul, YOU_MADE_A_PROGRAMMING_MISTAKE);
   VERIFY_IS_EQUAL(eval.dimensions()[0], 2);
   VERIFY_IS_EQUAL(eval.dimensions()[1], 3);
 
-  VERIFY_IS_APPROX(result(0,0), input(0,0)*kernel(0) + input(1,0)*kernel(1));  // index 0
-  VERIFY_IS_APPROX(result(0,1), input(0,1)*kernel(0) + input(1,1)*kernel(1));  // index 2
-  VERIFY_IS_APPROX(result(0,2), input(0,2)*kernel(0) + input(1,2)*kernel(1));  // index 4
-  VERIFY_IS_APPROX(result(1,0), input(1,0)*kernel(0) + input(2,0)*kernel(1));  // index 1
-  VERIFY_IS_APPROX(result(1,1), input(1,1)*kernel(0) + input(2,1)*kernel(1));  // index 3
-  VERIFY_IS_APPROX(result(1,2), input(1,2)*kernel(0) + input(2,2)*kernel(1));  // index 5
+  VERIFY_IS_APPROX(result(0, 0), input(0, 0) * kernel(0) + input(1, 0) * kernel(1));  // index 0
+  VERIFY_IS_APPROX(result(0, 1), input(0, 1) * kernel(0) + input(1, 1) * kernel(1));  // index 2
+  VERIFY_IS_APPROX(result(0, 2), input(0, 2) * kernel(0) + input(1, 2) * kernel(1));  // index 4
+  VERIFY_IS_APPROX(result(1, 0), input(1, 0) * kernel(0) + input(2, 0) * kernel(1));  // index 1
+  VERIFY_IS_APPROX(result(1, 1), input(1, 1) * kernel(0) + input(2, 1) * kernel(1));  // index 3
+  VERIFY_IS_APPROX(result(1, 2), input(1, 2) * kernel(0) + input(2, 2) * kernel(1));  // index 5
 }
 
 template <int DataLayout>
-static void test_expr()
-{
+static void test_expr() {
   Tensor<float, 2, DataLayout> input(3, 3);
   Tensor<float, 2, DataLayout> kernel(2, 2);
   input.setRandom();
   kernel.setRandom();
 
-  Tensor<float, 2, DataLayout> result(2,2);
+  Tensor<float, 2, DataLayout> result(2, 2);
   Eigen::array<ptrdiff_t, 2> dims;
   dims[0] = 0;
   dims[1] = 1;
   result = input.convolve(kernel, dims);
 
-  VERIFY_IS_APPROX(result(0,0), input(0,0)*kernel(0,0) + input(0,1)*kernel(0,1) +
-                                input(1,0)*kernel(1,0) + input(1,1)*kernel(1,1));
-  VERIFY_IS_APPROX(result(0,1), input(0,1)*kernel(0,0) + input(0,2)*kernel(0,1) +
-                                input(1,1)*kernel(1,0) + input(1,2)*kernel(1,1));
-  VERIFY_IS_APPROX(result(1,0), input(1,0)*kernel(0,0) + input(1,1)*kernel(0,1) +
-                                input(2,0)*kernel(1,0) + input(2,1)*kernel(1,1));
-  VERIFY_IS_APPROX(result(1,1), input(1,1)*kernel(0,0) + input(1,2)*kernel(0,1) +
-                                input(2,1)*kernel(1,0) + input(2,2)*kernel(1,1));
+  VERIFY_IS_APPROX(result(0, 0), input(0, 0) * kernel(0, 0) + input(0, 1) * kernel(0, 1) + input(1, 0) * kernel(1, 0) +
+                                     input(1, 1) * kernel(1, 1));
+  VERIFY_IS_APPROX(result(0, 1), input(0, 1) * kernel(0, 0) + input(0, 2) * kernel(0, 1) + input(1, 1) * kernel(1, 0) +
+                                     input(1, 2) * kernel(1, 1));
+  VERIFY_IS_APPROX(result(1, 0), input(1, 0) * kernel(0, 0) + input(1, 1) * kernel(0, 1) + input(2, 0) * kernel(1, 0) +
+                                     input(2, 1) * kernel(1, 1));
+  VERIFY_IS_APPROX(result(1, 1), input(1, 1) * kernel(0, 0) + input(1, 2) * kernel(0, 1) + input(2, 1) * kernel(1, 0) +
+                                     input(2, 2) * kernel(1, 1));
 }
 
 template <int DataLayout>
@@ -131,14 +129,11 @@
   result = input.stride(stride_of_3).convolve(kernel, dims).stride(stride_of_2);
 
   VERIFY_IS_EQUAL(result.dimension(0), 2);
-  VERIFY_IS_APPROX(result(0), (input(0)*kernel(0) + input(3)*kernel(1) +
-                               input(6)*kernel(2)));
-  VERIFY_IS_APPROX(result(1), (input(6)*kernel(0) + input(9)*kernel(1) +
-                               input(12)*kernel(2)));
+  VERIFY_IS_APPROX(result(0), (input(0) * kernel(0) + input(3) * kernel(1) + input(6) * kernel(2)));
+  VERIFY_IS_APPROX(result(1), (input(6) * kernel(0) + input(9) * kernel(1) + input(12) * kernel(2)));
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_convolution)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_convolution) {
   CALL_SUBTEST(test_evals<ColMajor>());
   CALL_SUBTEST(test_evals<RowMajor>());
   CALL_SUBTEST(test_expr<ColMajor>());
diff --git a/unsupported/test/cxx11_tensor_convolution_sycl.cpp b/unsupported/test/cxx11_tensor_convolution_sycl.cpp
index 3954c8a..350ac33 100644
--- a/unsupported/test/cxx11_tensor_convolution_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_convolution_sycl.cpp
@@ -29,26 +29,24 @@
 using Eigen::SyclDevice;
 using Eigen::Tensor;
 using Eigen::TensorMap;
-static const float error_threshold =1e-4f;
-
+static const float error_threshold = 1e-4f;
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_larg_expr1D(const Eigen::SyclDevice& sycl_device)
-{
-  IndexType indim0 =53;
-  IndexType indim1= 55;
-  IndexType indim2= 51;
-  IndexType outdim0=50;
-  IndexType outdim1=55;
-  IndexType outdim2=51;
+static void test_larg_expr1D(const Eigen::SyclDevice& sycl_device) {
+  IndexType indim0 = 53;
+  IndexType indim1 = 55;
+  IndexType indim2 = 51;
+  IndexType outdim0 = 50;
+  IndexType outdim1 = 55;
+  IndexType outdim2 = 51;
   Eigen::array<IndexType, 3> input_dims = {{indim0, indim1, indim2}};
   Eigen::array<IndexType, 1> kernel_dims = {{4}};
   Eigen::array<IndexType, 3> result_dims = {{outdim0, outdim1, outdim2}};
 
   Tensor<DataType, 3, DataLayout, IndexType> input(input_dims);
-  Tensor<DataType, 1, DataLayout,IndexType> kernel(kernel_dims);
-  Tensor<DataType, 3, DataLayout,IndexType> result(result_dims);
-  Tensor<DataType, 3, DataLayout,IndexType> result_host(result_dims);
+  Tensor<DataType, 1, DataLayout, IndexType> kernel(kernel_dims);
+  Tensor<DataType, 3, DataLayout, IndexType> result(result_dims);
+  Tensor<DataType, 3, DataLayout, IndexType> result_host(result_dims);
 
   Eigen::array<IndexType, 1> dims3{{0}};
 
@@ -57,13 +55,13 @@
   result.setZero();
   result_host.setZero();
 
-  std::size_t input_bytes = input.size()  * sizeof(DataType);
+  std::size_t input_bytes = input.size() * sizeof(DataType);
   std::size_t kernel_bytes = kernel.size() * sizeof(DataType);
   std::size_t result_bytes = result.size() * sizeof(DataType);
 
-  DataType * d_input  = static_cast<DataType*>(sycl_device.allocate(input_bytes));
-  DataType * d_kernel  = static_cast<DataType*>(sycl_device.allocate(kernel_bytes));
-  DataType * d_result =  static_cast<DataType*>(sycl_device.allocate(result_bytes));
+  DataType* d_input = static_cast<DataType*>(sycl_device.allocate(input_bytes));
+  DataType* d_kernel = static_cast<DataType*>(sycl_device.allocate(kernel_bytes));
+  DataType* d_result = static_cast<DataType*>(sycl_device.allocate(result_bytes));
 
   Eigen::TensorMap<Eigen::Tensor<DataType, 3, DataLayout, IndexType> > gpu_input(d_input, input_dims);
   Eigen::TensorMap<Eigen::Tensor<DataType, 1, DataLayout, IndexType> > gpu_kernel(d_kernel, kernel_dims);
@@ -71,60 +69,59 @@
   sycl_device.memcpyHostToDevice(d_input, input.data(), input_bytes);
   sycl_device.memcpyHostToDevice(d_kernel, kernel.data(), kernel_bytes);
 
-  gpu_result.device(sycl_device)=gpu_input.convolve(gpu_kernel, dims3);
+  gpu_result.device(sycl_device) = gpu_input.convolve(gpu_kernel, dims3);
   sycl_device.memcpyDeviceToHost(result.data(), d_result, result_bytes);
 
-  result_host=input.convolve(kernel, dims3);
+  result_host = input.convolve(kernel, dims3);
 
-for(IndexType i=0; i< outdim0; i++ ){
-  for(IndexType j=0; j< outdim1; j++ ){
-    for(IndexType k=0; k< outdim2; k++ ){
-      if (!(Eigen::internal::isApprox(result(i,j,k), result_host(i,j,k), error_threshold))) {
-        std::cout <<std::setprecision(16)<< "mismatch detected at index  ( "<< i  << " , "  << j  << ", " << k << " ) " << " \t " << result(i,j,k) << " vs "<<  result_host(i,j,k) << std::endl;
-        assert(false);
+  for (IndexType i = 0; i < outdim0; i++) {
+    for (IndexType j = 0; j < outdim1; j++) {
+      for (IndexType k = 0; k < outdim2; k++) {
+        if (!(Eigen::internal::isApprox(result(i, j, k), result_host(i, j, k), error_threshold))) {
+          std::cout << std::setprecision(16) << "mismatch detected at index  ( " << i << " , " << j << ", " << k
+                    << " ) "
+                    << " \t " << result(i, j, k) << " vs " << result_host(i, j, k) << std::endl;
+          assert(false);
+        }
       }
     }
   }
-}
   sycl_device.deallocate(d_input);
   sycl_device.deallocate(d_kernel);
   sycl_device.deallocate(d_result);
-
 }
 
-
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_larg_expr2D(const Eigen::SyclDevice& sycl_device)
-{
-  IndexType indim0 =53;
-  IndexType indim1= 55;
-  IndexType indim2= 51;
-  IndexType outdim0=50;
-  IndexType outdim1=51;
-  IndexType outdim2=51;
+static void test_larg_expr2D(const Eigen::SyclDevice& sycl_device) {
+  IndexType indim0 = 53;
+  IndexType indim1 = 55;
+  IndexType indim2 = 51;
+  IndexType outdim0 = 50;
+  IndexType outdim1 = 51;
+  IndexType outdim2 = 51;
   Eigen::array<IndexType, 3> input_dims = {{indim0, indim1, indim2}};
-  Eigen::array<IndexType, 2> kernel_dims = {{4,5}};
+  Eigen::array<IndexType, 2> kernel_dims = {{4, 5}};
   Eigen::array<IndexType, 3> result_dims = {{outdim0, outdim1, outdim2}};
 
   Tensor<DataType, 3, DataLayout, IndexType> input(input_dims);
-  Tensor<DataType, 2, DataLayout,IndexType> kernel(kernel_dims);
-  Tensor<DataType, 3, DataLayout,IndexType> result(result_dims);
-  Tensor<DataType, 3, DataLayout,IndexType> result_host(result_dims);
+  Tensor<DataType, 2, DataLayout, IndexType> kernel(kernel_dims);
+  Tensor<DataType, 3, DataLayout, IndexType> result(result_dims);
+  Tensor<DataType, 3, DataLayout, IndexType> result_host(result_dims);
 
-  Eigen::array<IndexType, 2> dims3{{0,1}};
+  Eigen::array<IndexType, 2> dims3{{0, 1}};
 
   input.setRandom();
   kernel.setRandom();
   result.setZero();
   result_host.setZero();
 
-  std::size_t input_bytes = input.size()  * sizeof(DataType);
+  std::size_t input_bytes = input.size() * sizeof(DataType);
   std::size_t kernel_bytes = kernel.size() * sizeof(DataType);
   std::size_t result_bytes = result.size() * sizeof(DataType);
 
-  DataType * d_input  = static_cast<DataType*>(sycl_device.allocate(input_bytes));
-  DataType * d_kernel  = static_cast<DataType*>(sycl_device.allocate(kernel_bytes));
-  DataType * d_result =  static_cast<DataType*>(sycl_device.allocate(result_bytes));
+  DataType* d_input = static_cast<DataType*>(sycl_device.allocate(input_bytes));
+  DataType* d_kernel = static_cast<DataType*>(sycl_device.allocate(kernel_bytes));
+  DataType* d_result = static_cast<DataType*>(sycl_device.allocate(result_bytes));
 
   Eigen::TensorMap<Eigen::Tensor<DataType, 3, DataLayout, IndexType> > gpu_input(d_input, input_dims);
   Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType> > gpu_kernel(d_kernel, kernel_dims);
@@ -132,60 +129,59 @@
   sycl_device.memcpyHostToDevice(d_input, input.data(), input_bytes);
   sycl_device.memcpyHostToDevice(d_kernel, kernel.data(), kernel_bytes);
 
-  gpu_result.device(sycl_device)=gpu_input.convolve(gpu_kernel, dims3);
+  gpu_result.device(sycl_device) = gpu_input.convolve(gpu_kernel, dims3);
   sycl_device.memcpyDeviceToHost(result.data(), d_result, result_bytes);
 
-  result_host=input.convolve(kernel, dims3);
+  result_host = input.convolve(kernel, dims3);
 
-for(IndexType i=0; i< outdim0; i++ ){
-  for(IndexType j=0; j< outdim1; j++ ){
-    for(IndexType k=0; k< outdim2; k++ ){
-      if (!(Eigen::internal::isApprox(result(i,j,k), result_host(i,j,k), error_threshold))) {
-        std::cout <<std::setprecision(16)<< "mismatch detected at index  ( "<< i  << " , "  << j  << ", " << k << " ) " << " \t " << result(i,j,k) << " vs "<<  result_host(i,j,k) << std::endl;
-        assert(false);
+  for (IndexType i = 0; i < outdim0; i++) {
+    for (IndexType j = 0; j < outdim1; j++) {
+      for (IndexType k = 0; k < outdim2; k++) {
+        if (!(Eigen::internal::isApprox(result(i, j, k), result_host(i, j, k), error_threshold))) {
+          std::cout << std::setprecision(16) << "mismatch detected at index  ( " << i << " , " << j << ", " << k
+                    << " ) "
+                    << " \t " << result(i, j, k) << " vs " << result_host(i, j, k) << std::endl;
+          assert(false);
+        }
       }
     }
   }
-}
   sycl_device.deallocate(d_input);
   sycl_device.deallocate(d_kernel);
   sycl_device.deallocate(d_result);
-
 }
 
-
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_larg_expr3D(const Eigen::SyclDevice& sycl_device)
-{
-  IndexType indim0 =53;
-  IndexType indim1= 55;
-  IndexType indim2= 51;
-  IndexType outdim0=50;
-  IndexType outdim1=51;
-  IndexType outdim2=49;
+static void test_larg_expr3D(const Eigen::SyclDevice& sycl_device) {
+  IndexType indim0 = 53;
+  IndexType indim1 = 55;
+  IndexType indim2 = 51;
+  IndexType outdim0 = 50;
+  IndexType outdim1 = 51;
+  IndexType outdim2 = 49;
   Eigen::array<IndexType, 3> input_dims = {{indim0, indim1, indim2}};
-  Eigen::array<IndexType, 3> kernel_dims = {{4,5,3}};
+  Eigen::array<IndexType, 3> kernel_dims = {{4, 5, 3}};
   Eigen::array<IndexType, 3> result_dims = {{outdim0, outdim1, outdim2}};
 
   Tensor<DataType, 3, DataLayout, IndexType> input(input_dims);
-  Tensor<DataType, 3, DataLayout,IndexType> kernel(kernel_dims);
-  Tensor<DataType, 3, DataLayout,IndexType> result(result_dims);
-  Tensor<DataType, 3, DataLayout,IndexType> result_host(result_dims);
+  Tensor<DataType, 3, DataLayout, IndexType> kernel(kernel_dims);
+  Tensor<DataType, 3, DataLayout, IndexType> result(result_dims);
+  Tensor<DataType, 3, DataLayout, IndexType> result_host(result_dims);
 
-  Eigen::array<IndexType, 3> dims3{{0,1,2}};
+  Eigen::array<IndexType, 3> dims3{{0, 1, 2}};
 
   input.setRandom();
   kernel.setRandom();
   result.setZero();
   result_host.setZero();
 
-  std::size_t input_bytes = input.size()  * sizeof(DataType);
+  std::size_t input_bytes = input.size() * sizeof(DataType);
   std::size_t kernel_bytes = kernel.size() * sizeof(DataType);
   std::size_t result_bytes = result.size() * sizeof(DataType);
 
-  DataType * d_input  = static_cast<DataType*>(sycl_device.allocate(input_bytes));
-  DataType * d_kernel  = static_cast<DataType*>(sycl_device.allocate(kernel_bytes));
-  DataType * d_result =  static_cast<DataType*>(sycl_device.allocate(result_bytes));
+  DataType* d_input = static_cast<DataType*>(sycl_device.allocate(input_bytes));
+  DataType* d_kernel = static_cast<DataType*>(sycl_device.allocate(kernel_bytes));
+  DataType* d_result = static_cast<DataType*>(sycl_device.allocate(result_bytes));
 
   Eigen::TensorMap<Eigen::Tensor<DataType, 3, DataLayout, IndexType> > gpu_input(d_input, input_dims);
   Eigen::TensorMap<Eigen::Tensor<DataType, 3, DataLayout, IndexType> > gpu_kernel(d_kernel, kernel_dims);
@@ -193,38 +189,37 @@
   sycl_device.memcpyHostToDevice(d_input, input.data(), input_bytes);
   sycl_device.memcpyHostToDevice(d_kernel, kernel.data(), kernel_bytes);
 
-  gpu_result.device(sycl_device)=gpu_input.convolve(gpu_kernel, dims3);
+  gpu_result.device(sycl_device) = gpu_input.convolve(gpu_kernel, dims3);
   sycl_device.memcpyDeviceToHost(result.data(), d_result, result_bytes);
 
-  result_host=input.convolve(kernel, dims3);
+  result_host = input.convolve(kernel, dims3);
 
-for(IndexType i=0; i< outdim0; i++ ){
-  for(IndexType j=0; j< outdim1; j++ ){
-    for(IndexType k=0; k< outdim2; k++ ){
-      if (!(Eigen::internal::isApprox(result(i,j,k), result_host(i,j,k), error_threshold))) {
-        std::cout <<std::setprecision(16)<< "mismatch detected at index  ( "<< i  << " , "  << j  << ", " << k << " ) " << " \t " << result(i,j,k) << " vs "<<  result_host(i,j,k) << std::endl;
-        assert(false);
+  for (IndexType i = 0; i < outdim0; i++) {
+    for (IndexType j = 0; j < outdim1; j++) {
+      for (IndexType k = 0; k < outdim2; k++) {
+        if (!(Eigen::internal::isApprox(result(i, j, k), result_host(i, j, k), error_threshold))) {
+          std::cout << std::setprecision(16) << "mismatch detected at index  ( " << i << " , " << j << ", " << k
+                    << " ) "
+                    << " \t " << result(i, j, k) << " vs " << result_host(i, j, k) << std::endl;
+          assert(false);
+        }
       }
     }
   }
-}
   sycl_device.deallocate(d_input);
   sycl_device.deallocate(d_kernel);
   sycl_device.deallocate(d_result);
-
 }
 
-
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_evals(const Eigen::SyclDevice& sycl_device)
-{
+static void test_evals(const Eigen::SyclDevice& sycl_device) {
   Eigen::array<IndexType, 2> input_dims = {{3, 3}};
   Eigen::array<IndexType, 1> kernel_dims = {{2}};
   Eigen::array<IndexType, 2> result_dims = {{2, 3}};
 
   Tensor<DataType, 2, DataLayout, IndexType> input(input_dims);
-  Tensor<DataType, 1, DataLayout,IndexType> kernel(kernel_dims);
-  Tensor<DataType, 2, DataLayout,IndexType> result(result_dims);
+  Tensor<DataType, 1, DataLayout, IndexType> kernel(kernel_dims);
+  Tensor<DataType, 2, DataLayout, IndexType> result(result_dims);
 
   Eigen::array<IndexType, 1> dims3{{0}};
 
@@ -232,13 +227,13 @@
   kernel.setRandom();
   result.setZero();
 
-  std::size_t input_bytes = input.size()  * sizeof(DataType);
+  std::size_t input_bytes = input.size() * sizeof(DataType);
   std::size_t kernel_bytes = kernel.size() * sizeof(DataType);
   std::size_t result_bytes = result.size() * sizeof(DataType);
 
-  DataType * d_input  = static_cast<DataType*>(sycl_device.allocate(input_bytes));
-  DataType * d_kernel  = static_cast<DataType*>(sycl_device.allocate(kernel_bytes));
-  DataType * d_result =  static_cast<DataType*>(sycl_device.allocate(result_bytes));
+  DataType* d_input = static_cast<DataType*>(sycl_device.allocate(input_bytes));
+  DataType* d_kernel = static_cast<DataType*>(sycl_device.allocate(kernel_bytes));
+  DataType* d_result = static_cast<DataType*>(sycl_device.allocate(result_bytes));
 
   Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType> > gpu_input(d_input, input_dims);
   Eigen::TensorMap<Eigen::Tensor<DataType, 1, DataLayout, IndexType> > gpu_kernel(d_kernel, kernel_dims);
@@ -246,15 +241,15 @@
   sycl_device.memcpyHostToDevice(d_input, input.data(), input_bytes);
   sycl_device.memcpyHostToDevice(d_kernel, kernel.data(), kernel_bytes);
 
-  gpu_result.device(sycl_device)=gpu_input.convolve(gpu_kernel, dims3);
+  gpu_result.device(sycl_device) = gpu_input.convolve(gpu_kernel, dims3);
   sycl_device.memcpyDeviceToHost(result.data(), d_result, result_bytes);
 
-  VERIFY_IS_APPROX(result(0,0), input(0,0)*kernel(0) + input(1,0)*kernel(1));  // index 0
-  VERIFY_IS_APPROX(result(0,1), input(0,1)*kernel(0) + input(1,1)*kernel(1));  // index 2
-  VERIFY_IS_APPROX(result(0,2), input(0,2)*kernel(0) + input(1,2)*kernel(1));  // index 4
-  VERIFY_IS_APPROX(result(1,0), input(1,0)*kernel(0) + input(2,0)*kernel(1));  // index 1
-  VERIFY_IS_APPROX(result(1,1), input(1,1)*kernel(0) + input(2,1)*kernel(1));  // index 3
-  VERIFY_IS_APPROX(result(1,2), input(1,2)*kernel(0) + input(2,2)*kernel(1));  // index 5
+  VERIFY_IS_APPROX(result(0, 0), input(0, 0) * kernel(0) + input(1, 0) * kernel(1));  // index 0
+  VERIFY_IS_APPROX(result(0, 1), input(0, 1) * kernel(0) + input(1, 1) * kernel(1));  // index 2
+  VERIFY_IS_APPROX(result(0, 2), input(0, 2) * kernel(0) + input(1, 2) * kernel(1));  // index 4
+  VERIFY_IS_APPROX(result(1, 0), input(1, 0) * kernel(0) + input(2, 0) * kernel(1));  // index 1
+  VERIFY_IS_APPROX(result(1, 1), input(1, 1) * kernel(0) + input(2, 1) * kernel(1));  // index 3
+  VERIFY_IS_APPROX(result(1, 2), input(1, 2) * kernel(0) + input(2, 2) * kernel(1));  // index 5
 
   sycl_device.deallocate(d_input);
   sycl_device.deallocate(d_kernel);
@@ -262,8 +257,7 @@
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_expr(const Eigen::SyclDevice& sycl_device)
-{
+static void test_expr(const Eigen::SyclDevice& sycl_device) {
   Eigen::array<IndexType, 2> input_dims = {{3, 3}};
   Eigen::array<IndexType, 2> kernel_dims = {{2, 2}};
   Eigen::array<IndexType, 2> result_dims = {{2, 2}};
@@ -278,51 +272,49 @@
   dims[0] = 0;
   dims[1] = 1;
 
-  std::size_t input_bytes = input.size()  * sizeof(DataType);
+  std::size_t input_bytes = input.size() * sizeof(DataType);
   std::size_t kernel_bytes = kernel.size() * sizeof(DataType);
   std::size_t result_bytes = result.size() * sizeof(DataType);
 
-  DataType * d_input  = static_cast<DataType*>(sycl_device.allocate(input_bytes));
-  DataType * d_kernel  = static_cast<DataType*>(sycl_device.allocate(kernel_bytes));
-  DataType * d_result =  static_cast<DataType*>(sycl_device.allocate(result_bytes));
+  DataType* d_input = static_cast<DataType*>(sycl_device.allocate(input_bytes));
+  DataType* d_kernel = static_cast<DataType*>(sycl_device.allocate(kernel_bytes));
+  DataType* d_result = static_cast<DataType*>(sycl_device.allocate(result_bytes));
 
-  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout,IndexType> > gpu_input(d_input, input_dims);
-  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout,IndexType> > gpu_kernel(d_kernel, kernel_dims);
-  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout,IndexType> > gpu_result(d_result, result_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType> > gpu_input(d_input, input_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType> > gpu_kernel(d_kernel, kernel_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType> > gpu_result(d_result, result_dims);
   sycl_device.memcpyHostToDevice(d_input, input.data(), input_bytes);
   sycl_device.memcpyHostToDevice(d_kernel, kernel.data(), kernel_bytes);
 
-  gpu_result.device(sycl_device)=gpu_input.convolve(gpu_kernel, dims);
+  gpu_result.device(sycl_device) = gpu_input.convolve(gpu_kernel, dims);
   sycl_device.memcpyDeviceToHost(result.data(), d_result, result_bytes);
 
-  VERIFY_IS_APPROX(result(0,0), input(0,0)*kernel(0,0) + input(0,1)*kernel(0,1) +
-                                input(1,0)*kernel(1,0) + input(1,1)*kernel(1,1));
-  VERIFY_IS_APPROX(result(0,1), input(0,1)*kernel(0,0) + input(0,2)*kernel(0,1) +
-                                input(1,1)*kernel(1,0) + input(1,2)*kernel(1,1));
-  VERIFY_IS_APPROX(result(1,0), input(1,0)*kernel(0,0) + input(1,1)*kernel(0,1) +
-                                input(2,0)*kernel(1,0) + input(2,1)*kernel(1,1));
-  VERIFY_IS_APPROX(result(1,1), input(1,1)*kernel(0,0) + input(1,2)*kernel(0,1) +
-                                input(2,1)*kernel(1,0) + input(2,2)*kernel(1,1));
+  VERIFY_IS_APPROX(result(0, 0), input(0, 0) * kernel(0, 0) + input(0, 1) * kernel(0, 1) + input(1, 0) * kernel(1, 0) +
+                                     input(1, 1) * kernel(1, 1));
+  VERIFY_IS_APPROX(result(0, 1), input(0, 1) * kernel(0, 0) + input(0, 2) * kernel(0, 1) + input(1, 1) * kernel(1, 0) +
+                                     input(1, 2) * kernel(1, 1));
+  VERIFY_IS_APPROX(result(1, 0), input(1, 0) * kernel(0, 0) + input(1, 1) * kernel(0, 1) + input(2, 0) * kernel(1, 0) +
+                                     input(2, 1) * kernel(1, 1));
+  VERIFY_IS_APPROX(result(1, 1), input(1, 1) * kernel(0, 0) + input(1, 2) * kernel(0, 1) + input(2, 1) * kernel(1, 0) +
+                                     input(2, 2) * kernel(1, 1));
 
   sycl_device.deallocate(d_input);
   sycl_device.deallocate(d_kernel);
   sycl_device.deallocate(d_result);
 }
 
-
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_modes(const Eigen::SyclDevice& sycl_device){
+static void test_modes(const Eigen::SyclDevice& sycl_device) {
+  Eigen::array<IndexType, 1> input_dims = {{3}};
+  Eigen::array<IndexType, 1> kernel_dims = {{3}};
 
-Eigen::array<IndexType, 1> input_dims = {{3}};
-Eigen::array<IndexType, 1> kernel_dims = {{3}};
+  Tensor<DataType, 1, DataLayout, IndexType> input(input_dims);
+  Tensor<DataType, 1, DataLayout, IndexType> kernel(kernel_dims);
 
-Tensor<DataType, 1, DataLayout, IndexType> input(input_dims);
-Tensor<DataType, 1, DataLayout, IndexType> kernel(kernel_dims);
-
-input.setRandom();
-kernel.setRandom();
-Eigen::array<IndexType, 1> dims;
-dims[0] = 0;
+  input.setRandom();
+  kernel.setRandom();
+  Eigen::array<IndexType, 1> dims;
+  dims[0] = 0;
 
   input(0) = 1.0f;
   input(1) = 2.0f;
@@ -338,21 +330,21 @@
   padding[0] = std::make_pair(0, 0);
   Tensor<DataType, 1, DataLayout, IndexType> valid(1);
 
-  std::size_t input_bytes = input.size()  * sizeof(DataType);
+  std::size_t input_bytes = input.size() * sizeof(DataType);
   std::size_t kernel_bytes = kernel.size() * sizeof(DataType);
   std::size_t valid_bytes = valid.size() * sizeof(DataType);
 
-  DataType * d_input  = static_cast<DataType*>(sycl_device.allocate(input_bytes));
-  DataType * d_kernel  = static_cast<DataType*>(sycl_device.allocate(kernel_bytes));
-  DataType * d_valid =  static_cast<DataType*>(sycl_device.allocate(valid_bytes));
+  DataType* d_input = static_cast<DataType*>(sycl_device.allocate(input_bytes));
+  DataType* d_kernel = static_cast<DataType*>(sycl_device.allocate(kernel_bytes));
+  DataType* d_valid = static_cast<DataType*>(sycl_device.allocate(valid_bytes));
 
-  Eigen::TensorMap<Eigen::Tensor<DataType, 1, DataLayout,IndexType> > gpu_input(d_input, input_dims);
-  Eigen::TensorMap<Eigen::Tensor<DataType, 1, DataLayout,IndexType> > gpu_kernel(d_kernel, kernel_dims);
-  Eigen::TensorMap<Eigen::Tensor<DataType, 1, DataLayout,IndexType> > gpu_valid(d_valid, valid.dimensions());
+  Eigen::TensorMap<Eigen::Tensor<DataType, 1, DataLayout, IndexType> > gpu_input(d_input, input_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 1, DataLayout, IndexType> > gpu_kernel(d_kernel, kernel_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 1, DataLayout, IndexType> > gpu_valid(d_valid, valid.dimensions());
   sycl_device.memcpyHostToDevice(d_input, input.data(), input_bytes);
   sycl_device.memcpyHostToDevice(d_kernel, kernel.data(), kernel_bytes);
 
-  gpu_valid.device(sycl_device)=gpu_input.pad(padding).convolve(gpu_kernel, dims);
+  gpu_valid.device(sycl_device) = gpu_input.pad(padding).convolve(gpu_kernel, dims);
   sycl_device.memcpyDeviceToHost(valid.data(), d_valid, valid_bytes);
 
   VERIFY_IS_EQUAL(valid.dimension(0), 1);
@@ -363,9 +355,9 @@
   padding[0] = std::make_pair(1, 1);
   Tensor<DataType, 1, DataLayout, IndexType> same(3);
   std::size_t same_bytes = same.size() * sizeof(DataType);
-  DataType * d_same =  static_cast<DataType*>(sycl_device.allocate(same_bytes));
-  Eigen::TensorMap<Eigen::Tensor<DataType, 1, DataLayout,IndexType> > gpu_same(d_same, same.dimensions());
-  gpu_same.device(sycl_device)=gpu_input.pad(padding).convolve(gpu_kernel, dims);
+  DataType* d_same = static_cast<DataType*>(sycl_device.allocate(same_bytes));
+  Eigen::TensorMap<Eigen::Tensor<DataType, 1, DataLayout, IndexType> > gpu_same(d_same, same.dimensions());
+  gpu_same.device(sycl_device) = gpu_input.pad(padding).convolve(gpu_kernel, dims);
   sycl_device.memcpyDeviceToHost(same.data(), d_same, same_bytes);
 
   VERIFY_IS_EQUAL(same.dimension(0), 3);
@@ -379,9 +371,9 @@
 
   Tensor<DataType, 1, DataLayout, IndexType> full(5);
   std::size_t full_bytes = full.size() * sizeof(DataType);
-  DataType * d_full =  static_cast<DataType*>(sycl_device.allocate(full_bytes));
-  Eigen::TensorMap<Eigen::Tensor<DataType, 1, DataLayout,IndexType> > gpu_full(d_full, full.dimensions());
-  gpu_full.device(sycl_device)=gpu_input.pad(padding).convolve(gpu_kernel, dims);
+  DataType* d_full = static_cast<DataType*>(sycl_device.allocate(full_bytes));
+  Eigen::TensorMap<Eigen::Tensor<DataType, 1, DataLayout, IndexType> > gpu_full(d_full, full.dimensions());
+  gpu_full.device(sycl_device) = gpu_input.pad(padding).convolve(gpu_kernel, dims);
   sycl_device.memcpyDeviceToHost(full.data(), d_full, full_bytes);
 
   VERIFY_IS_EQUAL(full.dimension(0), 5);
@@ -396,12 +388,10 @@
   sycl_device.deallocate(d_valid);
   sycl_device.deallocate(d_same);
   sycl_device.deallocate(d_full);
-
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_strides(const Eigen::SyclDevice& sycl_device){
-
+static void test_strides(const Eigen::SyclDevice& sycl_device) {
   Eigen::array<IndexType, 1> input_dims = {{13}};
   Eigen::array<IndexType, 1> kernel_dims = {{3}};
 
@@ -419,33 +409,32 @@
   Eigen::array<IndexType, 1> stride_of_2;
   stride_of_2[0] = 2;
 
-  std::size_t input_bytes = input.size()  * sizeof(DataType);
+  std::size_t input_bytes = input.size() * sizeof(DataType);
   std::size_t kernel_bytes = kernel.size() * sizeof(DataType);
   std::size_t result_bytes = result.size() * sizeof(DataType);
 
-  DataType * d_input  = static_cast<DataType*>(sycl_device.allocate(input_bytes));
-  DataType * d_kernel  = static_cast<DataType*>(sycl_device.allocate(kernel_bytes));
-  DataType * d_result =  static_cast<DataType*>(sycl_device.allocate(result_bytes));
+  DataType* d_input = static_cast<DataType*>(sycl_device.allocate(input_bytes));
+  DataType* d_kernel = static_cast<DataType*>(sycl_device.allocate(kernel_bytes));
+  DataType* d_result = static_cast<DataType*>(sycl_device.allocate(result_bytes));
 
-  Eigen::TensorMap<Eigen::Tensor<DataType, 1, DataLayout,IndexType> > gpu_input(d_input, input_dims);
-  Eigen::TensorMap<Eigen::Tensor<DataType, 1, DataLayout,IndexType> > gpu_kernel(d_kernel, kernel_dims);
-  Eigen::TensorMap<Eigen::Tensor<DataType, 1, DataLayout,IndexType> > gpu_result(d_result, result.dimensions());
+  Eigen::TensorMap<Eigen::Tensor<DataType, 1, DataLayout, IndexType> > gpu_input(d_input, input_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 1, DataLayout, IndexType> > gpu_kernel(d_kernel, kernel_dims);
+  Eigen::TensorMap<Eigen::Tensor<DataType, 1, DataLayout, IndexType> > gpu_result(d_result, result.dimensions());
   sycl_device.memcpyHostToDevice(d_input, input.data(), input_bytes);
   sycl_device.memcpyHostToDevice(d_kernel, kernel.data(), kernel_bytes);
 
-  gpu_result.device(sycl_device)=gpu_input.stride(stride_of_3).convolve(gpu_kernel, dims).stride(stride_of_2);
+  gpu_result.device(sycl_device) = gpu_input.stride(stride_of_3).convolve(gpu_kernel, dims).stride(stride_of_2);
   sycl_device.memcpyDeviceToHost(result.data(), d_result, result_bytes);
 
   VERIFY_IS_EQUAL(result.dimension(0), 2);
-  VERIFY_IS_APPROX(result(0), (input(0)*kernel(0) + input(3)*kernel(1) +
-                               input(6)*kernel(2)));
-  VERIFY_IS_APPROX(result(1), (input(6)*kernel(0) + input(9)*kernel(1) +
-                               input(12)*kernel(2)));
+  VERIFY_IS_APPROX(result(0), (input(0) * kernel(0) + input(3) * kernel(1) + input(6) * kernel(2)));
+  VERIFY_IS_APPROX(result(1), (input(6) * kernel(0) + input(9) * kernel(1) + input(12) * kernel(2)));
 }
 
-template <typename Dev_selector> void tensorConvolutionPerDevice(Dev_selector& s){
+template <typename Dev_selector>
+void tensorConvolutionPerDevice(Dev_selector& s) {
   QueueInterface queueInterface(s);
-  auto sycl_device=Eigen::SyclDevice(&queueInterface);
+  auto sycl_device = Eigen::SyclDevice(&queueInterface);
   test_larg_expr1D<float, RowMajor, int64_t>(sycl_device);
   test_larg_expr1D<float, ColMajor, int64_t>(sycl_device);
   test_larg_expr2D<float, RowMajor, int64_t>(sycl_device);
@@ -463,7 +452,7 @@
 }
 
 EIGEN_DECLARE_TEST(cxx11_tensor_convolution_sycl) {
-  for (const auto& device :Eigen::get_sycl_supported_devices()) {
+  for (const auto& device : Eigen::get_sycl_supported_devices()) {
     CALL_SUBTEST(tensorConvolutionPerDevice(device));
   }
 }
diff --git a/unsupported/test/cxx11_tensor_custom_index.cpp b/unsupported/test/cxx11_tensor_custom_index.cpp
index 38ce05b..f15da36 100644
--- a/unsupported/test/cxx11_tensor_custom_index.cpp
+++ b/unsupported/test/cxx11_tensor_custom_index.cpp
@@ -16,10 +16,8 @@
 
 using Eigen::Tensor;
 
-
 template <int DataLayout>
-static void test_map_as_index()
-{
+static void test_map_as_index() {
   Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
 
@@ -30,56 +28,49 @@
   coeffC[1] = 2;
   coeffC[2] = 4;
   coeffC[3] = 1;
-  NormalIndex coeff(1,2,4,1);
+  NormalIndex coeff(1, 2, 4, 1);
 
   VERIFY_IS_EQUAL(tensor.coeff(coeffC), tensor.coeff(coeff));
   VERIFY_IS_EQUAL(tensor.coeffRef(coeffC), tensor.coeffRef(coeff));
 }
 
-
 template <int DataLayout>
-static void test_matrix_as_index()
-{
+static void test_matrix_as_index() {
   Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
 
   using NormalIndex = DSizes<ptrdiff_t, 4>;
   using CustomIndex = Matrix<unsigned int, 4, 1>;
-  CustomIndex coeffC(1,2,4,1);
-  NormalIndex coeff(1,2,4,1);
+  CustomIndex coeffC(1, 2, 4, 1);
+  NormalIndex coeff(1, 2, 4, 1);
 
   VERIFY_IS_EQUAL(tensor.coeff(coeffC), tensor.coeff(coeff));
   VERIFY_IS_EQUAL(tensor.coeffRef(coeffC), tensor.coeffRef(coeff));
 }
 
-
 template <int DataLayout>
-static void test_varlist_as_index()
-{
+static void test_varlist_as_index() {
   Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
 
-  DSizes<ptrdiff_t, 4> coeff(1,2,4,1);
+  DSizes<ptrdiff_t, 4> coeff(1, 2, 4, 1);
 
-  VERIFY_IS_EQUAL(tensor.coeff({1,2,4,1}), tensor.coeff(coeff));
-  VERIFY_IS_EQUAL(tensor.coeffRef({1,2,4,1}), tensor.coeffRef(coeff));
+  VERIFY_IS_EQUAL(tensor.coeff({1, 2, 4, 1}), tensor.coeff(coeff));
+  VERIFY_IS_EQUAL(tensor.coeffRef({1, 2, 4, 1}), tensor.coeffRef(coeff));
 }
 
-
 template <int DataLayout>
-static void test_sizes_as_index()
-{
+static void test_sizes_as_index() {
   Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
 
-  DSizes<ptrdiff_t, 4> coeff(1,2,4,1);
-  Sizes<1,2,4,1> coeffC;
+  DSizes<ptrdiff_t, 4> coeff(1, 2, 4, 1);
+  Sizes<1, 2, 4, 1> coeffC;
 
   VERIFY_IS_EQUAL(tensor.coeff(coeffC), tensor.coeff(coeff));
   VERIFY_IS_EQUAL(tensor.coeffRef(coeffC), tensor.coeffRef(coeff));
 }
 
-
 EIGEN_DECLARE_TEST(cxx11_tensor_custom_index) {
   test_map_as_index<ColMajor>();
   test_map_as_index<RowMajor>();
diff --git a/unsupported/test/cxx11_tensor_custom_op.cpp b/unsupported/test/cxx11_tensor_custom_op.cpp
index 875ea57..493da48 100644
--- a/unsupported/test/cxx11_tensor_custom_op.cpp
+++ b/unsupported/test/cxx11_tensor_custom_op.cpp
@@ -13,7 +13,6 @@
 
 using Eigen::Tensor;
 
-
 struct InsertZeros {
   DSizes<DenseIndex, 2> dimensions(const Tensor<float, 2>& input) const {
     DSizes<DenseIndex, 2> result;
@@ -23,41 +22,38 @@
   }
 
   template <typename Output, typename Device>
-  void eval(const Tensor<float, 2>& input, Output& output, const Device& device) const
-  {
+  void eval(const Tensor<float, 2>& input, Output& output, const Device& device) const {
     array<DenseIndex, 2> strides;
     strides[0] = 2;
     strides[1] = 2;
     output.stride(strides).device(device) = input;
 
-    Eigen::DSizes<DenseIndex, 2> offsets(1,1);
-    Eigen::DSizes<DenseIndex, 2> extents(output.dimension(0)-1, output.dimension(1)-1);
+    Eigen::DSizes<DenseIndex, 2> offsets(1, 1);
+    Eigen::DSizes<DenseIndex, 2> extents(output.dimension(0) - 1, output.dimension(1) - 1);
     output.slice(offsets, extents).stride(strides).device(device) = input.constant(0.0f);
   }
 };
 
-static void test_custom_unary_op()
-{
-  Tensor<float, 2> tensor(3,5);
+static void test_custom_unary_op() {
+  Tensor<float, 2> tensor(3, 5);
   tensor.setRandom();
 
   Tensor<float, 2> result = tensor.customOp(InsertZeros());
   VERIFY_IS_EQUAL(result.dimension(0), 6);
   VERIFY_IS_EQUAL(result.dimension(1), 10);
 
-  for (int i = 0; i < 6; i+=2) {
-    for (int j = 0; j < 10; j+=2) {
-      VERIFY_IS_EQUAL(result(i, j), tensor(i/2, j/2));
+  for (int i = 0; i < 6; i += 2) {
+    for (int j = 0; j < 10; j += 2) {
+      VERIFY_IS_EQUAL(result(i, j), tensor(i / 2, j / 2));
     }
   }
-  for (int i = 1; i < 6; i+=2) {
-    for (int j = 1; j < 10; j+=2) {
+  for (int i = 1; i < 6; i += 2) {
+    for (int j = 1; j < 10; j += 2) {
       VERIFY_IS_EQUAL(result(i, j), 0);
     }
   }
 }
 
-
 struct BatchMatMul {
   DSizes<DenseIndex, 3> dimensions(const Tensor<float, 3>& input1, const Tensor<float, 3>& input2) const {
     DSizes<DenseIndex, 3> result;
@@ -68,9 +64,8 @@
   }
 
   template <typename Output, typename Device>
-  void eval(const Tensor<float, 3>& input1, const Tensor<float, 3>& input2,
-            Output& output, const Device& device) const
-  {
+  void eval(const Tensor<float, 3>& input1, const Tensor<float, 3>& input2, Output& output,
+            const Device& device) const {
     typedef Tensor<float, 3>::DimensionPair DimPair;
     array<DimPair, 1> dims;
     dims[0] = DimPair(1, 0);
@@ -80,12 +75,10 @@
   }
 };
 
-
-static void test_custom_binary_op()
-{
-  Tensor<float, 3> tensor1(2,3,5);
+static void test_custom_binary_op() {
+  Tensor<float, 3> tensor1(2, 3, 5);
   tensor1.setRandom();
-  Tensor<float, 3> tensor2(3,7,5);
+  Tensor<float, 3> tensor2(3, 7, 5);
   tensor2.setRandom();
 
   Tensor<float, 3> result = tensor1.customOp(tensor2, BatchMatMul());
@@ -103,9 +96,7 @@
   }
 }
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_custom_op)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_custom_op) {
   CALL_SUBTEST(test_custom_unary_op());
   CALL_SUBTEST(test_custom_binary_op());
 }
diff --git a/unsupported/test/cxx11_tensor_custom_op_sycl.cpp b/unsupported/test/cxx11_tensor_custom_op_sycl.cpp
index d947ead..eb9ef6e 100644
--- a/unsupported/test/cxx11_tensor_custom_op_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_custom_op_sycl.cpp
@@ -21,7 +21,7 @@
 #include <unsupported/Eigen/CXX11/Tensor>
 
 using Eigen::Tensor;
-template<typename TensorType>
+template <typename TensorType>
 struct InsertZeros {
   DSizes<DenseIndex, 2> dimensions(const TensorType& input) const {
     DSizes<DenseIndex, 2> result;
@@ -31,22 +31,20 @@
   }
 
   template <typename Output, typename Device>
-  void eval(const TensorType& input, Output& output, const Device& device) const
-  {
+  void eval(const TensorType& input, Output& output, const Device& device) const {
     array<DenseIndex, 2> strides;
     strides[0] = 2;
     strides[1] = 2;
     output.stride(strides).device(device) = input;
 
-    Eigen::DSizes<DenseIndex, 2> offsets(1,1);
-    Eigen::DSizes<DenseIndex, 2> extents(output.dimension(0)-1, output.dimension(1)-1);
+    Eigen::DSizes<DenseIndex, 2> offsets(1, 1);
+    Eigen::DSizes<DenseIndex, 2> extents(output.dimension(0) - 1, output.dimension(1) - 1);
     output.slice(offsets, extents).stride(strides).device(device) = input.constant(0.0f);
   }
 };
 
-template<typename DataType, int DataLayout, typename IndexType>
-static void test_custom_unary_op_sycl(const Eigen::SyclDevice &sycl_device)
-{
+template <typename DataType, int DataLayout, typename IndexType>
+static void test_custom_unary_op_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType sizeDim1 = 3;
   IndexType sizeDim2 = 5;
   Eigen::array<IndexType, 2> tensorRange = {{sizeDim1, sizeDim2}};
@@ -55,36 +53,38 @@
   Eigen::Tensor<DataType, 2, DataLayout, IndexType> in1(tensorRange);
   Eigen::Tensor<DataType, 2, DataLayout, IndexType> out(tensorResultRange);
 
-  DataType * gpu_in1_data  = static_cast<DataType*>(sycl_device.allocate(in1.dimensions().TotalSize()*sizeof(DataType)));
-  DataType * gpu_out_data =  static_cast<DataType*>(sycl_device.allocate(out.dimensions().TotalSize()*sizeof(DataType)));
+  DataType* gpu_in1_data =
+      static_cast<DataType*>(sycl_device.allocate(in1.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_out_data =
+      static_cast<DataType*>(sycl_device.allocate(out.dimensions().TotalSize() * sizeof(DataType)));
 
   typedef Eigen::TensorMap<Eigen::Tensor<DataType, 2, DataLayout, IndexType> > TensorType;
   TensorType gpu_in1(gpu_in1_data, tensorRange);
   TensorType gpu_out(gpu_out_data, tensorResultRange);
 
   in1.setRandom();
-  sycl_device.memcpyHostToDevice(gpu_in1_data, in1.data(),(in1.dimensions().TotalSize())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in1_data, in1.data(), (in1.dimensions().TotalSize()) * sizeof(DataType));
   gpu_out.device(sycl_device) = gpu_in1.customOp(InsertZeros<TensorType>());
-  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data,(out.dimensions().TotalSize())*sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data, (out.dimensions().TotalSize()) * sizeof(DataType));
 
   VERIFY_IS_EQUAL(out.dimension(0), 6);
   VERIFY_IS_EQUAL(out.dimension(1), 10);
 
-  for (int i = 0; i < 6; i+=2) {
-    for (int j = 0; j < 10; j+=2) {
-      VERIFY_IS_EQUAL(out(i, j), in1(i/2, j/2));
+  for (int i = 0; i < 6; i += 2) {
+    for (int j = 0; j < 10; j += 2) {
+      VERIFY_IS_EQUAL(out(i, j), in1(i / 2, j / 2));
     }
   }
-  for (int i = 1; i < 6; i+=2) {
-    for (int j = 1; j < 10; j+=2) {
+  for (int i = 1; i < 6; i += 2) {
+    for (int j = 1; j < 10; j += 2) {
       VERIFY_IS_EQUAL(out(i, j), 0);
     }
   }
   sycl_device.deallocate(gpu_in1_data);
-sycl_device.deallocate(gpu_out_data);
+  sycl_device.deallocate(gpu_out_data);
 }
 
-template<typename TensorType>
+template <typename TensorType>
 struct BatchMatMul {
   DSizes<DenseIndex, 3> dimensions(const TensorType& input1, const TensorType& input2) const {
     DSizes<DenseIndex, 3> result;
@@ -95,9 +95,7 @@
   }
 
   template <typename Output, typename Device>
-  void eval(const TensorType& input1, const TensorType& input2,
-            Output& output, const Device& device) const
-  {
+  void eval(const TensorType& input1, const TensorType& input2, Output& output, const Device& device) const {
     typedef typename TensorType::DimensionPair DimPair;
     array<DimPair, 1> dims;
     dims[0] = DimPair(1, 0);
@@ -107,21 +105,22 @@
   }
 };
 
-template<typename DataType, int DataLayout, typename IndexType>
-static void test_custom_binary_op_sycl(const Eigen::SyclDevice &sycl_device)
-{
-
+template <typename DataType, int DataLayout, typename IndexType>
+static void test_custom_binary_op_sycl(const Eigen::SyclDevice& sycl_device) {
   Eigen::array<IndexType, 3> tensorRange1 = {{2, 3, 5}};
-  Eigen::array<IndexType, 3> tensorRange2 = {{3,7,5}};
-  Eigen::array<IndexType, 3> tensorResultRange  = {{2, 7, 5}};
+  Eigen::array<IndexType, 3> tensorRange2 = {{3, 7, 5}};
+  Eigen::array<IndexType, 3> tensorResultRange = {{2, 7, 5}};
 
   Eigen::Tensor<DataType, 3, DataLayout, IndexType> in1(tensorRange1);
   Eigen::Tensor<DataType, 3, DataLayout, IndexType> in2(tensorRange2);
   Eigen::Tensor<DataType, 3, DataLayout, IndexType> out(tensorResultRange);
 
-  DataType * gpu_in1_data  = static_cast<DataType*>(sycl_device.allocate(in1.dimensions().TotalSize()*sizeof(DataType)));
-  DataType * gpu_in2_data  = static_cast<DataType*>(sycl_device.allocate(in2.dimensions().TotalSize()*sizeof(DataType)));
-  DataType * gpu_out_data =  static_cast<DataType*>(sycl_device.allocate(out.dimensions().TotalSize()*sizeof(DataType)));
+  DataType* gpu_in1_data =
+      static_cast<DataType*>(sycl_device.allocate(in1.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_in2_data =
+      static_cast<DataType*>(sycl_device.allocate(in2.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_out_data =
+      static_cast<DataType*>(sycl_device.allocate(out.dimensions().TotalSize() * sizeof(DataType)));
 
   typedef Eigen::TensorMap<Eigen::Tensor<DataType, 3, DataLayout, IndexType> > TensorType;
   TensorType gpu_in1(gpu_in1_data, tensorRange1);
@@ -131,17 +130,18 @@
   in1.setRandom();
   in2.setRandom();
 
-  sycl_device.memcpyHostToDevice(gpu_in1_data, in1.data(),(in1.dimensions().TotalSize())*sizeof(DataType));
-  sycl_device.memcpyHostToDevice(gpu_in2_data, in2.data(),(in2.dimensions().TotalSize())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in1_data, in1.data(), (in1.dimensions().TotalSize()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in2_data, in2.data(), (in2.dimensions().TotalSize()) * sizeof(DataType));
 
   gpu_out.device(sycl_device) = gpu_in1.customOp(gpu_in2, BatchMatMul<TensorType>());
-  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data,(out.dimensions().TotalSize())*sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data, (out.dimensions().TotalSize()) * sizeof(DataType));
 
   for (IndexType i = 0; i < 5; ++i) {
     typedef typename Eigen::Tensor<DataType, 3, DataLayout, IndexType>::DimensionPair DimPair;
     array<DimPair, 1> dims;
     dims[0] = DimPair(1, 0);
-    Eigen::Tensor<DataType, 2, DataLayout, IndexType> reference = in1.template chip<2>(i).contract(in2.template chip<2>(i), dims);
+    Eigen::Tensor<DataType, 2, DataLayout, IndexType> reference =
+        in1.template chip<2>(i).contract(in2.template chip<2>(i), dims);
     TensorRef<Eigen::Tensor<DataType, 2, DataLayout, IndexType> > val = out.template chip<2>(i);
     for (IndexType j = 0; j < 2; ++j) {
       for (IndexType k = 0; k < 7; ++k) {
@@ -154,17 +154,17 @@
   sycl_device.deallocate(gpu_out_data);
 }
 
-template <typename DataType, typename Dev_selector> void custom_op_perDevice(Dev_selector s){
+template <typename DataType, typename Dev_selector>
+void custom_op_perDevice(Dev_selector s) {
   QueueInterface queueInterface(s);
   auto sycl_device = Eigen::SyclDevice(&queueInterface);
   test_custom_unary_op_sycl<DataType, RowMajor, int64_t>(sycl_device);
   test_custom_unary_op_sycl<DataType, ColMajor, int64_t>(sycl_device);
   test_custom_binary_op_sycl<DataType, ColMajor, int64_t>(sycl_device);
   test_custom_binary_op_sycl<DataType, RowMajor, int64_t>(sycl_device);
-
 }
 EIGEN_DECLARE_TEST(cxx11_tensor_custom_op_sycl) {
-  for (const auto& device :Eigen::get_sycl_supported_devices()) {
+  for (const auto& device : Eigen::get_sycl_supported_devices()) {
     CALL_SUBTEST(custom_op_perDevice<float>(device));
   }
 }
diff --git a/unsupported/test/cxx11_tensor_device.cu b/unsupported/test/cxx11_tensor_device.cu
index 58cfc01..0f91b10 100644
--- a/unsupported/test/cxx11_tensor_device.cu
+++ b/unsupported/test/cxx11_tensor_device.cu
@@ -19,28 +19,29 @@
 
 #include <unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaDefines.h>
 
-using Eigen::Tensor;
 using Eigen::RowMajor;
+using Eigen::Tensor;
 
 // Context for evaluation on cpu
 struct CPUContext {
-  CPUContext(const Eigen::Tensor<float, 3>& in1, Eigen::Tensor<float, 3>& in2, Eigen::Tensor<float, 3>& out) : in1_(in1), in2_(in2), out_(out), kernel_1d_(2), kernel_2d_(2,2), kernel_3d_(2,2,2) {
+  CPUContext(const Eigen::Tensor<float, 3>& in1, Eigen::Tensor<float, 3>& in2, Eigen::Tensor<float, 3>& out)
+      : in1_(in1), in2_(in2), out_(out), kernel_1d_(2), kernel_2d_(2, 2), kernel_3d_(2, 2, 2) {
     kernel_1d_(0) = 3.14f;
     kernel_1d_(1) = 2.7f;
 
-    kernel_2d_(0,0) = 3.14f;
-    kernel_2d_(1,0) = 2.7f;
-    kernel_2d_(0,1) = 0.2f;
-    kernel_2d_(1,1) = 7.0f;
+    kernel_2d_(0, 0) = 3.14f;
+    kernel_2d_(1, 0) = 2.7f;
+    kernel_2d_(0, 1) = 0.2f;
+    kernel_2d_(1, 1) = 7.0f;
 
-    kernel_3d_(0,0,0) = 3.14f;
-    kernel_3d_(0,1,0) = 2.7f;
-    kernel_3d_(0,0,1) = 0.2f;
-    kernel_3d_(0,1,1) = 7.0f;
-    kernel_3d_(1,0,0) = -1.0f;
-    kernel_3d_(1,1,0) = -0.3f;
-    kernel_3d_(1,0,1) = -0.7f;
-    kernel_3d_(1,1,1) = -0.5f;
+    kernel_3d_(0, 0, 0) = 3.14f;
+    kernel_3d_(0, 1, 0) = 2.7f;
+    kernel_3d_(0, 0, 1) = 0.2f;
+    kernel_3d_(0, 1, 1) = 7.0f;
+    kernel_3d_(1, 0, 0) = -1.0f;
+    kernel_3d_(1, 1, 0) = -0.3f;
+    kernel_3d_(1, 0, 1) = -0.7f;
+    kernel_3d_(1, 1, 1) = -0.5f;
   }
 
   const Eigen::DefaultDevice& device() const { return cpu_device_; }
@@ -64,21 +65,22 @@
   Eigen::DefaultDevice cpu_device_;
 };
 
-
 // Context for evaluation on GPU
 struct GPUContext {
-  GPUContext(const Eigen::TensorMap<Eigen::Tensor<float, 3> >& in1, Eigen::TensorMap<Eigen::Tensor<float, 3> >& in2, Eigen::TensorMap<Eigen::Tensor<float, 3> >& out) : in1_(in1), in2_(in2), out_(out), gpu_device_(&stream_) {
-    assert(gpuMalloc((void**)(&kernel_1d_), 2*sizeof(float)) == gpuSuccess);
+  GPUContext(const Eigen::TensorMap<Eigen::Tensor<float, 3>>& in1, Eigen::TensorMap<Eigen::Tensor<float, 3>>& in2,
+             Eigen::TensorMap<Eigen::Tensor<float, 3>>& out)
+      : in1_(in1), in2_(in2), out_(out), gpu_device_(&stream_) {
+    assert(gpuMalloc((void**)(&kernel_1d_), 2 * sizeof(float)) == gpuSuccess);
     float kernel_1d_val[] = {3.14f, 2.7f};
-    assert(gpuMemcpy(kernel_1d_, kernel_1d_val, 2*sizeof(float), gpuMemcpyHostToDevice) == gpuSuccess);
+    assert(gpuMemcpy(kernel_1d_, kernel_1d_val, 2 * sizeof(float), gpuMemcpyHostToDevice) == gpuSuccess);
 
-    assert(gpuMalloc((void**)(&kernel_2d_), 4*sizeof(float)) == gpuSuccess);
+    assert(gpuMalloc((void**)(&kernel_2d_), 4 * sizeof(float)) == gpuSuccess);
     float kernel_2d_val[] = {3.14f, 2.7f, 0.2f, 7.0f};
-    assert(gpuMemcpy(kernel_2d_, kernel_2d_val, 4*sizeof(float), gpuMemcpyHostToDevice) == gpuSuccess);
+    assert(gpuMemcpy(kernel_2d_, kernel_2d_val, 4 * sizeof(float), gpuMemcpyHostToDevice) == gpuSuccess);
 
-    assert(gpuMalloc((void**)(&kernel_3d_), 8*sizeof(float)) == gpuSuccess);
+    assert(gpuMalloc((void**)(&kernel_3d_), 8 * sizeof(float)) == gpuSuccess);
     float kernel_3d_val[] = {3.14f, -1.0f, 2.7f, -0.3f, 0.2f, -0.7f, 7.0f, -0.5f};
-    assert(gpuMemcpy(kernel_3d_, kernel_3d_val, 8*sizeof(float), gpuMemcpyHostToDevice) == gpuSuccess);
+    assert(gpuMemcpy(kernel_3d_, kernel_3d_val, 8 * sizeof(float), gpuMemcpyHostToDevice) == gpuSuccess);
   }
   ~GPUContext() {
     assert(gpuFree(kernel_1d_) == gpuSuccess);
@@ -88,17 +90,23 @@
 
   const Eigen::GpuDevice& device() const { return gpu_device_; }
 
-  const Eigen::TensorMap<Eigen::Tensor<float, 3> >& in1() const { return in1_; }
-  const Eigen::TensorMap<Eigen::Tensor<float, 3> >& in2() const { return in2_; }
-  Eigen::TensorMap<Eigen::Tensor<float, 3> >& out() { return out_; }
-  Eigen::TensorMap<Eigen::Tensor<float, 1> > kernel1d() const { return Eigen::TensorMap<Eigen::Tensor<float, 1> >(kernel_1d_, 2); }
-  Eigen::TensorMap<Eigen::Tensor<float, 2> > kernel2d() const { return Eigen::TensorMap<Eigen::Tensor<float, 2> >(kernel_2d_, 2, 2); }
-  Eigen::TensorMap<Eigen::Tensor<float, 3> > kernel3d() const { return Eigen::TensorMap<Eigen::Tensor<float, 3> >(kernel_3d_, 2, 2, 2); }
+  const Eigen::TensorMap<Eigen::Tensor<float, 3>>& in1() const { return in1_; }
+  const Eigen::TensorMap<Eigen::Tensor<float, 3>>& in2() const { return in2_; }
+  Eigen::TensorMap<Eigen::Tensor<float, 3>>& out() { return out_; }
+  Eigen::TensorMap<Eigen::Tensor<float, 1>> kernel1d() const {
+    return Eigen::TensorMap<Eigen::Tensor<float, 1>>(kernel_1d_, 2);
+  }
+  Eigen::TensorMap<Eigen::Tensor<float, 2>> kernel2d() const {
+    return Eigen::TensorMap<Eigen::Tensor<float, 2>>(kernel_2d_, 2, 2);
+  }
+  Eigen::TensorMap<Eigen::Tensor<float, 3>> kernel3d() const {
+    return Eigen::TensorMap<Eigen::Tensor<float, 3>>(kernel_3d_, 2, 2, 2);
+  }
 
  private:
-  const Eigen::TensorMap<Eigen::Tensor<float, 3> >& in1_;
-  const Eigen::TensorMap<Eigen::Tensor<float, 3> >& in2_;
-  Eigen::TensorMap<Eigen::Tensor<float, 3> >& out_;
+  const Eigen::TensorMap<Eigen::Tensor<float, 3>>& in1_;
+  const Eigen::TensorMap<Eigen::Tensor<float, 3>>& in2_;
+  Eigen::TensorMap<Eigen::Tensor<float, 3>>& out_;
 
   float* kernel_1d_;
   float* kernel_2d_;
@@ -108,78 +116,71 @@
   Eigen::GpuDevice gpu_device_;
 };
 
-
 // The actual expression to evaluate
 template <typename Context>
-void test_contextual_eval(Context* context)
-{
+void test_contextual_eval(Context* context) {
   context->out().device(context->device()) = context->in1() + context->in2() * 3.14f + context->in1().constant(2.718f);
 }
 
 template <typename Context>
-void test_forced_contextual_eval(Context* context)
-{
-  context->out().device(context->device()) = (context->in1() + context->in2()).eval() * 3.14f + context->in1().constant(2.718f);
+void test_forced_contextual_eval(Context* context) {
+  context->out().device(context->device()) =
+      (context->in1() + context->in2()).eval() * 3.14f + context->in1().constant(2.718f);
 }
 
 template <typename Context>
-void test_compound_assignment(Context* context)
-{
+void test_compound_assignment(Context* context) {
   context->out().device(context->device()) = context->in1().constant(2.718f);
   context->out().device(context->device()) += context->in1() + context->in2() * 3.14f;
 }
 
-
 template <typename Context>
-void test_contraction(Context* context)
-{
+void test_contraction(Context* context) {
   Eigen::array<std::pair<int, int>, 2> dims;
   dims[0] = std::make_pair(1, 1);
   dims[1] = std::make_pair(2, 2);
 
-  Eigen::array<int, 2> shape(40, 50*70);
+  Eigen::array<int, 2> shape(40, 50 * 70);
 
-  Eigen::DSizes<int, 2> indices(0,0);
-  Eigen::DSizes<int, 2> sizes(40,40);
+  Eigen::DSizes<int, 2> indices(0, 0);
+  Eigen::DSizes<int, 2> sizes(40, 40);
 
-  context->out().reshape(shape).slice(indices, sizes).device(context->device()) = context->in1().contract(context->in2(), dims);
+  context->out().reshape(shape).slice(indices, sizes).device(context->device()) =
+      context->in1().contract(context->in2(), dims);
 }
 
-
 template <typename Context>
-void test_1d_convolution(Context* context)
-{
-  Eigen::DSizes<int, 3> indices(0,0,0);
-  Eigen::DSizes<int, 3> sizes(40,49,70);
+void test_1d_convolution(Context* context) {
+  Eigen::DSizes<int, 3> indices(0, 0, 0);
+  Eigen::DSizes<int, 3> sizes(40, 49, 70);
 
   Eigen::array<int, 1> dims(1);
   context->out().slice(indices, sizes).device(context->device()) = context->in1().convolve(context->kernel1d(), dims);
 }
 
 template <typename Context>
-void test_2d_convolution(Context* context)
-{
-  Eigen::DSizes<int, 3> indices(0,0,0);
-  Eigen::DSizes<int, 3> sizes(40,49,69);
+void test_2d_convolution(Context* context) {
+  Eigen::DSizes<int, 3> indices(0, 0, 0);
+  Eigen::DSizes<int, 3> sizes(40, 49, 69);
 
-  Eigen::array<int, 2> dims(1,2);
+  Eigen::array<int, 2> dims(1, 2);
   context->out().slice(indices, sizes).device(context->device()) = context->in1().convolve(context->kernel2d(), dims);
 }
 
 template <typename Context>
-void test_3d_convolution(Context* context)
-{
-  Eigen::DSizes<int, 3> indices(0,0,0);
-  Eigen::DSizes<int, 3> sizes(39,49,69);
+void test_3d_convolution(Context* context) {
+  Eigen::DSizes<int, 3> indices(0, 0, 0);
+  Eigen::DSizes<int, 3> sizes(39, 49, 69);
 
-  Eigen::array<int, 3> dims(0,1,2);
+  Eigen::array<int, 3> dims(0, 1, 2);
   context->out().slice(indices, sizes).device(context->device()) = context->in1().convolve(context->kernel3d(), dims);
 }
 
 // Helper method to synchronize device.
-template<typename Device>
-void synchronize(Device& device) { /*nothing*/ }
-template<>
+template <typename Device>
+void synchronize(Device& device) { /*nothing*/
+}
+template <>
 void synchronize(Eigen::GpuDevice& device) {
   device.synchronize();
 }
@@ -190,35 +191,35 @@
   Eigen::array<int, 1> tensorRange = {{count}};
   Eigen::Tensor<DataType, 1> host(tensorRange);
   Eigen::Tensor<DataType, 1> expected(tensorRange);
-  DataType* device_data  = static_cast<DataType*>(device.allocate(count * sizeof(DataType)));
-  
+  DataType* device_data = static_cast<DataType*>(device.allocate(count * sizeof(DataType)));
+
   // memset
   const char byte_value = static_cast<char>(0xAB);
   device.memset(device_data, byte_value, count * sizeof(DataType));
   device.memcpyDeviceToHost(host.data(), device_data, count * sizeof(DataType));
   synchronize(device);
   memset(expected.data(), byte_value, count * sizeof(DataType));
-  for (size_t i=0; i<count; i++) {
+  for (size_t i = 0; i < count; i++) {
     VERIFY_IS_EQUAL(host(i), expected(i));
   }
-  
+
   // fill
   DataType fill_value = DataType(7);
   std::fill_n(expected.data(), count, fill_value);
   device.fill(device_data, device_data + count, fill_value);
   device.memcpyDeviceToHost(host.data(), device_data, count * sizeof(DataType));
   synchronize(device);
-  for (int i=0; i<count; i++) {
+  for (int i = 0; i < count; i++) {
     VERIFY_IS_EQUAL(host(i), expected(i));
   }
-  
+
   device.deallocate(device_data);
 }
 
 void test_cpu() {
-  Eigen::Tensor<float, 3> in1(40,50,70);
-  Eigen::Tensor<float, 3> in2(40,50,70);
-  Eigen::Tensor<float, 3> out(40,50,70);
+  Eigen::Tensor<float, 3> in1(40, 50, 70);
+  Eigen::Tensor<float, 3> in2(40, 50, 70);
+  Eigen::Tensor<float, 3> out(40, 50, 70);
 
   in1 = in1.random() + in1.constant(10.0f);
   in2 = in2.random() + in2.constant(10.0f);
@@ -228,7 +229,7 @@
   for (int i = 0; i < 40; ++i) {
     for (int j = 0; j < 50; ++j) {
       for (int k = 0; k < 70; ++k) {
-        VERIFY_IS_APPROX(out(i,j,k), in1(i,j,k) + in2(i,j,k) * 3.14f + 2.718f);
+        VERIFY_IS_APPROX(out(i, j, k), in1(i, j, k) + in2(i, j, k) * 3.14f + 2.718f);
       }
     }
   }
@@ -237,7 +238,7 @@
   for (int i = 0; i < 40; ++i) {
     for (int j = 0; j < 50; ++j) {
       for (int k = 0; k < 70; ++k) {
-        VERIFY_IS_APPROX(out(i,j,k), (in1(i,j,k) + in2(i,j,k)) * 3.14f + 2.718f);
+        VERIFY_IS_APPROX(out(i, j, k), (in1(i, j, k) + in2(i, j, k)) * 3.14f + 2.718f);
       }
     }
   }
@@ -246,7 +247,7 @@
   for (int i = 0; i < 40; ++i) {
     for (int j = 0; j < 50; ++j) {
       for (int k = 0; k < 70; ++k) {
-        VERIFY_IS_APPROX(out(i,j,k), in1(i,j,k) + in2(i,j,k) * 3.14f + 2.718f);
+        VERIFY_IS_APPROX(out(i, j, k), in1(i, j, k) + in2(i, j, k) * 3.14f + 2.718f);
       }
     }
   }
@@ -254,7 +255,7 @@
   test_contraction(&context);
   for (int i = 0; i < 40; ++i) {
     for (int j = 0; j < 40; ++j) {
-      const float result = out(i,j,0);
+      const float result = out(i, j, 0);
       float expected = 0;
       for (int k = 0; k < 50; ++k) {
         for (int l = 0; l < 70; ++l) {
@@ -269,7 +270,7 @@
   for (int i = 0; i < 40; ++i) {
     for (int j = 0; j < 49; ++j) {
       for (int k = 0; k < 70; ++k) {
-        VERIFY_IS_APPROX(out(i,j,k), (in1(i,j,k) * 3.14f + in1(i,j+1,k) * 2.7f));
+        VERIFY_IS_APPROX(out(i, j, k), (in1(i, j, k) * 3.14f + in1(i, j + 1, k) * 2.7f));
       }
     }
   }
@@ -278,9 +279,9 @@
   for (int i = 0; i < 40; ++i) {
     for (int j = 0; j < 49; ++j) {
       for (int k = 0; k < 69; ++k) {
-        const float result = out(i,j,k);
-        const float expected = (in1(i,j,k) * 3.14f + in1(i,j+1,k) * 2.7f) +
-                               (in1(i,j,k+1) * 0.2f + in1(i,j+1,k+1) * 7.0f);
+        const float result = out(i, j, k);
+        const float expected =
+            (in1(i, j, k) * 3.14f + in1(i, j + 1, k) * 2.7f) + (in1(i, j, k + 1) * 0.2f + in1(i, j + 1, k + 1) * 7.0f);
         if (fabs(expected) < 1e-4f && fabs(result) < 1e-4f) {
           continue;
         }
@@ -293,11 +294,11 @@
   for (int i = 0; i < 39; ++i) {
     for (int j = 0; j < 49; ++j) {
       for (int k = 0; k < 69; ++k) {
-        const float result = out(i,j,k);
-        const float expected = (in1(i,j,k) * 3.14f + in1(i,j+1,k) * 2.7f +
-                                in1(i,j,k+1) * 0.2f + in1(i,j+1,k+1) * 7.0f) +
-                               (in1(i+1,j,k) * -1.0f + in1(i+1,j+1,k) * -0.3f +
-                                in1(i+1,j,k+1) * -0.7f + in1(i+1,j+1,k+1) * -0.5f);
+        const float result = out(i, j, k);
+        const float expected =
+            (in1(i, j, k) * 3.14f + in1(i, j + 1, k) * 2.7f + in1(i, j, k + 1) * 0.2f + in1(i, j + 1, k + 1) * 7.0f) +
+            (in1(i + 1, j, k) * -1.0f + in1(i + 1, j + 1, k) * -0.3f + in1(i + 1, j, k + 1) * -0.7f +
+             in1(i + 1, j + 1, k + 1) * -0.5f);
         if (fabs(expected) < 1e-4f && fabs(result) < 1e-4f) {
           continue;
         }
@@ -305,15 +306,15 @@
       }
     }
   }
-  
+
   test_device_memory<float>(context.device());
   test_device_memory<OffByOneScalar<int>>(context.device());
 }
 
 void test_gpu() {
-  Eigen::Tensor<float, 3> in1(40,50,70);
-  Eigen::Tensor<float, 3> in2(40,50,70);
-  Eigen::Tensor<float, 3> out(40,50,70);
+  Eigen::Tensor<float, 3> in1(40, 50, 70);
+  Eigen::Tensor<float, 3> in2(40, 50, 70);
+  Eigen::Tensor<float, 3> out(40, 50, 70);
   in1 = in1.random() + in1.constant(10.0f);
   in2 = in2.random() + in2.constant(10.0f);
 
@@ -331,9 +332,9 @@
   gpuMemcpy(d_in1, in1.data(), in1_bytes, gpuMemcpyHostToDevice);
   gpuMemcpy(d_in2, in2.data(), in2_bytes, gpuMemcpyHostToDevice);
 
-  Eigen::TensorMap<Eigen::Tensor<float, 3> > gpu_in1(d_in1, 40,50,70);
-  Eigen::TensorMap<Eigen::Tensor<float, 3> > gpu_in2(d_in2, 40,50,70);
-  Eigen::TensorMap<Eigen::Tensor<float, 3> > gpu_out(d_out, 40,50,70);
+  Eigen::TensorMap<Eigen::Tensor<float, 3>> gpu_in1(d_in1, 40, 50, 70);
+  Eigen::TensorMap<Eigen::Tensor<float, 3>> gpu_in2(d_in2, 40, 50, 70);
+  Eigen::TensorMap<Eigen::Tensor<float, 3>> gpu_out(d_out, 40, 50, 70);
 
   GPUContext context(gpu_in1, gpu_in2, gpu_out);
   test_contextual_eval(&context);
@@ -341,7 +342,7 @@
   for (int i = 0; i < 40; ++i) {
     for (int j = 0; j < 50; ++j) {
       for (int k = 0; k < 70; ++k) {
-        VERIFY_IS_APPROX(out(i,j,k), in1(i,j,k) + in2(i,j,k) * 3.14f + 2.718f);
+        VERIFY_IS_APPROX(out(i, j, k), in1(i, j, k) + in2(i, j, k) * 3.14f + 2.718f);
       }
     }
   }
@@ -351,7 +352,7 @@
   for (int i = 0; i < 40; ++i) {
     for (int j = 0; j < 50; ++j) {
       for (int k = 0; k < 70; ++k) {
-        VERIFY_IS_APPROX(out(i,j,k), (in1(i,j,k) + in2(i,j,k)) * 3.14f + 2.718f);
+        VERIFY_IS_APPROX(out(i, j, k), (in1(i, j, k) + in2(i, j, k)) * 3.14f + 2.718f);
       }
     }
   }
@@ -361,7 +362,7 @@
   for (int i = 0; i < 40; ++i) {
     for (int j = 0; j < 50; ++j) {
       for (int k = 0; k < 70; ++k) {
-        VERIFY_IS_APPROX(out(i,j,k), in1(i,j,k) + in2(i,j,k) * 3.14f + 2.718f);
+        VERIFY_IS_APPROX(out(i, j, k), in1(i, j, k) + in2(i, j, k) * 3.14f + 2.718f);
       }
     }
   }
@@ -370,7 +371,7 @@
   assert(gpuMemcpy(out.data(), d_out, out_bytes, gpuMemcpyDeviceToHost) == gpuSuccess);
   for (int i = 0; i < 40; ++i) {
     for (int j = 0; j < 40; ++j) {
-      const float result = out(i,j,0);
+      const float result = out(i, j, 0);
       float expected = 0;
       for (int k = 0; k < 50; ++k) {
         for (int l = 0; l < 70; ++l) {
@@ -387,7 +388,7 @@
   for (int i = 0; i < 40; ++i) {
     for (int j = 0; j < 49; ++j) {
       for (int k = 0; k < 70; ++k) {
-        VERIFY_IS_APPROX(out(i,j,k), (in1(i,j,k) * 3.14f + in1(i,j+1,k) * 2.7f));
+        VERIFY_IS_APPROX(out(i, j, k), (in1(i, j, k) * 3.14f + in1(i, j + 1, k) * 2.7f));
       }
     }
   }
@@ -398,17 +399,17 @@
   for (int i = 0; i < 40; ++i) {
     for (int j = 0; j < 49; ++j) {
       for (int k = 0; k < 69; ++k) {
-        const float result = out(i,j,k);
-        const float expected = (in1(i,j,k) * 3.14f + in1(i,j+1,k) * 2.7f +
-                                in1(i,j,k+1) * 0.2f + in1(i,j+1,k+1) * 7.0f);
+        const float result = out(i, j, k);
+        const float expected =
+            (in1(i, j, k) * 3.14f + in1(i, j + 1, k) * 2.7f + in1(i, j, k + 1) * 0.2f + in1(i, j + 1, k + 1) * 7.0f);
         VERIFY_IS_APPROX(expected, result);
       }
     }
   }
 
 #if !defined(EIGEN_USE_HIP)
-// disable this test on the HIP platform
-// 3D tensor convolutions seem to hang on the HIP platform
+  // disable this test on the HIP platform
+  // 3D tensor convolutions seem to hang on the HIP platform
 
   test_3d_convolution(&context);
   assert(gpuMemcpyAsync(out.data(), d_out, out_bytes, gpuMemcpyDeviceToHost, context.device().stream()) == gpuSuccess);
@@ -416,25 +417,22 @@
   for (int i = 0; i < 39; ++i) {
     for (int j = 0; j < 49; ++j) {
       for (int k = 0; k < 69; ++k) {
-       const float result = out(i,j,k);
-        const float expected = (in1(i,j,k) * 3.14f + in1(i,j+1,k) * 2.7f +
-                                in1(i,j,k+1) * 0.2f + in1(i,j+1,k+1) * 7.0f +
-                                in1(i+1,j,k) * -1.0f + in1(i+1,j+1,k) * -0.3f +
-                                in1(i+1,j,k+1) * -0.7f + in1(i+1,j+1,k+1) * -0.5f);
+        const float result = out(i, j, k);
+        const float expected = (in1(i, j, k) * 3.14f + in1(i, j + 1, k) * 2.7f + in1(i, j, k + 1) * 0.2f +
+                                in1(i, j + 1, k + 1) * 7.0f + in1(i + 1, j, k) * -1.0f + in1(i + 1, j + 1, k) * -0.3f +
+                                in1(i + 1, j, k + 1) * -0.7f + in1(i + 1, j + 1, k + 1) * -0.5f);
         VERIFY_IS_APPROX(expected, result);
       }
     }
   }
 
 #endif
- 
+
   test_device_memory<float>(context.device());
   test_device_memory<OffByOneScalar<int>>(context.device());
 }
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_device)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_device) {
   CALL_SUBTEST_1(test_cpu());
   CALL_SUBTEST_2(test_gpu());
 }
diff --git a/unsupported/test/cxx11_tensor_device_sycl.cpp b/unsupported/test/cxx11_tensor_device_sycl.cpp
index 66a13e8..d190815 100644
--- a/unsupported/test/cxx11_tensor_device_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_device_sycl.cpp
@@ -24,18 +24,18 @@
 #include <iostream>
 
 template <typename DataType, int DataLayout, typename IndexType>
-void test_device_memory(const Eigen::SyclDevice &sycl_device) {
+void test_device_memory(const Eigen::SyclDevice& sycl_device) {
   IndexType sizeDim1 = 100;
   array<IndexType, 1> tensorRange = {{sizeDim1}};
-  Tensor<DataType, 1, DataLayout,IndexType> in(tensorRange);
-  Tensor<DataType, 1, DataLayout,IndexType> in1(tensorRange);
-  DataType* gpu_in_data  = static_cast<DataType*>(sycl_device.allocate(in.size()*sizeof(DataType)));
+  Tensor<DataType, 1, DataLayout, IndexType> in(tensorRange);
+  Tensor<DataType, 1, DataLayout, IndexType> in1(tensorRange);
+  DataType* gpu_in_data = static_cast<DataType*>(sycl_device.allocate(in.size() * sizeof(DataType)));
 
   // memset
   memset(in1.data(), 1, in1.size() * sizeof(DataType));
-  sycl_device.memset(gpu_in_data, 1, in.size()*sizeof(DataType));
-  sycl_device.memcpyDeviceToHost(in.data(), gpu_in_data, in.size()*sizeof(DataType));
-  for (IndexType i=0; i<in.size(); i++) {
+  sycl_device.memset(gpu_in_data, 1, in.size() * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(in.data(), gpu_in_data, in.size() * sizeof(DataType));
+  for (IndexType i = 0; i < in.size(); i++) {
     VERIFY_IS_EQUAL(in(i), in1(i));
   }
 
@@ -43,8 +43,8 @@
   DataType value = DataType(7);
   std::fill_n(in1.data(), in1.size(), value);
   sycl_device.fill(gpu_in_data, gpu_in_data + in.size(), value);
-  sycl_device.memcpyDeviceToHost(in.data(), gpu_in_data, in.size()*sizeof(DataType));
-  for (IndexType i=0; i<in.size(); i++) {
+  sycl_device.memcpyDeviceToHost(in.data(), gpu_in_data, in.size() * sizeof(DataType));
+  for (IndexType i = 0; i < in.size(); i++) {
     VERIFY_IS_EQUAL(in(i), in1(i));
   }
 
@@ -52,15 +52,15 @@
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-void test_device_exceptions(const Eigen::SyclDevice &sycl_device) {
+void test_device_exceptions(const Eigen::SyclDevice& sycl_device) {
   VERIFY(sycl_device.ok());
   IndexType sizeDim1 = 100;
   array<IndexType, 1> tensorDims = {{sizeDim1}};
-  DataType* gpu_data = static_cast<DataType*>(sycl_device.allocate(sizeDim1*sizeof(DataType)));
-  sycl_device.memset(gpu_data, 1, sizeDim1*sizeof(DataType));
+  DataType* gpu_data = static_cast<DataType*>(sycl_device.allocate(sizeDim1 * sizeof(DataType)));
+  sycl_device.memset(gpu_data, 1, sizeDim1 * sizeof(DataType));
 
-  TensorMap<Tensor<DataType, 1, DataLayout,IndexType>> in(gpu_data, tensorDims);
-  TensorMap<Tensor<DataType, 1, DataLayout,IndexType>> out(gpu_data, tensorDims);
+  TensorMap<Tensor<DataType, 1, DataLayout, IndexType>> in(gpu_data, tensorDims);
+  TensorMap<Tensor<DataType, 1, DataLayout, IndexType>> out(gpu_data, tensorDims);
   out.device(sycl_device) = in / in.constant(0);
 
   sycl_device.synchronize();
@@ -68,20 +68,21 @@
   sycl_device.deallocate(gpu_data);
 }
 
-template<typename DataType> void sycl_device_test_per_device(const cl::sycl::device& d){
+template <typename DataType>
+void sycl_device_test_per_device(const cl::sycl::device& d) {
   std::cout << "Running on " << d.template get_info<cl::sycl::info::device::name>() << std::endl;
   QueueInterface queueInterface(d);
   auto sycl_device = Eigen::SyclDevice(&queueInterface);
   test_device_memory<DataType, RowMajor, int64_t>(sycl_device);
   test_device_memory<DataType, ColMajor, int64_t>(sycl_device);
   /// this test throw an exception. enable it if you want to see the exception
-  //test_device_exceptions<DataType, RowMajor>(sycl_device);
+  // test_device_exceptions<DataType, RowMajor>(sycl_device);
   /// this test throw an exception. enable it if you want to see the exception
-  //test_device_exceptions<DataType, ColMajor>(sycl_device);
+  // test_device_exceptions<DataType, ColMajor>(sycl_device);
 }
 
 EIGEN_DECLARE_TEST(cxx11_tensor_device_sycl) {
-  for (const auto& device :Eigen::get_sycl_supported_devices()) {
+  for (const auto& device : Eigen::get_sycl_supported_devices()) {
     CALL_SUBTEST(sycl_device_test_per_device<half>(device));
     CALL_SUBTEST(sycl_device_test_per_device<float>(device));
     CALL_SUBTEST(sycl_device_test_per_device<OffByOneScalar<int>>(device));
diff --git a/unsupported/test/cxx11_tensor_dimension.cpp b/unsupported/test/cxx11_tensor_dimension.cpp
index ee416e1..3423a66 100644
--- a/unsupported/test/cxx11_tensor_dimension.cpp
+++ b/unsupported/test/cxx11_tensor_dimension.cpp
@@ -13,43 +13,38 @@
 
 using Eigen::Tensor;
 
-
-static void test_dynamic_size()
-{
-  Eigen::DSizes<int, 3> dimensions(2,3,7);
+static void test_dynamic_size() {
+  Eigen::DSizes<int, 3> dimensions(2, 3, 7);
 
   VERIFY_IS_EQUAL((int)Eigen::internal::array_get<0>(dimensions), 2);
   VERIFY_IS_EQUAL((int)Eigen::internal::array_get<1>(dimensions), 3);
   VERIFY_IS_EQUAL((int)Eigen::internal::array_get<2>(dimensions), 7);
-  VERIFY_IS_EQUAL((int)dimensions.TotalSize(), 2*3*7);
+  VERIFY_IS_EQUAL((int)dimensions.TotalSize(), 2 * 3 * 7);
   VERIFY_IS_EQUAL((int)dimensions[0], 2);
   VERIFY_IS_EQUAL((int)dimensions[1], 3);
   VERIFY_IS_EQUAL((int)dimensions[2], 7);
 }
 
-static void test_fixed_size()
-{
-  Eigen::Sizes<2,3,7> dimensions;
+static void test_fixed_size() {
+  Eigen::Sizes<2, 3, 7> dimensions;
 
   VERIFY_IS_EQUAL((int)Eigen::internal::array_get<0>(dimensions), 2);
   VERIFY_IS_EQUAL((int)Eigen::internal::array_get<1>(dimensions), 3);
   VERIFY_IS_EQUAL((int)Eigen::internal::array_get<2>(dimensions), 7);
-  VERIFY_IS_EQUAL((int)dimensions.TotalSize(), 2*3*7);
+  VERIFY_IS_EQUAL((int)dimensions.TotalSize(), 2 * 3 * 7);
 }
 
-static void test_match()
-{
-  Eigen::DSizes<unsigned int, 3> dyn((unsigned int)2,(unsigned int)3,(unsigned int)7);
-  Eigen::Sizes<2,3,7> stat;
+static void test_match() {
+  Eigen::DSizes<unsigned int, 3> dyn((unsigned int)2, (unsigned int)3, (unsigned int)7);
+  Eigen::Sizes<2, 3, 7> stat;
   VERIFY_IS_EQUAL(Eigen::dimensions_match(dyn, stat), true);
 
-  Eigen::DSizes<int, 3> dyn1(2,3,7);
-  Eigen::DSizes<int, 2> dyn2(2,3);
+  Eigen::DSizes<int, 3> dyn1(2, 3, 7);
+  Eigen::DSizes<int, 2> dyn2(2, 3);
   VERIFY_IS_EQUAL(Eigen::dimensions_match(dyn1, dyn2), false);
 }
 
-static void test_rank_zero()
-{
+static void test_rank_zero() {
   Eigen::Sizes<> scalar;
   VERIFY_IS_EQUAL((int)scalar.TotalSize(), 1);
   VERIFY_IS_EQUAL((int)scalar.rank(), 0);
@@ -78,8 +73,7 @@
   VERIFY_IS_EQUAL(dst1[2], 6L);
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_dimension)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_dimension) {
   CALL_SUBTEST(test_dynamic_size());
   CALL_SUBTEST(test_fixed_size());
   CALL_SUBTEST(test_match());
diff --git a/unsupported/test/cxx11_tensor_empty.cpp b/unsupported/test/cxx11_tensor_empty.cpp
index fd889c4..c90cf36 100644
--- a/unsupported/test/cxx11_tensor_empty.cpp
+++ b/unsupported/test/cxx11_tensor_empty.cpp
@@ -11,9 +11,7 @@
 
 #include <Eigen/CXX11/Tensor>
 
-
-static void test_empty_tensor()
-{
+static void test_empty_tensor() {
   Tensor<float, 2> source;
   Tensor<float, 2> tgt1 = source;
   Tensor<float, 2> tgt2(source);
@@ -22,8 +20,7 @@
   tgt3 = tgt2;
 }
 
-static void test_empty_fixed_size_tensor()
-{
+static void test_empty_fixed_size_tensor() {
   TensorFixedSize<float, Sizes<0> > source;
   TensorFixedSize<float, Sizes<0> > tgt1 = source;
   TensorFixedSize<float, Sizes<0> > tgt2(source);
@@ -32,9 +29,7 @@
   tgt3 = tgt2;
 }
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_empty)
-{
-   CALL_SUBTEST(test_empty_tensor());
-   CALL_SUBTEST(test_empty_fixed_size_tensor());
+EIGEN_DECLARE_TEST(cxx11_tensor_empty) {
+  CALL_SUBTEST(test_empty_tensor());
+  CALL_SUBTEST(test_empty_fixed_size_tensor());
 }
diff --git a/unsupported/test/cxx11_tensor_executor.cpp b/unsupported/test/cxx11_tensor_executor.cpp
index d0103dc..ba553f9 100644
--- a/unsupported/test/cxx11_tensor_executor.cpp
+++ b/unsupported/test/cxx11_tensor_executor.cpp
@@ -13,9 +13,9 @@
 
 #include <Eigen/CXX11/Tensor>
 
-using Eigen::Tensor;
-using Eigen::RowMajor;
 using Eigen::ColMajor;
+using Eigen::RowMajor;
+using Eigen::Tensor;
 using Eigen::internal::TiledEvaluation;
 
 // A set of tests to verify that different TensorExecutor strategies yields the
@@ -26,21 +26,18 @@
 template <typename Dst, typename Expr>
 static void DefaultAssign(Dst& dst, Expr expr) {
   using Assign = Eigen::TensorAssignOp<Dst, const Expr>;
-  using Executor =
-      Eigen::internal::TensorExecutor<const Assign, DefaultDevice,
-                                      /*Vectorizable=*/false,
-                                      /*Tiling=*/TiledEvaluation::Off>;
+  using Executor = Eigen::internal::TensorExecutor<const Assign, DefaultDevice,
+                                                   /*Vectorizable=*/false,
+                                                   /*Tiling=*/TiledEvaluation::Off>;
 
   Executor::run(Assign(dst, expr), DefaultDevice());
 }
 
 // Assignment with specified device and tiling strategy.
-template <bool Vectorizable, TiledEvaluation Tiling, typename Device,
-          typename Dst, typename Expr>
+template <bool Vectorizable, TiledEvaluation Tiling, typename Device, typename Dst, typename Expr>
 static void DeviceAssign(Device& d, Dst& dst, Expr expr) {
   using Assign = Eigen::TensorAssignOp<Dst, const Expr>;
-  using Executor = Eigen::internal::TensorExecutor<const Assign, Device,
-                                                   Vectorizable, Tiling>;
+  using Executor = Eigen::internal::TensorExecutor<const Assign, Device, Vectorizable, Tiling>;
 
   Executor::run(Assign(dst, expr), d);
 }
@@ -54,10 +51,8 @@
   return dims;
 }
 
-template <typename T, int NumDims, typename Device, bool Vectorizable,
-          TiledEvaluation Tiling, int Layout>
-static void test_execute_unary_expr(Device d)
-{
+template <typename T, int NumDims, typename Device, bool Vectorizable, TiledEvaluation Tiling, int Layout>
+static void test_execute_unary_expr(Device d) {
   static constexpr int Options = 0 | Layout;
 
   // Pick a large enough tensor size to bypass small tensor block evaluation
@@ -71,8 +66,7 @@
   const auto expr = src.square();
 
   using Assign = TensorAssignOp<decltype(dst), const decltype(expr)>;
-  using Executor =
-      internal::TensorExecutor<const Assign, Device, Vectorizable, Tiling>;
+  using Executor = internal::TensorExecutor<const Assign, Device, Vectorizable, Tiling>;
 
   Executor::run(Assign(dst, expr), d);
 
@@ -82,10 +76,8 @@
   }
 }
 
-template <typename T, int NumDims, typename Device, bool Vectorizable,
-          TiledEvaluation Tiling, int Layout>
-static void test_execute_binary_expr(Device d)
-{
+template <typename T, int NumDims, typename Device, bool Vectorizable, TiledEvaluation Tiling, int Layout>
+static void test_execute_binary_expr(Device d) {
   static constexpr int Options = 0 | Layout;
 
   // Pick a large enough tensor size to bypass small tensor block evaluation
@@ -102,8 +94,7 @@
   const auto expr = lhs + rhs;
 
   using Assign = TensorAssignOp<decltype(dst), const decltype(expr)>;
-  using Executor =
-      internal::TensorExecutor<const Assign, Device, Vectorizable, Tiling>;
+  using Executor = internal::TensorExecutor<const Assign, Device, Vectorizable, Tiling>;
 
   Executor::run(Assign(dst, expr), d);
 
@@ -113,10 +104,8 @@
   }
 }
 
-template <typename T, int NumDims, typename Device, bool Vectorizable,
-          TiledEvaluation Tiling, int Layout>
-static void test_execute_broadcasting(Device d)
-{
+template <typename T, int NumDims, typename Device, bool Vectorizable, TiledEvaluation Tiling, int Layout>
+static void test_execute_broadcasting(Device d) {
   static constexpr int Options = 0 | Layout;
 
   auto dims = RandomDims<NumDims>(1, 10);
@@ -135,8 +124,7 @@
   Tensor<T, NumDims, Options, Index> dst(golden.dimensions());
 
   using Assign = TensorAssignOp<decltype(dst), const decltype(expr)>;
-  using Executor =
-      internal::TensorExecutor<const Assign, Device, Vectorizable, Tiling>;
+  using Executor = internal::TensorExecutor<const Assign, Device, Vectorizable, Tiling>;
 
   Executor::run(Assign(dst, expr), d);
 
@@ -145,33 +133,30 @@
   }
 }
 
-template <typename T, int NumDims, typename Device, bool Vectorizable,
-          TiledEvaluation Tiling, int Layout>
-static void test_execute_chipping_rvalue(Device d)
-{
+template <typename T, int NumDims, typename Device, bool Vectorizable, TiledEvaluation Tiling, int Layout>
+static void test_execute_chipping_rvalue(Device d) {
   auto dims = RandomDims<NumDims>(1, 10);
   Tensor<T, NumDims, Layout, Index> src(dims);
   src.setRandom();
 
-#define TEST_CHIPPING(CHIP_DIM)                                           \
-  if (NumDims > (CHIP_DIM)) {                                             \
-    const auto offset = internal::random<Index>(0, dims[(CHIP_DIM)] - 1); \
-    const auto expr = src.template chip<(CHIP_DIM)>(offset);              \
-                                                                          \
-    Tensor<T, NumDims - 1, Layout, Index> golden;                         \
-    golden = expr;                                                        \
-                                                                          \
-    Tensor<T, NumDims - 1, Layout, Index> dst(golden.dimensions());       \
-                                                                          \
-    using Assign = TensorAssignOp<decltype(dst), const decltype(expr)>;   \
-    using Executor = internal::TensorExecutor<const Assign, Device,       \
-                                              Vectorizable, Tiling>;      \
-                                                                          \
-    Executor::run(Assign(dst, expr), d);                                  \
-                                                                          \
-    for (Index i = 0; i < dst.dimensions().TotalSize(); ++i) {            \
-      VERIFY_IS_EQUAL(dst.coeff(i), golden.coeff(i));                     \
-    }                                                                     \
+#define TEST_CHIPPING(CHIP_DIM)                                                            \
+  if (NumDims > (CHIP_DIM)) {                                                              \
+    const auto offset = internal::random<Index>(0, dims[(CHIP_DIM)] - 1);                  \
+    const auto expr = src.template chip<(CHIP_DIM)>(offset);                               \
+                                                                                           \
+    Tensor<T, NumDims - 1, Layout, Index> golden;                                          \
+    golden = expr;                                                                         \
+                                                                                           \
+    Tensor<T, NumDims - 1, Layout, Index> dst(golden.dimensions());                        \
+                                                                                           \
+    using Assign = TensorAssignOp<decltype(dst), const decltype(expr)>;                    \
+    using Executor = internal::TensorExecutor<const Assign, Device, Vectorizable, Tiling>; \
+                                                                                           \
+    Executor::run(Assign(dst, expr), d);                                                   \
+                                                                                           \
+    for (Index i = 0; i < dst.dimensions().TotalSize(); ++i) {                             \
+      VERIFY_IS_EQUAL(dst.coeff(i), golden.coeff(i));                                      \
+    }                                                                                      \
   }
 
   TEST_CHIPPING(0)
@@ -184,46 +169,43 @@
 #undef TEST_CHIPPING
 }
 
-template <typename T, int NumDims, typename Device, bool Vectorizable,
-    TiledEvaluation Tiling, int Layout>
-static void test_execute_chipping_lvalue(Device d)
-{
+template <typename T, int NumDims, typename Device, bool Vectorizable, TiledEvaluation Tiling, int Layout>
+static void test_execute_chipping_lvalue(Device d) {
   auto dims = RandomDims<NumDims>(1, 10);
 
-#define TEST_CHIPPING(CHIP_DIM)                                             \
-  if (NumDims > (CHIP_DIM)) {                                               \
-    /* Generate random data that we'll assign to the chipped tensor dim. */ \
-    array<Index, NumDims - 1> src_dims;                                     \
-    for (int i = 0; i < NumDims - 1; ++i) {                                 \
-      int dim = i < (CHIP_DIM) ? i : i + 1;                                 \
-      src_dims[i] = dims[dim];                                              \
-    }                                                                       \
-                                                                            \
-    Tensor<T, NumDims - 1, Layout, Index> src(src_dims);                    \
-    src.setRandom();                                                        \
-                                                                            \
-    const auto offset = internal::random<Index>(0, dims[(CHIP_DIM)] - 1);   \
-                                                                            \
-    Tensor<T, NumDims, Layout, Index> random(dims);                         \
-    random.setZero();                                                       \
-                                                                            \
-    Tensor<T, NumDims, Layout, Index> golden(dims);                         \
-    golden = random;                                                        \
-    golden.template chip<(CHIP_DIM)>(offset) = src;                         \
-                                                                            \
-    Tensor<T, NumDims, Layout, Index> dst(dims);                            \
-    dst = random;                                                           \
-    auto expr = dst.template chip<(CHIP_DIM)>(offset);                      \
-                                                                            \
-    using Assign = TensorAssignOp<decltype(expr), const decltype(src)>;     \
-    using Executor = internal::TensorExecutor<const Assign, Device,         \
-                                              Vectorizable, Tiling>;        \
-                                                                            \
-    Executor::run(Assign(expr, src), d);                                    \
-                                                                            \
-    for (Index i = 0; i < dst.dimensions().TotalSize(); ++i) {              \
-      VERIFY_IS_EQUAL(dst.coeff(i), golden.coeff(i));                       \
-    }                                                                       \
+#define TEST_CHIPPING(CHIP_DIM)                                                            \
+  if (NumDims > (CHIP_DIM)) {                                                              \
+    /* Generate random data that we'll assign to the chipped tensor dim. */                \
+    array<Index, NumDims - 1> src_dims;                                                    \
+    for (int i = 0; i < NumDims - 1; ++i) {                                                \
+      int dim = i < (CHIP_DIM) ? i : i + 1;                                                \
+      src_dims[i] = dims[dim];                                                             \
+    }                                                                                      \
+                                                                                           \
+    Tensor<T, NumDims - 1, Layout, Index> src(src_dims);                                   \
+    src.setRandom();                                                                       \
+                                                                                           \
+    const auto offset = internal::random<Index>(0, dims[(CHIP_DIM)] - 1);                  \
+                                                                                           \
+    Tensor<T, NumDims, Layout, Index> random(dims);                                        \
+    random.setZero();                                                                      \
+                                                                                           \
+    Tensor<T, NumDims, Layout, Index> golden(dims);                                        \
+    golden = random;                                                                       \
+    golden.template chip<(CHIP_DIM)>(offset) = src;                                        \
+                                                                                           \
+    Tensor<T, NumDims, Layout, Index> dst(dims);                                           \
+    dst = random;                                                                          \
+    auto expr = dst.template chip<(CHIP_DIM)>(offset);                                     \
+                                                                                           \
+    using Assign = TensorAssignOp<decltype(expr), const decltype(src)>;                    \
+    using Executor = internal::TensorExecutor<const Assign, Device, Vectorizable, Tiling>; \
+                                                                                           \
+    Executor::run(Assign(expr, src), d);                                                   \
+                                                                                           \
+    for (Index i = 0; i < dst.dimensions().TotalSize(); ++i) {                             \
+      VERIFY_IS_EQUAL(dst.coeff(i), golden.coeff(i));                                      \
+    }                                                                                      \
   }
 
   TEST_CHIPPING(0)
@@ -236,10 +218,8 @@
 #undef TEST_CHIPPING
 }
 
-template <typename T, int NumDims, typename Device, bool Vectorizable,
-          TiledEvaluation Tiling, int Layout>
-static void test_execute_shuffle_rvalue(Device d)
-{
+template <typename T, int NumDims, typename Device, bool Vectorizable, TiledEvaluation Tiling, int Layout>
+static void test_execute_shuffle_rvalue(Device d) {
   static constexpr int Options = 0 | Layout;
 
   auto dims = RandomDims<NumDims>(1, 10);
@@ -274,10 +254,8 @@
   } while (std::next_permutation(&shuffle[0], &shuffle[0] + NumDims));
 }
 
-template <typename T, int NumDims, typename Device, bool Vectorizable,
-          TiledEvaluation Tiling, int Layout>
-static void test_execute_shuffle_lvalue(Device d)
-{
+template <typename T, int NumDims, typename Device, bool Vectorizable, TiledEvaluation Tiling, int Layout>
+static void test_execute_shuffle_lvalue(Device d) {
   static constexpr int Options = 0 | Layout;
 
   auto dims = RandomDims<NumDims>(5, 10);
@@ -310,10 +288,8 @@
   } while (std::next_permutation(&shuffle[0], &shuffle[0] + NumDims));
 }
 
-template <typename T, int NumDims, typename Device, bool Vectorizable,
-    TiledEvaluation Tiling, int Layout>
-static void test_execute_reshape(Device d)
-{
+template <typename T, int NumDims, typename Device, bool Vectorizable, TiledEvaluation Tiling, int Layout>
+static void test_execute_reshape(Device d) {
   static_assert(NumDims >= 2, "NumDims must be greater or equal than 2");
 
   static constexpr int ReshapedDims = NumDims - 1;
@@ -340,8 +316,7 @@
   auto expr = src.reshape(reshaped_dims);
 
   using Assign = TensorAssignOp<decltype(dst), const decltype(expr)>;
-  using Executor =
-      internal::TensorExecutor<const Assign, Device, Vectorizable, Tiling>;
+  using Executor = internal::TensorExecutor<const Assign, Device, Vectorizable, Tiling>;
 
   Executor::run(Assign(dst, expr), d);
 
@@ -350,10 +325,8 @@
   }
 }
 
-template <typename T, int NumDims, typename Device, bool Vectorizable,
-          TiledEvaluation Tiling, int Layout>
-static void test_execute_slice_rvalue(Device d)
-{
+template <typename T, int NumDims, typename Device, bool Vectorizable, TiledEvaluation Tiling, int Layout>
+static void test_execute_slice_rvalue(Device d) {
   static_assert(NumDims >= 2, "NumDims must be greater or equal than 2");
   static constexpr int Options = 0 | Layout;
 
@@ -371,8 +344,7 @@
     slice_size[i] = numext::mini(slice_size[i], dims[i] - slice_start[i]);
   }
 
-  Tensor<T, NumDims, Options, Index> golden =
-      src.slice(slice_start, slice_size);
+  Tensor<T, NumDims, Options, Index> golden = src.slice(slice_start, slice_size);
 
   // Now reshape using configured tensor executor.
   Tensor<T, NumDims, Options, Index> dst(golden.dimensions());
@@ -380,8 +352,7 @@
   auto expr = src.slice(slice_start, slice_size);
 
   using Assign = TensorAssignOp<decltype(dst), const decltype(expr)>;
-  using Executor =
-      internal::TensorExecutor<const Assign, Device, Vectorizable, Tiling>;
+  using Executor = internal::TensorExecutor<const Assign, Device, Vectorizable, Tiling>;
 
   Executor::run(Assign(dst, expr), d);
 
@@ -390,10 +361,8 @@
   }
 }
 
-template <typename T, int NumDims, typename Device, bool Vectorizable,
-    TiledEvaluation Tiling, int Layout>
-static void test_execute_slice_lvalue(Device d)
-{
+template <typename T, int NumDims, typename Device, bool Vectorizable, TiledEvaluation Tiling, int Layout>
+static void test_execute_slice_lvalue(Device d) {
   static_assert(NumDims >= 2, "NumDims must be greater or equal than 2");
   static constexpr int Options = 0 | Layout;
 
@@ -423,8 +392,7 @@
   auto expr = dst.slice(slice_start, slice_size);
 
   using Assign = TensorAssignOp<decltype(expr), const decltype(slice)>;
-  using Executor =
-      internal::TensorExecutor<const Assign, Device, Vectorizable, Tiling>;
+  using Executor = internal::TensorExecutor<const Assign, Device, Vectorizable, Tiling>;
 
   Executor::run(Assign(expr, slice), d);
 
@@ -433,10 +401,8 @@
   }
 }
 
-template <typename T, int NumDims, typename Device, bool Vectorizable,
-    TiledEvaluation Tiling, int Layout>
-static void test_execute_broadcasting_of_forced_eval(Device d)
-{
+template <typename T, int NumDims, typename Device, bool Vectorizable, TiledEvaluation Tiling, int Layout>
+static void test_execute_broadcasting_of_forced_eval(Device d) {
   static constexpr int Options = 0 | Layout;
 
   auto dims = RandomDims<NumDims>(1, 10);
@@ -455,8 +421,7 @@
   Tensor<T, NumDims, Options, Index> dst(golden.dimensions());
 
   using Assign = TensorAssignOp<decltype(dst), const decltype(expr)>;
-  using Executor =
-      internal::TensorExecutor<const Assign, Device, Vectorizable, Tiling>;
+  using Executor = internal::TensorExecutor<const Assign, Device, Vectorizable, Tiling>;
 
   Executor::run(Assign(dst, expr), d);
 
@@ -465,10 +430,9 @@
   }
 }
 
-template<typename T, int NumDims>
+template <typename T, int NumDims>
 struct DummyGenerator {
-  EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
-  T operator()(const array <Index, NumDims>& dims) const {
+  EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T operator()(const array<Index, NumDims>& dims) const {
     T result = static_cast<T>(0);
     for (int i = 0; i < NumDims; ++i) {
       result += static_cast<T>((i + 1) * dims[i]);
@@ -477,10 +441,8 @@
   }
 };
 
-template <typename T, int NumDims, typename Device, bool Vectorizable,
-    TiledEvaluation Tiling, int Layout>
-static void test_execute_generator_op(Device d)
-{
+template <typename T, int NumDims, typename Device, bool Vectorizable, TiledEvaluation Tiling, int Layout>
+static void test_execute_generator_op(Device d) {
   static constexpr int Options = 0 | Layout;
 
   auto dims = RandomDims<NumDims>(20, 30);
@@ -498,8 +460,7 @@
   Tensor<T, NumDims, Options, Index> dst(golden.dimensions());
 
   using Assign = TensorAssignOp<decltype(dst), const decltype(expr)>;
-  using Executor =
-    internal::TensorExecutor<const Assign, Device, Vectorizable, Tiling>;
+  using Executor = internal::TensorExecutor<const Assign, Device, Vectorizable, Tiling>;
 
   Executor::run(Assign(dst, expr), d);
 
@@ -508,14 +469,12 @@
   }
 }
 
-template <typename T, int NumDims, typename Device, bool Vectorizable,
-    TiledEvaluation Tiling, int Layout>
-static void test_execute_reverse_rvalue(Device d)
-{
+template <typename T, int NumDims, typename Device, bool Vectorizable, TiledEvaluation Tiling, int Layout>
+static void test_execute_reverse_rvalue(Device d) {
   static constexpr int Options = 0 | Layout;
 
   auto dims = RandomDims<NumDims>(1, numext::pow(1000000.0, 1.0 / NumDims));
-  Tensor <T, NumDims, Options, Index> src(dims);
+  Tensor<T, NumDims, Options, Index> src(dims);
   src.setRandom();
 
   // Reverse half of the dimensions.
@@ -526,15 +485,14 @@
 
   // We assume that reversing on a default device is tested and correct, so
   // we can rely on it to verify correctness of tensor executor and tiling.
-  Tensor <T, NumDims, Options, Index> golden;
+  Tensor<T, NumDims, Options, Index> golden;
   golden = expr;
 
   // Now do the reversing using configured tensor executor.
-  Tensor <T, NumDims, Options, Index> dst(golden.dimensions());
+  Tensor<T, NumDims, Options, Index> dst(golden.dimensions());
 
   using Assign = TensorAssignOp<decltype(dst), const decltype(expr)>;
-  using Executor =
-    internal::TensorExecutor<const Assign, Device, Vectorizable, Tiling>;
+  using Executor = internal::TensorExecutor<const Assign, Device, Vectorizable, Tiling>;
 
   Executor::run(Assign(dst, expr), d);
 
@@ -543,10 +501,8 @@
   }
 }
 
-template <typename T, int NumDims, typename Device, bool Vectorizable,
-          TiledEvaluation Tiling, int Layout>
-static void test_async_execute_unary_expr(Device d)
-{
+template <typename T, int NumDims, typename Device, bool Vectorizable, TiledEvaluation Tiling, int Layout>
+static void test_async_execute_unary_expr(Device d) {
   static constexpr int Options = 0 | Layout;
 
   // Pick a large enough tensor size to bypass small tensor block evaluation
@@ -564,8 +520,7 @@
 
   using Assign = TensorAssignOp<decltype(dst), const decltype(expr)>;
   using DoneCallback = decltype(on_done);
-  using Executor = internal::TensorAsyncExecutor<const Assign, Device, DoneCallback,
-                                                 Vectorizable, Tiling>;
+  using Executor = internal::TensorAsyncExecutor<const Assign, Device, DoneCallback, Vectorizable, Tiling>;
 
   Executor::runAsync(Assign(dst, expr), d, on_done);
   done.Wait();
@@ -576,10 +531,8 @@
   }
 }
 
-template <typename T, int NumDims, typename Device, bool Vectorizable,
-          TiledEvaluation Tiling, int Layout>
-static void test_async_execute_binary_expr(Device d)
-{
+template <typename T, int NumDims, typename Device, bool Vectorizable, TiledEvaluation Tiling, int Layout>
+static void test_async_execute_binary_expr(Device d) {
   static constexpr int Options = 0 | Layout;
 
   // Pick a large enough tensor size to bypass small tensor block evaluation
@@ -600,8 +553,7 @@
 
   using Assign = TensorAssignOp<decltype(dst), const decltype(expr)>;
   using DoneCallback = decltype(on_done);
-  using Executor = internal::TensorAsyncExecutor<const Assign, Device, DoneCallback,
-                                                 Vectorizable, Tiling>;
+  using Executor = internal::TensorAsyncExecutor<const Assign, Device, DoneCallback, Vectorizable, Tiling>;
 
   Executor::runAsync(Assign(dst, expr), d, on_done);
   done.Wait();
@@ -615,39 +567,50 @@
 #ifndef EIGEN_DONT_VECTORIZE
 #define EIGEN_DONT_VECTORIZE 0
 #endif
-#define VECTORIZABLE(T, VAL) !EIGEN_DONT_VECTORIZE && Eigen::internal::packet_traits<T>::Vectorizable && VAL
+#define VECTORIZABLE(T, VAL) !EIGEN_DONT_VECTORIZE&& Eigen::internal::packet_traits<T>::Vectorizable&& VAL
 
-#define CALL_SUBTEST_PART(PART) \
-  CALL_SUBTEST_##PART
+#define CALL_SUBTEST_PART(PART) CALL_SUBTEST_##PART
 
-#define CALL_SUBTEST_COMBINATIONS(PART, NAME, T, NUM_DIMS)                                                                                 \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, DefaultDevice,    false,                  TiledEvaluation::Off, ColMajor>(default_device))); \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, DefaultDevice,    false,                  TiledEvaluation::On,  ColMajor>(default_device)));     \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, DefaultDevice,    VECTORIZABLE(T, true),  TiledEvaluation::Off, ColMajor>(default_device))); \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, DefaultDevice,    VECTORIZABLE(T, true),  TiledEvaluation::On,  ColMajor>(default_device)));     \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, DefaultDevice,    false,                  TiledEvaluation::Off, RowMajor>(default_device))); \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, DefaultDevice,    false,                  TiledEvaluation::On,  RowMajor>(default_device)));     \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, DefaultDevice,    VECTORIZABLE(T, true),  TiledEvaluation::Off, RowMajor>(default_device))); \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, DefaultDevice,    VECTORIZABLE(T, true),  TiledEvaluation::On,  RowMajor>(default_device)));     \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, false,                  TiledEvaluation::Off, ColMajor>(tp_device)));      \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, false,                  TiledEvaluation::On,  ColMajor>(tp_device)));          \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, VECTORIZABLE(T, true),  TiledEvaluation::Off, ColMajor>(tp_device)));      \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, VECTORIZABLE(T, true),  TiledEvaluation::On,  ColMajor>(tp_device)));          \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, false,                  TiledEvaluation::Off, RowMajor>(tp_device)));      \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, false,                  TiledEvaluation::On,  RowMajor>(tp_device)));          \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, VECTORIZABLE(T, true),  TiledEvaluation::Off, RowMajor>(tp_device)));      \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, VECTORIZABLE(T, true),  TiledEvaluation::On,  RowMajor>(tp_device)))
+#define CALL_SUBTEST_COMBINATIONS(PART, NAME, T, NUM_DIMS)                                                            \
+  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, DefaultDevice, false, TiledEvaluation::Off, ColMajor>(default_device))); \
+  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, DefaultDevice, false, TiledEvaluation::On, ColMajor>(default_device)));  \
+  CALL_SUBTEST_PART(PART)                                                                                             \
+  ((NAME<T, NUM_DIMS, DefaultDevice, VECTORIZABLE(T, true), TiledEvaluation::Off, ColMajor>(default_device)));        \
+  CALL_SUBTEST_PART(PART)                                                                                             \
+  ((NAME<T, NUM_DIMS, DefaultDevice, VECTORIZABLE(T, true), TiledEvaluation::On, ColMajor>(default_device)));         \
+  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, DefaultDevice, false, TiledEvaluation::Off, RowMajor>(default_device))); \
+  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, DefaultDevice, false, TiledEvaluation::On, RowMajor>(default_device)));  \
+  CALL_SUBTEST_PART(PART)                                                                                             \
+  ((NAME<T, NUM_DIMS, DefaultDevice, VECTORIZABLE(T, true), TiledEvaluation::Off, RowMajor>(default_device)));        \
+  CALL_SUBTEST_PART(PART)                                                                                             \
+  ((NAME<T, NUM_DIMS, DefaultDevice, VECTORIZABLE(T, true), TiledEvaluation::On, RowMajor>(default_device)));         \
+  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, false, TiledEvaluation::Off, ColMajor>(tp_device)));   \
+  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, false, TiledEvaluation::On, ColMajor>(tp_device)));    \
+  CALL_SUBTEST_PART(PART)                                                                                             \
+  ((NAME<T, NUM_DIMS, ThreadPoolDevice, VECTORIZABLE(T, true), TiledEvaluation::Off, ColMajor>(tp_device)));          \
+  CALL_SUBTEST_PART(PART)                                                                                             \
+  ((NAME<T, NUM_DIMS, ThreadPoolDevice, VECTORIZABLE(T, true), TiledEvaluation::On, ColMajor>(tp_device)));           \
+  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, false, TiledEvaluation::Off, RowMajor>(tp_device)));   \
+  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, false, TiledEvaluation::On, RowMajor>(tp_device)));    \
+  CALL_SUBTEST_PART(PART)                                                                                             \
+  ((NAME<T, NUM_DIMS, ThreadPoolDevice, VECTORIZABLE(T, true), TiledEvaluation::Off, RowMajor>(tp_device)));          \
+  CALL_SUBTEST_PART(PART)                                                                                             \
+  ((NAME<T, NUM_DIMS, ThreadPoolDevice, VECTORIZABLE(T, true), TiledEvaluation::On, RowMajor>(tp_device)))
 
 // NOTE: Currently only ThreadPoolDevice supports async expression evaluation.
-#define CALL_ASYNC_SUBTEST_COMBINATIONS(PART, NAME, T, NUM_DIMS)                                                                      \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, false,                  TiledEvaluation::Off, ColMajor>(tp_device))); \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, false,                  TiledEvaluation::On,  ColMajor>(tp_device)));     \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, VECTORIZABLE(T, true),  TiledEvaluation::Off, ColMajor>(tp_device))); \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, VECTORIZABLE(T, true),  TiledEvaluation::On,  ColMajor>(tp_device)));     \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, false,                  TiledEvaluation::Off, RowMajor>(tp_device))); \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, false,                  TiledEvaluation::On,  RowMajor>(tp_device)));     \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, VECTORIZABLE(T, true),  TiledEvaluation::Off, RowMajor>(tp_device))); \
-  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, VECTORIZABLE(T, true),  TiledEvaluation::On,  RowMajor>(tp_device)))
+#define CALL_ASYNC_SUBTEST_COMBINATIONS(PART, NAME, T, NUM_DIMS)                                                    \
+  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, false, TiledEvaluation::Off, ColMajor>(tp_device))); \
+  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, false, TiledEvaluation::On, ColMajor>(tp_device)));  \
+  CALL_SUBTEST_PART(PART)                                                                                           \
+  ((NAME<T, NUM_DIMS, ThreadPoolDevice, VECTORIZABLE(T, true), TiledEvaluation::Off, ColMajor>(tp_device)));        \
+  CALL_SUBTEST_PART(PART)                                                                                           \
+  ((NAME<T, NUM_DIMS, ThreadPoolDevice, VECTORIZABLE(T, true), TiledEvaluation::On, ColMajor>(tp_device)));         \
+  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, false, TiledEvaluation::Off, RowMajor>(tp_device))); \
+  CALL_SUBTEST_PART(PART)((NAME<T, NUM_DIMS, ThreadPoolDevice, false, TiledEvaluation::On, RowMajor>(tp_device)));  \
+  CALL_SUBTEST_PART(PART)                                                                                           \
+  ((NAME<T, NUM_DIMS, ThreadPoolDevice, VECTORIZABLE(T, true), TiledEvaluation::Off, RowMajor>(tp_device)));        \
+  CALL_SUBTEST_PART(PART)                                                                                           \
+  ((NAME<T, NUM_DIMS, ThreadPoolDevice, VECTORIZABLE(T, true), TiledEvaluation::On, RowMajor>(tp_device)))
 
 EIGEN_DECLARE_TEST(cxx11_tensor_executor) {
   Eigen::DefaultDevice default_device;
diff --git a/unsupported/test/cxx11_tensor_expr.cpp b/unsupported/test/cxx11_tensor_expr.cpp
index c76fbc5..fc235d5 100644
--- a/unsupported/test/cxx11_tensor_expr.cpp
+++ b/unsupported/test/cxx11_tensor_expr.cpp
@@ -13,20 +13,25 @@
 
 #include <Eigen/CXX11/Tensor>
 
-using Eigen::Tensor;
 using Eigen::RowMajor;
+using Eigen::Tensor;
 
-static void test_1d()
-{
+static void test_1d() {
   Tensor<float, 1> vec1(6);
   Tensor<float, 1, RowMajor> vec2(6);
 
-  vec1(0) = 4.0;  vec2(0) = 0.0;
-  vec1(1) = 8.0;  vec2(1) = 1.0;
-  vec1(2) = 15.0; vec2(2) = 2.0;
-  vec1(3) = 16.0; vec2(3) = 3.0;
-  vec1(4) = 23.0; vec2(4) = 4.0;
-  vec1(5) = 42.0; vec2(5) = 5.0;
+  vec1(0) = 4.0;
+  vec2(0) = 0.0;
+  vec1(1) = 8.0;
+  vec2(1) = 1.0;
+  vec1(2) = 15.0;
+  vec2(2) = 2.0;
+  vec1(3) = 16.0;
+  vec2(3) = 3.0;
+  vec1(4) = 23.0;
+  vec2(4) = 4.0;
+  vec1(5) = 42.0;
+  vec2(5) = 5.0;
 
   float data3[6];
   TensorMap<Tensor<float, 1>> vec3(data3, 6);
@@ -68,112 +73,109 @@
   VERIFY_IS_APPROX(vec3(5), 42.0f + 5.0f);
 }
 
-static void test_2d()
-{
+static void test_2d() {
   float data1[6];
   TensorMap<Tensor<float, 2>> mat1(data1, 2, 3);
   float data2[6];
   TensorMap<Tensor<float, 2, RowMajor>> mat2(data2, 2, 3);
 
-  mat1(0,0) = 0.0;
-  mat1(0,1) = 1.0;
-  mat1(0,2) = 2.0;
-  mat1(1,0) = 3.0;
-  mat1(1,1) = 4.0;
-  mat1(1,2) = 5.0;
+  mat1(0, 0) = 0.0;
+  mat1(0, 1) = 1.0;
+  mat1(0, 2) = 2.0;
+  mat1(1, 0) = 3.0;
+  mat1(1, 1) = 4.0;
+  mat1(1, 2) = 5.0;
 
-  mat2(0,0) = -0.0;
-  mat2(0,1) = -1.0;
-  mat2(0,2) = -2.0;
-  mat2(1,0) = -3.0;
-  mat2(1,1) = -4.0;
-  mat2(1,2) = -5.0;
+  mat2(0, 0) = -0.0;
+  mat2(0, 1) = -1.0;
+  mat2(0, 2) = -2.0;
+  mat2(1, 0) = -3.0;
+  mat2(1, 1) = -4.0;
+  mat2(1, 2) = -5.0;
 
-  Tensor<float, 2> mat3(2,3);
-  Tensor<float, 2, RowMajor> mat4(2,3);
+  Tensor<float, 2> mat3(2, 3);
+  Tensor<float, 2, RowMajor> mat4(2, 3);
   mat3 = mat1.abs();
   mat4 = mat2.abs();
 
-  VERIFY_IS_APPROX(mat3(0,0), 0.0f);
-  VERIFY_IS_APPROX(mat3(0,1), 1.0f);
-  VERIFY_IS_APPROX(mat3(0,2), 2.0f);
-  VERIFY_IS_APPROX(mat3(1,0), 3.0f);
-  VERIFY_IS_APPROX(mat3(1,1), 4.0f);
-  VERIFY_IS_APPROX(mat3(1,2), 5.0f);
+  VERIFY_IS_APPROX(mat3(0, 0), 0.0f);
+  VERIFY_IS_APPROX(mat3(0, 1), 1.0f);
+  VERIFY_IS_APPROX(mat3(0, 2), 2.0f);
+  VERIFY_IS_APPROX(mat3(1, 0), 3.0f);
+  VERIFY_IS_APPROX(mat3(1, 1), 4.0f);
+  VERIFY_IS_APPROX(mat3(1, 2), 5.0f);
 
-  VERIFY_IS_APPROX(mat4(0,0), 0.0f);
-  VERIFY_IS_APPROX(mat4(0,1), 1.0f);
-  VERIFY_IS_APPROX(mat4(0,2), 2.0f);
-  VERIFY_IS_APPROX(mat4(1,0), 3.0f);
-  VERIFY_IS_APPROX(mat4(1,1), 4.0f);
-  VERIFY_IS_APPROX(mat4(1,2), 5.0f);
+  VERIFY_IS_APPROX(mat4(0, 0), 0.0f);
+  VERIFY_IS_APPROX(mat4(0, 1), 1.0f);
+  VERIFY_IS_APPROX(mat4(0, 2), 2.0f);
+  VERIFY_IS_APPROX(mat4(1, 0), 3.0f);
+  VERIFY_IS_APPROX(mat4(1, 1), 4.0f);
+  VERIFY_IS_APPROX(mat4(1, 2), 5.0f);
 }
 
-static void test_3d()
-{
-  Tensor<float, 3> mat1(2,3,7);
-  Tensor<float, 3, RowMajor> mat2(2,3,7);
+static void test_3d() {
+  Tensor<float, 3> mat1(2, 3, 7);
+  Tensor<float, 3, RowMajor> mat2(2, 3, 7);
 
   float val = 1.0f;
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        mat1(i,j,k) = val;
-        mat2(i,j,k) = val;
+        mat1(i, j, k) = val;
+        mat2(i, j, k) = val;
         val += 1.0f;
       }
     }
   }
 
-  Tensor<float, 3> mat3(2,3,7);
+  Tensor<float, 3> mat3(2, 3, 7);
   mat3 = mat1 + mat1;
-  Tensor<float, 3, RowMajor> mat4(2,3,7);
+  Tensor<float, 3, RowMajor> mat4(2, 3, 7);
   mat4 = mat2 * 3.14f;
-  Tensor<float, 3> mat5(2,3,7);
+  Tensor<float, 3> mat5(2, 3, 7);
   mat5 = (mat1 + mat1.constant(1)).inverse().log();
-  Tensor<float, 3, RowMajor> mat6(2,3,7);
+  Tensor<float, 3, RowMajor> mat6(2, 3, 7);
   mat6 = mat2.pow(0.5f) * 3.14f;
-  Tensor<float, 3> mat7(2,3,7);
+  Tensor<float, 3> mat7(2, 3, 7);
   mat7 = mat1.cwiseMax(mat5 * 2.0f).exp();
-  Tensor<float, 3, RowMajor> mat8(2,3,7);
+  Tensor<float, 3, RowMajor> mat8(2, 3, 7);
   mat8 = (-mat2).exp() * 3.14f;
-  Tensor<float, 3, RowMajor> mat9(2,3,7);
+  Tensor<float, 3, RowMajor> mat9(2, 3, 7);
   mat9 = mat2 + 3.14f;
-  Tensor<float, 3, RowMajor> mat10(2,3,7);
+  Tensor<float, 3, RowMajor> mat10(2, 3, 7);
   mat10 = mat2 - 3.14f;
-  Tensor<float, 3, RowMajor> mat11(2,3,7);
+  Tensor<float, 3, RowMajor> mat11(2, 3, 7);
   mat11 = mat2 / 3.14f;
 
   val = 1.0f;
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_APPROX(mat3(i,j,k), val + val);
-        VERIFY_IS_APPROX(mat4(i,j,k), val * 3.14f);
-        VERIFY_IS_APPROX(mat5(i,j,k), logf(1.0f/(val + 1)));
-        VERIFY_IS_APPROX(mat6(i,j,k), sqrtf(val) * 3.14f);
-        VERIFY_IS_APPROX(mat7(i,j,k), expf((std::max)(val, mat5(i,j,k) * 2.0f)));
-        VERIFY_IS_APPROX(mat8(i,j,k), expf(-val) * 3.14f);
-        VERIFY_IS_APPROX(mat9(i,j,k), val + 3.14f);
-        VERIFY_IS_APPROX(mat10(i,j,k), val - 3.14f);
-        VERIFY_IS_APPROX(mat11(i,j,k), val / 3.14f);
+        VERIFY_IS_APPROX(mat3(i, j, k), val + val);
+        VERIFY_IS_APPROX(mat4(i, j, k), val * 3.14f);
+        VERIFY_IS_APPROX(mat5(i, j, k), logf(1.0f / (val + 1)));
+        VERIFY_IS_APPROX(mat6(i, j, k), sqrtf(val) * 3.14f);
+        VERIFY_IS_APPROX(mat7(i, j, k), expf((std::max)(val, mat5(i, j, k) * 2.0f)));
+        VERIFY_IS_APPROX(mat8(i, j, k), expf(-val) * 3.14f);
+        VERIFY_IS_APPROX(mat9(i, j, k), val + 3.14f);
+        VERIFY_IS_APPROX(mat10(i, j, k), val - 3.14f);
+        VERIFY_IS_APPROX(mat11(i, j, k), val / 3.14f);
         val += 1.0f;
       }
     }
   }
 }
 
-static void test_constants()
-{
-  Tensor<float, 3> mat1(2,3,7);
-  Tensor<float, 3> mat2(2,3,7);
-  Tensor<float, 3> mat3(2,3,7);
+static void test_constants() {
+  Tensor<float, 3> mat1(2, 3, 7);
+  Tensor<float, 3> mat2(2, 3, 7);
+  Tensor<float, 3> mat3(2, 3, 7);
 
   float val = 1.0f;
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        mat1(i,j,k) = val;
+        mat1(i, j, k) = val;
         val += 1.0f;
       }
     }
@@ -185,16 +187,15 @@
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_APPROX(mat2(i,j,k), 3.14f);
-        VERIFY_IS_APPROX(mat3(i,j,k), expf((std::max)(val, 7.3f)));
+        VERIFY_IS_APPROX(mat2(i, j, k), 3.14f);
+        VERIFY_IS_APPROX(mat3(i, j, k), expf((std::max)(val, 7.3f)));
         val += 1.0f;
       }
     }
   }
 }
 
-static void test_boolean()
-{
+static void test_boolean() {
   const int kSize = 31;
   Tensor<int, 1> vec(kSize);
   std::iota(vec.data(), vec.data() + kSize, 0);
@@ -221,17 +222,16 @@
   bool3 = (vec < vec.constant(4)).cast<bool>() && bool2;
 }
 
-static void test_functors()
-{
-  Tensor<float, 3> mat1(2,3,7);
-  Tensor<float, 3> mat2(2,3,7);
-  Tensor<float, 3> mat3(2,3,7);
+static void test_functors() {
+  Tensor<float, 3> mat1(2, 3, 7);
+  Tensor<float, 3> mat2(2, 3, 7);
+  Tensor<float, 3> mat3(2, 3, 7);
 
   float val = 1.0f;
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        mat1(i,j,k) = val;
+        mat1(i, j, k) = val;
         val += 1.0f;
       }
     }
@@ -243,19 +243,18 @@
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_APPROX(mat2(i,j,k), asinf(1.0f / mat1(i,j,k)));
-        VERIFY_IS_APPROX(mat3(i,j,k), tanhf(mat1(i,j,k)));
+        VERIFY_IS_APPROX(mat2(i, j, k), asinf(1.0f / mat1(i, j, k)));
+        VERIFY_IS_APPROX(mat3(i, j, k), tanhf(mat1(i, j, k)));
         val += 1.0f;
       }
     }
   }
 }
 
-static void test_type_casting()
-{
-  Tensor<bool, 3> mat1(2,3,7);
-  Tensor<float, 3> mat2(2,3,7);
-  Tensor<double, 3> mat3(2,3,7);
+static void test_type_casting() {
+  Tensor<bool, 3> mat1(2, 3, 7);
+  Tensor<float, 3> mat2(2, 3, 7);
+  Tensor<double, 3> mat3(2, 3, 7);
   mat1.setRandom();
   mat2.setRandom();
 
@@ -263,7 +262,7 @@
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_APPROX(mat3(i,j,k), mat1(i,j,k) ? 1.0 : 0.0);
+        VERIFY_IS_APPROX(mat3(i, j, k), mat1(i, j, k) ? 1.0 : 0.0);
       }
     }
   }
@@ -272,20 +271,19 @@
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_APPROX(mat3(i,j,k), static_cast<double>(mat2(i,j,k)));
+        VERIFY_IS_APPROX(mat3(i, j, k), static_cast<double>(mat2(i, j, k)));
       }
     }
   }
 }
 
-static void test_select()
-{
+static void test_select() {
   using TypedGTOp = internal::scalar_cmp_op<float, float, internal::cmp_GT, true>;
 
-  Tensor<float, 3> selector(2,3,7);
-  Tensor<float, 3> mat1(2,3,7);
-  Tensor<float, 3> mat2(2,3,7);
-  Tensor<float, 3> result(2,3,7);
+  Tensor<float, 3> selector(2, 3, 7);
+  Tensor<float, 3> mat1(2, 3, 7);
+  Tensor<float, 3> mat2(2, 3, 7);
+  Tensor<float, 3> result(2, 3, 7);
 
   selector.setRandom();
   mat1.setRandom();
@@ -297,7 +295,7 @@
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_APPROX(result(i,j,k), (selector(i,j,k) > 0.5f) ? mat1(i,j,k) : mat2(i,j,k));
+        VERIFY_IS_APPROX(result(i, j, k), (selector(i, j, k) > 0.5f) ? mat1(i, j, k) : mat2(i, j, k));
       }
     }
   }
@@ -312,7 +310,6 @@
       }
     }
   }
-
 }
 
 template <typename Scalar>
@@ -327,7 +324,7 @@
     vec_full_nan.setConstant(kNaN);
     vec_zero.setZero();
     vec_one_nan.setZero();
-    vec_one_nan(size/2) = kNaN;
+    vec_one_nan(size / 2) = kNaN;
 
     auto verify_all_nan = [&](const Tensor<Scalar, 1>& v) {
       for (int i = 0; i < size; ++i) {
@@ -434,8 +431,7 @@
   }
 }
 
-static void test_clip()
-{
+static void test_clip() {
   Tensor<float, 1> vec(6);
   vec(0) = 4.0;
   vec(1) = 8.0;
@@ -454,14 +450,12 @@
   }
 }
 
-static void test_minmax_nan_propagation()
-{
+static void test_minmax_nan_propagation() {
   test_minmax_nan_propagation_templ<float>();
   test_minmax_nan_propagation_templ<double>();
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_expr)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_expr) {
   CALL_SUBTEST(test_1d());
   CALL_SUBTEST(test_2d());
   CALL_SUBTEST(test_3d());
diff --git a/unsupported/test/cxx11_tensor_fft.cpp b/unsupported/test/cxx11_tensor_fft.cpp
index ff8ebcf..70bba2e 100644
--- a/unsupported/test/cxx11_tensor_fft.cpp
+++ b/unsupported/test/cxx11_tensor_fft.cpp
@@ -28,13 +28,13 @@
 
   Tensor<std::complex<float>, 2, DataLayout> output = input.template fft<Eigen::BothParts, Eigen::FFT_FORWARD>(fft);
 
-  std::complex<float> output_golden[6]; // in ColMajor order
+  std::complex<float> output_golden[6];  // in ColMajor order
   output_golden[0] = std::complex<float>(21, 0);
   output_golden[1] = std::complex<float>(-9, 0);
   output_golden[2] = std::complex<float>(-3, 1.73205);
-  output_golden[3] = std::complex<float>( 0, 0);
+  output_golden[3] = std::complex<float>(0, 0);
   output_golden[4] = std::complex<float>(-3, -1.73205);
-  output_golden[5] = std::complex<float>(0 ,0);
+  output_golden[5] = std::complex<float>(0, 0);
 
   std::complex<float> c_offset = std::complex<float>(1.0, 1.0);
 
@@ -45,14 +45,13 @@
     VERIFY_IS_APPROX(output(3) + c_offset, output_golden[3] + c_offset);
     VERIFY_IS_APPROX(output(4) + c_offset, output_golden[4] + c_offset);
     VERIFY_IS_APPROX(output(5) + c_offset, output_golden[5] + c_offset);
-  }
-  else {
-    VERIFY_IS_APPROX(output(0)+ c_offset, output_golden[0]+ c_offset);
-    VERIFY_IS_APPROX(output(1)+ c_offset, output_golden[2]+ c_offset);
-    VERIFY_IS_APPROX(output(2)+ c_offset, output_golden[4]+ c_offset);
-    VERIFY_IS_APPROX(output(3)+ c_offset, output_golden[1]+ c_offset);
-    VERIFY_IS_APPROX(output(4)+ c_offset, output_golden[3]+ c_offset);
-    VERIFY_IS_APPROX(output(5)+ c_offset, output_golden[5]+ c_offset);
+  } else {
+    VERIFY_IS_APPROX(output(0) + c_offset, output_golden[0] + c_offset);
+    VERIFY_IS_APPROX(output(1) + c_offset, output_golden[2] + c_offset);
+    VERIFY_IS_APPROX(output(2) + c_offset, output_golden[4] + c_offset);
+    VERIFY_IS_APPROX(output(3) + c_offset, output_golden[1] + c_offset);
+    VERIFY_IS_APPROX(output(4) + c_offset, output_golden[3] + c_offset);
+    VERIFY_IS_APPROX(output(5) + c_offset, output_golden[5] + c_offset);
   }
 }
 
@@ -88,25 +87,25 @@
   std::complex<float> forward_golden_result[5];
   std::complex<float> reverse_golden_result[5];
 
-  forward_golden_result[0] = std::complex<float>(15.000000000000000,+15.000000000000000);
+  forward_golden_result[0] = std::complex<float>(15.000000000000000, +15.000000000000000);
   forward_golden_result[1] = std::complex<float>(-5.940954801177935, +0.940954801177934);
   forward_golden_result[2] = std::complex<float>(-3.312299240582266, -1.687700759417735);
   forward_golden_result[3] = std::complex<float>(-1.687700759417735, -3.312299240582266);
-  forward_golden_result[4] = std::complex<float>( 0.940954801177934, -5.940954801177935);
+  forward_golden_result[4] = std::complex<float>(0.940954801177934, -5.940954801177935);
 
-  reverse_golden_result[0] = std::complex<float>( 3.000000000000000, + 3.000000000000000);
-  reverse_golden_result[1] = std::complex<float>( 0.188190960235587, - 1.188190960235587);
-  reverse_golden_result[2] = std::complex<float>(-0.337540151883547, - 0.662459848116453);
-  reverse_golden_result[3] = std::complex<float>(-0.662459848116453, - 0.337540151883547);
-  reverse_golden_result[4] = std::complex<float>(-1.188190960235587, + 0.188190960235587);
+  reverse_golden_result[0] = std::complex<float>(3.000000000000000, +3.000000000000000);
+  reverse_golden_result[1] = std::complex<float>(0.188190960235587, -1.188190960235587);
+  reverse_golden_result[2] = std::complex<float>(-0.337540151883547, -0.662459848116453);
+  reverse_golden_result[3] = std::complex<float>(-0.662459848116453, -0.337540151883547);
+  reverse_golden_result[4] = std::complex<float>(-1.188190960235587, +0.188190960235587);
 
-  for(int i = 0; i < 5; ++i) {
+  for (int i = 0; i < 5; ++i) {
     VERIFY_IS_APPROX(forward_output_both_parts(i), forward_golden_result[i]);
     VERIFY_IS_APPROX(forward_output_real_part(i), forward_golden_result[i].real());
     VERIFY_IS_APPROX(forward_output_imag_part(i), forward_golden_result[i].imag());
   }
 
-  for(int i = 0; i < 5; ++i) {
+  for (int i = 0; i < 5; ++i) {
     VERIFY_IS_APPROX(reverse_output_both_parts(i), reverse_golden_result[i]);
     VERIFY_IS_APPROX(reverse_output_real_part(i), reverse_golden_result[i].real());
     VERIFY_IS_APPROX(reverse_output_imag_part(i), reverse_golden_result[i].imag());
@@ -145,14 +144,13 @@
   std::complex<float> forward_golden_result[5];
   std::complex<float> reverse_golden_result[5];
 
-
-  forward_golden_result[0] = std::complex<float>(  15, 0);
+  forward_golden_result[0] = std::complex<float>(15, 0);
   forward_golden_result[1] = std::complex<float>(-2.5, +3.44095480117793);
   forward_golden_result[2] = std::complex<float>(-2.5, +0.81229924058227);
   forward_golden_result[3] = std::complex<float>(-2.5, -0.81229924058227);
   forward_golden_result[4] = std::complex<float>(-2.5, -3.44095480117793);
 
-  reverse_golden_result[0] = std::complex<float>( 3.0, 0);
+  reverse_golden_result[0] = std::complex<float>(3.0, 0);
   reverse_golden_result[1] = std::complex<float>(-0.5, -0.688190960235587);
   reverse_golden_result[2] = std::complex<float>(-0.5, -0.162459848116453);
   reverse_golden_result[3] = std::complex<float>(-0.5, +0.162459848116453);
@@ -161,23 +159,21 @@
   std::complex<float> c_offset(1.0, 1.0);
   float r_offset = 1.0;
 
-  for(int i = 0; i < 5; ++i) {
+  for (int i = 0; i < 5; ++i) {
     VERIFY_IS_APPROX(forward_output_both_parts(i) + c_offset, forward_golden_result[i] + c_offset);
-    VERIFY_IS_APPROX(forward_output_real_part(i)  + r_offset, forward_golden_result[i].real() + r_offset);
-    VERIFY_IS_APPROX(forward_output_imag_part(i)  + r_offset, forward_golden_result[i].imag() + r_offset);
+    VERIFY_IS_APPROX(forward_output_real_part(i) + r_offset, forward_golden_result[i].real() + r_offset);
+    VERIFY_IS_APPROX(forward_output_imag_part(i) + r_offset, forward_golden_result[i].imag() + r_offset);
   }
 
-  for(int i = 0; i < 5; ++i) {
+  for (int i = 0; i < 5; ++i) {
     VERIFY_IS_APPROX(reverse_output_both_parts(i) + c_offset, reverse_golden_result[i] + c_offset);
-    VERIFY_IS_APPROX(reverse_output_real_part(i)  + r_offset, reverse_golden_result[i].real() + r_offset);
-    VERIFY_IS_APPROX(reverse_output_imag_part(i)  + r_offset, reverse_golden_result[i].imag() + r_offset);
+    VERIFY_IS_APPROX(reverse_output_real_part(i) + r_offset, reverse_golden_result[i].real() + r_offset);
+    VERIFY_IS_APPROX(reverse_output_imag_part(i) + r_offset, reverse_golden_result[i].imag() + r_offset);
   }
 }
 
-
 template <int DataLayout, typename RealScalar, bool isComplexInput, int FFTResultType, int FFTDirection, int TensorRank>
 static void test_fft_real_input_energy() {
-
   Eigen::DSizes<ptrdiff_t, TensorRank> dimensions;
   ptrdiff_t total_size = 1;
   for (int i = 0; i < TensorRank; ++i) {
@@ -216,10 +212,9 @@
     energy_after_fft += numext::abs2(output(i));
   }
 
-  if(FFTDirection == FFT_FORWARD) {
+  if (FFTDirection == FFT_FORWARD) {
     VERIFY_IS_APPROX(energy_original, energy_after_fft / total_size);
-  }
-  else {
+  } else {
     VERIFY_IS_APPROX(energy_original, energy_after_fft * total_size);
   }
 }
@@ -239,66 +234,63 @@
   array<int, 1> fft;
   fft[0] = 0;
 
-  Tensor<std::complex<RealScalar>, 1, ColMajor> forward =
-      input.template fft<BothParts, FFT_FORWARD>(fft);
+  Tensor<std::complex<RealScalar>, 1, ColMajor> forward = input.template fft<BothParts, FFT_FORWARD>(fft);
 
-  Tensor<RealScalar, 1, ColMajor, ptrdiff_t> output =
-      forward.template fft<RealPart, FFT_REVERSE>(fft);
+  Tensor<RealScalar, 1, ColMajor, ptrdiff_t> output = forward.template fft<RealPart, FFT_REVERSE>(fft);
 
   for (int i = 0; i < n; ++i) {
-    RealScalar tol = test_precision<RealScalar>() *
-                     (std::abs(input[i]) + std::abs(output[i]) + 1);
+    RealScalar tol = test_precision<RealScalar>() * (std::abs(input[i]) + std::abs(output[i]) + 1);
     VERIFY_IS_APPROX_OR_LESS_THAN(std::abs(input[i] - output[i]), tol);
   }
 }
 
 EIGEN_DECLARE_TEST(cxx11_tensor_fft) {
-    test_fft_complex_input_golden();
-    test_fft_real_input_golden();
+  test_fft_complex_input_golden();
+  test_fft_real_input_golden();
 
-    test_fft_2D_golden<ColMajor>();
-    test_fft_2D_golden<RowMajor>();
+  test_fft_2D_golden<ColMajor>();
+  test_fft_2D_golden<RowMajor>();
 
-    test_fft_real_input_energy<ColMajor, float,  true,  Eigen::BothParts, FFT_FORWARD, 1>();
-    test_fft_real_input_energy<ColMajor, double, true,  Eigen::BothParts, FFT_FORWARD, 1>();
-    test_fft_real_input_energy<ColMajor, float,  false,  Eigen::BothParts, FFT_FORWARD, 1>();
-    test_fft_real_input_energy<ColMajor, double, false,  Eigen::BothParts, FFT_FORWARD, 1>();
+  test_fft_real_input_energy<ColMajor, float, true, Eigen::BothParts, FFT_FORWARD, 1>();
+  test_fft_real_input_energy<ColMajor, double, true, Eigen::BothParts, FFT_FORWARD, 1>();
+  test_fft_real_input_energy<ColMajor, float, false, Eigen::BothParts, FFT_FORWARD, 1>();
+  test_fft_real_input_energy<ColMajor, double, false, Eigen::BothParts, FFT_FORWARD, 1>();
 
-    test_fft_real_input_energy<ColMajor, float,  true,  Eigen::BothParts, FFT_FORWARD, 2>();
-    test_fft_real_input_energy<ColMajor, double, true,  Eigen::BothParts, FFT_FORWARD, 2>();
-    test_fft_real_input_energy<ColMajor, float,  false,  Eigen::BothParts, FFT_FORWARD, 2>();
-    test_fft_real_input_energy<ColMajor, double, false,  Eigen::BothParts, FFT_FORWARD, 2>();
+  test_fft_real_input_energy<ColMajor, float, true, Eigen::BothParts, FFT_FORWARD, 2>();
+  test_fft_real_input_energy<ColMajor, double, true, Eigen::BothParts, FFT_FORWARD, 2>();
+  test_fft_real_input_energy<ColMajor, float, false, Eigen::BothParts, FFT_FORWARD, 2>();
+  test_fft_real_input_energy<ColMajor, double, false, Eigen::BothParts, FFT_FORWARD, 2>();
 
-    test_fft_real_input_energy<ColMajor, float,  true,  Eigen::BothParts, FFT_FORWARD, 3>();
-    test_fft_real_input_energy<ColMajor, double, true,  Eigen::BothParts, FFT_FORWARD, 3>();
-    test_fft_real_input_energy<ColMajor, float,  false,  Eigen::BothParts, FFT_FORWARD, 3>();
-    test_fft_real_input_energy<ColMajor, double, false,  Eigen::BothParts, FFT_FORWARD, 3>();
+  test_fft_real_input_energy<ColMajor, float, true, Eigen::BothParts, FFT_FORWARD, 3>();
+  test_fft_real_input_energy<ColMajor, double, true, Eigen::BothParts, FFT_FORWARD, 3>();
+  test_fft_real_input_energy<ColMajor, float, false, Eigen::BothParts, FFT_FORWARD, 3>();
+  test_fft_real_input_energy<ColMajor, double, false, Eigen::BothParts, FFT_FORWARD, 3>();
 
-    test_fft_real_input_energy<ColMajor, float,  true,  Eigen::BothParts, FFT_FORWARD, 4>();
-    test_fft_real_input_energy<ColMajor, double, true,  Eigen::BothParts, FFT_FORWARD, 4>();
-    test_fft_real_input_energy<ColMajor, float,  false,  Eigen::BothParts, FFT_FORWARD, 4>();
-    test_fft_real_input_energy<ColMajor, double, false,  Eigen::BothParts, FFT_FORWARD, 4>();
+  test_fft_real_input_energy<ColMajor, float, true, Eigen::BothParts, FFT_FORWARD, 4>();
+  test_fft_real_input_energy<ColMajor, double, true, Eigen::BothParts, FFT_FORWARD, 4>();
+  test_fft_real_input_energy<ColMajor, float, false, Eigen::BothParts, FFT_FORWARD, 4>();
+  test_fft_real_input_energy<ColMajor, double, false, Eigen::BothParts, FFT_FORWARD, 4>();
 
-    test_fft_real_input_energy<RowMajor, float,  true,  Eigen::BothParts, FFT_FORWARD, 1>();
-    test_fft_real_input_energy<RowMajor, double, true,  Eigen::BothParts, FFT_FORWARD, 1>();
-    test_fft_real_input_energy<RowMajor, float,  false,  Eigen::BothParts, FFT_FORWARD, 1>();
-    test_fft_real_input_energy<RowMajor, double, false,  Eigen::BothParts, FFT_FORWARD, 1>();
+  test_fft_real_input_energy<RowMajor, float, true, Eigen::BothParts, FFT_FORWARD, 1>();
+  test_fft_real_input_energy<RowMajor, double, true, Eigen::BothParts, FFT_FORWARD, 1>();
+  test_fft_real_input_energy<RowMajor, float, false, Eigen::BothParts, FFT_FORWARD, 1>();
+  test_fft_real_input_energy<RowMajor, double, false, Eigen::BothParts, FFT_FORWARD, 1>();
 
-    test_fft_real_input_energy<RowMajor, float,  true,  Eigen::BothParts, FFT_FORWARD, 2>();
-    test_fft_real_input_energy<RowMajor, double, true,  Eigen::BothParts, FFT_FORWARD, 2>();
-    test_fft_real_input_energy<RowMajor, float,  false,  Eigen::BothParts, FFT_FORWARD, 2>();
-    test_fft_real_input_energy<RowMajor, double, false,  Eigen::BothParts, FFT_FORWARD, 2>();
+  test_fft_real_input_energy<RowMajor, float, true, Eigen::BothParts, FFT_FORWARD, 2>();
+  test_fft_real_input_energy<RowMajor, double, true, Eigen::BothParts, FFT_FORWARD, 2>();
+  test_fft_real_input_energy<RowMajor, float, false, Eigen::BothParts, FFT_FORWARD, 2>();
+  test_fft_real_input_energy<RowMajor, double, false, Eigen::BothParts, FFT_FORWARD, 2>();
 
-    test_fft_real_input_energy<RowMajor, float,  true,  Eigen::BothParts, FFT_FORWARD, 3>();
-    test_fft_real_input_energy<RowMajor, double, true,  Eigen::BothParts, FFT_FORWARD, 3>();
-    test_fft_real_input_energy<RowMajor, float,  false,  Eigen::BothParts, FFT_FORWARD, 3>();
-    test_fft_real_input_energy<RowMajor, double, false,  Eigen::BothParts, FFT_FORWARD, 3>();
+  test_fft_real_input_energy<RowMajor, float, true, Eigen::BothParts, FFT_FORWARD, 3>();
+  test_fft_real_input_energy<RowMajor, double, true, Eigen::BothParts, FFT_FORWARD, 3>();
+  test_fft_real_input_energy<RowMajor, float, false, Eigen::BothParts, FFT_FORWARD, 3>();
+  test_fft_real_input_energy<RowMajor, double, false, Eigen::BothParts, FFT_FORWARD, 3>();
 
-    test_fft_real_input_energy<RowMajor, float,  true,  Eigen::BothParts, FFT_FORWARD, 4>();
-    test_fft_real_input_energy<RowMajor, double, true,  Eigen::BothParts, FFT_FORWARD, 4>();
-    test_fft_real_input_energy<RowMajor, float,  false,  Eigen::BothParts, FFT_FORWARD, 4>();
-    test_fft_real_input_energy<RowMajor, double, false,  Eigen::BothParts, FFT_FORWARD, 4>();
+  test_fft_real_input_energy<RowMajor, float, true, Eigen::BothParts, FFT_FORWARD, 4>();
+  test_fft_real_input_energy<RowMajor, double, true, Eigen::BothParts, FFT_FORWARD, 4>();
+  test_fft_real_input_energy<RowMajor, float, false, Eigen::BothParts, FFT_FORWARD, 4>();
+  test_fft_real_input_energy<RowMajor, double, false, Eigen::BothParts, FFT_FORWARD, 4>();
 
-    test_fft_non_power_of_2_round_trip<float>(7);
-    test_fft_non_power_of_2_round_trip<double>(7);
+  test_fft_non_power_of_2_round_trip<float>(7);
+  test_fft_non_power_of_2_round_trip<double>(7);
 }
diff --git a/unsupported/test/cxx11_tensor_fixed_size.cpp b/unsupported/test/cxx11_tensor_fixed_size.cpp
index 456ce6b..7cfc18d 100644
--- a/unsupported/test/cxx11_tensor_fixed_size.cpp
+++ b/unsupported/test/cxx11_tensor_fixed_size.cpp
@@ -11,12 +11,10 @@
 
 #include <Eigen/CXX11/Tensor>
 
-using Eigen::Tensor;
 using Eigen::RowMajor;
+using Eigen::Tensor;
 
-
-static void test_0d()
-{
+static void test_0d() {
   TensorFixedSize<float, Sizes<> > scalar1;
   TensorFixedSize<float, Sizes<>, RowMajor> scalar2;
   VERIFY_IS_EQUAL(scalar1.rank(), 0);
@@ -44,8 +42,7 @@
   VERIFY_IS_APPROX(scalar3(), 7.0f + 13.0f);
 }
 
-static void test_1d()
-{
+static void test_1d() {
   TensorFixedSize<float, Sizes<6> > vec1;
   TensorFixedSize<float, Sizes<6>, RowMajor> vec2;
 
@@ -53,12 +50,18 @@
   //  VERIFY_IS_EQUAL((vec1.dimensions()[0]), 6);
   //  VERIFY_IS_EQUAL((vec1.dimension(0)), 6);
 
-  vec1(0) = 4.0;  vec2(0) = 0.0;
-  vec1(1) = 8.0;  vec2(1) = 1.0;
-  vec1(2) = 15.0; vec2(2) = 2.0;
-  vec1(3) = 16.0; vec2(3) = 3.0;
-  vec1(4) = 23.0; vec2(4) = 4.0;
-  vec1(5) = 42.0; vec2(5) = 5.0;
+  vec1(0) = 4.0;
+  vec2(0) = 0.0;
+  vec1(1) = 8.0;
+  vec2(1) = 1.0;
+  vec1(2) = 15.0;
+  vec2(2) = 2.0;
+  vec1(3) = 16.0;
+  vec2(3) = 3.0;
+  vec1(4) = 23.0;
+  vec2(4) = 4.0;
+  vec1(5) = 42.0;
+  vec2(5) = 5.0;
 
   // Test against shallow copy.
   TensorFixedSize<float, Sizes<6> > copy = vec1;
@@ -103,17 +106,22 @@
   VERIFY_IS_APPROX(vec3(5), 42.0f + 5.0f);
 }
 
-static void test_tensor_map()
-{
+static void test_tensor_map() {
   TensorFixedSize<float, Sizes<6> > vec1;
   TensorFixedSize<float, Sizes<6>, RowMajor> vec2;
 
-  vec1(0) = 4.0;  vec2(0) = 0.0;
-  vec1(1) = 8.0;  vec2(1) = 1.0;
-  vec1(2) = 15.0; vec2(2) = 2.0;
-  vec1(3) = 16.0; vec2(3) = 3.0;
-  vec1(4) = 23.0; vec2(4) = 4.0;
-  vec1(5) = 42.0; vec2(5) = 5.0;
+  vec1(0) = 4.0;
+  vec2(0) = 0.0;
+  vec1(1) = 8.0;
+  vec2(1) = 1.0;
+  vec1(2) = 15.0;
+  vec2(2) = 2.0;
+  vec1(3) = 16.0;
+  vec2(3) = 3.0;
+  vec1(4) = 23.0;
+  vec2(4) = 4.0;
+  vec1(5) = 42.0;
+  vec2(5) = 5.0;
 
   float data3[6];
   TensorMap<TensorFixedSize<float, Sizes<6> > > vec3(data3, 6);
@@ -127,62 +135,60 @@
   VERIFY_IS_APPROX(vec3(5), sqrtf(42.0) + 5.0f);
 }
 
-static void test_2d()
-{
+static void test_2d() {
   float data1[6];
-  TensorMap<TensorFixedSize<float, Sizes<2, 3> > > mat1(data1,2,3);
+  TensorMap<TensorFixedSize<float, Sizes<2, 3> > > mat1(data1, 2, 3);
   float data2[6];
-  TensorMap<TensorFixedSize<float, Sizes<2, 3>, RowMajor> > mat2(data2,2,3);
+  TensorMap<TensorFixedSize<float, Sizes<2, 3>, RowMajor> > mat2(data2, 2, 3);
 
-  VERIFY_IS_EQUAL((mat1.size()), 2*3);
+  VERIFY_IS_EQUAL((mat1.size()), 2 * 3);
   VERIFY_IS_EQUAL(mat1.rank(), 2);
   //  VERIFY_IS_EQUAL((mat1.dimension(0)), 2);
   //  VERIFY_IS_EQUAL((mat1.dimension(1)), 3);
 
-  mat1(0,0) = 0.0;
-  mat1(0,1) = 1.0;
-  mat1(0,2) = 2.0;
-  mat1(1,0) = 3.0;
-  mat1(1,1) = 4.0;
-  mat1(1,2) = 5.0;
+  mat1(0, 0) = 0.0;
+  mat1(0, 1) = 1.0;
+  mat1(0, 2) = 2.0;
+  mat1(1, 0) = 3.0;
+  mat1(1, 1) = 4.0;
+  mat1(1, 2) = 5.0;
 
-  mat2(0,0) = -0.0;
-  mat2(0,1) = -1.0;
-  mat2(0,2) = -2.0;
-  mat2(1,0) = -3.0;
-  mat2(1,1) = -4.0;
-  mat2(1,2) = -5.0;
+  mat2(0, 0) = -0.0;
+  mat2(0, 1) = -1.0;
+  mat2(0, 2) = -2.0;
+  mat2(1, 0) = -3.0;
+  mat2(1, 1) = -4.0;
+  mat2(1, 2) = -5.0;
 
   TensorFixedSize<float, Sizes<2, 3> > mat3;
   TensorFixedSize<float, Sizes<2, 3>, RowMajor> mat4;
   mat3 = mat1.abs();
   mat4 = mat2.abs();
 
-  VERIFY_IS_EQUAL((mat3.size()), 2*3);
-    //  VERIFY_IS_EQUAL((mat3.dimension(0)), 2);
-    //  VERIFY_IS_EQUAL((mat3.dimension(1)), 3);
+  VERIFY_IS_EQUAL((mat3.size()), 2 * 3);
+  //  VERIFY_IS_EQUAL((mat3.dimension(0)), 2);
+  //  VERIFY_IS_EQUAL((mat3.dimension(1)), 3);
 
-  VERIFY_IS_APPROX(mat3(0,0), 0.0f);
-  VERIFY_IS_APPROX(mat3(0,1), 1.0f);
-  VERIFY_IS_APPROX(mat3(0,2), 2.0f);
-  VERIFY_IS_APPROX(mat3(1,0), 3.0f);
-  VERIFY_IS_APPROX(mat3(1,1), 4.0f);
-  VERIFY_IS_APPROX(mat3(1,2), 5.0f);
+  VERIFY_IS_APPROX(mat3(0, 0), 0.0f);
+  VERIFY_IS_APPROX(mat3(0, 1), 1.0f);
+  VERIFY_IS_APPROX(mat3(0, 2), 2.0f);
+  VERIFY_IS_APPROX(mat3(1, 0), 3.0f);
+  VERIFY_IS_APPROX(mat3(1, 1), 4.0f);
+  VERIFY_IS_APPROX(mat3(1, 2), 5.0f);
 
-  VERIFY_IS_APPROX(mat4(0,0), 0.0f);
-  VERIFY_IS_APPROX(mat4(0,1), 1.0f);
-  VERIFY_IS_APPROX(mat4(0,2), 2.0f);
-  VERIFY_IS_APPROX(mat4(1,0), 3.0f);
-  VERIFY_IS_APPROX(mat4(1,1), 4.0f);
-  VERIFY_IS_APPROX(mat4(1,2), 5.0f);
+  VERIFY_IS_APPROX(mat4(0, 0), 0.0f);
+  VERIFY_IS_APPROX(mat4(0, 1), 1.0f);
+  VERIFY_IS_APPROX(mat4(0, 2), 2.0f);
+  VERIFY_IS_APPROX(mat4(1, 0), 3.0f);
+  VERIFY_IS_APPROX(mat4(1, 1), 4.0f);
+  VERIFY_IS_APPROX(mat4(1, 2), 5.0f);
 }
 
-static void test_3d()
-{
+static void test_3d() {
   TensorFixedSize<float, Sizes<2, 3, 7> > mat1;
   TensorFixedSize<float, Sizes<2, 3, 7>, RowMajor> mat2;
 
-  VERIFY_IS_EQUAL((mat1.size()), 2*3*7);
+  VERIFY_IS_EQUAL((mat1.size()), 2 * 3 * 7);
   VERIFY_IS_EQUAL(mat1.rank(), 3);
   //  VERIFY_IS_EQUAL((mat1.dimension(0)), 2);
   //  VERIFY_IS_EQUAL((mat1.dimension(1)), 3);
@@ -192,8 +198,8 @@
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        mat1(i,j,k) = val;
-        mat2(i,j,k) = val;
+        mat1(i, j, k) = val;
+        mat2(i, j, k) = val;
         val += 1.0f;
       }
     }
@@ -204,33 +210,30 @@
   TensorFixedSize<float, Sizes<2, 3, 7>, RowMajor> mat4;
   mat4 = mat2.sqrt();
 
-  VERIFY_IS_EQUAL((mat3.size()), 2*3*7);
+  VERIFY_IS_EQUAL((mat3.size()), 2 * 3 * 7);
   //  VERIFY_IS_EQUAL((mat3.dimension(0)), 2);
   //  VERIFY_IS_EQUAL((mat3.dimension(1)), 3);
   //  VERIFY_IS_EQUAL((mat3.dimension(2)), 7);
 
-
   val = 0.0f;
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_APPROX(mat3(i,j,k), sqrtf(val));
-        VERIFY_IS_APPROX(mat4(i,j,k), sqrtf(val));
+        VERIFY_IS_APPROX(mat3(i, j, k), sqrtf(val));
+        VERIFY_IS_APPROX(mat4(i, j, k), sqrtf(val));
         val += 1.0f;
       }
     }
   }
 }
 
-
-static void test_array()
-{
+static void test_array() {
   TensorFixedSize<float, Sizes<2, 3, 7> > mat1;
   float val = 0.0f;
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        mat1(i,j,k) = val;
+        mat1(i, j, k) = val;
         val += 1.0f;
       }
     }
@@ -243,15 +246,14 @@
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_APPROX(mat3(i,j,k), powf(val, 3.5f));
+        VERIFY_IS_APPROX(mat3(i, j, k), powf(val, 3.5f));
         val += 1.0f;
       }
     }
   }
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_fixed_size)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_fixed_size) {
   CALL_SUBTEST(test_0d());
   CALL_SUBTEST(test_1d());
   CALL_SUBTEST(test_tensor_map());
diff --git a/unsupported/test/cxx11_tensor_forced_eval.cpp b/unsupported/test/cxx11_tensor_forced_eval.cpp
index a21a02b..4eb7d91 100644
--- a/unsupported/test/cxx11_tensor_forced_eval.cpp
+++ b/unsupported/test/cxx11_tensor_forced_eval.cpp
@@ -15,17 +15,16 @@
 using Eigen::MatrixXf;
 using Eigen::Tensor;
 
-static void test_simple()
-{
-  MatrixXf m1(3,3);
-  MatrixXf m2(3,3);
+static void test_simple() {
+  MatrixXf m1(3, 3);
+  MatrixXf m2(3, 3);
   m1.setRandom();
   m2.setRandom();
 
-  TensorMap<Tensor<float, 2> > mat1(m1.data(), 3,3);
-  TensorMap<Tensor<float, 2> > mat2(m2.data(), 3,3);
+  TensorMap<Tensor<float, 2> > mat1(m1.data(), 3, 3);
+  TensorMap<Tensor<float, 2> > mat2(m2.data(), 3, 3);
 
-  Tensor<float, 2> mat3(3,3);
+  Tensor<float, 2> mat3(3, 3);
   mat3 = mat1;
 
   typedef Tensor<float, 1>::DimensionPair DimPair;
@@ -34,21 +33,19 @@
 
   mat3 = mat3.contract(mat2, dims).eval();
 
-  VERIFY_IS_APPROX(mat3(0, 0), (m1*m2).eval()(0,0));
-  VERIFY_IS_APPROX(mat3(0, 1), (m1*m2).eval()(0,1));
-  VERIFY_IS_APPROX(mat3(0, 2), (m1*m2).eval()(0,2));
-  VERIFY_IS_APPROX(mat3(1, 0), (m1*m2).eval()(1,0));
-  VERIFY_IS_APPROX(mat3(1, 1), (m1*m2).eval()(1,1));
-  VERIFY_IS_APPROX(mat3(1, 2), (m1*m2).eval()(1,2));
-  VERIFY_IS_APPROX(mat3(2, 0), (m1*m2).eval()(2,0));
-  VERIFY_IS_APPROX(mat3(2, 1), (m1*m2).eval()(2,1));
-  VERIFY_IS_APPROX(mat3(2, 2), (m1*m2).eval()(2,2));
+  VERIFY_IS_APPROX(mat3(0, 0), (m1 * m2).eval()(0, 0));
+  VERIFY_IS_APPROX(mat3(0, 1), (m1 * m2).eval()(0, 1));
+  VERIFY_IS_APPROX(mat3(0, 2), (m1 * m2).eval()(0, 2));
+  VERIFY_IS_APPROX(mat3(1, 0), (m1 * m2).eval()(1, 0));
+  VERIFY_IS_APPROX(mat3(1, 1), (m1 * m2).eval()(1, 1));
+  VERIFY_IS_APPROX(mat3(1, 2), (m1 * m2).eval()(1, 2));
+  VERIFY_IS_APPROX(mat3(2, 0), (m1 * m2).eval()(2, 0));
+  VERIFY_IS_APPROX(mat3(2, 1), (m1 * m2).eval()(2, 1));
+  VERIFY_IS_APPROX(mat3(2, 2), (m1 * m2).eval()(2, 2));
 }
 
-
-static void test_const()
-{
-  MatrixXf input(3,3);
+static void test_const() {
+  MatrixXf input(3, 3);
   input.setRandom();
   MatrixXf output = input;
   output.rowwise() -= input.colwise().maxCoeff();
@@ -62,7 +59,8 @@
   bcast[0] = 3;
   bcast[1] = 1;
   const TensorMap<const Tensor<float, 2> > input_tensor(input.data(), 3, 3);
-  Tensor<float, 2> output_tensor= (input_tensor - input_tensor.maximum(depth_dim).eval().reshape(dims2d).broadcast(bcast));
+  Tensor<float, 2> output_tensor =
+      (input_tensor - input_tensor.maximum(depth_dim).eval().reshape(dims2d).broadcast(bcast));
 
   for (int i = 0; i < 3; ++i) {
     for (int j = 0; j < 3; ++j) {
@@ -71,9 +69,7 @@
   }
 }
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_forced_eval)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_forced_eval) {
   CALL_SUBTEST(test_simple());
   CALL_SUBTEST(test_const());
 }
diff --git a/unsupported/test/cxx11_tensor_forced_eval_sycl.cpp b/unsupported/test/cxx11_tensor_forced_eval_sycl.cpp
index a55a5ad..19a3c79 100644
--- a/unsupported/test/cxx11_tensor_forced_eval_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_forced_eval_sycl.cpp
@@ -22,8 +22,7 @@
 
 using Eigen::Tensor;
 template <typename DataType, int DataLayout, typename IndexType>
-void test_forced_eval_sycl(const Eigen::SyclDevice &sycl_device) {
-
+void test_forced_eval_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType sizeDim1 = 100;
   IndexType sizeDim2 = 20;
   IndexType sizeDim3 = 20;
@@ -32,9 +31,12 @@
   Eigen::Tensor<DataType, 3, DataLayout, IndexType> in2(tensorRange);
   Eigen::Tensor<DataType, 3, DataLayout, IndexType> out(tensorRange);
 
-  DataType * gpu_in1_data  = static_cast<DataType*>(sycl_device.allocate(in1.dimensions().TotalSize()*sizeof(DataType)));
-  DataType * gpu_in2_data  = static_cast<DataType*>(sycl_device.allocate(in2.dimensions().TotalSize()*sizeof(DataType)));
-  DataType * gpu_out_data =  static_cast<DataType*>(sycl_device.allocate(out.dimensions().TotalSize()*sizeof(DataType)));
+  DataType* gpu_in1_data =
+      static_cast<DataType*>(sycl_device.allocate(in1.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_in2_data =
+      static_cast<DataType*>(sycl_device.allocate(in2.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_out_data =
+      static_cast<DataType*>(sycl_device.allocate(out.dimensions().TotalSize() * sizeof(DataType)));
 
   in1 = in1.random() + in1.constant(static_cast<DataType>(10.0f));
   in2 = in2.random() + in2.constant(static_cast<DataType>(10.0f));
@@ -43,16 +45,15 @@
   Eigen::TensorMap<Eigen::Tensor<DataType, 3, DataLayout, IndexType>> gpu_in1(gpu_in1_data, tensorRange);
   Eigen::TensorMap<Eigen::Tensor<DataType, 3, DataLayout, IndexType>> gpu_in2(gpu_in2_data, tensorRange);
   Eigen::TensorMap<Eigen::Tensor<DataType, 3, DataLayout, IndexType>> gpu_out(gpu_out_data, tensorRange);
-  sycl_device.memcpyHostToDevice(gpu_in1_data, in1.data(),(in1.dimensions().TotalSize())*sizeof(DataType));
-  sycl_device.memcpyHostToDevice(gpu_in2_data, in2.data(),(in2.dimensions().TotalSize())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in1_data, in1.data(), (in1.dimensions().TotalSize()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in2_data, in2.data(), (in2.dimensions().TotalSize()) * sizeof(DataType));
   /// c=(a+b)*b
-  gpu_out.device(sycl_device) =(gpu_in1 + gpu_in2).eval() * gpu_in2;
-  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data,(out.dimensions().TotalSize())*sizeof(DataType));
+  gpu_out.device(sycl_device) = (gpu_in1 + gpu_in2).eval() * gpu_in2;
+  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data, (out.dimensions().TotalSize()) * sizeof(DataType));
   for (IndexType i = 0; i < sizeDim1; ++i) {
     for (IndexType j = 0; j < sizeDim2; ++j) {
       for (IndexType k = 0; k < sizeDim3; ++k) {
-        VERIFY_IS_APPROX(out(i, j, k),
-                         (in1(i, j, k) + in2(i, j, k)) * in2(i, j, k));
+        VERIFY_IS_APPROX(out(i, j, k), (in1(i, j, k) + in2(i, j, k)) * in2(i, j, k));
       }
     }
   }
@@ -60,17 +61,17 @@
   sycl_device.deallocate(gpu_in1_data);
   sycl_device.deallocate(gpu_in2_data);
   sycl_device.deallocate(gpu_out_data);
-
 }
 
-template <typename DataType, typename Dev_selector> void tensorForced_evalperDevice(Dev_selector s){
+template <typename DataType, typename Dev_selector>
+void tensorForced_evalperDevice(Dev_selector s) {
   QueueInterface queueInterface(s);
   auto sycl_device = Eigen::SyclDevice(&queueInterface);
   test_forced_eval_sycl<DataType, RowMajor, int64_t>(sycl_device);
   test_forced_eval_sycl<DataType, ColMajor, int64_t>(sycl_device);
 }
 EIGEN_DECLARE_TEST(cxx11_tensor_forced_eval_sycl) {
-  for (const auto& device :Eigen::get_sycl_supported_devices()) {
+  for (const auto& device : Eigen::get_sycl_supported_devices()) {
     CALL_SUBTEST(tensorForced_evalperDevice<float>(device));
     CALL_SUBTEST(tensorForced_evalperDevice<half>(device));
   }
diff --git a/unsupported/test/cxx11_tensor_generator.cpp b/unsupported/test/cxx11_tensor_generator.cpp
index 6dcf676..e4aec1b 100644
--- a/unsupported/test/cxx11_tensor_generator.cpp
+++ b/unsupported/test/cxx11_tensor_generator.cpp
@@ -12,16 +12,13 @@
 #include <Eigen/CXX11/Tensor>
 
 struct Generator1D {
-  Generator1D() { }
+  Generator1D() {}
 
-  float operator()(const array<Eigen::DenseIndex, 1>& coordinates) const {
-    return coordinates[0];
-  }
+  float operator()(const array<Eigen::DenseIndex, 1>& coordinates) const { return coordinates[0]; }
 };
 
 template <int DataLayout>
-static void test_1D()
-{
+static void test_1D() {
   Tensor<float, 1> vec(6);
   Tensor<float, 1> result = vec.generate(Generator1D());
 
@@ -30,9 +27,8 @@
   }
 }
 
-
 struct Generator2D {
-  Generator2D() { }
+  Generator2D() {}
 
   float operator()(const array<Eigen::DenseIndex, 2>& coordinates) const {
     return 3 * coordinates[0] + 11 * coordinates[1];
@@ -40,22 +36,19 @@
 };
 
 template <int DataLayout>
-static void test_2D()
-{
+static void test_2D() {
   Tensor<float, 2> matrix(512, 512);
   Tensor<float, 2> result = matrix.generate(Generator2D());
 
   for (int i = 0; i < 512; ++i) {
     for (int j = 0; j < 512; ++j) {
-      VERIFY_IS_EQUAL(result(i, j), 3*i + 11*j);
+      VERIFY_IS_EQUAL(result(i, j), 3 * i + 11 * j);
     }
   }
 }
 
-
 template <int DataLayout>
-static void test_gaussian()
-{
+static void test_gaussian() {
   int rows = 32;
   int cols = 48;
   array<float, 2> means;
@@ -71,17 +64,15 @@
 
   for (int i = 0; i < rows; ++i) {
     for (int j = 0; j < cols; ++j) {
-      float g_rows = powf(rows/2.0f - i, 2) / (3.14f * 3.14f) * 0.5f;
-      float g_cols = powf(cols/2.0f - j, 2) / (2.7f * 2.7f) * 0.5f;
+      float g_rows = powf(rows / 2.0f - i, 2) / (3.14f * 3.14f) * 0.5f;
+      float g_cols = powf(cols / 2.0f - j, 2) / (2.7f * 2.7f) * 0.5f;
       float gaussian = expf(-g_rows - g_cols);
       VERIFY_IS_EQUAL(result(i, j), gaussian);
     }
   }
 }
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_generator)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_generator) {
   CALL_SUBTEST(test_1D<ColMajor>());
   CALL_SUBTEST(test_1D<RowMajor>());
   CALL_SUBTEST(test_2D<ColMajor>());
diff --git a/unsupported/test/cxx11_tensor_generator_sycl.cpp b/unsupported/test/cxx11_tensor_generator_sycl.cpp
index fb6e3d9..335bf25 100644
--- a/unsupported/test/cxx11_tensor_generator_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_generator_sycl.cpp
@@ -16,38 +16,34 @@
 
 #define EIGEN_DEFAULT_DENSE_INDEX_TYPE int64_t
 #define EIGEN_USE_SYCL
-static const float error_threshold =1e-8f;
+static const float error_threshold = 1e-8f;
 
 #include "main.h"
 #include <unsupported/Eigen/CXX11/Tensor>
 
 using Eigen::Tensor;
 struct Generator1D {
-  Generator1D() { }
+  Generator1D() {}
 
-  float operator()(const array<Eigen::DenseIndex, 1>& coordinates) const {
-    return coordinates[0];
-  }
+  float operator()(const array<Eigen::DenseIndex, 1>& coordinates) const { return coordinates[0]; }
 };
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_1D_sycl(const Eigen::SyclDevice& sycl_device)
-{
-
+static void test_1D_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType sizeDim1 = 6;
   array<IndexType, 1> tensorRange = {{sizeDim1}};
-  Tensor<DataType, 1, DataLayout,IndexType> vec(tensorRange);
-  Tensor<DataType, 1, DataLayout,IndexType> result(tensorRange);
+  Tensor<DataType, 1, DataLayout, IndexType> vec(tensorRange);
+  Tensor<DataType, 1, DataLayout, IndexType> result(tensorRange);
 
-  const size_t tensorBuffSize =vec.size()*sizeof(DataType);
-  DataType* gpu_data_vec  = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
-  DataType* gpu_data_result  = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
+  const size_t tensorBuffSize = vec.size() * sizeof(DataType);
+  DataType* gpu_data_vec = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
+  DataType* gpu_data_result = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
 
-  TensorMap<Tensor<DataType, 1, DataLayout,IndexType>> gpu_vec(gpu_data_vec, tensorRange);
-  TensorMap<Tensor<DataType, 1, DataLayout,IndexType>> gpu_result(gpu_data_result, tensorRange);
+  TensorMap<Tensor<DataType, 1, DataLayout, IndexType>> gpu_vec(gpu_data_vec, tensorRange);
+  TensorMap<Tensor<DataType, 1, DataLayout, IndexType>> gpu_result(gpu_data_result, tensorRange);
 
   sycl_device.memcpyHostToDevice(gpu_data_vec, vec.data(), tensorBuffSize);
-  gpu_result.device(sycl_device)=gpu_vec.generate(Generator1D());
+  gpu_result.device(sycl_device) = gpu_vec.generate(Generator1D());
   sycl_device.memcpyDeviceToHost(result.data(), gpu_data_result, tensorBuffSize);
 
   for (IndexType i = 0; i < 6; ++i) {
@@ -55,9 +51,8 @@
   }
 }
 
-
 struct Generator2D {
-  Generator2D() { }
+  Generator2D() {}
 
   float operator()(const array<Eigen::DenseIndex, 2>& coordinates) const {
     return 3 * coordinates[0] + 11 * coordinates[1];
@@ -65,35 +60,33 @@
 };
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_2D_sycl(const Eigen::SyclDevice& sycl_device)
-{
+static void test_2D_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType sizeDim1 = 5;
   IndexType sizeDim2 = 7;
   array<IndexType, 2> tensorRange = {{sizeDim1, sizeDim2}};
-  Tensor<DataType, 2, DataLayout,IndexType> matrix(tensorRange);
-  Tensor<DataType, 2, DataLayout,IndexType> result(tensorRange);
+  Tensor<DataType, 2, DataLayout, IndexType> matrix(tensorRange);
+  Tensor<DataType, 2, DataLayout, IndexType> result(tensorRange);
 
-  const size_t tensorBuffSize =matrix.size()*sizeof(DataType);
-  DataType* gpu_data_matrix  = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
-  DataType* gpu_data_result  = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
+  const size_t tensorBuffSize = matrix.size() * sizeof(DataType);
+  DataType* gpu_data_matrix = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
+  DataType* gpu_data_result = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
 
-  TensorMap<Tensor<DataType, 2, DataLayout,IndexType>> gpu_matrix(gpu_data_matrix, tensorRange);
-  TensorMap<Tensor<DataType, 2, DataLayout,IndexType>> gpu_result(gpu_data_result, tensorRange);
+  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> gpu_matrix(gpu_data_matrix, tensorRange);
+  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> gpu_result(gpu_data_result, tensorRange);
 
   sycl_device.memcpyHostToDevice(gpu_data_matrix, matrix.data(), tensorBuffSize);
-  gpu_result.device(sycl_device)=gpu_matrix.generate(Generator2D());
+  gpu_result.device(sycl_device) = gpu_matrix.generate(Generator2D());
   sycl_device.memcpyDeviceToHost(result.data(), gpu_data_result, tensorBuffSize);
 
   for (IndexType i = 0; i < 5; ++i) {
     for (IndexType j = 0; j < 5; ++j) {
-      VERIFY_IS_EQUAL(result(i, j), 3*i + 11*j);
+      VERIFY_IS_EQUAL(result(i, j), 3 * i + 11 * j);
     }
   }
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_gaussian_sycl(const Eigen::SyclDevice& sycl_device)
-{
+static void test_gaussian_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType rows = 32;
   IndexType cols = 48;
   array<DataType, 2> means;
@@ -105,31 +98,32 @@
   internal::GaussianGenerator<DataType, Eigen::DenseIndex, 2> gaussian_gen(means, std_devs);
 
   array<IndexType, 2> tensorRange = {{rows, cols}};
-  Tensor<DataType, 2, DataLayout,IndexType> matrix(tensorRange);
-  Tensor<DataType, 2, DataLayout,IndexType> result(tensorRange);
+  Tensor<DataType, 2, DataLayout, IndexType> matrix(tensorRange);
+  Tensor<DataType, 2, DataLayout, IndexType> result(tensorRange);
 
-  const size_t tensorBuffSize =matrix.size()*sizeof(DataType);
-  DataType* gpu_data_matrix  = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
-  DataType* gpu_data_result  = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
+  const size_t tensorBuffSize = matrix.size() * sizeof(DataType);
+  DataType* gpu_data_matrix = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
+  DataType* gpu_data_result = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
 
-  TensorMap<Tensor<DataType, 2, DataLayout,IndexType>> gpu_matrix(gpu_data_matrix, tensorRange);
-  TensorMap<Tensor<DataType, 2, DataLayout,IndexType>> gpu_result(gpu_data_result, tensorRange);
+  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> gpu_matrix(gpu_data_matrix, tensorRange);
+  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> gpu_result(gpu_data_result, tensorRange);
 
   sycl_device.memcpyHostToDevice(gpu_data_matrix, matrix.data(), tensorBuffSize);
-  gpu_result.device(sycl_device)=gpu_matrix.generate(gaussian_gen);
+  gpu_result.device(sycl_device) = gpu_matrix.generate(gaussian_gen);
   sycl_device.memcpyDeviceToHost(result.data(), gpu_data_result, tensorBuffSize);
 
   for (IndexType i = 0; i < rows; ++i) {
     for (IndexType j = 0; j < cols; ++j) {
-      DataType g_rows = powf(rows/2.0f - i, 2) / (3.14f * 3.14f) * 0.5f;
-      DataType g_cols = powf(cols/2.0f - j, 2) / (2.7f * 2.7f) * 0.5f;
+      DataType g_rows = powf(rows / 2.0f - i, 2) / (3.14f * 3.14f) * 0.5f;
+      DataType g_cols = powf(cols / 2.0f - j, 2) / (2.7f * 2.7f) * 0.5f;
       DataType gaussian = expf(-g_rows - g_cols);
       Eigen::internal::isApprox(result(i, j), gaussian, error_threshold);
     }
   }
 }
 
-template<typename DataType, typename dev_Selector> void sycl_generator_test_per_device(dev_Selector s){
+template <typename DataType, typename dev_Selector>
+void sycl_generator_test_per_device(dev_Selector s) {
   QueueInterface queueInterface(s);
   auto sycl_device = Eigen::SyclDevice(&queueInterface);
   test_1D_sycl<DataType, RowMajor, int64_t>(sycl_device);
@@ -139,9 +133,8 @@
   test_gaussian_sycl<DataType, RowMajor, int64_t>(sycl_device);
   test_gaussian_sycl<DataType, ColMajor, int64_t>(sycl_device);
 }
-EIGEN_DECLARE_TEST(cxx11_tensor_generator_sycl)
-{
-  for (const auto& device :Eigen::get_sycl_supported_devices()) {
+EIGEN_DECLARE_TEST(cxx11_tensor_generator_sycl) {
+  for (const auto& device : Eigen::get_sycl_supported_devices()) {
     CALL_SUBTEST(sycl_generator_test_per_device<float>(device));
   }
 }
diff --git a/unsupported/test/cxx11_tensor_gpu.cu b/unsupported/test/cxx11_tensor_gpu.cu
index 31baf1b..b6ddc98 100644
--- a/unsupported/test/cxx11_tensor_gpu.cu
+++ b/unsupported/test/cxx11_tensor_gpu.cu
@@ -37,10 +37,8 @@
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
-  Eigen::TensorMap<Eigen::Tensor<float, 1, 0, int>, Eigen::Aligned> gpu_in1(
-      d_in1, 2);
-  Eigen::TensorMap<Eigen::Tensor<float, 1, 0, int>, Eigen::Aligned> gpu_in2(
-      d_in2, 2);
+  Eigen::TensorMap<Eigen::Tensor<float, 1, 0, int>, Eigen::Aligned> gpu_in1(d_in1, 2);
+  Eigen::TensorMap<Eigen::Tensor<float, 1, 0, int>, Eigen::Aligned> gpu_in2(d_in2, 2);
 
   gpu_in1.device(gpu_device) = gpu_in1.constant(3.14f);
   gpu_in2.device(gpu_device) = gpu_in2.random();
@@ -48,10 +46,8 @@
   Tensor<float, 1, 0, int> new1(2);
   Tensor<float, 1, 0, int> new2(2);
 
-  assert(gpuMemcpyAsync(new1.data(), d_in1, tensor_bytes, gpuMemcpyDeviceToHost,
-                         gpu_device.stream()) == gpuSuccess);
-  assert(gpuMemcpyAsync(new2.data(), d_in2, tensor_bytes, gpuMemcpyDeviceToHost,
-                         gpu_device.stream()) == gpuSuccess);
+  assert(gpuMemcpyAsync(new1.data(), d_in1, tensor_bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) == gpuSuccess);
+  assert(gpuMemcpyAsync(new2.data(), d_in2, tensor_bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) == gpuSuccess);
 
   assert(gpuStreamSynchronize(gpu_device.stream()) == gpuSuccess);
 
@@ -66,10 +62,8 @@
 
 // Tests that there are no indexing overflows when computing tensors with the
 // max representable size.
-template <typename IndexType,
-          IndexType N = (std::numeric_limits<IndexType>::max)()>
-void test_gpu_nullary_max_size()
-{
+template <typename IndexType, IndexType N = (std::numeric_limits<IndexType>::max)()>
+void test_gpu_nullary_max_size() {
   typedef int8_t DataType;
   typedef Tensor<DataType, 1, 0, IndexType> TensorType;
   typedef Eigen::array<IndexType, 1> ArrayType;
@@ -94,8 +88,7 @@
 
   TensorType new1((ArrayType(n)));
 
-  assert(gpuMemcpyAsync(new1.data(), d_in1, in1_bytes, gpuMemcpyDeviceToHost,
-                        gpu_device.stream()) == gpuSuccess);
+  assert(gpuMemcpyAsync(new1.data(), d_in1, in1_bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) == gpuSuccess);
   assert(gpuStreamSynchronize(gpu_device.stream()) == gpuSuccess);
 
   for (IndexType i = 0; i < n; ++i) {
@@ -129,23 +122,18 @@
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_in1(
-      d_in1, Eigen::array<Eigen::DenseIndex, 1>(2));
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_in2(
-      d_in2, Eigen::array<Eigen::DenseIndex, 1>(2));
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_out(
-      d_out, Eigen::array<Eigen::DenseIndex, 1>(2));
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_in1(d_in1, Eigen::array<Eigen::DenseIndex, 1>(2));
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_in2(d_in2, Eigen::array<Eigen::DenseIndex, 1>(2));
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_out(d_out, Eigen::array<Eigen::DenseIndex, 1>(2));
 
   gpu_out.device(gpu_device) = gpu_in1 + gpu_in2;
 
-  assert(gpuMemcpyAsync(out.data(), d_out, out_bytes, gpuMemcpyDeviceToHost,
-                         gpu_device.stream()) == gpuSuccess);
+  assert(gpuMemcpyAsync(out.data(), d_out, out_bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) == gpuSuccess);
   assert(gpuStreamSynchronize(gpu_device.stream()) == gpuSuccess);
 
   for (int i = 0; i < 2; ++i) {
-    VERIFY_IS_APPROX(
-        out(Eigen::array<Eigen::DenseIndex, 1>(i)),
-        in1(Eigen::array<Eigen::DenseIndex, 1>(i)) + in2(Eigen::array<Eigen::DenseIndex, 1>(i)));
+    VERIFY_IS_APPROX(out(Eigen::array<Eigen::DenseIndex, 1>(i)),
+                     in1(Eigen::array<Eigen::DenseIndex, 1>(i)) + in2(Eigen::array<Eigen::DenseIndex, 1>(i)));
   }
 
   gpuFree(d_in1);
@@ -153,12 +141,11 @@
   gpuFree(d_out);
 }
 
-void test_gpu_elementwise()
-{
-  Tensor<float, 3> in1(Eigen::array<Eigen::DenseIndex, 3>(72,53,97));
-  Tensor<float, 3> in2(Eigen::array<Eigen::DenseIndex, 3>(72,53,97));
-  Tensor<float, 3> in3(Eigen::array<Eigen::DenseIndex, 3>(72,53,97));
-  Tensor<float, 3> out(Eigen::array<Eigen::DenseIndex, 3>(72,53,97));
+void test_gpu_elementwise() {
+  Tensor<float, 3> in1(Eigen::array<Eigen::DenseIndex, 3>(72, 53, 97));
+  Tensor<float, 3> in2(Eigen::array<Eigen::DenseIndex, 3>(72, 53, 97));
+  Tensor<float, 3> in3(Eigen::array<Eigen::DenseIndex, 3>(72, 53, 97));
+  Tensor<float, 3> out(Eigen::array<Eigen::DenseIndex, 3>(72, 53, 97));
   in1.setRandom();
   in2.setRandom();
   in3.setRandom();
@@ -184,10 +171,10 @@
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
-  Eigen::TensorMap<Eigen::Tensor<float, 3> > gpu_in1(d_in1, Eigen::array<Eigen::DenseIndex, 3>(72,53,97));
-  Eigen::TensorMap<Eigen::Tensor<float, 3> > gpu_in2(d_in2, Eigen::array<Eigen::DenseIndex, 3>(72,53,97));
-  Eigen::TensorMap<Eigen::Tensor<float, 3> > gpu_in3(d_in3, Eigen::array<Eigen::DenseIndex, 3>(72,53,97));
-  Eigen::TensorMap<Eigen::Tensor<float, 3> > gpu_out(d_out, Eigen::array<Eigen::DenseIndex, 3>(72,53,97));
+  Eigen::TensorMap<Eigen::Tensor<float, 3> > gpu_in1(d_in1, Eigen::array<Eigen::DenseIndex, 3>(72, 53, 97));
+  Eigen::TensorMap<Eigen::Tensor<float, 3> > gpu_in2(d_in2, Eigen::array<Eigen::DenseIndex, 3>(72, 53, 97));
+  Eigen::TensorMap<Eigen::Tensor<float, 3> > gpu_in3(d_in3, Eigen::array<Eigen::DenseIndex, 3>(72, 53, 97));
+  Eigen::TensorMap<Eigen::Tensor<float, 3> > gpu_out(d_out, Eigen::array<Eigen::DenseIndex, 3>(72, 53, 97));
 
   gpu_out.device(gpu_device) = gpu_in1 + gpu_in2 * gpu_in3;
 
@@ -197,7 +184,10 @@
   for (int i = 0; i < 72; ++i) {
     for (int j = 0; j < 53; ++j) {
       for (int k = 0; k < 97; ++k) {
-        VERIFY_IS_APPROX(out(Eigen::array<Eigen::DenseIndex, 3>(i,j,k)), in1(Eigen::array<Eigen::DenseIndex, 3>(i,j,k)) + in2(Eigen::array<Eigen::DenseIndex, 3>(i,j,k)) * in3(Eigen::array<Eigen::DenseIndex, 3>(i,j,k)));
+        VERIFY_IS_APPROX(
+            out(Eigen::array<Eigen::DenseIndex, 3>(i, j, k)),
+            in1(Eigen::array<Eigen::DenseIndex, 3>(i, j, k)) +
+                in2(Eigen::array<Eigen::DenseIndex, 3>(i, j, k)) * in3(Eigen::array<Eigen::DenseIndex, 3>(i, j, k)));
       }
     }
   }
@@ -226,15 +216,12 @@
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_in1(
-      d_in1, 200);
-  Eigen::TensorMap<Eigen::Tensor<bool, 1>, Eigen::Aligned> gpu_out(
-      d_out, 200);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_in1(d_in1, 200);
+  Eigen::TensorMap<Eigen::Tensor<bool, 1>, Eigen::Aligned> gpu_out(d_out, 200);
 
   gpu_out.device(gpu_device) = (gpu_in1.isnan)();
 
-  assert(gpuMemcpyAsync(out.data(), d_out, out_bytes, gpuMemcpyDeviceToHost,
-                         gpu_device.stream()) == gpuSuccess);
+  assert(gpuMemcpyAsync(out.data(), d_out, out_bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) == gpuSuccess);
   assert(gpuStreamSynchronize(gpu_device.stream()) == gpuSuccess);
 
   for (int i = 0; i < 200; ++i) {
@@ -245,10 +232,9 @@
   gpuFree(d_out);
 }
 
-void test_gpu_reduction()
-{
-  Tensor<float, 4> in1(72,53,97,113);
-  Tensor<float, 2> out(72,97);
+void test_gpu_reduction() {
+  Tensor<float, 4> in1(72, 53, 97, 113);
+  Tensor<float, 2> out(72, 97);
   in1.setRandom();
 
   std::size_t in1_bytes = in1.size() * sizeof(float);
@@ -264,8 +250,8 @@
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
-  Eigen::TensorMap<Eigen::Tensor<float, 4> > gpu_in1(d_in1, 72,53,97,113);
-  Eigen::TensorMap<Eigen::Tensor<float, 2> > gpu_out(d_out, 72,97);
+  Eigen::TensorMap<Eigen::Tensor<float, 4> > gpu_in1(d_in1, 72, 53, 97, 113);
+  Eigen::TensorMap<Eigen::Tensor<float, 2> > gpu_out(d_out, 72, 97);
 
   array<Eigen::DenseIndex, 2> reduction_axis;
   reduction_axis[0] = 1;
@@ -281,11 +267,10 @@
       float expected = 0;
       for (int k = 0; k < 53; ++k) {
         for (int l = 0; l < 113; ++l) {
-          expected =
-              std::max<float>(expected, in1(i, k, j, l));
+          expected = std::max<float>(expected, in1(i, k, j, l));
         }
       }
-      VERIFY_IS_APPROX(out(i,j), expected);
+      VERIFY_IS_APPROX(out(i, j), expected);
     }
   }
 
@@ -293,9 +278,8 @@
   gpuFree(d_out);
 }
 
-template<int DataLayout>
-void test_gpu_contraction()
-{
+template <int DataLayout>
+void test_gpu_contraction() {
   // with these dimensions, the output has 300 * 140 elements, which is
   // more than 30 * 1024, which is the number of threads in blocks on
   // a 15 SM GK110 GPU
@@ -306,7 +290,7 @@
   t_left.setRandom();
   t_right.setRandom();
 
-  std::size_t t_left_bytes = t_left.size()  * sizeof(float);
+  std::size_t t_left_bytes = t_left.size() * sizeof(float);
   std::size_t t_right_bytes = t_right.size() * sizeof(float);
   std::size_t t_result_bytes = t_result.size() * sizeof(float);
 
@@ -345,7 +329,8 @@
 
   for (DenseIndex i = 0; i < t_result.size(); i++) {
     if (fabs(t_result.data()[i] - m_result.data()[i]) >= 1e-4f) {
-      std::cout << "mismatch detected at index " << i << ": " << t_result.data()[i] << " vs " <<  m_result.data()[i] << std::endl;
+      std::cout << "mismatch detected at index " << i << ": " << t_result.data()[i] << " vs " << m_result.data()[i]
+                << std::endl;
       assert(false);
     }
   }
@@ -355,12 +340,11 @@
   gpuFree(d_t_result);
 }
 
-template<int DataLayout>
-void test_gpu_convolution_1d()
-{
-  Tensor<float, 4, DataLayout> input(74,37,11,137);
+template <int DataLayout>
+void test_gpu_convolution_1d() {
+  Tensor<float, 4, DataLayout> input(74, 37, 11, 137);
   Tensor<float, 1, DataLayout> kernel(4);
-  Tensor<float, 4, DataLayout> out(74,34,11,137);
+  Tensor<float, 4, DataLayout> out(74, 34, 11, 137);
   input = input.constant(10.0f) + input.random();
   kernel = kernel.constant(7.0f) + kernel.random();
 
@@ -381,9 +365,9 @@
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
-  Eigen::TensorMap<Eigen::Tensor<float, 4, DataLayout> > gpu_input(d_input, 74,37,11,137);
+  Eigen::TensorMap<Eigen::Tensor<float, 4, DataLayout> > gpu_input(d_input, 74, 37, 11, 137);
   Eigen::TensorMap<Eigen::Tensor<float, 1, DataLayout> > gpu_kernel(d_kernel, 4);
-  Eigen::TensorMap<Eigen::Tensor<float, 4, DataLayout> > gpu_out(d_out, 74,34,11,137);
+  Eigen::TensorMap<Eigen::Tensor<float, 4, DataLayout> > gpu_out(d_out, 74, 34, 11, 137);
 
   Eigen::array<Eigen::DenseIndex, 1> dims(1);
   gpu_out.device(gpu_device) = gpu_input.convolve(gpu_kernel, dims);
@@ -395,9 +379,9 @@
     for (int j = 0; j < 34; ++j) {
       for (int k = 0; k < 11; ++k) {
         for (int l = 0; l < 137; ++l) {
-          const float result = out(i,j,k,l);
-          const float expected = input(i,j+0,k,l) * kernel(0) + input(i,j+1,k,l) * kernel(1) +
-                                 input(i,j+2,k,l) * kernel(2) + input(i,j+3,k,l) * kernel(3);
+          const float result = out(i, j, k, l);
+          const float expected = input(i, j + 0, k, l) * kernel(0) + input(i, j + 1, k, l) * kernel(1) +
+                                 input(i, j + 2, k, l) * kernel(2) + input(i, j + 3, k, l) * kernel(3);
           VERIFY_IS_APPROX(result, expected);
         }
       }
@@ -409,11 +393,10 @@
   gpuFree(d_out);
 }
 
-void test_gpu_convolution_inner_dim_col_major_1d()
-{
-  Tensor<float, 4, ColMajor> input(74,9,11,7);
+void test_gpu_convolution_inner_dim_col_major_1d() {
+  Tensor<float, 4, ColMajor> input(74, 9, 11, 7);
   Tensor<float, 1, ColMajor> kernel(4);
-  Tensor<float, 4, ColMajor> out(71,9,11,7);
+  Tensor<float, 4, ColMajor> out(71, 9, 11, 7);
   input = input.constant(10.0f) + input.random();
   kernel = kernel.constant(7.0f) + kernel.random();
 
@@ -434,9 +417,9 @@
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
-  Eigen::TensorMap<Eigen::Tensor<float, 4, ColMajor> > gpu_input(d_input,74,9,11,7);
-  Eigen::TensorMap<Eigen::Tensor<float, 1, ColMajor> > gpu_kernel(d_kernel,4);
-  Eigen::TensorMap<Eigen::Tensor<float, 4, ColMajor> > gpu_out(d_out,71,9,11,7);
+  Eigen::TensorMap<Eigen::Tensor<float, 4, ColMajor> > gpu_input(d_input, 74, 9, 11, 7);
+  Eigen::TensorMap<Eigen::Tensor<float, 1, ColMajor> > gpu_kernel(d_kernel, 4);
+  Eigen::TensorMap<Eigen::Tensor<float, 4, ColMajor> > gpu_out(d_out, 71, 9, 11, 7);
 
   Eigen::array<Eigen::DenseIndex, 1> dims(0);
   gpu_out.device(gpu_device) = gpu_input.convolve(gpu_kernel, dims);
@@ -448,9 +431,9 @@
     for (int j = 0; j < 9; ++j) {
       for (int k = 0; k < 11; ++k) {
         for (int l = 0; l < 7; ++l) {
-          const float result = out(i,j,k,l);
-          const float expected = input(i+0,j,k,l) * kernel(0) + input(i+1,j,k,l) * kernel(1) +
-                                 input(i+2,j,k,l) * kernel(2) + input(i+3,j,k,l) * kernel(3);
+          const float result = out(i, j, k, l);
+          const float expected = input(i + 0, j, k, l) * kernel(0) + input(i + 1, j, k, l) * kernel(1) +
+                                 input(i + 2, j, k, l) * kernel(2) + input(i + 3, j, k, l) * kernel(3);
           VERIFY_IS_APPROX(result, expected);
         }
       }
@@ -462,11 +445,10 @@
   gpuFree(d_out);
 }
 
-void test_gpu_convolution_inner_dim_row_major_1d()
-{
-  Tensor<float, 4, RowMajor> input(7,9,11,74);
+void test_gpu_convolution_inner_dim_row_major_1d() {
+  Tensor<float, 4, RowMajor> input(7, 9, 11, 74);
   Tensor<float, 1, RowMajor> kernel(4);
-  Tensor<float, 4, RowMajor> out(7,9,11,71);
+  Tensor<float, 4, RowMajor> out(7, 9, 11, 71);
   input = input.constant(10.0f) + input.random();
   kernel = kernel.constant(7.0f) + kernel.random();
 
@@ -487,9 +469,9 @@
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
-  Eigen::TensorMap<Eigen::Tensor<float, 4, RowMajor> > gpu_input(d_input, 7,9,11,74);
+  Eigen::TensorMap<Eigen::Tensor<float, 4, RowMajor> > gpu_input(d_input, 7, 9, 11, 74);
   Eigen::TensorMap<Eigen::Tensor<float, 1, RowMajor> > gpu_kernel(d_kernel, 4);
-  Eigen::TensorMap<Eigen::Tensor<float, 4, RowMajor> > gpu_out(d_out, 7,9,11,71);
+  Eigen::TensorMap<Eigen::Tensor<float, 4, RowMajor> > gpu_out(d_out, 7, 9, 11, 71);
 
   Eigen::array<Eigen::DenseIndex, 1> dims(3);
   gpu_out.device(gpu_device) = gpu_input.convolve(gpu_kernel, dims);
@@ -501,9 +483,9 @@
     for (int j = 0; j < 9; ++j) {
       for (int k = 0; k < 11; ++k) {
         for (int l = 0; l < 71; ++l) {
-          const float result = out(i,j,k,l);
-          const float expected = input(i,j,k,l+0) * kernel(0) + input(i,j,k,l+1) * kernel(1) +
-                                 input(i,j,k,l+2) * kernel(2) + input(i,j,k,l+3) * kernel(3);
+          const float result = out(i, j, k, l);
+          const float expected = input(i, j, k, l + 0) * kernel(0) + input(i, j, k, l + 1) * kernel(1) +
+                                 input(i, j, k, l + 2) * kernel(2) + input(i, j, k, l + 3) * kernel(3);
           VERIFY_IS_APPROX(result, expected);
         }
       }
@@ -515,12 +497,11 @@
   gpuFree(d_out);
 }
 
-template<int DataLayout>
-void test_gpu_convolution_2d()
-{
-  Tensor<float, 4, DataLayout> input(74,37,11,137);
-  Tensor<float, 2, DataLayout> kernel(3,4);
-  Tensor<float, 4, DataLayout> out(74,35,8,137);
+template <int DataLayout>
+void test_gpu_convolution_2d() {
+  Tensor<float, 4, DataLayout> input(74, 37, 11, 137);
+  Tensor<float, 2, DataLayout> kernel(3, 4);
+  Tensor<float, 4, DataLayout> out(74, 35, 8, 137);
   input = input.constant(10.0f) + input.random();
   kernel = kernel.constant(7.0f) + kernel.random();
 
@@ -541,11 +522,11 @@
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
-  Eigen::TensorMap<Eigen::Tensor<float, 4, DataLayout> > gpu_input(d_input,74,37,11,137);
-  Eigen::TensorMap<Eigen::Tensor<float, 2, DataLayout> > gpu_kernel(d_kernel,3,4);
-  Eigen::TensorMap<Eigen::Tensor<float, 4, DataLayout> > gpu_out(d_out,74,35,8,137);
+  Eigen::TensorMap<Eigen::Tensor<float, 4, DataLayout> > gpu_input(d_input, 74, 37, 11, 137);
+  Eigen::TensorMap<Eigen::Tensor<float, 2, DataLayout> > gpu_kernel(d_kernel, 3, 4);
+  Eigen::TensorMap<Eigen::Tensor<float, 4, DataLayout> > gpu_out(d_out, 74, 35, 8, 137);
 
-  Eigen::array<Eigen::DenseIndex, 2> dims(1,2);
+  Eigen::array<Eigen::DenseIndex, 2> dims(1, 2);
   gpu_out.device(gpu_device) = gpu_input.convolve(gpu_kernel, dims);
 
   assert(gpuMemcpyAsync(out.data(), d_out, out_bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) == gpuSuccess);
@@ -555,19 +536,13 @@
     for (int j = 0; j < 35; ++j) {
       for (int k = 0; k < 8; ++k) {
         for (int l = 0; l < 137; ++l) {
-          const float result = out(i,j,k,l);
-          const float expected = input(i,j+0,k+0,l) * kernel(0,0) +
-                                 input(i,j+1,k+0,l) * kernel(1,0) +
-                                 input(i,j+2,k+0,l) * kernel(2,0) +
-                                 input(i,j+0,k+1,l) * kernel(0,1) +
-                                 input(i,j+1,k+1,l) * kernel(1,1) +
-                                 input(i,j+2,k+1,l) * kernel(2,1) +
-                                 input(i,j+0,k+2,l) * kernel(0,2) +
-                                 input(i,j+1,k+2,l) * kernel(1,2) +
-                                 input(i,j+2,k+2,l) * kernel(2,2) +
-                                 input(i,j+0,k+3,l) * kernel(0,3) +
-                                 input(i,j+1,k+3,l) * kernel(1,3) +
-                                 input(i,j+2,k+3,l) * kernel(2,3);
+          const float result = out(i, j, k, l);
+          const float expected = input(i, j + 0, k + 0, l) * kernel(0, 0) + input(i, j + 1, k + 0, l) * kernel(1, 0) +
+                                 input(i, j + 2, k + 0, l) * kernel(2, 0) + input(i, j + 0, k + 1, l) * kernel(0, 1) +
+                                 input(i, j + 1, k + 1, l) * kernel(1, 1) + input(i, j + 2, k + 1, l) * kernel(2, 1) +
+                                 input(i, j + 0, k + 2, l) * kernel(0, 2) + input(i, j + 1, k + 2, l) * kernel(1, 2) +
+                                 input(i, j + 2, k + 2, l) * kernel(2, 2) + input(i, j + 0, k + 3, l) * kernel(0, 3) +
+                                 input(i, j + 1, k + 3, l) * kernel(1, 3) + input(i, j + 2, k + 3, l) * kernel(2, 3);
           VERIFY_IS_APPROX(result, expected);
         }
       }
@@ -579,12 +554,11 @@
   gpuFree(d_out);
 }
 
-template<int DataLayout>
-void test_gpu_convolution_3d()
-{
-  Tensor<float, 5, DataLayout> input(Eigen::array<Eigen::DenseIndex, 5>(74,37,11,137,17));
-  Tensor<float, 3, DataLayout> kernel(3,4,2);
-  Tensor<float, 5, DataLayout> out(Eigen::array<Eigen::DenseIndex, 5>(74,35,8,136,17));
+template <int DataLayout>
+void test_gpu_convolution_3d() {
+  Tensor<float, 5, DataLayout> input(Eigen::array<Eigen::DenseIndex, 5>(74, 37, 11, 137, 17));
+  Tensor<float, 3, DataLayout> kernel(3, 4, 2);
+  Tensor<float, 5, DataLayout> out(Eigen::array<Eigen::DenseIndex, 5>(74, 35, 8, 136, 17));
   input = input.constant(10.0f) + input.random();
   kernel = kernel.constant(7.0f) + kernel.random();
 
@@ -602,14 +576,14 @@
   gpuMemcpy(d_input, input.data(), input_bytes, gpuMemcpyHostToDevice);
   gpuMemcpy(d_kernel, kernel.data(), kernel_bytes, gpuMemcpyHostToDevice);
 
-  Eigen::GpuStreamDevice stream;    
+  Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
-  Eigen::TensorMap<Eigen::Tensor<float, 5, DataLayout> > gpu_input(d_input,74,37,11,137,17);
-  Eigen::TensorMap<Eigen::Tensor<float, 3, DataLayout> > gpu_kernel(d_kernel,3,4,2);
-  Eigen::TensorMap<Eigen::Tensor<float, 5, DataLayout> > gpu_out(d_out,74,35,8,136,17);
+  Eigen::TensorMap<Eigen::Tensor<float, 5, DataLayout> > gpu_input(d_input, 74, 37, 11, 137, 17);
+  Eigen::TensorMap<Eigen::Tensor<float, 3, DataLayout> > gpu_kernel(d_kernel, 3, 4, 2);
+  Eigen::TensorMap<Eigen::Tensor<float, 5, DataLayout> > gpu_out(d_out, 74, 35, 8, 136, 17);
 
-  Eigen::array<Eigen::DenseIndex, 3> dims(1,2,3);
+  Eigen::array<Eigen::DenseIndex, 3> dims(1, 2, 3);
   gpu_out.device(gpu_device) = gpu_input.convolve(gpu_kernel, dims);
 
   assert(gpuMemcpyAsync(out.data(), d_out, out_bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) == gpuSuccess);
@@ -620,31 +594,31 @@
       for (int k = 0; k < 8; ++k) {
         for (int l = 0; l < 136; ++l) {
           for (int m = 0; m < 17; ++m) {
-            const float result = out(i,j,k,l,m);
-            const float expected = input(i,j+0,k+0,l+0,m) * kernel(0,0,0) +
-                                   input(i,j+1,k+0,l+0,m) * kernel(1,0,0) +
-                                   input(i,j+2,k+0,l+0,m) * kernel(2,0,0) +
-                                   input(i,j+0,k+1,l+0,m) * kernel(0,1,0) +
-                                   input(i,j+1,k+1,l+0,m) * kernel(1,1,0) +
-                                   input(i,j+2,k+1,l+0,m) * kernel(2,1,0) +
-                                   input(i,j+0,k+2,l+0,m) * kernel(0,2,0) +
-                                   input(i,j+1,k+2,l+0,m) * kernel(1,2,0) +
-                                   input(i,j+2,k+2,l+0,m) * kernel(2,2,0) +
-                                   input(i,j+0,k+3,l+0,m) * kernel(0,3,0) +
-                                   input(i,j+1,k+3,l+0,m) * kernel(1,3,0) +
-                                   input(i,j+2,k+3,l+0,m) * kernel(2,3,0) +
-                                   input(i,j+0,k+0,l+1,m) * kernel(0,0,1) +
-                                   input(i,j+1,k+0,l+1,m) * kernel(1,0,1) +
-                                   input(i,j+2,k+0,l+1,m) * kernel(2,0,1) +
-                                   input(i,j+0,k+1,l+1,m) * kernel(0,1,1) +
-                                   input(i,j+1,k+1,l+1,m) * kernel(1,1,1) +
-                                   input(i,j+2,k+1,l+1,m) * kernel(2,1,1) +
-                                   input(i,j+0,k+2,l+1,m) * kernel(0,2,1) +
-                                   input(i,j+1,k+2,l+1,m) * kernel(1,2,1) +
-                                   input(i,j+2,k+2,l+1,m) * kernel(2,2,1) +
-                                   input(i,j+0,k+3,l+1,m) * kernel(0,3,1) +
-                                   input(i,j+1,k+3,l+1,m) * kernel(1,3,1) +
-                                   input(i,j+2,k+3,l+1,m) * kernel(2,3,1);
+            const float result = out(i, j, k, l, m);
+            const float expected = input(i, j + 0, k + 0, l + 0, m) * kernel(0, 0, 0) +
+                                   input(i, j + 1, k + 0, l + 0, m) * kernel(1, 0, 0) +
+                                   input(i, j + 2, k + 0, l + 0, m) * kernel(2, 0, 0) +
+                                   input(i, j + 0, k + 1, l + 0, m) * kernel(0, 1, 0) +
+                                   input(i, j + 1, k + 1, l + 0, m) * kernel(1, 1, 0) +
+                                   input(i, j + 2, k + 1, l + 0, m) * kernel(2, 1, 0) +
+                                   input(i, j + 0, k + 2, l + 0, m) * kernel(0, 2, 0) +
+                                   input(i, j + 1, k + 2, l + 0, m) * kernel(1, 2, 0) +
+                                   input(i, j + 2, k + 2, l + 0, m) * kernel(2, 2, 0) +
+                                   input(i, j + 0, k + 3, l + 0, m) * kernel(0, 3, 0) +
+                                   input(i, j + 1, k + 3, l + 0, m) * kernel(1, 3, 0) +
+                                   input(i, j + 2, k + 3, l + 0, m) * kernel(2, 3, 0) +
+                                   input(i, j + 0, k + 0, l + 1, m) * kernel(0, 0, 1) +
+                                   input(i, j + 1, k + 0, l + 1, m) * kernel(1, 0, 1) +
+                                   input(i, j + 2, k + 0, l + 1, m) * kernel(2, 0, 1) +
+                                   input(i, j + 0, k + 1, l + 1, m) * kernel(0, 1, 1) +
+                                   input(i, j + 1, k + 1, l + 1, m) * kernel(1, 1, 1) +
+                                   input(i, j + 2, k + 1, l + 1, m) * kernel(2, 1, 1) +
+                                   input(i, j + 0, k + 2, l + 1, m) * kernel(0, 2, 1) +
+                                   input(i, j + 1, k + 2, l + 1, m) * kernel(1, 2, 1) +
+                                   input(i, j + 2, k + 2, l + 1, m) * kernel(2, 2, 1) +
+                                   input(i, j + 0, k + 3, l + 1, m) * kernel(0, 3, 1) +
+                                   input(i, j + 1, k + 3, l + 1, m) * kernel(1, 3, 1) +
+                                   input(i, j + 2, k + 3, l + 1, m) * kernel(2, 3, 1);
             VERIFY_IS_APPROX(result, expected);
           }
         }
@@ -657,14 +631,12 @@
   gpuFree(d_out);
 }
 
-
 template <typename Scalar>
-void test_gpu_lgamma(const Scalar stddev)
-{
-  Tensor<Scalar, 2> in(72,97);
+void test_gpu_lgamma(const Scalar stddev) {
+  Tensor<Scalar, 2> in(72, 97);
   in.setRandom();
   in *= in.constant(stddev);
-  Tensor<Scalar, 2> out(72,97);
+  Tensor<Scalar, 2> out(72, 97);
   out.setZero();
 
   std::size_t bytes = in.size() * sizeof(Scalar);
@@ -689,7 +661,7 @@
 
   for (int i = 0; i < 72; ++i) {
     for (int j = 0; j < 97; ++j) {
-      VERIFY_IS_APPROX(out(i,j), (std::lgamma)(in(i,j)));
+      VERIFY_IS_APPROX(out(i, j), (std::lgamma)(in(i, j)));
     }
   }
 
@@ -698,8 +670,7 @@
 }
 
 template <typename Scalar>
-void test_gpu_digamma()
-{
+void test_gpu_digamma() {
   Tensor<Scalar, 1> in(7);
   Tensor<Scalar, 1> out(7);
   Tensor<Scalar, 1> expected_out(7);
@@ -750,8 +721,7 @@
 }
 
 template <typename Scalar>
-void test_gpu_zeta()
-{
+void test_gpu_zeta() {
   Tensor<Scalar, 1> in_x(6);
   Tensor<Scalar, 1> in_q(6);
   Tensor<Scalar, 1> out(6);
@@ -764,7 +734,7 @@
   in_x(3) = Scalar(-10.5);
   in_x(4) = Scalar(10000.5);
   in_x(5) = Scalar(3);
-  
+
   in_q(0) = Scalar(1.2345);
   in_q(1) = Scalar(2);
   in_q(2) = Scalar(1.5);
@@ -790,7 +760,7 @@
 
   gpuMemcpy(d_in_x, in_x.data(), bytes, gpuMemcpyHostToDevice);
   gpuMemcpy(d_in_q, in_q.data(), bytes, gpuMemcpyHostToDevice);
-  
+
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
@@ -813,8 +783,7 @@
 }
 
 template <typename Scalar>
-void test_gpu_polygamma()
-{
+void test_gpu_polygamma() {
   Tensor<Scalar, 1> in_x(7);
   Tensor<Scalar, 1> in_n(7);
   Tensor<Scalar, 1> out(7);
@@ -828,7 +797,7 @@
   in_n(4) = Scalar(31);
   in_n(5) = Scalar(28);
   in_n(6) = Scalar(8);
-  
+
   in_x(0) = Scalar(2);
   in_x(1) = Scalar(3);
   in_x(2) = Scalar(25.5);
@@ -856,7 +825,7 @@
 
   gpuMemcpy(d_in_x, in_x.data(), bytes, gpuMemcpyHostToDevice);
   gpuMemcpy(d_in_n, in_n.data(), bytes, gpuMemcpyHostToDevice);
-  
+
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
@@ -879,8 +848,7 @@
 }
 
 template <typename Scalar>
-void test_gpu_igamma()
-{
+void test_gpu_igamma() {
   Tensor<Scalar, 2> a(6, 6);
   Tensor<Scalar, 2> x(6, 6);
   Tensor<Scalar, 2> out(6, 6);
@@ -897,18 +865,13 @@
   }
 
   Scalar nan = std::numeric_limits<Scalar>::quiet_NaN();
-  Scalar igamma_s[][6] = {{0.0, nan, nan, nan, nan, nan},
-                          {0.0, 0.6321205588285578, 0.7768698398515702,
-                           0.9816843611112658, 9.999500016666262e-05, 1.0},
-                          {0.0, 0.4275932955291202, 0.608374823728911,
-                           0.9539882943107686, 7.522076445089201e-07, 1.0},
-                          {0.0, 0.01898815687615381, 0.06564245437845008,
-                           0.5665298796332909, 4.166333347221828e-18, 1.0},
-                          {0.0, 0.9999780593618628, 0.9999899967080838,
-                           0.9999996219837988, 0.9991370418689945, 1.0},
-                          {0.0, 0.0, 0.0, 0.0, 0.0, 0.5042041932513908}};
-
-
+  Scalar igamma_s[][6] = {
+      {0.0, nan, nan, nan, nan, nan},
+      {0.0, 0.6321205588285578, 0.7768698398515702, 0.9816843611112658, 9.999500016666262e-05, 1.0},
+      {0.0, 0.4275932955291202, 0.608374823728911, 0.9539882943107686, 7.522076445089201e-07, 1.0},
+      {0.0, 0.01898815687615381, 0.06564245437845008, 0.5665298796332909, 4.166333347221828e-18, 1.0},
+      {0.0, 0.9999780593618628, 0.9999899967080838, 0.9999996219837988, 0.9991370418689945, 1.0},
+      {0.0, 0.0, 0.0, 0.0, 0.0, 0.5042041932513908}};
 
   std::size_t bytes = a.size() * sizeof(Scalar);
 
@@ -950,8 +913,7 @@
 }
 
 template <typename Scalar>
-void test_gpu_igammac()
-{
+void test_gpu_igammac() {
   Tensor<Scalar, 2> a(6, 6);
   Tensor<Scalar, 2> x(6, 6);
   Tensor<Scalar, 2> out(6, 6);
@@ -968,17 +930,13 @@
   }
 
   Scalar nan = std::numeric_limits<Scalar>::quiet_NaN();
-  Scalar igammac_s[][6] = {{nan, nan, nan, nan, nan, nan},
-                           {1.0, 0.36787944117144233, 0.22313016014842982,
-                            0.018315638888734182, 0.9999000049998333, 0.0},
-                           {1.0, 0.5724067044708798, 0.3916251762710878,
-                            0.04601170568923136, 0.9999992477923555, 0.0},
-                           {1.0, 0.9810118431238462, 0.9343575456215499,
-                            0.4334701203667089, 1.0, 0.0},
-                           {1.0, 2.1940638138146658e-05, 1.0003291916285e-05,
-                            3.7801620118431334e-07, 0.0008629581310054535,
-                            0.0},
-                           {1.0, 1.0, 1.0, 1.0, 1.0, 0.49579580674813944}};
+  Scalar igammac_s[][6] = {
+      {nan, nan, nan, nan, nan, nan},
+      {1.0, 0.36787944117144233, 0.22313016014842982, 0.018315638888734182, 0.9999000049998333, 0.0},
+      {1.0, 0.5724067044708798, 0.3916251762710878, 0.04601170568923136, 0.9999992477923555, 0.0},
+      {1.0, 0.9810118431238462, 0.9343575456215499, 0.4334701203667089, 1.0, 0.0},
+      {1.0, 2.1940638138146658e-05, 1.0003291916285e-05, 3.7801620118431334e-07, 0.0008629581310054535, 0.0},
+      {1.0, 1.0, 1.0, 1.0, 1.0, 0.49579580674813944}};
 
   std::size_t bytes = a.size() * sizeof(Scalar);
 
@@ -1020,12 +978,11 @@
 }
 
 template <typename Scalar>
-void test_gpu_erf(const Scalar stddev)
-{
-  Tensor<Scalar, 2> in(72,97);
+void test_gpu_erf(const Scalar stddev) {
+  Tensor<Scalar, 2> in(72, 97);
   in.setRandom();
   in *= in.constant(stddev);
-  Tensor<Scalar, 2> out(72,97);
+  Tensor<Scalar, 2> out(72, 97);
   out.setZero();
 
   std::size_t bytes = in.size() * sizeof(Scalar);
@@ -1050,7 +1007,7 @@
 
   for (int i = 0; i < 72; ++i) {
     for (int j = 0; j < 97; ++j) {
-      VERIFY_IS_APPROX(out(i,j), (std::erf)(in(i,j)));
+      VERIFY_IS_APPROX(out(i, j), (std::erf)(in(i, j)));
     }
   }
 
@@ -1059,12 +1016,11 @@
 }
 
 template <typename Scalar>
-void test_gpu_erfc(const Scalar stddev)
-{
-  Tensor<Scalar, 2> in(72,97);
+void test_gpu_erfc(const Scalar stddev) {
+  Tensor<Scalar, 2> in(72, 97);
   in.setRandom();
   in *= in.constant(stddev);
-  Tensor<Scalar, 2> out(72,97);
+  Tensor<Scalar, 2> out(72, 97);
   out.setZero();
 
   std::size_t bytes = in.size() * sizeof(Scalar);
@@ -1089,7 +1045,7 @@
 
   for (int i = 0; i < 72; ++i) {
     for (int j = 0; j < 97; ++j) {
-      VERIFY_IS_APPROX(out(i,j), (std::erfc)(in(i,j)));
+      VERIFY_IS_APPROX(out(i, j), (std::erfc)(in(i, j)));
     }
   }
 
@@ -1098,8 +1054,7 @@
 }
 
 template <typename Scalar>
-void test_gpu_ndtri()
-{
+void test_gpu_ndtri() {
   Tensor<Scalar, 1> in_x(9);
   Tensor<Scalar, 1> out(9);
   Tensor<Scalar, 1> expected_out(9);
@@ -1145,7 +1100,7 @@
   assert(gpuMemcpyAsync(out.data(), d_out, bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) == gpuSuccess);
   assert(gpuStreamSynchronize(gpu_device.stream()) == gpuSuccess);
 
-  for (int i = 0; i < 6; ++i) {    
+  for (int i = 0; i < 6; ++i) {
     VERIFY_IS_CWISE_APPROX(out(i), expected_out(i));
   }
 
@@ -1154,8 +1109,7 @@
 }
 
 template <typename Scalar>
-void test_gpu_betainc()
-{
+void test_gpu_betainc() {
   Tensor<Scalar, 1> in_x(125);
   Tensor<Scalar, 1> in_a(125);
   Tensor<Scalar, 1> in_b(125);
@@ -1170,85 +1124,57 @@
   Array<Scalar, 1, Dynamic> b(125);
   Array<Scalar, 1, Dynamic> v(125);
 
-  a << 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
-      0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
-      0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
-      0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
-      0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
-      0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
-      0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
-      0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
-      0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
-      0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
-      0.03062277660168379, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999,
-      0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999,
-      0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 31.62177660168379,
-      31.62177660168379, 31.62177660168379, 31.62177660168379,
-      31.62177660168379, 31.62177660168379, 31.62177660168379,
-      31.62177660168379, 31.62177660168379, 31.62177660168379,
-      31.62177660168379, 31.62177660168379, 31.62177660168379,
-      31.62177660168379, 31.62177660168379, 31.62177660168379,
-      31.62177660168379, 31.62177660168379, 31.62177660168379,
-      31.62177660168379, 31.62177660168379, 31.62177660168379,
-      31.62177660168379, 31.62177660168379, 31.62177660168379, 999.999, 999.999,
-      999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999,
-      999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999,
-      999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999;
+  a << 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+      0.0, 0.0, 0.0, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
+      0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
+      0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
+      0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
+      0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
+      0.03062277660168379, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999,
+      0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 31.62177660168379,
+      31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379,
+      31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379,
+      31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379,
+      31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379,
+      999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999,
+      999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999,
+      999.999;
 
-  b << 0.0, 0.0, 0.0, 0.0, 0.0, 0.03062277660168379, 0.03062277660168379,
-      0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.999,
-      0.999, 0.999, 0.999, 0.999, 31.62177660168379, 31.62177660168379,
-      31.62177660168379, 31.62177660168379, 31.62177660168379, 999.999, 999.999,
-      999.999, 999.999, 999.999, 0.0, 0.0, 0.0, 0.0, 0.0, 0.03062277660168379,
-      0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
-      0.03062277660168379, 0.999, 0.999, 0.999, 0.999, 0.999, 31.62177660168379,
-      31.62177660168379, 31.62177660168379, 31.62177660168379,
-      31.62177660168379, 999.999, 999.999, 999.999, 999.999, 999.999, 0.0, 0.0,
-      0.0, 0.0, 0.0, 0.03062277660168379, 0.03062277660168379,
-      0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.999,
-      0.999, 0.999, 0.999, 0.999, 31.62177660168379, 31.62177660168379,
-      31.62177660168379, 31.62177660168379, 31.62177660168379, 999.999, 999.999,
-      999.999, 999.999, 999.999, 0.0, 0.0, 0.0, 0.0, 0.0, 0.03062277660168379,
-      0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
-      0.03062277660168379, 0.999, 0.999, 0.999, 0.999, 0.999, 31.62177660168379,
-      31.62177660168379, 31.62177660168379, 31.62177660168379,
-      31.62177660168379, 999.999, 999.999, 999.999, 999.999, 999.999, 0.0, 0.0,
-      0.0, 0.0, 0.0, 0.03062277660168379, 0.03062277660168379,
-      0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.999,
-      0.999, 0.999, 0.999, 0.999, 31.62177660168379, 31.62177660168379,
-      31.62177660168379, 31.62177660168379, 31.62177660168379, 999.999, 999.999,
-      999.999, 999.999, 999.999;
+  b << 0.0, 0.0, 0.0, 0.0, 0.0, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
+      0.03062277660168379, 0.999, 0.999, 0.999, 0.999, 0.999, 31.62177660168379, 31.62177660168379, 31.62177660168379,
+      31.62177660168379, 31.62177660168379, 999.999, 999.999, 999.999, 999.999, 999.999, 0.0, 0.0, 0.0, 0.0, 0.0,
+      0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.999,
+      0.999, 0.999, 0.999, 0.999, 31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379,
+      31.62177660168379, 999.999, 999.999, 999.999, 999.999, 999.999, 0.0, 0.0, 0.0, 0.0, 0.0, 0.03062277660168379,
+      0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.999, 0.999, 0.999, 0.999,
+      0.999, 31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379, 999.999,
+      999.999, 999.999, 999.999, 999.999, 0.0, 0.0, 0.0, 0.0, 0.0, 0.03062277660168379, 0.03062277660168379,
+      0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.999, 0.999, 0.999, 0.999, 0.999,
+      31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379, 999.999, 999.999,
+      999.999, 999.999, 999.999, 0.0, 0.0, 0.0, 0.0, 0.0, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
+      0.03062277660168379, 0.03062277660168379, 0.999, 0.999, 0.999, 0.999, 0.999, 31.62177660168379, 31.62177660168379,
+      31.62177660168379, 31.62177660168379, 31.62177660168379, 999.999, 999.999, 999.999, 999.999, 999.999;
 
-  x << -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8,
-      1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5,
-      0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2,
-      0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1,
-      0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1,
-      -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8,
-      1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5,
-      0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2,
-      0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1;
+  x << -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1,
+      0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5,
+      0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1,
+      -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2,
+      0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8,
+      1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1;
 
-  v << nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
-      nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
-      nan, nan, 0.47972119876364683, 0.5, 0.5202788012363533, nan, nan,
-      0.9518683957740043, 0.9789663010413743, 0.9931729188073435, nan, nan,
-      0.999995949033062, 0.9999999999993698, 0.9999999999999999, nan, nan,
-      0.9999999999999999, 0.9999999999999999, 0.9999999999999999, nan, nan, nan,
-      nan, nan, nan, nan, 0.006827081192655869, 0.0210336989586256,
-      0.04813160422599567, nan, nan, 0.20014344256217678, 0.5000000000000001,
-      0.7998565574378232, nan, nan, 0.9991401428435834, 0.999999999698403,
-      0.9999999999999999, nan, nan, 0.9999999999999999, 0.9999999999999999,
-      0.9999999999999999, nan, nan, nan, nan, nan, nan, nan,
-      1.0646600232370887e-25, 6.301722877826246e-13, 4.050966937974938e-06, nan,
-      nan, 7.864342668429763e-23, 3.015969667594166e-10, 0.0008598571564165444,
-      nan, nan, 6.031987710123844e-08, 0.5000000000000007, 0.9999999396801229,
-      nan, nan, 0.9999999999999999, 0.9999999999999999, 0.9999999999999999, nan,
-      nan, nan, nan, nan, nan, nan, 0.0, 7.029920380986636e-306,
-      2.2450728208591345e-101, nan, nan, 0.0, 9.275871147869727e-302,
-      1.2232913026152827e-97, nan, nan, 0.0, 3.0891393081932924e-252,
-      2.9303043666183996e-60, nan, nan, 2.248913486879199e-196,
-      0.5000000000004947, 0.9999999999999999, nan;
+  v << nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
+      nan, nan, nan, nan, nan, nan, nan, nan, nan, 0.47972119876364683, 0.5, 0.5202788012363533, nan, nan,
+      0.9518683957740043, 0.9789663010413743, 0.9931729188073435, nan, nan, 0.999995949033062, 0.9999999999993698,
+      0.9999999999999999, nan, nan, 0.9999999999999999, 0.9999999999999999, 0.9999999999999999, nan, nan, nan, nan, nan,
+      nan, nan, 0.006827081192655869, 0.0210336989586256, 0.04813160422599567, nan, nan, 0.20014344256217678,
+      0.5000000000000001, 0.7998565574378232, nan, nan, 0.9991401428435834, 0.999999999698403, 0.9999999999999999, nan,
+      nan, 0.9999999999999999, 0.9999999999999999, 0.9999999999999999, nan, nan, nan, nan, nan, nan, nan,
+      1.0646600232370887e-25, 6.301722877826246e-13, 4.050966937974938e-06, nan, nan, 7.864342668429763e-23,
+      3.015969667594166e-10, 0.0008598571564165444, nan, nan, 6.031987710123844e-08, 0.5000000000000007,
+      0.9999999396801229, nan, nan, 0.9999999999999999, 0.9999999999999999, 0.9999999999999999, nan, nan, nan, nan, nan,
+      nan, nan, 0.0, 7.029920380986636e-306, 2.2450728208591345e-101, nan, nan, 0.0, 9.275871147869727e-302,
+      1.2232913026152827e-97, nan, nan, 0.0, 3.0891393081932924e-252, 2.9303043666183996e-60, nan, nan,
+      2.248913486879199e-196, 0.5000000000004947, 0.9999999999999999, nan;
 
   for (int i = 0; i < 125; ++i) {
     in_x(i) = x(i);
@@ -1296,8 +1222,7 @@
 }
 
 template <typename Scalar>
-void test_gpu_i0e()
-{
+void test_gpu_i0e() {
   Tensor<Scalar, 1> in_x(21);
   Tensor<Scalar, 1> out(21);
   Tensor<Scalar, 1> expected_out(21);
@@ -1306,15 +1231,13 @@
   Array<Scalar, 1, Dynamic> in_x_array(21);
   Array<Scalar, 1, Dynamic> expected_out_array(21);
 
-  in_x_array << -20.0, -18.0, -16.0, -14.0, -12.0, -10.0, -8.0, -6.0, -4.0,
-      -2.0, 0.0, 2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0;
+  in_x_array << -20.0, -18.0, -16.0, -14.0, -12.0, -10.0, -8.0, -6.0, -4.0, -2.0, 0.0, 2.0, 4.0, 6.0, 8.0, 10.0, 12.0,
+      14.0, 16.0, 18.0, 20.0;
 
-  expected_out_array << 0.0897803118848, 0.0947062952128, 0.100544127361,
-      0.107615251671, 0.116426221213, 0.127833337163, 0.143431781857,
-      0.16665743264, 0.207001921224, 0.308508322554, 1.0, 0.308508322554,
-      0.207001921224, 0.16665743264, 0.143431781857, 0.127833337163,
-      0.116426221213, 0.107615251671, 0.100544127361, 0.0947062952128,
-      0.0897803118848;
+  expected_out_array << 0.0897803118848, 0.0947062952128, 0.100544127361, 0.107615251671, 0.116426221213,
+      0.127833337163, 0.143431781857, 0.16665743264, 0.207001921224, 0.308508322554, 1.0, 0.308508322554,
+      0.207001921224, 0.16665743264, 0.143431781857, 0.127833337163, 0.116426221213, 0.107615251671, 0.100544127361,
+      0.0947062952128, 0.0897803118848;
 
   for (int i = 0; i < 21; ++i) {
     in_x(i) = in_x_array(i);
@@ -1338,8 +1261,7 @@
 
   gpu_out.device(gpu_device) = gpu_in.bessel_i0e();
 
-  assert(gpuMemcpyAsync(out.data(), d_out, bytes, gpuMemcpyDeviceToHost,
-                         gpu_device.stream()) == gpuSuccess);
+  assert(gpuMemcpyAsync(out.data(), d_out, bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) == gpuSuccess);
   assert(gpuStreamSynchronize(gpu_device.stream()) == gpuSuccess);
 
   for (int i = 0; i < 21; ++i) {
@@ -1351,8 +1273,7 @@
 }
 
 template <typename Scalar>
-void test_gpu_i1e()
-{
+void test_gpu_i1e() {
   Tensor<Scalar, 1> in_x(21);
   Tensor<Scalar, 1> out(21);
   Tensor<Scalar, 1> expected_out(21);
@@ -1361,15 +1282,13 @@
   Array<Scalar, 1, Dynamic> in_x_array(21);
   Array<Scalar, 1, Dynamic> expected_out_array(21);
 
-  in_x_array << -20.0, -18.0, -16.0, -14.0, -12.0, -10.0, -8.0, -6.0, -4.0,
-      -2.0, 0.0, 2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0;
+  in_x_array << -20.0, -18.0, -16.0, -14.0, -12.0, -10.0, -8.0, -6.0, -4.0, -2.0, 0.0, 2.0, 4.0, 6.0, 8.0, 10.0, 12.0,
+      14.0, 16.0, 18.0, 20.0;
 
-  expected_out_array << -0.0875062221833, -0.092036796872, -0.0973496147565,
-      -0.103697667463, -0.11146429929, -0.121262681384, -0.134142493293,
-      -0.152051459309, -0.178750839502, -0.215269289249, 0.0, 0.215269289249,
-      0.178750839502, 0.152051459309, 0.134142493293, 0.121262681384,
-      0.11146429929, 0.103697667463, 0.0973496147565, 0.092036796872,
-      0.0875062221833;
+  expected_out_array << -0.0875062221833, -0.092036796872, -0.0973496147565, -0.103697667463, -0.11146429929,
+      -0.121262681384, -0.134142493293, -0.152051459309, -0.178750839502, -0.215269289249, 0.0, 0.215269289249,
+      0.178750839502, 0.152051459309, 0.134142493293, 0.121262681384, 0.11146429929, 0.103697667463, 0.0973496147565,
+      0.092036796872, 0.0875062221833;
 
   for (int i = 0; i < 21; ++i) {
     in_x(i) = in_x_array(i);
@@ -1393,8 +1312,7 @@
 
   gpu_out.device(gpu_device) = gpu_in.bessel_i1e();
 
-  assert(gpuMemcpyAsync(out.data(), d_out, bytes, gpuMemcpyDeviceToHost,
-                         gpu_device.stream()) == gpuSuccess);
+  assert(gpuMemcpyAsync(out.data(), d_out, bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) == gpuSuccess);
   assert(gpuStreamSynchronize(gpu_device.stream()) == gpuSuccess);
 
   for (int i = 0; i < 21; ++i) {
@@ -1406,8 +1324,7 @@
 }
 
 template <typename Scalar>
-void test_gpu_igamma_der_a()
-{
+void test_gpu_igamma_der_a() {
   Tensor<Scalar, 1> in_x(30);
   Tensor<Scalar, 1> in_a(30);
   Tensor<Scalar, 1> out(30);
@@ -1420,26 +1337,20 @@
 
   // See special_functions.cpp for the Python code that generates the test data.
 
-  in_a_array << 0.01, 0.01, 0.01, 0.01, 0.01, 0.1, 0.1, 0.1, 0.1, 0.1, 1.0, 1.0,
-      1.0, 1.0, 1.0, 10.0, 10.0, 10.0, 10.0, 10.0, 100.0, 100.0, 100.0, 100.0,
-      100.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0;
+  in_a_array << 0.01, 0.01, 0.01, 0.01, 0.01, 0.1, 0.1, 0.1, 0.1, 0.1, 1.0, 1.0, 1.0, 1.0, 1.0, 10.0, 10.0, 10.0, 10.0,
+      10.0, 100.0, 100.0, 100.0, 100.0, 100.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0;
 
-  in_x_array << 1.25668890405e-26, 1.17549435082e-38, 1.20938905072e-05,
-      1.17549435082e-38, 1.17549435082e-38, 5.66572070696e-16, 0.0132865061065,
-      0.0200034203853, 6.29263709118e-17, 1.37160367764e-06, 0.333412038288,
-      1.18135687766, 0.580629033777, 0.170631439426, 0.786686768458,
-      7.63873279537, 13.1944344379, 11.896042354, 10.5830172417, 10.5020942233,
-      92.8918587747, 95.003720371, 86.3715926467, 96.0330217672, 82.6389930677,
+  in_x_array << 1.25668890405e-26, 1.17549435082e-38, 1.20938905072e-05, 1.17549435082e-38, 1.17549435082e-38,
+      5.66572070696e-16, 0.0132865061065, 0.0200034203853, 6.29263709118e-17, 1.37160367764e-06, 0.333412038288,
+      1.18135687766, 0.580629033777, 0.170631439426, 0.786686768458, 7.63873279537, 13.1944344379, 11.896042354,
+      10.5830172417, 10.5020942233, 92.8918587747, 95.003720371, 86.3715926467, 96.0330217672, 82.6389930677,
       968.702906754, 969.463546828, 1001.79726022, 955.047416547, 1044.27458568;
 
-  expected_out_array << -32.7256441441, -36.4394150514, -9.66467612263,
-      -36.4394150514, -36.4394150514, -1.0891900302, -2.66351229645,
-      -2.48666868596, -0.929700494428, -3.56327722764, -0.455320135314,
-      -0.391437214323, -0.491352055991, -0.350454834292, -0.471773162921,
-      -0.104084440522, -0.0723646747909, -0.0992828975532, -0.121638215446,
-      -0.122619605294, -0.0317670267286, -0.0359974812869, -0.0154359225363,
-      -0.0375775365921, -0.00794899153653, -0.00777303219211, -0.00796085782042,
-      -0.0125850719397, -0.00455500206958, -0.00476436993148;
+  expected_out_array << -32.7256441441, -36.4394150514, -9.66467612263, -36.4394150514, -36.4394150514, -1.0891900302,
+      -2.66351229645, -2.48666868596, -0.929700494428, -3.56327722764, -0.455320135314, -0.391437214323,
+      -0.491352055991, -0.350454834292, -0.471773162921, -0.104084440522, -0.0723646747909, -0.0992828975532,
+      -0.121638215446, -0.122619605294, -0.0317670267286, -0.0359974812869, -0.0154359225363, -0.0375775365921,
+      -0.00794899153653, -0.00777303219211, -0.00796085782042, -0.0125850719397, -0.00455500206958, -0.00476436993148;
 
   for (int i = 0; i < 30; ++i) {
     in_x(i) = in_x_array(i);
@@ -1468,8 +1379,7 @@
 
   gpu_out.device(gpu_device) = gpu_a.igamma_der_a(gpu_x);
 
-  assert(gpuMemcpyAsync(out.data(), d_out, bytes, gpuMemcpyDeviceToHost,
-                         gpu_device.stream()) == gpuSuccess);
+  assert(gpuMemcpyAsync(out.data(), d_out, bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) == gpuSuccess);
   assert(gpuStreamSynchronize(gpu_device.stream()) == gpuSuccess);
 
   for (int i = 0; i < 30; ++i) {
@@ -1482,8 +1392,7 @@
 }
 
 template <typename Scalar>
-void test_gpu_gamma_sample_der_alpha()
-{
+void test_gpu_gamma_sample_der_alpha() {
   Tensor<Scalar, 1> in_alpha(30);
   Tensor<Scalar, 1> in_sample(30);
   Tensor<Scalar, 1> out(30);
@@ -1496,26 +1405,20 @@
 
   // See special_functions.cpp for the Python code that generates the test data.
 
-  in_alpha_array << 0.01, 0.01, 0.01, 0.01, 0.01, 0.1, 0.1, 0.1, 0.1, 0.1, 1.0,
-      1.0, 1.0, 1.0, 1.0, 10.0, 10.0, 10.0, 10.0, 10.0, 100.0, 100.0, 100.0,
-      100.0, 100.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0;
+  in_alpha_array << 0.01, 0.01, 0.01, 0.01, 0.01, 0.1, 0.1, 0.1, 0.1, 0.1, 1.0, 1.0, 1.0, 1.0, 1.0, 10.0, 10.0, 10.0,
+      10.0, 10.0, 100.0, 100.0, 100.0, 100.0, 100.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0;
 
-  in_sample_array << 1.25668890405e-26, 1.17549435082e-38, 1.20938905072e-05,
-      1.17549435082e-38, 1.17549435082e-38, 5.66572070696e-16, 0.0132865061065,
-      0.0200034203853, 6.29263709118e-17, 1.37160367764e-06, 0.333412038288,
-      1.18135687766, 0.580629033777, 0.170631439426, 0.786686768458,
-      7.63873279537, 13.1944344379, 11.896042354, 10.5830172417, 10.5020942233,
-      92.8918587747, 95.003720371, 86.3715926467, 96.0330217672, 82.6389930677,
+  in_sample_array << 1.25668890405e-26, 1.17549435082e-38, 1.20938905072e-05, 1.17549435082e-38, 1.17549435082e-38,
+      5.66572070696e-16, 0.0132865061065, 0.0200034203853, 6.29263709118e-17, 1.37160367764e-06, 0.333412038288,
+      1.18135687766, 0.580629033777, 0.170631439426, 0.786686768458, 7.63873279537, 13.1944344379, 11.896042354,
+      10.5830172417, 10.5020942233, 92.8918587747, 95.003720371, 86.3715926467, 96.0330217672, 82.6389930677,
       968.702906754, 969.463546828, 1001.79726022, 955.047416547, 1044.27458568;
 
-  expected_out_array << 7.42424742367e-23, 1.02004297287e-34, 0.0130155240738,
-      1.02004297287e-34, 1.02004297287e-34, 1.96505168277e-13, 0.525575786243,
-      0.713903991771, 2.32077561808e-14, 0.000179348049886, 0.635500453302,
-      1.27561284917, 0.878125852156, 0.41565819538, 1.03606488534,
-      0.885964824887, 1.16424049334, 1.10764479598, 1.04590810812,
-      1.04193666963, 0.965193152414, 0.976217589464, 0.93008035061,
-      0.98153216096, 0.909196397698, 0.98434963993, 0.984738050206,
-      1.00106492525, 0.97734200649, 1.02198794179;
+  expected_out_array << 7.42424742367e-23, 1.02004297287e-34, 0.0130155240738, 1.02004297287e-34, 1.02004297287e-34,
+      1.96505168277e-13, 0.525575786243, 0.713903991771, 2.32077561808e-14, 0.000179348049886, 0.635500453302,
+      1.27561284917, 0.878125852156, 0.41565819538, 1.03606488534, 0.885964824887, 1.16424049334, 1.10764479598,
+      1.04590810812, 1.04193666963, 0.965193152414, 0.976217589464, 0.93008035061, 0.98153216096, 0.909196397698,
+      0.98434963993, 0.984738050206, 1.00106492525, 0.97734200649, 1.02198794179;
 
   for (int i = 0; i < 30; ++i) {
     in_alpha(i) = in_alpha_array(i);
@@ -1544,8 +1447,7 @@
 
   gpu_out.device(gpu_device) = gpu_alpha.gamma_sample_der_alpha(gpu_sample);
 
-  assert(gpuMemcpyAsync(out.data(), d_out, bytes, gpuMemcpyDeviceToHost,
-                         gpu_device.stream()) == gpuSuccess);
+  assert(gpuMemcpyAsync(out.data(), d_out, bytes, gpuMemcpyDeviceToHost, gpu_device.stream()) == gpuSuccess);
   assert(gpuStreamSynchronize(gpu_device.stream()) == gpuSuccess);
 
   for (int i = 0; i < 30; ++i) {
@@ -1557,13 +1459,11 @@
   gpuFree(d_out);
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_gpu)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_gpu) {
   CALL_SUBTEST_1(test_gpu_nullary());
   CALL_SUBTEST_1(test_gpu_nullary_max_size<int16_t>());
   CALL_SUBTEST_1(test_gpu_nullary_max_size<int32_t>());
-  CALL_SUBTEST_1((test_gpu_nullary_max_size<
-                  int64_t, (std::numeric_limits<int32_t>::max)() + 100ll>()));
+  CALL_SUBTEST_1((test_gpu_nullary_max_size<int64_t, (std::numeric_limits<int32_t>::max)() + 100ll>()));
   CALL_SUBTEST_1(test_gpu_elementwise_small());
   CALL_SUBTEST_1(test_gpu_elementwise());
   CALL_SUBTEST_1(test_gpu_props());
@@ -1577,8 +1477,8 @@
   CALL_SUBTEST_3(test_gpu_convolution_2d<ColMajor>());
   CALL_SUBTEST_3(test_gpu_convolution_2d<RowMajor>());
 #if !defined(EIGEN_USE_HIP)
-// disable these tests on HIP for now.
-// they hang..need to investigate and fix
+  // disable these tests on HIP for now.
+  // they hang..need to investigate and fix
   CALL_SUBTEST_3(test_gpu_convolution_3d<ColMajor>());
   CALL_SUBTEST_3(test_gpu_convolution_3d<RowMajor>());
 #endif
@@ -1603,7 +1503,7 @@
 
   CALL_SUBTEST_4(test_gpu_erfc<float>(1.0f));
   // CALL_SUBTEST(test_gpu_erfc<float>(100.0f));
-  CALL_SUBTEST_4(test_gpu_erfc<float>(5.0f)); // GPU erfc lacks precision for large inputs
+  CALL_SUBTEST_4(test_gpu_erfc<float>(5.0f));  // GPU erfc lacks precision for large inputs
   CALL_SUBTEST_4(test_gpu_erfc<float>(0.01f));
   CALL_SUBTEST_4(test_gpu_erfc<float>(0.001f));
 
@@ -1614,12 +1514,12 @@
 
   CALL_SUBTEST_4(test_gpu_erfc<double>(1.0));
   // CALL_SUBTEST(test_gpu_erfc<double>(100.0));
-  CALL_SUBTEST_4(test_gpu_erfc<double>(5.0)); // GPU erfc lacks precision for large inputs
+  CALL_SUBTEST_4(test_gpu_erfc<double>(5.0));  // GPU erfc lacks precision for large inputs
   CALL_SUBTEST_4(test_gpu_erfc<double>(0.01));
   CALL_SUBTEST_4(test_gpu_erfc<double>(0.001));
 
 #if !defined(EIGEN_USE_HIP)
-// disable these tests on HIP for now.
+  // disable these tests on HIP for now.
 
   CALL_SUBTEST_5(test_gpu_ndtri<float>());
   CALL_SUBTEST_5(test_gpu_ndtri<double>());
@@ -1641,7 +1541,7 @@
   CALL_SUBTEST_5(test_gpu_igammac<double>());
 
 #if !defined(EIGEN_USE_HIP)
-// disable these tests on HIP for now.
+  // disable these tests on HIP for now.
   CALL_SUBTEST_6(test_gpu_betainc<float>());
   CALL_SUBTEST_6(test_gpu_betainc<double>());
 
diff --git a/unsupported/test/cxx11_tensor_ifft.cpp b/unsupported/test/cxx11_tensor_ifft.cpp
index c20edd9..3433aea 100644
--- a/unsupported/test/cxx11_tensor_ifft.cpp
+++ b/unsupported/test/cxx11_tensor_ifft.cpp
@@ -58,8 +58,9 @@
 
   for (int i = 0; i < dim0; ++i) {
     for (int j = 0; j < dim1; ++j) {
-      //std::cout << "[" << i << "][" << j << "]" <<  "  Original data: " << tensor(i,j) << " Transformed data:" << tensor_after_fft_ifft(i,j) << std::endl;
-      VERIFY_IS_APPROX(static_cast<float>(tensor(i,j)), static_cast<float>(std::real(tensor_after_fft_ifft(i,j))));
+      // std::cout << "[" << i << "][" << j << "]" <<  "  Original data: " << tensor(i,j) << " Transformed data:" <<
+      // tensor_after_fft_ifft(i,j) << std::endl;
+      VERIFY_IS_APPROX(static_cast<float>(tensor(i, j)), static_cast<float>(std::real(tensor_after_fft_ifft(i, j))));
     }
   }
 }
@@ -90,7 +91,8 @@
   for (int i = 0; i < dim0; ++i) {
     for (int j = 0; j < dim1; ++j) {
       for (int k = 0; k < dim2; ++k) {
-        VERIFY_IS_APPROX(static_cast<float>(tensor(i,j,k)), static_cast<float>(std::real(tensor_after_fft_ifft(i,j,k))));
+        VERIFY_IS_APPROX(static_cast<float>(tensor(i, j, k)),
+                         static_cast<float>(std::real(tensor_after_fft_ifft(i, j, k))));
       }
     }
   }
@@ -124,7 +126,8 @@
     for (int j = 0; j < dim1; ++j) {
       for (int k = 0; k < dim2; ++k) {
         for (int l = 0; l < dim3; ++l) {
-          VERIFY_IS_APPROX(static_cast<float>(tensor(i,j,k,l)), static_cast<float>(tensor_after_fft_ifft(i,j,k,l)));
+          VERIFY_IS_APPROX(static_cast<float>(tensor(i, j, k, l)),
+                           static_cast<float>(tensor_after_fft_ifft(i, j, k, l)));
         }
       }
     }
@@ -135,20 +138,20 @@
   CALL_SUBTEST(test_1D_fft_ifft_invariant<ColMajor>(4));
   CALL_SUBTEST(test_1D_fft_ifft_invariant<ColMajor>(16));
   CALL_SUBTEST(test_1D_fft_ifft_invariant<ColMajor>(32));
-  CALL_SUBTEST(test_1D_fft_ifft_invariant<ColMajor>(1024*1024));
+  CALL_SUBTEST(test_1D_fft_ifft_invariant<ColMajor>(1024 * 1024));
 
-  CALL_SUBTEST(test_2D_fft_ifft_invariant<ColMajor>(4,4));
-  CALL_SUBTEST(test_2D_fft_ifft_invariant<ColMajor>(8,16));
-  CALL_SUBTEST(test_2D_fft_ifft_invariant<ColMajor>(16,32));
-  CALL_SUBTEST(test_2D_fft_ifft_invariant<ColMajor>(1024,1024));
+  CALL_SUBTEST(test_2D_fft_ifft_invariant<ColMajor>(4, 4));
+  CALL_SUBTEST(test_2D_fft_ifft_invariant<ColMajor>(8, 16));
+  CALL_SUBTEST(test_2D_fft_ifft_invariant<ColMajor>(16, 32));
+  CALL_SUBTEST(test_2D_fft_ifft_invariant<ColMajor>(1024, 1024));
 
-  CALL_SUBTEST(test_3D_fft_ifft_invariant<ColMajor>(4,4,4));
-  CALL_SUBTEST(test_3D_fft_ifft_invariant<ColMajor>(8,16,32));
-  CALL_SUBTEST(test_3D_fft_ifft_invariant<ColMajor>(16,4,8));
-  CALL_SUBTEST(test_3D_fft_ifft_invariant<ColMajor>(256,256,256));
+  CALL_SUBTEST(test_3D_fft_ifft_invariant<ColMajor>(4, 4, 4));
+  CALL_SUBTEST(test_3D_fft_ifft_invariant<ColMajor>(8, 16, 32));
+  CALL_SUBTEST(test_3D_fft_ifft_invariant<ColMajor>(16, 4, 8));
+  CALL_SUBTEST(test_3D_fft_ifft_invariant<ColMajor>(256, 256, 256));
 
-  CALL_SUBTEST(test_sub_fft_ifft_invariant<ColMajor>(4,4,4,4));
-  CALL_SUBTEST(test_sub_fft_ifft_invariant<ColMajor>(8,16,32,64));
-  CALL_SUBTEST(test_sub_fft_ifft_invariant<ColMajor>(16,4,8,12));
-  CALL_SUBTEST(test_sub_fft_ifft_invariant<ColMajor>(64,64,64,64));
+  CALL_SUBTEST(test_sub_fft_ifft_invariant<ColMajor>(4, 4, 4, 4));
+  CALL_SUBTEST(test_sub_fft_ifft_invariant<ColMajor>(8, 16, 32, 64));
+  CALL_SUBTEST(test_sub_fft_ifft_invariant<ColMajor>(16, 4, 8, 12));
+  CALL_SUBTEST(test_sub_fft_ifft_invariant<ColMajor>(64, 64, 64, 64));
 }
diff --git a/unsupported/test/cxx11_tensor_image_op_sycl.cpp b/unsupported/test/cxx11_tensor_image_op_sycl.cpp
index 083c004..2aedaf6 100644
--- a/unsupported/test/cxx11_tensor_image_op_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_image_op_sycl.cpp
@@ -25,59 +25,55 @@
 using Eigen::Tensor;
 using Eigen::TensorMap;
 
-using Eigen::Tensor;
 using Eigen::RowMajor;
+using Eigen::Tensor;
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_image_op_sycl(const Eigen::SyclDevice &sycl_device)
-{
+static void test_image_op_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType sizeDim1 = 245;
   IndexType sizeDim2 = 343;
   IndexType sizeDim3 = 577;
 
-  array<IndexType, 3> input_range ={{sizeDim1, sizeDim2, sizeDim3}};
-  array<IndexType, 3> slice_range ={{sizeDim1-1, sizeDim2, sizeDim3}};
+  array<IndexType, 3> input_range = {{sizeDim1, sizeDim2, sizeDim3}};
+  array<IndexType, 3> slice_range = {{sizeDim1 - 1, sizeDim2, sizeDim3}};
 
-  Tensor<DataType, 3,DataLayout, IndexType> tensor1(input_range);
-  Tensor<DataType, 3,DataLayout, IndexType> tensor2(input_range);
+  Tensor<DataType, 3, DataLayout, IndexType> tensor1(input_range);
+  Tensor<DataType, 3, DataLayout, IndexType> tensor2(input_range);
   Tensor<DataType, 3, DataLayout, IndexType> tensor3(slice_range);
   Tensor<DataType, 3, DataLayout, IndexType> tensor3_cpu(slice_range);
 
-
-
   typedef Eigen::DSizes<IndexType, 3> Index3;
-  Index3 strides1(1L,1L, 1L);
+  Index3 strides1(1L, 1L, 1L);
   Index3 indicesStart1(1L, 0L, 0L);
   Index3 indicesStop1(sizeDim1, sizeDim2, sizeDim3);
 
-  Index3 strides2(1L,1L, 1L);
+  Index3 strides2(1L, 1L, 1L);
   Index3 indicesStart2(0L, 0L, 0L);
-  Index3 indicesStop2(sizeDim1-1, sizeDim2, sizeDim3);
-  Eigen::DSizes<IndexType, 3> sizes(sizeDim1-1,sizeDim2,sizeDim3);
+  Index3 indicesStop2(sizeDim1 - 1, sizeDim2, sizeDim3);
+  Eigen::DSizes<IndexType, 3> sizes(sizeDim1 - 1, sizeDim2, sizeDim3);
 
   tensor1.setRandom();
   tensor2.setRandom();
 
-
-  DataType* gpu_data1  = static_cast<DataType*>(sycl_device.allocate(tensor1.size()*sizeof(DataType)));
-  DataType* gpu_data2  = static_cast<DataType*>(sycl_device.allocate(tensor2.size()*sizeof(DataType)));
-  DataType* gpu_data3  = static_cast<DataType*>(sycl_device.allocate(tensor3.size()*sizeof(DataType)));
+  DataType* gpu_data1 = static_cast<DataType*>(sycl_device.allocate(tensor1.size() * sizeof(DataType)));
+  DataType* gpu_data2 = static_cast<DataType*>(sycl_device.allocate(tensor2.size() * sizeof(DataType)));
+  DataType* gpu_data3 = static_cast<DataType*>(sycl_device.allocate(tensor3.size() * sizeof(DataType)));
 
   TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> gpu1(gpu_data1, input_range);
   TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> gpu2(gpu_data2, input_range);
   TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> gpu3(gpu_data3, slice_range);
 
-  sycl_device.memcpyHostToDevice(gpu_data1, tensor1.data(),(tensor1.size())*sizeof(DataType));
-  sycl_device.memcpyHostToDevice(gpu_data2, tensor2.data(),(tensor2.size())*sizeof(DataType));
-  gpu3.device(sycl_device)= gpu1.slice(indicesStart1, sizes) - gpu2.slice(indicesStart2, sizes);
-  sycl_device.memcpyDeviceToHost(tensor3.data(), gpu_data3,(tensor3.size())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_data1, tensor1.data(), (tensor1.size()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_data2, tensor2.data(), (tensor2.size()) * sizeof(DataType));
+  gpu3.device(sycl_device) = gpu1.slice(indicesStart1, sizes) - gpu2.slice(indicesStart2, sizes);
+  sycl_device.memcpyDeviceToHost(tensor3.data(), gpu_data3, (tensor3.size()) * sizeof(DataType));
 
-  tensor3_cpu = tensor1.stridedSlice(indicesStart1,indicesStop1,strides1) - tensor2.stridedSlice(indicesStart2,indicesStop2,strides2);
+  tensor3_cpu = tensor1.stridedSlice(indicesStart1, indicesStop1, strides1) -
+                tensor2.stridedSlice(indicesStart2, indicesStop2, strides2);
 
-
-  for (IndexType i = 0; i <slice_range[0] ; ++i) {
+  for (IndexType i = 0; i < slice_range[0]; ++i) {
     for (IndexType j = 0; j < slice_range[1]; ++j) {
       for (IndexType k = 0; k < slice_range[2]; ++k) {
-        VERIFY_IS_EQUAL(tensor3_cpu(i,j,k), tensor3(i,j,k));
+        VERIFY_IS_EQUAL(tensor3_cpu(i, j, k), tensor3(i, j, k));
       }
     }
   }
@@ -86,19 +82,19 @@
   sycl_device.deallocate(gpu_data3);
 }
 
-
-template<typename DataType, typename dev_Selector> void sycl_computing_test_per_device(dev_Selector s){
+template <typename DataType, typename dev_Selector>
+void sycl_computing_test_per_device(dev_Selector s) {
   QueueInterface queueInterface(s);
   auto sycl_device = Eigen::SyclDevice(&queueInterface);
   test_image_op_sycl<DataType, RowMajor, int64_t>(sycl_device);
 }
 
 EIGEN_DECLARE_TEST(cxx11_tensor_image_op_sycl) {
-  for (const auto& device :Eigen::get_sycl_supported_devices()) { 
+  for (const auto& device : Eigen::get_sycl_supported_devices()) {
     CALL_SUBTEST(sycl_computing_test_per_device<half>(device));
-   CALL_SUBTEST(sycl_computing_test_per_device<float>(device));
+    CALL_SUBTEST(sycl_computing_test_per_device<float>(device));
 #ifdef EIGEN_SYCL_DOUBLE_SUPPORT
-   CALL_SUBTEST(sycl_computing_test_per_device<double>(device));
+    CALL_SUBTEST(sycl_computing_test_per_device<double>(device));
 #endif
   }
 }
diff --git a/unsupported/test/cxx11_tensor_image_patch.cpp b/unsupported/test/cxx11_tensor_image_patch.cpp
index 862f1f7..55d3c6e 100644
--- a/unsupported/test/cxx11_tensor_image_patch.cpp
+++ b/unsupported/test/cxx11_tensor_image_patch.cpp
@@ -13,9 +13,8 @@
 
 using Eigen::Tensor;
 
-void test_simple_patch()
-{
-  Tensor<float, 4> tensor(2,3,5,7);
+void test_simple_patch() {
+  Tensor<float, 4> tensor(2, 3, 5, 7);
   tensor.setRandom();
   Tensor<float, 4, RowMajor> tensor_row_major = tensor.swap_layout();
   VERIFY_IS_EQUAL(tensor.dimension(0), tensor_row_major.dimension(3));
@@ -29,14 +28,14 @@
   VERIFY_IS_EQUAL(single_pixel_patch.dimension(0), 2);
   VERIFY_IS_EQUAL(single_pixel_patch.dimension(1), 1);
   VERIFY_IS_EQUAL(single_pixel_patch.dimension(2), 1);
-  VERIFY_IS_EQUAL(single_pixel_patch.dimension(3), 3*5);
+  VERIFY_IS_EQUAL(single_pixel_patch.dimension(3), 3 * 5);
   VERIFY_IS_EQUAL(single_pixel_patch.dimension(4), 7);
 
   // Single pixel patch: RowMajor
   Tensor<float, 5, RowMajor> single_pixel_patch_row_major;
   single_pixel_patch_row_major = tensor_row_major.extract_image_patches(1, 1);
   VERIFY_IS_EQUAL(single_pixel_patch_row_major.dimension(0), 7);
-  VERIFY_IS_EQUAL(single_pixel_patch_row_major.dimension(1), 3*5);
+  VERIFY_IS_EQUAL(single_pixel_patch_row_major.dimension(1), 3 * 5);
   VERIFY_IS_EQUAL(single_pixel_patch_row_major.dimension(2), 1);
   VERIFY_IS_EQUAL(single_pixel_patch_row_major.dimension(3), 1);
   VERIFY_IS_EQUAL(single_pixel_patch_row_major.dimension(4), 2);
@@ -44,22 +43,18 @@
   for (int i = 0; i < tensor.size(); ++i) {
     // ColMajor
     if (tensor.data()[i] != single_pixel_patch.data()[i]) {
-      std::cout << "Mismatch detected at index " << i << " : "
-           << tensor.data()[i] << " vs " << single_pixel_patch.data()[i]
-           << std::endl;
+      std::cout << "Mismatch detected at index " << i << " : " << tensor.data()[i] << " vs "
+                << single_pixel_patch.data()[i] << std::endl;
     }
     VERIFY_IS_EQUAL(single_pixel_patch.data()[i], tensor.data()[i]);
     // RowMajor
     if (tensor_row_major.data()[i] != single_pixel_patch_row_major.data()[i]) {
-      std::cout << "Mismatch detected at index " << i << " : "
-           << tensor.data()[i] << " vs "
-           << single_pixel_patch_row_major.data()[i] << std::endl;
+      std::cout << "Mismatch detected at index " << i << " : " << tensor.data()[i] << " vs "
+                << single_pixel_patch_row_major.data()[i] << std::endl;
     }
-    VERIFY_IS_EQUAL(single_pixel_patch_row_major.data()[i],
-                    tensor_row_major.data()[i]);
+    VERIFY_IS_EQUAL(single_pixel_patch_row_major.data()[i], tensor_row_major.data()[i]);
     VERIFY_IS_EQUAL(tensor.data()[i], tensor_row_major.data()[i]);
-    VERIFY_IS_EQUAL(single_pixel_patch.data()[i],
-                    single_pixel_patch_row_major.data()[i]);
+    VERIFY_IS_EQUAL(single_pixel_patch.data()[i], single_pixel_patch_row_major.data()[i]);
   }
 
   // Entire image patch: ColMajor
@@ -68,45 +63,43 @@
   VERIFY_IS_EQUAL(entire_image_patch.dimension(0), 2);
   VERIFY_IS_EQUAL(entire_image_patch.dimension(1), 3);
   VERIFY_IS_EQUAL(entire_image_patch.dimension(2), 5);
-  VERIFY_IS_EQUAL(entire_image_patch.dimension(3), 3*5);
+  VERIFY_IS_EQUAL(entire_image_patch.dimension(3), 3 * 5);
   VERIFY_IS_EQUAL(entire_image_patch.dimension(4), 7);
 
   // Entire image patch: RowMajor
   Tensor<float, 5, RowMajor> entire_image_patch_row_major;
   entire_image_patch_row_major = tensor_row_major.extract_image_patches(3, 5);
   VERIFY_IS_EQUAL(entire_image_patch_row_major.dimension(0), 7);
-  VERIFY_IS_EQUAL(entire_image_patch_row_major.dimension(1), 3*5);
+  VERIFY_IS_EQUAL(entire_image_patch_row_major.dimension(1), 3 * 5);
   VERIFY_IS_EQUAL(entire_image_patch_row_major.dimension(2), 5);
   VERIFY_IS_EQUAL(entire_image_patch_row_major.dimension(3), 3);
   VERIFY_IS_EQUAL(entire_image_patch_row_major.dimension(4), 2);
 
   for (int i = 0; i < 3; ++i) {
     for (int j = 0; j < 5; ++j) {
-      int patchId = i+3*j;
+      int patchId = i + 3 * j;
       for (int r = 0; r < 3; ++r) {
         for (int c = 0; c < 5; ++c) {
           for (int d = 0; d < 2; ++d) {
             for (int b = 0; b < 7; ++b) {
               float expected = 0.0f;
               float expected_row_major = 0.0f;
-              if (r-1+i >= 0 && c-2+j >= 0 && r-1+i < 3 && c-2+j < 5) {
-                expected = tensor(d, r-1+i, c-2+j, b);
-                expected_row_major = tensor_row_major(b, c-2+j, r-1+i, d);
+              if (r - 1 + i >= 0 && c - 2 + j >= 0 && r - 1 + i < 3 && c - 2 + j < 5) {
+                expected = tensor(d, r - 1 + i, c - 2 + j, b);
+                expected_row_major = tensor_row_major(b, c - 2 + j, r - 1 + i, d);
               }
               // ColMajor
               if (entire_image_patch(d, r, c, patchId, b) != expected) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(entire_image_patch(d, r, c, patchId, b), expected);
               // RowMajor
-              if (entire_image_patch_row_major(b, patchId, c, r, d) !=
-                  expected_row_major) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j
-                     << " r=" << r << " c=" << c << " d=" << d << " b=" << b
-                     << std::endl;
+              if (entire_image_patch_row_major(b, patchId, c, r, d) != expected_row_major) {
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
-              VERIFY_IS_EQUAL(entire_image_patch_row_major(b, patchId, c, r, d),
-                              expected_row_major);
+              VERIFY_IS_EQUAL(entire_image_patch_row_major(b, patchId, c, r, d), expected_row_major);
               // Check that ColMajor and RowMajor agree.
               VERIFY_IS_EQUAL(expected, expected_row_major);
             }
@@ -122,19 +115,18 @@
   VERIFY_IS_EQUAL(twod_patch.dimension(0), 2);
   VERIFY_IS_EQUAL(twod_patch.dimension(1), 2);
   VERIFY_IS_EQUAL(twod_patch.dimension(2), 2);
-  VERIFY_IS_EQUAL(twod_patch.dimension(3), 3*5);
+  VERIFY_IS_EQUAL(twod_patch.dimension(3), 3 * 5);
   VERIFY_IS_EQUAL(twod_patch.dimension(4), 7);
 
   // 2D patch: RowMajor
   Tensor<float, 5, RowMajor> twod_patch_row_major;
   twod_patch_row_major = tensor_row_major.extract_image_patches(2, 2);
   VERIFY_IS_EQUAL(twod_patch_row_major.dimension(0), 7);
-  VERIFY_IS_EQUAL(twod_patch_row_major.dimension(1), 3*5);
+  VERIFY_IS_EQUAL(twod_patch_row_major.dimension(1), 3 * 5);
   VERIFY_IS_EQUAL(twod_patch_row_major.dimension(2), 2);
   VERIFY_IS_EQUAL(twod_patch_row_major.dimension(3), 2);
   VERIFY_IS_EQUAL(twod_patch_row_major.dimension(4), 2);
 
-
   // Based on the calculation described in TensorTraits.h, padding happens to be 0.
   int row_padding = 0;
   int col_padding = 0;
@@ -142,31 +134,34 @@
 
   for (int i = 0; i < 3; ++i) {
     for (int j = 0; j < 5; ++j) {
-      int patchId = i+3*j;
+      int patchId = i + 3 * j;
       for (int r = 0; r < 2; ++r) {
         for (int c = 0; c < 2; ++c) {
           for (int d = 0; d < 2; ++d) {
             for (int b = 0; b < 7; ++b) {
               float expected = 0.0f;
               float expected_row_major = 0.0f;
-              int row_offset = r*stride + i - row_padding;
-              int col_offset = c*stride + j - col_padding;
+              int row_offset = r * stride + i - row_padding;
+              int col_offset = c * stride + j - col_padding;
               // ColMajor
-              if (row_offset >= 0 && col_offset >= 0 && row_offset < tensor.dimension(1) && col_offset < tensor.dimension(2)) {
+              if (row_offset >= 0 && col_offset >= 0 && row_offset < tensor.dimension(1) &&
+                  col_offset < tensor.dimension(2)) {
                 expected = tensor(d, row_offset, col_offset, b);
               }
               if (twod_patch(d, r, c, patchId, b) != expected) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(twod_patch(d, r, c, patchId, b), expected);
 
               // RowMajor
-              if (row_offset >= 0 && col_offset >= 0 && row_offset < tensor_row_major.dimension(2) && col_offset < tensor_row_major.dimension(1)) {
+              if (row_offset >= 0 && col_offset >= 0 && row_offset < tensor_row_major.dimension(2) &&
+                  col_offset < tensor_row_major.dimension(1)) {
                 expected_row_major = tensor_row_major(b, col_offset, row_offset, d);
-
               }
               if (twod_patch_row_major(b, patchId, c, r, d) != expected_row_major) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(twod_patch_row_major(b, patchId, c, r, d), expected_row_major);
               // Check that ColMajor and RowMajor agree.
@@ -180,13 +175,12 @@
 }
 
 // Verifies VALID padding (no padding) with incrementing values.
-void test_patch_padding_valid()
-{
+void test_patch_padding_valid() {
   int input_depth = 3;
   int input_rows = 3;
   int input_cols = 3;
   int input_batches = 1;
-  int ksize = 2;  // Corresponds to the Rows and Cols for tensor.extract_image_patches<>.
+  int ksize = 2;   // Corresponds to the Rows and Cols for tensor.extract_image_patches<>.
   int stride = 2;  // Only same stride is supported.
   Tensor<float, 4> tensor(input_depth, input_rows, input_cols, input_batches);
   // Initializes tensor with incrementing numbers.
@@ -196,10 +190,10 @@
   // ColMajor
   Tensor<float, 5> result = tensor.extract_image_patches(ksize, ksize, stride, stride, 1, 1, PADDING_VALID);
 
-  VERIFY_IS_EQUAL(result.dimension(0), input_depth);  // depth
-  VERIFY_IS_EQUAL(result.dimension(1), ksize);  // kernel rows
-  VERIFY_IS_EQUAL(result.dimension(2), ksize);  // kernel cols
-  VERIFY_IS_EQUAL(result.dimension(3), 1);  // number of patches
+  VERIFY_IS_EQUAL(result.dimension(0), input_depth);    // depth
+  VERIFY_IS_EQUAL(result.dimension(1), ksize);          // kernel rows
+  VERIFY_IS_EQUAL(result.dimension(2), ksize);          // kernel cols
+  VERIFY_IS_EQUAL(result.dimension(3), 1);              // number of patches
   VERIFY_IS_EQUAL(result.dimension(4), input_batches);  // number of batches
 
   // RowMajor
@@ -209,7 +203,8 @@
   VERIFY_IS_EQUAL(tensor.dimension(2), tensor_row_major.dimension(1));
   VERIFY_IS_EQUAL(tensor.dimension(3), tensor_row_major.dimension(0));
 
-  Tensor<float, 5, RowMajor> result_row_major = tensor_row_major.extract_image_patches(ksize, ksize, stride, stride, 1, 1, PADDING_VALID);
+  Tensor<float, 5, RowMajor> result_row_major =
+      tensor_row_major.extract_image_patches(ksize, ksize, stride, stride, 1, 1, PADDING_VALID);
   VERIFY_IS_EQUAL(result.dimension(0), result_row_major.dimension(4));
   VERIFY_IS_EQUAL(result.dimension(1), result_row_major.dimension(3));
   VERIFY_IS_EQUAL(result.dimension(2), result_row_major.dimension(2));
@@ -220,12 +215,12 @@
   int row_padding = 0;
   int col_padding = 0;
 
-  for (int i = 0; (i+stride+ksize-1) < input_rows; i += stride) {  // input rows
-    for (int j = 0; (j+stride+ksize-1) < input_cols; j += stride) {  // input cols
-      int patchId = i+input_rows*j;
-      for (int r = 0; r < ksize; ++r) {  // patch rows
-        for (int c = 0; c < ksize; ++c) {  // patch cols
-          for (int d = 0; d < input_depth; ++d) {  // depth
+  for (int i = 0; (i + stride + ksize - 1) < input_rows; i += stride) {    // input rows
+    for (int j = 0; (j + stride + ksize - 1) < input_cols; j += stride) {  // input cols
+      int patchId = i + input_rows * j;
+      for (int r = 0; r < ksize; ++r) {                // patch rows
+        for (int c = 0; c < ksize; ++c) {              // patch cols
+          for (int d = 0; d < input_depth; ++d) {      // depth
             for (int b = 0; b < input_batches; ++b) {  // batch
               float expected = 0.0f;
               float expected_row_major = 0.0f;
@@ -237,12 +232,14 @@
               }
               // ColMajor
               if (result(d, r, c, patchId, b) != expected) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(result(d, r, c, patchId, b), expected);
               // RowMajor
               if (result_row_major(b, patchId, c, r, d) != expected_row_major) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(result_row_major(b, patchId, c, r, d), expected_row_major);
               // Check that ColMajor and RowMajor agree.
@@ -256,23 +253,22 @@
 }
 
 // Verifies VALID padding (no padding) with the same value.
-void test_patch_padding_valid_same_value()
-{
+void test_patch_padding_valid_same_value() {
   int input_depth = 1;
   int input_rows = 5;
   int input_cols = 5;
   int input_batches = 2;
-  int ksize = 3;  // Corresponds to the Rows and Cols for tensor.extract_image_patches<>.
+  int ksize = 3;   // Corresponds to the Rows and Cols for tensor.extract_image_patches<>.
   int stride = 2;  // Only same stride is supported.
   // ColMajor
   Tensor<float, 4> tensor(input_depth, input_rows, input_cols, input_batches);
   tensor = tensor.constant(11.0f);
   Tensor<float, 5> result = tensor.extract_image_patches(ksize, ksize, stride, stride, 1, 1, PADDING_VALID);
 
-  VERIFY_IS_EQUAL(result.dimension(0), input_depth);  // depth
-  VERIFY_IS_EQUAL(result.dimension(1), ksize);  // kernel rows
-  VERIFY_IS_EQUAL(result.dimension(2), ksize);  // kernel cols
-  VERIFY_IS_EQUAL(result.dimension(3), 4);  // number of patches
+  VERIFY_IS_EQUAL(result.dimension(0), input_depth);    // depth
+  VERIFY_IS_EQUAL(result.dimension(1), ksize);          // kernel rows
+  VERIFY_IS_EQUAL(result.dimension(2), ksize);          // kernel cols
+  VERIFY_IS_EQUAL(result.dimension(3), 4);              // number of patches
   VERIFY_IS_EQUAL(result.dimension(4), input_batches);  // number of batches
 
   // RowMajor
@@ -282,7 +278,8 @@
   VERIFY_IS_EQUAL(tensor.dimension(2), tensor_row_major.dimension(1));
   VERIFY_IS_EQUAL(tensor.dimension(3), tensor_row_major.dimension(0));
 
-  Tensor<float, 5, RowMajor> result_row_major = tensor_row_major.extract_image_patches(ksize, ksize, stride, stride, 1, 1, PADDING_VALID);
+  Tensor<float, 5, RowMajor> result_row_major =
+      tensor_row_major.extract_image_patches(ksize, ksize, stride, stride, 1, 1, PADDING_VALID);
   VERIFY_IS_EQUAL(result.dimension(0), result_row_major.dimension(4));
   VERIFY_IS_EQUAL(result.dimension(1), result_row_major.dimension(3));
   VERIFY_IS_EQUAL(result.dimension(2), result_row_major.dimension(2));
@@ -293,12 +290,12 @@
   int row_padding = 0;
   int col_padding = 0;
 
-  for (int i = 0; (i+stride+ksize-1) <= input_rows; i += stride) {  // input rows
-    for (int j = 0; (j+stride+ksize-1) <= input_cols; j += stride) {  // input cols
-      int patchId = i+input_rows*j;
-      for (int r = 0; r < ksize; ++r) {  // patch rows
-        for (int c = 0; c < ksize; ++c) {  // patch cols
-          for (int d = 0; d < input_depth; ++d) {  // depth
+  for (int i = 0; (i + stride + ksize - 1) <= input_rows; i += stride) {    // input rows
+    for (int j = 0; (j + stride + ksize - 1) <= input_cols; j += stride) {  // input cols
+      int patchId = i + input_rows * j;
+      for (int r = 0; r < ksize; ++r) {                // patch rows
+        for (int c = 0; c < ksize; ++c) {              // patch cols
+          for (int d = 0; d < input_depth; ++d) {      // depth
             for (int b = 0; b < input_batches; ++b) {  // batch
               float expected = 0.0f;
               float expected_row_major = 0.0f;
@@ -310,12 +307,14 @@
               }
               // ColMajor
               if (result(d, r, c, patchId, b) != expected) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(result(d, r, c, patchId, b), expected);
               // RowMajor
               if (result_row_major(b, patchId, c, r, d) != expected_row_major) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(result_row_major(b, patchId, c, r, d), expected_row_major);
               // Check that ColMajor and RowMajor agree.
@@ -329,13 +328,12 @@
 }
 
 // Verifies SAME padding.
-void test_patch_padding_same()
-{
+void test_patch_padding_same() {
   int input_depth = 3;
   int input_rows = 4;
   int input_cols = 2;
   int input_batches = 1;
-  int ksize = 2;  // Corresponds to the Rows and Cols for tensor.extract_image_patches<>.
+  int ksize = 2;   // Corresponds to the Rows and Cols for tensor.extract_image_patches<>.
   int stride = 2;  // Only same stride is supported.
   // ColMajor
   Tensor<float, 4> tensor(input_depth, input_rows, input_cols, input_batches);
@@ -345,10 +343,10 @@
   }
   Tensor<float, 5> result = tensor.extract_image_patches(ksize, ksize, stride, stride, PADDING_SAME);
 
-  VERIFY_IS_EQUAL(result.dimension(0), input_depth);  // depth
-  VERIFY_IS_EQUAL(result.dimension(1), ksize);  // kernel rows
-  VERIFY_IS_EQUAL(result.dimension(2), ksize);  // kernel cols
-  VERIFY_IS_EQUAL(result.dimension(3), 2);  // number of patches
+  VERIFY_IS_EQUAL(result.dimension(0), input_depth);    // depth
+  VERIFY_IS_EQUAL(result.dimension(1), ksize);          // kernel rows
+  VERIFY_IS_EQUAL(result.dimension(2), ksize);          // kernel cols
+  VERIFY_IS_EQUAL(result.dimension(3), 2);              // number of patches
   VERIFY_IS_EQUAL(result.dimension(4), input_batches);  // number of batches
 
   // RowMajor
@@ -358,7 +356,8 @@
   VERIFY_IS_EQUAL(tensor.dimension(2), tensor_row_major.dimension(1));
   VERIFY_IS_EQUAL(tensor.dimension(3), tensor_row_major.dimension(0));
 
-  Tensor<float, 5, RowMajor> result_row_major = tensor_row_major.extract_image_patches(ksize, ksize, stride, stride, PADDING_SAME);
+  Tensor<float, 5, RowMajor> result_row_major =
+      tensor_row_major.extract_image_patches(ksize, ksize, stride, stride, PADDING_SAME);
   VERIFY_IS_EQUAL(result.dimension(0), result_row_major.dimension(4));
   VERIFY_IS_EQUAL(result.dimension(1), result_row_major.dimension(3));
   VERIFY_IS_EQUAL(result.dimension(2), result_row_major.dimension(2));
@@ -370,29 +369,31 @@
   int row_padding = 0;
   int col_padding = 0;
 
-  for (int i = 0; (i+stride+ksize-1) <= input_rows; i += stride) {  // input rows
-    for (int j = 0; (j+stride+ksize-1) <= input_cols; j += stride) {  // input cols
-      int patchId = i+input_rows*j;
-      for (int r = 0; r < ksize; ++r) {  // patch rows
-        for (int c = 0; c < ksize; ++c) {  // patch cols
-          for (int d = 0; d < input_depth; ++d) {  // depth
+  for (int i = 0; (i + stride + ksize - 1) <= input_rows; i += stride) {    // input rows
+    for (int j = 0; (j + stride + ksize - 1) <= input_cols; j += stride) {  // input cols
+      int patchId = i + input_rows * j;
+      for (int r = 0; r < ksize; ++r) {                // patch rows
+        for (int c = 0; c < ksize; ++c) {              // patch cols
+          for (int d = 0; d < input_depth; ++d) {      // depth
             for (int b = 0; b < input_batches; ++b) {  // batch
               float expected = 0.0f;
               float expected_row_major = 0.0f;
-              int row_offset = r*stride + i - row_padding;
-              int col_offset = c*stride + j - col_padding;
+              int row_offset = r * stride + i - row_padding;
+              int col_offset = c * stride + j - col_padding;
               if (row_offset >= 0 && col_offset >= 0 && row_offset < input_rows && col_offset < input_cols) {
                 expected = tensor(d, row_offset, col_offset, b);
                 expected_row_major = tensor_row_major(b, col_offset, row_offset, d);
               }
               // ColMajor
               if (result(d, r, c, patchId, b) != expected) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(result(d, r, c, patchId, b), expected);
               // RowMajor
               if (result_row_major(b, patchId, c, r, d) != expected_row_major) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(result_row_major(b, patchId, c, r, d), expected_row_major);
               // Check that ColMajor and RowMajor agree.
@@ -422,8 +423,7 @@
   for (int i = 0; i < tensor.size(); ++i) {
     tensor.data()[i] = i + 1;
   }
-  Tensor<float, 5> result = tensor.extract_image_patches(
-      ksize, ksize, row_stride, col_stride, 1, 1, PADDING_SAME);
+  Tensor<float, 5> result = tensor.extract_image_patches(ksize, ksize, row_stride, col_stride, 1, 1, PADDING_SAME);
   // row padding will be computed as -2 originally and then be clipped to 0.
   VERIFY_IS_EQUAL(result.coeff(0), 1.0f);
   VERIFY_IS_EQUAL(result.coeff(1), 6.0f);
@@ -443,8 +443,7 @@
   VERIFY_IS_EQUAL(tensor.dimension(3), tensor_row_major.dimension(0));
 
   Tensor<float, 5, RowMajor> result_row_major =
-      tensor_row_major.extract_image_patches(ksize, ksize, row_stride,
-                                             col_stride, 1, 1, PADDING_SAME);
+      tensor_row_major.extract_image_patches(ksize, ksize, row_stride, col_stride, 1, 1, PADDING_SAME);
   VERIFY_IS_EQUAL(result_row_major.coeff(0), 1.0f);
   VERIFY_IS_EQUAL(result_row_major.coeff(1), 6.0f);
   VERIFY_IS_EQUAL(result_row_major.coeff(2), 11.0f);
@@ -456,9 +455,8 @@
   VERIFY_IS_EQUAL(result.dimension(4), result_row_major.dimension(0));
 }
 
-void test_patch_no_extra_dim()
-{
-  Tensor<float, 3> tensor(2,3,5);
+void test_patch_no_extra_dim() {
+  Tensor<float, 3> tensor(2, 3, 5);
   tensor.setRandom();
   Tensor<float, 3, RowMajor> tensor_row_major = tensor.swap_layout();
   VERIFY_IS_EQUAL(tensor.dimension(0), tensor_row_major.dimension(2));
@@ -471,12 +469,12 @@
   VERIFY_IS_EQUAL(single_pixel_patch.dimension(0), 2);
   VERIFY_IS_EQUAL(single_pixel_patch.dimension(1), 1);
   VERIFY_IS_EQUAL(single_pixel_patch.dimension(2), 1);
-  VERIFY_IS_EQUAL(single_pixel_patch.dimension(3), 3*5);
+  VERIFY_IS_EQUAL(single_pixel_patch.dimension(3), 3 * 5);
 
   // Single pixel patch: RowMajor
   Tensor<float, 4, RowMajor> single_pixel_patch_row_major;
   single_pixel_patch_row_major = tensor_row_major.extract_image_patches(1, 1);
-  VERIFY_IS_EQUAL(single_pixel_patch_row_major.dimension(0), 3*5);
+  VERIFY_IS_EQUAL(single_pixel_patch_row_major.dimension(0), 3 * 5);
   VERIFY_IS_EQUAL(single_pixel_patch_row_major.dimension(1), 1);
   VERIFY_IS_EQUAL(single_pixel_patch_row_major.dimension(2), 1);
   VERIFY_IS_EQUAL(single_pixel_patch_row_major.dimension(3), 2);
@@ -484,20 +482,18 @@
   for (int i = 0; i < tensor.size(); ++i) {
     // ColMajor
     if (tensor.data()[i] != single_pixel_patch.data()[i]) {
-      std::cout << "Mismatch detected at index " << i << " : " << tensor.data()[i] << " vs " << single_pixel_patch.data()[i] << std::endl;
+      std::cout << "Mismatch detected at index " << i << " : " << tensor.data()[i] << " vs "
+                << single_pixel_patch.data()[i] << std::endl;
     }
     VERIFY_IS_EQUAL(single_pixel_patch.data()[i], tensor.data()[i]);
     // RowMajor
     if (tensor_row_major.data()[i] != single_pixel_patch_row_major.data()[i]) {
-      std::cout << "Mismatch detected at index " << i << " : "
-           << tensor.data()[i] << " vs "
-           << single_pixel_patch_row_major.data()[i] << std::endl;
+      std::cout << "Mismatch detected at index " << i << " : " << tensor.data()[i] << " vs "
+                << single_pixel_patch_row_major.data()[i] << std::endl;
     }
-    VERIFY_IS_EQUAL(single_pixel_patch_row_major.data()[i],
-                    tensor_row_major.data()[i]);
+    VERIFY_IS_EQUAL(single_pixel_patch_row_major.data()[i], tensor_row_major.data()[i]);
     VERIFY_IS_EQUAL(tensor.data()[i], tensor_row_major.data()[i]);
-    VERIFY_IS_EQUAL(single_pixel_patch.data()[i],
-                    single_pixel_patch_row_major.data()[i]);
+    VERIFY_IS_EQUAL(single_pixel_patch.data()[i], single_pixel_patch_row_major.data()[i]);
   }
 
   // Entire image patch: ColMajor
@@ -506,40 +502,40 @@
   VERIFY_IS_EQUAL(entire_image_patch.dimension(0), 2);
   VERIFY_IS_EQUAL(entire_image_patch.dimension(1), 3);
   VERIFY_IS_EQUAL(entire_image_patch.dimension(2), 5);
-  VERIFY_IS_EQUAL(entire_image_patch.dimension(3), 3*5);
+  VERIFY_IS_EQUAL(entire_image_patch.dimension(3), 3 * 5);
 
   // Entire image patch: RowMajor
   Tensor<float, 4, RowMajor> entire_image_patch_row_major;
   entire_image_patch_row_major = tensor_row_major.extract_image_patches(3, 5);
-  VERIFY_IS_EQUAL(entire_image_patch_row_major.dimension(0), 3*5);
+  VERIFY_IS_EQUAL(entire_image_patch_row_major.dimension(0), 3 * 5);
   VERIFY_IS_EQUAL(entire_image_patch_row_major.dimension(1), 5);
   VERIFY_IS_EQUAL(entire_image_patch_row_major.dimension(2), 3);
   VERIFY_IS_EQUAL(entire_image_patch_row_major.dimension(3), 2);
 
   for (int i = 0; i < 3; ++i) {
     for (int j = 0; j < 5; ++j) {
-      int patchId = i+3*j;
+      int patchId = i + 3 * j;
       for (int r = 0; r < 3; ++r) {
         for (int c = 0; c < 5; ++c) {
           for (int d = 0; d < 2; ++d) {
             float expected = 0.0f;
             float expected_row_major = 0.0f;
-            if (r-1+i >= 0 && c-2+j >= 0 && r-1+i < 3 && c-2+j < 5) {
-              expected = tensor(d, r-1+i, c-2+j);
-              expected_row_major = tensor_row_major(c-2+j, r-1+i, d);
+            if (r - 1 + i >= 0 && c - 2 + j >= 0 && r - 1 + i < 3 && c - 2 + j < 5) {
+              expected = tensor(d, r - 1 + i, c - 2 + j);
+              expected_row_major = tensor_row_major(c - 2 + j, r - 1 + i, d);
             }
             // ColMajor
             if (entire_image_patch(d, r, c, patchId) != expected) {
-              std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << std::endl;
+              std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d
+                        << std::endl;
             }
             VERIFY_IS_EQUAL(entire_image_patch(d, r, c, patchId), expected);
             // RowMajor
-            if (entire_image_patch_row_major(patchId, c, r, d) !=
-                expected_row_major) {
-              std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << std::endl;
+            if (entire_image_patch_row_major(patchId, c, r, d) != expected_row_major) {
+              std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d
+                        << std::endl;
             }
-            VERIFY_IS_EQUAL(entire_image_patch_row_major(patchId, c, r, d),
-                            expected_row_major);
+            VERIFY_IS_EQUAL(entire_image_patch_row_major(patchId, c, r, d), expected_row_major);
             // Check that ColMajor and RowMajor agree.
             VERIFY_IS_EQUAL(expected, expected_row_major);
           }
@@ -554,12 +550,12 @@
   VERIFY_IS_EQUAL(twod_patch.dimension(0), 2);
   VERIFY_IS_EQUAL(twod_patch.dimension(1), 2);
   VERIFY_IS_EQUAL(twod_patch.dimension(2), 2);
-  VERIFY_IS_EQUAL(twod_patch.dimension(3), 3*5);
+  VERIFY_IS_EQUAL(twod_patch.dimension(3), 3 * 5);
 
   // 2D patch: RowMajor
   Tensor<float, 4, RowMajor> twod_patch_row_major;
   twod_patch_row_major = tensor_row_major.extract_image_patches(2, 2);
-  VERIFY_IS_EQUAL(twod_patch_row_major.dimension(0), 3*5);
+  VERIFY_IS_EQUAL(twod_patch_row_major.dimension(0), 3 * 5);
   VERIFY_IS_EQUAL(twod_patch_row_major.dimension(1), 2);
   VERIFY_IS_EQUAL(twod_patch_row_major.dimension(2), 2);
   VERIFY_IS_EQUAL(twod_patch_row_major.dimension(3), 2);
@@ -571,28 +567,32 @@
 
   for (int i = 0; i < 3; ++i) {
     for (int j = 0; j < 5; ++j) {
-      int patchId = i+3*j;
+      int patchId = i + 3 * j;
       for (int r = 0; r < 2; ++r) {
         for (int c = 0; c < 2; ++c) {
           for (int d = 0; d < 2; ++d) {
             float expected = 0.0f;
             float expected_row_major = 0.0f;
-            int row_offset = r*stride + i - row_padding;
-            int col_offset = c*stride + j - col_padding;
+            int row_offset = r * stride + i - row_padding;
+            int col_offset = c * stride + j - col_padding;
             // ColMajor
-            if (row_offset >= 0 && col_offset >= 0 && row_offset < tensor.dimension(1) && col_offset < tensor.dimension(2)) {
+            if (row_offset >= 0 && col_offset >= 0 && row_offset < tensor.dimension(1) &&
+                col_offset < tensor.dimension(2)) {
               expected = tensor(d, row_offset, col_offset);
             }
             if (twod_patch(d, r, c, patchId) != expected) {
-              std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << std::endl;
+              std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d
+                        << std::endl;
             }
             VERIFY_IS_EQUAL(twod_patch(d, r, c, patchId), expected);
             // RowMajor
-            if (row_offset >= 0 && col_offset >= 0 && row_offset < tensor_row_major.dimension(1) && col_offset < tensor_row_major.dimension(0)) {
+            if (row_offset >= 0 && col_offset >= 0 && row_offset < tensor_row_major.dimension(1) &&
+                col_offset < tensor_row_major.dimension(0)) {
               expected_row_major = tensor_row_major(col_offset, row_offset, d);
             }
             if (twod_patch_row_major(patchId, c, r, d) != expected_row_major) {
-              std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << std::endl;
+              std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d
+                        << std::endl;
             }
             VERIFY_IS_EQUAL(twod_patch_row_major(patchId, c, r, d), expected_row_major);
             // Check that ColMajor and RowMajor agree.
@@ -604,8 +604,7 @@
   }
 }
 
-void test_imagenet_patches()
-{
+void test_imagenet_patches() {
   // Test the code on typical configurations used by the 'imagenet' benchmarks at
   // https://github.com/soumith/convnet-benchmarks
   // ColMajor
@@ -615,13 +614,13 @@
   VERIFY_IS_EQUAL(l_out.dimension(0), 3);
   VERIFY_IS_EQUAL(l_out.dimension(1), 11);
   VERIFY_IS_EQUAL(l_out.dimension(2), 11);
-  VERIFY_IS_EQUAL(l_out.dimension(3), 128*128);
+  VERIFY_IS_EQUAL(l_out.dimension(3), 128 * 128);
   VERIFY_IS_EQUAL(l_out.dimension(4), 16);
 
   // RowMajor
   Tensor<float, 5, RowMajor> l_out_row_major = l_in.swap_layout().extract_image_patches(11, 11);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(0), 16);
-  VERIFY_IS_EQUAL(l_out_row_major.dimension(1), 128*128);
+  VERIFY_IS_EQUAL(l_out_row_major.dimension(1), 128 * 128);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(2), 11);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(3), 11);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(4), 3);
@@ -629,28 +628,26 @@
   for (int b = 0; b < 16; ++b) {
     for (int i = 0; i < 128; ++i) {
       for (int j = 0; j < 128; ++j) {
-        int patchId = i+128*j;
+        int patchId = i + 128 * j;
         for (int c = 0; c < 11; ++c) {
           for (int r = 0; r < 11; ++r) {
             for (int d = 0; d < 3; ++d) {
               float expected = 0.0f;
-              if (r-5+i >= 0 && c-5+j >= 0 && r-5+i < 128 && c-5+j < 128) {
-                expected = l_in(d, r-5+i, c-5+j, b);
+              if (r - 5 + i >= 0 && c - 5 + j >= 0 && r - 5 + i < 128 && c - 5 + j < 128) {
+                expected = l_in(d, r - 5 + i, c - 5 + j, b);
               }
               // ColMajor
               if (l_out(d, r, c, patchId, b) != expected) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(l_out(d, r, c, patchId, b), expected);
               // RowMajor
-              if (l_out_row_major(b, patchId, c, r, d) !=
-                  expected) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j
-                     << " r=" << r << " c=" << c << " d=" << d << " b=" << b
-                     << std::endl;
+              if (l_out_row_major(b, patchId, c, r, d) != expected) {
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
-              VERIFY_IS_EQUAL(l_out_row_major(b, patchId, c, r, d),
-                              expected);
+              VERIFY_IS_EQUAL(l_out_row_major(b, patchId, c, r, d), expected);
             }
           }
         }
@@ -665,13 +662,13 @@
   VERIFY_IS_EQUAL(l_out.dimension(0), 16);
   VERIFY_IS_EQUAL(l_out.dimension(1), 9);
   VERIFY_IS_EQUAL(l_out.dimension(2), 9);
-  VERIFY_IS_EQUAL(l_out.dimension(3), 64*64);
+  VERIFY_IS_EQUAL(l_out.dimension(3), 64 * 64);
   VERIFY_IS_EQUAL(l_out.dimension(4), 32);
 
   // RowMajor
   l_out_row_major = l_in.swap_layout().extract_image_patches(9, 9);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(0), 32);
-  VERIFY_IS_EQUAL(l_out_row_major.dimension(1), 64*64);
+  VERIFY_IS_EQUAL(l_out_row_major.dimension(1), 64 * 64);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(2), 9);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(3), 9);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(4), 16);
@@ -679,22 +676,24 @@
   for (int b = 0; b < 32; ++b) {
     for (int i = 0; i < 64; ++i) {
       for (int j = 0; j < 64; ++j) {
-        int patchId = i+64*j;
+        int patchId = i + 64 * j;
         for (int c = 0; c < 9; ++c) {
           for (int r = 0; r < 9; ++r) {
             for (int d = 0; d < 16; ++d) {
               float expected = 0.0f;
-              if (r-4+i >= 0 && c-4+j >= 0 && r-4+i < 64 && c-4+j < 64) {
-                expected = l_in(d, r-4+i, c-4+j, b);
+              if (r - 4 + i >= 0 && c - 4 + j >= 0 && r - 4 + i < 64 && c - 4 + j < 64) {
+                expected = l_in(d, r - 4 + i, c - 4 + j, b);
               }
               // ColMajor
               if (l_out(d, r, c, patchId, b) != expected) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(l_out(d, r, c, patchId, b), expected);
               // RowMajor
               if (l_out_row_major(b, patchId, c, r, d) != expected) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(l_out_row_major(b, patchId, c, r, d), expected);
             }
@@ -711,13 +710,13 @@
   VERIFY_IS_EQUAL(l_out.dimension(0), 32);
   VERIFY_IS_EQUAL(l_out.dimension(1), 7);
   VERIFY_IS_EQUAL(l_out.dimension(2), 7);
-  VERIFY_IS_EQUAL(l_out.dimension(3), 16*16);
+  VERIFY_IS_EQUAL(l_out.dimension(3), 16 * 16);
   VERIFY_IS_EQUAL(l_out.dimension(4), 32);
 
   // RowMajor
   l_out_row_major = l_in.swap_layout().extract_image_patches(7, 7);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(0), 32);
-  VERIFY_IS_EQUAL(l_out_row_major.dimension(1), 16*16);
+  VERIFY_IS_EQUAL(l_out_row_major.dimension(1), 16 * 16);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(2), 7);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(3), 7);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(4), 32);
@@ -725,22 +724,24 @@
   for (int b = 0; b < 32; ++b) {
     for (int i = 0; i < 16; ++i) {
       for (int j = 0; j < 16; ++j) {
-        int patchId = i+16*j;
+        int patchId = i + 16 * j;
         for (int c = 0; c < 7; ++c) {
           for (int r = 0; r < 7; ++r) {
             for (int d = 0; d < 32; ++d) {
               float expected = 0.0f;
-              if (r-3+i >= 0 && c-3+j >= 0 && r-3+i < 16 && c-3+j < 16) {
-                expected = l_in(d, r-3+i, c-3+j, b);
+              if (r - 3 + i >= 0 && c - 3 + j >= 0 && r - 3 + i < 16 && c - 3 + j < 16) {
+                expected = l_in(d, r - 3 + i, c - 3 + j, b);
               }
               // ColMajor
               if (l_out(d, r, c, patchId, b) != expected) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(l_out(d, r, c, patchId, b), expected);
               // RowMajor
               if (l_out_row_major(b, patchId, c, r, d) != expected) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(l_out_row_major(b, patchId, c, r, d), expected);
             }
@@ -757,13 +758,13 @@
   VERIFY_IS_EQUAL(l_out.dimension(0), 64);
   VERIFY_IS_EQUAL(l_out.dimension(1), 3);
   VERIFY_IS_EQUAL(l_out.dimension(2), 3);
-  VERIFY_IS_EQUAL(l_out.dimension(3), 13*13);
+  VERIFY_IS_EQUAL(l_out.dimension(3), 13 * 13);
   VERIFY_IS_EQUAL(l_out.dimension(4), 32);
 
   // RowMajor
   l_out_row_major = l_in.swap_layout().extract_image_patches(3, 3);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(0), 32);
-  VERIFY_IS_EQUAL(l_out_row_major.dimension(1), 13*13);
+  VERIFY_IS_EQUAL(l_out_row_major.dimension(1), 13 * 13);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(2), 3);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(3), 3);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(4), 64);
@@ -771,22 +772,24 @@
   for (int b = 0; b < 32; ++b) {
     for (int i = 0; i < 13; ++i) {
       for (int j = 0; j < 13; ++j) {
-        int patchId = i+13*j;
+        int patchId = i + 13 * j;
         for (int c = 0; c < 3; ++c) {
           for (int r = 0; r < 3; ++r) {
             for (int d = 0; d < 64; ++d) {
               float expected = 0.0f;
-              if (r-1+i >= 0 && c-1+j >= 0 && r-1+i < 13 && c-1+j < 13) {
-                expected = l_in(d, r-1+i, c-1+j, b);
+              if (r - 1 + i >= 0 && c - 1 + j >= 0 && r - 1 + i < 13 && c - 1 + j < 13) {
+                expected = l_in(d, r - 1 + i, c - 1 + j, b);
               }
               // ColMajor
               if (l_out(d, r, c, patchId, b) != expected) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(l_out(d, r, c, patchId, b), expected);
               // RowMajor
               if (l_out_row_major(b, patchId, c, r, d) != expected) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(l_out_row_major(b, patchId, c, r, d), expected);
             }
@@ -797,8 +800,7 @@
   }
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_image_patch)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_image_patch) {
   CALL_SUBTEST_1(test_simple_patch());
   CALL_SUBTEST_2(test_patch_no_extra_dim());
   CALL_SUBTEST_3(test_patch_padding_valid());
diff --git a/unsupported/test/cxx11_tensor_image_patch_sycl.cpp b/unsupported/test/cxx11_tensor_image_patch_sycl.cpp
index c1828a0..9cbf26c 100644
--- a/unsupported/test/cxx11_tensor_image_patch_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_image_patch_sycl.cpp
@@ -24,26 +24,29 @@
 static const int DataLayout = ColMajor;
 
 template <typename DataType, typename IndexType>
-static void test_simple_image_patch_sycl(const Eigen::SyclDevice& sycl_device)
-{
+static void test_simple_image_patch_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType sizeDim1 = 2;
   IndexType sizeDim2 = 3;
   IndexType sizeDim3 = 5;
   IndexType sizeDim4 = 7;
   array<IndexType, 4> tensorColMajorRange = {{sizeDim1, sizeDim2, sizeDim3, sizeDim4}};
   array<IndexType, 4> tensorRowMajorRange = {{sizeDim4, sizeDim3, sizeDim2, sizeDim1}};
-  Tensor<DataType, 4, DataLayout,IndexType> tensor_col_major(tensorColMajorRange);
-  Tensor<DataType, 4, RowMajor,IndexType> tensor_row_major(tensorRowMajorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> tensor_col_major(tensorColMajorRange);
+  Tensor<DataType, 4, RowMajor, IndexType> tensor_row_major(tensorRowMajorRange);
   tensor_col_major.setRandom();
 
-  DataType* gpu_data_col_major  = static_cast<DataType*>(sycl_device.allocate(tensor_col_major.size()*sizeof(DataType)));
-  DataType* gpu_data_row_major  = static_cast<DataType*>(sycl_device.allocate(tensor_row_major.size()*sizeof(DataType)));
+  DataType* gpu_data_col_major =
+      static_cast<DataType*>(sycl_device.allocate(tensor_col_major.size() * sizeof(DataType)));
+  DataType* gpu_data_row_major =
+      static_cast<DataType*>(sycl_device.allocate(tensor_row_major.size() * sizeof(DataType)));
   TensorMap<Tensor<DataType, 4, ColMajor, IndexType>> gpu_col_major(gpu_data_col_major, tensorColMajorRange);
   TensorMap<Tensor<DataType, 4, RowMajor, IndexType>> gpu_row_major(gpu_data_row_major, tensorRowMajorRange);
 
-  sycl_device.memcpyHostToDevice(gpu_data_col_major, tensor_col_major.data(),(tensor_col_major.size())*sizeof(DataType));
-  gpu_row_major.device(sycl_device)=gpu_col_major.swap_layout();
-  sycl_device.memcpyDeviceToHost(tensor_row_major.data(), gpu_data_row_major, (tensor_col_major.size())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_data_col_major, tensor_col_major.data(),
+                                 (tensor_col_major.size()) * sizeof(DataType));
+  gpu_row_major.device(sycl_device) = gpu_col_major.swap_layout();
+  sycl_device.memcpyDeviceToHost(tensor_row_major.data(), gpu_data_row_major,
+                                 (tensor_col_major.size()) * sizeof(DataType));
 
   VERIFY_IS_EQUAL(tensor_col_major.dimension(0), tensor_row_major.dimension(3));
   VERIFY_IS_EQUAL(tensor_col_major.dimension(1), tensor_row_major.dimension(2));
@@ -51,31 +54,33 @@
   VERIFY_IS_EQUAL(tensor_col_major.dimension(3), tensor_row_major.dimension(0));
 
   // Single pixel patch: ColMajor
-  array<IndexType, 5> patchColMajorTensorRange={{sizeDim1, 1, 1, sizeDim2*sizeDim3, sizeDim4}};
-  Tensor<DataType, 5, DataLayout,IndexType> single_patch_col_major(patchColMajorTensorRange);
-  size_t patchTensorBuffSize =single_patch_col_major.size()*sizeof(DataType);
-  DataType* gpu_data_single_patch_col_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 5, DataLayout,IndexType>> gpu_single_patch_col_major(gpu_data_single_patch_col_major, patchColMajorTensorRange);
-  gpu_single_patch_col_major.device(sycl_device)=gpu_col_major.extract_image_patches(1, 1);
+  array<IndexType, 5> patchColMajorTensorRange = {{sizeDim1, 1, 1, sizeDim2 * sizeDim3, sizeDim4}};
+  Tensor<DataType, 5, DataLayout, IndexType> single_patch_col_major(patchColMajorTensorRange);
+  size_t patchTensorBuffSize = single_patch_col_major.size() * sizeof(DataType);
+  DataType* gpu_data_single_patch_col_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu_single_patch_col_major(gpu_data_single_patch_col_major,
+                                                                                   patchColMajorTensorRange);
+  gpu_single_patch_col_major.device(sycl_device) = gpu_col_major.extract_image_patches(1, 1);
   sycl_device.memcpyDeviceToHost(single_patch_col_major.data(), gpu_data_single_patch_col_major, patchTensorBuffSize);
 
   VERIFY_IS_EQUAL(single_patch_col_major.dimension(0), 2);
   VERIFY_IS_EQUAL(single_patch_col_major.dimension(1), 1);
   VERIFY_IS_EQUAL(single_patch_col_major.dimension(2), 1);
-  VERIFY_IS_EQUAL(single_patch_col_major.dimension(3), 3*5);
+  VERIFY_IS_EQUAL(single_patch_col_major.dimension(3), 3 * 5);
   VERIFY_IS_EQUAL(single_patch_col_major.dimension(4), 7);
 
   // Single pixel patch: RowMajor
-  array<IndexType, 5> patchRowMajorTensorRange={{sizeDim4, sizeDim2*sizeDim3, 1, 1, sizeDim1}};
-  Tensor<DataType, 5, RowMajor,IndexType> single_patch_row_major(patchRowMajorTensorRange);
-  patchTensorBuffSize =single_patch_row_major.size()*sizeof(DataType);
-  DataType* gpu_data_single_patch_row_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 5, RowMajor,IndexType>> gpu_single_patch_row_major(gpu_data_single_patch_row_major, patchRowMajorTensorRange);
-  gpu_single_patch_row_major.device(sycl_device)=gpu_row_major.extract_image_patches(1, 1);
+  array<IndexType, 5> patchRowMajorTensorRange = {{sizeDim4, sizeDim2 * sizeDim3, 1, 1, sizeDim1}};
+  Tensor<DataType, 5, RowMajor, IndexType> single_patch_row_major(patchRowMajorTensorRange);
+  patchTensorBuffSize = single_patch_row_major.size() * sizeof(DataType);
+  DataType* gpu_data_single_patch_row_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 5, RowMajor, IndexType>> gpu_single_patch_row_major(gpu_data_single_patch_row_major,
+                                                                                 patchRowMajorTensorRange);
+  gpu_single_patch_row_major.device(sycl_device) = gpu_row_major.extract_image_patches(1, 1);
   sycl_device.memcpyDeviceToHost(single_patch_row_major.data(), gpu_data_single_patch_row_major, patchTensorBuffSize);
 
   VERIFY_IS_EQUAL(single_patch_row_major.dimension(0), 7);
-  VERIFY_IS_EQUAL(single_patch_row_major.dimension(1), 3*5);
+  VERIFY_IS_EQUAL(single_patch_row_major.dimension(1), 3 * 5);
   VERIFY_IS_EQUAL(single_patch_row_major.dimension(2), 1);
   VERIFY_IS_EQUAL(single_patch_row_major.dimension(3), 1);
   VERIFY_IS_EQUAL(single_patch_row_major.dimension(4), 2);
@@ -83,82 +88,79 @@
   for (IndexType i = 0; i < tensor_col_major.size(); ++i) {
     // ColMajor
     if (tensor_col_major.data()[i] != single_patch_col_major.data()[i]) {
-      std::cout << "Mismatch detected at index colmajor " << i << " : "
-           << tensor_col_major.data()[i] << " vs " << single_patch_col_major.data()[i]
-           << std::endl;
+      std::cout << "Mismatch detected at index colmajor " << i << " : " << tensor_col_major.data()[i] << " vs "
+                << single_patch_col_major.data()[i] << std::endl;
     }
     VERIFY_IS_EQUAL(single_patch_col_major.data()[i], tensor_col_major.data()[i]);
     // RowMajor
     if (tensor_row_major.data()[i] != single_patch_row_major.data()[i]) {
-      std::cout << "Mismatch detected at index row major" << i << " : "
-           << tensor_row_major.data()[i] << " vs "
-           << single_patch_row_major.data()[i] << std::endl;
+      std::cout << "Mismatch detected at index row major" << i << " : " << tensor_row_major.data()[i] << " vs "
+                << single_patch_row_major.data()[i] << std::endl;
     }
-    VERIFY_IS_EQUAL(single_patch_row_major.data()[i],
-                    tensor_row_major.data()[i]);
+    VERIFY_IS_EQUAL(single_patch_row_major.data()[i], tensor_row_major.data()[i]);
     VERIFY_IS_EQUAL(tensor_col_major.data()[i], tensor_row_major.data()[i]);
-    VERIFY_IS_EQUAL(single_patch_col_major.data()[i],
-                    single_patch_row_major.data()[i]);
+    VERIFY_IS_EQUAL(single_patch_col_major.data()[i], single_patch_row_major.data()[i]);
   }
 
-
   // Entire image patch: ColMajor
-  patchColMajorTensorRange={{sizeDim1, sizeDim2, sizeDim3, sizeDim2*sizeDim3, sizeDim4}};
-  Tensor<DataType, 5, DataLayout,IndexType> entire_image_patch_col_major(patchColMajorTensorRange);
-  patchTensorBuffSize =entire_image_patch_col_major.size()*sizeof(DataType);
-  DataType* gpu_data_entire_image_patch_col_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 5, DataLayout,IndexType>> gpu_entire_image_patch_col_major(gpu_data_entire_image_patch_col_major, patchColMajorTensorRange);
-  gpu_entire_image_patch_col_major.device(sycl_device)=gpu_col_major.extract_image_patches(3, 5);
-  sycl_device.memcpyDeviceToHost(entire_image_patch_col_major.data(), gpu_data_entire_image_patch_col_major, patchTensorBuffSize);
+  patchColMajorTensorRange = {{sizeDim1, sizeDim2, sizeDim3, sizeDim2 * sizeDim3, sizeDim4}};
+  Tensor<DataType, 5, DataLayout, IndexType> entire_image_patch_col_major(patchColMajorTensorRange);
+  patchTensorBuffSize = entire_image_patch_col_major.size() * sizeof(DataType);
+  DataType* gpu_data_entire_image_patch_col_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu_entire_image_patch_col_major(
+      gpu_data_entire_image_patch_col_major, patchColMajorTensorRange);
+  gpu_entire_image_patch_col_major.device(sycl_device) = gpu_col_major.extract_image_patches(3, 5);
+  sycl_device.memcpyDeviceToHost(entire_image_patch_col_major.data(), gpu_data_entire_image_patch_col_major,
+                                 patchTensorBuffSize);
 
   VERIFY_IS_EQUAL(entire_image_patch_col_major.dimension(0), 2);
   VERIFY_IS_EQUAL(entire_image_patch_col_major.dimension(1), 3);
   VERIFY_IS_EQUAL(entire_image_patch_col_major.dimension(2), 5);
-  VERIFY_IS_EQUAL(entire_image_patch_col_major.dimension(3), 3*5);
+  VERIFY_IS_EQUAL(entire_image_patch_col_major.dimension(3), 3 * 5);
   VERIFY_IS_EQUAL(entire_image_patch_col_major.dimension(4), 7);
 
   // Entire image patch: RowMajor
-  patchRowMajorTensorRange={{sizeDim4, sizeDim2*sizeDim3, sizeDim3, sizeDim2, sizeDim1}};
-  Tensor<DataType, 5, RowMajor,IndexType> entire_image_patch_row_major(patchRowMajorTensorRange);
-  patchTensorBuffSize =entire_image_patch_row_major.size()*sizeof(DataType);
-  DataType* gpu_data_entire_image_patch_row_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 5, RowMajor,IndexType>> gpu_entire_image_patch_row_major(gpu_data_entire_image_patch_row_major, patchRowMajorTensorRange);
-  gpu_entire_image_patch_row_major.device(sycl_device)=gpu_row_major.extract_image_patches(3, 5);
-  sycl_device.memcpyDeviceToHost(entire_image_patch_row_major.data(), gpu_data_entire_image_patch_row_major, patchTensorBuffSize);
+  patchRowMajorTensorRange = {{sizeDim4, sizeDim2 * sizeDim3, sizeDim3, sizeDim2, sizeDim1}};
+  Tensor<DataType, 5, RowMajor, IndexType> entire_image_patch_row_major(patchRowMajorTensorRange);
+  patchTensorBuffSize = entire_image_patch_row_major.size() * sizeof(DataType);
+  DataType* gpu_data_entire_image_patch_row_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 5, RowMajor, IndexType>> gpu_entire_image_patch_row_major(
+      gpu_data_entire_image_patch_row_major, patchRowMajorTensorRange);
+  gpu_entire_image_patch_row_major.device(sycl_device) = gpu_row_major.extract_image_patches(3, 5);
+  sycl_device.memcpyDeviceToHost(entire_image_patch_row_major.data(), gpu_data_entire_image_patch_row_major,
+                                 patchTensorBuffSize);
 
   VERIFY_IS_EQUAL(entire_image_patch_row_major.dimension(0), 7);
-  VERIFY_IS_EQUAL(entire_image_patch_row_major.dimension(1), 3*5);
+  VERIFY_IS_EQUAL(entire_image_patch_row_major.dimension(1), 3 * 5);
   VERIFY_IS_EQUAL(entire_image_patch_row_major.dimension(2), 5);
   VERIFY_IS_EQUAL(entire_image_patch_row_major.dimension(3), 3);
   VERIFY_IS_EQUAL(entire_image_patch_row_major.dimension(4), 2);
 
   for (IndexType i = 0; i < 3; ++i) {
     for (IndexType j = 0; j < 5; ++j) {
-      IndexType patchId = i+3*j;
+      IndexType patchId = i + 3 * j;
       for (IndexType r = 0; r < 3; ++r) {
         for (IndexType c = 0; c < 5; ++c) {
           for (IndexType d = 0; d < 2; ++d) {
             for (IndexType b = 0; b < 7; ++b) {
               DataType expected_col_major = 0.0f;
               DataType expected_row_major = 0.0f;
-              if (r-1+i >= 0 && c-2+j >= 0 && r-1+i < 3 && c-2+j < 5) {
-                expected_col_major = tensor_col_major(d, r-1+i, c-2+j, b);
-                expected_row_major = tensor_row_major(b, c-2+j, r-1+i, d);
+              if (r - 1 + i >= 0 && c - 2 + j >= 0 && r - 1 + i < 3 && c - 2 + j < 5) {
+                expected_col_major = tensor_col_major(d, r - 1 + i, c - 2 + j, b);
+                expected_row_major = tensor_row_major(b, c - 2 + j, r - 1 + i, d);
               }
               // ColMajor
               if (entire_image_patch_col_major(d, r, c, patchId, b) != expected_col_major) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(entire_image_patch_col_major(d, r, c, patchId, b), expected_col_major);
               // RowMajor
-              if (entire_image_patch_row_major(b, patchId, c, r, d) !=
-                  expected_row_major) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j
-                     << " r=" << r << " c=" << c << " d=" << d << " b=" << b
-                     << std::endl;
+              if (entire_image_patch_row_major(b, patchId, c, r, d) != expected_row_major) {
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
-              VERIFY_IS_EQUAL(entire_image_patch_row_major(b, patchId, c, r, d),
-                              expected_row_major);
+              VERIFY_IS_EQUAL(entire_image_patch_row_major(b, patchId, c, r, d), expected_row_major);
               // Check that ColMajor and RowMajor agree.
               VERIFY_IS_EQUAL(expected_col_major, expected_row_major);
             }
@@ -169,36 +171,37 @@
   }
 
   // 2D patch: ColMajor
-  patchColMajorTensorRange={{sizeDim1, 2, 2, sizeDim2*sizeDim3, sizeDim4}};
-  Tensor<DataType, 5, DataLayout,IndexType> twod_patch_col_major(patchColMajorTensorRange);
-  patchTensorBuffSize =twod_patch_col_major.size()*sizeof(DataType);
-  DataType* gpu_data_twod_patch_col_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 5, DataLayout,IndexType>> gpu_twod_patch_col_major(gpu_data_twod_patch_col_major, patchColMajorTensorRange);
-  gpu_twod_patch_col_major.device(sycl_device)=gpu_col_major.extract_image_patches(2, 2);
+  patchColMajorTensorRange = {{sizeDim1, 2, 2, sizeDim2 * sizeDim3, sizeDim4}};
+  Tensor<DataType, 5, DataLayout, IndexType> twod_patch_col_major(patchColMajorTensorRange);
+  patchTensorBuffSize = twod_patch_col_major.size() * sizeof(DataType);
+  DataType* gpu_data_twod_patch_col_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu_twod_patch_col_major(gpu_data_twod_patch_col_major,
+                                                                                 patchColMajorTensorRange);
+  gpu_twod_patch_col_major.device(sycl_device) = gpu_col_major.extract_image_patches(2, 2);
   sycl_device.memcpyDeviceToHost(twod_patch_col_major.data(), gpu_data_twod_patch_col_major, patchTensorBuffSize);
 
   VERIFY_IS_EQUAL(twod_patch_col_major.dimension(0), 2);
   VERIFY_IS_EQUAL(twod_patch_col_major.dimension(1), 2);
   VERIFY_IS_EQUAL(twod_patch_col_major.dimension(2), 2);
-  VERIFY_IS_EQUAL(twod_patch_col_major.dimension(3), 3*5);
+  VERIFY_IS_EQUAL(twod_patch_col_major.dimension(3), 3 * 5);
   VERIFY_IS_EQUAL(twod_patch_col_major.dimension(4), 7);
 
   // 2D patch: RowMajor
-  patchRowMajorTensorRange={{sizeDim4, sizeDim2*sizeDim3, 2, 2, sizeDim1}};
-  Tensor<DataType, 5, RowMajor,IndexType> twod_patch_row_major(patchRowMajorTensorRange);
-  patchTensorBuffSize =twod_patch_row_major.size()*sizeof(DataType);
-  DataType* gpu_data_twod_patch_row_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 5, RowMajor,IndexType>> gpu_twod_patch_row_major(gpu_data_twod_patch_row_major, patchRowMajorTensorRange);
-  gpu_twod_patch_row_major.device(sycl_device)=gpu_row_major.extract_image_patches(2, 2);
+  patchRowMajorTensorRange = {{sizeDim4, sizeDim2 * sizeDim3, 2, 2, sizeDim1}};
+  Tensor<DataType, 5, RowMajor, IndexType> twod_patch_row_major(patchRowMajorTensorRange);
+  patchTensorBuffSize = twod_patch_row_major.size() * sizeof(DataType);
+  DataType* gpu_data_twod_patch_row_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 5, RowMajor, IndexType>> gpu_twod_patch_row_major(gpu_data_twod_patch_row_major,
+                                                                               patchRowMajorTensorRange);
+  gpu_twod_patch_row_major.device(sycl_device) = gpu_row_major.extract_image_patches(2, 2);
   sycl_device.memcpyDeviceToHost(twod_patch_row_major.data(), gpu_data_twod_patch_row_major, patchTensorBuffSize);
 
   VERIFY_IS_EQUAL(twod_patch_row_major.dimension(0), 7);
-  VERIFY_IS_EQUAL(twod_patch_row_major.dimension(1), 3*5);
+  VERIFY_IS_EQUAL(twod_patch_row_major.dimension(1), 3 * 5);
   VERIFY_IS_EQUAL(twod_patch_row_major.dimension(2), 2);
   VERIFY_IS_EQUAL(twod_patch_row_major.dimension(3), 2);
   VERIFY_IS_EQUAL(twod_patch_row_major.dimension(4), 2);
 
-
   // Based on the calculation described in TensorTraits.h, padding happens to be 0.
   IndexType row_padding = 0;
   IndexType col_padding = 0;
@@ -206,31 +209,34 @@
 
   for (IndexType i = 0; i < 3; ++i) {
     for (IndexType j = 0; j < 5; ++j) {
-      IndexType patchId = i+3*j;
+      IndexType patchId = i + 3 * j;
       for (IndexType r = 0; r < 2; ++r) {
         for (IndexType c = 0; c < 2; ++c) {
           for (IndexType d = 0; d < 2; ++d) {
             for (IndexType b = 0; b < 7; ++b) {
               DataType expected_col_major = 0.0f;
               DataType expected_row_major = 0.0f;
-              IndexType row_offset = r*stride + i - row_padding;
-              IndexType col_offset = c*stride + j - col_padding;
+              IndexType row_offset = r * stride + i - row_padding;
+              IndexType col_offset = c * stride + j - col_padding;
               // ColMajor
-              if (row_offset >= 0 && col_offset >= 0 && row_offset < tensor_col_major.dimension(1) && col_offset < tensor_col_major.dimension(2)) {
+              if (row_offset >= 0 && col_offset >= 0 && row_offset < tensor_col_major.dimension(1) &&
+                  col_offset < tensor_col_major.dimension(2)) {
                 expected_col_major = tensor_col_major(d, row_offset, col_offset, b);
               }
               if (twod_patch_col_major(d, r, c, patchId, b) != expected_col_major) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(twod_patch_col_major(d, r, c, patchId, b), expected_col_major);
 
               // RowMajor
-              if (row_offset >= 0 && col_offset >= 0 && row_offset < tensor_row_major.dimension(2) && col_offset < tensor_row_major.dimension(1)) {
+              if (row_offset >= 0 && col_offset >= 0 && row_offset < tensor_row_major.dimension(2) &&
+                  col_offset < tensor_row_major.dimension(1)) {
                 expected_row_major = tensor_row_major(b, col_offset, row_offset, d);
-
               }
               if (twod_patch_row_major(b, patchId, c, r, d) != expected_row_major) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(twod_patch_row_major(b, patchId, c, r, d), expected_row_major);
               // Check that ColMajor and RowMajor agree.
@@ -250,33 +256,35 @@
   sycl_device.deallocate(gpu_data_entire_image_patch_row_major);
   sycl_device.deallocate(gpu_data_twod_patch_col_major);
   sycl_device.deallocate(gpu_data_twod_patch_row_major);
-
 }
 
-
 // Verifies VALID padding (no padding) with incrementing values.
 template <typename DataType, typename IndexType>
-static void test_patch_padding_valid_sycl(const Eigen::SyclDevice& sycl_device){
+static void test_patch_padding_valid_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType input_depth = 3;
   IndexType input_rows = 3;
   IndexType input_cols = 3;
   IndexType input_batches = 1;
-  IndexType ksize = 2;  // Corresponds to the Rows and Cols for tensor.extract_image_patches<>.
+  IndexType ksize = 2;   // Corresponds to the Rows and Cols for tensor.extract_image_patches<>.
   IndexType stride = 2;  // Only same stride is supported.
 
   array<IndexType, 4> tensorColMajorRange = {{input_depth, input_rows, input_cols, input_batches}};
   array<IndexType, 4> tensorRowMajorRange = {{input_batches, input_cols, input_rows, input_depth}};
-  Tensor<DataType, 4, DataLayout,IndexType> tensor_col_major(tensorColMajorRange);
-  Tensor<DataType, 4, RowMajor,IndexType> tensor_row_major(tensorRowMajorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> tensor_col_major(tensorColMajorRange);
+  Tensor<DataType, 4, RowMajor, IndexType> tensor_row_major(tensorRowMajorRange);
 
-  DataType* gpu_data_col_major  = static_cast<DataType*>(sycl_device.allocate(tensor_col_major.size()*sizeof(DataType)));
-  DataType* gpu_data_row_major  = static_cast<DataType*>(sycl_device.allocate(tensor_row_major.size()*sizeof(DataType)));
+  DataType* gpu_data_col_major =
+      static_cast<DataType*>(sycl_device.allocate(tensor_col_major.size() * sizeof(DataType)));
+  DataType* gpu_data_row_major =
+      static_cast<DataType*>(sycl_device.allocate(tensor_row_major.size() * sizeof(DataType)));
   TensorMap<Tensor<DataType, 4, ColMajor, IndexType>> gpu_col_major(gpu_data_col_major, tensorColMajorRange);
   TensorMap<Tensor<DataType, 4, RowMajor, IndexType>> gpu_row_major(gpu_data_row_major, tensorRowMajorRange);
 
-  sycl_device.memcpyHostToDevice(gpu_data_col_major, tensor_col_major.data(),(tensor_col_major.size())*sizeof(DataType));
-  gpu_row_major.device(sycl_device)=gpu_col_major.swap_layout();
-  sycl_device.memcpyDeviceToHost(tensor_row_major.data(), gpu_data_row_major, (tensor_col_major.size())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_data_col_major, tensor_col_major.data(),
+                                 (tensor_col_major.size()) * sizeof(DataType));
+  gpu_row_major.device(sycl_device) = gpu_col_major.swap_layout();
+  sycl_device.memcpyDeviceToHost(tensor_row_major.data(), gpu_data_row_major,
+                                 (tensor_col_major.size()) * sizeof(DataType));
 
   VERIFY_IS_EQUAL(tensor_col_major.dimension(0), tensor_row_major.dimension(3));
   VERIFY_IS_EQUAL(tensor_col_major.dimension(1), tensor_row_major.dimension(2));
@@ -288,27 +296,31 @@
     tensor_col_major.data()[i] = i + 1;
   }
   // ColMajor
-  array<IndexType, 5> patchColMajorTensorRange={{input_depth, ksize, ksize, 1, input_batches}};
-  Tensor<DataType, 5, DataLayout,IndexType> result_col_major(patchColMajorTensorRange);
-  size_t patchTensorBuffSize =result_col_major.size()*sizeof(DataType);
-  DataType* gpu_data_result_col_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 5, DataLayout,IndexType>> gpu_result_col_major(gpu_data_result_col_major, patchColMajorTensorRange);
-  gpu_result_col_major.device(sycl_device)=gpu_col_major.extract_image_patches(ksize, ksize, stride, stride, 1, 1, PADDING_VALID);
+  array<IndexType, 5> patchColMajorTensorRange = {{input_depth, ksize, ksize, 1, input_batches}};
+  Tensor<DataType, 5, DataLayout, IndexType> result_col_major(patchColMajorTensorRange);
+  size_t patchTensorBuffSize = result_col_major.size() * sizeof(DataType);
+  DataType* gpu_data_result_col_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu_result_col_major(gpu_data_result_col_major,
+                                                                             patchColMajorTensorRange);
+  gpu_result_col_major.device(sycl_device) =
+      gpu_col_major.extract_image_patches(ksize, ksize, stride, stride, 1, 1, PADDING_VALID);
   sycl_device.memcpyDeviceToHost(result_col_major.data(), gpu_data_result_col_major, patchTensorBuffSize);
 
-  VERIFY_IS_EQUAL(result_col_major.dimension(0), input_depth);  // depth
-  VERIFY_IS_EQUAL(result_col_major.dimension(1), ksize);  // kernel rows
-  VERIFY_IS_EQUAL(result_col_major.dimension(2), ksize);  // kernel cols
-  VERIFY_IS_EQUAL(result_col_major.dimension(3), 1);  // number of patches
+  VERIFY_IS_EQUAL(result_col_major.dimension(0), input_depth);    // depth
+  VERIFY_IS_EQUAL(result_col_major.dimension(1), ksize);          // kernel rows
+  VERIFY_IS_EQUAL(result_col_major.dimension(2), ksize);          // kernel cols
+  VERIFY_IS_EQUAL(result_col_major.dimension(3), 1);              // number of patches
   VERIFY_IS_EQUAL(result_col_major.dimension(4), input_batches);  // number of batches
 
   // RowMajor
-  array<IndexType, 5> patchRowMajorTensorRange={{input_batches, 1, ksize, ksize, input_depth }};
-  Tensor<DataType, 5, RowMajor,IndexType> result_row_major(patchRowMajorTensorRange);
-  patchTensorBuffSize =result_row_major.size()*sizeof(DataType);
-  DataType* gpu_data_result_row_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 5, RowMajor,IndexType>> gpu_result_row_major(gpu_data_result_row_major, patchRowMajorTensorRange);
-  gpu_result_row_major.device(sycl_device)=gpu_row_major.extract_image_patches(ksize, ksize, stride, stride, 1, 1, PADDING_VALID);
+  array<IndexType, 5> patchRowMajorTensorRange = {{input_batches, 1, ksize, ksize, input_depth}};
+  Tensor<DataType, 5, RowMajor, IndexType> result_row_major(patchRowMajorTensorRange);
+  patchTensorBuffSize = result_row_major.size() * sizeof(DataType);
+  DataType* gpu_data_result_row_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 5, RowMajor, IndexType>> gpu_result_row_major(gpu_data_result_row_major,
+                                                                           patchRowMajorTensorRange);
+  gpu_result_row_major.device(sycl_device) =
+      gpu_row_major.extract_image_patches(ksize, ksize, stride, stride, 1, 1, PADDING_VALID);
   sycl_device.memcpyDeviceToHost(result_row_major.data(), gpu_data_result_row_major, patchTensorBuffSize);
 
   VERIFY_IS_EQUAL(result_col_major.dimension(0), result_row_major.dimension(4));
@@ -321,12 +333,12 @@
   IndexType row_padding = 0;
   IndexType col_padding = 0;
 
-  for (IndexType i = 0; (i+stride+ksize-1) < input_rows; i += stride) {  // input rows
-    for (IndexType j = 0; (j+stride+ksize-1) < input_cols; j += stride) {  // input cols
-      IndexType patchId = i+input_rows*j;
-      for (IndexType r = 0; r < ksize; ++r) {  // patch rows
-        for (IndexType c = 0; c < ksize; ++c) {  // patch cols
-          for (IndexType d = 0; d < input_depth; ++d) {  // depth
+  for (IndexType i = 0; (i + stride + ksize - 1) < input_rows; i += stride) {    // input rows
+    for (IndexType j = 0; (j + stride + ksize - 1) < input_cols; j += stride) {  // input cols
+      IndexType patchId = i + input_rows * j;
+      for (IndexType r = 0; r < ksize; ++r) {                // patch rows
+        for (IndexType c = 0; c < ksize; ++c) {              // patch cols
+          for (IndexType d = 0; d < input_depth; ++d) {      // depth
             for (IndexType b = 0; b < input_batches; ++b) {  // batch
               DataType expected_col_major = 0.0f;
               DataType expected_row_major = 0.0f;
@@ -338,12 +350,14 @@
               }
               // ColMajor
               if (result_col_major(d, r, c, patchId, b) != expected_col_major) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(result_col_major(d, r, c, patchId, b), expected_col_major);
               // RowMajor
               if (result_row_major(b, patchId, c, r, d) != expected_row_major) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(result_row_major(b, patchId, c, r, d), expected_row_major);
               // Check that ColMajor and RowMajor agree.
@@ -362,54 +376,62 @@
 
 // Verifies VALID padding (no padding) with the same value.
 template <typename DataType, typename IndexType>
-static void test_patch_padding_valid_same_value_sycl(const Eigen::SyclDevice& sycl_device){
+static void test_patch_padding_valid_same_value_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType input_depth = 1;
   IndexType input_rows = 5;
   IndexType input_cols = 5;
   IndexType input_batches = 2;
-  IndexType ksize = 3;  // Corresponds to the Rows and Cols for tensor.extract_image_patches<>.
+  IndexType ksize = 3;   // Corresponds to the Rows and Cols for tensor.extract_image_patches<>.
   IndexType stride = 2;  // Only same stride is supported.
   // ColMajor
 
   array<IndexType, 4> tensorColMajorRange = {{input_depth, input_rows, input_cols, input_batches}};
   array<IndexType, 4> tensorRowMajorRange = {{input_batches, input_cols, input_rows, input_depth}};
-  Tensor<DataType, 4, DataLayout,IndexType> tensor_col_major(tensorColMajorRange);
-  Tensor<DataType, 4, RowMajor,IndexType> tensor_row_major(tensorRowMajorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> tensor_col_major(tensorColMajorRange);
+  Tensor<DataType, 4, RowMajor, IndexType> tensor_row_major(tensorRowMajorRange);
 
-  DataType* gpu_data_col_major  = static_cast<DataType*>(sycl_device.allocate(tensor_col_major.size()*sizeof(DataType)));
-  DataType* gpu_data_row_major  = static_cast<DataType*>(sycl_device.allocate(tensor_row_major.size()*sizeof(DataType)));
+  DataType* gpu_data_col_major =
+      static_cast<DataType*>(sycl_device.allocate(tensor_col_major.size() * sizeof(DataType)));
+  DataType* gpu_data_row_major =
+      static_cast<DataType*>(sycl_device.allocate(tensor_row_major.size() * sizeof(DataType)));
   TensorMap<Tensor<DataType, 4, ColMajor, IndexType>> gpu_col_major(gpu_data_col_major, tensorColMajorRange);
   TensorMap<Tensor<DataType, 4, RowMajor, IndexType>> gpu_row_major(gpu_data_row_major, tensorRowMajorRange);
-  gpu_col_major.device(sycl_device)=gpu_col_major.constant(11.0f);
-  gpu_row_major.device(sycl_device)=gpu_col_major.swap_layout();
-  sycl_device.memcpyDeviceToHost(tensor_col_major.data(), gpu_data_col_major, (tensor_col_major.size())*sizeof(DataType));
-  sycl_device.memcpyDeviceToHost(tensor_row_major.data(), gpu_data_row_major, (tensor_row_major.size())*sizeof(DataType));
+  gpu_col_major.device(sycl_device) = gpu_col_major.constant(11.0f);
+  gpu_row_major.device(sycl_device) = gpu_col_major.swap_layout();
+  sycl_device.memcpyDeviceToHost(tensor_col_major.data(), gpu_data_col_major,
+                                 (tensor_col_major.size()) * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(tensor_row_major.data(), gpu_data_row_major,
+                                 (tensor_row_major.size()) * sizeof(DataType));
   VERIFY_IS_EQUAL(tensor_col_major.dimension(0), tensor_row_major.dimension(3));
   VERIFY_IS_EQUAL(tensor_col_major.dimension(1), tensor_row_major.dimension(2));
   VERIFY_IS_EQUAL(tensor_col_major.dimension(2), tensor_row_major.dimension(1));
   VERIFY_IS_EQUAL(tensor_col_major.dimension(3), tensor_row_major.dimension(0));
 
-  array<IndexType, 5> patchColMajorTensorRange={{input_depth, ksize, ksize, 4, input_batches}};
-  Tensor<DataType, 5, DataLayout,IndexType> result_col_major(patchColMajorTensorRange);
-  size_t patchTensorBuffSize =result_col_major.size()*sizeof(DataType);
-  DataType* gpu_data_result_col_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 5, DataLayout,IndexType>> gpu_result_col_major(gpu_data_result_col_major, patchColMajorTensorRange);
-  gpu_result_col_major.device(sycl_device)=gpu_col_major.extract_image_patches(ksize, ksize, stride, stride, 1, 1, PADDING_VALID);
+  array<IndexType, 5> patchColMajorTensorRange = {{input_depth, ksize, ksize, 4, input_batches}};
+  Tensor<DataType, 5, DataLayout, IndexType> result_col_major(patchColMajorTensorRange);
+  size_t patchTensorBuffSize = result_col_major.size() * sizeof(DataType);
+  DataType* gpu_data_result_col_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu_result_col_major(gpu_data_result_col_major,
+                                                                             patchColMajorTensorRange);
+  gpu_result_col_major.device(sycl_device) =
+      gpu_col_major.extract_image_patches(ksize, ksize, stride, stride, 1, 1, PADDING_VALID);
   sycl_device.memcpyDeviceToHost(result_col_major.data(), gpu_data_result_col_major, patchTensorBuffSize);
 
-  VERIFY_IS_EQUAL(result_col_major.dimension(0), input_depth);  // depth
-  VERIFY_IS_EQUAL(result_col_major.dimension(1), ksize);  // kernel rows
-  VERIFY_IS_EQUAL(result_col_major.dimension(2), ksize);  // kernel cols
-  VERIFY_IS_EQUAL(result_col_major.dimension(3), 4);  // number of patches
+  VERIFY_IS_EQUAL(result_col_major.dimension(0), input_depth);    // depth
+  VERIFY_IS_EQUAL(result_col_major.dimension(1), ksize);          // kernel rows
+  VERIFY_IS_EQUAL(result_col_major.dimension(2), ksize);          // kernel cols
+  VERIFY_IS_EQUAL(result_col_major.dimension(3), 4);              // number of patches
   VERIFY_IS_EQUAL(result_col_major.dimension(4), input_batches);  // number of batches
 
   // RowMajor
-  array<IndexType, 5> patchRowMajorTensorRange={{input_batches, 4, ksize, ksize, input_depth }};
-  Tensor<DataType, 5, RowMajor,IndexType> result_row_major(patchRowMajorTensorRange);
-  patchTensorBuffSize =result_row_major.size()*sizeof(DataType);
-  DataType* gpu_data_result_row_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 5, RowMajor,IndexType>> gpu_result_row_major(gpu_data_result_row_major, patchRowMajorTensorRange);
-  gpu_result_row_major.device(sycl_device)=gpu_row_major.extract_image_patches(ksize, ksize, stride, stride, 1, 1, PADDING_VALID);
+  array<IndexType, 5> patchRowMajorTensorRange = {{input_batches, 4, ksize, ksize, input_depth}};
+  Tensor<DataType, 5, RowMajor, IndexType> result_row_major(patchRowMajorTensorRange);
+  patchTensorBuffSize = result_row_major.size() * sizeof(DataType);
+  DataType* gpu_data_result_row_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 5, RowMajor, IndexType>> gpu_result_row_major(gpu_data_result_row_major,
+                                                                           patchRowMajorTensorRange);
+  gpu_result_row_major.device(sycl_device) =
+      gpu_row_major.extract_image_patches(ksize, ksize, stride, stride, 1, 1, PADDING_VALID);
   sycl_device.memcpyDeviceToHost(result_row_major.data(), gpu_data_result_row_major, patchTensorBuffSize);
 
   VERIFY_IS_EQUAL(result_col_major.dimension(0), result_row_major.dimension(4));
@@ -422,12 +444,12 @@
   IndexType row_padding = 0;
   IndexType col_padding = 0;
 
-  for (IndexType i = 0; (i+stride+ksize-1) <= input_rows; i += stride) {  // input rows
-    for (IndexType j = 0; (j+stride+ksize-1) <= input_cols; j += stride) {  // input cols
-      IndexType patchId = i+input_rows*j;
-      for (IndexType r = 0; r < ksize; ++r) {  // patch rows
-        for (IndexType c = 0; c < ksize; ++c) {  // patch cols
-          for (IndexType d = 0; d < input_depth; ++d) {  // depth
+  for (IndexType i = 0; (i + stride + ksize - 1) <= input_rows; i += stride) {    // input rows
+    for (IndexType j = 0; (j + stride + ksize - 1) <= input_cols; j += stride) {  // input cols
+      IndexType patchId = i + input_rows * j;
+      for (IndexType r = 0; r < ksize; ++r) {                // patch rows
+        for (IndexType c = 0; c < ksize; ++c) {              // patch cols
+          for (IndexType d = 0; d < input_depth; ++d) {      // depth
             for (IndexType b = 0; b < input_batches; ++b) {  // batch
               DataType expected_col_major = 0.0f;
               DataType expected_row_major = 0.0f;
@@ -439,12 +461,14 @@
               }
               // ColMajor
               if (result_col_major(d, r, c, patchId, b) != expected_col_major) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(result_col_major(d, r, c, patchId, b), expected_col_major);
               // RowMajor
               if (result_row_major(b, patchId, c, r, d) != expected_row_major) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(result_row_major(b, patchId, c, r, d), expected_row_major);
               // Check that ColMajor and RowMajor agree.
@@ -459,28 +483,32 @@
 
 // Verifies SAME padding.
 template <typename DataType, typename IndexType>
-static void test_patch_padding_same_sycl(const Eigen::SyclDevice& sycl_device){
+static void test_patch_padding_same_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType input_depth = 3;
   IndexType input_rows = 4;
   IndexType input_cols = 2;
   IndexType input_batches = 1;
-  IndexType ksize = 2;  // Corresponds to the Rows and Cols for tensor.extract_image_patches<>.
+  IndexType ksize = 2;   // Corresponds to the Rows and Cols for tensor.extract_image_patches<>.
   IndexType stride = 2;  // Only same stride is supported.
 
   // ColMajor
   array<IndexType, 4> tensorColMajorRange = {{input_depth, input_rows, input_cols, input_batches}};
   array<IndexType, 4> tensorRowMajorRange = {{input_batches, input_cols, input_rows, input_depth}};
-  Tensor<DataType, 4, DataLayout,IndexType> tensor_col_major(tensorColMajorRange);
-  Tensor<DataType, 4, RowMajor,IndexType> tensor_row_major(tensorRowMajorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> tensor_col_major(tensorColMajorRange);
+  Tensor<DataType, 4, RowMajor, IndexType> tensor_row_major(tensorRowMajorRange);
 
-  DataType* gpu_data_col_major  = static_cast<DataType*>(sycl_device.allocate(tensor_col_major.size()*sizeof(DataType)));
-  DataType* gpu_data_row_major  = static_cast<DataType*>(sycl_device.allocate(tensor_row_major.size()*sizeof(DataType)));
+  DataType* gpu_data_col_major =
+      static_cast<DataType*>(sycl_device.allocate(tensor_col_major.size() * sizeof(DataType)));
+  DataType* gpu_data_row_major =
+      static_cast<DataType*>(sycl_device.allocate(tensor_row_major.size() * sizeof(DataType)));
   TensorMap<Tensor<DataType, 4, ColMajor, IndexType>> gpu_col_major(gpu_data_col_major, tensorColMajorRange);
   TensorMap<Tensor<DataType, 4, RowMajor, IndexType>> gpu_row_major(gpu_data_row_major, tensorRowMajorRange);
 
-  sycl_device.memcpyHostToDevice(gpu_data_col_major, tensor_col_major.data(),(tensor_col_major.size())*sizeof(DataType));
-  gpu_row_major.device(sycl_device)=gpu_col_major.swap_layout();
-  sycl_device.memcpyDeviceToHost(tensor_row_major.data(), gpu_data_row_major, (tensor_col_major.size())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_data_col_major, tensor_col_major.data(),
+                                 (tensor_col_major.size()) * sizeof(DataType));
+  gpu_row_major.device(sycl_device) = gpu_col_major.swap_layout();
+  sycl_device.memcpyDeviceToHost(tensor_row_major.data(), gpu_data_row_major,
+                                 (tensor_col_major.size()) * sizeof(DataType));
 
   VERIFY_IS_EQUAL(tensor_col_major.dimension(0), tensor_row_major.dimension(3));
   VERIFY_IS_EQUAL(tensor_col_major.dimension(1), tensor_row_major.dimension(2));
@@ -492,29 +520,32 @@
     tensor_col_major.data()[i] = i + 1;
   }
 
-array<IndexType, 5> patchColMajorTensorRange={{input_depth, ksize, ksize, 2, input_batches}};
-Tensor<DataType, 5, DataLayout,IndexType> result_col_major(patchColMajorTensorRange);
-size_t patchTensorBuffSize =result_col_major.size()*sizeof(DataType);
-DataType* gpu_data_result_col_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-TensorMap<Tensor<DataType, 5, DataLayout,IndexType>> gpu_result_col_major(gpu_data_result_col_major, patchColMajorTensorRange);
-gpu_result_col_major.device(sycl_device)=gpu_col_major.extract_image_patches(ksize, ksize, stride, stride, PADDING_SAME);
-sycl_device.memcpyDeviceToHost(result_col_major.data(), gpu_data_result_col_major, patchTensorBuffSize);
+  array<IndexType, 5> patchColMajorTensorRange = {{input_depth, ksize, ksize, 2, input_batches}};
+  Tensor<DataType, 5, DataLayout, IndexType> result_col_major(patchColMajorTensorRange);
+  size_t patchTensorBuffSize = result_col_major.size() * sizeof(DataType);
+  DataType* gpu_data_result_col_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu_result_col_major(gpu_data_result_col_major,
+                                                                             patchColMajorTensorRange);
+  gpu_result_col_major.device(sycl_device) =
+      gpu_col_major.extract_image_patches(ksize, ksize, stride, stride, PADDING_SAME);
+  sycl_device.memcpyDeviceToHost(result_col_major.data(), gpu_data_result_col_major, patchTensorBuffSize);
 
-
-  VERIFY_IS_EQUAL(result_col_major.dimension(0), input_depth);  // depth
-  VERIFY_IS_EQUAL(result_col_major.dimension(1), ksize);  // kernel rows
-  VERIFY_IS_EQUAL(result_col_major.dimension(2), ksize);  // kernel cols
-  VERIFY_IS_EQUAL(result_col_major.dimension(3), 2);  // number of patches
+  VERIFY_IS_EQUAL(result_col_major.dimension(0), input_depth);    // depth
+  VERIFY_IS_EQUAL(result_col_major.dimension(1), ksize);          // kernel rows
+  VERIFY_IS_EQUAL(result_col_major.dimension(2), ksize);          // kernel cols
+  VERIFY_IS_EQUAL(result_col_major.dimension(3), 2);              // number of patches
   VERIFY_IS_EQUAL(result_col_major.dimension(4), input_batches);  // number of batches
 
   // RowMajor
 
-  array<IndexType, 5> patchRowMajorTensorRange={{input_batches, 2, ksize, ksize, input_depth }};
-  Tensor<DataType, 5, RowMajor,IndexType> result_row_major(patchRowMajorTensorRange);
-  patchTensorBuffSize =result_row_major.size()*sizeof(DataType);
-  DataType* gpu_data_result_row_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 5, RowMajor,IndexType>> gpu_result_row_major(gpu_data_result_row_major, patchRowMajorTensorRange);
-  gpu_result_row_major.device(sycl_device)=gpu_row_major.extract_image_patches(ksize, ksize, stride, stride, PADDING_SAME);
+  array<IndexType, 5> patchRowMajorTensorRange = {{input_batches, 2, ksize, ksize, input_depth}};
+  Tensor<DataType, 5, RowMajor, IndexType> result_row_major(patchRowMajorTensorRange);
+  patchTensorBuffSize = result_row_major.size() * sizeof(DataType);
+  DataType* gpu_data_result_row_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 5, RowMajor, IndexType>> gpu_result_row_major(gpu_data_result_row_major,
+                                                                           patchRowMajorTensorRange);
+  gpu_result_row_major.device(sycl_device) =
+      gpu_row_major.extract_image_patches(ksize, ksize, stride, stride, PADDING_SAME);
   sycl_device.memcpyDeviceToHost(result_row_major.data(), gpu_data_result_row_major, patchTensorBuffSize);
 
   VERIFY_IS_EQUAL(result_col_major.dimension(0), result_row_major.dimension(4));
@@ -527,29 +558,31 @@
   IndexType row_padding = 0;
   IndexType col_padding = 0;
 
-  for (IndexType i = 0; (i+stride+ksize-1) <= input_rows; i += stride) {  // input rows
-    for (IndexType j = 0; (j+stride+ksize-1) <= input_cols; j += stride) {  // input cols
-      IndexType patchId = i+input_rows*j;
-      for (IndexType r = 0; r < ksize; ++r) {  // patch rows
-        for (IndexType c = 0; c < ksize; ++c) {  // patch cols
-          for (IndexType d = 0; d < input_depth; ++d) {  // depth
+  for (IndexType i = 0; (i + stride + ksize - 1) <= input_rows; i += stride) {    // input rows
+    for (IndexType j = 0; (j + stride + ksize - 1) <= input_cols; j += stride) {  // input cols
+      IndexType patchId = i + input_rows * j;
+      for (IndexType r = 0; r < ksize; ++r) {                // patch rows
+        for (IndexType c = 0; c < ksize; ++c) {              // patch cols
+          for (IndexType d = 0; d < input_depth; ++d) {      // depth
             for (IndexType b = 0; b < input_batches; ++b) {  // batch
               DataType expected_col_major = 0.0f;
               DataType expected_row_major = 0.0f;
-              IndexType row_offset = r*stride + i - row_padding;
-              IndexType col_offset = c*stride + j - col_padding;
+              IndexType row_offset = r * stride + i - row_padding;
+              IndexType col_offset = c * stride + j - col_padding;
               if (row_offset >= 0 && col_offset >= 0 && row_offset < input_rows && col_offset < input_cols) {
                 expected_col_major = tensor_col_major(d, row_offset, col_offset, b);
                 expected_row_major = tensor_row_major(b, col_offset, row_offset, d);
               }
               // ColMajor
               if (result_col_major(d, r, c, patchId, b) != expected_col_major) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(result_col_major(d, r, c, patchId, b), expected_col_major);
               // RowMajor
               if (result_row_major(b, patchId, c, r, d) != expected_row_major) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(result_row_major(b, patchId, c, r, d), expected_row_major);
               // Check that ColMajor and RowMajor agree.
@@ -562,10 +595,8 @@
   }
 }
 
-
 template <typename DataType, typename IndexType>
-static void test_patch_no_extra_dim_sycl(const Eigen::SyclDevice& sycl_device){
-
+static void test_patch_no_extra_dim_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType sizeDim1 = 2;
   IndexType sizeDim2 = 3;
   IndexType sizeDim3 = 5;
@@ -573,48 +604,53 @@
   // ColMajor
   array<IndexType, 3> tensorColMajorRange = {{sizeDim1, sizeDim2, sizeDim3}};
   array<IndexType, 3> tensorRowMajorRange = {{sizeDim3, sizeDim2, sizeDim1}};
-  Tensor<DataType, 3, DataLayout,IndexType> tensor_col_major(tensorColMajorRange);
+  Tensor<DataType, 3, DataLayout, IndexType> tensor_col_major(tensorColMajorRange);
   tensor_col_major.setRandom();
-  Tensor<DataType, 3, RowMajor,IndexType> tensor_row_major(tensorRowMajorRange);
+  Tensor<DataType, 3, RowMajor, IndexType> tensor_row_major(tensorRowMajorRange);
 
-  DataType* gpu_data_col_major  = static_cast<DataType*>(sycl_device.allocate(tensor_col_major.size()*sizeof(DataType)));
-  DataType* gpu_data_row_major  = static_cast<DataType*>(sycl_device.allocate(tensor_row_major.size()*sizeof(DataType)));
+  DataType* gpu_data_col_major =
+      static_cast<DataType*>(sycl_device.allocate(tensor_col_major.size() * sizeof(DataType)));
+  DataType* gpu_data_row_major =
+      static_cast<DataType*>(sycl_device.allocate(tensor_row_major.size() * sizeof(DataType)));
   TensorMap<Tensor<DataType, 3, ColMajor, IndexType>> gpu_col_major(gpu_data_col_major, tensorColMajorRange);
   TensorMap<Tensor<DataType, 3, RowMajor, IndexType>> gpu_row_major(gpu_data_row_major, tensorRowMajorRange);
 
-  sycl_device.memcpyHostToDevice(gpu_data_col_major, tensor_col_major.data(),(tensor_col_major.size())*sizeof(DataType));
-  gpu_row_major.device(sycl_device)=gpu_col_major.swap_layout();
-  sycl_device.memcpyDeviceToHost(tensor_row_major.data(), gpu_data_row_major, (tensor_row_major.size())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_data_col_major, tensor_col_major.data(),
+                                 (tensor_col_major.size()) * sizeof(DataType));
+  gpu_row_major.device(sycl_device) = gpu_col_major.swap_layout();
+  sycl_device.memcpyDeviceToHost(tensor_row_major.data(), gpu_data_row_major,
+                                 (tensor_row_major.size()) * sizeof(DataType));
 
   VERIFY_IS_EQUAL(tensor_col_major.dimension(0), tensor_row_major.dimension(2));
   VERIFY_IS_EQUAL(tensor_col_major.dimension(1), tensor_row_major.dimension(1));
   VERIFY_IS_EQUAL(tensor_col_major.dimension(2), tensor_row_major.dimension(0));
 
-
   // Single pixel patch: ColMajor
-  array<IndexType, 4> patchColMajorTensorRange={{sizeDim1, 1, 1, sizeDim2*sizeDim3}};
-  Tensor<DataType, 4, DataLayout,IndexType> single_patch_col_major(patchColMajorTensorRange);
-  size_t patchTensorBuffSize =single_patch_col_major.size()*sizeof(DataType);
-  DataType* gpu_data_single_patch_col_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 4, DataLayout,IndexType>> gpu_single_patch_col_major(gpu_data_single_patch_col_major, patchColMajorTensorRange);
-  gpu_single_patch_col_major.device(sycl_device)=gpu_col_major.extract_image_patches(1, 1);
+  array<IndexType, 4> patchColMajorTensorRange = {{sizeDim1, 1, 1, sizeDim2 * sizeDim3}};
+  Tensor<DataType, 4, DataLayout, IndexType> single_patch_col_major(patchColMajorTensorRange);
+  size_t patchTensorBuffSize = single_patch_col_major.size() * sizeof(DataType);
+  DataType* gpu_data_single_patch_col_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_single_patch_col_major(gpu_data_single_patch_col_major,
+                                                                                   patchColMajorTensorRange);
+  gpu_single_patch_col_major.device(sycl_device) = gpu_col_major.extract_image_patches(1, 1);
   sycl_device.memcpyDeviceToHost(single_patch_col_major.data(), gpu_data_single_patch_col_major, patchTensorBuffSize);
 
   VERIFY_IS_EQUAL(single_patch_col_major.dimension(0), sizeDim1);
   VERIFY_IS_EQUAL(single_patch_col_major.dimension(1), 1);
   VERIFY_IS_EQUAL(single_patch_col_major.dimension(2), 1);
-  VERIFY_IS_EQUAL(single_patch_col_major.dimension(3), sizeDim2*sizeDim3);
+  VERIFY_IS_EQUAL(single_patch_col_major.dimension(3), sizeDim2 * sizeDim3);
 
   // Single pixel patch: RowMajor
-  array<IndexType, 4> patchRowMajorTensorRange={{sizeDim2*sizeDim3, 1, 1, sizeDim1}};
-  Tensor<DataType, 4, RowMajor,IndexType> single_patch_row_major(patchRowMajorTensorRange);
-  patchTensorBuffSize =single_patch_row_major.size()*sizeof(DataType);
-  DataType* gpu_data_single_patch_row_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 4, RowMajor,IndexType>> gpu_single_patch_row_major(gpu_data_single_patch_row_major, patchRowMajorTensorRange);
-  gpu_single_patch_row_major.device(sycl_device)=gpu_row_major.extract_image_patches(1, 1);
+  array<IndexType, 4> patchRowMajorTensorRange = {{sizeDim2 * sizeDim3, 1, 1, sizeDim1}};
+  Tensor<DataType, 4, RowMajor, IndexType> single_patch_row_major(patchRowMajorTensorRange);
+  patchTensorBuffSize = single_patch_row_major.size() * sizeof(DataType);
+  DataType* gpu_data_single_patch_row_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 4, RowMajor, IndexType>> gpu_single_patch_row_major(gpu_data_single_patch_row_major,
+                                                                                 patchRowMajorTensorRange);
+  gpu_single_patch_row_major.device(sycl_device) = gpu_row_major.extract_image_patches(1, 1);
   sycl_device.memcpyDeviceToHost(single_patch_row_major.data(), gpu_data_single_patch_row_major, patchTensorBuffSize);
 
-  VERIFY_IS_EQUAL(single_patch_row_major.dimension(0), sizeDim2*sizeDim3);
+  VERIFY_IS_EQUAL(single_patch_row_major.dimension(0), sizeDim2 * sizeDim3);
   VERIFY_IS_EQUAL(single_patch_row_major.dimension(1), 1);
   VERIFY_IS_EQUAL(single_patch_row_major.dimension(2), 1);
   VERIFY_IS_EQUAL(single_patch_row_major.dimension(3), sizeDim1);
@@ -622,73 +658,75 @@
   for (IndexType i = 0; i < tensor_col_major.size(); ++i) {
     // ColMajor
     if (tensor_col_major.data()[i] != single_patch_col_major.data()[i]) {
-      std::cout << "Mismatch detected at index " << i << " : " << tensor_col_major.data()[i] << " vs " << single_patch_col_major.data()[i] << std::endl;
+      std::cout << "Mismatch detected at index " << i << " : " << tensor_col_major.data()[i] << " vs "
+                << single_patch_col_major.data()[i] << std::endl;
     }
     VERIFY_IS_EQUAL(single_patch_col_major.data()[i], tensor_col_major.data()[i]);
     // RowMajor
     if (tensor_row_major.data()[i] != single_patch_row_major.data()[i]) {
-      std::cout << "Mismatch detected at index " << i << " : "
-           << tensor_col_major.data()[i] << " vs "
-           << single_patch_row_major.data()[i] << std::endl;
+      std::cout << "Mismatch detected at index " << i << " : " << tensor_col_major.data()[i] << " vs "
+                << single_patch_row_major.data()[i] << std::endl;
     }
-    VERIFY_IS_EQUAL(single_patch_row_major.data()[i],
-                    tensor_row_major.data()[i]);
+    VERIFY_IS_EQUAL(single_patch_row_major.data()[i], tensor_row_major.data()[i]);
     VERIFY_IS_EQUAL(tensor_col_major.data()[i], tensor_row_major.data()[i]);
-    VERIFY_IS_EQUAL(single_patch_col_major.data()[i],
-                    single_patch_row_major.data()[i]);
+    VERIFY_IS_EQUAL(single_patch_col_major.data()[i], single_patch_row_major.data()[i]);
   }
 
   // Entire image patch: ColMajor
-  patchColMajorTensorRange={{sizeDim1, sizeDim2, sizeDim3, sizeDim2*sizeDim3}};
-  Tensor<DataType, 4, DataLayout,IndexType> entire_image_patch_col_major(patchColMajorTensorRange);
-  patchTensorBuffSize =entire_image_patch_col_major.size()*sizeof(DataType);
-  DataType* gpu_data_entire_image_patch_col_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 4, DataLayout,IndexType>> gpu_entire_image_patch_col_major(gpu_data_entire_image_patch_col_major, patchColMajorTensorRange);
-  gpu_entire_image_patch_col_major.device(sycl_device)=gpu_col_major.extract_image_patches(3, 5);
-  sycl_device.memcpyDeviceToHost(entire_image_patch_col_major.data(), gpu_data_entire_image_patch_col_major, patchTensorBuffSize);
+  patchColMajorTensorRange = {{sizeDim1, sizeDim2, sizeDim3, sizeDim2 * sizeDim3}};
+  Tensor<DataType, 4, DataLayout, IndexType> entire_image_patch_col_major(patchColMajorTensorRange);
+  patchTensorBuffSize = entire_image_patch_col_major.size() * sizeof(DataType);
+  DataType* gpu_data_entire_image_patch_col_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_entire_image_patch_col_major(
+      gpu_data_entire_image_patch_col_major, patchColMajorTensorRange);
+  gpu_entire_image_patch_col_major.device(sycl_device) = gpu_col_major.extract_image_patches(3, 5);
+  sycl_device.memcpyDeviceToHost(entire_image_patch_col_major.data(), gpu_data_entire_image_patch_col_major,
+                                 patchTensorBuffSize);
 
   VERIFY_IS_EQUAL(entire_image_patch_col_major.dimension(0), 2);
   VERIFY_IS_EQUAL(entire_image_patch_col_major.dimension(1), 3);
   VERIFY_IS_EQUAL(entire_image_patch_col_major.dimension(2), 5);
-  VERIFY_IS_EQUAL(entire_image_patch_col_major.dimension(3), 3*5);
+  VERIFY_IS_EQUAL(entire_image_patch_col_major.dimension(3), 3 * 5);
 
   // Entire image patch: RowMajor
-patchRowMajorTensorRange={{sizeDim2*sizeDim3, sizeDim3, sizeDim2, sizeDim1}};
-Tensor<DataType, 4, RowMajor,IndexType> entire_image_patch_row_major(patchRowMajorTensorRange);
-patchTensorBuffSize =entire_image_patch_row_major.size()*sizeof(DataType);
-DataType* gpu_data_entire_image_patch_row_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-TensorMap<Tensor<DataType, 4, RowMajor,IndexType>> gpu_entire_image_patch_row_major(gpu_data_entire_image_patch_row_major, patchRowMajorTensorRange);
-gpu_entire_image_patch_row_major.device(sycl_device)=gpu_row_major.extract_image_patches(3, 5);
-sycl_device.memcpyDeviceToHost(entire_image_patch_row_major.data(), gpu_data_entire_image_patch_row_major, patchTensorBuffSize);
-  VERIFY_IS_EQUAL(entire_image_patch_row_major.dimension(0), 3*5);
+  patchRowMajorTensorRange = {{sizeDim2 * sizeDim3, sizeDim3, sizeDim2, sizeDim1}};
+  Tensor<DataType, 4, RowMajor, IndexType> entire_image_patch_row_major(patchRowMajorTensorRange);
+  patchTensorBuffSize = entire_image_patch_row_major.size() * sizeof(DataType);
+  DataType* gpu_data_entire_image_patch_row_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 4, RowMajor, IndexType>> gpu_entire_image_patch_row_major(
+      gpu_data_entire_image_patch_row_major, patchRowMajorTensorRange);
+  gpu_entire_image_patch_row_major.device(sycl_device) = gpu_row_major.extract_image_patches(3, 5);
+  sycl_device.memcpyDeviceToHost(entire_image_patch_row_major.data(), gpu_data_entire_image_patch_row_major,
+                                 patchTensorBuffSize);
+  VERIFY_IS_EQUAL(entire_image_patch_row_major.dimension(0), 3 * 5);
   VERIFY_IS_EQUAL(entire_image_patch_row_major.dimension(1), 5);
   VERIFY_IS_EQUAL(entire_image_patch_row_major.dimension(2), 3);
   VERIFY_IS_EQUAL(entire_image_patch_row_major.dimension(3), 2);
 
   for (IndexType i = 0; i < 3; ++i) {
     for (IndexType j = 0; j < 5; ++j) {
-      IndexType patchId = i+3*j;
+      IndexType patchId = i + 3 * j;
       for (IndexType r = 0; r < 3; ++r) {
         for (IndexType c = 0; c < 5; ++c) {
           for (IndexType d = 0; d < 2; ++d) {
             DataType expected_col_major = 0.0f;
             DataType expected_row_major = 0.0f;
-            if (r-1+i >= 0 && c-2+j >= 0 && r-1+i < 3 && c-2+j < 5) {
-              expected_col_major = tensor_col_major(d, r-1+i, c-2+j);
-              expected_row_major = tensor_row_major(c-2+j, r-1+i, d);
+            if (r - 1 + i >= 0 && c - 2 + j >= 0 && r - 1 + i < 3 && c - 2 + j < 5) {
+              expected_col_major = tensor_col_major(d, r - 1 + i, c - 2 + j);
+              expected_row_major = tensor_row_major(c - 2 + j, r - 1 + i, d);
             }
             // ColMajor
             if (entire_image_patch_col_major(d, r, c, patchId) != expected_col_major) {
-              std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << std::endl;
+              std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d
+                        << std::endl;
             }
             VERIFY_IS_EQUAL(entire_image_patch_col_major(d, r, c, patchId), expected_col_major);
             // RowMajor
-            if (entire_image_patch_row_major(patchId, c, r, d) !=
-                expected_row_major) {
-              std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << std::endl;
+            if (entire_image_patch_row_major(patchId, c, r, d) != expected_row_major) {
+              std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d
+                        << std::endl;
             }
-            VERIFY_IS_EQUAL(entire_image_patch_row_major(patchId, c, r, d),
-                            expected_row_major);
+            VERIFY_IS_EQUAL(entire_image_patch_row_major(patchId, c, r, d), expected_row_major);
             // Check that ColMajor and RowMajor agree.
             VERIFY_IS_EQUAL(expected_col_major, expected_row_major);
           }
@@ -698,28 +736,30 @@
   }
 
   // 2D patch: ColMajor
-  patchColMajorTensorRange={{sizeDim1, 2, 2, sizeDim2*sizeDim3}};
-  Tensor<DataType, 4, DataLayout,IndexType> twod_patch_col_major(patchColMajorTensorRange);
-  patchTensorBuffSize =twod_patch_col_major.size()*sizeof(DataType);
-  DataType* gpu_data_twod_patch_col_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 4, DataLayout,IndexType>> gpu_twod_patch_col_major(gpu_data_twod_patch_col_major, patchColMajorTensorRange);
-  gpu_twod_patch_col_major.device(sycl_device)=gpu_col_major.extract_image_patches(2, 2);
+  patchColMajorTensorRange = {{sizeDim1, 2, 2, sizeDim2 * sizeDim3}};
+  Tensor<DataType, 4, DataLayout, IndexType> twod_patch_col_major(patchColMajorTensorRange);
+  patchTensorBuffSize = twod_patch_col_major.size() * sizeof(DataType);
+  DataType* gpu_data_twod_patch_col_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_twod_patch_col_major(gpu_data_twod_patch_col_major,
+                                                                                 patchColMajorTensorRange);
+  gpu_twod_patch_col_major.device(sycl_device) = gpu_col_major.extract_image_patches(2, 2);
   sycl_device.memcpyDeviceToHost(twod_patch_col_major.data(), gpu_data_twod_patch_col_major, patchTensorBuffSize);
 
   VERIFY_IS_EQUAL(twod_patch_col_major.dimension(0), 2);
   VERIFY_IS_EQUAL(twod_patch_col_major.dimension(1), 2);
   VERIFY_IS_EQUAL(twod_patch_col_major.dimension(2), 2);
-  VERIFY_IS_EQUAL(twod_patch_col_major.dimension(3), 3*5);
+  VERIFY_IS_EQUAL(twod_patch_col_major.dimension(3), 3 * 5);
 
   // 2D patch: RowMajor
-  patchRowMajorTensorRange={{sizeDim2*sizeDim3, 2, 2, sizeDim1}};
-  Tensor<DataType, 4, RowMajor,IndexType> twod_patch_row_major(patchRowMajorTensorRange);
-  patchTensorBuffSize =twod_patch_row_major.size()*sizeof(DataType);
-  DataType* gpu_data_twod_patch_row_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 4, RowMajor,IndexType>> gpu_twod_patch_row_major(gpu_data_twod_patch_row_major, patchRowMajorTensorRange);
-  gpu_twod_patch_row_major.device(sycl_device)=gpu_row_major.extract_image_patches(2, 2);
+  patchRowMajorTensorRange = {{sizeDim2 * sizeDim3, 2, 2, sizeDim1}};
+  Tensor<DataType, 4, RowMajor, IndexType> twod_patch_row_major(patchRowMajorTensorRange);
+  patchTensorBuffSize = twod_patch_row_major.size() * sizeof(DataType);
+  DataType* gpu_data_twod_patch_row_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 4, RowMajor, IndexType>> gpu_twod_patch_row_major(gpu_data_twod_patch_row_major,
+                                                                               patchRowMajorTensorRange);
+  gpu_twod_patch_row_major.device(sycl_device) = gpu_row_major.extract_image_patches(2, 2);
   sycl_device.memcpyDeviceToHost(twod_patch_row_major.data(), gpu_data_twod_patch_row_major, patchTensorBuffSize);
-  VERIFY_IS_EQUAL(twod_patch_row_major.dimension(0), 3*5);
+  VERIFY_IS_EQUAL(twod_patch_row_major.dimension(0), 3 * 5);
   VERIFY_IS_EQUAL(twod_patch_row_major.dimension(1), 2);
   VERIFY_IS_EQUAL(twod_patch_row_major.dimension(2), 2);
   VERIFY_IS_EQUAL(twod_patch_row_major.dimension(3), 2);
@@ -731,28 +771,32 @@
 
   for (IndexType i = 0; i < 3; ++i) {
     for (IndexType j = 0; j < 5; ++j) {
-      IndexType patchId = i+3*j;
+      IndexType patchId = i + 3 * j;
       for (IndexType r = 0; r < 2; ++r) {
         for (IndexType c = 0; c < 2; ++c) {
           for (IndexType d = 0; d < 2; ++d) {
             DataType expected_col_major = 0.0f;
             DataType expected_row_major = 0.0f;
-            IndexType row_offset = r*stride + i - row_padding;
-            IndexType col_offset = c*stride + j - col_padding;
+            IndexType row_offset = r * stride + i - row_padding;
+            IndexType col_offset = c * stride + j - col_padding;
             // ColMajor
-            if (row_offset >= 0 && col_offset >= 0 && row_offset < tensor_col_major.dimension(1) && col_offset < tensor_col_major.dimension(2)) {
+            if (row_offset >= 0 && col_offset >= 0 && row_offset < tensor_col_major.dimension(1) &&
+                col_offset < tensor_col_major.dimension(2)) {
               expected_col_major = tensor_col_major(d, row_offset, col_offset);
             }
             if (twod_patch_col_major(d, r, c, patchId) != expected_col_major) {
-              std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << std::endl;
+              std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d
+                        << std::endl;
             }
             VERIFY_IS_EQUAL(twod_patch_col_major(d, r, c, patchId), expected_col_major);
             // RowMajor
-            if (row_offset >= 0 && col_offset >= 0 && row_offset < tensor_row_major.dimension(1) && col_offset < tensor_row_major.dimension(0)) {
+            if (row_offset >= 0 && col_offset >= 0 && row_offset < tensor_row_major.dimension(1) &&
+                col_offset < tensor_row_major.dimension(0)) {
               expected_row_major = tensor_row_major(col_offset, row_offset, d);
             }
             if (twod_patch_row_major(patchId, c, r, d) != expected_row_major) {
-              std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << std::endl;
+              std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d
+                        << std::endl;
             }
             VERIFY_IS_EQUAL(twod_patch_row_major(patchId, c, r, d), expected_row_major);
             // Check that ColMajor and RowMajor agree.
@@ -774,8 +818,7 @@
 }
 
 template <typename DataType, typename IndexType>
-static void test_imagenet_patches_sycl(const Eigen::SyclDevice& sycl_device)
-{
+static void test_imagenet_patches_sycl(const Eigen::SyclDevice& sycl_device) {
   // Test the code on typical configurations used by the 'imagenet' benchmarks at
   // https://github.com/soumith/convnet-benchmarks
   // ColMajor
@@ -784,39 +827,41 @@
   IndexType sizeDim3 = 128;
   IndexType sizeDim4 = 16;
   array<IndexType, 4> tensorColMajorRange = {{sizeDim1, sizeDim2, sizeDim3, sizeDim4}};
-  Tensor<DataType, 4, DataLayout,IndexType> l_in_col_major(tensorColMajorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> l_in_col_major(tensorColMajorRange);
   l_in_col_major.setRandom();
 
-  DataType* gpu_data_l_in_col_major  = static_cast<DataType*>(sycl_device.allocate(l_in_col_major.size()*sizeof(DataType)));
+  DataType* gpu_data_l_in_col_major =
+      static_cast<DataType*>(sycl_device.allocate(l_in_col_major.size() * sizeof(DataType)));
   TensorMap<Tensor<DataType, 4, ColMajor, IndexType>> gpu_l_in_col_major(gpu_data_l_in_col_major, tensorColMajorRange);
 
-  sycl_device.memcpyHostToDevice(gpu_data_l_in_col_major, l_in_col_major.data(),(l_in_col_major.size())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_data_l_in_col_major, l_in_col_major.data(),
+                                 (l_in_col_major.size()) * sizeof(DataType));
 
-  array<IndexType, 5> patchTensorRange={{sizeDim1, 11, 11, sizeDim2*sizeDim3, sizeDim4}};
-  Tensor<DataType, 5, DataLayout,IndexType> l_out_col_major(patchTensorRange);
-  size_t patchTensorBuffSize =l_out_col_major.size()*sizeof(DataType);
-  DataType* gpu_data_l_out_col_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 5, DataLayout,IndexType>> gpu_l_out_col_major(gpu_data_l_out_col_major, patchTensorRange);
-  gpu_l_out_col_major.device(sycl_device)=gpu_l_in_col_major.extract_image_patches(11, 11);
+  array<IndexType, 5> patchTensorRange = {{sizeDim1, 11, 11, sizeDim2 * sizeDim3, sizeDim4}};
+  Tensor<DataType, 5, DataLayout, IndexType> l_out_col_major(patchTensorRange);
+  size_t patchTensorBuffSize = l_out_col_major.size() * sizeof(DataType);
+  DataType* gpu_data_l_out_col_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu_l_out_col_major(gpu_data_l_out_col_major, patchTensorRange);
+  gpu_l_out_col_major.device(sycl_device) = gpu_l_in_col_major.extract_image_patches(11, 11);
   sycl_device.memcpyDeviceToHost(l_out_col_major.data(), gpu_data_l_out_col_major, patchTensorBuffSize);
 
   VERIFY_IS_EQUAL(l_out_col_major.dimension(0), sizeDim1);
   VERIFY_IS_EQUAL(l_out_col_major.dimension(1), 11);
   VERIFY_IS_EQUAL(l_out_col_major.dimension(2), 11);
-  VERIFY_IS_EQUAL(l_out_col_major.dimension(3), sizeDim2*sizeDim3);
+  VERIFY_IS_EQUAL(l_out_col_major.dimension(3), sizeDim2 * sizeDim3);
   VERIFY_IS_EQUAL(l_out_col_major.dimension(4), sizeDim4);
 
   // RowMajor
-  patchTensorRange={{sizeDim4, sizeDim2*sizeDim3, 11, 11, sizeDim1}};
-  Tensor<DataType, 5, RowMajor,IndexType> l_out_row_major(patchTensorRange);
-  patchTensorBuffSize =l_out_row_major.size()*sizeof(DataType);
-  DataType* gpu_data_l_out_row_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 5, RowMajor,IndexType>> gpu_l_out_row_major(gpu_data_l_out_row_major, patchTensorRange);
-  gpu_l_out_row_major.device(sycl_device)=gpu_l_in_col_major.swap_layout().extract_image_patches(11, 11);
+  patchTensorRange = {{sizeDim4, sizeDim2 * sizeDim3, 11, 11, sizeDim1}};
+  Tensor<DataType, 5, RowMajor, IndexType> l_out_row_major(patchTensorRange);
+  patchTensorBuffSize = l_out_row_major.size() * sizeof(DataType);
+  DataType* gpu_data_l_out_row_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 5, RowMajor, IndexType>> gpu_l_out_row_major(gpu_data_l_out_row_major, patchTensorRange);
+  gpu_l_out_row_major.device(sycl_device) = gpu_l_in_col_major.swap_layout().extract_image_patches(11, 11);
   sycl_device.memcpyDeviceToHost(l_out_row_major.data(), gpu_data_l_out_row_major, patchTensorBuffSize);
 
   VERIFY_IS_EQUAL(l_out_row_major.dimension(0), sizeDim4);
-  VERIFY_IS_EQUAL(l_out_row_major.dimension(1), sizeDim2*sizeDim3);
+  VERIFY_IS_EQUAL(l_out_row_major.dimension(1), sizeDim2 * sizeDim3);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(2), 11);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(3), 11);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(4), sizeDim1);
@@ -824,28 +869,26 @@
   for (IndexType b = 0; b < 16; ++b) {
     for (IndexType i = 0; i < 128; ++i) {
       for (IndexType j = 0; j < 128; ++j) {
-        IndexType patchId = i+128*j;
+        IndexType patchId = i + 128 * j;
         for (IndexType c = 0; c < 11; ++c) {
           for (IndexType r = 0; r < 11; ++r) {
             for (IndexType d = 0; d < 3; ++d) {
               DataType expected = 0.0f;
-              if (r-5+i >= 0 && c-5+j >= 0 && r-5+i < 128 && c-5+j < 128) {
-                expected = l_in_col_major(d, r-5+i, c-5+j, b);
+              if (r - 5 + i >= 0 && c - 5 + j >= 0 && r - 5 + i < 128 && c - 5 + j < 128) {
+                expected = l_in_col_major(d, r - 5 + i, c - 5 + j, b);
               }
               // ColMajor
               if (l_out_col_major(d, r, c, patchId, b) != expected) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(l_out_col_major(d, r, c, patchId, b), expected);
               // RowMajor
-              if (l_out_row_major(b, patchId, c, r, d) !=
-                  expected) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j
-                     << " r=" << r << " c=" << c << " d=" << d << " b=" << b
-                     << std::endl;
+              if (l_out_row_major(b, patchId, c, r, d) != expected) {
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
-              VERIFY_IS_EQUAL(l_out_row_major(b, patchId, c, r, d),
-                              expected);
+              VERIFY_IS_EQUAL(l_out_row_major(b, patchId, c, r, d), expected);
             }
           }
         }
@@ -863,35 +906,40 @@
   tensorColMajorRange = {{sizeDim1, sizeDim2, sizeDim3, sizeDim4}};
   l_in_col_major.resize(tensorColMajorRange);
   l_in_col_major.setRandom();
-  gpu_data_l_in_col_major  = static_cast<DataType*>(sycl_device.allocate(l_in_col_major.size()*sizeof(DataType)));
-  TensorMap<Tensor<DataType, 4, ColMajor, IndexType>>gpu_l_in_col_major_resize1(gpu_data_l_in_col_major, tensorColMajorRange);
+  gpu_data_l_in_col_major = static_cast<DataType*>(sycl_device.allocate(l_in_col_major.size() * sizeof(DataType)));
+  TensorMap<Tensor<DataType, 4, ColMajor, IndexType>> gpu_l_in_col_major_resize1(gpu_data_l_in_col_major,
+                                                                                 tensorColMajorRange);
 
-  patchTensorRange={{sizeDim1, 9, 9, sizeDim2*sizeDim3, sizeDim4}};
+  patchTensorRange = {{sizeDim1, 9, 9, sizeDim2 * sizeDim3, sizeDim4}};
   l_out_col_major.resize(patchTensorRange);
-  patchTensorBuffSize =l_out_col_major.size()*sizeof(DataType);
-  gpu_data_l_out_col_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 5, DataLayout,IndexType>>gpu_l_out_col_major_resize1(gpu_data_l_out_col_major, patchTensorRange);
-  sycl_device.memcpyHostToDevice(gpu_data_l_in_col_major, l_in_col_major.data(),(l_in_col_major.size())*sizeof(DataType));
-  gpu_l_out_col_major_resize1.device(sycl_device)=gpu_l_in_col_major_resize1.extract_image_patches(9, 9);
+  patchTensorBuffSize = l_out_col_major.size() * sizeof(DataType);
+  gpu_data_l_out_col_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu_l_out_col_major_resize1(gpu_data_l_out_col_major,
+                                                                                    patchTensorRange);
+  sycl_device.memcpyHostToDevice(gpu_data_l_in_col_major, l_in_col_major.data(),
+                                 (l_in_col_major.size()) * sizeof(DataType));
+  gpu_l_out_col_major_resize1.device(sycl_device) = gpu_l_in_col_major_resize1.extract_image_patches(9, 9);
   sycl_device.memcpyDeviceToHost(l_out_col_major.data(), gpu_data_l_out_col_major, patchTensorBuffSize);
   VERIFY_IS_EQUAL(l_out_col_major.dimension(0), 16);
   VERIFY_IS_EQUAL(l_out_col_major.dimension(1), 9);
   VERIFY_IS_EQUAL(l_out_col_major.dimension(2), 9);
-  VERIFY_IS_EQUAL(l_out_col_major.dimension(3), 64*64);
+  VERIFY_IS_EQUAL(l_out_col_major.dimension(3), 64 * 64);
   VERIFY_IS_EQUAL(l_out_col_major.dimension(4), 32);
 
-// RowMajor
+  // RowMajor
   sycl_device.deallocate(gpu_data_l_out_row_major);
-  patchTensorRange={{sizeDim4, sizeDim2*sizeDim3, 9, 9 ,sizeDim1}};
+  patchTensorRange = {{sizeDim4, sizeDim2 * sizeDim3, 9, 9, sizeDim1}};
   l_out_row_major.resize(patchTensorRange);
-  patchTensorBuffSize =l_out_row_major.size()*sizeof(DataType);
-  gpu_data_l_out_row_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 5, RowMajor,IndexType>>gpu_l_out_row_major_resize1(gpu_data_l_out_row_major, patchTensorRange);
-  gpu_l_out_row_major_resize1.device(sycl_device)=gpu_l_in_col_major_resize1.swap_layout().extract_image_patches(9, 9);
+  patchTensorBuffSize = l_out_row_major.size() * sizeof(DataType);
+  gpu_data_l_out_row_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 5, RowMajor, IndexType>> gpu_l_out_row_major_resize1(gpu_data_l_out_row_major,
+                                                                                  patchTensorRange);
+  gpu_l_out_row_major_resize1.device(sycl_device) =
+      gpu_l_in_col_major_resize1.swap_layout().extract_image_patches(9, 9);
   sycl_device.memcpyDeviceToHost(l_out_row_major.data(), gpu_data_l_out_row_major, patchTensorBuffSize);
 
   VERIFY_IS_EQUAL(l_out_row_major.dimension(0), 32);
-  VERIFY_IS_EQUAL(l_out_row_major.dimension(1), 64*64);
+  VERIFY_IS_EQUAL(l_out_row_major.dimension(1), 64 * 64);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(2), 9);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(3), 9);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(4), 16);
@@ -899,22 +947,24 @@
   for (IndexType b = 0; b < 32; ++b) {
     for (IndexType i = 0; i < 64; ++i) {
       for (IndexType j = 0; j < 64; ++j) {
-        IndexType patchId = i+64*j;
+        IndexType patchId = i + 64 * j;
         for (IndexType c = 0; c < 9; ++c) {
           for (IndexType r = 0; r < 9; ++r) {
             for (IndexType d = 0; d < 16; ++d) {
               DataType expected = 0.0f;
-              if (r-4+i >= 0 && c-4+j >= 0 && r-4+i < 64 && c-4+j < 64) {
-                expected = l_in_col_major(d, r-4+i, c-4+j, b);
+              if (r - 4 + i >= 0 && c - 4 + j >= 0 && r - 4 + i < 64 && c - 4 + j < 64) {
+                expected = l_in_col_major(d, r - 4 + i, c - 4 + j, b);
               }
               // ColMajor
               if (l_out_col_major(d, r, c, patchId, b) != expected) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(l_out_col_major(d, r, c, patchId, b), expected);
               // RowMajor
               if (l_out_row_major(b, patchId, c, r, d) != expected) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(l_out_row_major(b, patchId, c, r, d), expected);
             }
@@ -935,36 +985,41 @@
   tensorColMajorRange = {{sizeDim1, sizeDim2, sizeDim3, sizeDim4}};
   l_in_col_major.resize(tensorColMajorRange);
   l_in_col_major.setRandom();
-  gpu_data_l_in_col_major  = static_cast<DataType*>(sycl_device.allocate(l_in_col_major.size()*sizeof(DataType)));
-  TensorMap<Tensor<DataType, 4, ColMajor, IndexType>>gpu_l_in_col_major_resize2(gpu_data_l_in_col_major, tensorColMajorRange);
+  gpu_data_l_in_col_major = static_cast<DataType*>(sycl_device.allocate(l_in_col_major.size() * sizeof(DataType)));
+  TensorMap<Tensor<DataType, 4, ColMajor, IndexType>> gpu_l_in_col_major_resize2(gpu_data_l_in_col_major,
+                                                                                 tensorColMajorRange);
 
-  patchTensorRange={{sizeDim1, 7, 7, sizeDim2*sizeDim3, sizeDim4}};
+  patchTensorRange = {{sizeDim1, 7, 7, sizeDim2 * sizeDim3, sizeDim4}};
   l_out_col_major.resize(patchTensorRange);
-  patchTensorBuffSize =l_out_col_major.size()*sizeof(DataType);
-  gpu_data_l_out_col_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 5, DataLayout,IndexType>>gpu_l_out_col_major_resize2(gpu_data_l_out_col_major, patchTensorRange);
-  sycl_device.memcpyHostToDevice(gpu_data_l_in_col_major, l_in_col_major.data(),(l_in_col_major.size())*sizeof(DataType));
-  gpu_l_out_col_major_resize2.device(sycl_device)=gpu_l_in_col_major_resize2.extract_image_patches(7, 7);
+  patchTensorBuffSize = l_out_col_major.size() * sizeof(DataType);
+  gpu_data_l_out_col_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu_l_out_col_major_resize2(gpu_data_l_out_col_major,
+                                                                                    patchTensorRange);
+  sycl_device.memcpyHostToDevice(gpu_data_l_in_col_major, l_in_col_major.data(),
+                                 (l_in_col_major.size()) * sizeof(DataType));
+  gpu_l_out_col_major_resize2.device(sycl_device) = gpu_l_in_col_major_resize2.extract_image_patches(7, 7);
   sycl_device.memcpyDeviceToHost(l_out_col_major.data(), gpu_data_l_out_col_major, patchTensorBuffSize);
 
   VERIFY_IS_EQUAL(l_out_col_major.dimension(0), 32);
   VERIFY_IS_EQUAL(l_out_col_major.dimension(1), 7);
   VERIFY_IS_EQUAL(l_out_col_major.dimension(2), 7);
-  VERIFY_IS_EQUAL(l_out_col_major.dimension(3), 16*16);
+  VERIFY_IS_EQUAL(l_out_col_major.dimension(3), 16 * 16);
   VERIFY_IS_EQUAL(l_out_col_major.dimension(4), 32);
 
   // RowMajor
   sycl_device.deallocate(gpu_data_l_out_row_major);
-  patchTensorRange={{sizeDim4, sizeDim2*sizeDim3, 7, 7 ,sizeDim1}};
+  patchTensorRange = {{sizeDim4, sizeDim2 * sizeDim3, 7, 7, sizeDim1}};
   l_out_row_major.resize(patchTensorRange);
-  patchTensorBuffSize =l_out_row_major.size()*sizeof(DataType);
-  gpu_data_l_out_row_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 5, RowMajor,IndexType>>gpu_l_out_row_major_resize2(gpu_data_l_out_row_major, patchTensorRange);
-  gpu_l_out_row_major_resize2.device(sycl_device)=gpu_l_in_col_major_resize2.swap_layout().extract_image_patches(7, 7);
+  patchTensorBuffSize = l_out_row_major.size() * sizeof(DataType);
+  gpu_data_l_out_row_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 5, RowMajor, IndexType>> gpu_l_out_row_major_resize2(gpu_data_l_out_row_major,
+                                                                                  patchTensorRange);
+  gpu_l_out_row_major_resize2.device(sycl_device) =
+      gpu_l_in_col_major_resize2.swap_layout().extract_image_patches(7, 7);
   sycl_device.memcpyDeviceToHost(l_out_row_major.data(), gpu_data_l_out_row_major, patchTensorBuffSize);
 
   VERIFY_IS_EQUAL(l_out_row_major.dimension(0), 32);
-  VERIFY_IS_EQUAL(l_out_row_major.dimension(1), 16*16);
+  VERIFY_IS_EQUAL(l_out_row_major.dimension(1), 16 * 16);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(2), 7);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(3), 7);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(4), 32);
@@ -972,22 +1027,24 @@
   for (IndexType b = 0; b < 32; ++b) {
     for (IndexType i = 0; i < 16; ++i) {
       for (IndexType j = 0; j < 16; ++j) {
-        IndexType patchId = i+16*j;
+        IndexType patchId = i + 16 * j;
         for (IndexType c = 0; c < 7; ++c) {
           for (IndexType r = 0; r < 7; ++r) {
             for (IndexType d = 0; d < 32; ++d) {
               DataType expected = 0.0f;
-              if (r-3+i >= 0 && c-3+j >= 0 && r-3+i < 16 && c-3+j < 16) {
-                expected = l_in_col_major(d, r-3+i, c-3+j, b);
+              if (r - 3 + i >= 0 && c - 3 + j >= 0 && r - 3 + i < 16 && c - 3 + j < 16) {
+                expected = l_in_col_major(d, r - 3 + i, c - 3 + j, b);
               }
               // ColMajor
               if (l_out_col_major(d, r, c, patchId, b) != expected) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(l_out_col_major(d, r, c, patchId, b), expected);
               // RowMajor
               if (l_out_row_major(b, patchId, c, r, d) != expected) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(l_out_row_major(b, patchId, c, r, d), expected);
             }
@@ -1007,36 +1064,41 @@
   tensorColMajorRange = {{sizeDim1, sizeDim2, sizeDim3, sizeDim4}};
   l_in_col_major.resize(tensorColMajorRange);
   l_in_col_major.setRandom();
-  gpu_data_l_in_col_major  = static_cast<DataType*>(sycl_device.allocate(l_in_col_major.size()*sizeof(DataType)));
-  TensorMap<Tensor<DataType, 4, ColMajor, IndexType>>gpu_l_in_col_major_resize3(gpu_data_l_in_col_major, tensorColMajorRange);
+  gpu_data_l_in_col_major = static_cast<DataType*>(sycl_device.allocate(l_in_col_major.size() * sizeof(DataType)));
+  TensorMap<Tensor<DataType, 4, ColMajor, IndexType>> gpu_l_in_col_major_resize3(gpu_data_l_in_col_major,
+                                                                                 tensorColMajorRange);
 
-  patchTensorRange={{sizeDim1, 3, 3, sizeDim2*sizeDim3, sizeDim4}};
+  patchTensorRange = {{sizeDim1, 3, 3, sizeDim2 * sizeDim3, sizeDim4}};
   l_out_col_major.resize(patchTensorRange);
-  patchTensorBuffSize =l_out_col_major.size()*sizeof(DataType);
-  gpu_data_l_out_col_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 5, DataLayout,IndexType>>gpu_l_out_col_major_resize3(gpu_data_l_out_col_major, patchTensorRange);
-  sycl_device.memcpyHostToDevice(gpu_data_l_in_col_major, l_in_col_major.data(),(l_in_col_major.size())*sizeof(DataType));
-  gpu_l_out_col_major_resize3.device(sycl_device)=gpu_l_in_col_major_resize3.extract_image_patches(3, 3);
+  patchTensorBuffSize = l_out_col_major.size() * sizeof(DataType);
+  gpu_data_l_out_col_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu_l_out_col_major_resize3(gpu_data_l_out_col_major,
+                                                                                    patchTensorRange);
+  sycl_device.memcpyHostToDevice(gpu_data_l_in_col_major, l_in_col_major.data(),
+                                 (l_in_col_major.size()) * sizeof(DataType));
+  gpu_l_out_col_major_resize3.device(sycl_device) = gpu_l_in_col_major_resize3.extract_image_patches(3, 3);
   sycl_device.memcpyDeviceToHost(l_out_col_major.data(), gpu_data_l_out_col_major, patchTensorBuffSize);
 
   VERIFY_IS_EQUAL(l_out_col_major.dimension(0), 64);
   VERIFY_IS_EQUAL(l_out_col_major.dimension(1), 3);
   VERIFY_IS_EQUAL(l_out_col_major.dimension(2), 3);
-  VERIFY_IS_EQUAL(l_out_col_major.dimension(3), 13*13);
+  VERIFY_IS_EQUAL(l_out_col_major.dimension(3), 13 * 13);
   VERIFY_IS_EQUAL(l_out_col_major.dimension(4), 32);
 
   // RowMajor
   sycl_device.deallocate(gpu_data_l_out_row_major);
-  patchTensorRange={{sizeDim4, sizeDim2*sizeDim3, 3, 3 ,sizeDim1}};
+  patchTensorRange = {{sizeDim4, sizeDim2 * sizeDim3, 3, 3, sizeDim1}};
   l_out_row_major.resize(patchTensorRange);
-  patchTensorBuffSize =l_out_row_major.size()*sizeof(DataType);
-  gpu_data_l_out_row_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 5, RowMajor,IndexType>>gpu_l_out_row_major_resize3(gpu_data_l_out_row_major, patchTensorRange);
-  gpu_l_out_row_major_resize3.device(sycl_device)=gpu_l_in_col_major_resize3.swap_layout().extract_image_patches(3, 3);
+  patchTensorBuffSize = l_out_row_major.size() * sizeof(DataType);
+  gpu_data_l_out_row_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 5, RowMajor, IndexType>> gpu_l_out_row_major_resize3(gpu_data_l_out_row_major,
+                                                                                  patchTensorRange);
+  gpu_l_out_row_major_resize3.device(sycl_device) =
+      gpu_l_in_col_major_resize3.swap_layout().extract_image_patches(3, 3);
   sycl_device.memcpyDeviceToHost(l_out_row_major.data(), gpu_data_l_out_row_major, patchTensorBuffSize);
 
   VERIFY_IS_EQUAL(l_out_row_major.dimension(0), 32);
-  VERIFY_IS_EQUAL(l_out_row_major.dimension(1), 13*13);
+  VERIFY_IS_EQUAL(l_out_row_major.dimension(1), 13 * 13);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(2), 3);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(3), 3);
   VERIFY_IS_EQUAL(l_out_row_major.dimension(4), 64);
@@ -1044,22 +1106,24 @@
   for (IndexType b = 0; b < 32; ++b) {
     for (IndexType i = 0; i < 13; ++i) {
       for (IndexType j = 0; j < 13; ++j) {
-        IndexType patchId = i+13*j;
+        IndexType patchId = i + 13 * j;
         for (IndexType c = 0; c < 3; ++c) {
           for (IndexType r = 0; r < 3; ++r) {
             for (IndexType d = 0; d < 64; ++d) {
               DataType expected = 0.0f;
-              if (r-1+i >= 0 && c-1+j >= 0 && r-1+i < 13 && c-1+j < 13) {
-                expected = l_in_col_major(d, r-1+i, c-1+j, b);
+              if (r - 1 + i >= 0 && c - 1 + j >= 0 && r - 1 + i < 13 && c - 1 + j < 13) {
+                expected = l_in_col_major(d, r - 1 + i, c - 1 + j, b);
               }
               // ColMajor
               if (l_out_col_major(d, r, c, patchId, b) != expected) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(l_out_col_major(d, r, c, patchId, b), expected);
               // RowMajor
               if (l_out_row_major(b, patchId, c, r, d) != expected) {
-                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c << " d=" << d << " b=" << b << std::endl;
+                std::cout << "Mismatch detected at index i=" << i << " j=" << j << " r=" << r << " c=" << c
+                          << " d=" << d << " b=" << b << std::endl;
               }
               VERIFY_IS_EQUAL(l_out_row_major(b, patchId, c, r, d), expected);
             }
@@ -1073,20 +1137,19 @@
   sycl_device.deallocate(gpu_data_l_out_row_major);
 }
 
-
-template<typename DataType, typename dev_Selector> void sycl_tensor_image_patch_test_per_device(dev_Selector s){
-QueueInterface queueInterface(s);
-auto sycl_device = Eigen::SyclDevice(&queueInterface);
-test_simple_image_patch_sycl<DataType, int64_t>(sycl_device);
-test_patch_padding_valid_sycl<DataType, int64_t>(sycl_device);
-test_patch_padding_valid_same_value_sycl<DataType, int64_t>(sycl_device);
-test_patch_padding_same_sycl<DataType, int64_t>(sycl_device);
-test_patch_no_extra_dim_sycl<DataType, int64_t>(sycl_device);
-test_imagenet_patches_sycl<DataType, int64_t>(sycl_device);
+template <typename DataType, typename dev_Selector>
+void sycl_tensor_image_patch_test_per_device(dev_Selector s) {
+  QueueInterface queueInterface(s);
+  auto sycl_device = Eigen::SyclDevice(&queueInterface);
+  test_simple_image_patch_sycl<DataType, int64_t>(sycl_device);
+  test_patch_padding_valid_sycl<DataType, int64_t>(sycl_device);
+  test_patch_padding_valid_same_value_sycl<DataType, int64_t>(sycl_device);
+  test_patch_padding_same_sycl<DataType, int64_t>(sycl_device);
+  test_patch_no_extra_dim_sycl<DataType, int64_t>(sycl_device);
+  test_imagenet_patches_sycl<DataType, int64_t>(sycl_device);
 }
-EIGEN_DECLARE_TEST(cxx11_tensor_image_patch_sycl)
-{
-for (const auto& device :Eigen::get_sycl_supported_devices()) {
-  CALL_SUBTEST(sycl_tensor_image_patch_test_per_device<float>(device));
-}
+EIGEN_DECLARE_TEST(cxx11_tensor_image_patch_sycl) {
+  for (const auto& device : Eigen::get_sycl_supported_devices()) {
+    CALL_SUBTEST(sycl_tensor_image_patch_test_per_device<float>(device));
+  }
 }
diff --git a/unsupported/test/cxx11_tensor_index_list.cpp b/unsupported/test/cxx11_tensor_index_list.cpp
index 9cbdaa7..9e0b755 100644
--- a/unsupported/test/cxx11_tensor_index_list.cpp
+++ b/unsupported/test/cxx11_tensor_index_list.cpp
@@ -11,9 +11,8 @@
 
 #include <Eigen/CXX11/Tensor>
 
-static void test_static_index_list()
-{
-  Tensor<float, 4> tensor(2,3,5,7);
+static void test_static_index_list() {
+  Tensor<float, 4> tensor(2, 3, 5, 7);
   tensor.setRandom();
 
   constexpr auto reduction_axis = make_index_list(0, 1, 2);
@@ -36,7 +35,7 @@
     for (int j = 0; j < 2; ++j) {
       for (int k = 0; k < 3; ++k) {
         for (int l = 0; l < 5; ++l) {
-          expected += tensor(j,k,l,i);
+          expected += tensor(j, k, l, i);
         }
       }
     }
@@ -44,18 +43,19 @@
   }
 }
 
-
-static void test_type2index_list()
-{
-  Tensor<float, 5> tensor(2,3,5,7,11);
+static void test_type2index_list() {
+  Tensor<float, 5> tensor(2, 3, 5, 7, 11);
   tensor.setRandom();
   tensor += tensor.constant(10.0f);
 
   typedef Eigen::IndexList<Eigen::type2index<0>> Dims0;
   typedef Eigen::IndexList<Eigen::type2index<0>, Eigen::type2index<1>> Dims1;
   typedef Eigen::IndexList<Eigen::type2index<0>, Eigen::type2index<1>, Eigen::type2index<2>> Dims2;
-  typedef Eigen::IndexList<Eigen::type2index<0>, Eigen::type2index<1>, Eigen::type2index<2>, Eigen::type2index<3>> Dims3;
-  typedef Eigen::IndexList<Eigen::type2index<0>, Eigen::type2index<1>, Eigen::type2index<2>, Eigen::type2index<3>, Eigen::type2index<4>> Dims4;
+  typedef Eigen::IndexList<Eigen::type2index<0>, Eigen::type2index<1>, Eigen::type2index<2>, Eigen::type2index<3>>
+      Dims3;
+  typedef Eigen::IndexList<Eigen::type2index<0>, Eigen::type2index<1>, Eigen::type2index<2>, Eigen::type2index<3>,
+                           Eigen::type2index<4>>
+      Dims4;
 
 #if 0
   EIGEN_STATIC_ASSERT((internal::indices_statically_known_to_increase<Dims0>() == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
@@ -65,17 +65,27 @@
   EIGEN_STATIC_ASSERT((internal::indices_statically_known_to_increase<Dims4>() == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
 #endif
 
-  EIGEN_STATIC_ASSERT((internal::are_inner_most_dims<Dims0, 1, ColMajor>::value == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((internal::are_inner_most_dims<Dims1, 2, ColMajor>::value == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((internal::are_inner_most_dims<Dims2, 3, ColMajor>::value == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((internal::are_inner_most_dims<Dims3, 4, ColMajor>::value == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((internal::are_inner_most_dims<Dims4, 5, ColMajor>::value == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((internal::are_inner_most_dims<Dims0, 1, ColMajor>::value == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((internal::are_inner_most_dims<Dims1, 2, ColMajor>::value == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((internal::are_inner_most_dims<Dims2, 3, ColMajor>::value == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((internal::are_inner_most_dims<Dims3, 4, ColMajor>::value == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((internal::are_inner_most_dims<Dims4, 5, ColMajor>::value == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
 
-  EIGEN_STATIC_ASSERT((internal::are_inner_most_dims<Dims0, 1, RowMajor>::value == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((internal::are_inner_most_dims<Dims1, 2, RowMajor>::value == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((internal::are_inner_most_dims<Dims2, 3, RowMajor>::value == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((internal::are_inner_most_dims<Dims3, 4, RowMajor>::value == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((internal::are_inner_most_dims<Dims4, 5, RowMajor>::value == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((internal::are_inner_most_dims<Dims0, 1, RowMajor>::value == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((internal::are_inner_most_dims<Dims1, 2, RowMajor>::value == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((internal::are_inner_most_dims<Dims2, 3, RowMajor>::value == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((internal::are_inner_most_dims<Dims3, 4, RowMajor>::value == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((internal::are_inner_most_dims<Dims4, 5, RowMajor>::value == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
 
   const Dims0 reduction_axis0;
   Tensor<float, 4> result0 = tensor.sum(reduction_axis0);
@@ -85,9 +95,9 @@
         for (int j = 0; j < 3; ++j) {
           float expected = 0.0f;
           for (int i = 0; i < 2; ++i) {
-            expected += tensor(i,j,k,l,m);
+            expected += tensor(i, j, k, l, m);
           }
-          VERIFY_IS_APPROX(result0(j,k,l,m), expected);
+          VERIFY_IS_APPROX(result0(j, k, l, m), expected);
         }
       }
     }
@@ -101,10 +111,10 @@
         float expected = 0.0f;
         for (int j = 0; j < 3; ++j) {
           for (int i = 0; i < 2; ++i) {
-            expected += tensor(i,j,k,l,m);
+            expected += tensor(i, j, k, l, m);
           }
         }
-        VERIFY_IS_APPROX(result1(k,l,m), expected);
+        VERIFY_IS_APPROX(result1(k, l, m), expected);
       }
     }
   }
@@ -117,11 +127,11 @@
       for (int k = 0; k < 5; ++k) {
         for (int j = 0; j < 3; ++j) {
           for (int i = 0; i < 2; ++i) {
-            expected += tensor(i,j,k,l,m);
+            expected += tensor(i, j, k, l, m);
           }
         }
       }
-      VERIFY_IS_APPROX(result2(l,m), expected);
+      VERIFY_IS_APPROX(result2(l, m), expected);
     }
   }
 
@@ -133,7 +143,7 @@
       for (int k = 0; k < 5; ++k) {
         for (int j = 0; j < 3; ++j) {
           for (int i = 0; i < 2; ++i) {
-            expected += tensor(i,j,k,l,m);
+            expected += tensor(i, j, k, l, m);
           }
         }
       }
@@ -149,7 +159,7 @@
       for (int k = 0; k < 5; ++k) {
         for (int j = 0; j < 3; ++j) {
           for (int i = 0; i < 2; ++i) {
-            expected += tensor(i,j,k,l,m);
+            expected += tensor(i, j, k, l, m);
           }
         }
       }
@@ -158,27 +168,27 @@
   VERIFY_IS_APPROX(result4(), expected);
 }
 
-
-static void test_type2indexpair_list()
-{
-  Tensor<float, 5> tensor(2,3,5,7,11);
+static void test_type2indexpair_list() {
+  Tensor<float, 5> tensor(2, 3, 5, 7, 11);
   tensor.setRandom();
   tensor += tensor.constant(10.0f);
 
-  typedef Eigen::IndexPairList<Eigen::type2indexpair<0,10>> Dims0;
-  typedef Eigen::IndexPairList<Eigen::type2indexpair<0,10>, Eigen::type2indexpair<1,11>, Eigen::type2indexpair<2,12>> Dims2_a;
-  typedef Eigen::IndexPairList<Eigen::type2indexpair<0,10>, Eigen::IndexPair<Index>, Eigen::type2indexpair<2,12>> Dims2_b;
-  typedef Eigen::IndexPairList<Eigen::IndexPair<Index>, Eigen::type2indexpair<1,11>, Eigen::IndexPair<Index>> Dims2_c;
+  typedef Eigen::IndexPairList<Eigen::type2indexpair<0, 10>> Dims0;
+  typedef Eigen::IndexPairList<Eigen::type2indexpair<0, 10>, Eigen::type2indexpair<1, 11>, Eigen::type2indexpair<2, 12>>
+      Dims2_a;
+  typedef Eigen::IndexPairList<Eigen::type2indexpair<0, 10>, Eigen::IndexPair<Index>, Eigen::type2indexpair<2, 12>>
+      Dims2_b;
+  typedef Eigen::IndexPairList<Eigen::IndexPair<Index>, Eigen::type2indexpair<1, 11>, Eigen::IndexPair<Index>> Dims2_c;
 
   Dims2_a d2_a;
 
   Dims2_b d2_b;
-  d2_b.set(1, Eigen::IndexPair<Index>(1,11));
+  d2_b.set(1, Eigen::IndexPair<Index>(1, 11));
 
   Dims2_c d2_c;
-  d2_c.set(0, Eigen::IndexPair<Index>(Eigen::IndexPair<Index>(0,10)));
-  d2_c.set(1, Eigen::IndexPair<Index>(1,11));  // setting type2indexpair to correct value.
-  d2_c.set(2, Eigen::IndexPair<Index>(2,12));
+  d2_c.set(0, Eigen::IndexPair<Index>(Eigen::IndexPair<Index>(0, 10)));
+  d2_c.set(1, Eigen::IndexPair<Index>(1, 11));  // setting type2indexpair to correct value.
+  d2_c.set(2, Eigen::IndexPair<Index>(2, 12));
 
   VERIFY_IS_EQUAL(d2_a[0].first, 0);
   VERIFY_IS_EQUAL(d2_a[0].second, 10);
@@ -213,59 +223,97 @@
   EIGEN_STATIC_ASSERT((d2_c.value_known_statically(1) == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
   EIGEN_STATIC_ASSERT((d2_c.value_known_statically(2) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
 
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims0>(0, 0) == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims0>(0, 1) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims0>(0, 0) == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims0>(0, 1) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
 
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_a>(0, 0) == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_a>(0, 1) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_a>(1, 1) == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_a>(1, 2) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_a>(2, 2) == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_a>(2, 3) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_a>(0, 0) == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_a>(0, 1) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_a>(1, 1) == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_a>(1, 2) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_a>(2, 2) == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_a>(2, 3) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
 
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_b>(0, 0) == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_b>(0, 1) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_b>(1, 1) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_b>(1, 2) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_b>(2, 2) == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_b>(2, 3) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_b>(0, 0) == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_b>(0, 1) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_b>(1, 1) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_b>(1, 2) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_b>(2, 2) == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_b>(2, 3) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
 
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_c>(0, 0) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_c>(0, 1) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_c>(1, 1) == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_c>(1, 2) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_c>(2, 2) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_c>(2, 3) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_c>(0, 0) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_c>(0, 1) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_c>(1, 1) == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_c>(1, 2) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_c>(2, 2) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_first_statically_eq<Dims2_c>(2, 3) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
 
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims0>(0, 10) == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims0>(0, 11) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims0>(0, 10) == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims0>(0, 11) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
 
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_a>(0, 10) == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_a>(0, 11) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_a>(1, 11) == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_a>(1, 12) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_a>(2, 12) == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_a>(2, 13) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_a>(0, 10) == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_a>(0, 11) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_a>(1, 11) == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_a>(1, 12) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_a>(2, 12) == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_a>(2, 13) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
 
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_b>(0, 10) == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_b>(0, 11) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_b>(1, 11) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_b>(1, 12) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_b>(2, 12) == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_b>(2, 13) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_b>(0, 10) == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_b>(0, 11) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_b>(1, 11) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_b>(1, 12) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_b>(2, 12) == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_b>(2, 13) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
 
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_c>(0, 10) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_c>(0, 11) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_c>(1, 11) == true), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_c>(1, 12) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_c>(2, 12) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
-  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_c>(2, 13) == false), YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_c>(0, 10) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_c>(0, 11) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_c>(1, 11) == true),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_c>(1, 12) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_c>(2, 12) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
+  EIGEN_STATIC_ASSERT((Eigen::internal::index_pair_second_statically_eq<Dims2_c>(2, 13) == false),
+                      YOU_MADE_A_PROGRAMMING_MISTAKE);
 }
 
-
-static void test_dynamic_index_list()
-{
-  Tensor<float, 4> tensor(2,3,5,7);
+static void test_dynamic_index_list() {
+  Tensor<float, 4> tensor(2, 3, 5, 7);
   tensor.setRandom();
 
   int dim1 = 2;
@@ -287,7 +335,7 @@
     for (int j = 0; j < 2; ++j) {
       for (int k = 0; k < 3; ++k) {
         for (int l = 0; l < 5; ++l) {
-          expected += tensor(j,k,l,i);
+          expected += tensor(j, k, l, i);
         }
       }
     }
@@ -295,9 +343,8 @@
   }
 }
 
-static void test_mixed_index_list()
-{
-  Tensor<float, 4> tensor(2,3,5,7);
+static void test_mixed_index_list() {
+  Tensor<float, 4> tensor(2, 3, 5, 7);
   tensor.setRandom();
 
   int dim2 = 1;
@@ -349,7 +396,7 @@
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 5; ++k) {
         for (int l = 0; l < 7; ++l) {
-          expected += tensor(i,j,k,l);
+          expected += tensor(i, j, k, l);
         }
       }
     }
@@ -359,9 +406,7 @@
   VERIFY_IS_APPROX(result3(), expected);
 }
 
-
-static void test_dim_check()
-{
+static void test_dim_check() {
   Eigen::IndexList<Eigen::type2index<1>, int> dim1;
   dim1.set(1, 2);
   Eigen::IndexList<Eigen::type2index<1>, int> dim2;
@@ -369,9 +414,7 @@
   VERIFY(dimensions_match(dim1, dim2));
 }
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_index_list)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_index_list) {
   CALL_SUBTEST(test_static_index_list());
   CALL_SUBTEST(test_type2index_list());
   CALL_SUBTEST(test_type2indexpair_list());
diff --git a/unsupported/test/cxx11_tensor_inflation.cpp b/unsupported/test/cxx11_tensor_inflation.cpp
index 75089e8..32662ab 100644
--- a/unsupported/test/cxx11_tensor_inflation.cpp
+++ b/unsupported/test/cxx11_tensor_inflation.cpp
@@ -13,10 +13,9 @@
 
 using Eigen::Tensor;
 
-template<int DataLayout>
-static void test_simple_inflation()
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,5,7);
+template <int DataLayout>
+static void test_simple_inflation() {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
   array<ptrdiff_t, 4> strides;
 
@@ -37,7 +36,7 @@
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 5; ++k) {
         for (int l = 0; l < 7; ++l) {
-          VERIFY_IS_EQUAL(tensor(i,j,k,l), no_stride(i,j,k,l));
+          VERIFY_IS_EQUAL(tensor(i, j, k, l), no_stride(i, j, k, l));
         }
       }
     }
@@ -59,14 +58,10 @@
     for (int j = 0; j < 9; ++j) {
       for (int k = 0; k < 9; ++k) {
         for (int l = 0; l < 19; ++l) {
-          if (i % 2 == 0 &&
-              j % 4 == 0 &&
-              k % 2 == 0 &&
-              l % 3 == 0) {
-            VERIFY_IS_EQUAL(inflated(i,j,k,l),
-                            tensor(i/2, j/4, k/2, l/3));
+          if (i % 2 == 0 && j % 4 == 0 && k % 2 == 0 && l % 3 == 0) {
+            VERIFY_IS_EQUAL(inflated(i, j, k, l), tensor(i / 2, j / 4, k / 2, l / 3));
           } else {
-            VERIFY_IS_EQUAL(0, inflated(i,j,k,l));
+            VERIFY_IS_EQUAL(0, inflated(i, j, k, l));
           }
         }
       }
@@ -74,8 +69,7 @@
   }
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_inflation)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_inflation) {
   CALL_SUBTEST(test_simple_inflation<ColMajor>());
   CALL_SUBTEST(test_simple_inflation<RowMajor>());
 }
diff --git a/unsupported/test/cxx11_tensor_inflation_sycl.cpp b/unsupported/test/cxx11_tensor_inflation_sycl.cpp
index 75c2c0e..2475a35 100644
--- a/unsupported/test/cxx11_tensor_inflation_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_inflation_sycl.cpp
@@ -30,16 +30,14 @@
 // (4, 0, 0, 4, 0, 0, 4).
 
 template <typename DataType, int DataLayout, typename IndexType>
-void test_simple_inflation_sycl(const Eigen::SyclDevice &sycl_device) {
-
-
+void test_simple_inflation_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType sizeDim1 = 2;
   IndexType sizeDim2 = 3;
   IndexType sizeDim3 = 5;
   IndexType sizeDim4 = 7;
   array<IndexType, 4> tensorRange = {{sizeDim1, sizeDim2, sizeDim3, sizeDim4}};
-  Tensor<DataType, 4, DataLayout,IndexType> tensor(tensorRange);
-  Tensor<DataType, 4, DataLayout,IndexType> no_stride(tensorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> tensor(tensorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> no_stride(tensorRange);
   tensor.setRandom();
 
   array<IndexType, 4> strides;
@@ -48,16 +46,15 @@
   strides[2] = 1;
   strides[3] = 1;
 
+  const size_t tensorBuffSize = tensor.size() * sizeof(DataType);
+  DataType* gpu_data_tensor = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
+  DataType* gpu_data_no_stride = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
 
-  const size_t tensorBuffSize =tensor.size()*sizeof(DataType);
-  DataType* gpu_data_tensor  = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
-  DataType* gpu_data_no_stride  = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
-
-  TensorMap<Tensor<DataType, 4, DataLayout,IndexType>> gpu_tensor(gpu_data_tensor, tensorRange);
-  TensorMap<Tensor<DataType, 4, DataLayout,IndexType>> gpu_no_stride(gpu_data_no_stride, tensorRange);
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_tensor(gpu_data_tensor, tensorRange);
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_no_stride(gpu_data_no_stride, tensorRange);
 
   sycl_device.memcpyHostToDevice(gpu_data_tensor, tensor.data(), tensorBuffSize);
-  gpu_no_stride.device(sycl_device)=gpu_tensor.inflate(strides);
+  gpu_no_stride.device(sycl_device) = gpu_tensor.inflate(strides);
   sycl_device.memcpyDeviceToHost(no_stride.data(), gpu_data_no_stride, tensorBuffSize);
 
   VERIFY_IS_EQUAL(no_stride.dimension(0), sizeDim1);
@@ -69,13 +66,12 @@
     for (IndexType j = 0; j < 3; ++j) {
       for (IndexType k = 0; k < 5; ++k) {
         for (IndexType l = 0; l < 7; ++l) {
-          VERIFY_IS_EQUAL(tensor(i,j,k,l), no_stride(i,j,k,l));
+          VERIFY_IS_EQUAL(tensor(i, j, k, l), no_stride(i, j, k, l));
         }
       }
     }
   }
 
-
   strides[0] = 2;
   strides[1] = 4;
   strides[2] = 2;
@@ -89,10 +85,10 @@
 
   Tensor<DataType, 4, DataLayout, IndexType> inflated(inflatedTensorRange);
 
-  const size_t inflatedTensorBuffSize =inflated.size()*sizeof(DataType);
-  DataType* gpu_data_inflated  = static_cast<DataType*>(sycl_device.allocate(inflatedTensorBuffSize));
+  const size_t inflatedTensorBuffSize = inflated.size() * sizeof(DataType);
+  DataType* gpu_data_inflated = static_cast<DataType*>(sycl_device.allocate(inflatedTensorBuffSize));
   TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_inflated(gpu_data_inflated, inflatedTensorRange);
-  gpu_inflated.device(sycl_device)=gpu_tensor.inflate(strides);
+  gpu_inflated.device(sycl_device) = gpu_tensor.inflate(strides);
   sycl_device.memcpyDeviceToHost(inflated.data(), gpu_data_inflated, inflatedTensorBuffSize);
 
   VERIFY_IS_EQUAL(inflated.dimension(0), inflatedSizeDim1);
@@ -104,14 +100,11 @@
     for (IndexType j = 0; j < inflatedSizeDim2; ++j) {
       for (IndexType k = 0; k < inflatedSizeDim3; ++k) {
         for (IndexType l = 0; l < inflatedSizeDim4; ++l) {
-          if (i % strides[0] == 0 &&
-              j % strides[1] == 0 &&
-              k % strides[2] == 0 &&
-              l % strides[3] == 0) {
-            VERIFY_IS_EQUAL(inflated(i,j,k,l),
-                            tensor(i/strides[0], j/strides[1], k/strides[2], l/strides[3]));
+          if (i % strides[0] == 0 && j % strides[1] == 0 && k % strides[2] == 0 && l % strides[3] == 0) {
+            VERIFY_IS_EQUAL(inflated(i, j, k, l),
+                            tensor(i / strides[0], j / strides[1], k / strides[2], l / strides[3]));
           } else {
-            VERIFY_IS_EQUAL(0, inflated(i,j,k,l));
+            VERIFY_IS_EQUAL(0, inflated(i, j, k, l));
           }
         }
       }
@@ -122,15 +115,15 @@
   sycl_device.deallocate(gpu_data_inflated);
 }
 
-template<typename DataType, typename dev_Selector> void sycl_inflation_test_per_device(dev_Selector s){
+template <typename DataType, typename dev_Selector>
+void sycl_inflation_test_per_device(dev_Selector s) {
   QueueInterface queueInterface(s);
   auto sycl_device = Eigen::SyclDevice(&queueInterface);
   test_simple_inflation_sycl<DataType, RowMajor, int64_t>(sycl_device);
   test_simple_inflation_sycl<DataType, ColMajor, int64_t>(sycl_device);
 }
-EIGEN_DECLARE_TEST(cxx11_tensor_inflation_sycl)
-{
-  for (const auto& device :Eigen::get_sycl_supported_devices()) {
+EIGEN_DECLARE_TEST(cxx11_tensor_inflation_sycl) {
+  for (const auto& device : Eigen::get_sycl_supported_devices()) {
     CALL_SUBTEST(sycl_inflation_test_per_device<half>(device));
     CALL_SUBTEST(sycl_inflation_test_per_device<float>(device));
   }
diff --git a/unsupported/test/cxx11_tensor_intdiv.cpp b/unsupported/test/cxx11_tensor_intdiv.cpp
index d18a05e..433ca6e 100644
--- a/unsupported/test/cxx11_tensor_intdiv.cpp
+++ b/unsupported/test/cxx11_tensor_intdiv.cpp
@@ -11,9 +11,7 @@
 
 #include <Eigen/CXX11/Tensor>
 
-
-void test_signed_32bit()
-{
+void test_signed_32bit() {
   // Divide by one
   const Eigen::internal::TensorIntDivisor<int32_t, false> div_by_one(1);
 
@@ -46,9 +44,7 @@
   }
 }
 
-
-void test_unsigned_32bit()
-{
+void test_unsigned_32bit() {
   for (uint32_t i = 1; i < 25000; ++i) {
     const Eigen::internal::TensorIntDivisor<uint32_t> div(i);
 
@@ -60,9 +56,7 @@
   }
 }
 
-
-void test_signed_64bit()
-{
+void test_signed_64bit() {
   for (int64_t i = 1; i < 25000; ++i) {
     const Eigen::internal::TensorIntDivisor<int64_t> div(i);
 
@@ -74,9 +68,7 @@
   }
 }
 
-
-void test_unsigned_64bit()
-{
+void test_unsigned_64bit() {
   for (uint64_t i = 1; i < 25000; ++i) {
     const Eigen::internal::TensorIntDivisor<uint64_t> div(i);
 
@@ -94,12 +86,10 @@
     for (int num_expon = 0; num_expon < 32; num_expon++) {
       int32_t start_num = (1 << num_expon) - 100;
       int32_t end_num = (1 << num_expon) + 100;
-      if (start_num < 0)
-        start_num = 0;
+      if (start_num < 0) start_num = 0;
       for (int32_t num = start_num; num < end_num; num++) {
-        Eigen::internal::TensorIntDivisor<int32_t> divider =
-          Eigen::internal::TensorIntDivisor<int32_t>(div);
-        int32_t result = num/div;
+        Eigen::internal::TensorIntDivisor<int32_t> divider = Eigen::internal::TensorIntDivisor<int32_t>(div);
+        int32_t result = num / div;
         int32_t result_op = divider.divide(num);
         VERIFY_IS_EQUAL(result_op, result);
       }
@@ -113,11 +103,10 @@
     for (int num_expon = 0; num_expon < 63; num_expon++) {
       int64_t start_num = (1ull << num_expon) - 10;
       int64_t end_num = (1ull << num_expon) + 10;
-      if (start_num < 0)
-        start_num = 0;
+      if (start_num < 0) start_num = 0;
       for (int64_t num = start_num; num < end_num; num++) {
         Eigen::internal::TensorIntDivisor<int64_t> divider(div);
-        int64_t result = num/div;
+        int64_t result = num / div;
         int64_t result_op = divider.divide(num);
         VERIFY_IS_EQUAL(result_op, result);
       }
@@ -130,13 +119,12 @@
   int64_t div = 209715200;
   int64_t num = 3238002688ll;
   Eigen::internal::TensorIntDivisor<int64_t> divider(div);
-  int64_t result = num/div;
+  int64_t result = num / div;
   int64_t result_op = divider.divide(num);
   VERIFY_IS_EQUAL(result, result_op);
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_intdiv)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_intdiv) {
   CALL_SUBTEST_1(test_signed_32bit());
   CALL_SUBTEST_2(test_unsigned_32bit());
   CALL_SUBTEST_3(test_signed_64bit());
diff --git a/unsupported/test/cxx11_tensor_io.cpp b/unsupported/test/cxx11_tensor_io.cpp
index c0ea2a1..16285c1 100644
--- a/unsupported/test/cxx11_tensor_io.cpp
+++ b/unsupported/test/cxx11_tensor_io.cpp
@@ -14,7 +14,7 @@
 template <typename Scalar, int rank, int Layout>
 struct test_tensor_ostream_impl {};
 
-template<typename Scalar, int Layout>
+template <typename Scalar, int Layout>
 struct test_tensor_ostream_impl<Scalar, 0, Layout> {
   static void run() {
     Eigen::Tensor<Scalar, 0> t;
@@ -25,7 +25,7 @@
   }
 };
 
-template<typename Scalar, int Layout>
+template <typename Scalar, int Layout>
 struct test_tensor_ostream_impl<Scalar, 1, Layout> {
   static void run() {
     Eigen::Tensor<Scalar, 1> t = {3};
@@ -36,7 +36,7 @@
   }
 };
 
-template<typename Scalar, int Layout>
+template <typename Scalar, int Layout>
 struct test_tensor_ostream_impl<Scalar, 2, Layout> {
   static void run() {
     Eigen::Tensor<Scalar, 2> t = {3, 2};
@@ -47,7 +47,7 @@
   }
 };
 
-template<typename Scalar, int Layout>
+template <typename Scalar, int Layout>
 struct test_tensor_ostream_impl<Scalar, 3, Layout> {
   static void run() {
     Eigen::Tensor<Scalar, 3> t = {4, 3, 2};
@@ -61,7 +61,7 @@
   }
 };
 
-template<int Layout>
+template <int Layout>
 struct test_tensor_ostream_impl<bool, 2, Layout> {
   static void run() {
     Eigen::Tensor<bool, 2> t = {3, 2};
@@ -72,7 +72,7 @@
   }
 };
 
-template<typename Scalar, int Layout>
+template <typename Scalar, int Layout>
 struct test_tensor_ostream_impl<std::complex<Scalar>, 2, Layout> {
   static void run() {
     Eigen::Tensor<std::complex<Scalar>, 2> t = {3, 2};
diff --git a/unsupported/test/cxx11_tensor_layout_swap.cpp b/unsupported/test/cxx11_tensor_layout_swap.cpp
index efb3333..50fb3ae 100644
--- a/unsupported/test/cxx11_tensor_layout_swap.cpp
+++ b/unsupported/test/cxx11_tensor_layout_swap.cpp
@@ -13,9 +13,8 @@
 
 using Eigen::Tensor;
 
-static void test_simple_swap()
-{
-  Tensor<float, 3, ColMajor> tensor(2,3,7);
+static void test_simple_swap() {
+  Tensor<float, 3, ColMajor> tensor(2, 3, 7);
   tensor.setRandom();
 
   Tensor<float, 3, RowMajor> tensor2 = tensor.swap_layout();
@@ -26,19 +25,17 @@
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_EQUAL(tensor(i,j,k), tensor2(k,j,i));
+        VERIFY_IS_EQUAL(tensor(i, j, k), tensor2(k, j, i));
       }
     }
   }
 }
 
-
-static void test_swap_as_lvalue()
-{
-  Tensor<float, 3, ColMajor> tensor(2,3,7);
+static void test_swap_as_lvalue() {
+  Tensor<float, 3, ColMajor> tensor(2, 3, 7);
   tensor.setRandom();
 
-  Tensor<float, 3, RowMajor> tensor2(7,3,2);
+  Tensor<float, 3, RowMajor> tensor2(7, 3, 2);
   tensor2.swap_layout() = tensor;
   VERIFY_IS_EQUAL(tensor.dimension(0), tensor2.dimension(2));
   VERIFY_IS_EQUAL(tensor.dimension(1), tensor2.dimension(1));
@@ -47,15 +44,13 @@
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_EQUAL(tensor(i,j,k), tensor2(k,j,i));
+        VERIFY_IS_EQUAL(tensor(i, j, k), tensor2(k, j, i));
       }
     }
   }
 }
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_layout_swap)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_layout_swap) {
   CALL_SUBTEST(test_simple_swap());
   CALL_SUBTEST(test_swap_as_lvalue());
 }
diff --git a/unsupported/test/cxx11_tensor_layout_swap_sycl.cpp b/unsupported/test/cxx11_tensor_layout_swap_sycl.cpp
index f556d84..066221e 100644
--- a/unsupported/test/cxx11_tensor_layout_swap_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_layout_swap_sycl.cpp
@@ -25,33 +25,30 @@
 using Eigen::Tensor;
 
 template <typename DataType, typename IndexType>
-static void test_simple_swap_sycl(const Eigen::SyclDevice& sycl_device)
-{
+static void test_simple_swap_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType sizeDim1 = 2;
   IndexType sizeDim2 = 3;
   IndexType sizeDim3 = 7;
   array<IndexType, 3> tensorColRange = {{sizeDim1, sizeDim2, sizeDim3}};
   array<IndexType, 3> tensorRowRange = {{sizeDim3, sizeDim2, sizeDim1}};
 
-
   Tensor<DataType, 3, ColMajor, IndexType> tensor1(tensorColRange);
   Tensor<DataType, 3, RowMajor, IndexType> tensor2(tensorRowRange);
   tensor1.setRandom();
 
-  DataType* gpu_data1  = static_cast<DataType*>(sycl_device.allocate(tensor1.size()*sizeof(DataType)));
-  DataType* gpu_data2  = static_cast<DataType*>(sycl_device.allocate(tensor2.size()*sizeof(DataType)));
+  DataType* gpu_data1 = static_cast<DataType*>(sycl_device.allocate(tensor1.size() * sizeof(DataType)));
+  DataType* gpu_data2 = static_cast<DataType*>(sycl_device.allocate(tensor2.size() * sizeof(DataType)));
   TensorMap<Tensor<DataType, 3, ColMajor, IndexType>> gpu1(gpu_data1, tensorColRange);
   TensorMap<Tensor<DataType, 3, RowMajor, IndexType>> gpu2(gpu_data2, tensorRowRange);
 
-  sycl_device.memcpyHostToDevice(gpu_data1, tensor1.data(),(tensor1.size())*sizeof(DataType));
-  gpu2.device(sycl_device)=gpu1.swap_layout();
-  sycl_device.memcpyDeviceToHost(tensor2.data(), gpu_data2,(tensor2.size())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_data1, tensor1.data(), (tensor1.size()) * sizeof(DataType));
+  gpu2.device(sycl_device) = gpu1.swap_layout();
+  sycl_device.memcpyDeviceToHost(tensor2.data(), gpu_data2, (tensor2.size()) * sizeof(DataType));
 
+  //  Tensor<float, 3, ColMajor> tensor(2,3,7);
+  // tensor.setRandom();
 
-//  Tensor<float, 3, ColMajor> tensor(2,3,7);
-  //tensor.setRandom();
-
-//  Tensor<float, 3, RowMajor> tensor2 = tensor.swap_layout();
+  //  Tensor<float, 3, RowMajor> tensor2 = tensor.swap_layout();
   VERIFY_IS_EQUAL(tensor1.dimension(0), tensor2.dimension(2));
   VERIFY_IS_EQUAL(tensor1.dimension(1), tensor2.dimension(1));
   VERIFY_IS_EQUAL(tensor1.dimension(2), tensor2.dimension(0));
@@ -59,7 +56,7 @@
   for (IndexType i = 0; i < 2; ++i) {
     for (IndexType j = 0; j < 3; ++j) {
       for (IndexType k = 0; k < 7; ++k) {
-        VERIFY_IS_EQUAL(tensor1(i,j,k), tensor2(k,j,i));
+        VERIFY_IS_EQUAL(tensor1(i, j, k), tensor2(k, j, i));
       }
     }
   }
@@ -68,9 +65,7 @@
 }
 
 template <typename DataType, typename IndexType>
-static void test_swap_as_lvalue_sycl(const Eigen::SyclDevice& sycl_device)
-{
-
+static void test_swap_as_lvalue_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType sizeDim1 = 2;
   IndexType sizeDim2 = 3;
   IndexType sizeDim3 = 7;
@@ -81,21 +76,20 @@
   Tensor<DataType, 3, RowMajor, IndexType> tensor2(tensorRowRange);
   tensor1.setRandom();
 
-  DataType* gpu_data1  = static_cast<DataType*>(sycl_device.allocate(tensor1.size()*sizeof(DataType)));
-  DataType* gpu_data2  = static_cast<DataType*>(sycl_device.allocate(tensor2.size()*sizeof(DataType)));
+  DataType* gpu_data1 = static_cast<DataType*>(sycl_device.allocate(tensor1.size() * sizeof(DataType)));
+  DataType* gpu_data2 = static_cast<DataType*>(sycl_device.allocate(tensor2.size() * sizeof(DataType)));
   TensorMap<Tensor<DataType, 3, ColMajor, IndexType>> gpu1(gpu_data1, tensorColRange);
   TensorMap<Tensor<DataType, 3, RowMajor, IndexType>> gpu2(gpu_data2, tensorRowRange);
 
-  sycl_device.memcpyHostToDevice(gpu_data1, tensor1.data(),(tensor1.size())*sizeof(DataType));
-  gpu2.swap_layout().device(sycl_device)=gpu1;
-  sycl_device.memcpyDeviceToHost(tensor2.data(), gpu_data2,(tensor2.size())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_data1, tensor1.data(), (tensor1.size()) * sizeof(DataType));
+  gpu2.swap_layout().device(sycl_device) = gpu1;
+  sycl_device.memcpyDeviceToHost(tensor2.data(), gpu_data2, (tensor2.size()) * sizeof(DataType));
 
+  //  Tensor<float, 3, ColMajor> tensor(2,3,7);
+  //  tensor.setRandom();
 
-//  Tensor<float, 3, ColMajor> tensor(2,3,7);
-//  tensor.setRandom();
-
-  //Tensor<float, 3, RowMajor> tensor2(7,3,2);
-//  tensor2.swap_layout() = tensor;
+  // Tensor<float, 3, RowMajor> tensor2(7,3,2);
+  //  tensor2.swap_layout() = tensor;
   VERIFY_IS_EQUAL(tensor1.dimension(0), tensor2.dimension(2));
   VERIFY_IS_EQUAL(tensor1.dimension(1), tensor2.dimension(1));
   VERIFY_IS_EQUAL(tensor1.dimension(2), tensor2.dimension(0));
@@ -103,7 +97,7 @@
   for (IndexType i = 0; i < 2; ++i) {
     for (IndexType j = 0; j < 3; ++j) {
       for (IndexType k = 0; k < 7; ++k) {
-        VERIFY_IS_EQUAL(tensor1(i,j,k), tensor2(k,j,i));
+        VERIFY_IS_EQUAL(tensor1(i, j, k), tensor2(k, j, i));
       }
     }
   }
@@ -111,16 +105,15 @@
   sycl_device.deallocate(gpu_data2);
 }
 
-
-template<typename DataType, typename dev_Selector> void sycl_tensor_layout_swap_test_per_device(dev_Selector s){
+template <typename DataType, typename dev_Selector>
+void sycl_tensor_layout_swap_test_per_device(dev_Selector s) {
   QueueInterface queueInterface(s);
   auto sycl_device = Eigen::SyclDevice(&queueInterface);
   test_simple_swap_sycl<DataType, int64_t>(sycl_device);
   test_swap_as_lvalue_sycl<DataType, int64_t>(sycl_device);
 }
-EIGEN_DECLARE_TEST(cxx11_tensor_layout_swap_sycl)
-{
-  for (const auto& device :Eigen::get_sycl_supported_devices()) {
+EIGEN_DECLARE_TEST(cxx11_tensor_layout_swap_sycl) {
+  for (const auto& device : Eigen::get_sycl_supported_devices()) {
     CALL_SUBTEST(sycl_tensor_layout_swap_test_per_device<half>(device));
     CALL_SUBTEST(sycl_tensor_layout_swap_test_per_device<float>(device));
   }
diff --git a/unsupported/test/cxx11_tensor_lvalue.cpp b/unsupported/test/cxx11_tensor_lvalue.cpp
index 6ba9a21..d70c7e0 100644
--- a/unsupported/test/cxx11_tensor_lvalue.cpp
+++ b/unsupported/test/cxx11_tensor_lvalue.cpp
@@ -11,15 +11,13 @@
 
 #include <Eigen/CXX11/Tensor>
 
-using Eigen::Tensor;
 using Eigen::RowMajor;
+using Eigen::Tensor;
 
-
-static void test_compound_assignment()
-{
-  Tensor<float, 3> mat1(2,3,7);
-  Tensor<float, 3> mat2(2,3,7);
-  Tensor<float, 3> mat3(2,3,7);
+static void test_compound_assignment() {
+  Tensor<float, 3> mat1(2, 3, 7);
+  Tensor<float, 3> mat2(2, 3, 7);
+  Tensor<float, 3> mat3(2, 3, 7);
 
   mat1.setRandom();
   mat2.setRandom();
@@ -29,14 +27,10 @@
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_APPROX(mat3(i,j,k), mat1(i,j,k) + mat2(i,j,k));
+        VERIFY_IS_APPROX(mat3(i, j, k), mat1(i, j, k) + mat2(i, j, k));
       }
     }
   }
 }
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_lvalue)
-{
-  CALL_SUBTEST(test_compound_assignment());
-}
+EIGEN_DECLARE_TEST(cxx11_tensor_lvalue) { CALL_SUBTEST(test_compound_assignment()); }
diff --git a/unsupported/test/cxx11_tensor_map.cpp b/unsupported/test/cxx11_tensor_map.cpp
index 4d4f689..25176f4 100644
--- a/unsupported/test/cxx11_tensor_map.cpp
+++ b/unsupported/test/cxx11_tensor_map.cpp
@@ -11,11 +11,10 @@
 
 #include <Eigen/CXX11/Tensor>
 
-using Eigen::Tensor;
 using Eigen::RowMajor;
+using Eigen::Tensor;
 
-static void test_0d()
-{
+static void test_0d() {
   Tensor<int, 0> scalar1;
   Tensor<int, 0, RowMajor> scalar2;
 
@@ -32,20 +31,25 @@
   VERIFY_IS_EQUAL(scalar4(), 13);
 }
 
-static void test_1d()
-{
+static void test_1d() {
   Tensor<int, 1> vec1(6);
   Tensor<int, 1, RowMajor> vec2(6);
 
   TensorMap<const Tensor<int, 1> > vec3(vec1.data(), 6);
   TensorMap<const Tensor<int, 1, RowMajor> > vec4(vec2.data(), 6);
 
-  vec1(0) = 4;  vec2(0) = 0;
-  vec1(1) = 8;  vec2(1) = 1;
-  vec1(2) = 15; vec2(2) = 2;
-  vec1(3) = 16; vec2(3) = 3;
-  vec1(4) = 23; vec2(4) = 4;
-  vec1(5) = 42; vec2(5) = 5;
+  vec1(0) = 4;
+  vec2(0) = 0;
+  vec1(1) = 8;
+  vec2(1) = 1;
+  vec1(2) = 15;
+  vec2(2) = 2;
+  vec1(3) = 16;
+  vec2(3) = 3;
+  vec1(4) = 23;
+  vec2(4) = 4;
+  vec1(5) = 42;
+  vec2(5) = 5;
 
   VERIFY_IS_EQUAL(vec1.rank(), 1);
   VERIFY_IS_EQUAL(vec1.size(), 6);
@@ -66,24 +70,23 @@
   VERIFY_IS_EQUAL(vec4(5), 5);
 }
 
-static void test_2d()
-{
-  Tensor<int, 2> mat1(2,3);
-  Tensor<int, 2, RowMajor> mat2(2,3);
+static void test_2d() {
+  Tensor<int, 2> mat1(2, 3);
+  Tensor<int, 2, RowMajor> mat2(2, 3);
 
-  mat1(0,0) = 0;
-  mat1(0,1) = 1;
-  mat1(0,2) = 2;
-  mat1(1,0) = 3;
-  mat1(1,1) = 4;
-  mat1(1,2) = 5;
+  mat1(0, 0) = 0;
+  mat1(0, 1) = 1;
+  mat1(0, 2) = 2;
+  mat1(1, 0) = 3;
+  mat1(1, 1) = 4;
+  mat1(1, 2) = 5;
 
-  mat2(0,0) = 0;
-  mat2(0,1) = 1;
-  mat2(0,2) = 2;
-  mat2(1,0) = 3;
-  mat2(1,1) = 4;
-  mat2(1,2) = 5;
+  mat2(0, 0) = 0;
+  mat2(0, 1) = 1;
+  mat2(0, 2) = 2;
+  mat2(1, 0) = 3;
+  mat2(1, 1) = 4;
+  mat2(1, 2) = 5;
 
   TensorMap<const Tensor<int, 2> > mat3(mat1.data(), 2, 3);
   TensorMap<const Tensor<int, 2, RowMajor> > mat4(mat2.data(), 2, 3);
@@ -98,32 +101,31 @@
   VERIFY_IS_EQUAL(mat4.dimension(0), 2);
   VERIFY_IS_EQUAL(mat4.dimension(1), 3);
 
-  VERIFY_IS_EQUAL(mat3(0,0), 0);
-  VERIFY_IS_EQUAL(mat3(0,1), 1);
-  VERIFY_IS_EQUAL(mat3(0,2), 2);
-  VERIFY_IS_EQUAL(mat3(1,0), 3);
-  VERIFY_IS_EQUAL(mat3(1,1), 4);
-  VERIFY_IS_EQUAL(mat3(1,2), 5);
+  VERIFY_IS_EQUAL(mat3(0, 0), 0);
+  VERIFY_IS_EQUAL(mat3(0, 1), 1);
+  VERIFY_IS_EQUAL(mat3(0, 2), 2);
+  VERIFY_IS_EQUAL(mat3(1, 0), 3);
+  VERIFY_IS_EQUAL(mat3(1, 1), 4);
+  VERIFY_IS_EQUAL(mat3(1, 2), 5);
 
-  VERIFY_IS_EQUAL(mat4(0,0), 0);
-  VERIFY_IS_EQUAL(mat4(0,1), 1);
-  VERIFY_IS_EQUAL(mat4(0,2), 2);
-  VERIFY_IS_EQUAL(mat4(1,0), 3);
-  VERIFY_IS_EQUAL(mat4(1,1), 4);
-  VERIFY_IS_EQUAL(mat4(1,2), 5);
+  VERIFY_IS_EQUAL(mat4(0, 0), 0);
+  VERIFY_IS_EQUAL(mat4(0, 1), 1);
+  VERIFY_IS_EQUAL(mat4(0, 2), 2);
+  VERIFY_IS_EQUAL(mat4(1, 0), 3);
+  VERIFY_IS_EQUAL(mat4(1, 1), 4);
+  VERIFY_IS_EQUAL(mat4(1, 2), 5);
 }
 
-static void test_3d()
-{
-  Tensor<int, 3> mat1(2,3,7);
-  Tensor<int, 3, RowMajor> mat2(2,3,7);
+static void test_3d() {
+  Tensor<int, 3> mat1(2, 3, 7);
+  Tensor<int, 3, RowMajor> mat2(2, 3, 7);
 
   int val = 0;
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        mat1(i,j,k) = val;
-        mat2(i,j,k) = val;
+        mat1(i, j, k) = val;
+        mat2(i, j, k) = val;
         val++;
       }
     }
@@ -133,13 +135,13 @@
   TensorMap<const Tensor<int, 3, RowMajor> > mat4(mat2.data(), 2, 3, 7);
 
   VERIFY_IS_EQUAL(mat3.rank(), 3);
-  VERIFY_IS_EQUAL(mat3.size(), 2*3*7);
+  VERIFY_IS_EQUAL(mat3.size(), 2 * 3 * 7);
   VERIFY_IS_EQUAL(mat3.dimension(0), 2);
   VERIFY_IS_EQUAL(mat3.dimension(1), 3);
   VERIFY_IS_EQUAL(mat3.dimension(2), 7);
 
   VERIFY_IS_EQUAL(mat4.rank(), 3);
-  VERIFY_IS_EQUAL(mat4.size(), 2*3*7);
+  VERIFY_IS_EQUAL(mat4.size(), 2 * 3 * 7);
   VERIFY_IS_EQUAL(mat4.dimension(0), 2);
   VERIFY_IS_EQUAL(mat4.dimension(1), 3);
   VERIFY_IS_EQUAL(mat4.dimension(2), 7);
@@ -148,26 +150,24 @@
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_EQUAL(mat3(i,j,k), val);
-        VERIFY_IS_EQUAL(mat4(i,j,k), val);
+        VERIFY_IS_EQUAL(mat3(i, j, k), val);
+        VERIFY_IS_EQUAL(mat4(i, j, k), val);
         val++;
       }
     }
   }
 }
 
-
-static void test_from_tensor()
-{
-  Tensor<int, 3> mat1(2,3,7);
-  Tensor<int, 3, RowMajor> mat2(2,3,7);
+static void test_from_tensor() {
+  Tensor<int, 3> mat1(2, 3, 7);
+  Tensor<int, 3, RowMajor> mat2(2, 3, 7);
 
   int val = 0;
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        mat1(i,j,k) = val;
-        mat2(i,j,k) = val;
+        mat1(i, j, k) = val;
+        mat2(i, j, k) = val;
         val++;
       }
     }
@@ -177,13 +177,13 @@
   TensorMap<Tensor<int, 3, RowMajor> > mat4(mat2);
 
   VERIFY_IS_EQUAL(mat3.rank(), 3);
-  VERIFY_IS_EQUAL(mat3.size(), 2*3*7);
+  VERIFY_IS_EQUAL(mat3.size(), 2 * 3 * 7);
   VERIFY_IS_EQUAL(mat3.dimension(0), 2);
   VERIFY_IS_EQUAL(mat3.dimension(1), 3);
   VERIFY_IS_EQUAL(mat3.dimension(2), 7);
 
   VERIFY_IS_EQUAL(mat4.rank(), 3);
-  VERIFY_IS_EQUAL(mat4.size(), 2*3*7);
+  VERIFY_IS_EQUAL(mat4.size(), 2 * 3 * 7);
   VERIFY_IS_EQUAL(mat4.dimension(0), 2);
   VERIFY_IS_EQUAL(mat4.dimension(1), 3);
   VERIFY_IS_EQUAL(mat4.dimension(2), 7);
@@ -192,14 +192,14 @@
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_EQUAL(mat3(i,j,k), val);
-        VERIFY_IS_EQUAL(mat4(i,j,k), val);
+        VERIFY_IS_EQUAL(mat3(i, j, k), val);
+        VERIFY_IS_EQUAL(mat4(i, j, k), val);
         val++;
       }
     }
   }
 
-  TensorFixedSize<int, Sizes<2,3,7> > mat5;
+  TensorFixedSize<int, Sizes<2, 3, 7> > mat5;
 
   val = 0;
   for (int i = 0; i < 2; ++i) {
@@ -215,10 +215,10 @@
     }
   }
 
-  TensorMap<TensorFixedSize<int, Sizes<2,3,7> > > mat6(mat5);
+  TensorMap<TensorFixedSize<int, Sizes<2, 3, 7> > > mat6(mat5);
 
   VERIFY_IS_EQUAL(mat6.rank(), 3);
-  VERIFY_IS_EQUAL(mat6.size(), 2*3*7);
+  VERIFY_IS_EQUAL(mat6.size(), 2 * 3 * 7);
   VERIFY_IS_EQUAL(mat6.dimension(0), 2);
   VERIFY_IS_EQUAL(mat6.dimension(1), 3);
   VERIFY_IS_EQUAL(mat6.dimension(2), 7);
@@ -227,14 +227,13 @@
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_EQUAL(mat6(i,j,k), val);
+        VERIFY_IS_EQUAL(mat6(i, j, k), val);
         val++;
       }
     }
   }
 }
 
-
 static int f(const TensorMap<Tensor<int, 3> >& tensor) {
   //  Size<0> empty;
   EIGEN_STATIC_ASSERT((internal::array_size<Sizes<> >::value == 0), YOU_MADE_A_PROGRAMMING_MISTAKE);
@@ -243,15 +242,14 @@
   return result();
 }
 
-static void test_casting()
-{
-  Tensor<int, 3> tensor(2,3,7);
+static void test_casting() {
+  Tensor<int, 3> tensor(2, 3, 7);
 
   int val = 0;
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        tensor(i,j,k) = val;
+        tensor(i, j, k) = val;
         val++;
       }
     }
@@ -265,13 +263,12 @@
   VERIFY_IS_EQUAL(sum1, 861);
 }
 
-template<typename T>
+template <typename T>
 static const T& add_const(T& value) {
   return value;
 }
 
-static void test_0d_const_tensor()
-{
+static void test_0d_const_tensor() {
   Tensor<int, 0> scalar1;
   Tensor<int, 0, RowMajor> scalar2;
 
@@ -288,8 +285,7 @@
   VERIFY_IS_EQUAL(scalar4(), 13);
 }
 
-static void test_0d_const_tensor_map()
-{
+static void test_0d_const_tensor_map() {
   Tensor<int, 0> scalar1;
   Tensor<int, 0, RowMajor> scalar2;
 
@@ -312,8 +308,7 @@
   VERIFY_IS_EQUAL(scalar2(), 14);
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_map)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_map) {
   CALL_SUBTEST(test_0d());
   CALL_SUBTEST(test_1d());
   CALL_SUBTEST(test_2d());
diff --git a/unsupported/test/cxx11_tensor_math.cpp b/unsupported/test/cxx11_tensor_math.cpp
index 82a1a26..8184b88 100644
--- a/unsupported/test/cxx11_tensor_math.cpp
+++ b/unsupported/test/cxx11_tensor_math.cpp
@@ -11,11 +11,10 @@
 
 #include <Eigen/CXX11/Tensor>
 
-using Eigen::Tensor;
 using Eigen::RowMajor;
+using Eigen::Tensor;
 
-static void test_tanh()
-{
+static void test_tanh() {
   Tensor<float, 1> vec1(6);
   vec1.setRandom();
 
@@ -26,8 +25,7 @@
   }
 }
 
-static void test_sigmoid()
-{
+static void test_sigmoid() {
   Tensor<float, 1> vec1(6);
   vec1.setRandom();
 
@@ -38,9 +36,7 @@
   }
 }
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_math)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_math) {
   CALL_SUBTEST(test_tanh());
   CALL_SUBTEST(test_sigmoid());
 }
diff --git a/unsupported/test/cxx11_tensor_math_sycl.cpp b/unsupported/test/cxx11_tensor_math_sycl.cpp
index 84d638e..7152a58 100644
--- a/unsupported/test/cxx11_tensor_math_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_math_sycl.cpp
@@ -25,12 +25,10 @@
 using Eigen::Tensor;
 using Eigen::TensorMap;
 
-using Eigen::Tensor;
 using Eigen::RowMajor;
+using Eigen::Tensor;
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_tanh_sycl(const Eigen::SyclDevice &sycl_device)
-{
-
+static void test_tanh_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType sizeDim1 = 4;
   IndexType sizeDim2 = 4;
   IndexType sizeDim3 = 1;
@@ -41,26 +39,24 @@
 
   in = in.random();
 
-  DataType* gpu_data1  = static_cast<DataType*>(sycl_device.allocate(in.size()*sizeof(DataType)));
-  DataType* gpu_data2  = static_cast<DataType*>(sycl_device.allocate(out.size()*sizeof(DataType)));
+  DataType* gpu_data1 = static_cast<DataType*>(sycl_device.allocate(in.size() * sizeof(DataType)));
+  DataType* gpu_data2 = static_cast<DataType*>(sycl_device.allocate(out.size() * sizeof(DataType)));
 
   TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> gpu1(gpu_data1, tensorRange);
   TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> gpu2(gpu_data2, tensorRange);
 
-  sycl_device.memcpyHostToDevice(gpu_data1, in.data(),(in.size())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_data1, in.data(), (in.size()) * sizeof(DataType));
   gpu2.device(sycl_device) = gpu1.tanh();
-  sycl_device.memcpyDeviceToHost(out.data(), gpu_data2,(out.size())*sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(out.data(), gpu_data2, (out.size()) * sizeof(DataType));
 
-  out_cpu=in.tanh();
+  out_cpu = in.tanh();
 
   for (int i = 0; i < in.size(); ++i) {
     VERIFY_IS_APPROX(out(i), out_cpu(i));
   }
 }
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_sigmoid_sycl(const Eigen::SyclDevice &sycl_device)
-{
-
+static void test_sigmoid_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType sizeDim1 = 4;
   IndexType sizeDim2 = 4;
   IndexType sizeDim3 = 1;
@@ -71,25 +67,25 @@
 
   in = in.random();
 
-  DataType* gpu_data1  = static_cast<DataType*>(sycl_device.allocate(in.size()*sizeof(DataType)));
-  DataType* gpu_data2  = static_cast<DataType*>(sycl_device.allocate(out.size()*sizeof(DataType)));
+  DataType* gpu_data1 = static_cast<DataType*>(sycl_device.allocate(in.size() * sizeof(DataType)));
+  DataType* gpu_data2 = static_cast<DataType*>(sycl_device.allocate(out.size() * sizeof(DataType)));
 
   TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> gpu1(gpu_data1, tensorRange);
   TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> gpu2(gpu_data2, tensorRange);
 
-  sycl_device.memcpyHostToDevice(gpu_data1, in.data(),(in.size())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_data1, in.data(), (in.size()) * sizeof(DataType));
   gpu2.device(sycl_device) = gpu1.sigmoid();
-  sycl_device.memcpyDeviceToHost(out.data(), gpu_data2,(out.size())*sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(out.data(), gpu_data2, (out.size()) * sizeof(DataType));
 
-  out_cpu=in.sigmoid();
+  out_cpu = in.sigmoid();
 
   for (int i = 0; i < in.size(); ++i) {
     VERIFY_IS_APPROX(out(i), out_cpu(i));
   }
 }
 
-
-template<typename DataType, typename dev_Selector> void sycl_computing_test_per_device(dev_Selector s){
+template <typename DataType, typename dev_Selector>
+void sycl_computing_test_per_device(dev_Selector s) {
   QueueInterface queueInterface(s);
   auto sycl_device = Eigen::SyclDevice(&queueInterface);
   test_tanh_sycl<DataType, RowMajor, int64_t>(sycl_device);
@@ -99,7 +95,7 @@
 }
 
 EIGEN_DECLARE_TEST(cxx11_tensor_math_sycl) {
-  for (const auto& device :Eigen::get_sycl_supported_devices()) {
+  for (const auto& device : Eigen::get_sycl_supported_devices()) {
     CALL_SUBTEST(sycl_computing_test_per_device<half>(device));
     CALL_SUBTEST(sycl_computing_test_per_device<float>(device));
   }
diff --git a/unsupported/test/cxx11_tensor_mixed_indices.cpp b/unsupported/test/cxx11_tensor_mixed_indices.cpp
index ee2616f..be6c486 100644
--- a/unsupported/test/cxx11_tensor_mixed_indices.cpp
+++ b/unsupported/test/cxx11_tensor_mixed_indices.cpp
@@ -11,18 +11,22 @@
 
 #include <Eigen/CXX11/Tensor>
 
-
-static void test_simple()
-{
+static void test_simple() {
   Tensor<float, 1, ColMajor> vec1(6);
   Tensor<float, 1, ColMajor, int> vec2(6);
 
-  vec1(0) = 4.0;  vec2(0) = 0.0;
-  vec1(1) = 8.0;  vec2(1) = 1.0;
-  vec1(2) = 15.0; vec2(2) = 2.0;
-  vec1(3) = 16.0; vec2(3) = 3.0;
-  vec1(4) = 23.0; vec2(4) = 4.0;
-  vec1(5) = 42.0; vec2(5) = 5.0;
+  vec1(0) = 4.0;
+  vec2(0) = 0.0;
+  vec1(1) = 8.0;
+  vec2(1) = 1.0;
+  vec1(2) = 15.0;
+  vec2(2) = 2.0;
+  vec1(3) = 16.0;
+  vec2(3) = 3.0;
+  vec1(4) = 23.0;
+  vec2(4) = 4.0;
+  vec1(5) = 42.0;
+  vec2(5) = 5.0;
 
   float data3[6];
   TensorMap<Tensor<float, 1, ColMajor>> vec3(data3, 6);
@@ -46,8 +50,4 @@
   VERIFY_IS_APPROX(vec4(5), 5.0f * 5.0f);
 }
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_mixed_indices)
-{
-  CALL_SUBTEST(test_simple());
-}
+EIGEN_DECLARE_TEST(cxx11_tensor_mixed_indices) { CALL_SUBTEST(test_simple()); }
diff --git a/unsupported/test/cxx11_tensor_morphing.cpp b/unsupported/test/cxx11_tensor_morphing.cpp
index d039a7e..0672572 100644
--- a/unsupported/test/cxx11_tensor_morphing.cpp
+++ b/unsupported/test/cxx11_tensor_morphing.cpp
@@ -13,29 +13,28 @@
 
 using Eigen::Tensor;
 
-template<typename>
-static void test_simple_reshape()
-{
-  Tensor<float, 5> tensor1(2,3,1,7,1);
+template <typename>
+static void test_simple_reshape() {
+  Tensor<float, 5> tensor1(2, 3, 1, 7, 1);
   tensor1.setRandom();
 
-  Tensor<float, 3> tensor2(2,3,7);
-  Tensor<float, 2> tensor3(6,7);
-  Tensor<float, 2> tensor4(2,21);
+  Tensor<float, 3> tensor2(2, 3, 7);
+  Tensor<float, 2> tensor3(6, 7);
+  Tensor<float, 2> tensor4(2, 21);
 
-  Tensor<float, 3>::Dimensions dim1(2,3,7);
+  Tensor<float, 3>::Dimensions dim1(2, 3, 7);
   tensor2 = tensor1.reshape(dim1);
-  Tensor<float, 2>::Dimensions dim2(6,7);
+  Tensor<float, 2>::Dimensions dim2(6, 7);
   tensor3 = tensor1.reshape(dim2);
-  Tensor<float, 2>::Dimensions dim3(2,21);
+  Tensor<float, 2>::Dimensions dim3(2, 21);
   tensor4 = tensor1.reshape(dim1).reshape(dim3);
 
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_EQUAL(tensor1(i,j,0,k,0), tensor2(i,j,k));
-        VERIFY_IS_EQUAL(tensor1(i,j,0,k,0), tensor3(i+2*j,k));
-        VERIFY_IS_EQUAL(tensor1(i,j,0,k,0), tensor4(i,j+3*k));
+        VERIFY_IS_EQUAL(tensor1(i, j, 0, k, 0), tensor2(i, j, k));
+        VERIFY_IS_EQUAL(tensor1(i, j, 0, k, 0), tensor3(i + 2 * j, k));
+        VERIFY_IS_EQUAL(tensor1(i, j, 0, k, 0), tensor4(i, j + 3 * k));
       }
     }
   }
@@ -50,7 +49,7 @@
 
   // New dimensions: [2, 3, 7]
   Eigen::IndexList<type2index<2>, type2index<3>, type2index<7>> dim;
-  Tensor<float, 3> reshaped = tensor.reshape(static_cast<Eigen::DSizes<ptrdiff_t,3>>(dim));
+  Tensor<float, 3> reshaped = tensor.reshape(static_cast<Eigen::DSizes<ptrdiff_t, 3>>(dim));
 
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
@@ -63,94 +62,91 @@
 
 template <typename>
 static void test_reshape_in_expr() {
-  MatrixXf m1(2,3*5*7*11);
-  MatrixXf m2(3*5*7*11,13);
+  MatrixXf m1(2, 3 * 5 * 7 * 11);
+  MatrixXf m2(3 * 5 * 7 * 11, 13);
   m1.setRandom();
   m2.setRandom();
   MatrixXf m3 = m1 * m2;
 
-  TensorMap<Tensor<float, 5>> tensor1(m1.data(), 2,3,5,7,11);
-  TensorMap<Tensor<float, 5>> tensor2(m2.data(), 3,5,7,11,13);
-  Tensor<float, 2>::Dimensions newDims1(2,3*5*7*11);
-  Tensor<float, 2>::Dimensions newDims2(3*5*7*11,13);
+  TensorMap<Tensor<float, 5>> tensor1(m1.data(), 2, 3, 5, 7, 11);
+  TensorMap<Tensor<float, 5>> tensor2(m2.data(), 3, 5, 7, 11, 13);
+  Tensor<float, 2>::Dimensions newDims1(2, 3 * 5 * 7 * 11);
+  Tensor<float, 2>::Dimensions newDims2(3 * 5 * 7 * 11, 13);
   typedef Tensor<float, 1>::DimensionPair DimPair;
   array<DimPair, 1> contract_along{{DimPair(1, 0)}};
-  Tensor<float, 2> tensor3(2,13);
+  Tensor<float, 2> tensor3(2, 13);
   tensor3 = tensor1.reshape(newDims1).contract(tensor2.reshape(newDims2), contract_along);
 
   Map<MatrixXf> res(tensor3.data(), 2, 13);
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 13; ++j) {
-      VERIFY_IS_APPROX(res(i,j), m3(i,j));
+      VERIFY_IS_APPROX(res(i, j), m3(i, j));
     }
   }
 }
 
-template<typename>
-static void test_reshape_as_lvalue()
-{
-  Tensor<float, 3> tensor(2,3,7);
+template <typename>
+static void test_reshape_as_lvalue() {
+  Tensor<float, 3> tensor(2, 3, 7);
   tensor.setRandom();
 
-  Tensor<float, 2> tensor2d(6,7);
-  Tensor<float, 3>::Dimensions dim(2,3,7);
+  Tensor<float, 2> tensor2d(6, 7);
+  Tensor<float, 3>::Dimensions dim(2, 3, 7);
   tensor2d.reshape(dim) = tensor;
 
-  float scratch[2*3*1*7*1];
-  TensorMap<Tensor<float, 5>> tensor5d(scratch, 2,3,1,7,1);
+  float scratch[2 * 3 * 1 * 7 * 1];
+  TensorMap<Tensor<float, 5>> tensor5d(scratch, 2, 3, 1, 7, 1);
   tensor5d.reshape(dim).device(Eigen::DefaultDevice()) = tensor;
 
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_EQUAL(tensor2d(i+2*j,k), tensor(i,j,k));
-        VERIFY_IS_EQUAL(tensor5d(i,j,0,k,0), tensor(i,j,k));
+        VERIFY_IS_EQUAL(tensor2d(i + 2 * j, k), tensor(i, j, k));
+        VERIFY_IS_EQUAL(tensor5d(i, j, 0, k, 0), tensor(i, j, k));
       }
     }
   }
 }
 
-template<typename T, int DataLayout>
-static void test_simple_slice()
-{
-  Tensor<T, 5, DataLayout> tensor(2,3,5,7,11);
+template <typename T, int DataLayout>
+static void test_simple_slice() {
+  Tensor<T, 5, DataLayout> tensor(2, 3, 5, 7, 11);
   tensor.setRandom();
 
-  Tensor<T, 5, DataLayout> slice1(1,1,1,1,1);
-  Eigen::DSizes<ptrdiff_t, 5> indices(1,2,3,4,5);
-  Eigen::DSizes<ptrdiff_t, 5> sizes(1,1,1,1,1);
+  Tensor<T, 5, DataLayout> slice1(1, 1, 1, 1, 1);
+  Eigen::DSizes<ptrdiff_t, 5> indices(1, 2, 3, 4, 5);
+  Eigen::DSizes<ptrdiff_t, 5> sizes(1, 1, 1, 1, 1);
   slice1 = tensor.slice(indices, sizes);
-  VERIFY_IS_EQUAL(slice1(0,0,0,0,0), tensor(1,2,3,4,5));
+  VERIFY_IS_EQUAL(slice1(0, 0, 0, 0, 0), tensor(1, 2, 3, 4, 5));
 
-  Tensor<T, 5, DataLayout> slice2(1,1,2,2,3);
-  Eigen::DSizes<ptrdiff_t, 5> indices2(1,1,3,4,5);
-  Eigen::DSizes<ptrdiff_t, 5> sizes2(1,1,2,2,3);
+  Tensor<T, 5, DataLayout> slice2(1, 1, 2, 2, 3);
+  Eigen::DSizes<ptrdiff_t, 5> indices2(1, 1, 3, 4, 5);
+  Eigen::DSizes<ptrdiff_t, 5> sizes2(1, 1, 2, 2, 3);
   slice2 = tensor.slice(indices2, sizes2);
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 2; ++j) {
       for (int k = 0; k < 3; ++k) {
-        VERIFY_IS_EQUAL(slice2(0,0,i,j,k), tensor(1,1,3+i,4+j,5+k));
+        VERIFY_IS_EQUAL(slice2(0, 0, i, j, k), tensor(1, 1, 3 + i, 4 + j, 5 + k));
       }
     }
   }
 }
 
-template<typename T>
-static void test_const_slice()
-{
+template <typename T>
+static void test_const_slice() {
   const T b[1] = {42};
-  TensorMap<Tensor<const T, 1> > m(b, 1);
+  TensorMap<Tensor<const T, 1>> m(b, 1);
   DSizes<DenseIndex, 1> offsets;
   offsets[0] = 0;
-  TensorRef<Tensor<const T, 1> > slice_ref(m.slice(offsets, m.dimensions()));
+  TensorRef<Tensor<const T, 1>> slice_ref(m.slice(offsets, m.dimensions()));
   VERIFY_IS_EQUAL(slice_ref(0), 42);
 }
 
-template<typename T, int DataLayout>
+template <typename T, int DataLayout>
 static void test_slice_in_expr() {
   typedef Matrix<T, Dynamic, Dynamic, DataLayout> Mtx;
-  Mtx m1(7,7);
-  Mtx m2(3,3);
+  Mtx m1(7, 7);
+  Mtx m2(3, 3);
   m1.setRandom();
   m2.setRandom();
 
@@ -158,148 +154,147 @@
 
   TensorMap<Tensor<T, 2, DataLayout>> tensor1(m1.data(), 7, 7);
   TensorMap<Tensor<T, 2, DataLayout>> tensor2(m2.data(), 3, 3);
-  Tensor<T, 2, DataLayout> tensor3(3,1);
+  Tensor<T, 2, DataLayout> tensor3(3, 1);
   typedef typename Tensor<T, 1>::DimensionPair DimPair;
   array<DimPair, 1> contract_along{{DimPair(1, 0)}};
 
-  Eigen::DSizes<ptrdiff_t, 2> indices1(1,2);
-  Eigen::DSizes<ptrdiff_t, 2> sizes1(3,3);
-  Eigen::DSizes<ptrdiff_t, 2> indices2(0,2);
-  Eigen::DSizes<ptrdiff_t, 2> sizes2(3,1);
+  Eigen::DSizes<ptrdiff_t, 2> indices1(1, 2);
+  Eigen::DSizes<ptrdiff_t, 2> sizes1(3, 3);
+  Eigen::DSizes<ptrdiff_t, 2> indices2(0, 2);
+  Eigen::DSizes<ptrdiff_t, 2> sizes2(3, 1);
   tensor3 = tensor1.slice(indices1, sizes1).contract(tensor2.slice(indices2, sizes2), contract_along);
 
   Map<Mtx> res(tensor3.data(), 3, 1);
   for (int i = 0; i < 3; ++i) {
     for (int j = 0; j < 1; ++j) {
-      VERIFY_IS_APPROX(res(i,j), m3(i,j));
+      VERIFY_IS_APPROX(res(i, j), m3(i, j));
     }
   }
 
   // Take an arbitrary slice of an arbitrarily sized tensor.
   TensorMap<Tensor<const T, 2, DataLayout>> tensor4(m1.data(), 7, 7);
-  Tensor<T, 1, DataLayout> tensor6 = tensor4.reshape(DSizes<ptrdiff_t, 1>(7*7)).exp().slice(DSizes<ptrdiff_t, 1>(0), DSizes<ptrdiff_t, 1>(35));
+  Tensor<T, 1, DataLayout> tensor6 =
+      tensor4.reshape(DSizes<ptrdiff_t, 1>(7 * 7)).exp().slice(DSizes<ptrdiff_t, 1>(0), DSizes<ptrdiff_t, 1>(35));
   for (int i = 0; i < 35; ++i) {
     VERIFY_IS_APPROX(tensor6(i), expf(tensor4.data()[i]));
   }
 }
 
-template<typename T, int DataLayout>
-static void test_slice_as_lvalue()
-{
-  Tensor<T, 3, DataLayout> tensor1(2,2,7);
+template <typename T, int DataLayout>
+static void test_slice_as_lvalue() {
+  Tensor<T, 3, DataLayout> tensor1(2, 2, 7);
   tensor1.setRandom();
-  Tensor<T, 3, DataLayout> tensor2(2,2,7);
+  Tensor<T, 3, DataLayout> tensor2(2, 2, 7);
   tensor2.setRandom();
-  Tensor<T, 3, DataLayout> tensor3(4,3,5);
+  Tensor<T, 3, DataLayout> tensor3(4, 3, 5);
   tensor3.setRandom();
-  Tensor<T, 3, DataLayout> tensor4(4,3,2);
+  Tensor<T, 3, DataLayout> tensor4(4, 3, 2);
   tensor4.setRandom();
-  Tensor<T, 3, DataLayout> tensor5(10,13,12);
+  Tensor<T, 3, DataLayout> tensor5(10, 13, 12);
   tensor5.setRandom();
 
-  Tensor<T, 3, DataLayout> result(4,5,7);
-  Eigen::DSizes<ptrdiff_t, 3> sizes12(2,2,7);
-  Eigen::DSizes<ptrdiff_t, 3> first_slice(0,0,0);
+  Tensor<T, 3, DataLayout> result(4, 5, 7);
+  Eigen::DSizes<ptrdiff_t, 3> sizes12(2, 2, 7);
+  Eigen::DSizes<ptrdiff_t, 3> first_slice(0, 0, 0);
   result.slice(first_slice, sizes12) = tensor1;
-  Eigen::DSizes<ptrdiff_t, 3> second_slice(2,0,0);
+  Eigen::DSizes<ptrdiff_t, 3> second_slice(2, 0, 0);
   result.slice(second_slice, sizes12).device(Eigen::DefaultDevice()) = tensor2;
 
-  Eigen::DSizes<ptrdiff_t, 3> sizes3(4,3,5);
-  Eigen::DSizes<ptrdiff_t, 3> third_slice(0,2,0);
+  Eigen::DSizes<ptrdiff_t, 3> sizes3(4, 3, 5);
+  Eigen::DSizes<ptrdiff_t, 3> third_slice(0, 2, 0);
   result.slice(third_slice, sizes3) = tensor3;
 
-  Eigen::DSizes<ptrdiff_t, 3> sizes4(4,3,2);
-  Eigen::DSizes<ptrdiff_t, 3> fourth_slice(0,2,5);
+  Eigen::DSizes<ptrdiff_t, 3> sizes4(4, 3, 2);
+  Eigen::DSizes<ptrdiff_t, 3> fourth_slice(0, 2, 5);
   result.slice(fourth_slice, sizes4) = tensor4;
 
   for (int j = 0; j < 2; ++j) {
     for (int k = 0; k < 7; ++k) {
       for (int i = 0; i < 2; ++i) {
-        VERIFY_IS_EQUAL(result(i,j,k), tensor1(i,j,k));
-        VERIFY_IS_EQUAL(result(i+2,j,k), tensor2(i,j,k));
+        VERIFY_IS_EQUAL(result(i, j, k), tensor1(i, j, k));
+        VERIFY_IS_EQUAL(result(i + 2, j, k), tensor2(i, j, k));
       }
     }
   }
   for (int i = 0; i < 4; ++i) {
     for (int j = 2; j < 5; ++j) {
       for (int k = 0; k < 5; ++k) {
-        VERIFY_IS_EQUAL(result(i,j,k), tensor3(i,j-2,k));
+        VERIFY_IS_EQUAL(result(i, j, k), tensor3(i, j - 2, k));
       }
       for (int k = 5; k < 7; ++k) {
-        VERIFY_IS_EQUAL(result(i,j,k), tensor4(i,j-2,k-5));
+        VERIFY_IS_EQUAL(result(i, j, k), tensor4(i, j - 2, k - 5));
       }
     }
   }
 
-  Eigen::DSizes<ptrdiff_t, 3> sizes5(4,5,7);
-  Eigen::DSizes<ptrdiff_t, 3> fifth_slice(0,0,0);
+  Eigen::DSizes<ptrdiff_t, 3> sizes5(4, 5, 7);
+  Eigen::DSizes<ptrdiff_t, 3> fifth_slice(0, 0, 0);
   result.slice(fifth_slice, sizes5) = tensor5.slice(fifth_slice, sizes5);
   for (int i = 0; i < 4; ++i) {
     for (int j = 2; j < 5; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_EQUAL(result(i,j,k), tensor5(i,j,k));
+        VERIFY_IS_EQUAL(result(i, j, k), tensor5(i, j, k));
       }
     }
   }
 }
 
-template<typename T, int DataLayout>
-static void test_slice_raw_data()
-{
-  Tensor<T, 4, DataLayout> tensor(3,5,7,11);
+template <typename T, int DataLayout>
+static void test_slice_raw_data() {
+  Tensor<T, 4, DataLayout> tensor(3, 5, 7, 11);
   tensor.setRandom();
 
-  Eigen::DSizes<ptrdiff_t, 4> offsets(1,2,3,4);
-  Eigen::DSizes<ptrdiff_t, 4> extents(1,1,1,1);
+  Eigen::DSizes<ptrdiff_t, 4> offsets(1, 2, 3, 4);
+  Eigen::DSizes<ptrdiff_t, 4> extents(1, 1, 1, 1);
   typedef TensorEvaluator<decltype(tensor.slice(offsets, extents)), DefaultDevice> SliceEvaluator;
   auto slice1 = SliceEvaluator(tensor.slice(offsets, extents), DefaultDevice());
   VERIFY_IS_EQUAL(slice1.dimensions().TotalSize(), 1);
-  VERIFY_IS_EQUAL(slice1.data()[0], tensor(1,2,3,4));
+  VERIFY_IS_EQUAL(slice1.data()[0], tensor(1, 2, 3, 4));
 
   if (DataLayout == ColMajor) {
-    extents = Eigen::DSizes<ptrdiff_t, 4>(2,1,1,1);
+    extents = Eigen::DSizes<ptrdiff_t, 4>(2, 1, 1, 1);
     auto slice2 = SliceEvaluator(tensor.slice(offsets, extents), DefaultDevice());
     VERIFY_IS_EQUAL(slice2.dimensions().TotalSize(), 2);
-    VERIFY_IS_EQUAL(slice2.data()[0], tensor(1,2,3,4));
-    VERIFY_IS_EQUAL(slice2.data()[1], tensor(2,2,3,4));
+    VERIFY_IS_EQUAL(slice2.data()[0], tensor(1, 2, 3, 4));
+    VERIFY_IS_EQUAL(slice2.data()[1], tensor(2, 2, 3, 4));
   } else {
-    extents = Eigen::DSizes<ptrdiff_t, 4>(1,1,1,2);
+    extents = Eigen::DSizes<ptrdiff_t, 4>(1, 1, 1, 2);
     auto slice2 = SliceEvaluator(tensor.slice(offsets, extents), DefaultDevice());
     VERIFY_IS_EQUAL(slice2.dimensions().TotalSize(), 2);
-    VERIFY_IS_EQUAL(slice2.data()[0], tensor(1,2,3,4));
-    VERIFY_IS_EQUAL(slice2.data()[1], tensor(1,2,3,5));
+    VERIFY_IS_EQUAL(slice2.data()[0], tensor(1, 2, 3, 4));
+    VERIFY_IS_EQUAL(slice2.data()[1], tensor(1, 2, 3, 5));
   }
 
-  extents = Eigen::DSizes<ptrdiff_t, 4>(1,2,1,1);
+  extents = Eigen::DSizes<ptrdiff_t, 4>(1, 2, 1, 1);
   auto slice3 = SliceEvaluator(tensor.slice(offsets, extents), DefaultDevice());
   VERIFY_IS_EQUAL(slice3.dimensions().TotalSize(), 2);
   VERIFY_IS_EQUAL(slice3.data(), static_cast<T*>(0));
 
   if (DataLayout == ColMajor) {
-    offsets = Eigen::DSizes<ptrdiff_t, 4>(0,2,3,4);
-    extents = Eigen::DSizes<ptrdiff_t, 4>(3,2,1,1);
+    offsets = Eigen::DSizes<ptrdiff_t, 4>(0, 2, 3, 4);
+    extents = Eigen::DSizes<ptrdiff_t, 4>(3, 2, 1, 1);
     auto slice4 = SliceEvaluator(tensor.slice(offsets, extents), DefaultDevice());
     VERIFY_IS_EQUAL(slice4.dimensions().TotalSize(), 6);
     for (int i = 0; i < 3; ++i) {
       for (int j = 0; j < 2; ++j) {
-        VERIFY_IS_EQUAL(slice4.data()[i+3*j], tensor(i,2+j,3,4));
+        VERIFY_IS_EQUAL(slice4.data()[i + 3 * j], tensor(i, 2 + j, 3, 4));
       }
     }
   } else {
-    offsets = Eigen::DSizes<ptrdiff_t, 4>(1,2,3,0);
-    extents = Eigen::DSizes<ptrdiff_t, 4>(1,1,2,11);
+    offsets = Eigen::DSizes<ptrdiff_t, 4>(1, 2, 3, 0);
+    extents = Eigen::DSizes<ptrdiff_t, 4>(1, 1, 2, 11);
     auto slice4 = SliceEvaluator(tensor.slice(offsets, extents), DefaultDevice());
     VERIFY_IS_EQUAL(slice4.dimensions().TotalSize(), 22);
     for (int l = 0; l < 11; ++l) {
       for (int k = 0; k < 2; ++k) {
-        VERIFY_IS_EQUAL(slice4.data()[l+11*k], tensor(1,2,3+k,l));
+        VERIFY_IS_EQUAL(slice4.data()[l + 11 * k], tensor(1, 2, 3 + k, l));
       }
     }
   }
 
   if (DataLayout == ColMajor) {
-    offsets = Eigen::DSizes<ptrdiff_t, 4>(0,0,0,4);
-    extents = Eigen::DSizes<ptrdiff_t, 4>(3,5,7,2);
+    offsets = Eigen::DSizes<ptrdiff_t, 4>(0, 0, 0, 4);
+    extents = Eigen::DSizes<ptrdiff_t, 4>(3, 5, 7, 2);
     auto slice5 = SliceEvaluator(tensor.slice(offsets, extents), DefaultDevice());
     VERIFY_IS_EQUAL(slice5.dimensions().TotalSize(), 210);
     for (int i = 0; i < 3; ++i) {
@@ -307,14 +302,14 @@
         for (int k = 0; k < 7; ++k) {
           for (int l = 0; l < 2; ++l) {
             int slice_index = i + 3 * (j + 5 * (k + 7 * l));
-            VERIFY_IS_EQUAL(slice5.data()[slice_index], tensor(i,j,k,l+4));
+            VERIFY_IS_EQUAL(slice5.data()[slice_index], tensor(i, j, k, l + 4));
           }
         }
       }
     }
   } else {
-    offsets = Eigen::DSizes<ptrdiff_t, 4>(1,0,0,0);
-    extents = Eigen::DSizes<ptrdiff_t, 4>(2,5,7,11);
+    offsets = Eigen::DSizes<ptrdiff_t, 4>(1, 0, 0, 0);
+    extents = Eigen::DSizes<ptrdiff_t, 4>(2, 5, 7, 11);
     auto slice5 = SliceEvaluator(tensor.slice(offsets, extents), DefaultDevice());
     VERIFY_IS_EQUAL(slice5.dimensions().TotalSize(), 770);
     for (int l = 0; l < 11; ++l) {
@@ -322,79 +317,76 @@
         for (int j = 0; j < 5; ++j) {
           for (int i = 0; i < 2; ++i) {
             int slice_index = l + 11 * (k + 7 * (j + 5 * i));
-            VERIFY_IS_EQUAL(slice5.data()[slice_index], tensor(i+1,j,k,l));
+            VERIFY_IS_EQUAL(slice5.data()[slice_index], tensor(i + 1, j, k, l));
           }
         }
       }
     }
-
   }
 
-  offsets = Eigen::DSizes<ptrdiff_t, 4>(0,0,0,0);
-  extents = Eigen::DSizes<ptrdiff_t, 4>(3,5,7,11);
+  offsets = Eigen::DSizes<ptrdiff_t, 4>(0, 0, 0, 0);
+  extents = Eigen::DSizes<ptrdiff_t, 4>(3, 5, 7, 11);
   auto slice6 = SliceEvaluator(tensor.slice(offsets, extents), DefaultDevice());
-  VERIFY_IS_EQUAL(slice6.dimensions().TotalSize(), 3*5*7*11);
+  VERIFY_IS_EQUAL(slice6.dimensions().TotalSize(), 3 * 5 * 7 * 11);
   VERIFY_IS_EQUAL(slice6.data(), tensor.data());
 }
 
-
-template<typename T, int DataLayout>
-static void test_strided_slice()
-{
+template <typename T, int DataLayout>
+static void test_strided_slice() {
   typedef Tensor<T, 5, DataLayout> Tensor5f;
   typedef Eigen::DSizes<Eigen::DenseIndex, 5> Index5;
   typedef Tensor<T, 2, DataLayout> Tensor2f;
   typedef Eigen::DSizes<Eigen::DenseIndex, 2> Index2;
-  Tensor<T, 5, DataLayout> tensor(2,3,5,7,11);
-  Tensor<T, 2, DataLayout> tensor2(7,11);
+  Tensor<T, 5, DataLayout> tensor(2, 3, 5, 7, 11);
+  Tensor<T, 2, DataLayout> tensor2(7, 11);
   tensor.setRandom();
   tensor2.setRandom();
 
   if (true) {
-    Tensor2f slice(2,3);
-    Index2 strides(-2,-1);
-    Index2 indicesStart(5,7);
-    Index2 indicesStop(0,4);
+    Tensor2f slice(2, 3);
+    Index2 strides(-2, -1);
+    Index2 indicesStart(5, 7);
+    Index2 indicesStop(0, 4);
     slice = tensor2.stridedSlice(indicesStart, indicesStop, strides);
     for (int j = 0; j < 2; ++j) {
       for (int k = 0; k < 3; ++k) {
-        VERIFY_IS_EQUAL(slice(j,k), tensor2(5-2*j,7-k));
+        VERIFY_IS_EQUAL(slice(j, k), tensor2(5 - 2 * j, 7 - k));
       }
     }
   }
 
-  if(true) {
-    Tensor2f slice(0,1);
-    Index2 strides(1,1);
-    Index2 indicesStart(5,4);
-    Index2 indicesStop(5,5);
+  if (true) {
+    Tensor2f slice(0, 1);
+    Index2 strides(1, 1);
+    Index2 indicesStart(5, 4);
+    Index2 indicesStop(5, 5);
     slice = tensor2.stridedSlice(indicesStart, indicesStop, strides);
   }
 
-  if(true) { // test clamped degenerate interavls
-    Tensor2f slice(7,11);
-    Index2 strides(1,-1);
-    Index2 indicesStart(-3,20); // should become 0,10
-    Index2 indicesStop(20,-11); // should become 11, -1
+  if (true) {  // test clamped degenerate interavls
+    Tensor2f slice(7, 11);
+    Index2 strides(1, -1);
+    Index2 indicesStart(-3, 20);  // should become 0,10
+    Index2 indicesStop(20, -11);  // should become 11, -1
     slice = tensor2.stridedSlice(indicesStart, indicesStop, strides);
     for (int j = 0; j < 7; ++j) {
       for (int k = 0; k < 11; ++k) {
-        VERIFY_IS_EQUAL(slice(j,k), tensor2(j,10-k));
+        VERIFY_IS_EQUAL(slice(j, k), tensor2(j, 10 - k));
       }
     }
   }
 
-  if(true) {
-    Tensor5f slice1(1,1,1,1,1);
+  if (true) {
+    Tensor5f slice1(1, 1, 1, 1, 1);
     Eigen::DSizes<Eigen::DenseIndex, 5> indicesStart(1, 2, 3, 4, 5);
     Eigen::DSizes<Eigen::DenseIndex, 5> indicesStop(2, 3, 4, 5, 6);
     Eigen::DSizes<Eigen::DenseIndex, 5> strides(1, 1, 1, 1, 1);
     slice1 = tensor.stridedSlice(indicesStart, indicesStop, strides);
-    VERIFY_IS_EQUAL(slice1(0,0,0,0,0), tensor(1,2,3,4,5));
+    VERIFY_IS_EQUAL(slice1(0, 0, 0, 0, 0), tensor(1, 2, 3, 4, 5));
   }
 
-  if(true) {
-    Tensor5f slice(1,1,2,2,3);
+  if (true) {
+    Tensor5f slice(1, 1, 2, 2, 3);
     Index5 start(1, 1, 3, 4, 5);
     Index5 stop(2, 2, 5, 6, 8);
     Index5 strides(1, 1, 1, 1, 1);
@@ -402,14 +394,14 @@
     for (int i = 0; i < 2; ++i) {
       for (int j = 0; j < 2; ++j) {
         for (int k = 0; k < 3; ++k) {
-          VERIFY_IS_EQUAL(slice(0,0,i,j,k), tensor(1,1,3+i,4+j,5+k));
+          VERIFY_IS_EQUAL(slice(0, 0, i, j, k), tensor(1, 1, 3 + i, 4 + j, 5 + k));
         }
       }
     }
   }
 
-  if(true) {
-    Tensor5f slice(1,1,2,2,3);
+  if (true) {
+    Tensor5f slice(1, 1, 2, 2, 3);
     Index5 strides3(1, 1, -2, 1, -1);
     Index5 indices3Start(1, 1, 4, 4, 7);
     Index5 indices3Stop(2, 2, 0, 6, 4);
@@ -417,14 +409,14 @@
     for (int i = 0; i < 2; ++i) {
       for (int j = 0; j < 2; ++j) {
         for (int k = 0; k < 3; ++k) {
-          VERIFY_IS_EQUAL(slice(0,0,i,j,k), tensor(1,1,4-2*i,4+j,7-k));
+          VERIFY_IS_EQUAL(slice(0, 0, i, j, k), tensor(1, 1, 4 - 2 * i, 4 + j, 7 - k));
         }
       }
     }
   }
 
-  if(false) { // tests degenerate interval
-    Tensor5f slice(1,1,2,2,3);
+  if (false) {  // tests degenerate interval
+    Tensor5f slice(1, 1, 2, 2, 3);
     Index5 strides3(1, 1, 2, 1, 1);
     Index5 indices3Start(1, 1, 4, 4, 7);
     Index5 indices3Stop(2, 2, 0, 6, 4);
@@ -432,35 +424,34 @@
   }
 }
 
-template<typename T, int DataLayout>
-static void test_strided_slice_write()
-{
+template <typename T, int DataLayout>
+static void test_strided_slice_write() {
   typedef Tensor<T, 2, DataLayout> Tensor2f;
   typedef Eigen::DSizes<Eigen::DenseIndex, 2> Index2;
 
-  Tensor<T, 2, DataLayout> tensor(7,11),tensor2(7,11);
+  Tensor<T, 2, DataLayout> tensor(7, 11), tensor2(7, 11);
   tensor.setRandom();
-  tensor2=tensor;
-  Tensor2f slice(2,3);
+  tensor2 = tensor;
+  Tensor2f slice(2, 3);
 
   slice.setRandom();
 
-  Index2 strides(1,1);
-  Index2 indicesStart(3,4);
-  Index2 indicesStop(5,7);
-  Index2 lengths(2,3);
+  Index2 strides(1, 1);
+  Index2 indicesStart(3, 4);
+  Index2 indicesStop(5, 7);
+  Index2 lengths(2, 3);
 
-  tensor.slice(indicesStart,lengths)=slice;
-  tensor2.stridedSlice(indicesStart,indicesStop,strides)=slice;
+  tensor.slice(indicesStart, lengths) = slice;
+  tensor2.stridedSlice(indicesStart, indicesStop, strides) = slice;
 
-  for(int i=0;i<7;i++) for(int j=0;j<11;j++){
-    VERIFY_IS_EQUAL(tensor(i,j), tensor2(i,j));
-  }
+  for (int i = 0; i < 7; i++)
+    for (int j = 0; j < 11; j++) {
+      VERIFY_IS_EQUAL(tensor(i, j), tensor2(i, j));
+    }
 }
 
-template<typename T, int DataLayout>
-static void test_composition()
-{
+template <typename T, int DataLayout>
+static void test_composition() {
   Eigen::Tensor<T, 2, DataLayout> matrix(7, 11);
   matrix.setRandom();
 
@@ -473,56 +464,55 @@
   VERIFY_IS_EQUAL(tensor.dimension(1), 1);
   VERIFY_IS_EQUAL(tensor.dimension(2), 11);
   for (int i = 0; i < 11; ++i) {
-    VERIFY_IS_EQUAL(tensor(0,0,i), matrix(2,i));
+    VERIFY_IS_EQUAL(tensor(0, 0, i), matrix(2, i));
   }
 }
 
-template<typename T, int DataLayout>
-static void test_empty_slice()
-{
-  Tensor<T, 3, DataLayout> tensor(2,3,5);
+template <typename T, int DataLayout>
+static void test_empty_slice() {
+  Tensor<T, 3, DataLayout> tensor(2, 3, 5);
   tensor.setRandom();
   Tensor<T, 3, DataLayout> copy = tensor;
 
   // empty size in first dimension
-  Eigen::DSizes<ptrdiff_t, 3> indices1(1,2,3);
-  Eigen::DSizes<ptrdiff_t, 3> sizes1(0,1,2);
-  Tensor<T, 3, DataLayout> slice1(0,1,2);
+  Eigen::DSizes<ptrdiff_t, 3> indices1(1, 2, 3);
+  Eigen::DSizes<ptrdiff_t, 3> sizes1(0, 1, 2);
+  Tensor<T, 3, DataLayout> slice1(0, 1, 2);
   slice1.setRandom();
   tensor.slice(indices1, sizes1) = slice1;
 
   // empty size in second dimension
-  Eigen::DSizes<ptrdiff_t, 3> indices2(1,2,3);
-  Eigen::DSizes<ptrdiff_t, 3> sizes2(1,0,2);
-  Tensor<T, 3, DataLayout> slice2(1,0,2);
+  Eigen::DSizes<ptrdiff_t, 3> indices2(1, 2, 3);
+  Eigen::DSizes<ptrdiff_t, 3> sizes2(1, 0, 2);
+  Tensor<T, 3, DataLayout> slice2(1, 0, 2);
   slice2.setRandom();
   tensor.slice(indices2, sizes2) = slice2;
 
   // empty size in third dimension
-  Eigen::DSizes<ptrdiff_t, 3> indices3(1,2,3);
-  Eigen::DSizes<ptrdiff_t, 3> sizes3(1,1,0);
-  Tensor<T, 3, DataLayout> slice3(1,1,0);
+  Eigen::DSizes<ptrdiff_t, 3> indices3(1, 2, 3);
+  Eigen::DSizes<ptrdiff_t, 3> sizes3(1, 1, 0);
+  Tensor<T, 3, DataLayout> slice3(1, 1, 0);
   slice3.setRandom();
   tensor.slice(indices3, sizes3) = slice3;
 
   // empty size in first and second dimension
-  Eigen::DSizes<ptrdiff_t, 3> indices4(1,2,3);
-  Eigen::DSizes<ptrdiff_t, 3> sizes4(0,0,2);
-  Tensor<T, 3, DataLayout> slice4(0,0,2);
+  Eigen::DSizes<ptrdiff_t, 3> indices4(1, 2, 3);
+  Eigen::DSizes<ptrdiff_t, 3> sizes4(0, 0, 2);
+  Tensor<T, 3, DataLayout> slice4(0, 0, 2);
   slice4.setRandom();
   tensor.slice(indices4, sizes4) = slice4;
 
   // empty size in second and third dimension
-  Eigen::DSizes<ptrdiff_t, 3> indices5(1,2,3);
-  Eigen::DSizes<ptrdiff_t, 3> sizes5(1,0,0);
-  Tensor<T, 3, DataLayout> slice5(1,0,0);
+  Eigen::DSizes<ptrdiff_t, 3> indices5(1, 2, 3);
+  Eigen::DSizes<ptrdiff_t, 3> sizes5(1, 0, 0);
+  Tensor<T, 3, DataLayout> slice5(1, 0, 0);
   slice5.setRandom();
   tensor.slice(indices5, sizes5) = slice5;
 
   // empty size in all dimensions
-  Eigen::DSizes<ptrdiff_t, 3> indices6(1,2,3);
-  Eigen::DSizes<ptrdiff_t, 3> sizes6(0,0,0);
-  Tensor<T, 3, DataLayout> slice6(0,0,0);
+  Eigen::DSizes<ptrdiff_t, 3> indices6(1, 2, 3);
+  Eigen::DSizes<ptrdiff_t, 3> sizes6(0, 0, 0);
+  Tensor<T, 3, DataLayout> slice6(0, 0, 0);
   slice6.setRandom();
   tensor.slice(indices6, sizes6) = slice6;
 
@@ -531,23 +521,21 @@
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 5; ++k) {
-          VERIFY_IS_EQUAL(tensor(i,j,k), copy(i,j,k));
+        VERIFY_IS_EQUAL(tensor(i, j, k), copy(i, j, k));
       }
     }
   }
 }
 
-#define CALL_SUBTEST_PART(PART) \
-  CALL_SUBTEST_##PART
+#define CALL_SUBTEST_PART(PART) CALL_SUBTEST_##PART
 
 #define CALL_SUBTESTS_TYPES_LAYOUTS(PART, NAME)       \
   CALL_SUBTEST_PART(PART)((NAME<float, ColMajor>())); \
   CALL_SUBTEST_PART(PART)((NAME<float, RowMajor>())); \
-  CALL_SUBTEST_PART(PART)((NAME<bool, ColMajor>())); \
+  CALL_SUBTEST_PART(PART)((NAME<bool, ColMajor>()));  \
   CALL_SUBTEST_PART(PART)((NAME<bool, RowMajor>()))
 
-EIGEN_DECLARE_TEST(cxx11_tensor_morphing)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_morphing) {
   CALL_SUBTEST_1(test_simple_reshape<void>());
   CALL_SUBTEST_1(test_static_reshape<void>());
   CALL_SUBTEST_1(test_reshape_as_lvalue<void>());
diff --git a/unsupported/test/cxx11_tensor_morphing_sycl.cpp b/unsupported/test/cxx11_tensor_morphing_sycl.cpp
index a1545d4..7242b8e 100644
--- a/unsupported/test/cxx11_tensor_morphing_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_morphing_sycl.cpp
@@ -12,14 +12,12 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-
 #define EIGEN_TEST_NO_LONGDOUBLE
 #define EIGEN_TEST_NO_COMPLEX
 
 #define EIGEN_DEFAULT_DENSE_INDEX_TYPE int64_t
 #define EIGEN_USE_SYCL
 
-
 #include "main.h"
 #include <unsupported/Eigen/CXX11/Tensor>
 
@@ -29,12 +27,11 @@
 using Eigen::TensorMap;
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_simple_reshape(const Eigen::SyclDevice& sycl_device)
-{
-  typename Tensor<DataType, 5 ,DataLayout, IndexType>::Dimensions dim1(2,3,1,7,1);
-  typename Tensor<DataType, 3 ,DataLayout, IndexType>::Dimensions dim2(2,3,7);
-  typename Tensor<DataType, 2 ,DataLayout, IndexType>::Dimensions dim3(6,7);
-  typename Tensor<DataType, 2 ,DataLayout, IndexType>::Dimensions dim4(2,21);
+static void test_simple_reshape(const Eigen::SyclDevice& sycl_device) {
+  typename Tensor<DataType, 5, DataLayout, IndexType>::Dimensions dim1(2, 3, 1, 7, 1);
+  typename Tensor<DataType, 3, DataLayout, IndexType>::Dimensions dim2(2, 3, 7);
+  typename Tensor<DataType, 2, DataLayout, IndexType>::Dimensions dim3(6, 7);
+  typename Tensor<DataType, 2, DataLayout, IndexType>::Dimensions dim4(2, 21);
 
   Tensor<DataType, 5, DataLayout, IndexType> tensor1(dim1);
   Tensor<DataType, 3, DataLayout, IndexType> tensor2(dim2);
@@ -43,38 +40,37 @@
 
   tensor1.setRandom();
 
-  DataType* gpu_data1  = static_cast<DataType*>(sycl_device.allocate(tensor1.size()*sizeof(DataType)));
-  DataType* gpu_data2  = static_cast<DataType*>(sycl_device.allocate(tensor2.size()*sizeof(DataType)));
-  DataType* gpu_data3  = static_cast<DataType*>(sycl_device.allocate(tensor3.size()*sizeof(DataType)));
-  DataType* gpu_data4  = static_cast<DataType*>(sycl_device.allocate(tensor4.size()*sizeof(DataType)));
+  DataType* gpu_data1 = static_cast<DataType*>(sycl_device.allocate(tensor1.size() * sizeof(DataType)));
+  DataType* gpu_data2 = static_cast<DataType*>(sycl_device.allocate(tensor2.size() * sizeof(DataType)));
+  DataType* gpu_data3 = static_cast<DataType*>(sycl_device.allocate(tensor3.size() * sizeof(DataType)));
+  DataType* gpu_data4 = static_cast<DataType*>(sycl_device.allocate(tensor4.size() * sizeof(DataType)));
 
-  TensorMap<Tensor<DataType, 5,DataLayout, IndexType>> gpu1(gpu_data1, dim1);
-  TensorMap<Tensor<DataType, 3,DataLayout, IndexType>> gpu2(gpu_data2, dim2);
-  TensorMap<Tensor<DataType, 2,DataLayout, IndexType>> gpu3(gpu_data3, dim3);
-  TensorMap<Tensor<DataType, 2,DataLayout, IndexType>> gpu4(gpu_data4, dim4);
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu1(gpu_data1, dim1);
+  TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> gpu2(gpu_data2, dim2);
+  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> gpu3(gpu_data3, dim3);
+  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> gpu4(gpu_data4, dim4);
 
-  sycl_device.memcpyHostToDevice(gpu_data1, tensor1.data(),(tensor1.size())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_data1, tensor1.data(), (tensor1.size()) * sizeof(DataType));
 
-  gpu2.device(sycl_device)=gpu1.reshape(dim2);
-  sycl_device.memcpyDeviceToHost(tensor2.data(), gpu_data2,(tensor1.size())*sizeof(DataType));
+  gpu2.device(sycl_device) = gpu1.reshape(dim2);
+  sycl_device.memcpyDeviceToHost(tensor2.data(), gpu_data2, (tensor1.size()) * sizeof(DataType));
 
-  gpu3.device(sycl_device)=gpu1.reshape(dim3);
-  sycl_device.memcpyDeviceToHost(tensor3.data(), gpu_data3,(tensor3.size())*sizeof(DataType));
+  gpu3.device(sycl_device) = gpu1.reshape(dim3);
+  sycl_device.memcpyDeviceToHost(tensor3.data(), gpu_data3, (tensor3.size()) * sizeof(DataType));
 
-  gpu4.device(sycl_device)=gpu1.reshape(dim2).reshape(dim4);
-  sycl_device.memcpyDeviceToHost(tensor4.data(), gpu_data4,(tensor4.size())*sizeof(DataType));
-  for (IndexType i = 0; i < 2; ++i){
-    for (IndexType j = 0; j < 3; ++j){
-      for (IndexType k = 0; k < 7; ++k){
-        VERIFY_IS_EQUAL(tensor1(i,j,0,k,0), tensor2(i,j,k));      ///ColMajor
+  gpu4.device(sycl_device) = gpu1.reshape(dim2).reshape(dim4);
+  sycl_device.memcpyDeviceToHost(tensor4.data(), gpu_data4, (tensor4.size()) * sizeof(DataType));
+  for (IndexType i = 0; i < 2; ++i) {
+    for (IndexType j = 0; j < 3; ++j) {
+      for (IndexType k = 0; k < 7; ++k) {
+        VERIFY_IS_EQUAL(tensor1(i, j, 0, k, 0), tensor2(i, j, k));  /// ColMajor
         if (static_cast<int>(DataLayout) == static_cast<int>(ColMajor)) {
-          VERIFY_IS_EQUAL(tensor1(i,j,0,k,0), tensor3(i+2*j,k));    ///ColMajor
-          VERIFY_IS_EQUAL(tensor1(i,j,0,k,0), tensor4(i,j+3*k));    ///ColMajor
-        }
-        else{
-          //VERIFY_IS_EQUAL(tensor1(i,j,0,k,0), tensor2(i,j,k));      /// RowMajor
-          VERIFY_IS_EQUAL(tensor1(i,j,0,k,0), tensor4(i,j*7 +k));   /// RowMajor
-          VERIFY_IS_EQUAL(tensor1(i,j,0,k,0), tensor3(i*3 +j,k));   /// RowMajor
+          VERIFY_IS_EQUAL(tensor1(i, j, 0, k, 0), tensor3(i + 2 * j, k));  /// ColMajor
+          VERIFY_IS_EQUAL(tensor1(i, j, 0, k, 0), tensor4(i, j + 3 * k));  /// ColMajor
+        } else {
+          // VERIFY_IS_EQUAL(tensor1(i,j,0,k,0), tensor2(i,j,k));      /// RowMajor
+          VERIFY_IS_EQUAL(tensor1(i, j, 0, k, 0), tensor4(i, j * 7 + k));  /// RowMajor
+          VERIFY_IS_EQUAL(tensor1(i, j, 0, k, 0), tensor3(i * 3 + j, k));  /// RowMajor
         }
       }
     }
@@ -85,45 +81,41 @@
   sycl_device.deallocate(gpu_data4);
 }
 
-
-template<typename DataType, int DataLayout, typename IndexType>
-static void test_reshape_as_lvalue(const Eigen::SyclDevice& sycl_device)
-{
-  typename Tensor<DataType, 3, DataLayout, IndexType>::Dimensions dim1(2,3,7);
-  typename Tensor<DataType, 2, DataLayout, IndexType>::Dimensions dim2(6,7);
-  typename Tensor<DataType, 5, DataLayout, IndexType>::Dimensions dim3(2,3,1,7,1);
+template <typename DataType, int DataLayout, typename IndexType>
+static void test_reshape_as_lvalue(const Eigen::SyclDevice& sycl_device) {
+  typename Tensor<DataType, 3, DataLayout, IndexType>::Dimensions dim1(2, 3, 7);
+  typename Tensor<DataType, 2, DataLayout, IndexType>::Dimensions dim2(6, 7);
+  typename Tensor<DataType, 5, DataLayout, IndexType>::Dimensions dim3(2, 3, 1, 7, 1);
   Tensor<DataType, 3, DataLayout, IndexType> tensor(dim1);
   Tensor<DataType, 2, DataLayout, IndexType> tensor2d(dim2);
   Tensor<DataType, 5, DataLayout, IndexType> tensor5d(dim3);
 
   tensor.setRandom();
 
-  DataType* gpu_data1  = static_cast<DataType*>(sycl_device.allocate(tensor.size()*sizeof(DataType)));
-  DataType* gpu_data2  = static_cast<DataType*>(sycl_device.allocate(tensor2d.size()*sizeof(DataType)));
-  DataType* gpu_data3  = static_cast<DataType*>(sycl_device.allocate(tensor5d.size()*sizeof(DataType)));
+  DataType* gpu_data1 = static_cast<DataType*>(sycl_device.allocate(tensor.size() * sizeof(DataType)));
+  DataType* gpu_data2 = static_cast<DataType*>(sycl_device.allocate(tensor2d.size() * sizeof(DataType)));
+  DataType* gpu_data3 = static_cast<DataType*>(sycl_device.allocate(tensor5d.size() * sizeof(DataType)));
 
-  TensorMap< Tensor<DataType, 3, DataLayout, IndexType> > gpu1(gpu_data1, dim1);
-  TensorMap< Tensor<DataType, 2, DataLayout, IndexType> > gpu2(gpu_data2, dim2);
-  TensorMap< Tensor<DataType, 5, DataLayout, IndexType> > gpu3(gpu_data3, dim3);
+  TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> gpu1(gpu_data1, dim1);
+  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> gpu2(gpu_data2, dim2);
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu3(gpu_data3, dim3);
 
-  sycl_device.memcpyHostToDevice(gpu_data1, tensor.data(),(tensor.size())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_data1, tensor.data(), (tensor.size()) * sizeof(DataType));
 
-  gpu2.reshape(dim1).device(sycl_device)=gpu1;
-  sycl_device.memcpyDeviceToHost(tensor2d.data(), gpu_data2,(tensor2d.size())*sizeof(DataType));
+  gpu2.reshape(dim1).device(sycl_device) = gpu1;
+  sycl_device.memcpyDeviceToHost(tensor2d.data(), gpu_data2, (tensor2d.size()) * sizeof(DataType));
 
-  gpu3.reshape(dim1).device(sycl_device)=gpu1;
-  sycl_device.memcpyDeviceToHost(tensor5d.data(), gpu_data3,(tensor5d.size())*sizeof(DataType));
+  gpu3.reshape(dim1).device(sycl_device) = gpu1;
+  sycl_device.memcpyDeviceToHost(tensor5d.data(), gpu_data3, (tensor5d.size()) * sizeof(DataType));
 
-
-  for (IndexType i = 0; i < 2; ++i){
-    for (IndexType j = 0; j < 3; ++j){
-      for (IndexType k = 0; k < 7; ++k){
-        VERIFY_IS_EQUAL(tensor5d(i,j,0,k,0), tensor(i,j,k));
+  for (IndexType i = 0; i < 2; ++i) {
+    for (IndexType j = 0; j < 3; ++j) {
+      for (IndexType k = 0; k < 7; ++k) {
+        VERIFY_IS_EQUAL(tensor5d(i, j, 0, k, 0), tensor(i, j, k));
         if (static_cast<int>(DataLayout) == static_cast<int>(ColMajor)) {
-          VERIFY_IS_EQUAL(tensor2d(i+2*j,k), tensor(i,j,k));    ///ColMajor
-        }
-        else{
-          VERIFY_IS_EQUAL(tensor2d(i*3 +j,k),tensor(i,j,k));   /// RowMajor
+          VERIFY_IS_EQUAL(tensor2d(i + 2 * j, k), tensor(i, j, k));  /// ColMajor
+        } else {
+          VERIFY_IS_EQUAL(tensor2d(i * 3 + j, k), tensor(i, j, k));  /// RowMajor
         }
       }
     }
@@ -133,45 +125,42 @@
   sycl_device.deallocate(gpu_data3);
 }
 
-
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_simple_slice(const Eigen::SyclDevice &sycl_device)
-{
+static void test_simple_slice(const Eigen::SyclDevice& sycl_device) {
   IndexType sizeDim1 = 2;
   IndexType sizeDim2 = 3;
   IndexType sizeDim3 = 5;
   IndexType sizeDim4 = 7;
   IndexType sizeDim5 = 11;
   array<IndexType, 5> tensorRange = {{sizeDim1, sizeDim2, sizeDim3, sizeDim4, sizeDim5}};
-  Tensor<DataType, 5,DataLayout, IndexType> tensor(tensorRange);
+  Tensor<DataType, 5, DataLayout, IndexType> tensor(tensorRange);
   tensor.setRandom();
-  array<IndexType, 5> slice1_range ={{1, 1, 1, 1, 1}};
-  Tensor<DataType, 5,DataLayout, IndexType> slice1(slice1_range);
+  array<IndexType, 5> slice1_range = {{1, 1, 1, 1, 1}};
+  Tensor<DataType, 5, DataLayout, IndexType> slice1(slice1_range);
 
-  DataType* gpu_data1  = static_cast<DataType*>(sycl_device.allocate(tensor.size()*sizeof(DataType)));
-  DataType* gpu_data2  = static_cast<DataType*>(sycl_device.allocate(slice1.size()*sizeof(DataType)));
-  TensorMap<Tensor<DataType, 5,DataLayout, IndexType>> gpu1(gpu_data1, tensorRange);
-  TensorMap<Tensor<DataType, 5,DataLayout, IndexType>> gpu2(gpu_data2, slice1_range);
-  Eigen::DSizes<IndexType, 5> indices(1,2,3,4,5);
-  Eigen::DSizes<IndexType, 5> sizes(1,1,1,1,1);
-  sycl_device.memcpyHostToDevice(gpu_data1, tensor.data(),(tensor.size())*sizeof(DataType));
-  gpu2.device(sycl_device)=gpu1.slice(indices, sizes);
-  sycl_device.memcpyDeviceToHost(slice1.data(), gpu_data2,(slice1.size())*sizeof(DataType));
-  VERIFY_IS_EQUAL(slice1(0,0,0,0,0), tensor(1,2,3,4,5));
+  DataType* gpu_data1 = static_cast<DataType*>(sycl_device.allocate(tensor.size() * sizeof(DataType)));
+  DataType* gpu_data2 = static_cast<DataType*>(sycl_device.allocate(slice1.size() * sizeof(DataType)));
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu1(gpu_data1, tensorRange);
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu2(gpu_data2, slice1_range);
+  Eigen::DSizes<IndexType, 5> indices(1, 2, 3, 4, 5);
+  Eigen::DSizes<IndexType, 5> sizes(1, 1, 1, 1, 1);
+  sycl_device.memcpyHostToDevice(gpu_data1, tensor.data(), (tensor.size()) * sizeof(DataType));
+  gpu2.device(sycl_device) = gpu1.slice(indices, sizes);
+  sycl_device.memcpyDeviceToHost(slice1.data(), gpu_data2, (slice1.size()) * sizeof(DataType));
+  VERIFY_IS_EQUAL(slice1(0, 0, 0, 0, 0), tensor(1, 2, 3, 4, 5));
 
-
-  array<IndexType, 5> slice2_range ={{1,1,2,2,3}};
-  Tensor<DataType, 5,DataLayout, IndexType> slice2(slice2_range);
-  DataType* gpu_data3  = static_cast<DataType*>(sycl_device.allocate(slice2.size()*sizeof(DataType)));
-  TensorMap<Tensor<DataType, 5,DataLayout, IndexType>> gpu3(gpu_data3, slice2_range);
-  Eigen::DSizes<IndexType, 5> indices2(1,1,3,4,5);
-  Eigen::DSizes<IndexType, 5> sizes2(1,1,2,2,3);
-  gpu3.device(sycl_device)=gpu1.slice(indices2, sizes2);
-  sycl_device.memcpyDeviceToHost(slice2.data(), gpu_data3,(slice2.size())*sizeof(DataType));
+  array<IndexType, 5> slice2_range = {{1, 1, 2, 2, 3}};
+  Tensor<DataType, 5, DataLayout, IndexType> slice2(slice2_range);
+  DataType* gpu_data3 = static_cast<DataType*>(sycl_device.allocate(slice2.size() * sizeof(DataType)));
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu3(gpu_data3, slice2_range);
+  Eigen::DSizes<IndexType, 5> indices2(1, 1, 3, 4, 5);
+  Eigen::DSizes<IndexType, 5> sizes2(1, 1, 2, 2, 3);
+  gpu3.device(sycl_device) = gpu1.slice(indices2, sizes2);
+  sycl_device.memcpyDeviceToHost(slice2.data(), gpu_data3, (slice2.size()) * sizeof(DataType));
   for (IndexType i = 0; i < 2; ++i) {
     for (IndexType j = 0; j < 2; ++j) {
       for (IndexType k = 0; k < 3; ++k) {
-        VERIFY_IS_EQUAL(slice2(0,0,i,j,k), tensor(1,1,3+i,4+j,5+k));
+        VERIFY_IS_EQUAL(slice2(0, 0, i, j, k), tensor(1, 1, 3 + i, 4 + j, 5 + k));
       }
     }
   }
@@ -180,74 +169,72 @@
   sycl_device.deallocate(gpu_data3);
 }
 
-
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_strided_slice_as_rhs_sycl(const Eigen::SyclDevice &sycl_device)
-{
+static void test_strided_slice_as_rhs_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType sizeDim1 = 2;
   IndexType sizeDim2 = 3;
   IndexType sizeDim3 = 5;
   IndexType sizeDim4 = 7;
   IndexType sizeDim5 = 11;
   typedef Eigen::DSizes<IndexType, 5> Index5;
-  Index5 strides(1L,1L,1L,1L,1L);
-  Index5 indicesStart(1L,2L,3L,4L,5L);
-  Index5 indicesStop(2L,3L,4L,5L,6L);
-  Index5 lengths(1L,1L,1L,1L,1L);
+  Index5 strides(1L, 1L, 1L, 1L, 1L);
+  Index5 indicesStart(1L, 2L, 3L, 4L, 5L);
+  Index5 indicesStop(2L, 3L, 4L, 5L, 6L);
+  Index5 lengths(1L, 1L, 1L, 1L, 1L);
 
   array<IndexType, 5> tensorRange = {{sizeDim1, sizeDim2, sizeDim3, sizeDim4, sizeDim5}};
   Tensor<DataType, 5, DataLayout, IndexType> tensor(tensorRange);
   tensor.setRandom();
 
-  array<IndexType, 5> slice1_range ={{1, 1, 1, 1, 1}};
-  Tensor<DataType, 5,DataLayout, IndexType> slice1(slice1_range);
+  array<IndexType, 5> slice1_range = {{1, 1, 1, 1, 1}};
+  Tensor<DataType, 5, DataLayout, IndexType> slice1(slice1_range);
   Tensor<DataType, 5, DataLayout, IndexType> slice_stride1(slice1_range);
 
-  DataType* gpu_data1  = static_cast<DataType*>(sycl_device.allocate(tensor.size()*sizeof(DataType)));
-  DataType* gpu_data2  = static_cast<DataType*>(sycl_device.allocate(slice1.size()*sizeof(DataType)));
-  DataType* gpu_data_stride2  = static_cast<DataType*>(sycl_device.allocate(slice_stride1.size()*sizeof(DataType)));
+  DataType* gpu_data1 = static_cast<DataType*>(sycl_device.allocate(tensor.size() * sizeof(DataType)));
+  DataType* gpu_data2 = static_cast<DataType*>(sycl_device.allocate(slice1.size() * sizeof(DataType)));
+  DataType* gpu_data_stride2 = static_cast<DataType*>(sycl_device.allocate(slice_stride1.size() * sizeof(DataType)));
 
-  TensorMap<Tensor<DataType, 5,DataLayout, IndexType>> gpu1(gpu_data1, tensorRange);
-  TensorMap<Tensor<DataType, 5,DataLayout, IndexType>> gpu2(gpu_data2, slice1_range);
-  TensorMap<Tensor<DataType, 5,DataLayout, IndexType>> gpu_stride2(gpu_data_stride2, slice1_range);
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu1(gpu_data1, tensorRange);
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu2(gpu_data2, slice1_range);
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu_stride2(gpu_data_stride2, slice1_range);
 
-  Eigen::DSizes<IndexType, 5> indices(1,2,3,4,5);
-  Eigen::DSizes<IndexType, 5> sizes(1,1,1,1,1);
-  sycl_device.memcpyHostToDevice(gpu_data1, tensor.data(),(tensor.size())*sizeof(DataType));
-  gpu2.device(sycl_device)=gpu1.slice(indices, sizes);
-  sycl_device.memcpyDeviceToHost(slice1.data(), gpu_data2,(slice1.size())*sizeof(DataType));
+  Eigen::DSizes<IndexType, 5> indices(1, 2, 3, 4, 5);
+  Eigen::DSizes<IndexType, 5> sizes(1, 1, 1, 1, 1);
+  sycl_device.memcpyHostToDevice(gpu_data1, tensor.data(), (tensor.size()) * sizeof(DataType));
+  gpu2.device(sycl_device) = gpu1.slice(indices, sizes);
+  sycl_device.memcpyDeviceToHost(slice1.data(), gpu_data2, (slice1.size()) * sizeof(DataType));
 
-  gpu_stride2.device(sycl_device)=gpu1.stridedSlice(indicesStart,indicesStop,strides);
-  sycl_device.memcpyDeviceToHost(slice_stride1.data(), gpu_data_stride2,(slice_stride1.size())*sizeof(DataType));
+  gpu_stride2.device(sycl_device) = gpu1.stridedSlice(indicesStart, indicesStop, strides);
+  sycl_device.memcpyDeviceToHost(slice_stride1.data(), gpu_data_stride2, (slice_stride1.size()) * sizeof(DataType));
 
-  VERIFY_IS_EQUAL(slice1(0,0,0,0,0), tensor(1,2,3,4,5));
-  VERIFY_IS_EQUAL(slice_stride1(0,0,0,0,0), tensor(1,2,3,4,5));
+  VERIFY_IS_EQUAL(slice1(0, 0, 0, 0, 0), tensor(1, 2, 3, 4, 5));
+  VERIFY_IS_EQUAL(slice_stride1(0, 0, 0, 0, 0), tensor(1, 2, 3, 4, 5));
 
-  array<IndexType, 5> slice2_range ={{1,1,2,2,3}};
-  Tensor<DataType, 5,DataLayout, IndexType> slice2(slice2_range);
+  array<IndexType, 5> slice2_range = {{1, 1, 2, 2, 3}};
+  Tensor<DataType, 5, DataLayout, IndexType> slice2(slice2_range);
   Tensor<DataType, 5, DataLayout, IndexType> strideSlice2(slice2_range);
 
-  DataType* gpu_data3  = static_cast<DataType*>(sycl_device.allocate(slice2.size()*sizeof(DataType)));
-  DataType* gpu_data_stride3  = static_cast<DataType*>(sycl_device.allocate(strideSlice2.size()*sizeof(DataType)));
-  TensorMap<Tensor<DataType, 5,DataLayout, IndexType>> gpu3(gpu_data3, slice2_range);
-  TensorMap<Tensor<DataType, 5,DataLayout, IndexType>> gpu_stride3(gpu_data_stride3, slice2_range);
-  Eigen::DSizes<IndexType, 5> indices2(1,1,3,4,5);
-  Eigen::DSizes<IndexType, 5> sizes2(1,1,2,2,3);
-  Index5 strides2(1L,1L,1L,1L,1L);
-  Index5 indicesStart2(1L,1L,3L,4L,5L);
-  Index5 indicesStop2(2L,2L,5L,6L,8L);
+  DataType* gpu_data3 = static_cast<DataType*>(sycl_device.allocate(slice2.size() * sizeof(DataType)));
+  DataType* gpu_data_stride3 = static_cast<DataType*>(sycl_device.allocate(strideSlice2.size() * sizeof(DataType)));
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu3(gpu_data3, slice2_range);
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu_stride3(gpu_data_stride3, slice2_range);
+  Eigen::DSizes<IndexType, 5> indices2(1, 1, 3, 4, 5);
+  Eigen::DSizes<IndexType, 5> sizes2(1, 1, 2, 2, 3);
+  Index5 strides2(1L, 1L, 1L, 1L, 1L);
+  Index5 indicesStart2(1L, 1L, 3L, 4L, 5L);
+  Index5 indicesStop2(2L, 2L, 5L, 6L, 8L);
 
-  gpu3.device(sycl_device)=gpu1.slice(indices2, sizes2);
-  sycl_device.memcpyDeviceToHost(slice2.data(), gpu_data3,(slice2.size())*sizeof(DataType));
+  gpu3.device(sycl_device) = gpu1.slice(indices2, sizes2);
+  sycl_device.memcpyDeviceToHost(slice2.data(), gpu_data3, (slice2.size()) * sizeof(DataType));
 
-  gpu_stride3.device(sycl_device)=gpu1.stridedSlice(indicesStart2,indicesStop2,strides2);
-  sycl_device.memcpyDeviceToHost(strideSlice2.data(), gpu_data_stride3,(strideSlice2.size())*sizeof(DataType));
+  gpu_stride3.device(sycl_device) = gpu1.stridedSlice(indicesStart2, indicesStop2, strides2);
+  sycl_device.memcpyDeviceToHost(strideSlice2.data(), gpu_data_stride3, (strideSlice2.size()) * sizeof(DataType));
 
   for (IndexType i = 0; i < 2; ++i) {
     for (IndexType j = 0; j < 2; ++j) {
       for (IndexType k = 0; k < 3; ++k) {
-        VERIFY_IS_EQUAL(slice2(0,0,i,j,k), tensor(1,1,3+i,4+j,5+k));
-        VERIFY_IS_EQUAL(strideSlice2(0,0,i,j,k), tensor(1,1,3+i,4+j,5+k));
+        VERIFY_IS_EQUAL(slice2(0, 0, i, j, k), tensor(1, 1, 3 + i, 4 + j, 5 + k));
+        VERIFY_IS_EQUAL(strideSlice2(0, 0, i, j, k), tensor(1, 1, 3 + i, 4 + j, 5 + k));
       }
     }
   }
@@ -256,49 +243,46 @@
   sycl_device.deallocate(gpu_data3);
 }
 
-template<typename DataType, int DataLayout, typename IndexType>
-static void test_strided_slice_write_sycl(const Eigen::SyclDevice& sycl_device)
-{
+template <typename DataType, int DataLayout, typename IndexType>
+static void test_strided_slice_write_sycl(const Eigen::SyclDevice& sycl_device) {
   typedef Tensor<DataType, 2, DataLayout, IndexType> Tensor2f;
   typedef Eigen::DSizes<IndexType, 2> Index2;
   IndexType sizeDim1 = 7L;
   IndexType sizeDim2 = 11L;
   array<IndexType, 2> tensorRange = {{sizeDim1, sizeDim2}};
-  Tensor<DataType, 2, DataLayout, IndexType> tensor(tensorRange),tensor2(tensorRange);
+  Tensor<DataType, 2, DataLayout, IndexType> tensor(tensorRange), tensor2(tensorRange);
   IndexType sliceDim1 = 2;
   IndexType sliceDim2 = 3;
   array<IndexType, 2> sliceRange = {{sliceDim1, sliceDim2}};
   Tensor2f slice(sliceRange);
-  Index2 strides(1L,1L);
-  Index2 indicesStart(3L,4L);
-  Index2 indicesStop(5L,7L);
-  Index2 lengths(2L,3L);
+  Index2 strides(1L, 1L);
+  Index2 indicesStart(3L, 4L);
+  Index2 indicesStop(5L, 7L);
+  Index2 lengths(2L, 3L);
 
-  DataType* gpu_data1  = static_cast<DataType*>(sycl_device.allocate(tensor.size()*sizeof(DataType)));
-  DataType* gpu_data2  = static_cast<DataType*>(sycl_device.allocate(tensor2.size()*sizeof(DataType)));
-  DataType* gpu_data3  = static_cast<DataType*>(sycl_device.allocate(slice.size()*sizeof(DataType)));
-  TensorMap<Tensor<DataType, 2,DataLayout,IndexType>> gpu1(gpu_data1, tensorRange);
-  TensorMap<Tensor<DataType, 2,DataLayout,IndexType>> gpu2(gpu_data2, tensorRange);
-  TensorMap<Tensor<DataType, 2,DataLayout,IndexType>> gpu3(gpu_data3, sliceRange);
-
+  DataType* gpu_data1 = static_cast<DataType*>(sycl_device.allocate(tensor.size() * sizeof(DataType)));
+  DataType* gpu_data2 = static_cast<DataType*>(sycl_device.allocate(tensor2.size() * sizeof(DataType)));
+  DataType* gpu_data3 = static_cast<DataType*>(sycl_device.allocate(slice.size() * sizeof(DataType)));
+  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> gpu1(gpu_data1, tensorRange);
+  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> gpu2(gpu_data2, tensorRange);
+  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> gpu3(gpu_data3, sliceRange);
 
   tensor.setRandom();
-  sycl_device.memcpyHostToDevice(gpu_data1, tensor.data(),(tensor.size())*sizeof(DataType));
-  gpu2.device(sycl_device)=gpu1;
+  sycl_device.memcpyHostToDevice(gpu_data1, tensor.data(), (tensor.size()) * sizeof(DataType));
+  gpu2.device(sycl_device) = gpu1;
 
   slice.setRandom();
-  sycl_device.memcpyHostToDevice(gpu_data3, slice.data(),(slice.size())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_data3, slice.data(), (slice.size()) * sizeof(DataType));
 
+  gpu1.slice(indicesStart, lengths).device(sycl_device) = gpu3;
+  gpu2.stridedSlice(indicesStart, indicesStop, strides).device(sycl_device) = gpu3;
+  sycl_device.memcpyDeviceToHost(tensor.data(), gpu_data1, (tensor.size()) * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(tensor2.data(), gpu_data2, (tensor2.size()) * sizeof(DataType));
 
-  gpu1.slice(indicesStart,lengths).device(sycl_device)=gpu3;
-  gpu2.stridedSlice(indicesStart,indicesStop,strides).device(sycl_device)=gpu3;
-  sycl_device.memcpyDeviceToHost(tensor.data(), gpu_data1,(tensor.size())*sizeof(DataType));
-  sycl_device.memcpyDeviceToHost(tensor2.data(), gpu_data2,(tensor2.size())*sizeof(DataType));
-
-  for(IndexType i=0;i<sizeDim1;i++)
-    for(IndexType j=0;j<sizeDim2;j++){
-    VERIFY_IS_EQUAL(tensor(i,j), tensor2(i,j));
-  }
+  for (IndexType i = 0; i < sizeDim1; i++)
+    for (IndexType j = 0; j < sizeDim2; j++) {
+      VERIFY_IS_EQUAL(tensor(i, j), tensor2(i, j));
+    }
   sycl_device.deallocate(gpu_data1);
   sycl_device.deallocate(gpu_data2);
   sycl_device.deallocate(gpu_data3);
@@ -363,7 +347,8 @@
   return has_err;
 }
 
-template<typename DataType, typename dev_Selector> void sycl_morphing_test_per_device(dev_Selector s){
+template <typename DataType, typename dev_Selector>
+void sycl_morphing_test_per_device(dev_Selector s) {
   QueueInterface queueInterface(s);
   auto sycl_device = Eigen::SyclDevice(&queueInterface);
   test_simple_slice<DataType, RowMajor, int64_t>(sycl_device);
@@ -376,11 +361,10 @@
   test_strided_slice_write_sycl<DataType, RowMajor, int64_t>(sycl_device);
   test_strided_slice_as_rhs_sycl<DataType, ColMajor, int64_t>(sycl_device);
   test_strided_slice_as_rhs_sycl<DataType, RowMajor, int64_t>(sycl_device);
-  run_eigen<float, RowMajor, long, int>(sycl_device); 
+  run_eigen<float, RowMajor, long, int>(sycl_device);
 }
-EIGEN_DECLARE_TEST(cxx11_tensor_morphing_sycl)
-{
-  for (const auto& device :Eigen::get_sycl_supported_devices()) {
+EIGEN_DECLARE_TEST(cxx11_tensor_morphing_sycl) {
+  for (const auto& device : Eigen::get_sycl_supported_devices()) {
     CALL_SUBTEST(sycl_morphing_test_per_device<half>(device));
     CALL_SUBTEST(sycl_morphing_test_per_device<float>(device));
   }
diff --git a/unsupported/test/cxx11_tensor_move.cpp b/unsupported/test/cxx11_tensor_move.cpp
index a298231..a21ebb1 100644
--- a/unsupported/test/cxx11_tensor_move.cpp
+++ b/unsupported/test/cxx11_tensor_move.cpp
@@ -12,48 +12,44 @@
 #include <Eigen/CXX11/Tensor>
 #include <utility>
 
-using Eigen::Tensor;
 using Eigen::RowMajor;
+using Eigen::Tensor;
 
-static void calc_indices(int i, int& x, int& y, int& z)
-{
+static void calc_indices(int i, int& x, int& y, int& z) {
   x = i / 4;
   y = (i % 4) / 2;
   z = i % 2;
 }
 
-static void test_move()
-{
+static void test_move() {
   int x;
   int y;
   int z;
 
-  Tensor<int,3> tensor1(2, 2, 2);
-  Tensor<int,3,RowMajor> tensor2(2, 2, 2);
+  Tensor<int, 3> tensor1(2, 2, 2);
+  Tensor<int, 3, RowMajor> tensor2(2, 2, 2);
 
-  for (int i = 0; i < 8; i++)
-  {
+  for (int i = 0; i < 8; i++) {
     calc_indices(i, x, y, z);
-    tensor1(x,y,z) = i;
-    tensor2(x,y,z) = 2 * i;
+    tensor1(x, y, z) = i;
+    tensor2(x, y, z) = 2 * i;
   }
 
   // Invokes the move constructor.
-  Tensor<int,3> moved_tensor1 = std::move(tensor1);
-  Tensor<int,3,RowMajor> moved_tensor2 = std::move(tensor2);
+  Tensor<int, 3> moved_tensor1 = std::move(tensor1);
+  Tensor<int, 3, RowMajor> moved_tensor2 = std::move(tensor2);
 
   VERIFY_IS_EQUAL(tensor1.size(), 0);
   VERIFY_IS_EQUAL(tensor2.size(), 0);
 
-  for (int i = 0; i < 8; i++)
-  {
+  for (int i = 0; i < 8; i++) {
     calc_indices(i, x, y, z);
-    VERIFY_IS_EQUAL(moved_tensor1(x,y,z), i);
-    VERIFY_IS_EQUAL(moved_tensor2(x,y,z), 2 * i);
+    VERIFY_IS_EQUAL(moved_tensor1(x, y, z), i);
+    VERIFY_IS_EQUAL(moved_tensor2(x, y, z), 2 * i);
   }
 
-  Tensor<int,3> moved_tensor3(2,2,2);
-  Tensor<int,3,RowMajor> moved_tensor4(2,2,2);
+  Tensor<int, 3> moved_tensor3(2, 2, 2);
+  Tensor<int, 3, RowMajor> moved_tensor4(2, 2, 2);
 
   moved_tensor3.setZero();
   moved_tensor4.setZero();
@@ -62,15 +58,11 @@
   moved_tensor3 = std::move(moved_tensor1);
   moved_tensor4 = std::move(moved_tensor2);
 
-  for (int i = 0; i < 8; i++)
-  {
+  for (int i = 0; i < 8; i++) {
     calc_indices(i, x, y, z);
-    VERIFY_IS_EQUAL(moved_tensor3(x,y,z), i);
-    VERIFY_IS_EQUAL(moved_tensor4(x,y,z), 2 * i);
+    VERIFY_IS_EQUAL(moved_tensor3(x, y, z), i);
+    VERIFY_IS_EQUAL(moved_tensor4(x, y, z), 2 * i);
   }
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_move)
-{
-  CALL_SUBTEST(test_move());
-}
+EIGEN_DECLARE_TEST(cxx11_tensor_move) { CALL_SUBTEST(test_move()); }
diff --git a/unsupported/test/cxx11_tensor_notification.cpp b/unsupported/test/cxx11_tensor_notification.cpp
index 8e81653..2173866 100644
--- a/unsupported/test/cxx11_tensor_notification.cpp
+++ b/unsupported/test/cxx11_tensor_notification.cpp
@@ -15,13 +15,15 @@
 #include "main.h"
 #include <Eigen/CXX11/Tensor>
 
-static void test_notification_single()
-{
+static void test_notification_single() {
   ThreadPool thread_pool(1);
 
   std::atomic<int> counter(0);
   Eigen::Notification n;
-  auto func = [&n, &counter](){ n.Wait(); ++counter;};
+  auto func = [&n, &counter]() {
+    n.Wait();
+    ++counter;
+  };
   thread_pool.Schedule(func);
   std::this_thread::sleep_for(std::chrono::milliseconds(1000));
 
@@ -39,13 +41,15 @@
 
 // Like test_notification_single() but enqueues multiple threads to
 // validate that all threads get notified by Notify().
-static void test_notification_multiple()
-{
+static void test_notification_multiple() {
   ThreadPool thread_pool(1);
 
   std::atomic<int> counter(0);
   Eigen::Notification n;
-  auto func = [&n, &counter](){ n.Wait(); ++counter;};
+  auto func = [&n, &counter]() {
+    n.Wait();
+    ++counter;
+  };
   thread_pool.Schedule(func);
   thread_pool.Schedule(func);
   thread_pool.Schedule(func);
@@ -57,8 +61,7 @@
   VERIFY_IS_EQUAL(counter, 4);
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_notification)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_notification) {
   CALL_SUBTEST(test_notification_single());
   CALL_SUBTEST(test_notification_multiple());
 }
diff --git a/unsupported/test/cxx11_tensor_of_bfloat16_gpu.cu b/unsupported/test/cxx11_tensor_of_bfloat16_gpu.cu
index 10498e6..722c92f 100644
--- a/unsupported/test/cxx11_tensor_of_bfloat16_gpu.cu
+++ b/unsupported/test/cxx11_tensor_of_bfloat16_gpu.cu
@@ -16,10 +16,9 @@
 #include "main.h"
 #include <unsupported/Eigen/CXX11/Tensor>
 
-
 using Eigen::Tensor;
 
-template<typename>
+template <typename>
 void test_gpu_numext() {
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
@@ -29,22 +28,20 @@
   bool* d_res_bfloat16 = (bool*)gpu_device.allocate(num_elem * sizeof(bool));
   bool* d_res_float = (bool*)gpu_device.allocate(num_elem * sizeof(bool));
 
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(
-      d_float, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<bool, 1>, Eigen::Aligned> gpu_res_bfloat16(
-      d_res_bfloat16, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<bool, 1>, Eigen::Aligned> gpu_res_float(
-      d_res_float, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(d_float, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<bool, 1>, Eigen::Aligned> gpu_res_bfloat16(d_res_bfloat16, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<bool, 1>, Eigen::Aligned> gpu_res_float(d_res_float, num_elem);
 
   gpu_float.device(gpu_device) = gpu_float.random() - gpu_float.constant(0.5f);
   gpu_res_float.device(gpu_device) = gpu_float.unaryExpr(Eigen::internal::scalar_isnan_op<float>());
   // Test bfloat16 specific isnan op.
-  gpu_res_bfloat16.device(gpu_device) = gpu_float.cast<Eigen::bfloat16>().unaryExpr(Eigen::internal::scalar_isnan_op<Eigen::bfloat16>());
+  gpu_res_bfloat16.device(gpu_device) =
+      gpu_float.cast<Eigen::bfloat16>().unaryExpr(Eigen::internal::scalar_isnan_op<Eigen::bfloat16>());
 
   Tensor<bool, 1> bfloat16_prec(num_elem);
   Tensor<bool, 1> full_prec(num_elem);
-  gpu_device.memcpyDeviceToHost(bfloat16_prec.data(), d_res_bfloat16, num_elem*sizeof(bool));
-  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem*sizeof(bool));
+  gpu_device.memcpyDeviceToHost(bfloat16_prec.data(), d_res_bfloat16, num_elem * sizeof(bool));
+  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem * sizeof(bool));
   gpu_device.synchronize();
 
   for (int i = 0; i < num_elem; ++i) {
@@ -56,10 +53,9 @@
   gpu_device.deallocate(d_res_float);
 }
 
-
 #ifdef EIGEN_HAS_GPU_BF16
 
-template<typename>
+template <typename>
 void test_gpu_conversion() {
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
@@ -69,12 +65,9 @@
   Eigen::bfloat16* d_bfloat16 = (Eigen::bfloat16*)gpu_device.allocate(num_elem * sizeof(Eigen::bfloat16));
   float* d_conv = (float*)gpu_device.allocate(num_elem * sizeof(float));
 
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(
-      d_float, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<Eigen::bfloat16, 1>, Eigen::Aligned> gpu_bfloat16(
-      d_bfloat16, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_conv(
-      d_conv, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(d_float, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<Eigen::bfloat16, 1>, Eigen::Aligned> gpu_bfloat16(d_bfloat16, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_conv(d_conv, num_elem);
 
   gpu_float.device(gpu_device) = gpu_float.random();
   gpu_bfloat16.device(gpu_device) = gpu_float.cast<Eigen::bfloat16>();
@@ -82,8 +75,8 @@
 
   Tensor<float, 1> initial(num_elem);
   Tensor<float, 1> final(num_elem);
-  gpu_device.memcpyDeviceToHost(initial.data(), d_float, num_elem*sizeof(float));
-  gpu_device.memcpyDeviceToHost(final.data(), d_conv, num_elem*sizeof(float));
+  gpu_device.memcpyDeviceToHost(initial.data(), d_float, num_elem * sizeof(float));
+  gpu_device.memcpyDeviceToHost(final.data(), d_conv, num_elem * sizeof(float));
 
   for (int i = 0; i < num_elem; ++i) {
     VERIFY_IS_APPROX(static_cast<Eigen::bfloat16>(initial(i)), static_cast<Eigen::bfloat16>(final(i)));
@@ -94,7 +87,7 @@
   gpu_device.deallocate(d_conv);
 }
 
-template<typename>
+template <typename>
 void test_gpu_unary() {
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
@@ -104,12 +97,9 @@
   float* d_res_bfloat16 = (float*)gpu_device.allocate(num_elem * sizeof(float));
   float* d_res_float = (float*)gpu_device.allocate(num_elem * sizeof(float));
 
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(
-      d_float, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_bfloat16(
-      d_res_bfloat16, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_float(
-      d_res_float, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(d_float, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_bfloat16(d_res_bfloat16, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_float(d_res_float, num_elem);
 
   gpu_float.device(gpu_device) = gpu_float.random() - gpu_float.constant(0.5f);
   gpu_float.device(gpu_device) = gpu_float.cast<Eigen::bfloat16>().cast<float>();
@@ -118,8 +108,8 @@
 
   Tensor<float, 1> bfloat16_prec(num_elem);
   Tensor<float, 1> full_prec(num_elem);
-  gpu_device.memcpyDeviceToHost(bfloat16_prec.data(), d_res_bfloat16, num_elem*sizeof(float));
-  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem*sizeof(float));
+  gpu_device.memcpyDeviceToHost(bfloat16_prec.data(), d_res_bfloat16, num_elem * sizeof(float));
+  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem * sizeof(float));
   gpu_device.synchronize();
 
   for (int i = 0; i < num_elem; ++i) {
@@ -131,7 +121,7 @@
   gpu_device.deallocate(d_res_float);
 }
 
-template<typename>
+template <typename>
 void test_gpu_elementwise() {
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
@@ -142,26 +132,24 @@
   float* d_res_bfloat16 = (float*)gpu_device.allocate(num_elem * sizeof(float));
   float* d_res_float = (float*)gpu_device.allocate(num_elem * sizeof(float));
 
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float1(
-      d_float1, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float2(
-      d_float2, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_bfloat16(
-      d_res_bfloat16, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_float(
-      d_res_float, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float1(d_float1, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float2(d_float2, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_bfloat16(d_res_bfloat16, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_float(d_res_float, num_elem);
 
   gpu_float1.device(gpu_device) = gpu_float1.random();
   gpu_float1.device(gpu_device) = gpu_float1.cast<Eigen::bfloat16>().cast<float>();
   gpu_float2.device(gpu_device) = gpu_float2.random();
   gpu_float2.device(gpu_device) = gpu_float2.cast<Eigen::bfloat16>().cast<float>();
   gpu_res_float.device(gpu_device) = (gpu_float1 + gpu_float2) * gpu_float1;
-  gpu_res_bfloat16.device(gpu_device) = ((gpu_float1.cast<Eigen::bfloat16>() + gpu_float2.cast<Eigen::bfloat16>()) * gpu_float1.cast<Eigen::bfloat16>()).cast<float>();
+  gpu_res_bfloat16.device(gpu_device) =
+      ((gpu_float1.cast<Eigen::bfloat16>() + gpu_float2.cast<Eigen::bfloat16>()) * gpu_float1.cast<Eigen::bfloat16>())
+          .cast<float>();
 
   Tensor<float, 1> bfloat16_prec(num_elem);
   Tensor<float, 1> full_prec(num_elem);
-  gpu_device.memcpyDeviceToHost(bfloat16_prec.data(), d_res_bfloat16, num_elem*sizeof(float));
-  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem*sizeof(float));
+  gpu_device.memcpyDeviceToHost(bfloat16_prec.data(), d_res_bfloat16, num_elem * sizeof(float));
+  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem * sizeof(float));
   gpu_device.synchronize();
 
   for (int i = 0; i < num_elem; ++i) {
@@ -174,7 +162,7 @@
   gpu_device.deallocate(d_res_float);
 }
 
-template<typename>
+template <typename>
 void test_gpu_trancendental() {
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
@@ -234,23 +222,23 @@
   Tensor<float, 1> input3(num_elem);
   Tensor<Eigen::bfloat16, 1> bfloat16_prec3(num_elem);
   Tensor<Eigen::bfloat16, 1> full_prec3(num_elem);
-  gpu_device.memcpyDeviceToHost(input1.data(), d_float1, num_elem*sizeof(float));
-  gpu_device.memcpyDeviceToHost(input2.data(), d_float2, num_elem*sizeof(float));
-  gpu_device.memcpyDeviceToHost(input3.data(), d_float3, num_elem*sizeof(float));
-  gpu_device.memcpyDeviceToHost(bfloat16_prec1.data(), d_res1_bfloat16, num_elem*sizeof(Eigen::bfloat16));
-  gpu_device.memcpyDeviceToHost(full_prec1.data(), d_res1_float, num_elem*sizeof(Eigen::bfloat16));
-  gpu_device.memcpyDeviceToHost(bfloat16_prec2.data(), d_res2_bfloat16, num_elem*sizeof(Eigen::bfloat16));
-  gpu_device.memcpyDeviceToHost(full_prec2.data(), d_res2_float, num_elem*sizeof(Eigen::bfloat16));
-  gpu_device.memcpyDeviceToHost(bfloat16_prec3.data(), d_res3_bfloat16, num_elem*sizeof(Eigen::bfloat16));
-  gpu_device.memcpyDeviceToHost(full_prec3.data(), d_res3_float, num_elem*sizeof(Eigen::bfloat16));
+  gpu_device.memcpyDeviceToHost(input1.data(), d_float1, num_elem * sizeof(float));
+  gpu_device.memcpyDeviceToHost(input2.data(), d_float2, num_elem * sizeof(float));
+  gpu_device.memcpyDeviceToHost(input3.data(), d_float3, num_elem * sizeof(float));
+  gpu_device.memcpyDeviceToHost(bfloat16_prec1.data(), d_res1_bfloat16, num_elem * sizeof(Eigen::bfloat16));
+  gpu_device.memcpyDeviceToHost(full_prec1.data(), d_res1_float, num_elem * sizeof(Eigen::bfloat16));
+  gpu_device.memcpyDeviceToHost(bfloat16_prec2.data(), d_res2_bfloat16, num_elem * sizeof(Eigen::bfloat16));
+  gpu_device.memcpyDeviceToHost(full_prec2.data(), d_res2_float, num_elem * sizeof(Eigen::bfloat16));
+  gpu_device.memcpyDeviceToHost(bfloat16_prec3.data(), d_res3_bfloat16, num_elem * sizeof(Eigen::bfloat16));
+  gpu_device.memcpyDeviceToHost(full_prec3.data(), d_res3_float, num_elem * sizeof(Eigen::bfloat16));
   gpu_device.synchronize();
 
   for (int i = 0; i < num_elem; ++i) {
     VERIFY_IS_APPROX(full_prec1(i), bfloat16_prec1(i));
   }
   for (int i = 0; i < num_elem; ++i) {
-    if(std::abs(input2(i)-1.f)<0.05f) // log lacks accuracy nearby 1
-      VERIFY_IS_APPROX(full_prec2(i)+Eigen::bfloat16(0.1f), bfloat16_prec2(i)+Eigen::bfloat16(0.1f));
+    if (std::abs(input2(i) - 1.f) < 0.05f)  // log lacks accuracy nearby 1
+      VERIFY_IS_APPROX(full_prec2(i) + Eigen::bfloat16(0.1f), bfloat16_prec2(i) + Eigen::bfloat16(0.1f));
     else
       VERIFY_IS_APPROX(full_prec2(i), bfloat16_prec2(i));
   }
@@ -268,27 +256,23 @@
   gpu_device.deallocate(d_res3_bfloat16);
 }
 
-template<typename>
+template <typename>
 void test_gpu_contractions() {
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
   int rows = 23;
   int cols = 23;
-  int num_elem = rows*cols;
+  int num_elem = rows * cols;
 
   float* d_float1 = (float*)gpu_device.allocate(num_elem * sizeof(float));
   float* d_float2 = (float*)gpu_device.allocate(num_elem * sizeof(float));
   Eigen::bfloat16* d_res_bfloat16 = (Eigen::bfloat16*)gpu_device.allocate(num_elem * sizeof(Eigen::bfloat16));
   Eigen::bfloat16* d_res_float = (Eigen::bfloat16*)gpu_device.allocate(num_elem * sizeof(Eigen::bfloat16));
 
-  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float1(
-      d_float1, rows, cols);
-  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float2(
-      d_float2, rows, cols);
-  Eigen::TensorMap<Eigen::Tensor<Eigen::bfloat16, 2>, Eigen::Aligned> gpu_res_bfloat16(
-      d_res_bfloat16, rows, cols);
-  Eigen::TensorMap<Eigen::Tensor<Eigen::bfloat16, 2>, Eigen::Aligned> gpu_res_float(
-      d_res_float, rows, cols);
+  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float1(d_float1, rows, cols);
+  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float2(d_float2, rows, cols);
+  Eigen::TensorMap<Eigen::Tensor<Eigen::bfloat16, 2>, Eigen::Aligned> gpu_res_bfloat16(d_res_bfloat16, rows, cols);
+  Eigen::TensorMap<Eigen::Tensor<Eigen::bfloat16, 2>, Eigen::Aligned> gpu_res_float(d_res_float, rows, cols);
 
   gpu_float1.device(gpu_device) = gpu_float1.random() - gpu_float1.constant(0.5f);
   gpu_float2.device(gpu_device) = gpu_float2.random() - gpu_float2.constant(0.5f);
@@ -296,12 +280,13 @@
   typedef Tensor<float, 2>::DimensionPair DimPair;
   Eigen::array<DimPair, 1> dims(DimPair(1, 0));
   gpu_res_float.device(gpu_device) = gpu_float1.contract(gpu_float2, dims).cast<Eigen::bfloat16>();
-  gpu_res_bfloat16.device(gpu_device) = gpu_float1.cast<Eigen::bfloat16>().contract(gpu_float2.cast<Eigen::bfloat16>(), dims);
+  gpu_res_bfloat16.device(gpu_device) =
+      gpu_float1.cast<Eigen::bfloat16>().contract(gpu_float2.cast<Eigen::bfloat16>(), dims);
 
   Tensor<Eigen::bfloat16, 2> bfloat16_prec(rows, cols);
   Tensor<Eigen::bfloat16, 2> full_prec(rows, cols);
-  gpu_device.memcpyDeviceToHost(bfloat16_prec.data(), d_res_bfloat16, num_elem*sizeof(Eigen::bfloat16));
-  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem*sizeof(Eigen::bfloat16));
+  gpu_device.memcpyDeviceToHost(bfloat16_prec.data(), d_res_bfloat16, num_elem * sizeof(Eigen::bfloat16));
+  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem * sizeof(Eigen::bfloat16));
   gpu_device.synchronize();
 
   for (int i = 0; i < rows; ++i) {
@@ -318,23 +303,20 @@
   gpu_device.deallocate(d_res_float);
 }
 
-template<typename>
+template <typename>
 void test_gpu_reductions(int size1, int size2, int redux) {
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
-  int num_elem = size1*size2;
+  int num_elem = size1 * size2;
   int result_size = (redux == 1 ? size1 : size2);
 
   float* d_float = (float*)gpu_device.allocate(num_elem * sizeof(float));
   Eigen::bfloat16* d_res_bfloat16 = (Eigen::bfloat16*)gpu_device.allocate(result_size * sizeof(Eigen::bfloat16));
   Eigen::bfloat16* d_res_float = (Eigen::bfloat16*)gpu_device.allocate(result_size * sizeof(Eigen::bfloat16));
 
-  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float(
-      d_float, size1, size2);
-  Eigen::TensorMap<Eigen::Tensor<Eigen::bfloat16, 1>, Eigen::Aligned> gpu_res_bfloat16(
-      d_res_bfloat16, result_size);
-  Eigen::TensorMap<Eigen::Tensor<Eigen::bfloat16, 1>, Eigen::Aligned> gpu_res_float(
-      d_res_float, result_size);
+  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float(d_float, size1, size2);
+  Eigen::TensorMap<Eigen::Tensor<Eigen::bfloat16, 1>, Eigen::Aligned> gpu_res_bfloat16(d_res_bfloat16, result_size);
+  Eigen::TensorMap<Eigen::Tensor<Eigen::bfloat16, 1>, Eigen::Aligned> gpu_res_float(d_res_float, result_size);
 
   gpu_float.device(gpu_device) = gpu_float.random() * 2.0f;
 
@@ -344,8 +326,8 @@
 
   Tensor<Eigen::bfloat16, 1> bfloat16_prec(result_size);
   Tensor<Eigen::bfloat16, 1> full_prec(result_size);
-  gpu_device.memcpyDeviceToHost(bfloat16_prec.data(), d_res_bfloat16, result_size*sizeof(Eigen::bfloat16));
-  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, result_size*sizeof(Eigen::bfloat16));
+  gpu_device.memcpyDeviceToHost(bfloat16_prec.data(), d_res_bfloat16, result_size * sizeof(Eigen::bfloat16));
+  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, result_size * sizeof(Eigen::bfloat16));
   gpu_device.synchronize();
 
   for (int i = 0; i < result_size; ++i) {
@@ -357,7 +339,7 @@
   gpu_device.deallocate(d_res_float);
 }
 
-template<typename>
+template <typename>
 void test_gpu_reductions() {
   test_gpu_reductions<void>(13, 13, 0);
   test_gpu_reductions<void>(13, 13, 1);
@@ -369,23 +351,20 @@
   test_gpu_reductions<void>(36, 35, 1);
 }
 
-template<typename>
+template <typename>
 void test_gpu_full_reductions() {
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
   int size = 13;
-  int num_elem = size*size;
+  int num_elem = size * size;
 
   float* d_float = (float*)gpu_device.allocate(num_elem * sizeof(float));
   Eigen::bfloat16* d_res_bfloat16 = (Eigen::bfloat16*)gpu_device.allocate(1 * sizeof(Eigen::bfloat16));
   Eigen::bfloat16* d_res_float = (Eigen::bfloat16*)gpu_device.allocate(1 * sizeof(Eigen::bfloat16));
 
-  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float(
-      d_float, size, size);
-  Eigen::TensorMap<Eigen::Tensor<Eigen::bfloat16, 0>, Eigen::Aligned> gpu_res_bfloat16(
-      d_res_bfloat16);
-  Eigen::TensorMap<Eigen::Tensor<Eigen::bfloat16, 0>, Eigen::Aligned> gpu_res_float(
-      d_res_float);
+  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float(d_float, size, size);
+  Eigen::TensorMap<Eigen::Tensor<Eigen::bfloat16, 0>, Eigen::Aligned> gpu_res_bfloat16(d_res_bfloat16);
+  Eigen::TensorMap<Eigen::Tensor<Eigen::bfloat16, 0>, Eigen::Aligned> gpu_res_float(d_res_float);
 
   gpu_float.device(gpu_device) = gpu_float.random();
 
@@ -413,9 +392,8 @@
   gpu_device.deallocate(d_res_float);
 }
 
-template<typename>
+template <typename>
 void test_gpu_forced_evals() {
-
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
   int num_elem = 101;
@@ -425,14 +403,10 @@
   float* d_res_bfloat16_2 = (float*)gpu_device.allocate(num_elem * sizeof(float));
   float* d_res_float = (float*)gpu_device.allocate(num_elem * sizeof(float));
 
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(
-      d_float, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_bfloat16_1(
-      d_res_bfloat16_1, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Unaligned> gpu_res_bfloat16_2(
-      d_res_bfloat16_2, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_float(
-      d_res_float, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(d_float, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_bfloat16_1(d_res_bfloat16_1, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Unaligned> gpu_res_bfloat16_2(d_res_bfloat16_2, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_float(d_res_float, num_elem);
 
   Eigen::array<int, 1> no_bcast;
   no_bcast[0] = 1;
@@ -441,14 +415,15 @@
   gpu_float.device(gpu_device) = gpu_float.cast<Eigen::bfloat16>().cast<float>();
   gpu_res_float.device(gpu_device) = gpu_float.abs();
   gpu_res_bfloat16_1.device(gpu_device) = gpu_float.cast<Eigen::bfloat16>().abs().eval().cast<float>();
-  gpu_res_bfloat16_2.device(gpu_device) = gpu_float.cast<Eigen::bfloat16>().abs().broadcast(no_bcast).eval().cast<float>();
+  gpu_res_bfloat16_2.device(gpu_device) =
+      gpu_float.cast<Eigen::bfloat16>().abs().broadcast(no_bcast).eval().cast<float>();
 
   Tensor<float, 1> bfloat16_prec1(num_elem);
   Tensor<float, 1> bfloat16_prec2(num_elem);
   Tensor<float, 1> full_prec(num_elem);
-  gpu_device.memcpyDeviceToHost(bfloat16_prec1.data(), d_res_bfloat16_1, num_elem*sizeof(float));
-  gpu_device.memcpyDeviceToHost(bfloat16_prec2.data(), d_res_bfloat16_2, num_elem*sizeof(float));
-  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem*sizeof(float));
+  gpu_device.memcpyDeviceToHost(bfloat16_prec1.data(), d_res_bfloat16_1, num_elem * sizeof(float));
+  gpu_device.memcpyDeviceToHost(bfloat16_prec2.data(), d_res_bfloat16_2, num_elem * sizeof(float));
+  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem * sizeof(float));
   gpu_device.synchronize();
 
   for (int i = 0; i < num_elem; ++i) {
@@ -464,8 +439,7 @@
 
 #endif
 
-EIGEN_DECLARE_TEST(cxx11_tensor_of_bfloat16_gpu)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_of_bfloat16_gpu) {
   CALL_SUBTEST_1(test_gpu_numext<void>());
 
 // The reduction unit tests have been excluded until a working
diff --git a/unsupported/test/cxx11_tensor_of_complex.cpp b/unsupported/test/cxx11_tensor_of_complex.cpp
index b2f5994..d34edbd 100644
--- a/unsupported/test/cxx11_tensor_of_complex.cpp
+++ b/unsupported/test/cxx11_tensor_of_complex.cpp
@@ -14,10 +14,7 @@
 using Eigen::Tensor;
 using Eigen::TensorMap;
 
-
-
-static void test_additions()
-{
+static void test_additions() {
   Tensor<std::complex<float>, 1> data1(3);
   Tensor<std::complex<float>, 1> data2(3);
   for (int i = 0; i < 3; ++i) {
@@ -27,13 +24,11 @@
 
   Tensor<std::complex<float>, 1> sum = data1 + data2;
   for (int i = 0; i < 3; ++i) {
-    VERIFY_IS_EQUAL(sum(i),  std::complex<float>(2*i, 6*i));
+    VERIFY_IS_EQUAL(sum(i), std::complex<float>(2 * i, 6 * i));
   }
 }
 
-
-static void test_abs()
-{
+static void test_abs() {
   Tensor<std::complex<float>, 1> data1(3);
   Tensor<std::complex<double>, 1> data2(3);
   data1.setRandom();
@@ -47,8 +42,7 @@
   }
 }
 
-static void test_arg()
-{
+static void test_arg() {
   Tensor<std::complex<float>, 1> data1(3);
   Tensor<std::complex<double>, 1> data2(3);
   data1.setRandom();
@@ -62,8 +56,7 @@
   }
 }
 
-static void test_conjugate()
-{
+static void test_conjugate() {
   Tensor<std::complex<float>, 1> data1(3);
   Tensor<std::complex<double>, 1> data2(3);
   Tensor<int, 1> data3(3);
@@ -81,8 +74,7 @@
   }
 }
 
-static void test_contractions()
-{
+static void test_contractions() {
   Tensor<std::complex<float>, 4> t_left(30, 50, 8, 31);
   Tensor<std::complex<float>, 5> t_right(8, 31, 7, 20, 10);
   Tensor<std::complex<float>, 5> t_result(30, 50, 7, 20, 10);
@@ -107,9 +99,7 @@
   }
 }
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_of_complex)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_of_complex) {
   CALL_SUBTEST(test_additions());
   CALL_SUBTEST(test_abs());
   CALL_SUBTEST(test_arg());
diff --git a/unsupported/test/cxx11_tensor_of_const_values.cpp b/unsupported/test/cxx11_tensor_of_const_values.cpp
index 344d678..6c76cf3 100644
--- a/unsupported/test/cxx11_tensor_of_const_values.cpp
+++ b/unsupported/test/cxx11_tensor_of_const_values.cpp
@@ -11,11 +11,10 @@
 
 #include <Eigen/CXX11/Tensor>
 
-using Eigen::Tensor;
 using Eigen::RowMajor;
+using Eigen::Tensor;
 
-static void test_assign()
-{
+static void test_assign() {
   float data1[6];
   TensorMap<Tensor<const float, 2>> mat1(data1, 2, 3);
   float data2[6];
@@ -39,19 +38,17 @@
 
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
-      VERIFY_IS_APPROX(rslt1(i,j), static_cast<float>(i + 2*j));
-      VERIFY_IS_APPROX(rslt2(i,j), static_cast<float>(-i - 2*j));
-      VERIFY_IS_APPROX(rslt3(i,j), static_cast<float>(i + 2*j));
-      VERIFY_IS_APPROX(rslt4(i,j), static_cast<float>(-i - 2*j));
-      VERIFY_IS_APPROX(rslt5(i,j), static_cast<float>(i + 2*j));
-      VERIFY_IS_APPROX(rslt6(i,j), static_cast<float>(-i - 2*j));
+      VERIFY_IS_APPROX(rslt1(i, j), static_cast<float>(i + 2 * j));
+      VERIFY_IS_APPROX(rslt2(i, j), static_cast<float>(-i - 2 * j));
+      VERIFY_IS_APPROX(rslt3(i, j), static_cast<float>(i + 2 * j));
+      VERIFY_IS_APPROX(rslt4(i, j), static_cast<float>(-i - 2 * j));
+      VERIFY_IS_APPROX(rslt5(i, j), static_cast<float>(i + 2 * j));
+      VERIFY_IS_APPROX(rslt6(i, j), static_cast<float>(-i - 2 * j));
     }
   }
 }
 
-
-static void test_plus()
-{
+static void test_plus() {
   float data1[6];
   TensorMap<Tensor<const float, 2>> mat1(data1, 2, 3);
   float data2[6];
@@ -69,15 +66,13 @@
 
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
-      VERIFY_IS_APPROX(sum1(i,j), 0.0f);
-      VERIFY_IS_APPROX(sum2(i,j), 0.0f);
+      VERIFY_IS_APPROX(sum1(i, j), 0.0f);
+      VERIFY_IS_APPROX(sum2(i, j), 0.0f);
     }
   }
 }
 
-
-static void test_plus_equal()
-{
+static void test_plus_equal() {
   float data1[6];
   TensorMap<Tensor<const float, 2>> mat1(data1, 2, 3);
   float data2[6];
@@ -91,14 +86,12 @@
 
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
-      VERIFY_IS_APPROX(mat2(i,j), 0.0f);
+      VERIFY_IS_APPROX(mat2(i, j), 0.0f);
     }
   }
 }
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_of_const_values)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_of_const_values) {
   CALL_SUBTEST(test_assign());
   CALL_SUBTEST(test_plus());
   CALL_SUBTEST(test_plus_equal());
diff --git a/unsupported/test/cxx11_tensor_of_float16_gpu.cu b/unsupported/test/cxx11_tensor_of_float16_gpu.cu
index 30bcc1d..a9a8267 100644
--- a/unsupported/test/cxx11_tensor_of_float16_gpu.cu
+++ b/unsupported/test/cxx11_tensor_of_float16_gpu.cu
@@ -16,10 +16,9 @@
 #include "main.h"
 #include <unsupported/Eigen/CXX11/Tensor>
 
-
 using Eigen::Tensor;
 
-template<typename>
+template <typename>
 void test_gpu_numext() {
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
@@ -29,21 +28,19 @@
   bool* d_res_half = (bool*)gpu_device.allocate(num_elem * sizeof(bool));
   bool* d_res_float = (bool*)gpu_device.allocate(num_elem * sizeof(bool));
 
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(
-      d_float, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<bool, 1>, Eigen::Aligned> gpu_res_half(
-      d_res_half, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<bool, 1>, Eigen::Aligned> gpu_res_float(
-      d_res_float, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(d_float, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<bool, 1>, Eigen::Aligned> gpu_res_half(d_res_half, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<bool, 1>, Eigen::Aligned> gpu_res_float(d_res_float, num_elem);
 
   gpu_float.device(gpu_device) = gpu_float.random() - gpu_float.constant(0.5f);
   gpu_res_float.device(gpu_device) = gpu_float.unaryExpr(Eigen::internal::scalar_isnan_op<float>());
-  gpu_res_half.device(gpu_device) = gpu_float.cast<Eigen::half>().unaryExpr(Eigen::internal::scalar_isnan_op<Eigen::half>());
+  gpu_res_half.device(gpu_device) =
+      gpu_float.cast<Eigen::half>().unaryExpr(Eigen::internal::scalar_isnan_op<Eigen::half>());
 
   Tensor<bool, 1> half_prec(num_elem);
   Tensor<bool, 1> full_prec(num_elem);
-  gpu_device.memcpyDeviceToHost(half_prec.data(), d_res_half, num_elem*sizeof(bool));
-  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem*sizeof(bool));
+  gpu_device.memcpyDeviceToHost(half_prec.data(), d_res_half, num_elem * sizeof(bool));
+  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem * sizeof(bool));
   gpu_device.synchronize();
 
   for (int i = 0; i < num_elem; ++i) {
@@ -56,10 +53,9 @@
   gpu_device.deallocate(d_res_float);
 }
 
-
 #ifdef EIGEN_HAS_GPU_FP16
 
-template<typename>
+template <typename>
 void test_gpu_conversion() {
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
@@ -69,12 +65,9 @@
   Eigen::half* d_half = (Eigen::half*)gpu_device.allocate(num_elem * sizeof(Eigen::half));
   float* d_conv = (float*)gpu_device.allocate(num_elem * sizeof(float));
 
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(
-      d_float, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 1>, Eigen::Aligned> gpu_half(
-      d_half, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_conv(
-      d_conv, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(d_float, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 1>, Eigen::Aligned> gpu_half(d_half, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_conv(d_conv, num_elem);
 
   gpu_float.device(gpu_device) = gpu_float.random();
   gpu_half.device(gpu_device) = gpu_float.cast<Eigen::half>();
@@ -82,8 +75,8 @@
 
   Tensor<float, 1> initial(num_elem);
   Tensor<float, 1> final(num_elem);
-  gpu_device.memcpyDeviceToHost(initial.data(), d_float, num_elem*sizeof(float));
-  gpu_device.memcpyDeviceToHost(final.data(), d_conv, num_elem*sizeof(float));
+  gpu_device.memcpyDeviceToHost(initial.data(), d_float, num_elem * sizeof(float));
+  gpu_device.memcpyDeviceToHost(final.data(), d_conv, num_elem * sizeof(float));
 
   for (int i = 0; i < num_elem; ++i) {
     VERIFY_IS_APPROX(initial(i), final(i));
@@ -94,7 +87,7 @@
   gpu_device.deallocate(d_conv);
 }
 
-template<typename>
+template <typename>
 void test_gpu_unary() {
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
@@ -104,12 +97,9 @@
   float* d_res_half = (float*)gpu_device.allocate(num_elem * sizeof(float));
   float* d_res_float = (float*)gpu_device.allocate(num_elem * sizeof(float));
 
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(
-      d_float, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_half(
-      d_res_half, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_float(
-      d_res_float, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(d_float, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_half(d_res_half, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_float(d_res_float, num_elem);
 
   gpu_float.device(gpu_device) = gpu_float.random() - gpu_float.constant(0.5f);
   gpu_res_float.device(gpu_device) = gpu_float.abs();
@@ -117,8 +107,8 @@
 
   Tensor<float, 1> half_prec(num_elem);
   Tensor<float, 1> full_prec(num_elem);
-  gpu_device.memcpyDeviceToHost(half_prec.data(), d_res_half, num_elem*sizeof(float));
-  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem*sizeof(float));
+  gpu_device.memcpyDeviceToHost(half_prec.data(), d_res_half, num_elem * sizeof(float));
+  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem * sizeof(float));
   gpu_device.synchronize();
 
   for (int i = 0; i < num_elem; ++i) {
@@ -131,7 +121,7 @@
   gpu_device.deallocate(d_res_float);
 }
 
-template<typename>
+template <typename>
 void test_gpu_elementwise() {
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
@@ -142,28 +132,27 @@
   float* d_res_half = (float*)gpu_device.allocate(num_elem * sizeof(float));
   float* d_res_float = (float*)gpu_device.allocate(num_elem * sizeof(float));
 
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float1(
-      d_float1, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float2(
-      d_float2, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_half(
-      d_res_half, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_float(
-      d_res_float, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float1(d_float1, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float2(d_float2, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_half(d_res_half, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_float(d_res_float, num_elem);
 
   gpu_float1.device(gpu_device) = gpu_float1.random();
   gpu_float2.device(gpu_device) = gpu_float2.random();
   gpu_res_float.device(gpu_device) = (gpu_float1 + gpu_float2) * gpu_float1;
-  gpu_res_half.device(gpu_device) = ((gpu_float1.cast<Eigen::half>() + gpu_float2.cast<Eigen::half>()) * gpu_float1.cast<Eigen::half>()).cast<float>();
+  gpu_res_half.device(gpu_device) =
+      ((gpu_float1.cast<Eigen::half>() + gpu_float2.cast<Eigen::half>()) * gpu_float1.cast<Eigen::half>())
+          .cast<float>();
 
   Tensor<float, 1> half_prec(num_elem);
   Tensor<float, 1> full_prec(num_elem);
-  gpu_device.memcpyDeviceToHost(half_prec.data(), d_res_half, num_elem*sizeof(float));
-  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem*sizeof(float));
+  gpu_device.memcpyDeviceToHost(half_prec.data(), d_res_half, num_elem * sizeof(float));
+  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem * sizeof(float));
   gpu_device.synchronize();
 
   for (int i = 0; i < num_elem; ++i) {
-    std::cout << "Checking elemwise " << i << ": full prec = " << full_prec(i) << " vs half prec = " << half_prec(i) << std::endl;
+    std::cout << "Checking elemwise " << i << ": full prec = " << full_prec(i) << " vs half prec = " << half_prec(i)
+              << std::endl;
     VERIFY_IS_APPROX(static_cast<Eigen::half>(full_prec(i)), static_cast<Eigen::half>(half_prec(i)));
   }
 
@@ -173,7 +162,7 @@
   gpu_device.deallocate(d_res_float);
 }
 
-template<typename>
+template <typename>
 void test_gpu_trancendental() {
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
@@ -230,30 +219,33 @@
   Tensor<float, 1> input3(num_elem);
   Tensor<Eigen::half, 1> half_prec3(num_elem);
   Tensor<Eigen::half, 1> full_prec3(num_elem);
-  gpu_device.memcpyDeviceToHost(input1.data(), d_float1, num_elem*sizeof(float));
-  gpu_device.memcpyDeviceToHost(input2.data(), d_float2, num_elem*sizeof(float));
-  gpu_device.memcpyDeviceToHost(input3.data(), d_float3, num_elem*sizeof(float));
-  gpu_device.memcpyDeviceToHost(half_prec1.data(), d_res1_half, num_elem*sizeof(Eigen::half));
-  gpu_device.memcpyDeviceToHost(full_prec1.data(), d_res1_float, num_elem*sizeof(Eigen::half));
-  gpu_device.memcpyDeviceToHost(half_prec2.data(), d_res2_half, num_elem*sizeof(Eigen::half));
-  gpu_device.memcpyDeviceToHost(full_prec2.data(), d_res2_float, num_elem*sizeof(Eigen::half));
-  gpu_device.memcpyDeviceToHost(half_prec3.data(), d_res3_half, num_elem*sizeof(Eigen::half));
-  gpu_device.memcpyDeviceToHost(full_prec3.data(), d_res3_float, num_elem*sizeof(Eigen::half));
+  gpu_device.memcpyDeviceToHost(input1.data(), d_float1, num_elem * sizeof(float));
+  gpu_device.memcpyDeviceToHost(input2.data(), d_float2, num_elem * sizeof(float));
+  gpu_device.memcpyDeviceToHost(input3.data(), d_float3, num_elem * sizeof(float));
+  gpu_device.memcpyDeviceToHost(half_prec1.data(), d_res1_half, num_elem * sizeof(Eigen::half));
+  gpu_device.memcpyDeviceToHost(full_prec1.data(), d_res1_float, num_elem * sizeof(Eigen::half));
+  gpu_device.memcpyDeviceToHost(half_prec2.data(), d_res2_half, num_elem * sizeof(Eigen::half));
+  gpu_device.memcpyDeviceToHost(full_prec2.data(), d_res2_float, num_elem * sizeof(Eigen::half));
+  gpu_device.memcpyDeviceToHost(half_prec3.data(), d_res3_half, num_elem * sizeof(Eigen::half));
+  gpu_device.memcpyDeviceToHost(full_prec3.data(), d_res3_float, num_elem * sizeof(Eigen::half));
   gpu_device.synchronize();
 
   for (int i = 0; i < num_elem; ++i) {
-    std::cout << "Checking elemwise exp " << i << " input = " << input1(i) << " full = " << full_prec1(i) << " half = " << half_prec1(i) << std::endl;
+    std::cout << "Checking elemwise exp " << i << " input = " << input1(i) << " full = " << full_prec1(i)
+              << " half = " << half_prec1(i) << std::endl;
     VERIFY_IS_APPROX(full_prec1(i), half_prec1(i));
   }
   for (int i = 0; i < num_elem; ++i) {
-    std::cout << "Checking elemwise log " << i << " input = " << input2(i) << " full = " << full_prec2(i) << " half = " << half_prec2(i) << std::endl;
-    if(std::abs(input2(i)-1.f)<0.05f) // log lacks accuracy nearby 1
-      VERIFY_IS_APPROX(full_prec2(i)+Eigen::half(0.1f), half_prec2(i)+Eigen::half(0.1f));
+    std::cout << "Checking elemwise log " << i << " input = " << input2(i) << " full = " << full_prec2(i)
+              << " half = " << half_prec2(i) << std::endl;
+    if (std::abs(input2(i) - 1.f) < 0.05f)  // log lacks accuracy nearby 1
+      VERIFY_IS_APPROX(full_prec2(i) + Eigen::half(0.1f), half_prec2(i) + Eigen::half(0.1f));
     else
       VERIFY_IS_APPROX(full_prec2(i), half_prec2(i));
   }
   for (int i = 0; i < num_elem; ++i) {
-    std::cout << "Checking elemwise plog1 " << i << " input = " << input3(i) << " full = " << full_prec3(i) << " half = " << half_prec3(i) << std::endl;
+    std::cout << "Checking elemwise plog1 " << i << " input = " << input3(i) << " full = " << full_prec3(i)
+              << " half = " << half_prec3(i) << std::endl;
     VERIFY_IS_APPROX(full_prec3(i), half_prec3(i));
   }
   gpu_device.deallocate(d_float1);
@@ -267,27 +259,23 @@
   gpu_device.deallocate(d_res3_half);
 }
 
-template<typename>
+template <typename>
 void test_gpu_contractions() {
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
   int rows = 23;
   int cols = 23;
-  int num_elem = rows*cols;
+  int num_elem = rows * cols;
 
   float* d_float1 = (float*)gpu_device.allocate(num_elem * sizeof(float));
   float* d_float2 = (float*)gpu_device.allocate(num_elem * sizeof(float));
   Eigen::half* d_res_half = (Eigen::half*)gpu_device.allocate(num_elem * sizeof(Eigen::half));
   Eigen::half* d_res_float = (Eigen::half*)gpu_device.allocate(num_elem * sizeof(Eigen::half));
 
-  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float1(
-      d_float1, rows, cols);
-  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float2(
-      d_float2, rows, cols);
-  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 2>, Eigen::Aligned> gpu_res_half(
-      d_res_half, rows, cols);
-  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 2>, Eigen::Aligned> gpu_res_float(
-      d_res_float, rows, cols);
+  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float1(d_float1, rows, cols);
+  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float2(d_float2, rows, cols);
+  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 2>, Eigen::Aligned> gpu_res_half(d_res_half, rows, cols);
+  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 2>, Eigen::Aligned> gpu_res_float(d_res_float, rows, cols);
 
   gpu_float1.device(gpu_device) = gpu_float1.random() - gpu_float1.constant(0.5f);
   gpu_float2.device(gpu_device) = gpu_float2.random() - gpu_float2.constant(0.5f);
@@ -299,8 +287,8 @@
 
   Tensor<Eigen::half, 2> half_prec(rows, cols);
   Tensor<Eigen::half, 2> full_prec(rows, cols);
-  gpu_device.memcpyDeviceToHost(half_prec.data(), d_res_half, num_elem*sizeof(Eigen::half));
-  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem*sizeof(Eigen::half));
+  gpu_device.memcpyDeviceToHost(half_prec.data(), d_res_half, num_elem * sizeof(Eigen::half));
+  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem * sizeof(Eigen::half));
   gpu_device.synchronize();
 
   for (int i = 0; i < rows; ++i) {
@@ -318,27 +306,22 @@
   gpu_device.deallocate(d_res_float);
 }
 
-template<typename>
+template <typename>
 void test_gpu_reductions(int size1, int size2, int redux) {
-
-   std::cout << "Reducing " << size1 << " by " << size2
-             << " tensor along dim " << redux << std::endl;
+  std::cout << "Reducing " << size1 << " by " << size2 << " tensor along dim " << redux << std::endl;
 
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
-  int num_elem = size1*size2;
+  int num_elem = size1 * size2;
   int result_size = (redux == 1 ? size1 : size2);
 
   float* d_float = (float*)gpu_device.allocate(num_elem * sizeof(float));
   Eigen::half* d_res_half = (Eigen::half*)gpu_device.allocate(result_size * sizeof(Eigen::half));
   Eigen::half* d_res_float = (Eigen::half*)gpu_device.allocate(result_size * sizeof(Eigen::half));
 
-  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float(
-      d_float, size1, size2);
-  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 1>, Eigen::Aligned> gpu_res_half(
-      d_res_half, result_size);
-  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 1>, Eigen::Aligned> gpu_res_float(
-      d_res_float, result_size);
+  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float(d_float, size1, size2);
+  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 1>, Eigen::Aligned> gpu_res_half(d_res_half, result_size);
+  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 1>, Eigen::Aligned> gpu_res_float(d_res_float, result_size);
 
   gpu_float.device(gpu_device) = gpu_float.random() * 2.0f;
 
@@ -348,8 +331,8 @@
 
   Tensor<Eigen::half, 1> half_prec(result_size);
   Tensor<Eigen::half, 1> full_prec(result_size);
-  gpu_device.memcpyDeviceToHost(half_prec.data(), d_res_half, result_size*sizeof(Eigen::half));
-  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, result_size*sizeof(Eigen::half));
+  gpu_device.memcpyDeviceToHost(half_prec.data(), d_res_half, result_size * sizeof(Eigen::half));
+  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, result_size * sizeof(Eigen::half));
   gpu_device.synchronize();
 
   for (int i = 0; i < result_size; ++i) {
@@ -362,7 +345,7 @@
   gpu_device.deallocate(d_res_float);
 }
 
-template<typename>
+template <typename>
 void test_gpu_reductions() {
   test_gpu_reductions<void>(13, 13, 0);
   test_gpu_reductions<void>(13, 13, 1);
@@ -374,23 +357,20 @@
   test_gpu_reductions<void>(36, 35, 1);
 }
 
-template<typename>
+template <typename>
 void test_gpu_full_reductions() {
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
   int size = 13;
-  int num_elem = size*size;
+  int num_elem = size * size;
 
   float* d_float = (float*)gpu_device.allocate(num_elem * sizeof(float));
   Eigen::half* d_res_half = (Eigen::half*)gpu_device.allocate(1 * sizeof(Eigen::half));
   Eigen::half* d_res_float = (Eigen::half*)gpu_device.allocate(1 * sizeof(Eigen::half));
 
-  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float(
-      d_float, size, size);
-  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 0>, Eigen::Aligned> gpu_res_half(
-      d_res_half);
-  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 0>, Eigen::Aligned> gpu_res_float(
-      d_res_float);
+  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float(d_float, size, size);
+  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 0>, Eigen::Aligned> gpu_res_half(d_res_half);
+  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 0>, Eigen::Aligned> gpu_res_float(d_res_float);
 
   gpu_float.device(gpu_device) = gpu_float.random();
 
@@ -418,9 +398,8 @@
   gpu_device.deallocate(d_res_float);
 }
 
-template<typename>
+template <typename>
 void test_gpu_forced_evals() {
-
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
   int num_elem = 101;
@@ -430,14 +409,10 @@
   float* d_res_half2 = (float*)gpu_device.allocate(num_elem * sizeof(float));
   float* d_res_float = (float*)gpu_device.allocate(num_elem * sizeof(float));
 
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(
-      d_float, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_half1(
-      d_res_half1, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Unaligned> gpu_res_half2(
-      d_res_half2, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_float(
-      d_res_float, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(d_float, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_half1(d_res_half1, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Unaligned> gpu_res_half2(d_res_half2, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_float(d_res_float, num_elem);
 
   Eigen::array<int, 1> no_bcast;
   no_bcast[0] = 1;
@@ -450,13 +425,14 @@
   Tensor<float, 1> half_prec1(num_elem);
   Tensor<float, 1> half_prec2(num_elem);
   Tensor<float, 1> full_prec(num_elem);
-  gpu_device.memcpyDeviceToHost(half_prec1.data(), d_res_half1, num_elem*sizeof(float));
-  gpu_device.memcpyDeviceToHost(half_prec2.data(), d_res_half2, num_elem*sizeof(float));
-  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem*sizeof(float));
+  gpu_device.memcpyDeviceToHost(half_prec1.data(), d_res_half1, num_elem * sizeof(float));
+  gpu_device.memcpyDeviceToHost(half_prec2.data(), d_res_half2, num_elem * sizeof(float));
+  gpu_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem * sizeof(float));
   gpu_device.synchronize();
 
   for (int i = 0; i < num_elem; ++i) {
-    std::cout << "Checking forced eval " << i << full_prec(i) << " vs " << half_prec1(i) << " vs " << half_prec2(i) << std::endl;
+    std::cout << "Checking forced eval " << i << full_prec(i) << " vs " << half_prec1(i) << " vs " << half_prec2(i)
+              << std::endl;
     VERIFY_IS_APPROX(full_prec(i), half_prec1(i));
     VERIFY_IS_APPROX(full_prec(i), half_prec2(i));
   }
@@ -468,9 +444,7 @@
 }
 #endif
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_of_float16_gpu)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_of_float16_gpu) {
   CALL_SUBTEST_1(test_gpu_numext<void>());
 
 #ifdef EIGEN_HAS_GPU_FP16
diff --git a/unsupported/test/cxx11_tensor_of_float16_sycl.cpp b/unsupported/test/cxx11_tensor_of_float16_sycl.cpp
index 1624acc..7de39e7 100644
--- a/unsupported/test/cxx11_tensor_of_float16_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_of_float16_sycl.cpp
@@ -20,10 +20,10 @@
 #include "main.h"
 #include <unsupported/Eigen/CXX11/Tensor>
 
-using Eigen::Tensor;
 using Eigen::SyclDevice;
+using Eigen::Tensor;
 
-void test_gpu_numext(const Eigen::SyclDevice &sycl_device) {
+void test_gpu_numext(const Eigen::SyclDevice& sycl_device) {
   int num_elem = 101;
 
   float* d_float = static_cast<float*>(sycl_device.allocate(num_elem * sizeof(float)));
@@ -36,13 +36,14 @@
 
   gpu_float.device(sycl_device) = gpu_float.random() - gpu_float.constant(0.5f);
   gpu_res_float.device(sycl_device) = gpu_float.unaryExpr(Eigen::internal::scalar_isnan_op<float>());
-  gpu_res_half.device(sycl_device) = gpu_float.cast<Eigen::half>().unaryExpr(Eigen::internal::scalar_isnan_op<Eigen::half>());
+  gpu_res_half.device(sycl_device) =
+      gpu_float.cast<Eigen::half>().unaryExpr(Eigen::internal::scalar_isnan_op<Eigen::half>());
 
   Tensor<bool, 1> half_prec(num_elem);
   Tensor<bool, 1> full_prec(num_elem);
 
-  sycl_device.memcpyDeviceToHost(half_prec.data(), d_res_half,num_elem * sizeof(bool));
-  sycl_device.memcpyDeviceToHost(full_prec.data(), d_res_float,num_elem * sizeof(bool));
+  sycl_device.memcpyDeviceToHost(half_prec.data(), d_res_half, num_elem * sizeof(bool));
+  sycl_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem * sizeof(bool));
 
   for (int i = 0; i < num_elem; ++i) {
     std::cout << "Checking numext " << i << std::endl;
@@ -50,19 +51,16 @@
   }
 }
 
-void test_gpu_conversion(const Eigen::SyclDevice &sycl_device) {
+void test_gpu_conversion(const Eigen::SyclDevice& sycl_device) {
   int num_elem = 101;
 
   float* d_float = static_cast<float*>(sycl_device.allocate(num_elem * sizeof(float)));
   Eigen::half* d_half = static_cast<Eigen::half*>(sycl_device.allocate(num_elem * sizeof(Eigen::half)));
   float* d_conv = static_cast<float*>(sycl_device.allocate(num_elem * sizeof(float)));
 
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(
-      d_float, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 1>, Eigen::Aligned> gpu_half(
-      d_half, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_conv(
-      d_conv, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(d_float, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 1>, Eigen::Aligned> gpu_half(d_half, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_conv(d_conv, num_elem);
 
   gpu_float.device(sycl_device) = gpu_float.random();
   gpu_half.device(sycl_device) = gpu_float.cast<Eigen::half>();
@@ -70,27 +68,24 @@
 
   Tensor<float, 1> initial(num_elem);
   Tensor<float, 1> final(num_elem);
-  sycl_device.memcpyDeviceToHost(initial.data(), d_float, num_elem*sizeof(float));
-  sycl_device.memcpyDeviceToHost(final.data(), d_conv, num_elem*sizeof(float));
+  sycl_device.memcpyDeviceToHost(initial.data(), d_float, num_elem * sizeof(float));
+  sycl_device.memcpyDeviceToHost(final.data(), d_conv, num_elem * sizeof(float));
 
   for (int i = 0; i < num_elem; ++i) {
     VERIFY_IS_APPROX(initial(i), final(i));
   }
 }
 
-void test_gpu_unary(const Eigen::SyclDevice &sycl_device) {
+void test_gpu_unary(const Eigen::SyclDevice& sycl_device) {
   int num_elem = 101;
 
   float* d_float = (float*)sycl_device.allocate(num_elem * sizeof(float));
   float* d_res_half = (float*)sycl_device.allocate(num_elem * sizeof(float));
   float* d_res_float = (float*)sycl_device.allocate(num_elem * sizeof(float));
 
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(
-      d_float, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_half(
-      d_res_half, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_float(
-      d_res_float, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(d_float, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_half(d_res_half, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_float(d_res_float, num_elem);
 
   gpu_float.device(sycl_device) = gpu_float.random() - gpu_float.constant(0.5f);
   gpu_res_float.device(sycl_device) = gpu_float.abs();
@@ -98,8 +93,8 @@
 
   Tensor<float, 1> half_prec(num_elem);
   Tensor<float, 1> full_prec(num_elem);
-  sycl_device.memcpyDeviceToHost(half_prec.data(), d_res_half, num_elem*sizeof(float));
-  sycl_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem*sizeof(float));
+  sycl_device.memcpyDeviceToHost(half_prec.data(), d_res_half, num_elem * sizeof(float));
+  sycl_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem * sizeof(float));
   sycl_device.synchronize();
 
   for (int i = 0; i < num_elem; ++i) {
@@ -108,7 +103,7 @@
   }
 }
 
-void test_gpu_elementwise(const Eigen::SyclDevice &sycl_device) {
+void test_gpu_elementwise(const Eigen::SyclDevice& sycl_device) {
   int num_elem = 101;
 
   float* d_float1 = static_cast<float*>(sycl_device.allocate(num_elem * sizeof(float)));
@@ -124,21 +119,24 @@
   gpu_float1.device(sycl_device) = gpu_float1.random();
   gpu_float2.device(sycl_device) = gpu_float2.random();
   gpu_res_float.device(sycl_device) = (gpu_float1 + gpu_float2) * gpu_float1;
-  gpu_res_half.device(sycl_device) = ((gpu_float1.cast<Eigen::half>() + gpu_float2.cast<Eigen::half>()) * gpu_float1.cast<Eigen::half>()).cast<float>();
+  gpu_res_half.device(sycl_device) =
+      ((gpu_float1.cast<Eigen::half>() + gpu_float2.cast<Eigen::half>()) * gpu_float1.cast<Eigen::half>())
+          .cast<float>();
 
   Tensor<float, 1> half_prec(num_elem);
   Tensor<float, 1> full_prec(num_elem);
 
-  sycl_device.memcpyDeviceToHost(half_prec.data(), d_res_half,num_elem * sizeof(float));
-  sycl_device.memcpyDeviceToHost(full_prec.data(), d_res_float,num_elem * sizeof(float));
+  sycl_device.memcpyDeviceToHost(half_prec.data(), d_res_half, num_elem * sizeof(float));
+  sycl_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem * sizeof(float));
 
   for (int i = 0; i < num_elem; ++i) {
-    std::cout << "Checking elemwise " << i << ": full prec = " << full_prec(i) << " vs half prec = " << half_prec(i) << std::endl;
+    std::cout << "Checking elemwise " << i << ": full prec = " << full_prec(i) << " vs half prec = " << half_prec(i)
+              << std::endl;
     VERIFY_IS_APPROX(static_cast<Eigen::half>(full_prec(i)), static_cast<Eigen::half>(half_prec(i)));
   }
 }
 
-void test_gpu_trancendental(const Eigen::SyclDevice &sycl_device) {
+void test_gpu_trancendental(const Eigen::SyclDevice& sycl_device) {
   int num_elem = 101;
 
   float* d_float1 = (float*)sycl_device.allocate(num_elem * sizeof(float));
@@ -192,52 +190,51 @@
   Tensor<float, 1> input3(num_elem);
   Tensor<Eigen::half, 1> half_prec3(num_elem);
   Tensor<Eigen::half, 1> full_prec3(num_elem);
-  sycl_device.memcpyDeviceToHost(input1.data(), d_float1, num_elem*sizeof(float));
-  sycl_device.memcpyDeviceToHost(input2.data(), d_float2, num_elem*sizeof(float));
-  sycl_device.memcpyDeviceToHost(input3.data(), d_float3, num_elem*sizeof(float));
-  sycl_device.memcpyDeviceToHost(half_prec1.data(), d_res1_half, num_elem*sizeof(Eigen::half));
-  sycl_device.memcpyDeviceToHost(full_prec1.data(), d_res1_float, num_elem*sizeof(Eigen::half));
-  sycl_device.memcpyDeviceToHost(half_prec2.data(), d_res2_half, num_elem*sizeof(Eigen::half));
-  sycl_device.memcpyDeviceToHost(full_prec2.data(), d_res2_float, num_elem*sizeof(Eigen::half));
-  sycl_device.memcpyDeviceToHost(half_prec3.data(), d_res3_half, num_elem*sizeof(Eigen::half));
-  sycl_device.memcpyDeviceToHost(full_prec3.data(), d_res3_float, num_elem*sizeof(Eigen::half));
+  sycl_device.memcpyDeviceToHost(input1.data(), d_float1, num_elem * sizeof(float));
+  sycl_device.memcpyDeviceToHost(input2.data(), d_float2, num_elem * sizeof(float));
+  sycl_device.memcpyDeviceToHost(input3.data(), d_float3, num_elem * sizeof(float));
+  sycl_device.memcpyDeviceToHost(half_prec1.data(), d_res1_half, num_elem * sizeof(Eigen::half));
+  sycl_device.memcpyDeviceToHost(full_prec1.data(), d_res1_float, num_elem * sizeof(Eigen::half));
+  sycl_device.memcpyDeviceToHost(half_prec2.data(), d_res2_half, num_elem * sizeof(Eigen::half));
+  sycl_device.memcpyDeviceToHost(full_prec2.data(), d_res2_float, num_elem * sizeof(Eigen::half));
+  sycl_device.memcpyDeviceToHost(half_prec3.data(), d_res3_half, num_elem * sizeof(Eigen::half));
+  sycl_device.memcpyDeviceToHost(full_prec3.data(), d_res3_float, num_elem * sizeof(Eigen::half));
   sycl_device.synchronize();
 
   for (int i = 0; i < num_elem; ++i) {
-    std::cout << "Checking elemwise exp " << i << " input = " << input1(i) << " full = " << full_prec1(i) << " half = " << half_prec1(i) << std::endl;
+    std::cout << "Checking elemwise exp " << i << " input = " << input1(i) << " full = " << full_prec1(i)
+              << " half = " << half_prec1(i) << std::endl;
     VERIFY_IS_APPROX(full_prec1(i), half_prec1(i));
   }
   for (int i = 0; i < num_elem; ++i) {
-    std::cout << "Checking elemwise log " << i << " input = " << input2(i) << " full = " << full_prec2(i) << " half = " << half_prec2(i) << std::endl;
-    if(std::abs(input2(i)-1.f)<0.05f) // log lacks accuracy nearby 1
-      VERIFY_IS_APPROX(full_prec2(i)+Eigen::half(0.1f), half_prec2(i)+Eigen::half(0.1f));
+    std::cout << "Checking elemwise log " << i << " input = " << input2(i) << " full = " << full_prec2(i)
+              << " half = " << half_prec2(i) << std::endl;
+    if (std::abs(input2(i) - 1.f) < 0.05f)  // log lacks accuracy nearby 1
+      VERIFY_IS_APPROX(full_prec2(i) + Eigen::half(0.1f), half_prec2(i) + Eigen::half(0.1f));
     else
       VERIFY_IS_APPROX(full_prec2(i), half_prec2(i));
   }
   for (int i = 0; i < num_elem; ++i) {
-    std::cout << "Checking elemwise plog1 " << i << " input = " << input3(i) << " full = " << full_prec3(i) << " half = " << half_prec3(i) << std::endl;
+    std::cout << "Checking elemwise plog1 " << i << " input = " << input3(i) << " full = " << full_prec3(i)
+              << " half = " << half_prec3(i) << std::endl;
     VERIFY_IS_APPROX(full_prec3(i), half_prec3(i));
   }
 }
 
-void test_gpu_contractions(const Eigen::SyclDevice &sycl_device) {
+void test_gpu_contractions(const Eigen::SyclDevice& sycl_device) {
   int rows = 23;
   int cols = 23;
-  int num_elem = rows*cols;
+  int num_elem = rows * cols;
 
   float* d_float1 = (float*)sycl_device.allocate(num_elem * sizeof(float));
   float* d_float2 = (float*)sycl_device.allocate(num_elem * sizeof(float));
   Eigen::half* d_res_half = (Eigen::half*)sycl_device.allocate(num_elem * sizeof(Eigen::half));
   Eigen::half* d_res_float = (Eigen::half*)sycl_device.allocate(num_elem * sizeof(Eigen::half));
 
-  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float1(
-      d_float1, rows, cols);
-  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float2(
-      d_float2, rows, cols);
-  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 2>, Eigen::Aligned> gpu_res_half(
-      d_res_half, rows, cols);
-  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 2>, Eigen::Aligned> gpu_res_float(
-      d_res_float, rows, cols);
+  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float1(d_float1, rows, cols);
+  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float2(d_float2, rows, cols);
+  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 2>, Eigen::Aligned> gpu_res_half(d_res_half, rows, cols);
+  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 2>, Eigen::Aligned> gpu_res_float(d_res_float, rows, cols);
 
   gpu_float1.device(sycl_device) = gpu_float1.random() - gpu_float1.constant(0.5f);
   gpu_float2.device(sycl_device) = gpu_float2.random() - gpu_float2.constant(0.5f);
@@ -249,8 +246,8 @@
 
   Tensor<Eigen::half, 2> half_prec(rows, cols);
   Tensor<Eigen::half, 2> full_prec(rows, cols);
-  sycl_device.memcpyDeviceToHost(half_prec.data(), d_res_half, num_elem*sizeof(Eigen::half));
-  sycl_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem*sizeof(Eigen::half));
+  sycl_device.memcpyDeviceToHost(half_prec.data(), d_res_half, num_elem * sizeof(Eigen::half));
+  sycl_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem * sizeof(Eigen::half));
   sycl_device.synchronize();
 
   for (int i = 0; i < rows; ++i) {
@@ -263,23 +260,19 @@
   }
 }
 
-void test_gpu_reductions(const Eigen::SyclDevice &sycl_device, int size1, int size2, int redux) {
-   std::cout << "Reducing " << size1 << " by " << size2
-             << " tensor along dim " << redux << std::endl;
+void test_gpu_reductions(const Eigen::SyclDevice& sycl_device, int size1, int size2, int redux) {
+  std::cout << "Reducing " << size1 << " by " << size2 << " tensor along dim " << redux << std::endl;
 
-  int num_elem = size1*size2;
+  int num_elem = size1 * size2;
   int result_size = (redux == 1 ? size1 : size2);
 
   float* d_float = (float*)sycl_device.allocate(num_elem * sizeof(float));
   Eigen::half* d_res_half = (Eigen::half*)sycl_device.allocate(result_size * sizeof(Eigen::half));
   Eigen::half* d_res_float = (Eigen::half*)sycl_device.allocate(result_size * sizeof(Eigen::half));
 
-  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float(
-      d_float, size1, size2);
-  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 1>, Eigen::Aligned> gpu_res_half(
-      d_res_half, result_size);
-  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 1>, Eigen::Aligned> gpu_res_float(
-      d_res_float, result_size);
+  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float(d_float, size1, size2);
+  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 1>, Eigen::Aligned> gpu_res_half(d_res_half, result_size);
+  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 1>, Eigen::Aligned> gpu_res_float(d_res_float, result_size);
 
   gpu_float.device(sycl_device) = gpu_float.random() * 2.0f;
 
@@ -289,8 +282,8 @@
 
   Tensor<Eigen::half, 1> half_prec(result_size);
   Tensor<Eigen::half, 1> full_prec(result_size);
-  sycl_device.memcpyDeviceToHost(half_prec.data(), d_res_half, result_size*sizeof(Eigen::half));
-  sycl_device.memcpyDeviceToHost(full_prec.data(), d_res_float, result_size*sizeof(Eigen::half));
+  sycl_device.memcpyDeviceToHost(half_prec.data(), d_res_half, result_size * sizeof(Eigen::half));
+  sycl_device.memcpyDeviceToHost(full_prec.data(), d_res_float, result_size * sizeof(Eigen::half));
   sycl_device.synchronize();
 
   for (int i = 0; i < result_size; ++i) {
@@ -299,7 +292,7 @@
   }
 }
 
-void test_gpu_reductions(const Eigen::SyclDevice &sycl_device) {
+void test_gpu_reductions(const Eigen::SyclDevice& sycl_device) {
   test_gpu_reductions(sycl_device, 13, 13, 0);
   test_gpu_reductions(sycl_device, 13, 13, 1);
 
@@ -310,20 +303,17 @@
   test_gpu_reductions(sycl_device, 36, 35, 1);
 }
 
-void test_gpu_full_reductions(const Eigen::SyclDevice &sycl_device) {
+void test_gpu_full_reductions(const Eigen::SyclDevice& sycl_device) {
   int size = 13;
-  int num_elem = size*size;
+  int num_elem = size * size;
 
   float* d_float = (float*)sycl_device.allocate(num_elem * sizeof(float));
   Eigen::half* d_res_half = (Eigen::half*)sycl_device.allocate(1 * sizeof(Eigen::half));
   Eigen::half* d_res_float = (Eigen::half*)sycl_device.allocate(1 * sizeof(Eigen::half));
 
-  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float(
-      d_float, size, size);
-  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 0>, Eigen::Aligned> gpu_res_half(
-      d_res_half);
-  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 0>, Eigen::Aligned> gpu_res_float(
-      d_res_float);
+  Eigen::TensorMap<Eigen::Tensor<float, 2>, Eigen::Aligned> gpu_float(d_float, size, size);
+  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 0>, Eigen::Aligned> gpu_res_half(d_res_half);
+  Eigen::TensorMap<Eigen::Tensor<Eigen::half, 0>, Eigen::Aligned> gpu_res_float(d_res_float);
 
   gpu_float.device(sycl_device) = gpu_float.random();
 
@@ -347,7 +337,7 @@
   VERIFY_IS_APPROX(full_prec(), half_prec());
 }
 
-void test_gpu_forced_evals(const Eigen::SyclDevice &sycl_device) {
+void test_gpu_forced_evals(const Eigen::SyclDevice& sycl_device) {
   int num_elem = 101;
 
   float* d_float = (float*)sycl_device.allocate(num_elem * sizeof(float));
@@ -355,14 +345,10 @@
   float* d_res_half2 = (float*)sycl_device.allocate(num_elem * sizeof(float));
   float* d_res_float = (float*)sycl_device.allocate(num_elem * sizeof(float));
 
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(
-      d_float, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_half1(
-      d_res_half1, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Unaligned> gpu_res_half2(
-      d_res_half2, num_elem);
-  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_float(
-      d_res_float, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_float(d_float, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_half1(d_res_half1, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Unaligned> gpu_res_half2(d_res_half2, num_elem);
+  Eigen::TensorMap<Eigen::Tensor<float, 1>, Eigen::Aligned> gpu_res_float(d_res_float, num_elem);
 
   Eigen::array<int, 1> no_bcast;
   no_bcast[0] = 1;
@@ -375,20 +361,20 @@
   Tensor<float, 1> half_prec1(num_elem);
   Tensor<float, 1> half_prec2(num_elem);
   Tensor<float, 1> full_prec(num_elem);
-  sycl_device.memcpyDeviceToHost(half_prec1.data(), d_res_half1, num_elem*sizeof(float));
-  sycl_device.memcpyDeviceToHost(half_prec2.data(), d_res_half2, num_elem*sizeof(float));
-  sycl_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem*sizeof(float));
+  sycl_device.memcpyDeviceToHost(half_prec1.data(), d_res_half1, num_elem * sizeof(float));
+  sycl_device.memcpyDeviceToHost(half_prec2.data(), d_res_half2, num_elem * sizeof(float));
+  sycl_device.memcpyDeviceToHost(full_prec.data(), d_res_float, num_elem * sizeof(float));
   sycl_device.synchronize();
 
   for (int i = 0; i < num_elem; ++i) {
-    std::cout << "Checking forced eval " << i << full_prec(i) << " vs " << half_prec1(i) << " vs " << half_prec2(i) << std::endl;
+    std::cout << "Checking forced eval " << i << full_prec(i) << " vs " << half_prec1(i) << " vs " << half_prec2(i)
+              << std::endl;
     VERIFY_IS_APPROX(full_prec(i), half_prec1(i));
     VERIFY_IS_APPROX(full_prec(i), half_prec2(i));
   }
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_of_float16_sycl)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_of_float16_sycl) {
   for (const auto& s : Eigen::get_sycl_supported_devices()) {
     QueueInterface queueInterface(s);
     auto sycl_device = Eigen::SyclDevice(&queueInterface);
diff --git a/unsupported/test/cxx11_tensor_of_strings.cpp b/unsupported/test/cxx11_tensor_of_strings.cpp
index 1596562..f7db25c 100644
--- a/unsupported/test/cxx11_tensor_of_strings.cpp
+++ b/unsupported/test/cxx11_tensor_of_strings.cpp
@@ -14,8 +14,7 @@
 using Eigen::Tensor;
 using Eigen::TensorMap;
 
-static void test_assign()
-{
+static void test_assign() {
   std::string data1[6];
   TensorMap<Tensor<std::string, 2>> mat1(data1, 2, 3);
   std::string data2[6];
@@ -23,10 +22,10 @@
 
   for (int i = 0; i < 6; ++i) {
     std::ostringstream s1;
-    s1 << "abc" << i*3;
+    s1 << "abc" << i * 3;
     data1[i] = s1.str();
     std::ostringstream s2;
-    s2 << "def" << i*5;
+    s2 << "def" << i * 5;
     data2[i] = s2.str();
   }
 
@@ -43,29 +42,27 @@
 
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
-      VERIFY_IS_EQUAL(rslt1(i,j), data1[i+2*j]);
-      VERIFY_IS_EQUAL(rslt2(i,j), data2[i+2*j]);
-      VERIFY_IS_EQUAL(rslt3(i,j), data1[i+2*j]);
-      VERIFY_IS_EQUAL(rslt4(i,j), data2[i+2*j]);
-      VERIFY_IS_EQUAL(rslt5(i,j), data1[i+2*j]);
-      VERIFY_IS_EQUAL(rslt6(i,j), data2[i+2*j]);
+      VERIFY_IS_EQUAL(rslt1(i, j), data1[i + 2 * j]);
+      VERIFY_IS_EQUAL(rslt2(i, j), data2[i + 2 * j]);
+      VERIFY_IS_EQUAL(rslt3(i, j), data1[i + 2 * j]);
+      VERIFY_IS_EQUAL(rslt4(i, j), data2[i + 2 * j]);
+      VERIFY_IS_EQUAL(rslt5(i, j), data1[i + 2 * j]);
+      VERIFY_IS_EQUAL(rslt6(i, j), data2[i + 2 * j]);
     }
   }
 }
 
-
-static void test_concat()
-{
+static void test_concat() {
   Tensor<std::string, 2> t1(2, 3);
   Tensor<std::string, 2> t2(2, 3);
 
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       std::ostringstream s1;
-      s1 << "abc" << i + j*2;
+      s1 << "abc" << i + j * 2;
       t1(i, j) = s1.str();
       std::ostringstream s2;
-      s2 << "def" << i*5 + j*32;
+      s2 << "def" << i * 5 + j * 32;
       t2(i, j) = s2.str();
     }
   }
@@ -76,20 +73,18 @@
 
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
-      VERIFY_IS_EQUAL(result(i, j),   t1(i, j));
-      VERIFY_IS_EQUAL(result(i, j+3), t2(i, j));
+      VERIFY_IS_EQUAL(result(i, j), t1(i, j));
+      VERIFY_IS_EQUAL(result(i, j + 3), t2(i, j));
     }
   }
 }
 
-
-static void test_slices()
-{
+static void test_slices() {
   Tensor<std::string, 2> data(2, 6);
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       std::ostringstream s1;
-      s1 << "abc" << i + j*2;
+      s1 << "abc" << i + j * 2;
       data(i, j) = s1.str();
     }
   }
@@ -103,15 +98,13 @@
 
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
-      VERIFY_IS_EQUAL(data(i, j),   t1(i, j));
-      VERIFY_IS_EQUAL(data(i, j+3), t2(i, j));
+      VERIFY_IS_EQUAL(data(i, j), t1(i, j));
+      VERIFY_IS_EQUAL(data(i, j + 3), t2(i, j));
     }
   }
 }
 
-
-static void test_additions()
-{
+static void test_additions() {
   Tensor<std::string, 1> data1(3);
   Tensor<std::string, 1> data2(3);
   for (int i = 0; i < 3; ++i) {
@@ -130,19 +123,15 @@
   }
 }
 
-
-static void test_initialization()
-{
+static void test_initialization() {
   Tensor<std::string, 2> a(2, 3);
   a.setConstant(std::string("foo"));
-  for (int i = 0; i < 2*3; ++i) {
+  for (int i = 0; i < 2 * 3; ++i) {
     VERIFY_IS_EQUAL(a(i), std::string("foo"));
   }
 }
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_of_strings)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_of_strings) {
   // Beware: none of this is likely to ever work on a GPU.
   CALL_SUBTEST(test_assign());
   CALL_SUBTEST(test_concat());
diff --git a/unsupported/test/cxx11_tensor_padding.cpp b/unsupported/test/cxx11_tensor_padding.cpp
index b8a329d..6c5ddf0 100644
--- a/unsupported/test/cxx11_tensor_padding.cpp
+++ b/unsupported/test/cxx11_tensor_padding.cpp
@@ -13,10 +13,9 @@
 
 using Eigen::Tensor;
 
-template<int DataLayout>
-static void test_simple_padding()
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,5,7);
+template <int DataLayout>
+static void test_simple_padding() {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
 
   array<std::pair<ptrdiff_t, ptrdiff_t>, 4> paddings;
@@ -28,19 +27,19 @@
   Tensor<float, 4, DataLayout> padded;
   padded = tensor.pad(paddings);
 
-  VERIFY_IS_EQUAL(padded.dimension(0), 2+0);
-  VERIFY_IS_EQUAL(padded.dimension(1), 3+3);
-  VERIFY_IS_EQUAL(padded.dimension(2), 5+7);
-  VERIFY_IS_EQUAL(padded.dimension(3), 7+0);
+  VERIFY_IS_EQUAL(padded.dimension(0), 2 + 0);
+  VERIFY_IS_EQUAL(padded.dimension(1), 3 + 3);
+  VERIFY_IS_EQUAL(padded.dimension(2), 5 + 7);
+  VERIFY_IS_EQUAL(padded.dimension(3), 7 + 0);
 
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 6; ++j) {
       for (int k = 0; k < 12; ++k) {
         for (int l = 0; l < 7; ++l) {
           if (j >= 2 && j < 5 && k >= 3 && k < 8) {
-            VERIFY_IS_EQUAL(padded(i,j,k,l), tensor(i,j-2,k-3,l));
+            VERIFY_IS_EQUAL(padded(i, j, k, l), tensor(i, j - 2, k - 3, l));
           } else {
-            VERIFY_IS_EQUAL(padded(i,j,k,l), 0.0f);
+            VERIFY_IS_EQUAL(padded(i, j, k, l), 0.0f);
           }
         }
       }
@@ -48,10 +47,9 @@
   }
 }
 
-template<int DataLayout>
-static void test_padded_expr()
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,5,7);
+template <int DataLayout>
+static void test_padded_expr() {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
 
   array<std::pair<ptrdiff_t, ptrdiff_t>, 4> paddings;
@@ -71,10 +69,10 @@
     for (int j = 0; j < 6; ++j) {
       for (int k = 0; k < 12; ++k) {
         for (int l = 0; l < 7; ++l) {
-          const float result_value = DataLayout == ColMajor ?
-              result(i+2*j,k+12*l) : result(j+6*i,l+7*k);
+          const float result_value =
+              DataLayout == ColMajor ? result(i + 2 * j, k + 12 * l) : result(j + 6 * i, l + 7 * k);
           if (j >= 2 && j < 5 && k >= 3 && k < 8) {
-            VERIFY_IS_EQUAL(result_value, tensor(i,j-2,k-3,l));
+            VERIFY_IS_EQUAL(result_value, tensor(i, j - 2, k - 3, l));
           } else {
             VERIFY_IS_EQUAL(result_value, 0.0f);
           }
@@ -84,8 +82,7 @@
   }
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_padding)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_padding) {
   CALL_SUBTEST(test_simple_padding<ColMajor>());
   CALL_SUBTEST(test_simple_padding<RowMajor>());
   CALL_SUBTEST(test_padded_expr<ColMajor>());
diff --git a/unsupported/test/cxx11_tensor_padding_sycl.cpp b/unsupported/test/cxx11_tensor_padding_sycl.cpp
index 9b16bb1..ae4d98a 100644
--- a/unsupported/test/cxx11_tensor_padding_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_padding_sycl.cpp
@@ -12,14 +12,12 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-
 #define EIGEN_TEST_NO_LONGDOUBLE
 #define EIGEN_TEST_NO_COMPLEX
 
 #define EIGEN_DEFAULT_DENSE_INDEX_TYPE int64_t
 #define EIGEN_USE_SYCL
 
-
 #include "main.h"
 #include <unsupported/Eigen/CXX11/Tensor>
 
@@ -28,11 +26,8 @@
 using Eigen::Tensor;
 using Eigen::TensorMap;
 
-
-template<typename DataType, int DataLayout, typename IndexType>
-static void test_simple_padding(const Eigen::SyclDevice& sycl_device)
-{
-
+template <typename DataType, int DataLayout, typename IndexType>
+static void test_simple_padding(const Eigen::SyclDevice& sycl_device) {
   IndexType sizeDim1 = 2;
   IndexType sizeDim2 = 3;
   IndexType sizeDim3 = 5;
@@ -56,27 +51,26 @@
 
   Tensor<DataType, 4, DataLayout, IndexType> padded(padedtensorRange);
 
+  DataType* gpu_data1 = static_cast<DataType*>(sycl_device.allocate(tensor.size() * sizeof(DataType)));
+  DataType* gpu_data2 = static_cast<DataType*>(sycl_device.allocate(padded.size() * sizeof(DataType)));
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu1(gpu_data1, tensorRange);
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu2(gpu_data2, padedtensorRange);
 
-  DataType* gpu_data1  = static_cast<DataType*>(sycl_device.allocate(tensor.size()*sizeof(DataType)));
-  DataType* gpu_data2  = static_cast<DataType*>(sycl_device.allocate(padded.size()*sizeof(DataType)));
-  TensorMap<Tensor<DataType, 4,DataLayout,IndexType>> gpu1(gpu_data1, tensorRange);
-  TensorMap<Tensor<DataType, 4,DataLayout,IndexType>> gpu2(gpu_data2, padedtensorRange);
-
-  VERIFY_IS_EQUAL(padded.dimension(0), 2+0);
-  VERIFY_IS_EQUAL(padded.dimension(1), 3+3);
-  VERIFY_IS_EQUAL(padded.dimension(2), 5+7);
-  VERIFY_IS_EQUAL(padded.dimension(3), 7+0);
-  sycl_device.memcpyHostToDevice(gpu_data1, tensor.data(),(tensor.size())*sizeof(DataType));
-  gpu2.device(sycl_device)=gpu1.pad(paddings);
-  sycl_device.memcpyDeviceToHost(padded.data(), gpu_data2,(padded.size())*sizeof(DataType));
+  VERIFY_IS_EQUAL(padded.dimension(0), 2 + 0);
+  VERIFY_IS_EQUAL(padded.dimension(1), 3 + 3);
+  VERIFY_IS_EQUAL(padded.dimension(2), 5 + 7);
+  VERIFY_IS_EQUAL(padded.dimension(3), 7 + 0);
+  sycl_device.memcpyHostToDevice(gpu_data1, tensor.data(), (tensor.size()) * sizeof(DataType));
+  gpu2.device(sycl_device) = gpu1.pad(paddings);
+  sycl_device.memcpyDeviceToHost(padded.data(), gpu_data2, (padded.size()) * sizeof(DataType));
   for (IndexType i = 0; i < padedSizeDim1; ++i) {
     for (IndexType j = 0; j < padedSizeDim2; ++j) {
       for (IndexType k = 0; k < padedSizeDim3; ++k) {
         for (IndexType l = 0; l < padedSizeDim4; ++l) {
           if (j >= 2 && j < 5 && k >= 3 && k < 8) {
-            VERIFY_IS_EQUAL(padded(i,j,k,l), tensor(i,j-2,k-3,l));
+            VERIFY_IS_EQUAL(padded(i, j, k, l), tensor(i, j - 2, k - 3, l));
           } else {
-            VERIFY_IS_EQUAL(padded(i,j,k,l), 0.0f);
+            VERIFY_IS_EQUAL(padded(i, j, k, l), 0.0f);
           }
         }
       }
@@ -86,9 +80,8 @@
   sycl_device.deallocate(gpu_data2);
 }
 
-template<typename DataType, int DataLayout, typename IndexType>
-static void test_padded_expr(const Eigen::SyclDevice& sycl_device)
-{
+template <typename DataType, int DataLayout, typename IndexType>
+static void test_padded_expr(const Eigen::SyclDevice& sycl_device) {
   IndexType sizeDim1 = 2;
   IndexType sizeDim2 = 3;
   IndexType sizeDim3 = 5;
@@ -108,27 +101,25 @@
   reshape_dims[0] = 12;
   reshape_dims[1] = 84;
 
+  Tensor<DataType, 2, DataLayout, IndexType> result(reshape_dims);
 
-  Tensor<DataType, 2, DataLayout, IndexType>  result(reshape_dims);
+  DataType* gpu_data1 = static_cast<DataType*>(sycl_device.allocate(tensor.size() * sizeof(DataType)));
+  DataType* gpu_data2 = static_cast<DataType*>(sycl_device.allocate(result.size() * sizeof(DataType)));
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu1(gpu_data1, tensorRange);
+  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> gpu2(gpu_data2, reshape_dims);
 
-  DataType* gpu_data1  = static_cast<DataType*>(sycl_device.allocate(tensor.size()*sizeof(DataType)));
-  DataType* gpu_data2  = static_cast<DataType*>(sycl_device.allocate(result.size()*sizeof(DataType)));
-  TensorMap<Tensor<DataType, 4,DataLayout,IndexType>> gpu1(gpu_data1, tensorRange);
-  TensorMap<Tensor<DataType, 2,DataLayout,IndexType>> gpu2(gpu_data2, reshape_dims);
-
-
-  sycl_device.memcpyHostToDevice(gpu_data1, tensor.data(),(tensor.size())*sizeof(DataType));
-  gpu2.device(sycl_device)=gpu1.pad(paddings).reshape(reshape_dims);
-  sycl_device.memcpyDeviceToHost(result.data(), gpu_data2,(result.size())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_data1, tensor.data(), (tensor.size()) * sizeof(DataType));
+  gpu2.device(sycl_device) = gpu1.pad(paddings).reshape(reshape_dims);
+  sycl_device.memcpyDeviceToHost(result.data(), gpu_data2, (result.size()) * sizeof(DataType));
 
   for (IndexType i = 0; i < 2; ++i) {
     for (IndexType j = 0; j < 6; ++j) {
       for (IndexType k = 0; k < 12; ++k) {
         for (IndexType l = 0; l < 7; ++l) {
-          const float result_value = DataLayout == ColMajor ?
-              result(i+2*j,k+12*l) : result(j+6*i,l+7*k);
+          const float result_value =
+              DataLayout == ColMajor ? result(i + 2 * j, k + 12 * l) : result(j + 6 * i, l + 7 * k);
           if (j >= 2 && j < 5 && k >= 3 && k < 8) {
-            VERIFY_IS_EQUAL(result_value, tensor(i,j-2,k-3,l));
+            VERIFY_IS_EQUAL(result_value, tensor(i, j - 2, k - 3, l));
           } else {
             VERIFY_IS_EQUAL(result_value, 0.0f);
           }
@@ -140,18 +131,17 @@
   sycl_device.deallocate(gpu_data2);
 }
 
-template<typename DataType, typename dev_Selector> void sycl_padding_test_per_device(dev_Selector s){
+template <typename DataType, typename dev_Selector>
+void sycl_padding_test_per_device(dev_Selector s) {
   QueueInterface queueInterface(s);
   auto sycl_device = Eigen::SyclDevice(&queueInterface);
   test_simple_padding<DataType, RowMajor, int64_t>(sycl_device);
   test_simple_padding<DataType, ColMajor, int64_t>(sycl_device);
   test_padded_expr<DataType, RowMajor, int64_t>(sycl_device);
   test_padded_expr<DataType, ColMajor, int64_t>(sycl_device);
-
 }
-EIGEN_DECLARE_TEST(cxx11_tensor_padding_sycl)
-{
-  for (const auto& device :Eigen::get_sycl_supported_devices()) {
+EIGEN_DECLARE_TEST(cxx11_tensor_padding_sycl) {
+  for (const auto& device : Eigen::get_sycl_supported_devices()) {
     CALL_SUBTEST(sycl_padding_test_per_device<half>(device));
     CALL_SUBTEST(sycl_padding_test_per_device<float>(device));
   }
diff --git a/unsupported/test/cxx11_tensor_patch.cpp b/unsupported/test/cxx11_tensor_patch.cpp
index 498ab8c..59b03e7 100644
--- a/unsupported/test/cxx11_tensor_patch.cpp
+++ b/unsupported/test/cxx11_tensor_patch.cpp
@@ -13,10 +13,9 @@
 
 using Eigen::Tensor;
 
-template<int DataLayout>
-static void test_simple_patch()
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,5,7);
+template <int DataLayout>
+static void test_simple_patch() {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
   array<ptrdiff_t, 4> patch_dims;
 
@@ -83,9 +82,9 @@
     VERIFY_IS_EQUAL(twod_patch.dimension(1), 2);
     VERIFY_IS_EQUAL(twod_patch.dimension(2), 2);
     VERIFY_IS_EQUAL(twod_patch.dimension(3), 1);
-    VERIFY_IS_EQUAL(twod_patch.dimension(4), 2*2*4*7);
+    VERIFY_IS_EQUAL(twod_patch.dimension(4), 2 * 2 * 4 * 7);
   } else {
-    VERIFY_IS_EQUAL(twod_patch.dimension(0), 2*2*4*7);
+    VERIFY_IS_EQUAL(twod_patch.dimension(0), 2 * 2 * 4 * 7);
     VERIFY_IS_EQUAL(twod_patch.dimension(1), 1);
     VERIFY_IS_EQUAL(twod_patch.dimension(2), 2);
     VERIFY_IS_EQUAL(twod_patch.dimension(3), 2);
@@ -105,9 +104,9 @@
           for (int x = 0; x < 2; ++x) {
             for (int y = 0; y < 2; ++y) {
               if (DataLayout == ColMajor) {
-                VERIFY_IS_EQUAL(tensor(i,j+x,k+y,l), twod_patch(0,x,y,0,patch_loc));
+                VERIFY_IS_EQUAL(tensor(i, j + x, k + y, l), twod_patch(0, x, y, 0, patch_loc));
               } else {
-                VERIFY_IS_EQUAL(tensor(i,j+x,k+y,l), twod_patch(patch_loc,0,x,y,0));
+                VERIFY_IS_EQUAL(tensor(i, j + x, k + y, l), twod_patch(patch_loc, 0, x, y, 0));
               }
             }
           }
@@ -128,9 +127,9 @@
     VERIFY_IS_EQUAL(threed_patch.dimension(1), 2);
     VERIFY_IS_EQUAL(threed_patch.dimension(2), 3);
     VERIFY_IS_EQUAL(threed_patch.dimension(3), 5);
-    VERIFY_IS_EQUAL(threed_patch.dimension(4), 2*2*3*3);
+    VERIFY_IS_EQUAL(threed_patch.dimension(4), 2 * 2 * 3 * 3);
   } else {
-    VERIFY_IS_EQUAL(threed_patch.dimension(0), 2*2*3*3);
+    VERIFY_IS_EQUAL(threed_patch.dimension(0), 2 * 2 * 3 * 3);
     VERIFY_IS_EQUAL(threed_patch.dimension(1), 1);
     VERIFY_IS_EQUAL(threed_patch.dimension(2), 2);
     VERIFY_IS_EQUAL(threed_patch.dimension(3), 3);
@@ -151,9 +150,9 @@
             for (int y = 0; y < 3; ++y) {
               for (int z = 0; z < 5; ++z) {
                 if (DataLayout == ColMajor) {
-                  VERIFY_IS_EQUAL(tensor(i,j+x,k+y,l+z), threed_patch(0,x,y,z,patch_loc));
+                  VERIFY_IS_EQUAL(tensor(i, j + x, k + y, l + z), threed_patch(0, x, y, z, patch_loc));
                 } else {
-                  VERIFY_IS_EQUAL(tensor(i,j+x,k+y,l+z), threed_patch(patch_loc,0,x,y,z));
+                  VERIFY_IS_EQUAL(tensor(i, j + x, k + y, l + z), threed_patch(patch_loc, 0, x, y, z));
                 }
               }
             }
@@ -164,9 +163,8 @@
   }
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_patch)
-{
-   CALL_SUBTEST(test_simple_patch<ColMajor>());
-   CALL_SUBTEST(test_simple_patch<RowMajor>());
-   //   CALL_SUBTEST(test_expr_shuffling());
+EIGEN_DECLARE_TEST(cxx11_tensor_patch) {
+  CALL_SUBTEST(test_simple_patch<ColMajor>());
+  CALL_SUBTEST(test_simple_patch<RowMajor>());
+  //   CALL_SUBTEST(test_expr_shuffling());
 }
diff --git a/unsupported/test/cxx11_tensor_patch_sycl.cpp b/unsupported/test/cxx11_tensor_patch_sycl.cpp
index 1216ad2..b1be9ff 100644
--- a/unsupported/test/cxx11_tensor_patch_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_patch_sycl.cpp
@@ -25,8 +25,7 @@
 using Eigen::Tensor;
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_simple_patch_sycl(const Eigen::SyclDevice& sycl_device){
-
+static void test_simple_patch_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType sizeDim1 = 2;
   IndexType sizeDim2 = 3;
   IndexType sizeDim3 = 5;
@@ -34,13 +33,13 @@
   array<IndexType, 4> tensorRange = {{sizeDim1, sizeDim2, sizeDim3, sizeDim4}};
   array<IndexType, 5> patchTensorRange;
   if (DataLayout == ColMajor) {
-   patchTensorRange = {{1, 1, 1, 1, sizeDim1*sizeDim2*sizeDim3*sizeDim4}};
-  }else{
-     patchTensorRange = {{sizeDim1*sizeDim2*sizeDim3*sizeDim4,1, 1, 1, 1}};
+    patchTensorRange = {{1, 1, 1, 1, sizeDim1 * sizeDim2 * sizeDim3 * sizeDim4}};
+  } else {
+    patchTensorRange = {{sizeDim1 * sizeDim2 * sizeDim3 * sizeDim4, 1, 1, 1, 1}};
   }
 
-  Tensor<DataType, 4, DataLayout,IndexType> tensor(tensorRange);
-  Tensor<DataType, 5, DataLayout,IndexType> no_patch(patchTensorRange);
+  Tensor<DataType, 4, DataLayout, IndexType> tensor(tensorRange);
+  Tensor<DataType, 5, DataLayout, IndexType> no_patch(patchTensorRange);
 
   tensor.setRandom();
 
@@ -50,16 +49,16 @@
   patch_dims[2] = 1;
   patch_dims[3] = 1;
 
-  const size_t tensorBuffSize =tensor.size()*sizeof(DataType);
-  size_t patchTensorBuffSize =no_patch.size()*sizeof(DataType);
-  DataType* gpu_data_tensor  = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
-  DataType* gpu_data_no_patch  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  const size_t tensorBuffSize = tensor.size() * sizeof(DataType);
+  size_t patchTensorBuffSize = no_patch.size() * sizeof(DataType);
+  DataType* gpu_data_tensor = static_cast<DataType*>(sycl_device.allocate(tensorBuffSize));
+  DataType* gpu_data_no_patch = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
 
-  TensorMap<Tensor<DataType, 4, DataLayout,IndexType>> gpu_tensor(gpu_data_tensor, tensorRange);
-  TensorMap<Tensor<DataType, 5, DataLayout,IndexType>> gpu_no_patch(gpu_data_no_patch, patchTensorRange);
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu_tensor(gpu_data_tensor, tensorRange);
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu_no_patch(gpu_data_no_patch, patchTensorRange);
 
   sycl_device.memcpyHostToDevice(gpu_data_tensor, tensor.data(), tensorBuffSize);
-  gpu_no_patch.device(sycl_device)=gpu_tensor.extract_patches(patch_dims);
+  gpu_no_patch.device(sycl_device) = gpu_tensor.extract_patches(patch_dims);
   sycl_device.memcpyDeviceToHost(no_patch.data(), gpu_data_no_patch, patchTensorBuffSize);
 
   if (DataLayout == ColMajor) {
@@ -86,16 +85,16 @@
   patch_dims[3] = 7;
 
   if (DataLayout == ColMajor) {
-   patchTensorRange = {{sizeDim1,sizeDim2,sizeDim3,sizeDim4,1}};
-  }else{
-     patchTensorRange = {{1,sizeDim1,sizeDim2,sizeDim3,sizeDim4}};
+    patchTensorRange = {{sizeDim1, sizeDim2, sizeDim3, sizeDim4, 1}};
+  } else {
+    patchTensorRange = {{1, sizeDim1, sizeDim2, sizeDim3, sizeDim4}};
   }
-  Tensor<DataType, 5, DataLayout,IndexType> single_patch(patchTensorRange);
-  patchTensorBuffSize =single_patch.size()*sizeof(DataType);
-  DataType* gpu_data_single_patch  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 5, DataLayout,IndexType>> gpu_single_patch(gpu_data_single_patch, patchTensorRange);
+  Tensor<DataType, 5, DataLayout, IndexType> single_patch(patchTensorRange);
+  patchTensorBuffSize = single_patch.size() * sizeof(DataType);
+  DataType* gpu_data_single_patch = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu_single_patch(gpu_data_single_patch, patchTensorRange);
 
-  gpu_single_patch.device(sycl_device)=gpu_tensor.extract_patches(patch_dims);
+  gpu_single_patch.device(sycl_device) = gpu_tensor.extract_patches(patch_dims);
   sycl_device.memcpyDeviceToHost(single_patch.data(), gpu_data_single_patch, patchTensorBuffSize);
 
   if (DataLayout == ColMajor) {
@@ -119,18 +118,18 @@
   patch_dims[1] = 2;
   patch_dims[2] = 2;
   patch_dims[3] = 1;
-  
-  if (DataLayout == ColMajor) {
-   patchTensorRange = {{1,2,2,1,2*2*4*7}};
-  }else{
-     patchTensorRange = {{2*2*4*7, 1, 2,2,1}};
-  }
-  Tensor<DataType, 5, DataLayout,IndexType> twod_patch(patchTensorRange);
-  patchTensorBuffSize =twod_patch.size()*sizeof(DataType);
-  DataType* gpu_data_twod_patch  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 5, DataLayout,IndexType>> gpu_twod_patch(gpu_data_twod_patch, patchTensorRange);
 
-  gpu_twod_patch.device(sycl_device)=gpu_tensor.extract_patches(patch_dims);
+  if (DataLayout == ColMajor) {
+    patchTensorRange = {{1, 2, 2, 1, 2 * 2 * 4 * 7}};
+  } else {
+    patchTensorRange = {{2 * 2 * 4 * 7, 1, 2, 2, 1}};
+  }
+  Tensor<DataType, 5, DataLayout, IndexType> twod_patch(patchTensorRange);
+  patchTensorBuffSize = twod_patch.size() * sizeof(DataType);
+  DataType* gpu_data_twod_patch = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu_twod_patch(gpu_data_twod_patch, patchTensorRange);
+
+  gpu_twod_patch.device(sycl_device) = gpu_tensor.extract_patches(patch_dims);
   sycl_device.memcpyDeviceToHost(twod_patch.data(), gpu_data_twod_patch, patchTensorBuffSize);
 
   if (DataLayout == ColMajor) {
@@ -138,9 +137,9 @@
     VERIFY_IS_EQUAL(twod_patch.dimension(1), 2);
     VERIFY_IS_EQUAL(twod_patch.dimension(2), 2);
     VERIFY_IS_EQUAL(twod_patch.dimension(3), 1);
-    VERIFY_IS_EQUAL(twod_patch.dimension(4), 2*2*4*7);
+    VERIFY_IS_EQUAL(twod_patch.dimension(4), 2 * 2 * 4 * 7);
   } else {
-    VERIFY_IS_EQUAL(twod_patch.dimension(0), 2*2*4*7);
+    VERIFY_IS_EQUAL(twod_patch.dimension(0), 2 * 2 * 4 * 7);
     VERIFY_IS_EQUAL(twod_patch.dimension(1), 1);
     VERIFY_IS_EQUAL(twod_patch.dimension(2), 2);
     VERIFY_IS_EQUAL(twod_patch.dimension(3), 2);
@@ -160,9 +159,9 @@
           for (int x = 0; x < 2; ++x) {
             for (int y = 0; y < 2; ++y) {
               if (DataLayout == ColMajor) {
-                VERIFY_IS_EQUAL(tensor(i,j+x,k+y,l), twod_patch(0,x,y,0,patch_loc));
+                VERIFY_IS_EQUAL(tensor(i, j + x, k + y, l), twod_patch(0, x, y, 0, patch_loc));
               } else {
-                VERIFY_IS_EQUAL(tensor(i,j+x,k+y,l), twod_patch(patch_loc,0,x,y,0));
+                VERIFY_IS_EQUAL(tensor(i, j + x, k + y, l), twod_patch(patch_loc, 0, x, y, 0));
               }
             }
           }
@@ -177,16 +176,16 @@
   patch_dims[3] = 5;
 
   if (DataLayout == ColMajor) {
-   patchTensorRange = {{1,2,3,5,2*2*3*3}};
-  }else{
-     patchTensorRange = {{2*2*3*3, 1, 2,3,5}};
+    patchTensorRange = {{1, 2, 3, 5, 2 * 2 * 3 * 3}};
+  } else {
+    patchTensorRange = {{2 * 2 * 3 * 3, 1, 2, 3, 5}};
   }
-  Tensor<DataType, 5, DataLayout,IndexType> threed_patch(patchTensorRange);
-  patchTensorBuffSize =threed_patch.size()*sizeof(DataType);
-  DataType* gpu_data_threed_patch  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 5, DataLayout,IndexType>> gpu_threed_patch(gpu_data_threed_patch, patchTensorRange);
+  Tensor<DataType, 5, DataLayout, IndexType> threed_patch(patchTensorRange);
+  patchTensorBuffSize = threed_patch.size() * sizeof(DataType);
+  DataType* gpu_data_threed_patch = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 5, DataLayout, IndexType>> gpu_threed_patch(gpu_data_threed_patch, patchTensorRange);
 
-  gpu_threed_patch.device(sycl_device)=gpu_tensor.extract_patches(patch_dims);
+  gpu_threed_patch.device(sycl_device) = gpu_tensor.extract_patches(patch_dims);
   sycl_device.memcpyDeviceToHost(threed_patch.data(), gpu_data_threed_patch, patchTensorBuffSize);
 
   if (DataLayout == ColMajor) {
@@ -194,9 +193,9 @@
     VERIFY_IS_EQUAL(threed_patch.dimension(1), 2);
     VERIFY_IS_EQUAL(threed_patch.dimension(2), 3);
     VERIFY_IS_EQUAL(threed_patch.dimension(3), 5);
-    VERIFY_IS_EQUAL(threed_patch.dimension(4), 2*2*3*3);
+    VERIFY_IS_EQUAL(threed_patch.dimension(4), 2 * 2 * 3 * 3);
   } else {
-    VERIFY_IS_EQUAL(threed_patch.dimension(0), 2*2*3*3);
+    VERIFY_IS_EQUAL(threed_patch.dimension(0), 2 * 2 * 3 * 3);
     VERIFY_IS_EQUAL(threed_patch.dimension(1), 1);
     VERIFY_IS_EQUAL(threed_patch.dimension(2), 2);
     VERIFY_IS_EQUAL(threed_patch.dimension(3), 3);
@@ -217,9 +216,9 @@
             for (int y = 0; y < 3; ++y) {
               for (int z = 0; z < 5; ++z) {
                 if (DataLayout == ColMajor) {
-                  VERIFY_IS_EQUAL(tensor(i,j+x,k+y,l+z), threed_patch(0,x,y,z,patch_loc));
+                  VERIFY_IS_EQUAL(tensor(i, j + x, k + y, l + z), threed_patch(0, x, y, z, patch_loc));
                 } else {
-                  VERIFY_IS_EQUAL(tensor(i,j+x,k+y,l+z), threed_patch(patch_loc,0,x,y,z));
+                  VERIFY_IS_EQUAL(tensor(i, j + x, k + y, l + z), threed_patch(patch_loc, 0, x, y, z));
                 }
               }
             }
@@ -235,15 +234,15 @@
   sycl_device.deallocate(gpu_data_threed_patch);
 }
 
-template<typename DataType, typename dev_Selector> void sycl_tensor_patch_test_per_device(dev_Selector s){
+template <typename DataType, typename dev_Selector>
+void sycl_tensor_patch_test_per_device(dev_Selector s) {
   QueueInterface queueInterface(s);
   auto sycl_device = Eigen::SyclDevice(&queueInterface);
   test_simple_patch_sycl<DataType, RowMajor, int64_t>(sycl_device);
   test_simple_patch_sycl<DataType, ColMajor, int64_t>(sycl_device);
 }
-EIGEN_DECLARE_TEST(cxx11_tensor_patch_sycl)
-{
-  for (const auto& device :Eigen::get_sycl_supported_devices()) {
+EIGEN_DECLARE_TEST(cxx11_tensor_patch_sycl) {
+  for (const auto& device : Eigen::get_sycl_supported_devices()) {
     CALL_SUBTEST(sycl_tensor_patch_test_per_device<half>(device));
     CALL_SUBTEST(sycl_tensor_patch_test_per_device<float>(device));
   }
diff --git a/unsupported/test/cxx11_tensor_random.cpp b/unsupported/test/cxx11_tensor_random.cpp
index b9d4c55..585a3f8 100644
--- a/unsupported/test/cxx11_tensor_random.cpp
+++ b/unsupported/test/cxx11_tensor_random.cpp
@@ -11,36 +11,33 @@
 
 #include <Eigen/CXX11/Tensor>
 
-template<typename Scalar>
-static void test_default()
-{
+template <typename Scalar>
+static void test_default() {
   Tensor<Scalar, 1> vec(6);
   vec.setRandom();
 
   // Fixme: we should check that the generated numbers follow a uniform
   // distribution instead.
   for (int i = 1; i < 6; ++i) {
-    VERIFY_IS_NOT_EQUAL(vec(i), vec(i-1));
+    VERIFY_IS_NOT_EQUAL(vec(i), vec(i - 1));
   }
 }
 
-template<typename Scalar>
-static void test_normal()
-{
+template <typename Scalar>
+static void test_normal() {
   Tensor<Scalar, 1> vec(6);
   vec.template setRandom<Eigen::internal::NormalRandomGenerator<Scalar>>();
 
   // Fixme: we should check that the generated numbers follow a gaussian
   // distribution instead.
   for (int i = 1; i < 6; ++i) {
-    VERIFY_IS_NOT_EQUAL(vec(i), vec(i-1));
+    VERIFY_IS_NOT_EQUAL(vec(i), vec(i - 1));
   }
 }
 
-
 struct MyGenerator {
-  MyGenerator() { }
-  MyGenerator(const MyGenerator&) { }
+  MyGenerator() {}
+  MyGenerator(const MyGenerator&) {}
 
   // Return a random value to be used.  "element_location" is the
   // location of the entry to set in the tensor, it can typically
@@ -50,8 +47,8 @@
   }
 
   // Same as above but generates several numbers at a time.
-  internal::packet_traits<int>::type packetOp(
-      Eigen::DenseIndex packet_location, Eigen::DenseIndex /*unused*/ = 0) const {
+  internal::packet_traits<int>::type packetOp(Eigen::DenseIndex packet_location,
+                                              Eigen::DenseIndex /*unused*/ = 0) const {
     const int packetSize = internal::packet_traits<int>::size;
     EIGEN_ALIGN_MAX int values[packetSize];
     for (int i = 0; i < packetSize; ++i) {
@@ -61,19 +58,16 @@
   }
 };
 
-
-static void test_custom()
-{
+static void test_custom() {
   Tensor<int, 1> vec(6);
   vec.setRandom<MyGenerator>();
 
   for (int i = 0; i < 6; ++i) {
-    VERIFY_IS_EQUAL(vec(i), 3*i);
+    VERIFY_IS_EQUAL(vec(i), 3 * i);
   }
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_random)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_random) {
   CALL_SUBTEST((test_default<float>()));
   CALL_SUBTEST((test_normal<float>()));
   CALL_SUBTEST((test_default<double>()));
diff --git a/unsupported/test/cxx11_tensor_random_gpu.cu b/unsupported/test/cxx11_tensor_random_gpu.cu
index 090986e..fa8da7d 100644
--- a/unsupported/test/cxx11_tensor_random_gpu.cu
+++ b/unsupported/test/cxx11_tensor_random_gpu.cu
@@ -18,9 +18,8 @@
 
 #include <Eigen/CXX11/src/Tensor/TensorGpuHipCudaDefines.h>
 
-void test_gpu_random_uniform()
-{
-  Tensor<float, 2> out(72,97);
+void test_gpu_random_uniform() {
+  Tensor<float, 2> out(72, 97);
   out.setZero();
 
   std::size_t out_bytes = out.size() * sizeof(float);
@@ -31,7 +30,7 @@
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
-  Eigen::TensorMap<Eigen::Tensor<float, 2> > gpu_out(d_out, 72,97);
+  Eigen::TensorMap<Eigen::Tensor<float, 2> > gpu_out(d_out, 72, 97);
 
   gpu_out.device(gpu_device) = gpu_out.random();
 
@@ -42,10 +41,8 @@
   // TODO: come up with a valid test of randomness
 }
 
-
-void test_gpu_random_normal()
-{
-  Tensor<float, 2> out(72,97);
+void test_gpu_random_normal() {
+  Tensor<float, 2> out(72, 97);
   out.setZero();
 
   std::size_t out_bytes = out.size() * sizeof(float);
@@ -56,7 +53,7 @@
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
-  Eigen::TensorMap<Eigen::Tensor<float, 2> > gpu_out(d_out, 72,97);
+  Eigen::TensorMap<Eigen::Tensor<float, 2> > gpu_out(d_out, 72, 97);
 
   Eigen::internal::NormalRandomGenerator<float> gen(true);
   gpu_out.device(gpu_device) = gpu_out.random(gen);
@@ -65,21 +62,18 @@
   assert(gpuStreamSynchronize(gpu_device.stream()) == gpuSuccess);
 }
 
-static void test_complex()
-{
+static void test_complex() {
   Tensor<std::complex<float>, 1> vec(6);
   vec.setRandom();
 
   // Fixme: we should check that the generated numbers follow a uniform
   // distribution instead.
   for (int i = 1; i < 6; ++i) {
-    VERIFY_IS_NOT_EQUAL(vec(i), vec(i-1));
+    VERIFY_IS_NOT_EQUAL(vec(i), vec(i - 1));
   }
 }
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_random_gpu)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_random_gpu) {
   CALL_SUBTEST(test_gpu_random_uniform());
   CALL_SUBTEST(test_gpu_random_normal());
   CALL_SUBTEST(test_complex());
diff --git a/unsupported/test/cxx11_tensor_random_sycl.cpp b/unsupported/test/cxx11_tensor_random_sycl.cpp
index dcdfdd3..0d29a5d 100644
--- a/unsupported/test/cxx11_tensor_random_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_random_sycl.cpp
@@ -20,9 +20,8 @@
 #include <unsupported/Eigen/CXX11/Tensor>
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_sycl_random_uniform(const Eigen::SyclDevice& sycl_device)
-{
-  Tensor<DataType, 2,DataLayout, IndexType> out(72,97);
+static void test_sycl_random_uniform(const Eigen::SyclDevice& sycl_device) {
+  Tensor<DataType, 2, DataLayout, IndexType> out(72, 97);
   out.setZero();
 
   std::size_t out_bytes = out.size() * sizeof(DataType);
@@ -32,11 +31,11 @@
 
   array<IndexType, 2> tensorRange = {{sizeDim0, sizeDim1}};
 
-  DataType* d_out  = static_cast<DataType*>(sycl_device.allocate(out_bytes));
+  DataType* d_out = static_cast<DataType*>(sycl_device.allocate(out_bytes));
   TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> gpu_out(d_out, tensorRange);
 
-  gpu_out.device(sycl_device)=gpu_out.random();
-  sycl_device.memcpyDeviceToHost(out.data(), d_out,out_bytes);
+  gpu_out.device(sycl_device) = gpu_out.random();
+  sycl_device.memcpyDeviceToHost(out.data(), d_out, out_bytes);
 
   // For now we just check the code doesn't crash.
   // TODO: come up with a valid test of randomness
@@ -44,9 +43,8 @@
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-void test_sycl_random_normal(const Eigen::SyclDevice& sycl_device)
-{
-  Tensor<DataType, 2,DataLayout,IndexType> out(72,97);
+void test_sycl_random_normal(const Eigen::SyclDevice& sycl_device) {
+  Tensor<DataType, 2, DataLayout, IndexType> out(72, 97);
   out.setZero();
   std::size_t out_bytes = out.size() * sizeof(DataType);
 
@@ -55,29 +53,28 @@
 
   array<IndexType, 2> tensorRange = {{sizeDim0, sizeDim1}};
 
-  DataType* d_out  = static_cast<DataType*>(sycl_device.allocate(out_bytes));
+  DataType* d_out = static_cast<DataType*>(sycl_device.allocate(out_bytes));
   TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> gpu_out(d_out, tensorRange);
   Eigen::internal::NormalRandomGenerator<DataType> gen(true);
-  gpu_out.device(sycl_device)=gpu_out.random(gen);
-  sycl_device.memcpyDeviceToHost(out.data(), d_out,out_bytes);
+  gpu_out.device(sycl_device) = gpu_out.random(gen);
+  sycl_device.memcpyDeviceToHost(out.data(), d_out, out_bytes);
 
   // For now we just check the code doesn't crash.
   // TODO: come up with a valid test of randomness
   sycl_device.deallocate(d_out);
 }
 
-template<typename DataType, typename dev_Selector> void sycl_random_test_per_device(dev_Selector s){
+template <typename DataType, typename dev_Selector>
+void sycl_random_test_per_device(dev_Selector s) {
   QueueInterface queueInterface(s);
   auto sycl_device = Eigen::SyclDevice(&queueInterface);
   test_sycl_random_uniform<DataType, RowMajor, int64_t>(sycl_device);
   test_sycl_random_uniform<DataType, ColMajor, int64_t>(sycl_device);
   test_sycl_random_normal<DataType, RowMajor, int64_t>(sycl_device);
   test_sycl_random_normal<DataType, ColMajor, int64_t>(sycl_device);
-
 }
-EIGEN_DECLARE_TEST(cxx11_tensor_random_sycl)
-{
-  for (const auto& device :Eigen::get_sycl_supported_devices()) {
+EIGEN_DECLARE_TEST(cxx11_tensor_random_sycl) {
+  for (const auto& device : Eigen::get_sycl_supported_devices()) {
     CALL_SUBTEST(sycl_random_test_per_device<half>(device));
     CALL_SUBTEST(sycl_random_test_per_device<float>(device));
 #ifdef EIGEN_SYCL_DOUBLE_SUPPORT
diff --git a/unsupported/test/cxx11_tensor_reduction.cpp b/unsupported/test/cxx11_tensor_reduction.cpp
index 071046a..ab497c4 100644
--- a/unsupported/test/cxx11_tensor_reduction.cpp
+++ b/unsupported/test/cxx11_tensor_reduction.cpp
@@ -53,7 +53,7 @@
   }
 }
 
-template <typename Scalar,int DataLayout>
+template <typename Scalar, int DataLayout>
 static void test_simple_reductions() {
   Tensor<Scalar, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
@@ -227,13 +227,13 @@
     Tensor<int, 1> ints(10);
     std::iota(ints.data(), ints.data() + ints.dimension(0), 0);
 
-    TensorFixedSize<bool, Sizes<> > all_;
+    TensorFixedSize<bool, Sizes<>> all_;
     all_ = ints.all();
     VERIFY(!all_());
     all_ = (ints >= ints.constant(0)).all();
     VERIFY(all_());
 
-    TensorFixedSize<bool, Sizes<> > any;
+    TensorFixedSize<bool, Sizes<>> any;
     any = (ints > ints.constant(10)).any();
     VERIFY(!any());
     any = (ints < ints.constant(1)).any();
@@ -241,7 +241,6 @@
   }
 }
 
-
 template <int DataLayout>
 static void test_reductions_in_expr() {
   Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
@@ -267,7 +266,6 @@
   }
 }
 
-
 template <int DataLayout>
 static void test_full_reductions() {
   Tensor<float, 2, DataLayout> tensor(2, 3);
@@ -333,11 +331,9 @@
 template <int DataLayout>
 static void test_tensor_maps() {
   int inputs[2 * 3 * 5 * 7];
-  TensorMap<Tensor<int, 4, DataLayout> > tensor_map(inputs, 2, 3, 5, 7);
-  TensorMap<Tensor<const int, 4, DataLayout> > tensor_map_const(inputs, 2, 3, 5,
-                                                                7);
-  const TensorMap<Tensor<const int, 4, DataLayout> > tensor_map_const_const(
-      inputs, 2, 3, 5, 7);
+  TensorMap<Tensor<int, 4, DataLayout>> tensor_map(inputs, 2, 3, 5, 7);
+  TensorMap<Tensor<const int, 4, DataLayout>> tensor_map_const(inputs, 2, 3, 5, 7);
+  const TensorMap<Tensor<const int, 4, DataLayout>> tensor_map_const_const(inputs, 2, 3, 5, 7);
 
   tensor_map.setRandom();
   array<ptrdiff_t, 2> reduction_axis;
@@ -346,8 +342,7 @@
 
   Tensor<int, 2, DataLayout> result = tensor_map.sum(reduction_axis);
   Tensor<int, 2, DataLayout> result2 = tensor_map_const.sum(reduction_axis);
-  Tensor<int, 2, DataLayout> result3 =
-      tensor_map_const_const.sum(reduction_axis);
+  Tensor<int, 2, DataLayout> result3 = tensor_map_const_const.sum(reduction_axis);
 
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 5; ++j) {
@@ -370,7 +365,7 @@
   Tensor<float, 2, DataLayout> out(72, 97);
   in.setRandom();
 
-  Eigen::IndexList<Eigen::type2index<1>, Eigen::type2index<3> > reduction_axis;
+  Eigen::IndexList<Eigen::type2index<1>, Eigen::type2index<3>> reduction_axis;
 
   out = in.maximum(reduction_axis);
 
@@ -393,9 +388,9 @@
   Tensor<float, 2, DataLayout> out(97, 113);
   in.setRandom();
 
-// Reduce on the innermost dimensions.
+  // Reduce on the innermost dimensions.
   // This triggers the use of packets for ColMajor.
-  Eigen::IndexList<Eigen::type2index<0>, Eigen::type2index<1> > reduction_axis;
+  Eigen::IndexList<Eigen::type2index<0>, Eigen::type2index<1>> reduction_axis;
 
   out = in.maximum(reduction_axis);
 
@@ -418,7 +413,7 @@
   Tensor<float, 2, DataLayout> out(72, 53);
   in.setRandom();
 
-// Reduce on the innermost dimensions.
+  // Reduce on the innermost dimensions.
   // This triggers the use of packets for RowMajor.
   Eigen::IndexList<Eigen::type2index<2>, Eigen::type2index<3>> reduction_axis;
 
@@ -443,7 +438,7 @@
   Tensor<float, 2, DataLayout> out(72, 53);
   in.setRandom();
 
-// Reduce on the innermost dimensions.
+  // Reduce on the innermost dimensions.
   // This triggers the use of packets for RowMajor.
   Eigen::IndexList<Eigen::type2index<1>, Eigen::type2index<2>> reduction_axis;
 
@@ -466,7 +461,8 @@
 void test_sum_accuracy() {
   Tensor<double, 1> double_tensor(num_elements);
   Tensor<ScalarType, 1> tensor(num_elements);
-  for (double prescribed_mean = 0; prescribed_mean <= max_mean; prescribed_mean = numext::maxi(1.0, prescribed_mean*3.99)) {
+  for (double prescribed_mean = 0; prescribed_mean <= max_mean;
+       prescribed_mean = numext::maxi(1.0, prescribed_mean * 3.99)) {
     // FIXME: NormalRandomGenerator doesn't work in bfloat and half.
     double_tensor.setRandom<Eigen::internal::NormalRandomGenerator<double>>();
     double_tensor += double_tensor.constant(prescribed_mean);
@@ -485,7 +481,8 @@
     // Test against probabilistic forward error bound. In reality, the error is much smaller
     // when we use tree summation.
     double err = Eigen::numext::abs(static_cast<double>(sum()) - expected_sum);
-    double tol = numext::sqrt(static_cast<double>(num_elements)) * static_cast<double>(NumTraits<ScalarType>::epsilon()) * abs_sum;
+    double tol = numext::sqrt(static_cast<double>(num_elements)) *
+                 static_cast<double>(NumTraits<ScalarType>::epsilon()) * abs_sum;
     VERIFY_LE(err, tol);
   }
 }
@@ -493,10 +490,10 @@
 EIGEN_DECLARE_TEST(cxx11_tensor_reduction) {
   CALL_SUBTEST(test_trivial_reductions<ColMajor>());
   CALL_SUBTEST(test_trivial_reductions<RowMajor>());
-  CALL_SUBTEST(( test_simple_reductions<float,ColMajor>() ));
-  CALL_SUBTEST(( test_simple_reductions<float,RowMajor>() ));
-  CALL_SUBTEST(( test_simple_reductions<Eigen::half,ColMajor>() ));
-  CALL_SUBTEST(( test_simple_reductions<Eigen::bfloat16,ColMajor>() ));
+  CALL_SUBTEST((test_simple_reductions<float, ColMajor>()));
+  CALL_SUBTEST((test_simple_reductions<float, RowMajor>()));
+  CALL_SUBTEST((test_simple_reductions<Eigen::half, ColMajor>()));
+  CALL_SUBTEST((test_simple_reductions<Eigen::bfloat16, ColMajor>()));
   CALL_SUBTEST(test_reductions_in_expr<ColMajor>());
   CALL_SUBTEST(test_reductions_in_expr<RowMajor>());
   CALL_SUBTEST(test_full_reductions<ColMajor>());
@@ -513,11 +510,11 @@
   CALL_SUBTEST(test_innermost_first_dims<RowMajor>());
   CALL_SUBTEST(test_reduce_middle_dims<ColMajor>());
   CALL_SUBTEST(test_reduce_middle_dims<RowMajor>());
-  CALL_SUBTEST((test_sum_accuracy<float,10*1024*1024,8*1024>()));
-  CALL_SUBTEST((test_sum_accuracy<Eigen::bfloat16,10*1024*1024,8*1024>()));
+  CALL_SUBTEST((test_sum_accuracy<float, 10 * 1024 * 1024, 8 * 1024>()));
+  CALL_SUBTEST((test_sum_accuracy<Eigen::bfloat16, 10 * 1024 * 1024, 8 * 1024>()));
   // The range of half is limited to 65519 when using round-to-even,
   // so we are severely limited in the size and mean of the tensors
   // we can reduce without overflow.
-  CALL_SUBTEST((test_sum_accuracy<Eigen::half,4*1024,16>()));
-  CALL_SUBTEST((test_sum_accuracy<Eigen::half,10*1024*1024,0>()));
+  CALL_SUBTEST((test_sum_accuracy<Eigen::half, 4 * 1024, 16>()));
+  CALL_SUBTEST((test_sum_accuracy<Eigen::half, 10 * 1024 * 1024, 0>()));
 }
diff --git a/unsupported/test/cxx11_tensor_reduction_gpu.cu b/unsupported/test/cxx11_tensor_reduction_gpu.cu
index 122ac94..24cc5be 100644
--- a/unsupported/test/cxx11_tensor_reduction_gpu.cu
+++ b/unsupported/test/cxx11_tensor_reduction_gpu.cu
@@ -15,15 +15,13 @@
 #include "main.h"
 #include <unsupported/Eigen/CXX11/Tensor>
 
-
-template<typename Type, int DataLayout>
+template <typename Type, int DataLayout>
 static void test_full_reductions() {
-
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
-  const int num_rows = internal::random<int>(1024, 5*1024);
-  const int num_cols = internal::random<int>(1024, 5*1024);
+  const int num_rows = internal::random<int>(1024, 5 * 1024);
+  const int num_cols = internal::random<int>(1024, 5 * 1024);
 
   Tensor<Type, 2, DataLayout> in(num_rows, num_cols);
   in.setRandom();
@@ -53,7 +51,7 @@
   gpu_device.deallocate(gpu_out_ptr);
 }
 
-template<typename Type, int DataLayout>
+template <typename Type, int DataLayout>
 static void test_first_dim_reductions() {
   int dim_x = 33;
   int dim_y = 1;
@@ -69,31 +67,31 @@
   // Create device
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice dev(&stream);
-  
+
   // Create data(T)
-  Type* in_data = (Type*)dev.allocate(dim_x*dim_y*dim_z*sizeof(Type));
-  Type* out_data = (Type*)dev.allocate(dim_z*dim_y*sizeof(Type));
+  Type* in_data = (Type*)dev.allocate(dim_x * dim_y * dim_z * sizeof(Type));
+  Type* out_data = (Type*)dev.allocate(dim_z * dim_y * sizeof(Type));
   Eigen::TensorMap<Eigen::Tensor<Type, 3, DataLayout> > gpu_in(in_data, dim_x, dim_y, dim_z);
   Eigen::TensorMap<Eigen::Tensor<Type, 2, DataLayout> > gpu_out(out_data, dim_y, dim_z);
-  
+
   // Perform operation
-  dev.memcpyHostToDevice(in_data, in.data(), in.size()*sizeof(Type));
+  dev.memcpyHostToDevice(in_data, in.data(), in.size() * sizeof(Type));
   gpu_out.device(dev) = gpu_in.sum(red_axis);
   gpu_out.device(dev) += gpu_in.sum(red_axis);
   Tensor<Type, 2, DataLayout> redux_gpu(dim_y, dim_z);
-  dev.memcpyDeviceToHost(redux_gpu.data(), out_data, gpu_out.size()*sizeof(Type));
+  dev.memcpyDeviceToHost(redux_gpu.data(), out_data, gpu_out.size() * sizeof(Type));
   dev.synchronize();
 
   // Check that the CPU and GPU reductions return the same result.
   for (int i = 0; i < gpu_out.size(); ++i) {
-    VERIFY_IS_APPROX(2*redux(i), redux_gpu(i));
+    VERIFY_IS_APPROX(2 * redux(i), redux_gpu(i));
   }
 
   dev.deallocate(in_data);
   dev.deallocate(out_data);
 }
 
-template<typename Type, int DataLayout>
+template <typename Type, int DataLayout>
 static void test_last_dim_reductions() {
   int dim_x = 128;
   int dim_y = 1;
@@ -109,46 +107,45 @@
   // Create device
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice dev(&stream);
-  
+
   // Create data
-  Type* in_data = (Type*)dev.allocate(dim_x*dim_y*dim_z*sizeof(Type));
-  Type* out_data = (Type*)dev.allocate(dim_x*dim_y*sizeof(Type));
+  Type* in_data = (Type*)dev.allocate(dim_x * dim_y * dim_z * sizeof(Type));
+  Type* out_data = (Type*)dev.allocate(dim_x * dim_y * sizeof(Type));
   Eigen::TensorMap<Eigen::Tensor<Type, 3, DataLayout> > gpu_in(in_data, dim_x, dim_y, dim_z);
   Eigen::TensorMap<Eigen::Tensor<Type, 2, DataLayout> > gpu_out(out_data, dim_x, dim_y);
-  
+
   // Perform operation
-  dev.memcpyHostToDevice(in_data, in.data(), in.size()*sizeof(Type));
+  dev.memcpyHostToDevice(in_data, in.data(), in.size() * sizeof(Type));
   gpu_out.device(dev) = gpu_in.sum(red_axis);
   gpu_out.device(dev) += gpu_in.sum(red_axis);
   Tensor<Type, 2, DataLayout> redux_gpu(dim_x, dim_y);
-  dev.memcpyDeviceToHost(redux_gpu.data(), out_data, gpu_out.size()*sizeof(Type));
+  dev.memcpyDeviceToHost(redux_gpu.data(), out_data, gpu_out.size() * sizeof(Type));
   dev.synchronize();
 
   // Check that the CPU and GPU reductions return the same result.
   for (int i = 0; i < gpu_out.size(); ++i) {
-    VERIFY_IS_APPROX(2*redux(i), redux_gpu(i));
+    VERIFY_IS_APPROX(2 * redux(i), redux_gpu(i));
   }
 
   dev.deallocate(in_data);
   dev.deallocate(out_data);
 }
 
-
 EIGEN_DECLARE_TEST(cxx11_tensor_reduction_gpu) {
   CALL_SUBTEST_1((test_full_reductions<float, ColMajor>()));
   CALL_SUBTEST_1((test_full_reductions<double, ColMajor>()));
   CALL_SUBTEST_2((test_full_reductions<float, RowMajor>()));
   CALL_SUBTEST_2((test_full_reductions<double, RowMajor>()));
-  
+
   CALL_SUBTEST_3((test_first_dim_reductions<float, ColMajor>()));
   CALL_SUBTEST_3((test_first_dim_reductions<double, ColMajor>()));
   CALL_SUBTEST_4((test_first_dim_reductions<float, RowMajor>()));
-// Outer reductions of doubles aren't supported just yet.  					      
-//  CALL_SUBTEST_4((test_first_dim_reductions<double, RowMajor>()))
+  // Outer reductions of doubles aren't supported just yet.
+  //  CALL_SUBTEST_4((test_first_dim_reductions<double, RowMajor>()))
 
   CALL_SUBTEST_5((test_last_dim_reductions<float, ColMajor>()));
-// Outer reductions of doubles aren't supported just yet.  					      
-//  CALL_SUBTEST_5((test_last_dim_reductions<double, ColMajor>()));
+  // Outer reductions of doubles aren't supported just yet.
+  //  CALL_SUBTEST_5((test_last_dim_reductions<double, ColMajor>()));
   CALL_SUBTEST_6((test_last_dim_reductions<float, RowMajor>()));
   CALL_SUBTEST_6((test_last_dim_reductions<double, RowMajor>()));
 }
diff --git a/unsupported/test/cxx11_tensor_reduction_sycl.cpp b/unsupported/test/cxx11_tensor_reduction_sycl.cpp
index 3afa62a..9276953 100644
--- a/unsupported/test/cxx11_tensor_reduction_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_reduction_sycl.cpp
@@ -22,8 +22,7 @@
 #include <unsupported/Eigen/CXX11/Tensor>
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_full_reductions_sum_sycl(
-    const Eigen::SyclDevice& sycl_device) {
+static void test_full_reductions_sum_sycl(const Eigen::SyclDevice& sycl_device) {
   const IndexType num_rows = 753;
   const IndexType num_cols = 537;
   array<IndexType, 2> tensorRange = {{num_rows, num_cols}};
@@ -38,32 +37,25 @@
   auto dim = DSizes<IndexType, 2>(1, 1);
   full_redux = in.sum().reshape(dim);
 
-  DataType* gpu_in_data = static_cast<DataType*>(
-      sycl_device.allocate(in.dimensions().TotalSize() * sizeof(DataType)));
-  DataType* gpu_out_data = (DataType*)sycl_device.allocate(
-      sizeof(DataType) * (full_redux_gpu.dimensions().TotalSize()));
+  DataType* gpu_in_data = static_cast<DataType*>(sycl_device.allocate(in.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_out_data =
+      (DataType*)sycl_device.allocate(sizeof(DataType) * (full_redux_gpu.dimensions().TotalSize()));
 
-  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> in_gpu(gpu_in_data,
-                                                               tensorRange);
-  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> out_gpu(gpu_out_data,
-                                                                outRange);
-  sycl_device.memcpyHostToDevice(
-      gpu_in_data, in.data(), (in.dimensions().TotalSize()) * sizeof(DataType));
+  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> in_gpu(gpu_in_data, tensorRange);
+  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> out_gpu(gpu_out_data, outRange);
+  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(), (in.dimensions().TotalSize()) * sizeof(DataType));
   out_gpu.device(sycl_device) = in_gpu.sum().reshape(dim);
-  sycl_device.memcpyDeviceToHost(
-      full_redux_gpu.data(), gpu_out_data,
-      (full_redux_gpu.dimensions().TotalSize()) * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(full_redux_gpu.data(), gpu_out_data,
+                                 (full_redux_gpu.dimensions().TotalSize()) * sizeof(DataType));
   // Check that the CPU and GPU reductions return the same result.
-  std::cout << "SYCL FULL :" << full_redux_gpu(0, 0)
-            << ", CPU FULL: " << full_redux(0, 0) << "\n";
+  std::cout << "SYCL FULL :" << full_redux_gpu(0, 0) << ", CPU FULL: " << full_redux(0, 0) << "\n";
   VERIFY_IS_APPROX(full_redux_gpu(0, 0), full_redux(0, 0));
   sycl_device.deallocate(gpu_in_data);
   sycl_device.deallocate(gpu_out_data);
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_full_reductions_sum_with_offset_sycl(
-    const Eigen::SyclDevice& sycl_device) {
+static void test_full_reductions_sum_with_offset_sycl(const Eigen::SyclDevice& sycl_device) {
   using data_tensor = Tensor<DataType, 2, DataLayout, IndexType>;
   using scalar_tensor = Tensor<DataType, 0, DataLayout, IndexType>;
   const IndexType num_rows = 64;
@@ -83,18 +75,14 @@
   TensorMap<data_tensor> in_offset(in.data() + offset, tensor_offset_range);
   full_redux = in_offset.sum();
 
-  DataType* gpu_in_data =
-      static_cast<DataType*>(sycl_device.allocate(n_elems * sizeof(DataType)));
-  DataType* gpu_out_data =
-      static_cast<DataType*>(sycl_device.allocate(sizeof(DataType)));
+  DataType* gpu_in_data = static_cast<DataType*>(sycl_device.allocate(n_elems * sizeof(DataType)));
+  DataType* gpu_out_data = static_cast<DataType*>(sycl_device.allocate(sizeof(DataType)));
 
   TensorMap<data_tensor> in_gpu(gpu_in_data + offset, tensor_offset_range);
   TensorMap<scalar_tensor> out_gpu(gpu_out_data);
-  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(),
-                                 n_elems * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(), n_elems * sizeof(DataType));
   out_gpu.device(sycl_device) = in_gpu.sum();
-  sycl_device.memcpyDeviceToHost(full_redux_gpu.data(), gpu_out_data,
-                                 sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(full_redux_gpu.data(), gpu_out_data, sizeof(DataType));
 
   // Check that the CPU and GPU reductions return the same result.
   VERIFY_IS_APPROX(full_redux_gpu(), full_redux());
@@ -104,8 +92,7 @@
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_full_reductions_max_sycl(
-    const Eigen::SyclDevice& sycl_device) {
+static void test_full_reductions_max_sycl(const Eigen::SyclDevice& sycl_device) {
   const IndexType num_rows = 4096;
   const IndexType num_cols = 4096;
   array<IndexType, 2> tensorRange = {{num_rows, num_cols}};
@@ -118,26 +105,21 @@
 
   full_redux = in.maximum();
 
-  DataType* gpu_in_data = static_cast<DataType*>(
-      sycl_device.allocate(in.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_in_data = static_cast<DataType*>(sycl_device.allocate(in.dimensions().TotalSize() * sizeof(DataType)));
   DataType* gpu_out_data = (DataType*)sycl_device.allocate(sizeof(DataType));
 
-  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> in_gpu(gpu_in_data,
-                                                               tensorRange);
+  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> in_gpu(gpu_in_data, tensorRange);
   TensorMap<Tensor<DataType, 0, DataLayout, IndexType>> out_gpu(gpu_out_data);
-  sycl_device.memcpyHostToDevice(
-      gpu_in_data, in.data(), (in.dimensions().TotalSize()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(), (in.dimensions().TotalSize()) * sizeof(DataType));
   out_gpu.device(sycl_device) = in_gpu.maximum();
-  sycl_device.memcpyDeviceToHost(full_redux_gpu.data(), gpu_out_data,
-                                 sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(full_redux_gpu.data(), gpu_out_data, sizeof(DataType));
   VERIFY_IS_APPROX(full_redux_gpu(), full_redux());
   sycl_device.deallocate(gpu_in_data);
   sycl_device.deallocate(gpu_out_data);
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_full_reductions_max_with_offset_sycl(
-    const Eigen::SyclDevice& sycl_device) {
+static void test_full_reductions_max_with_offset_sycl(const Eigen::SyclDevice& sycl_device) {
   using data_tensor = Tensor<DataType, 2, DataLayout, IndexType>;
   using scalar_tensor = Tensor<DataType, 0, DataLayout, IndexType>;
   const IndexType num_rows = 64;
@@ -161,18 +143,14 @@
   full_redux = in_offset.maximum();
   VERIFY_IS_NOT_EQUAL(full_redux(), in(0));
 
-  DataType* gpu_in_data =
-      static_cast<DataType*>(sycl_device.allocate(n_elems * sizeof(DataType)));
-  DataType* gpu_out_data =
-      static_cast<DataType*>(sycl_device.allocate(sizeof(DataType)));
+  DataType* gpu_in_data = static_cast<DataType*>(sycl_device.allocate(n_elems * sizeof(DataType)));
+  DataType* gpu_out_data = static_cast<DataType*>(sycl_device.allocate(sizeof(DataType)));
 
   TensorMap<data_tensor> in_gpu(gpu_in_data + offset, tensor_offset_range);
   TensorMap<scalar_tensor> out_gpu(gpu_out_data);
-  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(),
-                                 n_elems * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(), n_elems * sizeof(DataType));
   out_gpu.device(sycl_device) = in_gpu.maximum();
-  sycl_device.memcpyDeviceToHost(full_redux_gpu.data(), gpu_out_data,
-                                 sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(full_redux_gpu.data(), gpu_out_data, sizeof(DataType));
 
   // Check that the CPU and GPU reductions return the same result.
   VERIFY_IS_APPROX(full_redux_gpu(), full_redux());
@@ -182,8 +160,7 @@
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_full_reductions_mean_sycl(
-    const Eigen::SyclDevice& sycl_device) {
+static void test_full_reductions_mean_sycl(const Eigen::SyclDevice& sycl_device) {
   const IndexType num_rows = 4096;
   const IndexType num_cols = 4096;
   array<IndexType, 2> tensorRange = {{num_rows, num_cols}};
@@ -204,61 +181,44 @@
   in_arg1.setRandom();
   in_arg2.setRandom();
 
-  DataType* gpu_in_data = static_cast<DataType*>(
-      sycl_device.allocate(in.dimensions().TotalSize() * sizeof(DataType)));
-  DataType* gpu_in_arg1_data = static_cast<DataType*>(sycl_device.allocate(
-      in_arg1.dimensions().TotalSize() * sizeof(DataType)));
-  DataType* gpu_in_arg2_data = static_cast<DataType*>(sycl_device.allocate(
-      in_arg2.dimensions().TotalSize() * sizeof(DataType)));
-  bool* gpu_out_arg__gpu_helper_data = static_cast<bool*>(sycl_device.allocate(
-      out_arg_gpu.dimensions().TotalSize() * sizeof(DataType)));
-  bool* gpu_out_arg_data = static_cast<bool*>(sycl_device.allocate(
-      out_arg_gpu.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_in_data = static_cast<DataType*>(sycl_device.allocate(in.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_in_arg1_data =
+      static_cast<DataType*>(sycl_device.allocate(in_arg1.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_in_arg2_data =
+      static_cast<DataType*>(sycl_device.allocate(in_arg2.dimensions().TotalSize() * sizeof(DataType)));
+  bool* gpu_out_arg__gpu_helper_data =
+      static_cast<bool*>(sycl_device.allocate(out_arg_gpu.dimensions().TotalSize() * sizeof(DataType)));
+  bool* gpu_out_arg_data =
+      static_cast<bool*>(sycl_device.allocate(out_arg_gpu.dimensions().TotalSize() * sizeof(DataType)));
 
   DataType* gpu_out_data = (DataType*)sycl_device.allocate(sizeof(DataType));
 
-  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> in_gpu(gpu_in_data,
-                                                               tensorRange);
-  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> in_Arg1_gpu(
-      gpu_in_arg1_data, tensorRange);
-  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> in_Arg2_gpu(
-      gpu_in_arg2_data, tensorRange);
-  TensorMap<Tensor<bool, 1, DataLayout, IndexType>> out_Argout_gpu(
-      gpu_out_arg_data, argRange);
-  TensorMap<Tensor<bool, 1, DataLayout, IndexType>> out_Argout_gpu_helper(
-      gpu_out_arg__gpu_helper_data, argRange);
+  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> in_gpu(gpu_in_data, tensorRange);
+  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> in_Arg1_gpu(gpu_in_arg1_data, tensorRange);
+  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> in_Arg2_gpu(gpu_in_arg2_data, tensorRange);
+  TensorMap<Tensor<bool, 1, DataLayout, IndexType>> out_Argout_gpu(gpu_out_arg_data, argRange);
+  TensorMap<Tensor<bool, 1, DataLayout, IndexType>> out_Argout_gpu_helper(gpu_out_arg__gpu_helper_data, argRange);
   TensorMap<Tensor<DataType, 0, DataLayout, IndexType>> out_gpu(gpu_out_data);
 
   // CPU VERSION
   out_arg_cpu =
-      (in_arg1.argmax(1) == in_arg2.argmax(1))
-          .select(out_arg_cpu.constant(true), out_arg_cpu.constant(false));
-  full_redux = (out_arg_cpu.template cast<float>())
-                   .reduce(red_axis, Eigen::internal::MeanReducer<DataType>());
+      (in_arg1.argmax(1) == in_arg2.argmax(1)).select(out_arg_cpu.constant(true), out_arg_cpu.constant(false));
+  full_redux = (out_arg_cpu.template cast<float>()).reduce(red_axis, Eigen::internal::MeanReducer<DataType>());
 
   // GPU VERSION
-  sycl_device.memcpyHostToDevice(
-      gpu_in_data, in.data(), (in.dimensions().TotalSize()) * sizeof(DataType));
-  sycl_device.memcpyHostToDevice(
-      gpu_in_arg1_data, in_arg1.data(),
-      (in_arg1.dimensions().TotalSize()) * sizeof(DataType));
-  sycl_device.memcpyHostToDevice(
-      gpu_in_arg2_data, in_arg2.data(),
-      (in_arg2.dimensions().TotalSize()) * sizeof(DataType));
-  out_Argout_gpu_helper.device(sycl_device) =
-      (in_Arg1_gpu.argmax(1) == in_Arg2_gpu.argmax(1));
+  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(), (in.dimensions().TotalSize()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in_arg1_data, in_arg1.data(),
+                                 (in_arg1.dimensions().TotalSize()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in_arg2_data, in_arg2.data(),
+                                 (in_arg2.dimensions().TotalSize()) * sizeof(DataType));
+  out_Argout_gpu_helper.device(sycl_device) = (in_Arg1_gpu.argmax(1) == in_Arg2_gpu.argmax(1));
   out_Argout_gpu.device(sycl_device) =
-      (out_Argout_gpu_helper)
-          .select(out_Argout_gpu.constant(true),
-                  out_Argout_gpu.constant(false));
+      (out_Argout_gpu_helper).select(out_Argout_gpu.constant(true), out_Argout_gpu.constant(false));
   out_gpu.device(sycl_device) =
-      (out_Argout_gpu.template cast<float>())
-          .reduce(red_axis, Eigen::internal::MeanReducer<DataType>());
-  sycl_device.memcpyDeviceToHost(full_redux_gpu.data(), gpu_out_data,
-                                 sizeof(DataType));
+      (out_Argout_gpu.template cast<float>()).reduce(red_axis, Eigen::internal::MeanReducer<DataType>());
+  sycl_device.memcpyDeviceToHost(full_redux_gpu.data(), gpu_out_data, sizeof(DataType));
   // Check that the CPU and GPU reductions return the same result.
-  std::cout << "SYCL : " << full_redux_gpu() << " , CPU : " << full_redux()
-            << '\n';
+  std::cout << "SYCL : " << full_redux_gpu() << " , CPU : " << full_redux() << '\n';
   VERIFY_IS_EQUAL(full_redux_gpu(), full_redux());
   sycl_device.deallocate(gpu_in_data);
   sycl_device.deallocate(gpu_in_arg1_data);
@@ -269,8 +229,7 @@
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_full_reductions_mean_with_offset_sycl(
-    const Eigen::SyclDevice& sycl_device) {
+static void test_full_reductions_mean_with_offset_sycl(const Eigen::SyclDevice& sycl_device) {
   using data_tensor = Tensor<DataType, 2, DataLayout, IndexType>;
   using scalar_tensor = Tensor<DataType, 0, DataLayout, IndexType>;
   const IndexType num_rows = 64;
@@ -291,18 +250,14 @@
   full_redux = in_offset.mean();
   VERIFY_IS_NOT_EQUAL(full_redux(), in(0));
 
-  DataType* gpu_in_data =
-      static_cast<DataType*>(sycl_device.allocate(n_elems * sizeof(DataType)));
-  DataType* gpu_out_data =
-      static_cast<DataType*>(sycl_device.allocate(sizeof(DataType)));
+  DataType* gpu_in_data = static_cast<DataType*>(sycl_device.allocate(n_elems * sizeof(DataType)));
+  DataType* gpu_out_data = static_cast<DataType*>(sycl_device.allocate(sizeof(DataType)));
 
   TensorMap<data_tensor> in_gpu(gpu_in_data + offset, tensor_offset_range);
   TensorMap<scalar_tensor> out_gpu(gpu_out_data);
-  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(),
-                                 n_elems * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(), n_elems * sizeof(DataType));
   out_gpu.device(sycl_device) = in_gpu.mean();
-  sycl_device.memcpyDeviceToHost(full_redux_gpu.data(), gpu_out_data,
-                                 sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(full_redux_gpu.data(), gpu_out_data, sizeof(DataType));
 
   // Check that the CPU and GPU reductions return the same result.
   VERIFY_IS_APPROX(full_redux_gpu(), full_redux());
@@ -312,8 +267,7 @@
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_full_reductions_mean_with_odd_offset_sycl(
-    const Eigen::SyclDevice& sycl_device) {
+static void test_full_reductions_mean_with_odd_offset_sycl(const Eigen::SyclDevice& sycl_device) {
   // This is a particular case which illustrates a possible problem when the
   // number of local threads in a workgroup is even, but is not a power of two.
   using data_tensor = Tensor<DataType, 1, DataLayout, IndexType>;
@@ -336,19 +290,14 @@
   red_cpu = in.reduce(red_axis, Eigen::internal::MeanReducer<DataType>());
   VERIFY_IS_APPROX(const_val, red_cpu());
 
-  DataType* gpu_in_data =
-      static_cast<DataType*>(sycl_device.allocate(n_elems * sizeof(DataType)));
-  DataType* gpu_out_data =
-      static_cast<DataType*>(sycl_device.allocate(sizeof(DataType)));
+  DataType* gpu_in_data = static_cast<DataType*>(sycl_device.allocate(n_elems * sizeof(DataType)));
+  DataType* gpu_out_data = static_cast<DataType*>(sycl_device.allocate(sizeof(DataType)));
 
   TensorMap<data_tensor> in_gpu(gpu_in_data, tensor_range);
   TensorMap<scalar_tensor> out_gpu(gpu_out_data);
-  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(),
-                                 n_elems * sizeof(DataType));
-  out_gpu.device(sycl_device) =
-      in_gpu.reduce(red_axis, Eigen::internal::MeanReducer<DataType>());
-  sycl_device.memcpyDeviceToHost(red_gpu.data(), gpu_out_data,
-                                 sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(), n_elems * sizeof(DataType));
+  out_gpu.device(sycl_device) = in_gpu.reduce(red_axis, Eigen::internal::MeanReducer<DataType>());
+  sycl_device.memcpyDeviceToHost(red_gpu.data(), gpu_out_data, sizeof(DataType));
 
   // Check that the CPU and GPU reductions return the same result.
   VERIFY_IS_APPROX(full_redux_gpu, full_redux);
@@ -358,8 +307,7 @@
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_full_reductions_min_sycl(
-    const Eigen::SyclDevice& sycl_device) {
+static void test_full_reductions_min_sycl(const Eigen::SyclDevice& sycl_device) {
   const IndexType num_rows = 876;
   const IndexType num_cols = 953;
   array<IndexType, 2> tensorRange = {{num_rows, num_cols}};
@@ -372,19 +320,15 @@
 
   full_redux = in.minimum();
 
-  DataType* gpu_in_data = static_cast<DataType*>(
-      sycl_device.allocate(in.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_in_data = static_cast<DataType*>(sycl_device.allocate(in.dimensions().TotalSize() * sizeof(DataType)));
   DataType* gpu_out_data = (DataType*)sycl_device.allocate(sizeof(DataType));
 
-  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> in_gpu(gpu_in_data,
-                                                               tensorRange);
+  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> in_gpu(gpu_in_data, tensorRange);
   TensorMap<Tensor<DataType, 0, DataLayout, IndexType>> out_gpu(gpu_out_data);
 
-  sycl_device.memcpyHostToDevice(
-      gpu_in_data, in.data(), (in.dimensions().TotalSize()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(), (in.dimensions().TotalSize()) * sizeof(DataType));
   out_gpu.device(sycl_device) = in_gpu.minimum();
-  sycl_device.memcpyDeviceToHost(full_redux_gpu.data(), gpu_out_data,
-                                 sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(full_redux_gpu.data(), gpu_out_data, sizeof(DataType));
   // Check that the CPU and GPU reductions return the same result.
   VERIFY_IS_APPROX(full_redux_gpu(), full_redux());
   sycl_device.deallocate(gpu_in_data);
@@ -392,8 +336,7 @@
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_full_reductions_min_with_offset_sycl(
-    const Eigen::SyclDevice& sycl_device) {
+static void test_full_reductions_min_with_offset_sycl(const Eigen::SyclDevice& sycl_device) {
   using data_tensor = Tensor<DataType, 2, DataLayout, IndexType>;
   using scalar_tensor = Tensor<DataType, 0, DataLayout, IndexType>;
   const IndexType num_rows = 64;
@@ -417,18 +360,14 @@
   full_redux = in_offset.minimum();
   VERIFY_IS_NOT_EQUAL(full_redux(), in(0));
 
-  DataType* gpu_in_data =
-      static_cast<DataType*>(sycl_device.allocate(n_elems * sizeof(DataType)));
-  DataType* gpu_out_data =
-      static_cast<DataType*>(sycl_device.allocate(sizeof(DataType)));
+  DataType* gpu_in_data = static_cast<DataType*>(sycl_device.allocate(n_elems * sizeof(DataType)));
+  DataType* gpu_out_data = static_cast<DataType*>(sycl_device.allocate(sizeof(DataType)));
 
   TensorMap<data_tensor> in_gpu(gpu_in_data + offset, tensor_offset_range);
   TensorMap<scalar_tensor> out_gpu(gpu_out_data);
-  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(),
-                                 n_elems * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(), n_elems * sizeof(DataType));
   out_gpu.device(sycl_device) = in_gpu.minimum();
-  sycl_device.memcpyDeviceToHost(full_redux_gpu.data(), gpu_out_data,
-                                 sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(full_redux_gpu.data(), gpu_out_data, sizeof(DataType));
 
   // Check that the CPU and GPU reductions return the same result.
   VERIFY_IS_APPROX(full_redux_gpu(), full_redux());
@@ -437,8 +376,7 @@
   sycl_device.deallocate(gpu_out_data);
 }
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_first_dim_reductions_max_sycl(
-    const Eigen::SyclDevice& sycl_device) {
+static void test_first_dim_reductions_max_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType dim_x = 145;
   IndexType dim_y = 1;
   IndexType dim_z = 67;
@@ -456,35 +394,27 @@
 
   redux = in.maximum(red_axis);
 
-  DataType* gpu_in_data = static_cast<DataType*>(
-      sycl_device.allocate(in.dimensions().TotalSize() * sizeof(DataType)));
-  DataType* gpu_out_data = static_cast<DataType*>(sycl_device.allocate(
-      redux_gpu.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_in_data = static_cast<DataType*>(sycl_device.allocate(in.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_out_data =
+      static_cast<DataType*>(sycl_device.allocate(redux_gpu.dimensions().TotalSize() * sizeof(DataType)));
 
-  TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> in_gpu(gpu_in_data,
-                                                               tensorRange);
-  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> out_gpu(
-      gpu_out_data, reduced_tensorRange);
+  TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> in_gpu(gpu_in_data, tensorRange);
+  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> out_gpu(gpu_out_data, reduced_tensorRange);
 
-  sycl_device.memcpyHostToDevice(
-      gpu_in_data, in.data(), (in.dimensions().TotalSize()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(), (in.dimensions().TotalSize()) * sizeof(DataType));
   out_gpu.device(sycl_device) = in_gpu.maximum(red_axis);
-  sycl_device.memcpyDeviceToHost(
-      redux_gpu.data(), gpu_out_data,
-      redux_gpu.dimensions().TotalSize() * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(redux_gpu.data(), gpu_out_data, redux_gpu.dimensions().TotalSize() * sizeof(DataType));
 
   // Check that the CPU and GPU reductions return the same result.
   for (IndexType j = 0; j < reduced_tensorRange[0]; j++)
-    for (IndexType k = 0; k < reduced_tensorRange[1]; k++)
-      VERIFY_IS_APPROX(redux_gpu(j, k), redux(j, k));
+    for (IndexType k = 0; k < reduced_tensorRange[1]; k++) VERIFY_IS_APPROX(redux_gpu(j, k), redux(j, k));
 
   sycl_device.deallocate(gpu_in_data);
   sycl_device.deallocate(gpu_out_data);
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_first_dim_reductions_max_with_offset_sycl(
-    const Eigen::SyclDevice& sycl_device) {
+static void test_first_dim_reductions_max_with_offset_sycl(const Eigen::SyclDevice& sycl_device) {
   using data_tensor = Tensor<DataType, 2, DataLayout, IndexType>;
   using reduced_tensor = Tensor<DataType, 1, DataLayout, IndexType>;
 
@@ -517,18 +447,14 @@
     VERIFY_IS_NOT_EQUAL(redux(i), in(i));
   }
 
-  DataType* gpu_in_data =
-      static_cast<DataType*>(sycl_device.allocate(n_elems * sizeof(DataType)));
-  DataType* gpu_out_data = static_cast<DataType*>(
-      sycl_device.allocate(n_reduced * sizeof(DataType)));
+  DataType* gpu_in_data = static_cast<DataType*>(sycl_device.allocate(n_elems * sizeof(DataType)));
+  DataType* gpu_out_data = static_cast<DataType*>(sycl_device.allocate(n_reduced * sizeof(DataType)));
 
   TensorMap<data_tensor> in_gpu(gpu_in_data + offset, tensor_offset_range);
   TensorMap<reduced_tensor> out_gpu(gpu_out_data, reduced_range);
-  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(),
-                                 n_elems * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(), n_elems * sizeof(DataType));
   out_gpu.device(sycl_device) = in_gpu.maximum(red_axis);
-  sycl_device.memcpyDeviceToHost(redux_gpu.data(), gpu_out_data,
-                                 n_reduced * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(redux_gpu.data(), gpu_out_data, n_reduced * sizeof(DataType));
 
   // Check that the CPU and GPU reductions return the same result.
   for (IndexType i = 0; i < n_reduced; i++) {
@@ -540,8 +466,7 @@
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_last_dim_reductions_max_with_offset_sycl(
-    const Eigen::SyclDevice& sycl_device) {
+static void test_last_dim_reductions_max_with_offset_sycl(const Eigen::SyclDevice& sycl_device) {
   using data_tensor = Tensor<DataType, 2, DataLayout, IndexType>;
   using reduced_tensor = Tensor<DataType, 1, DataLayout, IndexType>;
 
@@ -582,18 +507,14 @@
     VERIFY_IS_NOT_EQUAL(red_offset(i), in(i));
   }
 
-  DataType* gpu_in_data =
-      static_cast<DataType*>(sycl_device.allocate(n_elems * sizeof(DataType)));
-  DataType* gpu_out_data = static_cast<DataType*>(
-      sycl_device.allocate((n_reduced + 1) * sizeof(DataType)));
+  DataType* gpu_in_data = static_cast<DataType*>(sycl_device.allocate(n_elems * sizeof(DataType)));
+  DataType* gpu_out_data = static_cast<DataType*>(sycl_device.allocate((n_reduced + 1) * sizeof(DataType)));
 
   TensorMap<data_tensor> in_gpu(gpu_in_data + offset, tensor_offset_range);
   TensorMap<reduced_tensor> out_gpu(gpu_out_data + 1, reduced_range);
-  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(),
-                                 n_elems * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(), n_elems * sizeof(DataType));
   out_gpu.device(sycl_device) = in_gpu.maximum(red_axis);
-  sycl_device.memcpyDeviceToHost(redux_gpu.data(), out_gpu.data(),
-                                 n_reduced * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(redux_gpu.data(), out_gpu.data(), n_reduced * sizeof(DataType));
 
   // Check that the CPU and GPU reductions return the same result.
   for (IndexType i = 0; i < n_reduced; i++) {
@@ -605,8 +526,7 @@
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_first_dim_reductions_sum_sycl(
-    const Eigen::SyclDevice& sycl_device, IndexType dim_x, IndexType dim_y) {
+static void test_first_dim_reductions_sum_sycl(const Eigen::SyclDevice& sycl_device, IndexType dim_x, IndexType dim_y) {
   array<IndexType, 2> tensorRange = {{dim_x, dim_y}};
   Eigen::array<IndexType, 1> red_axis;
   red_axis[0] = 0;
@@ -619,22 +539,16 @@
   in.setRandom();
   redux = in.sum(red_axis);
 
-  DataType* gpu_in_data = static_cast<DataType*>(
-      sycl_device.allocate(in.dimensions().TotalSize() * sizeof(DataType)));
-  DataType* gpu_out_data = static_cast<DataType*>(sycl_device.allocate(
-      redux_gpu.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_in_data = static_cast<DataType*>(sycl_device.allocate(in.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_out_data =
+      static_cast<DataType*>(sycl_device.allocate(redux_gpu.dimensions().TotalSize() * sizeof(DataType)));
 
-  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> in_gpu(gpu_in_data,
-                                                               tensorRange);
-  TensorMap<Tensor<DataType, 1, DataLayout, IndexType>> out_gpu(
-      gpu_out_data, reduced_tensorRange);
+  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> in_gpu(gpu_in_data, tensorRange);
+  TensorMap<Tensor<DataType, 1, DataLayout, IndexType>> out_gpu(gpu_out_data, reduced_tensorRange);
 
-  sycl_device.memcpyHostToDevice(
-      gpu_in_data, in.data(), (in.dimensions().TotalSize()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(), (in.dimensions().TotalSize()) * sizeof(DataType));
   out_gpu.device(sycl_device) = in_gpu.sum(red_axis);
-  sycl_device.memcpyDeviceToHost(
-      redux_gpu.data(), gpu_out_data,
-      redux_gpu.dimensions().TotalSize() * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(redux_gpu.data(), gpu_out_data, redux_gpu.dimensions().TotalSize() * sizeof(DataType));
 
   // Check that the CPU and GPU reductions return the same result.
   for (IndexType i = 0; i < redux.size(); i++) {
@@ -645,8 +559,7 @@
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_first_dim_reductions_mean_sycl(
-    const Eigen::SyclDevice& sycl_device) {
+static void test_first_dim_reductions_mean_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType dim_x = 145;
   IndexType dim_y = 1;
   IndexType dim_z = 67;
@@ -664,35 +577,27 @@
 
   redux = in.mean(red_axis);
 
-  DataType* gpu_in_data = static_cast<DataType*>(
-      sycl_device.allocate(in.dimensions().TotalSize() * sizeof(DataType)));
-  DataType* gpu_out_data = static_cast<DataType*>(sycl_device.allocate(
-      redux_gpu.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_in_data = static_cast<DataType*>(sycl_device.allocate(in.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_out_data =
+      static_cast<DataType*>(sycl_device.allocate(redux_gpu.dimensions().TotalSize() * sizeof(DataType)));
 
-  TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> in_gpu(gpu_in_data,
-                                                               tensorRange);
-  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> out_gpu(
-      gpu_out_data, reduced_tensorRange);
+  TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> in_gpu(gpu_in_data, tensorRange);
+  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> out_gpu(gpu_out_data, reduced_tensorRange);
 
-  sycl_device.memcpyHostToDevice(
-      gpu_in_data, in.data(), (in.dimensions().TotalSize()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(), (in.dimensions().TotalSize()) * sizeof(DataType));
   out_gpu.device(sycl_device) = in_gpu.mean(red_axis);
-  sycl_device.memcpyDeviceToHost(
-      redux_gpu.data(), gpu_out_data,
-      redux_gpu.dimensions().TotalSize() * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(redux_gpu.data(), gpu_out_data, redux_gpu.dimensions().TotalSize() * sizeof(DataType));
 
   // Check that the CPU and GPU reductions return the same result.
   for (IndexType j = 0; j < reduced_tensorRange[0]; j++)
-    for (IndexType k = 0; k < reduced_tensorRange[1]; k++)
-      VERIFY_IS_APPROX(redux_gpu(j, k), redux(j, k));
+    for (IndexType k = 0; k < reduced_tensorRange[1]; k++) VERIFY_IS_APPROX(redux_gpu(j, k), redux(j, k));
 
   sycl_device.deallocate(gpu_in_data);
   sycl_device.deallocate(gpu_out_data);
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_last_dim_reductions_mean_sycl(
-    const Eigen::SyclDevice& sycl_device) {
+static void test_last_dim_reductions_mean_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType dim_x = 64;
   IndexType dim_y = 1;
   IndexType dim_z = 32;
@@ -710,34 +615,26 @@
 
   redux = in.mean(red_axis);
 
-  DataType* gpu_in_data = static_cast<DataType*>(
-      sycl_device.allocate(in.dimensions().TotalSize() * sizeof(DataType)));
-  DataType* gpu_out_data = static_cast<DataType*>(sycl_device.allocate(
-      redux_gpu.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_in_data = static_cast<DataType*>(sycl_device.allocate(in.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_out_data =
+      static_cast<DataType*>(sycl_device.allocate(redux_gpu.dimensions().TotalSize() * sizeof(DataType)));
 
-  TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> in_gpu(gpu_in_data,
-                                                               tensorRange);
-  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> out_gpu(
-      gpu_out_data, reduced_tensorRange);
+  TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> in_gpu(gpu_in_data, tensorRange);
+  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> out_gpu(gpu_out_data, reduced_tensorRange);
 
-  sycl_device.memcpyHostToDevice(
-      gpu_in_data, in.data(), (in.dimensions().TotalSize()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(), (in.dimensions().TotalSize()) * sizeof(DataType));
   out_gpu.device(sycl_device) = in_gpu.mean(red_axis);
-  sycl_device.memcpyDeviceToHost(
-      redux_gpu.data(), gpu_out_data,
-      redux_gpu.dimensions().TotalSize() * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(redux_gpu.data(), gpu_out_data, redux_gpu.dimensions().TotalSize() * sizeof(DataType));
   // Check that the CPU and GPU reductions return the same result.
   for (IndexType j = 0; j < reduced_tensorRange[0]; j++)
-    for (IndexType k = 0; k < reduced_tensorRange[1]; k++)
-      VERIFY_IS_APPROX(redux_gpu(j, k), redux(j, k));
+    for (IndexType k = 0; k < reduced_tensorRange[1]; k++) VERIFY_IS_APPROX(redux_gpu(j, k), redux(j, k));
 
   sycl_device.deallocate(gpu_in_data);
   sycl_device.deallocate(gpu_out_data);
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_last_dim_reductions_sum_sycl(
-    const Eigen::SyclDevice& sycl_device) {
+static void test_last_dim_reductions_sum_sycl(const Eigen::SyclDevice& sycl_device) {
   IndexType dim_x = 64;
   IndexType dim_y = 1;
   IndexType dim_z = 32;
@@ -755,34 +652,26 @@
 
   redux = in.sum(red_axis);
 
-  DataType* gpu_in_data = static_cast<DataType*>(
-      sycl_device.allocate(in.dimensions().TotalSize() * sizeof(DataType)));
-  DataType* gpu_out_data = static_cast<DataType*>(sycl_device.allocate(
-      redux_gpu.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_in_data = static_cast<DataType*>(sycl_device.allocate(in.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_out_data =
+      static_cast<DataType*>(sycl_device.allocate(redux_gpu.dimensions().TotalSize() * sizeof(DataType)));
 
-  TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> in_gpu(gpu_in_data,
-                                                               tensorRange);
-  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> out_gpu(
-      gpu_out_data, reduced_tensorRange);
+  TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> in_gpu(gpu_in_data, tensorRange);
+  TensorMap<Tensor<DataType, 2, DataLayout, IndexType>> out_gpu(gpu_out_data, reduced_tensorRange);
 
-  sycl_device.memcpyHostToDevice(
-      gpu_in_data, in.data(), (in.dimensions().TotalSize()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(), (in.dimensions().TotalSize()) * sizeof(DataType));
   out_gpu.device(sycl_device) = in_gpu.sum(red_axis);
-  sycl_device.memcpyDeviceToHost(
-      redux_gpu.data(), gpu_out_data,
-      redux_gpu.dimensions().TotalSize() * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(redux_gpu.data(), gpu_out_data, redux_gpu.dimensions().TotalSize() * sizeof(DataType));
   // Check that the CPU and GPU reductions return the same result.
   for (IndexType j = 0; j < reduced_tensorRange[0]; j++)
-    for (IndexType k = 0; k < reduced_tensorRange[1]; k++)
-      VERIFY_IS_APPROX(redux_gpu(j, k), redux(j, k));
+    for (IndexType k = 0; k < reduced_tensorRange[1]; k++) VERIFY_IS_APPROX(redux_gpu(j, k), redux(j, k));
 
   sycl_device.deallocate(gpu_in_data);
   sycl_device.deallocate(gpu_out_data);
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_last_reductions_sum_sycl(
-    const Eigen::SyclDevice& sycl_device) {
+static void test_last_reductions_sum_sycl(const Eigen::SyclDevice& sycl_device) {
   auto tensorRange = Sizes<64, 32>(64, 32);
   // auto red_axis =  Sizes<0,1>(0,1);
   Eigen::IndexList<Eigen::type2index<1>> red_axis;
@@ -795,23 +684,18 @@
 
   redux_fix = in_fix.sum(red_axis);
 
-  DataType* gpu_in_data = static_cast<DataType*>(
-      sycl_device.allocate(in_fix.dimensions().TotalSize() * sizeof(DataType)));
-  DataType* gpu_out_data = static_cast<DataType*>(sycl_device.allocate(
-      redux_gpu_fix.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_in_data =
+      static_cast<DataType*>(sycl_device.allocate(in_fix.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_out_data =
+      static_cast<DataType*>(sycl_device.allocate(redux_gpu_fix.dimensions().TotalSize() * sizeof(DataType)));
 
-  TensorMap<TensorFixedSize<DataType, Sizes<64, 32>, DataLayout>> in_gpu_fix(
-      gpu_in_data, tensorRange);
-  TensorMap<TensorFixedSize<DataType, Sizes<64>, DataLayout>> out_gpu_fix(
-      gpu_out_data, reduced_tensorRange);
+  TensorMap<TensorFixedSize<DataType, Sizes<64, 32>, DataLayout>> in_gpu_fix(gpu_in_data, tensorRange);
+  TensorMap<TensorFixedSize<DataType, Sizes<64>, DataLayout>> out_gpu_fix(gpu_out_data, reduced_tensorRange);
 
-  sycl_device.memcpyHostToDevice(
-      gpu_in_data, in_fix.data(),
-      (in_fix.dimensions().TotalSize()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in_data, in_fix.data(), (in_fix.dimensions().TotalSize()) * sizeof(DataType));
   out_gpu_fix.device(sycl_device) = in_gpu_fix.sum(red_axis);
-  sycl_device.memcpyDeviceToHost(
-      redux_gpu_fix.data(), gpu_out_data,
-      redux_gpu_fix.dimensions().TotalSize() * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(redux_gpu_fix.data(), gpu_out_data,
+                                 redux_gpu_fix.dimensions().TotalSize() * sizeof(DataType));
   // Check that the CPU and GPU reductions return the same result.
   for (IndexType j = 0; j < reduced_tensorRange[0]; j++) {
     VERIFY_IS_APPROX(redux_gpu_fix(j), redux_fix(j));
@@ -822,8 +706,7 @@
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_last_reductions_mean_sycl(
-    const Eigen::SyclDevice& sycl_device) {
+static void test_last_reductions_mean_sycl(const Eigen::SyclDevice& sycl_device) {
   auto tensorRange = Sizes<64, 32>(64, 32);
   Eigen::IndexList<Eigen::type2index<1>> red_axis;
   auto reduced_tensorRange = Sizes<64>(64);
@@ -834,23 +717,18 @@
   in_fix.setRandom();
   redux_fix = in_fix.mean(red_axis);
 
-  DataType* gpu_in_data = static_cast<DataType*>(
-      sycl_device.allocate(in_fix.dimensions().TotalSize() * sizeof(DataType)));
-  DataType* gpu_out_data = static_cast<DataType*>(sycl_device.allocate(
-      redux_gpu_fix.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_in_data =
+      static_cast<DataType*>(sycl_device.allocate(in_fix.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_out_data =
+      static_cast<DataType*>(sycl_device.allocate(redux_gpu_fix.dimensions().TotalSize() * sizeof(DataType)));
 
-  TensorMap<TensorFixedSize<DataType, Sizes<64, 32>, DataLayout>> in_gpu_fix(
-      gpu_in_data, tensorRange);
-  TensorMap<TensorFixedSize<DataType, Sizes<64>, DataLayout>> out_gpu_fix(
-      gpu_out_data, reduced_tensorRange);
+  TensorMap<TensorFixedSize<DataType, Sizes<64, 32>, DataLayout>> in_gpu_fix(gpu_in_data, tensorRange);
+  TensorMap<TensorFixedSize<DataType, Sizes<64>, DataLayout>> out_gpu_fix(gpu_out_data, reduced_tensorRange);
 
-  sycl_device.memcpyHostToDevice(
-      gpu_in_data, in_fix.data(),
-      (in_fix.dimensions().TotalSize()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in_data, in_fix.data(), (in_fix.dimensions().TotalSize()) * sizeof(DataType));
   out_gpu_fix.device(sycl_device) = in_gpu_fix.mean(red_axis);
-  sycl_device.memcpyDeviceToHost(
-      redux_gpu_fix.data(), gpu_out_data,
-      redux_gpu_fix.dimensions().TotalSize() * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(redux_gpu_fix.data(), gpu_out_data,
+                                 redux_gpu_fix.dimensions().TotalSize() * sizeof(DataType));
   sycl_device.synchronize();
   // Check that the CPU and GPU reductions return the same result.
   for (IndexType j = 0; j < reduced_tensorRange[0]; j++) {
@@ -872,32 +750,22 @@
   static constexpr OutT InfBit = 1;
   static constexpr OutT NanBit = 2;
 
-  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reduce(const InT x,
-                                                    OutT* accum) const {
+  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reduce(const InT x, OutT* accum) const {
     if (Eigen::numext::isinf(x))
       *accum |= InfBit;
     else if (Eigen::numext::isnan(x))
       *accum |= NanBit;
   }
 
-  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reduce(const OutT x,
-                                                    OutT* accum) const {
-    *accum |= x;
-  }
+  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reduce(const OutT x, OutT* accum) const { *accum |= x; }
 
-  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE OutT initialize() const {
-    return OutT(0);
-  }
+  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE OutT initialize() const { return OutT(0); }
 
-  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE OutT finalize(const OutT accum) const {
-    return accum;
-  }
+  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE OutT finalize(const OutT accum) const { return accum; }
 };
 
-template <typename DataType, typename AccumType, int DataLayout,
-          typename IndexType>
-static void test_full_reductions_custom_sycl(
-    const Eigen::SyclDevice& sycl_device) {
+template <typename DataType, typename AccumType, int DataLayout, typename IndexType>
+static void test_full_reductions_custom_sycl(const Eigen::SyclDevice& sycl_device) {
   constexpr IndexType InSize = 64;
   auto tensorRange = Sizes<InSize>(InSize);
   Eigen::IndexList<Eigen::type2index<0>> dims;
@@ -910,20 +778,15 @@
   in_fix.setRandom();
 
   size_t in_size_bytes = in_fix.dimensions().TotalSize() * sizeof(DataType);
-  DataType* gpu_in_data =
-      static_cast<DataType*>(sycl_device.allocate(in_size_bytes));
-  AccumType* gpu_out_data =
-      static_cast<AccumType*>(sycl_device.allocate(sizeof(AccumType)));
+  DataType* gpu_in_data = static_cast<DataType*>(sycl_device.allocate(in_size_bytes));
+  AccumType* gpu_out_data = static_cast<AccumType*>(sycl_device.allocate(sizeof(AccumType)));
 
-  TensorMap<TensorFixedSize<DataType, Sizes<InSize>, DataLayout>> in_gpu_fix(
-      gpu_in_data, tensorRange);
-  TensorMap<TensorFixedSize<AccumType, Sizes<>, DataLayout>> out_gpu_fix(
-      gpu_out_data, reduced_tensorRange);
+  TensorMap<TensorFixedSize<DataType, Sizes<InSize>, DataLayout>> in_gpu_fix(gpu_in_data, tensorRange);
+  TensorMap<TensorFixedSize<AccumType, Sizes<>, DataLayout>> out_gpu_fix(gpu_out_data, reduced_tensorRange);
 
   sycl_device.memcpyHostToDevice(gpu_in_data, in_fix.data(), in_size_bytes);
   out_gpu_fix.device(sycl_device) = in_gpu_fix.reduce(dims, reducer);
-  sycl_device.memcpyDeviceToHost(redux_gpu_fix.data(), gpu_out_data,
-                                 sizeof(AccumType));
+  sycl_device.memcpyDeviceToHost(redux_gpu_fix.data(), gpu_out_data, sizeof(AccumType));
   VERIFY_IS_EQUAL(redux_gpu_fix(0), AccumType(0));
 
   sycl_device.deallocate(gpu_in_data);
@@ -941,55 +804,39 @@
 
   test_full_reductions_mean_sycl<DataType, ColMajor, int64_t>(sycl_device);
   test_full_reductions_mean_sycl<DataType, RowMajor, int64_t>(sycl_device);
-  test_full_reductions_custom_sycl<DataType, int, RowMajor, int64_t>(
-      sycl_device);
-  test_full_reductions_custom_sycl<DataType, int, ColMajor, int64_t>(
-      sycl_device);
+  test_full_reductions_custom_sycl<DataType, int, RowMajor, int64_t>(sycl_device);
+  test_full_reductions_custom_sycl<DataType, int, ColMajor, int64_t>(sycl_device);
   sycl_device.synchronize();
 }
 
 template <typename DataType, typename Dev>
 void sycl_reduction_full_offset_per_device(const Dev& sycl_device) {
-  test_full_reductions_sum_with_offset_sycl<DataType, RowMajor, int64_t>(
-      sycl_device);
-  test_full_reductions_sum_with_offset_sycl<DataType, ColMajor, int64_t>(
-      sycl_device);
-  test_full_reductions_min_with_offset_sycl<DataType, RowMajor, int64_t>(
-      sycl_device);
-  test_full_reductions_min_with_offset_sycl<DataType, ColMajor, int64_t>(
-      sycl_device);
-  test_full_reductions_max_with_offset_sycl<DataType, ColMajor, int64_t>(
-      sycl_device);
-  test_full_reductions_max_with_offset_sycl<DataType, RowMajor, int64_t>(
-      sycl_device);
-  test_full_reductions_mean_with_offset_sycl<DataType, RowMajor, int64_t>(
-      sycl_device);
-  test_full_reductions_mean_with_offset_sycl<DataType, ColMajor, int64_t>(
-      sycl_device);
-  test_full_reductions_mean_with_odd_offset_sycl<DataType, RowMajor, int64_t>(
-      sycl_device);
+  test_full_reductions_sum_with_offset_sycl<DataType, RowMajor, int64_t>(sycl_device);
+  test_full_reductions_sum_with_offset_sycl<DataType, ColMajor, int64_t>(sycl_device);
+  test_full_reductions_min_with_offset_sycl<DataType, RowMajor, int64_t>(sycl_device);
+  test_full_reductions_min_with_offset_sycl<DataType, ColMajor, int64_t>(sycl_device);
+  test_full_reductions_max_with_offset_sycl<DataType, ColMajor, int64_t>(sycl_device);
+  test_full_reductions_max_with_offset_sycl<DataType, RowMajor, int64_t>(sycl_device);
+  test_full_reductions_mean_with_offset_sycl<DataType, RowMajor, int64_t>(sycl_device);
+  test_full_reductions_mean_with_offset_sycl<DataType, ColMajor, int64_t>(sycl_device);
+  test_full_reductions_mean_with_odd_offset_sycl<DataType, RowMajor, int64_t>(sycl_device);
   sycl_device.synchronize();
 }
 
 template <typename DataType, typename Dev>
 void sycl_reduction_test_first_dim_per_device(const Dev& sycl_device) {
-  test_first_dim_reductions_sum_sycl<DataType, ColMajor, int64_t>(sycl_device,
-                                                                  4197, 4097);
-  test_first_dim_reductions_sum_sycl<DataType, RowMajor, int64_t>(sycl_device,
-                                                                  4197, 4097);
-  test_first_dim_reductions_sum_sycl<DataType, RowMajor, int64_t>(sycl_device,
-                                                                  129, 8);
+  test_first_dim_reductions_sum_sycl<DataType, ColMajor, int64_t>(sycl_device, 4197, 4097);
+  test_first_dim_reductions_sum_sycl<DataType, RowMajor, int64_t>(sycl_device, 4197, 4097);
+  test_first_dim_reductions_sum_sycl<DataType, RowMajor, int64_t>(sycl_device, 129, 8);
   test_first_dim_reductions_max_sycl<DataType, RowMajor, int64_t>(sycl_device);
-  test_first_dim_reductions_max_with_offset_sycl<DataType, RowMajor, int64_t>(
-      sycl_device);
+  test_first_dim_reductions_max_with_offset_sycl<DataType, RowMajor, int64_t>(sycl_device);
   sycl_device.synchronize();
 }
 
 template <typename DataType, typename Dev>
 void sycl_reduction_test_last_dim_per_device(const Dev& sycl_device) {
   test_last_dim_reductions_sum_sycl<DataType, RowMajor, int64_t>(sycl_device);
-  test_last_dim_reductions_max_with_offset_sycl<DataType, RowMajor, int64_t>(
-      sycl_device);
+  test_last_dim_reductions_max_with_offset_sycl<DataType, RowMajor, int64_t>(sycl_device);
   test_last_reductions_sum_sycl<DataType, ColMajor, int64_t>(sycl_device);
   test_last_reductions_sum_sycl<DataType, RowMajor, int64_t>(sycl_device);
   test_last_reductions_mean_sycl<DataType, ColMajor, int64_t>(sycl_device);
@@ -999,15 +846,12 @@
 
 EIGEN_DECLARE_TEST(cxx11_tensor_reduction_sycl) {
   for (const auto& device : Eigen::get_sycl_supported_devices()) {
-    std::cout << "Running on "
-              << device.template get_info<cl::sycl::info::device::name>()
-              << std::endl;
+    std::cout << "Running on " << device.template get_info<cl::sycl::info::device::name>() << std::endl;
     QueueInterface queueInterface(device);
     auto sycl_device = Eigen::SyclDevice(&queueInterface);
     CALL_SUBTEST_1(sycl_reduction_test_full_per_device<float>(sycl_device));
     CALL_SUBTEST_2(sycl_reduction_full_offset_per_device<float>(sycl_device));
-    CALL_SUBTEST_3(
-        sycl_reduction_test_first_dim_per_device<float>(sycl_device));
+    CALL_SUBTEST_3(sycl_reduction_test_first_dim_per_device<float>(sycl_device));
     CALL_SUBTEST_4(sycl_reduction_test_last_dim_per_device<float>(sycl_device));
   }
 }
diff --git a/unsupported/test/cxx11_tensor_ref.cpp b/unsupported/test/cxx11_tensor_ref.cpp
index 7dbd047..d5ff196 100644
--- a/unsupported/test/cxx11_tensor_ref.cpp
+++ b/unsupported/test/cxx11_tensor_ref.cpp
@@ -11,11 +11,10 @@
 
 #include <Eigen/CXX11/Tensor>
 
-using Eigen::Tensor;
 using Eigen::RowMajor;
+using Eigen::Tensor;
 
-static void test_simple_lvalue_ref()
-{
+static void test_simple_lvalue_ref() {
   Tensor<int, 1> input(6);
   input.setRandom();
 
@@ -40,13 +39,11 @@
     ref4.coeffRef(i) = -i * 2;
   }
   for (int i = 0; i < 6; ++i) {
-    VERIFY_IS_EQUAL(input(i), -i*2);
+    VERIFY_IS_EQUAL(input(i), -i * 2);
   }
 }
 
-
-static void test_simple_rvalue_ref()
-{
+static void test_simple_rvalue_ref() {
   Tensor<int, 1> input1(6);
   input1.setRandom();
   Tensor<int, 1> input2(6);
@@ -66,10 +63,8 @@
   }
 }
 
-
-static void test_multiple_dims()
-{
-  Tensor<float, 3> input(3,5,7);
+static void test_multiple_dims() {
+  Tensor<float, 3> input(3, 5, 7);
   input.setRandom();
 
   TensorRef<Tensor<float, 3>> ref(input);
@@ -81,44 +76,40 @@
   for (int i = 0; i < 3; ++i) {
     for (int j = 0; j < 5; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_EQUAL(ref(i,j,k), input(i,j,k));
+        VERIFY_IS_EQUAL(ref(i, j, k), input(i, j, k));
       }
     }
   }
 }
 
-
-static void test_slice()
-{
-  Tensor<float, 5> tensor(2,3,5,7,11);
+static void test_slice() {
+  Tensor<float, 5> tensor(2, 3, 5, 7, 11);
   tensor.setRandom();
 
-  Eigen::DSizes<ptrdiff_t, 5> indices(1,2,3,4,5);
-  Eigen::DSizes<ptrdiff_t, 5> sizes(1,1,1,1,1);
+  Eigen::DSizes<ptrdiff_t, 5> indices(1, 2, 3, 4, 5);
+  Eigen::DSizes<ptrdiff_t, 5> sizes(1, 1, 1, 1, 1);
   TensorRef<Tensor<float, 5>> slice = tensor.slice(indices, sizes);
-  VERIFY_IS_EQUAL(slice(0,0,0,0,0), tensor(1,2,3,4,5));
+  VERIFY_IS_EQUAL(slice(0, 0, 0, 0, 0), tensor(1, 2, 3, 4, 5));
 
-  Eigen::DSizes<ptrdiff_t, 5> indices2(1,1,3,4,5);
-  Eigen::DSizes<ptrdiff_t, 5> sizes2(1,1,2,2,3);
+  Eigen::DSizes<ptrdiff_t, 5> indices2(1, 1, 3, 4, 5);
+  Eigen::DSizes<ptrdiff_t, 5> sizes2(1, 1, 2, 2, 3);
   slice = tensor.slice(indices2, sizes2);
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 2; ++j) {
       for (int k = 0; k < 3; ++k) {
-        VERIFY_IS_EQUAL(slice(0,0,i,j,k), tensor(1,1,3+i,4+j,5+k));
+        VERIFY_IS_EQUAL(slice(0, 0, i, j, k), tensor(1, 1, 3 + i, 4 + j, 5 + k));
       }
     }
   }
 
-  Eigen::DSizes<ptrdiff_t, 5> indices3(0,0,0,0,0);
-  Eigen::DSizes<ptrdiff_t, 5> sizes3(2,3,1,1,1);
+  Eigen::DSizes<ptrdiff_t, 5> indices3(0, 0, 0, 0, 0);
+  Eigen::DSizes<ptrdiff_t, 5> sizes3(2, 3, 1, 1, 1);
   slice = tensor.slice(indices3, sizes3);
   VERIFY_IS_EQUAL(slice.data(), tensor.data());
 }
 
-
-static void test_ref_of_ref()
-{
-  Tensor<float, 3> input(3,5,7);
+static void test_ref_of_ref() {
+  Tensor<float, 3> input(3, 5, 7);
   input.setRandom();
 
   TensorRef<Tensor<float, 3>> ref(input);
@@ -139,33 +130,31 @@
   for (int i = 0; i < 3; ++i) {
     for (int j = 0; j < 5; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_EQUAL(ref_of_ref(i,j,k), input(i,j,k));
-        VERIFY_IS_EQUAL(ref_of_ref2(i,j,k), input(i,j,k));
-     }
+        VERIFY_IS_EQUAL(ref_of_ref(i, j, k), input(i, j, k));
+        VERIFY_IS_EQUAL(ref_of_ref2(i, j, k), input(i, j, k));
+      }
     }
   }
 }
 
-
-static void test_ref_in_expr()
-{
-  Tensor<float, 3> input(3,5,7);
+static void test_ref_in_expr() {
+  Tensor<float, 3> input(3, 5, 7);
   input.setRandom();
   TensorRef<Tensor<float, 3>> input_ref(input);
 
-  Tensor<float, 3> result(3,5,7);
+  Tensor<float, 3> result(3, 5, 7);
   result.setRandom();
   TensorRef<Tensor<float, 3>> result_ref(result);
 
-  Tensor<float, 3> bias(3,5,7);
+  Tensor<float, 3> bias(3, 5, 7);
   bias.setRandom();
 
   result_ref = input_ref + bias;
   for (int i = 0; i < 3; ++i) {
     for (int j = 0; j < 5; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_EQUAL(result_ref(i,j,k), input(i,j,k) + bias(i,j,k));
-        VERIFY_IS_NOT_EQUAL(result(i,j,k), input(i,j,k) + bias(i,j,k));
+        VERIFY_IS_EQUAL(result_ref(i, j, k), input(i, j, k) + bias(i, j, k));
+        VERIFY_IS_NOT_EQUAL(result(i, j, k), input(i, j, k) + bias(i, j, k));
       }
     }
   }
@@ -174,16 +163,14 @@
   for (int i = 0; i < 3; ++i) {
     for (int j = 0; j < 5; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_EQUAL(result(i,j,k), input(i,j,k) + bias(i,j,k));
+        VERIFY_IS_EQUAL(result(i, j, k), input(i, j, k) + bias(i, j, k));
       }
     }
   }
 }
 
-
-static void test_coeff_ref()
-{
-  Tensor<float, 5> tensor(2,3,5,7,11);
+static void test_coeff_ref() {
+  Tensor<float, 5> tensor(2, 3, 5, 7, 11);
   tensor.setRandom();
   Tensor<float, 5> original = tensor;
 
@@ -191,42 +178,40 @@
   slice.coeffRef(0, 0, 0, 0) = 1.0f;
   slice.coeffRef(1, 0, 0, 0) += 2.0f;
 
-  VERIFY_IS_EQUAL(tensor(0,0,0,0,7), 1.0f);
-  VERIFY_IS_EQUAL(tensor(1,0,0,0,7), original(1,0,0,0,7) + 2.0f);
+  VERIFY_IS_EQUAL(tensor(0, 0, 0, 0, 7), 1.0f);
+  VERIFY_IS_EQUAL(tensor(1, 0, 0, 0, 7), original(1, 0, 0, 0, 7) + 2.0f);
 }
 
-
-static void test_nested_ops_with_ref()
-{
+static void test_nested_ops_with_ref() {
   Tensor<float, 4> t(2, 3, 5, 7);
   t.setRandom();
-  TensorMap<Tensor<const float, 4> > m(t.data(), 2, 3, 5, 7);
+  TensorMap<Tensor<const float, 4>> m(t.data(), 2, 3, 5, 7);
   array<std::pair<ptrdiff_t, ptrdiff_t>, 4> paddings;
   paddings[0] = std::make_pair(0, 0);
   paddings[1] = std::make_pair(2, 1);
   paddings[2] = std::make_pair(3, 4);
   paddings[3] = std::make_pair(0, 0);
   DSizes<Eigen::DenseIndex, 4> shuffle_dims(0, 1, 2, 3);
-  TensorRef<Tensor<const float, 4> > ref(m.pad(paddings));
+  TensorRef<Tensor<const float, 4>> ref(m.pad(paddings));
   array<std::pair<ptrdiff_t, ptrdiff_t>, 4> trivial;
   trivial[0] = std::make_pair(0, 0);
   trivial[1] = std::make_pair(0, 0);
   trivial[2] = std::make_pair(0, 0);
   trivial[3] = std::make_pair(0, 0);
   Tensor<float, 4> padded = ref.shuffle(shuffle_dims).pad(trivial);
-  VERIFY_IS_EQUAL(padded.dimension(0), 2+0);
-  VERIFY_IS_EQUAL(padded.dimension(1), 3+3);
-  VERIFY_IS_EQUAL(padded.dimension(2), 5+7);
-  VERIFY_IS_EQUAL(padded.dimension(3), 7+0);
+  VERIFY_IS_EQUAL(padded.dimension(0), 2 + 0);
+  VERIFY_IS_EQUAL(padded.dimension(1), 3 + 3);
+  VERIFY_IS_EQUAL(padded.dimension(2), 5 + 7);
+  VERIFY_IS_EQUAL(padded.dimension(3), 7 + 0);
 
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 6; ++j) {
       for (int k = 0; k < 12; ++k) {
         for (int l = 0; l < 7; ++l) {
           if (j >= 2 && j < 5 && k >= 3 && k < 8) {
-            VERIFY_IS_EQUAL(padded(i,j,k,l), t(i,j-2,k-3,l));
+            VERIFY_IS_EQUAL(padded(i, j, k, l), t(i, j - 2, k - 3, l));
           } else {
-            VERIFY_IS_EQUAL(padded(i,j,k,l), 0.0f);
+            VERIFY_IS_EQUAL(padded(i, j, k, l), 0.0f);
           }
         }
       }
@@ -234,9 +219,7 @@
   }
 }
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_ref)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_ref) {
   CALL_SUBTEST(test_simple_lvalue_ref());
   CALL_SUBTEST(test_simple_rvalue_ref());
   CALL_SUBTEST(test_multiple_dims());
diff --git a/unsupported/test/cxx11_tensor_reverse.cpp b/unsupported/test/cxx11_tensor_reverse.cpp
index 5e44ec0..150c71b 100644
--- a/unsupported/test/cxx11_tensor_reverse.cpp
+++ b/unsupported/test/cxx11_tensor_reverse.cpp
@@ -12,13 +12,12 @@
 
 #include <Eigen/CXX11/Tensor>
 
-using Eigen::Tensor;
 using Eigen::array;
+using Eigen::Tensor;
 
 template <int DataLayout>
-static void test_simple_reverse()
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,5,7);
+static void test_simple_reverse() {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
 
   array<bool, 4> dim_rev;
@@ -39,7 +38,7 @@
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 5; ++k) {
         for (int l = 0; l < 7; ++l) {
-          VERIFY_IS_EQUAL(tensor(i,j,k,l), reversed_tensor(i,2-j,4-k,l));
+          VERIFY_IS_EQUAL(tensor(i, j, k, l), reversed_tensor(i, 2 - j, 4 - k, l));
         }
       }
     }
@@ -57,12 +56,11 @@
   VERIFY_IS_EQUAL(reversed_tensor.dimension(2), 5);
   VERIFY_IS_EQUAL(reversed_tensor.dimension(3), 7);
 
-
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 5; ++k) {
         for (int l = 0; l < 7; ++l) {
-          VERIFY_IS_EQUAL(tensor(i,j,k,l), reversed_tensor(1-i,j,k,l));
+          VERIFY_IS_EQUAL(tensor(i, j, k, l), reversed_tensor(1 - i, j, k, l));
         }
       }
     }
@@ -80,23 +78,20 @@
   VERIFY_IS_EQUAL(reversed_tensor.dimension(2), 5);
   VERIFY_IS_EQUAL(reversed_tensor.dimension(3), 7);
 
-
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 5; ++k) {
         for (int l = 0; l < 7; ++l) {
-          VERIFY_IS_EQUAL(tensor(i,j,k,l), reversed_tensor(1-i,j,k,6-l));
+          VERIFY_IS_EQUAL(tensor(i, j, k, l), reversed_tensor(1 - i, j, k, 6 - l));
         }
       }
     }
   }
 }
 
-
 template <int DataLayout>
-static void test_expr_reverse(bool LValue)
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,5,7);
+static void test_expr_reverse(bool LValue) {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
 
   array<bool, 4> dim_rev;
@@ -112,7 +107,7 @@
     expected = tensor.reverse(dim_rev);
   }
 
-  Tensor<float, 4, DataLayout> result(2,3,5,7);
+  Tensor<float, 4, DataLayout> result(2, 3, 5, 7);
 
   array<ptrdiff_t, 4> src_slice_dim;
   src_slice_dim[0] = 2;
@@ -129,11 +124,9 @@
 
   for (int i = 0; i < 5; ++i) {
     if (LValue) {
-      result.slice(dst_slice_start, dst_slice_dim).reverse(dim_rev) =
-          tensor.slice(src_slice_start, src_slice_dim);
+      result.slice(dst_slice_start, dst_slice_dim).reverse(dim_rev) = tensor.slice(src_slice_start, src_slice_dim);
     } else {
-      result.slice(dst_slice_start, dst_slice_dim) =
-          tensor.slice(src_slice_start, src_slice_dim).reverse(dim_rev);
+      result.slice(dst_slice_start, dst_slice_dim) = tensor.slice(src_slice_start, src_slice_dim).reverse(dim_rev);
     }
     src_slice_start[2] += 1;
     dst_slice_start[2] += 1;
@@ -148,7 +141,7 @@
     for (int j = 0; j < expected.dimension(1); ++j) {
       for (int k = 0; k < expected.dimension(2); ++k) {
         for (int l = 0; l < expected.dimension(3); ++l) {
-          VERIFY_IS_EQUAL(result(i,j,k,l), expected(i,j,k,l));
+          VERIFY_IS_EQUAL(result(i, j, k, l), expected(i, j, k, l));
         }
       }
     }
@@ -157,13 +150,11 @@
   dst_slice_start[2] = 0;
   result.setRandom();
   for (int i = 0; i < 5; ++i) {
-     if (LValue) {
-       result.slice(dst_slice_start, dst_slice_dim).reverse(dim_rev) =
-           tensor.slice(dst_slice_start, dst_slice_dim);
-     } else {
-       result.slice(dst_slice_start, dst_slice_dim) =
-           tensor.reverse(dim_rev).slice(dst_slice_start, dst_slice_dim);
-     }
+    if (LValue) {
+      result.slice(dst_slice_start, dst_slice_dim).reverse(dim_rev) = tensor.slice(dst_slice_start, dst_slice_dim);
+    } else {
+      result.slice(dst_slice_start, dst_slice_dim) = tensor.reverse(dim_rev).slice(dst_slice_start, dst_slice_dim);
+    }
     dst_slice_start[2] += 1;
   }
 
@@ -171,16 +162,14 @@
     for (int j = 0; j < expected.dimension(1); ++j) {
       for (int k = 0; k < expected.dimension(2); ++k) {
         for (int l = 0; l < expected.dimension(3); ++l) {
-          VERIFY_IS_EQUAL(result(i,j,k,l), expected(i,j,k,l));
+          VERIFY_IS_EQUAL(result(i, j, k, l), expected(i, j, k, l));
         }
       }
     }
   }
 }
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_reverse)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_reverse) {
   CALL_SUBTEST(test_simple_reverse<ColMajor>());
   CALL_SUBTEST(test_simple_reverse<RowMajor>());
   CALL_SUBTEST(test_expr_reverse<ColMajor>(true));
diff --git a/unsupported/test/cxx11_tensor_reverse_sycl.cpp b/unsupported/test/cxx11_tensor_reverse_sycl.cpp
index 5ed007f..c9c6172 100644
--- a/unsupported/test/cxx11_tensor_reverse_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_reverse_sycl.cpp
@@ -38,30 +38,24 @@
   dim_rev[2] = true;
   dim_rev[3] = false;
 
-  DataType* gpu_in_data = static_cast<DataType*>(
-      sycl_device.allocate(tensor.dimensions().TotalSize() * sizeof(DataType)));
-  DataType* gpu_out_data = static_cast<DataType*>(sycl_device.allocate(
-      reversed_tensor.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_in_data =
+      static_cast<DataType*>(sycl_device.allocate(tensor.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_out_data =
+      static_cast<DataType*>(sycl_device.allocate(reversed_tensor.dimensions().TotalSize() * sizeof(DataType)));
 
-  TensorMap<Tensor<DataType, 4, DataLayout, IndexType> > in_gpu(gpu_in_data,
-                                                                tensorRange);
-  TensorMap<Tensor<DataType, 4, DataLayout, IndexType> > out_gpu(gpu_out_data,
-                                                                 tensorRange);
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType> > in_gpu(gpu_in_data, tensorRange);
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType> > out_gpu(gpu_out_data, tensorRange);
 
-  sycl_device.memcpyHostToDevice(
-      gpu_in_data, tensor.data(),
-      (tensor.dimensions().TotalSize()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in_data, tensor.data(), (tensor.dimensions().TotalSize()) * sizeof(DataType));
   out_gpu.device(sycl_device) = in_gpu.reverse(dim_rev);
-  sycl_device.memcpyDeviceToHost(
-      reversed_tensor.data(), gpu_out_data,
-      reversed_tensor.dimensions().TotalSize() * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(reversed_tensor.data(), gpu_out_data,
+                                 reversed_tensor.dimensions().TotalSize() * sizeof(DataType));
   // Check that the CPU and GPU reductions return the same result.
   for (IndexType i = 0; i < 2; ++i) {
     for (IndexType j = 0; j < 3; ++j) {
       for (IndexType k = 0; k < 5; ++k) {
         for (IndexType l = 0; l < 7; ++l) {
-          VERIFY_IS_EQUAL(tensor(i, j, k, l),
-                          reversed_tensor(i, 2 - j, 4 - k, l));
+          VERIFY_IS_EQUAL(tensor(i, j, k, l), reversed_tensor(i, 2 - j, 4 - k, l));
         }
       }
     }
@@ -72,9 +66,8 @@
   dim_rev[3] = false;
 
   out_gpu.device(sycl_device) = in_gpu.reverse(dim_rev);
-  sycl_device.memcpyDeviceToHost(
-      reversed_tensor.data(), gpu_out_data,
-      reversed_tensor.dimensions().TotalSize() * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(reversed_tensor.data(), gpu_out_data,
+                                 reversed_tensor.dimensions().TotalSize() * sizeof(DataType));
 
   for (IndexType i = 0; i < 2; ++i) {
     for (IndexType j = 0; j < 3; ++j) {
@@ -91,16 +84,14 @@
   dim_rev[2] = false;
   dim_rev[3] = true;
   out_gpu.device(sycl_device) = in_gpu.reverse(dim_rev);
-  sycl_device.memcpyDeviceToHost(
-      reversed_tensor.data(), gpu_out_data,
-      reversed_tensor.dimensions().TotalSize() * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(reversed_tensor.data(), gpu_out_data,
+                                 reversed_tensor.dimensions().TotalSize() * sizeof(DataType));
 
   for (IndexType i = 0; i < 2; ++i) {
     for (IndexType j = 0; j < 3; ++j) {
       for (IndexType k = 0; k < 5; ++k) {
         for (IndexType l = 0; l < 7; ++l) {
-          VERIFY_IS_EQUAL(tensor(i, j, k, l),
-                          reversed_tensor(1 - i, j, k, 6 - l));
+          VERIFY_IS_EQUAL(tensor(i, j, k, l), reversed_tensor(1 - i, j, k, 6 - l));
         }
       }
     }
@@ -111,8 +102,7 @@
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_expr_reverse(const Eigen::SyclDevice& sycl_device,
-                              bool LValue) {
+static void test_expr_reverse(const Eigen::SyclDevice& sycl_device, bool LValue) {
   IndexType dim1 = 2;
   IndexType dim2 = 3;
   IndexType dim3 = 5;
@@ -130,32 +120,26 @@
   dim_rev[2] = false;
   dim_rev[3] = true;
 
-  DataType* gpu_in_data = static_cast<DataType*>(
-      sycl_device.allocate(tensor.dimensions().TotalSize() * sizeof(DataType)));
-  DataType* gpu_out_data_expected = static_cast<DataType*>(sycl_device.allocate(
-      expected.dimensions().TotalSize() * sizeof(DataType)));
-  DataType* gpu_out_data_result = static_cast<DataType*>(
-      sycl_device.allocate(result.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_in_data =
+      static_cast<DataType*>(sycl_device.allocate(tensor.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_out_data_expected =
+      static_cast<DataType*>(sycl_device.allocate(expected.dimensions().TotalSize() * sizeof(DataType)));
+  DataType* gpu_out_data_result =
+      static_cast<DataType*>(sycl_device.allocate(result.dimensions().TotalSize() * sizeof(DataType)));
 
-  TensorMap<Tensor<DataType, 4, DataLayout, IndexType> > in_gpu(gpu_in_data,
-                                                                tensorRange);
-  TensorMap<Tensor<DataType, 4, DataLayout, IndexType> > out_gpu_expected(
-      gpu_out_data_expected, tensorRange);
-  TensorMap<Tensor<DataType, 4, DataLayout, IndexType> > out_gpu_result(
-      gpu_out_data_result, tensorRange);
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType> > in_gpu(gpu_in_data, tensorRange);
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType> > out_gpu_expected(gpu_out_data_expected, tensorRange);
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType> > out_gpu_result(gpu_out_data_result, tensorRange);
 
-  sycl_device.memcpyHostToDevice(
-      gpu_in_data, tensor.data(),
-      (tensor.dimensions().TotalSize()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in_data, tensor.data(), (tensor.dimensions().TotalSize()) * sizeof(DataType));
 
   if (LValue) {
     out_gpu_expected.reverse(dim_rev).device(sycl_device) = in_gpu;
   } else {
     out_gpu_expected.device(sycl_device) = in_gpu.reverse(dim_rev);
   }
-  sycl_device.memcpyDeviceToHost(
-      expected.data(), gpu_out_data_expected,
-      expected.dimensions().TotalSize() * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(expected.data(), gpu_out_data_expected,
+                                 expected.dimensions().TotalSize() * sizeof(DataType));
 
   array<IndexType, 4> src_slice_dim;
   src_slice_dim[0] = 2;
@@ -172,9 +156,8 @@
 
   for (IndexType i = 0; i < 5; ++i) {
     if (LValue) {
-      out_gpu_result.slice(dst_slice_start, dst_slice_dim)
-          .reverse(dim_rev)
-          .device(sycl_device) = in_gpu.slice(src_slice_start, src_slice_dim);
+      out_gpu_result.slice(dst_slice_start, dst_slice_dim).reverse(dim_rev).device(sycl_device) =
+          in_gpu.slice(src_slice_start, src_slice_dim);
     } else {
       out_gpu_result.slice(dst_slice_start, dst_slice_dim).device(sycl_device) =
           in_gpu.slice(src_slice_start, src_slice_dim).reverse(dim_rev);
@@ -182,9 +165,8 @@
     src_slice_start[2] += 1;
     dst_slice_start[2] += 1;
   }
-  sycl_device.memcpyDeviceToHost(
-      result.data(), gpu_out_data_result,
-      result.dimensions().TotalSize() * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(result.data(), gpu_out_data_result,
+                                 result.dimensions().TotalSize() * sizeof(DataType));
 
   for (IndexType i = 0; i < expected.dimension(0); ++i) {
     for (IndexType j = 0; j < expected.dimension(1); ++j) {
@@ -198,23 +180,20 @@
 
   dst_slice_start[2] = 0;
   result.setRandom();
-  sycl_device.memcpyHostToDevice(
-      gpu_out_data_result, result.data(),
-      (result.dimensions().TotalSize()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_out_data_result, result.data(),
+                                 (result.dimensions().TotalSize()) * sizeof(DataType));
   for (IndexType i = 0; i < 5; ++i) {
     if (LValue) {
-      out_gpu_result.slice(dst_slice_start, dst_slice_dim)
-          .reverse(dim_rev)
-          .device(sycl_device) = in_gpu.slice(dst_slice_start, dst_slice_dim);
+      out_gpu_result.slice(dst_slice_start, dst_slice_dim).reverse(dim_rev).device(sycl_device) =
+          in_gpu.slice(dst_slice_start, dst_slice_dim);
     } else {
       out_gpu_result.slice(dst_slice_start, dst_slice_dim).device(sycl_device) =
           in_gpu.reverse(dim_rev).slice(dst_slice_start, dst_slice_dim);
     }
     dst_slice_start[2] += 1;
   }
-  sycl_device.memcpyDeviceToHost(
-      result.data(), gpu_out_data_result,
-      result.dimensions().TotalSize() * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(result.data(), gpu_out_data_result,
+                                 result.dimensions().TotalSize() * sizeof(DataType));
 
   for (IndexType i = 0; i < expected.dimension(0); ++i) {
     for (IndexType j = 0; j < expected.dimension(1); ++j) {
@@ -240,8 +219,7 @@
 }
 EIGEN_DECLARE_TEST(cxx11_tensor_reverse_sycl) {
   for (const auto& device : Eigen::get_sycl_supported_devices()) {
-    std::cout << "Running on "
-              << device.get_info<cl::sycl::info::device::name>() << std::endl;
+    std::cout << "Running on " << device.get_info<cl::sycl::info::device::name>() << std::endl;
     CALL_SUBTEST_1(sycl_reverse_test_per_device<short>(device));
     CALL_SUBTEST_2(sycl_reverse_test_per_device<int>(device));
     CALL_SUBTEST_3(sycl_reverse_test_per_device<unsigned int>(device));
diff --git a/unsupported/test/cxx11_tensor_roundings.cpp b/unsupported/test/cxx11_tensor_roundings.cpp
index 83b5923..2c1181a 100644
--- a/unsupported/test/cxx11_tensor_roundings.cpp
+++ b/unsupported/test/cxx11_tensor_roundings.cpp
@@ -11,52 +11,47 @@
 
 #include <Eigen/CXX11/Tensor>
 
-
-static void test_float_rounding()
-{
-  Tensor<float, 2> ftensor(20,30);
+static void test_float_rounding() {
+  Tensor<float, 2> ftensor(20, 30);
   ftensor = ftensor.random() * 100.f;
 
   Tensor<float, 2> result = ftensor.round();
 
   for (int i = 0; i < 20; ++i) {
     for (int j = 0; j < 30; ++j) {
-      VERIFY_IS_EQUAL(result(i,j), numext::round(ftensor(i,j)));
+      VERIFY_IS_EQUAL(result(i, j), numext::round(ftensor(i, j)));
     }
   }
 }
 
-static void test_float_flooring()
-{
-  Tensor<float, 2> ftensor(20,30);
+static void test_float_flooring() {
+  Tensor<float, 2> ftensor(20, 30);
   ftensor = ftensor.random() * 100.f;
 
   Tensor<float, 2> result = ftensor.floor();
 
   for (int i = 0; i < 20; ++i) {
     for (int j = 0; j < 30; ++j) {
-      VERIFY_IS_EQUAL(result(i,j), numext::floor(ftensor(i,j)));
+      VERIFY_IS_EQUAL(result(i, j), numext::floor(ftensor(i, j)));
     }
   }
 }
 
-static void test_float_ceiling()
-{
-  Tensor<float, 2> ftensor(20,30);
+static void test_float_ceiling() {
+  Tensor<float, 2> ftensor(20, 30);
   ftensor = ftensor.random() * 100.f;
 
   Tensor<float, 2> result = ftensor.ceil();
 
   for (int i = 0; i < 20; ++i) {
     for (int j = 0; j < 30; ++j) {
-      VERIFY_IS_EQUAL(result(i,j), numext::ceil(ftensor(i,j)));
+      VERIFY_IS_EQUAL(result(i, j), numext::ceil(ftensor(i, j)));
     }
   }
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_roundings)
-{
-   CALL_SUBTEST(test_float_rounding());
-   CALL_SUBTEST(test_float_ceiling());
-   CALL_SUBTEST(test_float_flooring());
+EIGEN_DECLARE_TEST(cxx11_tensor_roundings) {
+  CALL_SUBTEST(test_float_rounding());
+  CALL_SUBTEST(test_float_ceiling());
+  CALL_SUBTEST(test_float_flooring());
 }
diff --git a/unsupported/test/cxx11_tensor_scan.cpp b/unsupported/test/cxx11_tensor_scan.cpp
index dccee9e..50ec63d 100644
--- a/unsupported/test/cxx11_tensor_scan.cpp
+++ b/unsupported/test/cxx11_tensor_scan.cpp
@@ -14,9 +14,8 @@
 
 using Eigen::Tensor;
 
-template <int DataLayout, typename Type=float, bool Exclusive = false>
-static void test_1d_scan()
-{
+template <int DataLayout, typename Type = float, bool Exclusive = false>
+static void test_1d_scan() {
   int size = 50;
   Tensor<Type, 1, DataLayout> tensor(size);
   tensor.setRandom();
@@ -48,9 +47,8 @@
   }
 }
 
-template <int DataLayout, typename Type=float>
-static void test_4d_scan()
-{
+template <int DataLayout, typename Type = float>
+static void test_4d_scan() {
   int size = 5;
   Tensor<Type, 4, DataLayout> tensor(size, size, size, size);
   tensor.setRandom();
diff --git a/unsupported/test/cxx11_tensor_scan_gpu.cu b/unsupported/test/cxx11_tensor_scan_gpu.cu
index 770a144..c316f1e 100644
--- a/unsupported/test/cxx11_tensor_scan_gpu.cu
+++ b/unsupported/test/cxx11_tensor_scan_gpu.cu
@@ -21,9 +21,8 @@
 using Eigen::Tensor;
 typedef Tensor<float, 1>::DimensionPair DimPair;
 
-template<int DataLayout>
-void test_gpu_cumsum(int m_size, int k_size, int n_size)
-{
+template <int DataLayout>
+void test_gpu_cumsum(int m_size, int k_size, int n_size) {
   std::cout << "Testing for (" << m_size << "," << k_size << "," << n_size << ")" << std::endl;
   Tensor<float, 3, DataLayout> t_input(m_size, k_size, n_size);
   Tensor<float, 3, DataLayout> t_result(m_size, k_size, n_size);
@@ -31,7 +30,7 @@
 
   t_input.setRandom();
 
-  std::size_t t_input_bytes = t_input.size()  * sizeof(float);
+  std::size_t t_input_bytes = t_input.size() * sizeof(float);
   std::size_t t_result_bytes = t_result.size() * sizeof(float);
 
   float* d_t_input;
@@ -45,10 +44,10 @@
   Eigen::GpuStreamDevice stream;
   Eigen::GpuDevice gpu_device(&stream);
 
-  Eigen::TensorMap<Eigen::Tensor<float, 3, DataLayout> >
-      gpu_t_input(d_t_input, Eigen::array<int, 3>(m_size, k_size, n_size));
-  Eigen::TensorMap<Eigen::Tensor<float, 3, DataLayout> >
-      gpu_t_result(d_t_result, Eigen::array<int, 3>(m_size, k_size, n_size));
+  Eigen::TensorMap<Eigen::Tensor<float, 3, DataLayout> > gpu_t_input(d_t_input,
+                                                                     Eigen::array<int, 3>(m_size, k_size, n_size));
+  Eigen::TensorMap<Eigen::Tensor<float, 3, DataLayout> > gpu_t_result(d_t_result,
+                                                                      Eigen::array<int, 3>(m_size, k_size, n_size));
 
   gpu_t_result.device(gpu_device) = gpu_t_input.cumsum(1);
   t_result = t_input.cumsum(1);
@@ -61,8 +60,7 @@
     if (Eigen::internal::isApprox(t_result(i), t_result_gpu(i), 1e-4f)) {
       continue;
     }
-    std::cout << "mismatch detected at index " << i << ": " << t_result(i)
-              << " vs " <<  t_result_gpu(i) << std::endl;
+    std::cout << "mismatch detected at index " << i << ": " << t_result(i) << " vs " << t_result_gpu(i) << std::endl;
     assert(false);
   }
 
@@ -70,9 +68,7 @@
   gpuFree((void*)d_t_result);
 }
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_scan_gpu)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_scan_gpu) {
   CALL_SUBTEST_1(test_gpu_cumsum<ColMajor>(128, 128, 128));
   CALL_SUBTEST_2(test_gpu_cumsum<RowMajor>(128, 128, 128));
 }
diff --git a/unsupported/test/cxx11_tensor_scan_sycl.cpp b/unsupported/test/cxx11_tensor_scan_sycl.cpp
index 09c45fc..13f7c9e 100644
--- a/unsupported/test/cxx11_tensor_scan_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_scan_sycl.cpp
@@ -23,31 +23,25 @@
 typedef Tensor<float, 1>::DimensionPair DimPair;
 
 template <typename DataType, int DataLayout, typename IndexType>
-void test_sycl_cumsum(const Eigen::SyclDevice& sycl_device, IndexType m_size,
-                      IndexType k_size, IndexType n_size, int consume_dim,
-                      bool exclusive) {
+void test_sycl_cumsum(const Eigen::SyclDevice& sycl_device, IndexType m_size, IndexType k_size, IndexType n_size,
+                      int consume_dim, bool exclusive) {
   static const DataType error_threshold = 1e-4f;
-  std::cout << "Testing for (" << m_size << "," << k_size << "," << n_size
-            << " consume_dim : " << consume_dim << ")" << std::endl;
+  std::cout << "Testing for (" << m_size << "," << k_size << "," << n_size << " consume_dim : " << consume_dim << ")"
+            << std::endl;
   Tensor<DataType, 3, DataLayout, IndexType> t_input(m_size, k_size, n_size);
   Tensor<DataType, 3, DataLayout, IndexType> t_result(m_size, k_size, n_size);
-  Tensor<DataType, 3, DataLayout, IndexType> t_result_gpu(m_size, k_size,
-                                                          n_size);
+  Tensor<DataType, 3, DataLayout, IndexType> t_result_gpu(m_size, k_size, n_size);
 
   t_input.setRandom();
   std::size_t t_input_bytes = t_input.size() * sizeof(DataType);
   std::size_t t_result_bytes = t_result.size() * sizeof(DataType);
 
-  DataType* gpu_data_in =
-      static_cast<DataType*>(sycl_device.allocate(t_input_bytes));
-  DataType* gpu_data_out =
-      static_cast<DataType*>(sycl_device.allocate(t_result_bytes));
+  DataType* gpu_data_in = static_cast<DataType*>(sycl_device.allocate(t_input_bytes));
+  DataType* gpu_data_out = static_cast<DataType*>(sycl_device.allocate(t_result_bytes));
 
   array<IndexType, 3> tensorRange = {{m_size, k_size, n_size}};
-  TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> gpu_t_input(
-      gpu_data_in, tensorRange);
-  TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> gpu_t_result(
-      gpu_data_out, tensorRange);
+  TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> gpu_t_input(gpu_data_in, tensorRange);
+  TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> gpu_t_result(gpu_data_out, tensorRange);
   sycl_device.memcpyHostToDevice(gpu_data_in, t_input.data(), t_input_bytes);
   sycl_device.memcpyHostToDevice(gpu_data_out, t_input.data(), t_input_bytes);
 
@@ -55,21 +49,18 @@
 
   t_result = t_input.cumsum(consume_dim, exclusive);
 
-  sycl_device.memcpyDeviceToHost(t_result_gpu.data(), gpu_data_out,
-                                 t_result_bytes);
+  sycl_device.memcpyDeviceToHost(t_result_gpu.data(), gpu_data_out, t_result_bytes);
   sycl_device.synchronize();
 
   for (IndexType i = 0; i < t_result.size(); i++) {
-    if (static_cast<DataType>(std::fabs(static_cast<DataType>(
-            t_result(i) - t_result_gpu(i)))) < error_threshold) {
+    if (static_cast<DataType>(std::fabs(static_cast<DataType>(t_result(i) - t_result_gpu(i)))) < error_threshold) {
       continue;
     }
-    if (Eigen::internal::isApprox(t_result(i), t_result_gpu(i),
-                                  error_threshold)) {
+    if (Eigen::internal::isApprox(t_result(i), t_result_gpu(i), error_threshold)) {
       continue;
     }
-    std::cout << "mismatch detected at index " << i << " CPU : " << t_result(i)
-              << " vs SYCL : " << t_result_gpu(i) << std::endl;
+    std::cout << "mismatch detected at index " << i << " CPU : " << t_result(i) << " vs SYCL : " << t_result_gpu(i)
+              << std::endl;
     assert(false);
   }
   sycl_device.deallocate(gpu_data_in);
@@ -78,64 +69,44 @@
 
 template <typename DataType, typename Dev>
 void sycl_scan_test_exclusive_dim0_per_device(const Dev& sycl_device) {
-  test_sycl_cumsum<DataType, ColMajor, int64_t>(sycl_device, 2049, 1023, 127, 0,
-                                                true);
-  test_sycl_cumsum<DataType, RowMajor, int64_t>(sycl_device, 2049, 1023, 127, 0,
-                                                true);
+  test_sycl_cumsum<DataType, ColMajor, int64_t>(sycl_device, 2049, 1023, 127, 0, true);
+  test_sycl_cumsum<DataType, RowMajor, int64_t>(sycl_device, 2049, 1023, 127, 0, true);
 }
 template <typename DataType, typename Dev>
 void sycl_scan_test_exclusive_dim1_per_device(const Dev& sycl_device) {
-  test_sycl_cumsum<DataType, ColMajor, int64_t>(sycl_device, 1023, 2049, 127, 1,
-                                                true);
-  test_sycl_cumsum<DataType, RowMajor, int64_t>(sycl_device, 1023, 2049, 127, 1,
-                                                true);
+  test_sycl_cumsum<DataType, ColMajor, int64_t>(sycl_device, 1023, 2049, 127, 1, true);
+  test_sycl_cumsum<DataType, RowMajor, int64_t>(sycl_device, 1023, 2049, 127, 1, true);
 }
 template <typename DataType, typename Dev>
 void sycl_scan_test_exclusive_dim2_per_device(const Dev& sycl_device) {
-  test_sycl_cumsum<DataType, ColMajor, int64_t>(sycl_device, 1023, 127, 2049, 2,
-                                                true);
-  test_sycl_cumsum<DataType, RowMajor, int64_t>(sycl_device, 1023, 127, 2049, 2,
-                                                true);
+  test_sycl_cumsum<DataType, ColMajor, int64_t>(sycl_device, 1023, 127, 2049, 2, true);
+  test_sycl_cumsum<DataType, RowMajor, int64_t>(sycl_device, 1023, 127, 2049, 2, true);
 }
 template <typename DataType, typename Dev>
 void sycl_scan_test_inclusive_dim0_per_device(const Dev& sycl_device) {
-  test_sycl_cumsum<DataType, ColMajor, int64_t>(sycl_device, 2049, 1023, 127, 0,
-                                                false);
-  test_sycl_cumsum<DataType, RowMajor, int64_t>(sycl_device, 2049, 1023, 127, 0,
-                                                false);
+  test_sycl_cumsum<DataType, ColMajor, int64_t>(sycl_device, 2049, 1023, 127, 0, false);
+  test_sycl_cumsum<DataType, RowMajor, int64_t>(sycl_device, 2049, 1023, 127, 0, false);
 }
 template <typename DataType, typename Dev>
 void sycl_scan_test_inclusive_dim1_per_device(const Dev& sycl_device) {
-  test_sycl_cumsum<DataType, ColMajor, int64_t>(sycl_device, 1023, 2049, 127, 1,
-                                                false);
-  test_sycl_cumsum<DataType, RowMajor, int64_t>(sycl_device, 1023, 2049, 127, 1,
-                                                false);
+  test_sycl_cumsum<DataType, ColMajor, int64_t>(sycl_device, 1023, 2049, 127, 1, false);
+  test_sycl_cumsum<DataType, RowMajor, int64_t>(sycl_device, 1023, 2049, 127, 1, false);
 }
 template <typename DataType, typename Dev>
 void sycl_scan_test_inclusive_dim2_per_device(const Dev& sycl_device) {
-  test_sycl_cumsum<DataType, ColMajor, int64_t>(sycl_device, 1023, 127, 2049, 2,
-                                                false);
-  test_sycl_cumsum<DataType, RowMajor, int64_t>(sycl_device, 1023, 127, 2049, 2,
-                                                false);
+  test_sycl_cumsum<DataType, ColMajor, int64_t>(sycl_device, 1023, 127, 2049, 2, false);
+  test_sycl_cumsum<DataType, RowMajor, int64_t>(sycl_device, 1023, 127, 2049, 2, false);
 }
 EIGEN_DECLARE_TEST(cxx11_tensor_scan_sycl) {
   for (const auto& device : Eigen::get_sycl_supported_devices()) {
-    std::cout << "Running on "
-              << device.template get_info<cl::sycl::info::device::name>()
-              << std::endl;
+    std::cout << "Running on " << device.template get_info<cl::sycl::info::device::name>() << std::endl;
     QueueInterface queueInterface(device);
     auto sycl_device = Eigen::SyclDevice(&queueInterface);
-    CALL_SUBTEST_1(
-        sycl_scan_test_exclusive_dim0_per_device<float>(sycl_device));
-    CALL_SUBTEST_2(
-        sycl_scan_test_exclusive_dim1_per_device<float>(sycl_device));
-    CALL_SUBTEST_3(
-        sycl_scan_test_exclusive_dim2_per_device<float>(sycl_device));
-    CALL_SUBTEST_4(
-        sycl_scan_test_inclusive_dim0_per_device<float>(sycl_device));
-    CALL_SUBTEST_5(
-        sycl_scan_test_inclusive_dim1_per_device<float>(sycl_device));
-    CALL_SUBTEST_6(
-        sycl_scan_test_inclusive_dim2_per_device<float>(sycl_device));
+    CALL_SUBTEST_1(sycl_scan_test_exclusive_dim0_per_device<float>(sycl_device));
+    CALL_SUBTEST_2(sycl_scan_test_exclusive_dim1_per_device<float>(sycl_device));
+    CALL_SUBTEST_3(sycl_scan_test_exclusive_dim2_per_device<float>(sycl_device));
+    CALL_SUBTEST_4(sycl_scan_test_inclusive_dim0_per_device<float>(sycl_device));
+    CALL_SUBTEST_5(sycl_scan_test_inclusive_dim1_per_device<float>(sycl_device));
+    CALL_SUBTEST_6(sycl_scan_test_inclusive_dim2_per_device<float>(sycl_device));
   }
 }
diff --git a/unsupported/test/cxx11_tensor_shuffling.cpp b/unsupported/test/cxx11_tensor_shuffling.cpp
index 89a64c0..4e6fb73 100644
--- a/unsupported/test/cxx11_tensor_shuffling.cpp
+++ b/unsupported/test/cxx11_tensor_shuffling.cpp
@@ -11,13 +11,12 @@
 
 #include <Eigen/CXX11/Tensor>
 
-using Eigen::Tensor;
 using Eigen::array;
+using Eigen::Tensor;
 
 template <int DataLayout>
-static void test_simple_shuffling()
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,5,7);
+static void test_simple_shuffling() {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
   array<ptrdiff_t, 4> shuffles;
   shuffles[0] = 0;
@@ -37,7 +36,7 @@
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 5; ++k) {
         for (int l = 0; l < 7; ++l) {
-          VERIFY_IS_EQUAL(tensor(i,j,k,l), no_shuffle(i,j,k,l));
+          VERIFY_IS_EQUAL(tensor(i, j, k, l), no_shuffle(i, j, k, l));
         }
       }
     }
@@ -59,18 +58,16 @@
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 5; ++k) {
         for (int l = 0; l < 7; ++l) {
-          VERIFY_IS_EQUAL(tensor(i,j,k,l), shuffle(k,l,j,i));
+          VERIFY_IS_EQUAL(tensor(i, j, k, l), shuffle(k, l, j, i));
         }
       }
     }
   }
 }
 
-
 template <int DataLayout>
-static void test_expr_shuffling()
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,5,7);
+static void test_expr_shuffling() {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
 
   array<ptrdiff_t, 4> shuffles;
@@ -89,8 +86,7 @@
   array<ptrdiff_t, 4> dst_slice_start{{0, 0, 0, 0}};
 
   for (int i = 0; i < 5; ++i) {
-    result.slice(dst_slice_start, dst_slice_dim) =
-        tensor.slice(src_slice_start, src_slice_dim).shuffle(shuffles);
+    result.slice(dst_slice_start, dst_slice_dim) = tensor.slice(src_slice_start, src_slice_dim).shuffle(shuffles);
     src_slice_start[2] += 1;
     dst_slice_start[0] += 1;
   }
@@ -104,7 +100,7 @@
     for (int j = 0; j < expected.dimension(1); ++j) {
       for (int k = 0; k < expected.dimension(2); ++k) {
         for (int l = 0; l < expected.dimension(3); ++l) {
-          VERIFY_IS_EQUAL(result(i,j,k,l), expected(i,j,k,l));
+          VERIFY_IS_EQUAL(result(i, j, k, l), expected(i, j, k, l));
         }
       }
     }
@@ -113,8 +109,7 @@
   dst_slice_start[0] = 0;
   result.setRandom();
   for (int i = 0; i < 5; ++i) {
-    result.slice(dst_slice_start, dst_slice_dim) =
-        tensor.shuffle(shuffles).slice(dst_slice_start, dst_slice_dim);
+    result.slice(dst_slice_start, dst_slice_dim) = tensor.shuffle(shuffles).slice(dst_slice_start, dst_slice_dim);
     dst_slice_start[0] += 1;
   }
 
@@ -122,25 +117,23 @@
     for (int j = 0; j < expected.dimension(1); ++j) {
       for (int k = 0; k < expected.dimension(2); ++k) {
         for (int l = 0; l < expected.dimension(3); ++l) {
-          VERIFY_IS_EQUAL(result(i,j,k,l), expected(i,j,k,l));
+          VERIFY_IS_EQUAL(result(i, j, k, l), expected(i, j, k, l));
         }
       }
     }
   }
 }
 
-
 template <int DataLayout>
-static void test_shuffling_as_value()
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,5,7);
+static void test_shuffling_as_value() {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
   array<ptrdiff_t, 4> shuffles;
   shuffles[2] = 0;
   shuffles[3] = 1;
   shuffles[1] = 2;
   shuffles[0] = 3;
-  Tensor<float, 4, DataLayout> shuffle(5,7,3,2);
+  Tensor<float, 4, DataLayout> shuffle(5, 7, 3, 2);
   shuffle.shuffle(shuffles) = tensor;
 
   VERIFY_IS_EQUAL(shuffle.dimension(0), 5);
@@ -152,7 +145,7 @@
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 5; ++k) {
         for (int l = 0; l < 7; ++l) {
-          VERIFY_IS_EQUAL(tensor(i,j,k,l), shuffle(k,l,j,i));
+          VERIFY_IS_EQUAL(tensor(i, j, k, l), shuffle(k, l, j, i));
         }
       }
     }
@@ -163,24 +156,22 @@
   no_shuffle[1] = 1;
   no_shuffle[2] = 2;
   no_shuffle[3] = 3;
-  Tensor<float, 4, DataLayout> shuffle2(5,7,3,2);
+  Tensor<float, 4, DataLayout> shuffle2(5, 7, 3, 2);
   shuffle2.shuffle(shuffles) = tensor.shuffle(no_shuffle);
   for (int i = 0; i < 5; ++i) {
     for (int j = 0; j < 7; ++j) {
       for (int k = 0; k < 3; ++k) {
         for (int l = 0; l < 2; ++l) {
-          VERIFY_IS_EQUAL(shuffle2(i,j,k,l), shuffle(i,j,k,l));
+          VERIFY_IS_EQUAL(shuffle2(i, j, k, l), shuffle(i, j, k, l));
         }
       }
     }
   }
 }
 
-
 template <int DataLayout>
-static void test_shuffle_unshuffle()
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,5,7);
+static void test_shuffle_unshuffle() {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
 
   // Choose a random permutation.
@@ -207,18 +198,16 @@
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 5; ++k) {
         for (int l = 0; l < 7; ++l) {
-          VERIFY_IS_EQUAL(tensor(i,j,k,l), shuffle(i,j,k,l));
+          VERIFY_IS_EQUAL(tensor(i, j, k, l), shuffle(i, j, k, l));
         }
       }
     }
   }
 }
 
-
 template <int DataLayout>
-static void test_empty_shuffling()
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,0,7);
+static void test_empty_shuffling() {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 0, 7);
   tensor.setRandom();
   array<ptrdiff_t, 4> shuffles;
   shuffles[0] = 0;
@@ -238,7 +227,7 @@
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 0; ++k) {
         for (int l = 0; l < 7; ++l) {
-          VERIFY_IS_EQUAL(tensor(i,j,k,l), no_shuffle(i,j,k,l));
+          VERIFY_IS_EQUAL(tensor(i, j, k, l), no_shuffle(i, j, k, l));
         }
       }
     }
@@ -260,16 +249,14 @@
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 0; ++k) {
         for (int l = 0; l < 7; ++l) {
-          VERIFY_IS_EQUAL(tensor(i,j,k,l), shuffle(k,l,j,i));
+          VERIFY_IS_EQUAL(tensor(i, j, k, l), shuffle(k, l, j, i));
         }
       }
     }
   }
 }
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_shuffling)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_shuffling) {
   CALL_SUBTEST(test_simple_shuffling<ColMajor>());
   CALL_SUBTEST(test_simple_shuffling<RowMajor>());
   CALL_SUBTEST(test_expr_shuffling<ColMajor>());
diff --git a/unsupported/test/cxx11_tensor_shuffling_sycl.cpp b/unsupported/test/cxx11_tensor_shuffling_sycl.cpp
index 70c4116..0f88f52 100644
--- a/unsupported/test/cxx11_tensor_shuffling_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_shuffling_sycl.cpp
@@ -46,10 +46,8 @@
   DataType* gpu_data1 = static_cast<DataType*>(sycl_device.allocate(buffSize));
   DataType* gpu_data2 = static_cast<DataType*>(sycl_device.allocate(buffSize));
 
-  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu1(gpu_data1,
-                                                             tensorRange);
-  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu2(gpu_data2,
-                                                             tensorRange);
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu1(gpu_data1, tensorRange);
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu2(gpu_data2, tensorRange);
 
   sycl_device.memcpyHostToDevice(gpu_data1, tensor.data(), buffSize);
 
@@ -76,12 +74,10 @@
   shuffles[1] = 3;
   shuffles[2] = 1;
   shuffles[3] = 0;
-  array<IndexType, 4> tensorrangeShuffle = {
-      {sizeDim3, sizeDim4, sizeDim2, sizeDim1}};
+  array<IndexType, 4> tensorrangeShuffle = {{sizeDim3, sizeDim4, sizeDim2, sizeDim1}};
   Tensor<DataType, 4, DataLayout, IndexType> shuffle(tensorrangeShuffle);
   DataType* gpu_data3 = static_cast<DataType*>(sycl_device.allocate(buffSize));
-  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu3(
-      gpu_data3, tensorrangeShuffle);
+  TensorMap<Tensor<DataType, 4, DataLayout, IndexType>> gpu3(gpu_data3, tensorrangeShuffle);
 
   gpu3.device(sycl_device) = gpu1.shuffle(shuffles);
   sycl_device.memcpyDeviceToHost(shuffle.data(), gpu_data3, buffSize);
diff --git a/unsupported/test/cxx11_tensor_simple.cpp b/unsupported/test/cxx11_tensor_simple.cpp
index 6d70f54..1686af3 100644
--- a/unsupported/test/cxx11_tensor_simple.cpp
+++ b/unsupported/test/cxx11_tensor_simple.cpp
@@ -11,11 +11,10 @@
 
 #include <Eigen/CXX11/Tensor>
 
-using Eigen::Tensor;
 using Eigen::RowMajor;
+using Eigen::Tensor;
 
-static void test_0d()
-{
+static void test_0d() {
   Tensor<int, 0> scalar1;
   Tensor<int, 0, RowMajor> scalar2;
   Tensor<int, 0> scalar3;
@@ -43,8 +42,7 @@
   VERIFY_IS_EQUAL(scalar5.data()[0], 7);
 }
 
-static void test_1d()
-{
+static void test_1d() {
   Tensor<int, 1> vec1(6);
   Tensor<int, 1, RowMajor> vec2(6);
   Tensor<int, 1> vec3;
@@ -53,12 +51,24 @@
   vec3.resize(6);
   vec4.resize(6);
 
-  vec1(0) = 4;  vec2(0) = 0; vec3(0) = 5;
-  vec1(1) = 8;  vec2(1) = 1; vec3(1) = 4;
-  vec1(2) = 15; vec2(2) = 2; vec3(2) = 3;
-  vec1(3) = 16; vec2(3) = 3; vec3(3) = 2;
-  vec1(4) = 23; vec2(4) = 4; vec3(4) = 1;
-  vec1(5) = 42; vec2(5) = 5; vec3(5) = 0;
+  vec1(0) = 4;
+  vec2(0) = 0;
+  vec3(0) = 5;
+  vec1(1) = 8;
+  vec2(1) = 1;
+  vec3(1) = 4;
+  vec1(2) = 15;
+  vec2(2) = 2;
+  vec3(2) = 3;
+  vec1(3) = 16;
+  vec2(3) = 3;
+  vec3(3) = 2;
+  vec1(4) = 23;
+  vec2(4) = 4;
+  vec3(4) = 1;
+  vec1(5) = 42;
+  vec2(5) = 5;
+  vec3(5) = 0;
   vec4.setZero();
 
   VERIFY_IS_EQUAL((vec1.rank()), 1);
@@ -110,24 +120,23 @@
   VERIFY_IS_EQUAL((vec5.data()[5]), 42);
 }
 
-static void test_2d()
-{
-  Tensor<int, 2> mat1(2,3);
-  Tensor<int, 2, RowMajor> mat2(2,3);
+static void test_2d() {
+  Tensor<int, 2> mat1(2, 3);
+  Tensor<int, 2, RowMajor> mat2(2, 3);
 
-  mat1(0,0) = 0;
-  mat1(0,1) = 1;
-  mat1(0,2) = 2;
-  mat1(1,0) = 3;
-  mat1(1,1) = 4;
-  mat1(1,2) = 5;
+  mat1(0, 0) = 0;
+  mat1(0, 1) = 1;
+  mat1(0, 2) = 2;
+  mat1(1, 0) = 3;
+  mat1(1, 1) = 4;
+  mat1(1, 2) = 5;
 
-  mat2(0,0) = 0;
-  mat2(0,1) = 1;
-  mat2(0,2) = 2;
-  mat2(1,0) = 3;
-  mat2(1,1) = 4;
-  mat2(1,2) = 5;
+  mat2(0, 0) = 0;
+  mat2(0, 1) = 1;
+  mat2(0, 2) = 2;
+  mat2(1, 0) = 3;
+  mat2(1, 1) = 4;
+  mat2(1, 2) = 5;
 
   VERIFY_IS_EQUAL((mat1.rank()), 2);
   VERIFY_IS_EQUAL((mat1.size()), 6);
@@ -154,46 +163,45 @@
   VERIFY_IS_EQUAL((mat2.data()[5]), 5);
 }
 
-static void test_3d()
-{
-  Tensor<int, 3> epsilon(3,3,3);
+static void test_3d() {
+  Tensor<int, 3> epsilon(3, 3, 3);
   epsilon.setZero();
-  epsilon(0,1,2) = epsilon(2,0,1) = epsilon(1,2,0) = 1;
-  epsilon(2,1,0) = epsilon(0,2,1) = epsilon(1,0,2) = -1;
+  epsilon(0, 1, 2) = epsilon(2, 0, 1) = epsilon(1, 2, 0) = 1;
+  epsilon(2, 1, 0) = epsilon(0, 2, 1) = epsilon(1, 0, 2) = -1;
 
   VERIFY_IS_EQUAL((epsilon.size()), 27);
   VERIFY_IS_EQUAL((epsilon.dimensions()[0]), 3);
   VERIFY_IS_EQUAL((epsilon.dimensions()[1]), 3);
   VERIFY_IS_EQUAL((epsilon.dimensions()[2]), 3);
 
-  VERIFY_IS_EQUAL((epsilon(0,0,0)), 0);
-  VERIFY_IS_EQUAL((epsilon(0,0,1)), 0);
-  VERIFY_IS_EQUAL((epsilon(0,0,2)), 0);
-  VERIFY_IS_EQUAL((epsilon(0,1,0)), 0);
-  VERIFY_IS_EQUAL((epsilon(0,1,1)), 0);
-  VERIFY_IS_EQUAL((epsilon(0,2,0)), 0);
-  VERIFY_IS_EQUAL((epsilon(0,2,2)), 0);
-  VERIFY_IS_EQUAL((epsilon(1,0,0)), 0);
-  VERIFY_IS_EQUAL((epsilon(1,0,1)), 0);
-  VERIFY_IS_EQUAL((epsilon(1,1,0)), 0);
-  VERIFY_IS_EQUAL((epsilon(1,1,1)), 0);
-  VERIFY_IS_EQUAL((epsilon(1,1,2)), 0);
-  VERIFY_IS_EQUAL((epsilon(1,2,1)), 0);
-  VERIFY_IS_EQUAL((epsilon(1,2,2)), 0);
-  VERIFY_IS_EQUAL((epsilon(2,0,0)), 0);
-  VERIFY_IS_EQUAL((epsilon(2,0,2)), 0);
-  VERIFY_IS_EQUAL((epsilon(2,1,1)), 0);
-  VERIFY_IS_EQUAL((epsilon(2,1,2)), 0);
-  VERIFY_IS_EQUAL((epsilon(2,2,0)), 0);
-  VERIFY_IS_EQUAL((epsilon(2,2,1)), 0);
-  VERIFY_IS_EQUAL((epsilon(2,2,2)), 0);
+  VERIFY_IS_EQUAL((epsilon(0, 0, 0)), 0);
+  VERIFY_IS_EQUAL((epsilon(0, 0, 1)), 0);
+  VERIFY_IS_EQUAL((epsilon(0, 0, 2)), 0);
+  VERIFY_IS_EQUAL((epsilon(0, 1, 0)), 0);
+  VERIFY_IS_EQUAL((epsilon(0, 1, 1)), 0);
+  VERIFY_IS_EQUAL((epsilon(0, 2, 0)), 0);
+  VERIFY_IS_EQUAL((epsilon(0, 2, 2)), 0);
+  VERIFY_IS_EQUAL((epsilon(1, 0, 0)), 0);
+  VERIFY_IS_EQUAL((epsilon(1, 0, 1)), 0);
+  VERIFY_IS_EQUAL((epsilon(1, 1, 0)), 0);
+  VERIFY_IS_EQUAL((epsilon(1, 1, 1)), 0);
+  VERIFY_IS_EQUAL((epsilon(1, 1, 2)), 0);
+  VERIFY_IS_EQUAL((epsilon(1, 2, 1)), 0);
+  VERIFY_IS_EQUAL((epsilon(1, 2, 2)), 0);
+  VERIFY_IS_EQUAL((epsilon(2, 0, 0)), 0);
+  VERIFY_IS_EQUAL((epsilon(2, 0, 2)), 0);
+  VERIFY_IS_EQUAL((epsilon(2, 1, 1)), 0);
+  VERIFY_IS_EQUAL((epsilon(2, 1, 2)), 0);
+  VERIFY_IS_EQUAL((epsilon(2, 2, 0)), 0);
+  VERIFY_IS_EQUAL((epsilon(2, 2, 1)), 0);
+  VERIFY_IS_EQUAL((epsilon(2, 2, 2)), 0);
 
-  VERIFY_IS_EQUAL((epsilon(0,1,2)), 1);
-  VERIFY_IS_EQUAL((epsilon(2,0,1)), 1);
-  VERIFY_IS_EQUAL((epsilon(1,2,0)), 1);
-  VERIFY_IS_EQUAL((epsilon(2,1,0)), -1);
-  VERIFY_IS_EQUAL((epsilon(0,2,1)), -1);
-  VERIFY_IS_EQUAL((epsilon(1,0,2)), -1);
+  VERIFY_IS_EQUAL((epsilon(0, 1, 2)), 1);
+  VERIFY_IS_EQUAL((epsilon(2, 0, 1)), 1);
+  VERIFY_IS_EQUAL((epsilon(1, 2, 0)), 1);
+  VERIFY_IS_EQUAL((epsilon(2, 1, 0)), -1);
+  VERIFY_IS_EQUAL((epsilon(0, 2, 1)), -1);
+  VERIFY_IS_EQUAL((epsilon(1, 0, 2)), -1);
 
   array<Eigen::DenseIndex, 3> dims;
   dims[0] = 2;
@@ -221,43 +229,43 @@
     }
   }
 
-  VERIFY_IS_EQUAL((t1.data()[0]),    0);
-  VERIFY_IS_EQUAL((t1.data()[1]),  100);
-  VERIFY_IS_EQUAL((t1.data()[2]),   10);
-  VERIFY_IS_EQUAL((t1.data()[3]),  110);
-  VERIFY_IS_EQUAL((t1.data()[4]),   20);
-  VERIFY_IS_EQUAL((t1.data()[5]),  120);
-  VERIFY_IS_EQUAL((t1.data()[6]),    1);
-  VERIFY_IS_EQUAL((t1.data()[7]),  101);
-  VERIFY_IS_EQUAL((t1.data()[8]),   11);
-  VERIFY_IS_EQUAL((t1.data()[9]),  111);
-  VERIFY_IS_EQUAL((t1.data()[10]),  21);
+  VERIFY_IS_EQUAL((t1.data()[0]), 0);
+  VERIFY_IS_EQUAL((t1.data()[1]), 100);
+  VERIFY_IS_EQUAL((t1.data()[2]), 10);
+  VERIFY_IS_EQUAL((t1.data()[3]), 110);
+  VERIFY_IS_EQUAL((t1.data()[4]), 20);
+  VERIFY_IS_EQUAL((t1.data()[5]), 120);
+  VERIFY_IS_EQUAL((t1.data()[6]), 1);
+  VERIFY_IS_EQUAL((t1.data()[7]), 101);
+  VERIFY_IS_EQUAL((t1.data()[8]), 11);
+  VERIFY_IS_EQUAL((t1.data()[9]), 111);
+  VERIFY_IS_EQUAL((t1.data()[10]), 21);
   VERIFY_IS_EQUAL((t1.data()[11]), 121);
-  VERIFY_IS_EQUAL((t1.data()[12]),   2);
+  VERIFY_IS_EQUAL((t1.data()[12]), 2);
   VERIFY_IS_EQUAL((t1.data()[13]), 102);
-  VERIFY_IS_EQUAL((t1.data()[14]),  12);
+  VERIFY_IS_EQUAL((t1.data()[14]), 12);
   VERIFY_IS_EQUAL((t1.data()[15]), 112);
-  VERIFY_IS_EQUAL((t1.data()[16]),  22);
+  VERIFY_IS_EQUAL((t1.data()[16]), 22);
   VERIFY_IS_EQUAL((t1.data()[17]), 122);
-  VERIFY_IS_EQUAL((t1.data()[18]),   3);
+  VERIFY_IS_EQUAL((t1.data()[18]), 3);
   VERIFY_IS_EQUAL((t1.data()[19]), 103);
-  VERIFY_IS_EQUAL((t1.data()[20]),  13);
+  VERIFY_IS_EQUAL((t1.data()[20]), 13);
   VERIFY_IS_EQUAL((t1.data()[21]), 113);
-  VERIFY_IS_EQUAL((t1.data()[22]),  23);
+  VERIFY_IS_EQUAL((t1.data()[22]), 23);
   VERIFY_IS_EQUAL((t1.data()[23]), 123);
 
-  VERIFY_IS_EQUAL((t2.data()[0]),    0);
-  VERIFY_IS_EQUAL((t2.data()[1]),    1);
-  VERIFY_IS_EQUAL((t2.data()[2]),    2);
-  VERIFY_IS_EQUAL((t2.data()[3]),    3);
-  VERIFY_IS_EQUAL((t2.data()[4]),   10);
-  VERIFY_IS_EQUAL((t2.data()[5]),   11);
-  VERIFY_IS_EQUAL((t2.data()[6]),   12);
-  VERIFY_IS_EQUAL((t2.data()[7]),   13);
-  VERIFY_IS_EQUAL((t2.data()[8]),   20);
-  VERIFY_IS_EQUAL((t2.data()[9]),   21);
-  VERIFY_IS_EQUAL((t2.data()[10]),  22);
-  VERIFY_IS_EQUAL((t2.data()[11]),  23);
+  VERIFY_IS_EQUAL((t2.data()[0]), 0);
+  VERIFY_IS_EQUAL((t2.data()[1]), 1);
+  VERIFY_IS_EQUAL((t2.data()[2]), 2);
+  VERIFY_IS_EQUAL((t2.data()[3]), 3);
+  VERIFY_IS_EQUAL((t2.data()[4]), 10);
+  VERIFY_IS_EQUAL((t2.data()[5]), 11);
+  VERIFY_IS_EQUAL((t2.data()[6]), 12);
+  VERIFY_IS_EQUAL((t2.data()[7]), 13);
+  VERIFY_IS_EQUAL((t2.data()[8]), 20);
+  VERIFY_IS_EQUAL((t2.data()[9]), 21);
+  VERIFY_IS_EQUAL((t2.data()[10]), 22);
+  VERIFY_IS_EQUAL((t2.data()[11]), 23);
   VERIFY_IS_EQUAL((t2.data()[12]), 100);
   VERIFY_IS_EQUAL((t2.data()[13]), 101);
   VERIFY_IS_EQUAL((t2.data()[14]), 102);
@@ -272,52 +280,49 @@
   VERIFY_IS_EQUAL((t2.data()[23]), 123);
 }
 
-static void test_simple_assign()
-{
-  Tensor<int, 3> epsilon(3,3,3);
+static void test_simple_assign() {
+  Tensor<int, 3> epsilon(3, 3, 3);
   epsilon.setZero();
-  epsilon(0,1,2) = epsilon(2,0,1) = epsilon(1,2,0) = 1;
-  epsilon(2,1,0) = epsilon(0,2,1) = epsilon(1,0,2) = -1;
+  epsilon(0, 1, 2) = epsilon(2, 0, 1) = epsilon(1, 2, 0) = 1;
+  epsilon(2, 1, 0) = epsilon(0, 2, 1) = epsilon(1, 0, 2) = -1;
 
-  Tensor<int, 3> e2(3,3,3);
+  Tensor<int, 3> e2(3, 3, 3);
   e2.setZero();
-  VERIFY_IS_EQUAL((e2(1,2,0)), 0);
+  VERIFY_IS_EQUAL((e2(1, 2, 0)), 0);
 
   e2 = epsilon;
-  VERIFY_IS_EQUAL((e2(1,2,0)), 1);
-  VERIFY_IS_EQUAL((e2(0,1,2)), 1);
-  VERIFY_IS_EQUAL((e2(2,0,1)), 1);
-  VERIFY_IS_EQUAL((e2(2,1,0)), -1);
-  VERIFY_IS_EQUAL((e2(0,2,1)), -1);
-  VERIFY_IS_EQUAL((e2(1,0,2)), -1);
+  VERIFY_IS_EQUAL((e2(1, 2, 0)), 1);
+  VERIFY_IS_EQUAL((e2(0, 1, 2)), 1);
+  VERIFY_IS_EQUAL((e2(2, 0, 1)), 1);
+  VERIFY_IS_EQUAL((e2(2, 1, 0)), -1);
+  VERIFY_IS_EQUAL((e2(0, 2, 1)), -1);
+  VERIFY_IS_EQUAL((e2(1, 0, 2)), -1);
 }
 
-static void test_resize()
-{
+static void test_resize() {
   Tensor<int, 3> epsilon;
-  epsilon.resize(2,3,7);
+  epsilon.resize(2, 3, 7);
   VERIFY_IS_EQUAL(epsilon.dimension(0), 2);
   VERIFY_IS_EQUAL(epsilon.dimension(1), 3);
   VERIFY_IS_EQUAL(epsilon.dimension(2), 7);
-  VERIFY_IS_EQUAL(epsilon.size(), 2*3*7);
+  VERIFY_IS_EQUAL(epsilon.size(), 2 * 3 * 7);
 
   const int* old_data = epsilon.data();
-  epsilon.resize(3,2,7);
+  epsilon.resize(3, 2, 7);
   VERIFY_IS_EQUAL(epsilon.dimension(0), 3);
   VERIFY_IS_EQUAL(epsilon.dimension(1), 2);
   VERIFY_IS_EQUAL(epsilon.dimension(2), 7);
-  VERIFY_IS_EQUAL(epsilon.size(), 2*3*7);
+  VERIFY_IS_EQUAL(epsilon.size(), 2 * 3 * 7);
   VERIFY_IS_EQUAL(epsilon.data(), old_data);
 
-  epsilon.resize(3,5,7);
+  epsilon.resize(3, 5, 7);
   VERIFY_IS_EQUAL(epsilon.dimension(0), 3);
   VERIFY_IS_EQUAL(epsilon.dimension(1), 5);
   VERIFY_IS_EQUAL(epsilon.dimension(2), 7);
-  VERIFY_IS_EQUAL(epsilon.size(), 3*5*7);
+  VERIFY_IS_EQUAL(epsilon.size(), 3 * 5 * 7);
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_simple)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_simple) {
   CALL_SUBTEST(test_0d());
   CALL_SUBTEST(test_1d());
   CALL_SUBTEST(test_2d());
diff --git a/unsupported/test/cxx11_tensor_striding.cpp b/unsupported/test/cxx11_tensor_striding.cpp
index aefdfa9..4f3cd0d 100644
--- a/unsupported/test/cxx11_tensor_striding.cpp
+++ b/unsupported/test/cxx11_tensor_striding.cpp
@@ -13,10 +13,9 @@
 
 using Eigen::Tensor;
 
-template<int DataLayout>
-static void test_simple_striding()
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,5,7);
+template <int DataLayout>
+static void test_simple_striding() {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
   array<ptrdiff_t, 4> strides;
   strides[0] = 1;
@@ -36,7 +35,7 @@
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 5; ++k) {
         for (int l = 0; l < 7; ++l) {
-          VERIFY_IS_EQUAL(tensor(i,j,k,l), no_stride(i,j,k,l));
+          VERIFY_IS_EQUAL(tensor(i, j, k, l), no_stride(i, j, k, l));
         }
       }
     }
@@ -58,18 +57,16 @@
     for (int j = 0; j < 1; ++j) {
       for (int k = 0; k < 3; ++k) {
         for (int l = 0; l < 3; ++l) {
-          VERIFY_IS_EQUAL(tensor(2*i,4*j,2*k,3*l), stride(i,j,k,l));
+          VERIFY_IS_EQUAL(tensor(2 * i, 4 * j, 2 * k, 3 * l), stride(i, j, k, l));
         }
       }
     }
   }
 }
 
-
-template<int DataLayout>
-static void test_striding_as_lvalue()
-{
-  Tensor<float, 4, DataLayout> tensor(2,3,5,7);
+template <int DataLayout>
+static void test_striding_as_lvalue() {
+  Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7);
   tensor.setRandom();
   array<ptrdiff_t, 4> strides;
   strides[0] = 2;
@@ -84,7 +81,7 @@
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 5; ++k) {
         for (int l = 0; l < 7; ++l) {
-          VERIFY_IS_EQUAL(tensor(i,j,k,l), result(2*i,4*j,2*k,3*l));
+          VERIFY_IS_EQUAL(tensor(i, j, k, l), result(2 * i, 4 * j, 2 * k, 3 * l));
         }
       }
     }
@@ -102,16 +99,14 @@
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 5; ++k) {
         for (int l = 0; l < 7; ++l) {
-          VERIFY_IS_EQUAL(tensor(i,j,k,l), result2(2*i,4*j,2*k,3*l));
+          VERIFY_IS_EQUAL(tensor(i, j, k, l), result2(2 * i, 4 * j, 2 * k, 3 * l));
         }
       }
     }
   }
 }
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_striding)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_striding) {
   CALL_SUBTEST(test_simple_striding<ColMajor>());
   CALL_SUBTEST(test_simple_striding<RowMajor>());
   CALL_SUBTEST(test_striding_as_lvalue<ColMajor>());
diff --git a/unsupported/test/cxx11_tensor_striding_sycl.cpp b/unsupported/test/cxx11_tensor_striding_sycl.cpp
index d3b1fa7..e488c0e 100644
--- a/unsupported/test/cxx11_tensor_striding_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_striding_sycl.cpp
@@ -29,32 +29,26 @@
 using Eigen::Tensor;
 using Eigen::TensorMap;
 
-
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_simple_striding(const Eigen::SyclDevice& sycl_device)
-{
-
-  Eigen::array<IndexType, 4> tensor_dims = {{2,3,5,7}};
-  Eigen::array<IndexType, 4> stride_dims = {{1,1,3,3}};
-
+static void test_simple_striding(const Eigen::SyclDevice& sycl_device) {
+  Eigen::array<IndexType, 4> tensor_dims = {{2, 3, 5, 7}};
+  Eigen::array<IndexType, 4> stride_dims = {{1, 1, 3, 3}};
 
   Tensor<DataType, 4, DataLayout, IndexType> tensor(tensor_dims);
-  Tensor<DataType, 4, DataLayout,IndexType> no_stride(tensor_dims);
-  Tensor<DataType, 4, DataLayout,IndexType> stride(stride_dims);
+  Tensor<DataType, 4, DataLayout, IndexType> no_stride(tensor_dims);
+  Tensor<DataType, 4, DataLayout, IndexType> stride(stride_dims);
 
-
-  std::size_t tensor_bytes = tensor.size()  * sizeof(DataType);
+  std::size_t tensor_bytes = tensor.size() * sizeof(DataType);
   std::size_t no_stride_bytes = no_stride.size() * sizeof(DataType);
   std::size_t stride_bytes = stride.size() * sizeof(DataType);
-  DataType * d_tensor = static_cast<DataType*>(sycl_device.allocate(tensor_bytes));
-  DataType * d_no_stride = static_cast<DataType*>(sycl_device.allocate(no_stride_bytes));
-  DataType * d_stride = static_cast<DataType*>(sycl_device.allocate(stride_bytes));
+  DataType* d_tensor = static_cast<DataType*>(sycl_device.allocate(tensor_bytes));
+  DataType* d_no_stride = static_cast<DataType*>(sycl_device.allocate(no_stride_bytes));
+  DataType* d_stride = static_cast<DataType*>(sycl_device.allocate(stride_bytes));
 
   Eigen::TensorMap<Eigen::Tensor<DataType, 4, DataLayout, IndexType> > gpu_tensor(d_tensor, tensor_dims);
   Eigen::TensorMap<Eigen::Tensor<DataType, 4, DataLayout, IndexType> > gpu_no_stride(d_no_stride, tensor_dims);
   Eigen::TensorMap<Eigen::Tensor<DataType, 4, DataLayout, IndexType> > gpu_stride(d_stride, stride_dims);
 
-
   tensor.setRandom();
   array<IndexType, 4> strides;
   strides[0] = 1;
@@ -62,10 +56,10 @@
   strides[2] = 1;
   strides[3] = 1;
   sycl_device.memcpyHostToDevice(d_tensor, tensor.data(), tensor_bytes);
-  gpu_no_stride.device(sycl_device)=gpu_tensor.stride(strides);
+  gpu_no_stride.device(sycl_device) = gpu_tensor.stride(strides);
   sycl_device.memcpyDeviceToHost(no_stride.data(), d_no_stride, no_stride_bytes);
 
-  //no_stride = tensor.stride(strides);
+  // no_stride = tensor.stride(strides);
 
   VERIFY_IS_EQUAL(no_stride.dimension(0), 2);
   VERIFY_IS_EQUAL(no_stride.dimension(1), 3);
@@ -76,7 +70,7 @@
     for (IndexType j = 0; j < 3; ++j) {
       for (IndexType k = 0; k < 5; ++k) {
         for (IndexType l = 0; l < 7; ++l) {
-          VERIFY_IS_EQUAL(tensor(i,j,k,l), no_stride(i,j,k,l));
+          VERIFY_IS_EQUAL(tensor(i, j, k, l), no_stride(i, j, k, l));
         }
       }
     }
@@ -86,10 +80,10 @@
   strides[1] = 4;
   strides[2] = 2;
   strides[3] = 3;
-//Tensor<float, 4, DataLayout> stride;
-//  stride = tensor.stride(strides);
+  // Tensor<float, 4, DataLayout> stride;
+  //   stride = tensor.stride(strides);
 
-  gpu_stride.device(sycl_device)=gpu_tensor.stride(strides);
+  gpu_stride.device(sycl_device) = gpu_tensor.stride(strides);
   sycl_device.memcpyDeviceToHost(stride.data(), d_stride, stride_bytes);
 
   VERIFY_IS_EQUAL(stride.dimension(0), 1);
@@ -101,7 +95,7 @@
     for (IndexType j = 0; j < 1; ++j) {
       for (IndexType k = 0; k < 3; ++k) {
         for (IndexType l = 0; l < 3; ++l) {
-          VERIFY_IS_EQUAL(tensor(2*i,4*j,2*k,3*l), stride(i,j,k,l));
+          VERIFY_IS_EQUAL(tensor(2 * i, 4 * j, 2 * k, 3 * l), stride(i, j, k, l));
         }
       }
     }
@@ -113,31 +107,27 @@
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-static void test_striding_as_lvalue(const Eigen::SyclDevice& sycl_device)
-{
-
-  Eigen::array<IndexType, 4> tensor_dims = {{2,3,5,7}};
-  Eigen::array<IndexType, 4> stride_dims = {{3,12,10,21}};
-
+static void test_striding_as_lvalue(const Eigen::SyclDevice& sycl_device) {
+  Eigen::array<IndexType, 4> tensor_dims = {{2, 3, 5, 7}};
+  Eigen::array<IndexType, 4> stride_dims = {{3, 12, 10, 21}};
 
   Tensor<DataType, 4, DataLayout, IndexType> tensor(tensor_dims);
-  Tensor<DataType, 4, DataLayout,IndexType> no_stride(stride_dims);
-  Tensor<DataType, 4, DataLayout,IndexType> stride(stride_dims);
+  Tensor<DataType, 4, DataLayout, IndexType> no_stride(stride_dims);
+  Tensor<DataType, 4, DataLayout, IndexType> stride(stride_dims);
 
-
-  std::size_t tensor_bytes = tensor.size()  * sizeof(DataType);
+  std::size_t tensor_bytes = tensor.size() * sizeof(DataType);
   std::size_t no_stride_bytes = no_stride.size() * sizeof(DataType);
   std::size_t stride_bytes = stride.size() * sizeof(DataType);
 
-  DataType * d_tensor = static_cast<DataType*>(sycl_device.allocate(tensor_bytes));
-  DataType * d_no_stride = static_cast<DataType*>(sycl_device.allocate(no_stride_bytes));
-  DataType * d_stride = static_cast<DataType*>(sycl_device.allocate(stride_bytes));
+  DataType* d_tensor = static_cast<DataType*>(sycl_device.allocate(tensor_bytes));
+  DataType* d_no_stride = static_cast<DataType*>(sycl_device.allocate(no_stride_bytes));
+  DataType* d_stride = static_cast<DataType*>(sycl_device.allocate(stride_bytes));
 
   Eigen::TensorMap<Eigen::Tensor<DataType, 4, DataLayout, IndexType> > gpu_tensor(d_tensor, tensor_dims);
   Eigen::TensorMap<Eigen::Tensor<DataType, 4, DataLayout, IndexType> > gpu_no_stride(d_no_stride, stride_dims);
   Eigen::TensorMap<Eigen::Tensor<DataType, 4, DataLayout, IndexType> > gpu_stride(d_stride, stride_dims);
 
-  //Tensor<float, 4, DataLayout> tensor(2,3,5,7);
+  // Tensor<float, 4, DataLayout> tensor(2,3,5,7);
   tensor.setRandom();
   array<IndexType, 4> strides;
   strides[0] = 2;
@@ -145,17 +135,17 @@
   strides[2] = 2;
   strides[3] = 3;
 
-//  Tensor<float, 4, DataLayout> result(3, 12, 10, 21);
-//  result.stride(strides) = tensor;
+  //  Tensor<float, 4, DataLayout> result(3, 12, 10, 21);
+  //  result.stride(strides) = tensor;
   sycl_device.memcpyHostToDevice(d_tensor, tensor.data(), tensor_bytes);
-  gpu_stride.stride(strides).device(sycl_device)=gpu_tensor;
+  gpu_stride.stride(strides).device(sycl_device) = gpu_tensor;
   sycl_device.memcpyDeviceToHost(stride.data(), d_stride, stride_bytes);
 
   for (IndexType i = 0; i < 2; ++i) {
     for (IndexType j = 0; j < 3; ++j) {
       for (IndexType k = 0; k < 5; ++k) {
         for (IndexType l = 0; l < 7; ++l) {
-          VERIFY_IS_EQUAL(tensor(i,j,k,l), stride(2*i,4*j,2*k,3*l));
+          VERIFY_IS_EQUAL(tensor(i, j, k, l), stride(2 * i, 4 * j, 2 * k, 3 * l));
         }
       }
     }
@@ -166,17 +156,17 @@
   no_strides[1] = 1;
   no_strides[2] = 1;
   no_strides[3] = 1;
-//  Tensor<float, 4, DataLayout> result2(3, 12, 10, 21);
-//  result2.stride(strides) = tensor.stride(no_strides);
+  //  Tensor<float, 4, DataLayout> result2(3, 12, 10, 21);
+  //  result2.stride(strides) = tensor.stride(no_strides);
 
-  gpu_no_stride.stride(strides).device(sycl_device)=gpu_tensor.stride(no_strides);
+  gpu_no_stride.stride(strides).device(sycl_device) = gpu_tensor.stride(no_strides);
   sycl_device.memcpyDeviceToHost(no_stride.data(), d_no_stride, no_stride_bytes);
 
   for (IndexType i = 0; i < 2; ++i) {
     for (IndexType j = 0; j < 3; ++j) {
       for (IndexType k = 0; k < 5; ++k) {
         for (IndexType l = 0; l < 7; ++l) {
-          VERIFY_IS_EQUAL(tensor(i,j,k,l), no_stride(2*i,4*j,2*k,3*l));
+          VERIFY_IS_EQUAL(tensor(i, j, k, l), no_stride(2 * i, 4 * j, 2 * k, 3 * l));
         }
       }
     }
@@ -186,10 +176,10 @@
   sycl_device.deallocate(d_stride);
 }
 
-
-template <typename Dev_selector> void tensorStridingPerDevice(Dev_selector& s){
+template <typename Dev_selector>
+void tensorStridingPerDevice(Dev_selector& s) {
   QueueInterface queueInterface(s);
-  auto sycl_device=Eigen::SyclDevice(&queueInterface);
+  auto sycl_device = Eigen::SyclDevice(&queueInterface);
   test_simple_striding<float, ColMajor, int64_t>(sycl_device);
   test_simple_striding<float, RowMajor, int64_t>(sycl_device);
   test_striding_as_lvalue<float, ColMajor, int64_t>(sycl_device);
@@ -197,7 +187,7 @@
 }
 
 EIGEN_DECLARE_TEST(cxx11_tensor_striding_sycl) {
-  for (const auto& device :Eigen::get_sycl_supported_devices()) {
+  for (const auto& device : Eigen::get_sycl_supported_devices()) {
     CALL_SUBTEST(tensorStridingPerDevice(device));
   }
 }
diff --git a/unsupported/test/cxx11_tensor_sugar.cpp b/unsupported/test/cxx11_tensor_sugar.cpp
index 2ca5c47..9c4d8780 100644
--- a/unsupported/test/cxx11_tensor_sugar.cpp
+++ b/unsupported/test/cxx11_tensor_sugar.cpp
@@ -2,8 +2,8 @@
 
 #include <Eigen/CXX11/Tensor>
 
-using Eigen::Tensor;
 using Eigen::RowMajor;
+using Eigen::Tensor;
 
 static void test_comparison_sugar() {
   // we already trust comparisons between tensors, we're simply checking that
@@ -12,9 +12,9 @@
 
   t.setRandom();
   // make sure we have at least one value == 0
-  t(0,0,0) = 0;
+  t(0, 0, 0) = 0;
 
-  Tensor<bool,0> b;
+  Tensor<bool, 0> b;
 
 #define TEST_TENSOR_EQUAL(e1, e2) \
   b = ((e1) == (e2)).all();       \
@@ -32,7 +32,6 @@
 #undef TEST_TENSOR_EQUAL
 }
 
-
 static void test_scalar_sugar_add_mul() {
   Tensor<float, 3> A(6, 7, 5);
   Tensor<float, 3> B(6, 7, 5);
@@ -47,7 +46,7 @@
   Tensor<float, 3> S = A * alpha + B * beta + gamma;
   Tensor<float, 3> T = gamma + alpha * A + beta * B;
 
-  for (int i = 0; i < 6*7*5; ++i) {
+  for (int i = 0; i < 6 * 7 * 5; ++i) {
     VERIFY_IS_APPROX(R(i), S(i));
     VERIFY_IS_APPROX(R(i), T(i));
   }
@@ -64,17 +63,15 @@
   const float gamma = 0.14f;
   const float delta = 0.32f;
 
-  Tensor<float, 3> R = A.constant(gamma) - A / A.constant(alpha)
-      - B.constant(beta) / B - A.constant(delta);
+  Tensor<float, 3> R = A.constant(gamma) - A / A.constant(alpha) - B.constant(beta) / B - A.constant(delta);
   Tensor<float, 3> S = gamma - A / alpha - beta / B - delta;
 
-  for (int i = 0; i < 6*7*5; ++i) {
+  for (int i = 0; i < 6 * 7 * 5; ++i) {
     VERIFY_IS_APPROX(R(i), S(i));
   }
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_sugar)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_sugar) {
   CALL_SUBTEST(test_comparison_sugar());
   CALL_SUBTEST(test_scalar_sugar_add_mul());
   CALL_SUBTEST(test_scalar_sugar_sub_div());
diff --git a/unsupported/test/cxx11_tensor_sycl.cpp b/unsupported/test/cxx11_tensor_sycl.cpp
index e6c5e23..842a510 100644
--- a/unsupported/test/cxx11_tensor_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_sycl.cpp
@@ -12,7 +12,6 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-
 #define EIGEN_TEST_NO_LONGDOUBLE
 #define EIGEN_TEST_NO_COMPLEX
 
@@ -28,7 +27,7 @@
 using Eigen::TensorMap;
 
 template <typename DataType, int DataLayout, typename IndexType>
-void test_sycl_mem_transfers(const Eigen::SyclDevice &sycl_device) {
+void test_sycl_mem_transfers(const Eigen::SyclDevice& sycl_device) {
   IndexType sizeDim1 = 5;
   IndexType sizeDim2 = 5;
   IndexType sizeDim3 = 1;
@@ -40,23 +39,23 @@
 
   in1 = in1.random();
 
-  DataType* gpu_data1  = static_cast<DataType*>(sycl_device.allocate(in1.size()*sizeof(DataType)));
-  DataType* gpu_data2  = static_cast<DataType*>(sycl_device.allocate(out1.size()*sizeof(DataType)));
+  DataType* gpu_data1 = static_cast<DataType*>(sycl_device.allocate(in1.size() * sizeof(DataType)));
+  DataType* gpu_data2 = static_cast<DataType*>(sycl_device.allocate(out1.size() * sizeof(DataType)));
 
   TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> gpu1(gpu_data1, tensorRange);
   TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> gpu2(gpu_data2, tensorRange);
 
-  sycl_device.memcpyHostToDevice(gpu_data1, in1.data(),(in1.size())*sizeof(DataType));
-  sycl_device.memcpyHostToDevice(gpu_data2, in1.data(),(in1.size())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_data1, in1.data(), (in1.size()) * sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_data2, in1.data(), (in1.size()) * sizeof(DataType));
   gpu1.device(sycl_device) = gpu1 * 3.14f;
   gpu2.device(sycl_device) = gpu2 * 2.7f;
-  sycl_device.memcpyDeviceToHost(out1.data(), gpu_data1,(out1.size())*sizeof(DataType));
-  sycl_device.memcpyDeviceToHost(out2.data(), gpu_data1,(out2.size())*sizeof(DataType));
-  sycl_device.memcpyDeviceToHost(out3.data(), gpu_data2,(out3.size())*sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(out1.data(), gpu_data1, (out1.size()) * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(out2.data(), gpu_data1, (out2.size()) * sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(out3.data(), gpu_data2, (out3.size()) * sizeof(DataType));
   sycl_device.synchronize();
 
   for (IndexType i = 0; i < in1.size(); ++i) {
-  //  std::cout << "SYCL DATA : " << out1(i) << "  vs  CPU DATA : " << in1(i) * 3.14f << "\n";
+    //  std::cout << "SYCL DATA : " << out1(i) << "  vs  CPU DATA : " << in1(i) * 3.14f << "\n";
     VERIFY_IS_APPROX(out1(i), in1(i) * 3.14f);
     VERIFY_IS_APPROX(out2(i), in1(i) * 3.14f);
     VERIFY_IS_APPROX(out3(i), in1(i) * 2.7f);
@@ -67,7 +66,7 @@
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-void test_sycl_mem_sync(const Eigen::SyclDevice &sycl_device) {
+void test_sycl_mem_sync(const Eigen::SyclDevice& sycl_device) {
   IndexType size = 20;
   array<IndexType, 1> tensorRange = {{size}};
   Tensor<DataType, 1, DataLayout, IndexType> in1(tensorRange);
@@ -77,14 +76,14 @@
   in1 = in1.random();
   in2 = in1;
 
-  DataType* gpu_data  = static_cast<DataType*>(sycl_device.allocate(in1.size()*sizeof(DataType)));
+  DataType* gpu_data = static_cast<DataType*>(sycl_device.allocate(in1.size() * sizeof(DataType)));
 
   TensorMap<Tensor<DataType, 1, DataLayout, IndexType>> gpu1(gpu_data, tensorRange);
-  sycl_device.memcpyHostToDevice(gpu_data, in1.data(),(in1.size())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_data, in1.data(), (in1.size()) * sizeof(DataType));
   sycl_device.synchronize();
   in1.setZero();
 
-  sycl_device.memcpyDeviceToHost(out.data(), gpu_data, out.size()*sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(out.data(), gpu_data, out.size() * sizeof(DataType));
   sycl_device.synchronize();
 
   for (IndexType i = 0; i < in1.size(); ++i) {
@@ -95,7 +94,7 @@
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-void test_sycl_mem_sync_offsets(const Eigen::SyclDevice &sycl_device) {
+void test_sycl_mem_sync_offsets(const Eigen::SyclDevice& sycl_device) {
   using tensor_type = Tensor<DataType, 1, DataLayout, IndexType>;
   IndexType full_size = 32;
   IndexType half_size = full_size / 2;
@@ -103,7 +102,7 @@
   tensor_type in1(tensorRange);
   tensor_type out(tensorRange);
 
-  DataType* gpu_data  = static_cast<DataType*>(sycl_device.allocate(full_size * sizeof(DataType)));
+  DataType* gpu_data = static_cast<DataType*>(sycl_device.allocate(full_size * sizeof(DataType)));
   TensorMap<tensor_type> gpu1(gpu_data, tensorRange);
 
   in1 = in1.random();
@@ -131,7 +130,7 @@
 
   in1 = in1.random();
   out.setZero();
-  DataType* gpu_data_out  = static_cast<DataType*>(sycl_device.allocate(full_size * sizeof(DataType)));
+  DataType* gpu_data_out = static_cast<DataType*>(sycl_device.allocate(full_size * sizeof(DataType)));
   TensorMap<tensor_type> gpu2(gpu_data_out, tensorRange);
   // Copy all to device, permute copies on device, then copy all back to host
   sycl_device.memcpyHostToDevice(gpu_data, in1.data(), full_size * sizeof(DataType));
@@ -149,7 +148,7 @@
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-void test_sycl_memset_offsets(const Eigen::SyclDevice &sycl_device) {
+void test_sycl_memset_offsets(const Eigen::SyclDevice& sycl_device) {
   using tensor_type = Tensor<DataType, 1, DataLayout, IndexType>;
   IndexType full_size = 32;
   IndexType half_size = full_size / 2;
@@ -162,7 +161,7 @@
   std::memset(cpu_out.data(), 0, half_size * sizeof(DataType));
   std::memset(cpu_out.data() + half_size, 1, half_size * sizeof(DataType));
 
-  DataType* gpu_data  = static_cast<DataType*>(sycl_device.allocate(full_size * sizeof(DataType)));
+  DataType* gpu_data = static_cast<DataType*>(sycl_device.allocate(full_size * sizeof(DataType)));
   TensorMap<tensor_type> gpu1(gpu_data, tensorRange);
 
   sycl_device.memset(gpu_data, 0, half_size * sizeof(DataType));
@@ -177,24 +176,23 @@
 }
 
 template <typename DataType, int DataLayout, typename IndexType>
-void test_sycl_computations(const Eigen::SyclDevice &sycl_device) {
-
+void test_sycl_computations(const Eigen::SyclDevice& sycl_device) {
   IndexType sizeDim1 = 100;
   IndexType sizeDim2 = 10;
   IndexType sizeDim3 = 20;
   array<IndexType, 3> tensorRange = {{sizeDim1, sizeDim2, sizeDim3}};
-  Tensor<DataType, 3,DataLayout, IndexType> in1(tensorRange);
-  Tensor<DataType, 3,DataLayout, IndexType> in2(tensorRange);
-  Tensor<DataType, 3,DataLayout, IndexType> in3(tensorRange);
-  Tensor<DataType, 3,DataLayout, IndexType> out(tensorRange);
+  Tensor<DataType, 3, DataLayout, IndexType> in1(tensorRange);
+  Tensor<DataType, 3, DataLayout, IndexType> in2(tensorRange);
+  Tensor<DataType, 3, DataLayout, IndexType> in3(tensorRange);
+  Tensor<DataType, 3, DataLayout, IndexType> out(tensorRange);
 
   in2 = in2.random();
   in3 = in3.random();
 
-  DataType * gpu_in1_data  = static_cast<DataType*>(sycl_device.allocate(in1.size()*sizeof(DataType)));
-  DataType * gpu_in2_data  = static_cast<DataType*>(sycl_device.allocate(in2.size()*sizeof(DataType)));
-  DataType * gpu_in3_data  = static_cast<DataType*>(sycl_device.allocate(in3.size()*sizeof(DataType)));
-  DataType * gpu_out_data =  static_cast<DataType*>(sycl_device.allocate(out.size()*sizeof(DataType)));
+  DataType* gpu_in1_data = static_cast<DataType*>(sycl_device.allocate(in1.size() * sizeof(DataType)));
+  DataType* gpu_in2_data = static_cast<DataType*>(sycl_device.allocate(in2.size() * sizeof(DataType)));
+  DataType* gpu_in3_data = static_cast<DataType*>(sycl_device.allocate(in3.size() * sizeof(DataType)));
+  DataType* gpu_out_data = static_cast<DataType*>(sycl_device.allocate(out.size() * sizeof(DataType)));
 
   TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> gpu_in1(gpu_in1_data, tensorRange);
   TensorMap<Tensor<DataType, 3, DataLayout, IndexType>> gpu_in2(gpu_in2_data, tensorRange);
@@ -203,13 +201,13 @@
 
   /// a=1.2f
   gpu_in1.device(sycl_device) = gpu_in1.constant(1.2f);
-  sycl_device.memcpyDeviceToHost(in1.data(), gpu_in1_data ,(in1.size())*sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(in1.data(), gpu_in1_data, (in1.size()) * sizeof(DataType));
   sycl_device.synchronize();
 
   for (IndexType i = 0; i < sizeDim1; ++i) {
     for (IndexType j = 0; j < sizeDim2; ++j) {
       for (IndexType k = 0; k < sizeDim3; ++k) {
-        VERIFY_IS_APPROX(in1(i,j,k), 1.2f);
+        VERIFY_IS_APPROX(in1(i, j, k), 1.2f);
       }
     }
   }
@@ -217,31 +215,28 @@
 
   /// a=b*1.2f
   gpu_out.device(sycl_device) = gpu_in1 * 1.2f;
-  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data ,(out.size())*sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data, (out.size()) * sizeof(DataType));
   sycl_device.synchronize();
 
   for (IndexType i = 0; i < sizeDim1; ++i) {
     for (IndexType j = 0; j < sizeDim2; ++j) {
       for (IndexType k = 0; k < sizeDim3; ++k) {
-        VERIFY_IS_APPROX(out(i,j,k),
-                         in1(i,j,k) * 1.2f);
+        VERIFY_IS_APPROX(out(i, j, k), in1(i, j, k) * 1.2f);
       }
     }
   }
   printf("a=b*1.2f Test Passed\n");
 
   /// c=a*b
-  sycl_device.memcpyHostToDevice(gpu_in2_data, in2.data(),(in2.size())*sizeof(DataType));
+  sycl_device.memcpyHostToDevice(gpu_in2_data, in2.data(), (in2.size()) * sizeof(DataType));
   gpu_out.device(sycl_device) = gpu_in1 * gpu_in2;
-  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data,(out.size())*sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data, (out.size()) * sizeof(DataType));
   sycl_device.synchronize();
 
   for (IndexType i = 0; i < sizeDim1; ++i) {
     for (IndexType j = 0; j < sizeDim2; ++j) {
       for (IndexType k = 0; k < sizeDim3; ++k) {
-        VERIFY_IS_APPROX(out(i,j,k),
-                         in1(i,j,k) *
-                             in2(i,j,k));
+        VERIFY_IS_APPROX(out(i, j, k), in1(i, j, k) * in2(i, j, k));
       }
     }
   }
@@ -249,14 +244,12 @@
 
   /// c=a+b
   gpu_out.device(sycl_device) = gpu_in1 + gpu_in2;
-  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data,(out.size())*sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data, (out.size()) * sizeof(DataType));
   sycl_device.synchronize();
   for (IndexType i = 0; i < sizeDim1; ++i) {
     for (IndexType j = 0; j < sizeDim2; ++j) {
       for (IndexType k = 0; k < sizeDim3; ++k) {
-        VERIFY_IS_APPROX(out(i,j,k),
-                         in1(i,j,k) +
-                             in2(i,j,k));
+        VERIFY_IS_APPROX(out(i, j, k), in1(i, j, k) + in2(i, j, k));
       }
     }
   }
@@ -264,45 +257,39 @@
 
   /// c=a*a
   gpu_out.device(sycl_device) = gpu_in1 * gpu_in1;
-  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data,(out.size())*sizeof(DataType));
+  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data, (out.size()) * sizeof(DataType));
   sycl_device.synchronize();
   for (IndexType i = 0; i < sizeDim1; ++i) {
     for (IndexType j = 0; j < sizeDim2; ++j) {
       for (IndexType k = 0; k < sizeDim3; ++k) {
-        VERIFY_IS_APPROX(out(i,j,k),
-                         in1(i,j,k) *
-                             in1(i,j,k));
+        VERIFY_IS_APPROX(out(i, j, k), in1(i, j, k) * in1(i, j, k));
       }
     }
   }
   printf("c= a*a Test Passed\n");
 
-  //a*3.14f + b*2.7f
-  gpu_out.device(sycl_device) =  gpu_in1 * gpu_in1.constant(3.14f) + gpu_in2 * gpu_in2.constant(2.7f);
-  sycl_device.memcpyDeviceToHost(out.data(),gpu_out_data,(out.size())*sizeof(DataType));
+  // a*3.14f + b*2.7f
+  gpu_out.device(sycl_device) = gpu_in1 * gpu_in1.constant(3.14f) + gpu_in2 * gpu_in2.constant(2.7f);
+  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data, (out.size()) * sizeof(DataType));
   sycl_device.synchronize();
   for (IndexType i = 0; i < sizeDim1; ++i) {
     for (IndexType j = 0; j < sizeDim2; ++j) {
       for (IndexType k = 0; k < sizeDim3; ++k) {
-        VERIFY_IS_APPROX(out(i,j,k),
-                         in1(i,j,k) * 3.14f
-                       + in2(i,j,k) * 2.7f);
+        VERIFY_IS_APPROX(out(i, j, k), in1(i, j, k) * 3.14f + in2(i, j, k) * 2.7f);
       }
     }
   }
   printf("a*3.14f + b*2.7f Test Passed\n");
 
-  ///d= (a>0.5? b:c)
-  sycl_device.memcpyHostToDevice(gpu_in3_data, in3.data(),(in3.size())*sizeof(DataType));
-  gpu_out.device(sycl_device) =(gpu_in1 > gpu_in1.constant(0.5f)).select(gpu_in2, gpu_in3);
-  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data,(out.size())*sizeof(DataType));
+  /// d= (a>0.5? b:c)
+  sycl_device.memcpyHostToDevice(gpu_in3_data, in3.data(), (in3.size()) * sizeof(DataType));
+  gpu_out.device(sycl_device) = (gpu_in1 > gpu_in1.constant(0.5f)).select(gpu_in2, gpu_in3);
+  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data, (out.size()) * sizeof(DataType));
   sycl_device.synchronize();
   for (IndexType i = 0; i < sizeDim1; ++i) {
     for (IndexType j = 0; j < sizeDim2; ++j) {
       for (IndexType k = 0; k < sizeDim3; ++k) {
-        VERIFY_IS_APPROX(out(i, j, k), (in1(i, j, k) > 0.5f)
-                                                ? in2(i, j, k)
-                                                : in3(i, j, k));
+        VERIFY_IS_APPROX(out(i, j, k), (in1(i, j, k) > 0.5f) ? in2(i, j, k) : in3(i, j, k));
       }
     }
   }
@@ -312,34 +299,34 @@
   sycl_device.deallocate(gpu_in3_data);
   sycl_device.deallocate(gpu_out_data);
 }
-template<typename Scalar1, typename Scalar2,  int DataLayout, typename IndexType>
-static void test_sycl_cast(const Eigen::SyclDevice& sycl_device){
-    IndexType size = 20;
-    array<IndexType, 1> tensorRange = {{size}};
-    Tensor<Scalar1, 1, DataLayout, IndexType> in(tensorRange);
-    Tensor<Scalar2, 1, DataLayout, IndexType> out(tensorRange);
-    Tensor<Scalar2, 1, DataLayout, IndexType> out_host(tensorRange);
+template <typename Scalar1, typename Scalar2, int DataLayout, typename IndexType>
+static void test_sycl_cast(const Eigen::SyclDevice& sycl_device) {
+  IndexType size = 20;
+  array<IndexType, 1> tensorRange = {{size}};
+  Tensor<Scalar1, 1, DataLayout, IndexType> in(tensorRange);
+  Tensor<Scalar2, 1, DataLayout, IndexType> out(tensorRange);
+  Tensor<Scalar2, 1, DataLayout, IndexType> out_host(tensorRange);
 
-    in = in.random();
+  in = in.random();
 
-    Scalar1* gpu_in_data  = static_cast<Scalar1*>(sycl_device.allocate(in.size()*sizeof(Scalar1)));
-    Scalar2 * gpu_out_data =  static_cast<Scalar2*>(sycl_device.allocate(out.size()*sizeof(Scalar2)));
+  Scalar1* gpu_in_data = static_cast<Scalar1*>(sycl_device.allocate(in.size() * sizeof(Scalar1)));
+  Scalar2* gpu_out_data = static_cast<Scalar2*>(sycl_device.allocate(out.size() * sizeof(Scalar2)));
 
-    TensorMap<Tensor<Scalar1, 1, DataLayout, IndexType>> gpu_in(gpu_in_data, tensorRange);
-    TensorMap<Tensor<Scalar2, 1, DataLayout, IndexType>> gpu_out(gpu_out_data, tensorRange);
-    sycl_device.memcpyHostToDevice(gpu_in_data, in.data(),(in.size())*sizeof(Scalar1));
-    gpu_out.device(sycl_device) = gpu_in. template cast<Scalar2>();
-    sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data, out.size()*sizeof(Scalar2));
-    out_host = in. template cast<Scalar2>();
-    for(IndexType i=0; i< size; i++)
-    {
-      VERIFY_IS_APPROX(out(i), out_host(i));
-    }
-    printf("cast Test Passed\n");
-    sycl_device.deallocate(gpu_in_data);
-    sycl_device.deallocate(gpu_out_data);
+  TensorMap<Tensor<Scalar1, 1, DataLayout, IndexType>> gpu_in(gpu_in_data, tensorRange);
+  TensorMap<Tensor<Scalar2, 1, DataLayout, IndexType>> gpu_out(gpu_out_data, tensorRange);
+  sycl_device.memcpyHostToDevice(gpu_in_data, in.data(), (in.size()) * sizeof(Scalar1));
+  gpu_out.device(sycl_device) = gpu_in.template cast<Scalar2>();
+  sycl_device.memcpyDeviceToHost(out.data(), gpu_out_data, out.size() * sizeof(Scalar2));
+  out_host = in.template cast<Scalar2>();
+  for (IndexType i = 0; i < size; i++) {
+    VERIFY_IS_APPROX(out(i), out_host(i));
+  }
+  printf("cast Test Passed\n");
+  sycl_device.deallocate(gpu_in_data);
+  sycl_device.deallocate(gpu_out_data);
 }
-template<typename DataType, typename dev_Selector> void sycl_computing_test_per_device(dev_Selector s){
+template <typename DataType, typename dev_Selector>
+void sycl_computing_test_per_device(dev_Selector s) {
   QueueInterface queueInterface(s);
   auto sycl_device = Eigen::SyclDevice(&queueInterface);
   test_sycl_mem_transfers<DataType, RowMajor, int64_t>(sycl_device);
@@ -355,7 +342,7 @@
 }
 
 EIGEN_DECLARE_TEST(cxx11_tensor_sycl) {
-  for (const auto& device :Eigen::get_sycl_supported_devices()) {
+  for (const auto& device : Eigen::get_sycl_supported_devices()) {
     CALL_SUBTEST(sycl_computing_test_per_device<float>(device));
   }
 }
diff --git a/unsupported/test/cxx11_tensor_symmetry.cpp b/unsupported/test/cxx11_tensor_symmetry.cpp
index fed269a..16173b9 100644
--- a/unsupported/test/cxx11_tensor_symmetry.cpp
+++ b/unsupported/test/cxx11_tensor_symmetry.cpp
@@ -15,45 +15,42 @@
 #include <map>
 #include <set>
 
-using Eigen::Tensor;
-using Eigen::SGroup;
+using Eigen::AntiHermiticity;
+using Eigen::AntiSymmetry;
 using Eigen::DynamicSGroup;
+using Eigen::Hermiticity;
+using Eigen::SGroup;
 using Eigen::StaticSGroup;
 using Eigen::Symmetry;
-using Eigen::AntiSymmetry;
-using Eigen::Hermiticity;
-using Eigen::AntiHermiticity;
+using Eigen::Tensor;
 
-using Eigen::NegationFlag;
 using Eigen::ConjugationFlag;
-using Eigen::GlobalZeroFlag;
-using Eigen::GlobalRealFlag;
 using Eigen::GlobalImagFlag;
+using Eigen::GlobalRealFlag;
+using Eigen::GlobalZeroFlag;
+using Eigen::NegationFlag;
 
 // helper function to determine if the compiler intantiated a static
 // or dynamic symmetry group
-template<typename... Sym>
-bool isDynGroup(StaticSGroup<Sym...> const& dummy)
-{
+template <typename... Sym>
+bool isDynGroup(StaticSGroup<Sym...> const& dummy) {
   (void)dummy;
   return false;
 }
 
-bool isDynGroup(DynamicSGroup const& dummy)
-{
+bool isDynGroup(DynamicSGroup const& dummy) {
   (void)dummy;
   return true;
 }
 
 // helper class for checking that the symmetry groups are correct
 struct checkIdx {
-  template<typename ArrType>
-  static inline int doCheck_(ArrType e, int flags, int dummy, std::set<uint64_t>& found, std::map<uint64_t, int> const& expected)
-  {
+  template <typename ArrType>
+  static inline int doCheck_(ArrType e, int flags, int dummy, std::set<uint64_t>& found,
+                             std::map<uint64_t, int> const& expected) {
     // use decimal representation of value
     uint64_t value = e[0];
-    for (std::size_t i = 1; i < e.size(); i++)
-      value = value * 10 + e[i];
+    for (std::size_t i = 1; i < e.size(); i++) value = value * 10 + e[i];
 
     // we want to make sure that we find each element
     auto it = expected.find(value);
@@ -69,36 +66,32 @@
     return dummy;
   }
 
-  static inline int run(std::vector<int> e, int flags, int dummy, std::set<uint64_t>& found, std::map<uint64_t, int> const& expected)
-  {
+  static inline int run(std::vector<int> e, int flags, int dummy, std::set<uint64_t>& found,
+                        std::map<uint64_t, int> const& expected) {
     return doCheck_(e, flags, dummy, found, expected);
   }
 
-  template<std::size_t N>
-  static inline int run(std::array<int, N> e, int flags, int dummy, std::set<uint64_t>& found, std::map<uint64_t, int> const& expected)
-  {
+  template <std::size_t N>
+  static inline int run(std::array<int, N> e, int flags, int dummy, std::set<uint64_t>& found,
+                        std::map<uint64_t, int> const& expected) {
     return doCheck_(e, flags, dummy, found, expected);
   }
 };
 
-static void test_symgroups_static()
-{
-  std::array<int, 7> identity{{0,1,2,3,4,5,6}};
+static void test_symgroups_static() {
+  std::array<int, 7> identity{{0, 1, 2, 3, 4, 5, 6}};
 
   // Simple static symmetry group
-  StaticSGroup<
-    AntiSymmetry<0,1>,
-    Hermiticity<0,2>
-  > group;
+  StaticSGroup<AntiSymmetry<0, 1>, Hermiticity<0, 2>> group;
 
   std::set<uint64_t> found;
   std::map<uint64_t, int> expected;
-  expected[ 123456] = 0;
+  expected[123456] = 0;
   expected[1023456] = NegationFlag;
   expected[2103456] = ConjugationFlag;
   expected[1203456] = ConjugationFlag | NegationFlag;
   expected[2013456] = ConjugationFlag | NegationFlag;
-  expected[ 213456] = ConjugationFlag;
+  expected[213456] = ConjugationFlag;
 
   VERIFY_IS_EQUAL(group.size(), 6u);
   VERIFY_IS_EQUAL(group.globalFlags(), GlobalImagFlag);
@@ -106,28 +99,26 @@
   VERIFY_IS_EQUAL(found.size(), 6u);
 }
 
-static void test_symgroups_dynamic()
-{
+static void test_symgroups_dynamic() {
   std::vector<int> identity;
-  for (int i = 0; i <= 6; i++)
-    identity.push_back(i);
+  for (int i = 0; i <= 6; i++) identity.push_back(i);
 
   // Simple dynamic symmetry group
   DynamicSGroup group;
-  group.add(0,1,NegationFlag);
-  group.add(0,2,ConjugationFlag);
+  group.add(0, 1, NegationFlag);
+  group.add(0, 2, ConjugationFlag);
 
   VERIFY_IS_EQUAL(group.size(), 6u);
   VERIFY_IS_EQUAL(group.globalFlags(), GlobalImagFlag);
 
   std::set<uint64_t> found;
   std::map<uint64_t, int> expected;
-  expected[ 123456] = 0;
+  expected[123456] = 0;
   expected[1023456] = NegationFlag;
   expected[2103456] = ConjugationFlag;
   expected[1203456] = ConjugationFlag | NegationFlag;
   expected[2013456] = ConjugationFlag | NegationFlag;
-  expected[ 213456] = ConjugationFlag;
+  expected[213456] = ConjugationFlag;
 
   VERIFY_IS_EQUAL(group.size(), 6u);
   VERIFY_IS_EQUAL(group.globalFlags(), GlobalImagFlag);
@@ -135,27 +126,23 @@
   VERIFY_IS_EQUAL(found.size(), 6u);
 }
 
-static void test_symgroups_selection()
-{
-  std::array<int, 7> identity7{{0,1,2,3,4,5,6}};
-  std::array<int, 10> identity10{{0,1,2,3,4,5,6,7,8,9}};
+static void test_symgroups_selection() {
+  std::array<int, 7> identity7{{0, 1, 2, 3, 4, 5, 6}};
+  std::array<int, 10> identity10{{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}};
 
   {
     // Do the same test as in test_symgroups_static but
     // require selection via SGroup
-    SGroup<
-      AntiSymmetry<0,1>,
-      Hermiticity<0,2>
-    > group;
+    SGroup<AntiSymmetry<0, 1>, Hermiticity<0, 2>> group;
 
     std::set<uint64_t> found;
     std::map<uint64_t, int> expected;
-    expected[ 123456] = 0;
+    expected[123456] = 0;
     expected[1023456] = NegationFlag;
     expected[2103456] = ConjugationFlag;
     expected[1203456] = ConjugationFlag | NegationFlag;
     expected[2013456] = ConjugationFlag | NegationFlag;
-    expected[ 213456] = ConjugationFlag;
+    expected[213456] = ConjugationFlag;
 
     VERIFY(!isDynGroup(group));
     VERIFY_IS_EQUAL(group.size(), 6u);
@@ -168,24 +155,42 @@
     // simple factorizing group: 5 generators, 2^5 = 32 elements
     // selection should make this dynamic, although static group
     // can still be reasonably generated
-    SGroup<
-      Symmetry<0,1>,
-      Symmetry<2,3>,
-      Symmetry<4,5>,
-      Symmetry<6,7>,
-      Symmetry<8,9>
-    > group;
+    SGroup<Symmetry<0, 1>, Symmetry<2, 3>, Symmetry<4, 5>, Symmetry<6, 7>, Symmetry<8, 9>> group;
 
     std::set<uint64_t> found;
     std::map<uint64_t, int> expected;
-    expected[ 123456789] = 0; expected[ 123456798] = 0; expected[ 123457689] = 0; expected[ 123457698] = 0;
-    expected[ 123546789] = 0; expected[ 123546798] = 0; expected[ 123547689] = 0; expected[ 123547698] = 0;
-    expected[ 132456789] = 0; expected[ 132456798] = 0; expected[ 132457689] = 0; expected[ 132457698] = 0;
-    expected[ 132546789] = 0; expected[ 132546798] = 0; expected[ 132547689] = 0; expected[ 132547698] = 0;
-    expected[1023456789] = 0; expected[1023456798] = 0; expected[1023457689] = 0; expected[1023457698] = 0;
-    expected[1023546789] = 0; expected[1023546798] = 0; expected[1023547689] = 0; expected[1023547698] = 0;
-    expected[1032456789] = 0; expected[1032456798] = 0; expected[1032457689] = 0; expected[1032457698] = 0;
-    expected[1032546789] = 0; expected[1032546798] = 0; expected[1032547689] = 0; expected[1032547698] = 0;
+    expected[123456789] = 0;
+    expected[123456798] = 0;
+    expected[123457689] = 0;
+    expected[123457698] = 0;
+    expected[123546789] = 0;
+    expected[123546798] = 0;
+    expected[123547689] = 0;
+    expected[123547698] = 0;
+    expected[132456789] = 0;
+    expected[132456798] = 0;
+    expected[132457689] = 0;
+    expected[132457698] = 0;
+    expected[132546789] = 0;
+    expected[132546798] = 0;
+    expected[132547689] = 0;
+    expected[132547698] = 0;
+    expected[1023456789] = 0;
+    expected[1023456798] = 0;
+    expected[1023457689] = 0;
+    expected[1023457698] = 0;
+    expected[1023546789] = 0;
+    expected[1023546798] = 0;
+    expected[1023547689] = 0;
+    expected[1023547698] = 0;
+    expected[1032456789] = 0;
+    expected[1032456798] = 0;
+    expected[1032457689] = 0;
+    expected[1032457698] = 0;
+    expected[1032546789] = 0;
+    expected[1032546798] = 0;
+    expected[1032547689] = 0;
+    expected[1032547698] = 0;
 
     VERIFY(isDynGroup(group));
     VERIFY_IS_EQUAL(group.size(), 32u);
@@ -196,13 +201,7 @@
     // no verify that we could also generate a static group
     // with these generators
     found.clear();
-    StaticSGroup<
-      Symmetry<0,1>,
-      Symmetry<2,3>,
-      Symmetry<4,5>,
-      Symmetry<6,7>,
-      Symmetry<8,9>
-    > group_static;
+    StaticSGroup<Symmetry<0, 1>, Symmetry<2, 3>, Symmetry<4, 5>, Symmetry<6, 7>, Symmetry<8, 9>> group_static;
     VERIFY_IS_EQUAL(group_static.size(), 32u);
     VERIFY_IS_EQUAL(group_static.globalFlags(), 0);
     group_static.apply<checkIdx, int>(identity10, 0, found, expected);
@@ -211,441 +210,432 @@
 
   {
     // try to create a HUGE group
-    SGroup<
-      Symmetry<0,1>,
-      Symmetry<1,2>,
-      Symmetry<2,3>,
-      Symmetry<3,4>,
-      Symmetry<4,5>,
-      Symmetry<5,6>
-    > group;
+    SGroup<Symmetry<0, 1>, Symmetry<1, 2>, Symmetry<2, 3>, Symmetry<3, 4>, Symmetry<4, 5>, Symmetry<5, 6>> group;
 
     std::set<uint64_t> found;
     uint64_t pre_expected[5040] = {
-       123456, 1023456,  213456, 2013456, 1203456, 2103456,  132456, 1032456,  312456, 3012456, 1302456, 3102456,
-       231456, 2031456,  321456, 3021456, 2301456, 3201456, 1230456, 2130456, 1320456, 3120456, 2310456, 3210456,
-       124356, 1024356,  214356, 2014356, 1204356, 2104356,  142356, 1042356,  412356, 4012356, 1402356, 4102356,
-       241356, 2041356,  421356, 4021356, 2401356, 4201356, 1240356, 2140356, 1420356, 4120356, 2410356, 4210356,
-       134256, 1034256,  314256, 3014256, 1304256, 3104256,  143256, 1043256,  413256, 4013256, 1403256, 4103256,
-       341256, 3041256,  431256, 4031256, 3401256, 4301256, 1340256, 3140256, 1430256, 4130256, 3410256, 4310256,
-       234156, 2034156,  324156, 3024156, 2304156, 3204156,  243156, 2043156,  423156, 4023156, 2403156, 4203156,
-       342156, 3042156,  432156, 4032156, 3402156, 4302156, 2340156, 3240156, 2430156, 4230156, 3420156, 4320156,
-      1234056, 2134056, 1324056, 3124056, 2314056, 3214056, 1243056, 2143056, 1423056, 4123056, 2413056, 4213056,
-      1342056, 3142056, 1432056, 4132056, 3412056, 4312056, 2341056, 3241056, 2431056, 4231056, 3421056, 4321056,
-       123546, 1023546,  213546, 2013546, 1203546, 2103546,  132546, 1032546,  312546, 3012546, 1302546, 3102546,
-       231546, 2031546,  321546, 3021546, 2301546, 3201546, 1230546, 2130546, 1320546, 3120546, 2310546, 3210546,
-       125346, 1025346,  215346, 2015346, 1205346, 2105346,  152346, 1052346,  512346, 5012346, 1502346, 5102346,
-       251346, 2051346,  521346, 5021346, 2501346, 5201346, 1250346, 2150346, 1520346, 5120346, 2510346, 5210346,
-       135246, 1035246,  315246, 3015246, 1305246, 3105246,  153246, 1053246,  513246, 5013246, 1503246, 5103246,
-       351246, 3051246,  531246, 5031246, 3501246, 5301246, 1350246, 3150246, 1530246, 5130246, 3510246, 5310246,
-       235146, 2035146,  325146, 3025146, 2305146, 3205146,  253146, 2053146,  523146, 5023146, 2503146, 5203146,
-       352146, 3052146,  532146, 5032146, 3502146, 5302146, 2350146, 3250146, 2530146, 5230146, 3520146, 5320146,
-      1235046, 2135046, 1325046, 3125046, 2315046, 3215046, 1253046, 2153046, 1523046, 5123046, 2513046, 5213046,
-      1352046, 3152046, 1532046, 5132046, 3512046, 5312046, 2351046, 3251046, 2531046, 5231046, 3521046, 5321046,
-       124536, 1024536,  214536, 2014536, 1204536, 2104536,  142536, 1042536,  412536, 4012536, 1402536, 4102536,
-       241536, 2041536,  421536, 4021536, 2401536, 4201536, 1240536, 2140536, 1420536, 4120536, 2410536, 4210536,
-       125436, 1025436,  215436, 2015436, 1205436, 2105436,  152436, 1052436,  512436, 5012436, 1502436, 5102436,
-       251436, 2051436,  521436, 5021436, 2501436, 5201436, 1250436, 2150436, 1520436, 5120436, 2510436, 5210436,
-       145236, 1045236,  415236, 4015236, 1405236, 4105236,  154236, 1054236,  514236, 5014236, 1504236, 5104236,
-       451236, 4051236,  541236, 5041236, 4501236, 5401236, 1450236, 4150236, 1540236, 5140236, 4510236, 5410236,
-       245136, 2045136,  425136, 4025136, 2405136, 4205136,  254136, 2054136,  524136, 5024136, 2504136, 5204136,
-       452136, 4052136,  542136, 5042136, 4502136, 5402136, 2450136, 4250136, 2540136, 5240136, 4520136, 5420136,
-      1245036, 2145036, 1425036, 4125036, 2415036, 4215036, 1254036, 2154036, 1524036, 5124036, 2514036, 5214036,
-      1452036, 4152036, 1542036, 5142036, 4512036, 5412036, 2451036, 4251036, 2541036, 5241036, 4521036, 5421036,
-       134526, 1034526,  314526, 3014526, 1304526, 3104526,  143526, 1043526,  413526, 4013526, 1403526, 4103526,
-       341526, 3041526,  431526, 4031526, 3401526, 4301526, 1340526, 3140526, 1430526, 4130526, 3410526, 4310526,
-       135426, 1035426,  315426, 3015426, 1305426, 3105426,  153426, 1053426,  513426, 5013426, 1503426, 5103426,
-       351426, 3051426,  531426, 5031426, 3501426, 5301426, 1350426, 3150426, 1530426, 5130426, 3510426, 5310426,
-       145326, 1045326,  415326, 4015326, 1405326, 4105326,  154326, 1054326,  514326, 5014326, 1504326, 5104326,
-       451326, 4051326,  541326, 5041326, 4501326, 5401326, 1450326, 4150326, 1540326, 5140326, 4510326, 5410326,
-       345126, 3045126,  435126, 4035126, 3405126, 4305126,  354126, 3054126,  534126, 5034126, 3504126, 5304126,
-       453126, 4053126,  543126, 5043126, 4503126, 5403126, 3450126, 4350126, 3540126, 5340126, 4530126, 5430126,
-      1345026, 3145026, 1435026, 4135026, 3415026, 4315026, 1354026, 3154026, 1534026, 5134026, 3514026, 5314026,
-      1453026, 4153026, 1543026, 5143026, 4513026, 5413026, 3451026, 4351026, 3541026, 5341026, 4531026, 5431026,
-       234516, 2034516,  324516, 3024516, 2304516, 3204516,  243516, 2043516,  423516, 4023516, 2403516, 4203516,
-       342516, 3042516,  432516, 4032516, 3402516, 4302516, 2340516, 3240516, 2430516, 4230516, 3420516, 4320516,
-       235416, 2035416,  325416, 3025416, 2305416, 3205416,  253416, 2053416,  523416, 5023416, 2503416, 5203416,
-       352416, 3052416,  532416, 5032416, 3502416, 5302416, 2350416, 3250416, 2530416, 5230416, 3520416, 5320416,
-       245316, 2045316,  425316, 4025316, 2405316, 4205316,  254316, 2054316,  524316, 5024316, 2504316, 5204316,
-       452316, 4052316,  542316, 5042316, 4502316, 5402316, 2450316, 4250316, 2540316, 5240316, 4520316, 5420316,
-       345216, 3045216,  435216, 4035216, 3405216, 4305216,  354216, 3054216,  534216, 5034216, 3504216, 5304216,
-       453216, 4053216,  543216, 5043216, 4503216, 5403216, 3450216, 4350216, 3540216, 5340216, 4530216, 5430216,
-      2345016, 3245016, 2435016, 4235016, 3425016, 4325016, 2354016, 3254016, 2534016, 5234016, 3524016, 5324016,
-      2453016, 4253016, 2543016, 5243016, 4523016, 5423016, 3452016, 4352016, 3542016, 5342016, 4532016, 5432016,
-      1234506, 2134506, 1324506, 3124506, 2314506, 3214506, 1243506, 2143506, 1423506, 4123506, 2413506, 4213506,
-      1342506, 3142506, 1432506, 4132506, 3412506, 4312506, 2341506, 3241506, 2431506, 4231506, 3421506, 4321506,
-      1235406, 2135406, 1325406, 3125406, 2315406, 3215406, 1253406, 2153406, 1523406, 5123406, 2513406, 5213406,
-      1352406, 3152406, 1532406, 5132406, 3512406, 5312406, 2351406, 3251406, 2531406, 5231406, 3521406, 5321406,
-      1245306, 2145306, 1425306, 4125306, 2415306, 4215306, 1254306, 2154306, 1524306, 5124306, 2514306, 5214306,
-      1452306, 4152306, 1542306, 5142306, 4512306, 5412306, 2451306, 4251306, 2541306, 5241306, 4521306, 5421306,
-      1345206, 3145206, 1435206, 4135206, 3415206, 4315206, 1354206, 3154206, 1534206, 5134206, 3514206, 5314206,
-      1453206, 4153206, 1543206, 5143206, 4513206, 5413206, 3451206, 4351206, 3541206, 5341206, 4531206, 5431206,
-      2345106, 3245106, 2435106, 4235106, 3425106, 4325106, 2354106, 3254106, 2534106, 5234106, 3524106, 5324106,
-      2453106, 4253106, 2543106, 5243106, 4523106, 5423106, 3452106, 4352106, 3542106, 5342106, 4532106, 5432106,
-       123465, 1023465,  213465, 2013465, 1203465, 2103465,  132465, 1032465,  312465, 3012465, 1302465, 3102465,
-       231465, 2031465,  321465, 3021465, 2301465, 3201465, 1230465, 2130465, 1320465, 3120465, 2310465, 3210465,
-       124365, 1024365,  214365, 2014365, 1204365, 2104365,  142365, 1042365,  412365, 4012365, 1402365, 4102365,
-       241365, 2041365,  421365, 4021365, 2401365, 4201365, 1240365, 2140365, 1420365, 4120365, 2410365, 4210365,
-       134265, 1034265,  314265, 3014265, 1304265, 3104265,  143265, 1043265,  413265, 4013265, 1403265, 4103265,
-       341265, 3041265,  431265, 4031265, 3401265, 4301265, 1340265, 3140265, 1430265, 4130265, 3410265, 4310265,
-       234165, 2034165,  324165, 3024165, 2304165, 3204165,  243165, 2043165,  423165, 4023165, 2403165, 4203165,
-       342165, 3042165,  432165, 4032165, 3402165, 4302165, 2340165, 3240165, 2430165, 4230165, 3420165, 4320165,
-      1234065, 2134065, 1324065, 3124065, 2314065, 3214065, 1243065, 2143065, 1423065, 4123065, 2413065, 4213065,
-      1342065, 3142065, 1432065, 4132065, 3412065, 4312065, 2341065, 3241065, 2431065, 4231065, 3421065, 4321065,
-       123645, 1023645,  213645, 2013645, 1203645, 2103645,  132645, 1032645,  312645, 3012645, 1302645, 3102645,
-       231645, 2031645,  321645, 3021645, 2301645, 3201645, 1230645, 2130645, 1320645, 3120645, 2310645, 3210645,
-       126345, 1026345,  216345, 2016345, 1206345, 2106345,  162345, 1062345,  612345, 6012345, 1602345, 6102345,
-       261345, 2061345,  621345, 6021345, 2601345, 6201345, 1260345, 2160345, 1620345, 6120345, 2610345, 6210345,
-       136245, 1036245,  316245, 3016245, 1306245, 3106245,  163245, 1063245,  613245, 6013245, 1603245, 6103245,
-       361245, 3061245,  631245, 6031245, 3601245, 6301245, 1360245, 3160245, 1630245, 6130245, 3610245, 6310245,
-       236145, 2036145,  326145, 3026145, 2306145, 3206145,  263145, 2063145,  623145, 6023145, 2603145, 6203145,
-       362145, 3062145,  632145, 6032145, 3602145, 6302145, 2360145, 3260145, 2630145, 6230145, 3620145, 6320145,
-      1236045, 2136045, 1326045, 3126045, 2316045, 3216045, 1263045, 2163045, 1623045, 6123045, 2613045, 6213045,
-      1362045, 3162045, 1632045, 6132045, 3612045, 6312045, 2361045, 3261045, 2631045, 6231045, 3621045, 6321045,
-       124635, 1024635,  214635, 2014635, 1204635, 2104635,  142635, 1042635,  412635, 4012635, 1402635, 4102635,
-       241635, 2041635,  421635, 4021635, 2401635, 4201635, 1240635, 2140635, 1420635, 4120635, 2410635, 4210635,
-       126435, 1026435,  216435, 2016435, 1206435, 2106435,  162435, 1062435,  612435, 6012435, 1602435, 6102435,
-       261435, 2061435,  621435, 6021435, 2601435, 6201435, 1260435, 2160435, 1620435, 6120435, 2610435, 6210435,
-       146235, 1046235,  416235, 4016235, 1406235, 4106235,  164235, 1064235,  614235, 6014235, 1604235, 6104235,
-       461235, 4061235,  641235, 6041235, 4601235, 6401235, 1460235, 4160235, 1640235, 6140235, 4610235, 6410235,
-       246135, 2046135,  426135, 4026135, 2406135, 4206135,  264135, 2064135,  624135, 6024135, 2604135, 6204135,
-       462135, 4062135,  642135, 6042135, 4602135, 6402135, 2460135, 4260135, 2640135, 6240135, 4620135, 6420135,
-      1246035, 2146035, 1426035, 4126035, 2416035, 4216035, 1264035, 2164035, 1624035, 6124035, 2614035, 6214035,
-      1462035, 4162035, 1642035, 6142035, 4612035, 6412035, 2461035, 4261035, 2641035, 6241035, 4621035, 6421035,
-       134625, 1034625,  314625, 3014625, 1304625, 3104625,  143625, 1043625,  413625, 4013625, 1403625, 4103625,
-       341625, 3041625,  431625, 4031625, 3401625, 4301625, 1340625, 3140625, 1430625, 4130625, 3410625, 4310625,
-       136425, 1036425,  316425, 3016425, 1306425, 3106425,  163425, 1063425,  613425, 6013425, 1603425, 6103425,
-       361425, 3061425,  631425, 6031425, 3601425, 6301425, 1360425, 3160425, 1630425, 6130425, 3610425, 6310425,
-       146325, 1046325,  416325, 4016325, 1406325, 4106325,  164325, 1064325,  614325, 6014325, 1604325, 6104325,
-       461325, 4061325,  641325, 6041325, 4601325, 6401325, 1460325, 4160325, 1640325, 6140325, 4610325, 6410325,
-       346125, 3046125,  436125, 4036125, 3406125, 4306125,  364125, 3064125,  634125, 6034125, 3604125, 6304125,
-       463125, 4063125,  643125, 6043125, 4603125, 6403125, 3460125, 4360125, 3640125, 6340125, 4630125, 6430125,
-      1346025, 3146025, 1436025, 4136025, 3416025, 4316025, 1364025, 3164025, 1634025, 6134025, 3614025, 6314025,
-      1463025, 4163025, 1643025, 6143025, 4613025, 6413025, 3461025, 4361025, 3641025, 6341025, 4631025, 6431025,
-       234615, 2034615,  324615, 3024615, 2304615, 3204615,  243615, 2043615,  423615, 4023615, 2403615, 4203615,
-       342615, 3042615,  432615, 4032615, 3402615, 4302615, 2340615, 3240615, 2430615, 4230615, 3420615, 4320615,
-       236415, 2036415,  326415, 3026415, 2306415, 3206415,  263415, 2063415,  623415, 6023415, 2603415, 6203415,
-       362415, 3062415,  632415, 6032415, 3602415, 6302415, 2360415, 3260415, 2630415, 6230415, 3620415, 6320415,
-       246315, 2046315,  426315, 4026315, 2406315, 4206315,  264315, 2064315,  624315, 6024315, 2604315, 6204315,
-       462315, 4062315,  642315, 6042315, 4602315, 6402315, 2460315, 4260315, 2640315, 6240315, 4620315, 6420315,
-       346215, 3046215,  436215, 4036215, 3406215, 4306215,  364215, 3064215,  634215, 6034215, 3604215, 6304215,
-       463215, 4063215,  643215, 6043215, 4603215, 6403215, 3460215, 4360215, 3640215, 6340215, 4630215, 6430215,
-      2346015, 3246015, 2436015, 4236015, 3426015, 4326015, 2364015, 3264015, 2634015, 6234015, 3624015, 6324015,
-      2463015, 4263015, 2643015, 6243015, 4623015, 6423015, 3462015, 4362015, 3642015, 6342015, 4632015, 6432015,
-      1234605, 2134605, 1324605, 3124605, 2314605, 3214605, 1243605, 2143605, 1423605, 4123605, 2413605, 4213605,
-      1342605, 3142605, 1432605, 4132605, 3412605, 4312605, 2341605, 3241605, 2431605, 4231605, 3421605, 4321605,
-      1236405, 2136405, 1326405, 3126405, 2316405, 3216405, 1263405, 2163405, 1623405, 6123405, 2613405, 6213405,
-      1362405, 3162405, 1632405, 6132405, 3612405, 6312405, 2361405, 3261405, 2631405, 6231405, 3621405, 6321405,
-      1246305, 2146305, 1426305, 4126305, 2416305, 4216305, 1264305, 2164305, 1624305, 6124305, 2614305, 6214305,
-      1462305, 4162305, 1642305, 6142305, 4612305, 6412305, 2461305, 4261305, 2641305, 6241305, 4621305, 6421305,
-      1346205, 3146205, 1436205, 4136205, 3416205, 4316205, 1364205, 3164205, 1634205, 6134205, 3614205, 6314205,
-      1463205, 4163205, 1643205, 6143205, 4613205, 6413205, 3461205, 4361205, 3641205, 6341205, 4631205, 6431205,
-      2346105, 3246105, 2436105, 4236105, 3426105, 4326105, 2364105, 3264105, 2634105, 6234105, 3624105, 6324105,
-      2463105, 4263105, 2643105, 6243105, 4623105, 6423105, 3462105, 4362105, 3642105, 6342105, 4632105, 6432105,
-       123564, 1023564,  213564, 2013564, 1203564, 2103564,  132564, 1032564,  312564, 3012564, 1302564, 3102564,
-       231564, 2031564,  321564, 3021564, 2301564, 3201564, 1230564, 2130564, 1320564, 3120564, 2310564, 3210564,
-       125364, 1025364,  215364, 2015364, 1205364, 2105364,  152364, 1052364,  512364, 5012364, 1502364, 5102364,
-       251364, 2051364,  521364, 5021364, 2501364, 5201364, 1250364, 2150364, 1520364, 5120364, 2510364, 5210364,
-       135264, 1035264,  315264, 3015264, 1305264, 3105264,  153264, 1053264,  513264, 5013264, 1503264, 5103264,
-       351264, 3051264,  531264, 5031264, 3501264, 5301264, 1350264, 3150264, 1530264, 5130264, 3510264, 5310264,
-       235164, 2035164,  325164, 3025164, 2305164, 3205164,  253164, 2053164,  523164, 5023164, 2503164, 5203164,
-       352164, 3052164,  532164, 5032164, 3502164, 5302164, 2350164, 3250164, 2530164, 5230164, 3520164, 5320164,
-      1235064, 2135064, 1325064, 3125064, 2315064, 3215064, 1253064, 2153064, 1523064, 5123064, 2513064, 5213064,
-      1352064, 3152064, 1532064, 5132064, 3512064, 5312064, 2351064, 3251064, 2531064, 5231064, 3521064, 5321064,
-       123654, 1023654,  213654, 2013654, 1203654, 2103654,  132654, 1032654,  312654, 3012654, 1302654, 3102654,
-       231654, 2031654,  321654, 3021654, 2301654, 3201654, 1230654, 2130654, 1320654, 3120654, 2310654, 3210654,
-       126354, 1026354,  216354, 2016354, 1206354, 2106354,  162354, 1062354,  612354, 6012354, 1602354, 6102354,
-       261354, 2061354,  621354, 6021354, 2601354, 6201354, 1260354, 2160354, 1620354, 6120354, 2610354, 6210354,
-       136254, 1036254,  316254, 3016254, 1306254, 3106254,  163254, 1063254,  613254, 6013254, 1603254, 6103254,
-       361254, 3061254,  631254, 6031254, 3601254, 6301254, 1360254, 3160254, 1630254, 6130254, 3610254, 6310254,
-       236154, 2036154,  326154, 3026154, 2306154, 3206154,  263154, 2063154,  623154, 6023154, 2603154, 6203154,
-       362154, 3062154,  632154, 6032154, 3602154, 6302154, 2360154, 3260154, 2630154, 6230154, 3620154, 6320154,
-      1236054, 2136054, 1326054, 3126054, 2316054, 3216054, 1263054, 2163054, 1623054, 6123054, 2613054, 6213054,
-      1362054, 3162054, 1632054, 6132054, 3612054, 6312054, 2361054, 3261054, 2631054, 6231054, 3621054, 6321054,
-       125634, 1025634,  215634, 2015634, 1205634, 2105634,  152634, 1052634,  512634, 5012634, 1502634, 5102634,
-       251634, 2051634,  521634, 5021634, 2501634, 5201634, 1250634, 2150634, 1520634, 5120634, 2510634, 5210634,
-       126534, 1026534,  216534, 2016534, 1206534, 2106534,  162534, 1062534,  612534, 6012534, 1602534, 6102534,
-       261534, 2061534,  621534, 6021534, 2601534, 6201534, 1260534, 2160534, 1620534, 6120534, 2610534, 6210534,
-       156234, 1056234,  516234, 5016234, 1506234, 5106234,  165234, 1065234,  615234, 6015234, 1605234, 6105234,
-       561234, 5061234,  651234, 6051234, 5601234, 6501234, 1560234, 5160234, 1650234, 6150234, 5610234, 6510234,
-       256134, 2056134,  526134, 5026134, 2506134, 5206134,  265134, 2065134,  625134, 6025134, 2605134, 6205134,
-       562134, 5062134,  652134, 6052134, 5602134, 6502134, 2560134, 5260134, 2650134, 6250134, 5620134, 6520134,
-      1256034, 2156034, 1526034, 5126034, 2516034, 5216034, 1265034, 2165034, 1625034, 6125034, 2615034, 6215034,
-      1562034, 5162034, 1652034, 6152034, 5612034, 6512034, 2561034, 5261034, 2651034, 6251034, 5621034, 6521034,
-       135624, 1035624,  315624, 3015624, 1305624, 3105624,  153624, 1053624,  513624, 5013624, 1503624, 5103624,
-       351624, 3051624,  531624, 5031624, 3501624, 5301624, 1350624, 3150624, 1530624, 5130624, 3510624, 5310624,
-       136524, 1036524,  316524, 3016524, 1306524, 3106524,  163524, 1063524,  613524, 6013524, 1603524, 6103524,
-       361524, 3061524,  631524, 6031524, 3601524, 6301524, 1360524, 3160524, 1630524, 6130524, 3610524, 6310524,
-       156324, 1056324,  516324, 5016324, 1506324, 5106324,  165324, 1065324,  615324, 6015324, 1605324, 6105324,
-       561324, 5061324,  651324, 6051324, 5601324, 6501324, 1560324, 5160324, 1650324, 6150324, 5610324, 6510324,
-       356124, 3056124,  536124, 5036124, 3506124, 5306124,  365124, 3065124,  635124, 6035124, 3605124, 6305124,
-       563124, 5063124,  653124, 6053124, 5603124, 6503124, 3560124, 5360124, 3650124, 6350124, 5630124, 6530124,
-      1356024, 3156024, 1536024, 5136024, 3516024, 5316024, 1365024, 3165024, 1635024, 6135024, 3615024, 6315024,
-      1563024, 5163024, 1653024, 6153024, 5613024, 6513024, 3561024, 5361024, 3651024, 6351024, 5631024, 6531024,
-       235614, 2035614,  325614, 3025614, 2305614, 3205614,  253614, 2053614,  523614, 5023614, 2503614, 5203614,
-       352614, 3052614,  532614, 5032614, 3502614, 5302614, 2350614, 3250614, 2530614, 5230614, 3520614, 5320614,
-       236514, 2036514,  326514, 3026514, 2306514, 3206514,  263514, 2063514,  623514, 6023514, 2603514, 6203514,
-       362514, 3062514,  632514, 6032514, 3602514, 6302514, 2360514, 3260514, 2630514, 6230514, 3620514, 6320514,
-       256314, 2056314,  526314, 5026314, 2506314, 5206314,  265314, 2065314,  625314, 6025314, 2605314, 6205314,
-       562314, 5062314,  652314, 6052314, 5602314, 6502314, 2560314, 5260314, 2650314, 6250314, 5620314, 6520314,
-       356214, 3056214,  536214, 5036214, 3506214, 5306214,  365214, 3065214,  635214, 6035214, 3605214, 6305214,
-       563214, 5063214,  653214, 6053214, 5603214, 6503214, 3560214, 5360214, 3650214, 6350214, 5630214, 6530214,
-      2356014, 3256014, 2536014, 5236014, 3526014, 5326014, 2365014, 3265014, 2635014, 6235014, 3625014, 6325014,
-      2563014, 5263014, 2653014, 6253014, 5623014, 6523014, 3562014, 5362014, 3652014, 6352014, 5632014, 6532014,
-      1235604, 2135604, 1325604, 3125604, 2315604, 3215604, 1253604, 2153604, 1523604, 5123604, 2513604, 5213604,
-      1352604, 3152604, 1532604, 5132604, 3512604, 5312604, 2351604, 3251604, 2531604, 5231604, 3521604, 5321604,
-      1236504, 2136504, 1326504, 3126504, 2316504, 3216504, 1263504, 2163504, 1623504, 6123504, 2613504, 6213504,
-      1362504, 3162504, 1632504, 6132504, 3612504, 6312504, 2361504, 3261504, 2631504, 6231504, 3621504, 6321504,
-      1256304, 2156304, 1526304, 5126304, 2516304, 5216304, 1265304, 2165304, 1625304, 6125304, 2615304, 6215304,
-      1562304, 5162304, 1652304, 6152304, 5612304, 6512304, 2561304, 5261304, 2651304, 6251304, 5621304, 6521304,
-      1356204, 3156204, 1536204, 5136204, 3516204, 5316204, 1365204, 3165204, 1635204, 6135204, 3615204, 6315204,
-      1563204, 5163204, 1653204, 6153204, 5613204, 6513204, 3561204, 5361204, 3651204, 6351204, 5631204, 6531204,
-      2356104, 3256104, 2536104, 5236104, 3526104, 5326104, 2365104, 3265104, 2635104, 6235104, 3625104, 6325104,
-      2563104, 5263104, 2653104, 6253104, 5623104, 6523104, 3562104, 5362104, 3652104, 6352104, 5632104, 6532104,
-       124563, 1024563,  214563, 2014563, 1204563, 2104563,  142563, 1042563,  412563, 4012563, 1402563, 4102563,
-       241563, 2041563,  421563, 4021563, 2401563, 4201563, 1240563, 2140563, 1420563, 4120563, 2410563, 4210563,
-       125463, 1025463,  215463, 2015463, 1205463, 2105463,  152463, 1052463,  512463, 5012463, 1502463, 5102463,
-       251463, 2051463,  521463, 5021463, 2501463, 5201463, 1250463, 2150463, 1520463, 5120463, 2510463, 5210463,
-       145263, 1045263,  415263, 4015263, 1405263, 4105263,  154263, 1054263,  514263, 5014263, 1504263, 5104263,
-       451263, 4051263,  541263, 5041263, 4501263, 5401263, 1450263, 4150263, 1540263, 5140263, 4510263, 5410263,
-       245163, 2045163,  425163, 4025163, 2405163, 4205163,  254163, 2054163,  524163, 5024163, 2504163, 5204163,
-       452163, 4052163,  542163, 5042163, 4502163, 5402163, 2450163, 4250163, 2540163, 5240163, 4520163, 5420163,
-      1245063, 2145063, 1425063, 4125063, 2415063, 4215063, 1254063, 2154063, 1524063, 5124063, 2514063, 5214063,
-      1452063, 4152063, 1542063, 5142063, 4512063, 5412063, 2451063, 4251063, 2541063, 5241063, 4521063, 5421063,
-       124653, 1024653,  214653, 2014653, 1204653, 2104653,  142653, 1042653,  412653, 4012653, 1402653, 4102653,
-       241653, 2041653,  421653, 4021653, 2401653, 4201653, 1240653, 2140653, 1420653, 4120653, 2410653, 4210653,
-       126453, 1026453,  216453, 2016453, 1206453, 2106453,  162453, 1062453,  612453, 6012453, 1602453, 6102453,
-       261453, 2061453,  621453, 6021453, 2601453, 6201453, 1260453, 2160453, 1620453, 6120453, 2610453, 6210453,
-       146253, 1046253,  416253, 4016253, 1406253, 4106253,  164253, 1064253,  614253, 6014253, 1604253, 6104253,
-       461253, 4061253,  641253, 6041253, 4601253, 6401253, 1460253, 4160253, 1640253, 6140253, 4610253, 6410253,
-       246153, 2046153,  426153, 4026153, 2406153, 4206153,  264153, 2064153,  624153, 6024153, 2604153, 6204153,
-       462153, 4062153,  642153, 6042153, 4602153, 6402153, 2460153, 4260153, 2640153, 6240153, 4620153, 6420153,
-      1246053, 2146053, 1426053, 4126053, 2416053, 4216053, 1264053, 2164053, 1624053, 6124053, 2614053, 6214053,
-      1462053, 4162053, 1642053, 6142053, 4612053, 6412053, 2461053, 4261053, 2641053, 6241053, 4621053, 6421053,
-       125643, 1025643,  215643, 2015643, 1205643, 2105643,  152643, 1052643,  512643, 5012643, 1502643, 5102643,
-       251643, 2051643,  521643, 5021643, 2501643, 5201643, 1250643, 2150643, 1520643, 5120643, 2510643, 5210643,
-       126543, 1026543,  216543, 2016543, 1206543, 2106543,  162543, 1062543,  612543, 6012543, 1602543, 6102543,
-       261543, 2061543,  621543, 6021543, 2601543, 6201543, 1260543, 2160543, 1620543, 6120543, 2610543, 6210543,
-       156243, 1056243,  516243, 5016243, 1506243, 5106243,  165243, 1065243,  615243, 6015243, 1605243, 6105243,
-       561243, 5061243,  651243, 6051243, 5601243, 6501243, 1560243, 5160243, 1650243, 6150243, 5610243, 6510243,
-       256143, 2056143,  526143, 5026143, 2506143, 5206143,  265143, 2065143,  625143, 6025143, 2605143, 6205143,
-       562143, 5062143,  652143, 6052143, 5602143, 6502143, 2560143, 5260143, 2650143, 6250143, 5620143, 6520143,
-      1256043, 2156043, 1526043, 5126043, 2516043, 5216043, 1265043, 2165043, 1625043, 6125043, 2615043, 6215043,
-      1562043, 5162043, 1652043, 6152043, 5612043, 6512043, 2561043, 5261043, 2651043, 6251043, 5621043, 6521043,
-       145623, 1045623,  415623, 4015623, 1405623, 4105623,  154623, 1054623,  514623, 5014623, 1504623, 5104623,
-       451623, 4051623,  541623, 5041623, 4501623, 5401623, 1450623, 4150623, 1540623, 5140623, 4510623, 5410623,
-       146523, 1046523,  416523, 4016523, 1406523, 4106523,  164523, 1064523,  614523, 6014523, 1604523, 6104523,
-       461523, 4061523,  641523, 6041523, 4601523, 6401523, 1460523, 4160523, 1640523, 6140523, 4610523, 6410523,
-       156423, 1056423,  516423, 5016423, 1506423, 5106423,  165423, 1065423,  615423, 6015423, 1605423, 6105423,
-       561423, 5061423,  651423, 6051423, 5601423, 6501423, 1560423, 5160423, 1650423, 6150423, 5610423, 6510423,
-       456123, 4056123,  546123, 5046123, 4506123, 5406123,  465123, 4065123,  645123, 6045123, 4605123, 6405123,
-       564123, 5064123,  654123, 6054123, 5604123, 6504123, 4560123, 5460123, 4650123, 6450123, 5640123, 6540123,
-      1456023, 4156023, 1546023, 5146023, 4516023, 5416023, 1465023, 4165023, 1645023, 6145023, 4615023, 6415023,
-      1564023, 5164023, 1654023, 6154023, 5614023, 6514023, 4561023, 5461023, 4651023, 6451023, 5641023, 6541023,
-       245613, 2045613,  425613, 4025613, 2405613, 4205613,  254613, 2054613,  524613, 5024613, 2504613, 5204613,
-       452613, 4052613,  542613, 5042613, 4502613, 5402613, 2450613, 4250613, 2540613, 5240613, 4520613, 5420613,
-       246513, 2046513,  426513, 4026513, 2406513, 4206513,  264513, 2064513,  624513, 6024513, 2604513, 6204513,
-       462513, 4062513,  642513, 6042513, 4602513, 6402513, 2460513, 4260513, 2640513, 6240513, 4620513, 6420513,
-       256413, 2056413,  526413, 5026413, 2506413, 5206413,  265413, 2065413,  625413, 6025413, 2605413, 6205413,
-       562413, 5062413,  652413, 6052413, 5602413, 6502413, 2560413, 5260413, 2650413, 6250413, 5620413, 6520413,
-       456213, 4056213,  546213, 5046213, 4506213, 5406213,  465213, 4065213,  645213, 6045213, 4605213, 6405213,
-       564213, 5064213,  654213, 6054213, 5604213, 6504213, 4560213, 5460213, 4650213, 6450213, 5640213, 6540213,
-      2456013, 4256013, 2546013, 5246013, 4526013, 5426013, 2465013, 4265013, 2645013, 6245013, 4625013, 6425013,
-      2564013, 5264013, 2654013, 6254013, 5624013, 6524013, 4562013, 5462013, 4652013, 6452013, 5642013, 6542013,
-      1245603, 2145603, 1425603, 4125603, 2415603, 4215603, 1254603, 2154603, 1524603, 5124603, 2514603, 5214603,
-      1452603, 4152603, 1542603, 5142603, 4512603, 5412603, 2451603, 4251603, 2541603, 5241603, 4521603, 5421603,
-      1246503, 2146503, 1426503, 4126503, 2416503, 4216503, 1264503, 2164503, 1624503, 6124503, 2614503, 6214503,
-      1462503, 4162503, 1642503, 6142503, 4612503, 6412503, 2461503, 4261503, 2641503, 6241503, 4621503, 6421503,
-      1256403, 2156403, 1526403, 5126403, 2516403, 5216403, 1265403, 2165403, 1625403, 6125403, 2615403, 6215403,
-      1562403, 5162403, 1652403, 6152403, 5612403, 6512403, 2561403, 5261403, 2651403, 6251403, 5621403, 6521403,
-      1456203, 4156203, 1546203, 5146203, 4516203, 5416203, 1465203, 4165203, 1645203, 6145203, 4615203, 6415203,
-      1564203, 5164203, 1654203, 6154203, 5614203, 6514203, 4561203, 5461203, 4651203, 6451203, 5641203, 6541203,
-      2456103, 4256103, 2546103, 5246103, 4526103, 5426103, 2465103, 4265103, 2645103, 6245103, 4625103, 6425103,
-      2564103, 5264103, 2654103, 6254103, 5624103, 6524103, 4562103, 5462103, 4652103, 6452103, 5642103, 6542103,
-       134562, 1034562,  314562, 3014562, 1304562, 3104562,  143562, 1043562,  413562, 4013562, 1403562, 4103562,
-       341562, 3041562,  431562, 4031562, 3401562, 4301562, 1340562, 3140562, 1430562, 4130562, 3410562, 4310562,
-       135462, 1035462,  315462, 3015462, 1305462, 3105462,  153462, 1053462,  513462, 5013462, 1503462, 5103462,
-       351462, 3051462,  531462, 5031462, 3501462, 5301462, 1350462, 3150462, 1530462, 5130462, 3510462, 5310462,
-       145362, 1045362,  415362, 4015362, 1405362, 4105362,  154362, 1054362,  514362, 5014362, 1504362, 5104362,
-       451362, 4051362,  541362, 5041362, 4501362, 5401362, 1450362, 4150362, 1540362, 5140362, 4510362, 5410362,
-       345162, 3045162,  435162, 4035162, 3405162, 4305162,  354162, 3054162,  534162, 5034162, 3504162, 5304162,
-       453162, 4053162,  543162, 5043162, 4503162, 5403162, 3450162, 4350162, 3540162, 5340162, 4530162, 5430162,
-      1345062, 3145062, 1435062, 4135062, 3415062, 4315062, 1354062, 3154062, 1534062, 5134062, 3514062, 5314062,
-      1453062, 4153062, 1543062, 5143062, 4513062, 5413062, 3451062, 4351062, 3541062, 5341062, 4531062, 5431062,
-       134652, 1034652,  314652, 3014652, 1304652, 3104652,  143652, 1043652,  413652, 4013652, 1403652, 4103652,
-       341652, 3041652,  431652, 4031652, 3401652, 4301652, 1340652, 3140652, 1430652, 4130652, 3410652, 4310652,
-       136452, 1036452,  316452, 3016452, 1306452, 3106452,  163452, 1063452,  613452, 6013452, 1603452, 6103452,
-       361452, 3061452,  631452, 6031452, 3601452, 6301452, 1360452, 3160452, 1630452, 6130452, 3610452, 6310452,
-       146352, 1046352,  416352, 4016352, 1406352, 4106352,  164352, 1064352,  614352, 6014352, 1604352, 6104352,
-       461352, 4061352,  641352, 6041352, 4601352, 6401352, 1460352, 4160352, 1640352, 6140352, 4610352, 6410352,
-       346152, 3046152,  436152, 4036152, 3406152, 4306152,  364152, 3064152,  634152, 6034152, 3604152, 6304152,
-       463152, 4063152,  643152, 6043152, 4603152, 6403152, 3460152, 4360152, 3640152, 6340152, 4630152, 6430152,
-      1346052, 3146052, 1436052, 4136052, 3416052, 4316052, 1364052, 3164052, 1634052, 6134052, 3614052, 6314052,
-      1463052, 4163052, 1643052, 6143052, 4613052, 6413052, 3461052, 4361052, 3641052, 6341052, 4631052, 6431052,
-       135642, 1035642,  315642, 3015642, 1305642, 3105642,  153642, 1053642,  513642, 5013642, 1503642, 5103642,
-       351642, 3051642,  531642, 5031642, 3501642, 5301642, 1350642, 3150642, 1530642, 5130642, 3510642, 5310642,
-       136542, 1036542,  316542, 3016542, 1306542, 3106542,  163542, 1063542,  613542, 6013542, 1603542, 6103542,
-       361542, 3061542,  631542, 6031542, 3601542, 6301542, 1360542, 3160542, 1630542, 6130542, 3610542, 6310542,
-       156342, 1056342,  516342, 5016342, 1506342, 5106342,  165342, 1065342,  615342, 6015342, 1605342, 6105342,
-       561342, 5061342,  651342, 6051342, 5601342, 6501342, 1560342, 5160342, 1650342, 6150342, 5610342, 6510342,
-       356142, 3056142,  536142, 5036142, 3506142, 5306142,  365142, 3065142,  635142, 6035142, 3605142, 6305142,
-       563142, 5063142,  653142, 6053142, 5603142, 6503142, 3560142, 5360142, 3650142, 6350142, 5630142, 6530142,
-      1356042, 3156042, 1536042, 5136042, 3516042, 5316042, 1365042, 3165042, 1635042, 6135042, 3615042, 6315042,
-      1563042, 5163042, 1653042, 6153042, 5613042, 6513042, 3561042, 5361042, 3651042, 6351042, 5631042, 6531042,
-       145632, 1045632,  415632, 4015632, 1405632, 4105632,  154632, 1054632,  514632, 5014632, 1504632, 5104632,
-       451632, 4051632,  541632, 5041632, 4501632, 5401632, 1450632, 4150632, 1540632, 5140632, 4510632, 5410632,
-       146532, 1046532,  416532, 4016532, 1406532, 4106532,  164532, 1064532,  614532, 6014532, 1604532, 6104532,
-       461532, 4061532,  641532, 6041532, 4601532, 6401532, 1460532, 4160532, 1640532, 6140532, 4610532, 6410532,
-       156432, 1056432,  516432, 5016432, 1506432, 5106432,  165432, 1065432,  615432, 6015432, 1605432, 6105432,
-       561432, 5061432,  651432, 6051432, 5601432, 6501432, 1560432, 5160432, 1650432, 6150432, 5610432, 6510432,
-       456132, 4056132,  546132, 5046132, 4506132, 5406132,  465132, 4065132,  645132, 6045132, 4605132, 6405132,
-       564132, 5064132,  654132, 6054132, 5604132, 6504132, 4560132, 5460132, 4650132, 6450132, 5640132, 6540132,
-      1456032, 4156032, 1546032, 5146032, 4516032, 5416032, 1465032, 4165032, 1645032, 6145032, 4615032, 6415032,
-      1564032, 5164032, 1654032, 6154032, 5614032, 6514032, 4561032, 5461032, 4651032, 6451032, 5641032, 6541032,
-       345612, 3045612,  435612, 4035612, 3405612, 4305612,  354612, 3054612,  534612, 5034612, 3504612, 5304612,
-       453612, 4053612,  543612, 5043612, 4503612, 5403612, 3450612, 4350612, 3540612, 5340612, 4530612, 5430612,
-       346512, 3046512,  436512, 4036512, 3406512, 4306512,  364512, 3064512,  634512, 6034512, 3604512, 6304512,
-       463512, 4063512,  643512, 6043512, 4603512, 6403512, 3460512, 4360512, 3640512, 6340512, 4630512, 6430512,
-       356412, 3056412,  536412, 5036412, 3506412, 5306412,  365412, 3065412,  635412, 6035412, 3605412, 6305412,
-       563412, 5063412,  653412, 6053412, 5603412, 6503412, 3560412, 5360412, 3650412, 6350412, 5630412, 6530412,
-       456312, 4056312,  546312, 5046312, 4506312, 5406312,  465312, 4065312,  645312, 6045312, 4605312, 6405312,
-       564312, 5064312,  654312, 6054312, 5604312, 6504312, 4560312, 5460312, 4650312, 6450312, 5640312, 6540312,
-      3456012, 4356012, 3546012, 5346012, 4536012, 5436012, 3465012, 4365012, 3645012, 6345012, 4635012, 6435012,
-      3564012, 5364012, 3654012, 6354012, 5634012, 6534012, 4563012, 5463012, 4653012, 6453012, 5643012, 6543012,
-      1345602, 3145602, 1435602, 4135602, 3415602, 4315602, 1354602, 3154602, 1534602, 5134602, 3514602, 5314602,
-      1453602, 4153602, 1543602, 5143602, 4513602, 5413602, 3451602, 4351602, 3541602, 5341602, 4531602, 5431602,
-      1346502, 3146502, 1436502, 4136502, 3416502, 4316502, 1364502, 3164502, 1634502, 6134502, 3614502, 6314502,
-      1463502, 4163502, 1643502, 6143502, 4613502, 6413502, 3461502, 4361502, 3641502, 6341502, 4631502, 6431502,
-      1356402, 3156402, 1536402, 5136402, 3516402, 5316402, 1365402, 3165402, 1635402, 6135402, 3615402, 6315402,
-      1563402, 5163402, 1653402, 6153402, 5613402, 6513402, 3561402, 5361402, 3651402, 6351402, 5631402, 6531402,
-      1456302, 4156302, 1546302, 5146302, 4516302, 5416302, 1465302, 4165302, 1645302, 6145302, 4615302, 6415302,
-      1564302, 5164302, 1654302, 6154302, 5614302, 6514302, 4561302, 5461302, 4651302, 6451302, 5641302, 6541302,
-      3456102, 4356102, 3546102, 5346102, 4536102, 5436102, 3465102, 4365102, 3645102, 6345102, 4635102, 6435102,
-      3564102, 5364102, 3654102, 6354102, 5634102, 6534102, 4563102, 5463102, 4653102, 6453102, 5643102, 6543102,
-       234561, 2034561,  324561, 3024561, 2304561, 3204561,  243561, 2043561,  423561, 4023561, 2403561, 4203561,
-       342561, 3042561,  432561, 4032561, 3402561, 4302561, 2340561, 3240561, 2430561, 4230561, 3420561, 4320561,
-       235461, 2035461,  325461, 3025461, 2305461, 3205461,  253461, 2053461,  523461, 5023461, 2503461, 5203461,
-       352461, 3052461,  532461, 5032461, 3502461, 5302461, 2350461, 3250461, 2530461, 5230461, 3520461, 5320461,
-       245361, 2045361,  425361, 4025361, 2405361, 4205361,  254361, 2054361,  524361, 5024361, 2504361, 5204361,
-       452361, 4052361,  542361, 5042361, 4502361, 5402361, 2450361, 4250361, 2540361, 5240361, 4520361, 5420361,
-       345261, 3045261,  435261, 4035261, 3405261, 4305261,  354261, 3054261,  534261, 5034261, 3504261, 5304261,
-       453261, 4053261,  543261, 5043261, 4503261, 5403261, 3450261, 4350261, 3540261, 5340261, 4530261, 5430261,
-      2345061, 3245061, 2435061, 4235061, 3425061, 4325061, 2354061, 3254061, 2534061, 5234061, 3524061, 5324061,
-      2453061, 4253061, 2543061, 5243061, 4523061, 5423061, 3452061, 4352061, 3542061, 5342061, 4532061, 5432061,
-       234651, 2034651,  324651, 3024651, 2304651, 3204651,  243651, 2043651,  423651, 4023651, 2403651, 4203651,
-       342651, 3042651,  432651, 4032651, 3402651, 4302651, 2340651, 3240651, 2430651, 4230651, 3420651, 4320651,
-       236451, 2036451,  326451, 3026451, 2306451, 3206451,  263451, 2063451,  623451, 6023451, 2603451, 6203451,
-       362451, 3062451,  632451, 6032451, 3602451, 6302451, 2360451, 3260451, 2630451, 6230451, 3620451, 6320451,
-       246351, 2046351,  426351, 4026351, 2406351, 4206351,  264351, 2064351,  624351, 6024351, 2604351, 6204351,
-       462351, 4062351,  642351, 6042351, 4602351, 6402351, 2460351, 4260351, 2640351, 6240351, 4620351, 6420351,
-       346251, 3046251,  436251, 4036251, 3406251, 4306251,  364251, 3064251,  634251, 6034251, 3604251, 6304251,
-       463251, 4063251,  643251, 6043251, 4603251, 6403251, 3460251, 4360251, 3640251, 6340251, 4630251, 6430251,
-      2346051, 3246051, 2436051, 4236051, 3426051, 4326051, 2364051, 3264051, 2634051, 6234051, 3624051, 6324051,
-      2463051, 4263051, 2643051, 6243051, 4623051, 6423051, 3462051, 4362051, 3642051, 6342051, 4632051, 6432051,
-       235641, 2035641,  325641, 3025641, 2305641, 3205641,  253641, 2053641,  523641, 5023641, 2503641, 5203641,
-       352641, 3052641,  532641, 5032641, 3502641, 5302641, 2350641, 3250641, 2530641, 5230641, 3520641, 5320641,
-       236541, 2036541,  326541, 3026541, 2306541, 3206541,  263541, 2063541,  623541, 6023541, 2603541, 6203541,
-       362541, 3062541,  632541, 6032541, 3602541, 6302541, 2360541, 3260541, 2630541, 6230541, 3620541, 6320541,
-       256341, 2056341,  526341, 5026341, 2506341, 5206341,  265341, 2065341,  625341, 6025341, 2605341, 6205341,
-       562341, 5062341,  652341, 6052341, 5602341, 6502341, 2560341, 5260341, 2650341, 6250341, 5620341, 6520341,
-       356241, 3056241,  536241, 5036241, 3506241, 5306241,  365241, 3065241,  635241, 6035241, 3605241, 6305241,
-       563241, 5063241,  653241, 6053241, 5603241, 6503241, 3560241, 5360241, 3650241, 6350241, 5630241, 6530241,
-      2356041, 3256041, 2536041, 5236041, 3526041, 5326041, 2365041, 3265041, 2635041, 6235041, 3625041, 6325041,
-      2563041, 5263041, 2653041, 6253041, 5623041, 6523041, 3562041, 5362041, 3652041, 6352041, 5632041, 6532041,
-       245631, 2045631,  425631, 4025631, 2405631, 4205631,  254631, 2054631,  524631, 5024631, 2504631, 5204631,
-       452631, 4052631,  542631, 5042631, 4502631, 5402631, 2450631, 4250631, 2540631, 5240631, 4520631, 5420631,
-       246531, 2046531,  426531, 4026531, 2406531, 4206531,  264531, 2064531,  624531, 6024531, 2604531, 6204531,
-       462531, 4062531,  642531, 6042531, 4602531, 6402531, 2460531, 4260531, 2640531, 6240531, 4620531, 6420531,
-       256431, 2056431,  526431, 5026431, 2506431, 5206431,  265431, 2065431,  625431, 6025431, 2605431, 6205431,
-       562431, 5062431,  652431, 6052431, 5602431, 6502431, 2560431, 5260431, 2650431, 6250431, 5620431, 6520431,
-       456231, 4056231,  546231, 5046231, 4506231, 5406231,  465231, 4065231,  645231, 6045231, 4605231, 6405231,
-       564231, 5064231,  654231, 6054231, 5604231, 6504231, 4560231, 5460231, 4650231, 6450231, 5640231, 6540231,
-      2456031, 4256031, 2546031, 5246031, 4526031, 5426031, 2465031, 4265031, 2645031, 6245031, 4625031, 6425031,
-      2564031, 5264031, 2654031, 6254031, 5624031, 6524031, 4562031, 5462031, 4652031, 6452031, 5642031, 6542031,
-       345621, 3045621,  435621, 4035621, 3405621, 4305621,  354621, 3054621,  534621, 5034621, 3504621, 5304621,
-       453621, 4053621,  543621, 5043621, 4503621, 5403621, 3450621, 4350621, 3540621, 5340621, 4530621, 5430621,
-       346521, 3046521,  436521, 4036521, 3406521, 4306521,  364521, 3064521,  634521, 6034521, 3604521, 6304521,
-       463521, 4063521,  643521, 6043521, 4603521, 6403521, 3460521, 4360521, 3640521, 6340521, 4630521, 6430521,
-       356421, 3056421,  536421, 5036421, 3506421, 5306421,  365421, 3065421,  635421, 6035421, 3605421, 6305421,
-       563421, 5063421,  653421, 6053421, 5603421, 6503421, 3560421, 5360421, 3650421, 6350421, 5630421, 6530421,
-       456321, 4056321,  546321, 5046321, 4506321, 5406321,  465321, 4065321,  645321, 6045321, 4605321, 6405321,
-       564321, 5064321,  654321, 6054321, 5604321, 6504321, 4560321, 5460321, 4650321, 6450321, 5640321, 6540321,
-      3456021, 4356021, 3546021, 5346021, 4536021, 5436021, 3465021, 4365021, 3645021, 6345021, 4635021, 6435021,
-      3564021, 5364021, 3654021, 6354021, 5634021, 6534021, 4563021, 5463021, 4653021, 6453021, 5643021, 6543021,
-      2345601, 3245601, 2435601, 4235601, 3425601, 4325601, 2354601, 3254601, 2534601, 5234601, 3524601, 5324601,
-      2453601, 4253601, 2543601, 5243601, 4523601, 5423601, 3452601, 4352601, 3542601, 5342601, 4532601, 5432601,
-      2346501, 3246501, 2436501, 4236501, 3426501, 4326501, 2364501, 3264501, 2634501, 6234501, 3624501, 6324501,
-      2463501, 4263501, 2643501, 6243501, 4623501, 6423501, 3462501, 4362501, 3642501, 6342501, 4632501, 6432501,
-      2356401, 3256401, 2536401, 5236401, 3526401, 5326401, 2365401, 3265401, 2635401, 6235401, 3625401, 6325401,
-      2563401, 5263401, 2653401, 6253401, 5623401, 6523401, 3562401, 5362401, 3652401, 6352401, 5632401, 6532401,
-      2456301, 4256301, 2546301, 5246301, 4526301, 5426301, 2465301, 4265301, 2645301, 6245301, 4625301, 6425301,
-      2564301, 5264301, 2654301, 6254301, 5624301, 6524301, 4562301, 5462301, 4652301, 6452301, 5642301, 6542301,
-      3456201, 4356201, 3546201, 5346201, 4536201, 5436201, 3465201, 4365201, 3645201, 6345201, 4635201, 6435201,
-      3564201, 5364201, 3654201, 6354201, 5634201, 6534201, 4563201, 5463201, 4653201, 6453201, 5643201, 6543201,
-      1234560, 2134560, 1324560, 3124560, 2314560, 3214560, 1243560, 2143560, 1423560, 4123560, 2413560, 4213560,
-      1342560, 3142560, 1432560, 4132560, 3412560, 4312560, 2341560, 3241560, 2431560, 4231560, 3421560, 4321560,
-      1235460, 2135460, 1325460, 3125460, 2315460, 3215460, 1253460, 2153460, 1523460, 5123460, 2513460, 5213460,
-      1352460, 3152460, 1532460, 5132460, 3512460, 5312460, 2351460, 3251460, 2531460, 5231460, 3521460, 5321460,
-      1245360, 2145360, 1425360, 4125360, 2415360, 4215360, 1254360, 2154360, 1524360, 5124360, 2514360, 5214360,
-      1452360, 4152360, 1542360, 5142360, 4512360, 5412360, 2451360, 4251360, 2541360, 5241360, 4521360, 5421360,
-      1345260, 3145260, 1435260, 4135260, 3415260, 4315260, 1354260, 3154260, 1534260, 5134260, 3514260, 5314260,
-      1453260, 4153260, 1543260, 5143260, 4513260, 5413260, 3451260, 4351260, 3541260, 5341260, 4531260, 5431260,
-      2345160, 3245160, 2435160, 4235160, 3425160, 4325160, 2354160, 3254160, 2534160, 5234160, 3524160, 5324160,
-      2453160, 4253160, 2543160, 5243160, 4523160, 5423160, 3452160, 4352160, 3542160, 5342160, 4532160, 5432160,
-      1234650, 2134650, 1324650, 3124650, 2314650, 3214650, 1243650, 2143650, 1423650, 4123650, 2413650, 4213650,
-      1342650, 3142650, 1432650, 4132650, 3412650, 4312650, 2341650, 3241650, 2431650, 4231650, 3421650, 4321650,
-      1236450, 2136450, 1326450, 3126450, 2316450, 3216450, 1263450, 2163450, 1623450, 6123450, 2613450, 6213450,
-      1362450, 3162450, 1632450, 6132450, 3612450, 6312450, 2361450, 3261450, 2631450, 6231450, 3621450, 6321450,
-      1246350, 2146350, 1426350, 4126350, 2416350, 4216350, 1264350, 2164350, 1624350, 6124350, 2614350, 6214350,
-      1462350, 4162350, 1642350, 6142350, 4612350, 6412350, 2461350, 4261350, 2641350, 6241350, 4621350, 6421350,
-      1346250, 3146250, 1436250, 4136250, 3416250, 4316250, 1364250, 3164250, 1634250, 6134250, 3614250, 6314250,
-      1463250, 4163250, 1643250, 6143250, 4613250, 6413250, 3461250, 4361250, 3641250, 6341250, 4631250, 6431250,
-      2346150, 3246150, 2436150, 4236150, 3426150, 4326150, 2364150, 3264150, 2634150, 6234150, 3624150, 6324150,
-      2463150, 4263150, 2643150, 6243150, 4623150, 6423150, 3462150, 4362150, 3642150, 6342150, 4632150, 6432150,
-      1235640, 2135640, 1325640, 3125640, 2315640, 3215640, 1253640, 2153640, 1523640, 5123640, 2513640, 5213640,
-      1352640, 3152640, 1532640, 5132640, 3512640, 5312640, 2351640, 3251640, 2531640, 5231640, 3521640, 5321640,
-      1236540, 2136540, 1326540, 3126540, 2316540, 3216540, 1263540, 2163540, 1623540, 6123540, 2613540, 6213540,
-      1362540, 3162540, 1632540, 6132540, 3612540, 6312540, 2361540, 3261540, 2631540, 6231540, 3621540, 6321540,
-      1256340, 2156340, 1526340, 5126340, 2516340, 5216340, 1265340, 2165340, 1625340, 6125340, 2615340, 6215340,
-      1562340, 5162340, 1652340, 6152340, 5612340, 6512340, 2561340, 5261340, 2651340, 6251340, 5621340, 6521340,
-      1356240, 3156240, 1536240, 5136240, 3516240, 5316240, 1365240, 3165240, 1635240, 6135240, 3615240, 6315240,
-      1563240, 5163240, 1653240, 6153240, 5613240, 6513240, 3561240, 5361240, 3651240, 6351240, 5631240, 6531240,
-      2356140, 3256140, 2536140, 5236140, 3526140, 5326140, 2365140, 3265140, 2635140, 6235140, 3625140, 6325140,
-      2563140, 5263140, 2653140, 6253140, 5623140, 6523140, 3562140, 5362140, 3652140, 6352140, 5632140, 6532140,
-      1245630, 2145630, 1425630, 4125630, 2415630, 4215630, 1254630, 2154630, 1524630, 5124630, 2514630, 5214630,
-      1452630, 4152630, 1542630, 5142630, 4512630, 5412630, 2451630, 4251630, 2541630, 5241630, 4521630, 5421630,
-      1246530, 2146530, 1426530, 4126530, 2416530, 4216530, 1264530, 2164530, 1624530, 6124530, 2614530, 6214530,
-      1462530, 4162530, 1642530, 6142530, 4612530, 6412530, 2461530, 4261530, 2641530, 6241530, 4621530, 6421530,
-      1256430, 2156430, 1526430, 5126430, 2516430, 5216430, 1265430, 2165430, 1625430, 6125430, 2615430, 6215430,
-      1562430, 5162430, 1652430, 6152430, 5612430, 6512430, 2561430, 5261430, 2651430, 6251430, 5621430, 6521430,
-      1456230, 4156230, 1546230, 5146230, 4516230, 5416230, 1465230, 4165230, 1645230, 6145230, 4615230, 6415230,
-      1564230, 5164230, 1654230, 6154230, 5614230, 6514230, 4561230, 5461230, 4651230, 6451230, 5641230, 6541230,
-      2456130, 4256130, 2546130, 5246130, 4526130, 5426130, 2465130, 4265130, 2645130, 6245130, 4625130, 6425130,
-      2564130, 5264130, 2654130, 6254130, 5624130, 6524130, 4562130, 5462130, 4652130, 6452130, 5642130, 6542130,
-      1345620, 3145620, 1435620, 4135620, 3415620, 4315620, 1354620, 3154620, 1534620, 5134620, 3514620, 5314620,
-      1453620, 4153620, 1543620, 5143620, 4513620, 5413620, 3451620, 4351620, 3541620, 5341620, 4531620, 5431620,
-      1346520, 3146520, 1436520, 4136520, 3416520, 4316520, 1364520, 3164520, 1634520, 6134520, 3614520, 6314520,
-      1463520, 4163520, 1643520, 6143520, 4613520, 6413520, 3461520, 4361520, 3641520, 6341520, 4631520, 6431520,
-      1356420, 3156420, 1536420, 5136420, 3516420, 5316420, 1365420, 3165420, 1635420, 6135420, 3615420, 6315420,
-      1563420, 5163420, 1653420, 6153420, 5613420, 6513420, 3561420, 5361420, 3651420, 6351420, 5631420, 6531420,
-      1456320, 4156320, 1546320, 5146320, 4516320, 5416320, 1465320, 4165320, 1645320, 6145320, 4615320, 6415320,
-      1564320, 5164320, 1654320, 6154320, 5614320, 6514320, 4561320, 5461320, 4651320, 6451320, 5641320, 6541320,
-      3456120, 4356120, 3546120, 5346120, 4536120, 5436120, 3465120, 4365120, 3645120, 6345120, 4635120, 6435120,
-      3564120, 5364120, 3654120, 6354120, 5634120, 6534120, 4563120, 5463120, 4653120, 6453120, 5643120, 6543120,
-      2345610, 3245610, 2435610, 4235610, 3425610, 4325610, 2354610, 3254610, 2534610, 5234610, 3524610, 5324610,
-      2453610, 4253610, 2543610, 5243610, 4523610, 5423610, 3452610, 4352610, 3542610, 5342610, 4532610, 5432610,
-      2346510, 3246510, 2436510, 4236510, 3426510, 4326510, 2364510, 3264510, 2634510, 6234510, 3624510, 6324510,
-      2463510, 4263510, 2643510, 6243510, 4623510, 6423510, 3462510, 4362510, 3642510, 6342510, 4632510, 6432510,
-      2356410, 3256410, 2536410, 5236410, 3526410, 5326410, 2365410, 3265410, 2635410, 6235410, 3625410, 6325410,
-      2563410, 5263410, 2653410, 6253410, 5623410, 6523410, 3562410, 5362410, 3652410, 6352410, 5632410, 6532410,
-      2456310, 4256310, 2546310, 5246310, 4526310, 5426310, 2465310, 4265310, 2645310, 6245310, 4625310, 6425310,
-      2564310, 5264310, 2654310, 6254310, 5624310, 6524310, 4562310, 5462310, 4652310, 6452310, 5642310, 6542310,
-      3456210, 4356210, 3546210, 5346210, 4536210, 5436210, 3465210, 4365210, 3645210, 6345210, 4635210, 6435210,
-      3564210, 5364210, 3654210, 6354210, 5634210, 6534210, 4563210, 5463210, 4653210, 6453210, 5643210, 6543210
-    };
+        123456,  1023456, 213456,  2013456, 1203456, 2103456, 132456,  1032456, 312456,  3012456, 1302456, 3102456,
+        231456,  2031456, 321456,  3021456, 2301456, 3201456, 1230456, 2130456, 1320456, 3120456, 2310456, 3210456,
+        124356,  1024356, 214356,  2014356, 1204356, 2104356, 142356,  1042356, 412356,  4012356, 1402356, 4102356,
+        241356,  2041356, 421356,  4021356, 2401356, 4201356, 1240356, 2140356, 1420356, 4120356, 2410356, 4210356,
+        134256,  1034256, 314256,  3014256, 1304256, 3104256, 143256,  1043256, 413256,  4013256, 1403256, 4103256,
+        341256,  3041256, 431256,  4031256, 3401256, 4301256, 1340256, 3140256, 1430256, 4130256, 3410256, 4310256,
+        234156,  2034156, 324156,  3024156, 2304156, 3204156, 243156,  2043156, 423156,  4023156, 2403156, 4203156,
+        342156,  3042156, 432156,  4032156, 3402156, 4302156, 2340156, 3240156, 2430156, 4230156, 3420156, 4320156,
+        1234056, 2134056, 1324056, 3124056, 2314056, 3214056, 1243056, 2143056, 1423056, 4123056, 2413056, 4213056,
+        1342056, 3142056, 1432056, 4132056, 3412056, 4312056, 2341056, 3241056, 2431056, 4231056, 3421056, 4321056,
+        123546,  1023546, 213546,  2013546, 1203546, 2103546, 132546,  1032546, 312546,  3012546, 1302546, 3102546,
+        231546,  2031546, 321546,  3021546, 2301546, 3201546, 1230546, 2130546, 1320546, 3120546, 2310546, 3210546,
+        125346,  1025346, 215346,  2015346, 1205346, 2105346, 152346,  1052346, 512346,  5012346, 1502346, 5102346,
+        251346,  2051346, 521346,  5021346, 2501346, 5201346, 1250346, 2150346, 1520346, 5120346, 2510346, 5210346,
+        135246,  1035246, 315246,  3015246, 1305246, 3105246, 153246,  1053246, 513246,  5013246, 1503246, 5103246,
+        351246,  3051246, 531246,  5031246, 3501246, 5301246, 1350246, 3150246, 1530246, 5130246, 3510246, 5310246,
+        235146,  2035146, 325146,  3025146, 2305146, 3205146, 253146,  2053146, 523146,  5023146, 2503146, 5203146,
+        352146,  3052146, 532146,  5032146, 3502146, 5302146, 2350146, 3250146, 2530146, 5230146, 3520146, 5320146,
+        1235046, 2135046, 1325046, 3125046, 2315046, 3215046, 1253046, 2153046, 1523046, 5123046, 2513046, 5213046,
+        1352046, 3152046, 1532046, 5132046, 3512046, 5312046, 2351046, 3251046, 2531046, 5231046, 3521046, 5321046,
+        124536,  1024536, 214536,  2014536, 1204536, 2104536, 142536,  1042536, 412536,  4012536, 1402536, 4102536,
+        241536,  2041536, 421536,  4021536, 2401536, 4201536, 1240536, 2140536, 1420536, 4120536, 2410536, 4210536,
+        125436,  1025436, 215436,  2015436, 1205436, 2105436, 152436,  1052436, 512436,  5012436, 1502436, 5102436,
+        251436,  2051436, 521436,  5021436, 2501436, 5201436, 1250436, 2150436, 1520436, 5120436, 2510436, 5210436,
+        145236,  1045236, 415236,  4015236, 1405236, 4105236, 154236,  1054236, 514236,  5014236, 1504236, 5104236,
+        451236,  4051236, 541236,  5041236, 4501236, 5401236, 1450236, 4150236, 1540236, 5140236, 4510236, 5410236,
+        245136,  2045136, 425136,  4025136, 2405136, 4205136, 254136,  2054136, 524136,  5024136, 2504136, 5204136,
+        452136,  4052136, 542136,  5042136, 4502136, 5402136, 2450136, 4250136, 2540136, 5240136, 4520136, 5420136,
+        1245036, 2145036, 1425036, 4125036, 2415036, 4215036, 1254036, 2154036, 1524036, 5124036, 2514036, 5214036,
+        1452036, 4152036, 1542036, 5142036, 4512036, 5412036, 2451036, 4251036, 2541036, 5241036, 4521036, 5421036,
+        134526,  1034526, 314526,  3014526, 1304526, 3104526, 143526,  1043526, 413526,  4013526, 1403526, 4103526,
+        341526,  3041526, 431526,  4031526, 3401526, 4301526, 1340526, 3140526, 1430526, 4130526, 3410526, 4310526,
+        135426,  1035426, 315426,  3015426, 1305426, 3105426, 153426,  1053426, 513426,  5013426, 1503426, 5103426,
+        351426,  3051426, 531426,  5031426, 3501426, 5301426, 1350426, 3150426, 1530426, 5130426, 3510426, 5310426,
+        145326,  1045326, 415326,  4015326, 1405326, 4105326, 154326,  1054326, 514326,  5014326, 1504326, 5104326,
+        451326,  4051326, 541326,  5041326, 4501326, 5401326, 1450326, 4150326, 1540326, 5140326, 4510326, 5410326,
+        345126,  3045126, 435126,  4035126, 3405126, 4305126, 354126,  3054126, 534126,  5034126, 3504126, 5304126,
+        453126,  4053126, 543126,  5043126, 4503126, 5403126, 3450126, 4350126, 3540126, 5340126, 4530126, 5430126,
+        1345026, 3145026, 1435026, 4135026, 3415026, 4315026, 1354026, 3154026, 1534026, 5134026, 3514026, 5314026,
+        1453026, 4153026, 1543026, 5143026, 4513026, 5413026, 3451026, 4351026, 3541026, 5341026, 4531026, 5431026,
+        234516,  2034516, 324516,  3024516, 2304516, 3204516, 243516,  2043516, 423516,  4023516, 2403516, 4203516,
+        342516,  3042516, 432516,  4032516, 3402516, 4302516, 2340516, 3240516, 2430516, 4230516, 3420516, 4320516,
+        235416,  2035416, 325416,  3025416, 2305416, 3205416, 253416,  2053416, 523416,  5023416, 2503416, 5203416,
+        352416,  3052416, 532416,  5032416, 3502416, 5302416, 2350416, 3250416, 2530416, 5230416, 3520416, 5320416,
+        245316,  2045316, 425316,  4025316, 2405316, 4205316, 254316,  2054316, 524316,  5024316, 2504316, 5204316,
+        452316,  4052316, 542316,  5042316, 4502316, 5402316, 2450316, 4250316, 2540316, 5240316, 4520316, 5420316,
+        345216,  3045216, 435216,  4035216, 3405216, 4305216, 354216,  3054216, 534216,  5034216, 3504216, 5304216,
+        453216,  4053216, 543216,  5043216, 4503216, 5403216, 3450216, 4350216, 3540216, 5340216, 4530216, 5430216,
+        2345016, 3245016, 2435016, 4235016, 3425016, 4325016, 2354016, 3254016, 2534016, 5234016, 3524016, 5324016,
+        2453016, 4253016, 2543016, 5243016, 4523016, 5423016, 3452016, 4352016, 3542016, 5342016, 4532016, 5432016,
+        1234506, 2134506, 1324506, 3124506, 2314506, 3214506, 1243506, 2143506, 1423506, 4123506, 2413506, 4213506,
+        1342506, 3142506, 1432506, 4132506, 3412506, 4312506, 2341506, 3241506, 2431506, 4231506, 3421506, 4321506,
+        1235406, 2135406, 1325406, 3125406, 2315406, 3215406, 1253406, 2153406, 1523406, 5123406, 2513406, 5213406,
+        1352406, 3152406, 1532406, 5132406, 3512406, 5312406, 2351406, 3251406, 2531406, 5231406, 3521406, 5321406,
+        1245306, 2145306, 1425306, 4125306, 2415306, 4215306, 1254306, 2154306, 1524306, 5124306, 2514306, 5214306,
+        1452306, 4152306, 1542306, 5142306, 4512306, 5412306, 2451306, 4251306, 2541306, 5241306, 4521306, 5421306,
+        1345206, 3145206, 1435206, 4135206, 3415206, 4315206, 1354206, 3154206, 1534206, 5134206, 3514206, 5314206,
+        1453206, 4153206, 1543206, 5143206, 4513206, 5413206, 3451206, 4351206, 3541206, 5341206, 4531206, 5431206,
+        2345106, 3245106, 2435106, 4235106, 3425106, 4325106, 2354106, 3254106, 2534106, 5234106, 3524106, 5324106,
+        2453106, 4253106, 2543106, 5243106, 4523106, 5423106, 3452106, 4352106, 3542106, 5342106, 4532106, 5432106,
+        123465,  1023465, 213465,  2013465, 1203465, 2103465, 132465,  1032465, 312465,  3012465, 1302465, 3102465,
+        231465,  2031465, 321465,  3021465, 2301465, 3201465, 1230465, 2130465, 1320465, 3120465, 2310465, 3210465,
+        124365,  1024365, 214365,  2014365, 1204365, 2104365, 142365,  1042365, 412365,  4012365, 1402365, 4102365,
+        241365,  2041365, 421365,  4021365, 2401365, 4201365, 1240365, 2140365, 1420365, 4120365, 2410365, 4210365,
+        134265,  1034265, 314265,  3014265, 1304265, 3104265, 143265,  1043265, 413265,  4013265, 1403265, 4103265,
+        341265,  3041265, 431265,  4031265, 3401265, 4301265, 1340265, 3140265, 1430265, 4130265, 3410265, 4310265,
+        234165,  2034165, 324165,  3024165, 2304165, 3204165, 243165,  2043165, 423165,  4023165, 2403165, 4203165,
+        342165,  3042165, 432165,  4032165, 3402165, 4302165, 2340165, 3240165, 2430165, 4230165, 3420165, 4320165,
+        1234065, 2134065, 1324065, 3124065, 2314065, 3214065, 1243065, 2143065, 1423065, 4123065, 2413065, 4213065,
+        1342065, 3142065, 1432065, 4132065, 3412065, 4312065, 2341065, 3241065, 2431065, 4231065, 3421065, 4321065,
+        123645,  1023645, 213645,  2013645, 1203645, 2103645, 132645,  1032645, 312645,  3012645, 1302645, 3102645,
+        231645,  2031645, 321645,  3021645, 2301645, 3201645, 1230645, 2130645, 1320645, 3120645, 2310645, 3210645,
+        126345,  1026345, 216345,  2016345, 1206345, 2106345, 162345,  1062345, 612345,  6012345, 1602345, 6102345,
+        261345,  2061345, 621345,  6021345, 2601345, 6201345, 1260345, 2160345, 1620345, 6120345, 2610345, 6210345,
+        136245,  1036245, 316245,  3016245, 1306245, 3106245, 163245,  1063245, 613245,  6013245, 1603245, 6103245,
+        361245,  3061245, 631245,  6031245, 3601245, 6301245, 1360245, 3160245, 1630245, 6130245, 3610245, 6310245,
+        236145,  2036145, 326145,  3026145, 2306145, 3206145, 263145,  2063145, 623145,  6023145, 2603145, 6203145,
+        362145,  3062145, 632145,  6032145, 3602145, 6302145, 2360145, 3260145, 2630145, 6230145, 3620145, 6320145,
+        1236045, 2136045, 1326045, 3126045, 2316045, 3216045, 1263045, 2163045, 1623045, 6123045, 2613045, 6213045,
+        1362045, 3162045, 1632045, 6132045, 3612045, 6312045, 2361045, 3261045, 2631045, 6231045, 3621045, 6321045,
+        124635,  1024635, 214635,  2014635, 1204635, 2104635, 142635,  1042635, 412635,  4012635, 1402635, 4102635,
+        241635,  2041635, 421635,  4021635, 2401635, 4201635, 1240635, 2140635, 1420635, 4120635, 2410635, 4210635,
+        126435,  1026435, 216435,  2016435, 1206435, 2106435, 162435,  1062435, 612435,  6012435, 1602435, 6102435,
+        261435,  2061435, 621435,  6021435, 2601435, 6201435, 1260435, 2160435, 1620435, 6120435, 2610435, 6210435,
+        146235,  1046235, 416235,  4016235, 1406235, 4106235, 164235,  1064235, 614235,  6014235, 1604235, 6104235,
+        461235,  4061235, 641235,  6041235, 4601235, 6401235, 1460235, 4160235, 1640235, 6140235, 4610235, 6410235,
+        246135,  2046135, 426135,  4026135, 2406135, 4206135, 264135,  2064135, 624135,  6024135, 2604135, 6204135,
+        462135,  4062135, 642135,  6042135, 4602135, 6402135, 2460135, 4260135, 2640135, 6240135, 4620135, 6420135,
+        1246035, 2146035, 1426035, 4126035, 2416035, 4216035, 1264035, 2164035, 1624035, 6124035, 2614035, 6214035,
+        1462035, 4162035, 1642035, 6142035, 4612035, 6412035, 2461035, 4261035, 2641035, 6241035, 4621035, 6421035,
+        134625,  1034625, 314625,  3014625, 1304625, 3104625, 143625,  1043625, 413625,  4013625, 1403625, 4103625,
+        341625,  3041625, 431625,  4031625, 3401625, 4301625, 1340625, 3140625, 1430625, 4130625, 3410625, 4310625,
+        136425,  1036425, 316425,  3016425, 1306425, 3106425, 163425,  1063425, 613425,  6013425, 1603425, 6103425,
+        361425,  3061425, 631425,  6031425, 3601425, 6301425, 1360425, 3160425, 1630425, 6130425, 3610425, 6310425,
+        146325,  1046325, 416325,  4016325, 1406325, 4106325, 164325,  1064325, 614325,  6014325, 1604325, 6104325,
+        461325,  4061325, 641325,  6041325, 4601325, 6401325, 1460325, 4160325, 1640325, 6140325, 4610325, 6410325,
+        346125,  3046125, 436125,  4036125, 3406125, 4306125, 364125,  3064125, 634125,  6034125, 3604125, 6304125,
+        463125,  4063125, 643125,  6043125, 4603125, 6403125, 3460125, 4360125, 3640125, 6340125, 4630125, 6430125,
+        1346025, 3146025, 1436025, 4136025, 3416025, 4316025, 1364025, 3164025, 1634025, 6134025, 3614025, 6314025,
+        1463025, 4163025, 1643025, 6143025, 4613025, 6413025, 3461025, 4361025, 3641025, 6341025, 4631025, 6431025,
+        234615,  2034615, 324615,  3024615, 2304615, 3204615, 243615,  2043615, 423615,  4023615, 2403615, 4203615,
+        342615,  3042615, 432615,  4032615, 3402615, 4302615, 2340615, 3240615, 2430615, 4230615, 3420615, 4320615,
+        236415,  2036415, 326415,  3026415, 2306415, 3206415, 263415,  2063415, 623415,  6023415, 2603415, 6203415,
+        362415,  3062415, 632415,  6032415, 3602415, 6302415, 2360415, 3260415, 2630415, 6230415, 3620415, 6320415,
+        246315,  2046315, 426315,  4026315, 2406315, 4206315, 264315,  2064315, 624315,  6024315, 2604315, 6204315,
+        462315,  4062315, 642315,  6042315, 4602315, 6402315, 2460315, 4260315, 2640315, 6240315, 4620315, 6420315,
+        346215,  3046215, 436215,  4036215, 3406215, 4306215, 364215,  3064215, 634215,  6034215, 3604215, 6304215,
+        463215,  4063215, 643215,  6043215, 4603215, 6403215, 3460215, 4360215, 3640215, 6340215, 4630215, 6430215,
+        2346015, 3246015, 2436015, 4236015, 3426015, 4326015, 2364015, 3264015, 2634015, 6234015, 3624015, 6324015,
+        2463015, 4263015, 2643015, 6243015, 4623015, 6423015, 3462015, 4362015, 3642015, 6342015, 4632015, 6432015,
+        1234605, 2134605, 1324605, 3124605, 2314605, 3214605, 1243605, 2143605, 1423605, 4123605, 2413605, 4213605,
+        1342605, 3142605, 1432605, 4132605, 3412605, 4312605, 2341605, 3241605, 2431605, 4231605, 3421605, 4321605,
+        1236405, 2136405, 1326405, 3126405, 2316405, 3216405, 1263405, 2163405, 1623405, 6123405, 2613405, 6213405,
+        1362405, 3162405, 1632405, 6132405, 3612405, 6312405, 2361405, 3261405, 2631405, 6231405, 3621405, 6321405,
+        1246305, 2146305, 1426305, 4126305, 2416305, 4216305, 1264305, 2164305, 1624305, 6124305, 2614305, 6214305,
+        1462305, 4162305, 1642305, 6142305, 4612305, 6412305, 2461305, 4261305, 2641305, 6241305, 4621305, 6421305,
+        1346205, 3146205, 1436205, 4136205, 3416205, 4316205, 1364205, 3164205, 1634205, 6134205, 3614205, 6314205,
+        1463205, 4163205, 1643205, 6143205, 4613205, 6413205, 3461205, 4361205, 3641205, 6341205, 4631205, 6431205,
+        2346105, 3246105, 2436105, 4236105, 3426105, 4326105, 2364105, 3264105, 2634105, 6234105, 3624105, 6324105,
+        2463105, 4263105, 2643105, 6243105, 4623105, 6423105, 3462105, 4362105, 3642105, 6342105, 4632105, 6432105,
+        123564,  1023564, 213564,  2013564, 1203564, 2103564, 132564,  1032564, 312564,  3012564, 1302564, 3102564,
+        231564,  2031564, 321564,  3021564, 2301564, 3201564, 1230564, 2130564, 1320564, 3120564, 2310564, 3210564,
+        125364,  1025364, 215364,  2015364, 1205364, 2105364, 152364,  1052364, 512364,  5012364, 1502364, 5102364,
+        251364,  2051364, 521364,  5021364, 2501364, 5201364, 1250364, 2150364, 1520364, 5120364, 2510364, 5210364,
+        135264,  1035264, 315264,  3015264, 1305264, 3105264, 153264,  1053264, 513264,  5013264, 1503264, 5103264,
+        351264,  3051264, 531264,  5031264, 3501264, 5301264, 1350264, 3150264, 1530264, 5130264, 3510264, 5310264,
+        235164,  2035164, 325164,  3025164, 2305164, 3205164, 253164,  2053164, 523164,  5023164, 2503164, 5203164,
+        352164,  3052164, 532164,  5032164, 3502164, 5302164, 2350164, 3250164, 2530164, 5230164, 3520164, 5320164,
+        1235064, 2135064, 1325064, 3125064, 2315064, 3215064, 1253064, 2153064, 1523064, 5123064, 2513064, 5213064,
+        1352064, 3152064, 1532064, 5132064, 3512064, 5312064, 2351064, 3251064, 2531064, 5231064, 3521064, 5321064,
+        123654,  1023654, 213654,  2013654, 1203654, 2103654, 132654,  1032654, 312654,  3012654, 1302654, 3102654,
+        231654,  2031654, 321654,  3021654, 2301654, 3201654, 1230654, 2130654, 1320654, 3120654, 2310654, 3210654,
+        126354,  1026354, 216354,  2016354, 1206354, 2106354, 162354,  1062354, 612354,  6012354, 1602354, 6102354,
+        261354,  2061354, 621354,  6021354, 2601354, 6201354, 1260354, 2160354, 1620354, 6120354, 2610354, 6210354,
+        136254,  1036254, 316254,  3016254, 1306254, 3106254, 163254,  1063254, 613254,  6013254, 1603254, 6103254,
+        361254,  3061254, 631254,  6031254, 3601254, 6301254, 1360254, 3160254, 1630254, 6130254, 3610254, 6310254,
+        236154,  2036154, 326154,  3026154, 2306154, 3206154, 263154,  2063154, 623154,  6023154, 2603154, 6203154,
+        362154,  3062154, 632154,  6032154, 3602154, 6302154, 2360154, 3260154, 2630154, 6230154, 3620154, 6320154,
+        1236054, 2136054, 1326054, 3126054, 2316054, 3216054, 1263054, 2163054, 1623054, 6123054, 2613054, 6213054,
+        1362054, 3162054, 1632054, 6132054, 3612054, 6312054, 2361054, 3261054, 2631054, 6231054, 3621054, 6321054,
+        125634,  1025634, 215634,  2015634, 1205634, 2105634, 152634,  1052634, 512634,  5012634, 1502634, 5102634,
+        251634,  2051634, 521634,  5021634, 2501634, 5201634, 1250634, 2150634, 1520634, 5120634, 2510634, 5210634,
+        126534,  1026534, 216534,  2016534, 1206534, 2106534, 162534,  1062534, 612534,  6012534, 1602534, 6102534,
+        261534,  2061534, 621534,  6021534, 2601534, 6201534, 1260534, 2160534, 1620534, 6120534, 2610534, 6210534,
+        156234,  1056234, 516234,  5016234, 1506234, 5106234, 165234,  1065234, 615234,  6015234, 1605234, 6105234,
+        561234,  5061234, 651234,  6051234, 5601234, 6501234, 1560234, 5160234, 1650234, 6150234, 5610234, 6510234,
+        256134,  2056134, 526134,  5026134, 2506134, 5206134, 265134,  2065134, 625134,  6025134, 2605134, 6205134,
+        562134,  5062134, 652134,  6052134, 5602134, 6502134, 2560134, 5260134, 2650134, 6250134, 5620134, 6520134,
+        1256034, 2156034, 1526034, 5126034, 2516034, 5216034, 1265034, 2165034, 1625034, 6125034, 2615034, 6215034,
+        1562034, 5162034, 1652034, 6152034, 5612034, 6512034, 2561034, 5261034, 2651034, 6251034, 5621034, 6521034,
+        135624,  1035624, 315624,  3015624, 1305624, 3105624, 153624,  1053624, 513624,  5013624, 1503624, 5103624,
+        351624,  3051624, 531624,  5031624, 3501624, 5301624, 1350624, 3150624, 1530624, 5130624, 3510624, 5310624,
+        136524,  1036524, 316524,  3016524, 1306524, 3106524, 163524,  1063524, 613524,  6013524, 1603524, 6103524,
+        361524,  3061524, 631524,  6031524, 3601524, 6301524, 1360524, 3160524, 1630524, 6130524, 3610524, 6310524,
+        156324,  1056324, 516324,  5016324, 1506324, 5106324, 165324,  1065324, 615324,  6015324, 1605324, 6105324,
+        561324,  5061324, 651324,  6051324, 5601324, 6501324, 1560324, 5160324, 1650324, 6150324, 5610324, 6510324,
+        356124,  3056124, 536124,  5036124, 3506124, 5306124, 365124,  3065124, 635124,  6035124, 3605124, 6305124,
+        563124,  5063124, 653124,  6053124, 5603124, 6503124, 3560124, 5360124, 3650124, 6350124, 5630124, 6530124,
+        1356024, 3156024, 1536024, 5136024, 3516024, 5316024, 1365024, 3165024, 1635024, 6135024, 3615024, 6315024,
+        1563024, 5163024, 1653024, 6153024, 5613024, 6513024, 3561024, 5361024, 3651024, 6351024, 5631024, 6531024,
+        235614,  2035614, 325614,  3025614, 2305614, 3205614, 253614,  2053614, 523614,  5023614, 2503614, 5203614,
+        352614,  3052614, 532614,  5032614, 3502614, 5302614, 2350614, 3250614, 2530614, 5230614, 3520614, 5320614,
+        236514,  2036514, 326514,  3026514, 2306514, 3206514, 263514,  2063514, 623514,  6023514, 2603514, 6203514,
+        362514,  3062514, 632514,  6032514, 3602514, 6302514, 2360514, 3260514, 2630514, 6230514, 3620514, 6320514,
+        256314,  2056314, 526314,  5026314, 2506314, 5206314, 265314,  2065314, 625314,  6025314, 2605314, 6205314,
+        562314,  5062314, 652314,  6052314, 5602314, 6502314, 2560314, 5260314, 2650314, 6250314, 5620314, 6520314,
+        356214,  3056214, 536214,  5036214, 3506214, 5306214, 365214,  3065214, 635214,  6035214, 3605214, 6305214,
+        563214,  5063214, 653214,  6053214, 5603214, 6503214, 3560214, 5360214, 3650214, 6350214, 5630214, 6530214,
+        2356014, 3256014, 2536014, 5236014, 3526014, 5326014, 2365014, 3265014, 2635014, 6235014, 3625014, 6325014,
+        2563014, 5263014, 2653014, 6253014, 5623014, 6523014, 3562014, 5362014, 3652014, 6352014, 5632014, 6532014,
+        1235604, 2135604, 1325604, 3125604, 2315604, 3215604, 1253604, 2153604, 1523604, 5123604, 2513604, 5213604,
+        1352604, 3152604, 1532604, 5132604, 3512604, 5312604, 2351604, 3251604, 2531604, 5231604, 3521604, 5321604,
+        1236504, 2136504, 1326504, 3126504, 2316504, 3216504, 1263504, 2163504, 1623504, 6123504, 2613504, 6213504,
+        1362504, 3162504, 1632504, 6132504, 3612504, 6312504, 2361504, 3261504, 2631504, 6231504, 3621504, 6321504,
+        1256304, 2156304, 1526304, 5126304, 2516304, 5216304, 1265304, 2165304, 1625304, 6125304, 2615304, 6215304,
+        1562304, 5162304, 1652304, 6152304, 5612304, 6512304, 2561304, 5261304, 2651304, 6251304, 5621304, 6521304,
+        1356204, 3156204, 1536204, 5136204, 3516204, 5316204, 1365204, 3165204, 1635204, 6135204, 3615204, 6315204,
+        1563204, 5163204, 1653204, 6153204, 5613204, 6513204, 3561204, 5361204, 3651204, 6351204, 5631204, 6531204,
+        2356104, 3256104, 2536104, 5236104, 3526104, 5326104, 2365104, 3265104, 2635104, 6235104, 3625104, 6325104,
+        2563104, 5263104, 2653104, 6253104, 5623104, 6523104, 3562104, 5362104, 3652104, 6352104, 5632104, 6532104,
+        124563,  1024563, 214563,  2014563, 1204563, 2104563, 142563,  1042563, 412563,  4012563, 1402563, 4102563,
+        241563,  2041563, 421563,  4021563, 2401563, 4201563, 1240563, 2140563, 1420563, 4120563, 2410563, 4210563,
+        125463,  1025463, 215463,  2015463, 1205463, 2105463, 152463,  1052463, 512463,  5012463, 1502463, 5102463,
+        251463,  2051463, 521463,  5021463, 2501463, 5201463, 1250463, 2150463, 1520463, 5120463, 2510463, 5210463,
+        145263,  1045263, 415263,  4015263, 1405263, 4105263, 154263,  1054263, 514263,  5014263, 1504263, 5104263,
+        451263,  4051263, 541263,  5041263, 4501263, 5401263, 1450263, 4150263, 1540263, 5140263, 4510263, 5410263,
+        245163,  2045163, 425163,  4025163, 2405163, 4205163, 254163,  2054163, 524163,  5024163, 2504163, 5204163,
+        452163,  4052163, 542163,  5042163, 4502163, 5402163, 2450163, 4250163, 2540163, 5240163, 4520163, 5420163,
+        1245063, 2145063, 1425063, 4125063, 2415063, 4215063, 1254063, 2154063, 1524063, 5124063, 2514063, 5214063,
+        1452063, 4152063, 1542063, 5142063, 4512063, 5412063, 2451063, 4251063, 2541063, 5241063, 4521063, 5421063,
+        124653,  1024653, 214653,  2014653, 1204653, 2104653, 142653,  1042653, 412653,  4012653, 1402653, 4102653,
+        241653,  2041653, 421653,  4021653, 2401653, 4201653, 1240653, 2140653, 1420653, 4120653, 2410653, 4210653,
+        126453,  1026453, 216453,  2016453, 1206453, 2106453, 162453,  1062453, 612453,  6012453, 1602453, 6102453,
+        261453,  2061453, 621453,  6021453, 2601453, 6201453, 1260453, 2160453, 1620453, 6120453, 2610453, 6210453,
+        146253,  1046253, 416253,  4016253, 1406253, 4106253, 164253,  1064253, 614253,  6014253, 1604253, 6104253,
+        461253,  4061253, 641253,  6041253, 4601253, 6401253, 1460253, 4160253, 1640253, 6140253, 4610253, 6410253,
+        246153,  2046153, 426153,  4026153, 2406153, 4206153, 264153,  2064153, 624153,  6024153, 2604153, 6204153,
+        462153,  4062153, 642153,  6042153, 4602153, 6402153, 2460153, 4260153, 2640153, 6240153, 4620153, 6420153,
+        1246053, 2146053, 1426053, 4126053, 2416053, 4216053, 1264053, 2164053, 1624053, 6124053, 2614053, 6214053,
+        1462053, 4162053, 1642053, 6142053, 4612053, 6412053, 2461053, 4261053, 2641053, 6241053, 4621053, 6421053,
+        125643,  1025643, 215643,  2015643, 1205643, 2105643, 152643,  1052643, 512643,  5012643, 1502643, 5102643,
+        251643,  2051643, 521643,  5021643, 2501643, 5201643, 1250643, 2150643, 1520643, 5120643, 2510643, 5210643,
+        126543,  1026543, 216543,  2016543, 1206543, 2106543, 162543,  1062543, 612543,  6012543, 1602543, 6102543,
+        261543,  2061543, 621543,  6021543, 2601543, 6201543, 1260543, 2160543, 1620543, 6120543, 2610543, 6210543,
+        156243,  1056243, 516243,  5016243, 1506243, 5106243, 165243,  1065243, 615243,  6015243, 1605243, 6105243,
+        561243,  5061243, 651243,  6051243, 5601243, 6501243, 1560243, 5160243, 1650243, 6150243, 5610243, 6510243,
+        256143,  2056143, 526143,  5026143, 2506143, 5206143, 265143,  2065143, 625143,  6025143, 2605143, 6205143,
+        562143,  5062143, 652143,  6052143, 5602143, 6502143, 2560143, 5260143, 2650143, 6250143, 5620143, 6520143,
+        1256043, 2156043, 1526043, 5126043, 2516043, 5216043, 1265043, 2165043, 1625043, 6125043, 2615043, 6215043,
+        1562043, 5162043, 1652043, 6152043, 5612043, 6512043, 2561043, 5261043, 2651043, 6251043, 5621043, 6521043,
+        145623,  1045623, 415623,  4015623, 1405623, 4105623, 154623,  1054623, 514623,  5014623, 1504623, 5104623,
+        451623,  4051623, 541623,  5041623, 4501623, 5401623, 1450623, 4150623, 1540623, 5140623, 4510623, 5410623,
+        146523,  1046523, 416523,  4016523, 1406523, 4106523, 164523,  1064523, 614523,  6014523, 1604523, 6104523,
+        461523,  4061523, 641523,  6041523, 4601523, 6401523, 1460523, 4160523, 1640523, 6140523, 4610523, 6410523,
+        156423,  1056423, 516423,  5016423, 1506423, 5106423, 165423,  1065423, 615423,  6015423, 1605423, 6105423,
+        561423,  5061423, 651423,  6051423, 5601423, 6501423, 1560423, 5160423, 1650423, 6150423, 5610423, 6510423,
+        456123,  4056123, 546123,  5046123, 4506123, 5406123, 465123,  4065123, 645123,  6045123, 4605123, 6405123,
+        564123,  5064123, 654123,  6054123, 5604123, 6504123, 4560123, 5460123, 4650123, 6450123, 5640123, 6540123,
+        1456023, 4156023, 1546023, 5146023, 4516023, 5416023, 1465023, 4165023, 1645023, 6145023, 4615023, 6415023,
+        1564023, 5164023, 1654023, 6154023, 5614023, 6514023, 4561023, 5461023, 4651023, 6451023, 5641023, 6541023,
+        245613,  2045613, 425613,  4025613, 2405613, 4205613, 254613,  2054613, 524613,  5024613, 2504613, 5204613,
+        452613,  4052613, 542613,  5042613, 4502613, 5402613, 2450613, 4250613, 2540613, 5240613, 4520613, 5420613,
+        246513,  2046513, 426513,  4026513, 2406513, 4206513, 264513,  2064513, 624513,  6024513, 2604513, 6204513,
+        462513,  4062513, 642513,  6042513, 4602513, 6402513, 2460513, 4260513, 2640513, 6240513, 4620513, 6420513,
+        256413,  2056413, 526413,  5026413, 2506413, 5206413, 265413,  2065413, 625413,  6025413, 2605413, 6205413,
+        562413,  5062413, 652413,  6052413, 5602413, 6502413, 2560413, 5260413, 2650413, 6250413, 5620413, 6520413,
+        456213,  4056213, 546213,  5046213, 4506213, 5406213, 465213,  4065213, 645213,  6045213, 4605213, 6405213,
+        564213,  5064213, 654213,  6054213, 5604213, 6504213, 4560213, 5460213, 4650213, 6450213, 5640213, 6540213,
+        2456013, 4256013, 2546013, 5246013, 4526013, 5426013, 2465013, 4265013, 2645013, 6245013, 4625013, 6425013,
+        2564013, 5264013, 2654013, 6254013, 5624013, 6524013, 4562013, 5462013, 4652013, 6452013, 5642013, 6542013,
+        1245603, 2145603, 1425603, 4125603, 2415603, 4215603, 1254603, 2154603, 1524603, 5124603, 2514603, 5214603,
+        1452603, 4152603, 1542603, 5142603, 4512603, 5412603, 2451603, 4251603, 2541603, 5241603, 4521603, 5421603,
+        1246503, 2146503, 1426503, 4126503, 2416503, 4216503, 1264503, 2164503, 1624503, 6124503, 2614503, 6214503,
+        1462503, 4162503, 1642503, 6142503, 4612503, 6412503, 2461503, 4261503, 2641503, 6241503, 4621503, 6421503,
+        1256403, 2156403, 1526403, 5126403, 2516403, 5216403, 1265403, 2165403, 1625403, 6125403, 2615403, 6215403,
+        1562403, 5162403, 1652403, 6152403, 5612403, 6512403, 2561403, 5261403, 2651403, 6251403, 5621403, 6521403,
+        1456203, 4156203, 1546203, 5146203, 4516203, 5416203, 1465203, 4165203, 1645203, 6145203, 4615203, 6415203,
+        1564203, 5164203, 1654203, 6154203, 5614203, 6514203, 4561203, 5461203, 4651203, 6451203, 5641203, 6541203,
+        2456103, 4256103, 2546103, 5246103, 4526103, 5426103, 2465103, 4265103, 2645103, 6245103, 4625103, 6425103,
+        2564103, 5264103, 2654103, 6254103, 5624103, 6524103, 4562103, 5462103, 4652103, 6452103, 5642103, 6542103,
+        134562,  1034562, 314562,  3014562, 1304562, 3104562, 143562,  1043562, 413562,  4013562, 1403562, 4103562,
+        341562,  3041562, 431562,  4031562, 3401562, 4301562, 1340562, 3140562, 1430562, 4130562, 3410562, 4310562,
+        135462,  1035462, 315462,  3015462, 1305462, 3105462, 153462,  1053462, 513462,  5013462, 1503462, 5103462,
+        351462,  3051462, 531462,  5031462, 3501462, 5301462, 1350462, 3150462, 1530462, 5130462, 3510462, 5310462,
+        145362,  1045362, 415362,  4015362, 1405362, 4105362, 154362,  1054362, 514362,  5014362, 1504362, 5104362,
+        451362,  4051362, 541362,  5041362, 4501362, 5401362, 1450362, 4150362, 1540362, 5140362, 4510362, 5410362,
+        345162,  3045162, 435162,  4035162, 3405162, 4305162, 354162,  3054162, 534162,  5034162, 3504162, 5304162,
+        453162,  4053162, 543162,  5043162, 4503162, 5403162, 3450162, 4350162, 3540162, 5340162, 4530162, 5430162,
+        1345062, 3145062, 1435062, 4135062, 3415062, 4315062, 1354062, 3154062, 1534062, 5134062, 3514062, 5314062,
+        1453062, 4153062, 1543062, 5143062, 4513062, 5413062, 3451062, 4351062, 3541062, 5341062, 4531062, 5431062,
+        134652,  1034652, 314652,  3014652, 1304652, 3104652, 143652,  1043652, 413652,  4013652, 1403652, 4103652,
+        341652,  3041652, 431652,  4031652, 3401652, 4301652, 1340652, 3140652, 1430652, 4130652, 3410652, 4310652,
+        136452,  1036452, 316452,  3016452, 1306452, 3106452, 163452,  1063452, 613452,  6013452, 1603452, 6103452,
+        361452,  3061452, 631452,  6031452, 3601452, 6301452, 1360452, 3160452, 1630452, 6130452, 3610452, 6310452,
+        146352,  1046352, 416352,  4016352, 1406352, 4106352, 164352,  1064352, 614352,  6014352, 1604352, 6104352,
+        461352,  4061352, 641352,  6041352, 4601352, 6401352, 1460352, 4160352, 1640352, 6140352, 4610352, 6410352,
+        346152,  3046152, 436152,  4036152, 3406152, 4306152, 364152,  3064152, 634152,  6034152, 3604152, 6304152,
+        463152,  4063152, 643152,  6043152, 4603152, 6403152, 3460152, 4360152, 3640152, 6340152, 4630152, 6430152,
+        1346052, 3146052, 1436052, 4136052, 3416052, 4316052, 1364052, 3164052, 1634052, 6134052, 3614052, 6314052,
+        1463052, 4163052, 1643052, 6143052, 4613052, 6413052, 3461052, 4361052, 3641052, 6341052, 4631052, 6431052,
+        135642,  1035642, 315642,  3015642, 1305642, 3105642, 153642,  1053642, 513642,  5013642, 1503642, 5103642,
+        351642,  3051642, 531642,  5031642, 3501642, 5301642, 1350642, 3150642, 1530642, 5130642, 3510642, 5310642,
+        136542,  1036542, 316542,  3016542, 1306542, 3106542, 163542,  1063542, 613542,  6013542, 1603542, 6103542,
+        361542,  3061542, 631542,  6031542, 3601542, 6301542, 1360542, 3160542, 1630542, 6130542, 3610542, 6310542,
+        156342,  1056342, 516342,  5016342, 1506342, 5106342, 165342,  1065342, 615342,  6015342, 1605342, 6105342,
+        561342,  5061342, 651342,  6051342, 5601342, 6501342, 1560342, 5160342, 1650342, 6150342, 5610342, 6510342,
+        356142,  3056142, 536142,  5036142, 3506142, 5306142, 365142,  3065142, 635142,  6035142, 3605142, 6305142,
+        563142,  5063142, 653142,  6053142, 5603142, 6503142, 3560142, 5360142, 3650142, 6350142, 5630142, 6530142,
+        1356042, 3156042, 1536042, 5136042, 3516042, 5316042, 1365042, 3165042, 1635042, 6135042, 3615042, 6315042,
+        1563042, 5163042, 1653042, 6153042, 5613042, 6513042, 3561042, 5361042, 3651042, 6351042, 5631042, 6531042,
+        145632,  1045632, 415632,  4015632, 1405632, 4105632, 154632,  1054632, 514632,  5014632, 1504632, 5104632,
+        451632,  4051632, 541632,  5041632, 4501632, 5401632, 1450632, 4150632, 1540632, 5140632, 4510632, 5410632,
+        146532,  1046532, 416532,  4016532, 1406532, 4106532, 164532,  1064532, 614532,  6014532, 1604532, 6104532,
+        461532,  4061532, 641532,  6041532, 4601532, 6401532, 1460532, 4160532, 1640532, 6140532, 4610532, 6410532,
+        156432,  1056432, 516432,  5016432, 1506432, 5106432, 165432,  1065432, 615432,  6015432, 1605432, 6105432,
+        561432,  5061432, 651432,  6051432, 5601432, 6501432, 1560432, 5160432, 1650432, 6150432, 5610432, 6510432,
+        456132,  4056132, 546132,  5046132, 4506132, 5406132, 465132,  4065132, 645132,  6045132, 4605132, 6405132,
+        564132,  5064132, 654132,  6054132, 5604132, 6504132, 4560132, 5460132, 4650132, 6450132, 5640132, 6540132,
+        1456032, 4156032, 1546032, 5146032, 4516032, 5416032, 1465032, 4165032, 1645032, 6145032, 4615032, 6415032,
+        1564032, 5164032, 1654032, 6154032, 5614032, 6514032, 4561032, 5461032, 4651032, 6451032, 5641032, 6541032,
+        345612,  3045612, 435612,  4035612, 3405612, 4305612, 354612,  3054612, 534612,  5034612, 3504612, 5304612,
+        453612,  4053612, 543612,  5043612, 4503612, 5403612, 3450612, 4350612, 3540612, 5340612, 4530612, 5430612,
+        346512,  3046512, 436512,  4036512, 3406512, 4306512, 364512,  3064512, 634512,  6034512, 3604512, 6304512,
+        463512,  4063512, 643512,  6043512, 4603512, 6403512, 3460512, 4360512, 3640512, 6340512, 4630512, 6430512,
+        356412,  3056412, 536412,  5036412, 3506412, 5306412, 365412,  3065412, 635412,  6035412, 3605412, 6305412,
+        563412,  5063412, 653412,  6053412, 5603412, 6503412, 3560412, 5360412, 3650412, 6350412, 5630412, 6530412,
+        456312,  4056312, 546312,  5046312, 4506312, 5406312, 465312,  4065312, 645312,  6045312, 4605312, 6405312,
+        564312,  5064312, 654312,  6054312, 5604312, 6504312, 4560312, 5460312, 4650312, 6450312, 5640312, 6540312,
+        3456012, 4356012, 3546012, 5346012, 4536012, 5436012, 3465012, 4365012, 3645012, 6345012, 4635012, 6435012,
+        3564012, 5364012, 3654012, 6354012, 5634012, 6534012, 4563012, 5463012, 4653012, 6453012, 5643012, 6543012,
+        1345602, 3145602, 1435602, 4135602, 3415602, 4315602, 1354602, 3154602, 1534602, 5134602, 3514602, 5314602,
+        1453602, 4153602, 1543602, 5143602, 4513602, 5413602, 3451602, 4351602, 3541602, 5341602, 4531602, 5431602,
+        1346502, 3146502, 1436502, 4136502, 3416502, 4316502, 1364502, 3164502, 1634502, 6134502, 3614502, 6314502,
+        1463502, 4163502, 1643502, 6143502, 4613502, 6413502, 3461502, 4361502, 3641502, 6341502, 4631502, 6431502,
+        1356402, 3156402, 1536402, 5136402, 3516402, 5316402, 1365402, 3165402, 1635402, 6135402, 3615402, 6315402,
+        1563402, 5163402, 1653402, 6153402, 5613402, 6513402, 3561402, 5361402, 3651402, 6351402, 5631402, 6531402,
+        1456302, 4156302, 1546302, 5146302, 4516302, 5416302, 1465302, 4165302, 1645302, 6145302, 4615302, 6415302,
+        1564302, 5164302, 1654302, 6154302, 5614302, 6514302, 4561302, 5461302, 4651302, 6451302, 5641302, 6541302,
+        3456102, 4356102, 3546102, 5346102, 4536102, 5436102, 3465102, 4365102, 3645102, 6345102, 4635102, 6435102,
+        3564102, 5364102, 3654102, 6354102, 5634102, 6534102, 4563102, 5463102, 4653102, 6453102, 5643102, 6543102,
+        234561,  2034561, 324561,  3024561, 2304561, 3204561, 243561,  2043561, 423561,  4023561, 2403561, 4203561,
+        342561,  3042561, 432561,  4032561, 3402561, 4302561, 2340561, 3240561, 2430561, 4230561, 3420561, 4320561,
+        235461,  2035461, 325461,  3025461, 2305461, 3205461, 253461,  2053461, 523461,  5023461, 2503461, 5203461,
+        352461,  3052461, 532461,  5032461, 3502461, 5302461, 2350461, 3250461, 2530461, 5230461, 3520461, 5320461,
+        245361,  2045361, 425361,  4025361, 2405361, 4205361, 254361,  2054361, 524361,  5024361, 2504361, 5204361,
+        452361,  4052361, 542361,  5042361, 4502361, 5402361, 2450361, 4250361, 2540361, 5240361, 4520361, 5420361,
+        345261,  3045261, 435261,  4035261, 3405261, 4305261, 354261,  3054261, 534261,  5034261, 3504261, 5304261,
+        453261,  4053261, 543261,  5043261, 4503261, 5403261, 3450261, 4350261, 3540261, 5340261, 4530261, 5430261,
+        2345061, 3245061, 2435061, 4235061, 3425061, 4325061, 2354061, 3254061, 2534061, 5234061, 3524061, 5324061,
+        2453061, 4253061, 2543061, 5243061, 4523061, 5423061, 3452061, 4352061, 3542061, 5342061, 4532061, 5432061,
+        234651,  2034651, 324651,  3024651, 2304651, 3204651, 243651,  2043651, 423651,  4023651, 2403651, 4203651,
+        342651,  3042651, 432651,  4032651, 3402651, 4302651, 2340651, 3240651, 2430651, 4230651, 3420651, 4320651,
+        236451,  2036451, 326451,  3026451, 2306451, 3206451, 263451,  2063451, 623451,  6023451, 2603451, 6203451,
+        362451,  3062451, 632451,  6032451, 3602451, 6302451, 2360451, 3260451, 2630451, 6230451, 3620451, 6320451,
+        246351,  2046351, 426351,  4026351, 2406351, 4206351, 264351,  2064351, 624351,  6024351, 2604351, 6204351,
+        462351,  4062351, 642351,  6042351, 4602351, 6402351, 2460351, 4260351, 2640351, 6240351, 4620351, 6420351,
+        346251,  3046251, 436251,  4036251, 3406251, 4306251, 364251,  3064251, 634251,  6034251, 3604251, 6304251,
+        463251,  4063251, 643251,  6043251, 4603251, 6403251, 3460251, 4360251, 3640251, 6340251, 4630251, 6430251,
+        2346051, 3246051, 2436051, 4236051, 3426051, 4326051, 2364051, 3264051, 2634051, 6234051, 3624051, 6324051,
+        2463051, 4263051, 2643051, 6243051, 4623051, 6423051, 3462051, 4362051, 3642051, 6342051, 4632051, 6432051,
+        235641,  2035641, 325641,  3025641, 2305641, 3205641, 253641,  2053641, 523641,  5023641, 2503641, 5203641,
+        352641,  3052641, 532641,  5032641, 3502641, 5302641, 2350641, 3250641, 2530641, 5230641, 3520641, 5320641,
+        236541,  2036541, 326541,  3026541, 2306541, 3206541, 263541,  2063541, 623541,  6023541, 2603541, 6203541,
+        362541,  3062541, 632541,  6032541, 3602541, 6302541, 2360541, 3260541, 2630541, 6230541, 3620541, 6320541,
+        256341,  2056341, 526341,  5026341, 2506341, 5206341, 265341,  2065341, 625341,  6025341, 2605341, 6205341,
+        562341,  5062341, 652341,  6052341, 5602341, 6502341, 2560341, 5260341, 2650341, 6250341, 5620341, 6520341,
+        356241,  3056241, 536241,  5036241, 3506241, 5306241, 365241,  3065241, 635241,  6035241, 3605241, 6305241,
+        563241,  5063241, 653241,  6053241, 5603241, 6503241, 3560241, 5360241, 3650241, 6350241, 5630241, 6530241,
+        2356041, 3256041, 2536041, 5236041, 3526041, 5326041, 2365041, 3265041, 2635041, 6235041, 3625041, 6325041,
+        2563041, 5263041, 2653041, 6253041, 5623041, 6523041, 3562041, 5362041, 3652041, 6352041, 5632041, 6532041,
+        245631,  2045631, 425631,  4025631, 2405631, 4205631, 254631,  2054631, 524631,  5024631, 2504631, 5204631,
+        452631,  4052631, 542631,  5042631, 4502631, 5402631, 2450631, 4250631, 2540631, 5240631, 4520631, 5420631,
+        246531,  2046531, 426531,  4026531, 2406531, 4206531, 264531,  2064531, 624531,  6024531, 2604531, 6204531,
+        462531,  4062531, 642531,  6042531, 4602531, 6402531, 2460531, 4260531, 2640531, 6240531, 4620531, 6420531,
+        256431,  2056431, 526431,  5026431, 2506431, 5206431, 265431,  2065431, 625431,  6025431, 2605431, 6205431,
+        562431,  5062431, 652431,  6052431, 5602431, 6502431, 2560431, 5260431, 2650431, 6250431, 5620431, 6520431,
+        456231,  4056231, 546231,  5046231, 4506231, 5406231, 465231,  4065231, 645231,  6045231, 4605231, 6405231,
+        564231,  5064231, 654231,  6054231, 5604231, 6504231, 4560231, 5460231, 4650231, 6450231, 5640231, 6540231,
+        2456031, 4256031, 2546031, 5246031, 4526031, 5426031, 2465031, 4265031, 2645031, 6245031, 4625031, 6425031,
+        2564031, 5264031, 2654031, 6254031, 5624031, 6524031, 4562031, 5462031, 4652031, 6452031, 5642031, 6542031,
+        345621,  3045621, 435621,  4035621, 3405621, 4305621, 354621,  3054621, 534621,  5034621, 3504621, 5304621,
+        453621,  4053621, 543621,  5043621, 4503621, 5403621, 3450621, 4350621, 3540621, 5340621, 4530621, 5430621,
+        346521,  3046521, 436521,  4036521, 3406521, 4306521, 364521,  3064521, 634521,  6034521, 3604521, 6304521,
+        463521,  4063521, 643521,  6043521, 4603521, 6403521, 3460521, 4360521, 3640521, 6340521, 4630521, 6430521,
+        356421,  3056421, 536421,  5036421, 3506421, 5306421, 365421,  3065421, 635421,  6035421, 3605421, 6305421,
+        563421,  5063421, 653421,  6053421, 5603421, 6503421, 3560421, 5360421, 3650421, 6350421, 5630421, 6530421,
+        456321,  4056321, 546321,  5046321, 4506321, 5406321, 465321,  4065321, 645321,  6045321, 4605321, 6405321,
+        564321,  5064321, 654321,  6054321, 5604321, 6504321, 4560321, 5460321, 4650321, 6450321, 5640321, 6540321,
+        3456021, 4356021, 3546021, 5346021, 4536021, 5436021, 3465021, 4365021, 3645021, 6345021, 4635021, 6435021,
+        3564021, 5364021, 3654021, 6354021, 5634021, 6534021, 4563021, 5463021, 4653021, 6453021, 5643021, 6543021,
+        2345601, 3245601, 2435601, 4235601, 3425601, 4325601, 2354601, 3254601, 2534601, 5234601, 3524601, 5324601,
+        2453601, 4253601, 2543601, 5243601, 4523601, 5423601, 3452601, 4352601, 3542601, 5342601, 4532601, 5432601,
+        2346501, 3246501, 2436501, 4236501, 3426501, 4326501, 2364501, 3264501, 2634501, 6234501, 3624501, 6324501,
+        2463501, 4263501, 2643501, 6243501, 4623501, 6423501, 3462501, 4362501, 3642501, 6342501, 4632501, 6432501,
+        2356401, 3256401, 2536401, 5236401, 3526401, 5326401, 2365401, 3265401, 2635401, 6235401, 3625401, 6325401,
+        2563401, 5263401, 2653401, 6253401, 5623401, 6523401, 3562401, 5362401, 3652401, 6352401, 5632401, 6532401,
+        2456301, 4256301, 2546301, 5246301, 4526301, 5426301, 2465301, 4265301, 2645301, 6245301, 4625301, 6425301,
+        2564301, 5264301, 2654301, 6254301, 5624301, 6524301, 4562301, 5462301, 4652301, 6452301, 5642301, 6542301,
+        3456201, 4356201, 3546201, 5346201, 4536201, 5436201, 3465201, 4365201, 3645201, 6345201, 4635201, 6435201,
+        3564201, 5364201, 3654201, 6354201, 5634201, 6534201, 4563201, 5463201, 4653201, 6453201, 5643201, 6543201,
+        1234560, 2134560, 1324560, 3124560, 2314560, 3214560, 1243560, 2143560, 1423560, 4123560, 2413560, 4213560,
+        1342560, 3142560, 1432560, 4132560, 3412560, 4312560, 2341560, 3241560, 2431560, 4231560, 3421560, 4321560,
+        1235460, 2135460, 1325460, 3125460, 2315460, 3215460, 1253460, 2153460, 1523460, 5123460, 2513460, 5213460,
+        1352460, 3152460, 1532460, 5132460, 3512460, 5312460, 2351460, 3251460, 2531460, 5231460, 3521460, 5321460,
+        1245360, 2145360, 1425360, 4125360, 2415360, 4215360, 1254360, 2154360, 1524360, 5124360, 2514360, 5214360,
+        1452360, 4152360, 1542360, 5142360, 4512360, 5412360, 2451360, 4251360, 2541360, 5241360, 4521360, 5421360,
+        1345260, 3145260, 1435260, 4135260, 3415260, 4315260, 1354260, 3154260, 1534260, 5134260, 3514260, 5314260,
+        1453260, 4153260, 1543260, 5143260, 4513260, 5413260, 3451260, 4351260, 3541260, 5341260, 4531260, 5431260,
+        2345160, 3245160, 2435160, 4235160, 3425160, 4325160, 2354160, 3254160, 2534160, 5234160, 3524160, 5324160,
+        2453160, 4253160, 2543160, 5243160, 4523160, 5423160, 3452160, 4352160, 3542160, 5342160, 4532160, 5432160,
+        1234650, 2134650, 1324650, 3124650, 2314650, 3214650, 1243650, 2143650, 1423650, 4123650, 2413650, 4213650,
+        1342650, 3142650, 1432650, 4132650, 3412650, 4312650, 2341650, 3241650, 2431650, 4231650, 3421650, 4321650,
+        1236450, 2136450, 1326450, 3126450, 2316450, 3216450, 1263450, 2163450, 1623450, 6123450, 2613450, 6213450,
+        1362450, 3162450, 1632450, 6132450, 3612450, 6312450, 2361450, 3261450, 2631450, 6231450, 3621450, 6321450,
+        1246350, 2146350, 1426350, 4126350, 2416350, 4216350, 1264350, 2164350, 1624350, 6124350, 2614350, 6214350,
+        1462350, 4162350, 1642350, 6142350, 4612350, 6412350, 2461350, 4261350, 2641350, 6241350, 4621350, 6421350,
+        1346250, 3146250, 1436250, 4136250, 3416250, 4316250, 1364250, 3164250, 1634250, 6134250, 3614250, 6314250,
+        1463250, 4163250, 1643250, 6143250, 4613250, 6413250, 3461250, 4361250, 3641250, 6341250, 4631250, 6431250,
+        2346150, 3246150, 2436150, 4236150, 3426150, 4326150, 2364150, 3264150, 2634150, 6234150, 3624150, 6324150,
+        2463150, 4263150, 2643150, 6243150, 4623150, 6423150, 3462150, 4362150, 3642150, 6342150, 4632150, 6432150,
+        1235640, 2135640, 1325640, 3125640, 2315640, 3215640, 1253640, 2153640, 1523640, 5123640, 2513640, 5213640,
+        1352640, 3152640, 1532640, 5132640, 3512640, 5312640, 2351640, 3251640, 2531640, 5231640, 3521640, 5321640,
+        1236540, 2136540, 1326540, 3126540, 2316540, 3216540, 1263540, 2163540, 1623540, 6123540, 2613540, 6213540,
+        1362540, 3162540, 1632540, 6132540, 3612540, 6312540, 2361540, 3261540, 2631540, 6231540, 3621540, 6321540,
+        1256340, 2156340, 1526340, 5126340, 2516340, 5216340, 1265340, 2165340, 1625340, 6125340, 2615340, 6215340,
+        1562340, 5162340, 1652340, 6152340, 5612340, 6512340, 2561340, 5261340, 2651340, 6251340, 5621340, 6521340,
+        1356240, 3156240, 1536240, 5136240, 3516240, 5316240, 1365240, 3165240, 1635240, 6135240, 3615240, 6315240,
+        1563240, 5163240, 1653240, 6153240, 5613240, 6513240, 3561240, 5361240, 3651240, 6351240, 5631240, 6531240,
+        2356140, 3256140, 2536140, 5236140, 3526140, 5326140, 2365140, 3265140, 2635140, 6235140, 3625140, 6325140,
+        2563140, 5263140, 2653140, 6253140, 5623140, 6523140, 3562140, 5362140, 3652140, 6352140, 5632140, 6532140,
+        1245630, 2145630, 1425630, 4125630, 2415630, 4215630, 1254630, 2154630, 1524630, 5124630, 2514630, 5214630,
+        1452630, 4152630, 1542630, 5142630, 4512630, 5412630, 2451630, 4251630, 2541630, 5241630, 4521630, 5421630,
+        1246530, 2146530, 1426530, 4126530, 2416530, 4216530, 1264530, 2164530, 1624530, 6124530, 2614530, 6214530,
+        1462530, 4162530, 1642530, 6142530, 4612530, 6412530, 2461530, 4261530, 2641530, 6241530, 4621530, 6421530,
+        1256430, 2156430, 1526430, 5126430, 2516430, 5216430, 1265430, 2165430, 1625430, 6125430, 2615430, 6215430,
+        1562430, 5162430, 1652430, 6152430, 5612430, 6512430, 2561430, 5261430, 2651430, 6251430, 5621430, 6521430,
+        1456230, 4156230, 1546230, 5146230, 4516230, 5416230, 1465230, 4165230, 1645230, 6145230, 4615230, 6415230,
+        1564230, 5164230, 1654230, 6154230, 5614230, 6514230, 4561230, 5461230, 4651230, 6451230, 5641230, 6541230,
+        2456130, 4256130, 2546130, 5246130, 4526130, 5426130, 2465130, 4265130, 2645130, 6245130, 4625130, 6425130,
+        2564130, 5264130, 2654130, 6254130, 5624130, 6524130, 4562130, 5462130, 4652130, 6452130, 5642130, 6542130,
+        1345620, 3145620, 1435620, 4135620, 3415620, 4315620, 1354620, 3154620, 1534620, 5134620, 3514620, 5314620,
+        1453620, 4153620, 1543620, 5143620, 4513620, 5413620, 3451620, 4351620, 3541620, 5341620, 4531620, 5431620,
+        1346520, 3146520, 1436520, 4136520, 3416520, 4316520, 1364520, 3164520, 1634520, 6134520, 3614520, 6314520,
+        1463520, 4163520, 1643520, 6143520, 4613520, 6413520, 3461520, 4361520, 3641520, 6341520, 4631520, 6431520,
+        1356420, 3156420, 1536420, 5136420, 3516420, 5316420, 1365420, 3165420, 1635420, 6135420, 3615420, 6315420,
+        1563420, 5163420, 1653420, 6153420, 5613420, 6513420, 3561420, 5361420, 3651420, 6351420, 5631420, 6531420,
+        1456320, 4156320, 1546320, 5146320, 4516320, 5416320, 1465320, 4165320, 1645320, 6145320, 4615320, 6415320,
+        1564320, 5164320, 1654320, 6154320, 5614320, 6514320, 4561320, 5461320, 4651320, 6451320, 5641320, 6541320,
+        3456120, 4356120, 3546120, 5346120, 4536120, 5436120, 3465120, 4365120, 3645120, 6345120, 4635120, 6435120,
+        3564120, 5364120, 3654120, 6354120, 5634120, 6534120, 4563120, 5463120, 4653120, 6453120, 5643120, 6543120,
+        2345610, 3245610, 2435610, 4235610, 3425610, 4325610, 2354610, 3254610, 2534610, 5234610, 3524610, 5324610,
+        2453610, 4253610, 2543610, 5243610, 4523610, 5423610, 3452610, 4352610, 3542610, 5342610, 4532610, 5432610,
+        2346510, 3246510, 2436510, 4236510, 3426510, 4326510, 2364510, 3264510, 2634510, 6234510, 3624510, 6324510,
+        2463510, 4263510, 2643510, 6243510, 4623510, 6423510, 3462510, 4362510, 3642510, 6342510, 4632510, 6432510,
+        2356410, 3256410, 2536410, 5236410, 3526410, 5326410, 2365410, 3265410, 2635410, 6235410, 3625410, 6325410,
+        2563410, 5263410, 2653410, 6253410, 5623410, 6523410, 3562410, 5362410, 3652410, 6352410, 5632410, 6532410,
+        2456310, 4256310, 2546310, 5246310, 4526310, 5426310, 2465310, 4265310, 2645310, 6245310, 4625310, 6425310,
+        2564310, 5264310, 2654310, 6254310, 5624310, 6524310, 4562310, 5462310, 4652310, 6452310, 5642310, 6542310,
+        3456210, 4356210, 3546210, 5346210, 4536210, 5436210, 3465210, 4365210, 3645210, 6345210, 4635210, 6435210,
+        3564210, 5364210, 3654210, 6354210, 5634210, 6534210, 4563210, 5463210, 4653210, 6453210, 5643210, 6543210};
     std::map<uint64_t, int> expected;
-    for (std::size_t i = 0; i < 5040; i++)
-      expected[pre_expected[i]] = 0; // flags are 0, everything is symmetric here
+    for (std::size_t i = 0; i < 5040; i++) expected[pre_expected[i]] = 0;  // flags are 0, everything is symmetric here
 
     VERIFY(isDynGroup(group));
     VERIFY_IS_EQUAL(group.size(), 5040u);
@@ -655,10 +645,9 @@
   }
 }
 
-static void test_tensor_epsilon()
-{
-  SGroup<AntiSymmetry<0,1>, AntiSymmetry<1,2>> sym;
-  Tensor<int, 3> epsilon(3,3,3);
+static void test_tensor_epsilon() {
+  SGroup<AntiSymmetry<0, 1>, AntiSymmetry<1, 2>> sym;
+  Tensor<int, 3> epsilon(3, 3, 3);
 
   epsilon.setZero();
   sym(epsilon, 0, 1, 2) = 1;
@@ -666,16 +655,15 @@
   for (int i = 0; i < 3; i++) {
     for (int j = 0; j < 3; j++) {
       for (int k = 0; k < 3; k++) {
-        VERIFY_IS_EQUAL((epsilon(i,j,k)), (- (j - i) * (k - j) * (i - k) / 2) );
+        VERIFY_IS_EQUAL((epsilon(i, j, k)), (-(j - i) * (k - j) * (i - k) / 2));
       }
     }
   }
 }
 
-static void test_tensor_sym()
-{
-  SGroup<Symmetry<0,1>, Symmetry<2,3>> sym;
-  Tensor<int, 4> t(10,10,10,10);
+static void test_tensor_sym() {
+  SGroup<Symmetry<0, 1>, Symmetry<2, 3>> sym;
+  Tensor<int, 4> t(10, 10, 10, 10);
 
   t.setZero();
 
@@ -698,13 +686,11 @@
       }
     }
   }
-
 }
 
-static void test_tensor_asym()
-{
-  SGroup<AntiSymmetry<0,1>, AntiSymmetry<2,3>> sym;
-  Tensor<int, 4> t(10,10,10,10);
+static void test_tensor_asym() {
+  SGroup<AntiSymmetry<0, 1>, AntiSymmetry<2, 3>> sym;
+  Tensor<int, 4> t(10, 10, 10, 10);
 
   t.setZero();
 
@@ -727,9 +713,9 @@
           else if (i > j && k > l)
             VERIFY_IS_EQUAL((t(i, j, k, l)), (((i * j) + (k * l))));
           else if (i < j && k > l)
-            VERIFY_IS_EQUAL((t(i, j, k, l)), (- ((i * j) + (k * l))));
+            VERIFY_IS_EQUAL((t(i, j, k, l)), (-((i * j) + (k * l))));
           else if (i > j && k < l)
-            VERIFY_IS_EQUAL((t(i, j, k, l)), (- ((i * j) + (k * l))));
+            VERIFY_IS_EQUAL((t(i, j, k, l)), (-((i * j) + (k * l))));
           else
             VERIFY_IS_EQUAL((t(i, j, k, l)), 0);
         }
@@ -738,12 +724,11 @@
   }
 }
 
-static void test_tensor_dynsym()
-{
+static void test_tensor_dynsym() {
   DynamicSGroup sym;
-  sym.addSymmetry(0,1);
-  sym.addSymmetry(2,3);
-  Tensor<int, 4> t(10,10,10,10);
+  sym.addSymmetry(0, 1);
+  sym.addSymmetry(2, 3);
+  Tensor<int, 4> t(10, 10, 10, 10);
 
   t.setZero();
 
@@ -768,10 +753,9 @@
   }
 }
 
-static void test_tensor_randacc()
-{
-  SGroup<Symmetry<0,1>, Symmetry<2,3>> sym;
-  Tensor<int, 4> t(10,10,10,10);
+static void test_tensor_randacc() {
+  SGroup<Symmetry<0, 1>, Symmetry<2, 3>> sym;
+  Tensor<int, 4> t(10, 10, 10, 10);
 
   t.setZero();
 
@@ -783,10 +767,8 @@
     int k = rand() % 10;
     int l = rand() % 10;
     // only access those indices in a given order
-    if (i < j)
-      std::swap(i, j);
-    if (k < l)
-      std::swap(k, l);
+    if (i < j) std::swap(i, j);
+    if (k < l) std::swap(k, l);
     sym(t, i, j, k, l) = (i + j) * (k + l);
   }
 
@@ -801,8 +783,7 @@
   }
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_symmetry)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_symmetry) {
   CALL_SUBTEST(test_symgroups_static());
   CALL_SUBTEST(test_symgroups_dynamic());
   CALL_SUBTEST(test_symgroups_selection());
diff --git a/unsupported/test/cxx11_tensor_thread_local.cpp b/unsupported/test/cxx11_tensor_thread_local.cpp
index ec9d9ca..32ba2cd 100644
--- a/unsupported/test/cxx11_tensor_thread_local.cpp
+++ b/unsupported/test/cxx11_tensor_thread_local.cpp
@@ -28,9 +28,7 @@
 };
 
 struct InitCounter {
-  void operator()(Counter& counter) {
-    counter.created_by = std::this_thread::get_id();
-  }
+  void operator()(Counter& counter) { counter.created_by = std::this_thread::get_id(); }
 };
 
 void test_simple_thread_local() {
@@ -53,8 +51,7 @@
 
   barrier.Wait();
 
-  counter.ForEach(
-      [](std::thread::id, Counter& cnt) { VERIFY_IS_EQUAL(cnt.value(), 3); });
+  counter.ForEach([](std::thread::id, Counter& cnt) { VERIFY_IS_EQUAL(cnt.value(), 3); });
 }
 
 void test_zero_sized_thread_local() {
@@ -102,8 +99,7 @@
   VERIFY_IS_EQUAL(total, num_tasks);
   // Not all threads in a pool might be woken up to execute submitted tasks.
   // Also thread_pool.Schedule() might use current thread if queue is full.
-  VERIFY_IS_EQUAL(
-      unique_threads.size() <= (static_cast<size_t>(num_threads + 1)), true);
+  VERIFY_IS_EQUAL(unique_threads.size() <= (static_cast<size_t>(num_threads + 1)), true);
 }
 
 // Lock free thread local storage is too small to fit all the unique threads,
@@ -137,8 +133,7 @@
   VERIFY_IS_EQUAL(total, num_tasks);
   // Not all threads in a pool might be woken up to execute submitted tasks.
   // Also thread_pool.Schedule() might use current thread if queue is full.
-  VERIFY_IS_EQUAL(
-      unique_threads.size() <= (static_cast<size_t>(num_threads + 1)), true);
+  VERIFY_IS_EQUAL(unique_threads.size() <= (static_cast<size_t>(num_threads + 1)), true);
 }
 
 EIGEN_DECLARE_TEST(cxx11_tensor_thread_local) {
diff --git a/unsupported/test/cxx11_tensor_thread_pool.cpp b/unsupported/test/cxx11_tensor_thread_pool.cpp
index b772a1d..8961c84 100644
--- a/unsupported/test/cxx11_tensor_thread_pool.cpp
+++ b/unsupported/test/cxx11_tensor_thread_pool.cpp
@@ -9,7 +9,6 @@
 
 #define EIGEN_USE_THREADS
 
-
 #include "main.h"
 #include <iostream>
 #include <Eigen/CXX11/Tensor>
@@ -36,8 +35,7 @@
   int dealloc_count_ = 0;
 };
 
-void test_multithread_elementwise()
-{
+void test_multithread_elementwise() {
   Tensor<float, 3> in1(200, 30, 70);
   Tensor<float, 3> in2(200, 30, 70);
   Tensor<double, 3> out(200, 30, 70);
@@ -58,8 +56,7 @@
   }
 }
 
-void test_async_multithread_elementwise()
-{
+void test_async_multithread_elementwise() {
   Tensor<float, 3> in1(200, 30, 70);
   Tensor<float, 3> in2(200, 30, 70);
   Tensor<double, 3> out(200, 30, 70);
@@ -83,11 +80,10 @@
   }
 }
 
-void test_multithread_compound_assignment()
-{
-  Tensor<float, 3> in1(2,3,7);
-  Tensor<float, 3> in2(2,3,7);
-  Tensor<float, 3> out(2,3,7);
+void test_multithread_compound_assignment() {
+  Tensor<float, 3> in1(2, 3, 7);
+  Tensor<float, 3> in2(2, 3, 7);
+  Tensor<float, 3> out(2, 3, 7);
 
   in1.setRandom();
   in2.setRandom();
@@ -100,15 +96,14 @@
   for (int i = 0; i < 2; ++i) {
     for (int j = 0; j < 3; ++j) {
       for (int k = 0; k < 7; ++k) {
-        VERIFY_IS_APPROX(out(i,j,k), in1(i,j,k) + in2(i,j,k) * 3.14f);
+        VERIFY_IS_APPROX(out(i, j, k), in1(i, j, k) + in2(i, j, k) * 3.14f);
       }
     }
   }
 }
 
-template<int DataLayout>
-void test_multithread_contraction()
-{
+template <int DataLayout>
+void test_multithread_contraction() {
   Tensor<float, 4, DataLayout> t_left(30, 50, 37, 31);
   Tensor<float, 5, DataLayout> t_right(37, 31, 70, 2, 10);
   Tensor<float, 5, DataLayout> t_result(30, 50, 70, 2, 10);
@@ -132,7 +127,7 @@
   t_result.device(thread_pool_device) = t_left.contract(t_right, dims);
   m_result = m_left * m_right;
 
- for (ptrdiff_t i = 0; i < t_result.size(); i++) {
+  for (ptrdiff_t i = 0; i < t_result.size(); i++) {
     VERIFY(&t_result.data()[i] != &m_result.data()[i]);
     if (fabsf(t_result(i) - m_result(i)) < 1e-4f) {
       continue;
@@ -140,18 +135,16 @@
     if (Eigen::internal::isApprox(t_result(i), m_result(i), 1e-4f)) {
       continue;
     }
-    std::cout << "mismatch detected at index " << i << ": " << t_result(i)
-              << " vs " <<  m_result(i) << std::endl;
+    std::cout << "mismatch detected at index " << i << ": " << t_result(i) << " vs " << m_result(i) << std::endl;
     assert(false);
   }
 }
 
-template<int DataLayout>
-void test_contraction_corner_cases()
-{
+template <int DataLayout>
+void test_contraction_corner_cases() {
   Tensor<float, 2, DataLayout> t_left(32, 500);
-  Tensor<float, 2, DataLayout> t_right(32, 28*28);
-  Tensor<float, 2, DataLayout> t_result(500, 28*28);
+  Tensor<float, 2, DataLayout> t_right(32, 28 * 28);
+  Tensor<float, 2, DataLayout> t_result(500, 28 * 28);
 
   t_left = (t_left.constant(-0.5f) + t_left.random()) * 2.0f;
   t_right = (t_right.constant(-0.6f) + t_right.random()) * 2.0f;
@@ -163,8 +156,8 @@
 
   typedef Map<Matrix<float, Dynamic, Dynamic, DataLayout>> MapXf;
   MapXf m_left(t_left.data(), 32, 500);
-  MapXf m_right(t_right.data(), 32, 28*28);
-  Matrix<float, Dynamic, Dynamic, DataLayout> m_result(500, 28*28);
+  MapXf m_right(t_right.data(), 32, 28 * 28);
+  Matrix<float, Dynamic, Dynamic, DataLayout> m_result(500, 28 * 28);
 
   Eigen::ThreadPool tp(12);
   Eigen::ThreadPoolDevice thread_pool_device(&tp, 12);
@@ -176,22 +169,23 @@
   for (ptrdiff_t i = 0; i < t_result.size(); i++) {
     assert(!(numext::isnan)(t_result.data()[i]));
     if (fabsf(t_result.data()[i] - m_result.data()[i]) >= 1e-4f) {
-      std::cout << "mismatch detected at index " << i << " : " << t_result.data()[i] << " vs " <<  m_result.data()[i] << std::endl;
+      std::cout << "mismatch detected at index " << i << " : " << t_result.data()[i] << " vs " << m_result.data()[i]
+                << std::endl;
       assert(false);
     }
   }
 
   t_left.resize(32, 1);
   t_left = (t_left.constant(-0.5f) + t_left.random()) * 2.0f;
-  t_result.resize (1, 28*28);
+  t_result.resize(1, 28 * 28);
   t_result = t_result.constant(NAN);
   t_result.device(thread_pool_device) = t_left.contract(t_right, dims);
-  new(&m_left) MapXf(t_left.data(), 32, 1);
+  new (&m_left) MapXf(t_left.data(), 32, 1);
   m_result = m_left.transpose() * m_right;
   for (ptrdiff_t i = 0; i < t_result.size(); i++) {
     assert(!(numext::isnan)(t_result.data()[i]));
     if (fabsf(t_result.data()[i] - m_result.data()[i]) >= 1e-4f) {
-      std::cout << "mismatch detected: " << t_result.data()[i] << " vs " <<  m_result.data()[i] << std::endl;
+      std::cout << "mismatch detected: " << t_result.data()[i] << " vs " << m_result.data()[i] << std::endl;
       assert(false);
     }
   }
@@ -200,16 +194,16 @@
   t_right.resize(32, 4);
   t_left = (t_left.constant(-0.5f) + t_left.random()) * 2.0f;
   t_right = (t_right.constant(-0.6f) + t_right.random()) * 2.0f;
-  t_result.resize (500, 4);
+  t_result.resize(500, 4);
   t_result = t_result.constant(NAN);
   t_result.device(thread_pool_device) = t_left.contract(t_right, dims);
-  new(&m_left) MapXf(t_left.data(), 32, 500);
-  new(&m_right) MapXf(t_right.data(), 32, 4);
+  new (&m_left) MapXf(t_left.data(), 32, 500);
+  new (&m_right) MapXf(t_right.data(), 32, 4);
   m_result = m_left.transpose() * m_right;
   for (ptrdiff_t i = 0; i < t_result.size(); i++) {
     assert(!(numext::isnan)(t_result.data()[i]));
     if (fabsf(t_result.data()[i] - m_result.data()[i]) >= 1e-4f) {
-      std::cout << "mismatch detected: " << t_result.data()[i] << " vs " <<  m_result.data()[i] << std::endl;
+      std::cout << "mismatch detected: " << t_result.data()[i] << " vs " << m_result.data()[i] << std::endl;
       assert(false);
     }
   }
@@ -218,32 +212,28 @@
   t_right.resize(32, 4);
   t_left = (t_left.constant(-0.5f) + t_left.random()) * 2.0f;
   t_right = (t_right.constant(-0.6f) + t_right.random()) * 2.0f;
-  t_result.resize (1, 4);
+  t_result.resize(1, 4);
   t_result = t_result.constant(NAN);
   t_result.device(thread_pool_device) = t_left.contract(t_right, dims);
-  new(&m_left) MapXf(t_left.data(), 32, 1);
-  new(&m_right) MapXf(t_right.data(), 32, 4);
+  new (&m_left) MapXf(t_left.data(), 32, 1);
+  new (&m_right) MapXf(t_right.data(), 32, 4);
   m_result = m_left.transpose() * m_right;
   for (ptrdiff_t i = 0; i < t_result.size(); i++) {
     assert(!(numext::isnan)(t_result.data()[i]));
     if (fabsf(t_result.data()[i] - m_result.data()[i]) >= 1e-4f) {
-      std::cout << "mismatch detected: " << t_result.data()[i] << " vs " <<  m_result.data()[i] << std::endl;
+      std::cout << "mismatch detected: " << t_result.data()[i] << " vs " << m_result.data()[i] << std::endl;
       assert(false);
     }
   }
 }
 
-template<int DataLayout>
+template <int DataLayout>
 void test_multithread_contraction_agrees_with_singlethread() {
   int contract_size = internal::random<int>(1, 5000);
 
-  Tensor<float, 3, DataLayout> left(internal::random<int>(1, 80),
-                                    contract_size,
-                                    internal::random<int>(1, 100));
+  Tensor<float, 3, DataLayout> left(internal::random<int>(1, 80), contract_size, internal::random<int>(1, 100));
 
-  Tensor<float, 4, DataLayout> right(internal::random<int>(1, 25),
-                                     internal::random<int>(1, 37),
-                                     contract_size,
+  Tensor<float, 4, DataLayout> right(internal::random<int>(1, 25), internal::random<int>(1, 37), contract_size,
                                      internal::random<int>(1, 51));
 
   left.setRandom();
@@ -278,10 +268,9 @@
 // Apply Sqrt to all output elements.
 struct SqrtOutputKernel {
   template <typename Index, typename Scalar>
-  EIGEN_ALWAYS_INLINE void operator()(
-      const internal::blas_data_mapper<Scalar, Index, ColMajor>& output_mapper,
-      const TensorContractionParams&, Index, Index, Index num_rows,
-      Index num_cols) const {
+  EIGEN_ALWAYS_INLINE void operator()(const internal::blas_data_mapper<Scalar, Index, ColMajor>& output_mapper,
+                                      const TensorContractionParams&, Index, Index, Index num_rows,
+                                      Index num_cols) const {
     for (int i = 0; i < num_rows; ++i) {
       for (int j = 0; j < num_cols; ++j) {
         output_mapper(i, j) = std::sqrt(output_mapper(i, j));
@@ -330,18 +319,14 @@
   }
 }
 
-template<int DataLayout>
-void test_async_multithread_contraction_agrees_with_singlethread()
-{
+template <int DataLayout>
+void test_async_multithread_contraction_agrees_with_singlethread() {
   int contract_size = internal::random<int>(100, 500);
 
-  Tensor<float, 3, DataLayout> left(internal::random<int>(10, 40),
-                                    contract_size,
-                                    internal::random<int>(10, 40));
+  Tensor<float, 3, DataLayout> left(internal::random<int>(10, 40), contract_size, internal::random<int>(10, 40));
 
-  Tensor<float, 4, DataLayout> right(
-      internal::random<int>(1, 20), internal::random<int>(1, 20), contract_size,
-      internal::random<int>(1, 20));
+  Tensor<float, 4, DataLayout> right(internal::random<int>(1, 20), internal::random<int>(1, 20), contract_size,
+                                     internal::random<int>(1, 20));
 
   left.setRandom();
   right.setRandom();
@@ -362,8 +347,7 @@
   Tensor<float, 5, DataLayout> tp_result(st_result.dimensions());
 
   Eigen::Barrier barrier(1);
-  tp_result.device(thread_pool_device, [&barrier]() { barrier.Notify(); }) =
-      left.contract(right, dims);
+  tp_result.device(thread_pool_device, [&barrier]() { barrier.Notify(); }) = left.contract(right, dims);
   barrier.Wait();
 
   VERIFY(dimensions_match(st_result.dimensions(), tp_result.dimensions()));
@@ -378,8 +362,7 @@
 
 // We are triggering 'evalShardedByInnerDim' optimization.
 template <int DataLayout>
-static void test_sharded_by_inner_dim_contraction()
-{
+static void test_sharded_by_inner_dim_contraction() {
   typedef Tensor<float, 1>::DimensionPair DimPair;
 
   const int num_threads = internal::random<int>(4, 16);
@@ -418,8 +401,7 @@
 
 // We are triggering 'evalShardedByInnerDim' optimization with output kernel.
 template <int DataLayout>
-static void test_sharded_by_inner_dim_contraction_with_output_kernel()
-{
+static void test_sharded_by_inner_dim_contraction_with_output_kernel() {
   typedef Tensor<float, 1>::DimensionPair DimPair;
 
   const int num_threads = internal::random<int>(4, 16);
@@ -458,8 +440,7 @@
 
 // We are triggering 'evalShardedByInnerDim' optimization.
 template <int DataLayout>
-static void test_async_sharded_by_inner_dim_contraction()
-{
+static void test_async_sharded_by_inner_dim_contraction() {
   typedef Tensor<float, 1>::DimensionPair DimPair;
 
   const int num_threads = internal::random<int>(4, 16);
@@ -489,8 +470,7 @@
 
   // compute results by separate methods
   Eigen::Barrier barrier(1);
-  t_result.device(device, [&barrier]() { barrier.Notify(); }) =
-      t_left.contract(t_right, dims);
+  t_result.device(device, [&barrier]() { barrier.Notify(); }) = t_left.contract(t_right, dims);
   barrier.Wait();
 
   m_result = m_left * m_right;
@@ -502,8 +482,7 @@
 
 // We are triggering 'evalShardedByInnerDim' optimization with output kernel.
 template <int DataLayout>
-static void test_async_sharded_by_inner_dim_contraction_with_output_kernel()
-{
+static void test_async_sharded_by_inner_dim_contraction_with_output_kernel() {
   typedef Tensor<float, 1>::DimensionPair DimPair;
 
   const int num_threads = internal::random<int>(4, 16);
@@ -533,8 +512,7 @@
 
   // compute results by separate methods
   Eigen::Barrier barrier(1);
-  t_result.device(device, [&barrier]() { barrier.Notify(); }) =
-      t_left.contract(t_right, dims, SqrtOutputKernel());
+  t_result.device(device, [&barrier]() { barrier.Notify(); }) = t_left.contract(t_right, dims, SqrtOutputKernel());
   barrier.Wait();
   m_result = m_left * m_right;
 
@@ -543,15 +521,13 @@
   }
 }
 
-template<int DataLayout>
+template <int DataLayout>
 void test_full_contraction() {
   int contract_size1 = internal::random<int>(1, 500);
   int contract_size2 = internal::random<int>(1, 500);
 
-  Tensor<float, 2, DataLayout> left(contract_size1,
-                                    contract_size2);
-  Tensor<float, 2, DataLayout> right(contract_size1,
-                                    contract_size2);
+  Tensor<float, 2, DataLayout> left(contract_size1, contract_size2);
+  Tensor<float, 2, DataLayout> right(contract_size1, contract_size2);
   left.setRandom();
   right.setRandom();
 
@@ -579,7 +555,7 @@
   }
 }
 
-template<int DataLayout>
+template <int DataLayout>
 void test_multithreaded_reductions() {
   const int num_threads = internal::random<int>(3, 11);
   ThreadPool thread_pool(num_threads);
@@ -601,9 +577,7 @@
   VERIFY_IS_APPROX(full_redux(), full_redux_tp());
 }
 
-
 void test_memcpy() {
-
   for (int i = 0; i < 5; ++i) {
     const int num_threads = internal::random<int>(3, 11);
     Eigen::ThreadPool tp(num_threads);
@@ -613,49 +587,45 @@
     Tensor<float, 1> t1(size);
     t1.setRandom();
     std::vector<float> result(size);
-    thread_pool_device.memcpy(&result[0], t1.data(), size*sizeof(float));
+    thread_pool_device.memcpy(&result[0], t1.data(), size * sizeof(float));
     for (int j = 0; j < size; j++) {
       VERIFY_IS_EQUAL(t1(j), result[j]);
     }
   }
 }
 
-
-void test_multithread_random()
-{
+void test_multithread_random() {
   Eigen::ThreadPool tp(2);
   Eigen::ThreadPoolDevice device(&tp, 2);
   Tensor<float, 1> t(1 << 20);
   t.device(device) = t.random<Eigen::internal::NormalRandomGenerator<float>>();
 }
 
-template<int DataLayout>
-void test_multithread_shuffle(Allocator* allocator)
-{
-  Tensor<float, 4, DataLayout> tensor(17,5,7,11);
+template <int DataLayout>
+void test_multithread_shuffle(Allocator* allocator) {
+  Tensor<float, 4, DataLayout> tensor(17, 5, 7, 11);
   tensor.setRandom();
 
   const int num_threads = internal::random<int>(2, 11);
   ThreadPool threads(num_threads);
   Eigen::ThreadPoolDevice device(&threads, num_threads, allocator);
 
-  Tensor<float, 4, DataLayout> shuffle(7,5,11,17);
-  array<ptrdiff_t, 4> shuffles = {{2,1,3,0}};
+  Tensor<float, 4, DataLayout> shuffle(7, 5, 11, 17);
+  array<ptrdiff_t, 4> shuffles = {{2, 1, 3, 0}};
   shuffle.device(device) = tensor.shuffle(shuffles);
 
   for (int i = 0; i < 17; ++i) {
     for (int j = 0; j < 5; ++j) {
       for (int k = 0; k < 7; ++k) {
         for (int l = 0; l < 11; ++l) {
-          VERIFY_IS_EQUAL(tensor(i,j,k,l), shuffle(k,j,l,i));
+          VERIFY_IS_EQUAL(tensor(i, j, k, l), shuffle(k, j, l, i));
         }
       }
     }
   }
 }
 
-void test_threadpool_allocate(TestAllocator* allocator)
-{
+void test_threadpool_allocate(TestAllocator* allocator) {
   const int num_threads = internal::random<int>(2, 11);
   const int num_allocs = internal::random<int>(2, 11);
   ThreadPool threads(num_threads);
@@ -670,8 +640,7 @@
   VERIFY_IS_EQUAL(allocator->dealloc_count(), num_allocs);
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_thread_pool)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_thread_pool) {
   CALL_SUBTEST_1(test_multithread_elementwise());
   CALL_SUBTEST_1(test_async_multithread_elementwise());
   CALL_SUBTEST_1(test_multithread_compound_assignment());
diff --git a/unsupported/test/cxx11_tensor_trace.cpp b/unsupported/test/cxx11_tensor_trace.cpp
index 0097228..5b95839 100644
--- a/unsupported/test/cxx11_tensor_trace.cpp
+++ b/unsupported/test/cxx11_tensor_trace.cpp
@@ -11,8 +11,8 @@
 
 #include <Eigen/CXX11/Tensor>
 
-using Eigen::Tensor;
 using Eigen::array;
+using Eigen::Tensor;
 
 template <int DataLayout>
 static void test_0D_trace() {
@@ -23,7 +23,6 @@
   VERIFY_IS_EQUAL(result(), tensor());
 }
 
-
 template <int DataLayout>
 static void test_all_dimensions_trace() {
   Tensor<float, 3, DataLayout> tensor1(5, 5, 5);
@@ -38,7 +37,7 @@
 
   Tensor<float, 5, DataLayout> tensor2(7, 7, 7, 7, 7);
   tensor2.setRandom();
-  array<ptrdiff_t, 5> dims = { { 2, 1, 0, 3, 4 } };
+  array<ptrdiff_t, 5> dims = {{2, 1, 0, 3, 4}};
   Tensor<float, 0, DataLayout> result2 = tensor2.trace(dims);
   VERIFY_IS_EQUAL(result2.rank(), 0);
   sum = 0.0f;
@@ -48,12 +47,11 @@
   VERIFY_IS_EQUAL(result2(), sum);
 }
 
-
 template <int DataLayout>
 static void test_simple_trace() {
   Tensor<float, 3, DataLayout> tensor1(3, 5, 3);
   tensor1.setRandom();
-  array<ptrdiff_t, 2> dims1 = { { 0, 2 } };
+  array<ptrdiff_t, 2> dims1 = {{0, 2}};
   Tensor<float, 1, DataLayout> result1 = tensor1.trace(dims1);
   VERIFY_IS_EQUAL(result1.rank(), 1);
   VERIFY_IS_EQUAL(result1.dimension(0), 5);
@@ -68,7 +66,7 @@
 
   Tensor<float, 4, DataLayout> tensor2(5, 5, 7, 7);
   tensor2.setRandom();
-  array<ptrdiff_t, 2> dims2 = { { 2, 3 } };
+  array<ptrdiff_t, 2> dims2 = {{2, 3}};
   Tensor<float, 2, DataLayout> result2 = tensor2.trace(dims2);
   VERIFY_IS_EQUAL(result2.rank(), 2);
   VERIFY_IS_EQUAL(result2.dimension(0), 5);
@@ -83,7 +81,7 @@
     }
   }
 
-  array<ptrdiff_t, 2> dims3 = { { 1, 0 } };
+  array<ptrdiff_t, 2> dims3 = {{1, 0}};
   Tensor<float, 2, DataLayout> result3 = tensor2.trace(dims3);
   VERIFY_IS_EQUAL(result3.rank(), 2);
   VERIFY_IS_EQUAL(result3.dimension(0), 7);
@@ -100,7 +98,7 @@
 
   Tensor<float, 5, DataLayout> tensor3(3, 7, 3, 7, 3);
   tensor3.setRandom();
-  array<ptrdiff_t, 3> dims4 = { { 0, 2, 4 } };
+  array<ptrdiff_t, 3> dims4 = {{0, 2, 4}};
   Tensor<float, 2, DataLayout> result4 = tensor3.trace(dims4);
   VERIFY_IS_EQUAL(result4.rank(), 2);
   VERIFY_IS_EQUAL(result4.dimension(0), 7);
@@ -117,7 +115,7 @@
 
   Tensor<float, 5, DataLayout> tensor4(3, 7, 4, 7, 5);
   tensor4.setRandom();
-  array<ptrdiff_t, 2> dims5 = { { 1, 3 } };
+  array<ptrdiff_t, 2> dims5 = {{1, 3}};
   Tensor<float, 3, DataLayout> result5 = tensor4.trace(dims5);
   VERIFY_IS_EQUAL(result5.rank(), 3);
   VERIFY_IS_EQUAL(result5.dimension(0), 3);
@@ -136,12 +134,11 @@
   }
 }
 
-
-template<int DataLayout>
+template <int DataLayout>
 static void test_trace_in_expr() {
   Tensor<float, 4, DataLayout> tensor(2, 3, 5, 3);
   tensor.setRandom();
-  array<ptrdiff_t, 2> dims = { { 1, 3 } };
+  array<ptrdiff_t, 2> dims = {{1, 3}};
   Tensor<float, 2, DataLayout> result(2, 5);
   result = result.constant(1.0f) - tensor.trace(dims);
   VERIFY_IS_EQUAL(result.rank(), 2);
@@ -159,7 +156,6 @@
   }
 }
 
-
 EIGEN_DECLARE_TEST(cxx11_tensor_trace) {
   CALL_SUBTEST(test_0D_trace<ColMajor>());
   CALL_SUBTEST(test_0D_trace<RowMajor>());
diff --git a/unsupported/test/cxx11_tensor_uint128.cpp b/unsupported/test/cxx11_tensor_uint128.cpp
index 46fceaa..4470f25 100644
--- a/unsupported/test/cxx11_tensor_uint128.cpp
+++ b/unsupported/test/cxx11_tensor_uint128.cpp
@@ -11,7 +11,6 @@
 
 #include <Eigen/CXX11/Tensor>
 
-
 #if EIGEN_COMP_MSVC || !defined(__SIZEOF_INT128__)
 #define EIGEN_NO_INT128
 #else
@@ -21,22 +20,19 @@
 // Only run the test on compilers that support 128bit integers natively
 #ifndef EIGEN_NO_INT128
 
-using Eigen::internal::TensorUInt128;
 using Eigen::internal::static_val;
+using Eigen::internal::TensorUInt128;
 
 void VERIFY_EQUAL(TensorUInt128<uint64_t, uint64_t> actual, uint128_t expected) {
   bool matchl = actual.lower() == static_cast<uint64_t>(expected);
   bool matchh = actual.upper() == static_cast<uint64_t>(expected >> 64);
   if (!matchl || !matchh) {
     const char* testname = g_test_stack.back().c_str();
-    std::cerr << "Test " << testname << " failed in " << __FILE__
-              << " (" << __LINE__ << ")"
-              << std::endl;
+    std::cerr << "Test " << testname << " failed in " << __FILE__ << " (" << __LINE__ << ")" << std::endl;
     abort();
   }
 }
 
-
 void test_add() {
   uint64_t incr = internal::random<uint64_t>(1, 9999999999);
   for (uint64_t i1 = 0; i1 < 100; ++i1) {
@@ -132,10 +128,13 @@
   int64_t incr = internal::random<int64_t>(1, 100);
   for (int64_t log_div = 0; log_div < 63; ++log_div) {
     for (int64_t divider = 1; divider <= 1000000 * incr; divider += incr) {
-      uint64_t expected = (static_cast<uint128_t>(1) << (64+log_div)) / static_cast<uint128_t>(divider) - (static_cast<uint128_t>(1) << 64) + 1;
+      uint64_t expected = (static_cast<uint128_t>(1) << (64 + log_div)) / static_cast<uint128_t>(divider) -
+                          (static_cast<uint128_t>(1) << 64) + 1;
       uint64_t shift = 1ULL << log_div;
 
-      TensorUInt128<uint64_t, uint64_t> result = (TensorUInt128<uint64_t, static_val<0> >(shift, 0) / TensorUInt128<static_val<0>, uint64_t>(divider) - TensorUInt128<static_val<1>, static_val<0> >(1, 0) + TensorUInt128<static_val<0>, static_val<1> >(1));
+      TensorUInt128<uint64_t, uint64_t> result =
+          (TensorUInt128<uint64_t, static_val<0> >(shift, 0) / TensorUInt128<static_val<0>, uint64_t>(divider) -
+           TensorUInt128<static_val<1>, static_val<0> >(1, 0) + TensorUInt128<static_val<0>, static_val<1> >(1));
       uint64_t actual = static_cast<uint64_t>(result);
       VERIFY_IS_EQUAL(actual, expected);
     }
@@ -143,9 +142,7 @@
 }
 #endif
 
-
-EIGEN_DECLARE_TEST(cxx11_tensor_uint128)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_uint128) {
 #ifdef EIGEN_NO_INT128
   // Skip the test on compilers that don't support 128bit integers natively
   return;
diff --git a/unsupported/test/cxx11_tensor_volume_patch.cpp b/unsupported/test/cxx11_tensor_volume_patch.cpp
index 862212e..9a04861 100644
--- a/unsupported/test/cxx11_tensor_volume_patch.cpp
+++ b/unsupported/test/cxx11_tensor_volume_patch.cpp
@@ -4,9 +4,8 @@
 
 using Eigen::Tensor;
 
-static void test_single_voxel_patch()
-{
-  Tensor<float, 5> tensor(4,2,3,5,7);
+static void test_single_voxel_patch() {
+  Tensor<float, 5> tensor(4, 2, 3, 5, 7);
   tensor.setRandom();
   Tensor<float, 5, RowMajor> tensor_row_major = tensor.swap_layout();
 
@@ -35,9 +34,7 @@
   }
 }
 
-
-static void test_entire_volume_patch()
-{
+static void test_entire_volume_patch() {
   const int depth = 4;
   const int patch_z = 2;
   const int patch_y = 3;
@@ -88,8 +85,7 @@
                   const int eff_z = z - forward_pad_z + pz;
                   const int eff_y = y - forward_pad_y + py;
                   const int eff_x = x - forward_pad_x + px;
-                  if (eff_z >= 0 && eff_y >= 0 && eff_x >= 0 &&
-                      eff_z < patch_z && eff_y < patch_y && eff_x < patch_x) {
+                  if (eff_z >= 0 && eff_y >= 0 && eff_x >= 0 && eff_z < patch_z && eff_y < patch_y && eff_x < patch_x) {
                     expected = tensor(d, eff_z, eff_y, eff_x, b);
                     expected_row_major = tensor_row_major(b, eff_x, eff_y, eff_z, d);
                   }
@@ -105,8 +101,7 @@
   }
 }
 
-EIGEN_DECLARE_TEST(cxx11_tensor_volume_patch)
-{
+EIGEN_DECLARE_TEST(cxx11_tensor_volume_patch) {
   CALL_SUBTEST(test_single_voxel_patch());
   CALL_SUBTEST(test_entire_volume_patch());
 }
diff --git a/unsupported/test/cxx11_tensor_volume_patch_sycl.cpp b/unsupported/test/cxx11_tensor_volume_patch_sycl.cpp
index dc86dfe..6a4248e 100644
--- a/unsupported/test/cxx11_tensor_volume_patch_sycl.cpp
+++ b/unsupported/test/cxx11_tensor_volume_patch_sycl.cpp
@@ -24,39 +24,39 @@
 static const int DataLayout = ColMajor;
 
 template <typename DataType, typename IndexType>
-static void test_single_voxel_patch_sycl(const Eigen::SyclDevice& sycl_device)
-{
+static void test_single_voxel_patch_sycl(const Eigen::SyclDevice& sycl_device) {
+  IndexType sizeDim0 = 4;
+  IndexType sizeDim1 = 2;
+  IndexType sizeDim2 = 3;
+  IndexType sizeDim3 = 5;
+  IndexType sizeDim4 = 7;
+  array<IndexType, 5> tensorColMajorRange = {{sizeDim0, sizeDim1, sizeDim2, sizeDim3, sizeDim4}};
+  array<IndexType, 5> tensorRowMajorRange = {{sizeDim4, sizeDim3, sizeDim2, sizeDim1, sizeDim0}};
+  Tensor<DataType, 5, DataLayout, IndexType> tensor_col_major(tensorColMajorRange);
+  Tensor<DataType, 5, RowMajor, IndexType> tensor_row_major(tensorRowMajorRange);
+  tensor_col_major.setRandom();
 
-IndexType sizeDim0 = 4;
-IndexType sizeDim1 = 2;
-IndexType sizeDim2 = 3;
-IndexType sizeDim3 = 5;
-IndexType sizeDim4 = 7;
-array<IndexType, 5> tensorColMajorRange = {{sizeDim0, sizeDim1, sizeDim2, sizeDim3, sizeDim4}};
-array<IndexType, 5> tensorRowMajorRange = {{sizeDim4, sizeDim3, sizeDim2, sizeDim1, sizeDim0}};
-Tensor<DataType, 5, DataLayout,IndexType> tensor_col_major(tensorColMajorRange);
-Tensor<DataType, 5, RowMajor,IndexType> tensor_row_major(tensorRowMajorRange);
-tensor_col_major.setRandom();
-
-
-  DataType* gpu_data_col_major  = static_cast<DataType*>(sycl_device.allocate(tensor_col_major.size()*sizeof(DataType)));
-  DataType* gpu_data_row_major  = static_cast<DataType*>(sycl_device.allocate(tensor_row_major.size()*sizeof(DataType)));
+  DataType* gpu_data_col_major =
+      static_cast<DataType*>(sycl_device.allocate(tensor_col_major.size() * sizeof(DataType)));
+  DataType* gpu_data_row_major =
+      static_cast<DataType*>(sycl_device.allocate(tensor_row_major.size() * sizeof(DataType)));
   TensorMap<Tensor<DataType, 5, ColMajor, IndexType>> gpu_col_major(gpu_data_col_major, tensorColMajorRange);
   TensorMap<Tensor<DataType, 5, RowMajor, IndexType>> gpu_row_major(gpu_data_row_major, tensorRowMajorRange);
 
-  sycl_device.memcpyHostToDevice(gpu_data_col_major, tensor_col_major.data(),(tensor_col_major.size())*sizeof(DataType));
-  gpu_row_major.device(sycl_device)=gpu_col_major.swap_layout();
-
+  sycl_device.memcpyHostToDevice(gpu_data_col_major, tensor_col_major.data(),
+                                 (tensor_col_major.size()) * sizeof(DataType));
+  gpu_row_major.device(sycl_device) = gpu_col_major.swap_layout();
 
   // single volume patch: ColMajor
-  array<IndexType, 6> patchColMajorTensorRange={{sizeDim0,1, 1, 1, sizeDim1*sizeDim2*sizeDim3, sizeDim4}};
-  Tensor<DataType, 6, DataLayout,IndexType> single_voxel_patch_col_major(patchColMajorTensorRange);
-  size_t patchTensorBuffSize =single_voxel_patch_col_major.size()*sizeof(DataType);
-  DataType* gpu_data_single_voxel_patch_col_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 6, DataLayout,IndexType>> gpu_single_voxel_patch_col_major(gpu_data_single_voxel_patch_col_major, patchColMajorTensorRange);
-  gpu_single_voxel_patch_col_major.device(sycl_device)=gpu_col_major.extract_volume_patches(1, 1, 1);
-  sycl_device.memcpyDeviceToHost(single_voxel_patch_col_major.data(), gpu_data_single_voxel_patch_col_major, patchTensorBuffSize);
-
+  array<IndexType, 6> patchColMajorTensorRange = {{sizeDim0, 1, 1, 1, sizeDim1 * sizeDim2 * sizeDim3, sizeDim4}};
+  Tensor<DataType, 6, DataLayout, IndexType> single_voxel_patch_col_major(patchColMajorTensorRange);
+  size_t patchTensorBuffSize = single_voxel_patch_col_major.size() * sizeof(DataType);
+  DataType* gpu_data_single_voxel_patch_col_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 6, DataLayout, IndexType>> gpu_single_voxel_patch_col_major(
+      gpu_data_single_voxel_patch_col_major, patchColMajorTensorRange);
+  gpu_single_voxel_patch_col_major.device(sycl_device) = gpu_col_major.extract_volume_patches(1, 1, 1);
+  sycl_device.memcpyDeviceToHost(single_voxel_patch_col_major.data(), gpu_data_single_voxel_patch_col_major,
+                                 patchTensorBuffSize);
 
   VERIFY_IS_EQUAL(single_voxel_patch_col_major.dimension(0), 4);
   VERIFY_IS_EQUAL(single_voxel_patch_col_major.dimension(1), 1);
@@ -65,13 +65,15 @@
   VERIFY_IS_EQUAL(single_voxel_patch_col_major.dimension(4), 2 * 3 * 5);
   VERIFY_IS_EQUAL(single_voxel_patch_col_major.dimension(5), 7);
 
-  array<IndexType, 6> patchRowMajorTensorRange={{sizeDim4, sizeDim1*sizeDim2*sizeDim3, 1, 1, 1, sizeDim0}};
-  Tensor<DataType, 6, RowMajor,IndexType> single_voxel_patch_row_major(patchRowMajorTensorRange);
-  patchTensorBuffSize =single_voxel_patch_row_major.size()*sizeof(DataType);
-  DataType* gpu_data_single_voxel_patch_row_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 6, RowMajor,IndexType>> gpu_single_voxel_patch_row_major(gpu_data_single_voxel_patch_row_major, patchRowMajorTensorRange);
-  gpu_single_voxel_patch_row_major.device(sycl_device)=gpu_row_major.extract_volume_patches(1, 1, 1);
-  sycl_device.memcpyDeviceToHost(single_voxel_patch_row_major.data(), gpu_data_single_voxel_patch_row_major, patchTensorBuffSize);
+  array<IndexType, 6> patchRowMajorTensorRange = {{sizeDim4, sizeDim1 * sizeDim2 * sizeDim3, 1, 1, 1, sizeDim0}};
+  Tensor<DataType, 6, RowMajor, IndexType> single_voxel_patch_row_major(patchRowMajorTensorRange);
+  patchTensorBuffSize = single_voxel_patch_row_major.size() * sizeof(DataType);
+  DataType* gpu_data_single_voxel_patch_row_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 6, RowMajor, IndexType>> gpu_single_voxel_patch_row_major(
+      gpu_data_single_voxel_patch_row_major, patchRowMajorTensorRange);
+  gpu_single_voxel_patch_row_major.device(sycl_device) = gpu_row_major.extract_volume_patches(1, 1, 1);
+  sycl_device.memcpyDeviceToHost(single_voxel_patch_row_major.data(), gpu_data_single_voxel_patch_row_major,
+                                 patchTensorBuffSize);
 
   VERIFY_IS_EQUAL(single_voxel_patch_row_major.dimension(0), 7);
   VERIFY_IS_EQUAL(single_voxel_patch_row_major.dimension(1), 2 * 3 * 5);
@@ -80,14 +82,14 @@
   VERIFY_IS_EQUAL(single_voxel_patch_row_major.dimension(4), 1);
   VERIFY_IS_EQUAL(single_voxel_patch_row_major.dimension(5), 4);
 
- sycl_device.memcpyDeviceToHost(tensor_row_major.data(), gpu_data_row_major, (tensor_col_major.size())*sizeof(DataType));
- for (IndexType i = 0; i < tensor_col_major.size(); ++i) {
-       VERIFY_IS_EQUAL(tensor_col_major.data()[i], single_voxel_patch_col_major.data()[i]);
+  sycl_device.memcpyDeviceToHost(tensor_row_major.data(), gpu_data_row_major,
+                                 (tensor_col_major.size()) * sizeof(DataType));
+  for (IndexType i = 0; i < tensor_col_major.size(); ++i) {
+    VERIFY_IS_EQUAL(tensor_col_major.data()[i], single_voxel_patch_col_major.data()[i]);
     VERIFY_IS_EQUAL(tensor_row_major.data()[i], single_voxel_patch_row_major.data()[i]);
     VERIFY_IS_EQUAL(tensor_col_major.data()[i], tensor_row_major.data()[i]);
   }
 
-
   sycl_device.deallocate(gpu_data_col_major);
   sycl_device.deallocate(gpu_data_row_major);
   sycl_device.deallocate(gpu_data_single_voxel_patch_col_major);
@@ -95,8 +97,7 @@
 }
 
 template <typename DataType, typename IndexType>
-static void test_entire_volume_patch_sycl(const Eigen::SyclDevice& sycl_device)
-{
+static void test_entire_volume_patch_sycl(const Eigen::SyclDevice& sycl_device) {
   const int depth = 4;
   const int patch_z = 2;
   const int patch_y = 3;
@@ -105,37 +106,42 @@
 
   array<IndexType, 5> tensorColMajorRange = {{depth, patch_z, patch_y, patch_x, batch}};
   array<IndexType, 5> tensorRowMajorRange = {{batch, patch_x, patch_y, patch_z, depth}};
-  Tensor<DataType, 5, DataLayout,IndexType> tensor_col_major(tensorColMajorRange);
-  Tensor<DataType, 5, RowMajor,IndexType> tensor_row_major(tensorRowMajorRange);
+  Tensor<DataType, 5, DataLayout, IndexType> tensor_col_major(tensorColMajorRange);
+  Tensor<DataType, 5, RowMajor, IndexType> tensor_row_major(tensorRowMajorRange);
   tensor_col_major.setRandom();
 
+  DataType* gpu_data_col_major =
+      static_cast<DataType*>(sycl_device.allocate(tensor_col_major.size() * sizeof(DataType)));
+  DataType* gpu_data_row_major =
+      static_cast<DataType*>(sycl_device.allocate(tensor_row_major.size() * sizeof(DataType)));
+  TensorMap<Tensor<DataType, 5, ColMajor, IndexType>> gpu_col_major(gpu_data_col_major, tensorColMajorRange);
+  TensorMap<Tensor<DataType, 5, RowMajor, IndexType>> gpu_row_major(gpu_data_row_major, tensorRowMajorRange);
 
-    DataType* gpu_data_col_major  = static_cast<DataType*>(sycl_device.allocate(tensor_col_major.size()*sizeof(DataType)));
-    DataType* gpu_data_row_major  = static_cast<DataType*>(sycl_device.allocate(tensor_row_major.size()*sizeof(DataType)));
-    TensorMap<Tensor<DataType, 5, ColMajor, IndexType>> gpu_col_major(gpu_data_col_major, tensorColMajorRange);
-    TensorMap<Tensor<DataType, 5, RowMajor, IndexType>> gpu_row_major(gpu_data_row_major, tensorRowMajorRange);
+  sycl_device.memcpyHostToDevice(gpu_data_col_major, tensor_col_major.data(),
+                                 (tensor_col_major.size()) * sizeof(DataType));
+  gpu_row_major.device(sycl_device) = gpu_col_major.swap_layout();
+  sycl_device.memcpyDeviceToHost(tensor_row_major.data(), gpu_data_row_major,
+                                 (tensor_col_major.size()) * sizeof(DataType));
 
-    sycl_device.memcpyHostToDevice(gpu_data_col_major, tensor_col_major.data(),(tensor_col_major.size())*sizeof(DataType));
-    gpu_row_major.device(sycl_device)=gpu_col_major.swap_layout();
-    sycl_device.memcpyDeviceToHost(tensor_row_major.data(), gpu_data_row_major, (tensor_col_major.size())*sizeof(DataType));
+  // single volume patch: ColMajor
+  array<IndexType, 6> patchColMajorTensorRange = {
+      {depth, patch_z, patch_y, patch_x, patch_z * patch_y * patch_x, batch}};
+  Tensor<DataType, 6, DataLayout, IndexType> entire_volume_patch_col_major(patchColMajorTensorRange);
+  size_t patchTensorBuffSize = entire_volume_patch_col_major.size() * sizeof(DataType);
+  DataType* gpu_data_entire_volume_patch_col_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 6, DataLayout, IndexType>> gpu_entire_volume_patch_col_major(
+      gpu_data_entire_volume_patch_col_major, patchColMajorTensorRange);
+  gpu_entire_volume_patch_col_major.device(sycl_device) =
+      gpu_col_major.extract_volume_patches(patch_z, patch_y, patch_x);
+  sycl_device.memcpyDeviceToHost(entire_volume_patch_col_major.data(), gpu_data_entire_volume_patch_col_major,
+                                 patchTensorBuffSize);
 
+  //  Tensor<float, 5> tensor(depth, patch_z, patch_y, patch_x, batch);
+  //  tensor.setRandom();
+  //  Tensor<float, 5, RowMajor> tensor_row_major = tensor.swap_layout();
 
-    // single volume patch: ColMajor
-    array<IndexType, 6> patchColMajorTensorRange={{depth,patch_z, patch_y, patch_x, patch_z*patch_y*patch_x, batch}};
-    Tensor<DataType, 6, DataLayout,IndexType> entire_volume_patch_col_major(patchColMajorTensorRange);
-    size_t patchTensorBuffSize =entire_volume_patch_col_major.size()*sizeof(DataType);
-    DataType* gpu_data_entire_volume_patch_col_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-    TensorMap<Tensor<DataType, 6, DataLayout,IndexType>> gpu_entire_volume_patch_col_major(gpu_data_entire_volume_patch_col_major, patchColMajorTensorRange);
-    gpu_entire_volume_patch_col_major.device(sycl_device)=gpu_col_major.extract_volume_patches(patch_z, patch_y, patch_x);
-    sycl_device.memcpyDeviceToHost(entire_volume_patch_col_major.data(), gpu_data_entire_volume_patch_col_major, patchTensorBuffSize);
-
-
-//  Tensor<float, 5> tensor(depth, patch_z, patch_y, patch_x, batch);
-//  tensor.setRandom();
-//  Tensor<float, 5, RowMajor> tensor_row_major = tensor.swap_layout();
-
-  //Tensor<float, 6> entire_volume_patch;
-  //entire_volume_patch = tensor.extract_volume_patches(patch_z, patch_y, patch_x);
+  // Tensor<float, 6> entire_volume_patch;
+  // entire_volume_patch = tensor.extract_volume_patches(patch_z, patch_y, patch_x);
   VERIFY_IS_EQUAL(entire_volume_patch_col_major.dimension(0), depth);
   VERIFY_IS_EQUAL(entire_volume_patch_col_major.dimension(1), patch_z);
   VERIFY_IS_EQUAL(entire_volume_patch_col_major.dimension(2), patch_y);
@@ -143,17 +149,20 @@
   VERIFY_IS_EQUAL(entire_volume_patch_col_major.dimension(4), patch_z * patch_y * patch_x);
   VERIFY_IS_EQUAL(entire_volume_patch_col_major.dimension(5), batch);
 
-//  Tensor<float, 6, RowMajor> entire_volume_patch_row_major;
-  //entire_volume_patch_row_major = tensor_row_major.extract_volume_patches(patch_z, patch_y, patch_x);
+  //  Tensor<float, 6, RowMajor> entire_volume_patch_row_major;
+  // entire_volume_patch_row_major = tensor_row_major.extract_volume_patches(patch_z, patch_y, patch_x);
 
-  array<IndexType, 6> patchRowMajorTensorRange={{batch,patch_z*patch_y*patch_x, patch_x, patch_y, patch_z, depth}};
-  Tensor<DataType, 6, RowMajor,IndexType> entire_volume_patch_row_major(patchRowMajorTensorRange);
-  patchTensorBuffSize =entire_volume_patch_row_major.size()*sizeof(DataType);
-  DataType* gpu_data_entire_volume_patch_row_major  = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
-  TensorMap<Tensor<DataType, 6, RowMajor,IndexType>> gpu_entire_volume_patch_row_major(gpu_data_entire_volume_patch_row_major, patchRowMajorTensorRange);
-  gpu_entire_volume_patch_row_major.device(sycl_device)=gpu_row_major.extract_volume_patches(patch_z, patch_y, patch_x);
-  sycl_device.memcpyDeviceToHost(entire_volume_patch_row_major.data(), gpu_data_entire_volume_patch_row_major, patchTensorBuffSize);
-
+  array<IndexType, 6> patchRowMajorTensorRange = {
+      {batch, patch_z * patch_y * patch_x, patch_x, patch_y, patch_z, depth}};
+  Tensor<DataType, 6, RowMajor, IndexType> entire_volume_patch_row_major(patchRowMajorTensorRange);
+  patchTensorBuffSize = entire_volume_patch_row_major.size() * sizeof(DataType);
+  DataType* gpu_data_entire_volume_patch_row_major = static_cast<DataType*>(sycl_device.allocate(patchTensorBuffSize));
+  TensorMap<Tensor<DataType, 6, RowMajor, IndexType>> gpu_entire_volume_patch_row_major(
+      gpu_data_entire_volume_patch_row_major, patchRowMajorTensorRange);
+  gpu_entire_volume_patch_row_major.device(sycl_device) =
+      gpu_row_major.extract_volume_patches(patch_z, patch_y, patch_x);
+  sycl_device.memcpyDeviceToHost(entire_volume_patch_row_major.data(), gpu_data_entire_volume_patch_row_major,
+                                 patchTensorBuffSize);
 
   VERIFY_IS_EQUAL(entire_volume_patch_row_major.dimension(0), batch);
   VERIFY_IS_EQUAL(entire_volume_patch_row_major.dimension(1), patch_z * patch_y * patch_x);
@@ -184,8 +193,7 @@
                   const int eff_z = z - forward_pad_z + pz;
                   const int eff_y = y - forward_pad_y + py;
                   const int eff_x = x - forward_pad_x + px;
-                  if (eff_z >= 0 && eff_y >= 0 && eff_x >= 0 &&
-                      eff_z < patch_z && eff_y < patch_y && eff_x < patch_x) {
+                  if (eff_z >= 0 && eff_y >= 0 && eff_x >= 0 && eff_z < patch_z && eff_y < patch_y && eff_x < patch_x) {
                     expected = tensor_col_major(d, eff_z, eff_y, eff_x, b);
                     expected_row_major = tensor_row_major(b, eff_x, eff_y, eff_z, d);
                   }
@@ -205,19 +213,17 @@
   sycl_device.deallocate(gpu_data_entire_volume_patch_row_major);
 }
 
-
-
-template<typename DataType, typename dev_Selector> void sycl_tensor_volume_patch_test_per_device(dev_Selector s){
-QueueInterface queueInterface(s);
-auto sycl_device = Eigen::SyclDevice(&queueInterface);
-std::cout << "Running on " << s.template get_info<cl::sycl::info::device::name>() << std::endl;
-test_single_voxel_patch_sycl<DataType, int64_t>(sycl_device);
-test_entire_volume_patch_sycl<DataType, int64_t>(sycl_device);
+template <typename DataType, typename dev_Selector>
+void sycl_tensor_volume_patch_test_per_device(dev_Selector s) {
+  QueueInterface queueInterface(s);
+  auto sycl_device = Eigen::SyclDevice(&queueInterface);
+  std::cout << "Running on " << s.template get_info<cl::sycl::info::device::name>() << std::endl;
+  test_single_voxel_patch_sycl<DataType, int64_t>(sycl_device);
+  test_entire_volume_patch_sycl<DataType, int64_t>(sycl_device);
 }
-EIGEN_DECLARE_TEST(cxx11_tensor_volume_patch_sycl)
-{
-for (const auto& device :Eigen::get_sycl_supported_devices()) {
-  CALL_SUBTEST(sycl_tensor_volume_patch_test_per_device<half>(device));
-  CALL_SUBTEST(sycl_tensor_volume_patch_test_per_device<float>(device));
-}
+EIGEN_DECLARE_TEST(cxx11_tensor_volume_patch_sycl) {
+  for (const auto& device : Eigen::get_sycl_supported_devices()) {
+    CALL_SUBTEST(sycl_tensor_volume_patch_test_per_device<half>(device));
+    CALL_SUBTEST(sycl_tensor_volume_patch_test_per_device<float>(device));
+  }
 }
diff --git a/unsupported/test/dgmres.cpp b/unsupported/test/dgmres.cpp
index 5f63161..940800c 100644
--- a/unsupported/test/dgmres.cpp
+++ b/unsupported/test/dgmres.cpp
@@ -11,21 +11,20 @@
 #include "../../test/sparse_solver.h"
 #include <unsupported/Eigen/IterativeSolvers>
 
-template<typename T> void test_dgmres_T()
-{
+template <typename T>
+void test_dgmres_T() {
   DGMRES<SparseMatrix<T>, DiagonalPreconditioner<T> > dgmres_colmajor_diag;
-  DGMRES<SparseMatrix<T>, IdentityPreconditioner    > dgmres_colmajor_I;
-  DGMRES<SparseMatrix<T>, IncompleteLUT<T> >           dgmres_colmajor_ilut;
-  //GMRES<SparseMatrix<T>, SSORPreconditioner<T> >     dgmres_colmajor_ssor;
+  DGMRES<SparseMatrix<T>, IdentityPreconditioner> dgmres_colmajor_I;
+  DGMRES<SparseMatrix<T>, IncompleteLUT<T> > dgmres_colmajor_ilut;
+  // GMRES<SparseMatrix<T>, SSORPreconditioner<T> >     dgmres_colmajor_ssor;
 
-  CALL_SUBTEST( check_sparse_square_solving(dgmres_colmajor_diag)  );
-//   CALL_SUBTEST( check_sparse_square_solving(dgmres_colmajor_I)     );
-  CALL_SUBTEST( check_sparse_square_solving(dgmres_colmajor_ilut)     );
-  //CALL_SUBTEST( check_sparse_square_solving(dgmres_colmajor_ssor)     );
+  CALL_SUBTEST(check_sparse_square_solving(dgmres_colmajor_diag));
+  //   CALL_SUBTEST( check_sparse_square_solving(dgmres_colmajor_I)     );
+  CALL_SUBTEST(check_sparse_square_solving(dgmres_colmajor_ilut));
+  // CALL_SUBTEST( check_sparse_square_solving(dgmres_colmajor_ssor)     );
 }
 
-EIGEN_DECLARE_TEST(dgmres)
-{
+EIGEN_DECLARE_TEST(dgmres) {
   CALL_SUBTEST_1(test_dgmres_T<double>());
   CALL_SUBTEST_2(test_dgmres_T<std::complex<double> >());
 }
diff --git a/unsupported/test/forward_adolc.cpp b/unsupported/test/forward_adolc.cpp
index 27d09dd..5d129a0 100644
--- a/unsupported/test/forward_adolc.cpp
+++ b/unsupported/test/forward_adolc.cpp
@@ -13,24 +13,19 @@
 #define NUMBER_DIRECTIONS 16
 #include <unsupported/Eigen/AdolcForward>
 
-template<typename Vector>
-EIGEN_DONT_INLINE typename Vector::Scalar foo(const Vector& p)
-{
+template <typename Vector>
+EIGEN_DONT_INLINE typename Vector::Scalar foo(const Vector& p) {
   typedef typename Vector::Scalar Scalar;
-  return (p-Vector(Scalar(-1),Scalar(1.))).norm() + (p.array().sqrt().abs() * p.array().sin()).sum() + p.dot(p);
+  return (p - Vector(Scalar(-1), Scalar(1.))).norm() + (p.array().sqrt().abs() * p.array().sin()).sum() + p.dot(p);
 }
 
-template<typename Scalar_, int NX=Dynamic, int NY=Dynamic>
-struct TestFunc1
-{
+template <typename Scalar_, int NX = Dynamic, int NY = Dynamic>
+struct TestFunc1 {
   typedef Scalar_ Scalar;
-  enum {
-    InputsAtCompileTime = NX,
-    ValuesAtCompileTime = NY
-  };
-  typedef Matrix<Scalar,InputsAtCompileTime,1> InputType;
-  typedef Matrix<Scalar,ValuesAtCompileTime,1> ValueType;
-  typedef Matrix<Scalar,ValuesAtCompileTime,InputsAtCompileTime> JacobianType;
+  enum { InputsAtCompileTime = NX, ValuesAtCompileTime = NY };
+  typedef Matrix<Scalar, InputsAtCompileTime, 1> InputType;
+  typedef Matrix<Scalar, ValuesAtCompileTime, 1> ValueType;
+  typedef Matrix<Scalar, ValuesAtCompileTime, InputsAtCompileTime> JacobianType;
 
   int m_inputs, m_values;
 
@@ -40,102 +35,93 @@
   int inputs() const { return m_inputs; }
   int values() const { return m_values; }
 
-  template<typename T>
-  void operator() (const Matrix<T,InputsAtCompileTime,1>& x, Matrix<T,ValuesAtCompileTime,1>* _v) const
-  {
-    Matrix<T,ValuesAtCompileTime,1>& v = *_v;
+  template <typename T>
+  void operator()(const Matrix<T, InputsAtCompileTime, 1>& x, Matrix<T, ValuesAtCompileTime, 1>* _v) const {
+    Matrix<T, ValuesAtCompileTime, 1>& v = *_v;
 
     v[0] = 2 * x[0] * x[0] + x[0] * x[1];
     v[1] = 3 * x[1] * x[0] + 0.5 * x[1] * x[1];
-    if(inputs()>2)
-    {
+    if (inputs() > 2) {
       v[0] += 0.5 * x[2];
       v[1] += x[2];
     }
-    if(values()>2)
-    {
+    if (values() > 2) {
       v[2] = 3 * x[1] * x[0] * x[0];
     }
-    if (inputs()>2 && values()>2)
-      v[2] *= x[2];
+    if (inputs() > 2 && values() > 2) v[2] *= x[2];
   }
 
-  void operator() (const InputType& x, ValueType* v, JacobianType* _j) const
-  {
+  void operator()(const InputType& x, ValueType* v, JacobianType* _j) const {
     (*this)(x, v);
 
-    if(_j)
-    {
+    if (_j) {
       JacobianType& j = *_j;
 
-      j(0,0) = 4 * x[0] + x[1];
-      j(1,0) = 3 * x[1];
+      j(0, 0) = 4 * x[0] + x[1];
+      j(1, 0) = 3 * x[1];
 
-      j(0,1) = x[0];
-      j(1,1) = 3 * x[0] + 2 * 0.5 * x[1];
+      j(0, 1) = x[0];
+      j(1, 1) = 3 * x[0] + 2 * 0.5 * x[1];
 
-      if (inputs()>2)
-      {
-        j(0,2) = 0.5;
-        j(1,2) = 1;
+      if (inputs() > 2) {
+        j(0, 2) = 0.5;
+        j(1, 2) = 1;
       }
-      if(values()>2)
-      {
-        j(2,0) = 3 * x[1] * 2 * x[0];
-        j(2,1) = 3 * x[0] * x[0];
+      if (values() > 2) {
+        j(2, 0) = 3 * x[1] * 2 * x[0];
+        j(2, 1) = 3 * x[0] * x[0];
       }
-      if (inputs()>2 && values()>2)
-      {
-        j(2,0) *= x[2];
-        j(2,1) *= x[2];
+      if (inputs() > 2 && values() > 2) {
+        j(2, 0) *= x[2];
+        j(2, 1) *= x[2];
 
-        j(2,2) = 3 * x[1] * x[0] * x[0];
-        j(2,2) = 3 * x[1] * x[0] * x[0];
+        j(2, 2) = 3 * x[1] * x[0] * x[0];
+        j(2, 2) = 3 * x[1] * x[0] * x[0];
       }
     }
   }
 };
 
-template<typename Func> void adolc_forward_jacobian(const Func& f)
-{
-    typename Func::InputType x = Func::InputType::Random(f.inputs());
-    typename Func::ValueType y(f.values()), yref(f.values());
-    typename Func::JacobianType j(f.values(),f.inputs()), jref(f.values(),f.inputs());
+template <typename Func>
+void adolc_forward_jacobian(const Func& f) {
+  typename Func::InputType x = Func::InputType::Random(f.inputs());
+  typename Func::ValueType y(f.values()), yref(f.values());
+  typename Func::JacobianType j(f.values(), f.inputs()), jref(f.values(), f.inputs());
 
-    jref.setZero();
-    yref.setZero();
-    f(x,&yref,&jref);
-//     std::cerr << y.transpose() << "\n\n";;
-//     std::cerr << j << "\n\n";;
+  jref.setZero();
+  yref.setZero();
+  f(x, &yref, &jref);
+  //     std::cerr << y.transpose() << "\n\n";;
+  //     std::cerr << j << "\n\n";;
 
-    j.setZero();
-    y.setZero();
-    AdolcForwardJacobian<Func> autoj(f);
-    autoj(x, &y, &j);
-//     std::cerr << y.transpose() << "\n\n";;
-//     std::cerr << j << "\n\n";;
+  j.setZero();
+  y.setZero();
+  AdolcForwardJacobian<Func> autoj(f);
+  autoj(x, &y, &j);
+  //     std::cerr << y.transpose() << "\n\n";;
+  //     std::cerr << j << "\n\n";;
 
-    VERIFY_IS_APPROX(y, yref);
-    VERIFY_IS_APPROX(j, jref);
+  VERIFY_IS_APPROX(y, yref);
+  VERIFY_IS_APPROX(j, jref);
 }
 
-EIGEN_DECLARE_TEST(forward_adolc)
-{
+EIGEN_DECLARE_TEST(forward_adolc) {
   adtl::setNumDir(NUMBER_DIRECTIONS);
 
-  for(int i = 0; i < g_repeat; i++) {
-    CALL_SUBTEST(( adolc_forward_jacobian(TestFunc1<double,2,2>()) ));
-    CALL_SUBTEST(( adolc_forward_jacobian(TestFunc1<double,2,3>()) ));
-    CALL_SUBTEST(( adolc_forward_jacobian(TestFunc1<double,3,2>()) ));
-    CALL_SUBTEST(( adolc_forward_jacobian(TestFunc1<double,3,3>()) ));
-    CALL_SUBTEST(( adolc_forward_jacobian(TestFunc1<double>(3,3)) ));
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST((adolc_forward_jacobian(TestFunc1<double, 2, 2>())));
+    CALL_SUBTEST((adolc_forward_jacobian(TestFunc1<double, 2, 3>())));
+    CALL_SUBTEST((adolc_forward_jacobian(TestFunc1<double, 3, 2>())));
+    CALL_SUBTEST((adolc_forward_jacobian(TestFunc1<double, 3, 3>())));
+    CALL_SUBTEST((adolc_forward_jacobian(TestFunc1<double>(3, 3))));
   }
 
   {
     // simple instantiation tests
-    Matrix<adtl::adouble,2,1> x;
+    Matrix<adtl::adouble, 2, 1> x;
     foo(x);
-    Matrix<adtl::adouble,Dynamic,Dynamic> A(4,4);;
+    Matrix<adtl::adouble, Dynamic, Dynamic> A(4, 4);
+    ;
     A.selfadjointView<Lower>().eigenvalues();
   }
 }
diff --git a/unsupported/test/gmres.cpp b/unsupported/test/gmres.cpp
index 8d2254b..225bb96 100644
--- a/unsupported/test/gmres.cpp
+++ b/unsupported/test/gmres.cpp
@@ -11,21 +11,20 @@
 #include "../../test/sparse_solver.h"
 #include <Eigen/IterativeSolvers>
 
-template<typename T> void test_gmres_T()
-{
+template <typename T>
+void test_gmres_T() {
   GMRES<SparseMatrix<T>, DiagonalPreconditioner<T> > gmres_colmajor_diag;
-  GMRES<SparseMatrix<T>, IdentityPreconditioner    > gmres_colmajor_I;
-  GMRES<SparseMatrix<T>, IncompleteLUT<T> >           gmres_colmajor_ilut;
-  //GMRES<SparseMatrix<T>, SSORPreconditioner<T> >     gmres_colmajor_ssor;
+  GMRES<SparseMatrix<T>, IdentityPreconditioner> gmres_colmajor_I;
+  GMRES<SparseMatrix<T>, IncompleteLUT<T> > gmres_colmajor_ilut;
+  // GMRES<SparseMatrix<T>, SSORPreconditioner<T> >     gmres_colmajor_ssor;
 
-  CALL_SUBTEST( check_sparse_square_solving(gmres_colmajor_diag)  );
-//   CALL_SUBTEST( check_sparse_square_solving(gmres_colmajor_I)     );
-  CALL_SUBTEST( check_sparse_square_solving(gmres_colmajor_ilut)     );
-  //CALL_SUBTEST( check_sparse_square_solving(gmres_colmajor_ssor)     );
+  CALL_SUBTEST(check_sparse_square_solving(gmres_colmajor_diag));
+  //   CALL_SUBTEST( check_sparse_square_solving(gmres_colmajor_I)     );
+  CALL_SUBTEST(check_sparse_square_solving(gmres_colmajor_ilut));
+  // CALL_SUBTEST( check_sparse_square_solving(gmres_colmajor_ssor)     );
 }
 
-EIGEN_DECLARE_TEST(gmres)
-{
+EIGEN_DECLARE_TEST(gmres) {
   CALL_SUBTEST_1(test_gmres_T<double>());
   CALL_SUBTEST_2(test_gmres_T<std::complex<double> >());
 }
diff --git a/unsupported/test/idrs.cpp b/unsupported/test/idrs.cpp
index f88c016..9a2e4a5 100644
--- a/unsupported/test/idrs.cpp
+++ b/unsupported/test/idrs.cpp
@@ -11,17 +11,16 @@
 #include "../../test/sparse_solver.h"
 #include <Eigen/IterativeSolvers>
 
-template<typename T> void test_idrs_T()
-{
+template <typename T>
+void test_idrs_T() {
   IDRS<SparseMatrix<T>, DiagonalPreconditioner<T> > idrs_colmajor_diag;
-  IDRS<SparseMatrix<T>, IncompleteLUT<T> >           idrs_colmajor_ilut;
+  IDRS<SparseMatrix<T>, IncompleteLUT<T> > idrs_colmajor_ilut;
 
-  CALL_SUBTEST( check_sparse_square_solving(idrs_colmajor_diag)  );
-  CALL_SUBTEST( check_sparse_square_solving(idrs_colmajor_ilut)     );
+  CALL_SUBTEST(check_sparse_square_solving(idrs_colmajor_diag));
+  CALL_SUBTEST(check_sparse_square_solving(idrs_colmajor_ilut));
 }
 
-EIGEN_DECLARE_TEST(idrs)
-{
+EIGEN_DECLARE_TEST(idrs) {
   CALL_SUBTEST_1(test_idrs_T<double>());
   CALL_SUBTEST_2(test_idrs_T<std::complex<double> >());
 }
diff --git a/unsupported/test/kronecker_product.cpp b/unsupported/test/kronecker_product.cpp
index 3bac01d..87d213e 100644
--- a/unsupported/test/kronecker_product.cpp
+++ b/unsupported/test/kronecker_product.cpp
@@ -9,226 +9,217 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-
 #ifdef EIGEN_TEST_PART_1
 
 #include "sparse.h"
 #include <Eigen/SparseExtra>
 #include <Eigen/KroneckerProduct>
 
-template<typename MatrixType>
-void check_dimension(const MatrixType& ab, const int rows,  const int cols)
-{
+template <typename MatrixType>
+void check_dimension(const MatrixType& ab, const int rows, const int cols) {
   VERIFY_IS_EQUAL(ab.rows(), rows);
   VERIFY_IS_EQUAL(ab.cols(), cols);
 }
 
-
-template<typename MatrixType>
-void check_kronecker_product(const MatrixType& ab)
-{
+template <typename MatrixType>
+void check_kronecker_product(const MatrixType& ab) {
   VERIFY_IS_EQUAL(ab.rows(), 6);
   VERIFY_IS_EQUAL(ab.cols(), 6);
-  VERIFY_IS_EQUAL(ab.size(),  36);
-  VERIFY_IS_APPROX(ab.coeff(0,0), -0.4017367630386106);
-  VERIFY_IS_APPROX(ab.coeff(0,1),  0.1056863433932735);
-  VERIFY_IS_APPROX(ab.coeff(0,2), -0.7255206194554212);
-  VERIFY_IS_APPROX(ab.coeff(0,3),  0.1908653336744706);
-  VERIFY_IS_APPROX(ab.coeff(0,4),  0.350864567234111);
-  VERIFY_IS_APPROX(ab.coeff(0,5), -0.0923032108308013);
-  VERIFY_IS_APPROX(ab.coeff(1,0),  0.415417514804677);
-  VERIFY_IS_APPROX(ab.coeff(1,1), -0.2369227701722048);
-  VERIFY_IS_APPROX(ab.coeff(1,2),  0.7502275131458511);
-  VERIFY_IS_APPROX(ab.coeff(1,3), -0.4278731019742696);
-  VERIFY_IS_APPROX(ab.coeff(1,4), -0.3628129162264507);
-  VERIFY_IS_APPROX(ab.coeff(1,5),  0.2069210808481275);
-  VERIFY_IS_APPROX(ab.coeff(2,0),  0.05465890160863986);
-  VERIFY_IS_APPROX(ab.coeff(2,1), -0.2634092511419858);
-  VERIFY_IS_APPROX(ab.coeff(2,2),  0.09871180285793758);
-  VERIFY_IS_APPROX(ab.coeff(2,3), -0.4757066334017702);
-  VERIFY_IS_APPROX(ab.coeff(2,4), -0.04773740823058334);
-  VERIFY_IS_APPROX(ab.coeff(2,5),  0.2300535609645254);
-  VERIFY_IS_APPROX(ab.coeff(3,0), -0.8172945853260133);
-  VERIFY_IS_APPROX(ab.coeff(3,1),  0.2150086428359221);
-  VERIFY_IS_APPROX(ab.coeff(3,2),  0.5825113847292743);
-  VERIFY_IS_APPROX(ab.coeff(3,3), -0.1532433770097174);
-  VERIFY_IS_APPROX(ab.coeff(3,4), -0.329383387282399);
-  VERIFY_IS_APPROX(ab.coeff(3,5),  0.08665207912033064);
-  VERIFY_IS_APPROX(ab.coeff(4,0),  0.8451267514863225);
-  VERIFY_IS_APPROX(ab.coeff(4,1), -0.481996458918977);
-  VERIFY_IS_APPROX(ab.coeff(4,2), -0.6023482390791535);
-  VERIFY_IS_APPROX(ab.coeff(4,3),  0.3435339347164565);
-  VERIFY_IS_APPROX(ab.coeff(4,4),  0.3406002157428891);
-  VERIFY_IS_APPROX(ab.coeff(4,5), -0.1942526344200915);
-  VERIFY_IS_APPROX(ab.coeff(5,0),  0.1111982482925399);
-  VERIFY_IS_APPROX(ab.coeff(5,1), -0.5358806424754169);
-  VERIFY_IS_APPROX(ab.coeff(5,2), -0.07925446559335647);
-  VERIFY_IS_APPROX(ab.coeff(5,3),  0.3819388757769038);
-  VERIFY_IS_APPROX(ab.coeff(5,4),  0.04481475387219876);
-  VERIFY_IS_APPROX(ab.coeff(5,5), -0.2159688616158057);
+  VERIFY_IS_EQUAL(ab.size(), 36);
+  VERIFY_IS_APPROX(ab.coeff(0, 0), -0.4017367630386106);
+  VERIFY_IS_APPROX(ab.coeff(0, 1), 0.1056863433932735);
+  VERIFY_IS_APPROX(ab.coeff(0, 2), -0.7255206194554212);
+  VERIFY_IS_APPROX(ab.coeff(0, 3), 0.1908653336744706);
+  VERIFY_IS_APPROX(ab.coeff(0, 4), 0.350864567234111);
+  VERIFY_IS_APPROX(ab.coeff(0, 5), -0.0923032108308013);
+  VERIFY_IS_APPROX(ab.coeff(1, 0), 0.415417514804677);
+  VERIFY_IS_APPROX(ab.coeff(1, 1), -0.2369227701722048);
+  VERIFY_IS_APPROX(ab.coeff(1, 2), 0.7502275131458511);
+  VERIFY_IS_APPROX(ab.coeff(1, 3), -0.4278731019742696);
+  VERIFY_IS_APPROX(ab.coeff(1, 4), -0.3628129162264507);
+  VERIFY_IS_APPROX(ab.coeff(1, 5), 0.2069210808481275);
+  VERIFY_IS_APPROX(ab.coeff(2, 0), 0.05465890160863986);
+  VERIFY_IS_APPROX(ab.coeff(2, 1), -0.2634092511419858);
+  VERIFY_IS_APPROX(ab.coeff(2, 2), 0.09871180285793758);
+  VERIFY_IS_APPROX(ab.coeff(2, 3), -0.4757066334017702);
+  VERIFY_IS_APPROX(ab.coeff(2, 4), -0.04773740823058334);
+  VERIFY_IS_APPROX(ab.coeff(2, 5), 0.2300535609645254);
+  VERIFY_IS_APPROX(ab.coeff(3, 0), -0.8172945853260133);
+  VERIFY_IS_APPROX(ab.coeff(3, 1), 0.2150086428359221);
+  VERIFY_IS_APPROX(ab.coeff(3, 2), 0.5825113847292743);
+  VERIFY_IS_APPROX(ab.coeff(3, 3), -0.1532433770097174);
+  VERIFY_IS_APPROX(ab.coeff(3, 4), -0.329383387282399);
+  VERIFY_IS_APPROX(ab.coeff(3, 5), 0.08665207912033064);
+  VERIFY_IS_APPROX(ab.coeff(4, 0), 0.8451267514863225);
+  VERIFY_IS_APPROX(ab.coeff(4, 1), -0.481996458918977);
+  VERIFY_IS_APPROX(ab.coeff(4, 2), -0.6023482390791535);
+  VERIFY_IS_APPROX(ab.coeff(4, 3), 0.3435339347164565);
+  VERIFY_IS_APPROX(ab.coeff(4, 4), 0.3406002157428891);
+  VERIFY_IS_APPROX(ab.coeff(4, 5), -0.1942526344200915);
+  VERIFY_IS_APPROX(ab.coeff(5, 0), 0.1111982482925399);
+  VERIFY_IS_APPROX(ab.coeff(5, 1), -0.5358806424754169);
+  VERIFY_IS_APPROX(ab.coeff(5, 2), -0.07925446559335647);
+  VERIFY_IS_APPROX(ab.coeff(5, 3), 0.3819388757769038);
+  VERIFY_IS_APPROX(ab.coeff(5, 4), 0.04481475387219876);
+  VERIFY_IS_APPROX(ab.coeff(5, 5), -0.2159688616158057);
 }
 
-
-template<typename MatrixType>
-void check_sparse_kronecker_product(const MatrixType& ab)
-{
+template <typename MatrixType>
+void check_sparse_kronecker_product(const MatrixType& ab) {
   VERIFY_IS_EQUAL(ab.rows(), 12);
   VERIFY_IS_EQUAL(ab.cols(), 10);
-  VERIFY_IS_EQUAL(ab.nonZeros(), 3*2);
-  VERIFY_IS_APPROX(ab.coeff(3,0), -0.04);
-  VERIFY_IS_APPROX(ab.coeff(5,1),  0.05);
-  VERIFY_IS_APPROX(ab.coeff(0,6), -0.08);
-  VERIFY_IS_APPROX(ab.coeff(2,7),  0.10);
-  VERIFY_IS_APPROX(ab.coeff(6,8),  0.12);
-  VERIFY_IS_APPROX(ab.coeff(8,9), -0.15);
+  VERIFY_IS_EQUAL(ab.nonZeros(), 3 * 2);
+  VERIFY_IS_APPROX(ab.coeff(3, 0), -0.04);
+  VERIFY_IS_APPROX(ab.coeff(5, 1), 0.05);
+  VERIFY_IS_APPROX(ab.coeff(0, 6), -0.08);
+  VERIFY_IS_APPROX(ab.coeff(2, 7), 0.10);
+  VERIFY_IS_APPROX(ab.coeff(6, 8), 0.12);
+  VERIFY_IS_APPROX(ab.coeff(8, 9), -0.15);
 }
 
-
-EIGEN_DECLARE_TEST(kronecker_product)
-{
+EIGEN_DECLARE_TEST(kronecker_product) {
   // DM = dense matrix; SM = sparse matrix
 
   Matrix<double, 2, 3> DM_a;
-  SparseMatrix<double> SM_a(2,3);
-  SM_a.insert(0,0) = DM_a.coeffRef(0,0) = -0.4461540300782201;
-  SM_a.insert(0,1) = DM_a.coeffRef(0,1) = -0.8057364375283049;
-  SM_a.insert(0,2) = DM_a.coeffRef(0,2) =  0.3896572459516341;
-  SM_a.insert(1,0) = DM_a.coeffRef(1,0) = -0.9076572187376921;
-  SM_a.insert(1,1) = DM_a.coeffRef(1,1) =  0.6469156566545853;
-  SM_a.insert(1,2) = DM_a.coeffRef(1,2) = -0.3658010398782789;
+  SparseMatrix<double> SM_a(2, 3);
+  SM_a.insert(0, 0) = DM_a.coeffRef(0, 0) = -0.4461540300782201;
+  SM_a.insert(0, 1) = DM_a.coeffRef(0, 1) = -0.8057364375283049;
+  SM_a.insert(0, 2) = DM_a.coeffRef(0, 2) = 0.3896572459516341;
+  SM_a.insert(1, 0) = DM_a.coeffRef(1, 0) = -0.9076572187376921;
+  SM_a.insert(1, 1) = DM_a.coeffRef(1, 1) = 0.6469156566545853;
+  SM_a.insert(1, 2) = DM_a.coeffRef(1, 2) = -0.3658010398782789;
 
-  MatrixXd             DM_b(3,2);
-  SparseMatrix<double> SM_b(3,2);
-  SM_b.insert(0,0) = DM_b.coeffRef(0,0) =  0.9004440976767099;
-  SM_b.insert(0,1) = DM_b.coeffRef(0,1) = -0.2368830858139832;
-  SM_b.insert(1,0) = DM_b.coeffRef(1,0) = -0.9311078389941825;
-  SM_b.insert(1,1) = DM_b.coeffRef(1,1) =  0.5310335762980047;
-  SM_b.insert(2,0) = DM_b.coeffRef(2,0) = -0.1225112806872035;
-  SM_b.insert(2,1) = DM_b.coeffRef(2,1) =  0.5903998022741264;
+  MatrixXd DM_b(3, 2);
+  SparseMatrix<double> SM_b(3, 2);
+  SM_b.insert(0, 0) = DM_b.coeffRef(0, 0) = 0.9004440976767099;
+  SM_b.insert(0, 1) = DM_b.coeffRef(0, 1) = -0.2368830858139832;
+  SM_b.insert(1, 0) = DM_b.coeffRef(1, 0) = -0.9311078389941825;
+  SM_b.insert(1, 1) = DM_b.coeffRef(1, 1) = 0.5310335762980047;
+  SM_b.insert(2, 0) = DM_b.coeffRef(2, 0) = -0.1225112806872035;
+  SM_b.insert(2, 1) = DM_b.coeffRef(2, 1) = 0.5903998022741264;
 
-  SparseMatrix<double,RowMajor> SM_row_a(SM_a), SM_row_b(SM_b);
+  SparseMatrix<double, RowMajor> SM_row_a(SM_a), SM_row_b(SM_b);
 
   // test DM_fixedSize = kroneckerProduct(DM_block,DM)
-  Matrix<double, 6, 6> DM_fix_ab = kroneckerProduct(DM_a.topLeftCorner<2,3>(),DM_b);
+  Matrix<double, 6, 6> DM_fix_ab = kroneckerProduct(DM_a.topLeftCorner<2, 3>(), DM_b);
 
   CALL_SUBTEST(check_kronecker_product(DM_fix_ab));
-  CALL_SUBTEST(check_kronecker_product(kroneckerProduct(DM_a.topLeftCorner<2,3>(),DM_b)));
+  CALL_SUBTEST(check_kronecker_product(kroneckerProduct(DM_a.topLeftCorner<2, 3>(), DM_b)));
 
-  for(int i=0;i<DM_fix_ab.rows();++i)
-    for(int j=0;j<DM_fix_ab.cols();++j)
-       VERIFY_IS_APPROX(kroneckerProduct(DM_a,DM_b).coeff(i,j), DM_fix_ab(i,j));
+  for (int i = 0; i < DM_fix_ab.rows(); ++i)
+    for (int j = 0; j < DM_fix_ab.cols(); ++j)
+      VERIFY_IS_APPROX(kroneckerProduct(DM_a, DM_b).coeff(i, j), DM_fix_ab(i, j));
 
   // test DM_block = kroneckerProduct(DM,DM)
-  MatrixXd DM_block_ab(10,15);
-  DM_block_ab.block<6,6>(2,5) = kroneckerProduct(DM_a,DM_b);
-  CALL_SUBTEST(check_kronecker_product(DM_block_ab.block<6,6>(2,5)));
+  MatrixXd DM_block_ab(10, 15);
+  DM_block_ab.block<6, 6>(2, 5) = kroneckerProduct(DM_a, DM_b);
+  CALL_SUBTEST(check_kronecker_product(DM_block_ab.block<6, 6>(2, 5)));
 
   // test DM = kroneckerProduct(DM,DM)
-  MatrixXd DM_ab = kroneckerProduct(DM_a,DM_b);
+  MatrixXd DM_ab = kroneckerProduct(DM_a, DM_b);
   CALL_SUBTEST(check_kronecker_product(DM_ab));
-  CALL_SUBTEST(check_kronecker_product(kroneckerProduct(DM_a,DM_b)));
+  CALL_SUBTEST(check_kronecker_product(kroneckerProduct(DM_a, DM_b)));
 
   // test SM = kroneckerProduct(SM,DM)
-  SparseMatrix<double> SM_ab = kroneckerProduct(SM_a,DM_b);
+  SparseMatrix<double> SM_ab = kroneckerProduct(SM_a, DM_b);
   CALL_SUBTEST(check_kronecker_product(SM_ab));
-  SparseMatrix<double,RowMajor> SM_ab2 = kroneckerProduct(SM_a,DM_b);
+  SparseMatrix<double, RowMajor> SM_ab2 = kroneckerProduct(SM_a, DM_b);
   CALL_SUBTEST(check_kronecker_product(SM_ab2));
-  CALL_SUBTEST(check_kronecker_product(kroneckerProduct(SM_a,DM_b)));
+  CALL_SUBTEST(check_kronecker_product(kroneckerProduct(SM_a, DM_b)));
 
   // test SM = kroneckerProduct(DM,SM)
   SM_ab.setZero();
-  SM_ab.insert(0,0)=37.0;
-  SM_ab = kroneckerProduct(DM_a,SM_b);
+  SM_ab.insert(0, 0) = 37.0;
+  SM_ab = kroneckerProduct(DM_a, SM_b);
   CALL_SUBTEST(check_kronecker_product(SM_ab));
   SM_ab2.setZero();
-  SM_ab2.insert(0,0)=37.0;
-  SM_ab2 = kroneckerProduct(DM_a,SM_b);
+  SM_ab2.insert(0, 0) = 37.0;
+  SM_ab2 = kroneckerProduct(DM_a, SM_b);
   CALL_SUBTEST(check_kronecker_product(SM_ab2));
-  CALL_SUBTEST(check_kronecker_product(kroneckerProduct(DM_a,SM_b)));
+  CALL_SUBTEST(check_kronecker_product(kroneckerProduct(DM_a, SM_b)));
 
   // test SM = kroneckerProduct(SM,SM)
-  SM_ab.resize(2,33);
-  SM_ab.insert(0,0)=37.0;
-  SM_ab = kroneckerProduct(SM_a,SM_b);
+  SM_ab.resize(2, 33);
+  SM_ab.insert(0, 0) = 37.0;
+  SM_ab = kroneckerProduct(SM_a, SM_b);
   CALL_SUBTEST(check_kronecker_product(SM_ab));
-  SM_ab2.resize(5,11);
-  SM_ab2.insert(0,0)=37.0;
-  SM_ab2 = kroneckerProduct(SM_a,SM_b);
+  SM_ab2.resize(5, 11);
+  SM_ab2.insert(0, 0) = 37.0;
+  SM_ab2 = kroneckerProduct(SM_a, SM_b);
   CALL_SUBTEST(check_kronecker_product(SM_ab2));
-  CALL_SUBTEST(check_kronecker_product(kroneckerProduct(SM_a,SM_b)));
+  CALL_SUBTEST(check_kronecker_product(kroneckerProduct(SM_a, SM_b)));
 
   // test SM = kroneckerProduct(SM,SM) with sparse pattern
-  SM_a.resize(4,5);
-  SM_b.resize(3,2);
+  SM_a.resize(4, 5);
+  SM_b.resize(3, 2);
   SM_a.resizeNonZeros(0);
   SM_b.resizeNonZeros(0);
-  SM_a.insert(1,0) = -0.1;
-  SM_a.insert(0,3) = -0.2;
-  SM_a.insert(2,4) =  0.3;
+  SM_a.insert(1, 0) = -0.1;
+  SM_a.insert(0, 3) = -0.2;
+  SM_a.insert(2, 4) = 0.3;
   SM_a.finalize();
 
-  SM_b.insert(0,0) =  0.4;
-  SM_b.insert(2,1) = -0.5;
+  SM_b.insert(0, 0) = 0.4;
+  SM_b.insert(2, 1) = -0.5;
   SM_b.finalize();
-  SM_ab.resize(1,1);
-  SM_ab.insert(0,0)=37.0;
-  SM_ab = kroneckerProduct(SM_a,SM_b);
+  SM_ab.resize(1, 1);
+  SM_ab.insert(0, 0) = 37.0;
+  SM_ab = kroneckerProduct(SM_a, SM_b);
   CALL_SUBTEST(check_sparse_kronecker_product(SM_ab));
 
   // test dimension of result of DM = kroneckerProduct(DM,DM)
-  MatrixXd DM_a2(2,1);
-  MatrixXd DM_b2(5,4);
-  MatrixXd DM_ab2 = kroneckerProduct(DM_a2,DM_b2);
-  CALL_SUBTEST(check_dimension(DM_ab2,2*5,1*4));
-  DM_a2.resize(10,9);
-  DM_b2.resize(4,8);
-  DM_ab2 = kroneckerProduct(DM_a2,DM_b2);
-  CALL_SUBTEST(check_dimension(DM_ab2,10*4,9*8));
+  MatrixXd DM_a2(2, 1);
+  MatrixXd DM_b2(5, 4);
+  MatrixXd DM_ab2 = kroneckerProduct(DM_a2, DM_b2);
+  CALL_SUBTEST(check_dimension(DM_ab2, 2 * 5, 1 * 4));
+  DM_a2.resize(10, 9);
+  DM_b2.resize(4, 8);
+  DM_ab2 = kroneckerProduct(DM_a2, DM_b2);
+  CALL_SUBTEST(check_dimension(DM_ab2, 10 * 4, 9 * 8));
 
-  for(int i = 0; i < g_repeat; i++)
-  {
-    double density = Eigen::internal::random<double>(0.01,0.5);
-    int ra = Eigen::internal::random<int>(1,50);
-    int ca = Eigen::internal::random<int>(1,50);
-    int rb = Eigen::internal::random<int>(1,50);
-    int cb = Eigen::internal::random<int>(1,50);
-    SparseMatrix<float,ColMajor> sA(ra,ca), sB(rb,cb), sC;
-    SparseMatrix<float,RowMajor> sC2;
-    MatrixXf dA(ra,ca), dB(rb,cb), dC;
+  for (int i = 0; i < g_repeat; i++) {
+    double density = Eigen::internal::random<double>(0.01, 0.5);
+    int ra = Eigen::internal::random<int>(1, 50);
+    int ca = Eigen::internal::random<int>(1, 50);
+    int rb = Eigen::internal::random<int>(1, 50);
+    int cb = Eigen::internal::random<int>(1, 50);
+    SparseMatrix<float, ColMajor> sA(ra, ca), sB(rb, cb), sC;
+    SparseMatrix<float, RowMajor> sC2;
+    MatrixXf dA(ra, ca), dB(rb, cb), dC;
     initSparse(density, dA, sA);
     initSparse(density, dB, sB);
 
-    sC = kroneckerProduct(sA,sB);
-    dC = kroneckerProduct(dA,dB);
-    VERIFY_IS_APPROX(MatrixXf(sC),dC);
+    sC = kroneckerProduct(sA, sB);
+    dC = kroneckerProduct(dA, dB);
+    VERIFY_IS_APPROX(MatrixXf(sC), dC);
 
-    sC = kroneckerProduct(sA.transpose(),sB);
-    dC = kroneckerProduct(dA.transpose(),dB);
-    VERIFY_IS_APPROX(MatrixXf(sC),dC);
+    sC = kroneckerProduct(sA.transpose(), sB);
+    dC = kroneckerProduct(dA.transpose(), dB);
+    VERIFY_IS_APPROX(MatrixXf(sC), dC);
 
-    sC = kroneckerProduct(sA.transpose(),sB.transpose());
-    dC = kroneckerProduct(dA.transpose(),dB.transpose());
-    VERIFY_IS_APPROX(MatrixXf(sC),dC);
+    sC = kroneckerProduct(sA.transpose(), sB.transpose());
+    dC = kroneckerProduct(dA.transpose(), dB.transpose());
+    VERIFY_IS_APPROX(MatrixXf(sC), dC);
 
-    sC = kroneckerProduct(sA,sB.transpose());
-    dC = kroneckerProduct(dA,dB.transpose());
-    VERIFY_IS_APPROX(MatrixXf(sC),dC);
+    sC = kroneckerProduct(sA, sB.transpose());
+    dC = kroneckerProduct(dA, dB.transpose());
+    VERIFY_IS_APPROX(MatrixXf(sC), dC);
 
-    sC2 = kroneckerProduct(sA,sB);
-    dC = kroneckerProduct(dA,dB);
-    VERIFY_IS_APPROX(MatrixXf(sC2),dC);
+    sC2 = kroneckerProduct(sA, sB);
+    dC = kroneckerProduct(dA, dB);
+    VERIFY_IS_APPROX(MatrixXf(sC2), dC);
 
-    sC2 = kroneckerProduct(dA,sB);
-    dC = kroneckerProduct(dA,dB);
-    VERIFY_IS_APPROX(MatrixXf(sC2),dC);
+    sC2 = kroneckerProduct(dA, sB);
+    dC = kroneckerProduct(dA, dB);
+    VERIFY_IS_APPROX(MatrixXf(sC2), dC);
 
-    sC2 = kroneckerProduct(sA,dB);
-    dC = kroneckerProduct(dA,dB);
-    VERIFY_IS_APPROX(MatrixXf(sC2),dC);
+    sC2 = kroneckerProduct(sA, dB);
+    dC = kroneckerProduct(dA, dB);
+    VERIFY_IS_APPROX(MatrixXf(sC2), dC);
 
-    sC2 = kroneckerProduct(2*sA,sB);
-    dC = kroneckerProduct(2*dA,dB);
-    VERIFY_IS_APPROX(MatrixXf(sC2),dC);
+    sC2 = kroneckerProduct(2 * sA, sB);
+    dC = kroneckerProduct(2 * dA, dB);
+    VERIFY_IS_APPROX(MatrixXf(sC2), dC);
   }
 }
 
@@ -240,13 +231,12 @@
 #include "main.h"
 #include <Eigen/KroneckerProduct>
 
-EIGEN_DECLARE_TEST(kronecker_product)
-{
-  MatrixXd a(2,2), b(3,3), c;
+EIGEN_DECLARE_TEST(kronecker_product) {
+  MatrixXd a(2, 2), b(3, 3), c;
   a.setRandom();
   b.setRandom();
-  c = kroneckerProduct(a,b);
-  VERIFY_IS_APPROX(c.block(3,3,3,3), a(1,1)*b);
+  c = kroneckerProduct(a, b);
+  VERIFY_IS_APPROX(c.block(3, 3, 3, 3), a(1, 1) * b);
 }
 
 #endif
diff --git a/unsupported/test/levenberg_marquardt.cpp b/unsupported/test/levenberg_marquardt.cpp
index d0748d1..355fc7c 100644
--- a/unsupported/test/levenberg_marquardt.cpp
+++ b/unsupported/test/levenberg_marquardt.cpp
@@ -8,10 +8,8 @@
 // Public License v. 2.0. If a copy of the MPL was not distributed
 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-
 // FIXME: These tests all check for hard-coded values. Ideally, parameters and start estimates should be randomized.
 
-
 #include <stdio.h>
 
 #include "main.h"
@@ -26,45 +24,40 @@
 // tolerance for chekcing number of iterations
 #define LM_EVAL_COUNT_TOL 2
 
-struct lmder_functor : DenseFunctor<double>
-{
-    lmder_functor(void): DenseFunctor<double>(3,15) {}
-    int operator()(const VectorXd &x, VectorXd &fvec) const
-    {
-        double tmp1, tmp2, tmp3;
-        static const double y[15] = {1.4e-1, 1.8e-1, 2.2e-1, 2.5e-1, 2.9e-1, 3.2e-1, 3.5e-1,
-            3.9e-1, 3.7e-1, 5.8e-1, 7.3e-1, 9.6e-1, 1.34, 2.1, 4.39};
+struct lmder_functor : DenseFunctor<double> {
+  lmder_functor(void) : DenseFunctor<double>(3, 15) {}
+  int operator()(const VectorXd &x, VectorXd &fvec) const {
+    double tmp1, tmp2, tmp3;
+    static const double y[15] = {1.4e-1, 1.8e-1, 2.2e-1, 2.5e-1, 2.9e-1, 3.2e-1, 3.5e-1, 3.9e-1,
+                                 3.7e-1, 5.8e-1, 7.3e-1, 9.6e-1, 1.34,   2.1,    4.39};
 
-        for (int i = 0; i < values(); i++)
-        {
-            tmp1 = i+1;
-            tmp2 = 16 - i - 1;
-            tmp3 = (i>=8)? tmp2 : tmp1;
-            fvec[i] = y[i] - (x[0] + tmp1/(x[1]*tmp2 + x[2]*tmp3));
-        }
-        return 0;
+    for (int i = 0; i < values(); i++) {
+      tmp1 = i + 1;
+      tmp2 = 16 - i - 1;
+      tmp3 = (i >= 8) ? tmp2 : tmp1;
+      fvec[i] = y[i] - (x[0] + tmp1 / (x[1] * tmp2 + x[2] * tmp3));
     }
+    return 0;
+  }
 
-    int df(const VectorXd &x, MatrixXd &fjac) const
-    {
-        double tmp1, tmp2, tmp3, tmp4;
-        for (int i = 0; i < values(); i++)
-        {
-            tmp1 = i+1;
-            tmp2 = 16 - i - 1;
-            tmp3 = (i>=8)? tmp2 : tmp1;
-            tmp4 = (x[1]*tmp2 + x[2]*tmp3); tmp4 = tmp4*tmp4;
-            fjac(i,0) = -1;
-            fjac(i,1) = tmp1*tmp2/tmp4;
-            fjac(i,2) = tmp1*tmp3/tmp4;
-        }
-        return 0;
+  int df(const VectorXd &x, MatrixXd &fjac) const {
+    double tmp1, tmp2, tmp3, tmp4;
+    for (int i = 0; i < values(); i++) {
+      tmp1 = i + 1;
+      tmp2 = 16 - i - 1;
+      tmp3 = (i >= 8) ? tmp2 : tmp1;
+      tmp4 = (x[1] * tmp2 + x[2] * tmp3);
+      tmp4 = tmp4 * tmp4;
+      fjac(i, 0) = -1;
+      fjac(i, 1) = tmp1 * tmp2 / tmp4;
+      fjac(i, 2) = tmp1 * tmp3 / tmp4;
     }
+    return 0;
+  }
 };
 
-void testLmder1()
-{
-  int n=3, info;
+void testLmder1() {
+  int n = 3, info;
 
   VectorXd x;
 
@@ -90,9 +83,8 @@
   VERIFY_IS_APPROX(x, x_ref);
 }
 
-void testLmder()
-{
-  const int m=15, n=3;
+void testLmder() {
+  const int m = 15, n = 3;
   int info;
   double fnorm, covfac;
   VectorXd x;
@@ -121,52 +113,46 @@
   VERIFY_IS_APPROX(x, x_ref);
 
   // check covariance
-  covfac = fnorm*fnorm/(m-n);
-  internal::covar(lm.matrixR(), lm.permutation().indices()); // TODO : move this as a function of lm
+  covfac = fnorm * fnorm / (m - n);
+  internal::covar(lm.matrixR(), lm.permutation().indices());  // TODO : move this as a function of lm
 
-  MatrixXd cov_ref(n,n);
-  cov_ref <<
-      0.0001531202,   0.002869941,  -0.002656662,
-      0.002869941,    0.09480935,   -0.09098995,
-      -0.002656662,   -0.09098995,    0.08778727;
+  MatrixXd cov_ref(n, n);
+  cov_ref << 0.0001531202, 0.002869941, -0.002656662, 0.002869941, 0.09480935, -0.09098995, -0.002656662, -0.09098995,
+      0.08778727;
 
-//  std::cout << fjac*covfac << std::endl;
+  //  std::cout << fjac*covfac << std::endl;
 
   MatrixXd cov;
-  cov =  covfac*lm.matrixR().topLeftCorner<n,n>();
-  VERIFY_IS_APPROX( cov, cov_ref);
+  cov = covfac * lm.matrixR().topLeftCorner<n, n>();
+  VERIFY_IS_APPROX(cov, cov_ref);
   // TODO: why isn't this allowed ? :
   // VERIFY_IS_APPROX( covfac*fjac.topLeftCorner<n,n>() , cov_ref);
 }
 
-struct lmdif_functor : DenseFunctor<double>
-{
-    lmdif_functor(void) : DenseFunctor<double>(3,15) {}
-    int operator()(const VectorXd &x, VectorXd &fvec) const
-    {
-        int i;
-        double tmp1,tmp2,tmp3;
-        static const double y[15]={1.4e-1,1.8e-1,2.2e-1,2.5e-1,2.9e-1,3.2e-1,3.5e-1,3.9e-1,
-            3.7e-1,5.8e-1,7.3e-1,9.6e-1,1.34e0,2.1e0,4.39e0};
+struct lmdif_functor : DenseFunctor<double> {
+  lmdif_functor(void) : DenseFunctor<double>(3, 15) {}
+  int operator()(const VectorXd &x, VectorXd &fvec) const {
+    int i;
+    double tmp1, tmp2, tmp3;
+    static const double y[15] = {1.4e-1, 1.8e-1, 2.2e-1, 2.5e-1, 2.9e-1, 3.2e-1, 3.5e-1, 3.9e-1,
+                                 3.7e-1, 5.8e-1, 7.3e-1, 9.6e-1, 1.34e0, 2.1e0,  4.39e0};
 
-        assert(x.size()==3);
-        assert(fvec.size()==15);
-        for (i=0; i<15; i++)
-        {
-            tmp1 = i+1;
-            tmp2 = 15 - i;
-            tmp3 = tmp1;
+    assert(x.size() == 3);
+    assert(fvec.size() == 15);
+    for (i = 0; i < 15; i++) {
+      tmp1 = i + 1;
+      tmp2 = 15 - i;
+      tmp3 = tmp1;
 
-            if (i >= 8) tmp3 = tmp2;
-            fvec[i] = y[i] - (x[0] + tmp1/(x[1]*tmp2 + x[2]*tmp3));
-        }
-        return 0;
+      if (i >= 8) tmp3 = tmp2;
+      fvec[i] = y[i] - (x[0] + tmp1 / (x[1] * tmp2 + x[2] * tmp3));
     }
+    return 0;
+  }
 };
 
-void testLmdif1()
-{
-  const int n=3;
+void testLmdif1() {
+  const int n = 3;
   int info;
 
   VectorXd x(n), fvec(15);
@@ -182,7 +168,7 @@
 
   // check return value
   // VERIFY_IS_EQUAL(info, 1);
-//   VERIFY_IS_EQUAL(nfev, 26);
+  //   VERIFY_IS_EQUAL(nfev, 26);
 
   // check norm
   functor(x, fvec);
@@ -192,12 +178,10 @@
   VectorXd x_ref(n);
   x_ref << 0.0824106, 1.1330366, 2.3436947;
   VERIFY_IS_APPROX(x, x_ref);
-
 }
 
-void testLmdif()
-{
-  const int m=15, n=3;
+void testLmdif() {
+  const int m = 15, n = 3;
   int info;
   double fnorm, covfac;
   VectorXd x(n);
@@ -214,7 +198,7 @@
 
   // check return values
   // VERIFY_IS_EQUAL(info, 1);
-//   VERIFY_IS_EQUAL(lm.nfev(), 26);
+  //   VERIFY_IS_EQUAL(lm.nfev(), 26);
 
   // check norm
   fnorm = lm.fvec().blueNorm();
@@ -226,64 +210,69 @@
   VERIFY_IS_APPROX(x, x_ref);
 
   // check covariance
-  covfac = fnorm*fnorm/(m-n);
-  internal::covar(lm.matrixR(), lm.permutation().indices()); // TODO : move this as a function of lm
+  covfac = fnorm * fnorm / (m - n);
+  internal::covar(lm.matrixR(), lm.permutation().indices());  // TODO : move this as a function of lm
 
-  MatrixXd cov_ref(n,n);
-  cov_ref <<
-      0.0001531202,   0.002869942,  -0.002656662,
-      0.002869942,    0.09480937,   -0.09098997,
-      -0.002656662,   -0.09098997,    0.08778729;
+  MatrixXd cov_ref(n, n);
+  cov_ref << 0.0001531202, 0.002869942, -0.002656662, 0.002869942, 0.09480937, -0.09098997, -0.002656662, -0.09098997,
+      0.08778729;
 
-//  std::cout << fjac*covfac << std::endl;
+  //  std::cout << fjac*covfac << std::endl;
 
   MatrixXd cov;
-  cov =  covfac*lm.matrixR().topLeftCorner<n,n>();
-  VERIFY_IS_APPROX( cov, cov_ref);
+  cov = covfac * lm.matrixR().topLeftCorner<n, n>();
+  VERIFY_IS_APPROX(cov, cov_ref);
   // TODO: why isn't this allowed ? :
   // VERIFY_IS_APPROX( covfac*fjac.topLeftCorner<n,n>() , cov_ref);
 }
 
-struct chwirut2_functor : DenseFunctor<double>
-{
-    chwirut2_functor(void) : DenseFunctor<double>(3,54) {}
-    static const double m_x[54];
-    static const double m_y[54];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        int i;
+struct chwirut2_functor : DenseFunctor<double> {
+  chwirut2_functor(void) : DenseFunctor<double>(3, 54) {}
+  static const double m_x[54];
+  static const double m_y[54];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    int i;
 
-        assert(b.size()==3);
-        assert(fvec.size()==54);
-        for(i=0; i<54; i++) {
-            double x = m_x[i];
-            fvec[i] = exp(-b[0]*x)/(b[1]+b[2]*x) - m_y[i];
-        }
-        return 0;
+    assert(b.size() == 3);
+    assert(fvec.size() == 54);
+    for (i = 0; i < 54; i++) {
+      double x = m_x[i];
+      fvec[i] = exp(-b[0] * x) / (b[1] + b[2] * x) - m_y[i];
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==3);
-        assert(fjac.rows()==54);
-        assert(fjac.cols()==3);
-        for(int i=0; i<54; i++) {
-            double x = m_x[i];
-            double factor = 1./(b[1]+b[2]*x);
-            double e = exp(-b[0]*x);
-            fjac(i,0) = -x*e*factor;
-            fjac(i,1) = -e*factor*factor;
-            fjac(i,2) = -x*e*factor*factor;
-        }
-        return 0;
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 3);
+    assert(fjac.rows() == 54);
+    assert(fjac.cols() == 3);
+    for (int i = 0; i < 54; i++) {
+      double x = m_x[i];
+      double factor = 1. / (b[1] + b[2] * x);
+      double e = exp(-b[0] * x);
+      fjac(i, 0) = -x * e * factor;
+      fjac(i, 1) = -e * factor * factor;
+      fjac(i, 2) = -x * e * factor * factor;
     }
+    return 0;
+  }
 };
-const double chwirut2_functor::m_x[54] = { 0.500E0, 1.000E0, 1.750E0, 3.750E0, 5.750E0, 0.875E0, 2.250E0, 3.250E0, 5.250E0, 0.750E0, 1.750E0, 2.750E0, 4.750E0, 0.625E0, 1.250E0, 2.250E0, 4.250E0, .500E0, 3.000E0, .750E0, 3.000E0, 1.500E0, 6.000E0, 3.000E0, 6.000E0, 1.500E0, 3.000E0, .500E0, 2.000E0, 4.000E0, .750E0, 2.000E0, 5.000E0, .750E0, 2.250E0, 3.750E0, 5.750E0, 3.000E0, .750E0, 2.500E0, 4.000E0, .750E0, 2.500E0, 4.000E0, .750E0, 2.500E0, 4.000E0, .500E0, 6.000E0, 3.000E0, .500E0, 2.750E0, .500E0, 1.750E0};
-const double chwirut2_functor::m_y[54] = { 92.9000E0 ,57.1000E0 ,31.0500E0 ,11.5875E0 ,8.0250E0 ,63.6000E0 ,21.4000E0 ,14.2500E0 ,8.4750E0 ,63.8000E0 ,26.8000E0 ,16.4625E0 ,7.1250E0 ,67.3000E0 ,41.0000E0 ,21.1500E0 ,8.1750E0 ,81.5000E0 ,13.1200E0 ,59.9000E0 ,14.6200E0 ,32.9000E0 ,5.4400E0 ,12.5600E0 ,5.4400E0 ,32.0000E0 ,13.9500E0 ,75.8000E0 ,20.0000E0 ,10.4200E0 ,59.5000E0 ,21.6700E0 ,8.5500E0 ,62.0000E0 ,20.2000E0 ,7.7600E0 ,3.7500E0 ,11.8100E0 ,54.7000E0 ,23.7000E0 ,11.5500E0 ,61.3000E0 ,17.7000E0 ,8.7400E0 ,59.2000E0 ,16.3000E0 ,8.6200E0 ,81.0000E0 ,4.8700E0 ,14.6200E0 ,81.7000E0 ,17.1700E0 ,81.3000E0 ,28.9000E0  };
+const double chwirut2_functor::m_x[54] = {
+    0.500E0, 1.000E0, 1.750E0, 3.750E0, 5.750E0, 0.875E0, 2.250E0, 3.250E0, 5.250E0, 0.750E0, 1.750E0,
+    2.750E0, 4.750E0, 0.625E0, 1.250E0, 2.250E0, 4.250E0, .500E0,  3.000E0, .750E0,  3.000E0, 1.500E0,
+    6.000E0, 3.000E0, 6.000E0, 1.500E0, 3.000E0, .500E0,  2.000E0, 4.000E0, .750E0,  2.000E0, 5.000E0,
+    .750E0,  2.250E0, 3.750E0, 5.750E0, 3.000E0, .750E0,  2.500E0, 4.000E0, .750E0,  2.500E0, 4.000E0,
+    .750E0,  2.500E0, 4.000E0, .500E0,  6.000E0, 3.000E0, .500E0,  2.750E0, .500E0,  1.750E0};
+const double chwirut2_functor::m_y[54] = {
+    92.9000E0, 57.1000E0, 31.0500E0, 11.5875E0, 8.0250E0,  63.6000E0, 21.4000E0, 14.2500E0, 8.4750E0,
+    63.8000E0, 26.8000E0, 16.4625E0, 7.1250E0,  67.3000E0, 41.0000E0, 21.1500E0, 8.1750E0,  81.5000E0,
+    13.1200E0, 59.9000E0, 14.6200E0, 32.9000E0, 5.4400E0,  12.5600E0, 5.4400E0,  32.0000E0, 13.9500E0,
+    75.8000E0, 20.0000E0, 10.4200E0, 59.5000E0, 21.6700E0, 8.5500E0,  62.0000E0, 20.2000E0, 7.7600E0,
+    3.7500E0,  11.8100E0, 54.7000E0, 23.7000E0, 11.5500E0, 61.3000E0, 17.7000E0, 8.7400E0,  59.2000E0,
+    16.3000E0, 8.6200E0,  81.0000E0, 4.8700E0,  14.6200E0, 81.7000E0, 17.1700E0, 81.3000E0, 28.9000E0};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/chwirut2.shtml
-void testNistChwirut2(void)
-{
-  const int n=3;
+void testNistChwirut2(void) {
+  const int n = 3;
   LevenbergMarquardtSpace::Status info;
 
   VectorXd x(n);
@@ -291,7 +280,7 @@
   /*
    * First try
    */
-  x<< 0.1, 0.01, 0.02;
+  x << 0.1, 0.01, 0.02;
   // do the computation
   chwirut2_functor functor;
   LevenbergMarquardt<chwirut2_functor> lm(functor);
@@ -300,7 +289,7 @@
 
   // check return value
   // VERIFY_IS_EQUAL(info, 1);
-//   VERIFY_IS_EQUAL(lm.nfev(), 10);
+  //   VERIFY_IS_EQUAL(lm.nfev(), 10);
   // VERIFY_IS_EQUAL(lm.njev(), 8);
   // check norm^2
   VERIFY_IS_APPROX(lm.fvec().squaredNorm(), 5.1304802941E+02);
@@ -312,17 +301,17 @@
   /*
    * Second try
    */
-  x<< 0.15, 0.008, 0.010;
+  x << 0.15, 0.008, 0.010;
   // do the computation
   lm.resetParameters();
-  lm.setFtol(1.E6*NumTraits<double>::epsilon());
-  lm.setXtol(1.E6*NumTraits<double>::epsilon());
+  lm.setFtol(1.E6 * NumTraits<double>::epsilon());
+  lm.setXtol(1.E6 * NumTraits<double>::epsilon());
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
 
   // check return value
   // VERIFY_IS_EQUAL(info, 1);
-//   VERIFY_IS_EQUAL(lm.nfev(), 7);
+  //   VERIFY_IS_EQUAL(lm.nfev(), 7);
   // VERIFY_IS_EQUAL(lm.njev(), 6);
   // check norm^2
   VERIFY_IS_APPROX(lm.fvec().squaredNorm(), 5.1304802941E+02);
@@ -332,40 +321,37 @@
   VERIFY_IS_APPROX(x[2], 1.2150007096E-02);
 }
 
-
-struct misra1a_functor : DenseFunctor<double>
-{
-    misra1a_functor(void) : DenseFunctor<double>(2,14) {}
-    static const double m_x[14];
-    static const double m_y[14];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        assert(b.size()==2);
-        assert(fvec.size()==14);
-        for(int i=0; i<14; i++) {
-            fvec[i] = b[0]*(1.-exp(-b[1]*m_x[i])) - m_y[i] ;
-        }
-        return 0;
+struct misra1a_functor : DenseFunctor<double> {
+  misra1a_functor(void) : DenseFunctor<double>(2, 14) {}
+  static const double m_x[14];
+  static const double m_y[14];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    assert(b.size() == 2);
+    assert(fvec.size() == 14);
+    for (int i = 0; i < 14; i++) {
+      fvec[i] = b[0] * (1. - exp(-b[1] * m_x[i])) - m_y[i];
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==2);
-        assert(fjac.rows()==14);
-        assert(fjac.cols()==2);
-        for(int i=0; i<14; i++) {
-            fjac(i,0) = (1.-exp(-b[1]*m_x[i]));
-            fjac(i,1) = (b[0]*m_x[i]*exp(-b[1]*m_x[i]));
-        }
-        return 0;
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 2);
+    assert(fjac.rows() == 14);
+    assert(fjac.cols() == 2);
+    for (int i = 0; i < 14; i++) {
+      fjac(i, 0) = (1. - exp(-b[1] * m_x[i]));
+      fjac(i, 1) = (b[0] * m_x[i] * exp(-b[1] * m_x[i]));
     }
+    return 0;
+  }
 };
-const double misra1a_functor::m_x[14] = { 77.6E0, 114.9E0, 141.1E0, 190.8E0, 239.9E0, 289.0E0, 332.8E0, 378.4E0, 434.8E0, 477.3E0, 536.8E0, 593.1E0, 689.1E0, 760.0E0};
-const double misra1a_functor::m_y[14] = { 10.07E0, 14.73E0, 17.94E0, 23.93E0, 29.61E0, 35.18E0, 40.02E0, 44.82E0, 50.76E0, 55.05E0, 61.01E0, 66.40E0, 75.47E0, 81.78E0};
+const double misra1a_functor::m_x[14] = {77.6E0,  114.9E0, 141.1E0, 190.8E0, 239.9E0, 289.0E0, 332.8E0,
+                                         378.4E0, 434.8E0, 477.3E0, 536.8E0, 593.1E0, 689.1E0, 760.0E0};
+const double misra1a_functor::m_y[14] = {10.07E0, 14.73E0, 17.94E0, 23.93E0, 29.61E0, 35.18E0, 40.02E0,
+                                         44.82E0, 50.76E0, 55.05E0, 61.01E0, 66.40E0, 75.47E0, 81.78E0};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/misra1a.shtml
-void testNistMisra1a(void)
-{
-  const int n=2;
+void testNistMisra1a(void) {
+  const int n = 2;
   int info;
 
   VectorXd x(n);
@@ -373,7 +359,7 @@
   /*
    * First try
    */
-  x<< 500., 0.0001;
+  x << 500., 0.0001;
   // do the computation
   misra1a_functor functor;
   LevenbergMarquardt<misra1a_functor> lm(functor);
@@ -393,7 +379,7 @@
   /*
    * Second try
    */
-  x<< 250., 0.0005;
+  x << 250., 0.0005;
   // do the computation
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
@@ -409,56 +395,92 @@
   VERIFY_IS_APPROX(x[1], 5.5015643181E-04);
 }
 
-struct hahn1_functor : DenseFunctor<double>
-{
-    hahn1_functor(void) : DenseFunctor<double>(7,236) {}
-    static const double m_x[236];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        static const double m_y[236] = { .591E0 , 1.547E0 , 2.902E0 , 2.894E0 , 4.703E0 , 6.307E0 , 7.03E0  , 7.898E0 , 9.470E0 , 9.484E0 , 10.072E0 , 10.163E0 , 11.615E0 , 12.005E0 , 12.478E0 , 12.982E0 , 12.970E0 , 13.926E0 , 14.452E0 , 14.404E0 , 15.190E0 , 15.550E0 , 15.528E0 , 15.499E0 , 16.131E0 , 16.438E0 , 16.387E0 , 16.549E0 , 16.872E0 , 16.830E0 , 16.926E0 , 16.907E0 , 16.966E0 , 17.060E0 , 17.122E0 , 17.311E0 , 17.355E0 , 17.668E0 , 17.767E0 , 17.803E0 , 17.765E0 , 17.768E0 , 17.736E0 , 17.858E0 , 17.877E0 , 17.912E0 , 18.046E0 , 18.085E0 , 18.291E0 , 18.357E0 , 18.426E0 , 18.584E0 , 18.610E0 , 18.870E0 , 18.795E0 , 19.111E0 , .367E0 , .796E0 , 0.892E0 , 1.903E0 , 2.150E0 , 3.697E0 , 5.870E0 , 6.421E0 , 7.422E0 , 9.944E0 , 11.023E0 , 11.87E0  , 12.786E0 , 14.067E0 , 13.974E0 , 14.462E0 , 14.464E0 , 15.381E0 , 15.483E0 , 15.59E0  , 16.075E0 , 16.347E0 , 16.181E0 , 16.915E0 , 17.003E0 , 16.978E0 , 17.756E0 , 17.808E0 , 17.868E0 , 18.481E0 , 18.486E0 , 19.090E0 , 16.062E0 , 16.337E0 , 16.345E0 ,
-        16.388E0 , 17.159E0 , 17.116E0 , 17.164E0 , 17.123E0 , 17.979E0 , 17.974E0 , 18.007E0 , 17.993E0 , 18.523E0 , 18.669E0 , 18.617E0 , 19.371E0 , 19.330E0 , 0.080E0 , 0.248E0 , 1.089E0 , 1.418E0 , 2.278E0 , 3.624E0 , 4.574E0 , 5.556E0 , 7.267E0 , 7.695E0 , 9.136E0 , 9.959E0 , 9.957E0 , 11.600E0 , 13.138E0 , 13.564E0 , 13.871E0 , 13.994E0 , 14.947E0 , 15.473E0 , 15.379E0 , 15.455E0 , 15.908E0 , 16.114E0 , 17.071E0 , 17.135E0 , 17.282E0 , 17.368E0 , 17.483E0 , 17.764E0 , 18.185E0 , 18.271E0 , 18.236E0 , 18.237E0 , 18.523E0 , 18.627E0 , 18.665E0 , 19.086E0 , 0.214E0 , 0.943E0 , 1.429E0 , 2.241E0 , 2.951E0 , 3.782E0 , 4.757E0 , 5.602E0 , 7.169E0 , 8.920E0 , 10.055E0 , 12.035E0 , 12.861E0 , 13.436E0 , 14.167E0 , 14.755E0 , 15.168E0 , 15.651E0 , 15.746E0 , 16.216E0 , 16.445E0 , 16.965E0 , 17.121E0 , 17.206E0 , 17.250E0 , 17.339E0 , 17.793E0 , 18.123E0 , 18.49E0  , 18.566E0 , 18.645E0 , 18.706E0 , 18.924E0 , 19.1E0   , 0.375E0 , 0.471E0 , 1.504E0 , 2.204E0 , 2.813E0 , 4.765E0 , 9.835E0 , 10.040E0 , 11.946E0 , 
-12.596E0 , 
-13.303E0 , 13.922E0 , 14.440E0 , 14.951E0 , 15.627E0 , 15.639E0 , 15.814E0 , 16.315E0 , 16.334E0 , 16.430E0 , 16.423E0 , 17.024E0 , 17.009E0 , 17.165E0 , 17.134E0 , 17.349E0 , 17.576E0 , 17.848E0 , 18.090E0 , 18.276E0 , 18.404E0 , 18.519E0 , 19.133E0 , 19.074E0 , 19.239E0 , 19.280E0 , 19.101E0 , 19.398E0 , 19.252E0 , 19.89E0  , 20.007E0 , 19.929E0 , 19.268E0 , 19.324E0 , 20.049E0 , 20.107E0 , 20.062E0 , 20.065E0 , 19.286E0 , 19.972E0 , 20.088E0 , 20.743E0 , 20.83E0  , 20.935E0 , 21.035E0 , 20.93E0  , 21.074E0 , 21.085E0 , 20.935E0 };
+struct hahn1_functor : DenseFunctor<double> {
+  hahn1_functor(void) : DenseFunctor<double>(7, 236) {}
+  static const double m_x[236];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    static const double m_y[236] = {
+        .591E0,   1.547E0,  2.902E0,  2.894E0,  4.703E0,  6.307E0,  7.03E0,   7.898E0,  9.470E0,  9.484E0,  10.072E0,
+        10.163E0, 11.615E0, 12.005E0, 12.478E0, 12.982E0, 12.970E0, 13.926E0, 14.452E0, 14.404E0, 15.190E0, 15.550E0,
+        15.528E0, 15.499E0, 16.131E0, 16.438E0, 16.387E0, 16.549E0, 16.872E0, 16.830E0, 16.926E0, 16.907E0, 16.966E0,
+        17.060E0, 17.122E0, 17.311E0, 17.355E0, 17.668E0, 17.767E0, 17.803E0, 17.765E0, 17.768E0, 17.736E0, 17.858E0,
+        17.877E0, 17.912E0, 18.046E0, 18.085E0, 18.291E0, 18.357E0, 18.426E0, 18.584E0, 18.610E0, 18.870E0, 18.795E0,
+        19.111E0, .367E0,   .796E0,   0.892E0,  1.903E0,  2.150E0,  3.697E0,  5.870E0,  6.421E0,  7.422E0,  9.944E0,
+        11.023E0, 11.87E0,  12.786E0, 14.067E0, 13.974E0, 14.462E0, 14.464E0, 15.381E0, 15.483E0, 15.59E0,  16.075E0,
+        16.347E0, 16.181E0, 16.915E0, 17.003E0, 16.978E0, 17.756E0, 17.808E0, 17.868E0, 18.481E0, 18.486E0, 19.090E0,
+        16.062E0, 16.337E0, 16.345E0, 16.388E0, 17.159E0, 17.116E0, 17.164E0, 17.123E0, 17.979E0, 17.974E0, 18.007E0,
+        17.993E0, 18.523E0, 18.669E0, 18.617E0, 19.371E0, 19.330E0, 0.080E0,  0.248E0,  1.089E0,  1.418E0,  2.278E0,
+        3.624E0,  4.574E0,  5.556E0,  7.267E0,  7.695E0,  9.136E0,  9.959E0,  9.957E0,  11.600E0, 13.138E0, 13.564E0,
+        13.871E0, 13.994E0, 14.947E0, 15.473E0, 15.379E0, 15.455E0, 15.908E0, 16.114E0, 17.071E0, 17.135E0, 17.282E0,
+        17.368E0, 17.483E0, 17.764E0, 18.185E0, 18.271E0, 18.236E0, 18.237E0, 18.523E0, 18.627E0, 18.665E0, 19.086E0,
+        0.214E0,  0.943E0,  1.429E0,  2.241E0,  2.951E0,  3.782E0,  4.757E0,  5.602E0,  7.169E0,  8.920E0,  10.055E0,
+        12.035E0, 12.861E0, 13.436E0, 14.167E0, 14.755E0, 15.168E0, 15.651E0, 15.746E0, 16.216E0, 16.445E0, 16.965E0,
+        17.121E0, 17.206E0, 17.250E0, 17.339E0, 17.793E0, 18.123E0, 18.49E0,  18.566E0, 18.645E0, 18.706E0, 18.924E0,
+        19.1E0,   0.375E0,  0.471E0,  1.504E0,  2.204E0,  2.813E0,  4.765E0,  9.835E0,  10.040E0, 11.946E0, 12.596E0,
+        13.303E0, 13.922E0, 14.440E0, 14.951E0, 15.627E0, 15.639E0, 15.814E0, 16.315E0, 16.334E0, 16.430E0, 16.423E0,
+        17.024E0, 17.009E0, 17.165E0, 17.134E0, 17.349E0, 17.576E0, 17.848E0, 18.090E0, 18.276E0, 18.404E0, 18.519E0,
+        19.133E0, 19.074E0, 19.239E0, 19.280E0, 19.101E0, 19.398E0, 19.252E0, 19.89E0,  20.007E0, 19.929E0, 19.268E0,
+        19.324E0, 20.049E0, 20.107E0, 20.062E0, 20.065E0, 19.286E0, 19.972E0, 20.088E0, 20.743E0, 20.83E0,  20.935E0,
+        21.035E0, 20.93E0,  21.074E0, 21.085E0, 20.935E0};
 
-        //        int called=0; printf("call hahn1_functor with  iflag=%d, called=%d\n", iflag, called); if (iflag==1) called++;
+    //        int called=0; printf("call hahn1_functor with  iflag=%d, called=%d\n", iflag, called); if (iflag==1)
+    //        called++;
 
-        assert(b.size()==7);
-        assert(fvec.size()==236);
-        for(int i=0; i<236; i++) {
-            double x=m_x[i], xx=x*x, xxx=xx*x;
-            fvec[i] = (b[0]+b[1]*x+b[2]*xx+b[3]*xxx) / (1.+b[4]*x+b[5]*xx+b[6]*xxx) - m_y[i];
-        }
-        return 0;
+    assert(b.size() == 7);
+    assert(fvec.size() == 236);
+    for (int i = 0; i < 236; i++) {
+      double x = m_x[i], xx = x * x, xxx = xx * x;
+      fvec[i] = (b[0] + b[1] * x + b[2] * xx + b[3] * xxx) / (1. + b[4] * x + b[5] * xx + b[6] * xxx) - m_y[i];
     }
+    return 0;
+  }
 
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==7);
-        assert(fjac.rows()==236);
-        assert(fjac.cols()==7);
-        for(int i=0; i<236; i++) {
-            double x=m_x[i], xx=x*x, xxx=xx*x;
-            double fact = 1./(1.+b[4]*x+b[5]*xx+b[6]*xxx);
-            fjac(i,0) = 1.*fact;
-            fjac(i,1) = x*fact;
-            fjac(i,2) = xx*fact;
-            fjac(i,3) = xxx*fact;
-            fact = - (b[0]+b[1]*x+b[2]*xx+b[3]*xxx) * fact * fact;
-            fjac(i,4) = x*fact;
-            fjac(i,5) = xx*fact;
-            fjac(i,6) = xxx*fact;
-        }
-        return 0;
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 7);
+    assert(fjac.rows() == 236);
+    assert(fjac.cols() == 7);
+    for (int i = 0; i < 236; i++) {
+      double x = m_x[i], xx = x * x, xxx = xx * x;
+      double fact = 1. / (1. + b[4] * x + b[5] * xx + b[6] * xxx);
+      fjac(i, 0) = 1. * fact;
+      fjac(i, 1) = x * fact;
+      fjac(i, 2) = xx * fact;
+      fjac(i, 3) = xxx * fact;
+      fact = -(b[0] + b[1] * x + b[2] * xx + b[3] * xxx) * fact * fact;
+      fjac(i, 4) = x * fact;
+      fjac(i, 5) = xx * fact;
+      fjac(i, 6) = xxx * fact;
     }
+    return 0;
+  }
 };
-const double hahn1_functor::m_x[236] = { 24.41E0 , 34.82E0 , 44.09E0 , 45.07E0 , 54.98E0 , 65.51E0 , 70.53E0 , 75.70E0 , 89.57E0 , 91.14E0 , 96.40E0 , 97.19E0 , 114.26E0 , 120.25E0 , 127.08E0 , 133.55E0 , 133.61E0 , 158.67E0 , 172.74E0 , 171.31E0 , 202.14E0 , 220.55E0 , 221.05E0 , 221.39E0 , 250.99E0 , 268.99E0 , 271.80E0 , 271.97E0 , 321.31E0 , 321.69E0 , 330.14E0 , 333.03E0 , 333.47E0 , 340.77E0 , 345.65E0 , 373.11E0 , 373.79E0 , 411.82E0 , 419.51E0 , 421.59E0 , 422.02E0 , 422.47E0 , 422.61E0 , 441.75E0 , 447.41E0 , 448.7E0  , 472.89E0 , 476.69E0 , 522.47E0 , 522.62E0 , 524.43E0 , 546.75E0 , 549.53E0 , 575.29E0 , 576.00E0 , 625.55E0 , 20.15E0 , 28.78E0 , 29.57E0 , 37.41E0 , 39.12E0 , 50.24E0 , 61.38E0 , 66.25E0 , 73.42E0 , 95.52E0 , 107.32E0 , 122.04E0 , 134.03E0 , 163.19E0 , 163.48E0 , 175.70E0 , 179.86E0 , 211.27E0 , 217.78E0 , 219.14E0 , 262.52E0 , 268.01E0 , 268.62E0 , 336.25E0 , 337.23E0 , 339.33E0 , 427.38E0 , 428.58E0 , 432.68E0 , 528.99E0 , 531.08E0 , 628.34E0 , 253.24E0 , 273.13E0 , 273.66E0 ,
-282.10E0 , 346.62E0 , 347.19E0 , 348.78E0 , 351.18E0 , 450.10E0 , 450.35E0 , 451.92E0 , 455.56E0 , 552.22E0 , 553.56E0 , 555.74E0 , 652.59E0 , 656.20E0 , 14.13E0 , 20.41E0 , 31.30E0 , 33.84E0 , 39.70E0 , 48.83E0 , 54.50E0 , 60.41E0 , 72.77E0 , 75.25E0 , 86.84E0 , 94.88E0 , 96.40E0 , 117.37E0 , 139.08E0 , 147.73E0 , 158.63E0 , 161.84E0 , 192.11E0 , 206.76E0 , 209.07E0 , 213.32E0 , 226.44E0 , 237.12E0 , 330.90E0 , 358.72E0 , 370.77E0 , 372.72E0 , 396.24E0 , 416.59E0 , 484.02E0 , 495.47E0 , 514.78E0 , 515.65E0 , 519.47E0 , 544.47E0 , 560.11E0 , 620.77E0 , 18.97E0 , 28.93E0 , 33.91E0 , 40.03E0 , 44.66E0 , 49.87E0 , 55.16E0 , 60.90E0 , 72.08E0 , 85.15E0 , 97.06E0 , 119.63E0 , 133.27E0 , 143.84E0 , 161.91E0 , 180.67E0 , 198.44E0 , 226.86E0 , 229.65E0 , 258.27E0 , 273.77E0 , 339.15E0 , 350.13E0 , 362.75E0 , 371.03E0 , 393.32E0 , 448.53E0 , 473.78E0 , 511.12E0 , 524.70E0 , 548.75E0 , 551.64E0 , 574.02E0 , 623.86E0 , 21.46E0 , 24.33E0 , 33.43E0 , 39.22E0 , 44.18E0 , 55.02E0 , 94.33E0 , 96.44E0 , 118.82E0 , 128.48E0 ,
-141.94E0 , 156.92E0 , 171.65E0 , 190.00E0 , 223.26E0 , 223.88E0 , 231.50E0 , 265.05E0 , 269.44E0 , 271.78E0 , 273.46E0 , 334.61E0 , 339.79E0 , 349.52E0 , 358.18E0 , 377.98E0 , 394.77E0 , 429.66E0 , 468.22E0 , 487.27E0 , 519.54E0 , 523.03E0 , 612.99E0 , 638.59E0 , 641.36E0 , 622.05E0 , 631.50E0 , 663.97E0 , 646.9E0  , 748.29E0 , 749.21E0 , 750.14E0 , 647.04E0 , 646.89E0 , 746.9E0  , 748.43E0 , 747.35E0 , 749.27E0 , 647.61E0 , 747.78E0 , 750.51E0 , 851.37E0 , 845.97E0 , 847.54E0 , 849.93E0 , 851.61E0 , 849.75E0 , 850.98E0 , 848.23E0};
+const double hahn1_functor::m_x[236] = {
+    24.41E0,  34.82E0,  44.09E0,  45.07E0,  54.98E0,  65.51E0,  70.53E0,  75.70E0,  89.57E0,  91.14E0,  96.40E0,
+    97.19E0,  114.26E0, 120.25E0, 127.08E0, 133.55E0, 133.61E0, 158.67E0, 172.74E0, 171.31E0, 202.14E0, 220.55E0,
+    221.05E0, 221.39E0, 250.99E0, 268.99E0, 271.80E0, 271.97E0, 321.31E0, 321.69E0, 330.14E0, 333.03E0, 333.47E0,
+    340.77E0, 345.65E0, 373.11E0, 373.79E0, 411.82E0, 419.51E0, 421.59E0, 422.02E0, 422.47E0, 422.61E0, 441.75E0,
+    447.41E0, 448.7E0,  472.89E0, 476.69E0, 522.47E0, 522.62E0, 524.43E0, 546.75E0, 549.53E0, 575.29E0, 576.00E0,
+    625.55E0, 20.15E0,  28.78E0,  29.57E0,  37.41E0,  39.12E0,  50.24E0,  61.38E0,  66.25E0,  73.42E0,  95.52E0,
+    107.32E0, 122.04E0, 134.03E0, 163.19E0, 163.48E0, 175.70E0, 179.86E0, 211.27E0, 217.78E0, 219.14E0, 262.52E0,
+    268.01E0, 268.62E0, 336.25E0, 337.23E0, 339.33E0, 427.38E0, 428.58E0, 432.68E0, 528.99E0, 531.08E0, 628.34E0,
+    253.24E0, 273.13E0, 273.66E0, 282.10E0, 346.62E0, 347.19E0, 348.78E0, 351.18E0, 450.10E0, 450.35E0, 451.92E0,
+    455.56E0, 552.22E0, 553.56E0, 555.74E0, 652.59E0, 656.20E0, 14.13E0,  20.41E0,  31.30E0,  33.84E0,  39.70E0,
+    48.83E0,  54.50E0,  60.41E0,  72.77E0,  75.25E0,  86.84E0,  94.88E0,  96.40E0,  117.37E0, 139.08E0, 147.73E0,
+    158.63E0, 161.84E0, 192.11E0, 206.76E0, 209.07E0, 213.32E0, 226.44E0, 237.12E0, 330.90E0, 358.72E0, 370.77E0,
+    372.72E0, 396.24E0, 416.59E0, 484.02E0, 495.47E0, 514.78E0, 515.65E0, 519.47E0, 544.47E0, 560.11E0, 620.77E0,
+    18.97E0,  28.93E0,  33.91E0,  40.03E0,  44.66E0,  49.87E0,  55.16E0,  60.90E0,  72.08E0,  85.15E0,  97.06E0,
+    119.63E0, 133.27E0, 143.84E0, 161.91E0, 180.67E0, 198.44E0, 226.86E0, 229.65E0, 258.27E0, 273.77E0, 339.15E0,
+    350.13E0, 362.75E0, 371.03E0, 393.32E0, 448.53E0, 473.78E0, 511.12E0, 524.70E0, 548.75E0, 551.64E0, 574.02E0,
+    623.86E0, 21.46E0,  24.33E0,  33.43E0,  39.22E0,  44.18E0,  55.02E0,  94.33E0,  96.44E0,  118.82E0, 128.48E0,
+    141.94E0, 156.92E0, 171.65E0, 190.00E0, 223.26E0, 223.88E0, 231.50E0, 265.05E0, 269.44E0, 271.78E0, 273.46E0,
+    334.61E0, 339.79E0, 349.52E0, 358.18E0, 377.98E0, 394.77E0, 429.66E0, 468.22E0, 487.27E0, 519.54E0, 523.03E0,
+    612.99E0, 638.59E0, 641.36E0, 622.05E0, 631.50E0, 663.97E0, 646.9E0,  748.29E0, 749.21E0, 750.14E0, 647.04E0,
+    646.89E0, 746.9E0,  748.43E0, 747.35E0, 749.27E0, 647.61E0, 747.78E0, 750.51E0, 851.37E0, 845.97E0, 847.54E0,
+    849.93E0, 851.61E0, 849.75E0, 850.98E0, 848.23E0};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/hahn1.shtml
-void testNistHahn1(void)
-{
-  const int  n=7;
+void testNistHahn1(void) {
+  const int n = 7;
   int info;
 
   VectorXd x(n);
@@ -466,7 +488,7 @@
   /*
    * First try
    */
-  x<< 10., -1., .05, -.00001, -.05, .001, -.000001;
+  x << 10., -1., .05, -.00001, -.05, .001, -.000001;
   // do the computation
   hahn1_functor functor;
   LevenbergMarquardt<hahn1_functor> lm(functor);
@@ -481,72 +503,69 @@
   VERIFY_IS_APPROX(lm.fvec().squaredNorm(), 1.5324382854E+00);
   // check x
   VERIFY_IS_APPROX(x[0], 1.0776351733E+00);
-  VERIFY_IS_APPROX(x[1],-1.2269296921E-01);
+  VERIFY_IS_APPROX(x[1], -1.2269296921E-01);
   VERIFY_IS_APPROX(x[2], 4.0863750610E-03);
-  VERIFY_IS_APPROX(x[3],-1.426264e-06); // shoulde be : -1.4262662514E-06
-  VERIFY_IS_APPROX(x[4],-5.7609940901E-03);
+  VERIFY_IS_APPROX(x[3], -1.426264e-06);  // shoulde be : -1.4262662514E-06
+  VERIFY_IS_APPROX(x[4], -5.7609940901E-03);
   VERIFY_IS_APPROX(x[5], 2.4053735503E-04);
-  VERIFY_IS_APPROX(x[6],-1.2314450199E-07);
+  VERIFY_IS_APPROX(x[6], -1.2314450199E-07);
 
   /*
    * Second try
    */
-  x<< .1, -.1, .005, -.000001, -.005, .0001, -.0000001;
+  x << .1, -.1, .005, -.000001, -.005, .0001, -.0000001;
   // do the computation
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
 
   // check return value
   // VERIFY_IS_EQUAL(info, 1);
-//   VERIFY_IS_EQUAL(lm.nfev(), 11);
+  //   VERIFY_IS_EQUAL(lm.nfev(), 11);
   // VERIFY_IS_EQUAL(lm.njev(), 10);
   // check norm^2
   VERIFY_IS_APPROX(lm.fvec().squaredNorm(), 1.5324382854E+00);
   // check x
-  VERIFY_IS_APPROX(x[0], 1.077640); // should be :  1.0776351733E+00
-  VERIFY_IS_APPROX(x[1], -0.1226933); // should be : -1.2269296921E-01
-  VERIFY_IS_APPROX(x[2], 0.004086383); // should be : 4.0863750610E-03
-  VERIFY_IS_APPROX(x[3], -1.426277e-06); // shoulde be : -1.4262662514E-06
-  VERIFY_IS_APPROX(x[4],-5.7609940901E-03);
-  VERIFY_IS_APPROX(x[5], 0.00024053772); // should be : 2.4053735503E-04
-  VERIFY_IS_APPROX(x[6], -1.231450e-07); // should be : -1.2314450199E-07
-
+  VERIFY_IS_APPROX(x[0], 1.077640);       // should be :  1.0776351733E+00
+  VERIFY_IS_APPROX(x[1], -0.1226933);     // should be : -1.2269296921E-01
+  VERIFY_IS_APPROX(x[2], 0.004086383);    // should be : 4.0863750610E-03
+  VERIFY_IS_APPROX(x[3], -1.426277e-06);  // shoulde be : -1.4262662514E-06
+  VERIFY_IS_APPROX(x[4], -5.7609940901E-03);
+  VERIFY_IS_APPROX(x[5], 0.00024053772);  // should be : 2.4053735503E-04
+  VERIFY_IS_APPROX(x[6], -1.231450e-07);  // should be : -1.2314450199E-07
 }
 
-struct misra1d_functor : DenseFunctor<double>
-{
-    misra1d_functor(void) : DenseFunctor<double>(2,14) {}
-    static const double x[14];
-    static const double y[14];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        assert(b.size()==2);
-        assert(fvec.size()==14);
-        for(int i=0; i<14; i++) {
-            fvec[i] = b[0]*b[1]*x[i]/(1.+b[1]*x[i]) - y[i];
-        }
-        return 0;
+struct misra1d_functor : DenseFunctor<double> {
+  misra1d_functor(void) : DenseFunctor<double>(2, 14) {}
+  static const double x[14];
+  static const double y[14];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    assert(b.size() == 2);
+    assert(fvec.size() == 14);
+    for (int i = 0; i < 14; i++) {
+      fvec[i] = b[0] * b[1] * x[i] / (1. + b[1] * x[i]) - y[i];
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==2);
-        assert(fjac.rows()==14);
-        assert(fjac.cols()==2);
-        for(int i=0; i<14; i++) {
-            double den = 1.+b[1]*x[i];
-            fjac(i,0) = b[1]*x[i] / den;
-            fjac(i,1) = b[0]*x[i]*(den-b[1]*x[i])/den/den;
-        }
-        return 0;
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 2);
+    assert(fjac.rows() == 14);
+    assert(fjac.cols() == 2);
+    for (int i = 0; i < 14; i++) {
+      double den = 1. + b[1] * x[i];
+      fjac(i, 0) = b[1] * x[i] / den;
+      fjac(i, 1) = b[0] * x[i] * (den - b[1] * x[i]) / den / den;
     }
+    return 0;
+  }
 };
-const double misra1d_functor::x[14] = { 77.6E0, 114.9E0, 141.1E0, 190.8E0, 239.9E0, 289.0E0, 332.8E0, 378.4E0, 434.8E0, 477.3E0, 536.8E0, 593.1E0, 689.1E0, 760.0E0};
-const double misra1d_functor::y[14] = { 10.07E0, 14.73E0, 17.94E0, 23.93E0, 29.61E0, 35.18E0, 40.02E0, 44.82E0, 50.76E0, 55.05E0, 61.01E0, 66.40E0, 75.47E0, 81.78E0};
+const double misra1d_functor::x[14] = {77.6E0,  114.9E0, 141.1E0, 190.8E0, 239.9E0, 289.0E0, 332.8E0,
+                                       378.4E0, 434.8E0, 477.3E0, 536.8E0, 593.1E0, 689.1E0, 760.0E0};
+const double misra1d_functor::y[14] = {10.07E0, 14.73E0, 17.94E0, 23.93E0, 29.61E0, 35.18E0, 40.02E0,
+                                       44.82E0, 50.76E0, 55.05E0, 61.01E0, 66.40E0, 75.47E0, 81.78E0};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/misra1d.shtml
-void testNistMisra1d(void)
-{
-  const int n=2;
+void testNistMisra1d(void) {
+  const int n = 2;
   int info;
 
   VectorXd x(n);
@@ -554,7 +573,7 @@
   /*
    * First try
    */
-  x<< 500., 0.0001;
+  x << 500., 0.0001;
   // do the computation
   misra1d_functor functor;
   LevenbergMarquardt<misra1d_functor> lm(functor);
@@ -574,7 +593,7 @@
   /*
    * Second try
    */
-  x<< 450., 0.0003;
+  x << 450., 0.0003;
   // do the computation
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
@@ -590,43 +609,48 @@
   VERIFY_IS_APPROX(x[1], 3.0227324449E-04);
 }
 
-
-struct lanczos1_functor : DenseFunctor<double>
-{
-    lanczos1_functor(void) : DenseFunctor<double>(6,24) {}
-    static const double x[24];
-    static const double y[24];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        assert(b.size()==6);
-        assert(fvec.size()==24);
-        for(int i=0; i<24; i++)
-            fvec[i] = b[0]*exp(-b[1]*x[i]) + b[2]*exp(-b[3]*x[i]) + b[4]*exp(-b[5]*x[i])  - y[i];
-        return 0;
+struct lanczos1_functor : DenseFunctor<double> {
+  lanczos1_functor(void) : DenseFunctor<double>(6, 24) {}
+  static const double x[24];
+  static const double y[24];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    assert(b.size() == 6);
+    assert(fvec.size() == 24);
+    for (int i = 0; i < 24; i++)
+      fvec[i] = b[0] * exp(-b[1] * x[i]) + b[2] * exp(-b[3] * x[i]) + b[4] * exp(-b[5] * x[i]) - y[i];
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 6);
+    assert(fjac.rows() == 24);
+    assert(fjac.cols() == 6);
+    for (int i = 0; i < 24; i++) {
+      fjac(i, 0) = exp(-b[1] * x[i]);
+      fjac(i, 1) = -b[0] * x[i] * exp(-b[1] * x[i]);
+      fjac(i, 2) = exp(-b[3] * x[i]);
+      fjac(i, 3) = -b[2] * x[i] * exp(-b[3] * x[i]);
+      fjac(i, 4) = exp(-b[5] * x[i]);
+      fjac(i, 5) = -b[4] * x[i] * exp(-b[5] * x[i]);
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==6);
-        assert(fjac.rows()==24);
-        assert(fjac.cols()==6);
-        for(int i=0; i<24; i++) {
-            fjac(i,0) = exp(-b[1]*x[i]);
-            fjac(i,1) = -b[0]*x[i]*exp(-b[1]*x[i]);
-            fjac(i,2) = exp(-b[3]*x[i]);
-            fjac(i,3) = -b[2]*x[i]*exp(-b[3]*x[i]);
-            fjac(i,4) = exp(-b[5]*x[i]);
-            fjac(i,5) = -b[4]*x[i]*exp(-b[5]*x[i]);
-        }
-        return 0;
-    }
+    return 0;
+  }
 };
-const double lanczos1_functor::x[24] = { 0.000000000000E+00, 5.000000000000E-02, 1.000000000000E-01, 1.500000000000E-01, 2.000000000000E-01, 2.500000000000E-01, 3.000000000000E-01, 3.500000000000E-01, 4.000000000000E-01, 4.500000000000E-01, 5.000000000000E-01, 5.500000000000E-01, 6.000000000000E-01, 6.500000000000E-01, 7.000000000000E-01, 7.500000000000E-01, 8.000000000000E-01, 8.500000000000E-01, 9.000000000000E-01, 9.500000000000E-01, 1.000000000000E+00, 1.050000000000E+00, 1.100000000000E+00, 1.150000000000E+00 };
-const double lanczos1_functor::y[24] = { 2.513400000000E+00 ,2.044333373291E+00 ,1.668404436564E+00 ,1.366418021208E+00 ,1.123232487372E+00 ,9.268897180037E-01 ,7.679338563728E-01 ,6.388775523106E-01 ,5.337835317402E-01 ,4.479363617347E-01 ,3.775847884350E-01 ,3.197393199326E-01 ,2.720130773746E-01 ,2.324965529032E-01 ,1.996589546065E-01 ,1.722704126914E-01 ,1.493405660168E-01 ,1.300700206922E-01 ,1.138119324644E-01 ,1.000415587559E-01 ,8.833209084540E-02 ,7.833544019350E-02 ,6.976693743449E-02 ,6.239312536719E-02 };
+const double lanczos1_functor::x[24] = {0.000000000000E+00, 5.000000000000E-02, 1.000000000000E-01, 1.500000000000E-01,
+                                        2.000000000000E-01, 2.500000000000E-01, 3.000000000000E-01, 3.500000000000E-01,
+                                        4.000000000000E-01, 4.500000000000E-01, 5.000000000000E-01, 5.500000000000E-01,
+                                        6.000000000000E-01, 6.500000000000E-01, 7.000000000000E-01, 7.500000000000E-01,
+                                        8.000000000000E-01, 8.500000000000E-01, 9.000000000000E-01, 9.500000000000E-01,
+                                        1.000000000000E+00, 1.050000000000E+00, 1.100000000000E+00, 1.150000000000E+00};
+const double lanczos1_functor::y[24] = {2.513400000000E+00, 2.044333373291E+00, 1.668404436564E+00, 1.366418021208E+00,
+                                        1.123232487372E+00, 9.268897180037E-01, 7.679338563728E-01, 6.388775523106E-01,
+                                        5.337835317402E-01, 4.479363617347E-01, 3.775847884350E-01, 3.197393199326E-01,
+                                        2.720130773746E-01, 2.324965529032E-01, 1.996589546065E-01, 1.722704126914E-01,
+                                        1.493405660168E-01, 1.300700206922E-01, 1.138119324644E-01, 1.000415587559E-01,
+                                        8.833209084540E-02, 7.833544019350E-02, 6.976693743449E-02, 6.239312536719E-02};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/lanczos1.shtml
-void testNistLanczos1(void)
-{
-  const int n=6;
+void testNistLanczos1(void) {
+  const int n = 6;
   LevenbergMarquardtSpace::Status info;
 
   VectorXd x(n);
@@ -634,7 +658,7 @@
   /*
    * First try
    */
-  x<< 1.2, 0.3, 5.6, 5.5, 6.5, 7.6;
+  x << 1.2, 0.3, 5.6, 5.5, 6.5, 7.6;
   // do the computation
   lanczos1_functor functor;
   LevenbergMarquardt<lanczos1_functor> lm(functor);
@@ -658,7 +682,7 @@
   /*
    * Second try
    */
-  x<< 0.5, 0.7, 3.6, 4.2, 4., 6.3;
+  x << 0.5, 0.7, 3.6, 4.2, 4., 6.3;
   // do the computation
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
@@ -676,45 +700,42 @@
   VERIFY_IS_APPROX(x[3], 3.0000000002E+00);
   VERIFY_IS_APPROX(x[4], 1.5575999998E+00);
   VERIFY_IS_APPROX(x[5], 5.0000000001E+00);
-
 }
 
-struct rat42_functor : DenseFunctor<double>
-{
-    rat42_functor(void) : DenseFunctor<double>(3,9) {}
-    static const double x[9];
-    static const double y[9];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        assert(b.size()==3);
-        assert(fvec.size()==9);
-        for(int i=0; i<9; i++) {
-            fvec[i] = b[0] / (1.+exp(b[1]-b[2]*x[i])) - y[i];
-        }
-        return 0;
+struct rat42_functor : DenseFunctor<double> {
+  rat42_functor(void) : DenseFunctor<double>(3, 9) {}
+  static const double x[9];
+  static const double y[9];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    assert(b.size() == 3);
+    assert(fvec.size() == 9);
+    for (int i = 0; i < 9; i++) {
+      fvec[i] = b[0] / (1. + exp(b[1] - b[2] * x[i])) - y[i];
     }
+    return 0;
+  }
 
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==3);
-        assert(fjac.rows()==9);
-        assert(fjac.cols()==3);
-        for(int i=0; i<9; i++) {
-            double e = exp(b[1]-b[2]*x[i]);
-            fjac(i,0) = 1./(1.+e);
-            fjac(i,1) = -b[0]*e/(1.+e)/(1.+e);
-            fjac(i,2) = +b[0]*e*x[i]/(1.+e)/(1.+e);
-        }
-        return 0;
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 3);
+    assert(fjac.rows() == 9);
+    assert(fjac.cols() == 3);
+    for (int i = 0; i < 9; i++) {
+      double e = exp(b[1] - b[2] * x[i]);
+      fjac(i, 0) = 1. / (1. + e);
+      fjac(i, 1) = -b[0] * e / (1. + e) / (1. + e);
+      fjac(i, 2) = +b[0] * e * x[i] / (1. + e) / (1. + e);
     }
+    return 0;
+  }
 };
-const double rat42_functor::x[9] = { 9.000E0, 14.000E0, 21.000E0, 28.000E0, 42.000E0, 57.000E0, 63.000E0, 70.000E0, 79.000E0 };
-const double rat42_functor::y[9] = { 8.930E0 ,10.800E0 ,18.590E0 ,22.330E0 ,39.350E0 ,56.110E0 ,61.730E0 ,64.620E0 ,67.080E0 };
+const double rat42_functor::x[9] = {9.000E0,  14.000E0, 21.000E0, 28.000E0, 42.000E0,
+                                    57.000E0, 63.000E0, 70.000E0, 79.000E0};
+const double rat42_functor::y[9] = {8.930E0,  10.800E0, 18.590E0, 22.330E0, 39.350E0,
+                                    56.110E0, 61.730E0, 64.620E0, 67.080E0};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/ratkowsky2.shtml
-void testNistRat42(void)
-{
-  const int n=3;
+void testNistRat42(void) {
+  const int n = 3;
   LevenbergMarquardtSpace::Status info;
 
   VectorXd x(n);
@@ -722,7 +743,7 @@
   /*
    * First try
    */
-  x<< 100., 1., 0.1;
+  x << 100., 1., 0.1;
   // do the computation
   rat42_functor functor;
   LevenbergMarquardt<rat42_functor> lm(functor);
@@ -743,7 +764,7 @@
   /*
    * Second try
    */
-  x<< 75., 2.5, 0.07;
+  x << 75., 2.5, 0.07;
   // do the computation
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
@@ -760,41 +781,40 @@
   VERIFY_IS_APPROX(x[2], 6.7359200066E-02);
 }
 
-struct MGH10_functor : DenseFunctor<double>
-{
-    MGH10_functor(void) : DenseFunctor<double>(3,16) {}
-    static const double x[16];
-    static const double y[16];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        assert(b.size()==3);
-        assert(fvec.size()==16);
-        for(int i=0; i<16; i++)
-            fvec[i] =  b[0] * exp(b[1]/(x[i]+b[2])) - y[i];
-        return 0;
+struct MGH10_functor : DenseFunctor<double> {
+  MGH10_functor(void) : DenseFunctor<double>(3, 16) {}
+  static const double x[16];
+  static const double y[16];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    assert(b.size() == 3);
+    assert(fvec.size() == 16);
+    for (int i = 0; i < 16; i++) fvec[i] = b[0] * exp(b[1] / (x[i] + b[2])) - y[i];
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 3);
+    assert(fjac.rows() == 16);
+    assert(fjac.cols() == 3);
+    for (int i = 0; i < 16; i++) {
+      double factor = 1. / (x[i] + b[2]);
+      double e = exp(b[1] * factor);
+      fjac(i, 0) = e;
+      fjac(i, 1) = b[0] * factor * e;
+      fjac(i, 2) = -b[1] * b[0] * factor * factor * e;
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==3);
-        assert(fjac.rows()==16);
-        assert(fjac.cols()==3);
-        for(int i=0; i<16; i++) {
-            double factor = 1./(x[i]+b[2]);
-            double e = exp(b[1]*factor);
-            fjac(i,0) = e;
-            fjac(i,1) = b[0]*factor*e;
-            fjac(i,2) = -b[1]*b[0]*factor*factor*e;
-        }
-        return 0;
-    }
+    return 0;
+  }
 };
-const double MGH10_functor::x[16] = { 5.000000E+01, 5.500000E+01, 6.000000E+01, 6.500000E+01, 7.000000E+01, 7.500000E+01, 8.000000E+01, 8.500000E+01, 9.000000E+01, 9.500000E+01, 1.000000E+02, 1.050000E+02, 1.100000E+02, 1.150000E+02, 1.200000E+02, 1.250000E+02 };
-const double MGH10_functor::y[16] = { 3.478000E+04, 2.861000E+04, 2.365000E+04, 1.963000E+04, 1.637000E+04, 1.372000E+04, 1.154000E+04, 9.744000E+03, 8.261000E+03, 7.030000E+03, 6.005000E+03, 5.147000E+03, 4.427000E+03, 3.820000E+03, 3.307000E+03, 2.872000E+03 };
+const double MGH10_functor::x[16] = {5.000000E+01, 5.500000E+01, 6.000000E+01, 6.500000E+01, 7.000000E+01, 7.500000E+01,
+                                     8.000000E+01, 8.500000E+01, 9.000000E+01, 9.500000E+01, 1.000000E+02, 1.050000E+02,
+                                     1.100000E+02, 1.150000E+02, 1.200000E+02, 1.250000E+02};
+const double MGH10_functor::y[16] = {3.478000E+04, 2.861000E+04, 2.365000E+04, 1.963000E+04, 1.637000E+04, 1.372000E+04,
+                                     1.154000E+04, 9.744000E+03, 8.261000E+03, 7.030000E+03, 6.005000E+03, 5.147000E+03,
+                                     4.427000E+03, 3.820000E+03, 3.307000E+03, 2.872000E+03};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/mgh10.shtml
-void testNistMGH10(void)
-{
-  const int n=3;
+void testNistMGH10(void) {
+  const int n = 3;
   LevenbergMarquardtSpace::Status info;
 
   VectorXd x(n);
@@ -819,9 +839,9 @@
   VERIFY_IS_APPROX(x[0], 5.6096364710E-03);
   VERIFY_IS_APPROX(x[1], 6.1813463463E+03);
   VERIFY_IS_APPROX(x[2], 3.4522363462E+02);
-  
+
   // check return value
-  
+
   // ++g_test_level;
   // VERIFY_IS_EQUAL(lm.nfev(), 284 );
   // VERIFY_IS_EQUAL(lm.njev(), 249 );
@@ -832,7 +852,7 @@
   /*
    * Second try
    */
-  x<< 0.02, 4000., 250.;
+  x << 0.02, 4000., 250.;
   // do the computation
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
@@ -840,14 +860,14 @@
   // VERIFY_IS_EQUAL(info, LevenbergMarquardtSpace::RelativeReductionTooSmall);
   // // was: VERIFY_IS_EQUAL(info, 1);
   // --g_test_level;
-  
+
   // check norm^2
   VERIFY_IS_APPROX(lm.fvec().squaredNorm(), 8.7945855171E+01);
   // check x
   VERIFY_IS_APPROX(x[0], 5.6096364710E-03);
   VERIFY_IS_APPROX(x[1], 6.1813463463E+03);
   VERIFY_IS_APPROX(x[2], 3.4522363462E+02);
-  
+
   // check return value
   // ++g_test_level;
   // VERIFY_IS_EQUAL(lm.nfev(), 126);
@@ -857,39 +877,33 @@
   VERIFY(lm.njev() < 116 * LM_EVAL_COUNT_TOL);
 }
 
-
-struct BoxBOD_functor : DenseFunctor<double>
-{
-    BoxBOD_functor(void) : DenseFunctor<double>(2,6) {}
-    static const double x[6];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        static const double y[6] = { 109., 149., 149., 191., 213., 224. };
-        assert(b.size()==2);
-        assert(fvec.size()==6);
-        for(int i=0; i<6; i++)
-            fvec[i] =  b[0]*(1.-exp(-b[1]*x[i])) - y[i];
-        return 0;
+struct BoxBOD_functor : DenseFunctor<double> {
+  BoxBOD_functor(void) : DenseFunctor<double>(2, 6) {}
+  static const double x[6];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    static const double y[6] = {109., 149., 149., 191., 213., 224.};
+    assert(b.size() == 2);
+    assert(fvec.size() == 6);
+    for (int i = 0; i < 6; i++) fvec[i] = b[0] * (1. - exp(-b[1] * x[i])) - y[i];
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 2);
+    assert(fjac.rows() == 6);
+    assert(fjac.cols() == 2);
+    for (int i = 0; i < 6; i++) {
+      double e = exp(-b[1] * x[i]);
+      fjac(i, 0) = 1. - e;
+      fjac(i, 1) = b[0] * x[i] * e;
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==2);
-        assert(fjac.rows()==6);
-        assert(fjac.cols()==2);
-        for(int i=0; i<6; i++) {
-            double e = exp(-b[1]*x[i]);
-            fjac(i,0) = 1.-e;
-            fjac(i,1) = b[0]*x[i]*e;
-        }
-        return 0;
-    }
+    return 0;
+  }
 };
-const double BoxBOD_functor::x[6] = { 1., 2., 3., 5., 7., 10. };
+const double BoxBOD_functor::x[6] = {1., 2., 3., 5., 7., 10.};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/boxbod.shtml
-void testNistBoxBOD(void)
-{
-  const int n=2;
+void testNistBoxBOD(void) {
+  const int n = 2;
   int info;
 
   VectorXd x(n);
@@ -897,12 +911,12 @@
   /*
    * First try
    */
-  x<< 1., 1.;
+  x << 1., 1.;
   // do the computation
   BoxBOD_functor functor;
   LevenbergMarquardt<BoxBOD_functor> lm(functor);
-  lm.setFtol(1.E6*NumTraits<double>::epsilon());
-  lm.setXtol(1.E6*NumTraits<double>::epsilon());
+  lm.setFtol(1.E6 * NumTraits<double>::epsilon());
+  lm.setXtol(1.E6 * NumTraits<double>::epsilon());
   lm.setFactor(10);
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
@@ -912,7 +926,7 @@
   // check x
   VERIFY_IS_APPROX(x[0], 2.1380940889E+02);
   VERIFY_IS_APPROX(x[1], 5.4723748542E-01);
-  
+
   // check return value
   // VERIFY_IS_EQUAL(info, 1);
   // VERIFY(lm.nfev() < 31); // 31
@@ -921,11 +935,11 @@
   /*
    * Second try
    */
-  x<< 100., 0.75;
+  x << 100., 0.75;
   // do the computation
   lm.resetParameters();
   lm.setFtol(NumTraits<double>::epsilon());
-  lm.setXtol( NumTraits<double>::epsilon());
+  lm.setXtol(NumTraits<double>::epsilon());
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
 
@@ -944,41 +958,46 @@
   VERIFY_IS_APPROX(x[1], 5.4723748542E-01);
 }
 
-struct MGH17_functor : DenseFunctor<double>
-{
-    MGH17_functor(void) : DenseFunctor<double>(5,33) {}
-    static const double x[33];
-    static const double y[33];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        assert(b.size()==5);
-        assert(fvec.size()==33);
-        for(int i=0; i<33; i++)
-            fvec[i] =  b[0] + b[1]*exp(-b[3]*x[i]) +  b[2]*exp(-b[4]*x[i]) - y[i];
-        return 0;
+struct MGH17_functor : DenseFunctor<double> {
+  MGH17_functor(void) : DenseFunctor<double>(5, 33) {}
+  static const double x[33];
+  static const double y[33];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    assert(b.size() == 5);
+    assert(fvec.size() == 33);
+    for (int i = 0; i < 33; i++) fvec[i] = b[0] + b[1] * exp(-b[3] * x[i]) + b[2] * exp(-b[4] * x[i]) - y[i];
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 5);
+    assert(fjac.rows() == 33);
+    assert(fjac.cols() == 5);
+    for (int i = 0; i < 33; i++) {
+      fjac(i, 0) = 1.;
+      fjac(i, 1) = exp(-b[3] * x[i]);
+      fjac(i, 2) = exp(-b[4] * x[i]);
+      fjac(i, 3) = -x[i] * b[1] * exp(-b[3] * x[i]);
+      fjac(i, 4) = -x[i] * b[2] * exp(-b[4] * x[i]);
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==5);
-        assert(fjac.rows()==33);
-        assert(fjac.cols()==5);
-        for(int i=0; i<33; i++) {
-            fjac(i,0) = 1.;
-            fjac(i,1) = exp(-b[3]*x[i]);
-            fjac(i,2) = exp(-b[4]*x[i]);
-            fjac(i,3) = -x[i]*b[1]*exp(-b[3]*x[i]);
-            fjac(i,4) = -x[i]*b[2]*exp(-b[4]*x[i]);
-        }
-        return 0;
-    }
+    return 0;
+  }
 };
-const double MGH17_functor::x[33] = { 0.000000E+00, 1.000000E+01, 2.000000E+01, 3.000000E+01, 4.000000E+01, 5.000000E+01, 6.000000E+01, 7.000000E+01, 8.000000E+01, 9.000000E+01, 1.000000E+02, 1.100000E+02, 1.200000E+02, 1.300000E+02, 1.400000E+02, 1.500000E+02, 1.600000E+02, 1.700000E+02, 1.800000E+02, 1.900000E+02, 2.000000E+02, 2.100000E+02, 2.200000E+02, 2.300000E+02, 2.400000E+02, 2.500000E+02, 2.600000E+02, 2.700000E+02, 2.800000E+02, 2.900000E+02, 3.000000E+02, 3.100000E+02, 3.200000E+02 };
-const double MGH17_functor::y[33] = { 8.440000E-01, 9.080000E-01, 9.320000E-01, 9.360000E-01, 9.250000E-01, 9.080000E-01, 8.810000E-01, 8.500000E-01, 8.180000E-01, 7.840000E-01, 7.510000E-01, 7.180000E-01, 6.850000E-01, 6.580000E-01, 6.280000E-01, 6.030000E-01, 5.800000E-01, 5.580000E-01, 5.380000E-01, 5.220000E-01, 5.060000E-01, 4.900000E-01, 4.780000E-01, 4.670000E-01, 4.570000E-01, 4.480000E-01, 4.380000E-01, 4.310000E-01, 4.240000E-01, 4.200000E-01, 4.140000E-01, 4.110000E-01, 4.060000E-01 };
+const double MGH17_functor::x[33] = {0.000000E+00, 1.000000E+01, 2.000000E+01, 3.000000E+01, 4.000000E+01, 5.000000E+01,
+                                     6.000000E+01, 7.000000E+01, 8.000000E+01, 9.000000E+01, 1.000000E+02, 1.100000E+02,
+                                     1.200000E+02, 1.300000E+02, 1.400000E+02, 1.500000E+02, 1.600000E+02, 1.700000E+02,
+                                     1.800000E+02, 1.900000E+02, 2.000000E+02, 2.100000E+02, 2.200000E+02, 2.300000E+02,
+                                     2.400000E+02, 2.500000E+02, 2.600000E+02, 2.700000E+02, 2.800000E+02, 2.900000E+02,
+                                     3.000000E+02, 3.100000E+02, 3.200000E+02};
+const double MGH17_functor::y[33] = {8.440000E-01, 9.080000E-01, 9.320000E-01, 9.360000E-01, 9.250000E-01, 9.080000E-01,
+                                     8.810000E-01, 8.500000E-01, 8.180000E-01, 7.840000E-01, 7.510000E-01, 7.180000E-01,
+                                     6.850000E-01, 6.580000E-01, 6.280000E-01, 6.030000E-01, 5.800000E-01, 5.580000E-01,
+                                     5.380000E-01, 5.220000E-01, 5.060000E-01, 4.900000E-01, 4.780000E-01, 4.670000E-01,
+                                     4.570000E-01, 4.480000E-01, 4.380000E-01, 4.310000E-01, 4.240000E-01, 4.200000E-01,
+                                     4.140000E-01, 4.110000E-01, 4.060000E-01};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/mgh17.shtml
-void testNistMGH17(void)
-{
-  const int n=5;
+void testNistMGH17(void) {
+  const int n = 5;
   int info;
 
   VectorXd x(n);
@@ -986,7 +1005,7 @@
   /*
    * First try
    */
-  x<< 50., 150., -100., 1., 2.;
+  x << 50., 150., -100., 1., 2.;
   // do the computation
   MGH17_functor functor;
   LevenbergMarquardt<MGH17_functor> lm(functor);
@@ -1004,16 +1023,16 @@
   VERIFY_IS_APPROX(x[2], -1.4646871366E+00);
   VERIFY_IS_APPROX(x[3], 1.2867534640E-02);
   VERIFY_IS_APPROX(x[4], 2.2122699662E-02);
-  
-    // check return value
-//   VERIFY_IS_EQUAL(info, 2);  //FIXME Use (lm.info() == Success)
+
+  // check return value
+  //   VERIFY_IS_EQUAL(info, 2);  //FIXME Use (lm.info() == Success)
   // VERIFY(lm.nfev() < 700 ); // 602
   // VERIFY(lm.njev() < 600 ); // 545
 
   /*
    * Second try
    */
-  x<< 0.5  ,1.5  ,-1   ,0.01 ,0.02;
+  x << 0.5, 1.5, -1, 0.01, 0.02;
   // do the computation
   lm.resetParameters();
   info = lm.minimize(x);
@@ -1033,44 +1052,42 @@
   VERIFY_IS_APPROX(x[4], 2.2122699662E-02);
 }
 
-struct MGH09_functor : DenseFunctor<double>
-{
-    MGH09_functor(void) : DenseFunctor<double>(4,11) {}
-    static const double _x[11];
-    static const double y[11];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        assert(b.size()==4);
-        assert(fvec.size()==11);
-        for(int i=0; i<11; i++) {
-            double x = _x[i], xx=x*x;
-            fvec[i] = b[0]*(xx+x*b[1])/(xx+x*b[2]+b[3]) - y[i];
-        }
-        return 0;
+struct MGH09_functor : DenseFunctor<double> {
+  MGH09_functor(void) : DenseFunctor<double>(4, 11) {}
+  static const double _x[11];
+  static const double y[11];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    assert(b.size() == 4);
+    assert(fvec.size() == 11);
+    for (int i = 0; i < 11; i++) {
+      double x = _x[i], xx = x * x;
+      fvec[i] = b[0] * (xx + x * b[1]) / (xx + x * b[2] + b[3]) - y[i];
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==4);
-        assert(fjac.rows()==11);
-        assert(fjac.cols()==4);
-        for(int i=0; i<11; i++) {
-            double x = _x[i], xx=x*x;
-            double factor = 1./(xx+x*b[2]+b[3]);
-            fjac(i,0) = (xx+x*b[1]) * factor;
-            fjac(i,1) = b[0]*x* factor;
-            fjac(i,2) = - b[0]*(xx+x*b[1]) * x * factor * factor;
-            fjac(i,3) = - b[0]*(xx+x*b[1]) * factor * factor;
-        }
-        return 0;
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 4);
+    assert(fjac.rows() == 11);
+    assert(fjac.cols() == 4);
+    for (int i = 0; i < 11; i++) {
+      double x = _x[i], xx = x * x;
+      double factor = 1. / (xx + x * b[2] + b[3]);
+      fjac(i, 0) = (xx + x * b[1]) * factor;
+      fjac(i, 1) = b[0] * x * factor;
+      fjac(i, 2) = -b[0] * (xx + x * b[1]) * x * factor * factor;
+      fjac(i, 3) = -b[0] * (xx + x * b[1]) * factor * factor;
     }
+    return 0;
+  }
 };
-const double MGH09_functor::_x[11] = { 4., 2., 1., 5.E-1 , 2.5E-01, 1.670000E-01, 1.250000E-01,  1.E-01, 8.330000E-02, 7.140000E-02, 6.250000E-02 };
-const double MGH09_functor::y[11] = { 1.957000E-01, 1.947000E-01, 1.735000E-01, 1.600000E-01, 8.440000E-02, 6.270000E-02, 4.560000E-02, 3.420000E-02, 3.230000E-02, 2.350000E-02, 2.460000E-02 };
+const double MGH09_functor::_x[11] = {4.,           2.,     1.,           5.E-1,        2.5E-01,     1.670000E-01,
+                                      1.250000E-01, 1.E-01, 8.330000E-02, 7.140000E-02, 6.250000E-02};
+const double MGH09_functor::y[11] = {1.957000E-01, 1.947000E-01, 1.735000E-01, 1.600000E-01, 8.440000E-02, 6.270000E-02,
+                                     4.560000E-02, 3.420000E-02, 3.230000E-02, 2.350000E-02, 2.460000E-02};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/mgh09.shtml
-void testNistMGH09(void)
-{
-  const int n=4;
+void testNistMGH09(void) {
+  const int n = 4;
   int info;
 
   VectorXd x(n);
@@ -1078,7 +1095,7 @@
   /*
    * First try
    */
-  x<< 25., 39, 41.5, 39.;
+  x << 25., 39, 41.5, 39.;
   // do the computation
   MGH09_functor functor;
   LevenbergMarquardt<MGH09_functor> lm(functor);
@@ -1089,19 +1106,19 @@
   // check norm^2
   VERIFY_IS_APPROX(lm.fvec().squaredNorm(), 3.0750560385E-04);
   // check x
-  VERIFY_IS_APPROX(x[0], 0.1928077089); // should be 1.9280693458E-01
-  VERIFY_IS_APPROX(x[1], 0.19126423573); // should be 1.9128232873E-01
-  VERIFY_IS_APPROX(x[2], 0.12305309914); // should be 1.2305650693E-01
-  VERIFY_IS_APPROX(x[3], 0.13605395375); // should be 1.3606233068E-01
+  VERIFY_IS_APPROX(x[0], 0.1928077089);   // should be 1.9280693458E-01
+  VERIFY_IS_APPROX(x[1], 0.19126423573);  // should be 1.9128232873E-01
+  VERIFY_IS_APPROX(x[2], 0.12305309914);  // should be 1.2305650693E-01
+  VERIFY_IS_APPROX(x[3], 0.13605395375);  // should be 1.3606233068E-01
   // check return value
-  // VERIFY_IS_EQUAL(info, 1); 
+  // VERIFY_IS_EQUAL(info, 1);
   // VERIFY(lm.nfev() < 510 ); // 490
   // VERIFY(lm.njev() < 400 ); // 376
 
   /*
    * Second try
    */
-  x<< 0.25, 0.39, 0.415, 0.39;
+  x << 0.25, 0.39, 0.415, 0.39;
   // do the computation
   lm.resetParameters();
   info = lm.minimize(x);
@@ -1114,51 +1131,79 @@
   // check norm^2
   VERIFY_IS_APPROX(lm.fvec().squaredNorm(), 3.0750560385E-04);
   // check x
-  VERIFY_IS_APPROX(x[0], 0.19280781); // should be 1.9280693458E-01
-  VERIFY_IS_APPROX(x[1], 0.19126265); // should be 1.9128232873E-01
-  VERIFY_IS_APPROX(x[2], 0.12305280); // should be 1.2305650693E-01
-  VERIFY_IS_APPROX(x[3], 0.13605322); // should be 1.3606233068E-01
+  VERIFY_IS_APPROX(x[0], 0.19280781);  // should be 1.9280693458E-01
+  VERIFY_IS_APPROX(x[1], 0.19126265);  // should be 1.9128232873E-01
+  VERIFY_IS_APPROX(x[2], 0.12305280);  // should be 1.2305650693E-01
+  VERIFY_IS_APPROX(x[3], 0.13605322);  // should be 1.3606233068E-01
 }
 
-
-
-struct Bennett5_functor : DenseFunctor<double>
-{
-    Bennett5_functor(void) : DenseFunctor<double>(3,154) {}
-    static const double x[154];
-    static const double y[154];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        assert(b.size()==3);
-        assert(fvec.size()==154);
-        for(int i=0; i<154; i++)
-            fvec[i] = b[0]* pow(b[1]+x[i],-1./b[2]) - y[i];
-        return 0;
+struct Bennett5_functor : DenseFunctor<double> {
+  Bennett5_functor(void) : DenseFunctor<double>(3, 154) {}
+  static const double x[154];
+  static const double y[154];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    assert(b.size() == 3);
+    assert(fvec.size() == 154);
+    for (int i = 0; i < 154; i++) fvec[i] = b[0] * pow(b[1] + x[i], -1. / b[2]) - y[i];
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 3);
+    assert(fjac.rows() == 154);
+    assert(fjac.cols() == 3);
+    for (int i = 0; i < 154; i++) {
+      double e = pow(b[1] + x[i], -1. / b[2]);
+      fjac(i, 0) = e;
+      fjac(i, 1) = -b[0] * e / b[2] / (b[1] + x[i]);
+      fjac(i, 2) = b[0] * e * log(b[1] + x[i]) / b[2] / b[2];
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==3);
-        assert(fjac.rows()==154);
-        assert(fjac.cols()==3);
-        for(int i=0; i<154; i++) {
-            double e = pow(b[1]+x[i],-1./b[2]);
-            fjac(i,0) = e;
-            fjac(i,1) = - b[0]*e/b[2]/(b[1]+x[i]);
-            fjac(i,2) = b[0]*e*log(b[1]+x[i])/b[2]/b[2];
-        }
-        return 0;
-    }
+    return 0;
+  }
 };
-const double Bennett5_functor::x[154] = { 7.447168E0, 8.102586E0, 8.452547E0, 8.711278E0, 8.916774E0, 9.087155E0, 9.232590E0, 9.359535E0, 9.472166E0, 9.573384E0, 9.665293E0, 9.749461E0, 9.827092E0, 9.899128E0, 9.966321E0, 10.029280E0, 10.088510E0, 10.144430E0, 10.197380E0, 10.247670E0, 10.295560E0, 10.341250E0, 10.384950E0, 10.426820E0, 10.467000E0, 10.505640E0, 10.542830E0, 10.578690E0, 10.613310E0, 10.646780E0, 10.679150E0, 10.710520E0, 10.740920E0, 10.770440E0, 10.799100E0, 10.826970E0, 10.854080E0, 10.880470E0, 10.906190E0, 10.931260E0, 10.955720E0, 10.979590E0, 11.002910E0, 11.025700E0, 11.047980E0, 11.069770E0, 11.091100E0, 11.111980E0, 11.132440E0, 11.152480E0, 11.172130E0, 11.191410E0, 11.210310E0, 11.228870E0, 11.247090E0, 11.264980E0, 11.282560E0, 11.299840E0, 11.316820E0, 11.333520E0, 11.349940E0, 11.366100E0, 11.382000E0, 11.397660E0, 11.413070E0, 11.428240E0, 11.443200E0, 11.457930E0, 11.472440E0, 11.486750E0, 11.500860E0, 11.514770E0, 11.528490E0, 11.542020E0, 11.555380E0, 11.568550E0,
-11.581560E0, 11.594420E0, 11.607121E0, 11.619640E0, 11.632000E0, 11.644210E0, 11.656280E0, 11.668200E0, 11.679980E0, 11.691620E0, 11.703130E0, 11.714510E0, 11.725760E0, 11.736880E0, 11.747890E0, 11.758780E0, 11.769550E0, 11.780200E0, 11.790730E0, 11.801160E0, 11.811480E0, 11.821700E0, 11.831810E0, 11.841820E0, 11.851730E0, 11.861550E0, 11.871270E0, 11.880890E0, 11.890420E0, 11.899870E0, 11.909220E0, 11.918490E0, 11.927680E0, 11.936780E0, 11.945790E0, 11.954730E0, 11.963590E0, 11.972370E0, 11.981070E0, 11.989700E0, 11.998260E0, 12.006740E0, 12.015150E0, 12.023490E0, 12.031760E0, 12.039970E0, 12.048100E0, 12.056170E0, 12.064180E0, 12.072120E0, 12.080010E0, 12.087820E0, 12.095580E0, 12.103280E0, 12.110920E0, 12.118500E0, 12.126030E0, 12.133500E0, 12.140910E0, 12.148270E0, 12.155570E0, 12.162830E0, 12.170030E0, 12.177170E0, 12.184270E0, 12.191320E0, 12.198320E0, 12.205270E0, 12.212170E0, 12.219030E0, 12.225840E0, 12.232600E0, 12.239320E0, 12.245990E0, 12.252620E0, 12.259200E0, 12.265750E0, 12.272240E0 };
-const double Bennett5_functor::y[154] = { -34.834702E0 ,-34.393200E0 ,-34.152901E0 ,-33.979099E0 ,-33.845901E0 ,-33.732899E0 ,-33.640301E0 ,-33.559200E0 ,-33.486801E0 ,-33.423100E0 ,-33.365101E0 ,-33.313000E0 ,-33.260899E0 ,-33.217400E0 ,-33.176899E0 ,-33.139198E0 ,-33.101601E0 ,-33.066799E0 ,-33.035000E0 ,-33.003101E0 ,-32.971298E0 ,-32.942299E0 ,-32.916302E0 ,-32.890202E0 ,-32.864101E0 ,-32.841000E0 ,-32.817799E0 ,-32.797501E0 ,-32.774300E0 ,-32.757000E0 ,-32.733799E0 ,-32.716400E0 ,-32.699100E0 ,-32.678799E0 ,-32.661400E0 ,-32.644001E0 ,-32.626701E0 ,-32.612202E0 ,-32.597698E0 ,-32.583199E0 ,-32.568699E0 ,-32.554298E0 ,-32.539799E0 ,-32.525299E0 ,-32.510799E0 ,-32.499199E0 ,-32.487598E0 ,-32.473202E0 ,-32.461601E0 ,-32.435501E0 ,-32.435501E0 ,-32.426800E0 ,-32.412300E0 ,-32.400799E0 ,-32.392101E0 ,-32.380501E0 ,-32.366001E0 ,-32.357300E0 ,-32.348598E0 ,-32.339901E0 ,-32.328400E0 ,-32.319698E0 ,-32.311001E0 ,-32.299400E0 ,-32.290699E0 ,-32.282001E0 ,-32.273300E0 ,-32.264599E0 ,-32.256001E0 ,-32.247299E0
-,-32.238602E0 ,-32.229900E0 ,-32.224098E0 ,-32.215401E0 ,-32.203800E0 ,-32.198002E0 ,-32.189400E0 ,-32.183601E0 ,-32.174900E0 ,-32.169102E0 ,-32.163300E0 ,-32.154598E0 ,-32.145901E0 ,-32.140099E0 ,-32.131401E0 ,-32.125599E0 ,-32.119801E0 ,-32.111198E0 ,-32.105400E0 ,-32.096699E0 ,-32.090900E0 ,-32.088001E0 ,-32.079300E0 ,-32.073502E0 ,-32.067699E0 ,-32.061901E0 ,-32.056099E0 ,-32.050301E0 ,-32.044498E0 ,-32.038799E0 ,-32.033001E0 ,-32.027199E0 ,-32.024300E0 ,-32.018501E0 ,-32.012699E0 ,-32.004002E0 ,-32.001099E0 ,-31.995300E0 ,-31.989500E0 ,-31.983700E0 ,-31.977900E0 ,-31.972099E0 ,-31.969299E0 ,-31.963501E0 ,-31.957701E0 ,-31.951900E0 ,-31.946100E0 ,-31.940300E0 ,-31.937401E0 ,-31.931601E0 ,-31.925800E0 ,-31.922899E0 ,-31.917101E0 ,-31.911301E0 ,-31.908400E0 ,-31.902599E0 ,-31.896900E0 ,-31.893999E0 ,-31.888201E0 ,-31.885300E0 ,-31.882401E0 ,-31.876600E0 ,-31.873699E0 ,-31.867901E0 ,-31.862101E0 ,-31.859200E0 ,-31.856300E0 ,-31.850500E0 ,-31.844700E0 ,-31.841801E0 ,-31.838900E0 ,-31.833099E0 ,-31.830200E0 ,
--31.827299E0 ,-31.821600E0 ,-31.818701E0 ,-31.812901E0 ,-31.809999E0 ,-31.807100E0 ,-31.801300E0 ,-31.798401E0 ,-31.795500E0 ,-31.789700E0 ,-31.786800E0 };
+const double Bennett5_functor::x[154] = {
+    7.447168E0,  8.102586E0,  8.452547E0,  8.711278E0,  8.916774E0,  9.087155E0,  9.232590E0,  9.359535E0,  9.472166E0,
+    9.573384E0,  9.665293E0,  9.749461E0,  9.827092E0,  9.899128E0,  9.966321E0,  10.029280E0, 10.088510E0, 10.144430E0,
+    10.197380E0, 10.247670E0, 10.295560E0, 10.341250E0, 10.384950E0, 10.426820E0, 10.467000E0, 10.505640E0, 10.542830E0,
+    10.578690E0, 10.613310E0, 10.646780E0, 10.679150E0, 10.710520E0, 10.740920E0, 10.770440E0, 10.799100E0, 10.826970E0,
+    10.854080E0, 10.880470E0, 10.906190E0, 10.931260E0, 10.955720E0, 10.979590E0, 11.002910E0, 11.025700E0, 11.047980E0,
+    11.069770E0, 11.091100E0, 11.111980E0, 11.132440E0, 11.152480E0, 11.172130E0, 11.191410E0, 11.210310E0, 11.228870E0,
+    11.247090E0, 11.264980E0, 11.282560E0, 11.299840E0, 11.316820E0, 11.333520E0, 11.349940E0, 11.366100E0, 11.382000E0,
+    11.397660E0, 11.413070E0, 11.428240E0, 11.443200E0, 11.457930E0, 11.472440E0, 11.486750E0, 11.500860E0, 11.514770E0,
+    11.528490E0, 11.542020E0, 11.555380E0, 11.568550E0, 11.581560E0, 11.594420E0, 11.607121E0, 11.619640E0, 11.632000E0,
+    11.644210E0, 11.656280E0, 11.668200E0, 11.679980E0, 11.691620E0, 11.703130E0, 11.714510E0, 11.725760E0, 11.736880E0,
+    11.747890E0, 11.758780E0, 11.769550E0, 11.780200E0, 11.790730E0, 11.801160E0, 11.811480E0, 11.821700E0, 11.831810E0,
+    11.841820E0, 11.851730E0, 11.861550E0, 11.871270E0, 11.880890E0, 11.890420E0, 11.899870E0, 11.909220E0, 11.918490E0,
+    11.927680E0, 11.936780E0, 11.945790E0, 11.954730E0, 11.963590E0, 11.972370E0, 11.981070E0, 11.989700E0, 11.998260E0,
+    12.006740E0, 12.015150E0, 12.023490E0, 12.031760E0, 12.039970E0, 12.048100E0, 12.056170E0, 12.064180E0, 12.072120E0,
+    12.080010E0, 12.087820E0, 12.095580E0, 12.103280E0, 12.110920E0, 12.118500E0, 12.126030E0, 12.133500E0, 12.140910E0,
+    12.148270E0, 12.155570E0, 12.162830E0, 12.170030E0, 12.177170E0, 12.184270E0, 12.191320E0, 12.198320E0, 12.205270E0,
+    12.212170E0, 12.219030E0, 12.225840E0, 12.232600E0, 12.239320E0, 12.245990E0, 12.252620E0, 12.259200E0, 12.265750E0,
+    12.272240E0};
+const double Bennett5_functor::y[154] = {
+    -34.834702E0, -34.393200E0, -34.152901E0, -33.979099E0, -33.845901E0, -33.732899E0, -33.640301E0, -33.559200E0,
+    -33.486801E0, -33.423100E0, -33.365101E0, -33.313000E0, -33.260899E0, -33.217400E0, -33.176899E0, -33.139198E0,
+    -33.101601E0, -33.066799E0, -33.035000E0, -33.003101E0, -32.971298E0, -32.942299E0, -32.916302E0, -32.890202E0,
+    -32.864101E0, -32.841000E0, -32.817799E0, -32.797501E0, -32.774300E0, -32.757000E0, -32.733799E0, -32.716400E0,
+    -32.699100E0, -32.678799E0, -32.661400E0, -32.644001E0, -32.626701E0, -32.612202E0, -32.597698E0, -32.583199E0,
+    -32.568699E0, -32.554298E0, -32.539799E0, -32.525299E0, -32.510799E0, -32.499199E0, -32.487598E0, -32.473202E0,
+    -32.461601E0, -32.435501E0, -32.435501E0, -32.426800E0, -32.412300E0, -32.400799E0, -32.392101E0, -32.380501E0,
+    -32.366001E0, -32.357300E0, -32.348598E0, -32.339901E0, -32.328400E0, -32.319698E0, -32.311001E0, -32.299400E0,
+    -32.290699E0, -32.282001E0, -32.273300E0, -32.264599E0, -32.256001E0, -32.247299E0, -32.238602E0, -32.229900E0,
+    -32.224098E0, -32.215401E0, -32.203800E0, -32.198002E0, -32.189400E0, -32.183601E0, -32.174900E0, -32.169102E0,
+    -32.163300E0, -32.154598E0, -32.145901E0, -32.140099E0, -32.131401E0, -32.125599E0, -32.119801E0, -32.111198E0,
+    -32.105400E0, -32.096699E0, -32.090900E0, -32.088001E0, -32.079300E0, -32.073502E0, -32.067699E0, -32.061901E0,
+    -32.056099E0, -32.050301E0, -32.044498E0, -32.038799E0, -32.033001E0, -32.027199E0, -32.024300E0, -32.018501E0,
+    -32.012699E0, -32.004002E0, -32.001099E0, -31.995300E0, -31.989500E0, -31.983700E0, -31.977900E0, -31.972099E0,
+    -31.969299E0, -31.963501E0, -31.957701E0, -31.951900E0, -31.946100E0, -31.940300E0, -31.937401E0, -31.931601E0,
+    -31.925800E0, -31.922899E0, -31.917101E0, -31.911301E0, -31.908400E0, -31.902599E0, -31.896900E0, -31.893999E0,
+    -31.888201E0, -31.885300E0, -31.882401E0, -31.876600E0, -31.873699E0, -31.867901E0, -31.862101E0, -31.859200E0,
+    -31.856300E0, -31.850500E0, -31.844700E0, -31.841801E0, -31.838900E0, -31.833099E0, -31.830200E0, -31.827299E0,
+    -31.821600E0, -31.818701E0, -31.812901E0, -31.809999E0, -31.807100E0, -31.801300E0, -31.798401E0, -31.795500E0,
+    -31.789700E0, -31.786800E0};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/bennett5.shtml
-void testNistBennett5(void)
-{
-  const int  n=3;
+void testNistBennett5(void) {
+  const int n = 3;
   int info;
 
   VectorXd x(n);
@@ -1166,7 +1211,7 @@
   /*
    * First try
    */
-  x<< -2000., 50., 0.8;
+  x << -2000., 50., 0.8;
   // do the computation
   Bennett5_functor functor;
   LevenbergMarquardt<Bennett5_functor> lm(functor);
@@ -1187,7 +1232,7 @@
   /*
    * Second try
    */
-  x<< -1500., 45., 0.85;
+  x << -1500., 45., 0.85;
   // do the computation
   lm.resetParameters();
   info = lm.minimize(x);
@@ -1200,54 +1245,60 @@
   // check norm^2
   VERIFY_IS_APPROX(lm.fvec().squaredNorm(), 5.2404744073E-04);
   // check x
-  VERIFY_IS_APPROX(x[0], -2523.3007865); // should be -2.5235058043E+03
-  VERIFY_IS_APPROX(x[1], 46.735705771); // should be 4.6736564644E+01);
-  VERIFY_IS_APPROX(x[2], 0.93219881891); // should be 9.3218483193E-01);
+  VERIFY_IS_APPROX(x[0], -2523.3007865);  // should be -2.5235058043E+03
+  VERIFY_IS_APPROX(x[1], 46.735705771);   // should be 4.6736564644E+01);
+  VERIFY_IS_APPROX(x[2], 0.93219881891);  // should be 9.3218483193E-01);
 }
 
-struct thurber_functor : DenseFunctor<double>
-{
-    thurber_functor(void) : DenseFunctor<double>(7,37) {}
-    static const double _x[37];
-    static const double _y[37];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        //        int called=0; printf("call hahn1_functor with  iflag=%d, called=%d\n", iflag, called); if (iflag==1) called++;
-        assert(b.size()==7);
-        assert(fvec.size()==37);
-        for(int i=0; i<37; i++) {
-            double x=_x[i], xx=x*x, xxx=xx*x;
-            fvec[i] = (b[0]+b[1]*x+b[2]*xx+b[3]*xxx) / (1.+b[4]*x+b[5]*xx+b[6]*xxx) - _y[i];
-        }
-        return 0;
+struct thurber_functor : DenseFunctor<double> {
+  thurber_functor(void) : DenseFunctor<double>(7, 37) {}
+  static const double _x[37];
+  static const double _y[37];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    //        int called=0; printf("call hahn1_functor with  iflag=%d, called=%d\n", iflag, called); if (iflag==1)
+    //        called++;
+    assert(b.size() == 7);
+    assert(fvec.size() == 37);
+    for (int i = 0; i < 37; i++) {
+      double x = _x[i], xx = x * x, xxx = xx * x;
+      fvec[i] = (b[0] + b[1] * x + b[2] * xx + b[3] * xxx) / (1. + b[4] * x + b[5] * xx + b[6] * xxx) - _y[i];
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==7);
-        assert(fjac.rows()==37);
-        assert(fjac.cols()==7);
-        for(int i=0; i<37; i++) {
-            double x=_x[i], xx=x*x, xxx=xx*x;
-            double fact = 1./(1.+b[4]*x+b[5]*xx+b[6]*xxx);
-            fjac(i,0) = 1.*fact;
-            fjac(i,1) = x*fact;
-            fjac(i,2) = xx*fact;
-            fjac(i,3) = xxx*fact;
-            fact = - (b[0]+b[1]*x+b[2]*xx+b[3]*xxx) * fact * fact;
-            fjac(i,4) = x*fact;
-            fjac(i,5) = xx*fact;
-            fjac(i,6) = xxx*fact;
-        }
-        return 0;
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 7);
+    assert(fjac.rows() == 37);
+    assert(fjac.cols() == 7);
+    for (int i = 0; i < 37; i++) {
+      double x = _x[i], xx = x * x, xxx = xx * x;
+      double fact = 1. / (1. + b[4] * x + b[5] * xx + b[6] * xxx);
+      fjac(i, 0) = 1. * fact;
+      fjac(i, 1) = x * fact;
+      fjac(i, 2) = xx * fact;
+      fjac(i, 3) = xxx * fact;
+      fact = -(b[0] + b[1] * x + b[2] * xx + b[3] * xxx) * fact * fact;
+      fjac(i, 4) = x * fact;
+      fjac(i, 5) = xx * fact;
+      fjac(i, 6) = xxx * fact;
     }
+    return 0;
+  }
 };
-const double thurber_functor::_x[37] = { -3.067E0, -2.981E0, -2.921E0, -2.912E0, -2.840E0, -2.797E0, -2.702E0, -2.699E0, -2.633E0, -2.481E0, -2.363E0, -2.322E0, -1.501E0, -1.460E0, -1.274E0, -1.212E0, -1.100E0, -1.046E0, -0.915E0, -0.714E0, -0.566E0, -0.545E0, -0.400E0, -0.309E0, -0.109E0, -0.103E0, 0.010E0, 0.119E0, 0.377E0, 0.790E0, 0.963E0, 1.006E0, 1.115E0, 1.572E0, 1.841E0, 2.047E0, 2.200E0 };
-const double thurber_functor::_y[37] = { 80.574E0, 84.248E0, 87.264E0, 87.195E0, 89.076E0, 89.608E0, 89.868E0, 90.101E0, 92.405E0, 95.854E0, 100.696E0, 101.060E0, 401.672E0, 390.724E0, 567.534E0, 635.316E0, 733.054E0, 759.087E0, 894.206E0, 990.785E0, 1090.109E0, 1080.914E0, 1122.643E0, 1178.351E0, 1260.531E0, 1273.514E0, 1288.339E0, 1327.543E0, 1353.863E0, 1414.509E0, 1425.208E0, 1421.384E0, 1442.962E0, 1464.350E0, 1468.705E0, 1447.894E0, 1457.628E0};
+const double thurber_functor::_x[37] = {-3.067E0, -2.981E0, -2.921E0, -2.912E0, -2.840E0, -2.797E0, -2.702E0, -2.699E0,
+                                        -2.633E0, -2.481E0, -2.363E0, -2.322E0, -1.501E0, -1.460E0, -1.274E0, -1.212E0,
+                                        -1.100E0, -1.046E0, -0.915E0, -0.714E0, -0.566E0, -0.545E0, -0.400E0, -0.309E0,
+                                        -0.109E0, -0.103E0, 0.010E0,  0.119E0,  0.377E0,  0.790E0,  0.963E0,  1.006E0,
+                                        1.115E0,  1.572E0,  1.841E0,  2.047E0,  2.200E0};
+const double thurber_functor::_y[37] = {
+    80.574E0,   84.248E0,   87.264E0,   87.195E0,   89.076E0,   89.608E0,   89.868E0,   90.101E0,
+    92.405E0,   95.854E0,   100.696E0,  101.060E0,  401.672E0,  390.724E0,  567.534E0,  635.316E0,
+    733.054E0,  759.087E0,  894.206E0,  990.785E0,  1090.109E0, 1080.914E0, 1122.643E0, 1178.351E0,
+    1260.531E0, 1273.514E0, 1288.339E0, 1327.543E0, 1353.863E0, 1414.509E0, 1425.208E0, 1421.384E0,
+    1442.962E0, 1464.350E0, 1468.705E0, 1447.894E0, 1457.628E0};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/thurber.shtml
-void testNistThurber(void)
-{
-  const int n=7;
+void testNistThurber(void) {
+  const int n = 7;
   int info;
 
   VectorXd x(n);
@@ -1255,12 +1306,12 @@
   /*
    * First try
    */
-  x<< 1000 ,1000 ,400 ,40 ,0.7,0.3,0.0 ;
+  x << 1000, 1000, 400, 40, 0.7, 0.3, 0.0;
   // do the computation
   thurber_functor functor;
   LevenbergMarquardt<thurber_functor> lm(functor);
-  lm.setFtol(1.E4*NumTraits<double>::epsilon());
-  lm.setXtol(1.E4*NumTraits<double>::epsilon());
+  lm.setFtol(1.E4 * NumTraits<double>::epsilon());
+  lm.setXtol(1.E4 * NumTraits<double>::epsilon());
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
 
@@ -1282,11 +1333,11 @@
   /*
    * Second try
    */
-  x<< 1300 ,1500 ,500  ,75   ,1    ,0.4  ,0.05  ;
+  x << 1300, 1500, 500, 75, 1, 0.4, 0.05;
   // do the computation
   lm.resetParameters();
-  lm.setFtol(1.E4*NumTraits<double>::epsilon());
-  lm.setXtol(1.E4*NumTraits<double>::epsilon());
+  lm.setFtol(1.E4 * NumTraits<double>::epsilon());
+  lm.setXtol(1.E4 * NumTraits<double>::epsilon());
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
 
@@ -1306,42 +1357,38 @@
   VERIFY_IS_APPROX(x[6], 4.9727297349E-02);
 }
 
-struct rat43_functor : DenseFunctor<double>
-{
-    rat43_functor(void) : DenseFunctor<double>(4,15) {}
-    static const double x[15];
-    static const double y[15];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        assert(b.size()==4);
-        assert(fvec.size()==15);
-        for(int i=0; i<15; i++)
-            fvec[i] = b[0] * pow(1.+exp(b[1]-b[2]*x[i]),-1./b[3]) - y[i];
-        return 0;
+struct rat43_functor : DenseFunctor<double> {
+  rat43_functor(void) : DenseFunctor<double>(4, 15) {}
+  static const double x[15];
+  static const double y[15];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    assert(b.size() == 4);
+    assert(fvec.size() == 15);
+    for (int i = 0; i < 15; i++) fvec[i] = b[0] * pow(1. + exp(b[1] - b[2] * x[i]), -1. / b[3]) - y[i];
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 4);
+    assert(fjac.rows() == 15);
+    assert(fjac.cols() == 4);
+    for (int i = 0; i < 15; i++) {
+      double e = exp(b[1] - b[2] * x[i]);
+      double power = -1. / b[3];
+      fjac(i, 0) = pow(1. + e, power);
+      fjac(i, 1) = power * b[0] * e * pow(1. + e, power - 1.);
+      fjac(i, 2) = -power * b[0] * e * x[i] * pow(1. + e, power - 1.);
+      fjac(i, 3) = b[0] * power * power * log(1. + e) * pow(1. + e, power);
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==4);
-        assert(fjac.rows()==15);
-        assert(fjac.cols()==4);
-        for(int i=0; i<15; i++) {
-            double e = exp(b[1]-b[2]*x[i]);
-            double power = -1./b[3];
-            fjac(i,0) = pow(1.+e, power);
-            fjac(i,1) = power*b[0]*e*pow(1.+e, power-1.);
-            fjac(i,2) = -power*b[0]*e*x[i]*pow(1.+e, power-1.);
-            fjac(i,3) = b[0]*power*power*log(1.+e)*pow(1.+e, power);
-        }
-        return 0;
-    }
+    return 0;
+  }
 };
-const double rat43_functor::x[15] = { 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15. };
-const double rat43_functor::y[15] = { 16.08, 33.83, 65.80, 97.20, 191.55, 326.20, 386.87, 520.53, 590.03, 651.92, 724.93, 699.56, 689.96, 637.56, 717.41 };
+const double rat43_functor::x[15] = {1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.};
+const double rat43_functor::y[15] = {16.08,  33.83,  65.80,  97.20,  191.55, 326.20, 386.87, 520.53,
+                                     590.03, 651.92, 724.93, 699.56, 689.96, 637.56, 717.41};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/ratkowsky3.shtml
-void testNistRat43(void)
-{
-  const int n=4;
+void testNistRat43(void) {
+  const int n = 4;
   int info;
 
   VectorXd x(n);
@@ -1349,12 +1396,12 @@
   /*
    * First try
    */
-  x<< 100., 10., 1., 1.;
+  x << 100., 10., 1., 1.;
   // do the computation
   rat43_functor functor;
   LevenbergMarquardt<rat43_functor> lm(functor);
-  lm.setFtol(1.E6*NumTraits<double>::epsilon());
-  lm.setXtol(1.E6*NumTraits<double>::epsilon());
+  lm.setFtol(1.E6 * NumTraits<double>::epsilon());
+  lm.setXtol(1.E6 * NumTraits<double>::epsilon());
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
 
@@ -1373,11 +1420,11 @@
   /*
    * Second try
    */
-  x<< 700., 5., 0.75, 1.3;
+  x << 700., 5., 0.75, 1.3;
   // do the computation
   lm.resetParameters();
-  lm.setFtol(1.E5*NumTraits<double>::epsilon());
-  lm.setXtol(1.E5*NumTraits<double>::epsilon());
+  lm.setFtol(1.E5 * NumTraits<double>::epsilon());
+  lm.setXtol(1.E5 * NumTraits<double>::epsilon());
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
 
@@ -1394,43 +1441,44 @@
   VERIFY_IS_APPROX(x[3], 1.2792483859E+00);
 }
 
-
-
-struct eckerle4_functor : DenseFunctor<double>
-{
-    eckerle4_functor(void) : DenseFunctor<double>(3,35) {}
-    static const double x[35];
-    static const double y[35];
-    int operator()(const VectorXd &b, VectorXd &fvec)
-    {
-        assert(b.size()==3);
-        assert(fvec.size()==35);
-        for(int i=0; i<35; i++)
-            fvec[i] = b[0]/b[1] * exp(-0.5*(x[i]-b[2])*(x[i]-b[2])/(b[1]*b[1])) - y[i];
-        return 0;
+struct eckerle4_functor : DenseFunctor<double> {
+  eckerle4_functor(void) : DenseFunctor<double>(3, 35) {}
+  static const double x[35];
+  static const double y[35];
+  int operator()(const VectorXd &b, VectorXd &fvec) {
+    assert(b.size() == 3);
+    assert(fvec.size() == 35);
+    for (int i = 0; i < 35; i++)
+      fvec[i] = b[0] / b[1] * exp(-0.5 * (x[i] - b[2]) * (x[i] - b[2]) / (b[1] * b[1])) - y[i];
+    return 0;
+  }
+  int df(const VectorXd &b, MatrixXd &fjac) {
+    assert(b.size() == 3);
+    assert(fjac.rows() == 35);
+    assert(fjac.cols() == 3);
+    for (int i = 0; i < 35; i++) {
+      double b12 = b[1] * b[1];
+      double e = exp(-0.5 * (x[i] - b[2]) * (x[i] - b[2]) / b12);
+      fjac(i, 0) = e / b[1];
+      fjac(i, 1) = ((x[i] - b[2]) * (x[i] - b[2]) / b12 - 1.) * b[0] * e / b12;
+      fjac(i, 2) = (x[i] - b[2]) * e * b[0] / b[1] / b12;
     }
-    int df(const VectorXd &b, MatrixXd &fjac)
-    {
-        assert(b.size()==3);
-        assert(fjac.rows()==35);
-        assert(fjac.cols()==3);
-        for(int i=0; i<35; i++) {
-            double b12 = b[1]*b[1];
-            double e = exp(-0.5*(x[i]-b[2])*(x[i]-b[2])/b12);
-            fjac(i,0) = e / b[1];
-            fjac(i,1) = ((x[i]-b[2])*(x[i]-b[2])/b12-1.) * b[0]*e/b12;
-            fjac(i,2) = (x[i]-b[2])*e*b[0]/b[1]/b12;
-        }
-        return 0;
-    }
+    return 0;
+  }
 };
-const double eckerle4_functor::x[35] = { 400.0, 405.0, 410.0, 415.0, 420.0, 425.0, 430.0, 435.0, 436.5, 438.0, 439.5, 441.0, 442.5, 444.0, 445.5, 447.0, 448.5, 450.0, 451.5, 453.0, 454.5, 456.0, 457.5, 459.0, 460.5, 462.0, 463.5, 465.0, 470.0, 475.0, 480.0, 485.0, 490.0, 495.0, 500.0};
-const double eckerle4_functor::y[35] = { 0.0001575, 0.0001699, 0.0002350, 0.0003102, 0.0004917, 0.0008710, 0.0017418, 0.0046400, 0.0065895, 0.0097302, 0.0149002, 0.0237310, 0.0401683, 0.0712559, 0.1264458, 0.2073413, 0.2902366, 0.3445623, 0.3698049, 0.3668534, 0.3106727, 0.2078154, 0.1164354, 0.0616764, 0.0337200, 0.0194023, 0.0117831, 0.0074357, 0.0022732, 0.0008800, 0.0004579, 0.0002345, 0.0001586, 0.0001143, 0.0000710 };
+const double eckerle4_functor::x[35] = {400.0, 405.0, 410.0, 415.0, 420.0, 425.0, 430.0, 435.0, 436.5,
+                                        438.0, 439.5, 441.0, 442.5, 444.0, 445.5, 447.0, 448.5, 450.0,
+                                        451.5, 453.0, 454.5, 456.0, 457.5, 459.0, 460.5, 462.0, 463.5,
+                                        465.0, 470.0, 475.0, 480.0, 485.0, 490.0, 495.0, 500.0};
+const double eckerle4_functor::y[35] = {0.0001575, 0.0001699, 0.0002350, 0.0003102, 0.0004917, 0.0008710, 0.0017418,
+                                        0.0046400, 0.0065895, 0.0097302, 0.0149002, 0.0237310, 0.0401683, 0.0712559,
+                                        0.1264458, 0.2073413, 0.2902366, 0.3445623, 0.3698049, 0.3668534, 0.3106727,
+                                        0.2078154, 0.1164354, 0.0616764, 0.0337200, 0.0194023, 0.0117831, 0.0074357,
+                                        0.0022732, 0.0008800, 0.0004579, 0.0002345, 0.0001586, 0.0001143, 0.0000710};
 
 // http://www.itl.nist.gov/div898/strd/nls/data/eckerle4.shtml
-void testNistEckerle4(void)
-{
-  const int n=3;
+void testNistEckerle4(void) {
+  const int n = 3;
   int info;
 
   VectorXd x(n);
@@ -1438,7 +1486,7 @@
   /*
    * First try
    */
-  x<< 1., 10., 500.;
+  x << 1., 10., 500.;
   // do the computation
   eckerle4_functor functor;
   LevenbergMarquardt<eckerle4_functor> lm(functor);
@@ -1459,7 +1507,7 @@
   /*
    * Second try
    */
-  x<< 1.5, 5., 450.;
+  x << 1.5, 5., 450.;
   // do the computation
   info = lm.minimize(x);
   EIGEN_UNUSED_VARIABLE(info)
@@ -1476,33 +1524,32 @@
   VERIFY_IS_APPROX(x[2], 4.5154121844E+02);
 }
 
-EIGEN_DECLARE_TEST(levenberg_marquardt)
-{
-    // Tests using the examples provided by (c)minpack
-    CALL_SUBTEST(testLmder1());
-    CALL_SUBTEST(testLmder());
-    CALL_SUBTEST(testLmdif1());
-//     CALL_SUBTEST(testLmstr1());
-//     CALL_SUBTEST(testLmstr());
-    CALL_SUBTEST(testLmdif());
+EIGEN_DECLARE_TEST(levenberg_marquardt) {
+  // Tests using the examples provided by (c)minpack
+  CALL_SUBTEST(testLmder1());
+  CALL_SUBTEST(testLmder());
+  CALL_SUBTEST(testLmdif1());
+  //     CALL_SUBTEST(testLmstr1());
+  //     CALL_SUBTEST(testLmstr());
+  CALL_SUBTEST(testLmdif());
 
-    // NIST tests, level of difficulty = "Lower"
-    CALL_SUBTEST(testNistMisra1a());
-    CALL_SUBTEST(testNistChwirut2());
+  // NIST tests, level of difficulty = "Lower"
+  CALL_SUBTEST(testNistMisra1a());
+  CALL_SUBTEST(testNistChwirut2());
 
-    // NIST tests, level of difficulty = "Average"
-    CALL_SUBTEST(testNistHahn1());
-    CALL_SUBTEST(testNistMisra1d());
-    CALL_SUBTEST(testNistMGH17());
-    CALL_SUBTEST(testNistLanczos1());
+  // NIST tests, level of difficulty = "Average"
+  CALL_SUBTEST(testNistHahn1());
+  CALL_SUBTEST(testNistMisra1d());
+  CALL_SUBTEST(testNistMGH17());
+  CALL_SUBTEST(testNistLanczos1());
 
-//     // NIST tests, level of difficulty = "Higher"
-    CALL_SUBTEST(testNistRat42());
-    CALL_SUBTEST(testNistMGH10());
-    CALL_SUBTEST(testNistBoxBOD());
-//     CALL_SUBTEST(testNistMGH09());
-    CALL_SUBTEST(testNistBennett5());
-    CALL_SUBTEST(testNistThurber());
-    CALL_SUBTEST(testNistRat43());
-    CALL_SUBTEST(testNistEckerle4());
+  //     // NIST tests, level of difficulty = "Higher"
+  CALL_SUBTEST(testNistRat42());
+  CALL_SUBTEST(testNistMGH10());
+  CALL_SUBTEST(testNistBoxBOD());
+  //     CALL_SUBTEST(testNistMGH09());
+  CALL_SUBTEST(testNistBennett5());
+  CALL_SUBTEST(testNistThurber());
+  CALL_SUBTEST(testNistRat43());
+  CALL_SUBTEST(testNistEckerle4());
 }
diff --git a/unsupported/test/matrix_exponential.cpp b/unsupported/test/matrix_exponential.cpp
index b032cbf..0a52169 100644
--- a/unsupported/test/matrix_exponential.cpp
+++ b/unsupported/test/matrix_exponential.cpp
@@ -9,56 +9,49 @@
 
 #include "matrix_functions.h"
 
-double binom(int n, int k)
-{
+double binom(int n, int k) {
   double res = 1;
-  for (int i=0; i<k; i++)
-    res = res * (n-k+i+1) / (i+1);
+  for (int i = 0; i < k; i++) res = res * (n - k + i + 1) / (i + 1);
   return res;
 }
 
 template <typename T>
-T expfn(T x, int)
-{
+T expfn(T x, int) {
   return std::exp(x);
 }
 
 template <typename T>
-void test2dRotation(double tol)
-{
-  Matrix<T,2,2> A, B, C;
+void test2dRotation(double tol) {
+  Matrix<T, 2, 2> A, B, C;
   T angle;
 
   A << 0, 1, -1, 0;
-  for (int i=0; i<=20; i++)
-  {
+  for (int i = 0; i <= 20; i++) {
     angle = static_cast<T>(pow(10, i / 5. - 2));
     B << std::cos(angle), std::sin(angle), -std::sin(angle), std::cos(angle);
 
-    C = (angle*A).matrixFunction(expfn);
+    C = (angle * A).matrixFunction(expfn);
     std::cout << "test2dRotation: i = " << i << "   error funm = " << relerr(C, B);
     VERIFY(C.isApprox(B, static_cast<T>(tol)));
 
-    C = (angle*A).exp();
+    C = (angle * A).exp();
     std::cout << "   error expm = " << relerr(C, B) << "\n";
     VERIFY(C.isApprox(B, static_cast<T>(tol)));
   }
 }
 
 template <typename T>
-void test2dHyperbolicRotation(double tol)
-{
-  Matrix<std::complex<T>,2,2> A, B, C;
-  std::complex<T> imagUnit(0,1);
+void test2dHyperbolicRotation(double tol) {
+  Matrix<std::complex<T>, 2, 2> A, B, C;
+  std::complex<T> imagUnit(0, 1);
   T angle, ch, sh;
 
-  for (int i=0; i<=20; i++)
-  {
-    angle = static_cast<T>((i-10) / 2.0);
+  for (int i = 0; i <= 20; i++) {
+    angle = static_cast<T>((i - 10) / 2.0);
     ch = std::cosh(angle);
     sh = std::sinh(angle);
-    A << 0, angle*imagUnit, -angle*imagUnit, 0;
-    B << ch, sh*imagUnit, -sh*imagUnit, ch;
+    A << 0, angle * imagUnit, -angle * imagUnit, 0;
+    B << ch, sh * imagUnit, -sh * imagUnit, ch;
 
     C = A.matrixFunction(expfn);
     std::cout << "test2dHyperbolicRotation: i = " << i << "   error funm = " << relerr(C, B);
@@ -71,18 +64,14 @@
 }
 
 template <typename T>
-void testPascal(double tol)
-{
-  for (int size=1; size<20; size++)
-  {
-    Matrix<T,Dynamic,Dynamic> A(size,size), B(size,size), C(size,size);
+void testPascal(double tol) {
+  for (int size = 1; size < 20; size++) {
+    Matrix<T, Dynamic, Dynamic> A(size, size), B(size, size), C(size, size);
     A.setZero();
-    for (int i=0; i<size-1; i++)
-      A(i+1,i) = static_cast<T>(i+1);
+    for (int i = 0; i < size - 1; i++) A(i + 1, i) = static_cast<T>(i + 1);
     B.setZero();
-    for (int i=0; i<size; i++)
-      for (int j=0; j<=i; j++)
-    B(i,j) = static_cast<T>(binom(i,j));
+    for (int i = 0; i < size; i++)
+      for (int j = 0; j <= i; j++) B(i, j) = static_cast<T>(binom(i, j));
 
     C = A.matrixFunction(expfn);
     std::cout << "testPascal: size = " << size << "   error funm = " << relerr(C, B);
@@ -94,9 +83,8 @@
   }
 }
 
-template<typename MatrixType>
-void randomTest(const MatrixType& m, double tol)
-{
+template <typename MatrixType>
+void randomTest(const MatrixType& m, double tol) {
   /* this test covers the following files:
      Inverse.h
   */
@@ -106,7 +94,7 @@
 
   typedef typename NumTraits<typename internal::traits<MatrixType>::Scalar>::Real RealScalar;
 
-  for(int i = 0; i < g_repeat; i++) {
+  for (int i = 0; i < g_repeat; i++) {
     m1 = MatrixType::Random(rows, cols);
 
     m2 = m1.matrixFunction(expfn) * (-m1).matrixFunction(expfn);
@@ -119,23 +107,22 @@
   }
 }
 
-EIGEN_DECLARE_TEST(matrix_exponential)
-{
+EIGEN_DECLARE_TEST(matrix_exponential) {
   CALL_SUBTEST_2(test2dRotation<double>(1e-13));
   CALL_SUBTEST_1(test2dRotation<float>(2e-5));  // was 1e-5, relaxed for clang 2.8 / linux / x86-64
-  CALL_SUBTEST_8(test2dRotation<long double>(1e-13)); 
+  CALL_SUBTEST_8(test2dRotation<long double>(1e-13));
   CALL_SUBTEST_2(test2dHyperbolicRotation<double>(1e-14));
   CALL_SUBTEST_1(test2dHyperbolicRotation<float>(1e-5));
   CALL_SUBTEST_8(test2dHyperbolicRotation<long double>(1e-14));
   CALL_SUBTEST_6(testPascal<float>(1e-6));
   CALL_SUBTEST_5(testPascal<double>(1e-15));
   CALL_SUBTEST_2(randomTest(Matrix2d(), 1e-13));
-  CALL_SUBTEST_7(randomTest(Matrix<double,3,3,RowMajor>(), 1e-13));
+  CALL_SUBTEST_7(randomTest(Matrix<double, 3, 3, RowMajor>(), 1e-13));
   CALL_SUBTEST_3(randomTest(Matrix4cd(), 1e-13));
-  CALL_SUBTEST_4(randomTest(MatrixXd(8,8), 1e-13));
+  CALL_SUBTEST_4(randomTest(MatrixXd(8, 8), 1e-13));
   CALL_SUBTEST_1(randomTest(Matrix2f(), 1e-4));
   CALL_SUBTEST_5(randomTest(Matrix3cf(), 1e-4));
   CALL_SUBTEST_1(randomTest(Matrix4f(), 1e-4));
-  CALL_SUBTEST_6(randomTest(MatrixXf(8,8), 1e-4));
-  CALL_SUBTEST_9(randomTest(Matrix<long double,Dynamic,Dynamic>(7,7), 1e-13));
+  CALL_SUBTEST_6(randomTest(MatrixXf(8, 8), 1e-4));
+  CALL_SUBTEST_9(randomTest(Matrix<long double, Dynamic, Dynamic>(7, 7), 1e-13));
 }
diff --git a/unsupported/test/matrix_function.cpp b/unsupported/test/matrix_function.cpp
index 6d75373..6588527 100644
--- a/unsupported/test/matrix_function.cpp
+++ b/unsupported/test/matrix_function.cpp
@@ -14,23 +14,20 @@
 // relative error.
 #define VERIFY_IS_APPROX_ABS(a, b) VERIFY(test_isApprox_abs(a, b))
 
-template<typename Type1, typename Type2>
-inline bool test_isApprox_abs(const Type1& a, const Type2& b)
-{
-  return ((a-b).array().abs() < test_precision<typename Type1::RealScalar>()).all();
+template <typename Type1, typename Type2>
+inline bool test_isApprox_abs(const Type1& a, const Type2& b) {
+  return ((a - b).array().abs() < test_precision<typename Type1::RealScalar>()).all();
 }
 
-
 // Returns a matrix with eigenvalues clustered around 0, 1 and 2.
-template<typename MatrixType>
-MatrixType randomMatrixWithRealEivals(const Index size)
-{
+template <typename MatrixType>
+MatrixType randomMatrixWithRealEivals(const Index size) {
   typedef typename MatrixType::Scalar Scalar;
   typedef typename MatrixType::RealScalar RealScalar;
   MatrixType diag = MatrixType::Zero(size, size);
   for (Index i = 0; i < size; ++i) {
-    diag(i, i) = Scalar(RealScalar(internal::random<int>(0,2)))
-      + internal::random<Scalar>() * Scalar(RealScalar(0.01));
+    diag(i, i) =
+        Scalar(RealScalar(internal::random<int>(0, 2))) + internal::random<Scalar>() * Scalar(RealScalar(0.01));
   }
   MatrixType A = MatrixType::Random(size, size);
   HouseholderQR<MatrixType> QRofA(A);
@@ -38,30 +35,27 @@
 }
 
 template <typename MatrixType, int IsComplex = NumTraits<typename internal::traits<MatrixType>::Scalar>::IsComplex>
-struct randomMatrixWithImagEivals
-{
+struct randomMatrixWithImagEivals {
   // Returns a matrix with eigenvalues clustered around 0 and +/- i.
   static MatrixType run(const Index size);
 };
 
 // Partial specialization for real matrices
-template<typename MatrixType>
-struct randomMatrixWithImagEivals<MatrixType, 0>
-{
-  static MatrixType run(const Index size)
-  {
+template <typename MatrixType>
+struct randomMatrixWithImagEivals<MatrixType, 0> {
+  static MatrixType run(const Index size) {
     typedef typename MatrixType::Scalar Scalar;
     MatrixType diag = MatrixType::Zero(size, size);
     Index i = 0;
     while (i < size) {
       Index randomInt = internal::random<Index>(-1, 1);
-      if (randomInt == 0 || i == size-1) {
+      if (randomInt == 0 || i == size - 1) {
         diag(i, i) = internal::random<Scalar>() * Scalar(0.01);
         ++i;
       } else {
         Scalar alpha = Scalar(randomInt) + internal::random<Scalar>() * Scalar(0.01);
-        diag(i, i+1) = alpha;
-        diag(i+1, i) = -alpha;
+        diag(i, i + 1) = alpha;
+        diag(i + 1, i) = -alpha;
         i += 2;
       }
     }
@@ -72,18 +66,16 @@
 };
 
 // Partial specialization for complex matrices
-template<typename MatrixType>
-struct randomMatrixWithImagEivals<MatrixType, 1>
-{
-  static MatrixType run(const Index size)
-  {
+template <typename MatrixType>
+struct randomMatrixWithImagEivals<MatrixType, 1> {
+  static MatrixType run(const Index size) {
     typedef typename MatrixType::Scalar Scalar;
     typedef typename MatrixType::RealScalar RealScalar;
     const Scalar imagUnit(0, 1);
     MatrixType diag = MatrixType::Zero(size, size);
     for (Index i = 0; i < size; ++i) {
-      diag(i, i) = Scalar(RealScalar(internal::random<Index>(-1, 1))) * imagUnit
-        + internal::random<Scalar>() * Scalar(RealScalar(0.01));
+      diag(i, i) = Scalar(RealScalar(internal::random<Index>(-1, 1))) * imagUnit +
+                   internal::random<Scalar>() * Scalar(RealScalar(0.01));
     }
     MatrixType A = MatrixType::Random(size, size);
     HouseholderQR<MatrixType> QRofA(A);
@@ -91,10 +83,8 @@
   }
 };
 
-
-template<typename MatrixType>
-void testMatrixExponential(const MatrixType& A)
-{
+template <typename MatrixType>
+void testMatrixExponential(const MatrixType& A) {
   typedef typename internal::traits<MatrixType>::Scalar Scalar;
   typedef typename NumTraits<Scalar>::Real RealScalar;
   typedef std::complex<RealScalar> ComplexScalar;
@@ -102,9 +92,8 @@
   VERIFY_IS_APPROX(A.exp(), A.matrixFunction(internal::stem_function_exp<ComplexScalar>));
 }
 
-template<typename MatrixType>
-void testMatrixLogarithm(const MatrixType& A)
-{
+template <typename MatrixType>
+void testMatrixLogarithm(const MatrixType& A) {
   typedef typename internal::traits<MatrixType>::Scalar Scalar;
   typedef typename NumTraits<Scalar>::Real RealScalar;
 
@@ -121,51 +110,47 @@
   VERIFY_IS_APPROX(logExpA, scaledA);
 }
 
-template<typename MatrixType>
-void testHyperbolicFunctions(const MatrixType& A)
-{
+template <typename MatrixType>
+void testHyperbolicFunctions(const MatrixType& A) {
   // Need to use absolute error because of possible cancellation when
   // adding/subtracting expA and expmA.
   VERIFY_IS_APPROX_ABS(A.sinh(), (A.exp() - (-A).exp()) / 2);
   VERIFY_IS_APPROX_ABS(A.cosh(), (A.exp() + (-A).exp()) / 2);
 }
 
-template<typename MatrixType>
-void testGonioFunctions(const MatrixType& A)
-{
+template <typename MatrixType>
+void testGonioFunctions(const MatrixType& A) {
   typedef typename MatrixType::Scalar Scalar;
   typedef typename NumTraits<Scalar>::Real RealScalar;
   typedef std::complex<RealScalar> ComplexScalar;
-  typedef Matrix<ComplexScalar, MatrixType::RowsAtCompileTime, 
-                 MatrixType::ColsAtCompileTime, MatrixType::Options> ComplexMatrix;
+  typedef Matrix<ComplexScalar, MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime, MatrixType::Options>
+      ComplexMatrix;
 
-  ComplexScalar imagUnit(0,1);
-  ComplexScalar two(2,0);
+  ComplexScalar imagUnit(0, 1);
+  ComplexScalar two(2, 0);
 
   ComplexMatrix Ac = A.template cast<ComplexScalar>();
-  
+
   ComplexMatrix exp_iA = (imagUnit * Ac).exp();
   ComplexMatrix exp_miA = (-imagUnit * Ac).exp();
-  
+
   ComplexMatrix sinAc = A.sin().template cast<ComplexScalar>();
-  VERIFY_IS_APPROX_ABS(sinAc, (exp_iA - exp_miA) / (two*imagUnit));
-  
+  VERIFY_IS_APPROX_ABS(sinAc, (exp_iA - exp_miA) / (two * imagUnit));
+
   ComplexMatrix cosAc = A.cos().template cast<ComplexScalar>();
   VERIFY_IS_APPROX_ABS(cosAc, (exp_iA + exp_miA) / 2);
 }
 
-template<typename MatrixType>
-void testMatrix(const MatrixType& A)
-{
+template <typename MatrixType>
+void testMatrix(const MatrixType& A) {
   testMatrixExponential(A);
   testMatrixLogarithm(A);
   testHyperbolicFunctions(A);
   testGonioFunctions(A);
 }
 
-template<typename MatrixType>
-void testMatrixType(const MatrixType& m)
-{
+template <typename MatrixType>
+void testMatrixType(const MatrixType& m) {
   // Matrices with clustered eigenvalue lead to different code paths
   // in MatrixFunction.h and are thus useful for testing.
 
@@ -177,27 +162,27 @@
   }
 }
 
-template<typename MatrixType>
-void testMapRef(const MatrixType& A)
-{
+template <typename MatrixType>
+void testMapRef(const MatrixType& A) {
   // Test if passing Ref and Map objects is possible
   // (Regression test for Bug #1796)
   Index size = A.rows();
-  MatrixType X; X.setRandom(size, size);
-  MatrixType Y(size,size);
-  Ref<      MatrixType> R(Y);
+  MatrixType X;
+  X.setRandom(size, size);
+  MatrixType Y(size, size);
+  Ref<MatrixType> R(Y);
   Ref<const MatrixType> Rc(X);
-  Map<      MatrixType> M(Y.data(), size, size);
+  Map<MatrixType> M(Y.data(), size, size);
   Map<const MatrixType> Mc(X.data(), size, size);
 
-  X = X*X; // make sure sqrt is possible
+  X = X * X;  // make sure sqrt is possible
   Y = X.sqrt();
   R = Rc.sqrt();
   M = Mc.sqrt();
   Y = X.exp();
   R = Rc.exp();
   M = Mc.exp();
-  X = Y; // make sure log is possible
+  X = Y;  // make sure log is possible
   Y = X.log();
   R = Rc.log();
   M = Mc.log();
@@ -209,19 +194,17 @@
   Y = X.sinh() + Rc.sinh() + Mc.sinh();
 }
 
-
-EIGEN_DECLARE_TEST(matrix_function)
-{
-  CALL_SUBTEST_1(testMatrixType(Matrix<float,1,1>()));
+EIGEN_DECLARE_TEST(matrix_function) {
+  CALL_SUBTEST_1(testMatrixType(Matrix<float, 1, 1>()));
   CALL_SUBTEST_2(testMatrixType(Matrix3cf()));
-  CALL_SUBTEST_3(testMatrixType(MatrixXf(8,8)));
+  CALL_SUBTEST_3(testMatrixType(MatrixXf(8, 8)));
   CALL_SUBTEST_4(testMatrixType(Matrix2d()));
-  CALL_SUBTEST_5(testMatrixType(Matrix<double,5,5,RowMajor>()));
+  CALL_SUBTEST_5(testMatrixType(Matrix<double, 5, 5, RowMajor>()));
   CALL_SUBTEST_6(testMatrixType(Matrix4cd()));
-  CALL_SUBTEST_7(testMatrixType(MatrixXd(13,13)));
+  CALL_SUBTEST_7(testMatrixType(MatrixXd(13, 13)));
 
-  CALL_SUBTEST_1(testMapRef(Matrix<float,1,1>()));
+  CALL_SUBTEST_1(testMapRef(Matrix<float, 1, 1>()));
   CALL_SUBTEST_2(testMapRef(Matrix3cf()));
-  CALL_SUBTEST_3(testMapRef(MatrixXf(8,8)));
-  CALL_SUBTEST_7(testMapRef(MatrixXd(13,13)));
+  CALL_SUBTEST_3(testMapRef(MatrixXf(8, 8)));
+  CALL_SUBTEST_7(testMapRef(MatrixXd(13, 13)));
 }
diff --git a/unsupported/test/matrix_functions.h b/unsupported/test/matrix_functions.h
index 4e26364..cd5b908 100644
--- a/unsupported/test/matrix_functions.h
+++ b/unsupported/test/matrix_functions.h
@@ -11,24 +11,20 @@
 #include <unsupported/Eigen/MatrixFunctions>
 
 // For complex matrices, any matrix is fine.
-template<typename MatrixType, int IsComplex = NumTraits<typename internal::traits<MatrixType>::Scalar>::IsComplex>
-struct processTriangularMatrix
-{
-  static void run(MatrixType&, MatrixType&, const MatrixType&)
-  { }
+template <typename MatrixType, int IsComplex = NumTraits<typename internal::traits<MatrixType>::Scalar>::IsComplex>
+struct processTriangularMatrix {
+  static void run(MatrixType&, MatrixType&, const MatrixType&) {}
 };
 
 // For real matrices, make sure none of the eigenvalues are negative.
-template<typename MatrixType>
-struct processTriangularMatrix<MatrixType,0>
-{
-  static void run(MatrixType& m, MatrixType& T, const MatrixType& U)
-  {
+template <typename MatrixType>
+struct processTriangularMatrix<MatrixType, 0> {
+  static void run(MatrixType& m, MatrixType& T, const MatrixType& U) {
     const Index size = m.cols();
 
-    for (Index i=0; i < size; ++i) {
-      if (i == size - 1 || T.coeff(i+1,i) == 0)
-        T.coeffRef(i,i) = std::abs(T.coeff(i,i));
+    for (Index i = 0; i < size; ++i) {
+      if (i == size - 1 || T.coeff(i + 1, i) == 0)
+        T.coeffRef(i, i) = std::abs(T.coeff(i, i));
       else
         ++i;
     }
@@ -40,10 +36,8 @@
 struct generateTestMatrix;
 
 template <typename MatrixType>
-struct generateTestMatrix<MatrixType,0>
-{
-  static void run(MatrixType& result, typename MatrixType::Index size)
-  {
+struct generateTestMatrix<MatrixType, 0> {
+  static void run(MatrixType& result, typename MatrixType::Index size) {
     result = MatrixType::Random(size, size);
     RealSchur<MatrixType> schur(result);
     MatrixType T = schur.matrixT();
@@ -52,16 +46,11 @@
 };
 
 template <typename MatrixType>
-struct generateTestMatrix<MatrixType,1>
-{
-  static void run(MatrixType& result, typename MatrixType::Index size)
-  {
-    result = MatrixType::Random(size, size);
-  }
+struct generateTestMatrix<MatrixType, 1> {
+  static void run(MatrixType& result, typename MatrixType::Index size) { result = MatrixType::Random(size, size); }
 };
 
 template <typename Derived, typename OtherDerived>
-typename Derived::RealScalar relerr(const MatrixBase<Derived>& A, const MatrixBase<OtherDerived>& B)
-{
+typename Derived::RealScalar relerr(const MatrixBase<Derived>& A, const MatrixBase<OtherDerived>& B) {
   return std::sqrt((A - B).cwiseAbs2().sum() / (std::min)(A.cwiseAbs2().sum(), B.cwiseAbs2().sum()));
 }
diff --git a/unsupported/test/matrix_power.cpp b/unsupported/test/matrix_power.cpp
index b13eb5a..e17d35a 100644
--- a/unsupported/test/matrix_power.cpp
+++ b/unsupported/test/matrix_power.cpp
@@ -9,71 +9,67 @@
 
 #include "matrix_functions.h"
 
-template<typename T>
-void test2dRotation(const T& tol)
-{
-  Matrix<T,2,2> A, B, C;
+template <typename T>
+void test2dRotation(const T& tol) {
+  Matrix<T, 2, 2> A, B, C;
   T angle, c, s;
 
   A << 0, 1, -1, 0;
-  MatrixPower<Matrix<T,2,2> > Apow(A);
+  MatrixPower<Matrix<T, 2, 2> > Apow(A);
 
-  for (int i=0; i<=20; ++i) {
-    angle = std::pow(T(10), T(i-10) / T(5.));
+  for (int i = 0; i <= 20; ++i) {
+    angle = std::pow(T(10), T(i - 10) / T(5.));
     c = std::cos(angle);
     s = std::sin(angle);
     B << c, s, -s, c;
 
-    C = Apow(std::ldexp(angle,1) / T(EIGEN_PI));
-    std::cout << "test2dRotation: i = " << i << "   error powerm = " << relerr(C,B) << '\n';
+    C = Apow(std::ldexp(angle, 1) / T(EIGEN_PI));
+    std::cout << "test2dRotation: i = " << i << "   error powerm = " << relerr(C, B) << '\n';
     VERIFY(C.isApprox(B, tol));
   }
 }
 
-template<typename T>
-void test2dHyperbolicRotation(const T& tol)
-{
-  Matrix<std::complex<T>,2,2> A, B, C;
+template <typename T>
+void test2dHyperbolicRotation(const T& tol) {
+  Matrix<std::complex<T>, 2, 2> A, B, C;
   T angle, ch = std::cosh((T)1);
   std::complex<T> ish(0, std::sinh((T)1));
 
   A << ch, ish, -ish, ch;
-  MatrixPower<Matrix<std::complex<T>,2,2> > Apow(A);
+  MatrixPower<Matrix<std::complex<T>, 2, 2> > Apow(A);
 
-  for (int i=0; i<=20; ++i) {
-    angle = std::ldexp(static_cast<T>(i-10), -1);
+  for (int i = 0; i <= 20; ++i) {
+    angle = std::ldexp(static_cast<T>(i - 10), -1);
     ch = std::cosh(angle);
     ish = std::complex<T>(0, std::sinh(angle));
     B << ch, ish, -ish, ch;
 
     C = Apow(angle);
-    std::cout << "test2dHyperbolicRotation: i = " << i << "   error powerm = " << relerr(C,B) << '\n';
+    std::cout << "test2dHyperbolicRotation: i = " << i << "   error powerm = " << relerr(C, B) << '\n';
     VERIFY(C.isApprox(B, tol));
   }
 }
 
-template<typename T>
-void test3dRotation(const T& tol)
-{
-  Matrix<T,3,1> v;
+template <typename T>
+void test3dRotation(const T& tol) {
+  Matrix<T, 3, 1> v;
   T angle;
 
-  for (int i=0; i<=20; ++i) {
-    v = Matrix<T,3,1>::Random();
+  for (int i = 0; i <= 20; ++i) {
+    v = Matrix<T, 3, 1>::Random();
     v.normalize();
-    angle = std::pow(T(10), T(i-10) / T(5.));
-    VERIFY(AngleAxis<T>(angle, v).matrix().isApprox(AngleAxis<T>(1,v).matrix().pow(angle), tol));
+    angle = std::pow(T(10), T(i - 10) / T(5.));
+    VERIFY(AngleAxis<T>(angle, v).matrix().isApprox(AngleAxis<T>(1, v).matrix().pow(angle), tol));
   }
 }
 
-template<typename MatrixType>
-void testGeneral(const MatrixType& m, const typename MatrixType::RealScalar& tol)
-{
+template <typename MatrixType>
+void testGeneral(const MatrixType& m, const typename MatrixType::RealScalar& tol) {
   typedef typename MatrixType::RealScalar RealScalar;
   MatrixType m1, m2, m3, m4, m5;
   RealScalar x, y;
 
-  for (int i=0; i < g_repeat; ++i) {
+  for (int i = 0; i < g_repeat; ++i) {
     generateTestMatrix<MatrixType>::run(m1, m.rows());
     MatrixPower<MatrixType> mpow(m1);
 
@@ -82,11 +78,11 @@
     m2 = mpow(x);
     m3 = mpow(y);
 
-    m4 = mpow(x+y);
+    m4 = mpow(x + y);
     m5.noalias() = m2 * m3;
     VERIFY(m4.isApprox(m5, tol));
 
-    m4 = mpow(x*y);
+    m4 = mpow(x * y);
     m5 = m2.pow(y);
     VERIFY(m4.isApprox(m5, tol));
 
@@ -96,19 +92,18 @@
   }
 }
 
-template<typename MatrixType>
-void testSingular(const MatrixType& m_const, const typename MatrixType::RealScalar& tol)
-{
+template <typename MatrixType>
+void testSingular(const MatrixType& m_const, const typename MatrixType::RealScalar& tol) {
   // we need to pass by reference in order to prevent errors with
   // MSVC for aligned data types ...
   MatrixType& m = const_cast<MatrixType&>(m_const);
 
   const int IsComplex = NumTraits<typename internal::traits<MatrixType>::Scalar>::IsComplex;
-  typedef std::conditional_t<IsComplex, TriangularView<MatrixType,Upper>, const MatrixType&> TriangularType;
-  std::conditional_t< IsComplex, ComplexSchur<MatrixType>, RealSchur<MatrixType> > schur;
+  typedef std::conditional_t<IsComplex, TriangularView<MatrixType, Upper>, const MatrixType&> TriangularType;
+  std::conditional_t<IsComplex, ComplexSchur<MatrixType>, RealSchur<MatrixType> > schur;
   MatrixType T;
 
-  for (int i=0; i < g_repeat; ++i) {
+  for (int i = 0; i < g_repeat; ++i) {
     m.setRandom();
     m.col(0).fill(0);
 
@@ -129,9 +124,8 @@
   }
 }
 
-template<typename MatrixType>
-void testLogThenExp(const MatrixType& m_const, const typename MatrixType::RealScalar& tol)
-{
+template <typename MatrixType>
+void testLogThenExp(const MatrixType& m_const, const typename MatrixType::RealScalar& tol) {
   // we need to pass by reference in order to prevent errors with
   // MSVC for aligned data types ...
   MatrixType& m = const_cast<MatrixType&>(m_const);
@@ -139,19 +133,18 @@
   typedef typename MatrixType::Scalar Scalar;
   Scalar x;
 
-  for (int i=0; i < g_repeat; ++i) {
+  for (int i = 0; i < g_repeat; ++i) {
     generateTestMatrix<MatrixType>::run(m, m.rows());
     x = internal::random<Scalar>();
     VERIFY(m.pow(x).isApprox((x * m.log()).exp(), tol));
   }
 }
 
-typedef Matrix<double,3,3,RowMajor>         Matrix3dRowMajor;
-typedef Matrix<long double,3,3>             Matrix3e;
-typedef Matrix<long double,Dynamic,Dynamic> MatrixXe;
- 
-EIGEN_DECLARE_TEST(matrix_power)
-{
+typedef Matrix<double, 3, 3, RowMajor> Matrix3dRowMajor;
+typedef Matrix<long double, 3, 3> Matrix3e;
+typedef Matrix<long double, Dynamic, Dynamic> MatrixXe;
+
+EIGEN_DECLARE_TEST(matrix_power) {
   CALL_SUBTEST_2(test2dRotation<double>(1e-13));
   CALL_SUBTEST_1(test2dRotation<float>(2e-5f));  // was 1e-5, relaxed for clang 2.8 / linux / x86-64
   CALL_SUBTEST_9(test2dRotation<long double>(1e-13L));
@@ -163,42 +156,42 @@
   CALL_SUBTEST_11(test3dRotation<float>(1e-5f));
   CALL_SUBTEST_12(test3dRotation<long double>(1e-13L));
 
-  CALL_SUBTEST_2(testGeneral(Matrix2d(),         1e-13));
+  CALL_SUBTEST_2(testGeneral(Matrix2d(), 1e-13));
   CALL_SUBTEST_7(testGeneral(Matrix3dRowMajor(), 1e-13));
-  CALL_SUBTEST_3(testGeneral(Matrix4cd(),        1e-13));
-  CALL_SUBTEST_4(testGeneral(MatrixXd(8,8),      2e-12));
-  CALL_SUBTEST_1(testGeneral(Matrix2f(),         1e-4f));
-  CALL_SUBTEST_5(testGeneral(Matrix3cf(),        1e-4f));
-  CALL_SUBTEST_8(testGeneral(Matrix4f(),         1e-4f));
-  CALL_SUBTEST_6(testGeneral(MatrixXf(2,2),      1e-3f)); // see bug 614
-  CALL_SUBTEST_9(testGeneral(MatrixXe(7,7),      1e-12L));
-  CALL_SUBTEST_10(testGeneral(Matrix3d(),        1e-13));
-  CALL_SUBTEST_11(testGeneral(Matrix3f(),        1e-4f));
-  CALL_SUBTEST_12(testGeneral(Matrix3e(),        1e-13L));
+  CALL_SUBTEST_3(testGeneral(Matrix4cd(), 1e-13));
+  CALL_SUBTEST_4(testGeneral(MatrixXd(8, 8), 2e-12));
+  CALL_SUBTEST_1(testGeneral(Matrix2f(), 1e-4f));
+  CALL_SUBTEST_5(testGeneral(Matrix3cf(), 1e-4f));
+  CALL_SUBTEST_8(testGeneral(Matrix4f(), 1e-4f));
+  CALL_SUBTEST_6(testGeneral(MatrixXf(2, 2), 1e-3f));  // see bug 614
+  CALL_SUBTEST_9(testGeneral(MatrixXe(7, 7), 1e-12L));
+  CALL_SUBTEST_10(testGeneral(Matrix3d(), 1e-13));
+  CALL_SUBTEST_11(testGeneral(Matrix3f(), 1e-4f));
+  CALL_SUBTEST_12(testGeneral(Matrix3e(), 1e-13L));
 
-  CALL_SUBTEST_2(testSingular(Matrix2d(),         1e-13));
+  CALL_SUBTEST_2(testSingular(Matrix2d(), 1e-13));
   CALL_SUBTEST_7(testSingular(Matrix3dRowMajor(), 1e-13));
-  CALL_SUBTEST_3(testSingular(Matrix4cd(),        1e-13));
-  CALL_SUBTEST_4(testSingular(MatrixXd(8,8),      2e-12));
-  CALL_SUBTEST_1(testSingular(Matrix2f(),         1e-4f));
-  CALL_SUBTEST_5(testSingular(Matrix3cf(),        1e-4f));
-  CALL_SUBTEST_8(testSingular(Matrix4f(),         1e-4f));
-  CALL_SUBTEST_6(testSingular(MatrixXf(2,2),      1e-3f));
-  CALL_SUBTEST_9(testSingular(MatrixXe(7,7),      1e-12L));
-  CALL_SUBTEST_10(testSingular(Matrix3d(),        1e-13));
-  CALL_SUBTEST_11(testSingular(Matrix3f(),        1e-4f));
-  CALL_SUBTEST_12(testSingular(Matrix3e(),        1e-13L));
+  CALL_SUBTEST_3(testSingular(Matrix4cd(), 1e-13));
+  CALL_SUBTEST_4(testSingular(MatrixXd(8, 8), 2e-12));
+  CALL_SUBTEST_1(testSingular(Matrix2f(), 1e-4f));
+  CALL_SUBTEST_5(testSingular(Matrix3cf(), 1e-4f));
+  CALL_SUBTEST_8(testSingular(Matrix4f(), 1e-4f));
+  CALL_SUBTEST_6(testSingular(MatrixXf(2, 2), 1e-3f));
+  CALL_SUBTEST_9(testSingular(MatrixXe(7, 7), 1e-12L));
+  CALL_SUBTEST_10(testSingular(Matrix3d(), 1e-13));
+  CALL_SUBTEST_11(testSingular(Matrix3f(), 1e-4f));
+  CALL_SUBTEST_12(testSingular(Matrix3e(), 1e-13L));
 
-  CALL_SUBTEST_2(testLogThenExp(Matrix2d(),         1e-13));
+  CALL_SUBTEST_2(testLogThenExp(Matrix2d(), 1e-13));
   CALL_SUBTEST_7(testLogThenExp(Matrix3dRowMajor(), 1e-13));
-  CALL_SUBTEST_3(testLogThenExp(Matrix4cd(),        1e-13));
-  CALL_SUBTEST_4(testLogThenExp(MatrixXd(8,8),      2e-12));
-  CALL_SUBTEST_1(testLogThenExp(Matrix2f(),         1e-4f));
-  CALL_SUBTEST_5(testLogThenExp(Matrix3cf(),        1e-4f));
-  CALL_SUBTEST_8(testLogThenExp(Matrix4f(),         1e-4f));
-  CALL_SUBTEST_6(testLogThenExp(MatrixXf(2,2),      1e-3f));
-  CALL_SUBTEST_9(testLogThenExp(MatrixXe(7,7),      1e-12L));
-  CALL_SUBTEST_10(testLogThenExp(Matrix3d(),        1e-13));
-  CALL_SUBTEST_11(testLogThenExp(Matrix3f(),        1e-4f));
-  CALL_SUBTEST_12(testLogThenExp(Matrix3e(),        1e-13L));
+  CALL_SUBTEST_3(testLogThenExp(Matrix4cd(), 1e-13));
+  CALL_SUBTEST_4(testLogThenExp(MatrixXd(8, 8), 2e-12));
+  CALL_SUBTEST_1(testLogThenExp(Matrix2f(), 1e-4f));
+  CALL_SUBTEST_5(testLogThenExp(Matrix3cf(), 1e-4f));
+  CALL_SUBTEST_8(testLogThenExp(Matrix4f(), 1e-4f));
+  CALL_SUBTEST_6(testLogThenExp(MatrixXf(2, 2), 1e-3f));
+  CALL_SUBTEST_9(testLogThenExp(MatrixXe(7, 7), 1e-12L));
+  CALL_SUBTEST_10(testLogThenExp(Matrix3d(), 1e-13));
+  CALL_SUBTEST_11(testLogThenExp(Matrix3f(), 1e-4f));
+  CALL_SUBTEST_12(testLogThenExp(Matrix3e(), 1e-13L));
 }
diff --git a/unsupported/test/matrix_square_root.cpp b/unsupported/test/matrix_square_root.cpp
index 034f292..c7f8fbe 100644
--- a/unsupported/test/matrix_square_root.cpp
+++ b/unsupported/test/matrix_square_root.cpp
@@ -9,23 +9,21 @@
 
 #include "matrix_functions.h"
 
-template<typename MatrixType>
-void testMatrixSqrt(const MatrixType& m)
-{
+template <typename MatrixType>
+void testMatrixSqrt(const MatrixType& m) {
   MatrixType A;
   generateTestMatrix<MatrixType>::run(A, m.rows());
   MatrixType sqrtA = A.sqrt();
   VERIFY_IS_APPROX(sqrtA * sqrtA, A);
 }
 
-EIGEN_DECLARE_TEST(matrix_square_root)
-{
+EIGEN_DECLARE_TEST(matrix_square_root) {
   for (int i = 0; i < g_repeat; i++) {
     CALL_SUBTEST_1(testMatrixSqrt(Matrix3cf()));
-    CALL_SUBTEST_2(testMatrixSqrt(MatrixXcd(12,12)));
+    CALL_SUBTEST_2(testMatrixSqrt(MatrixXcd(12, 12)));
     CALL_SUBTEST_3(testMatrixSqrt(Matrix4f()));
-    CALL_SUBTEST_4(testMatrixSqrt(Matrix<double,Dynamic,Dynamic,RowMajor>(9, 9)));
-    CALL_SUBTEST_5(testMatrixSqrt(Matrix<float,1,1>()));
-    CALL_SUBTEST_5(testMatrixSqrt(Matrix<std::complex<float>,1,1>()));
+    CALL_SUBTEST_4(testMatrixSqrt(Matrix<double, Dynamic, Dynamic, RowMajor>(9, 9)));
+    CALL_SUBTEST_5(testMatrixSqrt(Matrix<float, 1, 1>()));
+    CALL_SUBTEST_5(testMatrixSqrt(Matrix<std::complex<float>, 1, 1>()));
   }
 }
diff --git a/unsupported/test/minres.cpp b/unsupported/test/minres.cpp
index 2eb40fe..0d625c4 100644
--- a/unsupported/test/minres.cpp
+++ b/unsupported/test/minres.cpp
@@ -12,33 +12,30 @@
 #include "../../test/sparse_solver.h"
 #include <Eigen/IterativeSolvers>
 
-template<typename T> void test_minres_T()
-{
+template <typename T>
+void test_minres_T() {
   // Identity preconditioner
-  MINRES<SparseMatrix<T>, Lower, IdentityPreconditioner    > minres_colmajor_lower_I;
-  MINRES<SparseMatrix<T>, Upper, IdentityPreconditioner    > minres_colmajor_upper_I;
+  MINRES<SparseMatrix<T>, Lower, IdentityPreconditioner> minres_colmajor_lower_I;
+  MINRES<SparseMatrix<T>, Upper, IdentityPreconditioner> minres_colmajor_upper_I;
 
   // Diagonal preconditioner
   MINRES<SparseMatrix<T>, Lower, DiagonalPreconditioner<T> > minres_colmajor_lower_diag;
   MINRES<SparseMatrix<T>, Upper, DiagonalPreconditioner<T> > minres_colmajor_upper_diag;
-  MINRES<SparseMatrix<T>, Lower|Upper, DiagonalPreconditioner<T> > minres_colmajor_uplo_diag;
-  
+  MINRES<SparseMatrix<T>, Lower | Upper, DiagonalPreconditioner<T> > minres_colmajor_uplo_diag;
+
   // call tests for SPD matrix
-  CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_lower_I) );
-  CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_upper_I) );
-    
-  CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_lower_diag)  );
-  CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_upper_diag)  );
-  CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_uplo_diag)  );
-    
+  CALL_SUBTEST(check_sparse_spd_solving(minres_colmajor_lower_I));
+  CALL_SUBTEST(check_sparse_spd_solving(minres_colmajor_upper_I));
+
+  CALL_SUBTEST(check_sparse_spd_solving(minres_colmajor_lower_diag));
+  CALL_SUBTEST(check_sparse_spd_solving(minres_colmajor_upper_diag));
+  CALL_SUBTEST(check_sparse_spd_solving(minres_colmajor_uplo_diag));
+
   // TO DO: symmetric semi-definite matrix
   // TO DO: symmetric indefinite matrix
-
 }
 
-EIGEN_DECLARE_TEST(minres)
-{
+EIGEN_DECLARE_TEST(minres) {
   CALL_SUBTEST_1(test_minres_T<double>());
-//  CALL_SUBTEST_2(test_minres_T<std::compex<double> >());
-
+  //  CALL_SUBTEST_2(test_minres_T<std::compex<double> >());
 }
diff --git a/unsupported/test/mpreal_support.cpp b/unsupported/test/mpreal_support.cpp
index 7256dc0..1598f7f 100644
--- a/unsupported/test/mpreal_support.cpp
+++ b/unsupported/test/mpreal_support.cpp
@@ -8,12 +8,11 @@
 using namespace mpfr;
 using namespace Eigen;
 
-EIGEN_DECLARE_TEST(mpreal_support)
-{
+EIGEN_DECLARE_TEST(mpreal_support) {
   // set precision to 256 bits (double has only 53 bits)
   mpreal::set_default_prec(256);
-  typedef Matrix<mpreal,Eigen::Dynamic,Eigen::Dynamic> MatrixXmp;
-  typedef Matrix<std::complex<mpreal>,Eigen::Dynamic,Eigen::Dynamic> MatrixXcmp;
+  typedef Matrix<mpreal, Eigen::Dynamic, Eigen::Dynamic> MatrixXmp;
+  typedef Matrix<std::complex<mpreal>, Eigen::Dynamic, Eigen::Dynamic> MatrixXcmp;
 
   std::cerr << "epsilon =         " << NumTraits<mpreal>::epsilon() << "\n";
   std::cerr << "dummy_precision = " << NumTraits<mpreal>::dummy_precision() << "\n";
@@ -22,44 +21,47 @@
   std::cerr << "digits10 =        " << NumTraits<mpreal>::digits10() << "\n";
   std::cerr << "max_digits10 =    " << NumTraits<mpreal>::max_digits10() << "\n";
 
-  for(int i = 0; i < g_repeat; i++) {
-    int s = Eigen::internal::random<int>(1,100);
-    MatrixXmp A = MatrixXmp::Random(s,s);
-    MatrixXmp B = MatrixXmp::Random(s,s);
+  for (int i = 0; i < g_repeat; i++) {
+    int s = Eigen::internal::random<int>(1, 100);
+    MatrixXmp A = MatrixXmp::Random(s, s);
+    MatrixXmp B = MatrixXmp::Random(s, s);
     MatrixXmp S = A.adjoint() * A;
     MatrixXmp X;
-    MatrixXcmp Ac = MatrixXcmp::Random(s,s);
-    MatrixXcmp Bc = MatrixXcmp::Random(s,s);
+    MatrixXcmp Ac = MatrixXcmp::Random(s, s);
+    MatrixXcmp Bc = MatrixXcmp::Random(s, s);
     MatrixXcmp Sc = Ac.adjoint() * Ac;
     MatrixXcmp Xc;
-    
+
     // Basic stuffs
     VERIFY_IS_APPROX(A.real(), A);
     VERIFY(Eigen::internal::isApprox(A.array().abs2().sum(), A.squaredNorm()));
-    VERIFY_IS_APPROX(A.array().exp(),         exp(A.array()));
+    VERIFY_IS_APPROX(A.array().exp(), exp(A.array()));
     VERIFY_IS_APPROX(A.array().abs2().sqrt(), A.array().abs());
-    VERIFY_IS_APPROX(A.array().sin(),         sin(A.array()));
-    VERIFY_IS_APPROX(A.array().cos(),         cos(A.array()));
+    VERIFY_IS_APPROX(A.array().sin(), sin(A.array()));
+    VERIFY_IS_APPROX(A.array().cos(), cos(A.array()));
 
     // Cholesky
     X = S.selfadjointView<Lower>().llt().solve(B);
-    VERIFY_IS_APPROX((S.selfadjointView<Lower>()*X).eval(),B);
+    VERIFY_IS_APPROX((S.selfadjointView<Lower>() * X).eval(), B);
 
     Xc = Sc.selfadjointView<Lower>().llt().solve(Bc);
-    VERIFY_IS_APPROX((Sc.selfadjointView<Lower>()*Xc).eval(),Bc);
-    
+    VERIFY_IS_APPROX((Sc.selfadjointView<Lower>() * Xc).eval(), Bc);
+
     // partial LU
     X = A.lu().solve(B);
-    VERIFY_IS_APPROX((A*X).eval(),B);
+    VERIFY_IS_APPROX((A * X).eval(), B);
 
     // symmetric eigenvalues
     SelfAdjointEigenSolver<MatrixXmp> eig(S);
     VERIFY_IS_EQUAL(eig.info(), Success);
-    VERIFY( (S.selfadjointView<Lower>() * eig.eigenvectors()).isApprox(eig.eigenvectors() * eig.eigenvalues().asDiagonal(), NumTraits<mpreal>::dummy_precision()*1e3) );
+    VERIFY(
+        (S.selfadjointView<Lower>() * eig.eigenvectors())
+            .isApprox(eig.eigenvectors() * eig.eigenvalues().asDiagonal(), NumTraits<mpreal>::dummy_precision() * 1e3));
   }
-  
+
   {
-    MatrixXmp A(8,3); A.setRandom();
+    MatrixXmp A(8, 3);
+    A.setRandom();
     // test output (interesting things happen in this code)
     std::stringstream stream;
     stream << A;
diff --git a/unsupported/test/openglsupport.cpp b/unsupported/test/openglsupport.cpp
index 1c44381..18f990d 100644
--- a/unsupported/test/openglsupport.cpp
+++ b/unsupported/test/openglsupport.cpp
@@ -12,89 +12,96 @@
 #include <string>
 
 #if defined(__APPLE_CC__)
-  // Prevent deprecation warnings caused by GLEW on MacOS.
-  #define GL_SILENCE_DEPRECATION 1
+// Prevent deprecation warnings caused by GLEW on MacOS.
+#define GL_SILENCE_DEPRECATION 1
 #endif
 #include <GL/glew.h>
 #include <Eigen/OpenGLSupport>
 #if defined(__APPLE_CC__)
-  #include <GLUT/glut.h>
+#include <GLUT/glut.h>
 #else
-  #include <GL/freeglut.h>
+#include <GL/freeglut.h>
 #endif
 
 using namespace Eigen;
 
-#define VERIFY_MATRIX(CODE,REF) { \
-    glMatrixMode(GL_MODELVIEW); \
-    glLoadIdentity(); \
-    CODE; \
-    Matrix<float,4,4,ColMajor> m; m.setZero(); \
-    glGet(GL_MODELVIEW_MATRIX, m); \
-    if(!(REF).cast<float>().isApprox(m)) { \
-      std::cerr << "Expected:\n" << ((REF).cast<float>()) << "\n" << "got\n" << m << "\n\n"; \
-    } \
-    VERIFY_IS_APPROX((REF).cast<float>(), m); \
+#define VERIFY_MATRIX(CODE, REF)                 \
+  {                                              \
+    glMatrixMode(GL_MODELVIEW);                  \
+    glLoadIdentity();                            \
+    CODE;                                        \
+    Matrix<float, 4, 4, ColMajor> m;             \
+    m.setZero();                                 \
+    glGet(GL_MODELVIEW_MATRIX, m);               \
+    if (!(REF).cast<float>().isApprox(m)) {      \
+      std::cerr << "Expected:\n"                 \
+                << ((REF).cast<float>()) << "\n" \
+                << "got\n"                       \
+                << m << "\n\n";                  \
+    }                                            \
+    VERIFY_IS_APPROX((REF).cast<float>(), m);    \
   }
 
-#define VERIFY_UNIFORM(SUFFIX,NAME,TYPE) { \
-    TYPE value; value.setRandom(); \
-    TYPE data; \
-    int loc = glGetUniformLocation(prg_id, #NAME); \
-    VERIFY((loc!=-1) && "uniform not found"); \
-    glUniform(loc,value); \
-    EIGEN_CAT(glGetUniform,SUFFIX)(prg_id,loc,data.data()); \
-    if(!value.isApprox(data)) { \
-      std::cerr << "Expected:\n" << value << "\n" << "got\n" << data << "\n\n"; \
-    } \
-    VERIFY_IS_APPROX(value, data); \
+#define VERIFY_UNIFORM(SUFFIX, NAME, TYPE)                     \
+  {                                                            \
+    TYPE value;                                                \
+    value.setRandom();                                         \
+    TYPE data;                                                 \
+    int loc = glGetUniformLocation(prg_id, #NAME);             \
+    VERIFY((loc != -1) && "uniform not found");                \
+    glUniform(loc, value);                                     \
+    EIGEN_CAT(glGetUniform, SUFFIX)(prg_id, loc, data.data()); \
+    if (!value.isApprox(data)) {                               \
+      std::cerr << "Expected:\n"                               \
+                << value << "\n"                               \
+                << "got\n"                                     \
+                << data << "\n\n";                             \
+    }                                                          \
+    VERIFY_IS_APPROX(value, data);                             \
   }
 
-#define VERIFY_UNIFORMi(NAME,TYPE) { \
+#define VERIFY_UNIFORMi(NAME, TYPE)                                        \
+  {                                                                        \
     TYPE value = TYPE::Random().eval().cast<float>().cast<TYPE::Scalar>(); \
-    TYPE data; \
-    int loc = glGetUniformLocation(prg_id, #NAME); \
-    VERIFY((loc!=-1) && "uniform not found"); \
-    glUniform(loc,value); \
-    glGetUniformiv(prg_id,loc,(GLint*)data.data()); \
-    if(!value.isApprox(data)) { \
-      std::cerr << "Expected:\n" << value << "\n" << "got\n" << data << "\n\n"; \
-    } \
-    VERIFY_IS_APPROX(value, data); \
+    TYPE data;                                                             \
+    int loc = glGetUniformLocation(prg_id, #NAME);                         \
+    VERIFY((loc != -1) && "uniform not found");                            \
+    glUniform(loc, value);                                                 \
+    glGetUniformiv(prg_id, loc, (GLint*)data.data());                      \
+    if (!value.isApprox(data)) {                                           \
+      std::cerr << "Expected:\n"                                           \
+                << value << "\n"                                           \
+                << "got\n"                                                 \
+                << data << "\n\n";                                         \
+    }                                                                      \
+    VERIFY_IS_APPROX(value, data);                                         \
   }
 
-void printProgramInfoLog(GLuint objectID)
-{
-    int infologLength, charsWritten;
-    GLchar *infoLog;
-    glGetProgramiv(objectID, GL_INFO_LOG_LENGTH, &infologLength);
-    if(infologLength > 0)
-    {
-        infoLog = new GLchar[infologLength];
-        glGetProgramInfoLog(objectID, infologLength, &charsWritten, infoLog);
-        if (charsWritten > 0)
-          std::cerr << "Program info : \n" << infoLog << std::endl;
-        delete[] infoLog;
-    }
+void printProgramInfoLog(GLuint objectID) {
+  int infologLength, charsWritten;
+  GLchar* infoLog;
+  glGetProgramiv(objectID, GL_INFO_LOG_LENGTH, &infologLength);
+  if (infologLength > 0) {
+    infoLog = new GLchar[infologLength];
+    glGetProgramInfoLog(objectID, infologLength, &charsWritten, infoLog);
+    if (charsWritten > 0) std::cerr << "Program info : \n" << infoLog << std::endl;
+    delete[] infoLog;
+  }
 }
 
-void printShaderInfoLog(GLuint objectID)
-{
-    int infologLength, charsWritten;
-    GLchar *infoLog;
-    glGetShaderiv(objectID, GL_INFO_LOG_LENGTH, &infologLength);
-    if(infologLength > 0)
-    {
-        infoLog = new GLchar[infologLength];
-        glGetShaderInfoLog(objectID, infologLength, &charsWritten, infoLog);
-        if (charsWritten > 0)
-          std::cerr << "Shader info : \n" << infoLog << std::endl;
-        delete[] infoLog;
-    }
+void printShaderInfoLog(GLuint objectID) {
+  int infologLength, charsWritten;
+  GLchar* infoLog;
+  glGetShaderiv(objectID, GL_INFO_LOG_LENGTH, &infologLength);
+  if (infologLength > 0) {
+    infoLog = new GLchar[infologLength];
+    glGetShaderInfoLog(objectID, infologLength, &charsWritten, infoLog);
+    if (charsWritten > 0) std::cerr << "Shader info : \n" << infoLog << std::endl;
+    delete[] infoLog;
+  }
 }
 
-GLint createProgram(const char* vtx, const char* frg, bool print_errors = true)
-{
+GLint createProgram(const char* vtx, const char* frg, bool print_errors = true) {
   GLint prg_id = glCreateProgram();
   GLint vtx_id = glCreateShader(GL_VERTEX_SHADER);
   GLint frg_id = glCreateShader(GL_FRAGMENT_SHADER);
@@ -103,10 +110,8 @@
   glShaderSource(vtx_id, 1, &vtx, 0);
   glCompileShader(vtx_id);
   glGetShaderiv(vtx_id, GL_COMPILE_STATUS, &ok);
-  if(!ok)
-  {
-    if (print_errors)
-    {
+  if (!ok) {
+    if (print_errors) {
       std::cerr << "vtx compilation failed\n";
       std::cerr << "Source:\n" << vtx << "\n";
       printShaderInfoLog(vtx_id);
@@ -118,10 +123,8 @@
   glShaderSource(frg_id, 1, &frg, 0);
   glCompileShader(frg_id);
   glGetShaderiv(frg_id, GL_COMPILE_STATUS, &ok);
-  if(!ok)
-  {
-    if (print_errors)
-    {
+  if (!ok) {
+    if (print_errors) {
       std::cerr << "frg compilation failed.\n";
       std::cerr << "Source:\n" << frg << "\n";
       printShaderInfoLog(frg_id);
@@ -139,10 +142,8 @@
   glDeleteShader(vtx_id);
   glDeleteShader(frg_id);
   glGetProgramiv(prg_id, GL_LINK_STATUS, &ok);
-  if(!ok)
-  {
-    if (print_errors)
-    {
+  if (!ok) {
+    if (print_errors) {
       std::cerr << "linking failed.\n";
       printProgramInfoLog(prg_id);
     }
@@ -154,18 +155,14 @@
   return prg_id;
 }
 
-GLint createProgram(const std::string& vtx, const std::string& frg, bool print_errors = true)
-{
+GLint createProgram(const std::string& vtx, const std::string& frg, bool print_errors = true) {
   return createProgram(vtx.c_str(), frg.c_str(), print_errors);
 }
 
-std::string getGlslVersionString(int gl_major_version, int gl_minor_version)
-{
-  switch (gl_major_version)
-  {
+std::string getGlslVersionString(int gl_major_version, int gl_minor_version) {
+  switch (gl_major_version) {
     case 2:
-      switch (gl_minor_version)
-      {
+      switch (gl_minor_version) {
         case 0:
           return "#version 110";
         case 1:
@@ -173,8 +170,7 @@
       }
       break;
     case 3:
-      switch (gl_minor_version)
-      {
+      switch (gl_minor_version) {
         case 0:
           return "#version 130";
         case 1:
@@ -186,8 +182,7 @@
       }
       break;
     case 4:
-      switch (gl_minor_version)
-      {
+      switch (gl_minor_version) {
         case 0:
           return "#version 400";
         case 1:
@@ -208,28 +203,21 @@
   return "";
 }
 
-void find_and_replace(
-  std::string& str,
-  const std::string& find,
-  const std::string& replace)
-{
+void find_and_replace(std::string& str, const std::string& find, const std::string& replace) {
   size_t loc = 0;
   size_t flen = find.length();
   size_t rlen = replace.length();
-  while ( (loc = str.find(find, loc)) != std::string::npos) {
+  while ((loc = str.find(find, loc)) != std::string::npos) {
     str.replace(loc, flen, replace);
     loc += rlen;
   }
 }
 
 // Finds and replaces a set of substrings in a string.
-std::string format(
-  const std::string& str,
-  const std::vector<std::string>& find,
-  const std::vector<std::string>& replace)
-{
+std::string format(const std::string& str, const std::vector<std::string>& find,
+                   const std::vector<std::string>& replace) {
   std::string out = str;
-  for (std::size_t i=0; i<find.size(); ++i) {
+  for (std::size_t i = 0; i < find.size(); ++i) {
     find_and_replace(out, find[i], replace[i]);
   }
   return out;
@@ -237,8 +225,7 @@
 
 // GLUT display function that runs test.  Must be run within the display loop
 // in order to properly destroy resources.
-void openglsupport_test_loop()
-{
+void openglsupport_test_loop() {
   // Get context info.
   const GLubyte* gl_version_string = glGetString(GL_VERSION);
   std::cerr << "GL version: " << gl_version_string << std::endl;
@@ -250,24 +237,25 @@
   bool legacy_gl = gl_major_version < 3 || (gl_major_version == 3 && gl_minor_version < 2);
 
   // Fixed-function pipeline removed in OpenGL 3.2.
-  if (legacy_gl)
-  {
+  if (legacy_gl) {
     // Draw a basic triangle.
     Vector3f v3f;
     Matrix3f rot;
     glBegin(GL_POINTS);
     {
       glVertex(v3f);
-      glVertex(2*v3f+v3f);
-      glVertex(rot*v3f);
+      glVertex(2 * v3f + v3f);
+      glVertex(rot * v3f);
     }
     glEnd();
 
     // 4x4 matrices
-    Matrix4f mf44; mf44.setRandom();
+    Matrix4f mf44;
+    mf44.setRandom();
     VERIFY_MATRIX(glLoadMatrix(mf44), mf44);
     VERIFY_MATRIX(glMultMatrix(mf44), mf44);
-    Matrix4d md44; md44.setRandom();
+    Matrix4d md44;
+    md44.setRandom();
     VERIFY_MATRIX(glLoadMatrix(md44), md44);
     VERIFY_MATRIX(glMultMatrix(md44), md44);
 
@@ -279,59 +267,81 @@
     VERIFY_MATRIX(glRotate(qf), Projective3f(qf).matrix());
 
     // 3D Transform
-    Transform<float,3,AffineCompact> acf3; acf3.matrix().setRandom();
+    Transform<float, 3, AffineCompact> acf3;
+    acf3.matrix().setRandom();
     VERIFY_MATRIX(glLoadMatrix(acf3), Projective3f(acf3).matrix());
     VERIFY_MATRIX(glMultMatrix(acf3), Projective3f(acf3).matrix());
 
-    Transform<float,3,Affine> af3(acf3);
+    Transform<float, 3, Affine> af3(acf3);
     VERIFY_MATRIX(glLoadMatrix(af3), Projective3f(af3).matrix());
     VERIFY_MATRIX(glMultMatrix(af3), Projective3f(af3).matrix());
 
-    Transform<float,3,Projective> pf3; pf3.matrix().setRandom();
+    Transform<float, 3, Projective> pf3;
+    pf3.matrix().setRandom();
     VERIFY_MATRIX(glLoadMatrix(pf3), Projective3f(pf3).matrix());
     VERIFY_MATRIX(glMultMatrix(pf3), Projective3f(pf3).matrix());
 
-    Transform<double,3,AffineCompact> acd3; acd3.matrix().setRandom();
+    Transform<double, 3, AffineCompact> acd3;
+    acd3.matrix().setRandom();
     VERIFY_MATRIX(glLoadMatrix(acd3), Projective3d(acd3).matrix());
     VERIFY_MATRIX(glMultMatrix(acd3), Projective3d(acd3).matrix());
 
-    Transform<double,3,Affine> ad3(acd3);
+    Transform<double, 3, Affine> ad3(acd3);
     VERIFY_MATRIX(glLoadMatrix(ad3), Projective3d(ad3).matrix());
     VERIFY_MATRIX(glMultMatrix(ad3), Projective3d(ad3).matrix());
 
-    Transform<double,3,Projective> pd3; pd3.matrix().setRandom();
+    Transform<double, 3, Projective> pd3;
+    pd3.matrix().setRandom();
     VERIFY_MATRIX(glLoadMatrix(pd3), Projective3d(pd3).matrix());
     VERIFY_MATRIX(glMultMatrix(pd3), Projective3d(pd3).matrix());
 
     // translations (2D and 3D)
     {
-      Vector2f vf2; vf2.setRandom(); Vector3f vf23; vf23 << vf2, 0;
+      Vector2f vf2;
+      vf2.setRandom();
+      Vector3f vf23;
+      vf23 << vf2, 0;
       VERIFY_MATRIX(glTranslate(vf2), Projective3f(Translation3f(vf23)).matrix());
-      Vector2d vd2; vd2.setRandom(); Vector3d vd23; vd23 << vd2, 0;
+      Vector2d vd2;
+      vd2.setRandom();
+      Vector3d vd23;
+      vd23 << vd2, 0;
       VERIFY_MATRIX(glTranslate(vd2), Projective3d(Translation3d(vd23)).matrix());
 
-      Vector3f vf3; vf3.setRandom();
+      Vector3f vf3;
+      vf3.setRandom();
       VERIFY_MATRIX(glTranslate(vf3), Projective3f(Translation3f(vf3)).matrix());
-      Vector3d vd3; vd3.setRandom();
+      Vector3d vd3;
+      vd3.setRandom();
       VERIFY_MATRIX(glTranslate(vd3), Projective3d(Translation3d(vd3)).matrix());
 
-      Translation<float,3> tf3; tf3.vector().setRandom();
+      Translation<float, 3> tf3;
+      tf3.vector().setRandom();
       VERIFY_MATRIX(glTranslate(tf3), Projective3f(tf3).matrix());
 
-      Translation<double,3> td3;  td3.vector().setRandom();
+      Translation<double, 3> td3;
+      td3.vector().setRandom();
       VERIFY_MATRIX(glTranslate(td3), Projective3d(td3).matrix());
     }
 
     // scaling (2D and 3D)
     {
-      Vector2f vf2; vf2.setRandom(); Vector3f vf23; vf23 << vf2, 1;
+      Vector2f vf2;
+      vf2.setRandom();
+      Vector3f vf23;
+      vf23 << vf2, 1;
       VERIFY_MATRIX(glScale(vf2), Projective3f(Scaling(vf23)).matrix());
-      Vector2d vd2; vd2.setRandom(); Vector3d vd23; vd23 << vd2, 1;
+      Vector2d vd2;
+      vd2.setRandom();
+      Vector3d vd23;
+      vd23 << vd2, 1;
       VERIFY_MATRIX(glScale(vd2), Projective3d(Scaling(vd23)).matrix());
 
-      Vector3f vf3; vf3.setRandom();
+      Vector3f vf3;
+      vf3.setRandom();
       VERIFY_MATRIX(glScale(vf3), Projective3f(Scaling(vf3)).matrix());
-      Vector3d vd3; vd3.setRandom();
+      Vector3d vd3;
+      vd3.setRandom();
       VERIFY_MATRIX(glScale(vd3), Projective3d(Scaling(vd3)).matrix());
 
       UniformScaling<float> usf(internal::random<float>());
@@ -369,32 +379,32 @@
   {
     // vertex shader.
     std::string vtx = format(
-      "${GLSL_VERSION}\n"
-      "void main(void) {\n"
-      "  gl_Position = vec4(0,0,0,1);\n"
-      "}\n",
-      glsl_vars, glsl_vals);
-
-#ifdef GL_VERSION_2_0
-    if(GLEW_VERSION_2_0 && GL_VERSION_2_0)
-    {
-      std::string frg = format(
         "${GLSL_VERSION}\n"
-        "uniform vec2 v2f;\n"
-        "uniform vec3 v3f;\n"
-        "uniform vec4 v4f;\n"
-        "uniform ivec2 v2i;\n"
-        "uniform ivec3 v3i;\n"
-        "uniform ivec4 v4i;\n"
-        "uniform mat2 m2f;\n"
-        "uniform mat3 m3f;\n"
-        "uniform mat4 m4f;\n"
-        "${FRAG_OUTPUT_DECLARATION}\n"
-        "void main(void) { \n"
-        "  ${FRAG_OUTPUT_VARIABLE} = vec4(v2f[0]+v3f[0]+v4f[0])+vec4(v2i[0]+v3i[0]+v4i[0])+vec4(m2f[0][0]+m3f[0][0]+m4f[0][0]);\n"
+        "void main(void) {\n"
+        "  gl_Position = vec4(0,0,0,1);\n"
         "}\n",
         glsl_vars, glsl_vals);
 
+#ifdef GL_VERSION_2_0
+    if (GLEW_VERSION_2_0 && GL_VERSION_2_0) {
+      std::string frg = format(
+          "${GLSL_VERSION}\n"
+          "uniform vec2 v2f;\n"
+          "uniform vec3 v3f;\n"
+          "uniform vec4 v4f;\n"
+          "uniform ivec2 v2i;\n"
+          "uniform ivec3 v3i;\n"
+          "uniform ivec4 v4i;\n"
+          "uniform mat2 m2f;\n"
+          "uniform mat3 m3f;\n"
+          "uniform mat4 m4f;\n"
+          "${FRAG_OUTPUT_DECLARATION}\n"
+          "void main(void) { \n"
+          "  ${FRAG_OUTPUT_VARIABLE} = "
+          "vec4(v2f[0]+v3f[0]+v4f[0])+vec4(v2i[0]+v3i[0]+v4i[0])+vec4(m2f[0][0]+m3f[0][0]+m4f[0][0]);\n"
+          "}\n",
+          glsl_vars, glsl_vals);
+
       GLint prg_id = createProgram(vtx, frg);
       VERIFY(prg_id > 0 && "Failed to create program.");
       VERIFY_UNIFORM(fv, v2f, Vector2f);
@@ -407,37 +417,35 @@
       VERIFY_UNIFORM(fv, m3f, Matrix3f);
       VERIFY_UNIFORM(fv, m4f, Matrix4f);
       glDeleteProgram(prg_id);
-    }
-    else
+    } else
 #endif
       std::cerr << "Warning: opengl 2.0 was not tested.\n";
 
 #ifdef GL_VERSION_2_1
-    if(GLEW_VERSION_2_1 && GL_VERSION_2_1 &&
-        (gl_major_version > 2 || (gl_major_version == 2 && gl_minor_version >= 1)))
-    {
+    if (GLEW_VERSION_2_1 && GL_VERSION_2_1 &&
+        (gl_major_version > 2 || (gl_major_version == 2 && gl_minor_version >= 1))) {
       std::string frg = format(
-        "${GLSL_VERSION}\n"
-        "uniform mat2x3 m23f;\n"
-        "uniform mat3x2 m32f;\n"
-        "uniform mat2x4 m24f;\n"
-        "uniform mat4x2 m42f;\n"
-        "uniform mat3x4 m34f;\n"
-        "uniform mat4x3 m43f;\n"
-        "${FRAG_OUTPUT_DECLARATION}\n"
-        "void main(void) {\n"
-        "  ${FRAG_OUTPUT_VARIABLE} = vec4(m23f[0][0]+m32f[0][0]+m24f[0][0]+m42f[0][0]+m34f[0][0]+m43f[0][0]);\n"
-        "}\n",
-        glsl_vars, glsl_vals);
+          "${GLSL_VERSION}\n"
+          "uniform mat2x3 m23f;\n"
+          "uniform mat3x2 m32f;\n"
+          "uniform mat2x4 m24f;\n"
+          "uniform mat4x2 m42f;\n"
+          "uniform mat3x4 m34f;\n"
+          "uniform mat4x3 m43f;\n"
+          "${FRAG_OUTPUT_DECLARATION}\n"
+          "void main(void) {\n"
+          "  ${FRAG_OUTPUT_VARIABLE} = vec4(m23f[0][0]+m32f[0][0]+m24f[0][0]+m42f[0][0]+m34f[0][0]+m43f[0][0]);\n"
+          "}\n",
+          glsl_vars, glsl_vals);
 
       GLint prg_id = createProgram(vtx, frg);
       VERIFY(prg_id > 0 && "Failed to create program.");
-      typedef Matrix<float,2,3> Matrix23f;
-      typedef Matrix<float,3,2> Matrix32f;
-      typedef Matrix<float,2,4> Matrix24f;
-      typedef Matrix<float,4,2> Matrix42f;
-      typedef Matrix<float,3,4> Matrix34f;
-      typedef Matrix<float,4,3> Matrix43f;
+      typedef Matrix<float, 2, 3> Matrix23f;
+      typedef Matrix<float, 3, 2> Matrix32f;
+      typedef Matrix<float, 2, 4> Matrix24f;
+      typedef Matrix<float, 4, 2> Matrix42f;
+      typedef Matrix<float, 3, 4> Matrix34f;
+      typedef Matrix<float, 4, 3> Matrix43f;
 
       VERIFY_UNIFORM(fv, m23f, Matrix23f);
       VERIFY_UNIFORM(fv, m32f, Matrix32f);
@@ -446,37 +454,34 @@
       VERIFY_UNIFORM(fv, m34f, Matrix34f);
       VERIFY_UNIFORM(fv, m43f, Matrix43f);
       glDeleteProgram(prg_id);
-    }
-    else
+    } else
 #endif
       std::cerr << "Warning: opengl 2.1 was not tested.\n";
 
 #ifdef GL_VERSION_3_0
-    if(GLEW_VERSION_3_0 && GL_VERSION_3_0 && gl_major_version >= 3)
-    {
+    if (GLEW_VERSION_3_0 && GL_VERSION_3_0 && gl_major_version >= 3) {
       std::string frg = format(
-        "${GLSL_VERSION}\n"
-        "uniform uvec2 v2ui;\n"
-        "uniform uvec3 v3ui;\n"
-        "uniform uvec4 v4ui;\n"
-        "${FRAG_OUTPUT_DECLARATION}\n"
-        "void main(void) {\n"
-        "  ${FRAG_OUTPUT_VARIABLE} = vec4(v2ui[0]+v3ui[0]+v4ui[0]);\n"
-        "}\n",
-        glsl_vars, glsl_vals);
+          "${GLSL_VERSION}\n"
+          "uniform uvec2 v2ui;\n"
+          "uniform uvec3 v3ui;\n"
+          "uniform uvec4 v4ui;\n"
+          "${FRAG_OUTPUT_DECLARATION}\n"
+          "void main(void) {\n"
+          "  ${FRAG_OUTPUT_VARIABLE} = vec4(v2ui[0]+v3ui[0]+v4ui[0]);\n"
+          "}\n",
+          glsl_vars, glsl_vals);
 
       GLint prg_id = createProgram(vtx, frg);
       VERIFY(prg_id > 0 && "Failed to create program.");
-      typedef Matrix<unsigned int,2,1> Vector2ui;
-      typedef Matrix<unsigned int,3,1> Vector3ui;
-      typedef Matrix<unsigned int,4,1> Vector4ui;
+      typedef Matrix<unsigned int, 2, 1> Vector2ui;
+      typedef Matrix<unsigned int, 3, 1> Vector3ui;
+      typedef Matrix<unsigned int, 4, 1> Vector4ui;
 
       VERIFY_UNIFORMi(v2ui, Vector2ui);
       VERIFY_UNIFORMi(v3ui, Vector3ui);
       VERIFY_UNIFORMi(v4ui, Vector4ui);
       glDeleteProgram(prg_id);
-    }
-    else
+    } else
 #endif
       std::cerr << "Warning: opengl 3.0 was not tested.\n";
 
@@ -484,23 +489,20 @@
     bool has_fp64_native = (gl_major_version == 4 && gl_minor_version >= 1);
     bool has_fp64_extension = false;
 #ifdef GLEW_ARB_gpu_shader_fp64
-    if(GLEW_ARB_gpu_shader_fp64)
-    {
+    if (GLEW_ARB_gpu_shader_fp64) {
       // Check that extension can actually be compiled.
-      if (has_fp64_extension)
-      {
+      if (has_fp64_extension) {
         std::string frg = format(
-          "${GLSL_VERSION}\n"
-          "#extension GL_ARB_gpu_shader_fp64 : enable\n"
-          "uniform dvec2 dv2;\n"
-          "${FRAG_OUTPUT_DECLARATION}\n"
-          "void main(void) {\n"
-          "  ${FRAG_OUTPUT_VARIABLE} = vec4(dv2.x, dv2.y, dv2.x, dv2.y);\n"
-          "}\n",
-          glsl_vars, glsl_vals);
+            "${GLSL_VERSION}\n"
+            "#extension GL_ARB_gpu_shader_fp64 : enable\n"
+            "uniform dvec2 dv2;\n"
+            "${FRAG_OUTPUT_DECLARATION}\n"
+            "void main(void) {\n"
+            "  ${FRAG_OUTPUT_VARIABLE} = vec4(dv2.x, dv2.y, dv2.x, dv2.y);\n"
+            "}\n",
+            glsl_vars, glsl_vals);
         GLint prg_id = createProgram(vtx, frg, /*print_errors=*/false);
-        if (prg_id)
-        {
+        if (prg_id) {
           has_fp64_extension = true;
           glDeleteProgram(prg_id);
         }
@@ -508,40 +510,35 @@
     }
 #endif
 
-    if( has_fp64_native || has_fp64_extension )
-    {
+    if (has_fp64_native || has_fp64_extension) {
       std::vector<std::string> glsl_vars_with_extension = glsl_vars;
       glsl_vars_with_extension.push_back("${GLSL_EXTENSIONS}");
       std::vector<std::string> glsl_vals_with_extension = glsl_vals;
-      if (has_fp64_extension)
-      {
+      if (has_fp64_extension) {
         glsl_vals_with_extension.push_back("#extension GL_ARB_gpu_shader_fp64 : enable");
-      }
-      else
-      {
+      } else {
         glsl_vals_with_extension.push_back("");
       }
 
       std::string frg = format(
-        "${GLSL_VERSION}\n"
-        "${GLSL_EXTENSIONS}\n"
-        "uniform dvec2 v2d;\n"
-        "uniform dvec3 v3d;\n"
-        "uniform dvec4 v4d;\n"
-        "${FRAG_OUTPUT_DECLARATION}\n"
-        "void main(void) {\n"
-        "  ${FRAG_OUTPUT_VARIABLE} = vec4(v2d[0]+v3d[0]+v4d[0]);\n"
-        "}\n",
-        glsl_vars_with_extension, glsl_vals_with_extension);
+          "${GLSL_VERSION}\n"
+          "${GLSL_EXTENSIONS}\n"
+          "uniform dvec2 v2d;\n"
+          "uniform dvec3 v3d;\n"
+          "uniform dvec4 v4d;\n"
+          "${FRAG_OUTPUT_DECLARATION}\n"
+          "void main(void) {\n"
+          "  ${FRAG_OUTPUT_VARIABLE} = vec4(v2d[0]+v3d[0]+v4d[0]);\n"
+          "}\n",
+          glsl_vars_with_extension, glsl_vals_with_extension);
 
-      GLint prg_id = createProgram(vtx,frg);
+      GLint prg_id = createProgram(vtx, frg);
       VERIFY(prg_id > 0 && "Failed to create program.");
       VERIFY_UNIFORM(dv, v2d, Vector2d);
       VERIFY_UNIFORM(dv, v3d, Vector3d);
       VERIFY_UNIFORM(dv, v4d, Vector4d);
       glDeleteProgram(prg_id);
-    }
-    else
+    } else
       std::cerr << "Warning: dvec (fp64) was not tested.\n";
   }
 
@@ -556,8 +553,7 @@
 #endif
 }
 
-EIGEN_DECLARE_TEST(openglsupport)
-{
+EIGEN_DECLARE_TEST(openglsupport) {
   int argc = 0;
   glutInit(&argc, 0);
 
@@ -579,15 +575,13 @@
   glutInitWindowSize(10, 10);
 
   int window = glutCreateWindow("Eigen");
-  if(window <= 0)
-  {
+  if (window <= 0) {
     std::cerr << "Error: Unable to create GLUT Window.\n";
     exit(1);
   }
 
   glewExperimental = GL_TRUE;
-  if(glewInit() != GLEW_OK)
-  {
+  if (glewInit() != GLEW_OK) {
     std::cerr << "Warning: Failed to initialize GLEW.\n";
     exit(1);
   }
diff --git a/unsupported/test/polynomialsolver.cpp b/unsupported/test/polynomialsolver.cpp
index fed9f89..12d137d 100644
--- a/unsupported/test/polynomialsolver.cpp
+++ b/unsupported/test/polynomialsolver.cpp
@@ -16,57 +16,50 @@
 
 namespace Eigen {
 namespace internal {
-template<int Size>
-struct increment_if_fixed_size
-{
-  enum {
-    ret = (Size == Dynamic) ? Dynamic : Size+1
-  };
+template <int Size>
+struct increment_if_fixed_size {
+  enum { ret = (Size == Dynamic) ? Dynamic : Size + 1 };
 };
-}
-}
+}  // namespace internal
+}  // namespace Eigen
 
-template<typename PolynomialType>
-PolynomialType polyder(const PolynomialType& p)
-{
+template <typename PolynomialType>
+PolynomialType polyder(const PolynomialType& p) {
   typedef typename PolynomialType::Scalar Scalar;
   PolynomialType res(p.size());
-  for(Index i=1; i<p.size(); ++i)
-    res[i-1] = p[i]*Scalar(i);
-  res[p.size()-1] = 0.;
+  for (Index i = 1; i < p.size(); ++i) res[i - 1] = p[i] * Scalar(i);
+  res[p.size() - 1] = 0.;
   return res;
 }
 
-template<int Deg, typename POLYNOMIAL, typename SOLVER>
-bool aux_evalSolver( const POLYNOMIAL& pols, SOLVER& psolve )
-{
+template <int Deg, typename POLYNOMIAL, typename SOLVER>
+bool aux_evalSolver(const POLYNOMIAL& pols, SOLVER& psolve) {
   typedef typename POLYNOMIAL::Scalar Scalar;
   typedef typename POLYNOMIAL::RealScalar RealScalar;
 
-  typedef typename SOLVER::RootsType    RootsType;
-  typedef Matrix<RealScalar,Deg,1>      EvalRootsType;
+  typedef typename SOLVER::RootsType RootsType;
+  typedef Matrix<RealScalar, Deg, 1> EvalRootsType;
 
-  const Index deg = pols.size()-1;
+  const Index deg = pols.size() - 1;
 
   // Test template constructor from coefficient vector
-  SOLVER solve_constr (pols);
+  SOLVER solve_constr(pols);
 
-  psolve.compute( pols );
-  const RootsType& roots( psolve.roots() );
-  EvalRootsType evr( deg );
+  psolve.compute(pols);
+  const RootsType& roots(psolve.roots());
+  EvalRootsType evr(deg);
   POLYNOMIAL pols_der = polyder(pols);
-  EvalRootsType der( deg );
-  for( int i=0; i<roots.size(); ++i ){
-    evr[i] = std::abs( poly_eval( pols, roots[i] ) );
-    der[i] = numext::maxi(RealScalar(1.), std::abs( poly_eval( pols_der, roots[i] ) ));
+  EvalRootsType der(deg);
+  for (int i = 0; i < roots.size(); ++i) {
+    evr[i] = std::abs(poly_eval(pols, roots[i]));
+    der[i] = numext::maxi(RealScalar(1.), std::abs(poly_eval(pols_der, roots[i])));
   }
 
   // we need to divide by the magnitude of the derivative because
   // with a high derivative is very small error in the value of the root
   // yiels a very large error in the polynomial evaluation.
-  bool evalToZero = (evr.cwiseQuotient(der)).isZero( test_precision<Scalar>() );
-  if( !evalToZero )
-  {
+  bool evalToZero = (evr.cwiseQuotient(der)).isZero(test_precision<Scalar>());
+  if (!evalToZero) {
     cerr << "WRONG root: " << endl;
     cerr << "Polynomial: " << pols.transpose() << endl;
     cerr << "Roots found: " << roots.transpose() << endl;
@@ -74,159 +67,137 @@
     cerr << endl;
   }
 
-  std::vector<RealScalar> rootModuli( roots.size() );
-  Map< EvalRootsType > aux( &rootModuli[0], roots.size() );
+  std::vector<RealScalar> rootModuli(roots.size());
+  Map<EvalRootsType> aux(&rootModuli[0], roots.size());
   aux = roots.array().abs();
-  std::sort( rootModuli.begin(), rootModuli.end() );
-  bool distinctModuli=true;
-  for( size_t i=1; i<rootModuli.size() && distinctModuli; ++i )
-  {
-    if( internal::isApprox( rootModuli[i], rootModuli[i-1] ) ){
-      distinctModuli = false; }
+  std::sort(rootModuli.begin(), rootModuli.end());
+  bool distinctModuli = true;
+  for (size_t i = 1; i < rootModuli.size() && distinctModuli; ++i) {
+    if (internal::isApprox(rootModuli[i], rootModuli[i - 1])) {
+      distinctModuli = false;
+    }
   }
-  VERIFY( evalToZero || !distinctModuli );
+  VERIFY(evalToZero || !distinctModuli);
 
   return distinctModuli;
 }
 
-
-
-
-
-
-
-template<int Deg, typename POLYNOMIAL>
-void evalSolver( const POLYNOMIAL& pols )
-{
+template <int Deg, typename POLYNOMIAL>
+void evalSolver(const POLYNOMIAL& pols) {
   typedef typename POLYNOMIAL::Scalar Scalar;
 
-  typedef PolynomialSolver<Scalar, Deg > PolynomialSolverType;
+  typedef PolynomialSolver<Scalar, Deg> PolynomialSolverType;
 
   PolynomialSolverType psolve;
-  aux_evalSolver<Deg, POLYNOMIAL, PolynomialSolverType>( pols, psolve );
+  aux_evalSolver<Deg, POLYNOMIAL, PolynomialSolverType>(pols, psolve);
 }
 
-
-
-
-template< int Deg, typename POLYNOMIAL, typename ROOTS, typename REAL_ROOTS >
-void evalSolverSugarFunction( const POLYNOMIAL& pols, const ROOTS& roots, const REAL_ROOTS& real_roots )
-{
+template <int Deg, typename POLYNOMIAL, typename ROOTS, typename REAL_ROOTS>
+void evalSolverSugarFunction(const POLYNOMIAL& pols, const ROOTS& roots, const REAL_ROOTS& real_roots) {
   using std::sqrt;
   typedef typename POLYNOMIAL::Scalar Scalar;
   typedef typename POLYNOMIAL::RealScalar RealScalar;
 
-  typedef PolynomialSolver<Scalar, Deg >              PolynomialSolverType;
+  typedef PolynomialSolver<Scalar, Deg> PolynomialSolverType;
 
   PolynomialSolverType psolve;
-  if( aux_evalSolver<Deg, POLYNOMIAL, PolynomialSolverType>( pols, psolve ) )
-  {
-    //It is supposed that
-    // 1) the roots found are correct
-    // 2) the roots have distinct moduli
+  if (aux_evalSolver<Deg, POLYNOMIAL, PolynomialSolverType>(pols, psolve)) {
+    // It is supposed that
+    //  1) the roots found are correct
+    //  2) the roots have distinct moduli
 
-    //Test realRoots
-    std::vector< RealScalar > calc_realRoots;
-    psolve.realRoots( calc_realRoots,  test_precision<RealScalar>());
-    VERIFY_IS_EQUAL( calc_realRoots.size() , (size_t)real_roots.size() );
+    // Test realRoots
+    std::vector<RealScalar> calc_realRoots;
+    psolve.realRoots(calc_realRoots, test_precision<RealScalar>());
+    VERIFY_IS_EQUAL(calc_realRoots.size(), (size_t)real_roots.size());
 
-    const RealScalar psPrec = sqrt( test_precision<RealScalar>() );
+    const RealScalar psPrec = sqrt(test_precision<RealScalar>());
 
-    for( size_t i=0; i<calc_realRoots.size(); ++i )
-    {
+    for (size_t i = 0; i < calc_realRoots.size(); ++i) {
       bool found = false;
-      for( size_t j=0; j<calc_realRoots.size()&& !found; ++j )
-      {
-        if( internal::isApprox( calc_realRoots[i], real_roots[j], psPrec ) ){
-          found = true; }
+      for (size_t j = 0; j < calc_realRoots.size() && !found; ++j) {
+        if (internal::isApprox(calc_realRoots[i], real_roots[j], psPrec)) {
+          found = true;
+        }
       }
-      VERIFY( found );
+      VERIFY(found);
     }
 
-    //Test greatestRoot
-    VERIFY( internal::isApprox( roots.array().abs().maxCoeff(),
-          abs( psolve.greatestRoot() ), psPrec ) );
+    // Test greatestRoot
+    VERIFY(internal::isApprox(roots.array().abs().maxCoeff(), abs(psolve.greatestRoot()), psPrec));
 
-    //Test smallestRoot
-    VERIFY( internal::isApprox( roots.array().abs().minCoeff(),
-          abs( psolve.smallestRoot() ), psPrec ) );
+    // Test smallestRoot
+    VERIFY(internal::isApprox(roots.array().abs().minCoeff(), abs(psolve.smallestRoot()), psPrec));
 
     bool hasRealRoot;
-    //Test absGreatestRealRoot
-    RealScalar r = psolve.absGreatestRealRoot( hasRealRoot );
-    VERIFY( hasRealRoot == (real_roots.size() > 0 ) );
-    if( hasRealRoot ){
-      VERIFY( internal::isApprox( real_roots.array().abs().maxCoeff(), abs(r), psPrec ) );  }
+    // Test absGreatestRealRoot
+    RealScalar r = psolve.absGreatestRealRoot(hasRealRoot);
+    VERIFY(hasRealRoot == (real_roots.size() > 0));
+    if (hasRealRoot) {
+      VERIFY(internal::isApprox(real_roots.array().abs().maxCoeff(), abs(r), psPrec));
+    }
 
-    //Test absSmallestRealRoot
-    r = psolve.absSmallestRealRoot( hasRealRoot );
-    VERIFY( hasRealRoot == (real_roots.size() > 0 ) );
-    if( hasRealRoot ){
-      VERIFY( internal::isApprox( real_roots.array().abs().minCoeff(), abs( r ), psPrec ) ); }
+    // Test absSmallestRealRoot
+    r = psolve.absSmallestRealRoot(hasRealRoot);
+    VERIFY(hasRealRoot == (real_roots.size() > 0));
+    if (hasRealRoot) {
+      VERIFY(internal::isApprox(real_roots.array().abs().minCoeff(), abs(r), psPrec));
+    }
 
-    //Test greatestRealRoot
-    r = psolve.greatestRealRoot( hasRealRoot );
-    VERIFY( hasRealRoot == (real_roots.size() > 0 ) );
-    if( hasRealRoot ){
-      VERIFY( internal::isApprox( real_roots.array().maxCoeff(), r, psPrec ) ); }
+    // Test greatestRealRoot
+    r = psolve.greatestRealRoot(hasRealRoot);
+    VERIFY(hasRealRoot == (real_roots.size() > 0));
+    if (hasRealRoot) {
+      VERIFY(internal::isApprox(real_roots.array().maxCoeff(), r, psPrec));
+    }
 
-    //Test smallestRealRoot
-    r = psolve.smallestRealRoot( hasRealRoot );
-    VERIFY( hasRealRoot == (real_roots.size() > 0 ) );
-    if( hasRealRoot ){
-    VERIFY( internal::isApprox( real_roots.array().minCoeff(), r, psPrec ) ); }
+    // Test smallestRealRoot
+    r = psolve.smallestRealRoot(hasRealRoot);
+    VERIFY(hasRealRoot == (real_roots.size() > 0));
+    if (hasRealRoot) {
+      VERIFY(internal::isApprox(real_roots.array().minCoeff(), r, psPrec));
+    }
   }
 }
 
-
-template<typename Scalar_, int Deg_>
-void polynomialsolver(int deg)
-{
+template <typename Scalar_, int Deg_>
+void polynomialsolver(int deg) {
   typedef typename NumTraits<Scalar_>::Real RealScalar;
-  typedef internal::increment_if_fixed_size<Deg_>     Dim;
-  typedef Matrix<Scalar_,Dim::ret,1>                  PolynomialType;
-  typedef Matrix<Scalar_,Deg_,1>                      EvalRootsType;
-  typedef Matrix<RealScalar,Deg_,1>                   RealRootsType;
+  typedef internal::increment_if_fixed_size<Deg_> Dim;
+  typedef Matrix<Scalar_, Dim::ret, 1> PolynomialType;
+  typedef Matrix<Scalar_, Deg_, 1> EvalRootsType;
+  typedef Matrix<RealScalar, Deg_, 1> RealRootsType;
 
   cout << "Standard cases" << endl;
-  PolynomialType pols = PolynomialType::Random(deg+1);
-  evalSolver<Deg_,PolynomialType>( pols );
+  PolynomialType pols = PolynomialType::Random(deg + 1);
+  evalSolver<Deg_, PolynomialType>(pols);
 
   cout << "Hard cases" << endl;
   Scalar_ multipleRoot = internal::random<Scalar_>();
-  EvalRootsType allRoots = EvalRootsType::Constant(deg,multipleRoot);
-  roots_to_monicPolynomial( allRoots, pols );
-  evalSolver<Deg_,PolynomialType>( pols );
+  EvalRootsType allRoots = EvalRootsType::Constant(deg, multipleRoot);
+  roots_to_monicPolynomial(allRoots, pols);
+  evalSolver<Deg_, PolynomialType>(pols);
 
   cout << "Test sugar" << endl;
   RealRootsType realRoots = RealRootsType::Random(deg);
-  roots_to_monicPolynomial( realRoots, pols );
-  evalSolverSugarFunction<Deg_>(
-      pols,
-      realRoots.template cast <std::complex<RealScalar> >().eval(),
-      realRoots );
+  roots_to_monicPolynomial(realRoots, pols);
+  evalSolverSugarFunction<Deg_>(pols, realRoots.template cast<std::complex<RealScalar> >().eval(), realRoots);
 }
 
-EIGEN_DECLARE_TEST(polynomialsolver)
-{
-  for(int i = 0; i < g_repeat; i++)
-  {
-    CALL_SUBTEST_1( (polynomialsolver<float,1>(1)) );
-    CALL_SUBTEST_2( (polynomialsolver<double,2>(2)) );
-    CALL_SUBTEST_3( (polynomialsolver<double,3>(3)) );
-    CALL_SUBTEST_4( (polynomialsolver<float,4>(4)) );
-    CALL_SUBTEST_5( (polynomialsolver<double,5>(5)) );
-    CALL_SUBTEST_6( (polynomialsolver<float,6>(6)) );
-    CALL_SUBTEST_7( (polynomialsolver<float,7>(7)) );
-    CALL_SUBTEST_8( (polynomialsolver<double,8>(8)) );
+EIGEN_DECLARE_TEST(polynomialsolver) {
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1((polynomialsolver<float, 1>(1)));
+    CALL_SUBTEST_2((polynomialsolver<double, 2>(2)));
+    CALL_SUBTEST_3((polynomialsolver<double, 3>(3)));
+    CALL_SUBTEST_4((polynomialsolver<float, 4>(4)));
+    CALL_SUBTEST_5((polynomialsolver<double, 5>(5)));
+    CALL_SUBTEST_6((polynomialsolver<float, 6>(6)));
+    CALL_SUBTEST_7((polynomialsolver<float, 7>(7)));
+    CALL_SUBTEST_8((polynomialsolver<double, 8>(8)));
 
-    CALL_SUBTEST_9( (polynomialsolver<float,Dynamic>(
-            internal::random<int>(9,13)
-            )) );
-    CALL_SUBTEST_10((polynomialsolver<double,Dynamic>(
-            internal::random<int>(9,13)
-            )) );
-    CALL_SUBTEST_11((polynomialsolver<float,Dynamic>(1)) );
-    CALL_SUBTEST_12((polynomialsolver<std::complex<double>,Dynamic>(internal::random<int>(2,13))) );
+    CALL_SUBTEST_9((polynomialsolver<float, Dynamic>(internal::random<int>(9, 13))));
+    CALL_SUBTEST_10((polynomialsolver<double, Dynamic>(internal::random<int>(9, 13))));
+    CALL_SUBTEST_11((polynomialsolver<float, Dynamic>(1)));
+    CALL_SUBTEST_12((polynomialsolver<std::complex<double>, Dynamic>(internal::random<int>(2, 13))));
   }
 }
diff --git a/unsupported/test/polynomialutils.cpp b/unsupported/test/polynomialutils.cpp
index 15a0f27..f57c874 100644
--- a/unsupported/test/polynomialutils.cpp
+++ b/unsupported/test/polynomialutils.cpp
@@ -15,96 +15,85 @@
 
 namespace Eigen {
 namespace internal {
-template<int Size>
-struct increment_if_fixed_size
-{
-  enum {
-    ret = (Size == Dynamic) ? Dynamic : Size+1
-  };
+template <int Size>
+struct increment_if_fixed_size {
+  enum { ret = (Size == Dynamic) ? Dynamic : Size + 1 };
 };
-}
-}
+}  // namespace internal
+}  // namespace Eigen
 
-template<typename Scalar_, int Deg_>
-void realRoots_to_monicPolynomial_test(int deg)
-{
-  typedef internal::increment_if_fixed_size<Deg_>            Dim;
-  typedef Matrix<Scalar_,Dim::ret,1>                  PolynomialType;
-  typedef Matrix<Scalar_,Deg_,1>                      EvalRootsType;
+template <typename Scalar_, int Deg_>
+void realRoots_to_monicPolynomial_test(int deg) {
+  typedef internal::increment_if_fixed_size<Deg_> Dim;
+  typedef Matrix<Scalar_, Dim::ret, 1> PolynomialType;
+  typedef Matrix<Scalar_, Deg_, 1> EvalRootsType;
 
-  PolynomialType pols(deg+1);
+  PolynomialType pols(deg + 1);
   EvalRootsType roots = EvalRootsType::Random(deg);
-  roots_to_monicPolynomial( roots, pols );
+  roots_to_monicPolynomial(roots, pols);
 
-  EvalRootsType evr( deg );
-  for( int i=0; i<roots.size(); ++i ){
-    evr[i] = std::abs( poly_eval( pols, roots[i] ) ); }
+  EvalRootsType evr(deg);
+  for (int i = 0; i < roots.size(); ++i) {
+    evr[i] = std::abs(poly_eval(pols, roots[i]));
+  }
 
-  bool evalToZero = evr.isZero( test_precision<Scalar_>() );
-  if( !evalToZero ){
-    cerr << evr.transpose() << endl; }
-  VERIFY( evalToZero );
+  bool evalToZero = evr.isZero(test_precision<Scalar_>());
+  if (!evalToZero) {
+    cerr << evr.transpose() << endl;
+  }
+  VERIFY(evalToZero);
 }
 
-template<typename Scalar_> void realRoots_to_monicPolynomial_scalar()
-{
-  CALL_SUBTEST_2( (realRoots_to_monicPolynomial_test<Scalar_,2>(2)) );
-  CALL_SUBTEST_3( (realRoots_to_monicPolynomial_test<Scalar_,3>(3)) );
-  CALL_SUBTEST_4( (realRoots_to_monicPolynomial_test<Scalar_,4>(4)) );
-  CALL_SUBTEST_5( (realRoots_to_monicPolynomial_test<Scalar_,5>(5)) );
-  CALL_SUBTEST_6( (realRoots_to_monicPolynomial_test<Scalar_,6>(6)) );
-  CALL_SUBTEST_7( (realRoots_to_monicPolynomial_test<Scalar_,7>(7)) );
-  CALL_SUBTEST_8( (realRoots_to_monicPolynomial_test<Scalar_,17>(17)) );
+template <typename Scalar_>
+void realRoots_to_monicPolynomial_scalar() {
+  CALL_SUBTEST_2((realRoots_to_monicPolynomial_test<Scalar_, 2>(2)));
+  CALL_SUBTEST_3((realRoots_to_monicPolynomial_test<Scalar_, 3>(3)));
+  CALL_SUBTEST_4((realRoots_to_monicPolynomial_test<Scalar_, 4>(4)));
+  CALL_SUBTEST_5((realRoots_to_monicPolynomial_test<Scalar_, 5>(5)));
+  CALL_SUBTEST_6((realRoots_to_monicPolynomial_test<Scalar_, 6>(6)));
+  CALL_SUBTEST_7((realRoots_to_monicPolynomial_test<Scalar_, 7>(7)));
+  CALL_SUBTEST_8((realRoots_to_monicPolynomial_test<Scalar_, 17>(17)));
 
-  CALL_SUBTEST_9( (realRoots_to_monicPolynomial_test<Scalar_,Dynamic>(
-          internal::random<int>(18,26) )) );
+  CALL_SUBTEST_9((realRoots_to_monicPolynomial_test<Scalar_, Dynamic>(internal::random<int>(18, 26))));
 }
 
+template <typename Scalar_, int Deg_>
+void CauchyBounds(int deg) {
+  typedef internal::increment_if_fixed_size<Deg_> Dim;
+  typedef Matrix<Scalar_, Dim::ret, 1> PolynomialType;
+  typedef Matrix<Scalar_, Deg_, 1> EvalRootsType;
 
-
-
-template<typename Scalar_, int Deg_>
-void CauchyBounds(int deg)
-{
-  typedef internal::increment_if_fixed_size<Deg_>            Dim;
-  typedef Matrix<Scalar_,Dim::ret,1>                  PolynomialType;
-  typedef Matrix<Scalar_,Deg_,1>                      EvalRootsType;
-
-  PolynomialType pols(deg+1);
+  PolynomialType pols(deg + 1);
   EvalRootsType roots = EvalRootsType::Random(deg);
-  roots_to_monicPolynomial( roots, pols );
-  Scalar_ M = cauchy_max_bound( pols );
-  Scalar_ m = cauchy_min_bound( pols );
+  roots_to_monicPolynomial(roots, pols);
+  Scalar_ M = cauchy_max_bound(pols);
+  Scalar_ m = cauchy_min_bound(pols);
   Scalar_ Max = roots.array().abs().maxCoeff();
   Scalar_ min = roots.array().abs().minCoeff();
   bool eval = (M >= Max) && (m <= min);
-  if( !eval )
-  {
+  if (!eval) {
     cerr << "Roots: " << roots << endl;
     cerr << "Bounds: (" << m << ", " << M << ")" << endl;
     cerr << "Min,Max: (" << min << ", " << Max << ")" << endl;
   }
-  VERIFY( eval );
+  VERIFY(eval);
 }
 
-template<typename Scalar_> void CauchyBounds_scalar()
-{
-  CALL_SUBTEST_2( (CauchyBounds<Scalar_,2>(2)) );
-  CALL_SUBTEST_3( (CauchyBounds<Scalar_,3>(3)) );
-  CALL_SUBTEST_4( (CauchyBounds<Scalar_,4>(4)) );
-  CALL_SUBTEST_5( (CauchyBounds<Scalar_,5>(5)) );
-  CALL_SUBTEST_6( (CauchyBounds<Scalar_,6>(6)) );
-  CALL_SUBTEST_7( (CauchyBounds<Scalar_,7>(7)) );
-  CALL_SUBTEST_8( (CauchyBounds<Scalar_,17>(17)) );
+template <typename Scalar_>
+void CauchyBounds_scalar() {
+  CALL_SUBTEST_2((CauchyBounds<Scalar_, 2>(2)));
+  CALL_SUBTEST_3((CauchyBounds<Scalar_, 3>(3)));
+  CALL_SUBTEST_4((CauchyBounds<Scalar_, 4>(4)));
+  CALL_SUBTEST_5((CauchyBounds<Scalar_, 5>(5)));
+  CALL_SUBTEST_6((CauchyBounds<Scalar_, 6>(6)));
+  CALL_SUBTEST_7((CauchyBounds<Scalar_, 7>(7)));
+  CALL_SUBTEST_8((CauchyBounds<Scalar_, 17>(17)));
 
-  CALL_SUBTEST_9( (CauchyBounds<Scalar_,Dynamic>(
-          internal::random<int>(18,26) )) );
+  CALL_SUBTEST_9((CauchyBounds<Scalar_, Dynamic>(internal::random<int>(18, 26))));
 }
 
-EIGEN_DECLARE_TEST(polynomialutils)
-{
-  for(int i = 0; i < g_repeat; i++)
-  {
+EIGEN_DECLARE_TEST(polynomialutils) {
+  for (int i = 0; i < g_repeat; i++) {
     realRoots_to_monicPolynomial_scalar<double>();
     realRoots_to_monicPolynomial_scalar<float>();
     CauchyBounds_scalar<double>();
diff --git a/unsupported/test/sparse_extra.cpp b/unsupported/test/sparse_extra.cpp
index 05a9066..22d6665 100644
--- a/unsupported/test/sparse_extra.cpp
+++ b/unsupported/test/sparse_extra.cpp
@@ -19,17 +19,16 @@
 
 #include <Eigen/SparseExtra>
 
-template<typename SetterType,typename DenseType, typename Scalar, int Options>
-bool test_random_setter(SparseMatrix<Scalar,Options>& sm, const DenseType& ref, const std::vector<Vector2i>& nonzeroCoords)
-{
+template <typename SetterType, typename DenseType, typename Scalar, int Options>
+bool test_random_setter(SparseMatrix<Scalar, Options>& sm, const DenseType& ref,
+                        const std::vector<Vector2i>& nonzeroCoords) {
   {
     sm.setZero();
     SetterType w(sm);
     std::vector<Vector2i> remaining = nonzeroCoords;
-    while(!remaining.empty())
-    {
-      int i = internal::random<int>(0,static_cast<int>(remaining.size())-1);
-      w(remaining[i].x(),remaining[i].y()) = ref.coeff(remaining[i].x(),remaining[i].y());
+    while (!remaining.empty()) {
+      int i = internal::random<int>(0, static_cast<int>(remaining.size()) - 1);
+      w(remaining[i].x(), remaining[i].y()) = ref.coeff(remaining[i].x(), remaining[i].y());
       remaining[i] = remaining.back();
       remaining.pop_back();
     }
@@ -37,16 +36,16 @@
   return sm.isApprox(ref);
 }
 
-template<typename SparseMatrixType> void sparse_extra(const SparseMatrixType& ref)
-{
+template <typename SparseMatrixType>
+void sparse_extra(const SparseMatrixType& ref) {
   const Index rows = ref.rows();
   const Index cols = ref.cols();
   typedef typename SparseMatrixType::Scalar Scalar;
   enum { Flags = SparseMatrixType::Flags };
 
-  double density = (std::max)(8./(rows*cols), 0.01);
-  typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrix;
-  typedef Matrix<Scalar,Dynamic,1> DenseVector;
+  double density = (std::max)(8. / (rows * cols), 0.01);
+  typedef Matrix<Scalar, Dynamic, Dynamic> DenseMatrix;
+  typedef Matrix<Scalar, Dynamic, 1> DenseVector;
   Scalar eps = 1e-6;
 
   SparseMatrixType m(rows, cols);
@@ -57,15 +56,13 @@
   std::vector<Vector2i> nonzeroCoords;
   initSparse<Scalar>(density, refMat, m, 0, &zeroCoords, &nonzeroCoords);
 
-  if (zeroCoords.size()==0 || nonzeroCoords.size()==0)
-    return;
+  if (zeroCoords.size() == 0 || nonzeroCoords.size() == 0) return;
 
   // test coeff and coeffRef
-  for (int i=0; i<(int)zeroCoords.size(); ++i)
-  {
-    VERIFY_IS_MUCH_SMALLER_THAN( m.coeff(zeroCoords[i].x(),zeroCoords[i].y()), eps );
-    if(internal::is_same<SparseMatrixType,SparseMatrix<Scalar,Flags> >::value)
-      VERIFY_RAISES_ASSERT( m.coeffRef(zeroCoords[0].x(),zeroCoords[0].y()) = 5 );
+  for (int i = 0; i < (int)zeroCoords.size(); ++i) {
+    VERIFY_IS_MUCH_SMALLER_THAN(m.coeff(zeroCoords[i].x(), zeroCoords[i].y()), eps);
+    if (internal::is_same<SparseMatrixType, SparseMatrix<Scalar, Flags> >::value)
+      VERIFY_RAISES_ASSERT(m.coeffRef(zeroCoords[0].x(), zeroCoords[0].y()) = 5);
   }
   VERIFY_IS_APPROX(m, refMat);
 
@@ -75,28 +72,27 @@
   VERIFY_IS_APPROX(m, refMat);
 
   // random setter
-//   {
-//     m.setZero();
-//     VERIFY_IS_NOT_APPROX(m, refMat);
-//     SparseSetter<SparseMatrixType, RandomAccessPattern> w(m);
-//     std::vector<Vector2i> remaining = nonzeroCoords;
-//     while(!remaining.empty())
-//     {
-//       int i = internal::random<int>(0,remaining.size()-1);
-//       w->coeffRef(remaining[i].x(),remaining[i].y()) = refMat.coeff(remaining[i].x(),remaining[i].y());
-//       remaining[i] = remaining.back();
-//       remaining.pop_back();
-//     }
-//   }
-//   VERIFY_IS_APPROX(m, refMat);
+  //   {
+  //     m.setZero();
+  //     VERIFY_IS_NOT_APPROX(m, refMat);
+  //     SparseSetter<SparseMatrixType, RandomAccessPattern> w(m);
+  //     std::vector<Vector2i> remaining = nonzeroCoords;
+  //     while(!remaining.empty())
+  //     {
+  //       int i = internal::random<int>(0,remaining.size()-1);
+  //       w->coeffRef(remaining[i].x(),remaining[i].y()) = refMat.coeff(remaining[i].x(),remaining[i].y());
+  //       remaining[i] = remaining.back();
+  //       remaining.pop_back();
+  //     }
+  //   }
+  //   VERIFY_IS_APPROX(m, refMat);
 
-    VERIFY(( test_random_setter<RandomSetter<SparseMatrixType, StdMapTraits> >(m,refMat,nonzeroCoords) ));
-    VERIFY(( test_random_setter<RandomSetter<SparseMatrixType, StdUnorderedMapTraits> >(m,refMat,nonzeroCoords) ));
-    #ifdef EIGEN_GOOGLEHASH_SUPPORT
-    VERIFY(( test_random_setter<RandomSetter<SparseMatrixType, GoogleDenseHashMapTraits> >(m,refMat,nonzeroCoords) ));
-    VERIFY(( test_random_setter<RandomSetter<SparseMatrixType, GoogleSparseHashMapTraits> >(m,refMat,nonzeroCoords) ));
-    #endif
-
+  VERIFY((test_random_setter<RandomSetter<SparseMatrixType, StdMapTraits> >(m, refMat, nonzeroCoords)));
+  VERIFY((test_random_setter<RandomSetter<SparseMatrixType, StdUnorderedMapTraits> >(m, refMat, nonzeroCoords)));
+#ifdef EIGEN_GOOGLEHASH_SUPPORT
+  VERIFY((test_random_setter<RandomSetter<SparseMatrixType, GoogleDenseHashMapTraits> >(m, refMat, nonzeroCoords)));
+  VERIFY((test_random_setter<RandomSetter<SparseMatrixType, GoogleSparseHashMapTraits> >(m, refMat, nonzeroCoords)));
+#endif
 
   // test RandomSetter
   /*{
@@ -111,63 +107,57 @@
     }
     VERIFY_IS_APPROX(m1, m2);
   }*/
-
-
 }
 
-
-template<typename SparseMatrixType>
-void check_marketio()
-{
+template <typename SparseMatrixType>
+void check_marketio() {
   typedef Matrix<typename SparseMatrixType::Scalar, Dynamic, Dynamic> DenseMatrix;
-  Index rows = internal::random<Index>(1,100);
-  Index cols = internal::random<Index>(1,100);
+  Index rows = internal::random<Index>(1, 100);
+  Index cols = internal::random<Index>(1, 100);
   SparseMatrixType m1, m2;
   m1 = DenseMatrix::Random(rows, cols).sparseView();
   saveMarket(m1, "sparse_extra.mtx");
   loadMarket(m2, "sparse_extra.mtx");
-  VERIFY_IS_EQUAL(DenseMatrix(m1),DenseMatrix(m2));
+  VERIFY_IS_EQUAL(DenseMatrix(m1), DenseMatrix(m2));
 }
 
-template<typename VectorType>
-void check_marketio_vector()
-{
-  Index size = internal::random<Index>(1,100);
+template <typename VectorType>
+void check_marketio_vector() {
+  Index size = internal::random<Index>(1, 100);
   VectorType v1, v2;
   v1 = VectorType::Random(size);
   saveMarketVector(v1, "vector_extra.mtx");
   loadMarketVector(v2, "vector_extra.mtx");
-  VERIFY_IS_EQUAL(v1,v2);
+  VERIFY_IS_EQUAL(v1, v2);
 }
 
-template<typename DenseMatrixType>
-void check_marketio_dense()
-{
-  Index rows=DenseMatrixType::MaxRowsAtCompileTime;
-  if (DenseMatrixType::MaxRowsAtCompileTime==Dynamic){
-    rows=internal::random<Index>(1,100);
-  }else if(DenseMatrixType::RowsAtCompileTime==Dynamic){
-    rows=internal::random<Index>(1,DenseMatrixType::MaxRowsAtCompileTime);
+template <typename DenseMatrixType>
+void check_marketio_dense() {
+  Index rows = DenseMatrixType::MaxRowsAtCompileTime;
+  if (DenseMatrixType::MaxRowsAtCompileTime == Dynamic) {
+    rows = internal::random<Index>(1, 100);
+  } else if (DenseMatrixType::RowsAtCompileTime == Dynamic) {
+    rows = internal::random<Index>(1, DenseMatrixType::MaxRowsAtCompileTime);
   }
 
-  Index cols =DenseMatrixType::MaxColsAtCompileTime; 
-  if (DenseMatrixType::MaxColsAtCompileTime==Dynamic){
-    cols=internal::random<Index>(1,100);
-  }else if(DenseMatrixType::ColsAtCompileTime==Dynamic){
-    cols=internal::random<Index>(1,DenseMatrixType::MaxColsAtCompileTime);
+  Index cols = DenseMatrixType::MaxColsAtCompileTime;
+  if (DenseMatrixType::MaxColsAtCompileTime == Dynamic) {
+    cols = internal::random<Index>(1, 100);
+  } else if (DenseMatrixType::ColsAtCompileTime == Dynamic) {
+    cols = internal::random<Index>(1, DenseMatrixType::MaxColsAtCompileTime);
   }
 
   DenseMatrixType m1, m2;
-  m1= DenseMatrixType::Random(rows,cols);
+  m1 = DenseMatrixType::Random(rows, cols);
   saveMarketDense(m1, "dense_extra.mtx");
   loadMarketDense(m2, "dense_extra.mtx");
-  VERIFY_IS_EQUAL(m1,m2);
+  VERIFY_IS_EQUAL(m1, m2);
 }
 
 template <typename Scalar>
 void check_sparse_inverse() {
   typedef SparseMatrix<Scalar> MatrixType;
- 
+
   Matrix<Scalar, -1, -1> A;
   A.resize(1000, 1000);
   A.fill(0);
@@ -206,41 +196,40 @@
   VERIFY_IS_APPROX_OR_LESS_THAN(sumdiff, 1e-10);
 }
 
-EIGEN_DECLARE_TEST(sparse_extra)
-{
-  for(int i = 0; i < g_repeat; i++) {
-    int s = Eigen::internal::random<int>(1,50);
-    CALL_SUBTEST_1( sparse_extra(SparseMatrix<double>(8, 8)) );
-    CALL_SUBTEST_2( sparse_extra(SparseMatrix<std::complex<double> >(s, s)) );
-    CALL_SUBTEST_1( sparse_extra(SparseMatrix<double>(s, s)) );
+EIGEN_DECLARE_TEST(sparse_extra) {
+  for (int i = 0; i < g_repeat; i++) {
+    int s = Eigen::internal::random<int>(1, 50);
+    CALL_SUBTEST_1(sparse_extra(SparseMatrix<double>(8, 8)));
+    CALL_SUBTEST_2(sparse_extra(SparseMatrix<std::complex<double> >(s, s)));
+    CALL_SUBTEST_1(sparse_extra(SparseMatrix<double>(s, s)));
 
-    CALL_SUBTEST_3( (check_marketio<SparseMatrix<float,ColMajor,int> >()) );
-    CALL_SUBTEST_3( (check_marketio<SparseMatrix<double,ColMajor,int> >()) );
-    CALL_SUBTEST_3( (check_marketio<SparseMatrix<std::complex<float>,ColMajor,int> >()) );
-    CALL_SUBTEST_3( (check_marketio<SparseMatrix<std::complex<double>,ColMajor,int> >()) );
-    CALL_SUBTEST_3( (check_marketio<SparseMatrix<float,ColMajor,long int> >()) );
-    CALL_SUBTEST_3( (check_marketio<SparseMatrix<double,ColMajor,long int> >()) );
-    CALL_SUBTEST_3( (check_marketio<SparseMatrix<std::complex<float>,ColMajor,long int> >()) );
-    CALL_SUBTEST_3( (check_marketio<SparseMatrix<std::complex<double>,ColMajor,long int> >()) );
+    CALL_SUBTEST_3((check_marketio<SparseMatrix<float, ColMajor, int> >()));
+    CALL_SUBTEST_3((check_marketio<SparseMatrix<double, ColMajor, int> >()));
+    CALL_SUBTEST_3((check_marketio<SparseMatrix<std::complex<float>, ColMajor, int> >()));
+    CALL_SUBTEST_3((check_marketio<SparseMatrix<std::complex<double>, ColMajor, int> >()));
+    CALL_SUBTEST_3((check_marketio<SparseMatrix<float, ColMajor, long int> >()));
+    CALL_SUBTEST_3((check_marketio<SparseMatrix<double, ColMajor, long int> >()));
+    CALL_SUBTEST_3((check_marketio<SparseMatrix<std::complex<float>, ColMajor, long int> >()));
+    CALL_SUBTEST_3((check_marketio<SparseMatrix<std::complex<double>, ColMajor, long int> >()));
 
-    CALL_SUBTEST_4( (check_marketio_dense<Matrix<float,Dynamic,Dynamic> >()) );
-    CALL_SUBTEST_4( (check_marketio_dense<Matrix<float,Dynamic,Dynamic,RowMajor> >()) );
-    CALL_SUBTEST_4( (check_marketio_dense<Matrix<double,Dynamic,Dynamic> >()) );
-    CALL_SUBTEST_4( (check_marketio_dense<Matrix<std::complex<float>,Dynamic,Dynamic> >()) );
-    CALL_SUBTEST_4( (check_marketio_dense<Matrix<std::complex<double>,Dynamic,Dynamic> >()) );
-    CALL_SUBTEST_4( (check_marketio_dense<Matrix<float,Dynamic,3> >()) );
-    CALL_SUBTEST_4( (check_marketio_dense<Matrix<double,3,Dynamic> >()) );
-    CALL_SUBTEST_4( (check_marketio_dense<Matrix<double,3,4> >()) );
-    CALL_SUBTEST_4( (check_marketio_dense<Matrix<double,Dynamic,Dynamic,ColMajor,5,5> >()) );
+    CALL_SUBTEST_4((check_marketio_dense<Matrix<float, Dynamic, Dynamic> >()));
+    CALL_SUBTEST_4((check_marketio_dense<Matrix<float, Dynamic, Dynamic, RowMajor> >()));
+    CALL_SUBTEST_4((check_marketio_dense<Matrix<double, Dynamic, Dynamic> >()));
+    CALL_SUBTEST_4((check_marketio_dense<Matrix<std::complex<float>, Dynamic, Dynamic> >()));
+    CALL_SUBTEST_4((check_marketio_dense<Matrix<std::complex<double>, Dynamic, Dynamic> >()));
+    CALL_SUBTEST_4((check_marketio_dense<Matrix<float, Dynamic, 3> >()));
+    CALL_SUBTEST_4((check_marketio_dense<Matrix<double, 3, Dynamic> >()));
+    CALL_SUBTEST_4((check_marketio_dense<Matrix<double, 3, 4> >()));
+    CALL_SUBTEST_4((check_marketio_dense<Matrix<double, Dynamic, Dynamic, ColMajor, 5, 5> >()));
 
-    CALL_SUBTEST_5( (check_marketio_vector<Matrix<float,1,Dynamic> >()) );
-    CALL_SUBTEST_5( (check_marketio_vector<Matrix<double,1,Dynamic> >()) );
-    CALL_SUBTEST_5( (check_marketio_vector<Matrix<std::complex<float>,1,Dynamic> >()) );
-    CALL_SUBTEST_5( (check_marketio_vector<Matrix<std::complex<double>,1,Dynamic> >()) );
-    CALL_SUBTEST_5( (check_marketio_vector<Matrix<float,Dynamic,1> >()) );
-    CALL_SUBTEST_5( (check_marketio_vector<Matrix<double,Dynamic,1> >()) );
-    CALL_SUBTEST_5( (check_marketio_vector<Matrix<std::complex<float>,Dynamic,1> >()) );
-    CALL_SUBTEST_5( (check_marketio_vector<Matrix<std::complex<double>,Dynamic,1> >()) );
+    CALL_SUBTEST_5((check_marketio_vector<Matrix<float, 1, Dynamic> >()));
+    CALL_SUBTEST_5((check_marketio_vector<Matrix<double, 1, Dynamic> >()));
+    CALL_SUBTEST_5((check_marketio_vector<Matrix<std::complex<float>, 1, Dynamic> >()));
+    CALL_SUBTEST_5((check_marketio_vector<Matrix<std::complex<double>, 1, Dynamic> >()));
+    CALL_SUBTEST_5((check_marketio_vector<Matrix<float, Dynamic, 1> >()));
+    CALL_SUBTEST_5((check_marketio_vector<Matrix<double, Dynamic, 1> >()));
+    CALL_SUBTEST_5((check_marketio_vector<Matrix<std::complex<float>, Dynamic, 1> >()));
+    CALL_SUBTEST_5((check_marketio_vector<Matrix<std::complex<double>, Dynamic, 1> >()));
 
     CALL_SUBTEST_6((check_sparse_inverse<double>()));
 
diff --git a/unsupported/test/special_functions.cpp b/unsupported/test/special_functions.cpp
index 44c7753..b16a7bb 100644
--- a/unsupported/test/special_functions.cpp
+++ b/unsupported/test/special_functions.cpp
@@ -12,32 +12,30 @@
 #include "../Eigen/SpecialFunctions"
 
 // Hack to allow "implicit" conversions from double to Scalar via comma-initialization.
-template<typename Derived>
+template <typename Derived>
 Eigen::CommaInitializer<Derived> operator<<(Eigen::DenseBase<Derived>& dense, double v) {
   return (dense << static_cast<typename Derived::Scalar>(v));
 }
 
-template<typename XprType>
+template <typename XprType>
 Eigen::CommaInitializer<XprType>& operator,(Eigen::CommaInitializer<XprType>& ci, double v) {
   return (ci, static_cast<typename XprType::Scalar>(v));
 }
 
-template<typename X, typename Y>
-void verify_component_wise(const X& x, const Y& y)
-{
-  for(Index i=0; i<x.size(); ++i)
-  {
-    if((numext::isfinite)(y(i)))
-      VERIFY_IS_APPROX( x(i), y(i) );
-    else if((numext::isnan)(y(i)))
+template <typename X, typename Y>
+void verify_component_wise(const X& x, const Y& y) {
+  for (Index i = 0; i < x.size(); ++i) {
+    if ((numext::isfinite)(y(i)))
+      VERIFY_IS_APPROX(x(i), y(i));
+    else if ((numext::isnan)(y(i)))
       VERIFY((numext::isnan)(x(i)));
     else
-      VERIFY_IS_EQUAL( x(i), y(i) );
+      VERIFY_IS_EQUAL(x(i), y(i));
   }
 }
 
-template<typename ArrayType> void array_special_functions()
-{
+template <typename ArrayType>
+void array_special_functions() {
   using std::abs;
   using std::sqrt;
   typedef typename ArrayType::Scalar Scalar;
@@ -46,12 +44,12 @@
   Scalar plusinf = std::numeric_limits<Scalar>::infinity();
   Scalar nan = std::numeric_limits<Scalar>::quiet_NaN();
 
-  Index rows = internal::random<Index>(1,30);
+  Index rows = internal::random<Index>(1, 30);
   Index cols = 1;
 
   // API
   {
-    ArrayType m1 = ArrayType::Random(rows,cols);
+    ArrayType m1 = ArrayType::Random(rows, cols);
 #if EIGEN_HAS_C99_MATH
     VERIFY_IS_APPROX(m1.lgamma(), lgamma(m1));
     VERIFY_IS_APPROX(m1.digamma(), digamma(m1));
@@ -60,15 +58,12 @@
 #endif  // EIGEN_HAS_C99_MATH
   }
 
-
 #if EIGEN_HAS_C99_MATH
   // check special functions (comparing against numpy implementation)
-  if (!NumTraits<Scalar>::IsComplex)
-  {
-
+  if (!NumTraits<Scalar>::IsComplex) {
     {
-      ArrayType m1 = ArrayType::Random(rows,cols);
-      ArrayType m2 = ArrayType::Random(rows,cols);
+      ArrayType m1 = ArrayType::Random(rows, cols);
+      ArrayType m2 = ArrayType::Random(rows, cols);
 
       // Test various propreties of igamma & igammac.  These are normalized
       // gamma integrals where
@@ -86,7 +81,6 @@
       ArrayType gamma_a_x = Eigen::igamma(a, x) * a.lgamma().exp();
       ArrayType gamma_a_m1_x = Eigen::igamma(a_m1, x) * a_m1.lgamma().exp();
 
-
       // Gamma(a, 0) == Gamma(a)
       VERIFY_IS_APPROX(Eigen::igammac(a, zero), one);
 
@@ -94,18 +88,18 @@
       VERIFY_IS_APPROX(Gamma_a_x + gamma_a_x, a.lgamma().exp());
 
       // Gamma(a, x) == (a - 1) * Gamma(a-1, x) + x^(a-1) * exp(-x)
-      VERIFY_IS_APPROX(Gamma_a_x, (a - Scalar(1)) * Gamma_a_m1_x + x.pow(a-Scalar(1)) * (-x).exp());
+      VERIFY_IS_APPROX(Gamma_a_x, (a - Scalar(1)) * Gamma_a_m1_x + x.pow(a - Scalar(1)) * (-x).exp());
 
       // gamma(a, x) == (a - 1) * gamma(a-1, x) - x^(a-1) * exp(-x)
-      VERIFY_IS_APPROX(gamma_a_x, (a - Scalar(1)) * gamma_a_m1_x - x.pow(a-Scalar(1)) * (-x).exp());
+      VERIFY_IS_APPROX(gamma_a_x, (a - Scalar(1)) * gamma_a_m1_x - x.pow(a - Scalar(1)) * (-x).exp());
     }
     {
       // Verify for large a and x that values are between 0 and 1.
-      ArrayType m1 = ArrayType::Random(rows,cols);
-      ArrayType m2 = ArrayType::Random(rows,cols);
+      ArrayType m1 = ArrayType::Random(rows, cols);
+      ArrayType m2 = ArrayType::Random(rows, cols);
       int max_exponent = std::numeric_limits<Scalar>::max_exponent10;
-      ArrayType a = m1.abs() *  Scalar(pow(10., max_exponent - 1));
-      ArrayType x = m2.abs() *  Scalar(pow(10., max_exponent - 1));
+      ArrayType a = m1.abs() * Scalar(pow(10., max_exponent - 1));
+      ArrayType x = m2.abs() * Scalar(pow(10., max_exponent - 1));
       for (int i = 0; i < a.size(); ++i) {
         Scalar igam = numext::igamma(a(i), x(i));
         VERIFY(0 <= igam);
@@ -121,34 +115,26 @@
       // location i*6+j corresponds to a_s[i], x_s[j].
       Scalar igamma_s[][6] = {
           {Scalar(0.0), nan, nan, nan, nan, nan},
-          {Scalar(0.0), Scalar(0.6321205588285578), Scalar(0.7768698398515702),
-           Scalar(0.9816843611112658), Scalar(9.999500016666262e-05),
-           Scalar(1.0)},
-          {Scalar(0.0), Scalar(0.4275932955291202), Scalar(0.608374823728911),
-           Scalar(0.9539882943107686), Scalar(7.522076445089201e-07),
-           Scalar(1.0)},
-          {Scalar(0.0), Scalar(0.01898815687615381),
-           Scalar(0.06564245437845008), Scalar(0.5665298796332909),
+          {Scalar(0.0), Scalar(0.6321205588285578), Scalar(0.7768698398515702), Scalar(0.9816843611112658),
+           Scalar(9.999500016666262e-05), Scalar(1.0)},
+          {Scalar(0.0), Scalar(0.4275932955291202), Scalar(0.608374823728911), Scalar(0.9539882943107686),
+           Scalar(7.522076445089201e-07), Scalar(1.0)},
+          {Scalar(0.0), Scalar(0.01898815687615381), Scalar(0.06564245437845008), Scalar(0.5665298796332909),
            Scalar(4.166333347221828e-18), Scalar(1.0)},
-          {Scalar(0.0), Scalar(0.9999780593618628), Scalar(0.9999899967080838),
-           Scalar(0.9999996219837988), Scalar(0.9991370418689945), Scalar(1.0)},
-          {Scalar(0.0), Scalar(0.0), Scalar(0.0), Scalar(0.0), Scalar(0.0),
-           Scalar(0.5042041932513908)}};
+          {Scalar(0.0), Scalar(0.9999780593618628), Scalar(0.9999899967080838), Scalar(0.9999996219837988),
+           Scalar(0.9991370418689945), Scalar(1.0)},
+          {Scalar(0.0), Scalar(0.0), Scalar(0.0), Scalar(0.0), Scalar(0.0), Scalar(0.5042041932513908)}};
       Scalar igammac_s[][6] = {
           {nan, nan, nan, nan, nan, nan},
-          {Scalar(1.0), Scalar(0.36787944117144233),
-           Scalar(0.22313016014842982), Scalar(0.018315638888734182),
+          {Scalar(1.0), Scalar(0.36787944117144233), Scalar(0.22313016014842982), Scalar(0.018315638888734182),
            Scalar(0.9999000049998333), Scalar(0.0)},
-          {Scalar(1.0), Scalar(0.5724067044708798), Scalar(0.3916251762710878),
-           Scalar(0.04601170568923136), Scalar(0.9999992477923555),
+          {Scalar(1.0), Scalar(0.5724067044708798), Scalar(0.3916251762710878), Scalar(0.04601170568923136),
+           Scalar(0.9999992477923555), Scalar(0.0)},
+          {Scalar(1.0), Scalar(0.9810118431238462), Scalar(0.9343575456215499), Scalar(0.4334701203667089), Scalar(1.0),
            Scalar(0.0)},
-          {Scalar(1.0), Scalar(0.9810118431238462), Scalar(0.9343575456215499),
-           Scalar(0.4334701203667089), Scalar(1.0), Scalar(0.0)},
-          {Scalar(1.0), Scalar(2.1940638138146658e-05),
-           Scalar(1.0003291916285e-05), Scalar(3.7801620118431334e-07),
+          {Scalar(1.0), Scalar(2.1940638138146658e-05), Scalar(1.0003291916285e-05), Scalar(3.7801620118431334e-07),
            Scalar(0.0008629581310054535), Scalar(0.0)},
-          {Scalar(1.0), Scalar(1.0), Scalar(1.0), Scalar(1.0), Scalar(1.0),
-           Scalar(0.49579580674813944)}};
+          {Scalar(1.0), Scalar(1.0), Scalar(1.0), Scalar(1.0), Scalar(1.0), Scalar(0.49579580674813944)}};
 
       for (int i = 0; i < 6; ++i) {
         for (int j = 0; j < 6; ++j) {
@@ -173,60 +159,59 @@
   {
     ArrayType x(11), res(11), ref(11);
     x << 0.5, 0.2, 0.8, 0.9, 0.1, 0.99, 0.01, 0, 1, -0.01, 1.01;
-    ref << 0., -0.8416212335729142, 0.8416212335729142, 1.2815515655446004, -1.2815515655446004, 2.3263478740408408, -2.3263478740408408, -plusinf, plusinf, nan, nan;
-    CALL_SUBTEST( verify_component_wise(ref, ref); );
-    CALL_SUBTEST( res = x.ndtri(); verify_component_wise(res, ref); );
-    CALL_SUBTEST( res = ndtri(x); verify_component_wise(res, ref); );
+    ref << 0., -0.8416212335729142, 0.8416212335729142, 1.2815515655446004, -1.2815515655446004, 2.3263478740408408,
+        -2.3263478740408408, -plusinf, plusinf, nan, nan;
+    CALL_SUBTEST(verify_component_wise(ref, ref););
+    CALL_SUBTEST(res = x.ndtri(); verify_component_wise(res, ref););
+    CALL_SUBTEST(res = ndtri(x); verify_component_wise(res, ref););
 
     // ndtri(normal_cdf(x)) ~= x
-    CALL_SUBTEST(
-        ArrayType m1 = ArrayType::Random(32);
-        using std::sqrt;
+    CALL_SUBTEST(ArrayType m1 = ArrayType::Random(32); using std::sqrt;
 
-        ArrayType cdf_val = (m1 / Scalar(sqrt(2.))).erf();
-        cdf_val = (cdf_val + Scalar(1)) / Scalar(2);
-        verify_component_wise(cdf_val.ndtri(), m1););
-
+                 ArrayType cdf_val = (m1 / Scalar(sqrt(2.))).erf(); cdf_val = (cdf_val + Scalar(1)) / Scalar(2);
+                 verify_component_wise(cdf_val.ndtri(), m1););
   }
 
   // Check the zeta function against scipy.special.zeta
   {
     ArrayType x(11), q(11), res(11), ref(11);
-    x << 1.5,   4, 10.5, 10000.5,    3,      1,    0.9,  2,  3,  4, 2000;
-    q <<   2, 1.5,    3,  1.0001, -2.5, 1.2345, 1.2345, -1, -2, -3, 2000;
-    ref << 1.61237534869, 0.234848505667, 1.03086757337e-5, 0.367879440865, 0.054102025820864097, plusinf, nan, plusinf, nan, plusinf, 0;
-    CALL_SUBTEST( verify_component_wise(ref, ref); );
-    CALL_SUBTEST( res = x.zeta(q); verify_component_wise(res, ref); );
-    CALL_SUBTEST( res = zeta(x,q); verify_component_wise(res, ref); );
+    x << 1.5, 4, 10.5, 10000.5, 3, 1, 0.9, 2, 3, 4, 2000;
+    q << 2, 1.5, 3, 1.0001, -2.5, 1.2345, 1.2345, -1, -2, -3, 2000;
+    ref << 1.61237534869, 0.234848505667, 1.03086757337e-5, 0.367879440865, 0.054102025820864097, plusinf, nan, plusinf,
+        nan, plusinf, 0;
+    CALL_SUBTEST(verify_component_wise(ref, ref););
+    CALL_SUBTEST(res = x.zeta(q); verify_component_wise(res, ref););
+    CALL_SUBTEST(res = zeta(x, q); verify_component_wise(res, ref););
   }
 
   // digamma
   {
     ArrayType x(9), res(9), ref(9);
     x << 1, 1.5, 4, -10.5, 10000.5, 0, -1, -2, -3;
-    ref << -0.5772156649015329, 0.03648997397857645, 1.2561176684318, 2.398239129535781, 9.210340372392849, nan, nan, nan, nan;
-    CALL_SUBTEST( verify_component_wise(ref, ref); );
+    ref << -0.5772156649015329, 0.03648997397857645, 1.2561176684318, 2.398239129535781, 9.210340372392849, nan, nan,
+        nan, nan;
+    CALL_SUBTEST(verify_component_wise(ref, ref););
 
-    CALL_SUBTEST( res = x.digamma(); verify_component_wise(res, ref); );
-    CALL_SUBTEST( res = digamma(x);  verify_component_wise(res, ref); );
+    CALL_SUBTEST(res = x.digamma(); verify_component_wise(res, ref););
+    CALL_SUBTEST(res = digamma(x); verify_component_wise(res, ref););
   }
 
 #if EIGEN_HAS_C99_MATH
   {
     ArrayType n(16), x(16), res(16), ref(16);
-    n << 1, 1,    1, 1.5,   17,   31,   28,    8,   42,  147, 170, -1,  0,  1,  2,  3;
-    x << 2, 3, 25.5, 1.5,  4.7, 11.8, 17.7, 30.2, 15.8, 54.1,  64, -1, -2, -3, -4, -5;
-    ref << 0.644934066848, 0.394934066848, 0.0399946696496, nan, 293.334565435, 0.445487887616, -2.47810300902e-07, -8.29668781082e-09, -0.434562276666, 0.567742190178, -0.0108615497927, nan, nan, plusinf, nan, plusinf;
-    CALL_SUBTEST( verify_component_wise(ref, ref); );
+    n << 1, 1, 1, 1.5, 17, 31, 28, 8, 42, 147, 170, -1, 0, 1, 2, 3;
+    x << 2, 3, 25.5, 1.5, 4.7, 11.8, 17.7, 30.2, 15.8, 54.1, 64, -1, -2, -3, -4, -5;
+    ref << 0.644934066848, 0.394934066848, 0.0399946696496, nan, 293.334565435, 0.445487887616, -2.47810300902e-07,
+        -8.29668781082e-09, -0.434562276666, 0.567742190178, -0.0108615497927, nan, nan, plusinf, nan, plusinf;
+    CALL_SUBTEST(verify_component_wise(ref, ref););
 
-    if(sizeof(RealScalar)>=8) {  // double
+    if (sizeof(RealScalar) >= 8) {  // double
       // Reason for commented line: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1232
       //       CALL_SUBTEST( res = x.polygamma(n); verify_component_wise(res, ref); );
-      CALL_SUBTEST( res = polygamma(n,x);  verify_component_wise(res, ref); );
-    }
-    else {
+      CALL_SUBTEST(res = polygamma(n, x); verify_component_wise(res, ref););
+    } else {
       //       CALL_SUBTEST( res = x.polygamma(n); verify_component_wise(res.head(8), ref.head(8)); );
-      CALL_SUBTEST( res = polygamma(n,x); verify_component_wise(res.head(8), ref.head(8)); );
+      CALL_SUBTEST(res = polygamma(n, x); verify_component_wise(res.head(8), ref.head(8)););
     }
   }
 #endif
@@ -248,92 +233,60 @@
     ArrayType v(125);
     ArrayType res(125);
 
-    a << 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
-        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
-        0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
-        0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
-        0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
-        0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
-        0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
-        0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
-        0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
-        0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
-        0.03062277660168379, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999,
-        0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999,
-        0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999,
-        31.62177660168379, 31.62177660168379, 31.62177660168379,
-        31.62177660168379, 31.62177660168379, 31.62177660168379,
-        31.62177660168379, 31.62177660168379, 31.62177660168379,
-        31.62177660168379, 31.62177660168379, 31.62177660168379,
-        31.62177660168379, 31.62177660168379, 31.62177660168379,
-        31.62177660168379, 31.62177660168379, 31.62177660168379,
-        31.62177660168379, 31.62177660168379, 31.62177660168379,
-        31.62177660168379, 31.62177660168379, 31.62177660168379,
-        31.62177660168379, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999,
-        999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999,
-        999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999,
+    a << 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+        0.0, 0.0, 0.0, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
+        0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
+        0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
+        0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
+        0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
+        0.03062277660168379, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999,
+        0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 31.62177660168379,
+        31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379,
+        31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379,
+        31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379,
+        31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379,
+        31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379, 999.999, 999.999, 999.999, 999.999,
+        999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999,
+        999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999, 999.999;
+
+    b << 0.0, 0.0, 0.0, 0.0, 0.0, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
+        0.03062277660168379, 0.999, 0.999, 0.999, 0.999, 0.999, 31.62177660168379, 31.62177660168379, 31.62177660168379,
+        31.62177660168379, 31.62177660168379, 999.999, 999.999, 999.999, 999.999, 999.999, 0.0, 0.0, 0.0, 0.0, 0.0,
+        0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.999,
+        0.999, 0.999, 0.999, 0.999, 31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379,
+        31.62177660168379, 999.999, 999.999, 999.999, 999.999, 999.999, 0.0, 0.0, 0.0, 0.0, 0.0, 0.03062277660168379,
+        0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.999, 0.999, 0.999, 0.999,
+        0.999, 31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379, 999.999,
+        999.999, 999.999, 999.999, 999.999, 0.0, 0.0, 0.0, 0.0, 0.0, 0.03062277660168379, 0.03062277660168379,
+        0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.999, 0.999, 0.999, 0.999, 0.999,
+        31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379, 999.999, 999.999,
+        999.999, 999.999, 999.999, 0.0, 0.0, 0.0, 0.0, 0.0, 0.03062277660168379, 0.03062277660168379,
+        0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.999, 0.999, 0.999, 0.999, 0.999,
+        31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379, 31.62177660168379, 999.999, 999.999,
         999.999, 999.999, 999.999;
 
-    b << 0.0, 0.0, 0.0, 0.0, 0.0, 0.03062277660168379, 0.03062277660168379,
-        0.03062277660168379, 0.03062277660168379, 0.03062277660168379, 0.999,
-        0.999, 0.999, 0.999, 0.999, 31.62177660168379, 31.62177660168379,
-        31.62177660168379, 31.62177660168379, 31.62177660168379, 999.999,
-        999.999, 999.999, 999.999, 999.999, 0.0, 0.0, 0.0, 0.0, 0.0,
-        0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
-        0.03062277660168379, 0.03062277660168379, 0.999, 0.999, 0.999, 0.999,
-        0.999, 31.62177660168379, 31.62177660168379, 31.62177660168379,
-        31.62177660168379, 31.62177660168379, 999.999, 999.999, 999.999,
-        999.999, 999.999, 0.0, 0.0, 0.0, 0.0, 0.0, 0.03062277660168379,
-        0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
-        0.03062277660168379, 0.999, 0.999, 0.999, 0.999, 0.999,
-        31.62177660168379, 31.62177660168379, 31.62177660168379,
-        31.62177660168379, 31.62177660168379, 999.999, 999.999, 999.999,
-        999.999, 999.999, 0.0, 0.0, 0.0, 0.0, 0.0, 0.03062277660168379,
-        0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
-        0.03062277660168379, 0.999, 0.999, 0.999, 0.999, 0.999,
-        31.62177660168379, 31.62177660168379, 31.62177660168379,
-        31.62177660168379, 31.62177660168379, 999.999, 999.999, 999.999,
-        999.999, 999.999, 0.0, 0.0, 0.0, 0.0, 0.0, 0.03062277660168379,
-        0.03062277660168379, 0.03062277660168379, 0.03062277660168379,
-        0.03062277660168379, 0.999, 0.999, 0.999, 0.999, 0.999,
-        31.62177660168379, 31.62177660168379, 31.62177660168379,
-        31.62177660168379, 31.62177660168379, 999.999, 999.999, 999.999,
-        999.999, 999.999;
+    x << -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1,
+        0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2,
+        0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5,
+        0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8,
+        1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1,
+        -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1;
 
-    x << -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5,
-        0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2,
-        0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1,
-        0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1,
-        -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8,
-        1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5,
-        0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2,
-        0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1,
-        0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5, 0.8, 1.1, -0.1, 0.2, 0.5,
-        0.8, 1.1;
-
-    v << nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
-        nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
-        nan, nan, nan, 0.47972119876364683, 0.5, 0.5202788012363533, nan, nan,
-        0.9518683957740043, 0.9789663010413743, 0.9931729188073435, nan, nan,
-        0.999995949033062, 0.9999999999993698, 0.9999999999999999, nan, nan,
-        0.9999999999999999, 0.9999999999999999, 0.9999999999999999, nan, nan,
-        nan, nan, nan, nan, nan, 0.006827081192655869, 0.0210336989586256,
-        0.04813160422599567, nan, nan, 0.20014344256217678, 0.5000000000000001,
-        0.7998565574378232, nan, nan, 0.9991401428435834, 0.999999999698403,
-        0.9999999999999999, nan, nan, 0.9999999999999999, 0.9999999999999999,
-        0.9999999999999999, nan, nan, nan, nan, nan, nan, nan,
-        1.0646600232370887e-25, 6.301722877826246e-13, 4.050966937974938e-06,
-        nan, nan, 7.864342668429763e-23, 3.015969667594166e-10,
-        0.0008598571564165444, nan, nan, 6.031987710123844e-08,
-        0.5000000000000007, 0.9999999396801229, nan, nan, 0.9999999999999999,
-        0.9999999999999999, 0.9999999999999999, nan, nan, nan, nan, nan, nan,
-        nan, 0.0, 7.029920380986636e-306, 2.2450728208591345e-101, nan, nan,
-        0.0, 9.275871147869727e-302, 1.2232913026152827e-97, nan, nan, 0.0,
-        3.0891393081932924e-252, 2.9303043666183996e-60, nan, nan,
+    v << nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
+        nan, nan, nan, nan, nan, nan, nan, nan, nan, 0.47972119876364683, 0.5, 0.5202788012363533, nan, nan,
+        0.9518683957740043, 0.9789663010413743, 0.9931729188073435, nan, nan, 0.999995949033062, 0.9999999999993698,
+        0.9999999999999999, nan, nan, 0.9999999999999999, 0.9999999999999999, 0.9999999999999999, nan, nan, nan, nan,
+        nan, nan, nan, 0.006827081192655869, 0.0210336989586256, 0.04813160422599567, nan, nan, 0.20014344256217678,
+        0.5000000000000001, 0.7998565574378232, nan, nan, 0.9991401428435834, 0.999999999698403, 0.9999999999999999,
+        nan, nan, 0.9999999999999999, 0.9999999999999999, 0.9999999999999999, nan, nan, nan, nan, nan, nan, nan,
+        1.0646600232370887e-25, 6.301722877826246e-13, 4.050966937974938e-06, nan, nan, 7.864342668429763e-23,
+        3.015969667594166e-10, 0.0008598571564165444, nan, nan, 6.031987710123844e-08, 0.5000000000000007,
+        0.9999999396801229, nan, nan, 0.9999999999999999, 0.9999999999999999, 0.9999999999999999, nan, nan, nan, nan,
+        nan, nan, nan, 0.0, 7.029920380986636e-306, 2.2450728208591345e-101, nan, nan, 0.0, 9.275871147869727e-302,
+        1.2232913026152827e-97, nan, nan, 0.0, 3.0891393081932924e-252, 2.9303043666183996e-60, nan, nan,
         2.248913486879199e-196, 0.5000000000004947, 0.9999999999999999, nan;
 
-    CALL_SUBTEST(res = betainc(a, b, x);
-                 verify_component_wise(res, v););
+    CALL_SUBTEST(res = betainc(a, b, x); verify_component_wise(res, v););
   }
 
   // Test various properties of betainc
@@ -348,22 +301,16 @@
     ArrayType x = m3.abs();
 
     // betainc(a, 1, x) == x**a
-    CALL_SUBTEST(
-        ArrayType test = betainc(a, one, x);
-        ArrayType expected = x.pow(a);
-        verify_component_wise(test, expected););
+    CALL_SUBTEST(ArrayType test = betainc(a, one, x); ArrayType expected = x.pow(a);
+                 verify_component_wise(test, expected););
 
     // betainc(1, b, x) == 1 - (1 - x)**b
-    CALL_SUBTEST(
-        ArrayType test = betainc(one, b, x);
-        ArrayType expected = one - (one - x).pow(b);
-        verify_component_wise(test, expected););
+    CALL_SUBTEST(ArrayType test = betainc(one, b, x); ArrayType expected = one - (one - x).pow(b);
+                 verify_component_wise(test, expected););
 
     // betainc(a, b, x) == 1 - betainc(b, a, 1-x)
-    CALL_SUBTEST(
-        ArrayType test = betainc(a, b, x) + betainc(b, a, one - x);
-        ArrayType expected = one;
-        verify_component_wise(test, expected););
+    CALL_SUBTEST(ArrayType test = betainc(a, b, x) + betainc(b, a, one - x); ArrayType expected = one;
+                 verify_component_wise(test, expected););
 
     // betainc(a+1, b, x) = betainc(a, b, x) - x**a * (1 - x)**b / (a * beta(a, b))
     CALL_SUBTEST(
@@ -372,8 +319,7 @@
         // Add eps to rhs and lhs so that component-wise test doesn't result in
         // nans when both outputs are zeros.
         ArrayType expected = betainc(a, b, x) - num / denom + eps;
-        ArrayType test = betainc(a + one, b, x) + eps;
-        if (sizeof(Scalar) >= 8) { // double
+        ArrayType test = betainc(a + one, b, x) + eps; if (sizeof(Scalar) >= 8) {  // double
           verify_component_wise(test, expected);
         } else {
           // Reason for limited test: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1232
@@ -386,38 +332,37 @@
         // nans when both outputs are zeros.
         ArrayType num = x.pow(a) * (one - x).pow(b);
         ArrayType denom = b * (a.lgamma() + b.lgamma() - (a + b).lgamma()).exp();
-        ArrayType expected = betainc(a, b, x) + num / denom + eps;
-        ArrayType test = betainc(a, b + one, x) + eps;
+        ArrayType expected = betainc(a, b, x) + num / denom + eps; ArrayType test = betainc(a, b + one, x) + eps;
         verify_component_wise(test, expected););
   }
 #endif  // EIGEN_HAS_C99_MATH
 
-    /* Code to generate the data for the following two test cases.
-    N = 5
-    np.random.seed(3)
+  /* Code to generate the data for the following two test cases.
+  N = 5
+  np.random.seed(3)
 
-    a = np.logspace(-2, 3, 6)
-    a = np.ravel(np.tile(np.reshape(a, [-1, 1]), [1, N]))
-    x = np.random.gamma(a, 1.0)
-    x = np.maximum(x, np.finfo(np.float32).tiny)
+  a = np.logspace(-2, 3, 6)
+  a = np.ravel(np.tile(np.reshape(a, [-1, 1]), [1, N]))
+  x = np.random.gamma(a, 1.0)
+  x = np.maximum(x, np.finfo(np.float32).tiny)
 
-    def igamma(a, x):
-      return mpmath.gammainc(a, 0, x, regularized=True)
+  def igamma(a, x):
+    return mpmath.gammainc(a, 0, x, regularized=True)
 
-    def igamma_der_a(a, x):
-      res = mpmath.diff(lambda a_prime: igamma(a_prime, x), a)
-      return np.float64(res)
+  def igamma_der_a(a, x):
+    res = mpmath.diff(lambda a_prime: igamma(a_prime, x), a)
+    return np.float64(res)
 
-    def gamma_sample_der_alpha(a, x):
-      igamma_x = igamma(a, x)
-      def igammainv_of_igamma(a_prime):
-        return mpmath.findroot(lambda x_prime: igamma(a_prime, x_prime) -
-            igamma_x, x, solver='newton')
-      return np.float64(mpmath.diff(igammainv_of_igamma, a))
+  def gamma_sample_der_alpha(a, x):
+    igamma_x = igamma(a, x)
+    def igammainv_of_igamma(a_prime):
+      return mpmath.findroot(lambda x_prime: igamma(a_prime, x_prime) -
+          igamma_x, x, solver='newton')
+    return np.float64(mpmath.diff(igammainv_of_igamma, a))
 
-    v_igamma_der_a = np.vectorize(igamma_der_a)(a, x)
-    v_gamma_sample_der_alpha = np.vectorize(gamma_sample_der_alpha)(a, x)
-  */
+  v_igamma_der_a = np.vectorize(igamma_der_a)(a, x)
+  v_gamma_sample_der_alpha = np.vectorize(gamma_sample_der_alpha)(a, x)
+*/
 
 #if EIGEN_HAS_C99_MATH
   // Test igamma_der_a
@@ -427,27 +372,20 @@
     ArrayType res(30);
     ArrayType v(30);
 
-    a << 0.01, 0.01, 0.01, 0.01, 0.01, 0.1, 0.1, 0.1, 0.1, 0.1, 1.0, 1.0, 1.0,
-        1.0, 1.0, 10.0, 10.0, 10.0, 10.0, 10.0, 100.0, 100.0, 100.0, 100.0,
-        100.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0;
+    a << 0.01, 0.01, 0.01, 0.01, 0.01, 0.1, 0.1, 0.1, 0.1, 0.1, 1.0, 1.0, 1.0, 1.0, 1.0, 10.0, 10.0, 10.0, 10.0, 10.0,
+        100.0, 100.0, 100.0, 100.0, 100.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0;
 
-    x << 1.25668890405e-26, 1.17549435082e-38, 1.20938905072e-05,
-        1.17549435082e-38, 1.17549435082e-38, 5.66572070696e-16,
-        0.0132865061065, 0.0200034203853, 6.29263709118e-17, 1.37160367764e-06,
-        0.333412038288, 1.18135687766, 0.580629033777, 0.170631439426,
-        0.786686768458, 7.63873279537, 13.1944344379, 11.896042354,
-        10.5830172417, 10.5020942233, 92.8918587747, 95.003720371,
-        86.3715926467, 96.0330217672, 82.6389930677, 968.702906754,
-        969.463546828, 1001.79726022, 955.047416547, 1044.27458568;
+    x << 1.25668890405e-26, 1.17549435082e-38, 1.20938905072e-05, 1.17549435082e-38, 1.17549435082e-38,
+        5.66572070696e-16, 0.0132865061065, 0.0200034203853, 6.29263709118e-17, 1.37160367764e-06, 0.333412038288,
+        1.18135687766, 0.580629033777, 0.170631439426, 0.786686768458, 7.63873279537, 13.1944344379, 11.896042354,
+        10.5830172417, 10.5020942233, 92.8918587747, 95.003720371, 86.3715926467, 96.0330217672, 82.6389930677,
+        968.702906754, 969.463546828, 1001.79726022, 955.047416547, 1044.27458568;
 
-    v << -32.7256441441, -36.4394150514, -9.66467612263, -36.4394150514,
-        -36.4394150514, -1.0891900302, -2.66351229645, -2.48666868596,
-        -0.929700494428, -3.56327722764, -0.455320135314, -0.391437214323,
-        -0.491352055991, -0.350454834292, -0.471773162921, -0.104084440522,
-        -0.0723646747909, -0.0992828975532, -0.121638215446, -0.122619605294,
-        -0.0317670267286, -0.0359974812869, -0.0154359225363, -0.0375775365921,
-        -0.00794899153653, -0.00777303219211, -0.00796085782042,
-        -0.0125850719397, -0.00455500206958, -0.00476436993148;
+    v << -32.7256441441, -36.4394150514, -9.66467612263, -36.4394150514, -36.4394150514, -1.0891900302, -2.66351229645,
+        -2.48666868596, -0.929700494428, -3.56327722764, -0.455320135314, -0.391437214323, -0.491352055991,
+        -0.350454834292, -0.471773162921, -0.104084440522, -0.0723646747909, -0.0992828975532, -0.121638215446,
+        -0.122619605294, -0.0317670267286, -0.0359974812869, -0.0154359225363, -0.0375775365921, -0.00794899153653,
+        -0.00777303219211, -0.00796085782042, -0.0125850719397, -0.00455500206958, -0.00476436993148;
 
     CALL_SUBTEST(res = igamma_der_a(a, x); verify_component_wise(res, v););
   }
@@ -459,36 +397,27 @@
     ArrayType res(30);
     ArrayType v(30);
 
-    alpha << 0.01, 0.01, 0.01, 0.01, 0.01, 0.1, 0.1, 0.1, 0.1, 0.1, 1.0, 1.0,
-        1.0, 1.0, 1.0, 10.0, 10.0, 10.0, 10.0, 10.0, 100.0, 100.0, 100.0, 100.0,
-        100.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0;
+    alpha << 0.01, 0.01, 0.01, 0.01, 0.01, 0.1, 0.1, 0.1, 0.1, 0.1, 1.0, 1.0, 1.0, 1.0, 1.0, 10.0, 10.0, 10.0, 10.0,
+        10.0, 100.0, 100.0, 100.0, 100.0, 100.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0;
 
-    sample << 1.25668890405e-26, 1.17549435082e-38, 1.20938905072e-05,
-        1.17549435082e-38, 1.17549435082e-38, 5.66572070696e-16,
-        0.0132865061065, 0.0200034203853, 6.29263709118e-17, 1.37160367764e-06,
-        0.333412038288, 1.18135687766, 0.580629033777, 0.170631439426,
-        0.786686768458, 7.63873279537, 13.1944344379, 11.896042354,
-        10.5830172417, 10.5020942233, 92.8918587747, 95.003720371,
-        86.3715926467, 96.0330217672, 82.6389930677, 968.702906754,
-        969.463546828, 1001.79726022, 955.047416547, 1044.27458568;
+    sample << 1.25668890405e-26, 1.17549435082e-38, 1.20938905072e-05, 1.17549435082e-38, 1.17549435082e-38,
+        5.66572070696e-16, 0.0132865061065, 0.0200034203853, 6.29263709118e-17, 1.37160367764e-06, 0.333412038288,
+        1.18135687766, 0.580629033777, 0.170631439426, 0.786686768458, 7.63873279537, 13.1944344379, 11.896042354,
+        10.5830172417, 10.5020942233, 92.8918587747, 95.003720371, 86.3715926467, 96.0330217672, 82.6389930677,
+        968.702906754, 969.463546828, 1001.79726022, 955.047416547, 1044.27458568;
 
-    v << 7.42424742367e-23, 1.02004297287e-34, 0.0130155240738,
-        1.02004297287e-34, 1.02004297287e-34, 1.96505168277e-13, 0.525575786243,
-        0.713903991771, 2.32077561808e-14, 0.000179348049886, 0.635500453302,
-        1.27561284917, 0.878125852156, 0.41565819538, 1.03606488534,
-        0.885964824887, 1.16424049334, 1.10764479598, 1.04590810812,
-        1.04193666963, 0.965193152414, 0.976217589464, 0.93008035061,
-        0.98153216096, 0.909196397698, 0.98434963993, 0.984738050206,
-        1.00106492525, 0.97734200649, 1.02198794179;
+    v << 7.42424742367e-23, 1.02004297287e-34, 0.0130155240738, 1.02004297287e-34, 1.02004297287e-34, 1.96505168277e-13,
+        0.525575786243, 0.713903991771, 2.32077561808e-14, 0.000179348049886, 0.635500453302, 1.27561284917,
+        0.878125852156, 0.41565819538, 1.03606488534, 0.885964824887, 1.16424049334, 1.10764479598, 1.04590810812,
+        1.04193666963, 0.965193152414, 0.976217589464, 0.93008035061, 0.98153216096, 0.909196397698, 0.98434963993,
+        0.984738050206, 1.00106492525, 0.97734200649, 1.02198794179;
 
-    CALL_SUBTEST(res = gamma_sample_der_alpha(alpha, sample);
-                 verify_component_wise(res, v););
+    CALL_SUBTEST(res = gamma_sample_der_alpha(alpha, sample); verify_component_wise(res, v););
   }
 #endif  // EIGEN_HAS_C99_MATH
 }
 
-EIGEN_DECLARE_TEST(special_functions)
-{
+EIGEN_DECLARE_TEST(special_functions) {
   CALL_SUBTEST_1(array_special_functions<ArrayXf>());
   CALL_SUBTEST_2(array_special_functions<ArrayXd>());
   // TODO(cantonios): half/bfloat16 don't have enough precision to reproduce results above.
diff --git a/unsupported/test/special_packetmath.cpp b/unsupported/test/special_packetmath.cpp
index faf10ef..1ec5c3d 100644
--- a/unsupported/test/special_packetmath.cpp
+++ b/unsupported/test/special_packetmath.cpp
@@ -12,39 +12,39 @@
 #include "packetmath_test_shared.h"
 #include "../Eigen/SpecialFunctions"
 
-template<typename Scalar,typename Packet> void packetmath_real()
-{
+template <typename Scalar, typename Packet>
+void packetmath_real() {
   using std::abs;
   typedef internal::packet_traits<Scalar> PacketTraits;
   const int PacketSize = internal::unpacket_traits<Packet>::size;
 
-  const int size = PacketSize*4;
-  EIGEN_ALIGN_MAX Scalar data1[PacketSize*4];
-  EIGEN_ALIGN_MAX Scalar data2[PacketSize*4];
-  EIGEN_ALIGN_MAX Scalar ref[PacketSize*4];
+  const int size = PacketSize * 4;
+  EIGEN_ALIGN_MAX Scalar data1[PacketSize * 4];
+  EIGEN_ALIGN_MAX Scalar data2[PacketSize * 4];
+  EIGEN_ALIGN_MAX Scalar ref[PacketSize * 4];
 
 #if EIGEN_HAS_C99_MATH
   {
     data1[0] = std::numeric_limits<Scalar>::quiet_NaN();
-    test::packet_helper<internal::packet_traits<Scalar>::HasLGamma,Packet> h;
+    test::packet_helper<internal::packet_traits<Scalar>::HasLGamma, Packet> h;
     h.store(data2, internal::plgamma(h.load(data1)));
     VERIFY((numext::isnan)(data2[0]));
   }
   if (internal::packet_traits<Scalar>::HasErf) {
     data1[0] = std::numeric_limits<Scalar>::quiet_NaN();
-    test::packet_helper<internal::packet_traits<Scalar>::HasErf,Packet> h;
+    test::packet_helper<internal::packet_traits<Scalar>::HasErf, Packet> h;
     h.store(data2, internal::perf(h.load(data1)));
     VERIFY((numext::isnan)(data2[0]));
   }
   {
     data1[0] = std::numeric_limits<Scalar>::quiet_NaN();
-    test::packet_helper<internal::packet_traits<Scalar>::HasErfc,Packet> h;
+    test::packet_helper<internal::packet_traits<Scalar>::HasErfc, Packet> h;
     h.store(data2, internal::perfc(h.load(data1)));
     VERIFY((numext::isnan)(data2[0]));
   }
   {
-    for (int i=0; i<size; ++i) {
-      data1[i] = internal::random<Scalar>(Scalar(0),Scalar(1));
+    for (int i = 0; i < size; ++i) {
+      data1[i] = internal::random<Scalar>(Scalar(0), Scalar(1));
     }
     CHECK_CWISE1_IF(internal::packet_traits<Scalar>::HasNdtri, numext::ndtri, internal::pndtri);
   }
@@ -52,11 +52,12 @@
 
   // For bessel_i*e and bessel_j*, the valid range is negative reals.
   {
-    const int max_exponent = numext::mini(std::numeric_limits<Scalar>::max_exponent10-1, 6);
-    for (int i=0; i<size; ++i)
-    {
-      data1[i] = internal::random<Scalar>(Scalar(-1),Scalar(1)) * Scalar(std::pow(Scalar(10), internal::random<Scalar>(Scalar(-max_exponent),Scalar(max_exponent))));
-      data2[i] = internal::random<Scalar>(Scalar(-1),Scalar(1)) * Scalar(std::pow(Scalar(10), internal::random<Scalar>(Scalar(-max_exponent),Scalar(max_exponent))));
+    const int max_exponent = numext::mini(std::numeric_limits<Scalar>::max_exponent10 - 1, 6);
+    for (int i = 0; i < size; ++i) {
+      data1[i] = internal::random<Scalar>(Scalar(-1), Scalar(1)) *
+                 Scalar(std::pow(Scalar(10), internal::random<Scalar>(Scalar(-max_exponent), Scalar(max_exponent))));
+      data2[i] = internal::random<Scalar>(Scalar(-1), Scalar(1)) *
+                 Scalar(std::pow(Scalar(10), internal::random<Scalar>(Scalar(-max_exponent), Scalar(max_exponent))));
     }
 
     CHECK_CWISE1_IF(PacketTraits::HasBessel, numext::bessel_i0e, internal::pbessel_i0e);
@@ -68,23 +69,23 @@
   // Use a smaller data range for the bessel_i* as these can become very large.
   // Following #1693, we also restrict this range further to avoid inf's due to
   // differences in pexp and exp.
-  for (int i=0; i<size; ++i) {
-      data1[i] = internal::random<Scalar>(Scalar(0.01),Scalar(1)) *
-                  Scalar(std::pow(Scalar(9), internal::random<Scalar>(Scalar(-1),Scalar(2))));
-      data2[i] = internal::random<Scalar>(Scalar(0.01),Scalar(1)) *
-                  Scalar(std::pow(Scalar(9), internal::random<Scalar>(Scalar(-1),Scalar(2))));
+  for (int i = 0; i < size; ++i) {
+    data1[i] = internal::random<Scalar>(Scalar(0.01), Scalar(1)) *
+               Scalar(std::pow(Scalar(9), internal::random<Scalar>(Scalar(-1), Scalar(2))));
+    data2[i] = internal::random<Scalar>(Scalar(0.01), Scalar(1)) *
+               Scalar(std::pow(Scalar(9), internal::random<Scalar>(Scalar(-1), Scalar(2))));
   }
   CHECK_CWISE1_IF(PacketTraits::HasBessel, numext::bessel_i0, internal::pbessel_i0);
   CHECK_CWISE1_IF(PacketTraits::HasBessel, numext::bessel_i1, internal::pbessel_i1);
 
-
   // y_i, and k_i are valid for x > 0.
   {
-    const int max_exponent = numext::mini(std::numeric_limits<Scalar>::max_exponent10-1, 5);
-    for (int i=0; i<size; ++i)
-    {
-      data1[i] = internal::random<Scalar>(Scalar(0.01),Scalar(1)) * Scalar(std::pow(Scalar(10), internal::random<Scalar>(Scalar(-2),Scalar(max_exponent))));
-      data2[i] = internal::random<Scalar>(Scalar(0.01),Scalar(1)) * Scalar(std::pow(Scalar(10), internal::random<Scalar>(Scalar(-2),Scalar(max_exponent))));
+    const int max_exponent = numext::mini(std::numeric_limits<Scalar>::max_exponent10 - 1, 5);
+    for (int i = 0; i < size; ++i) {
+      data1[i] = internal::random<Scalar>(Scalar(0.01), Scalar(1)) *
+                 Scalar(std::pow(Scalar(10), internal::random<Scalar>(Scalar(-2), Scalar(max_exponent))));
+      data2[i] = internal::random<Scalar>(Scalar(0.01), Scalar(1)) *
+                 Scalar(std::pow(Scalar(10), internal::random<Scalar>(Scalar(-2), Scalar(max_exponent))));
     }
   }
 
@@ -97,21 +98,20 @@
 
   // Following #1693, we restrict the range for exp to avoid zeroing out too
   // fast.
-  for (int i=0; i<size; ++i) {
-      data1[i] = internal::random<Scalar>(Scalar(0.01),Scalar(1)) *
-                  Scalar(std::pow(Scalar(9), internal::random<Scalar>(Scalar(-1),Scalar(2))));
-      data2[i] = internal::random<Scalar>(Scalar(0.01),Scalar(1)) *
-                  Scalar(std::pow(Scalar(9), internal::random<Scalar>(Scalar(-1),Scalar(2))));
+  for (int i = 0; i < size; ++i) {
+    data1[i] = internal::random<Scalar>(Scalar(0.01), Scalar(1)) *
+               Scalar(std::pow(Scalar(9), internal::random<Scalar>(Scalar(-1), Scalar(2))));
+    data2[i] = internal::random<Scalar>(Scalar(0.01), Scalar(1)) *
+               Scalar(std::pow(Scalar(9), internal::random<Scalar>(Scalar(-1), Scalar(2))));
   }
   CHECK_CWISE1_IF(PacketTraits::HasBessel, numext::bessel_k0, internal::pbessel_k0);
   CHECK_CWISE1_IF(PacketTraits::HasBessel, numext::bessel_k1, internal::pbessel_k1);
 
-
-  for (int i=0; i<size; ++i) {
-      data1[i] = internal::random<Scalar>(Scalar(0.01),Scalar(1)) *
-                  Scalar(std::pow(Scalar(10), internal::random<Scalar>(Scalar(-1),Scalar(2))));
-      data2[i] = internal::random<Scalar>(Scalar(0.01),Scalar(1)) *
-                  Scalar(std::pow(Scalar(10), internal::random<Scalar>(Scalar(-1),Scalar(2))));
+  for (int i = 0; i < size; ++i) {
+    data1[i] = internal::random<Scalar>(Scalar(0.01), Scalar(1)) *
+               Scalar(std::pow(Scalar(10), internal::random<Scalar>(Scalar(-1), Scalar(2))));
+    data2[i] = internal::random<Scalar>(Scalar(0.01), Scalar(1)) *
+               Scalar(std::pow(Scalar(10), internal::random<Scalar>(Scalar(-1), Scalar(2))));
   }
 
 #if EIGEN_HAS_C99_MATH
@@ -119,31 +119,26 @@
   CHECK_CWISE1_IF(internal::packet_traits<Scalar>::HasErf, std::erf, internal::perf);
   CHECK_CWISE1_IF(internal::packet_traits<Scalar>::HasErfc, std::erfc, internal::perfc);
 #endif
-
 }
 
 namespace Eigen {
 namespace test {
 
-template<typename Scalar,typename PacketType, bool IsComplex, bool IsInteger>
+template <typename Scalar, typename PacketType, bool IsComplex, bool IsInteger>
 struct runall {
-  static void run() {
-    packetmath_real<Scalar,PacketType>();
-  }
+  static void run() { packetmath_real<Scalar, PacketType>(); }
 };
 
-}
-}
+}  // namespace test
+}  // namespace Eigen
 
-EIGEN_DECLARE_TEST(special_packetmath)
-{
+EIGEN_DECLARE_TEST(special_packetmath) {
   g_first_pass = true;
-  for(int i = 0; i < g_repeat; i++) {
-
-    CALL_SUBTEST_1( test::runner<float>::run() );
-    CALL_SUBTEST_2( test::runner<double>::run() );
-    CALL_SUBTEST_3( test::runner<Eigen::half>::run() );
-    CALL_SUBTEST_4( test::runner<Eigen::bfloat16>::run() );
+  for (int i = 0; i < g_repeat; i++) {
+    CALL_SUBTEST_1(test::runner<float>::run());
+    CALL_SUBTEST_2(test::runner<double>::run());
+    CALL_SUBTEST_3(test::runner<Eigen::half>::run());
+    CALL_SUBTEST_4(test::runner<Eigen::bfloat16>::run());
     g_first_pass = false;
   }
 }
diff --git a/unsupported/test/splines.cpp b/unsupported/test/splines.cpp
index 88ec87b..8083718 100644
--- a/unsupported/test/splines.cpp
+++ b/unsupported/test/splines.cpp
@@ -12,230 +12,158 @@
 #include <unsupported/Eigen/Splines>
 
 namespace Eigen {
-  
-  // lets do some explicit instantiations and thus
-  // force the compilation of all spline functions...
-  template class Spline<double, 2, Dynamic>;
-  template class Spline<double, 3, Dynamic>;
 
-  template class Spline<double, 2, 2>;
-  template class Spline<double, 2, 3>;
-  template class Spline<double, 2, 4>;
-  template class Spline<double, 2, 5>;
+// lets do some explicit instantiations and thus
+// force the compilation of all spline functions...
+template class Spline<double, 2, Dynamic>;
+template class Spline<double, 3, Dynamic>;
 
-  template class Spline<float, 2, Dynamic>;
-  template class Spline<float, 3, Dynamic>;
+template class Spline<double, 2, 2>;
+template class Spline<double, 2, 3>;
+template class Spline<double, 2, 4>;
+template class Spline<double, 2, 5>;
 
-  template class Spline<float, 3, 2>;
-  template class Spline<float, 3, 3>;
-  template class Spline<float, 3, 4>;
-  template class Spline<float, 3, 5>;
+template class Spline<float, 2, Dynamic>;
+template class Spline<float, 3, Dynamic>;
 
-}
+template class Spline<float, 3, 2>;
+template class Spline<float, 3, 3>;
+template class Spline<float, 3, 4>;
+template class Spline<float, 3, 5>;
 
-Spline<double, 2, Dynamic> closed_spline2d()
-{
+}  // namespace Eigen
+
+Spline<double, 2, Dynamic> closed_spline2d() {
   RowVectorXd knots(12);
-  knots << 0,
-    0,
-    0,
-    0,
-    0.867193179093898,
-    1.660330955342408,
-    2.605084834823134,
-    3.484154586374428,
-    4.252699478956276,
-    4.252699478956276,
-    4.252699478956276,
-    4.252699478956276;
+  knots << 0, 0, 0, 0, 0.867193179093898, 1.660330955342408, 2.605084834823134, 3.484154586374428, 4.252699478956276,
+      4.252699478956276, 4.252699478956276, 4.252699478956276;
 
-  MatrixXd ctrls(8,2);
-  ctrls << -0.370967741935484,   0.236842105263158,
-    -0.231401860693277,   0.442245185027632,
-    0.344361228532831,   0.773369994120753,
-    0.828990216203802,   0.106550882647595,
-    0.407270163678382,  -1.043452922172848,
-    -0.488467813584053,  -0.390098582530090,
-    -0.494657189446427,   0.054804824897884,
-    -0.370967741935484,   0.236842105263158;
+  MatrixXd ctrls(8, 2);
+  ctrls << -0.370967741935484, 0.236842105263158, -0.231401860693277, 0.442245185027632, 0.344361228532831,
+      0.773369994120753, 0.828990216203802, 0.106550882647595, 0.407270163678382, -1.043452922172848,
+      -0.488467813584053, -0.390098582530090, -0.494657189446427, 0.054804824897884, -0.370967741935484,
+      0.236842105263158;
   ctrls.transposeInPlace();
 
   return Spline<double, 2, Dynamic>(knots, ctrls);
 }
 
 /* create a reference spline */
-Spline<double, 3, Dynamic> spline3d()
-{
+Spline<double, 3, Dynamic> spline3d() {
   RowVectorXd knots(11);
-  knots << 0,
-    0,
-    0,
-    0.118997681558377,
-    0.162611735194631,
-    0.498364051982143,
-    0.655098003973841,
-    0.679702676853675,
-    1.000000000000000,
-    1.000000000000000,
-    1.000000000000000;
+  knots << 0, 0, 0, 0.118997681558377, 0.162611735194631, 0.498364051982143, 0.655098003973841, 0.679702676853675,
+      1.000000000000000, 1.000000000000000, 1.000000000000000;
 
-  MatrixXd ctrls(8,3);
-  ctrls <<    0.959743958516081,   0.340385726666133,   0.585267750979777,
-    0.223811939491137,   0.751267059305653,   0.255095115459269,
-    0.505957051665142,   0.699076722656686,   0.890903252535799,
-    0.959291425205444,   0.547215529963803,   0.138624442828679,
-    0.149294005559057,   0.257508254123736,   0.840717255983663,
-    0.254282178971531,   0.814284826068816,   0.243524968724989,
-    0.929263623187228,   0.349983765984809,   0.196595250431208,
-    0.251083857976031,   0.616044676146639,   0.473288848902729;
+  MatrixXd ctrls(8, 3);
+  ctrls << 0.959743958516081, 0.340385726666133, 0.585267750979777, 0.223811939491137, 0.751267059305653,
+      0.255095115459269, 0.505957051665142, 0.699076722656686, 0.890903252535799, 0.959291425205444, 0.547215529963803,
+      0.138624442828679, 0.149294005559057, 0.257508254123736, 0.840717255983663, 0.254282178971531, 0.814284826068816,
+      0.243524968724989, 0.929263623187228, 0.349983765984809, 0.196595250431208, 0.251083857976031, 0.616044676146639,
+      0.473288848902729;
   ctrls.transposeInPlace();
 
   return Spline<double, 3, Dynamic>(knots, ctrls);
 }
 
 /* compares evaluations against known results */
-void eval_spline3d()
-{
+void eval_spline3d() {
   Spline3d spline = spline3d();
 
   RowVectorXd u(10);
-  u << 0.351659507062997,
-    0.830828627896291,
-    0.585264091152724,
-    0.549723608291140,
-    0.917193663829810,
-    0.285839018820374,
-    0.757200229110721,
-    0.753729094278495,
-    0.380445846975357,
-    0.567821640725221;
+  u << 0.351659507062997, 0.830828627896291, 0.585264091152724, 0.549723608291140, 0.917193663829810, 0.285839018820374,
+      0.757200229110721, 0.753729094278495, 0.380445846975357, 0.567821640725221;
 
-  MatrixXd pts(10,3);
-  pts << 0.707620811535916,   0.510258911240815,   0.417485437023409,
-    0.603422256426978,   0.529498282727551,   0.270351549348981,
-    0.228364197569334,   0.423745615677815,   0.637687289287490,
-    0.275556796335168,   0.350856706427970,   0.684295784598905,
-    0.514519311047655,   0.525077224890754,   0.351628308305896,
-    0.724152914315666,   0.574461155457304,   0.469860285484058,
-    0.529365063753288,   0.613328702656816,   0.237837040141739,
-    0.522469395136878,   0.619099658652895,   0.237139665242069,
-    0.677357023849552,   0.480655768435853,   0.422227610314397,
-    0.247046593173758,   0.380604672404750,   0.670065791405019;
+  MatrixXd pts(10, 3);
+  pts << 0.707620811535916, 0.510258911240815, 0.417485437023409, 0.603422256426978, 0.529498282727551,
+      0.270351549348981, 0.228364197569334, 0.423745615677815, 0.637687289287490, 0.275556796335168, 0.350856706427970,
+      0.684295784598905, 0.514519311047655, 0.525077224890754, 0.351628308305896, 0.724152914315666, 0.574461155457304,
+      0.469860285484058, 0.529365063753288, 0.613328702656816, 0.237837040141739, 0.522469395136878, 0.619099658652895,
+      0.237139665242069, 0.677357023849552, 0.480655768435853, 0.422227610314397, 0.247046593173758, 0.380604672404750,
+      0.670065791405019;
   pts.transposeInPlace();
 
-  for (int i=0; i<u.size(); ++i)
-  {
+  for (int i = 0; i < u.size(); ++i) {
     Vector3d pt = spline(u(i));
-    VERIFY( (pt - pts.col(i)).norm() < 1e-14 );
+    VERIFY((pt - pts.col(i)).norm() < 1e-14);
   }
 }
 
 /* compares evaluations on corner cases */
-void eval_spline3d_onbrks()
-{
+void eval_spline3d_onbrks() {
   Spline3d spline = spline3d();
 
   RowVectorXd u = spline.knots();
 
-  MatrixXd pts(11,3);
-  pts <<    0.959743958516081,   0.340385726666133,   0.585267750979777,
-    0.959743958516081,   0.340385726666133,   0.585267750979777,
-    0.959743958516081,   0.340385726666133,   0.585267750979777,
-    0.430282980289940,   0.713074680056118,   0.720373307943349,
-    0.558074875553060,   0.681617921034459,   0.804417124839942,
-    0.407076008291750,   0.349707710518163,   0.617275937419545,
-    0.240037008286602,   0.738739390398014,   0.324554153129411,
-    0.302434111480572,   0.781162443963899,   0.240177089094644,
-    0.251083857976031,   0.616044676146639,   0.473288848902729,
-    0.251083857976031,   0.616044676146639,   0.473288848902729,
-    0.251083857976031,   0.616044676146639,   0.473288848902729;
+  MatrixXd pts(11, 3);
+  pts << 0.959743958516081, 0.340385726666133, 0.585267750979777, 0.959743958516081, 0.340385726666133,
+      0.585267750979777, 0.959743958516081, 0.340385726666133, 0.585267750979777, 0.430282980289940, 0.713074680056118,
+      0.720373307943349, 0.558074875553060, 0.681617921034459, 0.804417124839942, 0.407076008291750, 0.349707710518163,
+      0.617275937419545, 0.240037008286602, 0.738739390398014, 0.324554153129411, 0.302434111480572, 0.781162443963899,
+      0.240177089094644, 0.251083857976031, 0.616044676146639, 0.473288848902729, 0.251083857976031, 0.616044676146639,
+      0.473288848902729, 0.251083857976031, 0.616044676146639, 0.473288848902729;
   pts.transposeInPlace();
 
-  for (int i=0; i<u.size(); ++i)
-  {
+  for (int i = 0; i < u.size(); ++i) {
     Vector3d pt = spline(u(i));
-    VERIFY( (pt - pts.col(i)).norm() < 1e-14 );
+    VERIFY((pt - pts.col(i)).norm() < 1e-14);
   }
 }
 
-void eval_closed_spline2d()
-{
+void eval_closed_spline2d() {
   Spline2d spline = closed_spline2d();
 
   RowVectorXd u(12);
-  u << 0,
-    0.332457030395796,
-    0.356467130532952,
-    0.453562180176215,
-    0.648017921874804,
-    0.973770235555003,
-    1.882577647219307,
-    2.289408593930498,
-    3.511951429883045,
-    3.884149321369450,
-    4.236261590369414,
-    4.252699478956276;
+  u << 0, 0.332457030395796, 0.356467130532952, 0.453562180176215, 0.648017921874804, 0.973770235555003,
+      1.882577647219307, 2.289408593930498, 3.511951429883045, 3.884149321369450, 4.236261590369414, 4.252699478956276;
 
-  MatrixXd pts(12,2);
-  pts << -0.370967741935484,   0.236842105263158,
-    -0.152576775123250,   0.448975001279334,
-    -0.133417538277668,   0.461615613865667,
-    -0.053199060826740,   0.507630360006299,
-    0.114249591147281,   0.570414135097409,
-    0.377810316891987,   0.560497102875315,
-    0.665052120135908,  -0.157557441109611,
-    0.516006487053228,  -0.559763292174825,
-    -0.379486035348887,  -0.331959640488223,
-    -0.462034726249078,  -0.039105670080824,
-    -0.378730600917982,   0.225127015099919,
-    -0.370967741935484,   0.236842105263158;
+  MatrixXd pts(12, 2);
+  pts << -0.370967741935484, 0.236842105263158, -0.152576775123250, 0.448975001279334, -0.133417538277668,
+      0.461615613865667, -0.053199060826740, 0.507630360006299, 0.114249591147281, 0.570414135097409, 0.377810316891987,
+      0.560497102875315, 0.665052120135908, -0.157557441109611, 0.516006487053228, -0.559763292174825,
+      -0.379486035348887, -0.331959640488223, -0.462034726249078, -0.039105670080824, -0.378730600917982,
+      0.225127015099919, -0.370967741935484, 0.236842105263158;
   pts.transposeInPlace();
 
-  for (int i=0; i<u.size(); ++i)
-  {
+  for (int i = 0; i < u.size(); ++i) {
     Vector2d pt = spline(u(i));
-    VERIFY( (pt - pts.col(i)).norm() < 1e-14 );
+    VERIFY((pt - pts.col(i)).norm() < 1e-14);
   }
 }
 
-void check_global_interpolation2d()
-{
+void check_global_interpolation2d() {
   typedef Spline2d::PointType PointType;
   typedef Spline2d::KnotVectorType KnotVectorType;
   typedef Spline2d::ControlPointVectorType ControlPointVectorType;
 
-  ControlPointVectorType points = ControlPointVectorType::Random(2,100);
+  ControlPointVectorType points = ControlPointVectorType::Random(2, 100);
 
-  KnotVectorType chord_lengths; // knot parameters
+  KnotVectorType chord_lengths;  // knot parameters
   Eigen::ChordLengths(points, chord_lengths);
 
   // interpolation without knot parameters
   {
-    const Spline2d spline = SplineFitting<Spline2d>::Interpolate(points,3);  
+    const Spline2d spline = SplineFitting<Spline2d>::Interpolate(points, 3);
 
-    for (Eigen::DenseIndex i=0; i<points.cols(); ++i)
-    {
-      PointType pt = spline( chord_lengths(i) );
+    for (Eigen::DenseIndex i = 0; i < points.cols(); ++i) {
+      PointType pt = spline(chord_lengths(i));
       PointType ref = points.col(i);
-      VERIFY( (pt - ref).matrix().norm() < 1e-14 );
+      VERIFY((pt - ref).matrix().norm() < 1e-14);
     }
   }
 
   // interpolation with given knot parameters
   {
-    const Spline2d spline = SplineFitting<Spline2d>::Interpolate(points,3,chord_lengths);  
+    const Spline2d spline = SplineFitting<Spline2d>::Interpolate(points, 3, chord_lengths);
 
-    for (Eigen::DenseIndex i=0; i<points.cols(); ++i)
-    {
-      PointType pt = spline( chord_lengths(i) );
+    for (Eigen::DenseIndex i = 0; i < points.cols(); ++i) {
+      PointType pt = spline(chord_lengths(i));
       PointType ref = points.col(i);
-      VERIFY( (pt - ref).matrix().norm() < 1e-14 );
+      VERIFY((pt - ref).matrix().norm() < 1e-14);
     }
   }
 }
 
-void check_global_interpolation_with_derivatives2d()
-{
+void check_global_interpolation_with_derivatives2d() {
   typedef Spline2d::PointType PointType;
   typedef Spline2d::KnotVectorType KnotVectorType;
 
@@ -251,14 +179,12 @@
   ArrayXXd derivatives = ArrayXXd::Random(dimension, numPoints);
   VectorXd derivativeIndices(numPoints);
 
-  for (Eigen::DenseIndex i = 0; i < numPoints; ++i)
-      derivativeIndices(i) = static_cast<double>(i);
+  for (Eigen::DenseIndex i = 0; i < numPoints; ++i) derivativeIndices(i) = static_cast<double>(i);
 
-  const Spline2d spline = SplineFitting<Spline2d>::InterpolateWithDerivatives(
-    points, derivatives, derivativeIndices, degree);  
-    
-  for (Eigen::DenseIndex i = 0; i < points.cols(); ++i)
-  {
+  const Spline2d spline =
+      SplineFitting<Spline2d>::InterpolateWithDerivatives(points, derivatives, derivativeIndices, degree);
+
+  for (Eigen::DenseIndex i = 0; i < points.cols(); ++i) {
     PointType point = spline(knots(i));
     PointType referencePoint = points.col(i);
     VERIFY_IS_APPROX(point, referencePoint);
@@ -268,14 +194,12 @@
   }
 }
 
-EIGEN_DECLARE_TEST(splines)
-{
-  for (int i = 0; i < g_repeat; ++i)
-  {
-    CALL_SUBTEST( eval_spline3d() );
-    CALL_SUBTEST( eval_spline3d_onbrks() );
-    CALL_SUBTEST( eval_closed_spline2d() );
-    CALL_SUBTEST( check_global_interpolation2d() );
-    CALL_SUBTEST( check_global_interpolation_with_derivatives2d() );
+EIGEN_DECLARE_TEST(splines) {
+  for (int i = 0; i < g_repeat; ++i) {
+    CALL_SUBTEST(eval_spline3d());
+    CALL_SUBTEST(eval_spline3d_onbrks());
+    CALL_SUBTEST(eval_closed_spline2d());
+    CALL_SUBTEST(check_global_interpolation2d());
+    CALL_SUBTEST(check_global_interpolation_with_derivatives2d());
   }
 }