DenseSparseMatrix is now column-major.

1. Introduce new typdefs in eigen.h to allow for column
   major matrices.

2. Clean up old unused typedefs, and the aligned typedefs
   since they do not actually add any real performance.

3. Made eigen.h conform to the google style guide by removing
   the using directives. They were polluting the ceres namespace.

4. Made the template specialization generator work again.

Change-Id: Ic2268c784534b737ebd6e1a043e2a327adaeca37
diff --git a/internal/ceres/dense_sparse_matrix.cc b/internal/ceres/dense_sparse_matrix.cc
index 978ac6a..9d58031 100644
--- a/internal/ceres/dense_sparse_matrix.cc
+++ b/internal/ceres/dense_sparse_matrix.cc
@@ -42,7 +42,6 @@
 DenseSparseMatrix::DenseSparseMatrix(int num_rows, int num_cols)
     : has_diagonal_appended_(false),
       has_diagonal_reserved_(false) {
-  // Allocate enough space for the diagonal.
   m_.resize(num_rows, num_cols);
   m_.setZero();
 }
@@ -52,8 +51,8 @@
                                      bool reserve_diagonal)
     : has_diagonal_appended_(false),
       has_diagonal_reserved_(reserve_diagonal) {
-  // Allocate enough space for the diagonal.
   if (reserve_diagonal) {
+    // Allocate enough space for the diagonal.
     m_.resize(num_rows +  num_cols, num_cols);
   } else {
     m_.resize(num_rows, num_cols);
@@ -75,7 +74,7 @@
   }
 }
 
-DenseSparseMatrix::DenseSparseMatrix(const Matrix& m)
+DenseSparseMatrix::DenseSparseMatrix(const ColMajorMatrix& m)
     : m_(m),
       has_diagonal_appended_(false),
       has_diagonal_reserved_(false) {
@@ -141,7 +140,7 @@
 void DenseSparseMatrix::AppendDiagonal(double *d) {
   CHECK(!has_diagonal_appended_);
   if (!has_diagonal_reserved_) {
-    Matrix tmp = m_;
+    ColMajorMatrix tmp = m_;
     m_.resize(m_.rows() + m_.cols(), m_.cols());
     m_.setZero();
     m_.block(0, 0, tmp.rows(), tmp.cols()) = tmp;
@@ -177,22 +176,27 @@
   return m_.rows() * m_.cols();
 }
 
-ConstAlignedMatrixRef DenseSparseMatrix::matrix() const {
-  if (has_diagonal_reserved_ && !has_diagonal_appended_) {
-    return ConstAlignedMatrixRef(
-        m_.data(), m_.rows() - m_.cols(), m_.cols());
-  }
-  return ConstAlignedMatrixRef(m_.data(), m_.rows(), m_.cols());
+ConstColMajorMatrixRef DenseSparseMatrix::matrix() const {
+  return ConstColMajorMatrixRef(
+      m_.data(),
+      ((has_diagonal_reserved_ && !has_diagonal_appended_)
+       ? m_.rows() - m_.cols()
+       : m_.rows()),
+      m_.cols(),
+      Eigen::Stride<Eigen::Dynamic, 1>(m_.rows(), 1));
 }
 
-AlignedMatrixRef DenseSparseMatrix::mutable_matrix() {
-  if (has_diagonal_reserved_ && !has_diagonal_appended_) {
-    return AlignedMatrixRef(
-        m_.data(), m_.rows() - m_.cols(), m_.cols());
-  }
-  return AlignedMatrixRef(m_.data(), m_.rows(), m_.cols());
+ColMajorMatrixRef DenseSparseMatrix::mutable_matrix() {
+  return ColMajorMatrixRef(
+      m_.data(),
+      ((has_diagonal_reserved_ && !has_diagonal_appended_)
+       ? m_.rows() - m_.cols()
+       : m_.rows()),
+      m_.cols(),
+      Eigen::Stride<Eigen::Dynamic, 1>(m_.rows(), 1));
 }
 
+
 void DenseSparseMatrix::ToTextFile(FILE* file) const {
   CHECK_NOTNULL(file);
   const int active_rows =