Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 1 | // 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 Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 44 | |
| 45 | namespace ceres { |
| 46 | namespace internal { |
| 47 | |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 48 | PartitionedMatrixViewBase* PartitionedMatrixViewBase::Create( |
| 49 | const LinearSolver::Options& options, const BlockSparseMatrix& matrix) { |
Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 50 | #ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 51 | if ((options.row_block_size == 2) && |
Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 52 | (options.e_block_size == 2) && |
| 53 | (options.f_block_size == 2)) { |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 54 | return new PartitionedMatrixView<2, 2, 2>(matrix, |
| 55 | options.elimination_groups[0]); |
| 56 | } |
| 57 | if ((options.row_block_size == 2) && |
Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 58 | (options.e_block_size == 2) && |
| 59 | (options.f_block_size == 3)) { |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 60 | return new PartitionedMatrixView<2, 2, 3>(matrix, |
| 61 | options.elimination_groups[0]); |
| 62 | } |
| 63 | if ((options.row_block_size == 2) && |
Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 64 | (options.e_block_size == 2) && |
| 65 | (options.f_block_size == 4)) { |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 66 | return new PartitionedMatrixView<2, 2, 4>(matrix, |
| 67 | options.elimination_groups[0]); |
| 68 | } |
| 69 | if ((options.row_block_size == 2) && |
Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 70 | (options.e_block_size == 2)) { |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 71 | return new PartitionedMatrixView<2, 2, Eigen::Dynamic>(matrix, |
| 72 | options.elimination_groups[0]); |
| 73 | } |
| 74 | if ((options.row_block_size == 2) && |
Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 75 | (options.e_block_size == 3) && |
| 76 | (options.f_block_size == 3)) { |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 77 | return new PartitionedMatrixView<2, 3, 3>(matrix, |
| 78 | options.elimination_groups[0]); |
| 79 | } |
| 80 | if ((options.row_block_size == 2) && |
Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 81 | (options.e_block_size == 3) && |
| 82 | (options.f_block_size == 4)) { |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 83 | return new PartitionedMatrixView<2, 3, 4>(matrix, |
| 84 | options.elimination_groups[0]); |
| 85 | } |
| 86 | if ((options.row_block_size == 2) && |
Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 87 | (options.e_block_size == 3) && |
| 88 | (options.f_block_size == 6)) { |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 89 | return new PartitionedMatrixView<2, 3, 6>(matrix, |
| 90 | options.elimination_groups[0]); |
| 91 | } |
| 92 | if ((options.row_block_size == 2) && |
Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 93 | (options.e_block_size == 3) && |
| 94 | (options.f_block_size == 9)) { |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 95 | return new PartitionedMatrixView<2, 3, 9>(matrix, |
| 96 | options.elimination_groups[0]); |
| 97 | } |
| 98 | if ((options.row_block_size == 2) && |
Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 99 | (options.e_block_size == 3)) { |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 100 | return new PartitionedMatrixView<2, 3, Eigen::Dynamic>(matrix, |
| 101 | options.elimination_groups[0]); |
| 102 | } |
| 103 | if ((options.row_block_size == 2) && |
Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 104 | (options.e_block_size == 4) && |
| 105 | (options.f_block_size == 3)) { |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 106 | return new PartitionedMatrixView<2, 4, 3>(matrix, |
| 107 | options.elimination_groups[0]); |
| 108 | } |
| 109 | if ((options.row_block_size == 2) && |
Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 110 | (options.e_block_size == 4) && |
| 111 | (options.f_block_size == 4)) { |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 112 | return new PartitionedMatrixView<2, 4, 4>(matrix, |
| 113 | options.elimination_groups[0]); |
| 114 | } |
| 115 | if ((options.row_block_size == 2) && |
Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 116 | (options.e_block_size == 4) && |
| 117 | (options.f_block_size == 6)) { |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 118 | return new PartitionedMatrixView<2, 4, 6>(matrix, |
| 119 | options.elimination_groups[0]); |
| 120 | } |
| 121 | if ((options.row_block_size == 2) && |
Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 122 | (options.e_block_size == 4) && |
| 123 | (options.f_block_size == 8)) { |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 124 | return new PartitionedMatrixView<2, 4, 8>(matrix, |
| 125 | options.elimination_groups[0]); |
| 126 | } |
| 127 | if ((options.row_block_size == 2) && |
Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 128 | (options.e_block_size == 4) && |
| 129 | (options.f_block_size == 9)) { |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 130 | return new PartitionedMatrixView<2, 4, 9>(matrix, |
| 131 | options.elimination_groups[0]); |
| 132 | } |
| 133 | if ((options.row_block_size == 2) && |
Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 134 | (options.e_block_size == 4)) { |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 135 | 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 Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 149 | (options.e_block_size == 4) && |
| 150 | (options.f_block_size == 2)) { |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 151 | return new PartitionedMatrixView<4, 4, 2>(matrix, |
| 152 | options.elimination_groups[0]); |
| 153 | } |
| 154 | if ((options.row_block_size == 4) && |
Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 155 | (options.e_block_size == 4) && |
| 156 | (options.f_block_size == 3)) { |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 157 | return new PartitionedMatrixView<4, 4, 3>(matrix, |
| 158 | options.elimination_groups[0]); |
| 159 | } |
| 160 | if ((options.row_block_size == 4) && |
Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 161 | (options.e_block_size == 4) && |
| 162 | (options.f_block_size == 4)) { |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 163 | return new PartitionedMatrixView<4, 4, 4>(matrix, |
| 164 | options.elimination_groups[0]); |
| 165 | } |
| 166 | if ((options.row_block_size == 4) && |
Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 167 | (options.e_block_size == 4)) { |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 168 | return new PartitionedMatrixView<4, 4, Eigen::Dynamic>(matrix, |
| 169 | options.elimination_groups[0]); |
| 170 | } |
Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 171 | |
| 172 | #endif |
| 173 | VLOG(1) << "Template specializations not found for <" |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 174 | << options.row_block_size << "," << options.e_block_size << "," |
Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 175 | << options.f_block_size << ">"; |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 176 | return new PartitionedMatrixView<Eigen::Dynamic, |
| 177 | Eigen::Dynamic, |
| 178 | Eigen::Dynamic>( |
| 179 | matrix, options.elimination_groups[0]); |
Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 180 | }; |
| 181 | |
| 182 | } // namespace internal |
| 183 | } // namespace ceres |