├── .github └── workflows │ └── c-cpp.yml ├── .gitignore ├── .vscode └── settings.json ├── LICENSE ├── LICENSE-DATA ├── README.md ├── data ├── scan_1.txt └── scan_2.txt ├── flatkdtree.h ├── main.cpp ├── main_downsample.cpp ├── matrixutil.hpp ├── ndt-cpu-single.hpp ├── ndtcpputil.hpp └── type.hpp /.github/workflows/c-cpp.yml: -------------------------------------------------------------------------------- 1 | name: C/C++ CI 2 | 3 | on: 4 | push: 5 | branches: [ "main" ] 6 | pull_request: 7 | branches: [ "main" ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v3 16 | 17 | - name: build-main_downsample 18 | run: | 19 | g++ -std=c++17 -O2 main_downsample.cpp && ./a.out 20 | - name: build-main 21 | run: | 22 | g++ -std=c++17 -O2 main.cpp && ./a.out -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.DS_Store 2 | *.out 3 | *.svg -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "chrono": "cpp", 4 | "cctype": "cpp", 5 | "clocale": "cpp", 6 | "cmath": "cpp", 7 | "cstdarg": "cpp", 8 | "cstddef": "cpp", 9 | "cstdio": "cpp", 10 | "cstdlib": "cpp", 11 | "cstring": "cpp", 12 | "ctime": "cpp", 13 | "cwchar": "cpp", 14 | "cwctype": "cpp", 15 | "array": "cpp", 16 | "atomic": "cpp", 17 | "strstream": "cpp", 18 | "bit": "cpp", 19 | "*.tcc": "cpp", 20 | "bitset": "cpp", 21 | "cfenv": "cpp", 22 | "cinttypes": "cpp", 23 | "compare": "cpp", 24 | "complex": "cpp", 25 | "concepts": "cpp", 26 | "condition_variable": "cpp", 27 | "cstdint": "cpp", 28 | "deque": "cpp", 29 | "forward_list": "cpp", 30 | "list": "cpp", 31 | "map": "cpp", 32 | "set": "cpp", 33 | "string": "cpp", 34 | "unordered_map": "cpp", 35 | "unordered_set": "cpp", 36 | "vector": "cpp", 37 | "exception": "cpp", 38 | "algorithm": "cpp", 39 | "functional": "cpp", 40 | "iterator": "cpp", 41 | "memory": "cpp", 42 | "memory_resource": "cpp", 43 | "numeric": "cpp", 44 | "optional": "cpp", 45 | "random": "cpp", 46 | "ratio": "cpp", 47 | "string_view": "cpp", 48 | "system_error": "cpp", 49 | "tuple": "cpp", 50 | "type_traits": "cpp", 51 | "utility": "cpp", 52 | "hash_map": "cpp", 53 | "hash_set": "cpp", 54 | "slist": "cpp", 55 | "fstream": "cpp", 56 | "initializer_list": "cpp", 57 | "iomanip": "cpp", 58 | "iosfwd": "cpp", 59 | "iostream": "cpp", 60 | "istream": "cpp", 61 | "limits": "cpp", 62 | "mutex": "cpp", 63 | "new": "cpp", 64 | "numbers": "cpp", 65 | "ostream": "cpp", 66 | "semaphore": "cpp", 67 | "shared_mutex": "cpp", 68 | "sstream": "cpp", 69 | "stdexcept": "cpp", 70 | "stop_token": "cpp", 71 | "streambuf": "cpp", 72 | "thread": "cpp", 73 | "typeindex": "cpp", 74 | "typeinfo": "cpp", 75 | "variant": "cpp", 76 | "csignal": "cpp", 77 | "any": "cpp", 78 | "codecvt": "cpp", 79 | "future": "cpp" 80 | } 81 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /LICENSE-DATA: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Naoki Akai 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NDT C++ 2 | 3 | Minimum NDT 4 | 5 | 6 | https://github.com/TakanoTaiga/ndt_cpp/assets/53041471/510656ef-73a8-49dd-b51f-698165e1922a 7 | 8 | 9 | 10 | ## RUN 11 | 12 | g++ 13 | ``` 14 | g++ -O2 ./main.cpp -o main.out && ./main.out 15 | 16 | g++ -O2 ./main_downsample.cpp -o main2.out && ./main2.out 17 | ``` 18 | 19 | NVIDIA HPC SDK 20 | ``` 21 | nvc++ -fast -O2 ./main.cpp -o main.out && ./main.out 22 | 23 | nvc++ -fast -O2 ./main_downsample.cpp -o main2.out && ./main2.out 24 | ``` 25 | 26 | 27 | ## LICENSE 28 | 29 | NDT C++ specific code is distributed under Apache2.0 License. 30 | The following extensions are included (*.cpp *.md) 31 | 32 | 33 | NDT C++ specific data are distributed under MIT License. 34 | The following extensions are included (*.txt) 35 | -------------------------------------------------------------------------------- /data/scan_1.txt: -------------------------------------------------------------------------------- 1 | -4.459060 -4.459060 2 | -4.378336 -4.416712 3 | -4.340672 -4.417099 4 | -4.168441 -4.279024 5 | -4.091581 -4.236955 6 | -3.982222 -4.159884 7 | -3.818573 -4.023937 8 | -3.638210 -3.867532 9 | -3.663106 -3.928201 10 | -3.468021 -3.751684 11 | -3.451755 -3.766930 12 | -3.368053 -3.707937 13 | -3.258602 -3.619043 14 | -3.289161 -3.685194 15 | -3.264532 -3.689882 16 | -3.287161 -3.748290 17 | -3.235976 -3.722564 18 | -3.244266 -3.765156 19 | -3.236168 -3.789066 20 | -3.235051 -3.821396 21 | -3.170757 -3.778760 22 | -3.212610 -3.862743 23 | -3.174256 -3.850679 24 | -3.214741 -3.934645 25 | -3.220234 -3.976656 26 | -3.167398 -3.946497 27 | -3.120651 -3.923196 28 | -3.116000 -3.952628 29 | -3.073278 -3.933617 30 | -3.054758 -3.945274 31 | -3.083024 -4.017875 32 | -3.036908 -3.993736 33 | -3.050508 -4.048160 34 | -2.986588 -3.999526 35 | -3.048593 -4.119938 36 | -3.027372 -4.128815 37 | -2.981194 -4.103262 38 | -2.951206 -4.099484 39 | -2.956208 -4.144451 40 | -2.918599 -4.129722 41 | -2.926610 -4.179631 42 | -2.899564 -4.179704 43 | -2.852955 -4.151074 44 | -2.835460 -4.164431 45 | -2.795426 -4.144390 46 | -2.738888 -4.099036 47 | -2.700895 -4.080608 48 | -2.636144 -4.020789 49 | -2.639730 -4.064828 50 | -2.536477 -3.943395 51 | -2.592155 -4.068868 52 | -2.557656 -4.053639 53 | -2.535254 -4.057255 54 | -2.508599 -4.053850 55 | -2.486521 -4.057634 56 | -2.496991 -4.114914 57 | -2.491818 -4.147082 58 | -2.469165 -4.150294 59 | -2.435337 -4.134382 60 | -2.416015 -4.142810 61 | -2.442089 -4.229822 62 | -2.444209 -4.276478 63 | -2.400121 -4.242199 64 | -2.385945 -4.260413 65 | -2.359978 -4.257514 66 | -2.383738 -4.344981 67 | -2.332927 -4.296719 68 | -2.339474 -4.353973 69 | -2.328274 -4.378846 70 | -2.336998 -4.441903 71 | -2.286535 -4.392391 72 | -2.265655 -4.399040 73 | -2.280481 -4.475698 74 | -2.244494 -4.452992 75 | -2.253719 -4.520262 76 | -2.263767 -4.590466 77 | -2.230549 -4.573304 78 | -2.176959 -4.513302 79 | -2.161942 -4.532606 80 | -2.393629 -5.075219 81 | -2.327914 -4.992226 82 | -2.297357 -4.983351 83 | -2.317941 -5.086258 84 | -2.295819 -5.096529 85 | -2.283168 -5.128080 86 | -2.274824 -5.169932 87 | -2.233930 -5.137687 88 | -2.222030 -5.171915 89 | -2.238333 -5.273182 90 | -2.248266 -5.361504 91 | -2.258121 -5.451588 92 | -2.231422 -5.454321 93 | -2.217787 -5.489214 94 | -2.207048 -5.532009 95 | -2.172158 -5.514345 96 | -2.180445 -5.607005 97 | -2.148866 -5.597988 98 | -2.138352 -5.644084 99 | -2.112088 -5.649035 100 | -2.107665 -5.713074 101 | -2.066361 -5.677280 102 | -2.054428 -5.722054 103 | -2.030772 -5.734724 104 | -2.005164 -5.741908 105 | -1.998641 -5.804475 106 | -1.984378 -5.845790 107 | -1.972181 -5.894228 108 | -1.937522 -5.875719 109 | -1.911057 -5.881628 110 | -1.911580 -5.971772 111 | -1.880437 -5.963984 112 | -1.870319 -6.023410 113 | -1.846357 -6.039160 114 | -1.827675 -6.072700 115 | -1.800029 -6.076796 116 | -1.772251 -6.080317 117 | -1.768381 -6.167079 118 | -1.727760 -6.126173 119 | -1.696815 -6.118517 120 | -1.708308 -6.266000 121 | -1.662449 -6.204346 122 | -1.656811 -6.293010 123 | -1.608178 -6.218364 124 | -1.615980 -6.362936 125 | -1.598860 -6.412678 126 | -1.572466 -6.426140 127 | -1.549351 -6.453509 128 | -1.535429 -6.520732 129 | -1.496351 -6.481407 130 | -1.466950 -6.482982 131 | -1.450469 -6.542641 132 | -1.440411 -6.634130 133 | -1.407255 -6.620615 134 | -1.380915 -6.639005 135 | -1.354982 -6.659952 136 | -1.346869 -6.771169 137 | -1.315952 -6.769987 138 | -1.277840 -6.730574 139 | -1.227514 -6.623069 140 | -1.199869 -6.635363 141 | -1.174237 -6.659431 142 | -1.151019 -6.698532 143 | -1.125890 -6.728058 144 | -1.100134 -6.755080 145 | -1.072622 -6.772267 146 | -1.040181 -6.758161 147 | -1.007717 -6.742792 148 | -0.969451 -6.686186 149 | -0.931784 -6.629984 150 | -0.903906 -6.641779 151 | -0.877452 -6.664906 152 | -0.842170 -6.620004 153 | -0.798661 -6.504575 154 | -0.781597 -6.603683 155 | -0.741131 -6.504826 156 | -0.717743 -6.553665 157 | -0.688987 -6.555271 158 | -0.653548 -6.490386 159 | -0.619899 -6.437891 160 | -0.605138 -6.585673 161 | -0.570397 -6.519670 162 | -0.539801 -6.496310 163 | -0.510343 -6.484520 164 | -0.493077 -6.635151 165 | -0.464292 -6.639689 166 | -0.435540 -6.645060 167 | -0.411316 -6.724954 168 | -0.381556 -6.719400 169 | -0.358547 -6.841486 170 | -0.326700 -6.801515 171 | -0.304010 -6.962964 172 | -0.274726 -6.992262 173 | -0.243767 -6.980577 174 | -0.213992 -7.004011 175 | -0.183894 -7.022632 176 | -0.154442 -7.077956 177 | -0.123713 -7.087461 178 | -0.093961 -7.177623 179 | -0.062373 -7.147257 180 | -0.031565 -7.234179 181 | 0.000001 -7.330907 182 | 0.031740 -7.274198 183 | 0.064715 -7.415541 184 | 0.096697 -7.386702 185 | 0.130874 -7.497798 186 | 0.164512 -7.539491 187 | 0.197170 -7.529654 188 | 0.232390 -7.606223 189 | 0.266810 -7.640434 190 | 0.304128 -7.740575 191 | 0.337707 -7.734739 192 | 0.374912 -7.805224 193 | 0.413807 -7.895909 194 | 0.448176 -7.892626 195 | 0.484427 -7.920321 196 | 0.525114 -8.011704 197 | 0.568883 -8.135408 198 | 0.607818 -8.179179 199 | 0.641447 -8.150352 200 | 0.686999 -8.267776 201 | 0.729487 -8.338067 202 | 0.769781 -8.377461 203 | 0.814155 -8.455322 204 | 0.852525 -8.466436 205 | 0.899074 -8.554126 206 | 0.935667 -8.543521 207 | 0.974541 -8.553442 208 | 1.004424 -8.486338 209 | 1.053956 -8.583784 210 | 1.085515 -8.532843 211 | 1.126656 -8.557801 212 | 1.163081 -8.546160 213 | 1.203072 -8.560302 214 | 1.242926 -8.572312 215 | 1.276229 -8.539449 216 | 1.310302 -8.513171 217 | 1.352638 -8.540229 218 | 1.392062 -8.547584 219 | 1.430478 -8.548202 220 | 1.474262 -8.579694 221 | 1.502329 -8.520125 222 | 1.542391 -8.529531 223 | 1.579913 -8.524446 224 | 1.621754 -8.542027 225 | 1.669994 -8.591378 226 | 1.694685 -8.519763 227 | 1.739240 -8.548638 228 | 1.769817 -8.508725 229 | 1.821553 -8.569733 230 | 1.843758 -8.491834 231 | 1.906113 -8.597919 232 | 1.922945 -8.498193 233 | 1.973396 -8.547719 234 | 2.004046 -8.510880 235 | 2.056087 -8.564223 236 | 2.093303 -8.554625 237 | 2.124320 -8.520182 238 | 2.151814 -8.472788 239 | 2.222297 -8.592986 240 | 2.292093 -8.705980 241 | 2.314403 -8.637468 242 | 2.366617 -8.680651 243 | 2.407989 -8.682927 244 | 2.439317 -8.649168 245 | 2.482728 -8.658300 246 | 2.526486 -8.667980 247 | 2.570257 -8.677044 248 | 2.598820 -8.634935 249 | 2.644068 -8.648357 250 | 2.700198 -8.696058 251 | 2.745530 -8.707706 252 | 2.783587 -8.695923 253 | 2.834967 -8.725133 254 | 2.874095 -8.715969 255 | 2.913061 -8.706220 256 | 2.948311 -8.685443 257 | 2.996029 -8.701101 258 | 3.053575 -8.744098 259 | 3.073119 -8.678222 260 | 3.107229 -8.654349 261 | 3.155000 -8.668290 262 | 3.192543 -8.653768 263 | 3.242491 -8.672436 264 | 3.290780 -8.685866 265 | 3.332141 -8.680524 266 | 3.360386 -8.641217 267 | 3.427651 -8.701599 268 | 3.460547 -8.673931 269 | 3.527988 -8.732079 270 | 3.562049 -8.706808 271 | 3.592896 -8.674018 272 | 3.622906 -8.639652 273 | 3.681607 -8.673326 274 | 3.731882 -8.686190 275 | 3.765138 -8.659225 276 | 3.841879 -8.731334 277 | 3.860015 -8.669737 278 | 3.913959 -8.688668 279 | 3.967838 -8.706626 280 | 3.967762 -8.606741 281 | 3.971633 -8.517195 282 | 4.017120 -8.517514 283 | 4.051522 -8.494195 284 | 4.114583 -8.530412 285 | 4.156635 -8.522366 286 | 4.220794 -8.558925 287 | 4.250020 -8.524221 288 | 4.302269 -8.535547 289 | 4.328611 -8.495377 290 | 4.401023 -8.545115 291 | 4.442007 -8.533015 292 | 4.496442 -8.546332 293 | 4.539680 -8.537897 294 | 4.599946 -8.560917 295 | 4.622197 -8.513028 296 | 4.650343 -8.476456 297 | 4.754832 -8.577946 298 | 4.743515 -8.470157 299 | 4.829152 -8.535496 300 | 4.852814 -8.490663 301 | 4.935461 -8.548470 302 | 4.956369 -8.498828 303 | 5.025033 -8.530811 304 | 5.046077 -8.481693 305 | 5.143459 -8.560153 306 | 5.167515 -8.515802 307 | 5.212307 -8.505714 308 | 5.255615 -8.492979 309 | 5.319512 -8.513000 310 | 5.358096 -8.492067 311 | 5.415817 -8.501130 312 | 5.479335 -8.518582 313 | 5.554936 -8.553851 314 | 5.431952 -8.285102 315 | 5.446989 -8.229503 316 | 5.499148 -8.230058 317 | 5.528124 -8.195782 318 | 5.619343 -8.253111 319 | 5.670497 -8.250624 320 | 5.711104 -8.232523 321 | 5.770873 -8.241661 322 | 5.785083 -8.185703 323 | 5.895595 -8.265319 324 | 5.970653 -8.293760 325 | 5.971678 -8.219310 326 | 6.035923 -8.231962 327 | 6.119134 -8.269536 328 | 6.178384 -8.273860 329 | 6.225956 -8.262123 330 | 6.215479 -8.173771 331 | 6.338957 -8.261090 332 | 6.380525 -8.240561 333 | 6.480567 -8.294746 334 | 6.511878 -8.260279 335 | 6.579174 -8.271155 336 | 6.662086 -8.300788 337 | 6.728584 -8.309108 338 | 6.767458 -8.282956 339 | 6.805943 -8.256269 340 | 6.881996 -8.274701 341 | 6.963361 -8.298612 342 | 6.955939 -8.216686 343 | 7.075680 -8.284556 344 | 7.101220 -8.241372 345 | 7.178367 -8.257767 346 | 7.243612 -8.259758 347 | 7.279201 -8.227639 348 | 7.604095 -8.519668 349 | 7.648319 -8.494320 350 | 7.726408 -8.506112 351 | 7.799177 -8.511310 352 | 7.856223 -8.498814 353 | 7.984710 -8.562553 354 | 8.000006 -8.504256 355 | 8.066607 -8.500430 356 | 8.120694 -8.482989 357 | 8.111820 -8.400035 358 | 8.271489 -8.490921 359 | 8.316895 -8.463333 360 | 8.258106 -8.330489 361 | 8.348070 -8.348069 362 | 8.268435 -8.196592 363 | 8.280445 -8.137171 364 | 8.260077 -8.046611 365 | 8.271111 -7.987321 366 | 8.345326 -7.988912 367 | 8.466212 -8.034135 368 | 8.559784 -8.052240 369 | 8.604898 -8.024198 370 | 8.687720 -8.030848 371 | 8.714467 -7.985338 372 | 8.757712 -7.954946 373 | 8.843100 -7.962363 374 | 8.957211 -7.994617 375 | 9.080455 -8.033710 376 | 9.195629 -8.064350 377 | 9.163568 -7.965768 378 | 8.878963 -7.583351 379 | 8.879601 -7.517138 380 | 8.960542 -7.518786 381 | 9.406116 -7.822985 382 | 9.050583 -7.460725 383 | 9.082069 -7.420363 384 | 9.111305 -7.378190 385 | 9.189223 -7.375131 386 | 9.176300 -7.299159 387 | 9.142118 -7.207066 388 | 8.969742 -7.007931 389 | 8.998878 -6.967675 390 | 9.012082 -6.915214 391 | 8.944991 -6.801929 392 | 8.964252 -6.755049 393 | 8.858302 -6.614809 394 | 8.911428 -6.594110 395 | 8.928603 -6.546723 396 | 8.888947 -6.458199 397 | 8.970467 -6.457812 398 | 8.931483 -6.370767 399 | 8.904381 -6.292994 400 | 8.808621 -6.167863 401 | 8.876716 -6.157997 402 | 8.901417 -6.117774 403 | 8.867828 -6.037890 404 | 8.914838 -6.013134 405 | 8.859005 -5.919398 406 | 8.899418 -5.890397 407 | 9.109205 -5.972258 408 | 8.850502 -5.747584 409 | 8.945315 -5.753820 410 | 9.040106 -5.759183 411 | 9.280868 -5.855792 412 | 9.168327 -5.729007 413 | 9.294760 -5.751771 414 | 9.355557 -5.733093 415 | 9.394093 -5.700475 416 | 9.390429 -5.642340 417 | 9.443718 -5.618423 418 | 9.457129 -5.570674 419 | 9.454426 -5.513658 420 | 9.473807 -5.469705 421 | 9.410676 -5.378644 422 | 8.688385 -4.915653 423 | 8.687707 -4.865349 424 | 8.842378 -4.901410 425 | 9.485378 -5.203856 426 | 9.471757 -5.142745 427 | 9.455819 -5.080796 428 | 9.375469 -4.985025 429 | 9.371626 -4.930651 430 | 9.410527 -4.898811 431 | 9.379327 -4.830671 432 | 9.426635 -4.803111 433 | 9.419724 -4.747932 434 | 9.399847 -4.686591 435 | 9.412190 -4.641579 436 | 9.352880 -4.561705 437 | 9.393939 -4.531099 438 | 9.352418 -4.460875 439 | 9.381674 -4.424685 440 | 9.448739 -4.406020 441 | 9.344427 -4.307840 442 | 9.400320 -4.283972 443 | 9.433847 -4.249638 444 | 9.364501 -4.169344 445 | 9.403771 -4.137759 446 | 8.826694 -3.837956 447 | 8.760718 -3.763901 448 | 9.411911 -3.995119 449 | 9.381806 -3.934118 450 | 9.416454 -3.900424 451 | 9.425121 -3.855919 452 | 9.401513 -3.798458 453 | 9.389205 -3.745913 454 | 9.397161 -3.701640 455 | 9.463949 -3.680329 456 | 9.361583 -3.593575 457 | 9.430333 -3.572833 458 | 9.383308 -3.508275 459 | 9.416156 -3.473802 460 | 9.376123 -3.412629 461 | 9.411034 -3.378906 462 | 9.444122 -3.344339 463 | 9.381657 -3.276222 464 | 9.405569 -3.238597 465 | 9.403843 -3.192175 466 | 9.394581 -3.143384 467 | 9.438613 -3.112389 468 | 9.389278 -3.050763 469 | 9.374434 -3.000779 470 | 9.410218 -2.967030 471 | 9.444914 -2.932723 472 | 9.385019 -2.869288 473 | 9.366725 -2.819065 474 | 8.645376 -2.560877 475 | 8.658416 -2.523699 476 | 8.689188 -2.491585 477 | 9.358902 -2.639484 478 | 8.567698 -2.376034 479 | 8.546177 -2.329954 480 | 8.648593 -2.317383 481 | 8.618167 -2.268974 482 | 8.571791 -2.216816 483 | 8.563316 -2.174806 484 | 8.721327 -2.174471 485 | 8.751620 -2.141509 486 | 7.821782 -1.877844 487 | 7.789844 -1.834266 488 | 8.002630 -1.847552 489 | 8.100153 -1.832877 490 | 7.968717 -1.766622 491 | 7.985487 -1.733819 492 | 7.957159 -1.691346 493 | 8.012451 -1.666593 494 | 8.039743 -1.635705 495 | 7.858517 -1.563157 496 | 8.012305 -1.557435 497 | 8.000413 -1.518927 498 | 8.062249 -1.494249 499 | 8.118026 -1.467978 500 | 7.990930 -1.409016 501 | 8.072970 -1.387190 502 | 8.043540 -1.346027 503 | 7.771493 -1.265669 504 | 7.925801 -1.255324 505 | 8.037210 -1.237046 506 | 8.016772 -1.198116 507 | 8.056290 -1.168108 508 | 7.973174 -1.120556 509 | 7.960854 -1.083424 510 | 7.937617 -1.045007 511 | 7.943172 -1.010499 512 | 7.838694 -0.962471 513 | 7.898956 -0.934904 514 | 8.176117 -0.931551 515 | 8.179498 -0.895801 516 | 8.167862 -0.858478 517 | 8.181593 -0.823842 518 | 8.199106 -0.789484 519 | 8.664719 -0.796175 520 | 8.992867 -0.786774 521 | 9.429188 -0.783505 522 | 9.376382 -0.737938 523 | 9.316525 -0.692338 524 | 9.425310 -0.659083 525 | 9.388788 -0.615375 526 | 9.395235 -0.574638 527 | 9.370278 -0.532082 528 | 9.393441 -0.492289 529 | 9.460528 -0.454421 530 | 9.379331 -0.409510 531 | 9.437562 -0.370803 532 | 9.380464 -0.327573 533 | 9.447646 -0.288652 534 | 9.394382 -0.246001 535 | 9.430387 -0.205773 536 | 9.361554 -0.163408 537 | 9.385432 -0.122861 538 | 9.418388 -0.082193 539 | 9.424864 -0.041124 540 | 9.428843 0.000000 541 | 9.388975 0.040967 542 | 9.363846 0.081717 543 | 9.372331 0.122690 544 | 9.343707 0.163094 545 | 9.346693 0.203944 546 | 9.401727 0.246194 547 | 9.377175 0.286499 548 | 9.388639 0.327859 549 | 9.473948 0.372233 550 | 9.403563 0.410568 551 | 9.402456 0.451632 552 | 9.391735 0.492199 553 | 9.355000 0.531215 554 | 9.416028 0.575908 555 | 9.392691 0.615628 556 | 9.401177 0.657395 557 | 9.408113 0.699144 558 | 9.323718 0.733793 559 | 9.329351 0.775209 560 | 9.400074 0.822400 561 | 9.401502 0.863876 562 | 9.433814 0.908372 563 | 9.483674 0.954955 564 | 9.424138 0.990516 565 | 9.454809 1.035469 566 | 9.405371 1.071607 567 | 9.375890 1.109710 568 | 13.133552 1.670799 569 | 13.978065 2.026721 570 | 13.178889 1.969596 571 | 13.102290 2.016637 572 | 9.456601 1.497779 573 | 9.462240 1.541024 574 | 9.425298 1.577254 575 | 9.494533 1.631459 576 | 9.473672 1.670464 577 | 9.488441 1.715789 578 | 9.411846 1.744382 579 | 9.446602 1.793492 580 | 9.388363 1.824911 581 | 9.418537 1.873464 582 | 9.302903 1.892698 583 | 9.366254 1.948184 584 | 9.457724 2.010301 585 | 8.169022 2.150724 586 | 8.220471 2.202668 587 | 8.226689 2.242852 588 | 8.248193 2.287426 589 | 8.144193 2.296899 590 | 8.091277 2.320137 591 | 8.140273 2.372674 592 | 8.186514 2.424956 593 | 9.439268 2.840898 594 | 9.451729 2.889683 595 | 9.374789 2.910949 596 | 9.426473 2.972154 597 | 9.336751 2.988717 598 | 13.198786 4.288544 599 | 6.355280 2.344586 600 | 6.190673 2.314597 601 | 6.141201 2.326692 602 | 6.150949 2.361129 603 | 6.103508 2.373525 604 | 6.178591 2.433812 605 | 6.139368 2.449359 606 | 6.104730 2.466471 607 | 6.086730 2.490147 608 | 6.119079 2.534605 609 | 10.768946 4.515792 610 | 9.493472 4.029738 611 | 9.394300 4.036111 612 | 9.334533 4.058771 613 | 9.623372 4.234386 614 | 9.397552 4.184060 615 | 13.076971 5.890746 616 | 13.034935 5.940361 617 | 9.402877 4.334785 618 | 9.454531 4.408719 619 | 9.440112 4.452245 620 | 9.415206 4.490821 621 | 13.121651 6.329134 622 | 8.189943 4.218097 623 | 8.212842 4.275334 624 | 8.139403 4.282346 625 | 8.080003 4.296212 626 | 8.056748 4.329048 627 | 8.022073 4.355631 628 | 4.327332 2.374056 629 | 4.217648 2.337880 630 | 4.195002 2.349314 631 | 4.184643 2.367557 632 | 4.162802 2.379237 633 | 4.164502 2.404376 634 | 4.156294 2.423878 635 | 4.131350 2.433552 636 | 4.144113 2.465488 637 | 4.106930 2.467693 638 | 4.142095 2.513485 639 | 4.143109 2.538901 640 | 4.095110 2.534131 641 | 4.155282 2.596508 642 | 10.651110 6.720348 643 | 10.655445 6.788266 644 | 10.566652 6.796698 645 | 9.454600 6.139890 646 | 9.468372 6.207738 647 | 9.364399 6.198161 648 | 9.342805 6.242663 649 | 9.436434 6.364954 650 | 9.424792 6.417112 651 | 9.403680 6.462969 652 | 10.609596 7.994904 653 | 9.546293 7.259169 654 | 8.145188 6.250021 655 | 8.130279 6.295136 656 | 8.048820 6.288428 657 | 8.075803 6.366450 658 | 8.077180 6.424880 659 | 9.317486 7.478073 660 | 8.205050 6.644318 661 | 8.208003 6.706219 662 | 8.090343 6.669164 663 | 8.059770 6.703238 664 | 8.023360 6.732397 665 | 8.094256 6.852295 666 | 9.308158 7.949918 667 | 9.240494 7.962120 668 | 9.224544 8.018773 669 | 9.095959 7.976941 670 | 9.025862 7.985407 671 | 8.942445 7.981436 672 | 8.874091 7.990267 673 | 8.740204 7.939041 674 | 8.693285 7.965926 675 | 8.608929 7.958013 676 | 8.517857 7.943030 677 | 8.454639 7.953331 678 | 8.390634 7.962413 679 | 8.325074 7.969524 680 | 8.251101 7.967995 681 | 8.215739 8.003418 682 | 2.282122 2.242634 683 | 2.276394 2.256615 684 | 2.202704 2.202704 685 | 2.177125 2.196208 686 | 2.180971 2.219372 687 | 2.141005 2.197803 688 | 2.218564 2.297390 689 | 2.179922 2.277176 690 | 2.108554 2.221952 691 | 2.156362 2.292280 692 | 2.100291 2.252286 693 | 2.135902 2.310605 694 | 2.122484 2.316285 695 | 2.102119 2.314253 696 | 2.059601 2.287419 697 | 2.048862 2.295556 698 | 2.100774 2.374493 699 | 2.109885 2.405862 700 | 2.074925 2.386928 701 | 2.029889 2.355801 702 | 6.816887 7.981547 703 | 6.762774 7.988508 704 | 6.657810 7.934470 705 | 6.406324 7.702769 706 | 6.372995 7.731061 707 | 6.289347 7.697776 708 | 6.292985 7.771189 709 | 6.186027 7.707629 710 | 6.098874 7.667334 711 | 6.168033 7.824111 712 | 6.033159 7.722089 713 | 5.993876 7.741200 714 | 5.945818 7.748743 715 | 5.862727 7.709877 716 | 5.812477 7.713418 717 | 5.804991 7.773825 718 | 5.737978 7.754431 719 | 5.654997 7.712442 720 | 5.638626 7.760901 721 | 5.526410 7.676666 722 | 5.564457 7.801079 723 | 5.460385 7.726267 724 | 5.443235 7.773746 725 | 5.376950 7.750842 726 | 5.306482 7.720978 727 | 5.243206 7.700680 728 | 5.226402 7.748458 729 | 5.200647 7.783317 730 | 5.086488 7.684844 731 | 4.336347 6.614026 732 | 4.327009 6.663012 733 | 4.320632 6.717175 734 | 4.301035 6.751274 735 | 4.269803 6.767228 736 | 4.316222 6.907399 737 | 4.780157 7.724647 738 | 4.737216 7.730434 739 | 4.701734 7.748216 740 | 4.634347 7.712847 741 | 4.619821 7.765218 742 | 4.559832 7.741060 743 | 4.492018 7.702591 744 | 4.437312 7.685650 745 | 4.397266 7.693620 746 | 4.358568 7.703743 747 | 4.359522 7.784487 748 | 4.316882 7.787860 749 | 4.320488 7.875208 750 | 4.265139 7.855406 751 | 4.289529 7.983199 752 | 4.218010 7.932925 753 | 4.198930 7.980855 754 | 4.149537 7.971187 755 | 4.079397 7.920639 756 | 4.058743 7.965731 757 | 4.010359 7.956405 758 | 3.973764 7.970136 759 | 3.919746 7.948458 760 | 3.875106 7.945141 761 | 3.864504 8.011948 762 | 3.801309 7.969612 763 | 3.749205 7.949453 764 | 3.717050 7.971239 765 | 3.681610 7.986029 766 | 3.649500 8.008096 767 | 3.589574 7.968558 768 | 3.523548 7.914016 769 | 3.526963 8.015631 770 | 3.480247 8.004018 771 | 3.410077 7.937170 772 | 3.395543 7.999399 773 | 3.333003 7.948311 774 | 3.298880 7.964200 775 | 3.263525 7.977118 776 | 3.223647 7.978805 777 | 3.201409 8.024394 778 | 3.169182 8.045435 779 | 3.131766 8.053322 780 | 3.090070 8.049903 781 | 3.053873 8.060561 782 | 3.003809 8.034054 783 | 2.988640 8.101063 784 | 2.424340 6.660820 785 | 2.398699 6.680929 786 | 2.350779 6.638395 787 | 2.314540 6.627823 788 | 2.303545 6.689979 789 | 2.276865 6.707425 790 | 2.236849 6.685239 791 | 2.211980 6.708042 792 | 2.193764 6.751711 793 | 2.574615 8.043094 794 | 2.544601 8.070443 795 | 2.494050 8.032153 796 | 2.473298 8.089791 797 | 2.413089 8.017815 798 | 2.363555 7.979225 799 | 2.324611 7.975374 800 | 2.295231 8.004423 801 | 2.239267 7.939845 802 | 2.205863 7.954087 803 | 2.179091 7.992814 804 | 2.147858 8.015913 805 | 2.106273 8.000184 806 | 2.053445 7.940081 807 | 2.012977 7.926112 808 | 1.979410 7.938976 809 | 1.950672 7.971732 810 | 1.915627 7.979165 811 | 1.881168 7.989035 812 | 1.838023 7.961354 813 | 1.794889 7.932266 814 | 1.756793 7.924379 815 | 1.720392 7.923643 816 | 1.692891 7.964422 817 | 1.645451 7.910807 818 | 1.623381 7.979169 819 | 1.581508 7.950780 820 | 1.547315 7.960249 821 | 1.512109 7.964509 822 | 1.481549 7.993725 823 | 1.438756 7.956422 824 | 1.403453 7.959373 825 | 1.370031 7.973107 826 | 1.326410 7.926309 827 | 1.294679 7.949622 828 | 1.254689 7.921787 829 | 1.223257 7.947633 830 | 1.181496 7.905580 831 | 1.150504 7.934890 832 | 1.116169 7.941956 833 | 1.085185 7.973791 834 | 0.290517 2.206697 835 | 0.291945 2.294873 836 | 0.278215 2.265879 837 | 0.272946 2.306103 838 | 0.257453 2.259632 839 | 0.242154 2.211091 840 | 0.231689 2.204370 841 | 0.223538 2.219963 842 | 0.217037 2.254019 843 | 0.203701 2.216862 844 | 0.185875 2.124559 845 | 0.181997 2.190266 846 | 0.171491 2.179002 847 | 0.162133 2.181759 848 | 0.156437 2.237149 849 | 0.146607 2.236786 850 | 0.139716 2.284334 851 | 0.127777 2.250231 852 | 0.119351 2.277361 853 | 0.106328 2.213613 854 | 0.096422 2.208431 855 | 0.084943 2.161951 856 | 0.077729 2.225862 857 | 0.067676 2.215041 858 | 0.058726 2.242681 859 | 0.090546 4.149677 860 | 0.073326 4.200839 861 | 0.054400 4.155602 862 | 0.036902 4.228592 863 | 0.018585 4.259334 864 | 0.000000 4.320835 865 | -0.034451 7.895832 866 | -0.069427 7.955714 867 | -0.103824 7.931187 868 | -0.138903 7.957744 869 | -0.172484 7.904808 870 | -0.208032 7.944416 871 | -0.242641 7.941710 872 | -0.276252 7.910818 873 | -0.311123 7.918623 874 | -0.346847 7.944124 875 | -0.379551 7.901819 876 | -0.419089 7.996711 877 | -0.450167 7.927687 878 | -0.487126 7.964426 879 | -0.521860 7.962039 880 | -0.552203 7.896873 881 | -0.590876 7.951196 882 | -0.622832 7.913805 883 | -0.666415 8.020063 884 | -0.698633 7.985394 885 | -0.731453 7.960353 886 | -0.763260 7.926750 887 | -0.800329 7.948084 888 | -0.832023 7.916170 889 | -0.864092 7.889984 890 | -0.899717 7.896717 891 | -0.938450 7.928943 892 | -0.977058 7.957501 893 | -1.011691 7.952533 894 | -1.043291 7.924586 895 | -1.080023 7.935855 896 | -1.122775 7.988968 897 | -1.158096 7.987243 898 | -1.186769 7.940868 899 | -1.224496 7.955680 900 | -1.253257 7.912767 901 | -1.289053 7.915084 902 | -1.332366 7.961899 903 | -1.360504 7.917672 904 | -1.396813 7.921713 905 | -1.432343 7.920966 906 | -1.477755 7.973250 907 | -1.510604 7.956589 908 | -1.546645 7.956798 909 | -1.586224 7.974497 910 | -1.616559 7.945643 911 | -1.658936 7.975636 912 | -1.685401 7.929192 913 | -1.728383 7.960443 914 | -1.767621 7.973228 915 | -1.805765 7.980330 916 | -1.835534 7.950580 917 | -1.867037 7.929022 918 | -1.916427 7.982499 919 | -1.964223 8.027118 920 | -1.984049 7.957597 921 | -2.027926 7.984979 922 | -2.062563 7.975335 923 | -2.096996 7.964951 924 | -2.124995 7.930585 925 | -2.183347 8.008430 926 | -2.212917 7.979519 927 | -2.234377 7.922508 928 | -2.276434 7.938869 929 | -2.294698 7.872757 930 | -2.362353 7.975170 931 | -2.408510 8.002598 932 | -2.429395 7.946195 933 | -2.462933 7.931936 934 | -2.522431 8.000133 935 | -2.541669 7.940171 936 | -2.583239 7.950398 937 | -2.617006 7.936318 938 | -2.649561 7.918709 939 | -2.693415 7.934545 940 | -2.745554 7.973662 941 | -2.755716 7.891160 942 | -2.818322 7.958693 943 | -2.859244 7.963657 944 | -2.877854 7.906837 945 | -2.921921 7.920218 946 | -2.944941 7.876601 947 | -3.014165 7.955758 948 | -3.061981 7.976733 949 | -3.083139 7.928285 950 | -3.138222 7.966842 951 | -3.160970 7.923030 952 | -3.200936 7.922598 953 | -3.238106 7.914982 954 | -3.288651 7.939508 955 | -3.321913 7.921862 956 | -3.367025 7.932217 957 | -3.415604 7.950033 958 | -3.465688 7.970543 959 | -3.492370 7.937016 960 | -3.526581 7.920828 961 | -3.549912 7.880515 962 | -3.610518 7.922556 963 | -3.690933 8.006256 964 | -3.700356 7.935439 965 | -3.736750 7.923048 966 | -3.783414 7.932093 967 | -3.825504 7.931096 968 | -3.866791 7.928096 969 | -3.920173 7.949320 970 | -3.945089 7.912626 971 | -4.007876 7.951477 972 | -4.055540 7.959447 973 | -4.070004 7.902399 974 | -4.147364 7.967015 975 | -4.172368 7.930367 976 | -4.186664 7.873973 977 | -4.278914 7.963447 978 | -4.277097 7.877439 979 | -4.338699 7.908406 980 | -4.379562 7.900937 981 | -4.439777 7.927794 982 | -4.501164 7.955778 983 | -4.548398 7.958049 984 | -4.543923 7.870305 985 | -4.618280 7.919100 986 | -4.675822 7.937971 987 | -4.749366 7.982970 988 | -4.770669 7.939729 989 | -4.782296 7.880978 990 | -4.840410 7.898833 991 | -4.899676 7.917787 992 | -4.953093 7.926608 993 | -4.972746 7.881324 994 | -5.059190 7.941341 995 | -5.097451 7.924875 996 | -5.130542 7.900346 997 | -5.194456 7.922862 998 | -5.258316 7.944445 999 | -5.297542 7.928333 1000 | -5.343244 7.921682 1001 | -5.419447 7.959527 1002 | -5.433028 7.905104 1003 | -5.483463 7.904382 1004 | -5.561385 7.942481 1005 | -5.572704 7.885198 1006 | -5.599976 7.850876 1007 | -5.685673 7.897903 1008 | -------------------------------------------------------------------------------- /data/scan_2.txt: -------------------------------------------------------------------------------- 1 | -4.413857 -4.413857 2 | -4.376200 -4.414557 3 | -4.355872 -4.432567 4 | -4.127883 -4.237390 5 | -4.045123 -4.188847 6 | -3.992610 -4.170736 7 | -3.833104 -4.039249 8 | -3.658535 -3.889138 9 | -3.653712 -3.918127 10 | -3.468815 -3.752543 11 | -3.456910 -3.772555 12 | -3.385004 -3.726598 13 | -3.265525 -3.626732 14 | -3.290742 -3.686965 15 | -3.301119 -3.731235 16 | -3.268564 -3.727083 17 | -3.256049 -3.745656 18 | -3.236123 -3.755706 19 | -3.254088 -3.810048 20 | -3.258536 -3.849138 21 | -3.150999 -3.755214 22 | -3.162717 -3.802754 23 | -3.156968 -3.829708 24 | -3.179735 -3.891800 25 | -3.166029 -3.909719 26 | -3.130551 -3.900586 27 | -3.137849 -3.944817 28 | -3.066334 -3.889626 29 | -3.105953 -3.975439 30 | -3.078081 -3.975396 31 | -3.055688 -3.982250 32 | -3.069332 -4.036376 33 | -3.029334 -4.020061 34 | -3.028230 -4.055291 35 | -3.006686 -4.063304 36 | -2.989647 -4.077364 37 | -2.991457 -4.117387 38 | -2.975230 -4.132855 39 | -2.942743 -4.125574 40 | -2.915504 -4.125342 41 | -2.927430 -4.180803 42 | -2.931402 -4.225597 43 | -2.866683 -4.171049 44 | -2.859526 -4.199776 45 | -2.806544 -4.160873 46 | -2.768835 -4.143855 47 | -2.697956 -4.076168 48 | -2.653658 -4.047501 49 | -2.611675 -4.021626 50 | -2.541119 -3.950611 51 | -2.574432 -4.041049 52 | -2.541193 -4.027546 53 | -2.566257 -4.106869 54 | -2.540627 -4.105607 55 | -2.509537 -4.095193 56 | -2.481319 -4.089087 57 | -2.463055 -4.099212 58 | -2.475247 -4.160516 59 | -2.404805 -4.082549 60 | -2.412850 -4.137382 61 | -2.399405 -4.155890 62 | -2.432577 -4.256126 63 | -2.406257 -4.253044 64 | -2.390409 -4.268384 65 | -2.402003 -4.333329 66 | -2.340186 -4.265596 67 | -2.317670 -4.268617 68 | -2.310001 -4.299121 69 | -2.314809 -4.353522 70 | -2.329543 -4.427732 71 | -2.287173 -4.393618 72 | -2.230587 -4.330952 73 | -2.262453 -4.440315 74 | -2.252136 -4.468154 75 | -2.240522 -4.493793 76 | -2.261365 -4.585596 77 | -2.214813 -4.541040 78 | -2.187087 -4.534300 79 | -2.193623 -4.599026 80 | -2.367238 -5.019263 81 | -2.329276 -4.995148 82 | -2.332132 -5.058783 83 | -2.329970 -5.112653 84 | -2.308729 -5.125189 85 | -2.286423 -5.135392 86 | -2.276262 -5.173199 87 | -2.229427 -5.127331 88 | -2.228583 -5.187168 89 | -2.224953 -5.241660 90 | -2.263947 -5.398899 91 | -2.242914 -5.414873 92 | -2.211411 -5.405408 93 | -2.226272 -5.510217 94 | -2.195686 -5.503531 95 | -2.169805 -5.508373 96 | -2.176346 -5.596464 97 | -2.140980 -5.577443 98 | -2.132122 -5.627640 99 | -2.122491 -5.676860 100 | -2.097857 -5.686488 101 | -2.049385 -5.630640 102 | -2.043171 -5.690701 103 | -2.048362 -5.784397 104 | -2.010441 -5.757017 105 | -2.011920 -5.843040 106 | -1.976709 -5.823196 107 | -1.965451 -5.874113 108 | -1.940138 -5.883651 109 | -1.914406 -5.891936 110 | -1.898484 -5.930860 111 | -1.892701 -6.002881 112 | -1.888436 -6.081757 113 | -1.835633 -6.004083 114 | -1.822187 -6.054465 115 | -1.808320 -6.104787 116 | -1.762713 -6.047595 117 | -1.776570 -6.195637 118 | -1.746611 -6.193013 119 | -1.720062 -6.202342 120 | -1.689967 -6.198725 121 | -1.667694 -6.223919 122 | -1.652366 -6.276125 123 | -1.623541 -6.277771 124 | -1.620243 -6.379725 125 | -1.600629 -6.419771 126 | -1.568255 -6.408929 127 | -1.539496 -6.412463 128 | -1.508590 -6.406752 129 | -1.489165 -6.450281 130 | -1.454796 -6.429271 131 | -1.458872 -6.580547 132 | -1.441722 -6.640167 133 | -1.424377 -6.701169 134 | -1.382293 -6.645631 135 | -1.364574 -6.707097 136 | -1.336384 -6.718454 137 | -1.304843 -6.712835 138 | -1.280597 -6.745097 139 | -1.231315 -6.643578 140 | -1.209014 -6.685936 141 | -1.181441 -6.700284 142 | -1.159855 -6.749959 143 | -1.119472 -6.689706 144 | -1.095916 -6.729180 145 | -1.065971 -6.730277 146 | -1.034614 -6.721994 147 | -1.004805 -6.723309 148 | -0.966086 -6.662976 149 | -0.944468 -6.720237 150 | -0.907843 -6.670707 151 | -0.874784 -6.644647 152 | -0.842468 -6.622342 153 | -0.806507 -6.568479 154 | -0.775699 -6.553849 155 | -0.752334 -6.603153 156 | -0.715966 -6.537437 157 | -0.682831 -6.496697 158 | -0.650973 -6.464818 159 | -0.622387 -6.463725 160 | -0.603204 -6.564621 161 | -0.566271 -6.472506 162 | -0.543115 -6.536185 163 | -0.512924 -6.517318 164 | -0.497431 -6.693749 165 | -0.463731 -6.631665 166 | -0.435445 -6.643608 167 | -0.412104 -6.737832 168 | -0.382388 -6.734055 169 | -0.356768 -6.807547 170 | -0.328856 -6.846395 171 | -0.298984 -6.847860 172 | -0.273445 -6.959645 173 | -0.244124 -6.990793 174 | -0.212857 -6.966852 175 | -0.184941 -7.062616 176 | -0.154998 -7.103446 177 | -0.124240 -7.117660 178 | -0.093544 -7.145815 179 | -0.062361 -7.145895 180 | -0.031725 -7.270729 181 | 0.000001 -7.280726 182 | 0.031858 -7.301196 183 | 0.065123 -7.462357 184 | 0.096474 -7.369668 185 | 0.132068 -7.566177 186 | 0.164129 -7.521922 187 | 0.197153 -7.528976 188 | 0.233295 -7.635845 189 | 0.268133 -7.678314 190 | 0.306562 -7.802522 191 | 0.339013 -7.764652 192 | 0.377789 -7.865115 193 | 0.411927 -7.860041 194 | 0.445217 -7.840513 195 | 0.484287 -7.918025 196 | 0.527900 -8.054207 197 | 0.566988 -8.108321 198 | 0.607180 -8.170588 199 | 0.645256 -8.198758 200 | 0.686479 -8.261523 201 | 0.734272 -8.392757 202 | 0.776751 -8.453315 203 | 0.815010 -8.464207 204 | 0.856383 -8.504744 205 | 0.897753 -8.541549 206 | 0.940837 -8.590722 207 | 0.977709 -8.581251 208 | 1.011159 -8.543235 209 | 1.049812 -8.550035 210 | 1.087209 -8.546153 211 | 1.119757 -8.505396 212 | 1.165162 -8.561447 213 | 1.208079 -8.595930 214 | 1.233528 -8.507499 215 | 1.277880 -8.550498 216 | 1.317743 -8.561520 217 | 1.351151 -8.530838 218 | 1.394861 -8.564767 219 | 1.430168 -8.546348 220 | 1.467417 -8.539861 221 | 1.496704 -8.488228 222 | 1.543605 -8.536247 223 | 1.592124 -8.590335 224 | 1.624499 -8.556483 225 | 1.668788 -8.585171 226 | 1.698341 -8.538143 227 | 1.735206 -8.528808 228 | 1.766984 -8.495106 229 | 1.826356 -8.592329 230 | 1.860182 -8.567475 231 | 1.891778 -8.533259 232 | 1.936792 -8.559388 233 | 1.965804 -8.514833 234 | 1.998970 -8.489322 235 | 2.048191 -8.531330 236 | 2.104300 -8.599562 237 | 2.124345 -8.520284 238 | 2.156539 -8.491395 239 | 2.204725 -8.525041 240 | 2.283390 -8.672926 241 | 2.330115 -8.696107 242 | 2.373019 -8.704134 243 | 2.402704 -8.663870 244 | 2.428159 -8.609604 245 | 2.499918 -8.718247 246 | 2.537155 -8.704585 247 | 2.574945 -8.692869 248 | 2.595564 -8.624116 249 | 2.656990 -8.690624 250 | 2.700886 -8.698274 251 | 2.742242 -8.697280 252 | 2.778318 -8.679462 253 | 2.813793 -8.659965 254 | 2.870785 -8.705932 255 | 2.903548 -8.677790 256 | 2.936536 -8.650756 257 | 3.016410 -8.760291 258 | 3.035910 -8.693514 259 | 3.069751 -8.668710 260 | 3.112346 -8.668602 261 | 3.158700 -8.678457 262 | 3.218857 -8.725093 263 | 3.261482 -8.723230 264 | 3.284012 -8.668004 265 | 3.326661 -8.666246 266 | 3.373619 -8.675246 267 | 3.426518 -8.698725 268 | 3.456425 -8.663598 269 | 3.493604 -8.646976 270 | 3.561682 -8.705910 271 | 3.575948 -8.633101 272 | 3.640627 -8.681911 273 | 3.692615 -8.699256 274 | 3.736579 -8.697122 275 | 3.780977 -8.695650 276 | 3.812641 -8.664886 277 | 3.849143 -8.645317 278 | 3.898554 -8.654471 279 | 3.955393 -8.679317 280 | 3.974155 -8.620608 281 | 3.960809 -8.493983 282 | 4.043654 -8.573775 283 | 4.082790 -8.559749 284 | 4.110279 -8.521488 285 | 4.163824 -8.537104 286 | 4.212373 -8.541848 287 | 4.262779 -8.549812 288 | 4.287903 -8.507044 289 | 4.368878 -8.574407 290 | 4.373181 -8.491056 291 | 4.442744 -8.534431 292 | 4.516697 -8.584830 293 | 4.515117 -8.491702 294 | 4.611827 -8.583028 295 | 4.637557 -8.541318 296 | 4.657844 -8.490129 297 | 4.730659 -8.534335 298 | 4.782447 -8.539676 299 | 4.816128 -8.512478 300 | 4.879915 -8.538079 301 | 4.924089 -8.528773 302 | 4.920971 -8.438129 303 | 5.040108 -8.556405 304 | 5.093709 -8.561754 305 | 5.125830 -8.530814 306 | 5.154214 -8.493883 307 | 5.229470 -8.533721 308 | 5.274204 -8.523019 309 | 5.328386 -8.527200 310 | 5.340859 -8.464749 311 | 5.433835 -8.529412 312 | 5.514311 -8.572957 313 | 5.576578 -8.587176 314 | 5.453261 -8.317605 315 | 5.449183 -8.232818 316 | 5.511281 -8.248217 317 | 5.522580 -8.187563 318 | 5.593960 -8.215832 319 | 5.632935 -8.195971 320 | 5.714680 -8.237678 321 | 5.765543 -8.234050 322 | 5.803337 -8.211533 323 | 5.873670 -8.234582 324 | 5.961976 -8.281707 325 | 5.987921 -8.241667 326 | 6.032972 -8.227937 327 | 6.119825 -8.270471 328 | 6.169709 -8.262243 329 | 6.242304 -8.283818 330 | 6.224616 -8.185786 331 | 6.322299 -8.239382 332 | 6.405075 -8.272267 333 | 6.458922 -8.267042 334 | 6.513149 -8.261890 335 | 6.579450 -8.271502 336 | 6.629537 -8.260232 337 | 6.702402 -8.276776 338 | 6.765817 -8.280946 339 | 6.806927 -8.257463 340 | 6.899985 -8.296330 341 | 6.924397 -8.252175 342 | 6.981822 -8.247261 343 | 7.019141 -8.218359 344 | 7.111076 -8.252810 345 | 7.163979 -8.241215 346 | 7.237794 -8.253123 347 | 7.314223 -8.267225 348 | 7.554048 -8.463595 349 | 7.642570 -8.487935 350 | 7.721085 -8.500252 351 | 7.784842 -8.495665 352 | 7.876594 -8.520850 353 | 7.963331 -8.539627 354 | 8.004728 -8.509277 355 | 8.094675 -8.530008 356 | 8.142724 -8.506001 357 | 8.182781 -8.473518 358 | 8.245130 -8.463862 359 | 8.305405 -8.451641 360 | 8.265626 -8.338075 361 | 8.319775 -8.319774 362 | 8.273927 -8.202036 363 | 8.337579 -8.193316 364 | 8.273699 -8.059882 365 | 8.317663 -8.032275 366 | 8.340251 -7.984053 367 | 8.467385 -8.035248 368 | 8.554621 -8.047384 369 | 8.576415 -7.997637 370 | 8.678035 -8.021894 371 | 8.722806 -7.992980 372 | 8.823159 -8.014394 373 | 8.847088 -7.965954 374 | 8.972591 -8.008345 375 | 9.024190 -7.983930 376 | 9.181061 -8.051575 377 | 9.220042 -8.014860 378 | 8.845473 -7.554749 379 | 8.854692 -7.496052 380 | 8.953920 -7.513231 381 | 9.453891 -7.862718 382 | 9.028872 -7.442827 383 | 9.102165 -7.436782 384 | 9.119311 -7.384672 385 | 9.213015 -7.394225 386 | 9.156596 -7.283485 387 | 9.132903 -7.199800 388 | 8.998950 -7.030751 389 | 8.995837 -6.965321 390 | 8.978371 -6.889347 391 | 8.935968 -6.795069 392 | 8.921771 -6.723037 393 | 8.817228 -6.584137 394 | 8.953497 -6.625238 395 | 8.843348 -6.484211 396 | 8.892118 -6.460501 397 | 8.915937 -6.418556 398 | 8.877669 -6.332381 399 | 8.888613 -6.281850 400 | 8.783544 -6.150303 401 | 8.861757 -6.147620 402 | 8.872706 -6.098042 403 | 8.784738 -5.981316 404 | 8.882542 -5.991350 405 | 8.856030 -5.917410 406 | 8.899667 -5.890561 407 | 9.156451 -6.003233 408 | 8.804751 -5.717874 409 | 8.887007 -5.716315 410 | 9.043886 -5.761591 411 | 9.247005 -5.834426 412 | 9.201750 -5.749892 413 | 9.276634 -5.740555 414 | 9.424280 -5.775206 415 | 9.383774 -5.694214 416 | 9.425480 -5.663400 417 | 9.423992 -5.606687 418 | 9.506658 -5.599848 419 | 9.453434 -5.513080 420 | 9.451618 -5.456894 421 | 9.486335 -5.421887 422 | 8.683090 -4.912657 423 | 8.726685 -4.887177 424 | 8.814852 -4.886152 425 | 9.397716 -5.155764 426 | 9.444889 -5.128157 427 | 9.442308 -5.073536 428 | 9.370041 -4.982139 429 | 9.349476 -4.918997 430 | 9.425032 -4.906362 431 | 9.418693 -4.850946 432 | 9.402478 -4.790802 433 | 9.478130 -4.777370 434 | 9.344017 -4.658755 435 | 9.379163 -4.625291 436 | 9.376989 -4.573464 437 | 9.412201 -4.539908 438 | 9.364953 -4.466854 439 | 9.403274 -4.434872 440 | 9.454799 -4.408845 441 | 9.350724 -4.310743 442 | 9.352724 -4.262281 443 | 9.440278 -4.252535 444 | 9.388761 -4.180146 445 | 9.389273 -4.131379 446 | 8.813509 -3.832223 447 | 8.769843 -3.767822 448 | 9.388476 -3.985172 449 | 9.415812 -3.948378 450 | 9.390813 -3.889802 451 | 9.388898 -3.841100 452 | 9.409778 -3.801797 453 | 9.389334 -3.745964 454 | 9.394465 -3.700578 455 | 9.435991 -3.669457 456 | 9.383708 -3.602069 457 | 9.385334 -3.555785 458 | 9.379731 -3.506938 459 | 9.398818 -3.467406 460 | 9.519562 -3.464837 461 | 9.398773 -3.374504 462 | 9.477421 -3.356131 463 | 9.392357 -3.279958 464 | 9.397785 -3.235917 465 | 9.452969 -3.208851 466 | 9.350110 -3.128504 467 | 9.401321 -3.100092 468 | 9.396267 -3.053034 469 | 9.382315 -3.003302 470 | 9.394526 -2.962082 471 | 9.384631 -2.914005 472 | 9.444791 -2.887562 473 | 9.340322 -2.811118 474 | 8.651190 -2.562599 475 | 8.717085 -2.540799 476 | 8.690638 -2.492001 477 | 9.428066 -2.658991 478 | 8.551118 -2.371436 479 | 8.596805 -2.343757 480 | 8.625528 -2.311203 481 | 8.503448 -2.238771 482 | 8.516086 -2.202410 483 | 8.638021 -2.193778 484 | 8.720972 -2.174383 485 | 8.771686 -2.146418 486 | 7.812377 -1.875587 487 | 7.769613 -1.829502 488 | 8.038657 -1.855870 489 | 8.164675 -1.847477 490 | 7.942749 -1.760865 491 | 7.971627 -1.730810 492 | 7.922764 -1.684035 493 | 7.954854 -1.654612 494 | 8.033206 -1.634375 495 | 7.836718 -1.558821 496 | 7.964628 -1.548168 497 | 7.985093 -1.516018 498 | 8.067126 -1.495153 499 | 8.078342 -1.460802 500 | 7.993051 -1.409390 501 | 8.021054 -1.378269 502 | 8.110194 -1.357181 503 | 7.888006 -1.284644 504 | 7.873989 -1.247118 505 | 7.983328 -1.228752 506 | 7.959887 -1.189614 507 | 8.000751 -1.160055 508 | 8.061860 -1.133020 509 | 7.947507 -1.081608 510 | 7.910758 -1.041471 511 | 7.940444 -1.010152 512 | 7.825103 -0.960802 513 | 7.940784 -0.939854 514 | 8.185501 -0.932621 515 | 8.190158 -0.896969 516 | 8.223045 -0.864278 517 | 8.235483 -0.829269 518 | 8.237818 -0.793211 519 | 8.592802 -0.789567 520 | 8.949946 -0.783019 521 | 9.428429 -0.783442 522 | 9.345014 -0.735469 523 | 9.391001 -0.697872 524 | 9.374740 -0.655546 525 | 9.391658 -0.615563 526 | 9.368346 -0.572994 527 | 9.413280 -0.534524 528 | 9.409157 -0.493112 529 | 9.434512 -0.453172 530 | 9.357625 -0.408563 531 | 9.427748 -0.370417 532 | 9.454032 -0.330142 533 | 9.432328 -0.288184 534 | 9.403008 -0.246227 535 | 9.407234 -0.205268 536 | 9.368071 -0.163522 537 | 9.456692 -0.123794 538 | 9.387818 -0.081926 539 | 9.372973 -0.040897 540 | 9.410576 0.000000 541 | 9.376866 0.040914 542 | 9.394644 0.081985 543 | 9.402020 0.123078 544 | 9.348713 0.163181 545 | 9.467043 0.206570 546 | 9.440358 0.247205 547 | 9.430862 0.288140 548 | 9.417496 0.328867 549 | 9.372241 0.368237 550 | 9.366395 0.408946 551 | 9.332733 0.448283 552 | 9.417673 0.493559 553 | 9.423378 0.535097 554 | 9.343224 0.571455 555 | 9.412904 0.616953 556 | 9.401927 0.657448 557 | 9.420394 0.700057 558 | 9.367141 0.737210 559 | 9.430867 0.783645 560 | 9.390371 0.821551 561 | 9.459865 0.869239 562 | 9.424209 0.907447 563 | 9.465465 0.953121 564 | 9.432560 0.991401 565 | 9.451764 1.035135 566 | 9.397460 1.070706 567 | 9.411745 1.113954 568 | 13.118664 1.668905 569 | 13.980861 2.027127 570 | 13.199282 1.972644 571 | 13.117469 2.018973 572 | 9.380352 1.485703 573 | 9.472290 1.542661 574 | 9.487133 1.587602 575 | 9.450912 1.623963 576 | 9.471406 1.670064 577 | 9.419023 1.703236 578 | 9.394506 1.741168 579 | 9.439687 1.792179 580 | 9.337747 1.815073 581 | 9.343222 1.858483 582 | 9.396108 1.911660 583 | 9.385698 1.952229 584 | 9.494380 2.018093 585 | 8.265438 2.176108 586 | 8.217534 2.201881 587 | 8.198386 2.235136 588 | 8.251306 2.288289 589 | 8.170395 2.304289 590 | 8.150834 2.337215 591 | 8.155729 2.377179 592 | 8.183640 2.424105 593 | 9.438884 2.840782 594 | 9.421755 2.880519 595 | 9.408218 2.921329 596 | 9.391994 2.961283 597 | 9.312947 2.981097 598 | 13.119874 4.262904 599 | 6.320170 2.331633 600 | 6.188270 2.313699 601 | 6.124587 2.320398 602 | 6.101617 2.342192 603 | 6.111557 2.376655 604 | 6.099530 2.402669 605 | 6.118220 2.440922 606 | 6.111976 2.469398 607 | 6.099969 2.495563 608 | 6.172386 2.556686 609 | 10.791298 4.525165 610 | 9.530401 4.045414 611 | 9.373372 4.027120 612 | 9.310235 4.048206 613 | 9.634585 4.239319 614 | 9.450472 4.207621 615 | 13.065873 5.885746 616 | 13.045833 5.945328 617 | 9.356302 4.313313 618 | 9.452363 4.407708 619 | 9.406462 4.436374 620 | 9.464616 4.514389 621 | 13.097840 6.317649 622 | 8.221107 4.234147 623 | 8.195793 4.266459 624 | 8.165094 4.295863 625 | 8.062645 4.286983 626 | 8.085339 4.344410 627 | 8.031084 4.360523 628 | 4.288225 2.352601 629 | 4.240262 2.350415 630 | 4.196722 2.350277 631 | 4.180877 2.365426 632 | 4.203654 2.402586 633 | 4.146323 2.393880 634 | 4.137685 2.413026 635 | 4.155135 2.447562 636 | 4.112784 2.446850 637 | 4.155226 2.496712 638 | 4.130326 2.506343 639 | 4.162732 2.550925 640 | 4.144199 2.564508 641 | 4.124513 2.577281 642 | 10.629128 6.706480 643 | 10.656219 6.788759 644 | 10.545004 6.782773 645 | 9.491581 6.163906 646 | 9.483977 6.217969 647 | 9.335361 6.178941 648 | 9.349565 6.247180 649 | 9.414843 6.350391 650 | 9.386665 6.391152 651 | 9.436926 6.485818 652 | 10.543363 7.944993 653 | 9.491279 7.217335 654 | 8.190514 6.284801 655 | 8.113414 6.282077 656 | 8.005230 6.254372 657 | 8.067432 6.359852 658 | 8.020117 6.379489 659 | 9.349633 7.503873 660 | 8.206875 6.645796 661 | 8.160689 6.667562 662 | 8.113938 6.688614 663 | 8.053924 6.698376 664 | 8.063827 6.766352 665 | 8.111759 6.867113 666 | 9.399339 8.027795 667 | 9.278081 7.994506 668 | 9.178314 7.978587 669 | 9.128298 8.005302 670 | 9.077659 8.031233 671 | 8.975841 8.011243 672 | 8.839758 7.959352 673 | 8.747264 7.945454 674 | 8.671009 7.945514 675 | 8.642496 7.989043 676 | 8.549001 7.972072 677 | 8.474946 7.972434 678 | 8.473392 8.040949 679 | 8.353621 7.996852 680 | 8.301878 8.017030 681 | 8.187373 7.975785 682 | 2.270819 2.231527 683 | 2.242088 2.222606 684 | 2.200928 2.200928 685 | 2.155256 2.174147 686 | 2.169750 2.207953 687 | 2.181331 2.239200 688 | 2.143128 2.219274 689 | 2.126310 2.221172 690 | 2.123861 2.238082 691 | 2.102275 2.234784 692 | 2.111365 2.264162 693 | 2.161125 2.337891 694 | 2.126446 2.320609 695 | 2.055321 2.262732 696 | 2.051369 2.278276 697 | 2.063406 2.311852 698 | 2.082089 2.353374 699 | 2.039617 2.325737 700 | 2.076438 2.388668 701 | 2.023125 2.347952 702 | 6.819037 7.984065 703 | 6.785567 8.015432 704 | 6.701169 7.986143 705 | 6.446023 7.750502 706 | 6.374813 7.733266 707 | 6.280321 7.686729 708 | 6.267672 7.739930 709 | 6.211993 7.739982 710 | 6.115572 7.688326 711 | 6.110144 7.750679 712 | 6.011539 7.694418 713 | 5.974017 7.715552 714 | 5.951322 7.755915 715 | 5.884851 7.738972 716 | 5.804427 7.702735 717 | 5.782326 7.743473 718 | 5.717956 7.727373 719 | 5.664269 7.725087 720 | 5.615194 7.728651 721 | 5.573926 7.742671 722 | 5.518423 7.736542 723 | 5.476684 7.749329 724 | 5.405787 7.720264 725 | 5.367734 7.737558 726 | 5.304261 7.717747 727 | 5.241095 7.697578 728 | 5.199590 7.708708 729 | 5.181342 7.754425 730 | 5.097728 7.701827 731 | 4.361192 6.651921 732 | 4.321094 6.653903 733 | 4.303319 6.690259 734 | 4.313827 6.771352 735 | 4.288810 6.797353 736 | 4.275933 6.842924 737 | 4.750204 7.676243 738 | 4.760150 7.767859 739 | 4.702604 7.749650 740 | 4.626165 7.699230 741 | 4.600637 7.732974 742 | 4.537310 7.702825 743 | 4.528083 7.764433 744 | 4.448047 7.704245 745 | 4.411109 7.717841 746 | 4.352782 7.693516 747 | 4.357333 7.780578 748 | 4.308630 7.772974 749 | 4.299189 7.836384 750 | 4.293784 7.908165 751 | 4.271416 7.949489 752 | 4.225344 7.946716 753 | 4.197187 7.977541 754 | 4.138008 7.949039 755 | 4.090300 7.941808 756 | 4.080943 8.009300 757 | 4.014171 7.963968 758 | 3.964049 7.950651 759 | 3.927670 7.964525 760 | 3.872538 7.939877 761 | 3.811452 7.901959 762 | 3.812488 7.993050 763 | 3.750415 7.952019 764 | 3.701087 7.937008 765 | 3.644458 7.905441 766 | 3.608290 7.917671 767 | 3.600866 7.993624 768 | 3.531519 7.931919 769 | 3.509049 7.974918 770 | 3.466707 7.972877 771 | 3.438335 8.002943 772 | 3.378397 7.959005 773 | 3.337105 7.958093 774 | 3.296276 7.957914 775 | 3.245021 7.931887 776 | 3.250495 8.045257 777 | 3.195326 8.009147 778 | 3.172126 8.052907 779 | 3.141901 8.079382 780 | 3.083052 8.031621 781 | 3.063725 8.086566 782 | 3.007416 8.043700 783 | 2.974669 8.063193 784 | 2.429829 6.675900 785 | 2.388912 6.653672 786 | 2.346229 6.625546 787 | 2.330902 6.674675 788 | 2.293073 6.659566 789 | 2.275274 6.702738 790 | 2.219459 6.633264 791 | 2.231071 6.765937 792 | 2.197083 6.761927 793 | 2.576868 8.050133 794 | 2.528150 8.018267 795 | 2.504241 8.064975 796 | 2.459026 8.043108 797 | 2.435377 8.091869 798 | 2.386579 8.056952 799 | 2.327185 7.984207 800 | 2.286216 7.972983 801 | 2.239997 7.942431 802 | 2.207314 7.959319 803 | 2.160666 7.925231 804 | 2.138327 7.980345 805 | 2.110484 8.016179 806 | 2.054260 7.943233 807 | 2.019037 7.949975 808 | 1.981584 7.947696 809 | 1.944284 7.945629 810 | 1.914953 7.976354 811 | 1.873319 7.955702 812 | 1.835621 7.950948 813 | 1.809181 7.995430 814 | 1.762577 7.950471 815 | 1.730162 7.968642 816 | 1.697989 7.988408 817 | 1.668857 8.023335 818 | 1.614806 7.937021 819 | 1.592000 8.003527 820 | 1.534040 7.891955 821 | 1.508968 7.947963 822 | 1.469852 7.930613 823 | 1.445599 7.994269 824 | 1.413777 8.017923 825 | 1.367680 7.959427 826 | 1.330046 7.948039 827 | 1.291267 7.928673 828 | 1.264875 7.986097 829 | 1.217520 7.910358 830 | 1.183084 7.916202 831 | 1.154310 7.961136 832 | 1.121436 7.979430 833 | 1.088586 7.998779 834 | 0.311793 2.368304 835 | 0.295379 2.321867 836 | 0.278734 2.270104 837 | 0.267160 2.257222 838 | 0.257428 2.259413 839 | 0.242967 2.218520 840 | 0.236627 2.251359 841 | 0.229211 2.276297 842 | 0.215704 2.240170 843 | 0.200939 2.186807 844 | 0.192187 2.196710 845 | 0.177138 2.131793 846 | 0.173468 2.204123 847 | 0.160569 2.160712 848 | 0.157202 2.248097 849 | 0.146747 2.238931 850 | 0.137173 2.242766 851 | 0.128170 2.257143 852 | 0.117656 2.245000 853 | 0.110710 2.304844 854 | 0.098203 2.249209 855 | 0.086739 2.207644 856 | 0.078762 2.255438 857 | 0.069591 2.277718 858 | 0.057538 2.197298 859 | 0.092213 4.226079 860 | 0.073499 4.210783 861 | 0.054687 4.177511 862 | 0.037077 4.248632 863 | 0.018647 4.273402 864 | 0.000000 4.268594 865 | -0.034770 7.968823 866 | -0.069511 7.965312 867 | -0.104094 7.951807 868 | -0.138017 7.906970 869 | -0.172896 7.923685 870 | -0.207908 7.939691 871 | -0.242784 7.946403 872 | -0.277732 7.953215 873 | -0.310578 7.904758 874 | -0.346709 7.940946 875 | -0.381023 7.932475 876 | -0.416085 7.939390 877 | -0.450547 7.934379 878 | -0.483023 7.897349 879 | -0.517317 7.892723 880 | -0.554535 7.930219 881 | -0.590841 7.950722 882 | -0.623160 7.917979 883 | -0.662959 7.978474 884 | -0.694812 7.941727 885 | -0.724974 7.889843 886 | -0.766270 7.958006 887 | -0.799087 7.935752 888 | -0.837956 7.972617 889 | -0.869697 7.941165 890 | -0.905472 7.947230 891 | -0.938948 7.933150 892 | -0.974855 7.939562 893 | -1.010155 7.940454 894 | -1.042319 7.917202 895 | -1.079240 7.930100 896 | -1.122206 7.984919 897 | -1.157811 7.985281 898 | -1.188481 7.952321 899 | -1.228697 7.982969 900 | -1.266410 7.995812 901 | -1.286810 7.901309 902 | -1.321979 7.899826 903 | -1.369456 7.969767 904 | -1.396801 7.921648 905 | -1.436720 7.945169 906 | -1.474738 7.956968 907 | -1.515484 7.982293 908 | -1.541699 7.931351 909 | -1.572593 7.905970 910 | -1.611185 7.919226 911 | -1.639582 7.882588 912 | -1.684460 7.924765 913 | -1.733483 7.983934 914 | -1.769267 7.980650 915 | -1.800270 7.956044 916 | -1.834455 7.945904 917 | -1.866642 7.927342 918 | -1.915745 7.979660 919 | -1.942925 7.940079 920 | -1.975906 7.924934 921 | -2.020985 7.957650 922 | -2.056250 7.950923 923 | -2.088774 7.933723 924 | -2.125509 7.932504 925 | -2.168445 7.953768 926 | -2.202969 7.943649 927 | -2.247189 7.967936 928 | -2.272227 7.924197 929 | -2.314708 7.941411 930 | -2.360308 7.968267 931 | -2.403693 7.986592 932 | -2.441350 7.985300 933 | -2.452877 7.899550 934 | -2.525879 8.011067 935 | -2.549889 7.965848 936 | -2.587750 7.964282 937 | -2.611704 7.920240 938 | -2.632664 7.868210 939 | -2.693614 7.935133 940 | -2.728018 7.922735 941 | -2.774292 7.944355 942 | -2.787544 7.871777 943 | -2.848817 7.934615 944 | -2.900594 7.969314 945 | -2.912485 7.894641 946 | -2.967846 7.937864 947 | -3.022996 7.979067 948 | -3.061574 7.975674 949 | -3.074755 7.906726 950 | -3.124552 7.932139 951 | -3.140260 7.871121 952 | -3.214496 7.956160 953 | -3.248426 7.940209 954 | -3.285631 7.932218 955 | -3.342522 7.971009 956 | -3.360723 7.917372 957 | -3.401906 7.918151 958 | -3.454401 7.944583 959 | -3.466139 7.877400 960 | -3.541732 7.954856 961 | -3.585333 7.959145 962 | -3.615025 7.932446 963 | -3.653363 7.924761 964 | -3.713975 7.964644 965 | -3.732691 7.914441 966 | -3.775904 7.916347 967 | -3.813537 7.906285 968 | -3.873776 7.942419 969 | -3.915009 7.938850 970 | -3.971609 7.965817 971 | -4.012370 7.960393 972 | -4.051058 7.950652 973 | -4.063994 7.890731 974 | -4.153789 7.979358 975 | -4.162679 7.911951 976 | -4.227609 7.950979 977 | -4.252127 7.913593 978 | -4.278913 7.880783 979 | -4.324887 7.883230 980 | -4.408453 7.953056 981 | -4.462621 7.968586 982 | -4.467198 7.895743 983 | -4.540689 7.944560 984 | -4.573817 7.922082 985 | -4.639811 7.956019 986 | -4.682191 7.948782 987 | -4.711063 7.918590 988 | -4.767357 7.934215 989 | -4.771957 7.863940 990 | -4.865364 7.939554 991 | -4.891608 7.904749 992 | -4.953977 7.928023 993 | -4.980695 7.893922 994 | -5.031851 7.898427 995 | -5.129850 7.975245 996 | -5.157526 7.941899 997 | -5.193971 7.922122 998 | -5.246692 7.926884 999 | -5.296657 7.927008 1000 | -5.348909 7.930082 1001 | -5.407397 7.941828 1002 | -5.434135 7.906714 1003 | -5.491286 7.915660 1004 | -5.540091 7.912068 1005 | -5.565694 7.875280 1006 | -5.623679 7.884108 1007 | -5.668465 7.874000 1008 | -------------------------------------------------------------------------------- /flatkdtree.h: -------------------------------------------------------------------------------- 1 | // Copyright 2024 Shota Minami 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef FLATKDTREE_FLATKDTREE_H_ 16 | #define FLATKDTREE_FLATKDTREE_H_ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | namespace kdtree { 27 | 28 | namespace trait { 29 | template 30 | struct access 31 | { }; 32 | 33 | template 34 | struct access::value>::type> 35 | { 36 | static T get(const T &t) 37 | { 38 | return t; 39 | } 40 | }; 41 | 42 | namespace detail { 43 | template ::value> 44 | using require_tuple = void; 45 | } 46 | 47 | template 48 | struct access> 49 | { 50 | static auto get(const T &t) -> typename std::tuple_element::type 51 | { 52 | using std::get; 53 | return get(t); 54 | } 55 | }; 56 | 57 | template 58 | struct dimension 59 | { }; 60 | 61 | template 62 | struct dimension::value>::type> 63 | { 64 | static constexpr std::size_t value = 1; 65 | }; 66 | 67 | template 68 | struct dimension> 69 | { 70 | static constexpr std::size_t value = std::tuple_size::value; 71 | }; 72 | 73 | template 74 | struct compare 75 | { 76 | static bool apply(const S &lhs, const T &rhs) 77 | { 78 | return lhs < rhs; 79 | } 80 | }; 81 | 82 | namespace detail { 83 | template 84 | struct default_squared_distance 85 | { 86 | static R apply(const S &s, const T &t) 87 | { 88 | R d = static_cast(access::get(s)) - static_cast(access::get(t)); 89 | return d * d + default_squared_distance::apply(s, t); 90 | } 91 | }; 92 | 93 | template 94 | struct default_squared_distance 95 | { 96 | static R apply(const S &s, const T &t) 97 | { 98 | R d = static_cast(access::get(s)) - static_cast(access::get(t)); 99 | return d * d; 100 | } 101 | }; 102 | } 103 | 104 | template 105 | struct squared_distance 106 | { 107 | static R apply(const S &s, const T &t) 108 | { 109 | return detail::default_squared_distance::value - 1>::apply(s, t); 110 | } 111 | }; 112 | } 113 | 114 | namespace internal { 115 | template 116 | auto get(const T &t) -> decltype(trait::access::get(t)) { return trait::access::get(t); } 117 | 118 | template 119 | constexpr std::size_t dimension() { return trait::dimension::value; } 120 | 121 | template 122 | bool compare(const S &lhs, const T &rhs) { return trait::compare::apply(lhs, rhs); } 123 | 124 | template 125 | R squared_distance(const S &s, const T &t) { return trait::squared_distance::apply(s, t); } 126 | 127 | template 128 | void do_construct(I first, I last) 129 | { 130 | using P = typename std::iterator_traits::value_type; 131 | 132 | const I middle = first + std::distance(first, last) / 2; 133 | std::nth_element(first, middle, last, [&](const P &l, const P &r) { return compare(get(l), get(r)); }); 134 | 135 | constexpr std::size_t NL = (L + 1) % dimension

(); 136 | if (first != middle) { 137 | do_construct(first, middle); 138 | } 139 | if (middle + 1 != last) { 140 | do_construct(middle + 1, last); 141 | } 142 | } 143 | 144 | template 145 | std::size_t do_search_knn(I first, I last, OP out_point, OD out_distance, std::size_t k, std::size_t n, const Q &query) 146 | { 147 | using P = typename std::iterator_traits::value_type; 148 | using D = typename std::iterator_traits::value_type; 149 | 150 | const I middle = first + std::distance(first, last) / 2; 151 | const D distance = squared_distance(query, *middle); 152 | 153 | if (n < k) { 154 | // Insert the point to the heap. 155 | std::size_t i = n; 156 | while (i > 0) { 157 | const std::size_t p = (i - 1) >> 1; 158 | if (compare(distance, out_distance[p])) { 159 | break; 160 | } 161 | 162 | out_distance[i] = std::move(out_distance[p]); 163 | out_point[i] = std::move(out_point[p]); 164 | i = p; 165 | } 166 | out_distance[i] = std::move(distance); 167 | out_point[i] = *middle; 168 | ++n; 169 | } else if (compare(distance, *out_distance)) { 170 | // Replace the root of the heap. 171 | std::size_t p = 0; 172 | for (std::size_t i = 1; i < n; i = (p << 1) | 1) { 173 | if (i + 1 < n and compare(out_distance[i], out_distance[i + 1])) { 174 | ++i; 175 | } 176 | 177 | if (compare(out_distance[i], distance)) { 178 | break; 179 | } 180 | 181 | out_distance[p] = std::move(out_distance[i]); 182 | out_point[p] = std::move(out_point[i]); 183 | p = i; 184 | } 185 | out_distance[p] = std::move(distance); 186 | out_point[p] = *middle; 187 | } 188 | 189 | constexpr std::size_t NL = (L + 1) % dimension

(); 190 | if (compare(get(query), get(*middle))) { 191 | if (first != middle) { 192 | n = do_search_knn(first, middle, out_point, out_distance, k, n, query); 193 | } 194 | if (middle + 1 != last and compare(squared_distance(get(query), get(*middle)), *out_distance)) { 195 | n = do_search_knn(middle + 1, last, out_point, out_distance, k, n, query); 196 | } 197 | } else { 198 | if (middle + 1 != last) { 199 | n = do_search_knn(middle + 1, last, out_point, out_distance, k, n, query); 200 | } 201 | if (first != middle and compare(squared_distance(get(query), get(*middle)), *out_distance)) { 202 | n = do_search_knn(first, middle, out_point, out_distance, k, n, query); 203 | } 204 | } 205 | return n; 206 | } 207 | } 208 | 209 | template 210 | void construct(I first, I last) 211 | { 212 | if (first != last) { 213 | internal::do_construct<0>(first, last); 214 | } 215 | } 216 | 217 | template 218 | std::size_t search_knn(I first, I last, OP out_point, OD out_distance, std::size_t k, const Q &query) 219 | { 220 | if (first != last) { 221 | return internal::do_search_knn<0>(first, last, out_point, out_distance, k, 0, query); 222 | } 223 | return 0; 224 | } 225 | 226 | } // namespace kdtree 227 | 228 | #endif // FLATKDTREE_FLATKDTREE_H_ 229 | -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "ndt-cpu-single.hpp" 4 | 5 | 6 | int main(void){ 7 | 8 | auto scan_points1 = ndtcpp::read_scan_points("./data/scan_1.txt"); 9 | auto target_points = ndtcpp::read_scan_points("./data/scan_2.txt"); 10 | 11 | std::vector durations; 12 | const size_t N = 10; 13 | 14 | for (size_t i = 0; i < N; ++i) { 15 | 16 | auto source = scan_points1; 17 | auto target = target_points; 18 | auto trans_mat1 = ndtcpp::makeTransformationMatrix(1.0f, 0.0f, 0.5f); 19 | ndtcpp::transformPointsZeroCopy(trans_mat1, source); 20 | 21 | auto ndt_points = std::vector(); 22 | auto start_time = std::chrono::high_resolution_clock::now(); 23 | 24 | const bool verbose = true; 25 | ndtcpp::compute_ndt_points(target, ndt_points); 26 | ndtcpp::ndt_scan_matching(trans_mat1, source, ndt_points, verbose); 27 | 28 | auto end_time = std::chrono::high_resolution_clock::now(); 29 | 30 | ndtcpp::transformPointsZeroCopy(trans_mat1, source); 31 | 32 | //debug 33 | auto microsec = std::chrono::duration_cast(end_time - start_time).count() / 1e6; 34 | durations.push_back(microsec); 35 | if (i == N - 1) { 36 | ndtcpp::writePointsToSVG(source, target, "scan_points.svg"); 37 | ndtcpp::writePointsToSVG(source, ndt_points, "scan_points_ndt.svg"); 38 | } 39 | } 40 | const double mean = std::accumulate(durations.begin(), durations.end(), 0.0) / durations.size(); 41 | std::cout << "MEAN: " << mean << " mill sec" << std::endl; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /main_downsample.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "ndt-cpu-single.hpp" 4 | 5 | 6 | int main(void){ 7 | 8 | auto scan_points1 = ndtcpp::read_scan_points("./data/scan_1.txt"); 9 | auto target_points = ndtcpp::read_scan_points("./data/scan_2.txt"); 10 | 11 | std::vector durations; 12 | const size_t N = 10; 13 | 14 | for (size_t i = 0; i < N; ++i) { 15 | 16 | auto source = scan_points1; 17 | auto target = target_points; 18 | auto trans_mat1 = ndtcpp::makeTransformationMatrix(1.0f, 0.0f, 0.5f); 19 | transformPointsZeroCopy(trans_mat1, source); 20 | 21 | auto ndt_points = std::vector(); 22 | auto start_time = std::chrono::high_resolution_clock::now(); 23 | 24 | const bool verbose = true; 25 | ndtcpp::compute_ndt_points_downsampling(target, ndt_points); 26 | ndtcpp::ndt_scan_matching(trans_mat1, source, ndt_points, verbose); 27 | 28 | auto end_time = std::chrono::high_resolution_clock::now(); 29 | 30 | ndtcpp::transformPointsZeroCopy(trans_mat1, source); 31 | 32 | //debug 33 | auto microsec = std::chrono::duration_cast(end_time - start_time).count() / 1e6; 34 | durations.push_back(microsec); 35 | if (i == N - 1) { 36 | ndtcpp::writePointsToSVG(source, target, "scan_points_ds.svg"); 37 | ndtcpp::writePointsToSVG(source, ndt_points, "scan_points_ndt_ds.svg"); 38 | } 39 | } 40 | const double mean = std::accumulate(durations.begin(), durations.end(), 0.0) / durations.size(); 41 | std::cout << "MEAN: " << mean << " mill sec" << std::endl; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /matrixutil.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2024 Taiga Takano 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef NDTCPP_MATRIX_UTIL_HPP_ 16 | #define NDTCPP_MATRIX_UTIL_HPP_ 17 | 18 | #include "type.hpp" 19 | 20 | namespace ndtcpp 21 | { 22 | auto operator*(const mat3x3& mat1, const mat3x3& mat2) 23 | { 24 | mat3x3 result; 25 | result.a = mat1.a * mat2.a + mat1.b * mat2.d + mat1.c * mat2.g; 26 | result.b = mat1.a * mat2.b + mat1.b * mat2.e + mat1.c * mat2.h; 27 | result.c = mat1.a * mat2.c + mat1.b * mat2.f + mat1.c * mat2.i; 28 | 29 | result.d = mat1.d * mat2.a + mat1.e * mat2.d + mat1.f * mat2.g; 30 | result.e = mat1.d * mat2.b + mat1.e * mat2.e + mat1.f * mat2.h; 31 | result.f = mat1.d * mat2.c + mat1.e * mat2.f + mat1.f * mat2.i; 32 | 33 | result.g = mat1.g * mat2.a + mat1.h * mat2.d + mat1.i * mat2.g; 34 | result.h = mat1.g * mat2.b + mat1.h * mat2.e + mat1.i * mat2.h; 35 | result.i = mat1.g * mat2.c + mat1.h * mat2.f + mat1.i * mat2.i; 36 | return result; 37 | } 38 | 39 | auto operator*(const mat3x3& mat, const point3& vec) 40 | { 41 | point3 result; 42 | result.x = mat.a * vec.x + mat.b * vec.y + mat.c * vec.z; 43 | result.y = mat.d * vec.x + mat.e * vec.y + mat.f * vec.z; 44 | result.z = mat.g * vec.x + mat.h * vec.y + mat.i * vec.z; 45 | return result; 46 | } 47 | 48 | auto operator+=(mat3x3& mat1, const mat3x3& mat2) 49 | { 50 | mat1.a += mat2.a; 51 | mat1.b += mat2.b; 52 | mat1.c += mat2.c; 53 | 54 | mat1.d += mat2.d; 55 | mat1.e += mat2.e; 56 | mat1.f += mat2.f; 57 | 58 | mat1.g += mat2.g; 59 | mat1.h += mat2.h; 60 | mat1.i += mat2.i; 61 | } 62 | 63 | auto operator+=(ndtcpp::point3& point1, const ndtcpp::point3& point2){ 64 | point1.x += point2.x; 65 | point1.y += point2.y; 66 | point1.z += point2.z; 67 | } 68 | } // namespace ndtcpp 69 | 70 | #endif // NDTCPP_MATRIX_UTIL_HPP_ 71 | -------------------------------------------------------------------------------- /ndt-cpu-single.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2024 Taiga Takano 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef NDTCPP_NDT_CPU_SINGLE_HPP_ 16 | #define NDTCPP_NDT_CPU_SINGLE_HPP_ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include "flatkdtree.h" 28 | #include "type.hpp" 29 | #include "ndtcpputil.hpp" 30 | #include "matrixutil.hpp" 31 | 32 | 33 | namespace ndtcpp { 34 | struct ndtpoint2 { 35 | ndtcpp::point2 mean; 36 | ndtcpp::mat2x2 cov; 37 | }; 38 | } // namespace ndtcpp 39 | 40 | template 41 | struct kdtree::trait::access { 42 | static auto get(const ndtcpp::point2 &p) -> float 43 | { 44 | return I == 0 ? p.x : p.y; 45 | } 46 | }; 47 | 48 | template <> 49 | struct kdtree::trait::dimension { 50 | static constexpr std::size_t value = 2; 51 | }; 52 | 53 | template 54 | struct kdtree::trait::access { 55 | static auto get(const ndtcpp::ndtpoint2 &p) -> float 56 | { 57 | return I == 0 ? p.mean.x : p.mean.y; 58 | } 59 | }; 60 | 61 | template <> 62 | struct kdtree::trait::dimension { 63 | static constexpr std::size_t value = 2; 64 | }; 65 | 66 | namespace ndtcpp { 67 | 68 | inline ndtcpp::mat3x3 makeTransformationMatrix(const float& tx, const float& ty, const float& theta) { 69 | ndtcpp::mat3x3 mat = { 70 | cosf(theta), sinf(theta) * -1.0f, tx, 71 | sinf(theta), cosf(theta) , ty, 72 | 0.0f, 0.0f, 1.0f 73 | }; 74 | return mat; 75 | } 76 | 77 | inline void transformPointsZeroCopy(const ndtcpp::mat3x3& mat, std::vector& points) { 78 | ndtcpp::point2 transformedPoint; 79 | 80 | for (auto& point : points) { 81 | transformedPoint.x = mat.a * point.x + mat.b * point.y + mat.c; 82 | transformedPoint.y = mat.d * point.x + mat.e * point.y + mat.f; 83 | point.x = transformedPoint.x; 84 | point.y = transformedPoint.y; 85 | } 86 | } 87 | 88 | 89 | namespace { 90 | struct tuple_int_hash { 91 | size_t operator()(const std::tuple& v) const { 92 | const auto hash0 = std::hash{}(std::get<0>(v)); 93 | const auto hash1 = std::hash{}(std::get<1>(v)); 94 | size_t seed = 0; 95 | seed ^= hash0 + 0x9e3779b9 + (seed << 6) + (seed >> 2); 96 | seed ^= hash1 + 0x9e3779b9 + (seed << 6) + (seed >> 2); 97 | return seed; 98 | } 99 | }; 100 | 101 | inline float multiplyPowPoint3(const ndtcpp::point3& vec){ 102 | return vec.x * vec.x + vec.y * vec.y + vec.z * vec.z; 103 | } 104 | 105 | inline ndtcpp::point3 solve3x3(const ndtcpp::mat3x3& m, const ndtcpp::point3& p) { 106 | float A[3][4] = { 107 | {m.a, m.b, m.c, p.x}, 108 | {m.d, m.e, m.f, p.y}, 109 | {m.g, m.h, m.i, p.z} 110 | }; 111 | 112 | const int n = 3; 113 | 114 | for (int i = 0; i < n; i++) { 115 | // Pivot選択 116 | float maxEl = std::abs(A[i][i]); 117 | int maxRow = i; 118 | for (int k = i+1; k < n; k++) { 119 | const auto el = std::abs(A[k][i]); 120 | if (el > maxEl) { 121 | maxEl = el; 122 | maxRow = k; 123 | } 124 | } 125 | 126 | // Pivotのある行を交換 127 | for (int k = i; k < n+1;k++) { 128 | float tmp = A[maxRow][k]; 129 | A[maxRow][k] = A[i][k]; 130 | A[i][k] = tmp; 131 | } 132 | 133 | // すべての行について消去を行う 134 | for (int k = i+1; k < n; k++) { 135 | const float c = -A[k][i] / A[i][i]; 136 | for (int j = i; j < n+1; j++) { 137 | if (i == j) { 138 | A[k][j] = 0.0f; 139 | } else { 140 | A[k][j] += c * A[i][j]; 141 | } 142 | } 143 | } 144 | } 145 | 146 | // 解の計算 (後退代入) 147 | ndtcpp::point3 solution; 148 | solution.z = A[2][3] / A[2][2]; 149 | solution.y = (A[1][3] - A[1][2] * solution.z) / A[1][1]; 150 | solution.x = (A[0][3] - A[0][2] * solution.z - A[0][1] * solution.y) / A[0][0]; 151 | 152 | return solution; 153 | } 154 | 155 | inline ndtcpp::point3 solve3x3_LU(const ndtcpp::mat3x3& m, const ndtcpp::point3& p) { 156 | const float u11 = m.a; 157 | const float u12 = m.b; 158 | const float u13 = m.c; 159 | const float l21 = m.d / u11; 160 | const float u22 = m.e - l21 * u12; 161 | const float u23 = m.f - l21 * u13; 162 | const float l31 = m.g / u11; 163 | const float l32 = (m.h - l31 * u12) / u22; 164 | const float u33 = m.i - l31 * u13 - l32 * u23; 165 | // ndtcpp::mat3x3 L = { 166 | // 1.0f, 0.0f, 0.0f, 167 | // l21, 1.0f, 0.0f, 168 | // l31, l32, 1.0f 169 | // }; 170 | // ndtcpp::mat3x3 U = { 171 | // u11, u12, u13, 172 | // 0.0f, u22, u23, 173 | // 0.0f, 0.0f, u33 174 | // }; 175 | const float y1 = p.x; 176 | const float y2 = p.y - l21 * y1; 177 | const float y3 = p.z - l31 * y1 - l32 * y2; 178 | 179 | const float x3 = y3 / u33; 180 | const float x2 = (y2 - u23 * x3) / u22; 181 | const float x1 = (y1 - u12 * x2 - u23 * x3) / u11; 182 | 183 | return {x1, x2, x3}; 184 | } 185 | 186 | inline ndtcpp::mat3x3 expmap(const ndtcpp::point3& point){ 187 | auto t = point.z; 188 | auto c = cosf(t); 189 | auto s = sinf(t); 190 | 191 | ndtcpp::mat2x2 R { 192 | c, s * -1.0f, 193 | s, c 194 | }; 195 | 196 | ndtcpp::mat3x3 T { 197 | R.a, R.b, point.x, 198 | R.c, R.d, point.y, 199 | 0.0f, 0.0f, 1.0f 200 | }; 201 | 202 | return T; 203 | } 204 | 205 | inline ndtcpp::point2 transformPointCopy(const ndtcpp::mat3x3& mat, const ndtcpp::point2& point) { 206 | ndtcpp::point2 transformedPoint; 207 | 208 | transformedPoint.x = mat.a * point.x + mat.b * point.y + mat.c; 209 | transformedPoint.y = mat.d * point.x + mat.e * point.y + mat.f; 210 | 211 | return transformedPoint; 212 | } 213 | 214 | inline ndtcpp::mat3x3 inverse3x3Copy(const ndtcpp::mat3x3& mat){ 215 | const auto a = 1.0f / ( 216 | mat.a * mat.e * mat.i + 217 | mat.b * mat.f * mat.g + 218 | mat.c * mat.d * mat.h - 219 | mat.c * mat.e * mat.g - 220 | mat.b * mat.d * mat.i - 221 | mat.a * mat.f * mat.h 222 | ); 223 | 224 | ndtcpp::mat3x3 inv_mat; 225 | inv_mat.a = mat.e * mat.i - mat.f * mat.h; 226 | inv_mat.b = mat.b * mat.i - mat.c * mat.h; 227 | inv_mat.c = mat.b * mat.f - mat.c * mat.e; 228 | 229 | inv_mat.d = mat.d * mat.i - mat.f * mat.g; 230 | inv_mat.e = mat.a * mat.i - mat.c * mat.g; 231 | inv_mat.f = mat.a * mat.f - mat.c * mat.d; 232 | 233 | inv_mat.g = mat.d * mat.h - mat.e * mat.g; 234 | inv_mat.h = mat.a * mat.h - mat.b * mat.g; 235 | inv_mat.i = mat.a * mat.e - mat.b * mat.d; 236 | 237 | 238 | inv_mat.a = inv_mat.a * a; 239 | inv_mat.b = inv_mat.b * a * -1.0f; 240 | inv_mat.c = inv_mat.c * a; 241 | 242 | inv_mat.d = inv_mat.d * a * -1.0f; 243 | inv_mat.e = inv_mat.e * a; 244 | inv_mat.f = inv_mat.f * a * -1.0f; 245 | 246 | inv_mat.g = inv_mat.g * a; 247 | inv_mat.h = inv_mat.h * a * -1.0f; 248 | inv_mat.i = inv_mat.i * a; 249 | 250 | return inv_mat; 251 | } 252 | 253 | inline ndtcpp::point2 skewd(const ndtcpp::point2& input_point){ 254 | const ndtcpp::point2 skewd_point { 255 | input_point.y, 256 | input_point.x * -1.0f 257 | }; 258 | return skewd_point; 259 | } 260 | 261 | inline ndtcpp::mat3x3 transpose(const ndtcpp::mat3x3& input_mat){ 262 | const ndtcpp::mat3x3 transpose_mat{ 263 | input_mat.a, input_mat.d, input_mat.g, 264 | input_mat.b, input_mat.e, input_mat.h, 265 | input_mat.c, input_mat.f, input_mat.i 266 | }; 267 | return transpose_mat; 268 | } 269 | 270 | inline ndtcpp::point2 compute_mean(const std::vector& points){ 271 | ndtcpp::point2 mean; 272 | mean.x = 0.0f; 273 | mean.y = 0.0f; 274 | for(const auto& point : points){ 275 | mean.x += point.x; 276 | mean.y += point.y; 277 | } 278 | mean.x = mean.x / (float)points.size(); 279 | mean.y = mean.y / (float)points.size(); 280 | return mean; 281 | } 282 | 283 | inline ndtcpp::mat2x2 compute_covariance(const std::vector& points, const ndtcpp::point2& mean){ 284 | auto point_size = points.size(); 285 | auto vxx = 0.0f; 286 | auto vxy = 0.0f; 287 | auto vyy = 0.0f; 288 | 289 | for(const auto& point : points){ 290 | const auto dx = point.x - mean.x; 291 | const auto dy = point.y - mean.y; 292 | vxx += dx * dx; 293 | vxy += dx * dy; 294 | vyy += dy * dy; 295 | } 296 | 297 | ndtcpp::mat2x2 cov; 298 | cov.a = vxx / point_size; 299 | cov.b = vxy / point_size; 300 | cov.c = cov.b; 301 | cov.d = vyy / point_size; 302 | return cov; 303 | } 304 | 305 | } // namespace 306 | 307 | inline void compute_ndt_points(std::vector& points, std::vector &results){ 308 | auto N = 10; 309 | 310 | const auto point_size = points.size(); 311 | 312 | kdtree::construct(points.begin(), points.end()); 313 | std::vector result_points(N); 314 | std::vector result_distances(N); 315 | 316 | std::vector covs(point_size); 317 | results.resize(point_size); 318 | 319 | for(std::size_t i = 0; i < point_size; i++) { 320 | kdtree::search_knn(points.begin(), points.end(), result_points.begin(), result_distances.begin(), N, points[i]); 321 | const auto mean = compute_mean(result_points); 322 | const auto cov = compute_covariance(result_points, mean); 323 | results[i] = {mean, cov}; 324 | } 325 | } 326 | 327 | inline void compute_ndt_points_downsampling( 328 | const std::vector& points, std::vector &results, 329 | float voxel_size = 1.0f, std::size_t voxel_min_count = 4) { 330 | 331 | const auto point_size = points.size(); 332 | 333 | std::unordered_map, std::vector, tuple_int_hash> voxel_indices; 334 | const float voxel_size_inv = 1.0f / voxel_size; 335 | 336 | for(size_t i = 0; i < point_size; i++) { 337 | const auto& pt0 = points[i]; 338 | const std::tuple voxel = { 339 | std::floor(pt0.x * voxel_size_inv), 340 | std::floor(pt0.y * voxel_size_inv) 341 | }; 342 | 343 | voxel_indices[voxel].push_back(i); 344 | } 345 | 346 | results.clear(); 347 | results.reserve(voxel_indices.size()); 348 | for (const auto& [voxel, indices]: voxel_indices) { 349 | if (indices.size() < voxel_min_count) continue; 350 | 351 | std::vector result_points; 352 | result_points.reserve(indices.size()); 353 | for (const auto& i: indices) { 354 | result_points.push_back(points[i]); 355 | } 356 | const auto mean = compute_mean(result_points); 357 | const auto cov = compute_covariance(result_points, mean); 358 | results.push_back({mean, cov}); 359 | } 360 | } 361 | 362 | inline void ndt_scan_matching( 363 | ndtcpp::mat3x3& trans_mat, 364 | const std::vector& source_points, 365 | std::vector& target_points, bool verbose = false 366 | ) { 367 | const size_t max_iter_num = 20; 368 | const float max_correspondence_distance = 3.0f; 369 | const float max_distance2 = max_correspondence_distance * max_correspondence_distance; 370 | const size_t point_step = 10; 371 | 372 | const size_t target_points_size = target_points.size(); 373 | const size_t source_points_size = source_points.size(); 374 | 375 | bool is_converged = false; 376 | ndtcpp::point3 prev_delta; 377 | float min_error = std::numeric_limits::max(); 378 | ndtcpp::mat3x3 min_trans_mat; 379 | 380 | kdtree::construct(target_points.begin(), target_points.end()); 381 | for(size_t iter = 0; iter < max_iter_num; iter++){ 382 | ndtcpp::mat3x3 H_Mat { 383 | 0.0f, 0.0f, 0.0f, 384 | 0.0f, 0.0f, 0.0f, 385 | 0.0f, 0.0f, 0.0f 386 | }; 387 | 388 | ndtcpp::point3 b_Point { 389 | 0.0f, 0.0f, 0.0f 390 | }; 391 | 392 | for(auto point_iter = 0; point_iter < source_points_size; point_iter += point_step){ 393 | ndtpoint2 query_point = {transformPointCopy(trans_mat, source_points[point_iter]), {}}; 394 | ndtpoint2 target_point; 395 | float target_distance; 396 | kdtree::search_knn(target_points.begin(), target_points.end(), &target_point, &target_distance, 1, query_point); 397 | 398 | if(target_distance > max_distance2){continue;} 399 | 400 | const auto identity_plus_cov = ndtcpp::mat3x3{ 401 | target_point.cov.a, target_point.cov.b, 0.0f, 402 | target_point.cov.c, target_point.cov.d, 0.0f, 403 | 0.0f, 0.0f, 1.0f 404 | }; 405 | 406 | const ndtcpp::mat3x3 target_cov_inv = inverse3x3Copy(identity_plus_cov); //IM 407 | 408 | 409 | const auto error = ndtcpp::point3{ 410 | target_point.mean.x - query_point.mean.x, 411 | target_point.mean.y - query_point.mean.y, 412 | 0.0f 413 | }; 414 | 415 | const ndtcpp::point2 v_point = transformPointCopy(trans_mat, skewd(source_points[point_iter])); 416 | 417 | const auto mat_J = ndtcpp::mat3x3{ 418 | trans_mat.a * -1.0f, trans_mat.b * -1.0f, v_point.x, 419 | trans_mat.d * -1.0f, trans_mat.e * -1.0f, v_point.y, 420 | trans_mat.g * -1.0f, trans_mat.h * -1.0f, trans_mat.i * -1.0f 421 | }; 422 | 423 | const ndtcpp::mat3x3 mat_J_T = transpose(mat_J); 424 | 425 | H_Mat += (mat_J_T * (target_cov_inv * mat_J)); 426 | 427 | b_Point += (mat_J_T * (target_cov_inv * error)); 428 | 429 | } 430 | b_Point.x *= -1.0f; 431 | b_Point.y *= -1.0f; 432 | b_Point.z *= -1.0f; 433 | 434 | // more stable solve 435 | H_Mat.a += 1e-6; 436 | H_Mat.e += 1e-6; 437 | H_Mat.i += 1e-6; 438 | 439 | const ndtcpp::point3 delta = solve3x3(H_Mat, b_Point); 440 | // const ndtcpp::point3 delta = solve3x3_LU(H_Mat, b_Point); 441 | trans_mat = trans_mat * expmap(delta); 442 | 443 | const float error = multiplyPowPoint3(delta); 444 | if(error < 1e-4){ 445 | is_converged = true; 446 | } 447 | 448 | if (iter > 0) { 449 | const float dx = prev_delta.x - delta.x; 450 | const float dy = prev_delta.y - delta.y; 451 | const float dz = prev_delta.z - delta.z; 452 | const auto d = std::max(std::max(std::fabs(dx), std::fabs(dy)), std::fabs(dz)); 453 | if (d < 1e-4) { 454 | is_converged = true; 455 | } 456 | } 457 | 458 | if (is_converged) { 459 | if (verbose) { 460 | std::cout << "END NDT. ITER: " << iter; 461 | std::cout << ", ERROR VALUE: " << error << std::endl; 462 | } 463 | break; 464 | } 465 | 466 | prev_delta = delta; 467 | 468 | if (min_error > error) { 469 | min_error = error; 470 | min_trans_mat = trans_mat; 471 | } 472 | 473 | if (iter == max_iter_num - 1) { 474 | if (verbose) { 475 | std::cout << "END NDT NOT CONVERGED. ERROR VALUE: " << min_error << std::endl; 476 | } 477 | trans_mat = min_trans_mat; 478 | } 479 | } 480 | } 481 | 482 | //debug 483 | inline void writePointsToSVG(const std::vector& point_1, const std::vector& point_2, const std::string& file_name) { 484 | std::ofstream file(file_name); 485 | if (!file.is_open()) { 486 | std::cerr << "Cannot open file for writing." << std::endl; 487 | return; 488 | } 489 | 490 | file << "\n"; 491 | file << "\n"; 492 | 493 | for (const auto& point : point_1) { 494 | file << "\n"; 495 | } 496 | 497 | for (const auto& point : point_2) { 498 | file << "\n"; 499 | } 500 | 501 | file << "\n"; 502 | file.close(); 503 | } 504 | 505 | inline void writePointsToSVG(const std::vector& point_1, const std::vector& point_2, const std::string& file_name, float voxel_size=1.0f) { 506 | std::ofstream file(file_name); 507 | if (!file.is_open()) { 508 | std::cerr << "Cannot open file for writing." << std::endl; 509 | return; 510 | } 511 | const int size = 500; 512 | const float scale = 10.0f; 513 | const float ellipse_scale = 3.0f; 514 | const float offset = 250.0f; 515 | const std::string ellipse_color = "green"; 516 | const std::string source_pt_color = "red"; 517 | const std::string target_pt_color = "black"; 518 | 519 | file << "\n"; 520 | file << "\n"; 521 | const int voxel_interval = static_cast(std::floor(1.0f / voxel_size * scale)); 522 | for (size_t i = 0; i < size + voxel_interval; i+=voxel_interval) { 523 | file << "\n"; 524 | file << "\n"; 525 | } 526 | file << "\n"; 527 | file << "\n"; 528 | file << "\n"; 529 | file << "\n"; 530 | file << "\n"; 531 | file << "\n"; 532 | file << "\n"; 533 | 534 | for (const auto& point : point_1) { 535 | file << "\n"; 536 | } 537 | 538 | for (const auto& point : point_2) { 539 | const auto cx = point.mean.x * scale + offset; 540 | const auto cy = point.mean.y * scale + offset; 541 | const auto& cov = point.cov; 542 | const float u = 0.5f * ((cov.a + cov.d) + std::sqrt((cov.a - cov.d) * (cov.a - cov.d) + 4.0f * cov.b * cov.b)); 543 | const float v = 0.5f * ((cov.a + cov.d) - std::sqrt((cov.a - cov.d) * (cov.a - cov.d) + 4.0f * cov.b * cov.b)); 544 | const float e1 = (u - cov.a) / cov.b; 545 | // const float e2 = (v - cov.a) / cov.b; 546 | // 95% 547 | const float rx = 2.0f * 2.448f * std::sqrt(u) * ellipse_scale; 548 | const float ry = 2.0f * 2.448f * std::sqrt(v) * ellipse_scale; 549 | const auto rot = std::atan(e1) * (180.0f / M_PI); 550 | 551 | file << "\n"; 552 | file << "\n"; 553 | } 554 | 555 | file << "\n"; 556 | file.close(); 557 | } 558 | 559 | } // namespace ndt_cpp 560 | 561 | #endif // NDTCPP_NDT_CPU_SINGLE_HPP_ 562 | -------------------------------------------------------------------------------- /ndtcpputil.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2024 Taiga Takano 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef NDTCPP_NDTCPPUTIL_HPP_ 16 | #define NDTCPP_NDTCPPUTIL_HPP_ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #include "type.hpp" 26 | 27 | 28 | namespace ndtcpp 29 | { 30 | auto read_scan_points(const std::string& file_path) -> std::vector 31 | { 32 | std::vector points; 33 | std::ifstream file(file_path); 34 | if (!file.is_open()) { 35 | std::cerr << "File could not be opened." << std::endl; 36 | return points; 37 | } 38 | 39 | std::string line_str; 40 | point2 p; 41 | while(std::getline(file, line_str)){ 42 | std::istringstream iss(line_str); 43 | if (!(iss >> p.x >> p.y)) { 44 | std::cerr << "Failed to parse line: " << line_str << std::endl; 45 | continue; 46 | } 47 | points.push_back(p); 48 | } 49 | 50 | return points; 51 | } 52 | } 53 | 54 | #endif // NDTCPP_NDTCPPUTIL_HPP_ 55 | -------------------------------------------------------------------------------- /type.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2024 Taiga Takano 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef NDTCPP_TYPE_H_ 16 | #define NDTCPP_TYPE_H_ 17 | 18 | namespace ndtcpp 19 | { 20 | struct point2{ 21 | float x, y; 22 | }; 23 | struct point3{ 24 | float x, y, z; 25 | }; 26 | 27 | struct mat2x2{ 28 | float a, b; 29 | float c, d; 30 | }; 31 | 32 | struct mat3x3{ 33 | float a, b, c; 34 | float d, e, f; 35 | float g, h, i; 36 | }; 37 | } // namespace ndtcpp 38 | 39 | #endif // NDTCPP_TYPE_H_ 40 | --------------------------------------------------------------------------------