blob: cffdbc5610f76797e323b90afb7a91b9b0634135 [file] [log] [blame]
Keir Mierle8ebb0732012-04-30 23:09:08 -07001// Ceres Solver - A fast non-linear least squares minimizer
Sameer Agarwal5a30cae2023-09-19 15:29:34 -07002// Copyright 2023 Google Inc. All rights reserved.
Keir Mierle7492b0d2015-03-17 22:30:16 -07003// http://ceres-solver.org/
Keir Mierle8ebb0732012-04-30 23:09:08 -07004//
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)
Sameer Agarwal5a161a22013-10-29 22:08:15 -070030//
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//
Sameer Agarwal1cfec3c2014-08-18 15:46:02 -070040// This file is generated using generate_template_specializations.py.
Keir Mierle8ebb0732012-04-30 23:09:08 -070041
Sameer Agarwal446487c2022-02-12 08:11:33 -080042#include <memory>
43
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +020044#include "ceres/linear_solver.h"
Sameer Agarwal6d9e9842020-09-28 11:35:37 -070045#include "ceres/partitioned_matrix_view.h"
Keir Mierle8ebb0732012-04-30 23:09:08 -070046
Sameer Agarwalcaf614a2022-04-21 17:41:10 -070047namespace ceres::internal {
Keir Mierle8ebb0732012-04-30 23:09:08 -070048
Sergiu Deitschc14f3602022-02-09 20:10:26 +010049PartitionedMatrixViewBase::~PartitionedMatrixViewBase() = default;
50
Sameer Agarwalae652192022-02-02 13:17:29 -080051std::unique_ptr<PartitionedMatrixViewBase> PartitionedMatrixViewBase::Create(
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +020052 const LinearSolver::Options& options, const BlockSparseMatrix& matrix) {
Sameer Agarwal5a161a22013-10-29 22:08:15 -070053#ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +020054 if ((options.row_block_size == 2) &&
Sameer Agarwal5f87f352017-02-27 11:00:49 -080055 (options.e_block_size == 2) &&
56 (options.f_block_size == 2)) {
Sameer Agarwalae652192022-02-02 13:17:29 -080057 return std::make_unique<PartitionedMatrixView<2,2, 2>>(
Sameer Agarwale4bef952022-11-14 11:40:49 -080058 options, matrix);
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +020059 }
60 if ((options.row_block_size == 2) &&
Sameer Agarwal5f87f352017-02-27 11:00:49 -080061 (options.e_block_size == 2) &&
62 (options.f_block_size == 3)) {
Sameer Agarwalae652192022-02-02 13:17:29 -080063 return std::make_unique<PartitionedMatrixView<2,2, 3>>(
Sameer Agarwale4bef952022-11-14 11:40:49 -080064 options, matrix);
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +020065 }
66 if ((options.row_block_size == 2) &&
Sameer Agarwal5f87f352017-02-27 11:00:49 -080067 (options.e_block_size == 2) &&
68 (options.f_block_size == 4)) {
Sameer Agarwalae652192022-02-02 13:17:29 -080069 return std::make_unique<PartitionedMatrixView<2,2, 4>>(
Sameer Agarwale4bef952022-11-14 11:40:49 -080070 options, matrix);
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +020071 }
72 if ((options.row_block_size == 2) &&
Sameer Agarwal5f87f352017-02-27 11:00:49 -080073 (options.e_block_size == 2)) {
Sameer Agarwalae652192022-02-02 13:17:29 -080074 return std::make_unique<PartitionedMatrixView<2,2, Eigen::Dynamic>>(
Sameer Agarwale4bef952022-11-14 11:40:49 -080075 options, matrix);
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +020076 }
77 if ((options.row_block_size == 2) &&
Sameer Agarwal5f87f352017-02-27 11:00:49 -080078 (options.e_block_size == 3) &&
79 (options.f_block_size == 3)) {
Sameer Agarwalae652192022-02-02 13:17:29 -080080 return std::make_unique<PartitionedMatrixView<2,3, 3>>(
Sameer Agarwale4bef952022-11-14 11:40:49 -080081 options, matrix);
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +020082 }
83 if ((options.row_block_size == 2) &&
Sameer Agarwal5f87f352017-02-27 11:00:49 -080084 (options.e_block_size == 3) &&
85 (options.f_block_size == 4)) {
Sameer Agarwalae652192022-02-02 13:17:29 -080086 return std::make_unique<PartitionedMatrixView<2,3, 4>>(
Sameer Agarwale4bef952022-11-14 11:40:49 -080087 options, matrix);
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +020088 }
89 if ((options.row_block_size == 2) &&
Sameer Agarwal5f87f352017-02-27 11:00:49 -080090 (options.e_block_size == 3) &&
91 (options.f_block_size == 6)) {
Sameer Agarwalae652192022-02-02 13:17:29 -080092 return std::make_unique<PartitionedMatrixView<2,3, 6>>(
Sameer Agarwale4bef952022-11-14 11:40:49 -080093 options, matrix);
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +020094 }
95 if ((options.row_block_size == 2) &&
Sameer Agarwal5f87f352017-02-27 11:00:49 -080096 (options.e_block_size == 3) &&
97 (options.f_block_size == 9)) {
Sameer Agarwalae652192022-02-02 13:17:29 -080098 return std::make_unique<PartitionedMatrixView<2,3, 9>>(
Sameer Agarwale4bef952022-11-14 11:40:49 -080099 options, matrix);
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +0200100 }
101 if ((options.row_block_size == 2) &&
Sameer Agarwal5f87f352017-02-27 11:00:49 -0800102 (options.e_block_size == 3)) {
Sameer Agarwalae652192022-02-02 13:17:29 -0800103 return std::make_unique<PartitionedMatrixView<2,3, Eigen::Dynamic>>(
Sameer Agarwale4bef952022-11-14 11:40:49 -0800104 options, matrix);
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +0200105 }
106 if ((options.row_block_size == 2) &&
Sameer Agarwal5f87f352017-02-27 11:00:49 -0800107 (options.e_block_size == 4) &&
108 (options.f_block_size == 3)) {
Sameer Agarwalae652192022-02-02 13:17:29 -0800109 return std::make_unique<PartitionedMatrixView<2,4, 3>>(
Sameer Agarwale4bef952022-11-14 11:40:49 -0800110 options, matrix);
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +0200111 }
112 if ((options.row_block_size == 2) &&
Sameer Agarwal5f87f352017-02-27 11:00:49 -0800113 (options.e_block_size == 4) &&
114 (options.f_block_size == 4)) {
Sameer Agarwalae652192022-02-02 13:17:29 -0800115 return std::make_unique<PartitionedMatrixView<2,4, 4>>(
Sameer Agarwale4bef952022-11-14 11:40:49 -0800116 options, matrix);
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +0200117 }
118 if ((options.row_block_size == 2) &&
Sameer Agarwal5f87f352017-02-27 11:00:49 -0800119 (options.e_block_size == 4) &&
Chris Sweeney2d703b12017-08-08 14:55:44 -0700120 (options.f_block_size == 6)) {
Sameer Agarwalae652192022-02-02 13:17:29 -0800121 return std::make_unique<PartitionedMatrixView<2,4, 6>>(
Sameer Agarwale4bef952022-11-14 11:40:49 -0800122 options, matrix);
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +0200123 }
124 if ((options.row_block_size == 2) &&
Chris Sweeney2d703b12017-08-08 14:55:44 -0700125 (options.e_block_size == 4) &&
Sameer Agarwal5f87f352017-02-27 11:00:49 -0800126 (options.f_block_size == 8)) {
Sameer Agarwalae652192022-02-02 13:17:29 -0800127 return std::make_unique<PartitionedMatrixView<2,4, 8>>(
Sameer Agarwale4bef952022-11-14 11:40:49 -0800128 options, matrix);
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +0200129 }
130 if ((options.row_block_size == 2) &&
Sameer Agarwal5f87f352017-02-27 11:00:49 -0800131 (options.e_block_size == 4) &&
132 (options.f_block_size == 9)) {
Sameer Agarwalae652192022-02-02 13:17:29 -0800133 return std::make_unique<PartitionedMatrixView<2,4, 9>>(
Sameer Agarwale4bef952022-11-14 11:40:49 -0800134 options, matrix);
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +0200135 }
136 if ((options.row_block_size == 2) &&
Sameer Agarwal5f87f352017-02-27 11:00:49 -0800137 (options.e_block_size == 4)) {
Sameer Agarwalae652192022-02-02 13:17:29 -0800138 return std::make_unique<PartitionedMatrixView<2,4, Eigen::Dynamic>>(
Sameer Agarwale4bef952022-11-14 11:40:49 -0800139 options, matrix);
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +0200140 }
141 if (options.row_block_size == 2) {
Sameer Agarwalae652192022-02-02 13:17:29 -0800142 return std::make_unique<PartitionedMatrixView<2,Eigen::Dynamic, Eigen::Dynamic>>(
Sameer Agarwale4bef952022-11-14 11:40:49 -0800143 options, matrix);
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +0200144 }
145 if ((options.row_block_size == 3) &&
Sameer Agarwal5a56d522019-03-07 07:39:21 -0800146 (options.e_block_size == 3) &&
147 (options.f_block_size == 3)) {
Sameer Agarwalae652192022-02-02 13:17:29 -0800148 return std::make_unique<PartitionedMatrixView<3,3, 3>>(
Sameer Agarwale4bef952022-11-14 11:40:49 -0800149 options, matrix);
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +0200150 }
151 if ((options.row_block_size == 4) &&
Sameer Agarwal5f87f352017-02-27 11:00:49 -0800152 (options.e_block_size == 4) &&
153 (options.f_block_size == 2)) {
Sameer Agarwalae652192022-02-02 13:17:29 -0800154 return std::make_unique<PartitionedMatrixView<4,4, 2>>(
Sameer Agarwale4bef952022-11-14 11:40:49 -0800155 options, matrix);
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +0200156 }
157 if ((options.row_block_size == 4) &&
Sameer Agarwal5f87f352017-02-27 11:00:49 -0800158 (options.e_block_size == 4) &&
159 (options.f_block_size == 3)) {
Sameer Agarwalae652192022-02-02 13:17:29 -0800160 return std::make_unique<PartitionedMatrixView<4,4, 3>>(
Sameer Agarwale4bef952022-11-14 11:40:49 -0800161 options, matrix);
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +0200162 }
163 if ((options.row_block_size == 4) &&
Sameer Agarwal5f87f352017-02-27 11:00:49 -0800164 (options.e_block_size == 4) &&
165 (options.f_block_size == 4)) {
Sameer Agarwalae652192022-02-02 13:17:29 -0800166 return std::make_unique<PartitionedMatrixView<4,4, 4>>(
Sameer Agarwale4bef952022-11-14 11:40:49 -0800167 options, matrix);
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +0200168 }
169 if ((options.row_block_size == 4) &&
Sameer Agarwal5f87f352017-02-27 11:00:49 -0800170 (options.e_block_size == 4)) {
Sameer Agarwalae652192022-02-02 13:17:29 -0800171 return std::make_unique<PartitionedMatrixView<4,4, Eigen::Dynamic>>(
Sameer Agarwale4bef952022-11-14 11:40:49 -0800172 options, matrix);
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +0200173 }
Keir Mierle8ebb0732012-04-30 23:09:08 -0700174
Sameer Agarwal5a161a22013-10-29 22:08:15 -0700175#endif
176 VLOG(1) << "Template specializations not found for <"
Nikolaus Demmeld3f66d72020-09-28 02:01:43 +0200177 << options.row_block_size << "," << options.e_block_size << ","
Sameer Agarwal5a161a22013-10-29 22:08:15 -0700178 << options.f_block_size << ">";
Sameer Agarwalae652192022-02-02 13:17:29 -0800179 return std::make_unique<PartitionedMatrixView<Eigen::Dynamic,
180 Eigen::Dynamic,
181 Eigen::Dynamic>>(
Sameer Agarwale4bef952022-11-14 11:40:49 -0800182 options, matrix);
Sameer Agarwal5a161a22013-10-29 22:08:15 -0700183};
Keir Mierle8ebb0732012-04-30 23:09:08 -0700184
Sameer Agarwalcaf614a2022-04-21 17:41:10 -0700185} // namespace ceres::internal