blob: b67bc905d15cf4af2d54d7db815f8373aae1c96f [file] [log] [blame]
Austin Schuh70cc9552019-01-21 19:46:48 -08001// Ceres Solver - A fast non-linear least squares minimizer
2// Copyright 2017 Google Inc. All rights reserved.
3// 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
42#include "ceres/linear_solver.h"
43#include "ceres/partitioned_matrix_view.h"
Austin Schuh70cc9552019-01-21 19:46:48 -080044
45namespace ceres {
46namespace internal {
47
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080048PartitionedMatrixViewBase* PartitionedMatrixViewBase::Create(
49 const LinearSolver::Options& options, const BlockSparseMatrix& matrix) {
Austin Schuh70cc9552019-01-21 19:46:48 -080050#ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080051 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -080052 (options.e_block_size == 2) &&
53 (options.f_block_size == 2)) {
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080054 return new PartitionedMatrixView<2, 2, 2>(matrix,
55 options.elimination_groups[0]);
56 }
57 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -080058 (options.e_block_size == 2) &&
59 (options.f_block_size == 3)) {
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080060 return new PartitionedMatrixView<2, 2, 3>(matrix,
61 options.elimination_groups[0]);
62 }
63 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -080064 (options.e_block_size == 2) &&
65 (options.f_block_size == 4)) {
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080066 return new PartitionedMatrixView<2, 2, 4>(matrix,
67 options.elimination_groups[0]);
68 }
69 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -080070 (options.e_block_size == 2)) {
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080071 return new PartitionedMatrixView<2, 2, Eigen::Dynamic>(matrix,
72 options.elimination_groups[0]);
73 }
74 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -080075 (options.e_block_size == 3) &&
76 (options.f_block_size == 3)) {
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080077 return new PartitionedMatrixView<2, 3, 3>(matrix,
78 options.elimination_groups[0]);
79 }
80 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -080081 (options.e_block_size == 3) &&
82 (options.f_block_size == 4)) {
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080083 return new PartitionedMatrixView<2, 3, 4>(matrix,
84 options.elimination_groups[0]);
85 }
86 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -080087 (options.e_block_size == 3) &&
88 (options.f_block_size == 6)) {
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080089 return new PartitionedMatrixView<2, 3, 6>(matrix,
90 options.elimination_groups[0]);
91 }
92 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -080093 (options.e_block_size == 3) &&
94 (options.f_block_size == 9)) {
Austin Schuh1d1e6ea2020-12-23 21:56:30 -080095 return new PartitionedMatrixView<2, 3, 9>(matrix,
96 options.elimination_groups[0]);
97 }
98 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -080099 (options.e_block_size == 3)) {
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800100 return new PartitionedMatrixView<2, 3, Eigen::Dynamic>(matrix,
101 options.elimination_groups[0]);
102 }
103 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -0800104 (options.e_block_size == 4) &&
105 (options.f_block_size == 3)) {
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800106 return new PartitionedMatrixView<2, 4, 3>(matrix,
107 options.elimination_groups[0]);
108 }
109 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -0800110 (options.e_block_size == 4) &&
111 (options.f_block_size == 4)) {
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800112 return new PartitionedMatrixView<2, 4, 4>(matrix,
113 options.elimination_groups[0]);
114 }
115 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -0800116 (options.e_block_size == 4) &&
117 (options.f_block_size == 6)) {
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800118 return new PartitionedMatrixView<2, 4, 6>(matrix,
119 options.elimination_groups[0]);
120 }
121 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -0800122 (options.e_block_size == 4) &&
123 (options.f_block_size == 8)) {
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800124 return new PartitionedMatrixView<2, 4, 8>(matrix,
125 options.elimination_groups[0]);
126 }
127 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -0800128 (options.e_block_size == 4) &&
129 (options.f_block_size == 9)) {
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800130 return new PartitionedMatrixView<2, 4, 9>(matrix,
131 options.elimination_groups[0]);
132 }
133 if ((options.row_block_size == 2) &&
Austin Schuh70cc9552019-01-21 19:46:48 -0800134 (options.e_block_size == 4)) {
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800135 return new PartitionedMatrixView<2, 4, Eigen::Dynamic>(matrix,
136 options.elimination_groups[0]);
137 }
138 if (options.row_block_size == 2) {
139 return new PartitionedMatrixView<2, Eigen::Dynamic, Eigen::Dynamic>(matrix,
140 options.elimination_groups[0]);
141 }
142 if ((options.row_block_size == 3) &&
143 (options.e_block_size == 3) &&
144 (options.f_block_size == 3)) {
145 return new PartitionedMatrixView<3, 3, 3>(matrix,
146 options.elimination_groups[0]);
147 }
148 if ((options.row_block_size == 4) &&
Austin Schuh70cc9552019-01-21 19:46:48 -0800149 (options.e_block_size == 4) &&
150 (options.f_block_size == 2)) {
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800151 return new PartitionedMatrixView<4, 4, 2>(matrix,
152 options.elimination_groups[0]);
153 }
154 if ((options.row_block_size == 4) &&
Austin Schuh70cc9552019-01-21 19:46:48 -0800155 (options.e_block_size == 4) &&
156 (options.f_block_size == 3)) {
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800157 return new PartitionedMatrixView<4, 4, 3>(matrix,
158 options.elimination_groups[0]);
159 }
160 if ((options.row_block_size == 4) &&
Austin Schuh70cc9552019-01-21 19:46:48 -0800161 (options.e_block_size == 4) &&
162 (options.f_block_size == 4)) {
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800163 return new PartitionedMatrixView<4, 4, 4>(matrix,
164 options.elimination_groups[0]);
165 }
166 if ((options.row_block_size == 4) &&
Austin Schuh70cc9552019-01-21 19:46:48 -0800167 (options.e_block_size == 4)) {
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800168 return new PartitionedMatrixView<4, 4, Eigen::Dynamic>(matrix,
169 options.elimination_groups[0]);
170 }
Austin Schuh70cc9552019-01-21 19:46:48 -0800171
172#endif
173 VLOG(1) << "Template specializations not found for <"
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800174 << options.row_block_size << "," << options.e_block_size << ","
Austin Schuh70cc9552019-01-21 19:46:48 -0800175 << options.f_block_size << ">";
Austin Schuh1d1e6ea2020-12-23 21:56:30 -0800176 return new PartitionedMatrixView<Eigen::Dynamic,
177 Eigen::Dynamic,
178 Eigen::Dynamic>(
179 matrix, options.elimination_groups[0]);
Austin Schuh70cc9552019-01-21 19:46:48 -0800180};
181
182} // namespace internal
183} // namespace ceres