Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 1 | // Ceres Solver - A fast non-linear least squares minimizer |
Sameer Agarwal | 5a30cae | 2023-09-19 15:29:34 -0700 | [diff] [blame] | 2 | // Copyright 2023 Google Inc. All rights reserved. |
Keir Mierle | 7492b0d | 2015-03-17 22:30:16 -0700 | [diff] [blame] | 3 | // http://ceres-solver.org/ |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 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) |
Sameer Agarwal | 5a161a2 | 2013-10-29 22:08:15 -0700 | [diff] [blame] | 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 | // |
Sameer Agarwal | 1cfec3c | 2014-08-18 15:46:02 -0700 | [diff] [blame] | 40 | // This file is generated using generate_template_specializations.py. |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 41 | |
Sameer Agarwal | 446487c | 2022-02-12 08:11:33 -0800 | [diff] [blame] | 42 | #include <memory> |
| 43 | |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 44 | #include "ceres/linear_solver.h" |
Sameer Agarwal | 6d9e984 | 2020-09-28 11:35:37 -0700 | [diff] [blame] | 45 | #include "ceres/partitioned_matrix_view.h" |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 46 | |
Sameer Agarwal | caf614a | 2022-04-21 17:41:10 -0700 | [diff] [blame] | 47 | namespace ceres::internal { |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 48 | |
Sergiu Deitsch | c14f360 | 2022-02-09 20:10:26 +0100 | [diff] [blame] | 49 | PartitionedMatrixViewBase::~PartitionedMatrixViewBase() = default; |
| 50 | |
Sameer Agarwal | ae65219 | 2022-02-02 13:17:29 -0800 | [diff] [blame] | 51 | std::unique_ptr<PartitionedMatrixViewBase> PartitionedMatrixViewBase::Create( |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 52 | const LinearSolver::Options& options, const BlockSparseMatrix& matrix) { |
Sameer Agarwal | 5a161a2 | 2013-10-29 22:08:15 -0700 | [diff] [blame] | 53 | #ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 54 | if ((options.row_block_size == 2) && |
Sameer Agarwal | 5f87f35 | 2017-02-27 11:00:49 -0800 | [diff] [blame] | 55 | (options.e_block_size == 2) && |
| 56 | (options.f_block_size == 2)) { |
Sameer Agarwal | ae65219 | 2022-02-02 13:17:29 -0800 | [diff] [blame] | 57 | return std::make_unique<PartitionedMatrixView<2,2, 2>>( |
Sameer Agarwal | e4bef95 | 2022-11-14 11:40:49 -0800 | [diff] [blame] | 58 | options, matrix); |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 59 | } |
| 60 | if ((options.row_block_size == 2) && |
Sameer Agarwal | 5f87f35 | 2017-02-27 11:00:49 -0800 | [diff] [blame] | 61 | (options.e_block_size == 2) && |
| 62 | (options.f_block_size == 3)) { |
Sameer Agarwal | ae65219 | 2022-02-02 13:17:29 -0800 | [diff] [blame] | 63 | return std::make_unique<PartitionedMatrixView<2,2, 3>>( |
Sameer Agarwal | e4bef95 | 2022-11-14 11:40:49 -0800 | [diff] [blame] | 64 | options, matrix); |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 65 | } |
| 66 | if ((options.row_block_size == 2) && |
Sameer Agarwal | 5f87f35 | 2017-02-27 11:00:49 -0800 | [diff] [blame] | 67 | (options.e_block_size == 2) && |
| 68 | (options.f_block_size == 4)) { |
Sameer Agarwal | ae65219 | 2022-02-02 13:17:29 -0800 | [diff] [blame] | 69 | return std::make_unique<PartitionedMatrixView<2,2, 4>>( |
Sameer Agarwal | e4bef95 | 2022-11-14 11:40:49 -0800 | [diff] [blame] | 70 | options, matrix); |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 71 | } |
| 72 | if ((options.row_block_size == 2) && |
Sameer Agarwal | 5f87f35 | 2017-02-27 11:00:49 -0800 | [diff] [blame] | 73 | (options.e_block_size == 2)) { |
Sameer Agarwal | ae65219 | 2022-02-02 13:17:29 -0800 | [diff] [blame] | 74 | return std::make_unique<PartitionedMatrixView<2,2, Eigen::Dynamic>>( |
Sameer Agarwal | e4bef95 | 2022-11-14 11:40:49 -0800 | [diff] [blame] | 75 | options, matrix); |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 76 | } |
| 77 | if ((options.row_block_size == 2) && |
Sameer Agarwal | 5f87f35 | 2017-02-27 11:00:49 -0800 | [diff] [blame] | 78 | (options.e_block_size == 3) && |
| 79 | (options.f_block_size == 3)) { |
Sameer Agarwal | ae65219 | 2022-02-02 13:17:29 -0800 | [diff] [blame] | 80 | return std::make_unique<PartitionedMatrixView<2,3, 3>>( |
Sameer Agarwal | e4bef95 | 2022-11-14 11:40:49 -0800 | [diff] [blame] | 81 | options, matrix); |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 82 | } |
| 83 | if ((options.row_block_size == 2) && |
Sameer Agarwal | 5f87f35 | 2017-02-27 11:00:49 -0800 | [diff] [blame] | 84 | (options.e_block_size == 3) && |
| 85 | (options.f_block_size == 4)) { |
Sameer Agarwal | ae65219 | 2022-02-02 13:17:29 -0800 | [diff] [blame] | 86 | return std::make_unique<PartitionedMatrixView<2,3, 4>>( |
Sameer Agarwal | e4bef95 | 2022-11-14 11:40:49 -0800 | [diff] [blame] | 87 | options, matrix); |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 88 | } |
| 89 | if ((options.row_block_size == 2) && |
Sameer Agarwal | 5f87f35 | 2017-02-27 11:00:49 -0800 | [diff] [blame] | 90 | (options.e_block_size == 3) && |
| 91 | (options.f_block_size == 6)) { |
Sameer Agarwal | ae65219 | 2022-02-02 13:17:29 -0800 | [diff] [blame] | 92 | return std::make_unique<PartitionedMatrixView<2,3, 6>>( |
Sameer Agarwal | e4bef95 | 2022-11-14 11:40:49 -0800 | [diff] [blame] | 93 | options, matrix); |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 94 | } |
| 95 | if ((options.row_block_size == 2) && |
Sameer Agarwal | 5f87f35 | 2017-02-27 11:00:49 -0800 | [diff] [blame] | 96 | (options.e_block_size == 3) && |
| 97 | (options.f_block_size == 9)) { |
Sameer Agarwal | ae65219 | 2022-02-02 13:17:29 -0800 | [diff] [blame] | 98 | return std::make_unique<PartitionedMatrixView<2,3, 9>>( |
Sameer Agarwal | e4bef95 | 2022-11-14 11:40:49 -0800 | [diff] [blame] | 99 | options, matrix); |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 100 | } |
| 101 | if ((options.row_block_size == 2) && |
Sameer Agarwal | 5f87f35 | 2017-02-27 11:00:49 -0800 | [diff] [blame] | 102 | (options.e_block_size == 3)) { |
Sameer Agarwal | ae65219 | 2022-02-02 13:17:29 -0800 | [diff] [blame] | 103 | return std::make_unique<PartitionedMatrixView<2,3, Eigen::Dynamic>>( |
Sameer Agarwal | e4bef95 | 2022-11-14 11:40:49 -0800 | [diff] [blame] | 104 | options, matrix); |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 105 | } |
| 106 | if ((options.row_block_size == 2) && |
Sameer Agarwal | 5f87f35 | 2017-02-27 11:00:49 -0800 | [diff] [blame] | 107 | (options.e_block_size == 4) && |
| 108 | (options.f_block_size == 3)) { |
Sameer Agarwal | ae65219 | 2022-02-02 13:17:29 -0800 | [diff] [blame] | 109 | return std::make_unique<PartitionedMatrixView<2,4, 3>>( |
Sameer Agarwal | e4bef95 | 2022-11-14 11:40:49 -0800 | [diff] [blame] | 110 | options, matrix); |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 111 | } |
| 112 | if ((options.row_block_size == 2) && |
Sameer Agarwal | 5f87f35 | 2017-02-27 11:00:49 -0800 | [diff] [blame] | 113 | (options.e_block_size == 4) && |
| 114 | (options.f_block_size == 4)) { |
Sameer Agarwal | ae65219 | 2022-02-02 13:17:29 -0800 | [diff] [blame] | 115 | return std::make_unique<PartitionedMatrixView<2,4, 4>>( |
Sameer Agarwal | e4bef95 | 2022-11-14 11:40:49 -0800 | [diff] [blame] | 116 | options, matrix); |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 117 | } |
| 118 | if ((options.row_block_size == 2) && |
Sameer Agarwal | 5f87f35 | 2017-02-27 11:00:49 -0800 | [diff] [blame] | 119 | (options.e_block_size == 4) && |
Chris Sweeney | 2d703b1 | 2017-08-08 14:55:44 -0700 | [diff] [blame] | 120 | (options.f_block_size == 6)) { |
Sameer Agarwal | ae65219 | 2022-02-02 13:17:29 -0800 | [diff] [blame] | 121 | return std::make_unique<PartitionedMatrixView<2,4, 6>>( |
Sameer Agarwal | e4bef95 | 2022-11-14 11:40:49 -0800 | [diff] [blame] | 122 | options, matrix); |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 123 | } |
| 124 | if ((options.row_block_size == 2) && |
Chris Sweeney | 2d703b1 | 2017-08-08 14:55:44 -0700 | [diff] [blame] | 125 | (options.e_block_size == 4) && |
Sameer Agarwal | 5f87f35 | 2017-02-27 11:00:49 -0800 | [diff] [blame] | 126 | (options.f_block_size == 8)) { |
Sameer Agarwal | ae65219 | 2022-02-02 13:17:29 -0800 | [diff] [blame] | 127 | return std::make_unique<PartitionedMatrixView<2,4, 8>>( |
Sameer Agarwal | e4bef95 | 2022-11-14 11:40:49 -0800 | [diff] [blame] | 128 | options, matrix); |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 129 | } |
| 130 | if ((options.row_block_size == 2) && |
Sameer Agarwal | 5f87f35 | 2017-02-27 11:00:49 -0800 | [diff] [blame] | 131 | (options.e_block_size == 4) && |
| 132 | (options.f_block_size == 9)) { |
Sameer Agarwal | ae65219 | 2022-02-02 13:17:29 -0800 | [diff] [blame] | 133 | return std::make_unique<PartitionedMatrixView<2,4, 9>>( |
Sameer Agarwal | e4bef95 | 2022-11-14 11:40:49 -0800 | [diff] [blame] | 134 | options, matrix); |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 135 | } |
| 136 | if ((options.row_block_size == 2) && |
Sameer Agarwal | 5f87f35 | 2017-02-27 11:00:49 -0800 | [diff] [blame] | 137 | (options.e_block_size == 4)) { |
Sameer Agarwal | ae65219 | 2022-02-02 13:17:29 -0800 | [diff] [blame] | 138 | return std::make_unique<PartitionedMatrixView<2,4, Eigen::Dynamic>>( |
Sameer Agarwal | e4bef95 | 2022-11-14 11:40:49 -0800 | [diff] [blame] | 139 | options, matrix); |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 140 | } |
| 141 | if (options.row_block_size == 2) { |
Sameer Agarwal | ae65219 | 2022-02-02 13:17:29 -0800 | [diff] [blame] | 142 | return std::make_unique<PartitionedMatrixView<2,Eigen::Dynamic, Eigen::Dynamic>>( |
Sameer Agarwal | e4bef95 | 2022-11-14 11:40:49 -0800 | [diff] [blame] | 143 | options, matrix); |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 144 | } |
| 145 | if ((options.row_block_size == 3) && |
Sameer Agarwal | 5a56d52 | 2019-03-07 07:39:21 -0800 | [diff] [blame] | 146 | (options.e_block_size == 3) && |
| 147 | (options.f_block_size == 3)) { |
Sameer Agarwal | ae65219 | 2022-02-02 13:17:29 -0800 | [diff] [blame] | 148 | return std::make_unique<PartitionedMatrixView<3,3, 3>>( |
Sameer Agarwal | e4bef95 | 2022-11-14 11:40:49 -0800 | [diff] [blame] | 149 | options, matrix); |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 150 | } |
| 151 | if ((options.row_block_size == 4) && |
Sameer Agarwal | 5f87f35 | 2017-02-27 11:00:49 -0800 | [diff] [blame] | 152 | (options.e_block_size == 4) && |
| 153 | (options.f_block_size == 2)) { |
Sameer Agarwal | ae65219 | 2022-02-02 13:17:29 -0800 | [diff] [blame] | 154 | return std::make_unique<PartitionedMatrixView<4,4, 2>>( |
Sameer Agarwal | e4bef95 | 2022-11-14 11:40:49 -0800 | [diff] [blame] | 155 | options, matrix); |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 156 | } |
| 157 | if ((options.row_block_size == 4) && |
Sameer Agarwal | 5f87f35 | 2017-02-27 11:00:49 -0800 | [diff] [blame] | 158 | (options.e_block_size == 4) && |
| 159 | (options.f_block_size == 3)) { |
Sameer Agarwal | ae65219 | 2022-02-02 13:17:29 -0800 | [diff] [blame] | 160 | return std::make_unique<PartitionedMatrixView<4,4, 3>>( |
Sameer Agarwal | e4bef95 | 2022-11-14 11:40:49 -0800 | [diff] [blame] | 161 | options, matrix); |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 162 | } |
| 163 | if ((options.row_block_size == 4) && |
Sameer Agarwal | 5f87f35 | 2017-02-27 11:00:49 -0800 | [diff] [blame] | 164 | (options.e_block_size == 4) && |
| 165 | (options.f_block_size == 4)) { |
Sameer Agarwal | ae65219 | 2022-02-02 13:17:29 -0800 | [diff] [blame] | 166 | return std::make_unique<PartitionedMatrixView<4,4, 4>>( |
Sameer Agarwal | e4bef95 | 2022-11-14 11:40:49 -0800 | [diff] [blame] | 167 | options, matrix); |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 168 | } |
| 169 | if ((options.row_block_size == 4) && |
Sameer Agarwal | 5f87f35 | 2017-02-27 11:00:49 -0800 | [diff] [blame] | 170 | (options.e_block_size == 4)) { |
Sameer Agarwal | ae65219 | 2022-02-02 13:17:29 -0800 | [diff] [blame] | 171 | return std::make_unique<PartitionedMatrixView<4,4, Eigen::Dynamic>>( |
Sameer Agarwal | e4bef95 | 2022-11-14 11:40:49 -0800 | [diff] [blame] | 172 | options, matrix); |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 173 | } |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 174 | |
Sameer Agarwal | 5a161a2 | 2013-10-29 22:08:15 -0700 | [diff] [blame] | 175 | #endif |
| 176 | VLOG(1) << "Template specializations not found for <" |
Nikolaus Demmel | d3f66d7 | 2020-09-28 02:01:43 +0200 | [diff] [blame] | 177 | << options.row_block_size << "," << options.e_block_size << "," |
Sameer Agarwal | 5a161a2 | 2013-10-29 22:08:15 -0700 | [diff] [blame] | 178 | << options.f_block_size << ">"; |
Sameer Agarwal | ae65219 | 2022-02-02 13:17:29 -0800 | [diff] [blame] | 179 | return std::make_unique<PartitionedMatrixView<Eigen::Dynamic, |
| 180 | Eigen::Dynamic, |
| 181 | Eigen::Dynamic>>( |
Sameer Agarwal | e4bef95 | 2022-11-14 11:40:49 -0800 | [diff] [blame] | 182 | options, matrix); |
Sameer Agarwal | 5a161a2 | 2013-10-29 22:08:15 -0700 | [diff] [blame] | 183 | }; |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 184 | |
Sameer Agarwal | caf614a | 2022-04-21 17:41:10 -0700 | [diff] [blame] | 185 | } // namespace ceres::internal |