Revert "Group specializations into groups of four" 


This reverts commit 4ba244cdbc61a9e36beded2f6cbea0c79dad60d0.

Reason for revert: This commit causes CI failures.

Change-Id: I954f2b8f093e39e3b52ca91b331591b73e646554
diff --git a/internal/ceres/generate_template_specializations.py b/internal/ceres/generate_template_specializations.py
index 4a3296b..74e46c2 100644
--- a/internal/ceres/generate_template_specializations.py
+++ b/internal/ceres/generate_template_specializations.py
@@ -74,14 +74,10 @@
                    (4, 4, 4),
                    (4, 4, "Eigen::Dynamic")]
 
-# The number of files we group the specializations into
-NUM_SPECIALIZATION_FILES = 5
-
 import schur_eliminator_template
 import partitioned_matrix_view_template
 import os
 import glob
-from itertools import cycle
 
 def SuffixForSize(size):
   if size == "Eigen::Dynamic":
@@ -115,22 +111,16 @@
   """
 
   # Specialization files
+  for row_block_size, e_block_size, f_block_size in SPECIALIZATIONS:
+      output = SpecializationFilename("generated/" + name,
+                                      row_block_size,
+                                      e_block_size,
+                                      f_block_size) + ".cc"
 
-  # Distribute the spcializations over NUM_SPECIALIZAITON_FILES source files with each
-  # containing roughly the same number of specializations.
-  specialization_files = [[] for _ in range(min(NUM_SPECIALIZATION_FILES, len(SPECIALIZATIONS)))]
-  for specialization, file in zip(SPECIALIZATIONS, cycle(specialization_files)):
-      file.append(specialization)
-
-  for idx, specializations in enumerate(specialization_files):
-    output = "generated/" + name + "_specializations_set_" + str(idx) + ".cc"
-    with open(output, "w") as f:
-      f.write(data["HEADER"])
-      f.write(data["SPECIALIZATION_FILE_TOP"])
-      for row_block_size, e_block_size, f_block_size in specializations:
-        f.write(data["SPECIALIZATION_FILE_SPECIALIZATION"] %
-         (row_block_size, e_block_size, f_block_size))
-      f.write(data["SPECIALIZATION_FILE_BOTTOM"])
+      with open(output, "w") as f:
+        f.write(data["HEADER"])
+        f.write(data["SPECIALIZATION_FILE"] %
+                  (row_block_size, e_block_size, f_block_size))
 
   # Generate the _d_d_d specialization.
   output = SpecializationFilename("generated/" + name,
diff --git a/internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc b/internal/ceres/generated/partitioned_matrix_view_2_2_2.cc
similarity index 92%
copy from internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc
copy to internal/ceres/generated/partitioned_matrix_view_2_2_2.cc
index ab0e523..f5753be 100644
--- a/internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc
+++ b/internal/ceres/generated/partitioned_matrix_view_2_2_2.cc
@@ -49,11 +49,7 @@
 namespace ceres {
 namespace internal {
 
-
-template class PartitionedMatrixView<2, 2, 4>;
-template class PartitionedMatrixView<2, 3, 9>;
-template class PartitionedMatrixView<2, 4, 8>;
-template class PartitionedMatrixView<4, 4, 2>;
+template class PartitionedMatrixView<2, 2, 2>;
 
 }  // namespace internal
 }  // namespace ceres
diff --git a/internal/ceres/generated/partitioned_matrix_view_specializations_set_1.cc b/internal/ceres/generated/partitioned_matrix_view_2_2_3.cc
similarity index 94%
rename from internal/ceres/generated/partitioned_matrix_view_specializations_set_1.cc
rename to internal/ceres/generated/partitioned_matrix_view_2_2_3.cc
index 169eb7e..a7a9b52 100644
--- a/internal/ceres/generated/partitioned_matrix_view_specializations_set_1.cc
+++ b/internal/ceres/generated/partitioned_matrix_view_2_2_3.cc
@@ -49,11 +49,7 @@
 namespace ceres {
 namespace internal {
 
-
 template class PartitionedMatrixView<2, 2, 3>;
-template class PartitionedMatrixView<2, 3, 6>;
-template class PartitionedMatrixView<2, 4, 6>;
-template class PartitionedMatrixView<3, 3, 3>;
 
 }  // namespace internal
 }  // namespace ceres
diff --git a/internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc b/internal/ceres/generated/partitioned_matrix_view_2_2_4.cc
similarity index 94%
rename from internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc
rename to internal/ceres/generated/partitioned_matrix_view_2_2_4.cc
index ab0e523..faf6c4a 100644
--- a/internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc
+++ b/internal/ceres/generated/partitioned_matrix_view_2_2_4.cc
@@ -49,11 +49,7 @@
 namespace ceres {
 namespace internal {
 
-
 template class PartitionedMatrixView<2, 2, 4>;
-template class PartitionedMatrixView<2, 3, 9>;
-template class PartitionedMatrixView<2, 4, 8>;
-template class PartitionedMatrixView<4, 4, 2>;
 
 }  // namespace internal
 }  // namespace ceres
diff --git a/internal/ceres/generated/partitioned_matrix_view_specializations_set_3.cc b/internal/ceres/generated/partitioned_matrix_view_2_2_d.cc
similarity index 93%
copy from internal/ceres/generated/partitioned_matrix_view_specializations_set_3.cc
copy to internal/ceres/generated/partitioned_matrix_view_2_2_d.cc
index 57e3c2a..92fd4cd 100644
--- a/internal/ceres/generated/partitioned_matrix_view_specializations_set_3.cc
+++ b/internal/ceres/generated/partitioned_matrix_view_2_2_d.cc
@@ -49,11 +49,7 @@
 namespace ceres {
 namespace internal {
 
-
 template class PartitionedMatrixView<2, 2, Eigen::Dynamic>;
-template class PartitionedMatrixView<2, 3, Eigen::Dynamic>;
-template class PartitionedMatrixView<2, 4, 9>;
-template class PartitionedMatrixView<4, 4, 3>;
 
 }  // namespace internal
 }  // namespace ceres
diff --git a/internal/ceres/generated/partitioned_matrix_view_specializations_set_4.cc b/internal/ceres/generated/partitioned_matrix_view_2_3_3.cc
similarity index 93%
copy from internal/ceres/generated/partitioned_matrix_view_specializations_set_4.cc
copy to internal/ceres/generated/partitioned_matrix_view_2_3_3.cc
index bc1aaf3..2df314f 100644
--- a/internal/ceres/generated/partitioned_matrix_view_specializations_set_4.cc
+++ b/internal/ceres/generated/partitioned_matrix_view_2_3_3.cc
@@ -49,11 +49,7 @@
 namespace ceres {
 namespace internal {
 
-
 template class PartitionedMatrixView<2, 3, 3>;
-template class PartitionedMatrixView<2, 4, 3>;
-template class PartitionedMatrixView<2, 4, Eigen::Dynamic>;
-template class PartitionedMatrixView<4, 4, 4>;
 
 }  // namespace internal
 }  // namespace ceres
diff --git a/internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc b/internal/ceres/generated/partitioned_matrix_view_2_3_4.cc
similarity index 92%
copy from internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc
copy to internal/ceres/generated/partitioned_matrix_view_2_3_4.cc
index ab0e523..ff1ca3e 100644
--- a/internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc
+++ b/internal/ceres/generated/partitioned_matrix_view_2_3_4.cc
@@ -49,11 +49,7 @@
 namespace ceres {
 namespace internal {
 
-
-template class PartitionedMatrixView<2, 2, 4>;
-template class PartitionedMatrixView<2, 3, 9>;
-template class PartitionedMatrixView<2, 4, 8>;
-template class PartitionedMatrixView<4, 4, 2>;
+template class PartitionedMatrixView<2, 3, 4>;
 
 }  // namespace internal
 }  // namespace ceres
diff --git a/internal/ceres/generated/partitioned_matrix_view_specializations_set_1.cc b/internal/ceres/generated/partitioned_matrix_view_2_3_6.cc
similarity index 94%
copy from internal/ceres/generated/partitioned_matrix_view_specializations_set_1.cc
copy to internal/ceres/generated/partitioned_matrix_view_2_3_6.cc
index 169eb7e..5041df9 100644
--- a/internal/ceres/generated/partitioned_matrix_view_specializations_set_1.cc
+++ b/internal/ceres/generated/partitioned_matrix_view_2_3_6.cc
@@ -49,11 +49,7 @@
 namespace ceres {
 namespace internal {
 
-
-template class PartitionedMatrixView<2, 2, 3>;
 template class PartitionedMatrixView<2, 3, 6>;
-template class PartitionedMatrixView<2, 4, 6>;
-template class PartitionedMatrixView<3, 3, 3>;
 
 }  // namespace internal
 }  // namespace ceres
diff --git a/internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc b/internal/ceres/generated/partitioned_matrix_view_2_3_9.cc
similarity index 94%
copy from internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc
copy to internal/ceres/generated/partitioned_matrix_view_2_3_9.cc
index ab0e523..c0b72fe 100644
--- a/internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc
+++ b/internal/ceres/generated/partitioned_matrix_view_2_3_9.cc
@@ -49,11 +49,7 @@
 namespace ceres {
 namespace internal {
 
-
-template class PartitionedMatrixView<2, 2, 4>;
 template class PartitionedMatrixView<2, 3, 9>;
-template class PartitionedMatrixView<2, 4, 8>;
-template class PartitionedMatrixView<4, 4, 2>;
 
 }  // namespace internal
 }  // namespace ceres
diff --git a/internal/ceres/generated/partitioned_matrix_view_specializations_set_3.cc b/internal/ceres/generated/partitioned_matrix_view_2_3_d.cc
similarity index 93%
rename from internal/ceres/generated/partitioned_matrix_view_specializations_set_3.cc
rename to internal/ceres/generated/partitioned_matrix_view_2_3_d.cc
index 57e3c2a..8a3c162 100644
--- a/internal/ceres/generated/partitioned_matrix_view_specializations_set_3.cc
+++ b/internal/ceres/generated/partitioned_matrix_view_2_3_d.cc
@@ -49,11 +49,7 @@
 namespace ceres {
 namespace internal {
 
-
-template class PartitionedMatrixView<2, 2, Eigen::Dynamic>;
 template class PartitionedMatrixView<2, 3, Eigen::Dynamic>;
-template class PartitionedMatrixView<2, 4, 9>;
-template class PartitionedMatrixView<4, 4, 3>;
 
 }  // namespace internal
 }  // namespace ceres
diff --git a/internal/ceres/generated/partitioned_matrix_view_specializations_set_4.cc b/internal/ceres/generated/partitioned_matrix_view_2_4_3.cc
similarity index 93%
copy from internal/ceres/generated/partitioned_matrix_view_specializations_set_4.cc
copy to internal/ceres/generated/partitioned_matrix_view_2_4_3.cc
index bc1aaf3..0e69ca6 100644
--- a/internal/ceres/generated/partitioned_matrix_view_specializations_set_4.cc
+++ b/internal/ceres/generated/partitioned_matrix_view_2_4_3.cc
@@ -49,11 +49,7 @@
 namespace ceres {
 namespace internal {
 
-
-template class PartitionedMatrixView<2, 3, 3>;
 template class PartitionedMatrixView<2, 4, 3>;
-template class PartitionedMatrixView<2, 4, Eigen::Dynamic>;
-template class PartitionedMatrixView<4, 4, 4>;
 
 }  // namespace internal
 }  // namespace ceres
diff --git a/internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc b/internal/ceres/generated/partitioned_matrix_view_2_4_4.cc
similarity index 92%
copy from internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc
copy to internal/ceres/generated/partitioned_matrix_view_2_4_4.cc
index ab0e523..ba9bb61 100644
--- a/internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc
+++ b/internal/ceres/generated/partitioned_matrix_view_2_4_4.cc
@@ -49,11 +49,7 @@
 namespace ceres {
 namespace internal {
 
-
-template class PartitionedMatrixView<2, 2, 4>;
-template class PartitionedMatrixView<2, 3, 9>;
-template class PartitionedMatrixView<2, 4, 8>;
-template class PartitionedMatrixView<4, 4, 2>;
+template class PartitionedMatrixView<2, 4, 4>;
 
 }  // namespace internal
 }  // namespace ceres
diff --git a/internal/ceres/generated/partitioned_matrix_view_specializations_set_1.cc b/internal/ceres/generated/partitioned_matrix_view_2_4_6.cc
similarity index 94%
copy from internal/ceres/generated/partitioned_matrix_view_specializations_set_1.cc
copy to internal/ceres/generated/partitioned_matrix_view_2_4_6.cc
index 169eb7e..1acdb9b 100644
--- a/internal/ceres/generated/partitioned_matrix_view_specializations_set_1.cc
+++ b/internal/ceres/generated/partitioned_matrix_view_2_4_6.cc
@@ -49,11 +49,7 @@
 namespace ceres {
 namespace internal {
 
-
-template class PartitionedMatrixView<2, 2, 3>;
-template class PartitionedMatrixView<2, 3, 6>;
 template class PartitionedMatrixView<2, 4, 6>;
-template class PartitionedMatrixView<3, 3, 3>;
 
 }  // namespace internal
 }  // namespace ceres
diff --git a/internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc b/internal/ceres/generated/partitioned_matrix_view_2_4_8.cc
similarity index 94%
copy from internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc
copy to internal/ceres/generated/partitioned_matrix_view_2_4_8.cc
index ab0e523..888ff99 100644
--- a/internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc
+++ b/internal/ceres/generated/partitioned_matrix_view_2_4_8.cc
@@ -49,11 +49,7 @@
 namespace ceres {
 namespace internal {
 
-
-template class PartitionedMatrixView<2, 2, 4>;
-template class PartitionedMatrixView<2, 3, 9>;
 template class PartitionedMatrixView<2, 4, 8>;
-template class PartitionedMatrixView<4, 4, 2>;
 
 }  // namespace internal
 }  // namespace ceres
diff --git a/internal/ceres/generated/partitioned_matrix_view_specializations_set_3.cc b/internal/ceres/generated/partitioned_matrix_view_2_4_9.cc
similarity index 93%
copy from internal/ceres/generated/partitioned_matrix_view_specializations_set_3.cc
copy to internal/ceres/generated/partitioned_matrix_view_2_4_9.cc
index 57e3c2a..bd4dde3 100644
--- a/internal/ceres/generated/partitioned_matrix_view_specializations_set_3.cc
+++ b/internal/ceres/generated/partitioned_matrix_view_2_4_9.cc
@@ -49,11 +49,7 @@
 namespace ceres {
 namespace internal {
 
-
-template class PartitionedMatrixView<2, 2, Eigen::Dynamic>;
-template class PartitionedMatrixView<2, 3, Eigen::Dynamic>;
 template class PartitionedMatrixView<2, 4, 9>;
-template class PartitionedMatrixView<4, 4, 3>;
 
 }  // namespace internal
 }  // namespace ceres
diff --git a/internal/ceres/generated/partitioned_matrix_view_specializations_set_4.cc b/internal/ceres/generated/partitioned_matrix_view_2_4_d.cc
similarity index 94%
rename from internal/ceres/generated/partitioned_matrix_view_specializations_set_4.cc
rename to internal/ceres/generated/partitioned_matrix_view_2_4_d.cc
index bc1aaf3..6d3516f 100644
--- a/internal/ceres/generated/partitioned_matrix_view_specializations_set_4.cc
+++ b/internal/ceres/generated/partitioned_matrix_view_2_4_d.cc
@@ -49,11 +49,7 @@
 namespace ceres {
 namespace internal {
 
-
-template class PartitionedMatrixView<2, 3, 3>;
-template class PartitionedMatrixView<2, 4, 3>;
 template class PartitionedMatrixView<2, 4, Eigen::Dynamic>;
-template class PartitionedMatrixView<4, 4, 4>;
 
 }  // namespace internal
 }  // namespace ceres
diff --git a/internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc b/internal/ceres/generated/partitioned_matrix_view_2_d_d.cc
similarity index 92%
copy from internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc
copy to internal/ceres/generated/partitioned_matrix_view_2_d_d.cc
index ab0e523..77d22ed 100644
--- a/internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc
+++ b/internal/ceres/generated/partitioned_matrix_view_2_d_d.cc
@@ -49,11 +49,7 @@
 namespace ceres {
 namespace internal {
 
-
-template class PartitionedMatrixView<2, 2, 4>;
-template class PartitionedMatrixView<2, 3, 9>;
-template class PartitionedMatrixView<2, 4, 8>;
-template class PartitionedMatrixView<4, 4, 2>;
+template class PartitionedMatrixView<2, Eigen::Dynamic, Eigen::Dynamic>;
 
 }  // namespace internal
 }  // namespace ceres
diff --git a/internal/ceres/generated/partitioned_matrix_view_specializations_set_1.cc b/internal/ceres/generated/partitioned_matrix_view_3_3_3.cc
similarity index 94%
copy from internal/ceres/generated/partitioned_matrix_view_specializations_set_1.cc
copy to internal/ceres/generated/partitioned_matrix_view_3_3_3.cc
index 169eb7e..aeb456c 100644
--- a/internal/ceres/generated/partitioned_matrix_view_specializations_set_1.cc
+++ b/internal/ceres/generated/partitioned_matrix_view_3_3_3.cc
@@ -49,10 +49,6 @@
 namespace ceres {
 namespace internal {
 
-
-template class PartitionedMatrixView<2, 2, 3>;
-template class PartitionedMatrixView<2, 3, 6>;
-template class PartitionedMatrixView<2, 4, 6>;
 template class PartitionedMatrixView<3, 3, 3>;
 
 }  // namespace internal
diff --git a/internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc b/internal/ceres/generated/partitioned_matrix_view_4_4_2.cc
similarity index 94%
copy from internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc
copy to internal/ceres/generated/partitioned_matrix_view_4_4_2.cc
index ab0e523..bb240b9 100644
--- a/internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc
+++ b/internal/ceres/generated/partitioned_matrix_view_4_4_2.cc
@@ -49,10 +49,6 @@
 namespace ceres {
 namespace internal {
 
-
-template class PartitionedMatrixView<2, 2, 4>;
-template class PartitionedMatrixView<2, 3, 9>;
-template class PartitionedMatrixView<2, 4, 8>;
 template class PartitionedMatrixView<4, 4, 2>;
 
 }  // namespace internal
diff --git a/internal/ceres/generated/partitioned_matrix_view_specializations_set_3.cc b/internal/ceres/generated/partitioned_matrix_view_4_4_3.cc
similarity index 93%
copy from internal/ceres/generated/partitioned_matrix_view_specializations_set_3.cc
copy to internal/ceres/generated/partitioned_matrix_view_4_4_3.cc
index 57e3c2a..5d47543 100644
--- a/internal/ceres/generated/partitioned_matrix_view_specializations_set_3.cc
+++ b/internal/ceres/generated/partitioned_matrix_view_4_4_3.cc
@@ -49,10 +49,6 @@
 namespace ceres {
 namespace internal {
 
-
-template class PartitionedMatrixView<2, 2, Eigen::Dynamic>;
-template class PartitionedMatrixView<2, 3, Eigen::Dynamic>;
-template class PartitionedMatrixView<2, 4, 9>;
 template class PartitionedMatrixView<4, 4, 3>;
 
 }  // namespace internal
diff --git a/internal/ceres/generated/partitioned_matrix_view_specializations_set_4.cc b/internal/ceres/generated/partitioned_matrix_view_4_4_4.cc
similarity index 93%
copy from internal/ceres/generated/partitioned_matrix_view_specializations_set_4.cc
copy to internal/ceres/generated/partitioned_matrix_view_4_4_4.cc
index bc1aaf3..e14f980 100644
--- a/internal/ceres/generated/partitioned_matrix_view_specializations_set_4.cc
+++ b/internal/ceres/generated/partitioned_matrix_view_4_4_4.cc
@@ -49,10 +49,6 @@
 namespace ceres {
 namespace internal {
 
-
-template class PartitionedMatrixView<2, 3, 3>;
-template class PartitionedMatrixView<2, 4, 3>;
-template class PartitionedMatrixView<2, 4, Eigen::Dynamic>;
 template class PartitionedMatrixView<4, 4, 4>;
 
 }  // namespace internal
diff --git a/internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc b/internal/ceres/generated/partitioned_matrix_view_4_4_d.cc
similarity index 92%
copy from internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc
copy to internal/ceres/generated/partitioned_matrix_view_4_4_d.cc
index ab0e523..9ec5056 100644
--- a/internal/ceres/generated/partitioned_matrix_view_specializations_set_2.cc
+++ b/internal/ceres/generated/partitioned_matrix_view_4_4_d.cc
@@ -49,11 +49,7 @@
 namespace ceres {
 namespace internal {
 
-
-template class PartitionedMatrixView<2, 2, 4>;
-template class PartitionedMatrixView<2, 3, 9>;
-template class PartitionedMatrixView<2, 4, 8>;
-template class PartitionedMatrixView<4, 4, 2>;
+template class PartitionedMatrixView<4, 4, Eigen::Dynamic>;
 
 }  // namespace internal
 }  // namespace ceres
diff --git a/internal/ceres/generated/partitioned_matrix_view_specializations_set_0.cc b/internal/ceres/generated/partitioned_matrix_view_specializations_set_0.cc
deleted file mode 100644
index 99adc83..0000000
--- a/internal/ceres/generated/partitioned_matrix_view_specializations_set_0.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-// Ceres Solver - A fast non-linear least squares minimizer
-// Copyright 2017 Google Inc. All rights reserved.
-// http://ceres-solver.org/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// * Redistributions of source code must retain the above copyright notice,
-//   this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright notice,
-//   this list of conditions and the following disclaimer in the documentation
-//   and/or other materials provided with the distribution.
-// * Neither the name of Google Inc. nor the names of its contributors may be
-//   used to endorse or promote products derived from this software without
-//   specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: sameeragarwal@google.com (Sameer Agarwal)
-//
-// Template specialization of PartitionedMatrixView.
-//
-// ========================================
-// THIS FILE IS AUTOGENERATED. DO NOT EDIT.
-// THIS FILE IS AUTOGENERATED. DO NOT EDIT.
-// THIS FILE IS AUTOGENERATED. DO NOT EDIT.
-// THIS FILE IS AUTOGENERATED. DO NOT EDIT.
-//=========================================
-//
-// This file is generated using generate_template_specializations.py.
-
-// This include must come before any #ifndef check on Ceres compile options.
-#include "ceres/internal/port.h"
-
-#ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION
-
-#include "ceres/partitioned_matrix_view_impl.h"
-
-namespace ceres {
-namespace internal {
-
-
-template class PartitionedMatrixView<2, 2, 2>;
-template class PartitionedMatrixView<2, 3, 4>;
-template class PartitionedMatrixView<2, 4, 4>;
-template class PartitionedMatrixView<2, Eigen::Dynamic, Eigen::Dynamic>;
-template class PartitionedMatrixView<4, 4, Eigen::Dynamic>;
-
-}  // namespace internal
-}  // namespace ceres
-
-#endif  // CERES_RESTRICT_SCHUR_SPECIALIZATION
diff --git a/internal/ceres/generated/schur_eliminator_specializations_set_1.cc b/internal/ceres/generated/schur_eliminator_2_2_2.cc
similarity index 93%
copy from internal/ceres/generated/schur_eliminator_specializations_set_1.cc
copy to internal/ceres/generated/schur_eliminator_2_2_2.cc
index d5eff15..289a809 100644
--- a/internal/ceres/generated/schur_eliminator_specializations_set_1.cc
+++ b/internal/ceres/generated/schur_eliminator_2_2_2.cc
@@ -49,11 +49,8 @@
 namespace ceres {
 namespace internal {
 
+template class SchurEliminator<2, 2, 2>;
 
-template class SchurEliminator<2, 2, 3>;
-template class SchurEliminator<2, 3, 6>;
-template class SchurEliminator<2, 4, 6>;
-template class SchurEliminator<3, 3, 3>;
 }  // namespace internal
 }  // namespace ceres
 
diff --git a/internal/ceres/generated/schur_eliminator_specializations_set_1.cc b/internal/ceres/generated/schur_eliminator_2_2_3.cc
similarity index 94%
copy from internal/ceres/generated/schur_eliminator_specializations_set_1.cc
copy to internal/ceres/generated/schur_eliminator_2_2_3.cc
index d5eff15..20311ba 100644
--- a/internal/ceres/generated/schur_eliminator_specializations_set_1.cc
+++ b/internal/ceres/generated/schur_eliminator_2_2_3.cc
@@ -49,11 +49,8 @@
 namespace ceres {
 namespace internal {
 
-
 template class SchurEliminator<2, 2, 3>;
-template class SchurEliminator<2, 3, 6>;
-template class SchurEliminator<2, 4, 6>;
-template class SchurEliminator<3, 3, 3>;
+
 }  // namespace internal
 }  // namespace ceres
 
diff --git a/internal/ceres/generated/schur_eliminator_specializations_set_2.cc b/internal/ceres/generated/schur_eliminator_2_2_4.cc
similarity index 94%
copy from internal/ceres/generated/schur_eliminator_specializations_set_2.cc
copy to internal/ceres/generated/schur_eliminator_2_2_4.cc
index f7b3687..1f6a8ae 100644
--- a/internal/ceres/generated/schur_eliminator_specializations_set_2.cc
+++ b/internal/ceres/generated/schur_eliminator_2_2_4.cc
@@ -49,11 +49,8 @@
 namespace ceres {
 namespace internal {
 
-
 template class SchurEliminator<2, 2, 4>;
-template class SchurEliminator<2, 3, 9>;
-template class SchurEliminator<2, 4, 8>;
-template class SchurEliminator<4, 4, 2>;
+
 }  // namespace internal
 }  // namespace ceres
 
diff --git a/internal/ceres/generated/schur_eliminator_specializations_set_3.cc b/internal/ceres/generated/schur_eliminator_2_2_d.cc
similarity index 94%
copy from internal/ceres/generated/schur_eliminator_specializations_set_3.cc
copy to internal/ceres/generated/schur_eliminator_2_2_d.cc
index f190fc9..08b18d3 100644
--- a/internal/ceres/generated/schur_eliminator_specializations_set_3.cc
+++ b/internal/ceres/generated/schur_eliminator_2_2_d.cc
@@ -49,11 +49,8 @@
 namespace ceres {
 namespace internal {
 
-
 template class SchurEliminator<2, 2, Eigen::Dynamic>;
-template class SchurEliminator<2, 3, Eigen::Dynamic>;
-template class SchurEliminator<2, 4, 9>;
-template class SchurEliminator<4, 4, 3>;
+
 }  // namespace internal
 }  // namespace ceres
 
diff --git a/internal/ceres/generated/schur_eliminator_specializations_set_4.cc b/internal/ceres/generated/schur_eliminator_2_3_3.cc
similarity index 94%
rename from internal/ceres/generated/schur_eliminator_specializations_set_4.cc
rename to internal/ceres/generated/schur_eliminator_2_3_3.cc
index 78f8f23..115b4c8 100644
--- a/internal/ceres/generated/schur_eliminator_specializations_set_4.cc
+++ b/internal/ceres/generated/schur_eliminator_2_3_3.cc
@@ -49,11 +49,8 @@
 namespace ceres {
 namespace internal {
 
-
 template class SchurEliminator<2, 3, 3>;
-template class SchurEliminator<2, 4, 3>;
-template class SchurEliminator<2, 4, Eigen::Dynamic>;
-template class SchurEliminator<4, 4, 4>;
+
 }  // namespace internal
 }  // namespace ceres
 
diff --git a/internal/ceres/generated/schur_eliminator_specializations_set_1.cc b/internal/ceres/generated/schur_eliminator_2_3_4.cc
similarity index 93%
copy from internal/ceres/generated/schur_eliminator_specializations_set_1.cc
copy to internal/ceres/generated/schur_eliminator_2_3_4.cc
index d5eff15..c703537 100644
--- a/internal/ceres/generated/schur_eliminator_specializations_set_1.cc
+++ b/internal/ceres/generated/schur_eliminator_2_3_4.cc
@@ -49,11 +49,8 @@
 namespace ceres {
 namespace internal {
 
+template class SchurEliminator<2, 3, 4>;
 
-template class SchurEliminator<2, 2, 3>;
-template class SchurEliminator<2, 3, 6>;
-template class SchurEliminator<2, 4, 6>;
-template class SchurEliminator<3, 3, 3>;
 }  // namespace internal
 }  // namespace ceres
 
diff --git a/internal/ceres/generated/schur_eliminator_specializations_set_1.cc b/internal/ceres/generated/schur_eliminator_2_3_6.cc
similarity index 94%
copy from internal/ceres/generated/schur_eliminator_specializations_set_1.cc
copy to internal/ceres/generated/schur_eliminator_2_3_6.cc
index d5eff15..edb9afe 100644
--- a/internal/ceres/generated/schur_eliminator_specializations_set_1.cc
+++ b/internal/ceres/generated/schur_eliminator_2_3_6.cc
@@ -49,11 +49,8 @@
 namespace ceres {
 namespace internal {
 
-
-template class SchurEliminator<2, 2, 3>;
 template class SchurEliminator<2, 3, 6>;
-template class SchurEliminator<2, 4, 6>;
-template class SchurEliminator<3, 3, 3>;
+
 }  // namespace internal
 }  // namespace ceres
 
diff --git a/internal/ceres/generated/schur_eliminator_specializations_set_2.cc b/internal/ceres/generated/schur_eliminator_2_3_9.cc
similarity index 94%
copy from internal/ceres/generated/schur_eliminator_specializations_set_2.cc
copy to internal/ceres/generated/schur_eliminator_2_3_9.cc
index f7b3687..faa5c19 100644
--- a/internal/ceres/generated/schur_eliminator_specializations_set_2.cc
+++ b/internal/ceres/generated/schur_eliminator_2_3_9.cc
@@ -49,11 +49,8 @@
 namespace ceres {
 namespace internal {
 
-
-template class SchurEliminator<2, 2, 4>;
 template class SchurEliminator<2, 3, 9>;
-template class SchurEliminator<2, 4, 8>;
-template class SchurEliminator<4, 4, 2>;
+
 }  // namespace internal
 }  // namespace ceres
 
diff --git a/internal/ceres/generated/schur_eliminator_specializations_set_3.cc b/internal/ceres/generated/schur_eliminator_2_3_d.cc
similarity index 94%
rename from internal/ceres/generated/schur_eliminator_specializations_set_3.cc
rename to internal/ceres/generated/schur_eliminator_2_3_d.cc
index f190fc9..81b6f97 100644
--- a/internal/ceres/generated/schur_eliminator_specializations_set_3.cc
+++ b/internal/ceres/generated/schur_eliminator_2_3_d.cc
@@ -49,11 +49,8 @@
 namespace ceres {
 namespace internal {
 
-
-template class SchurEliminator<2, 2, Eigen::Dynamic>;
 template class SchurEliminator<2, 3, Eigen::Dynamic>;
-template class SchurEliminator<2, 4, 9>;
-template class SchurEliminator<4, 4, 3>;
+
 }  // namespace internal
 }  // namespace ceres
 
diff --git a/internal/ceres/generated/schur_eliminator_specializations_set_4.cc b/internal/ceres/generated/schur_eliminator_2_4_3.cc
similarity index 94%
copy from internal/ceres/generated/schur_eliminator_specializations_set_4.cc
copy to internal/ceres/generated/schur_eliminator_2_4_3.cc
index 78f8f23..2cb2d15 100644
--- a/internal/ceres/generated/schur_eliminator_specializations_set_4.cc
+++ b/internal/ceres/generated/schur_eliminator_2_4_3.cc
@@ -49,11 +49,8 @@
 namespace ceres {
 namespace internal {
 
-
-template class SchurEliminator<2, 3, 3>;
 template class SchurEliminator<2, 4, 3>;
-template class SchurEliminator<2, 4, Eigen::Dynamic>;
-template class SchurEliminator<4, 4, 4>;
+
 }  // namespace internal
 }  // namespace ceres
 
diff --git a/internal/ceres/generated/schur_eliminator_specializations_set_1.cc b/internal/ceres/generated/schur_eliminator_2_4_4.cc
similarity index 93%
copy from internal/ceres/generated/schur_eliminator_specializations_set_1.cc
copy to internal/ceres/generated/schur_eliminator_2_4_4.cc
index d5eff15..a78eff3 100644
--- a/internal/ceres/generated/schur_eliminator_specializations_set_1.cc
+++ b/internal/ceres/generated/schur_eliminator_2_4_4.cc
@@ -49,11 +49,8 @@
 namespace ceres {
 namespace internal {
 
+template class SchurEliminator<2, 4, 4>;
 
-template class SchurEliminator<2, 2, 3>;
-template class SchurEliminator<2, 3, 6>;
-template class SchurEliminator<2, 4, 6>;
-template class SchurEliminator<3, 3, 3>;
 }  // namespace internal
 }  // namespace ceres
 
diff --git a/internal/ceres/generated/schur_eliminator_specializations_set_1.cc b/internal/ceres/generated/schur_eliminator_2_4_6.cc
similarity index 94%
copy from internal/ceres/generated/schur_eliminator_specializations_set_1.cc
copy to internal/ceres/generated/schur_eliminator_2_4_6.cc
index d5eff15..e2534f2 100644
--- a/internal/ceres/generated/schur_eliminator_specializations_set_1.cc
+++ b/internal/ceres/generated/schur_eliminator_2_4_6.cc
@@ -49,11 +49,8 @@
 namespace ceres {
 namespace internal {
 
-
-template class SchurEliminator<2, 2, 3>;
-template class SchurEliminator<2, 3, 6>;
 template class SchurEliminator<2, 4, 6>;
-template class SchurEliminator<3, 3, 3>;
+
 }  // namespace internal
 }  // namespace ceres
 
diff --git a/internal/ceres/generated/schur_eliminator_specializations_set_2.cc b/internal/ceres/generated/schur_eliminator_2_4_8.cc
similarity index 94%
rename from internal/ceres/generated/schur_eliminator_specializations_set_2.cc
rename to internal/ceres/generated/schur_eliminator_2_4_8.cc
index f7b3687..296a462 100644
--- a/internal/ceres/generated/schur_eliminator_specializations_set_2.cc
+++ b/internal/ceres/generated/schur_eliminator_2_4_8.cc
@@ -49,11 +49,8 @@
 namespace ceres {
 namespace internal {
 
-
-template class SchurEliminator<2, 2, 4>;
-template class SchurEliminator<2, 3, 9>;
 template class SchurEliminator<2, 4, 8>;
-template class SchurEliminator<4, 4, 2>;
+
 }  // namespace internal
 }  // namespace ceres
 
diff --git a/internal/ceres/generated/schur_eliminator_specializations_set_1.cc b/internal/ceres/generated/schur_eliminator_2_4_9.cc
similarity index 93%
copy from internal/ceres/generated/schur_eliminator_specializations_set_1.cc
copy to internal/ceres/generated/schur_eliminator_2_4_9.cc
index d5eff15..0d0b04e 100644
--- a/internal/ceres/generated/schur_eliminator_specializations_set_1.cc
+++ b/internal/ceres/generated/schur_eliminator_2_4_9.cc
@@ -49,11 +49,8 @@
 namespace ceres {
 namespace internal {
 
+template class SchurEliminator<2, 4, 9>;
 
-template class SchurEliminator<2, 2, 3>;
-template class SchurEliminator<2, 3, 6>;
-template class SchurEliminator<2, 4, 6>;
-template class SchurEliminator<3, 3, 3>;
 }  // namespace internal
 }  // namespace ceres
 
diff --git a/internal/ceres/generated/schur_eliminator_specializations_set_4.cc b/internal/ceres/generated/schur_eliminator_2_4_d.cc
similarity index 94%
copy from internal/ceres/generated/schur_eliminator_specializations_set_4.cc
copy to internal/ceres/generated/schur_eliminator_2_4_d.cc
index 78f8f23..7979926 100644
--- a/internal/ceres/generated/schur_eliminator_specializations_set_4.cc
+++ b/internal/ceres/generated/schur_eliminator_2_4_d.cc
@@ -49,11 +49,8 @@
 namespace ceres {
 namespace internal {
 
-
-template class SchurEliminator<2, 3, 3>;
-template class SchurEliminator<2, 4, 3>;
 template class SchurEliminator<2, 4, Eigen::Dynamic>;
-template class SchurEliminator<4, 4, 4>;
+
 }  // namespace internal
 }  // namespace ceres
 
diff --git a/internal/ceres/generated/schur_eliminator_specializations_set_1.cc b/internal/ceres/generated/schur_eliminator_2_d_d.cc
similarity index 93%
copy from internal/ceres/generated/schur_eliminator_specializations_set_1.cc
copy to internal/ceres/generated/schur_eliminator_2_d_d.cc
index d5eff15..189be04 100644
--- a/internal/ceres/generated/schur_eliminator_specializations_set_1.cc
+++ b/internal/ceres/generated/schur_eliminator_2_d_d.cc
@@ -49,11 +49,8 @@
 namespace ceres {
 namespace internal {
 
+template class SchurEliminator<2, Eigen::Dynamic, Eigen::Dynamic>;
 
-template class SchurEliminator<2, 2, 3>;
-template class SchurEliminator<2, 3, 6>;
-template class SchurEliminator<2, 4, 6>;
-template class SchurEliminator<3, 3, 3>;
 }  // namespace internal
 }  // namespace ceres
 
diff --git a/internal/ceres/generated/schur_eliminator_specializations_set_1.cc b/internal/ceres/generated/schur_eliminator_3_3_3.cc
similarity index 94%
rename from internal/ceres/generated/schur_eliminator_specializations_set_1.cc
rename to internal/ceres/generated/schur_eliminator_3_3_3.cc
index d5eff15..35c14a8 100644
--- a/internal/ceres/generated/schur_eliminator_specializations_set_1.cc
+++ b/internal/ceres/generated/schur_eliminator_3_3_3.cc
@@ -49,11 +49,8 @@
 namespace ceres {
 namespace internal {
 
-
-template class SchurEliminator<2, 2, 3>;
-template class SchurEliminator<2, 3, 6>;
-template class SchurEliminator<2, 4, 6>;
 template class SchurEliminator<3, 3, 3>;
+
 }  // namespace internal
 }  // namespace ceres
 
diff --git a/internal/ceres/generated/schur_eliminator_specializations_set_2.cc b/internal/ceres/generated/schur_eliminator_4_4_2.cc
similarity index 94%
copy from internal/ceres/generated/schur_eliminator_specializations_set_2.cc
copy to internal/ceres/generated/schur_eliminator_4_4_2.cc
index f7b3687..878500a 100644
--- a/internal/ceres/generated/schur_eliminator_specializations_set_2.cc
+++ b/internal/ceres/generated/schur_eliminator_4_4_2.cc
@@ -49,11 +49,8 @@
 namespace ceres {
 namespace internal {
 
-
-template class SchurEliminator<2, 2, 4>;
-template class SchurEliminator<2, 3, 9>;
-template class SchurEliminator<2, 4, 8>;
 template class SchurEliminator<4, 4, 2>;
+
 }  // namespace internal
 }  // namespace ceres
 
diff --git a/internal/ceres/generated/schur_eliminator_specializations_set_1.cc b/internal/ceres/generated/schur_eliminator_4_4_3.cc
similarity index 93%
copy from internal/ceres/generated/schur_eliminator_specializations_set_1.cc
copy to internal/ceres/generated/schur_eliminator_4_4_3.cc
index d5eff15..c4b0959 100644
--- a/internal/ceres/generated/schur_eliminator_specializations_set_1.cc
+++ b/internal/ceres/generated/schur_eliminator_4_4_3.cc
@@ -49,11 +49,8 @@
 namespace ceres {
 namespace internal {
 
+template class SchurEliminator<4, 4, 3>;
 
-template class SchurEliminator<2, 2, 3>;
-template class SchurEliminator<2, 3, 6>;
-template class SchurEliminator<2, 4, 6>;
-template class SchurEliminator<3, 3, 3>;
 }  // namespace internal
 }  // namespace ceres
 
diff --git a/internal/ceres/generated/schur_eliminator_specializations_set_4.cc b/internal/ceres/generated/schur_eliminator_4_4_4.cc
similarity index 94%
copy from internal/ceres/generated/schur_eliminator_specializations_set_4.cc
copy to internal/ceres/generated/schur_eliminator_4_4_4.cc
index 78f8f23..20df534 100644
--- a/internal/ceres/generated/schur_eliminator_specializations_set_4.cc
+++ b/internal/ceres/generated/schur_eliminator_4_4_4.cc
@@ -49,11 +49,8 @@
 namespace ceres {
 namespace internal {
 
-
-template class SchurEliminator<2, 3, 3>;
-template class SchurEliminator<2, 4, 3>;
-template class SchurEliminator<2, 4, Eigen::Dynamic>;
 template class SchurEliminator<4, 4, 4>;
+
 }  // namespace internal
 }  // namespace ceres
 
diff --git a/internal/ceres/generated/schur_eliminator_specializations_set_1.cc b/internal/ceres/generated/schur_eliminator_4_4_d.cc
similarity index 93%
copy from internal/ceres/generated/schur_eliminator_specializations_set_1.cc
copy to internal/ceres/generated/schur_eliminator_4_4_d.cc
index d5eff15..17368dc 100644
--- a/internal/ceres/generated/schur_eliminator_specializations_set_1.cc
+++ b/internal/ceres/generated/schur_eliminator_4_4_d.cc
@@ -49,11 +49,8 @@
 namespace ceres {
 namespace internal {
 
+template class SchurEliminator<4, 4, Eigen::Dynamic>;
 
-template class SchurEliminator<2, 2, 3>;
-template class SchurEliminator<2, 3, 6>;
-template class SchurEliminator<2, 4, 6>;
-template class SchurEliminator<3, 3, 3>;
 }  // namespace internal
 }  // namespace ceres
 
diff --git a/internal/ceres/generated/schur_eliminator_specializations_set_0.cc b/internal/ceres/generated/schur_eliminator_specializations_set_0.cc
deleted file mode 100644
index 407a032..0000000
--- a/internal/ceres/generated/schur_eliminator_specializations_set_0.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-// Ceres Solver - A fast non-linear least squares minimizer
-// Copyright 2017 Google Inc. All rights reserved.
-// http://ceres-solver.org/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// * Redistributions of source code must retain the above copyright notice,
-//   this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright notice,
-//   this list of conditions and the following disclaimer in the documentation
-//   and/or other materials provided with the distribution.
-// * Neither the name of Google Inc. nor the names of its contributors may be
-//   used to endorse or promote products derived from this software without
-//   specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: sameeragarwal@google.com (Sameer Agarwal)
-//
-// Template specialization of SchurEliminator.
-//
-// ========================================
-// THIS FILE IS AUTOGENERATED. DO NOT EDIT.
-// THIS FILE IS AUTOGENERATED. DO NOT EDIT.
-// THIS FILE IS AUTOGENERATED. DO NOT EDIT.
-// THIS FILE IS AUTOGENERATED. DO NOT EDIT.
-//=========================================
-//
-// This file is generated using generate_template_specializations.py.
-
-// This include must come before any #ifndef check on Ceres compile options.
-#include "ceres/internal/port.h"
-
-#ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION
-
-#include "ceres/schur_eliminator_impl.h"
-
-namespace ceres {
-namespace internal {
-
-
-template class SchurEliminator<2, 2, 2>;
-template class SchurEliminator<2, 3, 4>;
-template class SchurEliminator<2, 4, 4>;
-template class SchurEliminator<2, Eigen::Dynamic, Eigen::Dynamic>;
-template class SchurEliminator<4, 4, Eigen::Dynamic>;
-}  // namespace internal
-}  // namespace ceres
-
-#endif  // CERES_RESTRICT_SCHUR_SPECIALIZATION
diff --git a/internal/ceres/partitioned_matrix_view_template.py b/internal/ceres/partitioned_matrix_view_template.py
index 454265d..05a25bf 100644
--- a/internal/ceres/partitioned_matrix_view_template.py
+++ b/internal/ceres/partitioned_matrix_view_template.py
@@ -102,7 +102,7 @@
 }  // namespace ceres
 """
 
-SPECIALIZATION_FILE_TOP = """
+SPECIALIZATION_FILE = """
 // This include must come before any #ifndef check on Ceres compile options.
 #include "ceres/internal/port.h"
 
@@ -113,12 +113,7 @@
 namespace ceres {
 namespace internal {
 
-"""
-
-SPECIALIZATION_FILE_SPECIALIZATION = """
-template class PartitionedMatrixView<%s, %s, %s>;"""
-
-SPECIALIZATION_FILE_BOTTOM = """
+template class PartitionedMatrixView<%s, %s, %s>;
 
 }  // namespace internal
 }  // namespace ceres
diff --git a/internal/ceres/schur_eliminator_template.py b/internal/ceres/schur_eliminator_template.py
index 61b0449..5051595 100644
--- a/internal/ceres/schur_eliminator_template.py
+++ b/internal/ceres/schur_eliminator_template.py
@@ -104,7 +104,7 @@
 }  // namespace ceres
 """
 
-SPECIALIZATION_FILE_TOP = """
+SPECIALIZATION_FILE = """
 // This include must come before any #ifndef check on Ceres compile options.
 #include "ceres/internal/port.h"
 
@@ -115,19 +115,14 @@
 namespace ceres {
 namespace internal {
 
-"""
+template class SchurEliminator<%s, %s, %s>;
 
-SPECIALIZATION_FILE_SPECIALIZATION = """
-template class SchurEliminator<%s, %s, %s>;"""
-
-SPECIALIZATION_FILE_BOTTOM = """
 }  // namespace internal
 }  // namespace ceres
 
 #endif  // CERES_RESTRICT_SCHUR_SPECIALIZATION
 """
 
-
 FACTORY_FILE_HEADER = """
 #include "ceres/linear_solver.h"
 #include "ceres/schur_eliminator.h"