blob: cffdbc5610f76797e323b90afb7a91b9b0634135 [file] [log] [blame]
Austin Schuh70cc9552019-01-21 19:46:48 -08001// Ceres Solver - A fast non-linear least squares minimizer
Austin Schuh3de38b02024-06-25 18:25:10 -07002// Copyright 2023 Google Inc. All rights reserved.
Austin Schuh70cc9552019-01-21 19:46:48 -08003// http://ceres-solver.org/
4//
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions are met:
7//
8// * Redistributions of source code must retain the above copyright notice,
9// this list of conditions and the following disclaimer.
10// * Redistributions in binary form must reproduce the above copyright notice,
11// this list of conditions and the following disclaimer in the documentation
12// and/or other materials provided with the distribution.
13// * Neither the name of Google Inc. nor the names of its contributors may be
14// used to endorse or promote products derived from this software without
15// specific prior written permission.
16//
17// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27// POSSIBILITY OF SUCH DAMAGE.
28//
29// Author: sameeragarwal@google.com (Sameer Agarwal)
30//
31// Template specialization of PartitionedMatrixView.
32//
33// ========================================
34// THIS FILE IS AUTOGENERATED. DO NOT EDIT.
35// THIS FILE IS AUTOGENERATED. DO NOT EDIT.
36// THIS FILE IS AUTOGENERATED. DO NOT EDIT.
37// THIS FILE IS AUTOGENERATED. DO NOT EDIT.
38//=========================================
39//
40// This file is generated using generate_template_specializations.py.
41
Austin Schuh3de38b02024-06-25 18:25:10 -070042#include <memory>
43
Austin Schuh70cc9552019-01-21 19:46:48 -080044#include "ceres/linear_solver.h"
45#include "ceres/partitioned_matrix_view.h"
Austin Schuh70cc9552019-01-21 19:46:48 -080046
Austin Schuh3de38b02024-06-25 18:25:10 -070047namespace ceres::internal {
Austin Schuh70cc9552019-01-21 19:46:48 -080048
Austin Schuh3de38b02024-06-25 18:25:10 -070049PartitionedMatrixViewBase::~PartitionedMatrixViewBase() = default;
50
51std::unique_ptr<PartitionedMatrixViewBase> PartitionedMatrixViewBase::Create(
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080052 const LinearSolver::Options& options, const BlockSparseMatrix& matrix) {
Austin Schuh70cc9552019-01-21 19:46:48 -080053#ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080054 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -080055 (options.e_block_size == 2) &&
56 (options.f_block_size == 2)) {
Austin Schuh3de38b02024-06-25 18:25:10 -070057 return std::make_unique<PartitionedMatrixView<2,2, 2>>(
58 options, matrix);
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080059 }
60 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -080061 (options.e_block_size == 2) &&
62 (options.f_block_size == 3)) {
Austin Schuh3de38b02024-06-25 18:25:10 -070063 return std::make_unique<PartitionedMatrixView<2,2, 3>>(
64 options, matrix);
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080065 }
66 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -080067 (options.e_block_size == 2) &&
68 (options.f_block_size == 4)) {
Austin Schuh3de38b02024-06-25 18:25:10 -070069 return std::make_unique<PartitionedMatrixView<2,2, 4>>(
70 options, matrix);
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080071 }
72 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -080073 (options.e_block_size == 2)) {
Austin Schuh3de38b02024-06-25 18:25:10 -070074 return std::make_unique<PartitionedMatrixView<2,2, Eigen::Dynamic>>(
75 options, matrix);
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080076 }
77 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -080078 (options.e_block_size == 3) &&
79 (options.f_block_size == 3)) {
Austin Schuh3de38b02024-06-25 18:25:10 -070080 return std::make_unique<PartitionedMatrixView<2,3, 3>>(
81 options, matrix);
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080082 }
83 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -080084 (options.e_block_size == 3) &&
85 (options.f_block_size == 4)) {
Austin Schuh3de38b02024-06-25 18:25:10 -070086 return std::make_unique<PartitionedMatrixView<2,3, 4>>(
87 options, matrix);
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080088 }
89 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -080090 (options.e_block_size == 3) &&
91 (options.f_block_size == 6)) {
Austin Schuh3de38b02024-06-25 18:25:10 -070092 return std::make_unique<PartitionedMatrixView<2,3, 6>>(
93 options, matrix);
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080094 }
95 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -080096 (options.e_block_size == 3) &&
97 (options.f_block_size == 9)) {
Austin Schuh3de38b02024-06-25 18:25:10 -070098 return std::make_unique<PartitionedMatrixView<2,3, 9>>(
99 options, matrix);
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800100 }
101 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -0800102 (options.e_block_size == 3)) {
Austin Schuh3de38b02024-06-25 18:25:10 -0700103 return std::make_unique<PartitionedMatrixView<2,3, Eigen::Dynamic>>(
104 options, matrix);
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800105 }
106 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -0800107 (options.e_block_size == 4) &&
108 (options.f_block_size == 3)) {
Austin Schuh3de38b02024-06-25 18:25:10 -0700109 return std::make_unique<PartitionedMatrixView<2,4, 3>>(
110 options, matrix);
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800111 }
112 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -0800113 (options.e_block_size == 4) &&
114 (options.f_block_size == 4)) {
Austin Schuh3de38b02024-06-25 18:25:10 -0700115 return std::make_unique<PartitionedMatrixView<2,4, 4>>(
116 options, matrix);
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800117 }
118 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -0800119 (options.e_block_size == 4) &&
120 (options.f_block_size == 6)) {
Austin Schuh3de38b02024-06-25 18:25:10 -0700121 return std::make_unique<PartitionedMatrixView<2,4, 6>>(
122 options, matrix);
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800123 }
124 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -0800125 (options.e_block_size == 4) &&
126 (options.f_block_size == 8)) {
Austin Schuh3de38b02024-06-25 18:25:10 -0700127 return std::make_unique<PartitionedMatrixView<2,4, 8>>(
128 options, matrix);
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800129 }
130 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -0800131 (options.e_block_size == 4) &&
132 (options.f_block_size == 9)) {
Austin Schuh3de38b02024-06-25 18:25:10 -0700133 return std::make_unique<PartitionedMatrixView<2,4, 9>>(
134 options, matrix);
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800135 }
136 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -0800137 (options.e_block_size == 4)) {
Austin Schuh3de38b02024-06-25 18:25:10 -0700138 return std::make_unique<PartitionedMatrixView<2,4, Eigen::Dynamic>>(
139 options, matrix);
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800140 }
141 if (options.row_block_size == 2) {
Austin Schuh3de38b02024-06-25 18:25:10 -0700142 return std::make_unique<PartitionedMatrixView<2,Eigen::Dynamic, Eigen::Dynamic>>(
143 options, matrix);
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800144 }
145 if ((options.row_block_size == 3) &&
146 (options.e_block_size == 3) &&
147 (options.f_block_size == 3)) {
Austin Schuh3de38b02024-06-25 18:25:10 -0700148 return std::make_unique<PartitionedMatrixView<3,3, 3>>(
149 options, matrix);
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800150 }
151 if ((options.row_block_size == 4) &&
Austin Schuh70cc9552019-01-21 19:46:48 -0800152 (options.e_block_size == 4) &&
153 (options.f_block_size == 2)) {
Austin Schuh3de38b02024-06-25 18:25:10 -0700154 return std::make_unique<PartitionedMatrixView<4,4, 2>>(
155 options, matrix);
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800156 }
157 if ((options.row_block_size == 4) &&
Austin Schuh70cc9552019-01-21 19:46:48 -0800158 (options.e_block_size == 4) &&
159 (options.f_block_size == 3)) {
Austin Schuh3de38b02024-06-25 18:25:10 -0700160 return std::make_unique<PartitionedMatrixView<4,4, 3>>(
161 options, matrix);
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800162 }
163 if ((options.row_block_size == 4) &&
Austin Schuh70cc9552019-01-21 19:46:48 -0800164 (options.e_block_size == 4) &&
165 (options.f_block_size == 4)) {
Austin Schuh3de38b02024-06-25 18:25:10 -0700166 return std::make_unique<PartitionedMatrixView<4,4, 4>>(
167 options, matrix);
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800168 }
169 if ((options.row_block_size == 4) &&
Austin Schuh70cc9552019-01-21 19:46:48 -0800170 (options.e_block_size == 4)) {
Austin Schuh3de38b02024-06-25 18:25:10 -0700171 return std::make_unique<PartitionedMatrixView<4,4, Eigen::Dynamic>>(
172 options, matrix);
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800173 }
Austin Schuh70cc9552019-01-21 19:46:48 -0800174
175#endif
176 VLOG(1) << "Template specializations not found for <"
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800177 << options.row_block_size << "," << options.e_block_size << ","
Austin Schuh70cc9552019-01-21 19:46:48 -0800178 << options.f_block_size << ">";
Austin Schuh3de38b02024-06-25 18:25:10 -0700179 return std::make_unique<PartitionedMatrixView<Eigen::Dynamic,
180 Eigen::Dynamic,
181 Eigen::Dynamic>>(
182 options, matrix);
Austin Schuh70cc9552019-01-21 19:46:48 -0800183};
184
Austin Schuh3de38b02024-06-25 18:25:10 -0700185} // namespace ceres::internal