Compare commits
2034 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ca7c5d31a4 | |||
| 00c8ad4698 | |||
| e4c9451685 | |||
| db2580088d | |||
| c1b652f21e | |||
| 8fe0d42450 | |||
| 87293fac9b | |||
| f7322989df | |||
| a4f0f5c129 | |||
| 3003f16389 | |||
| 7ee0afbf7a | |||
| f2d8daa1fb | |||
| 7052fde4de | |||
| 484ba25ce6 | |||
| a21571a652 | |||
| c506881614 | |||
| 909727ade8 | |||
| 1626c69494 | |||
| b37e6ece98 | |||
| 08692f811b | |||
| 6c80dd4eae | |||
| e230f3c5e7 | |||
| c861505bc9 | |||
| d6052a5a27 | |||
| 0e45008f9a | |||
| f526ff8f48 | |||
| d4ec3a985a | |||
| 2521718820 | |||
| 0875dfad34 | |||
| 031711120d | |||
| 7dbcbc0f76 | |||
| 27f12ae3de | |||
| c69aae4b2f | |||
| 153e87d36c | |||
| fa77887d09 | |||
| d43443a832 | |||
| 7993938ab6 | |||
| bc71c6e64b | |||
| b86e14afff | |||
| bd46939070 | |||
| 70eeb4b475 | |||
| 3cd752417b | |||
| 287f3d94ca | |||
| 05ed514bcf | |||
| 368cd7b731 | |||
| 3af29639c6 | |||
| a69ee20f0c | |||
| 9e75213c92 | |||
| ff0839184b | |||
| 6453040cd8 | |||
| 9299a73cf1 | |||
| 7df94ca9af | |||
| feac22b00d | |||
| 9816e48b07 | |||
| 5393196c0e | |||
| 0f2943bde5 | |||
| aa83224594 | |||
| aebcea070c | |||
| 4ac1e89b65 | |||
| c2bf2d0daa | |||
| 056c2f1586 | |||
| a4dc263846 | |||
| 297e84e3f0 | |||
| 3849cd7993 | |||
| eca9e3339a | |||
| 1280a185c2 | |||
| c9d1fbdc7d | |||
| 8829848f35 | |||
| a235cbf275 | |||
| bcb75d5477 | |||
| 2542cb490a | |||
| cf713cf2a1 | |||
| 010121d8c1 | |||
| e6f0346521 | |||
| 9d617ce4c8 | |||
| 348303a6cf | |||
| 6ee243c2fa | |||
| 711f34f5ae | |||
| a0af9e2da0 | |||
| eca76c3781 | |||
| a0a989fe4c | |||
| 0ffb412aaf | |||
| 4e407ac4d6 | |||
| 4f92f5cbbb | |||
| fadf2dbc3b | |||
| 18f0cc6346 | |||
| 7f355febda | |||
| a2b1c3915f | |||
| 5c3024e9f8 | |||
| e624a1d00d | |||
| b25ef6235d | |||
| a17870c93c | |||
| d0e52d3578 | |||
| f124f6e70b | |||
| 32760491a6 | |||
| 4bccc5cc6e | |||
| 3f79dfffb6 | |||
| 5b156b2380 | |||
| 20ee0ba82f | |||
| ed61d65501 | |||
| 272cbd198d | |||
| 3ca1ec2c28 | |||
| 37b7334df6 | |||
| fcd4603b66 | |||
| 1531f5a325 | |||
| d8430f191f | |||
| 7ee6214415 | |||
| 8a91e7de24 | |||
| 2e43774c2f | |||
| 033eb6590e | |||
| 6da5c23990 | |||
| 9af03d9b68 | |||
| 65f53354c3 | |||
| 08044fb737 | |||
| ec7e920453 | |||
| e270dee8cc | |||
| b606ed8ce4 | |||
| f69a5ab7db | |||
| 8ce2f16759 | |||
| a43e8aafbf | |||
| ac79af0289 | |||
| 26f4d1ae8e | |||
| 34135e5d2e | |||
| e940274146 | |||
| f27fa2ac9b | |||
| 3c1ab4bd9d | |||
| 3df9df66d9 | |||
| b18a5f1396 | |||
| 2879ee24b5 | |||
| 4fcb93b64e | |||
| 4672066db8 | |||
| 9fa224a947 | |||
| 1fee124e65 | |||
| 007a00b7f1 | |||
| 685bcfb898 | |||
| d1b4f23388 | |||
| 8b8db11d9f | |||
| 34b9ff8867 | |||
| 0ec81d2760 | |||
| 843fbc49fc | |||
| 781f91e6af | |||
| 948ccac021 | |||
| efdbc93e99 | |||
| 70f58672c7 | |||
| 0ea6a2ed0d | |||
| 288841cf98 | |||
| a5e6edff87 | |||
| 74a43f23b3 | |||
| c1bf26bbd7 | |||
| 816b54bd25 | |||
| b825dcd6bb | |||
| 513969140d | |||
| 219e212fe0 | |||
| 2b66257d25 | |||
| d113deab32 | |||
| 57c783e5b0 | |||
| bc3cc033e1 | |||
| 83ccbbe79d | |||
| ec992ae1dc | |||
| f336b7ed67 | |||
| 8a76f2c13e | |||
| 1ec066553e | |||
| a1eef54451 | |||
| 0c5a477fee | |||
| b389554a30 | |||
| 7734ffb810 | |||
| 403ba14f57 | |||
| 0172544cc7 | |||
| f1053504a1 | |||
| ecd6517cb0 | |||
| 39187dacac | |||
| cf842d569e | |||
| 2710d276df | |||
| 9139ab37d3 | |||
| 93f32d4dd1 | |||
| f14758d5e5 | |||
| e47560003e | |||
| 187894d8b5 | |||
| fcd2882ad7 | |||
| 5574419293 | |||
| bcd0ec8f53 | |||
| 6f636e0ae9 | |||
| ee8ac77eab | |||
| 5bdbe2db61 | |||
| a59b915132 | |||
| 4e29db90c6 | |||
| 9bd89e7e29 | |||
| 9e01a08eaf | |||
| 1fd06ef59b | |||
| 32a5340b0b | |||
| 3f15ae80d0 | |||
| dd3d30a4da | |||
| d9e47e5896 | |||
| 92c2b18350 | |||
| e3aba10762 | |||
| d811b585b7 | |||
| e1e0777c7b | |||
| 236f1666db | |||
| d56357f764 | |||
| 67257633d6 | |||
| 26639f1eca | |||
| 206e183f52 | |||
| da9656dd7a | |||
| f868120a77 | |||
| 3fc7b6bfb2 | |||
| 6fe6863001 | |||
| 0c5484335d | |||
| ede0dbdff7 | |||
| d8abb92ba5 | |||
| 37e9c9732f | |||
| 18a61c0ef8 | |||
| 202a1be3f5 | |||
| 461bc33fbf | |||
| dabcf32e6b | |||
| e53e0ab0f5 | |||
| f66998e996 | |||
| d432c72a15 | |||
| 28b6c82555 | |||
| d3870968df | |||
| 83f87ba3ea | |||
| 7675a8effa | |||
| a1f16cabec | |||
| a7e05382ad | |||
| 604fc320cf | |||
| 3f3d8a95f5 | |||
| e1f3fe1be4 | |||
| 31fd2d1762 | |||
| 8de9436c36 | |||
| 52fac57d73 | |||
| 63e09bcbc2 | |||
| 660a30ce01 | |||
| e6624bf1c3 | |||
| d891ddba33 | |||
| 35fa65ec96 | |||
| 5342b67122 | |||
| c8d8df59b1 | |||
| f4b288fcf8 | |||
| 869e7870f5 | |||
| 9e551e0fdb | |||
| c6af697230 | |||
| e5f1f4df3d | |||
| 377595647d | |||
| a3209e1aee | |||
| 24e4e08be5 | |||
| 7bdecf9b38 | |||
| 60e0c447ca | |||
| 6b7190d3f0 | |||
| 4928624d14 | |||
| f16a26662d | |||
| e37cdf15cf | |||
| 577f208da7 | |||
| fa6046ea19 | |||
| ac4d466443 | |||
| 2dca1ffc39 | |||
| 1da5d33996 | |||
| be671259cb | |||
| 727a06689a | |||
| 9606fb144a | |||
| b74b3f3358 | |||
| 1802d94a1a | |||
| 810135fad4 | |||
| 095c823fda | |||
| 8c943d0ad7 | |||
| 53dcaccd4e | |||
| e5f1e298a6 | |||
| 183f8dfebe | |||
| 2f2e6e8f8c | |||
| 69c241ba89 | |||
| 167b78ed8e | |||
| 1a64c3f2dc | |||
| 237c74c212 | |||
| 4ef8c9707f | |||
| d2fead0f2a | |||
| 4d782e42ed | |||
| fbd6f9002c | |||
| 0e897b86c0 | |||
| 408d7a9ba8 | |||
| e242e4643b | |||
| 66e719f3f5 | |||
| d0bc467e6a | |||
| a649c3ca31 | |||
| 6a35ef38c7 | |||
| b1dc2cbf94 | |||
| 6a103493a1 | |||
| fe22e9730f | |||
| 5388520a20 | |||
| ce8ed2ade3 | |||
| 833c4aa860 | |||
| 5c5e62ffbd | |||
| 01032c952d | |||
| f942bf2729 | |||
| 381dcfe7e3 | |||
| 33344be035 | |||
| 45f059d3a9 | |||
| 7ff4e28599 | |||
| 0e8974a370 | |||
| 42c42fd064 | |||
| beb52c4e65 | |||
| 02578c4e6b | |||
| fe8be472a9 | |||
| bb6a66bd82 | |||
| 6763d3a6e4 | |||
| c30031f3d2 | |||
| 1324575b35 | |||
| 32b6d4af9c | |||
| dea9127ac2 | |||
| 0be4c51440 | |||
| d4d9b7aee1 | |||
| 1867c0d276 | |||
| df3648a864 | |||
| 980b8dbeda | |||
| ba9e43abc4 | |||
| 6ae327d1f7 | |||
| 2e2192f88a | |||
| 88be837f72 | |||
| f3d66aa674 | |||
| 35cc2879e5 | |||
| ab89c9af94 | |||
| 79a615f222 | |||
| 5ef5a8ec3c | |||
| 388ea0629c | |||
| e214567a64 | |||
| b0ba55316b | |||
| b3f77dcc35 | |||
| e9606a241a | |||
| efc9b712ae | |||
| 3690313065 | |||
| 60cdca01a8 | |||
| 37b1bdbe27 | |||
| fc9fe3ee00 | |||
| 04e9392e37 | |||
| 2688a2f501 | |||
| 704d3caf08 | |||
| c25595266b | |||
| fdcd605498 | |||
| fe959b8986 | |||
| 80a791021b | |||
| 4cb5de6848 | |||
| 87da750d56 | |||
| d1a02e8d35 | |||
| a3bf5421fe | |||
| 6117c31bcc | |||
| 0f858f99b7 | |||
| 2cb06c6f65 | |||
| 15a4976c97 | |||
| 287e741210 | |||
| d45abca952 | |||
| 8219102dbe | |||
| 645a83ad32 | |||
| 3702820f00 | |||
| 5fbdd4ac66 | |||
| 5ec2ea0e6c | |||
| feb9b58a7e | |||
| f07f047bbf | |||
| 2eb194776b | |||
| 23cc9ba32e | |||
| 173f19eff4 | |||
| dec030b34e | |||
| 1a06e50f0e | |||
| 9f907f5d1b | |||
| 641a3abc0a | |||
| c6740162bc | |||
| 1b8cd9b91c | |||
| d7dd512428 | |||
| e0b12695b1 | |||
| 28b92c478b | |||
| 72328ed0a1 | |||
| d71a12db05 | |||
| 670eaf04a6 | |||
| 22d77b784a | |||
| e9480e6a09 | |||
| ed29d8ef9a | |||
| bcff5d21ca | |||
| e8eef1dfcb | |||
| 610466284b | |||
| 301fcc2ab7 | |||
| d45a95bf3a | |||
| a583697e5a | |||
| abcb12caec | |||
| 173d197fe0 | |||
| d6ca807b71 | |||
| 621f7f49e0 | |||
| ec752fd076 | |||
| 499c685668 | |||
| f0770a7456 | |||
| 83d5217795 | |||
| cbdd18cef6 | |||
| a691fec1dd | |||
| 57fadb1663 | |||
| 380b4a7b62 | |||
| baf103ad0a | |||
| 4c3782ff96 | |||
| c3ccd0f72c | |||
| a615380027 | |||
| b5688aade5 | |||
| ada6ad5d89 | |||
| 45d343e975 | |||
| 27fbccaeab | |||
| 0a4a8191a2 | |||
| 7bba2ee9aa | |||
| c65dbe1db1 | |||
| e1aa844e95 | |||
| 55c63f414d | |||
| 94cc4b4e36 | |||
| 495308905c | |||
| 2ed8e5dd99 | |||
| 5033983c64 | |||
| f47cc169ae | |||
| c9f168d3a2 | |||
| aa7aa64724 | |||
| bf10bf33f6 | |||
| 094a4352f1 | |||
| 85d8d70411 | |||
| a5b6e5d48a | |||
| 44ad4d94c7 | |||
| a07b9cd0d4 | |||
| b5bf7d6b9d | |||
| 3185e09806 | |||
| b10f838687 | |||
| ba63d7af11 | |||
| 08dda60d00 | |||
| 2262e7d60f | |||
| 91d6e24f1e | |||
| 9770cca561 | |||
| 6315084f58 | |||
| d8e511f1dc | |||
| ebc6d37262 | |||
| 2814565850 | |||
| 65df5010f8 | |||
| cbe9c39a96 | |||
| f85d168ef0 | |||
| 281447780b | |||
| a643463733 | |||
| fa42bc451a | |||
| 0d22ca8eaf | |||
| cb92240458 | |||
| f480791472 | |||
| 5364a17c50 | |||
| 3644dcbcab | |||
| a5d7344f5a | |||
| 8cc3e62589 | |||
| b6a1fd85ea | |||
| 05279d2846 | |||
| 108149297f | |||
| 63f976e25a | |||
| a0a2a1012e | |||
| 7a53c17fde | |||
| c99f4921ca | |||
| cf76a92996 | |||
| ce52c4b024 | |||
| 3ea9f6245d | |||
| 65fe62d93b | |||
| bfdaa46feb | |||
| e002c9e66d | |||
| 36383135a8 | |||
| d78d747760 | |||
| a467612b9f | |||
| 5aea3220c8 | |||
| 7773ad03c1 | |||
| 1027801be6 | |||
| 372704f44b | |||
| 9a27d5845f | |||
| 6ed52e479b | |||
| ffcbb0b66c | |||
| bf151fe5e5 | |||
| e0ee8bb8ca | |||
| 0ba829de41 | |||
| 97aea8a4ed | |||
| 99731988d3 | |||
| db539008be | |||
| 8a3958ced5 | |||
| 3d551450a2 | |||
| f1a3276d37 | |||
| 7fc7bdc302 | |||
| f78a239167 | |||
| 5c1ab74329 | |||
| 86a1897eca | |||
| cbad63100a | |||
| 89cb247923 | |||
| 1e6a29eecf | |||
| 64a20a83cc | |||
| fa3d8c4824 | |||
| 6121e8dea4 | |||
| 81f216f9e3 | |||
| 3aa44e6b0c | |||
| d53cb8146e | |||
| 48b699071c | |||
| a760487ad2 | |||
| 160d88c883 | |||
| 5f26cd9d7c | |||
| 9cc45e6ff2 | |||
| e523638c75 | |||
| 009d0c03b4 | |||
| 905cd3b1d2 | |||
| e740a42075 | |||
| bf19e80de1 | |||
| 7691e22c59 | |||
| 7886675faa | |||
| 0b3f60a68c | |||
| edac98b7ee | |||
| c60c70eb7b | |||
| 0ba0f7a55d | |||
| feb8c0685e | |||
| fd14c1e3c3 | |||
| 5c2ed74292 | |||
| 87397a2512 | |||
| 061c67cbf8 | |||
| 53024a6140 | |||
| a9189fb052 | |||
| 7d0e892d36 | |||
| db345cb624 | |||
| 0aa944a1b7 | |||
| ab26271756 | |||
| 9beb7d21f3 | |||
| 3b463f2138 | |||
| cd2db00f22 | |||
| d5c074f80d | |||
| e55ba2d24d | |||
| c5b8b7c0a4 | |||
| 1e578c4f1a | |||
| 273131c088 | |||
| da83100728 | |||
| 1d05f9c66e | |||
| f46a6965d2 | |||
| 1747fb643f | |||
| 85fdc8c76b | |||
| 145fe4a364 | |||
| b6faaefaf8 | |||
| dd9e8c5bb1 | |||
| 0ea477b420 | |||
| 50d7793442 | |||
| 342198ea87 | |||
| e2369996e2 | |||
| 5e0f2ae418 | |||
| 3b139c9bb1 | |||
| 07b36e6bca | |||
| c2de4059c9 | |||
| b3bfdaafcf | |||
| ebbb68d978 | |||
| 715ae4e225 | |||
| 0135094133 | |||
| 17d7dd840e | |||
| 39a55cf951 | |||
| 7d96d0f0c8 | |||
| 1274967208 | |||
| 4e3856acc8 | |||
| ad2c4c23d0 | |||
| c2b66766b2 | |||
| e9e9a38865 | |||
| 9f4dc4616c | |||
| d989acaae8 | |||
| 9cca015108 | |||
| ed037c138e | |||
| 353b2df3d3 | |||
| bbfacbc883 | |||
| 83954da5cf | |||
| 86f0454414 | |||
| e9af05f911 | |||
| e0683f4db0 | |||
| 07ba938ff6 | |||
| 0f9d6c14ae | |||
| 24c234b80a | |||
| 1f4f94017a | |||
| 462ec49297 | |||
| e98347960d | |||
| 71b66ad25a | |||
| 026dc8678c | |||
| 7e6d816034 | |||
| 08b79eb4dd | |||
| 93ccc88f74 | |||
| d8088c5db0 | |||
| 51c7a8eecc | |||
| 632eaeadeb | |||
| 9aa3cfb4f9 | |||
| c2a31fe04b | |||
| 62ccb845bc | |||
| 5be2986146 | |||
| 3c0927650d | |||
| 3bbddc8675 | |||
| aac4205d1d | |||
| ff806af026 | |||
| 4f2291f420 | |||
| b55defa4f3 | |||
| 7913e608be | |||
| a1f82e443e | |||
| 94dd07297d | |||
| 474c114e66 | |||
| 38d90ab4c2 | |||
| 99ca18f541 | |||
| e6379ea636 | |||
| d3d01db9e2 | |||
| 4d85f0e40b | |||
| f7b8135ded | |||
| 7c359b7b30 | |||
| eca0e54bf3 | |||
| aad6ef004d | |||
| fca2e2671a | |||
| df660dc280 | |||
| 7b25d454b5 | |||
| 9c7b9ed2c0 | |||
| 65a610d1cb | |||
| 83d221e161 | |||
| 19fd2c3195 | |||
| 5fa85ad31b | |||
| d6920a07c3 | |||
| eb5ec62ccb | |||
| 0b0d258afd | |||
| bdc519743c | |||
| 5b750aabe3 | |||
| 73a716c82f | |||
| 823b5205bb | |||
| 6f39eed25e | |||
| 7760c6ac18 | |||
| db2f868bbe | |||
| dab7ef4262 | |||
| 45292eb9ee | |||
| cfba4a3d5c | |||
| 24c60199cc | |||
| 5ac4a6fa91 | |||
| 6d237ed63b | |||
| 4057de6346 | |||
| 61e1a5ca2f | |||
| f958dadb69 | |||
| 4f2992db54 | |||
| dd8027a839 | |||
| 43e0083c72 | |||
| 9a3211c343 | |||
| 2669aa6206 | |||
| e71787d37a | |||
| 472e6b777a | |||
| acf3b34711 | |||
| f7a2ffc457 | |||
| 1a8c643d50 | |||
| c850d622b7 | |||
| c66be818b9 | |||
| f26844e1bc | |||
| f46393efe7 | |||
| 33c9c02aeb | |||
| e305f079d0 | |||
| 97311dfd0a | |||
| 5949d79bed | |||
| 18346619ae | |||
| 7da3c663c6 | |||
| 3dcc557e65 | |||
| 0f7a13a8a8 | |||
| 4d4d292cf0 | |||
| be9920a132 | |||
| 36ac2e7032 | |||
| b7a9bf9505 | |||
| d65c96099e | |||
| 4901553a2d | |||
| dde207c360 | |||
| 7e261db1a2 | |||
| b876489b46 | |||
| dcad131357 | |||
| 580a4e15d1 | |||
| 4203a6f35b | |||
| 501fa80e4d | |||
| 118d2eb531 | |||
| 69a6970975 | |||
| ae6b934207 | |||
| aef7bbdf62 | |||
| 4d0af95caf | |||
| 71605e63ef | |||
| 4b5ae54e88 | |||
| c67b2bed45 | |||
| c0ee5fbae3 | |||
| a97992a537 | |||
| 1da0ec65c3 | |||
| 2e91633da9 | |||
| cf3e69de08 | |||
| 6d2877444c | |||
| 93b53f1662 | |||
| fd191b802e | |||
| 9e114a8b59 | |||
| cf22522290 | |||
| 98cd075a84 | |||
| 32624cbe94 | |||
| cf1c02271f | |||
| 3414ec8af1 | |||
| 7594bb6f31 | |||
| 047998de87 | |||
| d0dac0c658 | |||
| 7eb7be3936 | |||
| 1acf487040 | |||
| 9f4c54d33a | |||
| 2b2358e70b | |||
| 244054ff1f | |||
| fd802bad80 | |||
| a557cd4cc5 | |||
| c78f57a78a | |||
| d8af8693b4 | |||
| 8bc013140e | |||
| 76c238fc98 | |||
| b2080f945a | |||
| ea2a0d12c2 | |||
| ce3284624f | |||
| f3a1ef31db | |||
| 592e26fc41 | |||
| a25c4ac7da | |||
| fb7153d5fe | |||
| 9d2d92336e | |||
| 03d1d32e38 | |||
| 882db04b3c | |||
| 181262b39d | |||
| 39c3662da8 | |||
| 42913ca0cf | |||
| 6865e35fd9 | |||
| 80cf664ec8 | |||
| 3918d9fbe5 | |||
| 006bf802f4 | |||
| 9d0f4ba46e | |||
| 6111f55a89 | |||
| 19c840e1ab | |||
| aa6908b144 | |||
| 87c6af3547 | |||
| b7480210fd | |||
| 2e5175c7be | |||
| 45a2207f81 | |||
| 8b745b3751 | |||
| 559194edab | |||
| 898e0fb359 | |||
| e0f3bb00b8 | |||
| 3d6869bf68 | |||
| 7c5e8d58cb | |||
| b3e0e8272f | |||
| 6a6a2d5669 | |||
| 7c1c56a550 | |||
| 14a771bf05 | |||
| a5852dd8f2 | |||
| a029d90a98 | |||
| ad1210f4bb | |||
| bb1add4739 | |||
| 2362239edf | |||
| 8ebf64ac3f | |||
| 758f3ec77e | |||
| 2f5706262d | |||
| c8e241c9f3 | |||
| 13e2b24ddf | |||
| fe522bc66b | |||
| ed8eab273d | |||
| c9cfc369d6 | |||
| 3788670038 | |||
| 3268acf9a2 | |||
| 267f66539a | |||
| c159a8ddc2 | |||
| a839a13b59 | |||
| 78e9319587 | |||
| 1225a7ac06 | |||
| d37ac54c8e | |||
| 49b002beaf | |||
| eec2b56629 | |||
| 01d3b3ecad | |||
| d14e79eafa | |||
| 36ffb450f1 | |||
| dee8809454 | |||
| 58b41b9550 | |||
| ba21766096 | |||
| 4f4d747968 | |||
| 629a89218d | |||
| b0fbd60835 | |||
| 7848d08121 | |||
| 821cd696c5 | |||
| 53d323b5e0 | |||
| 081bc6b107 | |||
| 61a3997ef2 | |||
| 48027e1586 | |||
| 45af17e39c | |||
| bf0d8d68bb | |||
| 6944658bd4 | |||
| 74270c23d2 | |||
| 78ac00180f | |||
| 391cdf816d | |||
| 1e8e0877f3 | |||
| f74e016f30 | |||
| e90ed4bf65 | |||
| f3860faaef | |||
| 4af7d95a6d | |||
| e22431ea77 | |||
| c6989acd55 | |||
| ba394818a3 | |||
| dc20525edc | |||
| 7546a39b12 | |||
| be5e79601a | |||
| acd0f6a79e | |||
| dff58e5df3 | |||
| d3280a0b82 | |||
| 9d856fbd7a | |||
| 5e234486b2 | |||
| 5e001f3e15 | |||
| 062895c626 | |||
| c542a88e5e | |||
| 737fa891f8 | |||
| b1e67a7e0a | |||
| d10d18bd4d | |||
| 7847c6fcac | |||
| ea6e65f9f8 | |||
| 81cf730791 | |||
| 05a20ecc77 | |||
| 49c12c5e3d | |||
| 746bad9f18 | |||
| 3ef7d3ce3a | |||
| cb690eca62 | |||
| 0c55f927f5 | |||
| 52ad0bcc9d | |||
| cb0a48c849 | |||
| 8cb6ed7d6a | |||
| f02ba31d02 | |||
| 94a62e015c | |||
| 9bb0e7f75e | |||
| 0bb6dc4cf1 | |||
| d6bbc0ad0f | |||
| 8645d56acf | |||
| 25fd2adb03 | |||
| e8048a4968 | |||
| 39d6d68366 | |||
| 59bafd51c0 | |||
| 5d9954d3da | |||
| c3328d6b4e | |||
| 44a54e417c | |||
| 3d8d6eca5e | |||
| 899199daf5 | |||
| e5f805a773 | |||
| 38ca335a1f | |||
| 64950056b8 | |||
| d025f1e109 | |||
| a85c68aa65 | |||
| 9531c0b088 | |||
| 30e2ec315b | |||
| 3e20529210 | |||
| 919d47015a | |||
| 06d3926603 | |||
| d2469cac6e | |||
| 466d1a60b1 | |||
| 2d4d60d2ab | |||
| 85ac79aaf2 | |||
| caec2d98a0 | |||
| 71be79e09e | |||
| ff320f465f | |||
| 77f148350b | |||
| 0120942c46 | |||
| 212e2bf19c | |||
| e7d16c5f62 | |||
| fc8e2eed64 | |||
| 50ab6a3111 | |||
| cc3fee5f9c | |||
| 02be8e65ab | |||
| 13e7841b41 | |||
| e5adec94b7 | |||
| 9c0bcb7a7c | |||
| 7b1a4f1297 | |||
| c74a8392de | |||
| 6fe2923d52 | |||
| 8fa41edc04 | |||
| e3221376e1 | |||
| 15a6a463b3 | |||
| a3cd03ac03 | |||
| d58ccf7fd3 | |||
| e3c081be54 | |||
| 098e46f686 | |||
| 304e71e371 | |||
| cf979fa040 | |||
| 55bc72b7b4 | |||
| bba3543efe | |||
| 80b82dd955 | |||
| 3dcc189e8b | |||
| 6ab7a434ac | |||
| 068ba4793d | |||
| 042ded01e0 | |||
| fcf19ff8ec | |||
| 26cd01e346 | |||
| 8055b189be | |||
| 89b74a5231 | |||
| 15dbd1055a | |||
| 977411b4cc | |||
| b1ea3f70da | |||
| e82a780774 | |||
| c336f0757c | |||
| fe7c3cda44 | |||
| 6fecb87053 | |||
| abec1c4b1d | |||
| 67d8469069 | |||
| 1c90c3794d | |||
| e1dd86f0a9 | |||
| fc128d357d | |||
| 4fb15f2a1b | |||
| 60c8180079 | |||
| abd6e8c438 | |||
| 62da38339f | |||
| 726a514e3c | |||
| e7a3dc48e8 | |||
| 74ed253f51 | |||
| 9b6b171b04 | |||
| c16c27cd0e | |||
| 169b2e356e | |||
| 28abf3585b | |||
| ffdc7a45df | |||
| 499630034b | |||
| f76933eb87 | |||
| ddb20e7329 | |||
| 35632147ad | |||
| 2c21325353 | |||
| f33f573199 | |||
| 26d18db2d3 | |||
| b79cc695a1 | |||
| d5cf69b646 | |||
| d8488027d7 | |||
| 23dd479cb9 | |||
| 6116231e32 | |||
| 14740f9202 | |||
| 7c0a53596c | |||
| 50bcdaa90f | |||
| cf7f82c48a | |||
| f0951065c9 | |||
| cfc2a4d1f2 | |||
| ac0f3a650d | |||
| 554f4f5fc9 | |||
| da7d499595 | |||
| eda566e572 | |||
| 0b310174ee | |||
| 8c93b29737 | |||
| e416ec0dc3 | |||
| 861dc86093 | |||
| eff27994e5 | |||
| 5e48d2ec33 | |||
| 969b43bb64 | |||
| 00cdea7b74 | |||
| 9257e9471f | |||
| 337a36ceb8 | |||
| a0d8042bff | |||
| b4352a18d1 | |||
| 7554d2a8a8 | |||
| ad96714fe8 | |||
| 692e9e6b96 | |||
| 051ad564d1 | |||
| 4208b0840d | |||
| b6c2f8f822 | |||
| efd3a494d7 | |||
| 9abedaf0d2 | |||
| a36bf71632 | |||
| ee070344ee | |||
| 1f74c1d413 | |||
| 1d00b9f250 | |||
| 5467d0aec2 | |||
| bd594136a0 | |||
| 02e908ae18 | |||
| bfebdaeb16 | |||
| d28faee03a | |||
| b8ede9747a | |||
| 2e6c94fc8e | |||
| 52d5b8ab7f | |||
| ba2e003b92 | |||
| 9304f7a78a | |||
| 1908e852f0 | |||
| 9f4e7c4085 | |||
| 85994d17b8 | |||
| 409ee71087 | |||
| e380001762 | |||
| 167b094258 | |||
| e4ac34ecb0 | |||
| cddb6aa390 | |||
| b122cb5866 | |||
| 6725c540a6 | |||
| 1ad481b435 | |||
| 217103affb | |||
| 044c16d218 | |||
| f1f67b2298 | |||
| 60ac7e4cb8 | |||
| dc224265fa | |||
| 1d04ce9ea0 | |||
| d63348acf9 | |||
| 925b861fc0 | |||
| 5cc7f8b10c | |||
| 706d159339 | |||
| aac2b26c11 | |||
| e2650860cc | |||
| 29695a8ae7 | |||
| a80ccb9451 | |||
| 9fe3b0146a | |||
| e334ac3aed | |||
| 27cfcc5995 | |||
| 9b816905f1 | |||
| cf8ef4d9bc | |||
| dfb2335421 | |||
| 7a0c300aa3 | |||
| 039b632758 | |||
| fc12db7b26 | |||
| ad68cad1bf | |||
| dec1563c95 | |||
| d6392b751a | |||
| c5d0fd8d4b | |||
| 0f71211602 | |||
| e3a7a7955e | |||
| a4d1dbe5f0 | |||
| 716130c39e | |||
| 9aa5f7b3a5 | |||
| f295ac470a | |||
| 48d67aa4cd | |||
| 41852c4c50 | |||
| a7f96cb838 | |||
| 57b65cf405 | |||
| 177e0d2665 | |||
| b51155e289 | |||
| 6ece75789b | |||
| c133457da5 | |||
| 52957ffcb5 | |||
| 70d86ce907 | |||
| 7ca6bb4072 | |||
| b7be7aec13 | |||
| 5a78a6ab79 | |||
| 4909d628f5 | |||
| b68ae65f56 | |||
| f53a691bba | |||
| 48bf07e622 | |||
| 967eead27a | |||
| 72a260cc6e | |||
| 24a3b27150 | |||
| f19d4c44df | |||
| d86b0e8f76 | |||
| 33fed6a630 | |||
| f411000a0f | |||
| b2262058c8 | |||
| b4d99aa570 | |||
| 2b89aab8f3 | |||
| 30b5311aa4 | |||
| 0b47413fe1 | |||
| 3998bd7f98 | |||
| c5246875b1 | |||
| aa5b388f4a | |||
| 36dd6946a9 | |||
| e4768c1c75 | |||
| 4b00fe91ab | |||
| 232623d372 | |||
| 5dc75b73bf | |||
| 9a0c58986f | |||
| cbb4c52310 | |||
| 014bb5b519 | |||
| 5826a6ccb3 | |||
| cab8111292 | |||
| 145452120c | |||
| eecb6f3536 | |||
| f439208282 | |||
| a2ef7f244d | |||
| d248e8f914 | |||
| 4a802befbb | |||
| 94851bc14f | |||
| 56c29e27f7 | |||
| 01ba165d9a | |||
| e9594501dd | |||
| ee28daa669 | |||
| 6fea753584 | |||
| 0ef3a052c3 | |||
| cff628737b | |||
| cc446b1c5a | |||
| fa5b160887 | |||
| 309373c404 | |||
| 98ed315b2d | |||
| ae033fc046 | |||
| 96998d390a | |||
| 6a93d1392d | |||
| c94c203843 | |||
| 9b1fc9e705 | |||
| f8d3210730 | |||
| e786cfbc90 | |||
| 1059ff14fc | |||
| 202b51171c | |||
| 8c38e25377 | |||
| 8257751ef7 | |||
| 29c8e82dae | |||
| 12050b4c7d | |||
| 89df605c3b | |||
| 0894d5bdae | |||
| 10786c65b8 | |||
| 8e8ecdd36f | |||
| 705c339f21 | |||
| de1bdefc7c | |||
| 2b172a9f41 | |||
| 7b39e233e3 | |||
| 28fe9b481d | |||
| 90ccc1cee4 | |||
| e891ec1ba2 | |||
| e4cf5fab49 | |||
| e544a66086 | |||
| f85352d93d | |||
| d29f3fa276 | |||
| 8cd0939fff | |||
| cee4fc688f | |||
| 9ce1020d84 | |||
| ee7beea983 | |||
| 60062892a6 | |||
| b33be62bb6 | |||
| a8507628fa | |||
| 43a4a5938c | |||
| 0ce3d46e92 | |||
| 037ec5be78 | |||
| b25d2cd54d | |||
| 14b15ac095 | |||
| b936514937 | |||
| 4a3de89af0 | |||
| 310a684251 | |||
| 4d5646fa5d | |||
| 67800ec8c4 | |||
| cea2e62f57 | |||
| ddfbe349cf | |||
| 897f8b78b8 | |||
| 31a6fece52 | |||
| d7cbdf6a31 | |||
| a8328ec092 | |||
| fb2b1a6ec0 | |||
| 8259ec6764 | |||
| b052c21b16 | |||
| 3f0fc98d72 | |||
| ddc22a4101 | |||
| 722a40dd41 | |||
| 3474419925 | |||
| 4f589f6d60 | |||
| bee11897a1 | |||
| 4d1ebeccfa | |||
| 61cbad8a12 | |||
| 98700edbca | |||
| f7625481a2 | |||
| 2206e1cd7f | |||
| d3d7387da2 | |||
| ee59f1263c | |||
| 433efbc115 | |||
| cda9bf9ed5 | |||
| ec91085765 | |||
| 1dad42c2f6 | |||
| bd105711d4 | |||
| b9a512361d | |||
| 7d09444dd9 | |||
| bd1fc886fe | |||
| 2991bbf033 | |||
| e5c3a09502 | |||
| 848f9c4d46 | |||
| 8db1280a4d | |||
| bb05d17596 | |||
| 300e176eb3 | |||
| 32367b1744 | |||
| 739e643f2f | |||
| b9797ec92a | |||
| 6dfc395a06 | |||
| 470b9ff756 | |||
| cbfdfd5c2e | |||
| 5652ca2c61 | |||
| fa1d43345a | |||
| 75fbb93180 | |||
| 4f31fc44e6 | |||
| 04b6024e64 | |||
| c618962cd0 | |||
| 84e2b9ebbf | |||
| 40d35f23e4 | |||
| fb9f43667d | |||
| 5a2940fb82 | |||
| b553d9895d | |||
| c7ab1fd98b | |||
| bab3ec689a | |||
| b28680f3d8 | |||
| 7dc59751cc | |||
| 2a569497b9 | |||
| 29f827a575 | |||
| a7012575d4 | |||
| 60cd098ae9 | |||
| 2d1b79cbb0 | |||
| 7d771c7a36 | |||
| 163d206513 | |||
| 898d27e8d8 | |||
| 718982cdcf | |||
| c135ca40a5 | |||
| 694c409caf | |||
| b9865ed4f1 | |||
| d3281a66eb | |||
| 337a84328d | |||
| 9f5283d001 | |||
| 043dc1616d | |||
| 8cee8992ab | |||
| 140272b9d3 | |||
| 216a747978 | |||
| ac84b8171e | |||
| 83988ca831 | |||
| 9fb882b103 | |||
| 3274f42bb0 | |||
| e81c4cf62a | |||
| 7189c727bc | |||
| 29b2c9ab6c | |||
| 47c0859c1b | |||
| 185735ca2c | |||
| 4d776eb03f | |||
| 731b2567b3 | |||
| 9da3580b3d | |||
| 5ef9039f5e | |||
| 470880ebed | |||
| 7f0c5b5f23 | |||
| df4c99f157 | |||
| 1f1660a860 | |||
| 98ab26ce12 | |||
| b4ee6b9be6 | |||
| e0f3ab2473 | |||
| 4d9af51470 | |||
| 1f93879a0c | |||
| cbee95494e | |||
| c05baee29a | |||
| 6d84d419c2 | |||
| 99348d3a5b | |||
| ec898944af | |||
| 9bceab911b | |||
| 79ae0091ad | |||
| 2b9da837d7 | |||
| 7446930f69 | |||
| 53320b260e | |||
| 82e41125da | |||
| 224b3ec7d7 | |||
| 003199d6df | |||
| 32c96b4267 | |||
| 8cfc4b66be | |||
| 25b501e215 | |||
| 0ba28a5ba6 | |||
| 89d795ff90 | |||
| b516e35b19 | |||
| 7bf1bcdec3 | |||
| d52ad7e4bf | |||
| 2f681ab928 | |||
| cff386e210 | |||
| 685865ce31 | |||
| 6f89398b07 | |||
| b195afc8ca | |||
| 3c10cd1af2 | |||
| bd94486c7e | |||
| c515004611 | |||
| 9972dfbec9 | |||
| f1b21bf01d | |||
| 98e9dd08ac | |||
| 6b792952c3 | |||
| b4e3fcb428 | |||
| 23b1ed5c79 | |||
| 7f9aa7b4a5 | |||
| 3665b77827 | |||
| 4da63d1d03 | |||
| 220afa90db | |||
| bfad821cf2 | |||
| 134acba916 | |||
| 568f2634fe | |||
| 39035fc252 | |||
| 1fa67d08d8 | |||
| 16f813281c | |||
| fa550f0957 | |||
| 989a5fa933 | |||
| 91b2506ccc | |||
| 9cb63295e9 | |||
| 9253572afe | |||
| a811a3bf03 | |||
| 60b555d64b | |||
| 3dfc22231e | |||
| ada32f936a | |||
| 60e63e12d6 | |||
| 26b424e776 | |||
| a90fd14fe7 | |||
| da2c497671 | |||
| 0d9dc9414d | |||
| e461f65552 | |||
| 49dfb24267 | |||
| 890f1f10c3 | |||
| 0603c3fb61 | |||
| 3f8350157a | |||
| 993a8a8583 | |||
| 979d1299cc | |||
| 9426a77690 | |||
| d0e43137ce | |||
| d38863538c | |||
| 2aff34eab8 | |||
| 4daf44b925 | |||
| 3a4e93bb3d | |||
| 9846e52ed9 | |||
| 86a7ed44e0 | |||
| e19e7336cd | |||
| 1ed0ec974a | |||
| 650f3282d5 | |||
| 3807cbdb23 | |||
| 27bace846e | |||
| 35b1b5bb04 | |||
| 927fca0ece | |||
| 9583ce4c70 | |||
| d795eb2b7d | |||
| 0e01764f0b | |||
| 97d551b551 | |||
| 6ea93a4a04 | |||
| 6a16910ba5 | |||
| ee43612125 | |||
| 3eb8f21116 | |||
| 359e9a5d78 | |||
| fbc6ed5c77 | |||
| bade81ddcf | |||
| 32bcbda232 | |||
| cac09437c8 | |||
| 13fa571c41 | |||
| f7eb1ef924 | |||
| cb16fec6bb | |||
| 1a12d109e9 | |||
| 023de9b0f8 | |||
| 4fcbff9d34 | |||
| 2d6e82fb2c | |||
| d2176be234 | |||
| a8634f09fc | |||
| c3dfc7e30c | |||
| cf652c8410 | |||
| de2f8a26b2 | |||
| bbbefaf188 | |||
| cd9488daf7 | |||
| 95f0decaa5 | |||
| cd0ae20ef5 | |||
| efb08237ac | |||
| 4326c9657e | |||
| 80941aa0e0 | |||
| 774dac17ac | |||
| b714b8f4ad | |||
| a48d05e2bf | |||
| 75ce52f6b8 | |||
| 09c7179389 | |||
| 5aa4679847 | |||
| f5cd28fc53 | |||
| 4b992c27bb | |||
| 554d8f4078 | |||
| 6a18530a8d | |||
| c3656ad646 | |||
| f70d5be2b7 | |||
| daa024cc79 | |||
| fdb782c5c7 | |||
| 729c1b4a73 | |||
| 285ad9dbfa | |||
| 84a88c4d2f | |||
| d2c7366f9a | |||
| 8ec1bab139 | |||
| a801fb20b8 | |||
| 99fc24ea07 | |||
| 84a65a53ef | |||
| 04cb2d4411 | |||
| a7a1edbc64 | |||
| d13179b63f | |||
| 27dc80c846 | |||
| 1e745a6a6f | |||
| 70550739b6 | |||
| 60707fc256 | |||
| 15d7369de8 | |||
| 5e3dc0c2c9 | |||
| 53eb0dd758 | |||
| 0b44729bbe | |||
| 6d1cb3c97a | |||
| 0c82efe57a | |||
| 62c0a19071 | |||
| c733370cee | |||
| 617088284c | |||
| f64678a7ee | |||
| 4dee0663c3 | |||
| 9d10f3e026 | |||
| 790714712a | |||
| ab8d8a04ad | |||
| c79662e35b | |||
| 51cff8f0c3 | |||
| 73808aa15d | |||
| 4dc09efd0d | |||
| aec3ab60cb | |||
| d5f80ff61c | |||
| 4f6a50ac27 | |||
| 7fd2157ab0 | |||
| 13bf1a9cf5 | |||
| f395f38d09 | |||
| 95a7083267 | |||
| 192dca36c5 | |||
| 8c222a8c51 | |||
| 2bc0826c77 | |||
| 76c0f55ebe | |||
| b4ea012edc | |||
| cfbcd3a6f3 | |||
| 617bd8c859 | |||
| e7441149f0 | |||
| 92a65a8b5b | |||
| bc442592d2 | |||
| f808f03302 | |||
| 7d8fb99cea | |||
| d380187ef3 | |||
| b85c4430bd | |||
| 2475be5fa1 | |||
| 9196591803 | |||
| 8da4f1dd1d | |||
| 059bbdc496 | |||
| 5ae28eb038 | |||
| 686f2adc58 | |||
| d71d8943cb | |||
| d371cff4f2 | |||
| b5c08388b8 | |||
| 35f506d369 | |||
| 4c813656ea | |||
| 2a3409b4a6 | |||
| facb110329 | |||
| 6ca8a12525 | |||
| bb1a41f15e | |||
| c9c28a8690 | |||
| dc35235863 | |||
| 1d766e9677 | |||
| 5674ca802e | |||
| 93b24a1ab7 | |||
| 505b4ba8d3 | |||
| 7a71e14a78 | |||
| 337881348c | |||
| b88706bcd4 | |||
| f3d82fd9fa | |||
| 1d0d6dfe07 | |||
| 5f4f6047e3 | |||
| b9676cf7ee | |||
| 461e506c41 | |||
| 1de29d0ffa | |||
| 8d4510fd29 | |||
| 2515a69626 | |||
| ae7a53f4c1 | |||
| 4cf84fe9d2 | |||
| b81482d597 | |||
| 7d98705396 | |||
| 953ff71e99 | |||
| cc7fa5b28c | |||
| 3ef54f66bb | |||
| 32ebdf8e6f | |||
| e80fc80be3 | |||
| 89b609ea8d | |||
| 0bfe92e83e | |||
| 632a554802 | |||
| 14c36da81d | |||
| 472b4943ce | |||
| a9b28e541b | |||
| f5ad8ca415 | |||
| ddac5eed60 | |||
| 51f0e99d7b | |||
| d95003e92c | |||
| 7c517e7620 | |||
| 4319548f08 | |||
| b5475db2de | |||
| 2bbbeaafd2 | |||
| b045896ce2 | |||
| 6bd0501e53 | |||
| cad1db484b | |||
| 6d4bd04c9b | |||
| 56fad0cceb | |||
| 98a32d7982 | |||
| a6bb9a5e80 | |||
| afd2f27bdc | |||
| 0d5aee2f62 | |||
| 797a6f1ddb | |||
| f52401715d | |||
| e742d473a6 | |||
| 15bcb20d44 | |||
| 34f1450cbd | |||
| dff298c5b0 | |||
| de636242b3 | |||
| fcefdc0a8d | |||
| 519d93fa4f | |||
| c2bedaeb96 | |||
| 18c63c1ee4 | |||
| 9e9cbfb1a7 | |||
| 36249a64ce | |||
| 1b58ec8bb7 | |||
| 74e397c869 | |||
| bb9f43746f | |||
| 40cd060c5b | |||
| 0b1da87302 | |||
| 6b3d7b17a7 | |||
| 3241b1ece1 | |||
| 62c6a61b8b | |||
| ea0cc96c15 | |||
| 945638c405 | |||
| e6621ea78c | |||
| 3a00aa5918 | |||
| 9b476e140d | |||
| 44ae0d7ae7 | |||
| 2ce0fac098 | |||
| 5273c47c1b | |||
| 4d2e81796d | |||
| a369791665 | |||
| a5619f3bb6 | |||
| f7644fc9f3 | |||
| b52ab25322 | |||
| 18f0ec61eb | |||
| 2f25170763 | |||
| 7bd6dccac7 | |||
| 66de19b162 | |||
| d6d9264f25 | |||
| b3970f63ba | |||
| af793f16b0 | |||
| 82a4eb0cec | |||
| 18a770f616 | |||
| ce5ce0f933 | |||
| 5fc3370235 | |||
| 1eb76ba48c | |||
| 5b3d50afc4 | |||
| df04df01f7 | |||
| 7b37841fdc | |||
| 997001bbd9 | |||
| b738537452 | |||
| 61db2cb15e | |||
| 83bef31698 | |||
| bf97878f37 | |||
| 36241de2c6 | |||
| 3299e0c377 | |||
| f71f962f54 | |||
| cc281d482e | |||
| 1470a32533 | |||
| bf1accec06 | |||
| f6bf3f3055 | |||
| c87c15946c | |||
| 9a7151863c | |||
| 3d94464ba4 | |||
| e850604cdf | |||
| 52c453bdba | |||
| ff742beb97 | |||
| b45190fb4d | |||
| 7f9e50a22b | |||
| 4c4e76aa2b | |||
| 3187141dfe | |||
| e0956f67f3 | |||
| 2abdcf3b57 | |||
| 5816bf1871 | |||
| 81ff338236 | |||
| d250dc0425 | |||
| c8436a94d6 | |||
| 99d07fbd9a | |||
| 28b0a8bb77 | |||
| 67714c5025 | |||
| f83520b2cc | |||
| 3f4e55a474 | |||
| 6c32edfb8c | |||
| e404490651 | |||
| 6b01685808 | |||
| 0c93e0bcd5 | |||
| 9687c66a25 | |||
| 834c0a642d | |||
| 2b53da4eee | |||
| d826ad5b51 | |||
| de7c8fcbbf | |||
| 28a142d94e | |||
| 48c25da133 | |||
| cd0b369425 | |||
| 0765dc1aae | |||
| e239c65ba1 | |||
| c7440ef92e | |||
| eaa5b15291 | |||
| 882ecd3ce3 | |||
| 38fffd8218 | |||
| fed516d582 | |||
| 1a1927b8d5 | |||
| 89cbdb35b6 | |||
| 864e0bcccb | |||
| cac47d2548 | |||
| 214169616d | |||
| 3a69c926b5 | |||
| 2e7b4602a9 | |||
| c61c12d834 | |||
| 165261e358 | |||
| c3c27817b6 | |||
| 2a54fba098 | |||
| ffaa0c8249 | |||
| 1fc88ebe24 | |||
| 82e24d830e | |||
| 8f68b14627 | |||
| efb08cd11c | |||
| 7f442c5a3f | |||
| 22bcb40484 | |||
| cb2d70b4f0 | |||
| 86f0df4f3c | |||
| f3592c1216 | |||
| 516b0d3c56 | |||
| 6030da1182 | |||
| bae32f74bb | |||
| 796c9d79d4 | |||
| 02df1acb5f | |||
| 480d23f8e1 | |||
| 93c836fdcf | |||
| 65310f00ab | |||
| 4caa464ebb | |||
| ed6af74a78 | |||
| 9680f13854 | |||
| 16c740a6f9 | |||
| bc920f9a24 | |||
| 18624df555 | |||
| 4379846dfa | |||
| cd25a34171 | |||
| 72abf54d12 | |||
| 0ea718177d | |||
| 074d5d7f11 | |||
| 8b4492ebc5 | |||
| 238becaebb | |||
| 788fadf4a8 | |||
| ec5f3b2b98 | |||
| 61bd2d41ac | |||
| d1acd124cc | |||
| da5270131c | |||
| eb7a3c763c | |||
| 4b0bd78814 | |||
| 339717c96f | |||
| a21265f9b6 | |||
| 0e92e6356f | |||
| 280019ddf9 | |||
| f99fd100e6 | |||
| 1749ff2d5d | |||
| d0cfe4b010 | |||
| d0d98b8775 | |||
| e864bb8d92 | |||
| efc21a5a63 | |||
| 9d5d05a708 | |||
| 12e4d59458 | |||
| edbbcfb790 | |||
| 40f8bb4143 | |||
| 5040a97b0b | |||
| 4a7419c064 | |||
| 615d037de0 | |||
| 4f5534a87a | |||
| 54317becbf | |||
| 3a7772d0f7 | |||
| 793a5b79f1 | |||
| 5853eabc62 | |||
| 6de28c158d | |||
| f5146b8d43 | |||
| 9766893be1 | |||
| f29b003810 | |||
| ca47eeaeff | |||
| 6df5809c33 | |||
| da83e47241 | |||
| 157399e395 | |||
| beedcc06fe | |||
| 895510e08d | |||
| 48113f3bca | |||
| 418cefd7ee | |||
| 37fbcb64a6 | |||
| 5ced7e5cbe | |||
| c3808cd991 | |||
| cf1a77a44d | |||
| c91018946c | |||
| 0fec404c6d | |||
| 1808fd83ed | |||
| 4e94c02dda | |||
| 8195ce579b | |||
| aed303f4ff | |||
| 70318d7820 | |||
| 749e772d85 | |||
| 97a6333f87 | |||
| 302dbbf0be | |||
| dc7da86261 | |||
| 6a13a51b90 | |||
| 74234e7000 | |||
| 597c9b856b | |||
| 9c6ee0ac63 | |||
| f5863b6d9b | |||
| 05cb44bfb0 | |||
| 39b407fdba | |||
| cd5cc689dc | |||
| b27e512828 | |||
| 657041d6b1 | |||
| f7be7d1e30 | |||
| dfa96bd3fe | |||
| 63360966f9 | |||
| 3a52249400 | |||
| f867db6f71 | |||
| 5c79b2f762 | |||
| 071829dbc9 | |||
| 2e14552a50 | |||
| a12f700aa2 | |||
| 351e7aae6f | |||
| eef340f19c | |||
| 3b1873f1dc | |||
| ca356c308e | |||
| 0bd3801314 | |||
| a1c3b942aa | |||
| 4dfc96e102 | |||
| 8685e94b76 | |||
| 75fa12964e | |||
| 765b720c48 | |||
| d5ec887526 | |||
| 1c803df7d4 | |||
| 3231a0c92a | |||
| ba5a8fe87c | |||
| f7c9566f1e | |||
| ad180fb2c3 | |||
| bc85670ce9 | |||
| 5676c632f6 | |||
| 24b71377e1 | |||
| cd4952dee4 | |||
| e13a8cf304 | |||
| 3c629f095d | |||
| 81bd2cf34a | |||
| a2bdc366f0 | |||
| b5ff8cdc82 | |||
| b882109cb1 | |||
| 7843225fad | |||
| c5903523ea | |||
| bb3be15ff5 | |||
| 1099b23587 | |||
| a4441f2a41 | |||
| f20519d352 | |||
| ef610c8c96 | |||
| 27863408c9 | |||
| 562ecea9cf | |||
| dbfedbdeae | |||
| d5ae1988b8 | |||
| aa142250e0 | |||
| 4ae424b44a | |||
| be70bad701 | |||
| e75fd5e69a | |||
| afef89a8ef | |||
| 4c383527f8 | |||
| b507505a47 | |||
| b7e7f1f40a | |||
| 4729cafdcc | |||
| 691b1af944 | |||
| 9431d301d3 | |||
| 994fbd072a | |||
| f8eb61fdf8 | |||
| 854b4be506 | |||
| 00a124cea1 | |||
| a6436f7d12 | |||
| 78671cb27e | |||
| 4fe99f2658 | |||
| 0950e1963a | |||
| cb2002d188 | |||
| 25da93e2ea | |||
| 96e77ab5bf | |||
| 84d579186c | |||
| a6fad36ab6 | |||
| c7c5171233 | |||
| 29044021cd | |||
| bcec2d45ad | |||
| d4f3cb7277 | |||
| 31cecf79a1 | |||
| 1f1acad4f8 | |||
| 45604b3874 | |||
| fbdfeef2a3 | |||
| 814c144ecb | |||
| 9e89f2ff9a | |||
| cd6088332f | |||
| 6ab70bece6 | |||
| 48efcc449b | |||
| be43c7f5c0 | |||
| 3395d4ea02 | |||
| 0e670396fa | |||
| 72a0c490ac | |||
| 2dd871389e | |||
| 4efaacc5b3 | |||
| f840f89922 | |||
| 6c7911a602 | |||
| dd78ad7e72 | |||
| 24e310ec57 | |||
| 00438fffd2 | |||
| 7b1135a3e9 | |||
| a9ecbdc802 | |||
| 54220d5040 | |||
| 13070cbe23 | |||
| 477b3ce3f2 | |||
| 6cd9220079 | |||
| 74c912f169 | |||
| 894e66056e | |||
| f6c25f94de | |||
| 58b54aa729 | |||
| b35d28a941 | |||
| 24797fb65e | |||
| 605e8cd72c | |||
| beb6cecf59 | |||
| dec69a8769 | |||
| 0b7c02850e | |||
| 5bf115ddba | |||
| 39fd6d9217 | |||
| 27e43f6939 | |||
| d7ae64fb45 | |||
| a99a897ae8 | |||
| dd2b39ddd6 | |||
| d8f63bcfd1 | |||
| 6b6070281e | |||
| 11239b034c | |||
| 1811795e41 | |||
| f5874a74e4 | |||
| 30a69a5797 | |||
| ab26d7fd50 | |||
| 7036d46bf2 | |||
| 5e48d624e4 | |||
| ed8267643b | |||
| b61bb54b78 | |||
| c9a54019aa | |||
| 9f7728573d | |||
| bdfe2bafda | |||
| cd4e71eadd | |||
| 294939f471 | |||
| d6b2ae8096 | |||
| 42bc0b57f8 | |||
| af4ad9059a | |||
| c6d1052f1f | |||
| efcfd10a56 | |||
| 79caef00cb | |||
| 8d46ebc405 | |||
| 56ef3b56ec | |||
| badfa3ad17 | |||
| d449cab279 | |||
| 69b213b7e5 | |||
| c84ce15054 | |||
| 02f938ebdf | |||
| baf0dc0524 | |||
| 74c9a3dc4e | |||
| 070198ecf2 | |||
| f1b75dbe29 | |||
| 67c4dcdf70 | |||
| 2a3edfcd84 | |||
| c692d6e136 | |||
| 9967bbe297 | |||
| 4db69850fb | |||
| ec96217335 | |||
| 7ec585ec18 | |||
| a4429c9ea8 | |||
| 6ba642a3cc | |||
| e6d7b7e586 | |||
| 249c2641e0 | |||
| f3b33f52e6 | |||
| 31a263ed89 | |||
| bf1ffb612f | |||
| dd3c7f1bfb | |||
| 129cc88b0b | |||
| c5850e510a | |||
| 1e026ac477 | |||
| 4f36439028 | |||
| f96f319986 | |||
| 9b2f2b15bc | |||
| d548490a2b | |||
| f482dc2383 | |||
| 957f723782 | |||
| 13b8d323b2 | |||
| bf32404975 | |||
| f460cec308 | |||
| bf2266aee3 | |||
| f4f7759bba | |||
| 02b84611b2 | |||
| 197aa0c85c | |||
| bab894b775 | |||
| 01480a174a | |||
| 01768b70e7 | |||
| 9dfb87d227 | |||
| 225fce9604 | |||
| 4d630dbc32 | |||
| bba2dd581b | |||
| f12a26b5fb | |||
| 3e82f69ca5 | |||
| 017e0f38d1 | |||
| 59e45e0ae9 | |||
| 943ded5774 | |||
| 987dddfc78 | |||
| 4b56d3d406 | |||
| 35c5de0782 | |||
| 25c18729e1 | |||
| 2d90d39cc3 | |||
| d3c7270031 | |||
| ac5fe442dc | |||
| b6ea746fa2 | |||
| 3066e6b3d0 | |||
| 6437beaec1 | |||
| 76aa89b536 | |||
| 2acfadfeef | |||
| 663771f0a4 | |||
| 6750127a05 | |||
| f068e723ea | |||
| 38ca5341a6 | |||
| 0c1fb8e4d8 | |||
| 84467808a4 | |||
| 9eb6cf7480 | |||
| abefd40bb7 | |||
| 1d5b4709fe | |||
| 32a51db481 | |||
| 956e5f0da0 | |||
| 5040266320 | |||
| 9205db4b77 | |||
| 75fcae04b9 | |||
| c091b87459 | |||
| 8113463e1e | |||
| 343225dcc2 | |||
| 97f5f76433 | |||
| 7cb4df59f7 | |||
| 9a9f7e64a5 | |||
| f7fd04aa2b | |||
| 0039ea9e72 | |||
| 54ae984650 | |||
| b7bb4346da | |||
| bf179d9f78 | |||
| 7ddd9d2ce0 | |||
| f6638d49ce | |||
| 0e91902e74 | |||
| 2dc1890fd2 | |||
| 1c79de55ed | |||
| 618192fca5 | |||
| f53fd0fe90 | |||
| 0c0365bb49 | |||
| d9b6007722 | |||
| a7c346606f | |||
| 3e1e5974f0 | |||
| 8991b9e04b | |||
| 6685ae0142 | |||
| 52db9a6cff | |||
| 708f6665e6 | |||
| 2a5659c36b | |||
| 8476bab7dc | |||
| 5c079f8da7 | |||
| 00daa1cbd2 | |||
| 4e54841a75 | |||
| c62319d2d9 | |||
| 9ea9980b2c | |||
| 56b15fb690 | |||
| 08be917054 | |||
| 64b83139c7 | |||
| 1c79112f6e | |||
| b3cbf2b3da | |||
| 0c32b1b0ec | |||
| 7a096acccd | |||
| 1f47d2cac0 | |||
| e18796efc5 | |||
| 4024f46677 | |||
| 6a6a3d3bd0 | |||
| c774316642 | |||
| 9731fc4e4d | |||
| 03e5bb55a4 | |||
| 6c3e3b740b | |||
| 72b73d8208 | |||
| be1240a977 | |||
| 3a7f48c632 | |||
| ab2f1c5d1d | |||
| 8489a014d1 | |||
| 54bb4e297e | |||
| aec082639f | |||
| 65396bc95b | |||
| 18aad09d0d | |||
| 56bf10afef | |||
| 8de8b991a5 | |||
| 135cfbd80f | |||
| 157a1d8e77 | |||
| 5a1249dc3b | |||
| 6bfd683dcf | |||
| 1ff82e48c6 | |||
| 0f9bcc2f84 | |||
| 7b01cd6832 | |||
| 7030aa7482 | |||
| 835228ef34 | |||
| 40e8f5b020 | |||
| 3b46c4e94a | |||
| 1af11d9db7 | |||
| b149ba0288 | |||
| fbbc9e21a9 | |||
| 5d0bc520b9 | |||
| 892b7ae509 | |||
| 694b0339fd | |||
| 8ba5f73c1a | |||
| 963b993abc | |||
| 176f3e6057 | |||
| 960be3c809 | |||
| 79de781304 | |||
| 1d1e71b52f | |||
| d3af1ea85a | |||
| 453eb18abb | |||
| d13c279d5a | |||
| b36c34b105 | |||
| 32688a636b | |||
| c519989ec0 | |||
| ccfaa56b31 | |||
| ebb1ca3b36 | |||
| 75070b1810 | |||
| 6c42e558e2 | |||
| bc9b8bcf19 | |||
| 5b27b3194e | |||
| 8e0110a18e | |||
| 4f5747ebef | |||
| 7085e1ec0c | |||
| 7f0ca58154 | |||
| c0d15db47c | |||
| 77ef990fa7 | |||
| 862e65df6c | |||
| 1d4de73415 | |||
| 9ce46db813 | |||
| bbb3e3f459 | |||
| ae584e8ec8 | |||
| 018854360d | |||
| 90b5d64831 | |||
| 30098b62e3 | |||
| ff774748cd | |||
| f84a150bfd | |||
| a15ea4ca18 | |||
| e4c2421350 | |||
| dadc87eff8 | |||
| 995de944c8 | |||
| 88ef0b58d9 | |||
| 18e4fdf5c2 | |||
| bf7bc3532e | |||
| 89d0a7a176 | |||
| 3e6eb430fa | |||
| 94c26629c0 | |||
| 5d9b7a4e03 | |||
| 30e4eae4aa | |||
| f3cd3e4ce8 | |||
| 436749f864 | |||
| b4b0ed5c44 | |||
| f6d50e6f33 | |||
| 70a1124a1d | |||
| eba335c615 | |||
| 5ff38ba7d5 | |||
| 0a4b08fcb6 | |||
| 1719f4269a | |||
| d67d9603c2 | |||
| f87fbe7e2a | |||
| db13fbb7b3 | |||
| 6a2a20f64b | |||
| 05bc4d13e1 | |||
| 5057f28a49 | |||
| 103ee9943d | |||
| 6fb4a7d6f4 | |||
| df074d117e | |||
| 77f6684dfe | |||
| 2afea6c661 | |||
| de4fbb94ef | |||
| a6206196f6 | |||
| bd28c52fca | |||
| 2de5c0f59c | |||
| 089174c297 | |||
| 1846087723 | |||
| 16c1dbd25d | |||
| 01b491b16e | |||
| 565a875365 | |||
| 89117e2c6d | |||
| 77fe619fa9 | |||
| a53f6818b4 | |||
| ec27cbc1c6 | |||
| d693051f14 | |||
| e0ed154996 | |||
| 0ed9b18367 | |||
| 47b88e47fb | |||
| ea640ea104 | |||
| 41539d672b | |||
| ff667115e1 |
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"phabricator.uri" : "http://pha.geofinder.eu/"
|
||||
}
|
||||
@@ -27,3 +27,6 @@ install_manifest.txt
|
||||
/Mod/
|
||||
/ZERO_CHECK.dir/
|
||||
/build/
|
||||
/src/Tools/offlinedoc/localwiki/
|
||||
/src/Tools/offlinedoc/todolist.txt
|
||||
/src/Tools/offlinedoc/wikifiles.txt
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
Wrn:
|
||||
Err:
|
||||
Cannot find icon:
|
||||
Executable
+166
@@ -0,0 +1,166 @@
|
||||
####
|
||||
# Travis-CI configuration file for FreeCAD.
|
||||
#
|
||||
# This build configuration will build and test FreeCAD on both Linux
|
||||
# and Mac OS X. For Mac OS X, this configuration will also package
|
||||
# and deploy the build to GitHub provided the following prerequisites
|
||||
# are satisfied:
|
||||
#
|
||||
# GH_TOKEN is defined as a secure environment variable and contains a
|
||||
# a valid GitHub OAUTH token with repo_deployment scope.
|
||||
# NOTE: Define this env using the Travis-CI Repo Settings UI
|
||||
#
|
||||
# FREECAD_RELEASE: A GitHub Release with this identifier exists in the
|
||||
# repo. The Travis job will deploy the OS X build to this
|
||||
# GitHub release name as a release asset.
|
||||
##
|
||||
env:
|
||||
global:
|
||||
- FREECAD_RELEASE="0.16"
|
||||
- DEPLOY_RELEASE=${DEPLOY_RELEASE:-$FREECAD_RELEASE}
|
||||
- CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Release}
|
||||
- OSX_PORTS_CACHE=${OSX_PORTS_CACHE:-FreeCAD/FreeCAD-ports-cache}
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
git:
|
||||
depth: 800
|
||||
|
||||
language: cpp
|
||||
|
||||
before_install:
|
||||
- eval "$(curl -fsSL "https://raw.githubusercontent.com/${OSX_PORTS_CACHE}/v${FREECAD_RELEASE}/travis-helpers.sh")"
|
||||
- |
|
||||
case "${TRAVIS_OS_NAME}" in
|
||||
|
||||
"linux")
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y doxygen \
|
||||
libboost-dev \
|
||||
libboost-filesystem-dev \
|
||||
libboost-program-options-dev \
|
||||
libboost-python-dev \
|
||||
libboost-regex-dev \
|
||||
libboost-signals-dev \
|
||||
libboost-system-dev \
|
||||
libboost-thread-dev \
|
||||
libcoin60 \
|
||||
libcoin60-dev \
|
||||
libeigen3-dev \
|
||||
liboce-foundation-dev \
|
||||
liboce-foundation1 \
|
||||
liboce-modeling-dev \
|
||||
liboce-modeling1 \
|
||||
liboce-ocaf-dev \
|
||||
liboce-ocaf-lite-dev \
|
||||
liboce-ocaf-lite1 \
|
||||
liboce-ocaf1 \
|
||||
liboce-visualization-dev \
|
||||
liboce-visualization1 \
|
||||
libopencascade-modeling-6.5.0 \
|
||||
libpyside-dev \
|
||||
libqtcore4 \
|
||||
libshiboken-dev \
|
||||
libxerces-c-dev \
|
||||
libxmu-dev \
|
||||
libxmu-headers \
|
||||
libxmu6 \
|
||||
libxmuu-dev \
|
||||
libxmuu1 \
|
||||
oce-draw \
|
||||
pyside-tools \
|
||||
python-dev \
|
||||
python-pyside \
|
||||
python-matplotlib \
|
||||
qt4-dev-tools \
|
||||
qt4-qmake \
|
||||
shiboken \
|
||||
swig
|
||||
|
||||
#Patch the system - there is a bug related to invalid location of libs on ubuntu 12.04
|
||||
sudo ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib/i386-linux-gnu
|
||||
export DISPLAY=:99.0
|
||||
sh -e /etc/init.d/xvfb start
|
||||
|
||||
CMAKE_ARGS=""
|
||||
INSTALLED_APP_PATH="/usr/local/bin/FreeCAD"
|
||||
;;
|
||||
|
||||
"osx")
|
||||
brew update >/dev/null
|
||||
if [ "${OSX_PORTS_CACHE}X" != "X" ]; then
|
||||
brew install jq
|
||||
cacheContext=$(create_helper_context repo=${OSX_PORTS_CACHE} auth_token=${GH_TOKEN} release=${FREECAD_RELEASE})
|
||||
prime_local_ports_cache $cacheContext
|
||||
fi
|
||||
brew install eigen \
|
||||
freetype \
|
||||
qt \
|
||||
python \
|
||||
boost-python \
|
||||
pyside \
|
||||
pyside-tools \
|
||||
xerces-c \
|
||||
orocos-kdl \
|
||||
homebrew/science/oce \
|
||||
homebrew/python/matplotlib
|
||||
brew install --with-oce homebrew/science/nglib
|
||||
brew install --without-framework --without-soqt sanelson/freecad/coin
|
||||
brew install --HEAD pivy
|
||||
|
||||
#Install the 3DConnexion frameworks
|
||||
if [ ! -d /Library/Frameworks/3DconnexionClient.framework ]; then
|
||||
curl -o /tmp/3dFW.dmg -L 'http://www.3dconnexion.com/index.php?eID=sdl&ext=tx_iccsoftware&oid=a273bdbc-c289-e10d-816b-567043331c9e&filename=3DxWareMac_v10-2-5_r2142.dmg'
|
||||
hdiutil attach -readonly /tmp/3dFW.dmg
|
||||
sudo installer -package /Volumes/3Dconnexion\ Software/Install\ 3Dconnexion\ software.pkg -target /
|
||||
fi
|
||||
|
||||
#Remove GDAL if installed because it results in non-existent dependent library exceptions
|
||||
if [ -e /usr/local/lib/libgdal.1.dylib ]; then brew unlink gdal; fi
|
||||
|
||||
CMAKE_ARGS="-DFREECAD_USE_EXTERNAL_KDL=ON -DBUILD_FEM_NETGEN=ON -DFREECAD_CREATE_MAC_APP=ON"
|
||||
INSTALLED_APP_PATH="/usr/local/FreeCAD.app/Contents/bin/FreeCAD"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Invalid or unsupported operating system ${TRAVIS_OS_NAME}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
install:
|
||||
####
|
||||
# Build FreeCAD with cmake options set above for each platform
|
||||
##
|
||||
- mkdir build && cd build && cmake ${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ../
|
||||
|
||||
script:
|
||||
####
|
||||
# Install FreeCAD and run unit tests. Test failures will fail the build
|
||||
##
|
||||
- sudo make -j2 install
|
||||
- ${INSTALLED_APP_PATH} --run-test 0
|
||||
- ${INSTALLED_APP_PATH} --log-file /tmp/FreeCAD_installed.log &
|
||||
- sleep 10 && pkill FreeCAD
|
||||
- cat /tmp/FreeCAD_installed.log
|
||||
- grep --file=../.log_errors /tmp/FreeCAD_installed.log ; [ $? == 1 ] && echo "No errors from .log_errors file found in the log after start from /usr/local/bin" || ( echo "Error from .log_errors found!" && false )
|
||||
|
||||
after_success:
|
||||
####
|
||||
# Package and deploy the build to GitHub. This will only run for builds on
|
||||
# master (i.e. pull requests are only built and tested but not deployed).
|
||||
#
|
||||
# GH_TOKEN must be set in order to deploy releases to GitHub
|
||||
##
|
||||
- |
|
||||
if [ "${TRAVIS_OS_NAME}" == "osx" -a "${TRAVIS_PULL_REQUEST}" == "false" ]; then
|
||||
brew install jq node && npm install -g appdmg
|
||||
export VSN=$(python ${TRAVIS_BUILD_DIR}/src/Tools/ArchiveNameFromVersionHeader.py ${TRAVIS_BUILD_DIR}/build/src/Build/Version.h --git-SHA=$(git ls-remote origin master))
|
||||
export DEPLOYMENT_ARCHIVE=${VSN}.dmg
|
||||
appdmg ${TRAVIS_BUILD_DIR}/src/MacAppBundle/DiskImage/layout.json "${DEPLOYMENT_ARCHIVE}"
|
||||
deployContext=$(create_helper_context repo=${TRAVIS_REPO_SLUG} auth_token=${GH_TOKEN} release=${DEPLOY_RELEASE})
|
||||
gitHub_deploy_asset_to_release_named $deployContext ${DEPLOYMENT_ARCHIVE}
|
||||
gitHub_prune_assets_for_release_named $deployContext "-OSX-" 3
|
||||
fi
|
||||
+294
-70
@@ -1,10 +1,10 @@
|
||||
project(FreeCAD_trunk)
|
||||
set(FREECAD_VERSION "0.15")
|
||||
set(FREECAD_VERSION "0.16")
|
||||
|
||||
set(PACKAGE_NAME "FreeCAD")
|
||||
set(PACKAGE_VERSION_MAJOR "0")
|
||||
set(PACKAGE_VERSION_MINOR "15")
|
||||
set(PACKAGE_VERSION_PATCH "4664")
|
||||
set(PACKAGE_VERSION_MINOR "16")
|
||||
set(PACKAGE_VERSION_PATCH "4665")
|
||||
set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
|
||||
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
|
||||
|
||||
@@ -42,18 +42,25 @@ else(WIN32)
|
||||
set(PLATFORM_MK mkdir -p)
|
||||
endif(WIN32)
|
||||
|
||||
|
||||
# ================================================================================
|
||||
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||
# Issues with boost::any on older versions with C++11 enabled.
|
||||
set(BOOST_MIN_VERSION 1.55)
|
||||
|
||||
if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
|
||||
set(CMAKE_COMPILER_IS_CLANGXX TRUE)
|
||||
endif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||
# make this an option because for older compilers C++11 doesn't work properly.
|
||||
OPTION(BUILD_ENABLE_CXX11 "Enable C++11 support." ON)
|
||||
if (BUILD_ENABLE_CXX11)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
endif(BUILD_ENABLE_CXX11)
|
||||
endif (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
|
||||
include(cMake/ConfigureChecks.cmake)
|
||||
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||
add_definitions(-DHAVE_CONFIG_H)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-write-strings")
|
||||
set(CMAKE_CXX_FLAGS "-Wall -Wno-deprecated -Wno-write-strings ${CMAKE_CXX_FLAGS}")
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
|
||||
# get linker errors as soon as possible and not at runtime e.g. for modules
|
||||
if(UNIX)
|
||||
@@ -61,6 +68,15 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
|
||||
endif(UNIX)
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
|
||||
|
||||
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
EXECUTE_PROCESS( COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
||||
OUTPUT_VARIABLE GCC_VERSION )
|
||||
IF(GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
ELSE(GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
|
||||
UNSET(BOOST_MIN_VERSION) # For Ubuntu 12.04
|
||||
ENDIF(GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
|
||||
ENDIF()
|
||||
|
||||
# ================================================================================
|
||||
# Output directories for install target
|
||||
@@ -118,8 +134,9 @@ endif(MSVC)
|
||||
OPTION(BUILD_GUI "Build FreeCAD Gui. Otherwise you have only the command line and the Python import module." ON)
|
||||
OPTION(FREECAD_MAINTAINERS_BUILD "Build FreeCAD for Maintainers, with Docu and 3rd party libs. On Windows the Installer is build." OFF)
|
||||
OPTION(FREECAD_USE_EXTERNAL_ZIPIOS "Use system installed zipios++ instead of the bundled." OFF)
|
||||
OPTION(FREECAD_USE_EXTERNAL_PIVY "Use system installed python-pivy instead of the bundled." OFF)
|
||||
OPTION(FREECAD_USE_EXTERNAL_SMESH "Use system installed smesh instead of the bundled." OFF)
|
||||
OPTION(FREECAD_USE_EXTERNAL_KDL "Use system installed orocos-kdl instead of the bundled." OFF)
|
||||
OPTION(FREECAD_USE_FREETYPE "Builds the features using FreeType libs" ON)
|
||||
OPTION(FREECAD_BUILD_DEBIAN "Prepare for a build of a Debian package" OFF)
|
||||
|
||||
if(APPLE)
|
||||
@@ -127,15 +144,24 @@ if(APPLE)
|
||||
|
||||
if(FREECAD_CREATE_MAC_APP)
|
||||
install(
|
||||
DIRECTORY ${CMAKE_SOURCE_DIR}/src/MacAppBundle/FreeCAD.app
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}
|
||||
DIRECTORY ${CMAKE_SOURCE_DIR}/src/MacAppBundle/FreeCAD.app/
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/${PACKAGE_NAME}.app
|
||||
)
|
||||
set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/FreeCAD.app/Contents)
|
||||
SET(CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib)
|
||||
|
||||
# It should be safe to assume we've got sed on OSX...
|
||||
install(CODE "
|
||||
execute_process(COMMAND
|
||||
sed -i \"\" -e s/VERSION_STRING_FROM_CMAKE/${PACKAGE_VERSION}/
|
||||
-e s/NAME_STRING_FROM_CMAKE/${PACKAGE_NAME}/
|
||||
${CMAKE_INSTALL_PREFIX}/${PACKAGE_NAME}.app/Contents/Info.plist)
|
||||
")
|
||||
|
||||
set(CMAKE_INSTALL_PREFIX
|
||||
${CMAKE_INSTALL_PREFIX}/${PACKAGE_NAME}.app/Contents)
|
||||
set(CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib)
|
||||
endif(FREECAD_CREATE_MAC_APP)
|
||||
endif(APPLE)
|
||||
|
||||
OPTION(BUILD_CAM "Build the FreeCAD CAM module and the needed libs, be aware, unfinished code!" OFF)
|
||||
OPTION(BUILD_FEM "Build the FreeCAD FEM module, be aware, unfinished code!" ON)
|
||||
OPTION(BUILD_SANDBOX "Build the FreeCAD Sandbox module which is only for testing purposes" OFF)
|
||||
OPTION(BUILD_TEMPLATE "Build the FreeCAD template module which is only for testing purposes" OFF)
|
||||
@@ -155,6 +181,7 @@ OPTION(BUILD_MESH_PART "Build the FreeCAD mesh part module" ON)
|
||||
OPTION(BUILD_OPENSCAD "Build the FreeCAD openscad module" ON)
|
||||
OPTION(BUILD_PART "Build the FreeCAD part module" ON)
|
||||
OPTION(BUILD_PART_DESIGN "Build the FreeCAD part design module" ON)
|
||||
OPTION(BUILD_PATH "Build the FreeCAD path module" ON)
|
||||
OPTION(BUILD_PLOT "Build the FreeCAD plot module" ON)
|
||||
OPTION(BUILD_POINTS "Build the FreeCAD points module" ON)
|
||||
OPTION(BUILD_RAYTRACING "Build the FreeCAD ray tracing module" ON)
|
||||
@@ -169,21 +196,26 @@ OPTION(BUILD_WEB "Build the FreeCAD web module" ON)
|
||||
OPTION(BUILD_VR "Build the FreeCAD Oculus Rift support (need Oculus SDK 4.x or higher)" OFF)
|
||||
|
||||
if(MSVC)
|
||||
OPTION(FREECAD_USE_3DCONNEXION "Use the 3D connexion SDK to support 3d mouse." ON)
|
||||
OPTION(FREECAD_USE_FREETYPE "Builds the features using FreeType libs" OFF)
|
||||
OPTION(BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" ON)
|
||||
OPTION(BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" ON)
|
||||
OPTION(FREECAD_USE_3DCONNEXION "Use the 3D connexion SDK to support 3d mouse." ON)
|
||||
elseif(APPLE)
|
||||
find_library(3DCONNEXIONCLIENT_FRAMEWORK 3DconnexionClient)
|
||||
if(IS_DIRECTORY ${3DCONNEXIONCLIENT_FRAMEWORK})
|
||||
OPTION(FREECAD_USE_3DCONNEXION "Use the 3D connexion SDK to support 3d mouse." ON)
|
||||
else(IS_DIRECTORY ${3DCONNEXIONCLIENT_FRAMEWORK})
|
||||
OPTION(FREECAD_USE_3DCONNEXION "Use the 3D connexion SDK to support 3d mouse." OFF)
|
||||
endif(IS_DIRECTORY ${3DCONNEXIONCLIENT_FRAMEWORK})
|
||||
else(MSVC)
|
||||
set(FREECAD_USE_3DCONNEXION OFF)
|
||||
OPTION(FREECAD_USE_FREETYPE "Builds the features using FreeType libs" ON)
|
||||
OPTION(BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" OFF)
|
||||
OPTION(FREECAD_USE_PCL "Build the features that use PCL libs" OFF)
|
||||
OPTION(FREECAD_USE_EXTERNAL_PIVY "Use system installed python-pivy instead of the bundled." ON)
|
||||
set(FREECAD_USE_3DCONNEXION OFF)
|
||||
endif(MSVC)
|
||||
if(NOT MSVC)
|
||||
OPTION(BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" OFF)
|
||||
OPTION(FREECAD_USE_PCL "Build the features that use PCL libs" OFF)
|
||||
endif(NOT MSVC)
|
||||
|
||||
# if this is set override some options
|
||||
if (FREECAD_BUILD_DEBIAN)
|
||||
set(FREECAD_USE_EXTERNAL_ZIPIOS ON)
|
||||
set(FREECAD_USE_EXTERNAL_PIVY ON)
|
||||
# A Debian package for SMESH doesn't exist
|
||||
#set(FREECAD_USE_EXTERNAL_SMESH ON)
|
||||
endif (FREECAD_BUILD_DEBIAN)
|
||||
@@ -257,12 +289,6 @@ if(BUILD_MESH_PART)
|
||||
set(BUILD_SMESH ON)
|
||||
endif(BUILD_MESH_PART)
|
||||
|
||||
#inferred from cmakelists.txt. build errors. obsolete?
|
||||
if(BUILD_CAM)
|
||||
set(BUILD_PART ON)
|
||||
set(BUILD_MESH ON)
|
||||
endif(BUILD_CAM)
|
||||
|
||||
#inferred from cmakelists.txt. appears to be working.
|
||||
if(BUILD_RAYTRACING)
|
||||
set(BUILD_PART ON)
|
||||
@@ -271,6 +297,7 @@ endif(BUILD_RAYTRACING)
|
||||
#inferred from cmakelists.txt. appears to be working.
|
||||
if(BUILD_DRAWING)
|
||||
set(BUILD_PART ON)
|
||||
set(BUILD_SPREADSHEET ON)
|
||||
endif(BUILD_DRAWING)
|
||||
|
||||
#inferred from cmakelists.txt. appears to be working.
|
||||
@@ -278,6 +305,12 @@ if(BUILD_ROBOT)
|
||||
set(BUILD_PART ON)
|
||||
endif(BUILD_ROBOT)
|
||||
|
||||
#path module dependencies.
|
||||
if(BUILD_PATH)
|
||||
set(BUILD_PART ON)
|
||||
#set(BUILD_ROBOT ON) reenable this when using KDL
|
||||
endif(BUILD_PATH)
|
||||
|
||||
#inferred from cmakelists.txt. appears to be working.
|
||||
if(BUILD_SKETCHER)
|
||||
set(BUILD_PART ON)
|
||||
@@ -310,13 +343,17 @@ if(BUILD_JTREADER)
|
||||
set(BUILD_MESH ON)
|
||||
endif(BUILD_JTREADER)
|
||||
|
||||
#a runtime dependency
|
||||
if(BUILD_START)
|
||||
set(BUILD_WEB ON)
|
||||
endif(BUILD_START)
|
||||
|
||||
#leaving test module for someone else.
|
||||
#image has none. as far as I can tell.
|
||||
#mesh has none. as far as I can tell.
|
||||
#part has none. as far as I can tell.
|
||||
#material has none. as far as I can tell.
|
||||
#web has none. as far as I can tell.
|
||||
#start has none. as far as I can tell.
|
||||
#assembly has none. as far as I can tell.
|
||||
#plot has none. as far as I can tell.
|
||||
#points has none. as far as I can tell
|
||||
@@ -360,7 +397,6 @@ if(FREECAD_LIBPACK_USE)
|
||||
set(FREECAD_LIBPACK_VERSION "9.x" CACHE STRING "Displays if the libpack has been found" FORCE)
|
||||
include(cMake/UseLibPack9x.cmake)
|
||||
set(SWIG_EXECUTABLE ${FREECAD_LIBPACK_DIR}/tools/swigwin-2.0.11/swig.exe CACHE STRING "Swig" FORCE)
|
||||
set(FREECAD_USE_EXTERNAL_PIVY ON CACHE BOOL "Switch off local pivy" FORCE)
|
||||
set(FREECAD_LIBPACK_PYSIDEUIC_REL "${FREECAD_LIBPACK_DIR}/pyside-tools/Lib/site-packages")
|
||||
file(GLOB FREECAD_LIBPACK_PIVY_COIN "${FREECAD_LIBPACK_DIR}/pivy/*.*")
|
||||
file(GLOB FREECAD_LIBPACK_SHIBOKEN "${FREECAD_LIBPACK_DIR}/shiboken-1.2.1/lib/site-packages/*.pyd")
|
||||
@@ -388,7 +424,9 @@ if(FREECAD_LIBPACK_USE)
|
||||
find_package(SWIG)
|
||||
|
||||
IF(NOT SWIG_FOUND)
|
||||
MESSAGE("SWIG was not found, build no SWIG binding for pivy")
|
||||
MESSAGE("==================================================\n"
|
||||
"SWIG not found, don't build SWIG binding for pivy.\n"
|
||||
"==================================================\n")
|
||||
ENDIF(NOT SWIG_FOUND)
|
||||
|
||||
# -------------------------------- Shiboken/PySide ------------------------
|
||||
@@ -411,38 +449,172 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
|
||||
|
||||
# -------------------------------- Python --------------------------------
|
||||
|
||||
#http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=677598
|
||||
# Acceptable versions of Python
|
||||
set(Python_ADDITIONAL_VERSIONS "2.5" "2.6" "2.7" "2.8" "2.9")
|
||||
|
||||
# For building on OS X
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
|
||||
# If the user doesn't tell us which package manager they're using
|
||||
if(NOT DEFINED MACPORTS_PREFIX AND NOT DEFINED HOMEBREW_PREFIX)
|
||||
|
||||
# Try to find MacPorts path
|
||||
find_program(MACPORTS_EXECUTABLE port)
|
||||
if(EXISTS ${MACPORTS_EXECUTABLE})
|
||||
string(REPLACE "/bin/port" ""
|
||||
MACPORTS_PREFIX ${MACPORTS_EXECUTABLE})
|
||||
message(STATUS "Detected MacPorts install at ${MACPORTS_PREFIX}")
|
||||
endif(EXISTS ${MACPORTS_EXECUTABLE})
|
||||
|
||||
# Try to find Homebrew path
|
||||
find_program(HOMEBREW_EXECUTABLE brew)
|
||||
if(EXISTS ${HOMEBREW_EXECUTABLE})
|
||||
string(REPLACE "/bin/brew" ""
|
||||
HOMEBREW_PREFIX ${HOMEBREW_EXECUTABLE})
|
||||
message(STATUS "Detected Homebrew install at ${HOMEBREW_PREFIX}")
|
||||
endif()
|
||||
|
||||
endif(NOT DEFINED MACPORTS_PREFIX AND NOT DEFINED HOMEBREW_PREFIX)
|
||||
|
||||
# In case someone tries to shoot themselves in the foot
|
||||
if(DEFINED MACPORTS_PREFIX AND DEFINED HOMEBREW_PREFIX)
|
||||
message(SEND_ERROR
|
||||
"Multiple package management systems detected - ")
|
||||
message(SEND_ERROR
|
||||
"define either MACPORTS_PREFIX or HOMEBREW_PREFIX")
|
||||
|
||||
# No package manager
|
||||
elseif(NOT DEFINED MACPORTS_PREFIX AND NOT DEFINED HOMEBREW_PREFIX)
|
||||
message(SEND_ERROR
|
||||
"No package manager detected - install MacPorts or Homebrew")
|
||||
|
||||
# The hopefully-normal case - one package manager identified
|
||||
else(DEFINED MACPORTS_PREFIX AND DEFINED HOMEBREW_PREFIX)
|
||||
|
||||
# Construct a list like python;python2.9;python2.8;...
|
||||
set(Python_ADDITIONAL_VERSIONS_REV ${Python_ADDITIONAL_VERSIONS})
|
||||
list(REVERSE Python_ADDITIONAL_VERSIONS_REV)
|
||||
set(_PYTHON_NAMES "python")
|
||||
foreach(_PYTHON_VERSION IN LISTS Python_ADDITIONAL_VERSIONS_REV)
|
||||
list(APPEND _PYTHON_NAMES "python${_PYTHON_VERSION}")
|
||||
endforeach(_PYTHON_VERSION)
|
||||
|
||||
# Find python in the package management systems, using names in that
|
||||
# list in decreasing priority. Note that a manually specified
|
||||
# PYTHON_EXECUTABLE still has prescedence over this.
|
||||
find_program(PYTHON_EXECUTABLE
|
||||
NAMES ${_PYTHON_NAMES}
|
||||
PATHS ${MACPORTS_PREFIX} ${HOMEBREW_PREFIX}
|
||||
PATH_SUFFIXES /bin
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
endif(DEFINED MACPORTS_PREFIX AND DEFINED HOMEBREW_PREFIX)
|
||||
|
||||
# Warn user if we still only have the system Python
|
||||
string(FIND ${PYTHON_EXECUTABLE} "/usr/bin/python" _FIND_SYS_PYTHON)
|
||||
if(_FIND_SYS_PYTHON EQUAL 0)
|
||||
message(SEND_ERROR
|
||||
"Only found the stock Python, that's probably bad.")
|
||||
endif(_FIND_SYS_PYTHON EQUAL 0)
|
||||
|
||||
# Ask Python to tell us it's include directory, if nobody else has
|
||||
if(NOT DEFINED PYTHON_INCLUDE_DIR)
|
||||
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c
|
||||
"from distutils.sysconfig import get_python_inc;print get_python_inc()"
|
||||
OUTPUT_VARIABLE PYTHON_INCLUDE_DIR
|
||||
RESULT_VARIABLE PYTHON_INCLUDE_DIR_RESULT
|
||||
ERROR_QUIET)
|
||||
if(NOT PYTHON_INCLUDE_DIR_RESULT MATCHES 0)
|
||||
message(SEND_ERROR "Failed to determine PYTHON_INCLUDE_DIR")
|
||||
endif(NOT PYTHON_INCLUDE_DIR_RESULT MATCHES 0)
|
||||
endif(NOT DEFINED PYTHON_INCLUDE_DIR)
|
||||
|
||||
# Similar for the Python library - there must be an easier way...
|
||||
if(NOT DEFINED PYTHON_LIBRARY)
|
||||
# Get the library path
|
||||
execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c
|
||||
"from distutils import sysconfig;print sysconfig.get_config_var('LIBDIR')"
|
||||
OUTPUT_VARIABLE PYTHON_LIBRARY_DIR
|
||||
RESULT_VARIABLE PYTHON_LIBRARY_DIR_RESULT
|
||||
ERROR_QUIET)
|
||||
string(STRIP ${PYTHON_LIBRARY_DIR} PYTHON_LIBRARY_DIR)
|
||||
if(NOT PYTHON_LIBRARY_DIR_RESULT MATCHES 0)
|
||||
message(SEND_ERROR "Failed to determine PYTHON_LIBRARY")
|
||||
endif(NOT PYTHON_LIBRARY_DIR_RESULT MATCHES 0)
|
||||
|
||||
# Get library filename - might not be safe to assume .dylib extension?
|
||||
execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c
|
||||
"import sys;print 'libpython%d.%d.dylib'%sys.version_info[0:2]"
|
||||
OUTPUT_VARIABLE PYTHON_LIBRARY_FILE
|
||||
RESULT_VARIABLE PYTHON_LIBRARY_FILE_RESULT
|
||||
ERROR_QUIET)
|
||||
string(STRIP ${PYTHON_LIBRARY_FILE} PYTHON_LIBRARY_FILE)
|
||||
if(NOT PYTHON_LIBRARY_FILE_RESULT MATCHES 0)
|
||||
message(SEND_ERROR "Failed to determine PYTHON_LIBRARY")
|
||||
endif(NOT PYTHON_LIBRARY_FILE_RESULT MATCHES 0)
|
||||
|
||||
set(PYTHON_LIBRARY "${PYTHON_LIBRARY_DIR}/${PYTHON_LIBRARY_FILE}")
|
||||
|
||||
else(NOT DEFINED PYTHON_LIBRARY)
|
||||
# Used on MacPorts systems for finding Shiboken and PySide
|
||||
# TODO: When we start requiring minimum CMake version above
|
||||
# 2.8.11, change PATH below to DIRECTORY
|
||||
get_filename_component(PYTHON_LIBRARY_DIR ${PYTHON_LIBRARY} PATH)
|
||||
endif(NOT DEFINED PYTHON_LIBRARY)
|
||||
|
||||
|
||||
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
|
||||
#http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=677598
|
||||
set(Python_ADDITIONAL_VERSIONS "2.3" "2.4" "2.5" "2.6" "2.7" "2.8" "2.9")
|
||||
find_package(PythonInterp REQUIRED)
|
||||
set(Python_ADDITIONAL_VERSIONS ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
|
||||
IF (NOT DEFINED PYTHON_VERSION_STRING)
|
||||
find_package(PythonLibs REQUIRED)
|
||||
ELSE (NOT DEFINED PYTHON_VERSION_STRING)
|
||||
find_package(PythonLibs ${PYTHON_VERSION_STRING} EXACT)
|
||||
ENDIF(NOT DEFINED PYTHON_VERSION_STRING)
|
||||
|
||||
|
||||
IF(NOT PYTHONLIBS_FOUND)
|
||||
MESSAGE("Python not found, install python!")
|
||||
MESSAGE(FATAL_ERROR "=================================\n"
|
||||
"Python not found, install Python!\n"
|
||||
"=================================\n")
|
||||
ENDIF(NOT PYTHONLIBS_FOUND)
|
||||
|
||||
# -------------------------------- pcl ----------------------------------
|
||||
#PCL needs to be found before boost because the PCLConfig also calls find_package(Boost ...),
|
||||
#but with different components
|
||||
if(FREECAD_USE_PCL)
|
||||
find_package(PCL REQUIRED COMPONENTS common kdtree features surface io)
|
||||
find_package(PCL REQUIRED COMPONENTS common kdtree features surface io filters segmentation sample_consensus)
|
||||
endif(FREECAD_USE_PCL)
|
||||
|
||||
# -------------------------------- Boost --------------------------------
|
||||
|
||||
SET( _boost_TEST_VERSIONS ${Boost_ADDITIONAL_VERSIONS} "1.41.0" "1.39.0" "1.38.0" "1.37.0"
|
||||
"1.36.1" "1.36.0" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0" "1.34"
|
||||
"1.33.1" "1.33.0" "1.33" )
|
||||
SET(_boost_TEST_VERSIONS ${Boost_ADDITIONAL_VERSIONS})
|
||||
|
||||
find_package(Boost COMPONENTS filesystem program_options regex signals system thread REQUIRED)
|
||||
find_package(Boost ${BOOST_MIN_VERSION}
|
||||
COMPONENTS filesystem program_options regex signals system thread REQUIRED)
|
||||
|
||||
IF(NOT Boost_FOUND)
|
||||
MESSAGE(FATAL_ERROR "========================================\n"
|
||||
"boost not found, install the components:\n"
|
||||
" * filesystem\n"
|
||||
" * program_options\n"
|
||||
" * regex\n"
|
||||
" * signals\n"
|
||||
" * system\n"
|
||||
" * thread\n"
|
||||
"========================================\n")
|
||||
ENDIF(NOT Boost_FOUND)
|
||||
|
||||
# -------------------------------- XercesC --------------------------------
|
||||
|
||||
find_package(XercesC REQUIRED)
|
||||
IF(NOT XercesC_FOUND)
|
||||
MESSAGE(FATAL_ERROR "==================\n"
|
||||
"XercesC not found.\n"
|
||||
"==================\n")
|
||||
ENDIF(NOT XercesC_FOUND)
|
||||
|
||||
# -------------------------------- ZLIB --------------------------------
|
||||
|
||||
@@ -455,6 +627,11 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
|
||||
# -------------------------------- OpenCasCade --------------------------------
|
||||
|
||||
find_package(OpenCasCade)
|
||||
IF(NOT OCC_FOUND)
|
||||
MESSAGE(FATAL_ERROR "================================================================\n"
|
||||
"Neither OpenCASCADE Community Edition nor OpenCASCADE was found!\n"
|
||||
"================================================================\n")
|
||||
ENDIF(NOT OCC_FOUND)
|
||||
|
||||
# -------------------------------- Salome SMESH --------------------------
|
||||
|
||||
@@ -465,7 +642,9 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
|
||||
else()
|
||||
find_package(SMESH)
|
||||
if(NOT SMESH_FOUND)
|
||||
message(ERROR "SMESH was not found.")
|
||||
message(ERROR "================\n"
|
||||
"SMESH not found.\n"
|
||||
"================\n")
|
||||
endif()
|
||||
include_directories(${SMESH_INCLUDE_DIR})
|
||||
endif()
|
||||
@@ -488,16 +667,19 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
|
||||
find_package(SWIG)
|
||||
|
||||
IF(NOT SWIG_FOUND)
|
||||
MESSAGE("SWIG was not found, build no SWIG binding for pivy")
|
||||
MESSAGE("==================================================\n"
|
||||
"SWIG not found, don't build SWIG binding for pivy.\n"
|
||||
"==================================================\n")
|
||||
ENDIF(NOT SWIG_FOUND)
|
||||
|
||||
# -------------------------------- Eigen --------------------------------
|
||||
|
||||
find_package(Eigen3)
|
||||
|
||||
# -------------------------------- ODE ----------------------------------
|
||||
|
||||
# find_package(ODE)
|
||||
IF(NOT EIGEN3_FOUND)
|
||||
MESSAGE("=================\n"
|
||||
"Eigen3 not found.\n"
|
||||
"=================\n")
|
||||
ENDIF(NOT EIGEN3_FOUND)
|
||||
|
||||
# -------------------------------- Qt --------------------------------
|
||||
|
||||
@@ -512,16 +694,21 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
|
||||
set(QT_USE_QTUITOOLS TRUE)
|
||||
set(QT_USE_QTWEBKIT TRUE)
|
||||
endif(BUILD_GUI)
|
||||
find_package(Qt4 REQUIRED)
|
||||
|
||||
find_package(Qt4)# REQUIRED
|
||||
|
||||
include(${QT_USE_FILE})
|
||||
|
||||
IF(NOT QT4_FOUND)
|
||||
MESSAGE("Library qt-4.3 or above is not available, install QT or FreeCAD Gui version will not be built")
|
||||
MESSAGE(FATAL_ERROR "=======================\n"
|
||||
"Qt libraries not found.\n"
|
||||
"=======================\n")
|
||||
ENDIF(NOT QT4_FOUND)
|
||||
|
||||
IF(NOT QT_QTWEBKIT_FOUND)
|
||||
MESSAGE("Qt Webkit not found, will not build browser integration!")
|
||||
MESSAGE("=====================================================\n"
|
||||
"Qt Webkit not found, don't build browser integration.\n"
|
||||
"=====================================================\n")
|
||||
ENDIF(NOT QT_QTWEBKIT_FOUND)
|
||||
|
||||
|
||||
@@ -555,7 +742,9 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
|
||||
if(FREECAD_USE_FREETYPE)
|
||||
find_package(Freetype)
|
||||
if(NOT FREETYPE_FOUND)
|
||||
MESSAGE("FreeType2 library is not available. Part module will lack of makeWireString().")
|
||||
MESSAGE("===============================================================\n"
|
||||
"FreeType2 not found. Part module will lack of makeWireString().\n"
|
||||
"===============================================================\n")
|
||||
endif(NOT FREETYPE_FOUND)
|
||||
endif(FREECAD_USE_FREETYPE)
|
||||
|
||||
@@ -565,18 +754,25 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
|
||||
# -------------------------------- OpenGL --------------------------------
|
||||
|
||||
find_package(OpenGL)
|
||||
include(FindPackageMessage)
|
||||
if(OPENGL_GLU_FOUND)
|
||||
find_package_message(OPENGL_GLU
|
||||
"Found OpenGLU: ${OPENGL_glu_LIBRARY}"
|
||||
"[${OPENGL_glu_LIBRARY}][${OEPNGL_INCLUDE_DIR}]")
|
||||
else(OPENGL_GLU_FOUND)
|
||||
message(FATAL_ERROR "The GLU library is required. Make sure it is installed.")
|
||||
endif(OPENGL_GLU_FOUND)
|
||||
include(FindPackageMessage)
|
||||
if(OPENGL_GLU_FOUND)
|
||||
find_package_message(OPENGL_GLU
|
||||
"Found OpenGLU: ${OPENGL_glu_LIBRARY}"
|
||||
"[${OPENGL_glu_LIBRARY}][${OEPNGL_INCLUDE_DIR}]")
|
||||
else(OPENGL_GLU_FOUND)
|
||||
message(FATAL_ERROR "======================\n"
|
||||
"GLU library not found.\n"
|
||||
"======================\n")
|
||||
endif(OPENGL_GLU_FOUND)
|
||||
|
||||
# -------------------------------- Coin3D --------------------------------
|
||||
|
||||
find_package(Coin3D REQUIRED)
|
||||
if(NOT COIN3D_FOUND)
|
||||
MESSAGE(FATAL_ERROR "=================\n"
|
||||
"Coin3D not found.\n"
|
||||
"=================\n")
|
||||
endif(NOT COIN3D_FOUND)
|
||||
|
||||
# ------------------------------ Spaceball -------------------------------
|
||||
|
||||
@@ -591,9 +787,27 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
|
||||
# set(PYTHON_SUFFIX -python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
|
||||
SET(PYTHON_SUFFIX -python2.7) # for shiboken
|
||||
SET(PYTHON_BASENAME -python2.7) # for PySide
|
||||
find_package(Shiboken REQUIRED)
|
||||
find_package(PySide REQUIRED)
|
||||
find_package(PySideTools REQUIRED) # Pyside utilities (pyside-uic & pyside-rcc)
|
||||
|
||||
if(DEFINED MACPORTS_PREFIX)
|
||||
find_package(Shiboken REQUIRED HINTS "${PYTHON_LIBRARY_DIR}/cmake")
|
||||
find_package(PySide REQUIRED HINTS "${PYTHON_LIBRARY_DIR}/cmake")
|
||||
endif(DEFINED MACPORTS_PREFIX)
|
||||
|
||||
find_package(Shiboken)# REQUIRED
|
||||
if(NOT SHIBOKEN_INCLUDE_DIR)
|
||||
MESSAGE(FATAL_ERROR "===================\n"
|
||||
"shiboken not found.\n"
|
||||
"===================\n")
|
||||
endif(NOT SHIBOKEN_INCLUDE_DIR)
|
||||
|
||||
find_package(PySide)# REQUIRED
|
||||
if(NOT PYSIDE_INCLUDE_DIR)
|
||||
MESSAGE(FATAL_ERROR "=================\n"
|
||||
"PySide not found.\n"
|
||||
"=================\n")
|
||||
endif(NOT PYSIDE_INCLUDE_DIR)
|
||||
|
||||
find_package(PySideTools REQUIRED) # PySide utilities (pyside-uic & pyside-rcc)
|
||||
|
||||
# ------------------------------ Matplotlib ------------------------------
|
||||
|
||||
@@ -601,7 +815,9 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
|
||||
IF(MATPLOTLIB_FOUND)
|
||||
message(STATUS "-- matplotlib-${MATPLOTLIB_VERSION} has been found.")
|
||||
ELSE(MATPLOTLIB_FOUND)
|
||||
message("-- matplotlib not found, Plot module won't be available!")
|
||||
message("=====================================================\n"
|
||||
"matplotlib not found, Plot module won't be available.\n"
|
||||
"=====================================================\n")
|
||||
ENDIF(MATPLOTLIB_FOUND)
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
@@ -626,6 +842,13 @@ endif(WIN32)
|
||||
|
||||
|
||||
|
||||
# version information of libraries
|
||||
#
|
||||
if(OCC_INCLUDE_DIR AND EXISTS ${OCC_INCLUDE_DIR}/Standard_Version.hxx)
|
||||
set(HAVE_OCC_VERSION 1)
|
||||
endif(OCC_INCLUDE_DIR AND EXISTS ${OCC_INCLUDE_DIR}/Standard_Version.hxx)
|
||||
|
||||
configure_file(LibraryVersions.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/LibraryVersions.h)
|
||||
|
||||
# ================================================================================
|
||||
# == Global Compiler and Linker Settings =========================================
|
||||
@@ -653,7 +876,8 @@ IF(MSVC)
|
||||
set (CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES}")
|
||||
# set linker flag /nodefaultlib
|
||||
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB")
|
||||
SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB")
|
||||
set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /NODEFAULTLIB")
|
||||
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB")
|
||||
IF(FREECAD_RELEASE_PDB)
|
||||
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
|
||||
set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG")
|
||||
@@ -684,10 +908,6 @@ IF(MINGW)
|
||||
# SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -static-libstdc++")
|
||||
LINK_LIBRARIES(-lgdi32)
|
||||
ENDIF(MINGW)
|
||||
# 0000661: cmake build on Mac OS: dealing with dylib versus so
|
||||
IF(APPLE)
|
||||
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so")
|
||||
ENDIF(APPLE)
|
||||
|
||||
# force build directory to be different to source directory
|
||||
#if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
@@ -779,10 +999,6 @@ if(FREECAD_MAINTAINERS_BUILD AND NOT WIN32)
|
||||
"tar.gz"
|
||||
"~$"
|
||||
)
|
||||
#set(CPACK_SOURCE_IGNORE_FILES
|
||||
# ${CPACK_SOURCE_IGNORE_FILES}
|
||||
# "/Pivy-0.5/"
|
||||
#)
|
||||
set(CPACK_SOURCE_STRIP_FILES "")
|
||||
include(CPack)
|
||||
|
||||
@@ -812,3 +1028,11 @@ if(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
|
||||
|
||||
# Print message to start build process
|
||||
if (${CMAKE_BUILD_TOOL} MATCHES "make")
|
||||
MESSAGE("=======================================\n"
|
||||
"Now run 'make' to build ${PACKAGE_NAME}\n"
|
||||
"=======================================\n")
|
||||
endif()
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef LIBRARY_VERSIONS_H
|
||||
#define LIBRARY_VERSIONS_H
|
||||
|
||||
/* LibraryVersions.h. Generated from LibraryVersions.h.cmake by cmake. */
|
||||
|
||||
#cmakedefine HAVE_OCC_VERSION
|
||||
|
||||
#if defined(HAVE_OCC_VERSION)
|
||||
# include <${OCC_INCLUDE_DIR}/Standard_Version.hxx>
|
||||
#endif
|
||||
|
||||
#endif // LIBRARY_VERSIONS_H
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
|
||||
How to build and run FreeCAD under Cygwin
|
||||
=========================================
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
To compile FreeCAD, you will need, besides functioning Cygwin environment
|
||||
and programming tools (like compiler), the following libraries:
|
||||
|
||||
o Python (http://www.python.org), >= 2.5.x
|
||||
o Qt (http://www.trolltech.no), >= 4.1.x
|
||||
o Coin3D (http://www.coin3d.org), >= 2.4.x
|
||||
o SoQt (http://www.coin3d.org), >= 1.2.x
|
||||
o Xerces-c (http://xml.apache.org/dist/xerces-c/)
|
||||
o zlib (http://www.zlib.net/)
|
||||
|
||||
As far as I know, except of Coin3D and SoQt all libraries are available as prebuilt
|
||||
binary packages from one of the Cygwin mirrors. To install them, first download the
|
||||
latest version of setup.exe from www.cygwin.com and run it with administrator rights.
|
||||
Then follow the instructions of the wizard until the list of all available packages
|
||||
appears. Select the devel files of all the required libraries and install them.
|
||||
|
||||
Then download the source tarballs of Coin3D and SoQt and unpack them into a directory
|
||||
of your choice.
|
||||
The Coin library can be built with ./configure --disable-msvc;make; make install.
|
||||
|
||||
Building SoQt is a bit tricky and I haven't managed yet to build it in a proper way.
|
||||
There are various problems with X11 functions and Windows API functions which I
|
||||
don't know how to solve.
|
||||
|
||||
And for the Mesh module of FreeCAD the additional libraries
|
||||
o GTS Library (http://gts.sourceforge.net)
|
||||
o Wild Magic (http://www.geometrictools.com)
|
||||
o OpenCASCADE (http://www.opencascade.org), you need >=5.2 here
|
||||
are required. OpenCASCADE is also needed by the Part and Raytracing modules.
|
||||
|
||||
Note: As OpenCASCADE that is also required by the Mesh, Part and Raytracing
|
||||
modules is not available for Cygwin it is not possible to build them
|
||||
for this platform. It is planned for the future to move all OpenCASCADE
|
||||
dependencies of the Mesh module into a separate module so that at least
|
||||
this module can be built under Cygwin.
|
||||
|
||||
Note: All libraries listed above must be built as shared library. Refer to their
|
||||
documentation to see how to do.
|
||||
|
||||
Note: If possible you should enable thread support for the libraries. At least for
|
||||
Qt thread support is strongly recommended, otherwise you will run into linker
|
||||
errors at build time of FreeCAD.
|
||||
|
||||
Note: zlib might be already on your system, as this is a library that is used
|
||||
from a lot of other libraries.
|
||||
|
||||
Note: There seems to be various problems with Qt's uic tool of the Cygwin port.
|
||||
|
||||
Due to these problems it is not possible to run the GUI under Cygwin at the
|
||||
moment. It is only possible to run the commandline version.
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
For the build process of FreeCAD we make use of configure scripts.
|
||||
To have an overview of all options type in ./configure --help, first.
|
||||
|
||||
If you have installed all libraries above into standard paths you need not any of the
|
||||
'--with' options at all. Unless you have installed any library into a non-standard path,
|
||||
then make use of the --with-XXX-includes or --with-XXX-libs options.
|
||||
(XXX represents the corresponding library.)
|
||||
|
||||
Note: Due to some limitations of the Windows platform it is not possible to build
|
||||
libraries with unresolved symbols at link time. Thus it is strongly recommended to run
|
||||
./configure with the option LDFLAGS=-no-undefined, otherwise the creation of shared
|
||||
libraries fails. For more details see section 11.2.1 Creating Libtool Libraries with
|
||||
Automake of the libtool documentation.
|
||||
|
||||
Note: To specify FreeCAD's root directory it is recommended to use only the '--prefix'
|
||||
option from the configure script but not the --bindir, --libdir, ... options, because
|
||||
at startup FreeCAD makes assumptions where its lib-, doc-, .. directories reside.
|
||||
The default root directory is located in ~/FreeCAD.
|
||||
|
||||
If you know how to work with GNU autoconf, feel free to contribute improvements
|
||||
to our configuration scripts --- that would be great.
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Once you have built the sources successfully using 'make' with 'make install' you can
|
||||
install FreeCAD onto your machine whereever you want. Go to the directory FreeCAD/bin
|
||||
and just type in ./FreeCADCmd.
|
||||
FreeCAD's default root directory resides under ~/FreeCAD, so you don't need root privileges
|
||||
therefore.
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
|
||||
How to build and run FreeCAD under Linux
|
||||
========================================
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
To compile FreeCAD you will need, besides functioning Linux
|
||||
and programming tools (like compiler), the following libraries:
|
||||
|
||||
o Python (http://www.python.org), >= 2.5.x
|
||||
o boost (http://www.boost.org), >= 1.33.1
|
||||
o Qt (http://qt-project.org/), >= 4.1.x
|
||||
o PySide (http://qt-project.org/wiki/category:LanguageBindings::PySide::Downloads)
|
||||
o Coin3D (http://www.coin3d.org), >= 2.4.x
|
||||
o SoQt (http://www.coin3d.org), >= 1.2.x
|
||||
o Xerces-C++ (http://xml.apache.org/dist/xerces-c/), >= 2.6
|
||||
o zlib (http://www.zlib.net/)
|
||||
|
||||
And for the some FreeCAD modules the additional libraries
|
||||
o OpenCascade (http://www.opencascade.org), >= 5.2
|
||||
o Eigen3 (http://eigen.tuxfamily.org/index.php?title=Main_Page), >= 3.0.1
|
||||
o FreeType
|
||||
are required.
|
||||
|
||||
Note: zlib might be already on your system, as this is a library that is used
|
||||
by a lot of libraries, too.
|
||||
|
||||
Note: All libraries listed above must be built as shared library. Refer to their
|
||||
documentation to see how to do.
|
||||
|
||||
Note: If possible you should enable thread support for the libraries. At least for
|
||||
Qt thread support is strongly recommended, otherwise you will run into linker
|
||||
errors at build time of FreeCAD.
|
||||
|
||||
Note: The package for SoQt for Debian based systems may lack of the soqt.m4 macro file.
|
||||
You should download the file from www.coin3d.org and copy it to /usr/share/aclocal.
|
||||
|
||||
Note: The package for SoQt (at least for older Debian based systems) is usually built to link
|
||||
against Qt3. This, however, causes a segmentation fault when using with FreeCAD because
|
||||
it links against Qt4 and you get a mixup of Qt3 and Qt4 libraries.
|
||||
To fix this problem you must download the sources from www.coin3d.org and run
|
||||
configure with the 'with-qt=DIR' switch specifying the location of Qt4.
|
||||
Probably, it's best to 'make install' the newly built SoQt into a different directory
|
||||
than the installed SoQt to avoid to corrupt your package database and/or to keep other
|
||||
applications working. When configuring FreeCAD you have to use the '--with-soqt=DIR'
|
||||
switch specifying the path of the newly installed SoQt.
|
||||
For newer Debian releases this already solved by a new package that links against Qt4.
|
||||
|
||||
|
||||
During the compilation some Python scripts get executed. So the Python interpreter has
|
||||
to work properly.
|
||||
|
||||
Optionally, you can build the Qt plugin that provides all custom widgets of FreeCAD
|
||||
we need for the Qt Designer. The sources are located under Tools/plugins/widget.
|
||||
So far, we don't provide a makefile but calling 'qmake plugin.pro' creates it and
|
||||
calling 'make' will create the library libFreeCAD_widgets.so. To make known this library
|
||||
to your Qt Designer you have to copy the file to $QTDIR/plugin/designer.
|
||||
|
||||
On our Wiki you'll find more information to build with different Linux distributions at
|
||||
http://sourceforge.net/apps/mediawiki/free-cad/index.php?title=CompileOnUnix
|
||||
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
For the build process of FreeCAD we make use of configure scripts.
|
||||
To have an overview of all switches type in ./configure --help, first.
|
||||
|
||||
You don't need any of these switches unless you have installed a library into a non-standard
|
||||
path. In this case make use of the appropriate --with-XXX-include or --with-XXX-lib switches,
|
||||
please. (XXX stands for the corresponding library.)
|
||||
Of course, for above mentioned problem with SoQt you should use the '--with-soqt=DIR' switch.
|
||||
|
||||
Note: To specify FreeCAD's root directory it is recommended to use only the '--prefix'
|
||||
switch from the configure script but not the --bindir, --libdir, ... switches, because at startup
|
||||
FreeCAD makes assumptions about where its module directories are installed.
|
||||
|
||||
|
||||
Installation & Running FreeCAD
|
||||
------------------------------
|
||||
|
||||
Once you have built the sources successfully using 'make', with 'make install' you can
|
||||
install FreeCAD onto your machine whereever you want. FreeCAD's default root directory
|
||||
is $HOME/FreeCAD, so you don't need root privileges therefore. To run FreeCAD go to
|
||||
$PREFIX/FreeCAD/bin and type in ./FreeCAD.
|
||||
|
||||
Note: In the past there were a lot of problems that the Part workbench couldn't be loaded.
|
||||
The problem is that the system wasn't able to find the OpenCascade library files.
|
||||
To fix this problem you are strongly recommended to add the path of these libraries
|
||||
to LD_LIBRARY_PATH or even to add it to ld.so.conf and run ldconfig.
|
||||
|
||||
|
||||
So, just have fun!
|
||||
|
||||
|
||||
|
||||
Werner Mayer <wmayer@users.sourceforge.net>
|
||||
June 2014
|
||||
-324
@@ -1,324 +0,0 @@
|
||||
|
||||
How to build and run FreeCAD under MSYS/MinGW
|
||||
=============================================
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
Here comes a short introduction how to setup a MSYS/MinGW environment
|
||||
on a Windows system, to build all needed libraries and finally to build
|
||||
the FreeCAD sources.
|
||||
|
||||
o MSYS/MinGW
|
||||
If not already installed get a MinGW installer from the Sourceforge page at
|
||||
http://sourceforge.net/projects/mingw. When writing this tutorial the latest
|
||||
version was mingw-get-inst-20100831.exe. Download and just double-click the
|
||||
excutable. This installs the compiler and a minimal Windows developer environment.
|
||||
Make sure to also install the Fortran compiler because there is a single Fortran
|
||||
file in the 3rd party folder of the FreeCAD sources.
|
||||
|
||||
Then as second step MSYS needs to be installed to have an environment to run
|
||||
./configure scripts which we make heavy use of in order to build all needed
|
||||
libraries. From the Soureforge page the file MSYS-1.0.11.exe was taken.
|
||||
|
||||
A virginal MSYS/MinGW installation lacks of a few modules we later need.
|
||||
First, we need the utility pexport which can be found in the file
|
||||
pexports-0.44-1-mingw32-bin.tar.lzma. I don't know where to put this file
|
||||
and how to make MSYS to install the stuff inside. But the file can be opened
|
||||
with a ZIP program and the content can be copied to their destination manually.
|
||||
Here, the pexports utility can go to the bin directory of your MinGW installation.
|
||||
|
||||
Then, we also need the development files for the pthreads module which is part
|
||||
of the file pthreads-w32-2.8.0-3-mingw32-dev.tar.lzma. Just download and copy
|
||||
the files inside to your MinGW installation.
|
||||
|
||||
|
||||
o CMake
|
||||
Download the CMake utility from http://www.cmake.org/cmake/resources/software.html.
|
||||
Get the archive with the binaries for the Windows platform and unpack whereever you
|
||||
want. There is nothing further to do for this.
|
||||
|
||||
o SWIG
|
||||
Download the SWIG utility from www.swig.org and extract it somewhere on your harddisk.
|
||||
|
||||
|
||||
Third party libraries
|
||||
---------------------
|
||||
|
||||
Here is a description which libraries we need for FreeCAD and how to build them from
|
||||
the sources. In order not to pollute our MinGW installation with too many files from
|
||||
the 3rd party libraries we have to build you can e.g. create a sub-directory "local"
|
||||
in your MSYS installation. If you have installed MSYS under C:\MSYS then simply create
|
||||
the directory C:\MSYS\1.0\local.
|
||||
|
||||
|
||||
o zlib
|
||||
For zlib there is already a ready package for MinGW. So, therefore simply download
|
||||
the file libz-1.2.3-1-mingw32-dev.tar.gz from the Sourceforge site and extract the
|
||||
two directories lib and include to C:\MSYS\1.0\local.
|
||||
|
||||
|
||||
o Python
|
||||
It seems to be nearly impossible to build the Python sources directly with the MinGW
|
||||
compiler. This is because some Python modules require some features which are not
|
||||
implemented on the MinGW platform. Fortunately, the Python sources are plain C code
|
||||
and instead of trying to build it with MinGW you can get a ready binary package built
|
||||
with the MSVC compiler. You can install the Python stuff whereever you want. Afterwards
|
||||
copy the include folder to C:\MSYS\1.0\local, the DLL can go to C:\MSYS\1.0\local\bin.
|
||||
|
||||
Now we also need the so called import library. There we cannot use the .lib file which
|
||||
comes together with the installer. But it's easy to create one with the pexports/dlltool
|
||||
utilities. Assuming the Python version is 2.6 do these two steps:
|
||||
|
||||
pexports python26.dll > python26.def
|
||||
dlltool -D python26.dll -d python26.def -l libpython26.dll.a
|
||||
|
||||
The file libpython26.dll.a can now be moved to C:\MSYS\1.0\local\lib.
|
||||
|
||||
|
||||
o f2c
|
||||
For this library we don't need any header files but only the import library to build the
|
||||
Salome SMESH sources. The easiest way to build this file is:
|
||||
|
||||
pexports libgfortran-3.dll > f2c.def
|
||||
dlltool -D libgfortran-3.dll -d f2c.def -l libf2c.dll.a
|
||||
|
||||
The file libf2c.dll.a can now be moved to C:\MSYS\1.0\local\lib.
|
||||
|
||||
|
||||
o xerces-c
|
||||
Download a source archive from http://xml.apache.org/dist/xerces-c/ and extract it.
|
||||
Open a MSYS command line window and change to the xerces-c sources. From there run
|
||||
|
||||
./configure LDFLAGS=-no-undefined
|
||||
|
||||
Once ./configure has finished it's best to move to the source directory because we
|
||||
don't need to build the dozens of test applications and other stuff. So, do this:
|
||||
|
||||
cd src
|
||||
make
|
||||
make install
|
||||
|
||||
This takes a few minutes to be done.
|
||||
|
||||
|
||||
o boost
|
||||
For boost there exists a testing package with cmake support. This, however, seems to be
|
||||
stable enough to build with the MinGW compiler. So, get the file boost-1.41.0.cmake0.zip
|
||||
from http://sodium.resophonic.com/boost-cmake/1.41.0.cmake0/ and unpack it.
|
||||
|
||||
Now, start the cmake-gui.exe from within the MSYS command line. This is necessary for cmake
|
||||
in order to find the compiler and other stuff. Select the folder of the boost sources with
|
||||
the CMakeLists.txt file, select a build directory and start Configure. You'll be asked for
|
||||
which system you want to generate the Makefiles. Select MSYS/Makefiles, not MinGW/Makefiles.
|
||||
|
||||
When the configuration step has finished go to the options and search for WINMANGLE_LIBNAMES.
|
||||
Switch this off because otherwise the boost library names contain the compiler name. This
|
||||
causes the boost cmake check to fail later when we try to build the FreeCAD sources. And for
|
||||
the installtion folder choose the directory C:\MSYS\1.0\local.
|
||||
|
||||
So, reconfigure boost and press on Generate once it has finished. Close the CMake GUI window
|
||||
and enter
|
||||
|
||||
make
|
||||
make install
|
||||
|
||||
into the command line. This will take a couple of minutes.
|
||||
|
||||
|
||||
o eigen2
|
||||
Download eigen-2.0.15.tar.gz or any later version from http://eigen.tuxfamily.org/index.php?title=Main_Page.
|
||||
Unpack the files and start again cmake-gui. Set the installation directory to C:\MSYS\1.0\local
|
||||
and press on Configure and Generate. Close the window and start the installation with
|
||||
|
||||
make
|
||||
make install
|
||||
|
||||
|
||||
o Qt4
|
||||
From the Qt website at ftp://ftp.trollech.com you can download already prebuilt packages for the
|
||||
MinGW platform. But depending on the version you have installed it can happen that they don't fit
|
||||
together. In this case the source tarball must be downloaded. Use version 4.5.3 or higher. Unpack
|
||||
the sources and start the configure.exe you'll find inside the sources.
|
||||
|
||||
./configure
|
||||
|
||||
By default the build the debug and release version. If you only want the release version use the
|
||||
option "-release".
|
||||
|
||||
Configure will ask you some questions under which license you want to use Qt. Choose LGPL here.
|
||||
Now run the build with
|
||||
|
||||
make
|
||||
|
||||
This can take quite some time because Qt has become a really huge library over the years. Once the
|
||||
build has finished run a
|
||||
|
||||
make install
|
||||
|
||||
to copy the header files to their right place. All the binaries and header files are still inside
|
||||
the source folder. If you like you can copy all the .dll, .a, and the direcories under "include" to
|
||||
the subdirectories of C:\MSYS\1.0\local.
|
||||
|
||||
|
||||
o Coin
|
||||
Get a source archive from www.coin3d.org. Unpack the sources and run
|
||||
|
||||
./confiure
|
||||
make
|
||||
make install
|
||||
|
||||
It may happen that a message dialog pops up due to a missing cygwin1.dll. You simply ignore this.
|
||||
|
||||
|
||||
o SoQt
|
||||
Get a source archive from www.coin3d.org. Unpack the sources and run
|
||||
|
||||
./configure CXXFLAGS="-DCOIN_DLL" --with-qt=/usr/local
|
||||
make
|
||||
make install
|
||||
|
||||
In case your Qt development files are not under /usr/local choose the correct directory there.
|
||||
Again a message dialog may pop up due to the missing cygwin1.dll.
|
||||
|
||||
|
||||
o PyQt/sip
|
||||
|
||||
Warning: the following is obsoleted from version 0.14, since FreeCAD is now using
|
||||
pySide instead of PyQt. At the moment, PySide suport for MingW seems still not complete:
|
||||
https://bugreports.qt-project.org/browse/PYSIDE-113?page=com.atlassian.jira.plugin.system.issuetabpanels%3aall-tabpanel
|
||||
|
||||
Download the sources archives for sip and PyQt4 from www.riverbankcomputing.co.uk.
|
||||
|
||||
In order to build sip extract the archive and open a MSYS command line. From within
|
||||
its source archive call
|
||||
|
||||
python configure.py --platform win32-g++ --destdir=/usr/local
|
||||
make
|
||||
|
||||
It may happen that this step aborts because the Python include headers cannot be found.
|
||||
In this case edit the Makefile and add the include path for the ython headers and also
|
||||
the path and filename of the Python library.
|
||||
|
||||
Unfortunately, the 'make install' command doesn't work because the Makefile was generated
|
||||
to use Windows batch commands instead of bash commands. Thus, copy the following files to
|
||||
a path where Python can find it, e.g. /usr/local/bin.
|
||||
|
||||
sipconfig.py
|
||||
sipdistutils.py
|
||||
siputils.py
|
||||
sip.pyd
|
||||
sip.exe
|
||||
|
||||
In order to build PyQt4 extract the source archive and open a MSYS command line. Go to the
|
||||
directory and start
|
||||
|
||||
export PATH=/usr/local/lib/:$PATH
|
||||
python configure.py --destdir=/usr/local/lib/site-packages
|
||||
make
|
||||
|
||||
Since the Makefile doesn't find the Python header files copy them all and also the file sip.h
|
||||
to a directory where they can be found. A good place seems to be the directory of the Qt sources.
|
||||
There copy the files to $QTDIR/include. The Python library file python26.dll.a can go $QTDIR/lib.
|
||||
|
||||
After the build has finished you have to copy all files that end with .pyd to their destination,
|
||||
e.g. /usr/local/lib/site-packages/PyQt4. Lateron when you have built the FreeCAD sources you have
|
||||
to copy the PyQt4 directory and sip.pyd to the FreeCAD bin directory or set a symlink.
|
||||
|
||||
|
||||
o ODE
|
||||
TODO: Still not clear if this will be used. (http://www.ode.org), >= 0.10.x
|
||||
|
||||
|
||||
o OpenCASCADE
|
||||
For the build of the OpenCASCADE libraries get the sources from www.opencascade.org or alternatively
|
||||
it is also possible to download a stripped source tarball from the Debian mirrors which don't include
|
||||
any fonts and other resource files.
|
||||
|
||||
Unpack the sources and download a CMake script from http://opencascade-cmake.googlecode.com/svn/trunk/
|
||||
and the file occ_config.h.cmake. Copy both files into the 'ros' directory, start cmake-gui from
|
||||
within a MSYS command line and select MSYS Makefiles. In the options the following switches can be
|
||||
disabled:
|
||||
|
||||
OPENCASCADE_WRAPPERS
|
||||
OPENCASCADE_VISUALISATION
|
||||
OPENCASCADE_OCAF
|
||||
OPENCASCADE_DRAW
|
||||
|
||||
Then specify for OPENCASCADE_INSTALL_PREFIX C:/MSYS/1.0/local as destination directory-
|
||||
|
||||
Now click the Configure button which takes a while and afterwards the Generate button.
|
||||
|
||||
Note: The original sources don't completely compile with MinGW. Therefore you have to apply the patch
|
||||
OpenCASCADE6.3.0-MinGW.patch from http://code.google.com/p/opencascade-cmake/source/browse/trunk
|
||||
|
||||
Note: The original sources includes also a configure script and the Makefile.am files.
|
||||
But it appeared to be very hard to build the libraries this way. Thus, it highly
|
||||
recommended to do it the CMake way.
|
||||
|
||||
Note: For a couple of libraries the arguments passed to the linker exceeds the number of
|
||||
allowed characters and thus the linker stops with an error: "Bad file number".
|
||||
To solve this issue you can open the file build.make of the according library and
|
||||
split the block (e.g. TKGeomAlgo_OBJECTS) into several smaller ones and modify the
|
||||
build rule this way that you create first a static library, add the other object
|
||||
files to the group and then unpack the static archive into one directory. This
|
||||
trick solves the problem to reduce the whole number of characters.
|
||||
Afterwards the shared library can be built out of these object files.
|
||||
Example:
|
||||
If the build.make file has a line of the form
|
||||
g++ <options> -shared -o libTKGeomAlgo.dll $(TKGeomAlgo_OBJECTS) <libs>
|
||||
then change it into
|
||||
ar rcs win32/libTKGeomAlgo.a $(TKGeomAlgo_OBJECTS1)
|
||||
ar q win32/libTKGeomAlgo.a $(TKGeomAlgo_OBJECTS2)
|
||||
...
|
||||
ar x win32/libTKGeomAlgo.a
|
||||
g++ <options> -shared -o libTKGeomAlgo.dll *.obj <libs>
|
||||
rm -f *.obj
|
||||
|
||||
o Netgen
|
||||
Modify the following files:
|
||||
* libsrc/meshing/improve2.hpp
|
||||
Add DLL_HEADER to class MeshOptimize2d
|
||||
* libsrc/meshing/meshclass.hpp
|
||||
Add DLL_HEADER to CalcSurfacesOfNode
|
||||
* libsrc/meshing/meshtype.hpp
|
||||
Add DLL_HEADER to classes SurfaceElementIndex, MeshPoint, Element2d (int anp),
|
||||
* libsrc/occ/occgeom.hpp
|
||||
Add DLL_HEADER to classes Line, OCCGeometry, OCCParameters, OCCGenerateMesh
|
||||
* libsrc/occ/occmeshsurf.hpp
|
||||
Add DLL_HEADER to classes OCCSurface, Meshing2OCCSurfaces, MeshOptimize2dOCCSurfaces, OCCRefinementSurfaces
|
||||
|
||||
Run the configure script with these arguments
|
||||
./configure --prefix=/usr/local --enable-shared --enable-occ --with-occ=/usr/local --with-tcl=/usr/local/lib --enable-nglib CXXFLAGS="-DNGLIB_EXPORTS -DWNT"
|
||||
make && make install
|
||||
|
||||
|
||||
Building the FreeCAD sources
|
||||
----------------------------
|
||||
|
||||
In order build the FreeCAD sources either get the developer sources from the SVN repository
|
||||
or get one of the .tar.gz tarballs and extract it.
|
||||
Now start cmake-gui.exe from within a MSYS command line window and browse to the FreeCAD
|
||||
sources and also define the build directory. Now run Configure. It may happen that cmake
|
||||
complains about some not found libraries. In this case go through the listed libraries and
|
||||
choose the include directory and/or the path to the library where needed. Once Confgiure
|
||||
accepts all your input create the Makefiles by clicking on Generate. Now close the window
|
||||
and enter
|
||||
|
||||
make
|
||||
make install
|
||||
|
||||
This will take a couple of minutes. From the command line window change to the FreeCAD bin
|
||||
folder and start the application with ./FreeCAD. In case it complains about some DLLs it cannot
|
||||
find you have to extend your PATH environment variable with
|
||||
|
||||
export PATH=$PATH:/usr/local/bin:/usr/local/lib
|
||||
|
||||
If no grave problems remains repeating ./FreeCAD should start the application now.
|
||||
|
||||
Note: In order to let CMake detect the boost libraries you must make sure that the
|
||||
DLLs are in the system path because the check builds some test applications
|
||||
and tries to start them. If the DLLs are not in path CMake says that it cannot
|
||||
find boost. In this case do a export PATH=/usr/local/lib:$PATH
|
||||
|
||||
Have fun!
|
||||
@@ -1,82 +0,0 @@
|
||||
|
||||
How to build and run FreeCAD under Windows
|
||||
==========================================
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
On Windows we use the IDE MS VisualStudio 9 with the highest service pack.
|
||||
In case you don't want to use MS products you can also use the MinGW compiler,
|
||||
alternatively. In this case continue on reading the manual README.MinGW.
|
||||
You need cMake 2.6 or higher to generate the project files for VisualStudio.
|
||||
Also you need all the 3rd party libraries to succsefully compile FreeCAD.
|
||||
|
||||
Using LibPack
|
||||
-------------
|
||||
|
||||
To make it easier to get FreeCAD compiled, we provide a collection of all
|
||||
needed libraries. It's called the LibPack. You can find it on the download
|
||||
page on sourceforge.
|
||||
|
||||
Python needed
|
||||
-------------
|
||||
|
||||
During the compilation some Python scripts get executed. So the Python interpreter
|
||||
has to function on the OS. Use a command box to check it. If the Python library is
|
||||
not properly installed you will get an error message like Cannot find python.exe.
|
||||
If you use the LibPack you can also use the python.exe in the bin directory.
|
||||
|
||||
Compile
|
||||
-------
|
||||
|
||||
In order to build the FreeCAD sources start the GUI frontend of cmake. If
|
||||
doesn't already find the header files and libraries of the LibPack you have to
|
||||
define the path where you have unpacked it.
|
||||
|
||||
After you conform to all prerequisites the compilation is - hopefully - only
|
||||
a mouse click in VC ;-)
|
||||
|
||||
After Compiling
|
||||
---------------
|
||||
|
||||
To get FreeCAD up and running from the compiler environment you need to move a
|
||||
few files from the LibPack to the "bin" folder where FreeCAD.exe is installed
|
||||
after a successfull build:
|
||||
|
||||
* python.exe and python_d.exe from LIBPACK/bin
|
||||
* python26.dll and python26_d.dll from LIBPACK/bin
|
||||
* python26.zip from LIBPACK/bin
|
||||
* make a copy of python26.zip and rename it to python26_d.zip
|
||||
|
||||
|
||||
Additional stuff
|
||||
----------------
|
||||
|
||||
If you want to build the source code documentation you need DoxyGen.
|
||||
To create an intstaller package you need WIX.
|
||||
|
||||
|
||||
Additional information on building special 3rd party libraries
|
||||
--------------------------------------------------------------
|
||||
|
||||
* Mefisto2F
|
||||
|
||||
The Salome SMESH library needs the Mefisto2F library which contains some Fortran code.
|
||||
The easiest way is to convert the Fortran code into C code and use the f2c library to
|
||||
build a static library.
|
||||
|
||||
1. Get the f2c utility from http://netlib.sandia.gov/f2c/mswin/index.html
|
||||
2. Convert the Fortran file trte.f into a C file trte.c using the f2c utility
|
||||
>>> f2c trte.f
|
||||
3. Get the sources for the lib f2c from http://netlib.sandia.gov/f2c/libf2c.zip and
|
||||
unpack them.
|
||||
4. Apply the patch 'mefisto2f.patch'
|
||||
5. Run nmake -f makefile.vc
|
||||
|
||||
Alternatively, you can use the Watcom Fortran compiler. The needed project file can be get from
|
||||
here: http://sourceforge.net/p/salomesmesh/code/HEAD/tree/trunk/adm/win32-watcom/
|
||||
However, this doesn't work for x64 targets at the moment.
|
||||
|
||||
* FreeType
|
||||
|
||||
http://stackoverflow.com/questions/6207176/compiling-freetype-to-dll-as-opposed-to-static-library
|
||||
+44
-29
@@ -1,5 +1,7 @@
|
||||
FreeCAD
|
||||
=======
|
||||
-------
|
||||
|
||||

|
||||
|
||||
FreeCAD is a general purpose feature-based, parametric 3D modeler for
|
||||
CAD, MCAD, CAx, CAE and PLM, aimed directly at mechanical engineering
|
||||
@@ -15,25 +17,45 @@ FreeCAD runs exactly the same way on Windows, Mac OSX, BSD and Linux
|
||||
platforms.
|
||||
|
||||
Home page: http://www.freecadweb.org
|
||||
|
||||
Documentation wiki: http://www.freecadweb.org/wiki/
|
||||
|
||||
Forum: http://forum.freecadweb.org/
|
||||
|
||||
Bug tracker: http://www.freecadweb.org/tracker/
|
||||
Git repository: http://sourceforge.net/p/free-cad/code/ci/master/tree/
|
||||
|
||||
Git repository: https://github.com/FreeCAD/FreeCAD
|
||||
|
||||
Installing
|
||||
==========
|
||||
----------
|
||||
|
||||
Precompiled (installable) packages are usually available to you from
|
||||
several sources and are described on the FreeCAD download page:
|
||||
http://www.freecadweb.org/wiki/index.php?title=Download
|
||||
Precompiled (installable) packages are available for Windows and Mac on the
|
||||
releases page at https://github.com/FreeCAD/FreeCAD/releases
|
||||
|
||||
On most Linux distributions, FreeCAD is directly installable from the
|
||||
software center application.
|
||||
|
||||
Other options are described at http://www.freecadweb.org/wiki/index.php?title=Download
|
||||
|
||||
Build Status <img src="https://cdn.travis-ci.org/images/travis-mascot-150-3791701416eeee8479e23fe4bb7edf4f.png" height="30"/>
|
||||
------------
|
||||
|
||||
| Master | 0.16 |
|
||||
|:------:|:----:|
|
||||
|[![Master][freecad-master-status]][travis-branches]|[![0.16][freecad-0.16-status]][travis-branches]|
|
||||
|
||||
[freecad-0.16-status]: https://travis-ci-org/FreeCAD/FreeCAD.svg?branch=0.16
|
||||
[freecad-master-status]: https://travis-ci.org/FreeCAD/FreeCAD.svg?branch=master
|
||||
[travis-branches]: https://travis-ci.org/FreeCAD/FreeCAD/branches
|
||||
[travis-builds]: https://travis-ci.org/FreeCAD/FreeCAD/builds
|
||||
|
||||
Compiling
|
||||
=========
|
||||
---------
|
||||
|
||||
Compiling FreeCAD requires to install several libraries and their
|
||||
Compiling FreeCAD requires installation of several libraries and their
|
||||
development files such as OpenCasCADe, Coin and Qt, listed in the
|
||||
pages below. Once this is done, FreeCAD can be simply compiled with
|
||||
cMake. On windows, these libraries are bundled and offered by the
|
||||
cMake. On Windows, these libraries are bundled and offered by the
|
||||
FreeCAD team in a convenience package, on Linux they are usually found
|
||||
in your distribution's repositories and on Mac OSX and other platforms
|
||||
you will usually need to compile them yourself.
|
||||
@@ -41,41 +63,34 @@ you will usually need to compile them yourself.
|
||||
The pages below contain up-to-date build instructions:
|
||||
|
||||
For Linux: http://www.freecadweb.org/wiki/?title=CompileOnUnix
|
||||
|
||||
For Windows: http://www.freecadweb.org/wiki/?title=CompileOnWindows
|
||||
|
||||
For Mac OSX: http://www.freecadweb.org/wiki/?title=CompileOnMac
|
||||
|
||||
For Cygwin: http://www.freecadweb.org/wiki/?title=CompileOnCygwin
|
||||
|
||||
For MinGW: http://www.freecadweb.org/wiki/?title=CompileOnMinGW
|
||||
|
||||
Usage & Getting help
|
||||
====================
|
||||
--------------------
|
||||
|
||||
The FreeCAD documentation wiki contains a lot of documentation on
|
||||
general FreeCAD usage, python scripting, and development. The following
|
||||
pages might help you to get started:
|
||||
pages might help you get started:
|
||||
|
||||
Getting started: http://www.freecadweb.org/wiki/?title=Getting_started
|
||||
Features list: http://www.freecadweb.org/wiki/?title=Features_list
|
||||
|
||||
Features list: http://www.freecadweb.org/wiki/?title=Feature_list
|
||||
|
||||
Frequent questions: http://www.freecadweb.org/wiki/?title=FAQ
|
||||
|
||||
Workbenches: http://www.freecadweb.org/wiki/?title=Workbench_Concept
|
||||
|
||||
Scripting: http://www.freecadweb.org/wiki/?title=Power_users_hub
|
||||
|
||||
Development: http://www.freecadweb.org/wiki/?title=Developer_hub
|
||||
|
||||
The FreeCAD forum at http://forum.freecadweb.org is also a great place
|
||||
to find help and solve specific problems that you might encounter when
|
||||
to find help and solve specific problems you might encounter when
|
||||
learning to use FreeCAD.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+37
-31
@@ -2,28 +2,29 @@
|
||||
# Once done this will define
|
||||
#
|
||||
# COIN3D_FOUND - system has Coin3D - Open Inventor
|
||||
# COIN3D_INCLUDE_DIR - where the Inventor include directory can be found
|
||||
# COIN3D_LIBRARY - Link this to use Coin3D
|
||||
# COIN3D_INCLUDE_DIRS - where the Inventor include directory can be found
|
||||
# COIN3D_LIBRARIES - Link this to use Coin3D
|
||||
#
|
||||
|
||||
SET( COIN3D_FOUND "NO" )
|
||||
|
||||
IF (WIN32)
|
||||
IF (CYGWIN)
|
||||
|
||||
FIND_PATH(COIN3D_INCLUDE_DIR Inventor/So.h
|
||||
FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/usr/include/coin
|
||||
)
|
||||
|
||||
FIND_LIBRARY(COIN3D_LIBRARY Coin
|
||||
FIND_LIBRARY(COIN3D_LIBRARIES Coin
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
)
|
||||
|
||||
ELSE (CYGWIN)
|
||||
|
||||
FIND_PATH(COIN3D_INCLUDE_DIR Inventor/So.h
|
||||
FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/include"
|
||||
)
|
||||
|
||||
@@ -36,58 +37,63 @@ IF (WIN32)
|
||||
)
|
||||
|
||||
IF (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
|
||||
SET(COIN3D_LIBRARY optimized ${COIN3D_LIBRARY_RELEASE}
|
||||
debug ${COIN3D_LIBRARY_DEBUG})
|
||||
SET(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
|
||||
debug ${COIN3D_LIBRARY_DEBUG})
|
||||
ELSE (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
|
||||
IF (COIN3D_LIBRARY_DEBUG)
|
||||
SET (COIN3D_LIBRARY ${COIN3D_LIBRARY_DEBUG})
|
||||
SET (COIN3D_LIBRARIES ${COIN3D_LIBRARY_DEBUG})
|
||||
ENDIF (COIN3D_LIBRARY_DEBUG)
|
||||
IF (COIN3D_LIBRARY_RELEASE)
|
||||
SET (COIN3D_LIBRARY ${COIN3D_LIBRARY_RELEASE})
|
||||
SET (COIN3D_LIBRARIES ${COIN3D_LIBRARY_RELEASE})
|
||||
ENDIF (COIN3D_LIBRARY_RELEASE)
|
||||
ENDIF (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
|
||||
|
||||
IF (COIN3D_LIBRARY)
|
||||
IF (COIN3D_LIBRARIES)
|
||||
# ADD_DEFINITIONS ( -DCOIN_NOT_DLL )
|
||||
#ELSE (COIN3D_LIBRARY)
|
||||
# SET (COIN3D_LIBRARY coin2d CACHE STRING "Coin3D Library (Debug) - Open Inventor API")
|
||||
ENDIF (COIN3D_LIBRARY)
|
||||
#ELSE (COIN3D_LIBRARIES)
|
||||
# SET (COIN3D_LIBRARIES coin2d CACHE STRING "Coin3D Library (Debug) - Open Inventor API")
|
||||
ENDIF (COIN3D_LIBRARIES)
|
||||
|
||||
ENDIF (CYGWIN)
|
||||
|
||||
ELSE (WIN32)
|
||||
IF(APPLE)
|
||||
FIND_PATH(COIN3D_INCLUDE_DIR Inventor/So.h
|
||||
FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h
|
||||
/Library/Frameworks/Inventor.framework/Headers
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
)
|
||||
FIND_LIBRARY(COIN3D_LIBRARY Coin
|
||||
FIND_LIBRARY(COIN3D_LIBRARIES Coin
|
||||
/Library/Frameworks/Inventor.framework/Libraries
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
)
|
||||
SET(COIN3D_LIBRARY "-framework Coin3d" CACHE STRING "Coin3D library for OSX")
|
||||
ELSE(APPLE)
|
||||
SET(COIN3D_LIBRARIES "-framework Coin3d" CACHE STRING "Coin3D library for OSX")
|
||||
ELSE(APPLE)
|
||||
# Try to use pkg-config first...
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(COIN3D Coin)
|
||||
# ... then fall back to manual lookup
|
||||
IF(NOT COIN3D_FOUND)
|
||||
FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h
|
||||
/usr/include/Coin3
|
||||
/usr/include
|
||||
/usr/include/coin
|
||||
/usr/local/include
|
||||
)
|
||||
|
||||
FIND_PATH(COIN3D_INCLUDE_DIR Inventor/So.h
|
||||
/usr/include/Coin3
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(COIN3D_LIBRARY Coin
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
PATH_SUFFIXES Coin2 Coin3
|
||||
)
|
||||
FIND_LIBRARY(COIN3D_LIBRARIES Coin
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
PATH_SUFFIXES Coin2 Coin3
|
||||
)
|
||||
ENDIF(NOT COIN3D_FOUND)
|
||||
ENDIF(APPLE)
|
||||
|
||||
ENDIF (WIN32)
|
||||
|
||||
|
||||
SET( COIN3D_FOUND "NO" )
|
||||
IF(COIN3D_LIBRARY)
|
||||
IF(COIN3D_LIBRARIES)
|
||||
SET( COIN3D_FOUND "YES" )
|
||||
ENDIF(COIN3D_LIBRARY)
|
||||
ENDIF(COIN3D_LIBRARIES)
|
||||
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
# This module finds the f2c library.
|
||||
#
|
||||
# This module sets the following variables:
|
||||
# F2C_FOUND - set to true if library is found
|
||||
# F2C_DEFINITIONS - compilation options to use f2c
|
||||
# F2C_LIBRARIES - f2c library name (using full path name)
|
||||
|
||||
if (F2C_LIBRARIES)
|
||||
|
||||
set(F2C_FOUND TRUE)
|
||||
|
||||
else(F2C_LIBRARIES)
|
||||
|
||||
set(F2C_DEFINITIONS)
|
||||
|
||||
find_library(F2C_LIBRARIES f2c
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
)
|
||||
|
||||
if(F2C_LIBRARIES)
|
||||
set(F2C_FOUND TRUE)
|
||||
else()
|
||||
set(F2C_FOUND FALSE)
|
||||
endif()
|
||||
|
||||
if(NOT F2C_FIND_QUIETLY)
|
||||
if(F2C_FOUND)
|
||||
message(STATUS "f2c library found.")
|
||||
else(F2C_FOUND)
|
||||
if(F2C_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "f2c library not found. Please specify library location.")
|
||||
else()
|
||||
message(STATUS "f2c library not found. Please specify library location.")
|
||||
endif()
|
||||
endif(F2C_FOUND)
|
||||
endif(NOT F2C_FIND_QUIETLY)
|
||||
|
||||
endif(F2C_LIBRARIES)
|
||||
+42
-17
@@ -1,23 +1,52 @@
|
||||
# Try to find nglib/netgen
|
||||
#
|
||||
# Optional input NETGENDATA is path to the netgen libsrc source tree - this is
|
||||
# required due to some headers not being installed by netgen.
|
||||
#
|
||||
# Once done this will define
|
||||
#
|
||||
# NGLIB_INCLUDE_DIR - where the nglib include directory can be found
|
||||
# NGLIB_LIBRARIES - Link this to use nglib
|
||||
# NETGEN_INCLUDE_DIRS - where the netgen include directories can be found
|
||||
# NETGEN_DEFINITIONS - C++ compiler defines required to use netgen/nglib
|
||||
#
|
||||
# See also: http://git.salome-platform.org/gitweb/?p=NETGENPLUGIN_SRC.git;a=summary
|
||||
|
||||
# nglib
|
||||
FIND_PATH(NGLIB_INCLUDE_DIR nglib.h /usr/include)
|
||||
FIND_LIBRARY(NGLIB_LIBRARIES nglib /usr/lib /usr/local/lib)
|
||||
SET(NETGEN_DEFINITIONS -DNO_PARALLEL_THREADS -DOCCGEOMETRY)
|
||||
|
||||
# netgen headers
|
||||
SET(NETGEN_INCLUDE_DIRS)
|
||||
SET(NETGEN_INCLUDE_DIRS ${NETGEN_INCLUDE_DIRS} -DNO_PARALLEL_THREADS -DOCCGEOMETRY)
|
||||
IF(DEFINED MACPORTS_PREFIX OR DEFINED HOMEBREW_PREFIX)
|
||||
# We haven't supported Netgen prior to 5.3.1 on MacOS, and the current
|
||||
# plan is for the next Netgen version to be 6.1 (currently unreleased).
|
||||
LIST( APPEND NETGEN_DEFINITIONS -DNETGEN_V5 )
|
||||
|
||||
if(NOT NETGENDATA)
|
||||
SET(NETGENDATA /usr/share/netgen/libsrc)
|
||||
endif()
|
||||
IF(DEFINED HOMEBREW_PREFIX)
|
||||
EXEC_PROGRAM(brew ARGS --prefix nglib OUTPUT_VARIABLE NGLIB_PREFIX)
|
||||
ELSE(DEFINED HOMEBREW_PREFIX)
|
||||
SET(NGLIB_PREFIX ${MACPORTS_PREFIX})
|
||||
ENDIF(DEFINED HOMEBREW_PREFIX)
|
||||
|
||||
FIND_PATH(NGLIB_INCLUDE_DIR nglib.h ${NGLIB_PREFIX}/include)
|
||||
|
||||
FIND_LIBRARY(NGLIB_LIBNGLIB nglib ${NGLIB_PREFIX}/lib)
|
||||
FIND_LIBRARY(NGLIB_LIBMESH mesh ${NGLIB_PREFIX}/lib)
|
||||
FIND_LIBRARY(NGLIB_LIBOCC occ ${NGLIB_PREFIX}/lib)
|
||||
FIND_LIBRARY(NGLIB_LIBINTERFACE interface ${NGLIB_PREFIX}/lib)
|
||||
SET(NGLIB_LIBRARIES ${NGLIB_LIBNGLIB} ${NGLIB_LIBMESH}
|
||||
${NGLIB_LIBOCC} ${NGLIB_LIBINTERFACE})
|
||||
|
||||
IF(NOT NETGENDATA)
|
||||
SET(NETGENDATA ${NGLIB_PREFIX}/include/netgen)
|
||||
ENDIF(NOT NETGENDATA)
|
||||
|
||||
ELSE(DEFINED MACPORTS_PREFIX OR DEFINED HOMEBREW_PREFIX)
|
||||
FIND_PATH(NGLIB_INCLUDE_DIR nglib.h /usr/include)
|
||||
FIND_LIBRARY(NGLIB_LIBRARIES nglib /usr/lib /usr/local/lib)
|
||||
|
||||
IF(NOT NETGENDATA)
|
||||
SET(NETGENDATA /usr/share/netgen/libsrc)
|
||||
ENDIF(NOT NETGENDATA)
|
||||
|
||||
ENDIF(DEFINED MACPORTS_PREFIX OR DEFINED HOMEBREW_PREFIX)
|
||||
|
||||
FIND_PATH(NETGEN_DIR_csg csg.hpp PATHS ${NETGENDATA}/csg)
|
||||
FIND_PATH(NETGEN_DIR_gen array.hpp PATHS ${NETGENDATA}/general)
|
||||
@@ -28,12 +57,8 @@ FIND_PATH(NETGEN_DIR_mesh meshing.hpp PATHS ${NETGENDATA}/meshing)
|
||||
FIND_PATH(NETGEN_DIR_occ occgeom.hpp PATHS ${NETGENDATA}/occ)
|
||||
FIND_PATH(NETGEN_DIR_stlgeom stlgeom.hpp PATHS ${NETGENDATA}/stlgeom)
|
||||
|
||||
SET(NETGEN_INCLUDE_DIRS ${NETGEN_INCLUDE_DIRS} ${NETGEN_DIR_csg})
|
||||
SET(NETGEN_INCLUDE_DIRS ${NETGEN_INCLUDE_DIRS} ${NETGEN_DIR_gen})
|
||||
SET(NETGEN_INCLUDE_DIRS ${NETGEN_INCLUDE_DIRS} ${NETGEN_DIR_geom2d})
|
||||
SET(NETGEN_INCLUDE_DIRS ${NETGEN_INCLUDE_DIRS} ${NETGEN_DIR_gprim})
|
||||
SET(NETGEN_INCLUDE_DIRS ${NETGEN_INCLUDE_DIRS} ${NETGEN_DIR_la})
|
||||
SET(NETGEN_INCLUDE_DIRS ${NETGEN_INCLUDE_DIRS} ${NETGEN_DIR_mesh})
|
||||
SET(NETGEN_INCLUDE_DIRS ${NETGEN_INCLUDE_DIRS} ${NETGEN_DIR_occ})
|
||||
SET(NETGEN_INCLUDE_DIRS ${NETGEN_INCLUDE_DIRS} ${NETGEN_DIR_stlgeom})
|
||||
LIST( APPEND NETGEN_INCLUDE_DIRS
|
||||
${NETGEN_DIR_csg} ${NETGEN_DIR_gen} ${NETGEN_DIR_geom2d}
|
||||
${NETGEN_DIR_gprim} ${NETGEN_DIR_la} ${NETGEN_DIR_mesh}
|
||||
${NETGEN_DIR_occ} ${NETGEN_DIR_stlgeom} )
|
||||
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
# - Try to find the Open Dynamics Engine library
|
||||
# Once done this will define:
|
||||
#
|
||||
# ODE_FOUND - system has the ODE library
|
||||
# ODE_INCLUDE_DIRS - the ODE include directory (include ODE headers with <ode/headername.h>)
|
||||
# ODE_LIBRARIES - the ODE library
|
||||
# ODE_DEFINITIONS - additional definitions necessary to use ODE (usually the precision flag)
|
||||
|
||||
if (ODE_INCLUDE_DIRS AND ODE_LIBRARIES)
|
||||
# ODE has already been found and the necessary variables are cached
|
||||
set(ODE_FOUND TRUE)
|
||||
else (ODE_INCLUDE_DIRS AND ODE_LIBRARIES)
|
||||
# Find ODE
|
||||
|
||||
# Use PkgConfig if possible
|
||||
if (NOT WIN32)
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PC_ODE ode)
|
||||
endif (NOT WIN32)
|
||||
|
||||
# Find include dir
|
||||
find_path(ODE_INCLUDE_DIRS ode/ode.h
|
||||
HINTS ${PC_ODE_INCLUDEDIR}
|
||||
PATHS $ENV{OGRE_HOME}/include # ODE is shipped with the OGRE SDK
|
||||
)
|
||||
find_library(ODE_LIBRARIES ode
|
||||
NAMES ode ${PC_ODE_LIBRARIES}
|
||||
HINTS ${PC_ODE_LIBDIR}
|
||||
PATHS $ENV{OGRE_HOME}/lib
|
||||
)
|
||||
|
||||
# Decide if ODE was found
|
||||
set(ODE_FOUND FALSE)
|
||||
if (ODE_INCLUDE_DIRS AND ODE_LIBRARIES)
|
||||
set(ODE_FOUND TRUE)
|
||||
endif (ODE_INCLUDE_DIRS AND ODE_LIBRARIES)
|
||||
|
||||
# Find out extra definitions needed for ODE.
|
||||
# This is mostly needed for the ODE's precision selector:
|
||||
# ODE can be built either in single-precision (default) or double-precision mode. The app has
|
||||
# to be built in the same mode, otherwise things will crash.
|
||||
if (ODE_FOUND)
|
||||
# If PkgConfig found anything, then use its results, otherwise use ode-config script
|
||||
if (PC_ODE_FOUND)
|
||||
# Take the definitions from PkgConfig results
|
||||
set(ODE_DEFINITIONS ${PC_ODE_CFLAGS_OTHER} CACHE STRING "")
|
||||
set(ODE_DEFINITIONS_FOUND TRUE)
|
||||
else (PC_ODE_FOUND)
|
||||
# Try to use ode-config
|
||||
find_program(ODECONFIG_EXECUTABLE ode-config)
|
||||
if (ODECONFIG_EXECUTABLE)
|
||||
execute_process(COMMAND ${ODECONFIG_EXECUTABLE} --cflags OUTPUT_VARIABLE ODECONFIG_CFLAGS)
|
||||
set(ODE_DEFINITIONS ${ODECONFIG_CFLAGS} CACHE STRING "")
|
||||
set(ODE_DEFINITIONS_FOUND TRUE)
|
||||
endif (ODECONFIG_EXECUTABLE)
|
||||
endif (PC_ODE_FOUND)
|
||||
endif (ODE_FOUND)
|
||||
|
||||
# Show messages
|
||||
if (ODE_FOUND)
|
||||
if (NOT ODE_FIND_QUIETLY)
|
||||
message(STATUS "Found ODE: ${ODE_LIBRARIES}")
|
||||
# Show the ODE precision if the definitions were detected
|
||||
if (ODE_DEFINITIONS_FOUND)
|
||||
if (ODE_DEFINITIONS MATCHES -DdDOUBLE)
|
||||
message(STATUS "ODE uses double precision")
|
||||
else (ODE_DEFINITIONS MATCHES -DdDOUBLE)
|
||||
message(STATUS "ODE uses single precision")
|
||||
endif (ODE_DEFINITIONS MATCHES -DdDOUBLE)
|
||||
else (ODE_DEFINITIONS_FOUND)
|
||||
message(STATUS "Warning: couldn't determine ODE's precision")
|
||||
endif (ODE_DEFINITIONS_FOUND)
|
||||
endif (NOT ODE_FIND_QUIETLY)
|
||||
else (ODE_FOUND)
|
||||
if (ODE_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could NOT find ODE")
|
||||
endif (ODE_FIND_REQUIRED)
|
||||
endif (ODE_FOUND)
|
||||
|
||||
endif(ODE_INCLUDE_DIRS AND ODE_LIBRARIES)
|
||||
@@ -9,7 +9,14 @@
|
||||
|
||||
# First try to find OpenCASCADE Community Edition
|
||||
if(NOT DEFINED OCE_DIR)
|
||||
if(UNIX)
|
||||
# Check for OSX needs to come first because UNIX evaluates to true on OSX
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
if(DEFINED MACPORTS_PREFIX)
|
||||
find_package(OCE HINTS ${MACPORTS_PREFIX}/Library/Frameworks)
|
||||
elseif(DEFINED HOMEBREW_PREFIX)
|
||||
find_package(OCE HINTS ${HOMEBREW_PREFIX}/Cellar/oce/*)
|
||||
endif()
|
||||
elseif(UNIX)
|
||||
set(OCE_DIR "/usr/local/share/cmake/")
|
||||
elseif(WIN32)
|
||||
set(OCE_DIR "c:/OCE-0.4.0/share/cmake")
|
||||
@@ -60,6 +67,11 @@ else(OCE_FOUND) #look for OpenCASCADE
|
||||
endif(WIN32)
|
||||
if(OCC_LIBRARY)
|
||||
GET_FILENAME_COMPONENT(OCC_LIBRARY_DIR ${OCC_LIBRARY} PATH)
|
||||
IF(NOT OCC_INCLUDE_DIR)
|
||||
FIND_PATH(OCC_INCLUDE_DIR Standard_Version.hxx
|
||||
${OCC_LIBRARY_DIR}/../inc
|
||||
)
|
||||
ENDIF()
|
||||
endif(OCC_LIBRARY)
|
||||
endif(OCE_FOUND)
|
||||
|
||||
@@ -97,6 +109,7 @@ if(OCC_FOUND)
|
||||
TKSTL
|
||||
TKShHealing
|
||||
TKXSBase
|
||||
TKBin
|
||||
TKBool
|
||||
TKBO
|
||||
TKBRep
|
||||
@@ -126,5 +139,5 @@ if(OCC_FOUND)
|
||||
message(STATUS "-- OCE/OpenCASCADE include directory: ${OCC_INCLUDE_DIR}")
|
||||
message(STATUS "-- OCE/OpenCASCADE shared libraries directory: ${OCC_LIBRARY_DIR}")
|
||||
else(OCC_FOUND)
|
||||
message("Neither OpenCASCADE Community Edition nor OpenCasCade were found: will not build CAD modules!")
|
||||
#message(SEND_ERROR "Neither OpenCASCADE Community Edition nor OpenCasCade were found: will not build CAD modules!")
|
||||
endif(OCC_FOUND)
|
||||
|
||||
+33
-16
@@ -14,17 +14,14 @@ IF(PYSIDEUIC4BINARY AND PYSIDERCC4BINARY)
|
||||
set(PYSIDE_TOOLS_FOUND_QUIETLY TRUE)
|
||||
ENDIF(PYSIDEUIC4BINARY AND PYSIDERCC4BINARY)
|
||||
|
||||
if(WIN32 OR APPLE)
|
||||
if(WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
#pyside tools are often in same location as python interpreter
|
||||
get_filename_component(PYTHON_BIN_DIR ${PYTHON_EXECUTABLE} PATH)
|
||||
set(PYSIDE_BIN_DIR ${PYTHON_BIN_DIR})
|
||||
endif(WIN32 OR APPLE)
|
||||
endif(WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
|
||||
FIND_PROGRAM(PYSIDEUIC4BINARY pyside-uic HINTS ${PYSIDE_BIN_DIR})
|
||||
FIND_PROGRAM(PYSIDERCC4BINARY pyside-rcc HINTS ${PYSIDE_BIN_DIR})
|
||||
|
||||
#message(STATUS "PYSIDEUIC4BINARY ${PYSIDEUIC4BINARY}" )
|
||||
#message(STATUS "PYSIDERCC4BINARY ${PYSIDERCC4BINARY}" )
|
||||
FIND_PROGRAM(PYSIDEUIC4BINARY NAMES python2-pyside-uic pyside-uic pyside-uic-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} HINTS ${PYSIDE_BIN_DIR})
|
||||
FIND_PROGRAM(PYSIDERCC4BINARY NAMES pyside-rcc pyside-rcc-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} HINTS ${PYSIDE_BIN_DIR})
|
||||
|
||||
MACRO(PYSIDE_WRAP_UI outfiles)
|
||||
FOREACH(it ${ARGN})
|
||||
@@ -34,10 +31,20 @@ MACRO(PYSIDE_WRAP_UI outfiles)
|
||||
#ADD_CUSTOM_TARGET(${it} ALL
|
||||
# DEPENDS ${outfile}
|
||||
#)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
||||
COMMAND ${PYSIDEUIC4BINARY} ${infile} -o ${outfile}
|
||||
MAIN_DEPENDENCY ${infile}
|
||||
)
|
||||
if(WIN32)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
||||
COMMAND ${PYSIDEUIC4BINARY} ${infile} -o ${outfile}
|
||||
MAIN_DEPENDENCY ${infile}
|
||||
)
|
||||
else(WIN32)
|
||||
# Especially on Open Build Service we don't want changing date like
|
||||
# pyside-uic generates in comments at beginning.
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${PYSIDEUIC4BINARY} ${infile}
|
||||
COMMAND sed "/^# /d"
|
||||
OUTPUT_FILE ${outfile}
|
||||
)
|
||||
endif(WIN32)
|
||||
SET(${outfiles} ${${outfiles}} ${outfile})
|
||||
ENDFOREACH(it)
|
||||
ENDMACRO (PYSIDE_WRAP_UI)
|
||||
@@ -50,10 +57,20 @@ MACRO(PYSIDE_WRAP_RC outfiles)
|
||||
#ADD_CUSTOM_TARGET(${it} ALL
|
||||
# DEPENDS ${outfile}
|
||||
#)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
||||
COMMAND ${PYSIDERCC4BINARY} ${infile} -o ${outfile}
|
||||
MAIN_DEPENDENCY ${infile}
|
||||
)
|
||||
if(WIN32)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
||||
COMMAND ${PYSIDERCC4BINARY} ${infile} -o ${outfile}
|
||||
MAIN_DEPENDENCY ${infile}
|
||||
)
|
||||
else(WIN32)
|
||||
# Especially on Open Build Service we don't want changing date like
|
||||
# pyside-rcc generates in comments at beginning.
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${PYSIDERCC4BINARY} ${infile}
|
||||
COMMAND sed "/^# /d"
|
||||
OUTPUT_FILE ${outfile}
|
||||
)
|
||||
endif(WIN32)
|
||||
SET(${outfiles} ${${outfiles}} ${outfile})
|
||||
ENDFOREACH(it)
|
||||
ENDMACRO (PYSIDE_WRAP_RC)
|
||||
@@ -68,7 +85,7 @@ if(PYSIDERCC4BINARY AND PYSIDEUIC4BINARY)
|
||||
endif (NOT PySideTools_FIND_QUIETLY)
|
||||
else(PYSIDERCC4BINARY AND PYSIDEUIC4BINARY)
|
||||
if(PySideTools_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "PySideTools could not be not found, but are required.")
|
||||
message(FATAL_ERROR "PySideTools could not be found, but are required.")
|
||||
else(PySideTools_FIND_REQUIRED)
|
||||
if (NOT PySideTools_FIND_QUIETLY)
|
||||
message(STATUS "PySideTools: not found.")
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
#############################################################################
|
||||
# Description:
|
||||
# Try to find SoQt library.
|
||||
# Once run this will define:
|
||||
#
|
||||
# SOQT_FOUND
|
||||
# SOQT_LIBRARIES
|
||||
# SOQT_LIBRARY_RELEASE
|
||||
# SOQT_LIBRARY_DEBUG
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
|
||||
|
||||
|
||||
IF(UNIX OR WIN32)
|
||||
|
||||
IF(WIN32)
|
||||
IF(MINGW)
|
||||
FIND_LIBRARY(SOQT_LIBRARY
|
||||
NAMES SoQt #only shared libraries under windows
|
||||
PATHS
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/lib
|
||||
"$ENV{COINDIR}/lib"
|
||||
)
|
||||
ELSE(MINGW)
|
||||
FIND_LIBRARY(SOQT_LIBRARY_RELEASE
|
||||
#only shared libraries under windows
|
||||
NAMES soqt1
|
||||
PATHS
|
||||
"$ENV{COINDIR}/lib"
|
||||
)
|
||||
FIND_LIBRARY(SOQT_LIBRARY_DEBUG
|
||||
NAMES soqt1d #only shared libraries under windows
|
||||
PATHS
|
||||
"$ENV{COINDIR}/lib"
|
||||
)
|
||||
|
||||
FIND_PATH(SOQT_INCLUDE_PATH Inventor/Qt/SoQt.h
|
||||
"$ENV{COINDIR}/include"
|
||||
"$ENV{INCLUDE}"
|
||||
)
|
||||
MARK_AS_ADVANCED(
|
||||
SOQT_LIBRARY_DEBUG
|
||||
SOQT_LIBRARY_RELEASE
|
||||
SOQT_INCLUDE_PATH
|
||||
)
|
||||
ENDIF(MINGW)
|
||||
ELSE(WIN32)
|
||||
FIND_LIBRARY(SOQT_LIBRARY
|
||||
NAMES SoQt #only shared libraries under windows
|
||||
PATHS
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/lib
|
||||
"$ENV{COINDIR}/lib"
|
||||
)
|
||||
|
||||
#MESSAGE(STATUS "DBG SOQT_LIBRARY=${SOQT_LIBRARY}")
|
||||
|
||||
ENDIF(WIN32)
|
||||
|
||||
## --------------------------------
|
||||
|
||||
IF(SOQT_LIBRARY OR SOQT_LIBRARY_DEBUG OR SOQT_LIBRARY_RELEASE)
|
||||
|
||||
IF(WIN32)
|
||||
IF(SOQT_LIBRARY_RELEASE AND NOT SOQT_LIBRARY_DEBUG)
|
||||
SET(SOQT_LIBRARY_RELEASE ${SOQT_LIBRARY_RELEASE})
|
||||
ENDIF(SOQT_LIBRARY_RELEASE AND NOT SOQT_LIBRARY_DEBUG)
|
||||
IF(SOQT_LIBRARY_DEBUG AND NOT SOQT_LIBRARY_RELEASE)
|
||||
SET(SOQT_LIBRARY_DEBUG ${SOQT_LIBRARY_DEBUG})
|
||||
ENDIF(SOQT_LIBRARY_DEBUG AND NOT SOQT_LIBRARY_RELEASE)
|
||||
IF(SOQT_LIBRARY_RELEASE AND SOQT_LIBRARY_DEBUG)
|
||||
SET(SOQT_LIBRARY_RELEASE ${SOQT_LIBRARY_RELEASE})
|
||||
SET(SOQT_LIBRARY_DEBUG ${SOQT_LIBRARY_DEBUG})
|
||||
ENDIF(SOQT_LIBRARY_RELEASE AND SOQT_LIBRARY_DEBUG)
|
||||
IF(MINGW)
|
||||
SET(SOQT_LIBRARIES ${SOQT_LIBRARY})
|
||||
MARK_AS_ADVANCED(
|
||||
SOQT_LIBRARIES
|
||||
SOQT_LIBRARY
|
||||
)
|
||||
ENDIF(MINGW)
|
||||
ELSE(WIN32)
|
||||
SET(SOQT_LIBRARIES ${SOQT_LIBRARY})
|
||||
MARK_AS_ADVANCED(
|
||||
SOQT_LIBRARIES
|
||||
SOQT_LIBRARY
|
||||
)
|
||||
ENDIF(WIN32)
|
||||
SET(SOQT_FOUND TRUE)
|
||||
ELSE(SOQT_LIBRARY OR SOQT_LIBRARY_DEBUG OR SOQT_LIBRARY_RELEASE)
|
||||
SET(SOQT_FOUND FALSE)
|
||||
#MESSAGE("SoQt library not found.")
|
||||
ENDIF(SOQT_LIBRARY OR SOQT_LIBRARY_DEBUG OR SOQT_LIBRARY_RELEASE)
|
||||
|
||||
IF(WIN32)
|
||||
IF(SOQT_INCLUDE_PATH)
|
||||
set(SOQT_INCLUDE_DIR ${SOQT_INCLUDE_PATH})
|
||||
ELSE(SOQT_INCLUDE_PATH)
|
||||
#MESSAGE("Can not find SoQt includes")
|
||||
ENDIF(SOQT_INCLUDE_PATH)
|
||||
MARK_AS_ADVANCED(
|
||||
SOQT_INCUDE_DIR
|
||||
)
|
||||
ENDIF(WIN32)
|
||||
|
||||
#MESSAGE(STATUS "SOQT_FOUND : ${SOQT_FOUND}")
|
||||
|
||||
ELSE(UNIX OR WIN32)
|
||||
SET(SOQT_FOUND FALSE)
|
||||
ENDIF(UNIX OR WIN32)
|
||||
+12
-12
@@ -4,11 +4,11 @@
|
||||
# Modified by Jos van den Oever
|
||||
|
||||
# This module defines
|
||||
# XERCESC_INCLUDE_DIR, where to find ptlib.h, etc.
|
||||
# XERCESC_LIBRARIES, the libraries to link against to use pwlib.
|
||||
# XERCESC_FOUND, If false, don't try to use pwlib.
|
||||
# XercesC_INCLUDE_DIRS, where to find ptlib.h, etc.
|
||||
# XercesC_LIBRARIES, the libraries to link against to use pwlib.
|
||||
# XercesC_FOUND, If false, don't try to use pwlib.
|
||||
|
||||
FIND_PATH(XERCESC_INCLUDE_DIR xercesc/dom/DOM.hpp
|
||||
FIND_PATH(XercesC_INCLUDE_DIRS xercesc/dom/DOM.hpp
|
||||
"[HKEY_CURRENT_USER\\software\\xerces-c\\src]"
|
||||
"[HKEY_CURRENT_USER\\xerces-c\\src]"
|
||||
$ENV{XERCESCROOT}/src/
|
||||
@@ -16,7 +16,7 @@ FIND_PATH(XERCESC_INCLUDE_DIR xercesc/dom/DOM.hpp
|
||||
/usr/include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(XERCESC_LIBRARIES
|
||||
FIND_LIBRARY(XercesC_LIBRARIES
|
||||
NAMES
|
||||
xerces-c
|
||||
PATHS
|
||||
@@ -28,21 +28,21 @@ FIND_LIBRARY(XERCESC_LIBRARIES
|
||||
)
|
||||
|
||||
# if the include a the library are found then we have it
|
||||
IF(XERCESC_INCLUDE_DIR AND XERCESC_LIBRARIES)
|
||||
SET(XERCESC_FOUND "YES" )
|
||||
IF(XercesC_INCLUDE_DIRS AND XercesC_LIBRARIES)
|
||||
SET(XercesC_FOUND "YES" )
|
||||
IF(NOT XERCESC__FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found Xerces-C: ${XERCESC_LIBRARIES}")
|
||||
MESSAGE(STATUS "Found Xerces-C: ${XercesC_LIBRARIES}")
|
||||
ENDIF(NOT XERCESC__FIND_QUIETLY)
|
||||
ELSE(XERCESC_INCLUDE_DIR AND XERCESC_LIBRARIES)
|
||||
ELSE(XercesC_INCLUDE_DIRS AND XercesC_LIBRARIES)
|
||||
IF(XERCESC_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Xerces-C was not found.")
|
||||
ENDIF(XERCESC_FIND_REQUIRED)
|
||||
IF(NOT XERCESC__FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Xerces-C was not found.")
|
||||
ENDIF(NOT XERCESC__FIND_QUIETLY)
|
||||
ENDIF(XERCESC_INCLUDE_DIR AND XERCESC_LIBRARIES)
|
||||
ENDIF(XercesC_INCLUDE_DIRS AND XercesC_LIBRARIES)
|
||||
|
||||
#MARK_AS_ADVANCED(
|
||||
# XERCESC_INCLUDE_DIR
|
||||
# XERCESC_LIBRARIES
|
||||
# XercesC_INCLUDE_DIRS
|
||||
# XercesC_LIBRARIES
|
||||
#)
|
||||
|
||||
@@ -222,24 +222,28 @@ MACRO(SET_BIN_DIR ProjectName OutputName)
|
||||
set_target_properties(${ProjectName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}${ARGV2})
|
||||
set_target_properties(${ProjectName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}${ARGV2})
|
||||
set_target_properties(${ProjectName} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}${ARGV2})
|
||||
set_target_properties(${ProjectName} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}${ARGV2})
|
||||
set_target_properties(${ProjectName} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}${ARGV2})
|
||||
else(${ARGC} GREATER 2)
|
||||
set_target_properties(${ProjectName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
set_target_properties(${ProjectName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin)
|
||||
set_target_properties(${ProjectName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin)
|
||||
set_target_properties(${ProjectName} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set_target_properties(${ProjectName} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/lib)
|
||||
set_target_properties(${ProjectName} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/lib)
|
||||
endif(${ARGC} GREATER 2)
|
||||
|
||||
if(WIN32)
|
||||
set_target_properties(${ProjectName} PROPERTIES DEBUG_OUTPUT_NAME ${OutputName}_d)
|
||||
else(WIN32)
|
||||
# FreeCADBase, SMDS, Driver and MEFISTO2 libs don't depend on parts from CMAKE_INSTALL_LIBDIR
|
||||
if(NOT ${ProjectName} MATCHES "^(FreeCADBase|SMDS|Driver|MEFISTO2)$")
|
||||
# FreeCADBase, SMDS, Driver, MEFISTO2 and area libs don't depend on parts from CMAKE_INSTALL_LIBDIR
|
||||
if(NOT ${ProjectName} MATCHES "^(FreeCADBase|SMDS|Driver|MEFISTO2|area)$")
|
||||
if(${ARGC} STREQUAL 4)
|
||||
set_target_properties(${ProjectName} PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}${ARGV3})
|
||||
else(${ARGC} STREQUAL 4)
|
||||
set_target_properties(${ProjectName} PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_LIBDIR})
|
||||
endif(${ARGC} STREQUAL 4)
|
||||
endif(NOT ${ProjectName} MATCHES "^(FreeCADBase|SMDS|Driver|MEFISTO2)$")
|
||||
endif()
|
||||
endif()
|
||||
endif(WIN32)
|
||||
ENDMACRO(SET_BIN_DIR)
|
||||
|
||||
@@ -251,5 +255,8 @@ MACRO(SET_PYTHON_PREFIX_SUFFIX ProjectName)
|
||||
|
||||
if(WIN32)
|
||||
set_target_properties(${ProjectName} PROPERTIES SUFFIX ".pyd")
|
||||
# 0000661: cmake build on Mac OS: dealing with dylib versus so
|
||||
elseif(APPLE)
|
||||
set_target_properties(${ProjectName} PROPERTIES SUFFIX ".so")
|
||||
endif(WIN32)
|
||||
ENDMACRO(SET_PYTHON_PREFIX_SUFFIX)
|
||||
|
||||
+24
-17
@@ -11,16 +11,17 @@ include_directories(${FREECAD_LIBPACK_DIR}/include)
|
||||
set(OPENGL_gl_LIBRARY opengl32 glu32)
|
||||
|
||||
# Python
|
||||
set(PYTHON_LIBRARY optimized python27.lib debug python27_d.lib)
|
||||
set(PYTHON_LIBRARIES optimized python27.lib debug python27_d.lib)
|
||||
set(PYTHON_INCLUDE_PATH ${FREECAD_LIBPACK_DIR}/include/Python-2.7.5)
|
||||
set(PYTHON_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/Python-2.7.5)
|
||||
set(PYTHON_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/python.exe)
|
||||
set(PYTHONLIBS_FOUND TRUE)
|
||||
|
||||
# XercesC
|
||||
set(XERCESC_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/xerces-c-3.1.1)
|
||||
set(XERCESC_LIBRARIES xerces-c_3.lib)
|
||||
set(XERCESC_DEBUG_LIBRARIES xerces-c_3D.lib)
|
||||
set(XERCESC_FOUND TRUE)
|
||||
set(XercesC_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/xerces-c-3.1.1)
|
||||
set(XercesC_LIBRARIES xerces-c_3.lib)
|
||||
set(XercesC_DEBUG_LIBRARIES xerces-c_3D.lib)
|
||||
set(XercesC_FOUND TRUE)
|
||||
|
||||
# Boost
|
||||
set(Boost_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/boost-1_55)
|
||||
@@ -29,15 +30,15 @@ set(Boost_LIBRARIES
|
||||
optimized boost_system-vc110-mt-1_55.lib
|
||||
optimized boost_graph-vc110-mt-1_55.lib
|
||||
optimized boost_program_options-vc110-mt-1_55.lib
|
||||
optimized boost_python-vc110-mt-1_55.lib
|
||||
optimized boost_regex-vc110-mt-1_55.lib
|
||||
optimized boost_signals-vc110-mt-1_55.lib
|
||||
optimized boost_thread-vc110-mt-1_55.lib
|
||||
)
|
||||
set(Boost_DEBUG_LIBRARIES
|
||||
debug boost_filesystem-vc110-mt-gd-1_55.lib
|
||||
debug boost_system-vc110-mt-gd-1_55.lib
|
||||
debug boost_graph-vc110-mt-gd-1_55.lib
|
||||
debug boost_program_options-vc110-mt-gd-1_55.lib
|
||||
debug boost_python-vc110-mt-gd-1_55.lib
|
||||
debug boost_regex-vc110-mt-gd-1_55.lib
|
||||
debug boost_signals-vc110-mt-gd-1_55.lib
|
||||
debug boost_thread-vc110-mt-gd-1_55.lib
|
||||
@@ -67,7 +68,7 @@ set(SMESH_FOUND TRUE)
|
||||
|
||||
# Coin3D
|
||||
|
||||
find_path(COIN3D_INCLUDE_DIR Inventor/So.h
|
||||
find_path(COIN3D_INCLUDE_DIRS Inventor/So.h
|
||||
${FREECAD_LIBPACK_DIR}/include/Coin-4.0.0
|
||||
)
|
||||
find_library(COIN3D_LIBRARY_RELEASE coin4
|
||||
@@ -76,6 +77,8 @@ find_library(COIN3D_LIBRARY_RELEASE coin4
|
||||
find_library(COIN3D_LIBRARY_DEBUG coin4d
|
||||
"${FREECAD_LIBPACK_DIR}/lib"
|
||||
)
|
||||
set(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
|
||||
debug ${COIN3D_LIBRARY_DEBUG})
|
||||
|
||||
set(COIN3D_FOUND TRUE)
|
||||
|
||||
@@ -117,8 +120,6 @@ set(QT_LIBRARIES
|
||||
optimized QtXml4.lib
|
||||
optimized QtOpenGl4.lib
|
||||
optimized QtWebKit4.lib
|
||||
)
|
||||
set(QT_DEBUG_LIBRARIES
|
||||
debug QtCored4.lib
|
||||
debug QtGuid4.lib
|
||||
debug QtDesignerd4.lib
|
||||
@@ -135,12 +136,20 @@ set(QT_QTCORE_LIBRARY
|
||||
optimized QtCore4.lib debug QtCored4.lib
|
||||
)
|
||||
|
||||
set(QT_QT3SUPPORT_LIBRARY_DEBUG
|
||||
debug Qt3Supportd4.lib
|
||||
set(QT_QTXML_LIBRARY
|
||||
optimized QtXml4.lib debug QtXmld4.lib
|
||||
)
|
||||
|
||||
set(QT_QT3SUPPORT_LIBRARY
|
||||
optimized Qt3Support4.lib
|
||||
optimized Qt3Support4.lib debug Qt3Supportd4.lib
|
||||
)
|
||||
|
||||
set(QT_QTUITOOLS_LIBRARY
|
||||
optimized QtUiTools.lib debug QtUiToolsd.lib
|
||||
)
|
||||
|
||||
set(QT_QTMAIN_LIBRARY
|
||||
debug qtmaind.lib optimized qtmain.lib
|
||||
)
|
||||
|
||||
set(QT_UIC_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/uic.exe)
|
||||
@@ -422,6 +431,7 @@ set(OCC_LIBRARIES
|
||||
optimized TKSTL
|
||||
optimized TKShHealing
|
||||
optimized TKXSBase
|
||||
optimized TKBin
|
||||
optimized TKBool
|
||||
optimized TKBO
|
||||
optimized TKBRep
|
||||
@@ -447,6 +457,7 @@ set(OCC_DEBUG_LIBRARIES
|
||||
debug TKSTLd
|
||||
debug TKShHealingd
|
||||
debug TKXSBased
|
||||
debug TKBind
|
||||
debug TKBoold
|
||||
debug TKBOd
|
||||
debug TKBRepd
|
||||
@@ -485,10 +496,6 @@ set(OCC_FOUND TRUE)
|
||||
set(EIGEN3_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/eigen3)
|
||||
set(EIGEN3_FOUND TRUE)
|
||||
|
||||
set(ODE_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/ode-0.11.1)
|
||||
set(ODE_LIBRARIES ${FREECAD_LIBPACK_DIR}/lib/ode_double.lib)
|
||||
set(ODE_FOUND TRUE)
|
||||
|
||||
# FreeType
|
||||
if(FREECAD_USE_FREETYPE)
|
||||
set(FREETYPE_LIBRARIES
|
||||
|
||||
+28
-20
@@ -11,17 +11,17 @@ include_directories(${FREECAD_LIBPACK_DIR}/include)
|
||||
set(OPENGL_gl_LIBRARY opengl32 glu32)
|
||||
|
||||
# Python
|
||||
set(PYTHON_DEBUG_LIBRARY python25_d.lib)
|
||||
set(PYTHON_LIBRARY python25.lib)
|
||||
set(PYTHON_LIBRARIES optimized python25.lib debug python25_d.lib)
|
||||
set(PYTHON_INCLUDE_PATH ${FREECAD_LIBPACK_DIR}/include/python)
|
||||
set(PYTHON_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/python)
|
||||
set(PYTHON_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/python.exe)
|
||||
set(PYTHONLIBS_FOUND TRUE)
|
||||
|
||||
# XercesC
|
||||
set(XERCESC_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/xercesc)
|
||||
set(XERCESC_LIBRARIES xerces-c_2.lib)
|
||||
set(XERCESC_DEBUG_LIBRARIES xerces-c_2D.lib)
|
||||
set(XERCESC_FOUND TRUE)
|
||||
set(XercesC_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/xercesc)
|
||||
set(XercesC_LIBRARIES xerces-c_2.lib)
|
||||
set(XercesC_DEBUG_LIBRARIES xerces-c_2D.lib)
|
||||
set(XercesC_FOUND TRUE)
|
||||
|
||||
# Boost
|
||||
set(Boost_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/boost)
|
||||
@@ -29,13 +29,13 @@ set(Boost_LIBRARIES
|
||||
optimized boost_filesystem-vc80-mt.lib
|
||||
#optimized boost_graph-vc80-mt.lib
|
||||
optimized boost_program_options-vc80-mt.lib
|
||||
optimized boost_python-vc80-mt.lib
|
||||
optimized boost_regex-vc80-mt.lib
|
||||
optimized boost_signals-vc80-mt.lib
|
||||
)
|
||||
set(Boost_DEBUG_LIBRARIES
|
||||
debug boost_filesystem-vc80-mt-gd.lib
|
||||
#debug boost_graph-vc80-mt-gd.lib
|
||||
debug boost_program_options-vc80-mt-gd.lib
|
||||
debug boost_python-vc80-mt-gd.lib
|
||||
debug boost_regex-vc80-mt-gd.lib
|
||||
debug boost_signals-vc80-mt-gd.lib
|
||||
)
|
||||
@@ -63,9 +63,11 @@ set(SMESH_LIBRARIES
|
||||
set(SMESH_FOUND TRUE)
|
||||
|
||||
# Coin3D
|
||||
set(COIN3D_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/coin)
|
||||
set(COIN3D_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/coin)
|
||||
set(COIN3D_LIBRARY_DEBUG coin2d.lib)
|
||||
set(COIN3D_LIBRARY_RELEASE coin2.lib)
|
||||
set(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
|
||||
debug ${COIN3D_LIBRARY_DEBUG})
|
||||
set(COIN3D_FOUND TRUE)
|
||||
|
||||
|
||||
@@ -102,8 +104,6 @@ set(QT_LIBRARIES
|
||||
optimized QtXml4.lib
|
||||
optimized QtOpenGl4.lib
|
||||
optimized QtWebKit4.lib
|
||||
)
|
||||
set(QT_DEBUG_LIBRARIES
|
||||
debug QtCored4.lib
|
||||
debug QtGuid4.lib
|
||||
debug QtDesignerd4.lib
|
||||
@@ -116,12 +116,24 @@ set(QT_DEBUG_LIBRARIES
|
||||
debug QtWebKitd4.lib
|
||||
)
|
||||
|
||||
set(QT_QTCORE_LIBRARY_DEBUG
|
||||
debug QtCored4.lib
|
||||
)
|
||||
|
||||
set(QT_QTCORE_LIBRARY
|
||||
optimized QtCore4.lib
|
||||
debug QtCored4.lib
|
||||
)
|
||||
|
||||
set(QT_QTXML_LIBRARY
|
||||
optimized QtXml4.lib
|
||||
debug QtXmld4.lib
|
||||
)
|
||||
|
||||
set(QT_QTUITOOLS_LIBRARY
|
||||
optimized QtUiTools.lib
|
||||
debug QtUiToolsd.lib
|
||||
)
|
||||
|
||||
set(QT_QTMAIN_LIBRARY
|
||||
debug qtmaind.lib
|
||||
optimized qtmain.lib
|
||||
)
|
||||
|
||||
set(QT_UIC_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/uic.exe)
|
||||
@@ -272,11 +284,6 @@ set(OPENCV_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/opencv)
|
||||
set(OPENCV_LIBRARIES cv.lib cvaux.lib cxcore.lib cxts.lib highgui.lib)
|
||||
set(OPENCV_FOUND TRUE)
|
||||
|
||||
# ODE
|
||||
set(ODE_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include)
|
||||
set(ODE_LIBRARIES ode_double.lib)
|
||||
set(ODE_FOUND TRUE)
|
||||
|
||||
# OCC
|
||||
set(OCC_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/OpenCascade)
|
||||
set(OCC_LIBRARY_DIR
|
||||
@@ -293,6 +300,7 @@ set(OCC_LIBRARIES
|
||||
TKSTL
|
||||
TKShHealing
|
||||
TKXSBase
|
||||
TKBin
|
||||
TKBool
|
||||
TKBO
|
||||
TKBRep
|
||||
|
||||
+28
-15
@@ -11,17 +11,17 @@ include_directories(${FREECAD_LIBPACK_DIR}/include)
|
||||
set(OPENGL_gl_LIBRARY opengl32 glu32)
|
||||
|
||||
# Python
|
||||
set(PYTHON_DEBUG_LIBRARY python26_d.lib)
|
||||
set(PYTHON_LIBRARY python26.lib)
|
||||
set(PYTHON_LIBRARIES optimized python26.lib debug python26_d.lib)
|
||||
set(PYTHON_INCLUDE_PATH ${FREECAD_LIBPACK_DIR}/include/python)
|
||||
set(PYTHON_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/python)
|
||||
set(PYTHON_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/python.exe)
|
||||
set(PYTHONLIBS_FOUND TRUE)
|
||||
|
||||
# XercesC
|
||||
set(XERCESC_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/xercesc)
|
||||
set(XERCESC_LIBRARIES xerces-c_2.lib)
|
||||
set(XERCESC_DEBUG_LIBRARIES xerces-c_2D.lib)
|
||||
set(XERCESC_FOUND TRUE)
|
||||
set(XercesC_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/xercesc)
|
||||
set(XercesC_LIBRARIES xerces-c_2.lib)
|
||||
set(XercesC_DEBUG_LIBRARIES xerces-c_2D.lib)
|
||||
set(XercesC_FOUND TRUE)
|
||||
|
||||
# Boost
|
||||
set(Boost_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/boost)
|
||||
@@ -30,11 +30,10 @@ set(Boost_LIBRARIES
|
||||
optimized boost_system-vc90-mt-1_39.lib
|
||||
optimized boost_graph-vc90-mt-1_39.lib
|
||||
optimized boost_program_options-vc90-mt-1_39.lib
|
||||
optimized boost_python-vc90-mt-1_39.lib
|
||||
optimized boost_regex-vc90-mt-1_39.lib
|
||||
optimized boost_signals-vc90-mt-1_39.lib
|
||||
optimized boost_thread-vc90-mt-1_39.lib
|
||||
)
|
||||
set(Boost_DEBUG_LIBRARIES
|
||||
debug boost_filesystem-vc90-mt-gd-1_39.lib
|
||||
debug boost_date_time-vc90-mt-gd-1_39.lib
|
||||
debug boost_filesystem-vc90-mt-gd-1_39.lib
|
||||
@@ -45,6 +44,7 @@ set(Boost_DEBUG_LIBRARIES
|
||||
debug boost_system-vc90-mt-gd-1_39.lib
|
||||
debug boost_graph-vc90-mt-gd-1_39.lib
|
||||
debug boost_program_options-vc90-mt-gd-1_39.lib
|
||||
debug boost_python-vc90-mt-gd-1_39.lib
|
||||
debug boost_regex-vc90-mt-gd-1_39.lib
|
||||
debug boost_signals-vc90-mt-gd-1_39.lib
|
||||
)
|
||||
@@ -72,9 +72,11 @@ set(SMESH_LIBRARIES
|
||||
set(SMESH_FOUND TRUE)
|
||||
|
||||
# Coin3D
|
||||
set(COIN3D_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/coin)
|
||||
set(COIN3D_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/coin)
|
||||
set(COIN3D_LIBRARY_DEBUG coin3d.lib)
|
||||
set(COIN3D_LIBRARY_RELEASE coin3.lib)
|
||||
set(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
|
||||
debug ${COIN3D_LIBRARY_DEBUG})
|
||||
set(COIN3D_FOUND TRUE)
|
||||
|
||||
|
||||
@@ -111,8 +113,6 @@ set(QT_LIBRARIES
|
||||
optimized QtXml4.lib
|
||||
optimized QtOpenGl4.lib
|
||||
optimized QtWebKit4.lib
|
||||
)
|
||||
set(QT_DEBUG_LIBRARIES
|
||||
debug QtCored4.lib
|
||||
debug QtGuid4.lib
|
||||
debug QtDesignerd4.lib
|
||||
@@ -125,12 +125,24 @@ set(QT_DEBUG_LIBRARIES
|
||||
debug QtWebKitd4.lib
|
||||
)
|
||||
|
||||
set(QT_QTCORE_LIBRARY_DEBUG
|
||||
debug QtCored4.lib
|
||||
)
|
||||
|
||||
set(QT_QTCORE_LIBRARY
|
||||
optimized QtCore4.lib
|
||||
debug QtCored4.lib
|
||||
)
|
||||
|
||||
set(QT_QTXML_LIBRARY
|
||||
optimized QtXml4.lib
|
||||
debug QtXmld4.lib
|
||||
)
|
||||
|
||||
set(QT_QTUITOOLS_LIBRARY
|
||||
optimized QtUiTools.lib
|
||||
debug QtUiToolsd.lib
|
||||
)
|
||||
|
||||
set(QT_QTMAIN_LIBRARY
|
||||
debug qtmaind.lib
|
||||
optimized qtmain.lib
|
||||
)
|
||||
|
||||
set(QT_UIC_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/uic.exe)
|
||||
@@ -299,6 +311,7 @@ set(OCC_LIBRARIES
|
||||
TKSTL
|
||||
TKShHealing
|
||||
TKXSBase
|
||||
TKBin
|
||||
TKBool
|
||||
TKBO
|
||||
TKBRep
|
||||
|
||||
+28
-11
@@ -11,17 +11,17 @@ include_directories(${FREECAD_LIBPACK_DIR}/include)
|
||||
set(OPENGL_gl_LIBRARY opengl32 glu32)
|
||||
|
||||
# Python
|
||||
set(PYTHON_DEBUG_LIBRARY python26_d.lib)
|
||||
set(PYTHON_LIBRARY python26.lib)
|
||||
set(PYTHON_LIBRARIES optimized python26.lib debug python26_d.lib)
|
||||
set(PYTHON_INCLUDE_PATH ${FREECAD_LIBPACK_DIR}/include/python)
|
||||
set(PYTHON_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/python)
|
||||
set(PYTHON_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/python.exe)
|
||||
set(PYTHONLIBS_FOUND TRUE)
|
||||
|
||||
# XercesC
|
||||
set(XERCESC_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/xercesc)
|
||||
set(XERCESC_LIBRARIES xerces-c_2.lib)
|
||||
set(XERCESC_DEBUG_LIBRARIES xerces-c_2D.lib)
|
||||
set(XERCESC_FOUND TRUE)
|
||||
set(XercesC_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/xercesc)
|
||||
set(XercesC_LIBRARIES xerces-c_2.lib)
|
||||
set(XercesC_DEBUG_LIBRARIES xerces-c_2D.lib)
|
||||
set(XercesC_FOUND TRUE)
|
||||
|
||||
# Boost
|
||||
set(Boost_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/boost)
|
||||
@@ -30,11 +30,10 @@ set(Boost_LIBRARIES
|
||||
optimized boost_system-vc90-mt-1_48.lib
|
||||
optimized boost_graph-vc90-mt-1_48.lib
|
||||
optimized boost_program_options-vc90-mt-1_48.lib
|
||||
optimized boost_python-vc90-mt-1_48.lib
|
||||
optimized boost_regex-vc90-mt-1_48.lib
|
||||
optimized boost_signals-vc90-mt-1_48.lib
|
||||
optimized boost_thread-vc90-mt-1_48.lib
|
||||
)
|
||||
set(Boost_DEBUG_LIBRARIES
|
||||
debug boost_filesystem-vc90-mt-gd-1_48.lib
|
||||
debug boost_date_time-vc90-mt-gd-1_48.lib
|
||||
debug boost_filesystem-vc90-mt-gd-1_48.lib
|
||||
@@ -45,6 +44,7 @@ set(Boost_DEBUG_LIBRARIES
|
||||
debug boost_system-vc90-mt-gd-1_48.lib
|
||||
debug boost_graph-vc90-mt-gd-1_48.lib
|
||||
debug boost_program_options-vc90-mt-gd-1_48.lib
|
||||
debug boost_python-vc90-mt-gd-1_48.lib
|
||||
debug boost_regex-vc90-mt-gd-1_48.lib
|
||||
debug boost_signals-vc90-mt-gd-1_48.lib
|
||||
)
|
||||
@@ -84,9 +84,11 @@ set(ZLIB_FOUND TRUE)
|
||||
#set(SMESH_FOUND TRUE)
|
||||
|
||||
# Coin3D
|
||||
set(COIN3D_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/coin)
|
||||
set(COIN3D_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/coin)
|
||||
set(COIN3D_LIBRARY_DEBUG coin3d.lib)
|
||||
set(COIN3D_LIBRARY_RELEASE coin3.lib)
|
||||
set(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
|
||||
debug ${COIN3D_LIBRARY_DEBUG})
|
||||
set(COIN3D_FOUND TRUE)
|
||||
|
||||
|
||||
@@ -123,8 +125,6 @@ set(QT_LIBRARIES
|
||||
optimized QtXml4.lib
|
||||
optimized QtOpenGl4.lib
|
||||
optimized QtWebKit4.lib
|
||||
)
|
||||
set(QT_DEBUG_LIBRARIES
|
||||
debug QtCored4.lib
|
||||
debug QtGuid4.lib
|
||||
debug QtDesignerd4.lib
|
||||
@@ -142,6 +142,21 @@ set(QT_QTCORE_LIBRARY
|
||||
debug QtCored4.lib
|
||||
)
|
||||
|
||||
set(QT_QTXML_LIBRARY
|
||||
optimized QtXml4.lib
|
||||
debug QtXmld4.lib
|
||||
)
|
||||
|
||||
set(QT_QTUITOOLS_LIBRARY
|
||||
optimized QtUiTools.lib
|
||||
debug QtUiToolsd.lib
|
||||
)
|
||||
|
||||
set(QT_QTMAIN_LIBRARY
|
||||
debug qtmaind.lib
|
||||
optimized qtmain.lib
|
||||
)
|
||||
|
||||
set(QT_UIC_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/uic.exe)
|
||||
set(QT_MOC_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/moc.exe)
|
||||
set(QT_RCC_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/rcc.exe)
|
||||
@@ -341,6 +356,7 @@ set(OCC_LIBRARIES
|
||||
optimized TKSTL
|
||||
optimized TKShHealing
|
||||
optimized TKXSBase
|
||||
optimized TKBin
|
||||
optimized TKBool
|
||||
optimized TKXSBase
|
||||
optimized TKBO
|
||||
@@ -376,6 +392,7 @@ set(OCC_DEBUG_LIBRARIES
|
||||
debug TKSTLd
|
||||
debug TKShHealingd
|
||||
debug TKXSBased
|
||||
debug TKBind
|
||||
debug TKBoold
|
||||
debug TKXSBased
|
||||
debug TKBOd
|
||||
|
||||
+31
-25
@@ -11,16 +11,17 @@ include_directories(${FREECAD_LIBPACK_DIR}/include)
|
||||
set(OPENGL_gl_LIBRARY opengl32 glu32)
|
||||
|
||||
# Python
|
||||
set(PYTHON_LIBRARY optimized python27.lib debug python27_d.lib)
|
||||
set(PYTHON_LIBRARIES optimized python27.lib debug python27_d.lib)
|
||||
set(PYTHON_INCLUDE_PATH ${FREECAD_LIBPACK_DIR}/include/Python-2.7.6)
|
||||
set(PYTHON_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/Python-2.7.6)
|
||||
set(PYTHON_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/python.exe)
|
||||
set(PYTHONLIBS_FOUND TRUE)
|
||||
|
||||
# XercesC
|
||||
set(XERCESC_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/xerces-c-3.1.0)
|
||||
set(XERCESC_LIBRARIES xerces-c_3.lib)
|
||||
set(XERCESC_DEBUG_LIBRARIES xerces-c_3D.lib)
|
||||
set(XERCESC_FOUND TRUE)
|
||||
set(XercesC_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/xerces-c-3.1.0)
|
||||
set(XercesC_LIBRARIES xerces-c_3.lib)
|
||||
set(XercesC_DEBUG_LIBRARIES xerces-c_3D.lib)
|
||||
set(XercesC_FOUND TRUE)
|
||||
|
||||
# Boost
|
||||
set(Boost_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/boost-1_54)
|
||||
@@ -29,15 +30,15 @@ set(Boost_LIBRARIES
|
||||
optimized boost_system-vc90-mt-1_54.lib
|
||||
optimized boost_graph-vc90-mt-1_54.lib
|
||||
optimized boost_program_options-vc90-mt-1_54.lib
|
||||
optimized boost_python-vc90-mt-1_54.lib
|
||||
optimized boost_regex-vc90-mt-1_54.lib
|
||||
optimized boost_signals-vc90-mt-1_54.lib
|
||||
optimized boost_thread-vc90-mt-1_54.lib
|
||||
)
|
||||
set(Boost_DEBUG_LIBRARIES
|
||||
debug boost_filesystem-vc90-mt-gd-1_54.lib
|
||||
debug boost_system-vc90-mt-gd-1_54.lib
|
||||
debug boost_graph-vc90-mt-gd-1_54.lib
|
||||
debug boost_program_options-vc90-mt-gd-1_54.lib
|
||||
debug boost_python-vc90-mt-gd-1_54.lib
|
||||
debug boost_regex-vc90-mt-gd-1_54.lib
|
||||
debug boost_signals-vc90-mt-gd-1_54.lib
|
||||
debug boost_thread-vc90-mt-gd-1_54.lib
|
||||
@@ -66,24 +67,17 @@ set(SMESH_LIBRARIES
|
||||
set(SMESH_FOUND TRUE)
|
||||
|
||||
# Coin3D
|
||||
find_path(COIN3D_INCLUDE_DIR Inventor/So.h
|
||||
${FREECAD_LIBPACK_DIR}/include/Coin-2.4.5
|
||||
)
|
||||
find_path(COIN3D_INCLUDE_DIR Inventor/So.h
|
||||
find_path(COIN3D_INCLUDE_DIRS Inventor/So.h
|
||||
${FREECAD_LIBPACK_DIR}/include/Coin-4.0.0
|
||||
)
|
||||
find_library(COIN3D_LIBRARY_RELEASE coin2
|
||||
"${FREECAD_LIBPACK_DIR}/lib"
|
||||
)
|
||||
find_library(COIN3D_LIBRARY_DEBUG coin2d
|
||||
"${FREECAD_LIBPACK_DIR}/lib"
|
||||
)
|
||||
find_library(COIN3D_LIBRARY_RELEASE coin4
|
||||
"${FREECAD_LIBPACK_DIR}/lib"
|
||||
)
|
||||
find_library(COIN3D_LIBRARY_DEBUG coin4d
|
||||
"${FREECAD_LIBPACK_DIR}/lib"
|
||||
)
|
||||
set(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
|
||||
debug ${COIN3D_LIBRARY_DEBUG})
|
||||
|
||||
set(COIN3D_FOUND TRUE)
|
||||
|
||||
@@ -110,6 +104,10 @@ set(QT_QTCORE_INCLUDE_DIR
|
||||
${FREECAD_LIBPACK_DIR}/include/Qt-4.8.5/QtCore
|
||||
)
|
||||
|
||||
set(QT_QTXML_INCLUDE_DIR
|
||||
${FREECAD_LIBPACK_DIR}/include/Qt-4.8.5/QtXml
|
||||
)
|
||||
|
||||
set(QT_QT3SUPPORT_INCLUDE_DIR
|
||||
${FREECAD_LIBPACK_DIR}/include/Qt-4.8.5/Qt3Support
|
||||
)
|
||||
@@ -125,8 +123,6 @@ set(QT_LIBRARIES
|
||||
optimized QtXml4.lib
|
||||
optimized QtOpenGl4.lib
|
||||
optimized QtWebKit4.lib
|
||||
)
|
||||
set(QT_DEBUG_LIBRARIES
|
||||
debug QtCored4.lib
|
||||
debug QtGuid4.lib
|
||||
debug QtDesignerd4.lib
|
||||
@@ -144,12 +140,24 @@ set(QT_QTCORE_LIBRARY
|
||||
debug QtCored4.lib
|
||||
)
|
||||
|
||||
set(QT_QT3SUPPORT_LIBRARY_DEBUG
|
||||
debug Qt3Supportd4.lib
|
||||
set(QT_QTXML_LIBRARY
|
||||
optimized QtXml4.lib
|
||||
debug QtXmld4.lib
|
||||
)
|
||||
|
||||
set(QT_QT3SUPPORT_LIBRARY
|
||||
optimized Qt3Support4.lib
|
||||
debug Qt3Supportd4.lib
|
||||
)
|
||||
|
||||
set(QT_QTUITOOLS_LIBRARY
|
||||
optimized QtUiTools.lib
|
||||
debug QtUiToolsd.lib
|
||||
)
|
||||
|
||||
set(QT_QTMAIN_LIBRARY
|
||||
debug qtmaind.lib
|
||||
optimized qtmain.lib
|
||||
)
|
||||
|
||||
set(QT_UIC_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/uic.exe)
|
||||
@@ -363,6 +371,7 @@ set(OCC_LIBRARIES
|
||||
optimized TKSTL
|
||||
optimized TKShHealing
|
||||
optimized TKXSBase
|
||||
optimized TKBin
|
||||
optimized TKBool
|
||||
optimized TKBO
|
||||
optimized TKBRep
|
||||
@@ -388,6 +397,7 @@ set(OCC_DEBUG_LIBRARIES
|
||||
debug TKSTLd
|
||||
debug TKShHealingd
|
||||
debug TKXSBased
|
||||
debug TKBind
|
||||
debug TKBoold
|
||||
debug TKBOd
|
||||
debug TKBRepd
|
||||
@@ -428,10 +438,6 @@ set(EIGEN2_FOUND TRUE)
|
||||
set(EIGEN3_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/eigen3)
|
||||
set(EIGEN3_FOUND TRUE)
|
||||
|
||||
set(ODE_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/ode-0.11.1)
|
||||
set(ODE_LIBRARIES ${FREECAD_LIBPACK_DIR}/lib/ode_double.lib)
|
||||
set(ODE_FOUND TRUE)
|
||||
|
||||
# FreeType
|
||||
if(FREECAD_USE_FREETYPE)
|
||||
set(FREETYPE_LIBRARIES
|
||||
|
||||
@@ -12,12 +12,14 @@ set(PYTHON_LIBRARY ${FREECAD_LIBPACK_DIR}/lib/python27.lib CACHE FILEPATH "" FOR
|
||||
set(PYTHON_DEBUG_LIBRARY ${FREECAD_LIBPACK_DIR}/lib/python27_d.lib CACHE FILEPATH "" FORCE)
|
||||
set(PYTHON_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/python2.7 CACHE PATH "" FORCE)
|
||||
|
||||
find_library(XERCESC_LIBRARIES xerces-c_3 "${FREECAD_LIBPACK_DIR}/lib")
|
||||
find_library(XERCESC_DEBUG_LIBRARIES xerces-c_3D "${FREECAD_LIBPACK_DIR}/lib")
|
||||
set(XERCESC_FOUND TRUE)
|
||||
find_library(XercesC_LIBRARIES xerces-c_3 "${FREECAD_LIBPACK_DIR}/lib")
|
||||
find_library(XercesC_DEBUG_LIBRARIES xerces-c_3D "${FREECAD_LIBPACK_DIR}/lib")
|
||||
set(XercesC_FOUND TRUE)
|
||||
|
||||
find_library(COIN3D_LIBRARY_RELEASE coin4 "${FREECAD_LIBPACK_DIR}/lib")
|
||||
find_library(COIN3D_LIBRARY_DEBUG coin4d "${FREECAD_LIBPACK_DIR}/lib")
|
||||
set(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
|
||||
debug ${COIN3D_LIBRARY_DEBUG})
|
||||
set(COIN3D_FOUND TRUE)
|
||||
|
||||
set(NETGENDATA ${FREECAD_LIBPACK_DIR}/include/netgen)
|
||||
|
||||
@@ -11,17 +11,17 @@ include_directories(${FREECAD_LIBPACK_DIR}/include)
|
||||
set(OPENGL_gl_LIBRARY opengl32 glu32)
|
||||
|
||||
# Python
|
||||
set(PYTHON_DEBUG_LIBRARY python26_d.lib)
|
||||
set(PYTHON_LIBRARY python26.lib)
|
||||
set(PYTHON_LIBRARIES optimized python26.lib debug python26_d.lib)
|
||||
set(PYTHON_INCLUDE_PATH ${FREECAD_LIBPACK_DIR}/include/Python-2.6.4)
|
||||
set(PYTHON_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/Python-2.6.4)
|
||||
set(PYTHON_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/python.exe)
|
||||
set(PYTHONLIBS_FOUND TRUE)
|
||||
|
||||
# XercesC
|
||||
set(XERCESC_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/xerces-c-3.1.0)
|
||||
set(XERCESC_LIBRARIES xerces-c_3.lib)
|
||||
set(XERCESC_DEBUG_LIBRARIES xerces-c_3D.lib)
|
||||
set(XERCESC_FOUND TRUE)
|
||||
set(XercesC_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/xerces-c-3.1.0)
|
||||
set(XercesC_LIBRARIES xerces-c_3.lib)
|
||||
set(XercesC_DEBUG_LIBRARIES xerces-c_3D.lib)
|
||||
set(XercesC_FOUND TRUE)
|
||||
|
||||
# Boost
|
||||
set(Boost_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/boost-1_41)
|
||||
@@ -30,15 +30,15 @@ set(Boost_LIBRARIES
|
||||
optimized boost_system-vc90-mt-1_41.lib
|
||||
optimized boost_graph-vc90-mt-1_41.lib
|
||||
optimized boost_program_options-vc90-mt-1_41.lib
|
||||
optimized boost_python-vc90-mt-1_41.lib
|
||||
optimized boost_regex-vc90-mt-1_41.lib
|
||||
optimized boost_signals-vc90-mt-1_41.lib
|
||||
optimized boost_thread-vc90-mt-1_41.lib
|
||||
)
|
||||
set(Boost_DEBUG_LIBRARIES
|
||||
debug boost_filesystem-vc90-mt-gd-1_41.lib
|
||||
debug boost_system-vc90-mt-gd-1_41.lib
|
||||
debug boost_graph-vc90-mt-gd-1_41.lib
|
||||
debug boost_program_options-vc90-mt-gd-1_41.lib
|
||||
debug boost_python-vc90-mt-gd-1_41.lib
|
||||
debug boost_regex-vc90-mt-gd-1_41.lib
|
||||
debug boost_signals-vc90-mt-gd-1_41.lib
|
||||
debug boost_thread-vc90-mt-gd-1_41.lib
|
||||
@@ -67,10 +67,10 @@ set(SMESH_LIBRARIES
|
||||
set(SMESH_FOUND TRUE)
|
||||
|
||||
# Coin3D
|
||||
find_path(COIN3D_INCLUDE_DIR Inventor/So.h
|
||||
find_path(COIN3D_INCLUDE_DIRS Inventor/So.h
|
||||
${FREECAD_LIBPACK_DIR}/include/Coin-2.4.5
|
||||
)
|
||||
find_path(COIN3D_INCLUDE_DIR Inventor/So.h
|
||||
find_path(COIN3D_INCLUDE_DIRS Inventor/So.h
|
||||
${FREECAD_LIBPACK_DIR}/include/Coin-3.1.3
|
||||
)
|
||||
find_library(COIN3D_LIBRARY_RELEASE coin2
|
||||
@@ -85,6 +85,8 @@ find_library(COIN3D_LIBRARY_RELEASE coin3
|
||||
find_library(COIN3D_LIBRARY_DEBUG coin3d
|
||||
"${FREECAD_LIBPACK_DIR}/lib"
|
||||
)
|
||||
set(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
|
||||
debug ${COIN3D_LIBRARY_DEBUG})
|
||||
|
||||
set(COIN3D_FOUND TRUE)
|
||||
|
||||
@@ -126,8 +128,6 @@ set(QT_LIBRARIES
|
||||
optimized QtXml4.lib
|
||||
optimized QtOpenGl4.lib
|
||||
optimized QtWebKit4.lib
|
||||
)
|
||||
set(QT_DEBUG_LIBRARIES
|
||||
debug QtCored4.lib
|
||||
debug QtGuid4.lib
|
||||
debug QtDesignerd4.lib
|
||||
@@ -140,20 +140,29 @@ set(QT_DEBUG_LIBRARIES
|
||||
debug QtWebKitd4.lib
|
||||
)
|
||||
|
||||
set(QT_QTCORE_LIBRARY_DEBUG
|
||||
set(QT_QTCORE_LIBRARY
|
||||
optimized QtCore4.lib
|
||||
debug QtCored4.lib
|
||||
)
|
||||
|
||||
set(QT_QTCORE_LIBRARY
|
||||
optimized QtCore4.lib
|
||||
)
|
||||
|
||||
set(QT_QT3SUPPORT_LIBRARY_DEBUG
|
||||
debug Qt3Supportd4.lib
|
||||
set(QT_QTXML_LIBRARY
|
||||
optimized QtXml4.lib
|
||||
debug QtXmld4.lib
|
||||
)
|
||||
|
||||
set(QT_QT3SUPPORT_LIBRARY
|
||||
optimized Qt3Support4.lib
|
||||
debug Qt3Supportd4.lib
|
||||
)
|
||||
|
||||
set(QT_QTUITOOLS_LIBRARY
|
||||
optimized QtUiTools.lib
|
||||
debug QtUiToolsd.lib
|
||||
)
|
||||
|
||||
set(QT_QTMAIN_LIBRARY
|
||||
debug qtmaind.lib
|
||||
optimized qtmain.lib
|
||||
)
|
||||
|
||||
set(QT_UIC_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/uic.exe)
|
||||
@@ -367,6 +376,7 @@ set(OCC_LIBRARIES
|
||||
TKSTL
|
||||
TKShHealing
|
||||
TKXSBase
|
||||
TKBin
|
||||
TKBool
|
||||
TKBO
|
||||
TKBRep
|
||||
@@ -398,10 +408,6 @@ set(EIGEN2_FOUND TRUE)
|
||||
set(EIGEN3_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/eigen3)
|
||||
set(EIGEN3_FOUND TRUE)
|
||||
|
||||
set(ODE_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/ode-0.11.1)
|
||||
set(ODE_LIBRARIES ${FREECAD_LIBPACK_DIR}/lib/ode_double.lib)
|
||||
set(ODE_FOUND TRUE)
|
||||
|
||||
# FreeType
|
||||
if(FREECAD_USE_FREETYPE)
|
||||
set(FREETYPE_LIBRARIES
|
||||
|
||||
@@ -6,6 +6,7 @@ SET(Examples_Files
|
||||
PartDesignExample.FCStd
|
||||
RobotExample.FCStd
|
||||
ArchDetail.FCStd
|
||||
FemCalculixCantilever3D.FCStd
|
||||
)
|
||||
|
||||
ADD_CUSTOM_TARGET(Example_data ALL
|
||||
|
||||
Binary file not shown.
@@ -1,3 +1,27 @@
|
||||
freecad (0.15-1precise3) precise; urgency=low
|
||||
|
||||
* control: added netgen-headers to Build Depends.
|
||||
|
||||
-- Normand Chamberland <gemnoc@gmail.com> Sat, 04 Apr 2015 11:14:23 -0400
|
||||
|
||||
freecad (0.15-1precise2) precise; urgency=low
|
||||
|
||||
* control: added pyside-tools to build deps, broke down python-pyside depends
|
||||
|
||||
-- Normand Chamberland <gemnoc@gmail.com> Thu, 06 Nov 2014 22:10:44 -0500
|
||||
|
||||
freecad (0.15-1precise1) precise; urgency=low
|
||||
|
||||
* Bumped version number as per upstream version
|
||||
|
||||
-- Normand Chamberland <gemnoc@gmail.com> Thu, 07 Aug 2014 11:34:39 -0400
|
||||
|
||||
freecad (0.14-1precise2) precise; urgency=low
|
||||
|
||||
* Set new version number.
|
||||
|
||||
-- Werner Mayer <wmayer@users.sourceforge.net> Sat, 13 Jul 2013 12:53:55 +0200
|
||||
|
||||
freecad (0.13-1precise2) precise; urgency=low
|
||||
|
||||
* Fix hard dependency on libgl1-mesa-glx preventing installation on
|
||||
|
||||
+11
-10
@@ -5,24 +5,25 @@ Maintainer: Debian Science Maintainers <debian-science-maintainers@lists.alioth.
|
||||
Uploaders: Teemu Ikonen <tpikonen@gmail.com>, "Adam C. Powell, IV" <hazelsct@debian.org>, Anton Gladky <gladky.anton@gmail.com>
|
||||
Vcs-Browser: http://git.debian.org/?p=debian-science/packages/freecad.git
|
||||
Vcs-Git: git://git.debian.org/git/debian-science/packages/freecad.git
|
||||
Homepage: https://sourceforge.net/apps/mediawiki/free-cad/index.php?title=Main_Page
|
||||
Homepage: http://www.freecadweb.org/
|
||||
Build-Depends: debhelper (>= 7.0.50~), cmake,
|
||||
libboost-dev, libboost-date-time-dev, libboost-filesystem-dev,
|
||||
libboost-graph-dev, libboost-iostreams-dev, libboost-program-options-dev,
|
||||
libboost-regex-dev, libboost-serialization-dev, libboost-signals-dev,
|
||||
libboost-thread-dev, libboost-python-dev, python-dev, python-support,
|
||||
libqt4-dev, libxt-dev, libxext-dev, libxmu-dev, libxi-dev, libx11-dev,
|
||||
libcoin80-dev, libsoqt4-dev, libeigen3-dev,
|
||||
zlib1g-dev, libxerces-c-dev, liboce-foundation-dev,
|
||||
liboce-modeling-dev, liboce-ocaf-dev,
|
||||
liboce-visualization-dev, python-cxx-dev, libswscale-dev,
|
||||
libzipios++-dev, swig, gfortran, f2c, libqtwebkit-dev, libspnav-dev, libfreetype6-dev,
|
||||
libpyside-dev, libshiboken-dev, pyside-tools
|
||||
Standards-Version: 3.9.1
|
||||
libcoin60-dev, libsoqt4-dev, libeigen3-dev,
|
||||
zlib1g-dev, libxerces-c2-dev, liboce-foundation-dev,
|
||||
liboce-modeling-dev, liboce-ocaf-dev, liboce-visualization-dev,
|
||||
python-cxx-dev, libswscale-dev, libzipios++-dev, swig, gfortran,
|
||||
f2c, libqtwebkit-dev, libspnav-dev, libfreetype6-dev, libfreeimage-dev,
|
||||
libpyside-dev, libshiboken-dev, pyside-tools, netgen-headers
|
||||
Standards-Version: 3.9.3
|
||||
|
||||
Package: freecad
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, python-pyside.qtcore,
|
||||
python-pyside.qtsvg, python-pyside.qtuitools
|
||||
Recommends: python-pivy, python
|
||||
Suggests: freecad-doc
|
||||
Description: Extensible Open Source CAx program (beta)
|
||||
@@ -62,7 +63,7 @@ Description: FreeCAD documentation
|
||||
.
|
||||
This package contains the FreeCAD documentation.
|
||||
.
|
||||
The documentation is provided in Qt help format;
|
||||
The documentation is provided in Qt's new help format;
|
||||
the new help format version can be viewed in conjunction with the Qt Assistant
|
||||
found in the qt4-dev-tools package.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Format-Specification: http://dep.debian.net/deps/dep5/
|
||||
Maintainer: Werner Mayer <wmayer@users.sourceforge.net>
|
||||
Format: http://dep.debian.net/deps/dep5/
|
||||
Upstream-Contact: Werner Mayer <wmayer@users.sourceforge.net>
|
||||
X-Packaged-By: Werner Mayer <wmayer@users.sourceforge.net>
|
||||
X-Packaged-Date: 2006-09-26_16:55:15+02:00
|
||||
Source: http://sourceforge.net/projects/free-cad
|
||||
|
||||
@@ -4,5 +4,4 @@ usr/share/icons/hicolor/48x48/apps
|
||||
usr/share/icons/hicolor/64x64/apps
|
||||
usr/share/icons/hicolor/scalable/apps
|
||||
usr/share/icons/hicolor/64x64/mimetypes
|
||||
usr/share/pixmaps
|
||||
|
||||
|
||||
@@ -11,8 +11,5 @@ Abstract: FreeCAD is a general purpose Open Source 3D
|
||||
Section: Science/Engineering
|
||||
|
||||
Format: HTML
|
||||
Index: /usr/share/doc/freecad/Start_Page.html
|
||||
Files: /usr/share/doc/freecad/*.q*
|
||||
|
||||
Format: PDF
|
||||
Files: /usr/share/doc/freecad/kr_16.pdf.gz /usr/share/doc/freecad/kr_210_2.pdf.gz /usr/share/doc/freecad/kr_500_2.pdf.gz
|
||||
Index: /usr/share/doc/freecad-doc/Start_Page.html
|
||||
Files: /usr/share/doc/freecad-doc/*.q*
|
||||
|
||||
@@ -1 +1 @@
|
||||
debian/tmp/usr/doc/*
|
||||
debian/tmp/usr/lib/freecad/doc/*
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
file formats such as STEP, IGES, STL and others.</p>
|
||||
</description>
|
||||
<screenshots>
|
||||
<screenshot type="default" width="800" height="600">http://www.freecadweb.org/wiki/index.php?title=File:FreeCAD011.png</screenshot>
|
||||
<screenshot type="default" width="800" height="600">http://www.freecadweb.org/wiki/images/5/56/Freecad_jeep.png</screenshot>
|
||||
</screenshots>
|
||||
<url type="homepage">http://www.freecadweb.org</url>
|
||||
<updatecontact>yorik@uncreated.net</updatecontact>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
debian/freecad.desktop usr/share/applications
|
||||
debian/menu usr/share/menu/freecad
|
||||
usr/share/freecad
|
||||
usr/lib/freecad/bin
|
||||
usr/lib/freecad/Mod
|
||||
usr/lib/freecad/lib
|
||||
@@ -0,0 +1 @@
|
||||
freecad: binary-or-shlib-defines-rpath
|
||||
@@ -1 +1,2 @@
|
||||
debian/freecad.1
|
||||
debian/mime/freecad-thumbnailer.1
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@
|
||||
section="Applications/Science/Engineering"\
|
||||
title="FreeCAD"\
|
||||
command="/usr/bin/freecad"\
|
||||
icon="/usr/share/pixmaps/freecad.xpm"
|
||||
icon="/usr/share/freecad/freecad.xpm"
|
||||
|
||||
|
||||
+29
-88
@@ -1,100 +1,41 @@
|
||||
#!/usr/bin/make -f
|
||||
# -*- makefile -*-
|
||||
%:
|
||||
dh $@ --buildsystem=cmake --parallel --with python2
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
# For testing: fakeroot debian/rules binary
|
||||
|
||||
# These are used for cross-compiling and for saving the configure script
|
||||
# from having to guess our platform (since we know it already)
|
||||
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
|
||||
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
|
||||
|
||||
CFLAGS = -Wall -g
|
||||
|
||||
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
||||
CFLAGS += -O0
|
||||
else
|
||||
CFLAGS += -O2
|
||||
endif
|
||||
|
||||
configure:
|
||||
dh_testdir
|
||||
cmake . \
|
||||
extra_flags += \
|
||||
-DFREECAD_BUILD_DEBIAN=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr/lib/freecad \
|
||||
-DCMAKE_INSTALL_MANDIR=/usr/share/man \
|
||||
-DCMAKE_INSTALL_INFODIR=/usr/share/info \
|
||||
-DCMAKE_INSTALL_DATADIR=/usr/share/freecad \
|
||||
-DCMAKE_INSTALL_INCLUDEDIR=/usr/include/freecad \
|
||||
-DCMAKE_INSTALL_DOCDIR=/usr/share/doc/freecad
|
||||
-DBUILD_FEM_NETGEN=ON \
|
||||
-DCMAKE_CXX_FLAGS="-Wall -DHAVE_SWIG=1 -fpermissive $(shell dpkg-buildflags --get CXXFLAGS) $(shell dpkg-buildflags --get CPPFLAGS)" \
|
||||
-DCMAKE_C_FLAGS="-Wall -fpermissive $(shell dpkg-buildflags --get CFLAGS) $(shell dpkg-buildflags --get CPPFLAGS)" \
|
||||
-DCMAKE_SHARED_LINKER_FLAGS="$(shell dpkg-buildflags --get LDFLAGS)" \
|
||||
-DLIB_SUFFIX="" \
|
||||
-DOCC_INCLUDE_DIR="/usr/include/oce" \
|
||||
-DCMAKE_INSTALL_PREFIX="/usr/lib/freecad" \
|
||||
-DCMAKE_INSTALL_DATADIR="/usr/share/freecad"
|
||||
|
||||
build: build-stamp
|
||||
|
||||
build-stamp: configure
|
||||
dh_testdir
|
||||
$(MAKE)
|
||||
touch $@
|
||||
|
||||
clean:
|
||||
dh clean
|
||||
rm -f build-stamp
|
||||
find -name '*.pyc' | xargs rm -f
|
||||
find -name 'moc_*.cpp' | xargs rm -f
|
||||
find -name 'ui_*.h' | xargs rm -f
|
||||
find -name 'CMakeFiles' | xargs rm -rf
|
||||
rm -f stamp-h1
|
||||
|
||||
install: build install-stamp
|
||||
install-stamp:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_prep
|
||||
dh_installdirs
|
||||
$(MAKE) install/fast DESTDIR=$(CURDIR)/debian/tmp/freecad
|
||||
# install the core system
|
||||
dh_install -pfreecad debian/tmp/freecad/usr/share/freecad/* usr/share/freecad/
|
||||
# Desktop icons
|
||||
dh_install -pfreecad debian/tmp/freecad/usr/share/freecad/freecad.xpm usr/share/pixmaps
|
||||
install -m 644 debian/tmp/freecad/usr/share/freecad/freecad-icon-16.png debian/freecad/usr/share/icons/hicolor/16x16/apps/freecad.png
|
||||
install -m 644 debian/tmp/freecad/usr/share/freecad/freecad-icon-32.png debian/freecad/usr/share/icons/hicolor/32x32/apps/freecad.png
|
||||
install -m 644 debian/tmp/freecad/usr/share/freecad/freecad-icon-32.png debian/freecad/usr/share/icons/hicolor/48x48/apps/freecad.png
|
||||
install -m 644 debian/tmp/freecad/usr/share/freecad/freecad-icon-64.png debian/freecad/usr/share/icons/hicolor/64x64/apps/freecad.png
|
||||
install -m 644 debian/tmp/freecad/usr/share/freecad/freecad.svg debian/freecad/usr/share/icons/hicolor/scalable/apps/freecad.svg
|
||||
install -m 644 debian/tmp/freecad/usr/share/freecad/freecad-doc.png debian/freecad/usr/share/icons/hicolor/64x64/mimetypes/application-x-extension-fcstd.png
|
||||
|
||||
dh_install -pfreecad debian/tmp/freecad/usr/lib/freecad/bin usr/lib/freecad
|
||||
dh_install -pfreecad debian/tmp/freecad/usr/lib/freecad/lib usr/lib/freecad
|
||||
dh_install -pfreecad debian/tmp/freecad/usr/lib/freecad/Mod usr/lib/freecad
|
||||
dh_install debian/freecad.desktop usr/share/applications
|
||||
dh_installman debian/freecad.1 debian/mime/freecad-thumbnailer.1
|
||||
dh_installchangelogs ChangeLog.txt
|
||||
# install the gnome app file
|
||||
df_install debian/freecad.appdata.xml debian/freecad/usr/share/appdata
|
||||
# install the headers
|
||||
#dh_install -pfreecad-dev debian/tmp/freecad/usr/include/* usr/include
|
||||
# install the help system
|
||||
dh_install -pfreecad-doc debian/tmp/freecad/usr/share/doc/* usr/share/doc/
|
||||
# install MIME stuff
|
||||
dh_install debian/mime/freecad-thumbnailer usr/bin
|
||||
dh_install debian/mime/freecad.thumbnailer usr/share/thumbnailers
|
||||
dh_install debian/mime/freecad.schemas etc/gconf/schemas
|
||||
dh_gconf -pfreecad
|
||||
dh_installmime
|
||||
touch install-stamp
|
||||
override_dh_auto_configure:
|
||||
dh_auto_configure -- $(extra_flags)
|
||||
cp -f src/Build/Version.h obj-$(DEB_BUILD_GNU_TYPE)/src/Build/Version.h
|
||||
|
||||
override_dh_compress:
|
||||
dh_compress -X.qch -X.qhc
|
||||
|
||||
override_dh_makeshlibs:
|
||||
override_dh_installchangelogs:
|
||||
dh_installchangelogs ChangeLog.txt
|
||||
|
||||
override_dh_installmime:
|
||||
dh_installmime
|
||||
dh_install debian/mime/freecad-thumbnailer usr/bin
|
||||
dh_install debian/mime/freecad.thumbnailer usr/share/thumbnailers
|
||||
dh_install debian/mime/freecad.schemas etc/gconf/schemas
|
||||
|
||||
override_dh_icons:
|
||||
install -m 644 debian/freecad/usr/share/freecad/freecad-icon-16.png debian/freecad/usr/share/icons/hicolor/16x16/apps/freecad.png
|
||||
install -m 644 debian/freecad/usr/share/freecad/freecad-icon-32.png debian/freecad/usr/share/icons/hicolor/32x32/apps/freecad.png
|
||||
install -m 644 debian/freecad/usr/share/freecad/freecad-icon-32.png debian/freecad/usr/share/icons/hicolor/48x48/apps/freecad.png
|
||||
install -m 644 debian/freecad/usr/share/freecad/freecad-icon-64.png debian/freecad/usr/share/icons/hicolor/64x64/apps/freecad.png
|
||||
install -m 644 debian/freecad/usr/share/freecad/freecad.svg debian/freecad/usr/share/icons/hicolor/scalable/apps/freecad.svg
|
||||
install -m 644 debian/freecad/usr/share/freecad/freecad-doc.png debian/freecad/usr/share/icons/hicolor/64x64/mimetypes/application-x-extension-fcstd.png
|
||||
|
||||
binary-indep: build install
|
||||
dh binary-indep
|
||||
|
||||
binary-arch: build install
|
||||
dh binary-arch
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install
|
||||
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
add_subdirectory(src)
|
||||
Vendored
-47
@@ -1,47 +0,0 @@
|
||||
ANN: Approximate Nearest Neighbors
|
||||
Version: 1.1.1
|
||||
Release Date: Aug 4, 2006
|
||||
----------------------------------------------------------------------------
|
||||
Copyright (c) 1997-2005 University of Maryland and Sunil Arya and David
|
||||
Mount All Rights Reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser Public License as published by the
|
||||
Free Software Foundation; either version 2.1 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser Public License for more details.
|
||||
|
||||
A copy of the terms and conditions of the license can be found in
|
||||
License.txt or online at
|
||||
|
||||
http://www.gnu.org/copyleft/lesser.html
|
||||
|
||||
To obtain a copy, write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
Disclaimer
|
||||
----------
|
||||
The University of Maryland and the authors make no representations about
|
||||
the suitability or fitness of this software for any purpose. It is
|
||||
provided "as is" without express or implied warranty.
|
||||
---------------------------------------------------------------------
|
||||
|
||||
Authors
|
||||
-------
|
||||
David Mount
|
||||
Dept of Computer Science
|
||||
University of Maryland,
|
||||
College Park, MD 20742 USA
|
||||
mount@cs.umd.edu
|
||||
http://www.cs.umd.edu/~mount/
|
||||
|
||||
Sunil Arya
|
||||
Dept of Computer Science
|
||||
Hong University of Science and Technology
|
||||
Clearwater Bay, HONG KONG
|
||||
arya@cs.ust.hk
|
||||
http://www.cs.ust.hk/faculty/arya/
|
||||
Vendored
-450
@@ -1,450 +0,0 @@
|
||||
----------------------------------------------------------------------
|
||||
The ANN Library (all versions) is provided under the terms and
|
||||
conditions of the GNU Lesser General Public Library, which is stated
|
||||
below. It can also be found at:
|
||||
|
||||
http://www.gnu.org/copyleft/lesser.html
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence the
|
||||
version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom to
|
||||
share and change it. By contrast, the GNU General Public Licenses are
|
||||
intended to guarantee your freedom to share and change free software--to
|
||||
make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the Free
|
||||
Software Foundation and other authors who decide to use it. You can use
|
||||
it too, but we suggest you first think carefully about whether this
|
||||
license or the ordinary General Public License is the better strategy to
|
||||
use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish); that you receive source code or can get it if
|
||||
you want it; that you can change the software and use pieces of it in
|
||||
new free programs; and that you are informed that you can do these
|
||||
things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for you
|
||||
if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis or
|
||||
for a fee, you must give the recipients all the rights that we gave you.
|
||||
You must make sure that they, too, receive or can get the source code.
|
||||
If you link other code with the library, you must provide complete
|
||||
object files to the recipients, so that they can relink them with the
|
||||
library after making changes to the library and recompiling it. And you
|
||||
must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that there is
|
||||
no warranty for the free library. Also, if the library is modified by
|
||||
someone else and passed on, the recipients should know that what they
|
||||
have is not the original version, so that the original author's
|
||||
reputation will not be affected by problems that might be introduced by
|
||||
others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of any
|
||||
free program. We wish to make sure that a company cannot effectively
|
||||
restrict the users of a free program by obtaining a restrictive license
|
||||
from a patent holder. Therefore, we insist that any patent license
|
||||
obtained for a version of the library must be consistent with the full
|
||||
freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the ordinary
|
||||
GNU General Public License. This license, the GNU Lesser General Public
|
||||
License, applies to certain designated libraries, and is quite different
|
||||
from the ordinary General Public License. We use this license for
|
||||
certain libraries in order to permit linking those libraries into
|
||||
non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using a
|
||||
shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the entire
|
||||
combination fits its criteria of freedom. The Lesser General Public
|
||||
License permits more lax criteria for linking other code with the
|
||||
library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it does
|
||||
Less to protect the user's freedom than the ordinary General Public
|
||||
License. It also provides other free software developers Less of an
|
||||
advantage over competing non-free programs. These disadvantages are the
|
||||
reason we use the ordinary General Public License for many libraries.
|
||||
However, the Lesser license provides advantages in certain special
|
||||
circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to encourage
|
||||
the widest possible use of a certain library, so that it becomes a
|
||||
de-facto standard. To achieve this, non-free programs must be allowed to
|
||||
use the library. A more frequent case is that a free library does the
|
||||
same job as widely used non-free libraries. In this case, there is
|
||||
little to gain by limiting the free library to free software only, so we
|
||||
use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of free
|
||||
software. For example, permission to use the GNU C Library in non-free
|
||||
programs enables many more people to use the whole GNU operating system,
|
||||
as well as its variant, the GNU/Linux operating system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is linked
|
||||
with the Library has the freedom and the wherewithal to run that program
|
||||
using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or other
|
||||
authorized party saying it may be distributed under the terms of this
|
||||
Lesser General Public License (also called "this License"). Each
|
||||
licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work which
|
||||
has been distributed under these terms. A "work based on the Library"
|
||||
means either the Library or any derivative work under copyright law:
|
||||
that is to say, a work containing the Library or a portion of it, either
|
||||
verbatim or with modifications and/or translated straightforwardly into
|
||||
another language. (Hereinafter, translation is included without
|
||||
limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for making
|
||||
modifications to it. For a library, complete source code means all the
|
||||
source code for all modules it contains, plus any associated interface
|
||||
definition files, plus the scripts used to control compilation and
|
||||
installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of running
|
||||
a program using the Library is not restricted, and output from such a
|
||||
program is covered only if its contents constitute a work based on the
|
||||
Library (independent of the use of the Library in a tool for writing
|
||||
it). Whether that is true depends on what the Library does and what the
|
||||
program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's complete
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the notices
|
||||
that refer to this License and to the absence of any warranty; and
|
||||
distribute a copy of this License along with the Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion of
|
||||
it, thus forming a work based on the Library, and copy and distribute
|
||||
such modifications or work under the terms of Section 1 above, provided
|
||||
that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the application.
|
||||
Therefore, Subsection 2d requires that any application-supplied function
|
||||
or table used by this function must be optional: if the application does
|
||||
not supply it, the square root function must still compute square
|
||||
roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library, and
|
||||
can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based on
|
||||
the Library, the distribution of the whole must be on the terms of this
|
||||
License, whose permissions for other licensees extend to the entire
|
||||
whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or
|
||||
contest your rights to work written entirely by you; rather, the intent
|
||||
is to exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the
|
||||
Library with the Library (or with a work based on the Library) on a
|
||||
volume of a storage or distribution medium does not bring the other work
|
||||
under the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so that
|
||||
they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in these
|
||||
notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for that
|
||||
copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of the
|
||||
Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or derivative
|
||||
of it, under Section 2) in object code or executable form under the
|
||||
terms of Sections 1 and 2 above provided that you accompany it with the
|
||||
complete corresponding machine-readable source code, which must be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy from a
|
||||
designated place, then offering equivalent access to copy the source
|
||||
code from the same place satisfies the requirement to distribute the
|
||||
source code, even though third parties are not compelled to copy the
|
||||
source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the Library,
|
||||
but is designed to work with the Library by being compiled or linked
|
||||
with it, is called a "work that uses the Library". Such a work, in
|
||||
isolation, is not a derivative work of the Library, and therefore falls
|
||||
outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library creates
|
||||
an executable that is a derivative of the Library (because it contains
|
||||
portions of the Library), rather than a "work that uses the library".
|
||||
The executable is therefore covered by this License. Section 6 states
|
||||
terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be linked
|
||||
without the Library, or if the work is itself a library. The threshold
|
||||
for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data structure
|
||||
layouts and accessors, and small macros and small inline functions (ten
|
||||
lines or less in length), then the use of the object file is
|
||||
unrestricted, regardless of whether it is legally a derivative work.
|
||||
(Executables containing this object code plus portions of the Library
|
||||
will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6, whether
|
||||
or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or link a
|
||||
"work that uses the Library" with the Library to produce a work
|
||||
containing portions of the Library, and distribute that work under terms
|
||||
of your choice, provided that the terms permit modification of the work
|
||||
for the customer's own use and reverse engineering for debugging such
|
||||
modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work during
|
||||
execution displays copyright notices, you must include the copyright
|
||||
notice for the Library among them, as well as a reference directing the
|
||||
user to the copy of this License. Also, you must do one of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood that
|
||||
the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
c) Accompany the work with a written offer, valid for at least
|
||||
three years, to give the same user the materials specified in
|
||||
Subsection 6a, above, for a charge no more than the cost of
|
||||
performing this distribution.
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the Library"
|
||||
must include any data and utility programs needed for reproducing the
|
||||
executable from it. However, as a special exception, the materials to be
|
||||
distributed need not include anything that is normally distributed (in
|
||||
either source or binary form) with the major components (compiler,
|
||||
kernel, and so on) of the operating system on which the executable runs,
|
||||
unless that component itself accompanies the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license restrictions
|
||||
of other proprietary libraries that do not normally accompany the
|
||||
operating system. Such a contradiction means you cannot use both them
|
||||
and the Library together in an executable that you distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the Library
|
||||
side-by-side in a single library together with other library facilities
|
||||
not covered by this License, and distribute such a combined library,
|
||||
provided that the separate distribution of the work based on the Library
|
||||
and of the other library facilities is otherwise permitted, and provided
|
||||
that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute the
|
||||
Library except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense, link with, or distribute the
|
||||
Library is void, and will automatically terminate your rights under this
|
||||
License. However, parties who have received copies, or rights, from you
|
||||
under this License will not have their licenses terminated so long as
|
||||
such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and all
|
||||
its terms and conditions for copying, distributing or modifying the
|
||||
Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot distribute
|
||||
so as to satisfy simultaneously your obligations under this License and
|
||||
any other pertinent obligations, then as a consequence you may not
|
||||
distribute the Library at all. For example, if a patent license would
|
||||
not permit royalty-free redistribution of the Library by all those who
|
||||
receive copies directly or indirectly through you, then the only way you
|
||||
could satisfy both it and this License would be to refrain entirely from
|
||||
distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply, and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is implemented
|
||||
by public license practices. Many people have made generous
|
||||
contributions to the wide range of software distributed through that
|
||||
system in reliance on consistent application of that system; it is up to
|
||||
the author/donor to decide if he or she is willing to distribute
|
||||
software through any other system and a licensee cannot impose that
|
||||
choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be
|
||||
a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may
|
||||
add an explicit geographical distribution limitation excluding those
|
||||
countries, so that distribution is permitted only in or among countries
|
||||
not thus excluded. In such case, this License incorporates the
|
||||
limitation as if written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new versions
|
||||
of the Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a license
|
||||
version number, you may choose any version ever published by the Free
|
||||
Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free Software
|
||||
Foundation; we sometimes make exceptions for this. Our decision will be
|
||||
guided by the two goals of preserving the free status of all derivatives
|
||||
of our free software and of promoting the sharing and reuse of software
|
||||
generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
|
||||
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH
|
||||
YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
|
||||
NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR
|
||||
DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
|
||||
DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY
|
||||
(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
|
||||
INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF
|
||||
THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR
|
||||
OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
Vendored
-46
@@ -1,46 +0,0 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll", "dll\dll.vcproj", "{A7D00B21-CB9C-4BBB-8DEE-51025104F867}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample", "sample\sample.vcproj", "{C76F5A10-7A4A-4546-9414-296DB38BE825}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{A7D00B21-CB9C-4BBB-8DEE-51025104F867} = {A7D00B21-CB9C-4BBB-8DEE-51025104F867}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test\test.vcproj", "{6AC673C7-7B3F-4520-A761-647B212A4BEF}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{A7D00B21-CB9C-4BBB-8DEE-51025104F867} = {A7D00B21-CB9C-4BBB-8DEE-51025104F867}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ann2fig", "ann2fig\ann2fig.vcproj", "{622DD7D8-0C0A-4303-9176-C9A8AF467E70}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{A7D00B21-CB9C-4BBB-8DEE-51025104F867} = {A7D00B21-CB9C-4BBB-8DEE-51025104F867}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{A7D00B21-CB9C-4BBB-8DEE-51025104F867}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{A7D00B21-CB9C-4BBB-8DEE-51025104F867}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{A7D00B21-CB9C-4BBB-8DEE-51025104F867}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{A7D00B21-CB9C-4BBB-8DEE-51025104F867}.Release|Win32.Build.0 = Release|Win32
|
||||
{C76F5A10-7A4A-4546-9414-296DB38BE825}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C76F5A10-7A4A-4546-9414-296DB38BE825}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C76F5A10-7A4A-4546-9414-296DB38BE825}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C76F5A10-7A4A-4546-9414-296DB38BE825}.Release|Win32.Build.0 = Release|Win32
|
||||
{6AC673C7-7B3F-4520-A761-647B212A4BEF}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{6AC673C7-7B3F-4520-A761-647B212A4BEF}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{6AC673C7-7B3F-4520-A761-647B212A4BEF}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{6AC673C7-7B3F-4520-A761-647B212A4BEF}.Release|Win32.Build.0 = Release|Win32
|
||||
{622DD7D8-0C0A-4303-9176-C9A8AF467E70}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{622DD7D8-0C0A-4303-9176-C9A8AF467E70}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{622DD7D8-0C0A-4303-9176-C9A8AF467E70}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{622DD7D8-0C0A-4303-9176-C9A8AF467E70}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
Vendored
-53
@@ -1,53 +0,0 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
# Makefile for Windows Versions.
|
||||
#
|
||||
# ANN: Approximate Nearest Neighbors
|
||||
# Version: 1.1.1 08/04/06
|
||||
#-----------------------------------------------------------------------------
|
||||
# Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
# David Mount. All Rights Reserved.
|
||||
#
|
||||
# This software and related documentation is part of the Approximate
|
||||
# Nearest Neighbor Library (ANN). This software is provided under
|
||||
# the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
# file ../ReadMe.txt for further information.
|
||||
#
|
||||
# The University of Maryland (U.M.) and the authors make no
|
||||
# representations about the suitability or fitness of this software for
|
||||
# any purpose. It is provided "as is" without express or implied
|
||||
# warranty.
|
||||
#-----------------------------------------------------------------------------
|
||||
# Revision 1.0 05/03/05
|
||||
# Initial release
|
||||
# Revision 1.1.1 08/04/06
|
||||
# Added copyright/license
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# This is not used for compiling the dll. It is just used for cleaning
|
||||
# things up for distribution. For compilcation, open the Ann.sln
|
||||
# solution file in Microsoft Windows Visual Studio.NET.
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
default:
|
||||
@echo "Enter one of the following:"
|
||||
@echo " make clean remove object files"
|
||||
@echo " make realclean remove library and executable files"
|
||||
@echo " "
|
||||
@echo "See file Makefile for other compilation options."
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Remove .o files and core files
|
||||
#-----------------------------------------------------------------------------
|
||||
clean:
|
||||
-rm -f -r ann2fig/Debug ann2fig/Release
|
||||
-rm -f -r dll/Debug dll/Release
|
||||
-rm -f -r sample/Debug sample/Release
|
||||
-rm -f -r test/Debug test/Release
|
||||
-rm -f Ann.ncb Ann.suo
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Remove everthing that can be remade
|
||||
#-----------------------------------------------------------------------------
|
||||
realclean: clean
|
||||
-rm -f bin/*
|
||||
@@ -1,134 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="ann2fig"
|
||||
ProjectGUID="{622DD7D8-0C0A-4303-9176-C9A8AF467E70}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="5"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\bin\ann2fig.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/ann2fig.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="4"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\bin\ann2fig.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
|
||||
<File
|
||||
RelativePath="..\..\ann2fig\ann2fig.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
-452
@@ -1,452 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="dll"
|
||||
SccProjectName=""
|
||||
SccLocalPath="">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DLL_EXPORTS;ANN_PERF;ANN_NO_RANDOM"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderThrough="stdafx.h"
|
||||
PrecompiledHeaderFile=".\Debug/dll.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\bin\ANN.dll"
|
||||
LinkIncremental="0"
|
||||
SuppressStartupBanner="TRUE"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\Debug\ANN.pdb"
|
||||
ImportLibrary=".\Debug\ANN.lib"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Debug/dll.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="3081"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DLL_EXPORTS;ANN_NO_RANDOM"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderThrough="stdafx.h"
|
||||
PrecompiledHeaderFile=".\Release/dll.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\bin\ANN.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
ProgramDatabaseFile=".\Release\ANN.pdb"
|
||||
ImportLibrary=".\Release\ANN.lib"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Release/dll.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="3081"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
<File
|
||||
RelativePath="..\..\src\ANN.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
|
||||
BasicRuntimeChecks="3"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\bd_fix_rad_search.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\bd_pr_search.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
|
||||
BasicRuntimeChecks="3"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\bd_search.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
|
||||
BasicRuntimeChecks="3"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\bd_tree.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
|
||||
BasicRuntimeChecks="3"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\brute.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
|
||||
BasicRuntimeChecks="3"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\kd_dump.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\kd_fix_rad_search.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\kd_pr_search.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
|
||||
BasicRuntimeChecks="3"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\kd_search.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
|
||||
BasicRuntimeChecks="3"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\kd_split.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
|
||||
BasicRuntimeChecks="3"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\kd_tree.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
|
||||
BasicRuntimeChecks="3"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\kd_util.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
|
||||
BasicRuntimeChecks="3"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\perf.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
|
||||
BasicRuntimeChecks="3"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;DLL_EXPORTS"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
<File
|
||||
RelativePath="..\..\include\Ann\ANN.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\Ann\ANNperf.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\Ann\ANNx.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\bd_tree.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\kd_fix_rad_search.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\kd_pr_search.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\kd_search.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\kd_split.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\kd_tree.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\kd_util.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\pr_queue.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\pr_queue_k.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="ReadMe.txt">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -1,194 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="sample"
|
||||
SccProjectName=""
|
||||
SccLocalPath=""
|
||||
Keyword="MFCProj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="2"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;ANN_NO_RANDOM;ANN_PERF"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderThrough="stdafx.h"
|
||||
PrecompiledHeaderFile=".\Debug/sample.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
|
||||
OutputFile="..\bin\ann_sample.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\Debug/sample.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Debug/sample.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="3081"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="2"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ANN_NO_RANDOM"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderThrough="stdafx.h"
|
||||
PrecompiledHeaderFile=".\Release/sample.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
|
||||
OutputFile="..\bin\ann_sample.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
ProgramDatabaseFile=".\Release/sample.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Release/sample.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="3081"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
<File
|
||||
RelativePath="..\..\sample\ann_sample.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Test Data"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="data_pts">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="query_pts">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="sample.out">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="ReadMe.txt">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
-220
@@ -1,220 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="test"
|
||||
SccProjectName=""
|
||||
SccLocalPath=""
|
||||
Keyword="MFCProj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="2"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="NDEBUG;PREP;WIN32;_CONSOLE;ANN_NO_RANDOM"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderThrough="stdafx.h"
|
||||
PrecompiledHeaderFile=".\Release/test.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
|
||||
OutputFile="..\bin\ann_test.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
ProgramDatabaseFile=".\Release/test.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Release/test.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="3081"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="2"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;ANN_NO_RANDOM;ANN_PERF"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderThrough="stdafx.h"
|
||||
PrecompiledHeaderFile=".\Debug/test.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
|
||||
OutputFile="..\bin\ann_test.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\Debug/test.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Debug/test.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="3081"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
<File
|
||||
RelativePath="..\..\test\ann_test.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
PreprocessorDefinitions=""
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\test\rand.cpp">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
PreprocessorDefinitions=""
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"
|
||||
UsePrecompiledHeader="0"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
<File
|
||||
RelativePath="..\..\test\rand.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Test Data"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="test1.data">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="test1.in">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="test1.query">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="test2.in">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="ReadMe.txt">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
Vendored
-194
@@ -1,194 +0,0 @@
|
||||
#-----------------------------------------------------------------------
|
||||
# Makefile variations depending on different configurations
|
||||
#
|
||||
# ANN: Approximate Nearest Neighbors
|
||||
# Version: 1.1 05/03/05
|
||||
#
|
||||
# (This Make-config structure is based on the one used by Mesa by Brian
|
||||
# Paul. If you succeed in porting ANN to your favorite system, please
|
||||
# send email to mount@cs.umd.edu, and I'll try to include it in this
|
||||
# list.)
|
||||
#
|
||||
#----------------------------------------------------------------------
|
||||
# The following configuration-dependent variables are passed to each
|
||||
# the Makefile in subdirectories:
|
||||
#
|
||||
# ANNLIB The name of the ANN library file (usually libANN.a)
|
||||
# C++ The C compiler (usually CC or g++)
|
||||
# MAKELIB The command and flags to make a library file (usually
|
||||
# "ar ...")
|
||||
# CFLAGS Flags to C++ compiler
|
||||
# RANLIB For "ranlib" = use ranlib, "true" = don't use ranlib
|
||||
#----------------------------------------------------------------------
|
||||
# Revision 0.1 09/06/97
|
||||
# Initial release
|
||||
# Revision 0.2 06/24/98
|
||||
# Minor changes to fix compilation errors on SGI systems.
|
||||
# Revision 1.0 04/01/05
|
||||
# Modifications for alpha with cxx
|
||||
# Removed CFLAGS2 options (just write your own)
|
||||
# Removed -DUSING... (Compilers are pretty consistent these days)
|
||||
# Added linux-g++ target
|
||||
# Revision 1.1 05/03/05
|
||||
# Added macosx-g++ target
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Compilation options (add these, as desired, to the CFLAGS variable
|
||||
# in the desired compilation target below). For example,
|
||||
#
|
||||
# "CFLAGS = -O3 -Wall -DANN_PERF"
|
||||
#
|
||||
# -g Debugging.
|
||||
# -O? Run-time optimization.
|
||||
# -Wall Be verbose about warnings.
|
||||
#
|
||||
# -DANN_PERF Enable performance evaluation. (This may slow execution
|
||||
# slightly.)
|
||||
#
|
||||
# -DANN_NO_LIMITS_H
|
||||
# Use this if limits.h or float.h does not exist on your
|
||||
# system. (Also see include/ANN/ANN.h for other changes
|
||||
# needed.)
|
||||
#
|
||||
# -DANN_NO_RANDOM
|
||||
# Use this option if srandom()/random() are not available
|
||||
# on your system. Pseudo-random number generation is used
|
||||
# in the utility program test/ann_test. The combination
|
||||
# srandom()/random() is considered the best pseudo-random
|
||||
# number generator, but is not available on all systems.
|
||||
# If they are not available on your system (for example,
|
||||
# Visual C++) then srand()/rand() will be used instead by
|
||||
# setting this parameter.
|
||||
#
|
||||
# -DWIN32
|
||||
# This is used only for compilation under windows systems
|
||||
# (but instead of using this, use the various .vcproj
|
||||
# files in the MS_WIN32 directory).
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
# Linux using g++
|
||||
linux-g++:
|
||||
$(MAKE) targets \
|
||||
"ANNLIB = libANN.a" \
|
||||
"C++ = g++" \
|
||||
"CFLAGS = -O3" \
|
||||
"MAKELIB = ar ruv" \
|
||||
"RANLIB = true"
|
||||
|
||||
# Mac OS X using g++
|
||||
macosx-g++:
|
||||
$(MAKE) targets \
|
||||
"ANNLIB = libANN.a" \
|
||||
"C++ = g++" \
|
||||
"CFLAGS = -O3" \
|
||||
"MAKELIB = libtool -static -o " \
|
||||
"RANLIB = true"
|
||||
|
||||
# SunOS5
|
||||
sunos5:
|
||||
$(MAKE) targets \
|
||||
"ANNLIB = libANN.a" \
|
||||
"C++ = CC" \
|
||||
"CFLAGS = -O" \
|
||||
"MAKELIB = ar ruv" \
|
||||
"RANLIB = true"
|
||||
|
||||
# SunOS5 with shared libraries
|
||||
sunos5-sl:
|
||||
$(MAKE) targets \
|
||||
"ANNLIB = libANN.a" \
|
||||
"C++ = CC" \
|
||||
"CFLAGS = -Kpic -O" \
|
||||
"MAKELIB = ld -G -o" \
|
||||
"RANLIB = true"
|
||||
|
||||
# SunOS5 with g++
|
||||
sunos5-g++:
|
||||
$(MAKE) targets \
|
||||
"ANNLIB = libANN.a" \
|
||||
"C++ = g++" \
|
||||
"CFLAGS = -O3" \
|
||||
"MAKELIB = ar ruv" \
|
||||
"RANLIB = true"
|
||||
|
||||
# SunOS5 with g++ and shared libraries
|
||||
sunos5-g++-sl:
|
||||
$(MAKE) targets \
|
||||
"ANNLIB = libANN.so" \
|
||||
"C++ = g++" \
|
||||
"CFLAGS = -fpic -O3" \
|
||||
"MAKELIB = ld -G -o" \
|
||||
"RANLIB = true"
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Used for the author's testing and debugging only
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
# debugging version for authors
|
||||
authors-debug:
|
||||
$(MAKE) targets \
|
||||
"ANNLIB = libANN.a" \
|
||||
"C++ = g++" \
|
||||
"CFLAGS = -g -DANN_PERF -Wall" \
|
||||
"MAKELIB = ar ruv" \
|
||||
"RANLIB = true"
|
||||
|
||||
# performance testing version for authors
|
||||
authors-perf:
|
||||
$(MAKE) targets \
|
||||
"ANNLIB = libANN.a" \
|
||||
"C++ = g++" \
|
||||
"CFLAGS = -O3 -DANN_PERF -Wall" \
|
||||
"MAKELIB = ar ruv" \
|
||||
"RANLIB = true"
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Some older ones that I have not tested with the latest version.
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
sgi:
|
||||
$(MAKE) targets \
|
||||
"ANNLIB = libANN.a" \
|
||||
"C++ = CC -ansi" \
|
||||
"CFLAGS = -O2" \
|
||||
"MAKELIB = ar ruv" \
|
||||
"RANLIB = true"
|
||||
|
||||
# DEC Alpha with g++
|
||||
alpha-g++:
|
||||
$(MAKE) targets \
|
||||
"ANNLIB = libANN.a" \
|
||||
"C++ = g++" \
|
||||
"CFLAGS = -O3" \
|
||||
"MAKELIB = ar ruv" \
|
||||
"RANLIB = ranlib"
|
||||
|
||||
# SunOS4
|
||||
sunos4:
|
||||
$(MAKE) targets \
|
||||
"ANNLIB = libANN.a" \
|
||||
"C++ = CC" \
|
||||
"CFLAGS = -O" \
|
||||
"MAKELIB = ar ruv" \
|
||||
"RANLIB = ranlib"
|
||||
|
||||
# SunOS4 with g++
|
||||
sunos4-g++:
|
||||
$(MAKE) targets \
|
||||
"ANNLIB = libANN.a" \
|
||||
"C++ = g++" \
|
||||
"CFLAGS = -O3" \
|
||||
"MAKELIB = ar ruv" \
|
||||
"RANLIB = ranlib"
|
||||
|
||||
# SunOS4 with g++ and shared libraries
|
||||
sunos4-g++-sl:
|
||||
$(MAKE) targets \
|
||||
"ANNLIB = libANN.so" \
|
||||
"C++ = g++" \
|
||||
"CC = g++" \
|
||||
"CFLAGS = -fPIC -O3" \
|
||||
"MAKELIB = ld -assert pure-text -o" \
|
||||
"RANLIB = true"
|
||||
|
||||
Vendored
-68
@@ -1,68 +0,0 @@
|
||||
ANN: Approximate Nearest Neighbors
|
||||
Version: 1.1.1
|
||||
Release date: Aug 4, 2006
|
||||
----------------------------------------------------------------------------
|
||||
Copyright (c) 1997-2005 University of Maryland and Sunil Arya and David
|
||||
Mount. All Rights Reserved. See Copyright.txt and License.txt for
|
||||
complete information on terms and conditions of use and distribution of
|
||||
this software.
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Authors
|
||||
-------
|
||||
David Mount
|
||||
Dept of Computer Science
|
||||
University of Maryland,
|
||||
College Park, MD 20742 USA
|
||||
mount@cs.umd.edu
|
||||
http://www.cs.umd.edu/~mount/
|
||||
|
||||
Sunil Arya
|
||||
Dept of Computer Science
|
||||
Hong University of Science and Technology
|
||||
Clearwater Bay, HONG KONG
|
||||
arya@cs.ust.hk
|
||||
http://www.cs.ust.hk/faculty/arya/
|
||||
|
||||
Introduction
|
||||
------------
|
||||
ANN is a library written in the C++ programming language to support both
|
||||
exact and approximate nearest neighbor searching in spaces of various
|
||||
dimensions. It was implemented by David M. Mount of the University of
|
||||
Maryland, and Sunil Arya of the Hong Kong University of Science and
|
||||
Technology. ANN (pronounced like the name ``Ann'') stands for
|
||||
Approximate Nearest Neighbors. ANN is also a testbed containing
|
||||
programs and procedures for generating data sets, collecting and
|
||||
analyzing statistics on the performance of nearest neighbor algorithms
|
||||
and data structures, and visualizing the geometric structure of these
|
||||
data structures.
|
||||
|
||||
The ANN source code and documentation is available from the following
|
||||
web page:
|
||||
|
||||
http://www.cs.umd.edu/~mount/ANN
|
||||
|
||||
For more information on ANN and its use, see the ``ANN Programming
|
||||
Manual,'' which is provided with the software distribution.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
History
|
||||
Version 0.1 03/04/98
|
||||
Preliminary release
|
||||
Version 0.2 06/24/98
|
||||
Changes for SGI compiler.
|
||||
Version 1.0 04/01/05
|
||||
Fixed a number of small bugs
|
||||
Added dump/load operations
|
||||
Added annClose to eliminate minor memory leak
|
||||
Improved compatibility with current C++ compilers
|
||||
Added compilation for Microsoft Visual Studio.NET
|
||||
Added compilation for Linux 2.x
|
||||
Version 1.1 05/03/05
|
||||
Added make target for Mac OS X
|
||||
Added fixed-radius range searching and counting
|
||||
Added instructions on compiling/using ANN on Windows platforms
|
||||
Fixed minor output bug in ann2fig
|
||||
Version 1.1.1 08/04/06
|
||||
Added "planted" distribution
|
||||
Updated old source comments for GNU LPL.
|
||||
Vendored
-87
@@ -1,87 +0,0 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
# Makefile for ann2fig
|
||||
#
|
||||
# ANN: Approximate Nearest Neighbors
|
||||
# Version: 1.1.1 08/04/06
|
||||
#-----------------------------------------------------------------------------
|
||||
# Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
# David Mount. All Rights Reserved.
|
||||
#
|
||||
# This software and related documentation is part of the Approximate
|
||||
# Nearest Neighbor Library (ANN). This software is provided under
|
||||
# the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
# file ../ReadMe.txt for further information.
|
||||
#
|
||||
# The University of Maryland (U.M.) and the authors make no
|
||||
# representations about the suitability or fitness of this software for
|
||||
# any purpose. It is provided "as is" without express or implied
|
||||
# warranty.
|
||||
#-----------------------------------------------------------------------------
|
||||
# Revision 0.1 03/04/98
|
||||
# Initial release
|
||||
# Revision 1.1.1 08/04/06
|
||||
# Added copyright/license
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Basic definitions
|
||||
# BASEDIR where include, src, lib, ... are
|
||||
# INCDIR include directory
|
||||
# LIBDIR library directory
|
||||
# BINDIR bin directory
|
||||
# LDFLAGS loader flags
|
||||
# ANNLIB ANN library
|
||||
# OTHERLIB other libraries
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
BASEDIR = ..
|
||||
INCDIR = $(BASEDIR)/include
|
||||
LIBDIR = $(BASEDIR)/lib
|
||||
BINDIR = $(BASEDIR)/bin
|
||||
LDFLAGS = -L$(LIBDIR)
|
||||
ANNLIBS = -lANN
|
||||
OTHERLIBS = -lm
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Some more definitions
|
||||
# ANN2FIG name of executable
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
ANN2FIG = ann2fig
|
||||
SOURCES = ann2fig.cpp
|
||||
OBJECTS = $(SOURCES:.cpp=.o)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Make the program
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
default:
|
||||
@echo "Specify a target configuration"
|
||||
|
||||
targets: $(BINDIR)/$(ANN2FIG)
|
||||
|
||||
$(BINDIR)/$(ANN2FIG): $(OBJECTS)
|
||||
$(C++) $(OBJECTS) -o $(ANN2FIG) $(LDFLAGS) $(ANNLIBS) $(OTHERLIBS)
|
||||
mv $(ANN2FIG) $(BINDIR)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# configuration definitions
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
include ../Make-config
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Objects
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
ann2fig.o: ann2fig.cpp
|
||||
$(C++) -c -I$(INCDIR) ann2fig.cpp
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Cleaning
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
clean:
|
||||
-rm -f *.o core
|
||||
|
||||
realclean: clean
|
||||
Vendored
-586
@@ -1,586 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: ann2fig.cpp
|
||||
// Programmer: David Mount
|
||||
// Last modified: 05/03/05
|
||||
// Description: convert ann dump file to fig file
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
// Revision 1.0 04/01/05
|
||||
// Changed dump file suffix from .ann to .dmp.
|
||||
// Revision 1.1 05/03/05
|
||||
// Fixed usage output string.
|
||||
//----------------------------------------------------------------------
|
||||
// This program inputs an ann dump file of a search structure
|
||||
// perhaps along with point coordinates, and outputs a fig (Ver 3.1)
|
||||
// file (see fig2dev (1)) displaying the tree. The fig file may
|
||||
// then be displayed using xfig, or converted to any of a number of
|
||||
// other formats using fig2dev.
|
||||
//
|
||||
// If the dimension is 2 then the entire tree is display. If the
|
||||
// dimension is larger than 2 then the user has the option of
|
||||
// selecting which two dimensions will be displayed, and the slice
|
||||
// value for each of the remaining dimensions. All leaf cells
|
||||
// intersecting the slice are shown along with the points in these
|
||||
// cells. See the procedure getArgs() below for the command-line
|
||||
// arguments.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#include <cstdio> // C standard I/O
|
||||
#include <fstream> // file I/O
|
||||
#include <string> // string manipulation
|
||||
#include <ANN/ANNx.h> // all ANN includes
|
||||
|
||||
using namespace std; // make std:: accessible
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Globals and their defaults
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
const int STRING_LEN = 500; // string lengths
|
||||
const int MAX_DIM = 1000; // maximum dimension
|
||||
const double DEF_SLICE_VAL = 0; // default slice value
|
||||
const char FIG_HEAD[] = {"#FIG 3.1"}; // fig file header
|
||||
const char DUMP_SUFFIX[] = {".dmp"}; // suffix for dump file
|
||||
const char FIG_SUFFIX[] = {".fig"}; // suffix for fig file
|
||||
|
||||
char file_name[STRING_LEN]; // (root) file name (say xxx)
|
||||
char infile_name[STRING_LEN];// input file name (xxx.dmp)
|
||||
char outfile_name[STRING_LEN];// output file name (xxx.fig)
|
||||
char caption[STRING_LEN]; // caption line (= command line)
|
||||
ofstream ofile; // output file stream
|
||||
ifstream ifile; // input file stream
|
||||
int dim_x = 0; // horizontal dimension
|
||||
int dim_y = 1; // vertical dimension
|
||||
double slice_val[MAX_DIM]; // array of slice values
|
||||
double u_per_in = 1200; // fig units per inch (version 3.1)
|
||||
double in_size = 5; // size of figure (in inches)
|
||||
double in_low_x = 1; // fig upper left corner (in inches)
|
||||
double in_low_y = 1; // fig upper left corner (in inches)
|
||||
double u_size = 6000; // size of figure (in units)
|
||||
double u_low_x = 1200; // fig upper left corner (in units)
|
||||
double u_low_y = 1200; // fig upper left corner (in units)
|
||||
int pt_size = 10; // point size (in fig units)
|
||||
|
||||
int dim; // dimension
|
||||
int n_pts; // number of points
|
||||
ANNpointArray pts = NULL; // point array
|
||||
|
||||
double scale; // scale factor for transformation
|
||||
double offset_x; // offsets for transformation
|
||||
double offset_y;
|
||||
|
||||
// transformations
|
||||
#define TRANS_X(p) (offset_x + scale*(p[dim_x]))
|
||||
#define TRANS_Y(p) (offset_y - scale*(p[dim_y]))
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Error handler
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void Error(char *msg, ANNerr level)
|
||||
{
|
||||
if (level == ANNabort) {
|
||||
cerr << "ann2fig: ERROR------->" << msg << "<-------------ERROR\n";
|
||||
exit(1);
|
||||
}
|
||||
else {
|
||||
cerr << "ann2fig: WARNING----->" << msg << "<-------------WARNING\n";
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// set_slice_val - set all slice values to given value
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void set_slice_val(double val)
|
||||
{
|
||||
for (int i = 0; i < MAX_DIM; i++) {
|
||||
slice_val[i] = val;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// getArgs - get input arguments
|
||||
//
|
||||
// Syntax:
|
||||
// ann2fig [-upi scale] [-x low_x] [-y low_y]
|
||||
// [-sz size] [-dx dim_x] [-dy dim_y] [-sl dim value]*
|
||||
// [-ps pointsize]
|
||||
// file
|
||||
//
|
||||
// where:
|
||||
// -upi scale fig units per inch (default = 1200)
|
||||
// -x low_x x and y offset of upper left corner (inches)
|
||||
// -y low_y ...(default = 1)
|
||||
// -sz size maximum side length of figure (in inches)
|
||||
// ...(default = 5)
|
||||
// -dx dim_x horizontal dimension (default = 0)
|
||||
// -dy dim_y vertical dimension (default = 1)
|
||||
// -sv value default slice value (default = 0)
|
||||
// -sl dim value each such pair defines the value along the
|
||||
// ...given dimension at which to slice. This
|
||||
// ...may be supplied for all dimensions except
|
||||
// ...dim_x and dim_y.
|
||||
// -ps pointsize size of points in fig units (def = 10)
|
||||
// file file (input=file.dmp, output=file.fig)
|
||||
//
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void getArgs(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
int sl_dim; // temp slice dimension
|
||||
double sl_val; // temp slice value
|
||||
|
||||
set_slice_val(DEF_SLICE_VAL); // set initial slice-values
|
||||
|
||||
if (argc <= 1) {
|
||||
cerr << "Syntax:\n\
|
||||
ann2fig [-upi scale] [-x low_x] [-y low_y]\n\
|
||||
[-sz size] [-dx dim_x] [-dy dim_y] [-sl dim value]*\n\
|
||||
file\n\
|
||||
\n\
|
||||
where:\n\
|
||||
-upi scale fig units per inch (default = 1200)\n\
|
||||
-x low_x x and y offset of upper left corner (inches)\n\
|
||||
-y low_y ...(default = 1)\n\
|
||||
-sz size maximum side length of figure (in inches)\n\
|
||||
...(default = 5)\n\
|
||||
-dx dim_x horizontal dimension (default = 0)\n\
|
||||
-dy dim_y vertical dimension (default = 1)\n\
|
||||
-sv value default slice value (default = 0)\n\
|
||||
-sl dim value each such pair defines the value along the\n\
|
||||
...given dimension at which to slice. This\n\
|
||||
...may be supplied for each dimension except\n\
|
||||
...dim_x and dim_y.\n\
|
||||
-ps pointsize size of points in fig units (def = 10)\n\
|
||||
file file (input=file.dmp, output=file.fig)\n";
|
||||
exit(0);
|
||||
}
|
||||
|
||||
ANNbool fileSeen = ANNfalse; // file argument seen?
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (!strcmp(argv[i], "-upi")) { // process -upi option
|
||||
sscanf(argv[++i], "%lf", &u_per_in);
|
||||
}
|
||||
else if (!strcmp(argv[i], "-x")) { // process -x option
|
||||
sscanf(argv[++i], "%lf", &in_low_x);
|
||||
}
|
||||
else if (!strcmp(argv[i], "-y")) { // process -y option
|
||||
sscanf(argv[++i], "%lf", &in_low_y);
|
||||
}
|
||||
else if (!strcmp(argv[i], "-sz")) { // process -sz option
|
||||
sscanf(argv[++i], "%lf", &in_size);
|
||||
}
|
||||
else if (!strcmp(argv[i], "-dx")) { // process -dx option
|
||||
sscanf(argv[++i], "%d", &dim_x);
|
||||
}
|
||||
else if (!strcmp(argv[i], "-dy")) { // process -dy option
|
||||
sscanf(argv[++i], "%d", &dim_y);
|
||||
}
|
||||
else if (!strcmp(argv[i], "-sv")) { // process -sv option
|
||||
sscanf(argv[++i], "%lf", &sl_val);
|
||||
set_slice_val(sl_val); // set slice values
|
||||
}
|
||||
else if (!strcmp(argv[i], "-sl")) { // process -sl option
|
||||
sscanf(argv[++i], "%d", &sl_dim);
|
||||
if (sl_dim < 0 || sl_dim >= MAX_DIM) {
|
||||
Error("Slice dimension out of bounds", ANNabort);
|
||||
}
|
||||
sscanf(argv[++i], "%lf", &slice_val[sl_dim]);
|
||||
}
|
||||
if (!strcmp(argv[i], "-ps")) { // process -ps option
|
||||
sscanf(argv[++i], "%i", &pt_size);
|
||||
}
|
||||
else { // must be file name
|
||||
fileSeen = ANNtrue;
|
||||
sscanf(argv[i], "%s", file_name);
|
||||
strcpy(infile_name, file_name); // copy to input file name
|
||||
strcat(infile_name, DUMP_SUFFIX);
|
||||
strcpy(outfile_name, file_name); // copy to output file name
|
||||
strcat(outfile_name, FIG_SUFFIX);
|
||||
}
|
||||
}
|
||||
|
||||
if (!fileSeen) { // no file seen
|
||||
Error("File argument is required", ANNabort);
|
||||
}
|
||||
|
||||
ifile.open(infile_name, ios::in); // open for reading
|
||||
if (!ifile) {
|
||||
Error("Cannot open input file", ANNabort);
|
||||
}
|
||||
ofile.open(outfile_name, ios::out); // open for writing
|
||||
if (!ofile) {
|
||||
Error("Cannot open output file", ANNabort);
|
||||
}
|
||||
|
||||
u_low_x = u_per_in * in_low_x; // convert inches to fig units
|
||||
u_low_y = u_per_in * in_low_y;
|
||||
u_size = u_per_in * in_size;
|
||||
|
||||
strcpy(caption, argv[0]); // copy command line to caption
|
||||
for (i = 1; i < argc; i++) {
|
||||
strcat(caption, " ");
|
||||
strcat(caption, argv[i]);
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Graphics utilities for fig output
|
||||
//
|
||||
// writeHeader write header for fig file
|
||||
// writePoint write a point
|
||||
// writeBox write a box
|
||||
// writeLine write a line
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void writeHeader()
|
||||
{
|
||||
ofile << FIG_HEAD << "\n" // fig file header
|
||||
<< "Portrait\n"
|
||||
<< "Center\n"
|
||||
<< "Inches\n"
|
||||
<< (int) u_per_in << " 2\n";
|
||||
}
|
||||
|
||||
void writePoint(ANNpoint p) // write a single point
|
||||
{
|
||||
// filled black point object
|
||||
ofile << "1 3 0 1 -1 7 0 0 0 0.000 1 0.0000 ";
|
||||
int cent_x = (int) TRANS_X(p); // transform center coords
|
||||
int cent_y = (int) TRANS_Y(p);
|
||||
ofile << cent_x << " " << cent_y << " " // write center, radius, bounds
|
||||
<< pt_size << " " << pt_size << " "
|
||||
<< cent_x << " " << cent_y << " "
|
||||
<< cent_x + pt_size << " " << cent_y + pt_size << "\n";
|
||||
}
|
||||
|
||||
void writeBox(const ANNorthRect &r) // write box
|
||||
{
|
||||
// unfilled box object
|
||||
ofile << "2 2 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 5\n";
|
||||
|
||||
int p0_x = (int) TRANS_X(r.lo); // transform endpoints
|
||||
int p0_y = (int) TRANS_Y(r.lo);
|
||||
int p1_x = (int) TRANS_X(r.hi);
|
||||
int p1_y = (int) TRANS_Y(r.hi);
|
||||
ofile << "\t"
|
||||
<< p0_x << " " << p0_y << " " // write vertices
|
||||
<< p1_x << " " << p0_y << " "
|
||||
<< p1_x << " " << p1_y << " "
|
||||
<< p0_x << " " << p1_y << " "
|
||||
<< p0_x << " " << p0_y << "\n";
|
||||
}
|
||||
|
||||
void writeLine(ANNpoint p0, ANNpoint p1) // write line
|
||||
{
|
||||
// unfilled line object
|
||||
ofile << "2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2\n";
|
||||
|
||||
int p0_x = (int) TRANS_X(p0); // transform endpoints
|
||||
int p0_y = (int) TRANS_Y(p0);
|
||||
int p1_x = (int) TRANS_X(p1);
|
||||
int p1_y = (int) TRANS_Y(p1);
|
||||
ofile << "\t"
|
||||
<< p0_x << " " << p0_y << " " // write vertices
|
||||
<< p1_x << " " << p1_y << "\n";
|
||||
}
|
||||
|
||||
void writeCaption( // write caption text
|
||||
const ANNorthRect &bnd_box, // bounding box
|
||||
char *caption) // caption
|
||||
{
|
||||
if (!strcmp(caption, "\0")) return; // null string?
|
||||
int px = (int) TRANS_X(bnd_box.lo); // put .5 in. lower left
|
||||
int py = (int) (TRANS_Y(bnd_box.lo) + 0.50 * u_per_in);
|
||||
ofile << "4 0 -1 0 0 0 20 0.0000 4 255 2000 ";
|
||||
ofile << px << " " << py << " " << caption << "\\001\n";
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// overlap - test whether a box overlap slicing region
|
||||
//
|
||||
// The slicing region is a 2-dimensional plane in space
|
||||
// which contains points (x1, x2, ..., xn) satisfying the
|
||||
// n-2 linear equalities:
|
||||
//
|
||||
// xi == slice_val[i] for i != dim_x, dim_y
|
||||
//
|
||||
// This procedure returns true of the box defined by
|
||||
// corner points box.lo and box.hi overlap this plane.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
ANNbool overlap(const ANNorthRect &box)
|
||||
{
|
||||
for (int i = 0; i < dim; i++) {
|
||||
if (i != dim_x && i != dim_y &&
|
||||
(box.lo[i] > slice_val[i] || box.hi[i] < slice_val[i]))
|
||||
return ANNfalse;
|
||||
}
|
||||
return ANNtrue;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// readTree, recReadTree - inputs tree and outputs figure
|
||||
//
|
||||
// readTree procedure initializes things and then calls recReadTree
|
||||
// which does all the work.
|
||||
//
|
||||
// recReadTree reads in a node of the tree, makes any recursive
|
||||
// calls as needed to input the children of this node (if internal)
|
||||
// and maintains the bounding box. Note that the bounding box
|
||||
// is modified within this procedure, but it is the responsibility
|
||||
// of the procedure that it be restored to its original value
|
||||
// on return.
|
||||
//
|
||||
// Recall that these are the formats. The tree is given in
|
||||
// preorder.
|
||||
//
|
||||
// Leaf node:
|
||||
// leaf <n_pts> <bkt[0]> <bkt[1]> ... <bkt[n-1]>
|
||||
// Splitting nodes:
|
||||
// split <cut_dim> <cut_val> <lo_bound> <hi_bound>
|
||||
// Shrinking nodes:
|
||||
// shrink <n_bnds>
|
||||
// <cut_dim> <cut_val> <side>
|
||||
// <cut_dim> <cut_val> <side>
|
||||
// ... (repeated n_bnds times)
|
||||
//
|
||||
// On reading a leaf we determine whether we should output the
|
||||
// cell's points (if dimension = 2 or this cell overlaps the
|
||||
// slicing region). For splitting nodes we check whether the
|
||||
// current cell overlaps the slicing plane and whether the
|
||||
// cutting dimension coincides with either the x or y drawing
|
||||
// dimensions. If so, we output the corresponding splitting
|
||||
// segment.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void recReadTree(ANNorthRect &box)
|
||||
{
|
||||
char tag[STRING_LEN]; // tag (leaf, split, shrink)
|
||||
int n_pts; // number of points in leaf
|
||||
int idx; // point index
|
||||
int cd; // cut dimension
|
||||
ANNcoord cv; // cut value
|
||||
ANNcoord lb; // low bound
|
||||
ANNcoord hb; // high bound
|
||||
int n_bnds; // number of bounding sides
|
||||
int sd; // which side
|
||||
|
||||
ifile >> tag; // input node tag
|
||||
if (strcmp(tag, "leaf") == 0) { // leaf node
|
||||
|
||||
ifile >> n_pts; // input number of points
|
||||
// check for overlap
|
||||
if (dim == 2 || overlap(box)) {
|
||||
for (int i = 0; i < n_pts; i++) { // yes, write the points
|
||||
ifile >> idx;
|
||||
writePoint(pts[idx]);
|
||||
}
|
||||
}
|
||||
else { // input but ignore points
|
||||
for (int i = 0; i < n_pts; i++) {
|
||||
ifile >> idx;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (strcmp(tag, "split") == 0) { // splitting node
|
||||
|
||||
ifile >> cd >> cv >> lb >> hb;
|
||||
if (lb != box.lo[cd] || hb != box.hi[cd]) {
|
||||
Error("Bounding box coordinates are fishy", ANNwarn);
|
||||
}
|
||||
|
||||
ANNcoord lv = box.lo[cd]; // save bounds for cutting dim
|
||||
ANNcoord hv = box.hi[cd];
|
||||
|
||||
//--------------------------------------------------------------
|
||||
// The following code is rather fragile so modify at your
|
||||
// own risk. We first decrease the high-end of the bounding
|
||||
// box down to the cutting plane and then read the left subtree.
|
||||
// Then we increase the low-end of the bounding box up to the
|
||||
// cutting plane (thus collapsing the bounding box to a d-1
|
||||
// dimensional hyperrectangle). Then we draw the projection of
|
||||
// its diagonal if it crosses the slicing plane. This will have
|
||||
// the effect of drawing its intersection on the slicing plane.
|
||||
// Then we restore the high-end of the bounding box and read
|
||||
// the right subtree. Finally we restore the low-end of the
|
||||
// bounding box, before returning.
|
||||
//--------------------------------------------------------------
|
||||
box.hi[cd] = cv; // decrease high bounds
|
||||
recReadTree(box); // read left subtree
|
||||
// check for overlap
|
||||
box.lo[cd] = cv; // increase low bounds
|
||||
if (dim == 2 || overlap(box)) { // check for overlap
|
||||
if (cd == dim_x || cd == dim_y) { // cut through slice plane
|
||||
writeLine(box.lo, box.hi); // draw cutting line
|
||||
}
|
||||
}
|
||||
box.hi[cd] = hv; // restore high bounds
|
||||
|
||||
recReadTree(box); // read right subtree
|
||||
box.lo[cd] = lv; // restore low bounds
|
||||
}
|
||||
else if (strcmp(tag, "shrink") == 0) { // splitting node
|
||||
|
||||
ANNorthRect inner(dim, box); // copy bounding box
|
||||
ifile >> n_bnds; // number of bounding sides
|
||||
for (int i = 0; i < n_bnds; i++) {
|
||||
ifile >> cd >> cv >> sd; // input bounding halfspace
|
||||
ANNorthHalfSpace hs(cd, cv, sd); // create orthogonal halfspace
|
||||
hs.project(inner.lo); // intersect by projecting
|
||||
hs.project(inner.hi);
|
||||
}
|
||||
if (dim == 2 || overlap(inner)) {
|
||||
writeBox(inner); // draw inner rectangle
|
||||
}
|
||||
recReadTree(inner); // read inner subtree
|
||||
recReadTree(box); // read outer subtree
|
||||
}
|
||||
else {
|
||||
Error("Illegal node type in dump file", ANNabort);
|
||||
}
|
||||
}
|
||||
|
||||
void readTree(ANNorthRect &bnd_box)
|
||||
{
|
||||
writeHeader(); // output header
|
||||
writeBox(bnd_box); // draw bounding box
|
||||
writeCaption(bnd_box, caption); // write caption
|
||||
recReadTree(bnd_box); // do it
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// readANN - read the ANN dump file
|
||||
//
|
||||
// This procedure reads in the dump file. See the format below.
|
||||
// It first reads the header line with version number. If the
|
||||
// points section is present it reads them (otherwise just leaves
|
||||
// points = NULL), and then it reads the tree section. It inputs
|
||||
// the bounding box and determines the parameters for transforming
|
||||
// the image to figure units. It then invokes the procedure
|
||||
// readTree to do all the real work.
|
||||
//
|
||||
// Dump File Format: <xxx> = coordinate value (ANNcoord)
|
||||
//
|
||||
// #ANN <version number> <comments> [END_OF_LINE]
|
||||
// points <dim> <n_pts> (point coordinates: this is optional)
|
||||
// 0 <xxx> <xxx> ... <xxx> (point indices and coordinates)
|
||||
// 1 <xxx> <xxx> ... <xxx>
|
||||
// ...
|
||||
// tree <dim> <n_pts> <bkt_size>
|
||||
// <xxx> <xxx> ... <xxx> (lower end of bounding box)
|
||||
// <xxx> <xxx> ... <xxx> (upper end of bounding box)
|
||||
// If the tree is null, then a single line "null" is
|
||||
// output. Otherwise the nodes of the tree are printed
|
||||
// one per line in preorder. Leaves and splitting nodes
|
||||
// have the following formats:
|
||||
// Leaf node:
|
||||
// leaf <n_pts> <bkt[0]> <bkt[1]> ... <bkt[n-1]>
|
||||
// Splitting nodes:
|
||||
// split <cut_dim> <cut_val> <lo_bound> <hi_bound>
|
||||
// Shrinking nodes:
|
||||
// shrink <n_bnds>
|
||||
// <cut_dim> <cut_val> <side>
|
||||
// <cut_dim> <cut_val> <side>
|
||||
// ... (repeated n_bnds times)
|
||||
//
|
||||
// Note: Infinite lo_ and hi_bounds are printed as the special
|
||||
// values "-INF" and "+INF", respectively. We do not
|
||||
// check for this, because the current version of ANN
|
||||
// starts with a finite bounding box if the tree is
|
||||
// nonempty.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void readANN()
|
||||
{
|
||||
int j;
|
||||
char str[STRING_LEN]; // storage for string
|
||||
char version[STRING_LEN]; // storage for version
|
||||
int bkt_size; // bucket size
|
||||
|
||||
ifile >> str; // input header
|
||||
if (strcmp(str, "#ANN") != 0) { // incorrect header
|
||||
Error("Incorrect header for dump file", ANNabort);
|
||||
}
|
||||
ifile.getline(version, STRING_LEN); // get version (ignore)
|
||||
ifile >> str; // get major heading
|
||||
if (strcmp(str, "points") == 0) { // points section
|
||||
ifile >> dim; // read dimension
|
||||
ifile >> n_pts; // number of points
|
||||
pts = annAllocPts(n_pts, dim); // allocate points
|
||||
for (int i = 0; i < n_pts; i++) { // input point coordinates
|
||||
int idx; // point index
|
||||
ifile >> idx; // input point index
|
||||
if (idx < 0 || idx >= n_pts) {
|
||||
Error("Point index is out of range", ANNabort);
|
||||
}
|
||||
for (j = 0; j < dim; j++) {
|
||||
ifile >> pts[idx][j]; // read point coordinates
|
||||
}
|
||||
}
|
||||
ifile >> str; // get next major heading
|
||||
}
|
||||
if (strcmp(str, "tree") == 0) { // tree section
|
||||
ifile >> dim; // read dimension
|
||||
if (dim_x > dim || dim_y > dim) {
|
||||
Error("Dimensions out of bounds", ANNabort);
|
||||
}
|
||||
ifile >> n_pts; // number of points
|
||||
ifile >> bkt_size; // bucket size (ignored)
|
||||
// read bounding box
|
||||
ANNorthRect bnd_box(dim); // create bounding box
|
||||
for (j = 0; j < dim; j++) {
|
||||
ifile >> bnd_box.lo[j]; // read box low coordinates
|
||||
}
|
||||
for (j = 0; j < dim; j++) {
|
||||
ifile >> bnd_box.hi[j]; // read box high coordinates
|
||||
}
|
||||
// compute scaling factors
|
||||
double box_len_x = bnd_box.hi[dim_x] - bnd_box.lo[dim_x];
|
||||
double box_len_y = bnd_box.hi[dim_y] - bnd_box.lo[dim_y];
|
||||
// longer side determines scale
|
||||
if (box_len_x > box_len_y) scale = u_size/box_len_x;
|
||||
else scale = u_size/box_len_y;
|
||||
// compute offsets
|
||||
offset_x = u_low_x - scale*bnd_box.lo[dim_x];
|
||||
offset_y = u_low_y + scale*bnd_box.hi[dim_y];
|
||||
readTree(bnd_box); // read the tree and process
|
||||
}
|
||||
else if (strcmp(str, "null") == 0) return; // empty tree
|
||||
else {
|
||||
cerr << "Input string: " << str << "\n";
|
||||
Error("Illegal ann format. Expecting section heading", ANNabort);
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Main program
|
||||
//
|
||||
// Gets the command-line arguments and invokes the main scanning
|
||||
// procedure.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
getArgs(argc, argv); // get input arguments
|
||||
readANN(); // read the dump file
|
||||
return 0;
|
||||
}
|
||||
Vendored
BIN
Binary file not shown.
Vendored
-826
@@ -1,826 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: ANN.h
|
||||
// Programmer: Sunil Arya and David Mount
|
||||
// Last modified: 05/03/05 (Release 1.1)
|
||||
// Description: Basic include file for approximate nearest
|
||||
// neighbor searching.
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
// Revision 1.0 04/01/05
|
||||
// Added copyright and revision information
|
||||
// Added ANNcoordPrec for coordinate precision.
|
||||
// Added methods theDim, nPoints, maxPoints, thePoints to ANNpointSet.
|
||||
// Cleaned up C++ structure for modern compilers
|
||||
// Revision 1.1 05/03/05
|
||||
// Added fixed-radius k-NN searching
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// ANN - approximate nearest neighbor searching
|
||||
// ANN is a library for approximate nearest neighbor searching,
|
||||
// based on the use of standard and priority search in kd-trees
|
||||
// and balanced box-decomposition (bbd) trees. Here are some
|
||||
// references to the main algorithmic techniques used here:
|
||||
//
|
||||
// kd-trees:
|
||||
// Friedman, Bentley, and Finkel, ``An algorithm for finding
|
||||
// best matches in logarithmic expected time,'' ACM
|
||||
// Transactions on Mathematical Software, 3(3):209-226, 1977.
|
||||
//
|
||||
// Priority search in kd-trees:
|
||||
// Arya and Mount, ``Algorithms for fast vector quantization,''
|
||||
// Proc. of DCC '93: Data Compression Conference, eds. J. A.
|
||||
// Storer and M. Cohn, IEEE Press, 1993, 381-390.
|
||||
//
|
||||
// Approximate nearest neighbor search and bbd-trees:
|
||||
// Arya, Mount, Netanyahu, Silverman, and Wu, ``An optimal
|
||||
// algorithm for approximate nearest neighbor searching,''
|
||||
// 5th Ann. ACM-SIAM Symposium on Discrete Algorithms,
|
||||
// 1994, 573-582.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#ifndef ANN_H
|
||||
#define ANN_H
|
||||
|
||||
#ifdef WIN32
|
||||
//----------------------------------------------------------------------
|
||||
// For Microsoft Visual C++, externally accessible symbols must be
|
||||
// explicitly indicated with DLL_API, which is somewhat like "extern."
|
||||
//
|
||||
// The following ifdef block is the standard way of creating macros
|
||||
// which make exporting from a DLL simpler. All files within this DLL
|
||||
// are compiled with the DLL_EXPORTS preprocessor symbol defined on the
|
||||
// command line. In contrast, projects that use (or import) the DLL
|
||||
// objects do not define the DLL_EXPORTS symbol. This way any other
|
||||
// project whose source files include this file see DLL_API functions as
|
||||
// being imported from a DLL, wheras this DLL sees symbols defined with
|
||||
// this macro as being exported.
|
||||
//----------------------------------------------------------------------
|
||||
#ifdef DLL_EXPORTS
|
||||
#define DLL_API __declspec(dllexport)
|
||||
#else
|
||||
#define DLL_API __declspec(dllimport)
|
||||
#endif
|
||||
//----------------------------------------------------------------------
|
||||
// DLL_API is ignored for all other systems
|
||||
//----------------------------------------------------------------------
|
||||
#else
|
||||
#define DLL_API
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// basic includes
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#include <cmath> // math includes
|
||||
#include <iostream> // I/O streams
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Limits
|
||||
// There are a number of places where we use the maximum double value as
|
||||
// default initializers (and others may be used, depending on the
|
||||
// data/distance representation). These can usually be found in limits.h
|
||||
// (as LONG_MAX, INT_MAX) or in float.h (as DBL_MAX, FLT_MAX).
|
||||
//
|
||||
// Not all systems have these files. If you are using such a system,
|
||||
// you should set the preprocessor symbol ANN_NO_LIMITS_H when
|
||||
// compiling, and modify the statements below to generate the
|
||||
// appropriate value. For practical purposes, this does not need to be
|
||||
// the maximum double value. It is sufficient that it be at least as
|
||||
// large than the maximum squared distance between between any two
|
||||
// points.
|
||||
//----------------------------------------------------------------------
|
||||
#ifdef ANN_NO_LIMITS_H // limits.h unavailable
|
||||
#include <cvalues> // replacement for limits.h
|
||||
const double ANN_DBL_MAX = MAXDOUBLE; // insert maximum double
|
||||
#else
|
||||
#include <climits>
|
||||
#include <cfloat>
|
||||
const double ANN_DBL_MAX = DBL_MAX;
|
||||
#endif
|
||||
|
||||
#define ANNversion "1.1.1" // ANN version and information
|
||||
#define ANNversionCmt ""
|
||||
#define ANNcopyright "David M. Mount and Sunil Arya"
|
||||
#define ANNlatestRev "Aug 4, 2006"
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// ANNbool
|
||||
// This is a simple boolean type. Although ANSI C++ is supposed
|
||||
// to support the type bool, some compilers do not have it.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
enum ANNbool {ANNfalse = 0, ANNtrue = 1}; // ANN boolean type (non ANSI C++)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// ANNcoord, ANNdist
|
||||
// ANNcoord and ANNdist are the types used for representing
|
||||
// point coordinates and distances. They can be modified by the
|
||||
// user, with some care. It is assumed that they are both numeric
|
||||
// types, and that ANNdist is generally of an equal or higher type
|
||||
// from ANNcoord. A variable of type ANNdist should be large
|
||||
// enough to store the sum of squared components of a variable
|
||||
// of type ANNcoord for the number of dimensions needed in the
|
||||
// application. For example, the following combinations are
|
||||
// legal:
|
||||
//
|
||||
// ANNcoord ANNdist
|
||||
// --------- -------------------------------
|
||||
// short short, int, long, float, double
|
||||
// int int, long, float, double
|
||||
// long long, float, double
|
||||
// float float, double
|
||||
// double double
|
||||
//
|
||||
// It is the user's responsibility to make sure that overflow does
|
||||
// not occur in distance calculation.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
typedef double ANNcoord; // coordinate data type
|
||||
typedef double ANNdist; // distance data type
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// ANNidx
|
||||
// ANNidx is a point index. When the data structure is built, the
|
||||
// points are given as an array. Nearest neighbor results are
|
||||
// returned as an integer index into this array. To make it
|
||||
// clearer when this is happening, we define the integer type
|
||||
// ANNidx. Indexing starts from 0.
|
||||
//
|
||||
// For fixed-radius near neighbor searching, it is possible that
|
||||
// there are not k nearest neighbors within the search radius. To
|
||||
// indicate this, the algorithm returns ANN_NULL_IDX as its result.
|
||||
// It should be distinguishable from any valid array index.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
typedef int ANNidx; // point index
|
||||
const ANNidx ANN_NULL_IDX = -1; // a NULL point index
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Infinite distance:
|
||||
// The code assumes that there is an "infinite distance" which it
|
||||
// uses to initialize distances before performing nearest neighbor
|
||||
// searches. It should be as larger or larger than any legitimate
|
||||
// nearest neighbor distance.
|
||||
//
|
||||
// On most systems, these should be found in the standard include
|
||||
// file <limits.h> or possibly <float.h>. If you do not have these
|
||||
// file, some suggested values are listed below, assuming 64-bit
|
||||
// long, 32-bit int and 16-bit short.
|
||||
//
|
||||
// ANNdist ANN_DIST_INF Values (see <limits.h> or <float.h>)
|
||||
// ------- ------------ ------------------------------------
|
||||
// double DBL_MAX 1.79769313486231570e+308
|
||||
// float FLT_MAX 3.40282346638528860e+38
|
||||
// long LONG_MAX 0x7fffffffffffffff
|
||||
// int INT_MAX 0x7fffffff
|
||||
// short SHRT_MAX 0x7fff
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
const ANNdist ANN_DIST_INF = ANN_DBL_MAX;
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Significant digits for tree dumps:
|
||||
// When floating point coordinates are used, the routine that dumps
|
||||
// a tree needs to know roughly how many significant digits there
|
||||
// are in a ANNcoord, so it can output points to full precision.
|
||||
// This is defined to be ANNcoordPrec. On most systems these
|
||||
// values can be found in the standard include files <limits.h> or
|
||||
// <float.h>. For integer types, the value is essentially ignored.
|
||||
//
|
||||
// ANNcoord ANNcoordPrec Values (see <limits.h> or <float.h>)
|
||||
// -------- ------------ ------------------------------------
|
||||
// double DBL_DIG 15
|
||||
// float FLT_DIG 6
|
||||
// long doesn't matter 19
|
||||
// int doesn't matter 10
|
||||
// short doesn't matter 5
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#ifdef DBL_DIG // number of sig. bits in ANNcoord
|
||||
const int ANNcoordPrec = DBL_DIG;
|
||||
#else
|
||||
const int ANNcoordPrec = 15; // default precision
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Self match?
|
||||
// In some applications, the nearest neighbor of a point is not
|
||||
// allowed to be the point itself. This occurs, for example, when
|
||||
// computing all nearest neighbors in a set. By setting the
|
||||
// parameter ANN_ALLOW_SELF_MATCH to ANNfalse, the nearest neighbor
|
||||
// is the closest point whose distance from the query point is
|
||||
// strictly positive.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
const ANNbool ANN_ALLOW_SELF_MATCH = ANNtrue;
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Norms and metrics:
|
||||
// ANN supports any Minkowski norm for defining distance. In
|
||||
// particular, for any p >= 1, the L_p Minkowski norm defines the
|
||||
// length of a d-vector (v0, v1, ..., v(d-1)) to be
|
||||
//
|
||||
// (|v0|^p + |v1|^p + ... + |v(d-1)|^p)^(1/p),
|
||||
//
|
||||
// (where ^ denotes exponentiation, and |.| denotes absolute
|
||||
// value). The distance between two points is defined to be the
|
||||
// norm of the vector joining them. Some common distance metrics
|
||||
// include
|
||||
//
|
||||
// Euclidean metric p = 2
|
||||
// Manhattan metric p = 1
|
||||
// Max metric p = infinity
|
||||
//
|
||||
// In the case of the max metric, the norm is computed by taking
|
||||
// the maxima of the absolute values of the components. ANN is
|
||||
// highly "coordinate-based" and does not support general distances
|
||||
// functions (e.g. those obeying just the triangle inequality). It
|
||||
// also does not support distance functions based on
|
||||
// inner-products.
|
||||
//
|
||||
// For the purpose of computing nearest neighbors, it is not
|
||||
// necessary to compute the final power (1/p). Thus the only
|
||||
// component that is used by the program is |v(i)|^p.
|
||||
//
|
||||
// ANN parameterizes the distance computation through the following
|
||||
// macros. (Macros are used rather than procedures for
|
||||
// efficiency.) Recall that the distance between two points is
|
||||
// given by the length of the vector joining them, and the length
|
||||
// or norm of a vector v is given by formula:
|
||||
//
|
||||
// |v| = ROOT(POW(v0) # POW(v1) # ... # POW(v(d-1)))
|
||||
//
|
||||
// where ROOT, POW are unary functions and # is an associative and
|
||||
// commutative binary operator mapping the following types:
|
||||
//
|
||||
// ** POW: ANNcoord --> ANNdist
|
||||
// ** #: ANNdist x ANNdist --> ANNdist
|
||||
// ** ROOT: ANNdist (>0) --> double
|
||||
//
|
||||
// For early termination in distance calculation (partial distance
|
||||
// calculation) we assume that POW and # together are monotonically
|
||||
// increasing on sequences of arguments, meaning that for all
|
||||
// v0..vk and y:
|
||||
//
|
||||
// POW(v0) #...# POW(vk) <= (POW(v0) #...# POW(vk)) # POW(y).
|
||||
//
|
||||
// Incremental Distance Calculation:
|
||||
// The program uses an optimized method of computing distances for
|
||||
// kd-trees and bd-trees, called incremental distance calculation.
|
||||
// It is used when distances are to be updated when only a single
|
||||
// coordinate of a point has been changed. In order to use this,
|
||||
// we assume that there is an incremental update function DIFF(x,y)
|
||||
// for #, such that if:
|
||||
//
|
||||
// s = x0 # ... # xi # ... # xk
|
||||
//
|
||||
// then if s' is equal to s but with xi replaced by y, that is,
|
||||
//
|
||||
// s' = x0 # ... # y # ... # xk
|
||||
//
|
||||
// then the length of s' can be computed by:
|
||||
//
|
||||
// |s'| = |s| # DIFF(xi,y).
|
||||
//
|
||||
// Thus, if # is + then DIFF(xi,y) is (yi-x). For the L_infinity
|
||||
// norm we make use of the fact that in the program this function
|
||||
// is only invoked when y > xi, and hence DIFF(xi,y)=y.
|
||||
//
|
||||
// Finally, for approximate nearest neighbor queries we assume
|
||||
// that POW and ROOT are related such that
|
||||
//
|
||||
// v*ROOT(x) = ROOT(POW(v)*x)
|
||||
//
|
||||
// Here are the values for the various Minkowski norms:
|
||||
//
|
||||
// L_p: p even: p odd:
|
||||
// ------------------------- ------------------------
|
||||
// POW(v) = v^p POW(v) = |v|^p
|
||||
// ROOT(x) = x^(1/p) ROOT(x) = x^(1/p)
|
||||
// # = + # = +
|
||||
// DIFF(x,y) = y - x DIFF(x,y) = y - x
|
||||
//
|
||||
// L_inf:
|
||||
// POW(v) = |v|
|
||||
// ROOT(x) = x
|
||||
// # = max
|
||||
// DIFF(x,y) = y
|
||||
//
|
||||
// By default the Euclidean norm is assumed. To change the norm,
|
||||
// uncomment the appropriate set of macros below.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Use the following for the Euclidean norm
|
||||
//----------------------------------------------------------------------
|
||||
#define ANN_POW(v) ((v)*(v))
|
||||
#define ANN_ROOT(x) sqrt(x)
|
||||
#define ANN_SUM(x,y) ((x) + (y))
|
||||
#define ANN_DIFF(x,y) ((y) - (x))
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Use the following for the L_1 (Manhattan) norm
|
||||
//----------------------------------------------------------------------
|
||||
// #define ANN_POW(v) fabs(v)
|
||||
// #define ANN_ROOT(x) (x)
|
||||
// #define ANN_SUM(x,y) ((x) + (y))
|
||||
// #define ANN_DIFF(x,y) ((y) - (x))
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Use the following for a general L_p norm
|
||||
//----------------------------------------------------------------------
|
||||
// #define ANN_POW(v) pow(fabs(v),p)
|
||||
// #define ANN_ROOT(x) pow(fabs(x),1/p)
|
||||
// #define ANN_SUM(x,y) ((x) + (y))
|
||||
// #define ANN_DIFF(x,y) ((y) - (x))
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Use the following for the L_infinity (Max) norm
|
||||
//----------------------------------------------------------------------
|
||||
// #define ANN_POW(v) fabs(v)
|
||||
// #define ANN_ROOT(x) (x)
|
||||
// #define ANN_SUM(x,y) ((x) > (y) ? (x) : (y))
|
||||
// #define ANN_DIFF(x,y) (y)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Array types
|
||||
// The following array types are of basic interest. A point is
|
||||
// just a dimensionless array of coordinates, a point array is a
|
||||
// dimensionless array of points. A distance array is a
|
||||
// dimensionless array of distances and an index array is a
|
||||
// dimensionless array of point indices. The latter two are used
|
||||
// when returning the results of k-nearest neighbor queries.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
typedef ANNcoord* ANNpoint; // a point
|
||||
typedef ANNpoint* ANNpointArray; // an array of points
|
||||
typedef ANNdist* ANNdistArray; // an array of distances
|
||||
typedef ANNidx* ANNidxArray; // an array of point indices
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Basic point and array utilities:
|
||||
// The following procedures are useful supplements to ANN's nearest
|
||||
// neighbor capabilities.
|
||||
//
|
||||
// annDist():
|
||||
// Computes the (squared) distance between a pair of points.
|
||||
// Note that this routine is not used internally by ANN for
|
||||
// computing distance calculations. For reasons of efficiency
|
||||
// this is done using incremental distance calculation. Thus,
|
||||
// this routine cannot be modified as a method of changing the
|
||||
// metric.
|
||||
//
|
||||
// Because points (somewhat like strings in C) are stored as
|
||||
// pointers. Consequently, creating and destroying copies of
|
||||
// points may require storage allocation. These procedures do
|
||||
// this.
|
||||
//
|
||||
// annAllocPt() and annDeallocPt():
|
||||
// Allocate a deallocate storage for a single point, and
|
||||
// return a pointer to it. The argument to AllocPt() is
|
||||
// used to initialize all components.
|
||||
//
|
||||
// annAllocPts() and annDeallocPts():
|
||||
// Allocate and deallocate an array of points as well a
|
||||
// place to store their coordinates, and initializes the
|
||||
// points to point to their respective coordinates. It
|
||||
// allocates point storage in a contiguous block large
|
||||
// enough to store all the points. It performs no
|
||||
// initialization.
|
||||
//
|
||||
// annCopyPt():
|
||||
// Creates a copy of a given point, allocating space for
|
||||
// the new point. It returns a pointer to the newly
|
||||
// allocated copy.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
DLL_API ANNdist annDist(
|
||||
int dim, // dimension of space
|
||||
ANNpoint p, // points
|
||||
ANNpoint q);
|
||||
|
||||
DLL_API ANNpoint annAllocPt(
|
||||
int dim, // dimension
|
||||
ANNcoord c = 0); // coordinate value (all equal)
|
||||
|
||||
DLL_API ANNpointArray annAllocPts(
|
||||
int n, // number of points
|
||||
int dim); // dimension
|
||||
|
||||
DLL_API void annDeallocPt(
|
||||
ANNpoint &p); // deallocate 1 point
|
||||
|
||||
DLL_API void annDeallocPts(
|
||||
ANNpointArray &pa); // point array
|
||||
|
||||
DLL_API ANNpoint annCopyPt(
|
||||
int dim, // dimension
|
||||
ANNpoint source); // point to copy
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//Overall structure: ANN supports a number of different data structures
|
||||
//for approximate and exact nearest neighbor searching. These are:
|
||||
//
|
||||
// ANNbruteForce A simple brute-force search structure.
|
||||
// ANNkd_tree A kd-tree tree search structure. ANNbd_tree
|
||||
// A bd-tree tree search structure (a kd-tree with shrink
|
||||
// capabilities).
|
||||
//
|
||||
// At a minimum, each of these data structures support k-nearest
|
||||
// neighbor queries. The nearest neighbor query, annkSearch,
|
||||
// returns an integer identifier and the distance to the nearest
|
||||
// neighbor(s) and annRangeSearch returns the nearest points that
|
||||
// lie within a given query ball.
|
||||
//
|
||||
// Each structure is built by invoking the appropriate constructor
|
||||
// and passing it (at a minimum) the array of points, the total
|
||||
// number of points and the dimension of the space. Each structure
|
||||
// is also assumed to support a destructor and member functions
|
||||
// that return basic information about the point set.
|
||||
//
|
||||
// Note that the array of points is not copied by the data
|
||||
// structure (for reasons of space efficiency), and it is assumed
|
||||
// to be constant throughout the lifetime of the search structure.
|
||||
//
|
||||
// The search algorithm, annkSearch, is given the query point (q),
|
||||
// and the desired number of nearest neighbors to report (k), and
|
||||
// the error bound (eps) (whose default value is 0, implying exact
|
||||
// nearest neighbors). It returns two arrays which are assumed to
|
||||
// contain at least k elements: one (nn_idx) contains the indices
|
||||
// (within the point array) of the nearest neighbors and the other
|
||||
// (dd) contains the squared distances to these nearest neighbors.
|
||||
//
|
||||
// The search algorithm, annkFRSearch, is a fixed-radius kNN
|
||||
// search. In addition to a query point, it is given a (squared)
|
||||
// radius bound. (This is done for consistency, because the search
|
||||
// returns distances as squared quantities.) It does two things.
|
||||
// First, it computes the k nearest neighbors within the radius
|
||||
// bound, and second, it returns the total number of points lying
|
||||
// within the radius bound. It is permitted to set k = 0, in which
|
||||
// case it effectively answers a range counting query. If the
|
||||
// error bound epsilon is positive, then the search is approximate
|
||||
// in the sense that it is free to ignore any point that lies
|
||||
// outside a ball of radius r/(1+epsilon), where r is the given
|
||||
// (unsquared) radius bound.
|
||||
//
|
||||
// The generic object from which all the search structures are
|
||||
// dervied is given below. It is a virtual object, and is useless
|
||||
// by itself.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
class DLL_API ANNpointSet {
|
||||
public:
|
||||
virtual ~ANNpointSet() {} // virtual distructor
|
||||
|
||||
virtual void annkSearch( // approx k near neighbor search
|
||||
ANNpoint q, // query point
|
||||
int k, // number of near neighbors to return
|
||||
ANNidxArray nn_idx, // nearest neighbor array (modified)
|
||||
ANNdistArray dd, // dist to near neighbors (modified)
|
||||
double eps=0.0 // error bound
|
||||
) = 0; // pure virtual (defined elsewhere)
|
||||
|
||||
virtual int annkFRSearch( // approx fixed-radius kNN search
|
||||
ANNpoint q, // query point
|
||||
ANNdist sqRad, // squared radius
|
||||
int k = 0, // number of near neighbors to return
|
||||
ANNidxArray nn_idx = NULL, // nearest neighbor array (modified)
|
||||
ANNdistArray dd = NULL, // dist to near neighbors (modified)
|
||||
double eps=0.0 // error bound
|
||||
) = 0; // pure virtual (defined elsewhere)
|
||||
|
||||
virtual int theDim() = 0; // return dimension of space
|
||||
virtual int nPoints() = 0; // return number of points
|
||||
// return pointer to points
|
||||
virtual ANNpointArray thePoints() = 0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Brute-force nearest neighbor search:
|
||||
// The brute-force search structure is very simple but inefficient.
|
||||
// It has been provided primarily for the sake of comparison with
|
||||
// and validation of the more complex search structures.
|
||||
//
|
||||
// Query processing is the same as described above, but the value
|
||||
// of epsilon is ignored, since all distance calculations are
|
||||
// performed exactly.
|
||||
//
|
||||
// WARNING: This data structure is very slow, and should not be
|
||||
// used unless the number of points is very small.
|
||||
//
|
||||
// Internal information:
|
||||
// ---------------------
|
||||
// This data structure bascially consists of the array of points
|
||||
// (each a pointer to an array of coordinates). The search is
|
||||
// performed by a simple linear scan of all the points.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
class DLL_API ANNbruteForce: public ANNpointSet {
|
||||
int dim; // dimension
|
||||
int n_pts; // number of points
|
||||
ANNpointArray pts; // point array
|
||||
public:
|
||||
ANNbruteForce( // constructor from point array
|
||||
ANNpointArray pa, // point array
|
||||
int n, // number of points
|
||||
int dd); // dimension
|
||||
|
||||
~ANNbruteForce(); // destructor
|
||||
|
||||
void annkSearch( // approx k near neighbor search
|
||||
ANNpoint q, // query point
|
||||
int k, // number of near neighbors to return
|
||||
ANNidxArray nn_idx, // nearest neighbor array (modified)
|
||||
ANNdistArray dd, // dist to near neighbors (modified)
|
||||
double eps=0.0); // error bound
|
||||
|
||||
int annkFRSearch( // approx fixed-radius kNN search
|
||||
ANNpoint q, // query point
|
||||
ANNdist sqRad, // squared radius
|
||||
int k = 0, // number of near neighbors to return
|
||||
ANNidxArray nn_idx = NULL, // nearest neighbor array (modified)
|
||||
ANNdistArray dd = NULL, // dist to near neighbors (modified)
|
||||
double eps=0.0); // error bound
|
||||
|
||||
int theDim() // return dimension of space
|
||||
{ return dim; }
|
||||
|
||||
int nPoints() // return number of points
|
||||
{ return n_pts; }
|
||||
|
||||
ANNpointArray thePoints() // return pointer to points
|
||||
{ return pts; }
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// kd- and bd-tree splitting and shrinking rules
|
||||
// kd-trees supports a collection of different splitting rules.
|
||||
// In addition to the standard kd-tree splitting rule proposed
|
||||
// by Friedman, Bentley, and Finkel, we have introduced a
|
||||
// number of other splitting rules, which seem to perform
|
||||
// as well or better (for the distributions we have tested).
|
||||
//
|
||||
// The splitting methods given below allow the user to tailor
|
||||
// the data structure to the particular data set. They are
|
||||
// are described in greater details in the kd_split.cc source
|
||||
// file. The method ANN_KD_SUGGEST is the method chosen (rather
|
||||
// subjectively) by the implementors as the one giving the
|
||||
// fastest performance, and is the default splitting method.
|
||||
//
|
||||
// As with splitting rules, there are a number of different
|
||||
// shrinking rules. The shrinking rule ANN_BD_NONE does no
|
||||
// shrinking (and hence produces a kd-tree tree). The rule
|
||||
// ANN_BD_SUGGEST uses the implementors favorite rule.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
enum ANNsplitRule {
|
||||
ANN_KD_STD = 0, // the optimized kd-splitting rule
|
||||
ANN_KD_MIDPT = 1, // midpoint split
|
||||
ANN_KD_FAIR = 2, // fair split
|
||||
ANN_KD_SL_MIDPT = 3, // sliding midpoint splitting method
|
||||
ANN_KD_SL_FAIR = 4, // sliding fair split method
|
||||
ANN_KD_SUGGEST = 5}; // the authors' suggestion for best
|
||||
const int ANN_N_SPLIT_RULES = 6; // number of split rules
|
||||
|
||||
enum ANNshrinkRule {
|
||||
ANN_BD_NONE = 0, // no shrinking at all (just kd-tree)
|
||||
ANN_BD_SIMPLE = 1, // simple splitting
|
||||
ANN_BD_CENTROID = 2, // centroid splitting
|
||||
ANN_BD_SUGGEST = 3}; // the authors' suggested choice
|
||||
const int ANN_N_SHRINK_RULES = 4; // number of shrink rules
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// kd-tree:
|
||||
// The main search data structure supported by ANN is a kd-tree.
|
||||
// The main constructor is given a set of points and a choice of
|
||||
// splitting method to use in building the tree.
|
||||
//
|
||||
// Construction:
|
||||
// -------------
|
||||
// The constructor is given the point array, number of points,
|
||||
// dimension, bucket size (default = 1), and the splitting rule
|
||||
// (default = ANN_KD_SUGGEST). The point array is not copied, and
|
||||
// is assumed to be kept constant throughout the lifetime of the
|
||||
// search structure. There is also a "load" constructor that
|
||||
// builds a tree from a file description that was created by the
|
||||
// Dump operation.
|
||||
//
|
||||
// Search:
|
||||
// -------
|
||||
// There are two search methods:
|
||||
//
|
||||
// Standard search (annkSearch()):
|
||||
// Searches nodes in tree-traversal order, always visiting
|
||||
// the closer child first.
|
||||
// Priority search (annkPriSearch()):
|
||||
// Searches nodes in order of increasing distance of the
|
||||
// associated cell from the query point. For many
|
||||
// distributions the standard search seems to work just
|
||||
// fine, but priority search is safer for worst-case
|
||||
// performance.
|
||||
//
|
||||
// Printing:
|
||||
// ---------
|
||||
// There are two methods provided for printing the tree. Print()
|
||||
// is used to produce a "human-readable" display of the tree, with
|
||||
// indenation, which is handy for debugging. Dump() produces a
|
||||
// format that is suitable reading by another program. There is a
|
||||
// "load" constructor, which constructs a tree which is assumed to
|
||||
// have been saved by the Dump() procedure.
|
||||
//
|
||||
// Performance and Structure Statistics:
|
||||
// -------------------------------------
|
||||
// The procedure getStats() collects statistics information on the
|
||||
// tree (its size, height, etc.) See ANNperf.h for information on
|
||||
// the stats structure it returns.
|
||||
//
|
||||
// Internal information:
|
||||
// ---------------------
|
||||
// The data structure consists of three major chunks of storage.
|
||||
// The first (implicit) storage are the points themselves (pts),
|
||||
// which have been provided by the users as an argument to the
|
||||
// constructor, or are allocated dynamically if the tree is built
|
||||
// using the load constructor). These should not be changed during
|
||||
// the lifetime of the search structure. It is the user's
|
||||
// responsibility to delete these after the tree is destroyed.
|
||||
//
|
||||
// The second is the tree itself (which is dynamically allocated in
|
||||
// the constructor) and is given as a pointer to its root node
|
||||
// (root). These nodes are automatically deallocated when the tree
|
||||
// is deleted. See the file src/kd_tree.h for further information
|
||||
// on the structure of the tree nodes.
|
||||
//
|
||||
// Each leaf of the tree does not contain a pointer directly to a
|
||||
// point, but rather contains a pointer to a "bucket", which is an
|
||||
// array consisting of point indices. The third major chunk of
|
||||
// storage is an array (pidx), which is a large array in which all
|
||||
// these bucket subarrays reside. (The reason for storing them
|
||||
// separately is the buckets are typically small, but of varying
|
||||
// sizes. This was done to avoid fragmentation.) This array is
|
||||
// also deallocated when the tree is deleted.
|
||||
//
|
||||
// In addition to this, the tree consists of a number of other
|
||||
// pieces of information which are used in searching and for
|
||||
// subsequent tree operations. These consist of the following:
|
||||
//
|
||||
// dim Dimension of space
|
||||
// n_pts Number of points currently in the tree
|
||||
// n_max Maximum number of points that are allowed
|
||||
// in the tree
|
||||
// bkt_size Maximum bucket size (no. of points per leaf)
|
||||
// bnd_box_lo Bounding box low point
|
||||
// bnd_box_hi Bounding box high point
|
||||
// splitRule Splitting method used
|
||||
//
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Some types and objects used by kd-tree functions
|
||||
// See src/kd_tree.h and src/kd_tree.cpp for definitions
|
||||
//----------------------------------------------------------------------
|
||||
class ANNkdStats; // stats on kd-tree
|
||||
class ANNkd_node; // generic node in a kd-tree
|
||||
typedef ANNkd_node* ANNkd_ptr; // pointer to a kd-tree node
|
||||
|
||||
class DLL_API ANNkd_tree: public ANNpointSet {
|
||||
protected:
|
||||
int dim; // dimension of space
|
||||
int n_pts; // number of points in tree
|
||||
int bkt_size; // bucket size
|
||||
ANNpointArray pts; // the points
|
||||
ANNidxArray pidx; // point indices (to pts array)
|
||||
ANNkd_ptr root; // root of kd-tree
|
||||
ANNpoint bnd_box_lo; // bounding box low point
|
||||
ANNpoint bnd_box_hi; // bounding box high point
|
||||
|
||||
void SkeletonTree( // construct skeleton tree
|
||||
int n, // number of points
|
||||
int dd, // dimension
|
||||
int bs, // bucket size
|
||||
ANNpointArray pa = NULL, // point array (optional)
|
||||
ANNidxArray pi = NULL); // point indices (optional)
|
||||
|
||||
public:
|
||||
ANNkd_tree( // build skeleton tree
|
||||
int n = 0, // number of points
|
||||
int dd = 0, // dimension
|
||||
int bs = 1); // bucket size
|
||||
|
||||
ANNkd_tree( // build from point array
|
||||
ANNpointArray pa, // point array
|
||||
int n, // number of points
|
||||
int dd, // dimension
|
||||
int bs = 1, // bucket size
|
||||
ANNsplitRule split = ANN_KD_SUGGEST); // splitting method
|
||||
|
||||
ANNkd_tree( // build from dump file
|
||||
std::istream& in); // input stream for dump file
|
||||
|
||||
~ANNkd_tree(); // tree destructor
|
||||
|
||||
void annkSearch( // approx k near neighbor search
|
||||
ANNpoint q, // query point
|
||||
int k, // number of near neighbors to return
|
||||
ANNidxArray nn_idx, // nearest neighbor array (modified)
|
||||
ANNdistArray dd, // dist to near neighbors (modified)
|
||||
double eps=0.0); // error bound
|
||||
|
||||
void annkPriSearch( // priority k near neighbor search
|
||||
ANNpoint q, // query point
|
||||
int k, // number of near neighbors to return
|
||||
ANNidxArray nn_idx, // nearest neighbor array (modified)
|
||||
ANNdistArray dd, // dist to near neighbors (modified)
|
||||
double eps=0.0); // error bound
|
||||
|
||||
int annkFRSearch( // approx fixed-radius kNN search
|
||||
ANNpoint q, // the query point
|
||||
ANNdist sqRad, // squared radius of query ball
|
||||
int k, // number of neighbors to return
|
||||
ANNidxArray nn_idx = NULL, // nearest neighbor array (modified)
|
||||
ANNdistArray dd = NULL, // dist to near neighbors (modified)
|
||||
double eps=0.0); // error bound
|
||||
|
||||
int theDim() // return dimension of space
|
||||
{ return dim; }
|
||||
|
||||
int nPoints() // return number of points
|
||||
{ return n_pts; }
|
||||
|
||||
ANNpointArray thePoints() // return pointer to points
|
||||
{ return pts; }
|
||||
|
||||
virtual void Print( // print the tree (for debugging)
|
||||
ANNbool with_pts, // print points as well?
|
||||
std::ostream& out); // output stream
|
||||
|
||||
virtual void Dump( // dump entire tree
|
||||
ANNbool with_pts, // print points as well?
|
||||
std::ostream& out); // output stream
|
||||
|
||||
virtual void getStats( // compute tree statistics
|
||||
ANNkdStats& st); // the statistics (modified)
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Box decomposition tree (bd-tree)
|
||||
// The bd-tree is inherited from a kd-tree. The main difference
|
||||
// in the bd-tree and the kd-tree is a new type of internal node
|
||||
// called a shrinking node (in the kd-tree there is only one type
|
||||
// of internal node, a splitting node). The shrinking node
|
||||
// makes it possible to generate balanced trees in which the
|
||||
// cells have bounded aspect ratio, by allowing the decomposition
|
||||
// to zoom in on regions of dense point concentration. Although
|
||||
// this is a nice idea in theory, few point distributions are so
|
||||
// densely clustered that this is really needed.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
class DLL_API ANNbd_tree: public ANNkd_tree {
|
||||
public:
|
||||
ANNbd_tree( // build skeleton tree
|
||||
int n, // number of points
|
||||
int dd, // dimension
|
||||
int bs = 1) // bucket size
|
||||
: ANNkd_tree(n, dd, bs) {} // build base kd-tree
|
||||
|
||||
ANNbd_tree( // build from point array
|
||||
ANNpointArray pa, // point array
|
||||
int n, // number of points
|
||||
int dd, // dimension
|
||||
int bs = 1, // bucket size
|
||||
ANNsplitRule split = ANN_KD_SUGGEST, // splitting rule
|
||||
ANNshrinkRule shrink = ANN_BD_SUGGEST); // shrinking rule
|
||||
|
||||
ANNbd_tree( // build from dump file
|
||||
std::istream& in); // input stream for dump file
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Other functions
|
||||
// annMaxPtsVisit Sets a limit on the maximum number of points
|
||||
// to visit in the search.
|
||||
// annClose Can be called when all use of ANN is finished.
|
||||
// It clears up a minor memory leak.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
DLL_API void annMaxPtsVisit( // max. pts to visit in search
|
||||
int maxPts); // the limit
|
||||
|
||||
DLL_API void annClose(); // called to end use of ANN
|
||||
|
||||
#endif
|
||||
-223
@@ -1,223 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: ANNperf.h
|
||||
// Programmer: Sunil Arya and David Mount
|
||||
// Last modified: 03/04/98 (Release 0.1)
|
||||
// Description: Include file for ANN performance stats
|
||||
//
|
||||
// Some of the code for statistics gathering has been adapted
|
||||
// from the SmplStat.h package in the g++ library.
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
// Revision 1.0 04/01/05
|
||||
// Added ANN_ prefix to avoid name conflicts.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#ifndef ANNperf_H
|
||||
#define ANNperf_H
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// basic includes
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#include <ANN/ANN.h> // basic ANN includes
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// kd-tree stats object
|
||||
// This object is used for collecting information about a kd-tree
|
||||
// or bd-tree.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
class ANNkdStats { // stats on kd-tree
|
||||
public:
|
||||
int dim; // dimension of space
|
||||
int n_pts; // no. of points
|
||||
int bkt_size; // bucket size
|
||||
int n_lf; // no. of leaves (including trivial)
|
||||
int n_tl; // no. of trivial leaves (no points)
|
||||
int n_spl; // no. of splitting nodes
|
||||
int n_shr; // no. of shrinking nodes (for bd-trees)
|
||||
int depth; // depth of tree
|
||||
float sum_ar; // sum of leaf aspect ratios
|
||||
float avg_ar; // average leaf aspect ratio
|
||||
//
|
||||
// reset stats
|
||||
void reset(int d=0, int n=0, int bs=0)
|
||||
{
|
||||
dim = d; n_pts = n; bkt_size = bs;
|
||||
n_lf = n_tl = n_spl = n_shr = depth = 0;
|
||||
sum_ar = avg_ar = 0.0;
|
||||
}
|
||||
|
||||
ANNkdStats() // basic constructor
|
||||
{ reset(); }
|
||||
|
||||
void merge(const ANNkdStats &st); // merge stats from child
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// ANNsampStat
|
||||
// A sample stat collects numeric (double) samples and returns some
|
||||
// simple statistics. Its main functions are:
|
||||
//
|
||||
// reset() Reset to no samples.
|
||||
// += x Include sample x.
|
||||
// samples() Return number of samples.
|
||||
// mean() Return mean of samples.
|
||||
// stdDev() Return standard deviation
|
||||
// min() Return minimum of samples.
|
||||
// max() Return maximum of samples.
|
||||
//----------------------------------------------------------------------
|
||||
class DLL_API ANNsampStat {
|
||||
int n; // number of samples
|
||||
double sum; // sum
|
||||
double sum2; // sum of squares
|
||||
double minVal, maxVal; // min and max
|
||||
public :
|
||||
void reset() // reset everything
|
||||
{
|
||||
n = 0;
|
||||
sum = sum2 = 0;
|
||||
minVal = ANN_DBL_MAX;
|
||||
maxVal = -ANN_DBL_MAX;
|
||||
}
|
||||
|
||||
ANNsampStat() { reset(); } // constructor
|
||||
|
||||
void operator+=(double x) // add sample
|
||||
{
|
||||
n++; sum += x; sum2 += x*x;
|
||||
if (x < minVal) minVal = x;
|
||||
if (x > maxVal) maxVal = x;
|
||||
}
|
||||
|
||||
int samples() { return n; } // number of samples
|
||||
|
||||
double mean() { return sum/n; } // mean
|
||||
|
||||
// standard deviation
|
||||
double stdDev() { return sqrt((sum2 - (sum*sum)/n)/(n-1));}
|
||||
|
||||
double min() { return minVal; } // minimum
|
||||
double max() { return maxVal; } // maximum
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Operation count updates
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#ifdef ANN_PERF
|
||||
#define ANN_FLOP(n) {ann_Nfloat_ops += (n);}
|
||||
#define ANN_LEAF(n) {ann_Nvisit_lfs += (n);}
|
||||
#define ANN_SPL(n) {ann_Nvisit_spl += (n);}
|
||||
#define ANN_SHR(n) {ann_Nvisit_shr += (n);}
|
||||
#define ANN_PTS(n) {ann_Nvisit_pts += (n);}
|
||||
#define ANN_COORD(n) {ann_Ncoord_hts += (n);}
|
||||
#else
|
||||
#define ANN_FLOP(n)
|
||||
#define ANN_LEAF(n)
|
||||
#define ANN_SPL(n)
|
||||
#define ANN_SHR(n)
|
||||
#define ANN_PTS(n)
|
||||
#define ANN_COORD(n)
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Performance statistics
|
||||
// The following data and routines are used for computing performance
|
||||
// statistics for nearest neighbor searching. Because these routines
|
||||
// can slow the code down, they can be activated and deactiviated by
|
||||
// defining the ANN_PERF variable, by compiling with the option:
|
||||
// -DANN_PERF
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Global counters for performance measurement
|
||||
//
|
||||
// visit_lfs The number of leaf nodes visited in the
|
||||
// tree.
|
||||
//
|
||||
// visit_spl The number of splitting nodes visited in the
|
||||
// tree.
|
||||
//
|
||||
// visit_shr The number of shrinking nodes visited in the
|
||||
// tree.
|
||||
//
|
||||
// visit_pts The number of points visited in all the
|
||||
// leaf nodes visited. Equivalently, this
|
||||
// is the number of points for which distance
|
||||
// calculations are performed.
|
||||
//
|
||||
// coord_hts The number of times a coordinate of a
|
||||
// data point is accessed. This is generally
|
||||
// less than visit_pts*d if partial distance
|
||||
// calculation is used. This count is low
|
||||
// in the sense that if a coordinate is hit
|
||||
// many times in the same routine we may
|
||||
// count it only once.
|
||||
//
|
||||
// float_ops The number of floating point operations.
|
||||
// This includes all operations in the heap
|
||||
// as well as distance calculations to boxes.
|
||||
//
|
||||
// average_err The average error of each query (the
|
||||
// error of the reported point to the true
|
||||
// nearest neighbor). For k nearest neighbors
|
||||
// the error is computed k times.
|
||||
//
|
||||
// rank_err The rank error of each query (the difference
|
||||
// in the rank of the reported point and its
|
||||
// true rank).
|
||||
//
|
||||
// data_pts The number of data points. This is not
|
||||
// a counter, but used in stats computation.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
extern int ann_Ndata_pts; // number of data points
|
||||
extern int ann_Nvisit_lfs; // number of leaf nodes visited
|
||||
extern int ann_Nvisit_spl; // number of splitting nodes visited
|
||||
extern int ann_Nvisit_shr; // number of shrinking nodes visited
|
||||
extern int ann_Nvisit_pts; // visited points for one query
|
||||
extern int ann_Ncoord_hts; // coordinate hits for one query
|
||||
extern int ann_Nfloat_ops; // floating ops for one query
|
||||
extern ANNsampStat ann_visit_lfs; // stats on leaf nodes visits
|
||||
extern ANNsampStat ann_visit_spl; // stats on splitting nodes visits
|
||||
extern ANNsampStat ann_visit_shr; // stats on shrinking nodes visits
|
||||
extern ANNsampStat ann_visit_nds; // stats on total nodes visits
|
||||
extern ANNsampStat ann_visit_pts; // stats on points visited
|
||||
extern ANNsampStat ann_coord_hts; // stats on coordinate hits
|
||||
extern ANNsampStat ann_float_ops; // stats on floating ops
|
||||
//----------------------------------------------------------------------
|
||||
// The following need to be part of the public interface, because
|
||||
// they are accessed outside the DLL in ann_test.cpp.
|
||||
//----------------------------------------------------------------------
|
||||
DLL_API extern ANNsampStat ann_average_err; // average error
|
||||
DLL_API extern ANNsampStat ann_rank_err; // rank error
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Declaration of externally accessible routines for statistics
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
DLL_API void annResetStats(int data_size); // reset stats for a set of queries
|
||||
|
||||
DLL_API void annResetCounts(); // reset counts for one queries
|
||||
|
||||
DLL_API void annUpdateStats(); // update stats with current counts
|
||||
|
||||
DLL_API void annPrintStats(ANNbool validate); // print statistics for a run
|
||||
|
||||
#endif
|
||||
Vendored
-167
@@ -1,167 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: ANNx.h
|
||||
// Programmer: Sunil Arya and David Mount
|
||||
// Last modified: 03/04/98 (Release 0.1)
|
||||
// Description: Internal include file for ANN
|
||||
//
|
||||
// These declarations are of use in manipulating some of
|
||||
// the internal data objects appearing in ANN, but are not
|
||||
// needed for applications just using the nearest neighbor
|
||||
// search.
|
||||
//
|
||||
// Typical users of ANN should not need to access this file.
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
// Revision 1.0 04/01/05
|
||||
// Changed LO, HI, IN, OUT to ANN_LO, ANN_HI, etc.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#ifndef ANNx_H
|
||||
#define ANNx_H
|
||||
|
||||
#include <iomanip> // I/O manipulators
|
||||
#include <ANN/ANN.h> // ANN includes
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Global constants and types
|
||||
//----------------------------------------------------------------------
|
||||
enum {ANN_LO=0, ANN_HI=1}; // splitting indices
|
||||
enum {ANN_IN=0, ANN_OUT=1}; // shrinking indices
|
||||
// what to do in case of error
|
||||
enum ANNerr {ANNwarn = 0, ANNabort = 1};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Maximum number of points to visit
|
||||
// We have an option for terminating the search early if the
|
||||
// number of points visited exceeds some threshold. If the
|
||||
// threshold is 0 (its default) this means there is no limit
|
||||
// and the algorithm applies its normal termination condition.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
extern int ANNmaxPtsVisited; // maximum number of pts visited
|
||||
extern int ANNptsVisited; // number of pts visited in search
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Global function declarations
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void annError( // ANN error routine
|
||||
char *msg, // error message
|
||||
ANNerr level); // level of error
|
||||
|
||||
void annPrintPt( // print a point
|
||||
ANNpoint pt, // the point
|
||||
int dim, // the dimension
|
||||
std::ostream &out); // output stream
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Orthogonal (axis aligned) rectangle
|
||||
// Orthogonal rectangles are represented by two points, one
|
||||
// for the lower left corner (min coordinates) and the other
|
||||
// for the upper right corner (max coordinates).
|
||||
//
|
||||
// The constructor initializes from either a pair of coordinates,
|
||||
// pair of points, or another rectangle. Note that all constructors
|
||||
// allocate new point storage. The destructor deallocates this
|
||||
// storage.
|
||||
//
|
||||
// BEWARE: Orthogonal rectangles should be passed ONLY BY REFERENCE.
|
||||
// (C++'s default copy constructor will not allocate new point
|
||||
// storage, then on return the destructor free's storage, and then
|
||||
// you get into big trouble in the calling procedure.)
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
class ANNorthRect {
|
||||
public:
|
||||
ANNpoint lo; // rectangle lower bounds
|
||||
ANNpoint hi; // rectangle upper bounds
|
||||
//
|
||||
ANNorthRect( // basic constructor
|
||||
int dd, // dimension of space
|
||||
ANNcoord l=0, // default is empty
|
||||
ANNcoord h=0)
|
||||
{ lo = annAllocPt(dd, l); hi = annAllocPt(dd, h); }
|
||||
|
||||
ANNorthRect( // (almost a) copy constructor
|
||||
int dd, // dimension
|
||||
const ANNorthRect &r) // rectangle to copy
|
||||
{ lo = annCopyPt(dd, r.lo); hi = annCopyPt(dd, r.hi); }
|
||||
|
||||
ANNorthRect( // construct from points
|
||||
int dd, // dimension
|
||||
ANNpoint l, // low point
|
||||
ANNpoint h) // hight point
|
||||
{ lo = annCopyPt(dd, l); hi = annCopyPt(dd, h); }
|
||||
|
||||
~ANNorthRect() // destructor
|
||||
{ annDeallocPt(lo); annDeallocPt(hi); }
|
||||
|
||||
ANNbool inside(int dim, ANNpoint p);// is point p inside rectangle?
|
||||
};
|
||||
|
||||
void annAssignRect( // assign one rect to another
|
||||
int dim, // dimension (both must be same)
|
||||
ANNorthRect &dest, // destination (modified)
|
||||
const ANNorthRect &source); // source
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Orthogonal (axis aligned) halfspace
|
||||
// An orthogonal halfspace is represented by an integer cutting
|
||||
// dimension cd, coordinate cutting value, cv, and side, sd, which is
|
||||
// either +1 or -1. Our convention is that point q lies in the (closed)
|
||||
// halfspace if (q[cd] - cv)*sd >= 0.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
class ANNorthHalfSpace {
|
||||
public:
|
||||
int cd; // cutting dimension
|
||||
ANNcoord cv; // cutting value
|
||||
int sd; // which side
|
||||
//
|
||||
ANNorthHalfSpace() // default constructor
|
||||
{ cd = 0; cv = 0; sd = 0; }
|
||||
|
||||
ANNorthHalfSpace( // basic constructor
|
||||
int cdd, // dimension of space
|
||||
ANNcoord cvv, // cutting value
|
||||
int sdd) // side
|
||||
{ cd = cdd; cv = cvv; sd = sdd; }
|
||||
|
||||
ANNbool in(ANNpoint q) const // is q inside halfspace?
|
||||
{ return (ANNbool) ((q[cd] - cv)*sd >= 0); }
|
||||
|
||||
ANNbool out(ANNpoint q) const // is q outside halfspace?
|
||||
{ return (ANNbool) ((q[cd] - cv)*sd < 0); }
|
||||
|
||||
ANNdist dist(ANNpoint q) const // (squared) distance from q
|
||||
{ return (ANNdist) ANN_POW(q[cd] - cv); }
|
||||
|
||||
void setLowerBound(int d, ANNpoint p)// set to lower bound at p[i]
|
||||
{ cd = d; cv = p[d]; sd = +1; }
|
||||
|
||||
void setUpperBound(int d, ANNpoint p)// set to upper bound at p[i]
|
||||
{ cd = d; cv = p[d]; sd = -1; }
|
||||
|
||||
void project(ANNpoint &q) // project q (modified) onto halfspace
|
||||
{ if (out(q)) q[cd] = cv; }
|
||||
};
|
||||
|
||||
// array of halfspaces
|
||||
typedef ANNorthHalfSpace *ANNorthHSArray;
|
||||
|
||||
#endif
|
||||
Vendored
-90
@@ -1,90 +0,0 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
# Makefile for the sample program
|
||||
#
|
||||
# ANN: Approximate Nearest Neighbors
|
||||
# Version: 1.1.1 08/04/06
|
||||
#-----------------------------------------------------------------------------
|
||||
# Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
# David Mount. All Rights Reserved.
|
||||
#
|
||||
# This software and related documentation is part of the Approximate
|
||||
# Nearest Neighbor Library (ANN). This software is provided under
|
||||
# the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
# file ../ReadMe.txt for further information.
|
||||
#
|
||||
# The University of Maryland (U.M.) and the authors make no
|
||||
# representations about the suitability or fitness of this software for
|
||||
# any purpose. It is provided "as is" without express or implied
|
||||
# warranty.
|
||||
#-----------------------------------------------------------------------------
|
||||
# Revision 0.1 03/04/98
|
||||
# Initial release
|
||||
# Revision 1.1.1 08/04/06
|
||||
# Added copyright/license
|
||||
#-----------------------------------------------------------------------------
|
||||
# Note: For full performance measurements, it is assumed that the library
|
||||
# and this program have both been compiled with the -DPERF flag. See the
|
||||
# Makefile in the ANN base directory for this flag.
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Basic definitions
|
||||
# BASEDIR where include, src, lib, ... are
|
||||
# INCDIR include directory
|
||||
# LIBDIR library directory
|
||||
# BINDIR bin directory
|
||||
# LDFLAGS loader flags
|
||||
# ANNLIBS libraries
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
BASEDIR = ..
|
||||
INCDIR = $(BASEDIR)/include
|
||||
LIBDIR = $(BASEDIR)/lib
|
||||
BINDIR = $(BASEDIR)/bin
|
||||
LDFLAGS = -L$(LIBDIR)
|
||||
ANNLIBS = -lANN -lm
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Some more definitions
|
||||
# ANNSAMP name of sample program
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
ANNSAMP = ann_sample
|
||||
|
||||
SAMPSOURCES = ann_sample.cpp
|
||||
SAMPOBJECTS = $(SAMPSOURCES:.cpp=.o)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Make the program
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
default:
|
||||
@echo "Specify a target configuration"
|
||||
|
||||
targets: $(BINDIR)/$(ANNSAMP)
|
||||
|
||||
$(BINDIR)/$(ANNSAMP): $(SAMPOBJECTS) $(LIBDIR)/$(ANNLIB)
|
||||
$(C++) $(SAMPOBJECTS) -o $(ANNSAMP) $(LDFLAGS) $(ANNLIBS)
|
||||
mv $(ANNSAMP) $(BINDIR)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# configuration definitions
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
include ../Make-config
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Objects
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
ann_sample.o: ann_sample.cpp
|
||||
$(C++) -c -I$(INCDIR) $(CFLAGS) ann_sample.cpp
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Cleaning
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
clean:
|
||||
-rm -f *.o *.out core
|
||||
|
||||
realclean: clean
|
||||
-198
@@ -1,198 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: ann_sample.cpp
|
||||
// Programmer: Sunil Arya and David Mount
|
||||
// Last modified: 03/04/98 (Release 0.1)
|
||||
// Description: Sample program for ANN
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#include <cstdlib> // C standard library
|
||||
#include <cstdio> // C I/O (for sscanf)
|
||||
#include <cstring> // string manipulation
|
||||
#include <fstream> // file I/O
|
||||
#include <ANN/ANN.h> // ANN declarations
|
||||
|
||||
using namespace std; // make std:: accessible
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// ann_sample
|
||||
//
|
||||
// This is a simple sample program for the ANN library. After compiling,
|
||||
// it can be run as follows.
|
||||
//
|
||||
// ann_sample [-d dim] [-max mpts] [-nn k] [-e eps] [-df data] [-qf query]
|
||||
//
|
||||
// where
|
||||
// dim is the dimension of the space (default = 2)
|
||||
// mpts maximum number of data points (default = 1000)
|
||||
// k number of nearest neighbors per query (default 1)
|
||||
// eps is the error bound (default = 0.0)
|
||||
// data file containing data points
|
||||
// query file containing query points
|
||||
//
|
||||
// Results are sent to the standard output.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Parameters that are set in getArgs()
|
||||
//----------------------------------------------------------------------
|
||||
void getArgs(int argc, char **argv); // get command-line arguments
|
||||
|
||||
int k = 1; // number of nearest neighbors
|
||||
int dim = 2; // dimension
|
||||
double eps = 0; // error bound
|
||||
int maxPts = 1000; // maximum number of data points
|
||||
|
||||
istream* dataIn = NULL; // input for data points
|
||||
istream* queryIn = NULL; // input for query points
|
||||
|
||||
bool readPt(istream &in, ANNpoint p) // read point (false on EOF)
|
||||
{
|
||||
for (int i = 0; i < dim; i++) {
|
||||
if(!(in >> p[i])) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void printPt(ostream &out, ANNpoint p) // print point
|
||||
{
|
||||
out << "(" << p[0];
|
||||
for (int i = 1; i < dim; i++) {
|
||||
out << ", " << p[i];
|
||||
}
|
||||
out << ")\n";
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int nPts; // actual number of data points
|
||||
ANNpointArray dataPts; // data points
|
||||
ANNpoint queryPt; // query point
|
||||
ANNidxArray nnIdx; // near neighbor indices
|
||||
ANNdistArray dists; // near neighbor distances
|
||||
ANNkd_tree* kdTree; // search structure
|
||||
|
||||
getArgs(argc, argv); // read command-line arguments
|
||||
|
||||
queryPt = annAllocPt(dim); // allocate query point
|
||||
dataPts = annAllocPts(maxPts, dim); // allocate data points
|
||||
nnIdx = new ANNidx[k]; // allocate near neigh indices
|
||||
dists = new ANNdist[k]; // allocate near neighbor dists
|
||||
|
||||
nPts = 0; // read data points
|
||||
|
||||
cout << "Data Points:\n";
|
||||
while (nPts < maxPts && readPt(*dataIn, dataPts[nPts])) {
|
||||
printPt(cout, dataPts[nPts]);
|
||||
nPts++;
|
||||
}
|
||||
|
||||
kdTree = new ANNkd_tree( // build search structure
|
||||
dataPts, // the data points
|
||||
nPts, // number of points
|
||||
dim); // dimension of space
|
||||
|
||||
while (readPt(*queryIn, queryPt)) { // read query points
|
||||
cout << "Query point: "; // echo query point
|
||||
printPt(cout, queryPt);
|
||||
|
||||
kdTree->annkSearch( // search
|
||||
queryPt, // query point
|
||||
k, // number of near neighbors
|
||||
nnIdx, // nearest neighbors (returned)
|
||||
dists, // distance (returned)
|
||||
eps); // error bound
|
||||
|
||||
cout << "\tNN:\tIndex\tDistance\n";
|
||||
for (int i = 0; i < k; i++) { // print summary
|
||||
dists[i] = sqrt(dists[i]); // unsquare distance
|
||||
cout << "\t" << i << "\t" << nnIdx[i] << "\t" << dists[i] << "\n";
|
||||
}
|
||||
}
|
||||
delete [] nnIdx; // clean things up
|
||||
delete [] dists;
|
||||
delete kdTree;
|
||||
annClose(); // done with ANN
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// getArgs - get command line arguments
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void getArgs(int argc, char **argv)
|
||||
{
|
||||
static ifstream dataStream; // data file stream
|
||||
static ifstream queryStream; // query file stream
|
||||
|
||||
if (argc <= 1) { // no arguments
|
||||
cerr << "Usage:\n\n"
|
||||
<< " ann_sample [-d dim] [-max m] [-nn k] [-e eps] [-df data]"
|
||||
" [-qf query]\n\n"
|
||||
<< " where:\n"
|
||||
<< " dim dimension of the space (default = 2)\n"
|
||||
<< " m maximum number of data points (default = 1000)\n"
|
||||
<< " k number of nearest neighbors per query (default 1)\n"
|
||||
<< " eps the error bound (default = 0.0)\n"
|
||||
<< " data name of file containing data points\n"
|
||||
<< " query name of file containing query points\n\n"
|
||||
<< " Results are sent to the standard output.\n"
|
||||
<< "\n"
|
||||
<< " To run this demo use:\n"
|
||||
<< " ann_sample -df data.pts -qf query.pts\n";
|
||||
exit(0);
|
||||
}
|
||||
int i = 1;
|
||||
while (i < argc) { // read arguments
|
||||
if (!strcmp(argv[i], "-d")) { // -d option
|
||||
dim = atoi(argv[++i]); // get dimension to dump
|
||||
}
|
||||
else if (!strcmp(argv[i], "-max")) { // -max option
|
||||
maxPts = atoi(argv[++i]); // get max number of points
|
||||
}
|
||||
else if (!strcmp(argv[i], "-nn")) { // -nn option
|
||||
k = atoi(argv[++i]); // get number of near neighbors
|
||||
}
|
||||
else if (!strcmp(argv[i], "-e")) { // -e option
|
||||
sscanf(argv[++i], "%lf", &eps); // get error bound
|
||||
}
|
||||
else if (!strcmp(argv[i], "-df")) { // -df option
|
||||
dataStream.open(argv[++i], ios::in);// open data file
|
||||
if (!dataStream) {
|
||||
cerr << "Cannot open data file\n";
|
||||
exit(1);
|
||||
}
|
||||
dataIn = &dataStream; // make this the data stream
|
||||
}
|
||||
else if (!strcmp(argv[i], "-qf")) { // -qf option
|
||||
queryStream.open(argv[++i], ios::in);// open query file
|
||||
if (!queryStream) {
|
||||
cerr << "Cannot open query file\n";
|
||||
exit(1);
|
||||
}
|
||||
queryIn = &queryStream; // make this query stream
|
||||
}
|
||||
else { // illegal syntax
|
||||
cerr << "Unrecognized option.\n";
|
||||
exit(1);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (dataIn == NULL || queryIn == NULL) {
|
||||
cerr << "-df and -qf options must be specified\n";
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
Vendored
-20
@@ -1,20 +0,0 @@
|
||||
-0.297462 0.176102
|
||||
0.565538 -0.361496
|
||||
0.909313 -0.182785
|
||||
0.920712 0.478408
|
||||
0.167682 0.0499836
|
||||
0.305223 -0.0805835
|
||||
0.114973 0.882453
|
||||
0.742916 0.16376
|
||||
0.0724605 -0.826775
|
||||
0.690960 -0.559284
|
||||
0.188485 -0.643934
|
||||
0.749427 -0.942415
|
||||
-0.970662 -0.223466
|
||||
0.916110 0.879597
|
||||
0.927417 -0.382593
|
||||
-0.711327 0.278713
|
||||
-0.519172 0.986146
|
||||
0.135338 0.924588
|
||||
-0.0837537 0.61687
|
||||
0.0520465 0.896306
|
||||
Vendored
-10
@@ -1,10 +0,0 @@
|
||||
0.0902484 -0.207129
|
||||
-0.419567 0.485743
|
||||
0.826225 -0.30962
|
||||
0.694758 0.987088
|
||||
-0.410807 -0.465182
|
||||
-0.836501 0.490184
|
||||
0.588289 0.656408
|
||||
0.325807 0.38721
|
||||
-0.532226 -0.727036
|
||||
-0.52506 -0.853508
|
||||
Vendored
-51
@@ -1,51 +0,0 @@
|
||||
Data Points:
|
||||
(-0.297462, 0.176102)
|
||||
(0.565538, -0.361496)
|
||||
(0.909313, -0.182785)
|
||||
(0.920712, 0.478408)
|
||||
(0.167682, 0.0499836)
|
||||
(0.305223, -0.0805835)
|
||||
(0.114973, 0.882453)
|
||||
(0.742916, 0.16376)
|
||||
(0.0724605, -0.826775)
|
||||
(0.69096, -0.559284)
|
||||
(0.188485, -0.643934)
|
||||
(0.749427, -0.942415)
|
||||
(-0.970662, -0.223466)
|
||||
(0.91611, 0.879597)
|
||||
(0.927417, -0.382593)
|
||||
(-0.711327, 0.278713)
|
||||
(-0.519172, 0.986146)
|
||||
(0.135338, 0.924588)
|
||||
(-0.0837537, 0.61687)
|
||||
(0.0520465, 0.896306)
|
||||
Query point: (0.0902484, -0.207129)
|
||||
NN: Index Distance
|
||||
0 5 0.249455
|
||||
Query point: (-0.419567, 0.485743)
|
||||
NN: Index Distance
|
||||
0 0 0.332847
|
||||
Query point: (0.826225, -0.30962)
|
||||
NN: Index Distance
|
||||
0 14 0.124759
|
||||
Query point: (0.694758, 0.987088)
|
||||
NN: Index Distance
|
||||
0 13 0.246071
|
||||
Query point: (-0.410807, -0.465182)
|
||||
NN: Index Distance
|
||||
0 8 0.60357
|
||||
Query point: (-0.836501, 0.490184)
|
||||
NN: Index Distance
|
||||
0 15 0.245741
|
||||
Query point: (0.588289, 0.656408)
|
||||
NN: Index Distance
|
||||
0 3 0.37708
|
||||
Query point: (0.325807, 0.38721)
|
||||
NN: Index Distance
|
||||
0 4 0.372458
|
||||
Query point: (-0.532226, -0.727036)
|
||||
NN: Index Distance
|
||||
0 8 0.612857
|
||||
Query point: (-0.52506, -0.853508)
|
||||
NN: Index Distance
|
||||
0 8 0.598118
|
||||
Vendored
-199
@@ -1,199 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: ANN.cpp
|
||||
// Programmer: Sunil Arya and David Mount
|
||||
// Description: Methods for ANN.h and ANNx.h
|
||||
// Last modified: 01/04/05 (Version 1.0)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
// Revision 1.0 04/01/05
|
||||
// Added performance counting to annDist()
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#include <ANN/ANNx.h> // all ANN includes
|
||||
#include <ANN/ANNperf.h> // ANN performance
|
||||
#include <cstdlib>
|
||||
|
||||
using namespace std; // make std:: accessible
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Point methods
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Distance utility.
|
||||
// (Note: In the nearest neighbor search, most distances are
|
||||
// computed using partial distance calculations, not this
|
||||
// procedure.)
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
ANNdist annDist( // interpoint squared distance
|
||||
int dim,
|
||||
ANNpoint p,
|
||||
ANNpoint q)
|
||||
{
|
||||
register int d;
|
||||
register ANNcoord diff;
|
||||
register ANNcoord dist;
|
||||
|
||||
dist = 0;
|
||||
for (d = 0; d < dim; d++) {
|
||||
diff = p[d] - q[d];
|
||||
dist = ANN_SUM(dist, ANN_POW(diff));
|
||||
}
|
||||
ANN_FLOP(3*dim) // performance counts
|
||||
ANN_PTS(1)
|
||||
ANN_COORD(dim)
|
||||
return dist;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annPrintPoint() prints a point to a given output stream.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void annPrintPt( // print a point
|
||||
ANNpoint pt, // the point
|
||||
int dim, // the dimension
|
||||
std::ostream &out) // output stream
|
||||
{
|
||||
for (int j = 0; j < dim; j++) {
|
||||
out << pt[j];
|
||||
if (j < dim-1) out << " ";
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Point allocation/deallocation:
|
||||
//
|
||||
// Because points (somewhat like strings in C) are stored
|
||||
// as pointers. Consequently, creating and destroying
|
||||
// copies of points may require storage allocation. These
|
||||
// procedures do this.
|
||||
//
|
||||
// annAllocPt() and annDeallocPt() allocate a deallocate
|
||||
// storage for a single point, and return a pointer to it.
|
||||
//
|
||||
// annAllocPts() allocates an array of points as well a place
|
||||
// to store their coordinates, and initializes the points to
|
||||
// point to their respective coordinates. It allocates point
|
||||
// storage in a contiguous block large enough to store all the
|
||||
// points. It performs no initialization.
|
||||
//
|
||||
// annDeallocPts() should only be used on point arrays allocated
|
||||
// by annAllocPts since it assumes that points are allocated in
|
||||
// a block.
|
||||
//
|
||||
// annCopyPt() copies a point taking care to allocate storage
|
||||
// for the new point.
|
||||
//
|
||||
// annAssignRect() assigns the coordinates of one rectangle to
|
||||
// another. The two rectangles must have the same dimension
|
||||
// (and it is not possible to test this here).
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
ANNpoint annAllocPt(int dim, ANNcoord c) // allocate 1 point
|
||||
{
|
||||
ANNpoint p = new ANNcoord[dim];
|
||||
for (int i = 0; i < dim; i++) p[i] = c;
|
||||
return p;
|
||||
}
|
||||
|
||||
ANNpointArray annAllocPts(int n, int dim) // allocate n pts in dim
|
||||
{
|
||||
ANNpointArray pa = new ANNpoint[n]; // allocate points
|
||||
ANNpoint p = new ANNcoord[n*dim]; // allocate space for coords
|
||||
for (int i = 0; i < n; i++) {
|
||||
pa[i] = &(p[i*dim]);
|
||||
}
|
||||
return pa;
|
||||
}
|
||||
|
||||
void annDeallocPt(ANNpoint &p) // deallocate 1 point
|
||||
{
|
||||
delete [] p;
|
||||
p = NULL;
|
||||
}
|
||||
|
||||
void annDeallocPts(ANNpointArray &pa) // deallocate points
|
||||
{
|
||||
delete [] pa[0]; // dealloc coordinate storage
|
||||
delete [] pa; // dealloc points
|
||||
pa = NULL;
|
||||
}
|
||||
|
||||
ANNpoint annCopyPt(int dim, ANNpoint source) // copy point
|
||||
{
|
||||
ANNpoint p = new ANNcoord[dim];
|
||||
for (int i = 0; i < dim; i++) p[i] = source[i];
|
||||
return p;
|
||||
}
|
||||
|
||||
// assign one rect to another
|
||||
void annAssignRect(int dim, ANNorthRect &dest, const ANNorthRect &source)
|
||||
{
|
||||
for (int i = 0; i < dim; i++) {
|
||||
dest.lo[i] = source.lo[i];
|
||||
dest.hi[i] = source.hi[i];
|
||||
}
|
||||
}
|
||||
|
||||
// is point inside rectangle?
|
||||
ANNbool ANNorthRect::inside(int dim, ANNpoint p)
|
||||
{
|
||||
for (int i = 0; i < dim; i++) {
|
||||
if (p[i] < lo[i] || p[i] > hi[i]) return ANNfalse;
|
||||
}
|
||||
return ANNtrue;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Error handler
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void annError(char *msg, ANNerr level)
|
||||
{
|
||||
if (level == ANNabort) {
|
||||
cerr << "ANN: ERROR------->" << msg << "<-------------ERROR\n";
|
||||
exit(1);
|
||||
}
|
||||
else {
|
||||
cerr << "ANN: WARNING----->" << msg << "<-------------WARNING\n";
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Limit on number of points visited
|
||||
// We have an option for terminating the search early if the
|
||||
// number of points visited exceeds some threshold. If the
|
||||
// threshold is 0 (its default) this means there is no limit
|
||||
// and the algorithm applies its normal termination condition.
|
||||
// This is for applications where there are real time constraints
|
||||
// on the running time of the algorithm.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
int ANNmaxPtsVisited = 0; // maximum number of pts visited
|
||||
int ANNptsVisited; // number of pts visited in search
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Global function declarations
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void annMaxPtsVisit( // set limit on max. pts to visit in search
|
||||
int maxPts) // the limit
|
||||
{
|
||||
ANNmaxPtsVisited = maxPts;
|
||||
}
|
||||
Vendored
-29
@@ -1,29 +0,0 @@
|
||||
add_definitions(-D_USRDLL -DDLL_EXPORTS -DANN_PERF -DANN_NO_RANDOM)
|
||||
|
||||
include_directories(../include)
|
||||
|
||||
set(ANN_SRCS
|
||||
ANN.cpp brute.cpp kd_tree.cpp kd_util.cpp kd_split.cpp
|
||||
kd_dump.cpp kd_search.cpp kd_pr_search.cpp kd_fix_rad_search.cpp
|
||||
bd_tree.cpp bd_search.cpp bd_pr_search.cpp bd_fix_rad_search.cpp
|
||||
perf.cpp bd_tree.h kd_tree.h kd_split.h kd_util.h kd_search.h
|
||||
kd_pr_search.h kd_fix_rad_search.h pr_queue.h pr_queue_k.h
|
||||
../include/ANN/ANN.h ../include/ANN/ANNperf.h ../include/ANN/ANNx.h
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
set(ANN_LIBS
|
||||
debug MSVCRTD.LIB
|
||||
debug MSVCPRTD.LIB
|
||||
optimized MSVCRT.LIB
|
||||
optimized MSVCPRT.LIB
|
||||
Rpcrt4.lib
|
||||
)
|
||||
endif(WIN32)
|
||||
|
||||
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/src/Main)
|
||||
|
||||
add_library(ANN SHARED ${ANN_SRCS})
|
||||
target_link_libraries(ANN ${ANN_LIBS})
|
||||
|
||||
SET_BIN_DIR(ANN ANN)
|
||||
-61
@@ -1,61 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: bd_fix_rad_search.cpp
|
||||
// Programmer: David Mount
|
||||
// Description: Standard bd-tree search
|
||||
// Last modified: 05/03/05 (Version 1.1)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 1.1 05/03/05
|
||||
// Initial release
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#include "bd_tree.h" // bd-tree declarations
|
||||
#include "kd_fix_rad_search.h" // kd-tree FR search declarations
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Approximate searching for bd-trees.
|
||||
// See the file kd_FR_search.cpp for general information on the
|
||||
// approximate nearest neighbor search algorithm. Here we
|
||||
// include the extensions for shrinking nodes.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// bd_shrink::ann_FR_search - search a shrinking node
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void ANNbd_shrink::ann_FR_search(ANNdist box_dist)
|
||||
{
|
||||
// check dist calc term cond.
|
||||
if (ANNmaxPtsVisited != 0 && ANNptsVisited > ANNmaxPtsVisited) return;
|
||||
|
||||
ANNdist inner_dist = 0; // distance to inner box
|
||||
for (int i = 0; i < n_bnds; i++) { // is query point in the box?
|
||||
if (bnds[i].out(ANNkdFRQ)) { // outside this bounding side?
|
||||
// add to inner distance
|
||||
inner_dist = (ANNdist) ANN_SUM(inner_dist, bnds[i].dist(ANNkdFRQ));
|
||||
}
|
||||
}
|
||||
if (inner_dist <= box_dist) { // if inner box is closer
|
||||
child[ANN_IN]->ann_FR_search(inner_dist);// search inner child first
|
||||
child[ANN_OUT]->ann_FR_search(box_dist);// ...then outer child
|
||||
}
|
||||
else { // if outer box is closer
|
||||
child[ANN_OUT]->ann_FR_search(box_dist);// search outer child first
|
||||
child[ANN_IN]->ann_FR_search(inner_dist);// ...then outer child
|
||||
}
|
||||
ANN_FLOP(3*n_bnds) // increment floating ops
|
||||
ANN_SHR(1) // one more shrinking node
|
||||
}
|
||||
-62
@@ -1,62 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: bd_pr_search.cpp
|
||||
// Programmer: David Mount
|
||||
// Description: Priority search for bd-trees
|
||||
// Last modified: 01/04/05 (Version 1.0)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
//History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#include "bd_tree.h" // bd-tree declarations
|
||||
#include "kd_pr_search.h" // kd priority search declarations
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Approximate priority searching for bd-trees.
|
||||
// See the file kd_pr_search.cc for general information on the
|
||||
// approximate nearest neighbor priority search algorithm. Here
|
||||
// we include the extensions for shrinking nodes.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// bd_shrink::ann_search - search a shrinking node
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void ANNbd_shrink::ann_pri_search(ANNdist box_dist)
|
||||
{
|
||||
ANNdist inner_dist = 0; // distance to inner box
|
||||
for (int i = 0; i < n_bnds; i++) { // is query point in the box?
|
||||
if (bnds[i].out(ANNprQ)) { // outside this bounding side?
|
||||
// add to inner distance
|
||||
inner_dist = (ANNdist) ANN_SUM(inner_dist, bnds[i].dist(ANNprQ));
|
||||
}
|
||||
}
|
||||
if (inner_dist <= box_dist) { // if inner box is closer
|
||||
if (child[ANN_OUT] != KD_TRIVIAL) // enqueue outer if not trivial
|
||||
ANNprBoxPQ->insert(box_dist,child[ANN_OUT]);
|
||||
// continue with inner child
|
||||
child[ANN_IN]->ann_pri_search(inner_dist);
|
||||
}
|
||||
else { // if outer box is closer
|
||||
if (child[ANN_IN] != KD_TRIVIAL) // enqueue inner if not trivial
|
||||
ANNprBoxPQ->insert(inner_dist,child[ANN_IN]);
|
||||
// continue with outer child
|
||||
child[ANN_OUT]->ann_pri_search(box_dist);
|
||||
}
|
||||
ANN_FLOP(3*n_bnds) // increment floating ops
|
||||
ANN_SHR(1) // one more shrinking node
|
||||
}
|
||||
Vendored
-61
@@ -1,61 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: bd_search.cpp
|
||||
// Programmer: David Mount
|
||||
// Description: Standard bd-tree search
|
||||
// Last modified: 01/04/05 (Version 1.0)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#include "bd_tree.h" // bd-tree declarations
|
||||
#include "kd_search.h" // kd-tree search declarations
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Approximate searching for bd-trees.
|
||||
// See the file kd_search.cpp for general information on the
|
||||
// approximate nearest neighbor search algorithm. Here we
|
||||
// include the extensions for shrinking nodes.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// bd_shrink::ann_search - search a shrinking node
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void ANNbd_shrink::ann_search(ANNdist box_dist)
|
||||
{
|
||||
// check dist calc term cond.
|
||||
if (ANNmaxPtsVisited != 0 && ANNptsVisited > ANNmaxPtsVisited) return;
|
||||
|
||||
ANNdist inner_dist = 0; // distance to inner box
|
||||
for (int i = 0; i < n_bnds; i++) { // is query point in the box?
|
||||
if (bnds[i].out(ANNkdQ)) { // outside this bounding side?
|
||||
// add to inner distance
|
||||
inner_dist = (ANNdist) ANN_SUM(inner_dist, bnds[i].dist(ANNkdQ));
|
||||
}
|
||||
}
|
||||
if (inner_dist <= box_dist) { // if inner box is closer
|
||||
child[ANN_IN]->ann_search(inner_dist); // search inner child first
|
||||
child[ANN_OUT]->ann_search(box_dist); // ...then outer child
|
||||
}
|
||||
else { // if outer box is closer
|
||||
child[ANN_OUT]->ann_search(box_dist); // search outer child first
|
||||
child[ANN_IN]->ann_search(inner_dist); // ...then outer child
|
||||
}
|
||||
ANN_FLOP(3*n_bnds) // increment floating ops
|
||||
ANN_SHR(1) // one more shrinking node
|
||||
}
|
||||
Vendored
-417
@@ -1,417 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: bd_tree.cpp
|
||||
// Programmer: David Mount
|
||||
// Description: Basic methods for bd-trees.
|
||||
// Last modified: 01/04/05 (Version 1.0)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
// Revision l.0 04/01/05
|
||||
// Fixed centroid shrink threshold condition to depend on the
|
||||
// dimension.
|
||||
// Moved dump routine to kd_dump.cpp.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#include "bd_tree.h" // bd-tree declarations
|
||||
#include "kd_util.h" // kd-tree utilities
|
||||
#include "kd_split.h" // kd-tree splitting rules
|
||||
|
||||
#include <ANN/ANNperf.h> // performance evaluation
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Printing a bd-tree
|
||||
// These routines print a bd-tree. See the analogous procedure
|
||||
// in kd_tree.cpp for more information.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void ANNbd_shrink::print( // print shrinking node
|
||||
int level, // depth of node in tree
|
||||
ostream &out) // output stream
|
||||
{
|
||||
child[ANN_OUT]->print(level+1, out); // print out-child
|
||||
|
||||
out << " ";
|
||||
for (int i = 0; i < level; i++) // print indentation
|
||||
out << "..";
|
||||
out << "Shrink";
|
||||
for (int j = 0; j < n_bnds; j++) { // print sides, 2 per line
|
||||
if (j % 2 == 0) {
|
||||
out << "\n"; // newline and indentation
|
||||
for (int i = 0; i < level+2; i++) out << " ";
|
||||
}
|
||||
out << " ([" << bnds[j].cd << "]"
|
||||
<< (bnds[j].sd > 0 ? ">=" : "< ")
|
||||
<< bnds[j].cv << ")";
|
||||
}
|
||||
out << "\n";
|
||||
|
||||
child[ANN_IN]->print(level+1, out); // print in-child
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// kd_tree statistics utility (for performance evaluation)
|
||||
// This routine computes various statistics information for
|
||||
// shrinking nodes. See file kd_tree.cpp for more information.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void ANNbd_shrink::getStats( // get subtree statistics
|
||||
int dim, // dimension of space
|
||||
ANNkdStats &st, // stats (modified)
|
||||
ANNorthRect &bnd_box) // bounding box
|
||||
{
|
||||
ANNkdStats ch_stats; // stats for children
|
||||
ANNorthRect inner_box(dim); // inner box of shrink
|
||||
|
||||
annBnds2Box(bnd_box, // enclosing box
|
||||
dim, // dimension
|
||||
n_bnds, // number of bounds
|
||||
bnds, // bounds array
|
||||
inner_box); // inner box (modified)
|
||||
// get stats for inner child
|
||||
ch_stats.reset(); // reset
|
||||
child[ANN_IN]->getStats(dim, ch_stats, inner_box);
|
||||
st.merge(ch_stats); // merge them
|
||||
// get stats for outer child
|
||||
ch_stats.reset(); // reset
|
||||
child[ANN_OUT]->getStats(dim, ch_stats, bnd_box);
|
||||
st.merge(ch_stats); // merge them
|
||||
|
||||
st.depth++; // increment depth
|
||||
st.n_shr++; // increment number of shrinks
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// bd-tree constructor
|
||||
// This is the main constructor for bd-trees given a set of points.
|
||||
// It first builds a skeleton kd-tree as a basis, then computes the
|
||||
// bounding box of the data points, and then invokes rbd_tree() to
|
||||
// actually build the tree, passing it the appropriate splitting
|
||||
// and shrinking information.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
ANNkd_ptr rbd_tree( // recursive construction of bd-tree
|
||||
ANNpointArray pa, // point array
|
||||
ANNidxArray pidx, // point indices to store in subtree
|
||||
int n, // number of points
|
||||
int dim, // dimension of space
|
||||
int bsp, // bucket space
|
||||
ANNorthRect &bnd_box, // bounding box for current node
|
||||
ANNkd_splitter splitter, // splitting routine
|
||||
ANNshrinkRule shrink); // shrinking rule
|
||||
|
||||
ANNbd_tree::ANNbd_tree( // construct from point array
|
||||
ANNpointArray pa, // point array (with at least n pts)
|
||||
int n, // number of points
|
||||
int dd, // dimension
|
||||
int bs, // bucket size
|
||||
ANNsplitRule split, // splitting rule
|
||||
ANNshrinkRule shrink) // shrinking rule
|
||||
: ANNkd_tree(n, dd, bs) // build skeleton base tree
|
||||
{
|
||||
pts = pa; // where the points are
|
||||
if (n == 0) return; // no points--no sweat
|
||||
|
||||
ANNorthRect bnd_box(dd); // bounding box for points
|
||||
// construct bounding rectangle
|
||||
annEnclRect(pa, pidx, n, dd, bnd_box);
|
||||
// copy to tree structure
|
||||
bnd_box_lo = annCopyPt(dd, bnd_box.lo);
|
||||
bnd_box_hi = annCopyPt(dd, bnd_box.hi);
|
||||
|
||||
switch (split) { // build by rule
|
||||
case ANN_KD_STD: // standard kd-splitting rule
|
||||
root = rbd_tree(pa, pidx, n, dd, bs, bnd_box, kd_split, shrink);
|
||||
break;
|
||||
case ANN_KD_MIDPT: // midpoint split
|
||||
root = rbd_tree(pa, pidx, n, dd, bs, bnd_box, midpt_split, shrink);
|
||||
break;
|
||||
case ANN_KD_SUGGEST: // best (in our opinion)
|
||||
case ANN_KD_SL_MIDPT: // sliding midpoint split
|
||||
root = rbd_tree(pa, pidx, n, dd, bs, bnd_box, sl_midpt_split, shrink);
|
||||
break;
|
||||
case ANN_KD_FAIR: // fair split
|
||||
root = rbd_tree(pa, pidx, n, dd, bs, bnd_box, fair_split, shrink);
|
||||
break;
|
||||
case ANN_KD_SL_FAIR: // sliding fair split
|
||||
root = rbd_tree(pa, pidx, n, dd, bs,
|
||||
bnd_box, sl_fair_split, shrink);
|
||||
break;
|
||||
default:
|
||||
annError("Illegal splitting method", ANNabort);
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Shrinking rules
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
enum ANNdecomp {SPLIT, SHRINK}; // decomposition methods
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// trySimpleShrink - Attempt a simple shrink
|
||||
//
|
||||
// We compute the tight bounding box of the points, and compute
|
||||
// the 2*dim ``gaps'' between the sides of the tight box and the
|
||||
// bounding box. If any of the gaps is large enough relative to
|
||||
// the longest side of the tight bounding box, then we shrink
|
||||
// all sides whose gaps are large enough. (The reason for
|
||||
// comparing against the tight bounding box, is that after
|
||||
// shrinking the longest box size will decrease, and if we use
|
||||
// the standard bounding box, we may decide to shrink twice in
|
||||
// a row. Since the tight box is fixed, we cannot shrink twice
|
||||
// consecutively.)
|
||||
//----------------------------------------------------------------------
|
||||
const float BD_GAP_THRESH = 0.5; // gap threshold (must be < 1)
|
||||
const int BD_CT_THRESH = 2; // min number of shrink sides
|
||||
|
||||
ANNdecomp trySimpleShrink( // try a simple shrink
|
||||
ANNpointArray pa, // point array
|
||||
ANNidxArray pidx, // point indices to store in subtree
|
||||
int n, // number of points
|
||||
int dim, // dimension of space
|
||||
const ANNorthRect &bnd_box, // current bounding box
|
||||
ANNorthRect &inner_box) // inner box if shrinking (returned)
|
||||
{
|
||||
int i;
|
||||
// compute tight bounding box
|
||||
annEnclRect(pa, pidx, n, dim, inner_box);
|
||||
|
||||
ANNcoord max_length = 0; // find longest box side
|
||||
for (i = 0; i < dim; i++) {
|
||||
ANNcoord length = inner_box.hi[i] - inner_box.lo[i];
|
||||
if (length > max_length) {
|
||||
max_length = length;
|
||||
}
|
||||
}
|
||||
|
||||
int shrink_ct = 0; // number of sides we shrunk
|
||||
for (i = 0; i < dim; i++) { // select which sides to shrink
|
||||
// gap between boxes
|
||||
ANNcoord gap_hi = bnd_box.hi[i] - inner_box.hi[i];
|
||||
// big enough gap to shrink?
|
||||
if (gap_hi < max_length*BD_GAP_THRESH)
|
||||
inner_box.hi[i] = bnd_box.hi[i]; // no - expand
|
||||
else shrink_ct++; // yes - shrink this side
|
||||
|
||||
// repeat for high side
|
||||
ANNcoord gap_lo = inner_box.lo[i] - bnd_box.lo[i];
|
||||
if (gap_lo < max_length*BD_GAP_THRESH)
|
||||
inner_box.lo[i] = bnd_box.lo[i]; // no - expand
|
||||
else shrink_ct++; // yes - shrink this side
|
||||
}
|
||||
|
||||
if (shrink_ct >= BD_CT_THRESH) // did we shrink enough sides?
|
||||
return SHRINK;
|
||||
else return SPLIT;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// tryCentroidShrink - Attempt a centroid shrink
|
||||
//
|
||||
// We repeatedly apply the splitting rule, always to the larger subset
|
||||
// of points, until the number of points decreases by the constant
|
||||
// fraction BD_FRACTION. If this takes more than dim*BD_MAX_SPLIT_FAC
|
||||
// splits for this to happen, then we shrink to the final inner box
|
||||
// Otherwise we split.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
const float BD_MAX_SPLIT_FAC = 0.5; // maximum number of splits allowed
|
||||
const float BD_FRACTION = 0.5; // ...to reduce points by this fraction
|
||||
// ...This must be < 1.
|
||||
|
||||
ANNdecomp tryCentroidShrink( // try a centroid shrink
|
||||
ANNpointArray pa, // point array
|
||||
ANNidxArray pidx, // point indices to store in subtree
|
||||
int n, // number of points
|
||||
int dim, // dimension of space
|
||||
const ANNorthRect &bnd_box, // current bounding box
|
||||
ANNkd_splitter splitter, // splitting procedure
|
||||
ANNorthRect &inner_box) // inner box if shrinking (returned)
|
||||
{
|
||||
int n_sub = n; // number of points in subset
|
||||
int n_goal = (int) (n*BD_FRACTION); // number of point in goal
|
||||
int n_splits = 0; // number of splits needed
|
||||
// initialize inner box to bounding box
|
||||
annAssignRect(dim, inner_box, bnd_box);
|
||||
|
||||
while (n_sub > n_goal) { // keep splitting until goal reached
|
||||
int cd; // cut dim from splitter (ignored)
|
||||
ANNcoord cv; // cut value from splitter (ignored)
|
||||
int n_lo; // number of points on low side
|
||||
// invoke splitting procedure
|
||||
(*splitter)(pa, pidx, inner_box, n_sub, dim, cd, cv, n_lo);
|
||||
n_splits++; // increment split count
|
||||
|
||||
if (n_lo >= n_sub/2) { // most points on low side
|
||||
inner_box.hi[cd] = cv; // collapse high side
|
||||
n_sub = n_lo; // recurse on lower points
|
||||
}
|
||||
else { // most points on high side
|
||||
inner_box.lo[cd] = cv; // collapse low side
|
||||
pidx += n_lo; // recurse on higher points
|
||||
n_sub -= n_lo;
|
||||
}
|
||||
}
|
||||
if (n_splits > dim*BD_MAX_SPLIT_FAC)// took too many splits
|
||||
return SHRINK; // shrink to final subset
|
||||
else
|
||||
return SPLIT;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// selectDecomp - select which decomposition to use
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
ANNdecomp selectDecomp( // select decomposition method
|
||||
ANNpointArray pa, // point array
|
||||
ANNidxArray pidx, // point indices to store in subtree
|
||||
int n, // number of points
|
||||
int dim, // dimension of space
|
||||
const ANNorthRect &bnd_box, // current bounding box
|
||||
ANNkd_splitter splitter, // splitting procedure
|
||||
ANNshrinkRule shrink, // shrinking rule
|
||||
ANNorthRect &inner_box) // inner box if shrinking (returned)
|
||||
{
|
||||
ANNdecomp decomp = SPLIT; // decomposition
|
||||
|
||||
switch (shrink) { // check shrinking rule
|
||||
case ANN_BD_NONE: // no shrinking allowed
|
||||
decomp = SPLIT;
|
||||
break;
|
||||
case ANN_BD_SUGGEST: // author's suggestion
|
||||
case ANN_BD_SIMPLE: // simple shrink
|
||||
decomp = trySimpleShrink(
|
||||
pa, pidx, // points and indices
|
||||
n, dim, // number of points and dimension
|
||||
bnd_box, // current bounding box
|
||||
inner_box); // inner box if shrinking (returned)
|
||||
break;
|
||||
case ANN_BD_CENTROID: // centroid shrink
|
||||
decomp = tryCentroidShrink(
|
||||
pa, pidx, // points and indices
|
||||
n, dim, // number of points and dimension
|
||||
bnd_box, // current bounding box
|
||||
splitter, // splitting procedure
|
||||
inner_box); // inner box if shrinking (returned)
|
||||
break;
|
||||
default:
|
||||
annError("Illegal shrinking rule", ANNabort);
|
||||
}
|
||||
return decomp;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// rbd_tree - recursive procedure to build a bd-tree
|
||||
//
|
||||
// This is analogous to rkd_tree, but for bd-trees. See the
|
||||
// procedure rkd_tree() in kd_split.cpp for more information.
|
||||
//
|
||||
// If the number of points falls below the bucket size, then a
|
||||
// leaf node is created for the points. Otherwise we invoke the
|
||||
// procedure selectDecomp() which determines whether we are to
|
||||
// split or shrink. If splitting is chosen, then we essentially
|
||||
// do exactly as rkd_tree() would, and invoke the specified
|
||||
// splitting procedure to the points. Otherwise, the selection
|
||||
// procedure returns a bounding box, from which we extract the
|
||||
// appropriate shrinking bounds, and create a shrinking node.
|
||||
// Finally the points are subdivided, and the procedure is
|
||||
// invoked recursively on the two subsets to form the children.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
ANNkd_ptr rbd_tree( // recursive construction of bd-tree
|
||||
ANNpointArray pa, // point array
|
||||
ANNidxArray pidx, // point indices to store in subtree
|
||||
int n, // number of points
|
||||
int dim, // dimension of space
|
||||
int bsp, // bucket space
|
||||
ANNorthRect &bnd_box, // bounding box for current node
|
||||
ANNkd_splitter splitter, // splitting routine
|
||||
ANNshrinkRule shrink) // shrinking rule
|
||||
{
|
||||
ANNdecomp decomp; // decomposition method
|
||||
|
||||
ANNorthRect inner_box(dim); // inner box (if shrinking)
|
||||
|
||||
if (n <= bsp) { // n small, make a leaf node
|
||||
if (n == 0) // empty leaf node
|
||||
return KD_TRIVIAL; // return (canonical) empty leaf
|
||||
else // construct the node and return
|
||||
return new ANNkd_leaf(n, pidx);
|
||||
}
|
||||
|
||||
decomp = selectDecomp( // select decomposition method
|
||||
pa, pidx, // points and indices
|
||||
n, dim, // number of points and dimension
|
||||
bnd_box, // current bounding box
|
||||
splitter, shrink, // splitting/shrinking methods
|
||||
inner_box); // inner box if shrinking (returned)
|
||||
|
||||
if (decomp == SPLIT) { // split selected
|
||||
int cd; // cutting dimension
|
||||
ANNcoord cv; // cutting value
|
||||
int n_lo; // number on low side of cut
|
||||
// invoke splitting procedure
|
||||
(*splitter)(pa, pidx, bnd_box, n, dim, cd, cv, n_lo);
|
||||
|
||||
ANNcoord lv = bnd_box.lo[cd]; // save bounds for cutting dimension
|
||||
ANNcoord hv = bnd_box.hi[cd];
|
||||
|
||||
bnd_box.hi[cd] = cv; // modify bounds for left subtree
|
||||
ANNkd_ptr lo = rbd_tree( // build left subtree
|
||||
pa, pidx, n_lo, // ...from pidx[0..n_lo-1]
|
||||
dim, bsp, bnd_box, splitter, shrink);
|
||||
bnd_box.hi[cd] = hv; // restore bounds
|
||||
|
||||
bnd_box.lo[cd] = cv; // modify bounds for right subtree
|
||||
ANNkd_ptr hi = rbd_tree( // build right subtree
|
||||
pa, pidx + n_lo, n-n_lo,// ...from pidx[n_lo..n-1]
|
||||
dim, bsp, bnd_box, splitter, shrink);
|
||||
bnd_box.lo[cd] = lv; // restore bounds
|
||||
// create the splitting node
|
||||
return new ANNkd_split(cd, cv, lv, hv, lo, hi);
|
||||
}
|
||||
else { // shrink selected
|
||||
int n_in; // number of points in box
|
||||
int n_bnds; // number of bounding sides
|
||||
|
||||
annBoxSplit( // split points around inner box
|
||||
pa, // points to split
|
||||
pidx, // point indices
|
||||
n, // number of points
|
||||
dim, // dimension
|
||||
inner_box, // inner box
|
||||
n_in); // number of points inside (returned)
|
||||
|
||||
ANNkd_ptr in = rbd_tree( // build inner subtree pidx[0..n_in-1]
|
||||
pa, pidx, n_in, dim, bsp, inner_box, splitter, shrink);
|
||||
ANNkd_ptr out = rbd_tree( // build outer subtree pidx[n_in..n]
|
||||
pa, pidx+n_in, n - n_in, dim, bsp, bnd_box, splitter, shrink);
|
||||
|
||||
ANNorthHSArray bnds = NULL; // bounds (alloc in Box2Bnds and
|
||||
// ...freed in bd_shrink destroyer)
|
||||
|
||||
annBox2Bnds( // convert inner box to bounds
|
||||
inner_box, // inner box
|
||||
bnd_box, // enclosing box
|
||||
dim, // dimension
|
||||
n_bnds, // number of bounds (returned)
|
||||
bnds); // bounds array (modified)
|
||||
|
||||
// return shrinking node
|
||||
return new ANNbd_shrink(n_bnds, bnds, in, out);
|
||||
}
|
||||
}
|
||||
Vendored
-100
@@ -1,100 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: bd_tree.h
|
||||
// Programmer: David Mount
|
||||
// Description: Declarations for standard bd-tree routines
|
||||
// Last modified: 01/04/05 (Version 1.0)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
// Revision 1.0 04/01/05
|
||||
// Changed IN, OUT to ANN_IN, ANN_OUT
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#ifndef ANN_bd_tree_H
|
||||
#define ANN_bd_tree_H
|
||||
|
||||
#include <ANN/ANNx.h> // all ANN includes
|
||||
#include "kd_tree.h" // kd-tree includes
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// bd-tree shrinking node.
|
||||
// The main addition in the bd-tree is the shrinking node, which
|
||||
// is declared here.
|
||||
//
|
||||
// Shrinking nodes are defined by list of orthogonal halfspaces.
|
||||
// These halfspaces define a (possibly unbounded) orthogonal
|
||||
// rectangle. There are two children, in and out. Points that
|
||||
// lie within this rectangle are stored in the in-child, and the
|
||||
// other points are stored in the out-child.
|
||||
//
|
||||
// We use a list of orthogonal halfspaces rather than an
|
||||
// orthogonal rectangle object because typically the number of
|
||||
// sides of the shrinking box will be much smaller than the
|
||||
// worst case bound of 2*dim.
|
||||
//
|
||||
// BEWARE: Note that constructor just copies the pointer to the
|
||||
// bounding array, but the destructor deallocates it. This is
|
||||
// rather poor practice, but happens to be convenient. The list
|
||||
// is allocated in the bd-tree building procedure rbd_tree() just
|
||||
// prior to construction, and is used for no other purposes.
|
||||
//
|
||||
// WARNING: In the near neighbor searching code it is assumed that
|
||||
// the list of bounding halfspaces is irredundant, meaning that there
|
||||
// are no two distinct halfspaces in the list with the same outward
|
||||
// pointing normals.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
class ANNbd_shrink : public ANNkd_node // splitting node of a kd-tree
|
||||
{
|
||||
int n_bnds; // number of bounding halfspaces
|
||||
ANNorthHSArray bnds; // list of bounding halfspaces
|
||||
ANNkd_ptr child[2]; // in and out children
|
||||
public:
|
||||
ANNbd_shrink( // constructor
|
||||
int nb, // number of bounding halfspaces
|
||||
ANNorthHSArray bds, // list of bounding halfspaces
|
||||
ANNkd_ptr ic=NULL, ANNkd_ptr oc=NULL) // children
|
||||
{
|
||||
n_bnds = nb; // cutting dimension
|
||||
bnds = bds; // assign bounds
|
||||
child[ANN_IN] = ic; // set children
|
||||
child[ANN_OUT] = oc;
|
||||
}
|
||||
|
||||
~ANNbd_shrink() // destructor
|
||||
{
|
||||
if (child[ANN_IN]!= NULL && child[ANN_IN]!= KD_TRIVIAL)
|
||||
delete child[ANN_IN];
|
||||
if (child[ANN_OUT]!= NULL&& child[ANN_OUT]!= KD_TRIVIAL)
|
||||
delete child[ANN_OUT];
|
||||
if (bnds != NULL)
|
||||
delete [] bnds; // delete bounds
|
||||
}
|
||||
|
||||
virtual void getStats( // get tree statistics
|
||||
int dim, // dimension of space
|
||||
ANNkdStats &st, // statistics
|
||||
ANNorthRect &bnd_box); // bounding box
|
||||
virtual void print(int level, ostream &out);// print node
|
||||
virtual void dump(ostream &out); // dump node
|
||||
|
||||
virtual void ann_search(ANNdist); // standard search
|
||||
virtual void ann_pri_search(ANNdist); // priority search
|
||||
virtual void ann_FR_search(ANNdist); // fixed-radius search
|
||||
};
|
||||
|
||||
#endif
|
||||
Vendored
-109
@@ -1,109 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: brute.cpp
|
||||
// Programmer: Sunil Arya and David Mount
|
||||
// Description: Brute-force nearest neighbors
|
||||
// Last modified: 05/03/05 (Version 1.1)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
// Revision 1.1 05/03/05
|
||||
// Added fixed-radius kNN search
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#include <ANN/ANNx.h> // all ANN includes
|
||||
#include "pr_queue_k.h" // k element priority queue
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Brute-force search simply stores a pointer to the list of
|
||||
// data points and searches linearly for the nearest neighbor.
|
||||
// The k nearest neighbors are stored in a k-element priority
|
||||
// queue (which is implemented in a pretty dumb way as well).
|
||||
//
|
||||
// If ANN_ALLOW_SELF_MATCH is ANNfalse then data points at distance
|
||||
// zero are not considered.
|
||||
//
|
||||
// Note that the error bound eps is passed in, but it is ignored.
|
||||
// These routines compute exact nearest neighbors (which is needed
|
||||
// for validation purposes in ann_test.cpp).
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
ANNbruteForce::ANNbruteForce( // constructor from point array
|
||||
ANNpointArray pa, // point array
|
||||
int n, // number of points
|
||||
int dd) // dimension
|
||||
{
|
||||
dim = dd; n_pts = n; pts = pa;
|
||||
}
|
||||
|
||||
ANNbruteForce::~ANNbruteForce() { } // destructor (empty)
|
||||
|
||||
void ANNbruteForce::annkSearch( // approx k near neighbor search
|
||||
ANNpoint q, // query point
|
||||
int k, // number of near neighbors to return
|
||||
ANNidxArray nn_idx, // nearest neighbor indices (returned)
|
||||
ANNdistArray dd, // dist to near neighbors (returned)
|
||||
double eps) // error bound (ignored)
|
||||
{
|
||||
ANNmin_k mk(k); // construct a k-limited priority queue
|
||||
int i;
|
||||
|
||||
if (k > n_pts) { // too many near neighbors?
|
||||
annError("Requesting more near neighbors than data points", ANNabort);
|
||||
}
|
||||
// run every point through queue
|
||||
for (i = 0; i < n_pts; i++) {
|
||||
// compute distance to point
|
||||
ANNdist sqDist = annDist(dim, pts[i], q);
|
||||
if (ANN_ALLOW_SELF_MATCH || sqDist != 0)
|
||||
mk.insert(sqDist, i);
|
||||
}
|
||||
for (i = 0; i < k; i++) { // extract the k closest points
|
||||
dd[i] = mk.ith_smallest_key(i);
|
||||
nn_idx[i] = mk.ith_smallest_info(i);
|
||||
}
|
||||
}
|
||||
|
||||
int ANNbruteForce::annkFRSearch( // approx fixed-radius kNN search
|
||||
ANNpoint q, // query point
|
||||
ANNdist sqRad, // squared radius
|
||||
int k, // number of near neighbors to return
|
||||
ANNidxArray nn_idx, // nearest neighbor array (returned)
|
||||
ANNdistArray dd, // dist to near neighbors (returned)
|
||||
double eps) // error bound
|
||||
{
|
||||
ANNmin_k mk(k); // construct a k-limited priority queue
|
||||
int i;
|
||||
int pts_in_range = 0; // number of points in query range
|
||||
// run every point through queue
|
||||
for (i = 0; i < n_pts; i++) {
|
||||
// compute distance to point
|
||||
ANNdist sqDist = annDist(dim, pts[i], q);
|
||||
if (sqDist <= sqRad && // within radius bound
|
||||
(ANN_ALLOW_SELF_MATCH || sqDist != 0)) { // ...and no self match
|
||||
mk.insert(sqDist, i);
|
||||
pts_in_range++;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < k; i++) { // extract the k closest points
|
||||
if (dd != NULL)
|
||||
dd[i] = mk.ith_smallest_key(i);
|
||||
if (nn_idx != NULL)
|
||||
nn_idx[i] = mk.ith_smallest_info(i);
|
||||
}
|
||||
|
||||
return pts_in_range;
|
||||
}
|
||||
Vendored
-446
@@ -1,446 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: kd_dump.cc
|
||||
// Programmer: David Mount
|
||||
// Description: Dump and Load for kd- and bd-trees
|
||||
// Last modified: 01/04/05 (Version 1.0)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
// Revision 1.0 04/01/05
|
||||
// Moved dump out of kd_tree.cc into this file.
|
||||
// Added kd-tree load constructor.
|
||||
//----------------------------------------------------------------------
|
||||
// This file contains routines for dumping kd-trees and bd-trees and
|
||||
// reloading them. (It is an abuse of policy to include both kd- and
|
||||
// bd-tree routines in the same file, sorry. There should be no problem
|
||||
// in deleting the bd- versions of the routines if they are not
|
||||
// desired.)
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#include "kd_tree.h" // kd-tree declarations
|
||||
#include "bd_tree.h" // bd-tree declarations
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
|
||||
using namespace std; // make std:: available
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Constants
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
const int STRING_LEN = 500; // maximum string length
|
||||
const double EPSILON = 1E-5; // small number for float comparison
|
||||
|
||||
enum ANNtreeType {KD_TREE, BD_TREE}; // tree types (used in loading)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Procedure declarations
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
static ANNkd_ptr annReadDump( // read dump file
|
||||
istream &in, // input stream
|
||||
ANNtreeType tree_type, // type of tree expected
|
||||
ANNpointArray &the_pts, // new points (if applic)
|
||||
ANNidxArray &the_pidx, // point indices (returned)
|
||||
int &the_dim, // dimension (returned)
|
||||
int &the_n_pts, // number of points (returned)
|
||||
int &the_bkt_size, // bucket size (returned)
|
||||
ANNpoint &the_bnd_box_lo, // low bounding point
|
||||
ANNpoint &the_bnd_box_hi); // high bounding point
|
||||
|
||||
static ANNkd_ptr annReadTree( // read tree-part of dump file
|
||||
istream &in, // input stream
|
||||
ANNtreeType tree_type, // type of tree expected
|
||||
ANNidxArray the_pidx, // point indices (modified)
|
||||
int &next_idx); // next index (modified)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// ANN kd- and bd-tree Dump Format
|
||||
// The dump file begins with a header containing the version of
|
||||
// ANN, an optional section containing the points, followed by
|
||||
// a description of the tree. The tree is printed in preorder.
|
||||
//
|
||||
// Format:
|
||||
// #ANN <version number> <comments> [END_OF_LINE]
|
||||
// points <dim> <n_pts> (point coordinates: this is optional)
|
||||
// 0 <xxx> <xxx> ... <xxx> (point indices and coordinates)
|
||||
// 1 <xxx> <xxx> ... <xxx>
|
||||
// ...
|
||||
// tree <dim> <n_pts> <bkt_size>
|
||||
// <xxx> <xxx> ... <xxx> (lower end of bounding box)
|
||||
// <xxx> <xxx> ... <xxx> (upper end of bounding box)
|
||||
// If the tree is null, then a single line "null" is
|
||||
// output. Otherwise the nodes of the tree are printed
|
||||
// one per line in preorder. Leaves and splitting nodes
|
||||
// have the following formats:
|
||||
// Leaf node:
|
||||
// leaf <n_pts> <bkt[0]> <bkt[1]> ... <bkt[n-1]>
|
||||
// Splitting nodes:
|
||||
// split <cut_dim> <cut_val> <lo_bound> <hi_bound>
|
||||
//
|
||||
// For bd-trees:
|
||||
//
|
||||
// Shrinking nodes:
|
||||
// shrink <n_bnds>
|
||||
// <cut_dim> <cut_val> <side>
|
||||
// <cut_dim> <cut_val> <side>
|
||||
// ... (repeated n_bnds times)
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void ANNkd_tree::Dump( // dump entire tree
|
||||
ANNbool with_pts, // print points as well?
|
||||
ostream &out) // output stream
|
||||
{
|
||||
out << "#ANN " << ANNversion << "\n";
|
||||
out.precision(ANNcoordPrec); // use full precision in dumping
|
||||
if (with_pts) { // print point coordinates
|
||||
out << "points " << dim << " " << n_pts << "\n";
|
||||
for (int i = 0; i < n_pts; i++) {
|
||||
out << i << " ";
|
||||
annPrintPt(pts[i], dim, out);
|
||||
out << "\n";
|
||||
}
|
||||
}
|
||||
out << "tree " // print tree elements
|
||||
<< dim << " "
|
||||
<< n_pts << " "
|
||||
<< bkt_size << "\n";
|
||||
|
||||
annPrintPt(bnd_box_lo, dim, out); // print lower bound
|
||||
out << "\n";
|
||||
annPrintPt(bnd_box_hi, dim, out); // print upper bound
|
||||
out << "\n";
|
||||
|
||||
if (root == NULL) // empty tree?
|
||||
out << "null\n";
|
||||
else {
|
||||
root->dump(out); // invoke printing at root
|
||||
}
|
||||
out.precision(0); // restore default precision
|
||||
}
|
||||
|
||||
void ANNkd_split::dump( // dump a splitting node
|
||||
ostream &out) // output stream
|
||||
{
|
||||
out << "split " << cut_dim << " " << cut_val << " ";
|
||||
out << cd_bnds[ANN_LO] << " " << cd_bnds[ANN_HI] << "\n";
|
||||
|
||||
child[ANN_LO]->dump(out); // print low child
|
||||
child[ANN_HI]->dump(out); // print high child
|
||||
}
|
||||
|
||||
void ANNkd_leaf::dump( // dump a leaf node
|
||||
ostream &out) // output stream
|
||||
{
|
||||
if (this == KD_TRIVIAL) { // canonical trivial leaf node
|
||||
out << "leaf 0\n"; // leaf no points
|
||||
}
|
||||
else{
|
||||
out << "leaf " << n_pts;
|
||||
for (int j = 0; j < n_pts; j++) {
|
||||
out << " " << bkt[j];
|
||||
}
|
||||
out << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
void ANNbd_shrink::dump( // dump a shrinking node
|
||||
ostream &out) // output stream
|
||||
{
|
||||
out << "shrink " << n_bnds << "\n";
|
||||
for (int j = 0; j < n_bnds; j++) {
|
||||
out << bnds[j].cd << " " << bnds[j].cv << " " << bnds[j].sd << "\n";
|
||||
}
|
||||
child[ANN_IN]->dump(out); // print in-child
|
||||
child[ANN_OUT]->dump(out); // print out-child
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Load kd-tree from dump file
|
||||
// This rebuilds a kd-tree which was dumped to a file. The dump
|
||||
// file contains all the basic tree information according to a
|
||||
// preorder traversal. We assume that the dump file also contains
|
||||
// point data. (This is to guarantee the consistency of the tree.)
|
||||
// If not, then an error is generated.
|
||||
//
|
||||
// Indirectly, this procedure allocates space for points, point
|
||||
// indices, all nodes in the tree, and the bounding box for the
|
||||
// tree. When the tree is destroyed, all but the points are
|
||||
// deallocated.
|
||||
//
|
||||
// This routine calls annReadDump to do all the work.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
ANNkd_tree::ANNkd_tree( // build from dump file
|
||||
istream &in) // input stream for dump file
|
||||
{
|
||||
int the_dim; // local dimension
|
||||
int the_n_pts; // local number of points
|
||||
int the_bkt_size; // local number of points
|
||||
ANNpoint the_bnd_box_lo; // low bounding point
|
||||
ANNpoint the_bnd_box_hi; // high bounding point
|
||||
ANNpointArray the_pts; // point storage
|
||||
ANNidxArray the_pidx; // point index storage
|
||||
ANNkd_ptr the_root; // root of the tree
|
||||
|
||||
the_root = annReadDump( // read the dump file
|
||||
in, // input stream
|
||||
KD_TREE, // expecting a kd-tree
|
||||
the_pts, // point array (returned)
|
||||
the_pidx, // point indices (returned)
|
||||
the_dim, the_n_pts, the_bkt_size, // basic tree info (returned)
|
||||
the_bnd_box_lo, the_bnd_box_hi); // bounding box info (returned)
|
||||
|
||||
// create a skeletal tree
|
||||
SkeletonTree(the_n_pts, the_dim, the_bkt_size, the_pts, the_pidx);
|
||||
|
||||
bnd_box_lo = the_bnd_box_lo;
|
||||
bnd_box_hi = the_bnd_box_hi;
|
||||
|
||||
root = the_root; // set the root
|
||||
}
|
||||
|
||||
ANNbd_tree::ANNbd_tree( // build bd-tree from dump file
|
||||
istream &in) : ANNkd_tree() // input stream for dump file
|
||||
{
|
||||
int the_dim; // local dimension
|
||||
int the_n_pts; // local number of points
|
||||
int the_bkt_size; // local number of points
|
||||
ANNpoint the_bnd_box_lo; // low bounding point
|
||||
ANNpoint the_bnd_box_hi; // high bounding point
|
||||
ANNpointArray the_pts; // point storage
|
||||
ANNidxArray the_pidx; // point index storage
|
||||
ANNkd_ptr the_root; // root of the tree
|
||||
|
||||
the_root = annReadDump( // read the dump file
|
||||
in, // input stream
|
||||
BD_TREE, // expecting a bd-tree
|
||||
the_pts, // point array (returned)
|
||||
the_pidx, // point indices (returned)
|
||||
the_dim, the_n_pts, the_bkt_size, // basic tree info (returned)
|
||||
the_bnd_box_lo, the_bnd_box_hi); // bounding box info (returned)
|
||||
|
||||
// create a skeletal tree
|
||||
SkeletonTree(the_n_pts, the_dim, the_bkt_size, the_pts, the_pidx);
|
||||
bnd_box_lo = the_bnd_box_lo;
|
||||
bnd_box_hi = the_bnd_box_hi;
|
||||
|
||||
root = the_root; // set the root
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annReadDump - read a dump file
|
||||
//
|
||||
// This procedure reads a dump file, constructs a kd-tree
|
||||
// and returns all the essential information needed to actually
|
||||
// construct the tree. Because this procedure is used for
|
||||
// constructing both kd-trees and bd-trees, the second argument
|
||||
// is used to indicate which type of tree we are expecting.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
static ANNkd_ptr annReadDump(
|
||||
istream &in, // input stream
|
||||
ANNtreeType tree_type, // type of tree expected
|
||||
ANNpointArray &the_pts, // new points (returned)
|
||||
ANNidxArray &the_pidx, // point indices (returned)
|
||||
int &the_dim, // dimension (returned)
|
||||
int &the_n_pts, // number of points (returned)
|
||||
int &the_bkt_size, // bucket size (returned)
|
||||
ANNpoint &the_bnd_box_lo, // low bounding point (ret'd)
|
||||
ANNpoint &the_bnd_box_hi) // high bounding point (ret'd)
|
||||
{
|
||||
int j;
|
||||
char str[STRING_LEN]; // storage for string
|
||||
char version[STRING_LEN]; // ANN version number
|
||||
ANNkd_ptr the_root = NULL;
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Input file header
|
||||
//------------------------------------------------------------------
|
||||
in >> str; // input header
|
||||
if (strcmp(str, "#ANN") != 0) { // incorrect header
|
||||
annError("Incorrect header for dump file", ANNabort);
|
||||
}
|
||||
in.getline(version, STRING_LEN); // get version (ignore)
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Input the points
|
||||
// An array the_pts is allocated and points are read from
|
||||
// the dump file.
|
||||
//------------------------------------------------------------------
|
||||
in >> str; // get major heading
|
||||
if (strcmp(str, "points") == 0) { // points section
|
||||
in >> the_dim; // input dimension
|
||||
in >> the_n_pts; // number of points
|
||||
// allocate point storage
|
||||
the_pts = annAllocPts(the_n_pts, the_dim);
|
||||
for (int i = 0; i < the_n_pts; i++) { // input point coordinates
|
||||
ANNidx idx; // point index
|
||||
in >> idx; // input point index
|
||||
if (idx < 0 || idx >= the_n_pts) {
|
||||
annError("Point index is out of range", ANNabort);
|
||||
}
|
||||
for (j = 0; j < the_dim; j++) {
|
||||
in >> the_pts[idx][j]; // read point coordinates
|
||||
}
|
||||
}
|
||||
in >> str; // get next major heading
|
||||
}
|
||||
else { // no points were input
|
||||
annError("Points must be supplied in the dump file", ANNabort);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Input the tree
|
||||
// After the basic header information, we invoke annReadTree
|
||||
// to do all the heavy work. We create our own array of
|
||||
// point indices (so we can pass them to annReadTree())
|
||||
// but we do not deallocate them. They will be deallocated
|
||||
// when the tree is destroyed.
|
||||
//------------------------------------------------------------------
|
||||
if (strcmp(str, "tree") == 0) { // tree section
|
||||
in >> the_dim; // read dimension
|
||||
in >> the_n_pts; // number of points
|
||||
in >> the_bkt_size; // bucket size
|
||||
the_bnd_box_lo = annAllocPt(the_dim); // allocate bounding box pts
|
||||
the_bnd_box_hi = annAllocPt(the_dim);
|
||||
|
||||
for (j = 0; j < the_dim; j++) { // read bounding box low
|
||||
in >> the_bnd_box_lo[j];
|
||||
}
|
||||
for (j = 0; j < the_dim; j++) { // read bounding box low
|
||||
in >> the_bnd_box_hi[j];
|
||||
}
|
||||
the_pidx = new ANNidx[the_n_pts]; // allocate point index array
|
||||
int next_idx = 0; // number of indices filled
|
||||
// read the tree and indices
|
||||
the_root = annReadTree(in, tree_type, the_pidx, next_idx);
|
||||
if (next_idx != the_n_pts) { // didn't see all the points?
|
||||
annError("Didn't see as many points as expected", ANNwarn);
|
||||
}
|
||||
}
|
||||
else {
|
||||
annError("Illegal dump format. Expecting section heading", ANNabort);
|
||||
}
|
||||
return the_root;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annReadTree - input tree and return pointer
|
||||
//
|
||||
// annReadTree reads in a node of the tree, makes any recursive
|
||||
// calls as needed to input the children of this node (if internal).
|
||||
// It returns a pointer to the node that was created. An array
|
||||
// of point indices is given along with a pointer to the next
|
||||
// available location in the array. As leaves are read, their
|
||||
// point indices are stored here, and the point buckets point
|
||||
// to the first entry in the array.
|
||||
//
|
||||
// Recall that these are the formats. The tree is given in
|
||||
// preorder.
|
||||
//
|
||||
// Leaf node:
|
||||
// leaf <n_pts> <bkt[0]> <bkt[1]> ... <bkt[n-1]>
|
||||
// Splitting nodes:
|
||||
// split <cut_dim> <cut_val> <lo_bound> <hi_bound>
|
||||
//
|
||||
// For bd-trees:
|
||||
//
|
||||
// Shrinking nodes:
|
||||
// shrink <n_bnds>
|
||||
// <cut_dim> <cut_val> <side>
|
||||
// <cut_dim> <cut_val> <side>
|
||||
// ... (repeated n_bnds times)
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
static ANNkd_ptr annReadTree(
|
||||
istream &in, // input stream
|
||||
ANNtreeType tree_type, // type of tree expected
|
||||
ANNidxArray the_pidx, // point indices (modified)
|
||||
int &next_idx) // next index (modified)
|
||||
{
|
||||
char tag[STRING_LEN]; // tag (leaf, split, shrink)
|
||||
int n_pts; // number of points in leaf
|
||||
int cd; // cut dimension
|
||||
ANNcoord cv; // cut value
|
||||
ANNcoord lb; // low bound
|
||||
ANNcoord hb; // high bound
|
||||
int n_bnds; // number of bounding sides
|
||||
int sd; // which side
|
||||
|
||||
in >> tag; // input node tag
|
||||
|
||||
if (strcmp(tag, "null") == 0) { // null tree
|
||||
return NULL;
|
||||
}
|
||||
//------------------------------------------------------------------
|
||||
// Read a leaf
|
||||
//------------------------------------------------------------------
|
||||
if (strcmp(tag, "leaf") == 0) { // leaf node
|
||||
|
||||
in >> n_pts; // input number of points
|
||||
int old_idx = next_idx; // save next_idx
|
||||
if (n_pts == 0) { // trivial leaf
|
||||
return KD_TRIVIAL;
|
||||
}
|
||||
else {
|
||||
for (int i = 0; i < n_pts; i++) { // input point indices
|
||||
in >> the_pidx[next_idx++]; // store in array of indices
|
||||
}
|
||||
}
|
||||
return new ANNkd_leaf(n_pts, &the_pidx[old_idx]);
|
||||
}
|
||||
//------------------------------------------------------------------
|
||||
// Read a splitting node
|
||||
//------------------------------------------------------------------
|
||||
else if (strcmp(tag, "split") == 0) { // splitting node
|
||||
|
||||
in >> cd >> cv >> lb >> hb;
|
||||
|
||||
// read low and high subtrees
|
||||
ANNkd_ptr lc = annReadTree(in, tree_type, the_pidx, next_idx);
|
||||
ANNkd_ptr hc = annReadTree(in, tree_type, the_pidx, next_idx);
|
||||
// create new node and return
|
||||
return new ANNkd_split(cd, cv, lb, hb, lc, hc);
|
||||
}
|
||||
//------------------------------------------------------------------
|
||||
// Read a shrinking node (bd-tree only)
|
||||
//------------------------------------------------------------------
|
||||
else if (strcmp(tag, "shrink") == 0) { // shrinking node
|
||||
if (tree_type != BD_TREE) {
|
||||
annError("Shrinking node not allowed in kd-tree", ANNabort);
|
||||
}
|
||||
|
||||
in >> n_bnds; // number of bounding sides
|
||||
// allocate bounds array
|
||||
ANNorthHSArray bds = new ANNorthHalfSpace[n_bnds];
|
||||
for (int i = 0; i < n_bnds; i++) {
|
||||
in >> cd >> cv >> sd; // input bounding halfspace
|
||||
// copy to array
|
||||
bds[i] = ANNorthHalfSpace(cd, cv, sd);
|
||||
}
|
||||
// read inner and outer subtrees
|
||||
ANNkd_ptr ic = annReadTree(in, tree_type, the_pidx, next_idx);
|
||||
ANNkd_ptr oc = annReadTree(in, tree_type, the_pidx, next_idx);
|
||||
// create new node and return
|
||||
return new ANNbd_shrink(n_bnds, bds, ic, oc);
|
||||
}
|
||||
else {
|
||||
annError("Illegal node type in dump file", ANNabort);
|
||||
exit(0); // to keep the compiler happy
|
||||
}
|
||||
}
|
||||
-183
@@ -1,183 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: kd_fix_rad_search.cpp
|
||||
// Programmer: Sunil Arya and David Mount
|
||||
// Description: Standard kd-tree fixed-radius kNN search
|
||||
// Last modified: 05/03/05 (Version 1.1)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 1.1 05/03/05
|
||||
// Initial release
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#include "kd_fix_rad_search.h" // kd fixed-radius search decls
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Approximate fixed-radius k nearest neighbor search
|
||||
// The squared radius is provided, and this procedure finds the
|
||||
// k nearest neighbors within the radius, and returns the total
|
||||
// number of points lying within the radius.
|
||||
//
|
||||
// The method used for searching the kd-tree is a variation of the
|
||||
// nearest neighbor search used in kd_search.cpp, except that the
|
||||
// radius of the search ball is known. We refer the reader to that
|
||||
// file for the explanation of the recursive search procedure.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// To keep argument lists short, a number of global variables
|
||||
// are maintained which are common to all the recursive calls.
|
||||
// These are given below.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
int ANNkdFRDim; // dimension of space
|
||||
ANNpoint ANNkdFRQ; // query point
|
||||
ANNdist ANNkdFRSqRad; // squared radius search bound
|
||||
double ANNkdFRMaxErr; // max tolerable squared error
|
||||
ANNpointArray ANNkdFRPts; // the points
|
||||
ANNmin_k* ANNkdFRPointMK; // set of k closest points
|
||||
int ANNkdFRPtsVisited; // total points visited
|
||||
int ANNkdFRPtsInRange; // number of points in the range
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annkFRSearch - fixed radius search for k nearest neighbors
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
int ANNkd_tree::annkFRSearch(
|
||||
ANNpoint q, // the query point
|
||||
ANNdist sqRad, // squared radius search bound
|
||||
int k, // number of near neighbors to return
|
||||
ANNidxArray nn_idx, // nearest neighbor indices (returned)
|
||||
ANNdistArray dd, // the approximate nearest neighbor
|
||||
double eps) // the error bound
|
||||
{
|
||||
ANNkdFRDim = dim; // copy arguments to static equivs
|
||||
ANNkdFRQ = q;
|
||||
ANNkdFRSqRad = sqRad;
|
||||
ANNkdFRPts = pts;
|
||||
ANNkdFRPtsVisited = 0; // initialize count of points visited
|
||||
ANNkdFRPtsInRange = 0; // ...and points in the range
|
||||
|
||||
ANNkdFRMaxErr = ANN_POW(1.0 + eps);
|
||||
ANN_FLOP(2) // increment floating op count
|
||||
|
||||
ANNkdFRPointMK = new ANNmin_k(k); // create set for closest k points
|
||||
// search starting at the root
|
||||
root->ann_FR_search(annBoxDistance(q, bnd_box_lo, bnd_box_hi, dim));
|
||||
|
||||
for (int i = 0; i < k; i++) { // extract the k-th closest points
|
||||
if (dd != NULL)
|
||||
dd[i] = ANNkdFRPointMK->ith_smallest_key(i);
|
||||
if (nn_idx != NULL)
|
||||
nn_idx[i] = ANNkdFRPointMK->ith_smallest_info(i);
|
||||
}
|
||||
|
||||
delete ANNkdFRPointMK; // deallocate closest point set
|
||||
return ANNkdFRPtsInRange; // return final point count
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// kd_split::ann_FR_search - search a splitting node
|
||||
// Note: This routine is similar in structure to the standard kNN
|
||||
// search. It visits the subtree that is closer to the query point
|
||||
// first. For fixed-radius search, there is no benefit in visiting
|
||||
// one subtree before the other, but we maintain the same basic
|
||||
// code structure for the sake of uniformity.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void ANNkd_split::ann_FR_search(ANNdist box_dist)
|
||||
{
|
||||
// check dist calc term condition
|
||||
if (ANNmaxPtsVisited != 0 && ANNkdFRPtsVisited > ANNmaxPtsVisited) return;
|
||||
|
||||
// distance to cutting plane
|
||||
ANNcoord cut_diff = ANNkdFRQ[cut_dim] - cut_val;
|
||||
|
||||
if (cut_diff < 0) { // left of cutting plane
|
||||
child[ANN_LO]->ann_FR_search(box_dist);// visit closer child first
|
||||
|
||||
ANNcoord box_diff = cd_bnds[ANN_LO] - ANNkdFRQ[cut_dim];
|
||||
if (box_diff < 0) // within bounds - ignore
|
||||
box_diff = 0;
|
||||
// distance to further box
|
||||
box_dist = (ANNdist) ANN_SUM(box_dist,
|
||||
ANN_DIFF(ANN_POW(box_diff), ANN_POW(cut_diff)));
|
||||
|
||||
// visit further child if in range
|
||||
if (box_dist * ANNkdFRMaxErr <= ANNkdFRSqRad)
|
||||
child[ANN_HI]->ann_FR_search(box_dist);
|
||||
|
||||
}
|
||||
else { // right of cutting plane
|
||||
child[ANN_HI]->ann_FR_search(box_dist);// visit closer child first
|
||||
|
||||
ANNcoord box_diff = ANNkdFRQ[cut_dim] - cd_bnds[ANN_HI];
|
||||
if (box_diff < 0) // within bounds - ignore
|
||||
box_diff = 0;
|
||||
// distance to further box
|
||||
box_dist = (ANNdist) ANN_SUM(box_dist,
|
||||
ANN_DIFF(ANN_POW(box_diff), ANN_POW(cut_diff)));
|
||||
|
||||
// visit further child if close enough
|
||||
if (box_dist * ANNkdFRMaxErr <= ANNkdFRSqRad)
|
||||
child[ANN_LO]->ann_FR_search(box_dist);
|
||||
|
||||
}
|
||||
ANN_FLOP(13) // increment floating ops
|
||||
ANN_SPL(1) // one more splitting node visited
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// kd_leaf::ann_FR_search - search points in a leaf node
|
||||
// Note: The unreadability of this code is the result of
|
||||
// some fine tuning to replace indexing by pointer operations.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void ANNkd_leaf::ann_FR_search(ANNdist box_dist)
|
||||
{
|
||||
register ANNdist dist; // distance to data point
|
||||
register ANNcoord* pp; // data coordinate pointer
|
||||
register ANNcoord* qq; // query coordinate pointer
|
||||
register ANNcoord t;
|
||||
register int d;
|
||||
|
||||
for (int i = 0; i < n_pts; i++) { // check points in bucket
|
||||
|
||||
pp = ANNkdFRPts[bkt[i]]; // first coord of next data point
|
||||
qq = ANNkdFRQ; // first coord of query point
|
||||
dist = 0;
|
||||
|
||||
for(d = 0; d < ANNkdFRDim; d++) {
|
||||
ANN_COORD(1) // one more coordinate hit
|
||||
ANN_FLOP(5) // increment floating ops
|
||||
|
||||
t = *(qq++) - *(pp++); // compute length and adv coordinate
|
||||
// exceeds dist to k-th smallest?
|
||||
if( (dist = ANN_SUM(dist, ANN_POW(t))) > ANNkdFRSqRad) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (d >= ANNkdFRDim && // among the k best?
|
||||
(ANN_ALLOW_SELF_MATCH || dist!=0)) { // and no self-match problem
|
||||
// add it to the list
|
||||
ANNkdFRPointMK->insert(dist, bkt[i]);
|
||||
ANNkdFRPtsInRange++; // increment point count
|
||||
}
|
||||
}
|
||||
ANN_LEAF(1) // one more leaf node visited
|
||||
ANN_PTS(n_pts) // increment points visited
|
||||
ANNkdFRPtsVisited += n_pts; // increment number of points visited
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: kd_fix_rad_search.h
|
||||
// Programmer: Sunil Arya and David Mount
|
||||
// Description: Standard kd-tree fixed-radius kNN search
|
||||
// Last modified: 05/03/05 (Version 1.1)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 1.1 05/03/05
|
||||
// Initial release
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#ifndef ANN_kd_fix_rad_search_H
|
||||
#define ANN_kd_fix_rad_search_H
|
||||
|
||||
#include "kd_tree.h" // kd-tree declarations
|
||||
#include "kd_util.h" // kd-tree utilities
|
||||
#include "pr_queue_k.h" // k-element priority queue
|
||||
|
||||
#include <ANN/ANNperf.h> // performance evaluation
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Global variables
|
||||
// These are active for the life of each call to
|
||||
// annRangeSearch(). They are set to save the number of
|
||||
// variables that need to be passed among the various search
|
||||
// procedures.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
extern ANNpoint ANNkdFRQ; // query point (static copy)
|
||||
|
||||
#endif
|
||||
-219
@@ -1,219 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: kd_pr_search.cpp
|
||||
// Programmer: Sunil Arya and David Mount
|
||||
// Description: Priority search for kd-trees
|
||||
// Last modified: 01/04/05 (Version 1.0)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#include "kd_pr_search.h" // kd priority search declarations
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Approximate nearest neighbor searching by priority search.
|
||||
// The kd-tree is searched for an approximate nearest neighbor.
|
||||
// The point is returned through one of the arguments, and the
|
||||
// distance returned is the SQUARED distance to this point.
|
||||
//
|
||||
// The method used for searching the kd-tree is called priority
|
||||
// search. (It is described in Arya and Mount, ``Algorithms for
|
||||
// fast vector quantization,'' Proc. of DCC '93: Data Compression
|
||||
// Conference}, eds. J. A. Storer and M. Cohn, IEEE Press, 1993,
|
||||
// 381--390.)
|
||||
//
|
||||
// The cell of the kd-tree containing the query point is located,
|
||||
// and cells are visited in increasing order of distance from the
|
||||
// query point. This is done by placing each subtree which has
|
||||
// NOT been visited in a priority queue, according to the closest
|
||||
// distance of the corresponding enclosing rectangle from the
|
||||
// query point. The search stops when the distance to the nearest
|
||||
// remaining rectangle exceeds the distance to the nearest point
|
||||
// seen by a factor of more than 1/(1+eps). (Implying that any
|
||||
// point found subsequently in the search cannot be closer by more
|
||||
// than this factor.)
|
||||
//
|
||||
// The main entry point is annkPriSearch() which sets things up and
|
||||
// then call the recursive routine ann_pri_search(). This is a
|
||||
// recursive routine which performs the processing for one node in
|
||||
// the kd-tree. There are two versions of this virtual procedure,
|
||||
// one for splitting nodes and one for leaves. When a splitting node
|
||||
// is visited, we determine which child to continue the search on
|
||||
// (the closer one), and insert the other child into the priority
|
||||
// queue. When a leaf is visited, we compute the distances to the
|
||||
// points in the buckets, and update information on the closest
|
||||
// points.
|
||||
//
|
||||
// Some trickery is used to incrementally update the distance from
|
||||
// a kd-tree rectangle to the query point. This comes about from
|
||||
// the fact that which each successive split, only one component
|
||||
// (along the dimension that is split) of the squared distance to
|
||||
// the child rectangle is different from the squared distance to
|
||||
// the parent rectangle.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// To keep argument lists short, a number of global variables
|
||||
// are maintained which are common to all the recursive calls.
|
||||
// These are given below.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
double ANNprEps; // the error bound
|
||||
int ANNprDim; // dimension of space
|
||||
ANNpoint ANNprQ; // query point
|
||||
double ANNprMaxErr; // max tolerable squared error
|
||||
ANNpointArray ANNprPts; // the points
|
||||
ANNpr_queue *ANNprBoxPQ; // priority queue for boxes
|
||||
ANNmin_k *ANNprPointMK; // set of k closest points
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annkPriSearch - priority search for k nearest neighbors
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void ANNkd_tree::annkPriSearch(
|
||||
ANNpoint q, // query point
|
||||
int k, // number of near neighbors to return
|
||||
ANNidxArray nn_idx, // nearest neighbor indices (returned)
|
||||
ANNdistArray dd, // dist to near neighbors (returned)
|
||||
double eps) // error bound (ignored)
|
||||
{
|
||||
// max tolerable squared error
|
||||
ANNprMaxErr = ANN_POW(1.0 + eps);
|
||||
ANN_FLOP(2) // increment floating ops
|
||||
|
||||
ANNprDim = dim; // copy arguments to static equivs
|
||||
ANNprQ = q;
|
||||
ANNprPts = pts;
|
||||
ANNptsVisited = 0; // initialize count of points visited
|
||||
|
||||
ANNprPointMK = new ANNmin_k(k); // create set for closest k points
|
||||
|
||||
// distance to root box
|
||||
ANNdist box_dist = annBoxDistance(q,
|
||||
bnd_box_lo, bnd_box_hi, dim);
|
||||
|
||||
ANNprBoxPQ = new ANNpr_queue(n_pts);// create priority queue for boxes
|
||||
ANNprBoxPQ->insert(box_dist, root); // insert root in priority queue
|
||||
|
||||
while (ANNprBoxPQ->non_empty() &&
|
||||
(!(ANNmaxPtsVisited != 0 && ANNptsVisited > ANNmaxPtsVisited))) {
|
||||
ANNkd_ptr np; // next box from prior queue
|
||||
|
||||
// extract closest box from queue
|
||||
ANNprBoxPQ->extr_min(box_dist, (void *&) np);
|
||||
|
||||
ANN_FLOP(2) // increment floating ops
|
||||
if (box_dist*ANNprMaxErr >= ANNprPointMK->max_key())
|
||||
break;
|
||||
|
||||
np->ann_pri_search(box_dist); // search this subtree.
|
||||
}
|
||||
|
||||
for (int i = 0; i < k; i++) { // extract the k-th closest points
|
||||
dd[i] = ANNprPointMK->ith_smallest_key(i);
|
||||
nn_idx[i] = ANNprPointMK->ith_smallest_info(i);
|
||||
}
|
||||
|
||||
delete ANNprPointMK; // deallocate closest point set
|
||||
delete ANNprBoxPQ; // deallocate priority queue
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// kd_split::ann_pri_search - search a splitting node
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void ANNkd_split::ann_pri_search(ANNdist box_dist)
|
||||
{
|
||||
ANNdist new_dist; // distance to child visited later
|
||||
// distance to cutting plane
|
||||
ANNcoord cut_diff = ANNprQ[cut_dim] - cut_val;
|
||||
|
||||
if (cut_diff < 0) { // left of cutting plane
|
||||
ANNcoord box_diff = cd_bnds[ANN_LO] - ANNprQ[cut_dim];
|
||||
if (box_diff < 0) // within bounds - ignore
|
||||
box_diff = 0;
|
||||
// distance to further box
|
||||
new_dist = (ANNdist) ANN_SUM(box_dist,
|
||||
ANN_DIFF(ANN_POW(box_diff), ANN_POW(cut_diff)));
|
||||
|
||||
if (child[ANN_HI] != KD_TRIVIAL)// enqueue if not trivial
|
||||
ANNprBoxPQ->insert(new_dist, child[ANN_HI]);
|
||||
// continue with closer child
|
||||
child[ANN_LO]->ann_pri_search(box_dist);
|
||||
}
|
||||
else { // right of cutting plane
|
||||
ANNcoord box_diff = ANNprQ[cut_dim] - cd_bnds[ANN_HI];
|
||||
if (box_diff < 0) // within bounds - ignore
|
||||
box_diff = 0;
|
||||
// distance to further box
|
||||
new_dist = (ANNdist) ANN_SUM(box_dist,
|
||||
ANN_DIFF(ANN_POW(box_diff), ANN_POW(cut_diff)));
|
||||
|
||||
if (child[ANN_LO] != KD_TRIVIAL)// enqueue if not trivial
|
||||
ANNprBoxPQ->insert(new_dist, child[ANN_LO]);
|
||||
// continue with closer child
|
||||
child[ANN_HI]->ann_pri_search(box_dist);
|
||||
}
|
||||
ANN_SPL(1) // one more splitting node visited
|
||||
ANN_FLOP(8) // increment floating ops
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// kd_leaf::ann_pri_search - search points in a leaf node
|
||||
//
|
||||
// This is virtually identical to the ann_search for standard search.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void ANNkd_leaf::ann_pri_search(ANNdist box_dist)
|
||||
{
|
||||
register ANNdist dist; // distance to data point
|
||||
register ANNcoord* pp; // data coordinate pointer
|
||||
register ANNcoord* qq; // query coordinate pointer
|
||||
register ANNdist min_dist; // distance to k-th closest point
|
||||
register ANNcoord t;
|
||||
register int d;
|
||||
|
||||
min_dist = ANNprPointMK->max_key(); // k-th smallest distance so far
|
||||
|
||||
for (int i = 0; i < n_pts; i++) { // check points in bucket
|
||||
|
||||
pp = ANNprPts[bkt[i]]; // first coord of next data point
|
||||
qq = ANNprQ; // first coord of query point
|
||||
dist = 0;
|
||||
|
||||
for(d = 0; d < ANNprDim; d++) {
|
||||
ANN_COORD(1) // one more coordinate hit
|
||||
ANN_FLOP(4) // increment floating ops
|
||||
|
||||
t = *(qq++) - *(pp++); // compute length and adv coordinate
|
||||
// exceeds dist to k-th smallest?
|
||||
if( (dist = ANN_SUM(dist, ANN_POW(t))) > min_dist) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (d >= ANNprDim && // among the k best?
|
||||
(ANN_ALLOW_SELF_MATCH || dist!=0)) { // and no self-match problem
|
||||
// add it to the list
|
||||
ANNprPointMK->insert(dist, bkt[i]);
|
||||
min_dist = ANNprPointMK->max_key();
|
||||
}
|
||||
}
|
||||
ANN_LEAF(1) // one more leaf node visited
|
||||
ANN_PTS(n_pts) // increment points visited
|
||||
ANNptsVisited += n_pts; // increment number of points visited
|
||||
}
|
||||
Vendored
-49
@@ -1,49 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: kd_pr_search.h
|
||||
// Programmer: Sunil Arya and David Mount
|
||||
// Description: Priority kd-tree search
|
||||
// Last modified: 01/04/05 (Version 1.0)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#ifndef ANN_kd_pr_search_H
|
||||
#define ANN_kd_pr_search_H
|
||||
|
||||
#include "kd_tree.h" // kd-tree declarations
|
||||
#include "kd_util.h" // kd-tree utilities
|
||||
#include "pr_queue.h" // priority queue declarations
|
||||
#include "pr_queue_k.h" // k-element priority queue
|
||||
|
||||
#include <ANN/ANNperf.h> // performance evaluation
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Global variables
|
||||
// Active for the life of each call to Appx_Near_Neigh() or
|
||||
// Appx_k_Near_Neigh().
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
extern double ANNprEps; // the error bound
|
||||
extern int ANNprDim; // dimension of space
|
||||
extern ANNpoint ANNprQ; // query point
|
||||
extern double ANNprMaxErr; // max tolerable squared error
|
||||
extern ANNpointArray ANNprPts; // the points
|
||||
extern ANNpr_queue *ANNprBoxPQ; // priority queue for boxes
|
||||
extern ANNmin_k *ANNprPointMK; // set of k closest points
|
||||
|
||||
#endif
|
||||
Vendored
-210
@@ -1,210 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: kd_search.cpp
|
||||
// Programmer: Sunil Arya and David Mount
|
||||
// Description: Standard kd-tree search
|
||||
// Last modified: 01/04/05 (Version 1.0)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
// Revision 1.0 04/01/05
|
||||
// Changed names LO, HI to ANN_LO, ANN_HI
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#include "kd_search.h" // kd-search declarations
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Approximate nearest neighbor searching by kd-tree search
|
||||
// The kd-tree is searched for an approximate nearest neighbor.
|
||||
// The point is returned through one of the arguments, and the
|
||||
// distance returned is the squared distance to this point.
|
||||
//
|
||||
// The method used for searching the kd-tree is an approximate
|
||||
// adaptation of the search algorithm described by Friedman,
|
||||
// Bentley, and Finkel, ``An algorithm for finding best matches
|
||||
// in logarithmic expected time,'' ACM Transactions on Mathematical
|
||||
// Software, 3(3):209-226, 1977).
|
||||
//
|
||||
// The algorithm operates recursively. When first encountering a
|
||||
// node of the kd-tree we first visit the child which is closest to
|
||||
// the query point. On return, we decide whether we want to visit
|
||||
// the other child. If the box containing the other child exceeds
|
||||
// 1/(1+eps) times the current best distance, then we skip it (since
|
||||
// any point found in this child cannot be closer to the query point
|
||||
// by more than this factor.) Otherwise, we visit it recursively.
|
||||
// The distance between a box and the query point is computed exactly
|
||||
// (not approximated as is often done in kd-tree), using incremental
|
||||
// distance updates, as described by Arya and Mount in ``Algorithms
|
||||
// for fast vector quantization,'' Proc. of DCC '93: Data Compression
|
||||
// Conference, eds. J. A. Storer and M. Cohn, IEEE Press, 1993,
|
||||
// 381-390.
|
||||
//
|
||||
// The main entry points is annkSearch() which sets things up and
|
||||
// then call the recursive routine ann_search(). This is a recursive
|
||||
// routine which performs the processing for one node in the kd-tree.
|
||||
// There are two versions of this virtual procedure, one for splitting
|
||||
// nodes and one for leaves. When a splitting node is visited, we
|
||||
// determine which child to visit first (the closer one), and visit
|
||||
// the other child on return. When a leaf is visited, we compute
|
||||
// the distances to the points in the buckets, and update information
|
||||
// on the closest points.
|
||||
//
|
||||
// Some trickery is used to incrementally update the distance from
|
||||
// a kd-tree rectangle to the query point. This comes about from
|
||||
// the fact that which each successive split, only one component
|
||||
// (along the dimension that is split) of the squared distance to
|
||||
// the child rectangle is different from the squared distance to
|
||||
// the parent rectangle.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// To keep argument lists short, a number of global variables
|
||||
// are maintained which are common to all the recursive calls.
|
||||
// These are given below.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
int ANNkdDim; // dimension of space
|
||||
ANNpoint ANNkdQ; // query point
|
||||
double ANNkdMaxErr; // max tolerable squared error
|
||||
ANNpointArray ANNkdPts; // the points
|
||||
ANNmin_k *ANNkdPointMK; // set of k closest points
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annkSearch - search for the k nearest neighbors
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void ANNkd_tree::annkSearch(
|
||||
ANNpoint q, // the query point
|
||||
int k, // number of near neighbors to return
|
||||
ANNidxArray nn_idx, // nearest neighbor indices (returned)
|
||||
ANNdistArray dd, // the approximate nearest neighbor
|
||||
double eps) // the error bound
|
||||
{
|
||||
|
||||
ANNkdDim = dim; // copy arguments to static equivs
|
||||
ANNkdQ = q;
|
||||
ANNkdPts = pts;
|
||||
ANNptsVisited = 0; // initialize count of points visited
|
||||
|
||||
if (k > n_pts) { // too many near neighbors?
|
||||
annError("Requesting more near neighbors than data points", ANNabort);
|
||||
}
|
||||
|
||||
ANNkdMaxErr = ANN_POW(1.0 + eps);
|
||||
ANN_FLOP(2) // increment floating op count
|
||||
|
||||
ANNkdPointMK = new ANNmin_k(k); // create set for closest k points
|
||||
// search starting at the root
|
||||
root->ann_search(annBoxDistance(q, bnd_box_lo, bnd_box_hi, dim));
|
||||
|
||||
for (int i = 0; i < k; i++) { // extract the k-th closest points
|
||||
dd[i] = ANNkdPointMK->ith_smallest_key(i);
|
||||
nn_idx[i] = ANNkdPointMK->ith_smallest_info(i);
|
||||
}
|
||||
delete ANNkdPointMK; // deallocate closest point set
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// kd_split::ann_search - search a splitting node
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void ANNkd_split::ann_search(ANNdist box_dist)
|
||||
{
|
||||
// check dist calc term condition
|
||||
if (ANNmaxPtsVisited != 0 && ANNptsVisited > ANNmaxPtsVisited) return;
|
||||
|
||||
// distance to cutting plane
|
||||
ANNcoord cut_diff = ANNkdQ[cut_dim] - cut_val;
|
||||
|
||||
if (cut_diff < 0) { // left of cutting plane
|
||||
child[ANN_LO]->ann_search(box_dist);// visit closer child first
|
||||
|
||||
ANNcoord box_diff = cd_bnds[ANN_LO] - ANNkdQ[cut_dim];
|
||||
if (box_diff < 0) // within bounds - ignore
|
||||
box_diff = 0;
|
||||
// distance to further box
|
||||
box_dist = (ANNdist) ANN_SUM(box_dist,
|
||||
ANN_DIFF(ANN_POW(box_diff), ANN_POW(cut_diff)));
|
||||
|
||||
// visit further child if close enough
|
||||
if (box_dist * ANNkdMaxErr < ANNkdPointMK->max_key())
|
||||
child[ANN_HI]->ann_search(box_dist);
|
||||
|
||||
}
|
||||
else { // right of cutting plane
|
||||
child[ANN_HI]->ann_search(box_dist);// visit closer child first
|
||||
|
||||
ANNcoord box_diff = ANNkdQ[cut_dim] - cd_bnds[ANN_HI];
|
||||
if (box_diff < 0) // within bounds - ignore
|
||||
box_diff = 0;
|
||||
// distance to further box
|
||||
box_dist = (ANNdist) ANN_SUM(box_dist,
|
||||
ANN_DIFF(ANN_POW(box_diff), ANN_POW(cut_diff)));
|
||||
|
||||
// visit further child if close enough
|
||||
if (box_dist * ANNkdMaxErr < ANNkdPointMK->max_key())
|
||||
child[ANN_LO]->ann_search(box_dist);
|
||||
|
||||
}
|
||||
ANN_FLOP(10) // increment floating ops
|
||||
ANN_SPL(1) // one more splitting node visited
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// kd_leaf::ann_search - search points in a leaf node
|
||||
// Note: The unreadability of this code is the result of
|
||||
// some fine tuning to replace indexing by pointer operations.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void ANNkd_leaf::ann_search(ANNdist box_dist)
|
||||
{
|
||||
register ANNdist dist; // distance to data point
|
||||
register ANNcoord* pp; // data coordinate pointer
|
||||
register ANNcoord* qq; // query coordinate pointer
|
||||
register ANNdist min_dist; // distance to k-th closest point
|
||||
register ANNcoord t;
|
||||
register int d;
|
||||
|
||||
min_dist = ANNkdPointMK->max_key(); // k-th smallest distance so far
|
||||
|
||||
for (int i = 0; i < n_pts; i++) { // check points in bucket
|
||||
|
||||
pp = ANNkdPts[bkt[i]]; // first coord of next data point
|
||||
qq = ANNkdQ; // first coord of query point
|
||||
dist = 0;
|
||||
|
||||
for(d = 0; d < ANNkdDim; d++) {
|
||||
ANN_COORD(1) // one more coordinate hit
|
||||
ANN_FLOP(4) // increment floating ops
|
||||
|
||||
t = *(qq++) - *(pp++); // compute length and adv coordinate
|
||||
// exceeds dist to k-th smallest?
|
||||
if( (dist = ANN_SUM(dist, ANN_POW(t))) > min_dist) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (d >= ANNkdDim && // among the k best?
|
||||
(ANN_ALLOW_SELF_MATCH || dist!=0)) { // and no self-match problem
|
||||
// add it to the list
|
||||
ANNkdPointMK->insert(dist, bkt[i]);
|
||||
min_dist = ANNkdPointMK->max_key();
|
||||
}
|
||||
}
|
||||
ANN_LEAF(1) // one more leaf node visited
|
||||
ANN_PTS(n_pts) // increment points visited
|
||||
ANNptsVisited += n_pts; // increment number of points visited
|
||||
}
|
||||
Vendored
-48
@@ -1,48 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: kd_search.h
|
||||
// Programmer: Sunil Arya and David Mount
|
||||
// Description: Standard kd-tree search
|
||||
// Last modified: 01/04/05 (Version 1.0)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#ifndef ANN_kd_search_H
|
||||
#define ANN_kd_search_H
|
||||
|
||||
#include "kd_tree.h" // kd-tree declarations
|
||||
#include "kd_util.h" // kd-tree utilities
|
||||
#include "pr_queue_k.h" // k-element priority queue
|
||||
|
||||
#include <ANN/ANNperf.h> // performance evaluation
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// More global variables
|
||||
// These are active for the life of each call to annkSearch(). They
|
||||
// are set to save the number of variables that need to be passed
|
||||
// among the various search procedures.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
extern int ANNkdDim; // dimension of space (static copy)
|
||||
extern ANNpoint ANNkdQ; // query point (static copy)
|
||||
extern double ANNkdMaxErr; // max tolerable squared error
|
||||
extern ANNpointArray ANNkdPts; // the points (static copy)
|
||||
extern ANNmin_k *ANNkdPointMK; // set of k closest points
|
||||
extern int ANNptsVisited; // number of points visited
|
||||
|
||||
#endif
|
||||
Vendored
-428
@@ -1,428 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: kd_split.cpp
|
||||
// Programmer: Sunil Arya and David Mount
|
||||
// Description: Methods for splitting kd-trees
|
||||
// Last modified: 01/04/05 (Version 1.0)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
// Revision 1.0 04/01/05
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#include "kd_tree.h" // kd-tree definitions
|
||||
#include "kd_util.h" // kd-tree utilities
|
||||
#include "kd_split.h" // splitting functions
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Constants
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
const double ERR = 0.001; // a small value
|
||||
const double FS_ASPECT_RATIO = 3.0; // maximum allowed aspect ratio
|
||||
// in fair split. Must be >= 2.
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// kd_split - Bentley's standard splitting routine for kd-trees
|
||||
// Find the dimension of the greatest spread, and split
|
||||
// just before the median point along this dimension.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void kd_split(
|
||||
ANNpointArray pa, // point array (permuted on return)
|
||||
ANNidxArray pidx, // point indices
|
||||
const ANNorthRect &bnds, // bounding rectangle for cell
|
||||
int n, // number of points
|
||||
int dim, // dimension of space
|
||||
int &cut_dim, // cutting dimension (returned)
|
||||
ANNcoord &cut_val, // cutting value (returned)
|
||||
int &n_lo) // num of points on low side (returned)
|
||||
{
|
||||
// find dimension of maximum spread
|
||||
cut_dim = annMaxSpread(pa, pidx, n, dim);
|
||||
n_lo = n/2; // median rank
|
||||
// split about median
|
||||
annMedianSplit(pa, pidx, n, cut_dim, cut_val, n_lo);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// midpt_split - midpoint splitting rule for box-decomposition trees
|
||||
//
|
||||
// This is the simplest splitting rule that guarantees boxes
|
||||
// of bounded aspect ratio. It simply cuts the box with the
|
||||
// longest side through its midpoint. If there are ties, it
|
||||
// selects the dimension with the maximum point spread.
|
||||
//
|
||||
// WARNING: This routine (while simple) doesn't seem to work
|
||||
// well in practice in high dimensions, because it tends to
|
||||
// generate a large number of trivial and/or unbalanced splits.
|
||||
// Either kd_split(), sl_midpt_split(), or fair_split() are
|
||||
// recommended, instead.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void midpt_split(
|
||||
ANNpointArray pa, // point array
|
||||
ANNidxArray pidx, // point indices (permuted on return)
|
||||
const ANNorthRect &bnds, // bounding rectangle for cell
|
||||
int n, // number of points
|
||||
int dim, // dimension of space
|
||||
int &cut_dim, // cutting dimension (returned)
|
||||
ANNcoord &cut_val, // cutting value (returned)
|
||||
int &n_lo) // num of points on low side (returned)
|
||||
{
|
||||
int d;
|
||||
|
||||
ANNcoord max_length = bnds.hi[0] - bnds.lo[0];
|
||||
for (d = 1; d < dim; d++) { // find length of longest box side
|
||||
ANNcoord length = bnds.hi[d] - bnds.lo[d];
|
||||
if (length > max_length) {
|
||||
max_length = length;
|
||||
}
|
||||
}
|
||||
ANNcoord max_spread = -1; // find long side with most spread
|
||||
for (d = 0; d < dim; d++) {
|
||||
// is it among longest?
|
||||
if (double(bnds.hi[d] - bnds.lo[d]) >= (1-ERR)*max_length) {
|
||||
// compute its spread
|
||||
ANNcoord spr = annSpread(pa, pidx, n, d);
|
||||
if (spr > max_spread) { // is it max so far?
|
||||
max_spread = spr;
|
||||
cut_dim = d;
|
||||
}
|
||||
}
|
||||
}
|
||||
// split along cut_dim at midpoint
|
||||
cut_val = (bnds.lo[cut_dim] + bnds.hi[cut_dim]) / 2;
|
||||
// permute points accordingly
|
||||
int br1, br2;
|
||||
annPlaneSplit(pa, pidx, n, cut_dim, cut_val, br1, br2);
|
||||
//------------------------------------------------------------------
|
||||
// On return: pa[0..br1-1] < cut_val
|
||||
// pa[br1..br2-1] == cut_val
|
||||
// pa[br2..n-1] > cut_val
|
||||
//
|
||||
// We can set n_lo to any value in the range [br1..br2].
|
||||
// We choose split so that points are most evenly divided.
|
||||
//------------------------------------------------------------------
|
||||
if (br1 > n/2) n_lo = br1;
|
||||
else if (br2 < n/2) n_lo = br2;
|
||||
else n_lo = n/2;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// sl_midpt_split - sliding midpoint splitting rule
|
||||
//
|
||||
// This is a modification of midpt_split, which has the nonsensical
|
||||
// name "sliding midpoint". The idea is that we try to use the
|
||||
// midpoint rule, by bisecting the longest side. If there are
|
||||
// ties, the dimension with the maximum spread is selected. If,
|
||||
// however, the midpoint split produces a trivial split (no points
|
||||
// on one side of the splitting plane) then we slide the splitting
|
||||
// (maintaining its orientation) until it produces a nontrivial
|
||||
// split. For example, if the splitting plane is along the x-axis,
|
||||
// and all the data points have x-coordinate less than the x-bisector,
|
||||
// then the split is taken along the maximum x-coordinate of the
|
||||
// data points.
|
||||
//
|
||||
// Intuitively, this rule cannot generate trivial splits, and
|
||||
// hence avoids midpt_split's tendency to produce trees with
|
||||
// a very large number of nodes.
|
||||
//
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void sl_midpt_split(
|
||||
ANNpointArray pa, // point array
|
||||
ANNidxArray pidx, // point indices (permuted on return)
|
||||
const ANNorthRect &bnds, // bounding rectangle for cell
|
||||
int n, // number of points
|
||||
int dim, // dimension of space
|
||||
int &cut_dim, // cutting dimension (returned)
|
||||
ANNcoord &cut_val, // cutting value (returned)
|
||||
int &n_lo) // num of points on low side (returned)
|
||||
{
|
||||
int d;
|
||||
|
||||
ANNcoord max_length = bnds.hi[0] - bnds.lo[0];
|
||||
for (d = 1; d < dim; d++) { // find length of longest box side
|
||||
ANNcoord length = bnds.hi[d] - bnds.lo[d];
|
||||
if (length > max_length) {
|
||||
max_length = length;
|
||||
}
|
||||
}
|
||||
ANNcoord max_spread = -1; // find long side with most spread
|
||||
for (d = 0; d < dim; d++) {
|
||||
// is it among longest?
|
||||
if ((bnds.hi[d] - bnds.lo[d]) >= (1-ERR)*max_length) {
|
||||
// compute its spread
|
||||
ANNcoord spr = annSpread(pa, pidx, n, d);
|
||||
if (spr > max_spread) { // is it max so far?
|
||||
max_spread = spr;
|
||||
cut_dim = d;
|
||||
}
|
||||
}
|
||||
}
|
||||
// ideal split at midpoint
|
||||
ANNcoord ideal_cut_val = (bnds.lo[cut_dim] + bnds.hi[cut_dim])/2;
|
||||
|
||||
ANNcoord min, max;
|
||||
annMinMax(pa, pidx, n, cut_dim, min, max); // find min/max coordinates
|
||||
|
||||
if (ideal_cut_val < min) // slide to min or max as needed
|
||||
cut_val = min;
|
||||
else if (ideal_cut_val > max)
|
||||
cut_val = max;
|
||||
else
|
||||
cut_val = ideal_cut_val;
|
||||
|
||||
// permute points accordingly
|
||||
int br1, br2;
|
||||
annPlaneSplit(pa, pidx, n, cut_dim, cut_val, br1, br2);
|
||||
//------------------------------------------------------------------
|
||||
// On return: pa[0..br1-1] < cut_val
|
||||
// pa[br1..br2-1] == cut_val
|
||||
// pa[br2..n-1] > cut_val
|
||||
//
|
||||
// We can set n_lo to any value in the range [br1..br2] to satisfy
|
||||
// the exit conditions of the procedure.
|
||||
//
|
||||
// if ideal_cut_val < min (implying br2 >= 1),
|
||||
// then we select n_lo = 1 (so there is one point on left) and
|
||||
// if ideal_cut_val > max (implying br1 <= n-1),
|
||||
// then we select n_lo = n-1 (so there is one point on right).
|
||||
// Otherwise, we select n_lo as close to n/2 as possible within
|
||||
// [br1..br2].
|
||||
//------------------------------------------------------------------
|
||||
if (ideal_cut_val < min) n_lo = 1;
|
||||
else if (ideal_cut_val > max) n_lo = n-1;
|
||||
else if (br1 > n/2) n_lo = br1;
|
||||
else if (br2 < n/2) n_lo = br2;
|
||||
else n_lo = n/2;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// fair_split - fair-split splitting rule
|
||||
//
|
||||
// This is a compromise between the kd-tree splitting rule (which
|
||||
// always splits data points at their median) and the midpoint
|
||||
// splitting rule (which always splits a box through its center.
|
||||
// The goal of this procedure is to achieve both nicely balanced
|
||||
// splits, and boxes of bounded aspect ratio.
|
||||
//
|
||||
// A constant FS_ASPECT_RATIO is defined. Given a box, those sides
|
||||
// which can be split so that the ratio of the longest to shortest
|
||||
// side does not exceed ASPECT_RATIO are identified. Among these
|
||||
// sides, we select the one in which the points have the largest
|
||||
// spread. We then split the points in a manner which most evenly
|
||||
// distributes the points on either side of the splitting plane,
|
||||
// subject to maintaining the bound on the ratio of long to short
|
||||
// sides. To determine that the aspect ratio will be preserved,
|
||||
// we determine the longest side (other than this side), and
|
||||
// determine how narrowly we can cut this side, without causing the
|
||||
// aspect ratio bound to be exceeded (small_piece).
|
||||
//
|
||||
// This procedure is more robust than either kd_split or midpt_split,
|
||||
// but is more complicated as well. When point distribution is
|
||||
// extremely skewed, this degenerates to midpt_split (actually
|
||||
// 1/3 point split), and when the points are most evenly distributed,
|
||||
// this degenerates to kd-split.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void fair_split(
|
||||
ANNpointArray pa, // point array
|
||||
ANNidxArray pidx, // point indices (permuted on return)
|
||||
const ANNorthRect &bnds, // bounding rectangle for cell
|
||||
int n, // number of points
|
||||
int dim, // dimension of space
|
||||
int &cut_dim, // cutting dimension (returned)
|
||||
ANNcoord &cut_val, // cutting value (returned)
|
||||
int &n_lo) // num of points on low side (returned)
|
||||
{
|
||||
int d;
|
||||
ANNcoord max_length = bnds.hi[0] - bnds.lo[0];
|
||||
cut_dim = 0;
|
||||
for (d = 1; d < dim; d++) { // find length of longest box side
|
||||
ANNcoord length = bnds.hi[d] - bnds.lo[d];
|
||||
if (length > max_length) {
|
||||
max_length = length;
|
||||
cut_dim = d;
|
||||
}
|
||||
}
|
||||
|
||||
ANNcoord max_spread = 0; // find legal cut with max spread
|
||||
cut_dim = 0;
|
||||
for (d = 0; d < dim; d++) {
|
||||
ANNcoord length = bnds.hi[d] - bnds.lo[d];
|
||||
// is this side midpoint splitable
|
||||
// without violating aspect ratio?
|
||||
if (((double) max_length)*2.0/((double) length) <= FS_ASPECT_RATIO) {
|
||||
// compute spread along this dim
|
||||
ANNcoord spr = annSpread(pa, pidx, n, d);
|
||||
if (spr > max_spread) { // best spread so far
|
||||
max_spread = spr;
|
||||
cut_dim = d; // this is dimension to cut
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
max_length = 0; // find longest side other than cut_dim
|
||||
for (d = 0; d < dim; d++) {
|
||||
ANNcoord length = bnds.hi[d] - bnds.lo[d];
|
||||
if (d != cut_dim && length > max_length)
|
||||
max_length = length;
|
||||
}
|
||||
// consider most extreme splits
|
||||
ANNcoord small_piece = max_length / FS_ASPECT_RATIO;
|
||||
ANNcoord lo_cut = bnds.lo[cut_dim] + small_piece;// lowest legal cut
|
||||
ANNcoord hi_cut = bnds.hi[cut_dim] - small_piece;// highest legal cut
|
||||
|
||||
int br1, br2;
|
||||
// is median below lo_cut ?
|
||||
if (annSplitBalance(pa, pidx, n, cut_dim, lo_cut) >= 0) {
|
||||
cut_val = lo_cut; // cut at lo_cut
|
||||
annPlaneSplit(pa, pidx, n, cut_dim, cut_val, br1, br2);
|
||||
n_lo = br1;
|
||||
}
|
||||
// is median above hi_cut?
|
||||
else if (annSplitBalance(pa, pidx, n, cut_dim, hi_cut) <= 0) {
|
||||
cut_val = hi_cut; // cut at hi_cut
|
||||
annPlaneSplit(pa, pidx, n, cut_dim, cut_val, br1, br2);
|
||||
n_lo = br2;
|
||||
}
|
||||
else { // median cut preserves asp ratio
|
||||
n_lo = n/2; // split about median
|
||||
annMedianSplit(pa, pidx, n, cut_dim, cut_val, n_lo);
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// sl_fair_split - sliding fair split splitting rule
|
||||
//
|
||||
// Sliding fair split is a splitting rule that combines the
|
||||
// strengths of both fair split with sliding midpoint split.
|
||||
// Fair split tends to produce balanced splits when the points
|
||||
// are roughly uniformly distributed, but it can produce many
|
||||
// trivial splits when points are highly clustered. Sliding
|
||||
// midpoint never produces trivial splits, and shrinks boxes
|
||||
// nicely if points are highly clustered, but it may produce
|
||||
// rather unbalanced splits when points are unclustered but not
|
||||
// quite uniform.
|
||||
//
|
||||
// Sliding fair split is based on the theory that there are two
|
||||
// types of splits that are "good": balanced splits that produce
|
||||
// fat boxes, and unbalanced splits provided the cell with fewer
|
||||
// points is fat.
|
||||
//
|
||||
// This splitting rule operates by first computing the longest
|
||||
// side of the current bounding box. Then it asks which sides
|
||||
// could be split (at the midpoint) and still satisfy the aspect
|
||||
// ratio bound with respect to this side. Among these, it selects
|
||||
// the side with the largest spread (as fair split would). It
|
||||
// then considers the most extreme cuts that would be allowed by
|
||||
// the aspect ratio bound. This is done by dividing the longest
|
||||
// side of the box by the aspect ratio bound. If the median cut
|
||||
// lies between these extreme cuts, then we use the median cut.
|
||||
// If not, then consider the extreme cut that is closer to the
|
||||
// median. If all the points lie to one side of this cut, then
|
||||
// we slide the cut until it hits the first point. This may
|
||||
// violate the aspect ratio bound, but will never generate empty
|
||||
// cells. However the sibling of every such skinny cell is fat,
|
||||
// and hence packing arguments still apply.
|
||||
//
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void sl_fair_split(
|
||||
ANNpointArray pa, // point array
|
||||
ANNidxArray pidx, // point indices (permuted on return)
|
||||
const ANNorthRect &bnds, // bounding rectangle for cell
|
||||
int n, // number of points
|
||||
int dim, // dimension of space
|
||||
int &cut_dim, // cutting dimension (returned)
|
||||
ANNcoord &cut_val, // cutting value (returned)
|
||||
int &n_lo) // num of points on low side (returned)
|
||||
{
|
||||
int d;
|
||||
ANNcoord min, max; // min/max coordinates
|
||||
int br1, br2; // split break points
|
||||
|
||||
ANNcoord max_length = bnds.hi[0] - bnds.lo[0];
|
||||
cut_dim = 0;
|
||||
for (d = 1; d < dim; d++) { // find length of longest box side
|
||||
ANNcoord length = bnds.hi[d] - bnds.lo[d];
|
||||
if (length > max_length) {
|
||||
max_length = length;
|
||||
cut_dim = d;
|
||||
}
|
||||
}
|
||||
|
||||
ANNcoord max_spread = 0; // find legal cut with max spread
|
||||
cut_dim = 0;
|
||||
for (d = 0; d < dim; d++) {
|
||||
ANNcoord length = bnds.hi[d] - bnds.lo[d];
|
||||
// is this side midpoint splitable
|
||||
// without violating aspect ratio?
|
||||
if (((double) max_length)*2.0/((double) length) <= FS_ASPECT_RATIO) {
|
||||
// compute spread along this dim
|
||||
ANNcoord spr = annSpread(pa, pidx, n, d);
|
||||
if (spr > max_spread) { // best spread so far
|
||||
max_spread = spr;
|
||||
cut_dim = d; // this is dimension to cut
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
max_length = 0; // find longest side other than cut_dim
|
||||
for (d = 0; d < dim; d++) {
|
||||
ANNcoord length = bnds.hi[d] - bnds.lo[d];
|
||||
if (d != cut_dim && length > max_length)
|
||||
max_length = length;
|
||||
}
|
||||
// consider most extreme splits
|
||||
ANNcoord small_piece = max_length / FS_ASPECT_RATIO;
|
||||
ANNcoord lo_cut = bnds.lo[cut_dim] + small_piece;// lowest legal cut
|
||||
ANNcoord hi_cut = bnds.hi[cut_dim] - small_piece;// highest legal cut
|
||||
// find min and max along cut_dim
|
||||
annMinMax(pa, pidx, n, cut_dim, min, max);
|
||||
// is median below lo_cut?
|
||||
if (annSplitBalance(pa, pidx, n, cut_dim, lo_cut) >= 0) {
|
||||
if (max > lo_cut) { // are any points above lo_cut?
|
||||
cut_val = lo_cut; // cut at lo_cut
|
||||
annPlaneSplit(pa, pidx, n, cut_dim, cut_val, br1, br2);
|
||||
n_lo = br1; // balance if there are ties
|
||||
}
|
||||
else { // all points below lo_cut
|
||||
cut_val = max; // cut at max value
|
||||
annPlaneSplit(pa, pidx, n, cut_dim, cut_val, br1, br2);
|
||||
n_lo = n-1;
|
||||
}
|
||||
}
|
||||
// is median above hi_cut?
|
||||
else if (annSplitBalance(pa, pidx, n, cut_dim, hi_cut) <= 0) {
|
||||
if (min < hi_cut) { // are any points below hi_cut?
|
||||
cut_val = hi_cut; // cut at hi_cut
|
||||
annPlaneSplit(pa, pidx, n, cut_dim, cut_val, br1, br2);
|
||||
n_lo = br2; // balance if there are ties
|
||||
}
|
||||
else { // all points above hi_cut
|
||||
cut_val = min; // cut at min value
|
||||
annPlaneSplit(pa, pidx, n, cut_dim, cut_val, br1, br2);
|
||||
n_lo = 1;
|
||||
}
|
||||
}
|
||||
else { // median cut is good enough
|
||||
n_lo = n/2; // split about median
|
||||
annMedianSplit(pa, pidx, n, cut_dim, cut_val, n_lo);
|
||||
}
|
||||
}
|
||||
Vendored
-85
@@ -1,85 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: kd_split.h
|
||||
// Programmer: Sunil Arya and David Mount
|
||||
// Description: Methods for splitting kd-trees
|
||||
// Last modified: 01/04/05 (Version 1.0)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#ifndef ANN_KD_SPLIT_H
|
||||
#define ANN_KD_SPLIT_H
|
||||
|
||||
#include "kd_tree.h" // kd-tree definitions
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// External entry points
|
||||
// These are all splitting procedures for kd-trees.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void kd_split( // standard (optimized) kd-splitter
|
||||
ANNpointArray pa, // point array (unaltered)
|
||||
ANNidxArray pidx, // point indices (permuted on return)
|
||||
const ANNorthRect &bnds, // bounding rectangle for cell
|
||||
int n, // number of points
|
||||
int dim, // dimension of space
|
||||
int &cut_dim, // cutting dimension (returned)
|
||||
ANNcoord &cut_val, // cutting value (returned)
|
||||
int &n_lo); // num of points on low side (returned)
|
||||
|
||||
void midpt_split( // midpoint kd-splitter
|
||||
ANNpointArray pa, // point array (unaltered)
|
||||
ANNidxArray pidx, // point indices (permuted on return)
|
||||
const ANNorthRect &bnds, // bounding rectangle for cell
|
||||
int n, // number of points
|
||||
int dim, // dimension of space
|
||||
int &cut_dim, // cutting dimension (returned)
|
||||
ANNcoord &cut_val, // cutting value (returned)
|
||||
int &n_lo); // num of points on low side (returned)
|
||||
|
||||
void sl_midpt_split( // sliding midpoint kd-splitter
|
||||
ANNpointArray pa, // point array (unaltered)
|
||||
ANNidxArray pidx, // point indices (permuted on return)
|
||||
const ANNorthRect &bnds, // bounding rectangle for cell
|
||||
int n, // number of points
|
||||
int dim, // dimension of space
|
||||
int &cut_dim, // cutting dimension (returned)
|
||||
ANNcoord &cut_val, // cutting value (returned)
|
||||
int &n_lo); // num of points on low side (returned)
|
||||
|
||||
void fair_split( // fair-split kd-splitter
|
||||
ANNpointArray pa, // point array (unaltered)
|
||||
ANNidxArray pidx, // point indices (permuted on return)
|
||||
const ANNorthRect &bnds, // bounding rectangle for cell
|
||||
int n, // number of points
|
||||
int dim, // dimension of space
|
||||
int &cut_dim, // cutting dimension (returned)
|
||||
ANNcoord &cut_val, // cutting value (returned)
|
||||
int &n_lo); // num of points on low side (returned)
|
||||
|
||||
void sl_fair_split( // sliding fair-split kd-splitter
|
||||
ANNpointArray pa, // point array (unaltered)
|
||||
ANNidxArray pidx, // point indices (permuted on return)
|
||||
const ANNorthRect &bnds, // bounding rectangle for cell
|
||||
int n, // number of points
|
||||
int dim, // dimension of space
|
||||
int &cut_dim, // cutting dimension (returned)
|
||||
ANNcoord &cut_val, // cutting value (returned)
|
||||
int &n_lo); // num of points on low side (returned)
|
||||
|
||||
#endif
|
||||
Vendored
-405
@@ -1,405 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: kd_tree.cpp
|
||||
// Programmer: Sunil Arya and David Mount
|
||||
// Description: Basic methods for kd-trees.
|
||||
// Last modified: 01/04/05 (Version 1.0)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
// Revision 1.0 04/01/05
|
||||
// Increased aspect ratio bound (ANN_AR_TOOBIG) from 100 to 1000.
|
||||
// Fixed leaf counts to count trivial leaves.
|
||||
// Added optional pa, pi arguments to Skeleton kd_tree constructor
|
||||
// for use in load constructor.
|
||||
// Added annClose() to eliminate KD_TRIVIAL memory leak.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#include "kd_tree.h" // kd-tree declarations
|
||||
#include "kd_split.h" // kd-tree splitting rules
|
||||
#include "kd_util.h" // kd-tree utilities
|
||||
#include <ANN/ANNperf.h> // performance evaluation
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Global data
|
||||
//
|
||||
// For some splitting rules, especially with small bucket sizes,
|
||||
// it is possible to generate a large number of empty leaf nodes.
|
||||
// To save storage we allocate a single trivial leaf node which
|
||||
// contains no points. For messy coding reasons it is convenient
|
||||
// to have it reference a trivial point index.
|
||||
//
|
||||
// KD_TRIVIAL is allocated when the first kd-tree is created. It
|
||||
// must *never* deallocated (since it may be shared by more than
|
||||
// one tree).
|
||||
//----------------------------------------------------------------------
|
||||
static int IDX_TRIVIAL[] = {0}; // trivial point index
|
||||
ANNkd_leaf *KD_TRIVIAL = NULL; // trivial leaf node
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Printing the kd-tree
|
||||
// These routines print a kd-tree in reverse inorder (high then
|
||||
// root then low). (This is so that if you look at the output
|
||||
// from the right side it appear from left to right in standard
|
||||
// inorder.) When outputting leaves we output only the point
|
||||
// indices rather than the point coordinates. There is an option
|
||||
// to print the point coordinates separately.
|
||||
//
|
||||
// The tree printing routine calls the printing routines on the
|
||||
// individual nodes of the tree, passing in the level or depth
|
||||
// in the tree. The level in the tree is used to print indentation
|
||||
// for readability.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void ANNkd_split::print( // print splitting node
|
||||
int level, // depth of node in tree
|
||||
ostream &out) // output stream
|
||||
{
|
||||
child[ANN_HI]->print(level+1, out); // print high child
|
||||
out << " ";
|
||||
for (int i = 0; i < level; i++) // print indentation
|
||||
out << "..";
|
||||
out << "Split cd=" << cut_dim << " cv=" << cut_val;
|
||||
out << " lbnd=" << cd_bnds[ANN_LO];
|
||||
out << " hbnd=" << cd_bnds[ANN_HI];
|
||||
out << "\n";
|
||||
child[ANN_LO]->print(level+1, out); // print low child
|
||||
}
|
||||
|
||||
void ANNkd_leaf::print( // print leaf node
|
||||
int level, // depth of node in tree
|
||||
ostream &out) // output stream
|
||||
{
|
||||
|
||||
out << " ";
|
||||
for (int i = 0; i < level; i++) // print indentation
|
||||
out << "..";
|
||||
|
||||
if (this == KD_TRIVIAL) { // canonical trivial leaf node
|
||||
out << "Leaf (trivial)\n";
|
||||
}
|
||||
else{
|
||||
out << "Leaf n=" << n_pts << " <";
|
||||
for (int j = 0; j < n_pts; j++) {
|
||||
out << bkt[j];
|
||||
if (j < n_pts-1) out << ",";
|
||||
}
|
||||
out << ">\n";
|
||||
}
|
||||
}
|
||||
|
||||
void ANNkd_tree::Print( // print entire tree
|
||||
ANNbool with_pts, // print points as well?
|
||||
ostream &out) // output stream
|
||||
{
|
||||
out << "ANN Version " << ANNversion << "\n";
|
||||
if (with_pts) { // print point coordinates
|
||||
out << " Points:\n";
|
||||
for (int i = 0; i < n_pts; i++) {
|
||||
out << "\t" << i << ": ";
|
||||
annPrintPt(pts[i], dim, out);
|
||||
out << "\n";
|
||||
}
|
||||
}
|
||||
if (root == NULL) // empty tree?
|
||||
out << " Null tree.\n";
|
||||
else {
|
||||
root->print(0, out); // invoke printing at root
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// kd_tree statistics (for performance evaluation)
|
||||
// This routine compute various statistics information for
|
||||
// a kd-tree. It is used by the implementors for performance
|
||||
// evaluation of the data structure.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
void ANNkdStats::merge(const ANNkdStats &st) // merge stats from child
|
||||
{
|
||||
n_lf += st.n_lf; n_tl += st.n_tl;
|
||||
n_spl += st.n_spl; n_shr += st.n_shr;
|
||||
depth = MAX(depth, st.depth);
|
||||
sum_ar += st.sum_ar;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Update statistics for nodes
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
const double ANN_AR_TOOBIG = 1000; // too big an aspect ratio
|
||||
|
||||
void ANNkd_leaf::getStats( // get subtree statistics
|
||||
int dim, // dimension of space
|
||||
ANNkdStats &st, // stats (modified)
|
||||
ANNorthRect &bnd_box) // bounding box
|
||||
{
|
||||
st.reset();
|
||||
st.n_lf = 1; // count this leaf
|
||||
if (this == KD_TRIVIAL) st.n_tl = 1; // count trivial leaf
|
||||
double ar = annAspectRatio(dim, bnd_box); // aspect ratio of leaf
|
||||
// incr sum (ignore outliers)
|
||||
st.sum_ar += float(ar < ANN_AR_TOOBIG ? ar : ANN_AR_TOOBIG);
|
||||
}
|
||||
|
||||
void ANNkd_split::getStats( // get subtree statistics
|
||||
int dim, // dimension of space
|
||||
ANNkdStats &st, // stats (modified)
|
||||
ANNorthRect &bnd_box) // bounding box
|
||||
{
|
||||
ANNkdStats ch_stats; // stats for children
|
||||
// get stats for low child
|
||||
ANNcoord hv = bnd_box.hi[cut_dim]; // save box bounds
|
||||
bnd_box.hi[cut_dim] = cut_val; // upper bound for low child
|
||||
ch_stats.reset(); // reset
|
||||
child[ANN_LO]->getStats(dim, ch_stats, bnd_box);
|
||||
st.merge(ch_stats); // merge them
|
||||
bnd_box.hi[cut_dim] = hv; // restore bound
|
||||
// get stats for high child
|
||||
ANNcoord lv = bnd_box.lo[cut_dim]; // save box bounds
|
||||
bnd_box.lo[cut_dim] = cut_val; // lower bound for high child
|
||||
ch_stats.reset(); // reset
|
||||
child[ANN_HI]->getStats(dim, ch_stats, bnd_box);
|
||||
st.merge(ch_stats); // merge them
|
||||
bnd_box.lo[cut_dim] = lv; // restore bound
|
||||
|
||||
st.depth++; // increment depth
|
||||
st.n_spl++; // increment number of splits
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// getStats
|
||||
// Collects a number of statistics related to kd_tree or
|
||||
// bd_tree.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void ANNkd_tree::getStats( // get tree statistics
|
||||
ANNkdStats &st) // stats (modified)
|
||||
{
|
||||
st.reset(dim, n_pts, bkt_size); // reset stats
|
||||
// create bounding box
|
||||
ANNorthRect bnd_box(dim, bnd_box_lo, bnd_box_hi);
|
||||
if (root != NULL) { // if nonempty tree
|
||||
root->getStats(dim, st, bnd_box); // get statistics
|
||||
st.avg_ar = st.sum_ar / st.n_lf; // average leaf asp ratio
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// kd_tree destructor
|
||||
// The destructor just frees the various elements that were
|
||||
// allocated in the construction process.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
ANNkd_tree::~ANNkd_tree() // tree destructor
|
||||
{
|
||||
if (root != NULL) delete root;
|
||||
if (pidx != NULL) delete [] pidx;
|
||||
if (bnd_box_lo != NULL) annDeallocPt(bnd_box_lo);
|
||||
if (bnd_box_hi != NULL) annDeallocPt(bnd_box_hi);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// This is called with all use of ANN is finished. It eliminates the
|
||||
// minor memory leak caused by the allocation of KD_TRIVIAL.
|
||||
//----------------------------------------------------------------------
|
||||
void annClose() // close use of ANN
|
||||
{
|
||||
if (KD_TRIVIAL != NULL) {
|
||||
delete KD_TRIVIAL;
|
||||
KD_TRIVIAL = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// kd_tree constructors
|
||||
// There is a skeleton kd-tree constructor which sets up a
|
||||
// trivial empty tree. The last optional argument allows
|
||||
// the routine to be passed a point index array which is
|
||||
// assumed to be of the proper size (n). Otherwise, one is
|
||||
// allocated and initialized to the identity. Warning: In
|
||||
// either case the destructor will deallocate this array.
|
||||
//
|
||||
// As a kludge, we need to allocate KD_TRIVIAL if one has not
|
||||
// already been allocated. (This is because I'm too dumb to
|
||||
// figure out how to cause a pointer to be allocated at load
|
||||
// time.)
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void ANNkd_tree::SkeletonTree( // construct skeleton tree
|
||||
int n, // number of points
|
||||
int dd, // dimension
|
||||
int bs, // bucket size
|
||||
ANNpointArray pa, // point array
|
||||
ANNidxArray pi) // point indices
|
||||
{
|
||||
dim = dd; // initialize basic elements
|
||||
n_pts = n;
|
||||
bkt_size = bs;
|
||||
pts = pa; // initialize points array
|
||||
|
||||
root = NULL; // no associated tree yet
|
||||
|
||||
if (pi == NULL) { // point indices provided?
|
||||
pidx = new ANNidx[n]; // no, allocate space for point indices
|
||||
for (int i = 0; i < n; i++) {
|
||||
pidx[i] = i; // initially identity
|
||||
}
|
||||
}
|
||||
else {
|
||||
pidx = pi; // yes, use them
|
||||
}
|
||||
|
||||
bnd_box_lo = bnd_box_hi = NULL; // bounding box is nonexistent
|
||||
if (KD_TRIVIAL == NULL) // no trivial leaf node yet?
|
||||
KD_TRIVIAL = new ANNkd_leaf(0, IDX_TRIVIAL); // allocate it
|
||||
}
|
||||
|
||||
ANNkd_tree::ANNkd_tree( // basic constructor
|
||||
int n, // number of points
|
||||
int dd, // dimension
|
||||
int bs) // bucket size
|
||||
{ SkeletonTree(n, dd, bs); } // construct skeleton tree
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// rkd_tree - recursive procedure to build a kd-tree
|
||||
//
|
||||
// Builds a kd-tree for points in pa as indexed through the
|
||||
// array pidx[0..n-1] (typically a subarray of the array used in
|
||||
// the top-level call). This routine permutes the array pidx,
|
||||
// but does not alter pa[].
|
||||
//
|
||||
// The construction is based on a standard algorithm for constructing
|
||||
// the kd-tree (see Friedman, Bentley, and Finkel, ``An algorithm for
|
||||
// finding best matches in logarithmic expected time,'' ACM Transactions
|
||||
// on Mathematical Software, 3(3):209-226, 1977). The procedure
|
||||
// operates by a simple divide-and-conquer strategy, which determines
|
||||
// an appropriate orthogonal cutting plane (see below), and splits
|
||||
// the points. When the number of points falls below the bucket size,
|
||||
// we simply store the points in a leaf node's bucket.
|
||||
//
|
||||
// One of the arguments is a pointer to a splitting routine,
|
||||
// whose prototype is:
|
||||
//
|
||||
// void split(
|
||||
// ANNpointArray pa, // complete point array
|
||||
// ANNidxArray pidx, // point array (permuted on return)
|
||||
// ANNorthRect &bnds, // bounds of current cell
|
||||
// int n, // number of points
|
||||
// int dim, // dimension of space
|
||||
// int &cut_dim, // cutting dimension
|
||||
// ANNcoord &cut_val, // cutting value
|
||||
// int &n_lo) // no. of points on low side of cut
|
||||
//
|
||||
// This procedure selects a cutting dimension and cutting value,
|
||||
// partitions pa about these values, and returns the number of
|
||||
// points on the low side of the cut.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
ANNkd_ptr rkd_tree( // recursive construction of kd-tree
|
||||
ANNpointArray pa, // point array
|
||||
ANNidxArray pidx, // point indices to store in subtree
|
||||
int n, // number of points
|
||||
int dim, // dimension of space
|
||||
int bsp, // bucket space
|
||||
ANNorthRect &bnd_box, // bounding box for current node
|
||||
ANNkd_splitter splitter) // splitting routine
|
||||
{
|
||||
if (n <= bsp) { // n small, make a leaf node
|
||||
if (n == 0) // empty leaf node
|
||||
return KD_TRIVIAL; // return (canonical) empty leaf
|
||||
else // construct the node and return
|
||||
return new ANNkd_leaf(n, pidx);
|
||||
}
|
||||
else { // n large, make a splitting node
|
||||
int cd; // cutting dimension
|
||||
ANNcoord cv; // cutting value
|
||||
int n_lo; // number on low side of cut
|
||||
ANNkd_node *lo, *hi; // low and high children
|
||||
|
||||
// invoke splitting procedure
|
||||
(*splitter)(pa, pidx, bnd_box, n, dim, cd, cv, n_lo);
|
||||
|
||||
ANNcoord lv = bnd_box.lo[cd]; // save bounds for cutting dimension
|
||||
ANNcoord hv = bnd_box.hi[cd];
|
||||
|
||||
bnd_box.hi[cd] = cv; // modify bounds for left subtree
|
||||
lo = rkd_tree( // build left subtree
|
||||
pa, pidx, n_lo, // ...from pidx[0..n_lo-1]
|
||||
dim, bsp, bnd_box, splitter);
|
||||
bnd_box.hi[cd] = hv; // restore bounds
|
||||
|
||||
bnd_box.lo[cd] = cv; // modify bounds for right subtree
|
||||
hi = rkd_tree( // build right subtree
|
||||
pa, pidx + n_lo, n-n_lo,// ...from pidx[n_lo..n-1]
|
||||
dim, bsp, bnd_box, splitter);
|
||||
bnd_box.lo[cd] = lv; // restore bounds
|
||||
|
||||
// create the splitting node
|
||||
ANNkd_split *ptr = new ANNkd_split(cd, cv, lv, hv, lo, hi);
|
||||
|
||||
return ptr; // return pointer to this node
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// kd-tree constructor
|
||||
// This is the main constructor for kd-trees given a set of points.
|
||||
// It first builds a skeleton tree, then computes the bounding box
|
||||
// of the data points, and then invokes rkd_tree() to actually
|
||||
// build the tree, passing it the appropriate splitting routine.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
ANNkd_tree::ANNkd_tree( // construct from point array
|
||||
ANNpointArray pa, // point array (with at least n pts)
|
||||
int n, // number of points
|
||||
int dd, // dimension
|
||||
int bs, // bucket size
|
||||
ANNsplitRule split) // splitting method
|
||||
{
|
||||
SkeletonTree(n, dd, bs); // set up the basic stuff
|
||||
pts = pa; // where the points are
|
||||
if (n == 0) return; // no points--no sweat
|
||||
|
||||
ANNorthRect bnd_box(dd); // bounding box for points
|
||||
annEnclRect(pa, pidx, n, dd, bnd_box);// construct bounding rectangle
|
||||
// copy to tree structure
|
||||
bnd_box_lo = annCopyPt(dd, bnd_box.lo);
|
||||
bnd_box_hi = annCopyPt(dd, bnd_box.hi);
|
||||
|
||||
switch (split) { // build by rule
|
||||
case ANN_KD_STD: // standard kd-splitting rule
|
||||
root = rkd_tree(pa, pidx, n, dd, bs, bnd_box, kd_split);
|
||||
break;
|
||||
case ANN_KD_MIDPT: // midpoint split
|
||||
root = rkd_tree(pa, pidx, n, dd, bs, bnd_box, midpt_split);
|
||||
break;
|
||||
case ANN_KD_FAIR: // fair split
|
||||
root = rkd_tree(pa, pidx, n, dd, bs, bnd_box, fair_split);
|
||||
break;
|
||||
case ANN_KD_SUGGEST: // best (in our opinion)
|
||||
case ANN_KD_SL_MIDPT: // sliding midpoint split
|
||||
root = rkd_tree(pa, pidx, n, dd, bs, bnd_box, sl_midpt_split);
|
||||
break;
|
||||
case ANN_KD_SL_FAIR: // sliding fair split
|
||||
root = rkd_tree(pa, pidx, n, dd, bs, bnd_box, sl_fair_split);
|
||||
break;
|
||||
default:
|
||||
annError("Illegal splitting method", ANNabort);
|
||||
}
|
||||
}
|
||||
Vendored
-197
@@ -1,197 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: kd_tree.h
|
||||
// Programmer: Sunil Arya and David Mount
|
||||
// Description: Declarations for standard kd-tree routines
|
||||
// Last modified: 05/03/05 (Version 1.1)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
// Revision 1.1 05/03/05
|
||||
// Added fixed radius kNN search
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#ifndef ANN_kd_tree_H
|
||||
#define ANN_kd_tree_H
|
||||
|
||||
#include <ANN/ANNx.h> // all ANN includes
|
||||
|
||||
using namespace std; // make std:: available
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Generic kd-tree node
|
||||
//
|
||||
// Nodes in kd-trees are of two types, splitting nodes which contain
|
||||
// splitting information (a splitting hyperplane orthogonal to one
|
||||
// of the coordinate axes) and leaf nodes which contain point
|
||||
// information (an array of points stored in a bucket). This is
|
||||
// handled by making a generic class kd_node, which is essentially an
|
||||
// empty shell, and then deriving the leaf and splitting nodes from
|
||||
// this.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
class ANNkd_node{ // generic kd-tree node (empty shell)
|
||||
public:
|
||||
virtual ~ANNkd_node() {} // virtual distroyer
|
||||
|
||||
virtual void ann_search(ANNdist) = 0; // tree search
|
||||
virtual void ann_pri_search(ANNdist) = 0; // priority search
|
||||
virtual void ann_FR_search(ANNdist) = 0; // fixed-radius search
|
||||
|
||||
virtual void getStats( // get tree statistics
|
||||
int dim, // dimension of space
|
||||
ANNkdStats &st, // statistics
|
||||
ANNorthRect &bnd_box) = 0; // bounding box
|
||||
// print node
|
||||
virtual void print(int level, ostream &out) = 0;
|
||||
virtual void dump(ostream &out) = 0; // dump node
|
||||
|
||||
friend class ANNkd_tree; // allow kd-tree to access us
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// kd-splitting function:
|
||||
// kd_splitter is a pointer to a splitting routine for preprocessing.
|
||||
// Different splitting procedures result in different strategies
|
||||
// for building the tree.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
typedef void (*ANNkd_splitter)( // splitting routine for kd-trees
|
||||
ANNpointArray pa, // point array (unaltered)
|
||||
ANNidxArray pidx, // point indices (permuted on return)
|
||||
const ANNorthRect &bnds, // bounding rectangle for cell
|
||||
int n, // number of points
|
||||
int dim, // dimension of space
|
||||
int &cut_dim, // cutting dimension (returned)
|
||||
ANNcoord &cut_val, // cutting value (returned)
|
||||
int &n_lo); // num of points on low side (returned)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Leaf kd-tree node
|
||||
// Leaf nodes of the kd-tree store the set of points associated
|
||||
// with this bucket, stored as an array of point indices. These
|
||||
// are indices in the array points, which resides with the
|
||||
// root of the kd-tree. We also store the number of points
|
||||
// that reside in this bucket.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
class ANNkd_leaf: public ANNkd_node // leaf node for kd-tree
|
||||
{
|
||||
int n_pts; // no. points in bucket
|
||||
ANNidxArray bkt; // bucket of points
|
||||
public:
|
||||
ANNkd_leaf( // constructor
|
||||
int n, // number of points
|
||||
ANNidxArray b) // bucket
|
||||
{
|
||||
n_pts = n; // number of points in bucket
|
||||
bkt = b; // the bucket
|
||||
}
|
||||
|
||||
~ANNkd_leaf() { } // destructor (none)
|
||||
|
||||
virtual void getStats( // get tree statistics
|
||||
int dim, // dimension of space
|
||||
ANNkdStats &st, // statistics
|
||||
ANNorthRect &bnd_box); // bounding box
|
||||
virtual void print(int level, ostream &out);// print node
|
||||
virtual void dump(ostream &out); // dump node
|
||||
|
||||
virtual void ann_search(ANNdist); // standard search
|
||||
virtual void ann_pri_search(ANNdist); // priority search
|
||||
virtual void ann_FR_search(ANNdist); // fixed-radius search
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// KD_TRIVIAL is a special pointer to an empty leaf node. Since
|
||||
// some splitting rules generate many (more than 50%) trivial
|
||||
// leaves, we use this one shared node to save space.
|
||||
//
|
||||
// The pointer is initialized to NULL, but whenever a kd-tree is
|
||||
// created, we allocate this node, if it has not already been
|
||||
// allocated. This node is *never* deallocated, so it produces
|
||||
// a small memory leak.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
extern ANNkd_leaf *KD_TRIVIAL; // trivial (empty) leaf node
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// kd-tree splitting node.
|
||||
// Splitting nodes contain a cutting dimension and a cutting value.
|
||||
// These indicate the axis-parellel plane which subdivide the
|
||||
// box for this node. The extent of the bounding box along the
|
||||
// cutting dimension is maintained (this is used to speed up point
|
||||
// to box distance calculations) [we do not store the entire bounding
|
||||
// box since this may be wasteful of space in high dimensions].
|
||||
// We also store pointers to the 2 children.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
class ANNkd_split : public ANNkd_node // splitting node of a kd-tree
|
||||
{
|
||||
int cut_dim; // dim orthogonal to cutting plane
|
||||
ANNcoord cut_val; // location of cutting plane
|
||||
ANNcoord cd_bnds[2]; // lower and upper bounds of
|
||||
// rectangle along cut_dim
|
||||
ANNkd_ptr child[2]; // left and right children
|
||||
public:
|
||||
ANNkd_split( // constructor
|
||||
int cd, // cutting dimension
|
||||
ANNcoord cv, // cutting value
|
||||
ANNcoord lv, ANNcoord hv, // low and high values
|
||||
ANNkd_ptr lc=NULL, ANNkd_ptr hc=NULL) // children
|
||||
{
|
||||
cut_dim = cd; // cutting dimension
|
||||
cut_val = cv; // cutting value
|
||||
cd_bnds[ANN_LO] = lv; // lower bound for rectangle
|
||||
cd_bnds[ANN_HI] = hv; // upper bound for rectangle
|
||||
child[ANN_LO] = lc; // left child
|
||||
child[ANN_HI] = hc; // right child
|
||||
}
|
||||
|
||||
~ANNkd_split() // destructor
|
||||
{
|
||||
if (child[ANN_LO]!= NULL && child[ANN_LO]!= KD_TRIVIAL)
|
||||
delete child[ANN_LO];
|
||||
if (child[ANN_HI]!= NULL && child[ANN_HI]!= KD_TRIVIAL)
|
||||
delete child[ANN_HI];
|
||||
}
|
||||
|
||||
virtual void getStats( // get tree statistics
|
||||
int dim, // dimension of space
|
||||
ANNkdStats &st, // statistics
|
||||
ANNorthRect &bnd_box); // bounding box
|
||||
virtual void print(int level, ostream &out);// print node
|
||||
virtual void dump(ostream &out); // dump node
|
||||
|
||||
virtual void ann_search(ANNdist); // standard search
|
||||
virtual void ann_pri_search(ANNdist); // priority search
|
||||
virtual void ann_FR_search(ANNdist); // fixed-radius search
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// External entry points
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
ANNkd_ptr rkd_tree( // recursive construction of kd-tree
|
||||
ANNpointArray pa, // point array (unaltered)
|
||||
ANNidxArray pidx, // point indices to store in subtree
|
||||
int n, // number of points
|
||||
int dim, // dimension of space
|
||||
int bsp, // bucket space
|
||||
ANNorthRect &bnd_box, // bounding box for current node
|
||||
ANNkd_splitter splitter); // splitting routine
|
||||
|
||||
#endif
|
||||
Vendored
-439
@@ -1,439 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: kd_util.cpp
|
||||
// Programmer: Sunil Arya and David Mount
|
||||
// Description: Common utilities for kd-trees
|
||||
// Last modified: 01/04/05 (Version 1.0)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#include "kd_util.h" // kd-utility declarations
|
||||
|
||||
#include <ANN/ANNperf.h> // performance evaluation
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// The following routines are utility functions for manipulating
|
||||
// points sets, used in determining splitting planes for kd-tree
|
||||
// construction.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// NOTE: Virtually all point indexing is done through an index (i.e.
|
||||
// permutation) array pidx. Consequently, a reference to the d-th
|
||||
// coordinate of the i-th point is pa[pidx[i]][d]. The macro PA(i,d)
|
||||
// is a shorthand for this.
|
||||
//----------------------------------------------------------------------
|
||||
// standard 2-d indirect indexing
|
||||
#define PA(i,d) (pa[pidx[(i)]][(d)])
|
||||
// accessing a single point
|
||||
#define PP(i) (pa[pidx[(i)]])
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annAspectRatio
|
||||
// Compute the aspect ratio (ratio of longest to shortest side)
|
||||
// of a rectangle.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
double annAspectRatio(
|
||||
int dim, // dimension
|
||||
const ANNorthRect &bnd_box) // bounding cube
|
||||
{
|
||||
ANNcoord length = bnd_box.hi[0] - bnd_box.lo[0];
|
||||
ANNcoord min_length = length; // min side length
|
||||
ANNcoord max_length = length; // max side length
|
||||
for (int d = 0; d < dim; d++) {
|
||||
length = bnd_box.hi[d] - bnd_box.lo[d];
|
||||
if (length < min_length) min_length = length;
|
||||
if (length > max_length) max_length = length;
|
||||
}
|
||||
return max_length/min_length;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annEnclRect, annEnclCube
|
||||
// These utilities compute the smallest rectangle and cube enclosing
|
||||
// a set of points, respectively.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void annEnclRect(
|
||||
ANNpointArray pa, // point array
|
||||
ANNidxArray pidx, // point indices
|
||||
int n, // number of points
|
||||
int dim, // dimension
|
||||
ANNorthRect &bnds) // bounding cube (returned)
|
||||
{
|
||||
for (int d = 0; d < dim; d++) { // find smallest enclosing rectangle
|
||||
ANNcoord lo_bnd = PA(0,d); // lower bound on dimension d
|
||||
ANNcoord hi_bnd = PA(0,d); // upper bound on dimension d
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (PA(i,d) < lo_bnd) lo_bnd = PA(i,d);
|
||||
else if (PA(i,d) > hi_bnd) hi_bnd = PA(i,d);
|
||||
}
|
||||
bnds.lo[d] = lo_bnd;
|
||||
bnds.hi[d] = hi_bnd;
|
||||
}
|
||||
}
|
||||
|
||||
void annEnclCube( // compute smallest enclosing cube
|
||||
ANNpointArray pa, // point array
|
||||
ANNidxArray pidx, // point indices
|
||||
int n, // number of points
|
||||
int dim, // dimension
|
||||
ANNorthRect &bnds) // bounding cube (returned)
|
||||
{
|
||||
int d;
|
||||
// compute smallest enclosing rect
|
||||
annEnclRect(pa, pidx, n, dim, bnds);
|
||||
|
||||
ANNcoord max_len = 0; // max length of any side
|
||||
for (d = 0; d < dim; d++) { // determine max side length
|
||||
ANNcoord len = bnds.hi[d] - bnds.lo[d];
|
||||
if (len > max_len) { // update max_len if longest
|
||||
max_len = len;
|
||||
}
|
||||
}
|
||||
for (d = 0; d < dim; d++) { // grow sides to match max
|
||||
ANNcoord len = bnds.hi[d] - bnds.lo[d];
|
||||
ANNcoord half_diff = (max_len - len) / 2;
|
||||
bnds.lo[d] -= half_diff;
|
||||
bnds.hi[d] += half_diff;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annBoxDistance - utility routine which computes distance from point to
|
||||
// box (Note: most distances to boxes are computed using incremental
|
||||
// distance updates, not this function.)
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
ANNdist annBoxDistance( // compute distance from point to box
|
||||
const ANNpoint q, // the point
|
||||
const ANNpoint lo, // low point of box
|
||||
const ANNpoint hi, // high point of box
|
||||
int dim) // dimension of space
|
||||
{
|
||||
register ANNdist dist = 0.0; // sum of squared distances
|
||||
register ANNdist t;
|
||||
|
||||
for (register int d = 0; d < dim; d++) {
|
||||
if (q[d] < lo[d]) { // q is left of box
|
||||
t = ANNdist(lo[d]) - ANNdist(q[d]);
|
||||
dist = ANN_SUM(dist, ANN_POW(t));
|
||||
}
|
||||
else if (q[d] > hi[d]) { // q is right of box
|
||||
t = ANNdist(q[d]) - ANNdist(hi[d]);
|
||||
dist = ANN_SUM(dist, ANN_POW(t));
|
||||
}
|
||||
}
|
||||
ANN_FLOP(4*dim) // increment floating op count
|
||||
|
||||
return dist;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annSpread - find spread along given dimension
|
||||
// annMinMax - find min and max coordinates along given dimension
|
||||
// annMaxSpread - find dimension of max spread
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
ANNcoord annSpread( // compute point spread along dimension
|
||||
ANNpointArray pa, // point array
|
||||
ANNidxArray pidx, // point indices
|
||||
int n, // number of points
|
||||
int d) // dimension to check
|
||||
{
|
||||
ANNcoord min = PA(0,d); // compute max and min coords
|
||||
ANNcoord max = PA(0,d);
|
||||
for (int i = 1; i < n; i++) {
|
||||
ANNcoord c = PA(i,d);
|
||||
if (c < min) min = c;
|
||||
else if (c > max) max = c;
|
||||
}
|
||||
return (max - min); // total spread is difference
|
||||
}
|
||||
|
||||
void annMinMax( // compute min and max coordinates along dim
|
||||
ANNpointArray pa, // point array
|
||||
ANNidxArray pidx, // point indices
|
||||
int n, // number of points
|
||||
int d, // dimension to check
|
||||
ANNcoord &min, // minimum value (returned)
|
||||
ANNcoord &max) // maximum value (returned)
|
||||
{
|
||||
min = PA(0,d); // compute max and min coords
|
||||
max = PA(0,d);
|
||||
for (int i = 1; i < n; i++) {
|
||||
ANNcoord c = PA(i,d);
|
||||
if (c < min) min = c;
|
||||
else if (c > max) max = c;
|
||||
}
|
||||
}
|
||||
|
||||
int annMaxSpread( // compute dimension of max spread
|
||||
ANNpointArray pa, // point array
|
||||
ANNidxArray pidx, // point indices
|
||||
int n, // number of points
|
||||
int dim) // dimension of space
|
||||
{
|
||||
int max_dim = 0; // dimension of max spread
|
||||
ANNcoord max_spr = 0; // amount of max spread
|
||||
|
||||
if (n == 0) return max_dim; // no points, who cares?
|
||||
|
||||
for (int d = 0; d < dim; d++) { // compute spread along each dim
|
||||
ANNcoord spr = annSpread(pa, pidx, n, d);
|
||||
if (spr > max_spr) { // bigger than current max
|
||||
max_spr = spr;
|
||||
max_dim = d;
|
||||
}
|
||||
}
|
||||
return max_dim;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annMedianSplit - split point array about its median
|
||||
// Splits a subarray of points pa[0..n] about an element of given
|
||||
// rank (median: n_lo = n/2) with respect to dimension d. It places
|
||||
// the element of rank n_lo-1 correctly (because our splitting rule
|
||||
// takes the mean of these two). On exit, the array is permuted so
|
||||
// that:
|
||||
//
|
||||
// pa[0..n_lo-2][d] <= pa[n_lo-1][d] <= pa[n_lo][d] <= pa[n_lo+1..n-1][d].
|
||||
//
|
||||
// The mean of pa[n_lo-1][d] and pa[n_lo][d] is returned as the
|
||||
// splitting value.
|
||||
//
|
||||
// All indexing is done indirectly through the index array pidx.
|
||||
//
|
||||
// This function uses the well known selection algorithm due to
|
||||
// C.A.R. Hoare.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
// swap two points in pa array
|
||||
#define PASWAP(a,b) { int tmp = pidx[a]; pidx[a] = pidx[b]; pidx[b] = tmp; }
|
||||
|
||||
void annMedianSplit(
|
||||
ANNpointArray pa, // points to split
|
||||
ANNidxArray pidx, // point indices
|
||||
int n, // number of points
|
||||
int d, // dimension along which to split
|
||||
ANNcoord &cv, // cutting value
|
||||
int n_lo) // split into n_lo and n-n_lo
|
||||
{
|
||||
int l = 0; // left end of current subarray
|
||||
int r = n-1; // right end of current subarray
|
||||
while (l < r) {
|
||||
register int i = (r+l)/2; // select middle as pivot
|
||||
register int k;
|
||||
|
||||
if (PA(i,d) > PA(r,d)) // make sure last > pivot
|
||||
PASWAP(i,r)
|
||||
PASWAP(l,i); // move pivot to first position
|
||||
|
||||
ANNcoord c = PA(l,d); // pivot value
|
||||
i = l;
|
||||
k = r;
|
||||
for(;;) { // pivot about c
|
||||
while (PA(++i,d) < c) ;
|
||||
while (PA(--k,d) > c) ;
|
||||
if (i < k) PASWAP(i,k) else break;
|
||||
}
|
||||
PASWAP(l,k); // pivot winds up in location k
|
||||
|
||||
if (k > n_lo) r = k-1; // recurse on proper subarray
|
||||
else if (k < n_lo) l = k+1;
|
||||
else break; // got the median exactly
|
||||
}
|
||||
if (n_lo > 0) { // search for next smaller item
|
||||
ANNcoord c = PA(0,d); // candidate for max
|
||||
int k = 0; // candidate's index
|
||||
for (int i = 1; i < n_lo; i++) {
|
||||
if (PA(i,d) > c) {
|
||||
c = PA(i,d);
|
||||
k = i;
|
||||
}
|
||||
}
|
||||
PASWAP(n_lo-1, k); // max among pa[0..n_lo-1] to pa[n_lo-1]
|
||||
}
|
||||
// cut value is midpoint value
|
||||
cv = (PA(n_lo-1,d) + PA(n_lo,d))/2.0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annPlaneSplit - split point array about a cutting plane
|
||||
// Split the points in an array about a given plane along a
|
||||
// given cutting dimension. On exit, br1 and br2 are set so
|
||||
// that:
|
||||
//
|
||||
// pa[ 0 ..br1-1] < cv
|
||||
// pa[br1..br2-1] == cv
|
||||
// pa[br2.. n -1] > cv
|
||||
//
|
||||
// All indexing is done indirectly through the index array pidx.
|
||||
//
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void annPlaneSplit( // split points by a plane
|
||||
ANNpointArray pa, // points to split
|
||||
ANNidxArray pidx, // point indices
|
||||
int n, // number of points
|
||||
int d, // dimension along which to split
|
||||
ANNcoord cv, // cutting value
|
||||
int &br1, // first break (values < cv)
|
||||
int &br2) // second break (values == cv)
|
||||
{
|
||||
int l = 0;
|
||||
int r = n-1;
|
||||
for(;;) { // partition pa[0..n-1] about cv
|
||||
while (l < n && PA(l,d) < cv) l++;
|
||||
while (r >= 0 && PA(r,d) >= cv) r--;
|
||||
if (l > r) break;
|
||||
PASWAP(l,r);
|
||||
l++; r--;
|
||||
}
|
||||
br1 = l; // now: pa[0..br1-1] < cv <= pa[br1..n-1]
|
||||
r = n-1;
|
||||
for(;;) { // partition pa[br1..n-1] about cv
|
||||
while (l < n && PA(l,d) <= cv) l++;
|
||||
while (r >= br1 && PA(r,d) > cv) r--;
|
||||
if (l > r) break;
|
||||
PASWAP(l,r);
|
||||
l++; r--;
|
||||
}
|
||||
br2 = l; // now: pa[br1..br2-1] == cv < pa[br2..n-1]
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annBoxSplit - split point array about a orthogonal rectangle
|
||||
// Split the points in an array about a given orthogonal
|
||||
// rectangle. On exit, n_in is set to the number of points
|
||||
// that are inside (or on the boundary of) the rectangle.
|
||||
//
|
||||
// All indexing is done indirectly through the index array pidx.
|
||||
//
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void annBoxSplit( // split points by a box
|
||||
ANNpointArray pa, // points to split
|
||||
ANNidxArray pidx, // point indices
|
||||
int n, // number of points
|
||||
int dim, // dimension of space
|
||||
ANNorthRect &box, // the box
|
||||
int &n_in) // number of points inside (returned)
|
||||
{
|
||||
int l = 0;
|
||||
int r = n-1;
|
||||
for(;;) { // partition pa[0..n-1] about box
|
||||
while (l < n && box.inside(dim, PP(l))) l++;
|
||||
while (r >= 0 && !box.inside(dim, PP(r))) r--;
|
||||
if (l > r) break;
|
||||
PASWAP(l,r);
|
||||
l++; r--;
|
||||
}
|
||||
n_in = l; // now: pa[0..n_in-1] inside and rest outside
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annSplitBalance - compute balance factor for a given plane split
|
||||
// Balance factor is defined as the number of points lying
|
||||
// below the splitting value minus n/2 (median). Thus, a
|
||||
// median split has balance 0, left of this is negative and
|
||||
// right of this is positive. (The points are unchanged.)
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
int annSplitBalance( // determine balance factor of a split
|
||||
ANNpointArray pa, // points to split
|
||||
ANNidxArray pidx, // point indices
|
||||
int n, // number of points
|
||||
int d, // dimension along which to split
|
||||
ANNcoord cv) // cutting value
|
||||
{
|
||||
int n_lo = 0;
|
||||
for(int i = 0; i < n; i++) { // count number less than cv
|
||||
if (PA(i,d) < cv) n_lo++;
|
||||
}
|
||||
return n_lo - n/2;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annBox2Bnds - convert bounding box to list of bounds
|
||||
// Given two boxes, an inner box enclosed within a bounding
|
||||
// box, this routine determines all the sides for which the
|
||||
// inner box is strictly contained with the bounding box,
|
||||
// and adds an appropriate entry to a list of bounds. Then
|
||||
// we allocate storage for the final list of bounds, and return
|
||||
// the resulting list and its size.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void annBox2Bnds( // convert inner box to bounds
|
||||
const ANNorthRect &inner_box, // inner box
|
||||
const ANNorthRect &bnd_box, // enclosing box
|
||||
int dim, // dimension of space
|
||||
int &n_bnds, // number of bounds (returned)
|
||||
ANNorthHSArray &bnds) // bounds array (returned)
|
||||
{
|
||||
int i;
|
||||
n_bnds = 0; // count number of bounds
|
||||
for (i = 0; i < dim; i++) {
|
||||
if (inner_box.lo[i] > bnd_box.lo[i]) // low bound is inside
|
||||
n_bnds++;
|
||||
if (inner_box.hi[i] < bnd_box.hi[i]) // high bound is inside
|
||||
n_bnds++;
|
||||
}
|
||||
|
||||
bnds = new ANNorthHalfSpace[n_bnds]; // allocate appropriate size
|
||||
|
||||
int j = 0;
|
||||
for (i = 0; i < dim; i++) { // fill the array
|
||||
if (inner_box.lo[i] > bnd_box.lo[i]) {
|
||||
bnds[j].cd = i;
|
||||
bnds[j].cv = inner_box.lo[i];
|
||||
bnds[j].sd = +1;
|
||||
j++;
|
||||
}
|
||||
if (inner_box.hi[i] < bnd_box.hi[i]) {
|
||||
bnds[j].cd = i;
|
||||
bnds[j].cv = inner_box.hi[i];
|
||||
bnds[j].sd = -1;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annBnds2Box - convert list of bounds to bounding box
|
||||
// Given an enclosing box and a list of bounds, this routine
|
||||
// computes the corresponding inner box. It is assumed that
|
||||
// the box points have been allocated already.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void annBnds2Box(
|
||||
const ANNorthRect &bnd_box, // enclosing box
|
||||
int dim, // dimension of space
|
||||
int n_bnds, // number of bounds
|
||||
ANNorthHSArray bnds, // bounds array
|
||||
ANNorthRect &inner_box) // inner box (returned)
|
||||
{
|
||||
annAssignRect(dim, inner_box, bnd_box); // copy bounding box to inner
|
||||
|
||||
for (int i = 0; i < n_bnds; i++) {
|
||||
bnds[i].project(inner_box.lo); // project each endpoint
|
||||
bnds[i].project(inner_box.hi);
|
||||
}
|
||||
}
|
||||
Vendored
-124
@@ -1,124 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: kd_util.h
|
||||
// Programmer: Sunil Arya and David Mount
|
||||
// Description: Common utilities for kd- trees
|
||||
// Last modified: 01/04/05 (Version 1.0)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#ifndef ANN_kd_util_H
|
||||
#define ANN_kd_util_H
|
||||
|
||||
#include "kd_tree.h" // kd-tree declarations
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// externally accessible functions
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
double annAspectRatio( // compute aspect ratio of box
|
||||
int dim, // dimension
|
||||
const ANNorthRect &bnd_box); // bounding cube
|
||||
|
||||
void annEnclRect( // compute smallest enclosing rectangle
|
||||
ANNpointArray pa, // point array
|
||||
ANNidxArray pidx, // point indices
|
||||
int n, // number of points
|
||||
int dim, // dimension
|
||||
ANNorthRect &bnds); // bounding cube (returned)
|
||||
|
||||
void annEnclCube( // compute smallest enclosing cube
|
||||
ANNpointArray pa, // point array
|
||||
ANNidxArray pidx, // point indices
|
||||
int n, // number of points
|
||||
int dim, // dimension
|
||||
ANNorthRect &bnds); // bounding cube (returned)
|
||||
|
||||
ANNdist annBoxDistance( // compute distance from point to box
|
||||
const ANNpoint q, // the point
|
||||
const ANNpoint lo, // low point of box
|
||||
const ANNpoint hi, // high point of box
|
||||
int dim); // dimension of space
|
||||
|
||||
ANNcoord annSpread( // compute point spread along dimension
|
||||
ANNpointArray pa, // point array
|
||||
ANNidxArray pidx, // point indices
|
||||
int n, // number of points
|
||||
int d); // dimension to check
|
||||
|
||||
void annMinMax( // compute min and max coordinates along dim
|
||||
ANNpointArray pa, // point array
|
||||
ANNidxArray pidx, // point indices
|
||||
int n, // number of points
|
||||
int d, // dimension to check
|
||||
ANNcoord& min, // minimum value (returned)
|
||||
ANNcoord& max); // maximum value (returned)
|
||||
|
||||
int annMaxSpread( // compute dimension of max spread
|
||||
ANNpointArray pa, // point array
|
||||
ANNidxArray pidx, // point indices
|
||||
int n, // number of points
|
||||
int dim); // dimension of space
|
||||
|
||||
void annMedianSplit( // split points along median value
|
||||
ANNpointArray pa, // points to split
|
||||
ANNidxArray pidx, // point indices
|
||||
int n, // number of points
|
||||
int d, // dimension along which to split
|
||||
ANNcoord &cv, // cutting value
|
||||
int n_lo); // split into n_lo and n-n_lo
|
||||
|
||||
void annPlaneSplit( // split points by a plane
|
||||
ANNpointArray pa, // points to split
|
||||
ANNidxArray pidx, // point indices
|
||||
int n, // number of points
|
||||
int d, // dimension along which to split
|
||||
ANNcoord cv, // cutting value
|
||||
int &br1, // first break (values < cv)
|
||||
int &br2); // second break (values == cv)
|
||||
|
||||
void annBoxSplit( // split points by a box
|
||||
ANNpointArray pa, // points to split
|
||||
ANNidxArray pidx, // point indices
|
||||
int n, // number of points
|
||||
int dim, // dimension of space
|
||||
ANNorthRect &box, // the box
|
||||
int &n_in); // number of points inside (returned)
|
||||
|
||||
int annSplitBalance( // determine balance factor of a split
|
||||
ANNpointArray pa, // points to split
|
||||
ANNidxArray pidx, // point indices
|
||||
int n, // number of points
|
||||
int d, // dimension along which to split
|
||||
ANNcoord cv); // cutting value
|
||||
|
||||
void annBox2Bnds( // convert inner box to bounds
|
||||
const ANNorthRect &inner_box, // inner box
|
||||
const ANNorthRect &bnd_box, // enclosing box
|
||||
int dim, // dimension of space
|
||||
int &n_bnds, // number of bounds (returned)
|
||||
ANNorthHSArray &bnds); // bounds array (returned)
|
||||
|
||||
void annBnds2Box( // convert bounds to inner box
|
||||
const ANNorthRect &bnd_box, // enclosing box
|
||||
int dim, // dimension of space
|
||||
int n_bnds, // number of bounds
|
||||
ANNorthHSArray bnds, // bounds array
|
||||
ANNorthRect &inner_box); // inner box (returned)
|
||||
|
||||
#endif
|
||||
Vendored
-134
@@ -1,134 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: perf.cpp
|
||||
// Programmer: Sunil Arya and David Mount
|
||||
// Description: Methods for performance stats
|
||||
// Last modified: 01/04/05 (Version 1.0)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
// Revision 1.0 04/01/05
|
||||
// Changed names to avoid namespace conflicts.
|
||||
// Added flush after printing performance stats to fix bug
|
||||
// in Microsoft Windows version.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#include <ANN/ANN.h> // basic ANN includes
|
||||
#include <ANN/ANNperf.h> // performance includes
|
||||
|
||||
using namespace std; // make std:: available
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Performance statistics
|
||||
// The following data and routines are used for computing
|
||||
// performance statistics for nearest neighbor searching.
|
||||
// Because these routines can slow the code down, they can be
|
||||
// activated and deactiviated by defining the PERF variable,
|
||||
// by compiling with the option: -DPERF
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Global counters for performance measurement
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
int ann_Ndata_pts = 0; // number of data points
|
||||
int ann_Nvisit_lfs = 0; // number of leaf nodes visited
|
||||
int ann_Nvisit_spl = 0; // number of splitting nodes visited
|
||||
int ann_Nvisit_shr = 0; // number of shrinking nodes visited
|
||||
int ann_Nvisit_pts = 0; // visited points for one query
|
||||
int ann_Ncoord_hts = 0; // coordinate hits for one query
|
||||
int ann_Nfloat_ops = 0; // floating ops for one query
|
||||
ANNsampStat ann_visit_lfs; // stats on leaf nodes visits
|
||||
ANNsampStat ann_visit_spl; // stats on splitting nodes visits
|
||||
ANNsampStat ann_visit_shr; // stats on shrinking nodes visits
|
||||
ANNsampStat ann_visit_nds; // stats on total nodes visits
|
||||
ANNsampStat ann_visit_pts; // stats on points visited
|
||||
ANNsampStat ann_coord_hts; // stats on coordinate hits
|
||||
ANNsampStat ann_float_ops; // stats on floating ops
|
||||
//
|
||||
ANNsampStat ann_average_err; // average error
|
||||
ANNsampStat ann_rank_err; // rank error
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Routines for statistics.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
DLL_API void annResetStats(int data_size) // reset stats for a set of queries
|
||||
{
|
||||
ann_Ndata_pts = data_size;
|
||||
ann_visit_lfs.reset();
|
||||
ann_visit_spl.reset();
|
||||
ann_visit_shr.reset();
|
||||
ann_visit_nds.reset();
|
||||
ann_visit_pts.reset();
|
||||
ann_coord_hts.reset();
|
||||
ann_float_ops.reset();
|
||||
ann_average_err.reset();
|
||||
ann_rank_err.reset();
|
||||
}
|
||||
|
||||
DLL_API void annResetCounts() // reset counts for one query
|
||||
{
|
||||
ann_Nvisit_lfs = 0;
|
||||
ann_Nvisit_spl = 0;
|
||||
ann_Nvisit_shr = 0;
|
||||
ann_Nvisit_pts = 0;
|
||||
ann_Ncoord_hts = 0;
|
||||
ann_Nfloat_ops = 0;
|
||||
}
|
||||
|
||||
DLL_API void annUpdateStats() // update stats with current counts
|
||||
{
|
||||
ann_visit_lfs += ann_Nvisit_lfs;
|
||||
ann_visit_nds += ann_Nvisit_spl + ann_Nvisit_lfs;
|
||||
ann_visit_spl += ann_Nvisit_spl;
|
||||
ann_visit_shr += ann_Nvisit_shr;
|
||||
ann_visit_pts += ann_Nvisit_pts;
|
||||
ann_coord_hts += ann_Ncoord_hts;
|
||||
ann_float_ops += ann_Nfloat_ops;
|
||||
}
|
||||
|
||||
// print a single statistic
|
||||
void print_one_stat(char *title, ANNsampStat s, double div)
|
||||
{
|
||||
cout << title << "= [ ";
|
||||
cout.width(9); cout << s.mean()/div << " : ";
|
||||
cout.width(9); cout << s.stdDev()/div << " ]<";
|
||||
cout.width(9); cout << s.min()/div << " , ";
|
||||
cout.width(9); cout << s.max()/div << " >\n";
|
||||
}
|
||||
|
||||
DLL_API void annPrintStats( // print statistics for a run
|
||||
ANNbool validate) // true if average errors desired
|
||||
{
|
||||
cout.precision(4); // set floating precision
|
||||
cout << " (Performance stats: "
|
||||
<< " [ mean : stddev ]< min , max >\n";
|
||||
print_one_stat(" leaf_nodes ", ann_visit_lfs, 1);
|
||||
print_one_stat(" splitting_nodes ", ann_visit_spl, 1);
|
||||
print_one_stat(" shrinking_nodes ", ann_visit_shr, 1);
|
||||
print_one_stat(" total_nodes ", ann_visit_nds, 1);
|
||||
print_one_stat(" points_visited ", ann_visit_pts, 1);
|
||||
print_one_stat(" coord_hits/pt ", ann_coord_hts, ann_Ndata_pts);
|
||||
print_one_stat(" floating_ops_(K) ", ann_float_ops, 1000);
|
||||
if (validate) {
|
||||
print_one_stat(" average_error ", ann_average_err, 1);
|
||||
print_one_stat(" rank_error ", ann_rank_err, 1);
|
||||
}
|
||||
cout.precision(0); // restore the default
|
||||
cout << " )\n";
|
||||
cout.flush();
|
||||
}
|
||||
Vendored
-125
@@ -1,125 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: pr_queue.h
|
||||
// Programmer: Sunil Arya and David Mount
|
||||
// Description: Include file for priority queue and related
|
||||
// structures.
|
||||
// Last modified: 01/04/05 (Version 1.0)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#ifndef PR_QUEUE_H
|
||||
#define PR_QUEUE_H
|
||||
|
||||
#include <ANN/ANNx.h> // all ANN includes
|
||||
#include <ANN/ANNperf.h> // performance evaluation
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Basic types.
|
||||
//----------------------------------------------------------------------
|
||||
typedef void *PQinfo; // info field is generic pointer
|
||||
typedef ANNdist PQkey; // key field is distance
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Priority queue
|
||||
// A priority queue is a list of items, along with associated
|
||||
// priorities. The basic operations are insert and extract_minimum.
|
||||
//
|
||||
// The priority queue is maintained using a standard binary heap.
|
||||
// (Implementation note: Indexing is performed from [1..max] rather
|
||||
// than the C standard of [0..max-1]. This simplifies parent/child
|
||||
// computations.) User information consists of a void pointer,
|
||||
// and the user is responsible for casting this quantity into whatever
|
||||
// useful form is desired.
|
||||
//
|
||||
// Because the priority queue is so central to the efficiency of
|
||||
// query processing, all the code is inline.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
class ANNpr_queue {
|
||||
|
||||
struct pq_node { // node in priority queue
|
||||
PQkey key; // key value
|
||||
PQinfo info; // info field
|
||||
};
|
||||
int n; // number of items in queue
|
||||
int max_size; // maximum queue size
|
||||
pq_node *pq; // the priority queue (array of nodes)
|
||||
|
||||
public:
|
||||
ANNpr_queue(int max) // constructor (given max size)
|
||||
{
|
||||
n = 0; // initially empty
|
||||
max_size = max; // maximum number of items
|
||||
pq = new pq_node[max+1]; // queue is array [1..max] of nodes
|
||||
}
|
||||
|
||||
~ANNpr_queue() // destructor
|
||||
{ delete [] pq; }
|
||||
|
||||
ANNbool empty() // is queue empty?
|
||||
{ if (n==0) return ANNtrue; else return ANNfalse; }
|
||||
|
||||
ANNbool non_empty() // is queue nonempty?
|
||||
{ if (n==0) return ANNfalse; else return ANNtrue; }
|
||||
|
||||
void reset() // make existing queue empty
|
||||
{ n = 0; }
|
||||
|
||||
inline void insert( // insert item (inlined for speed)
|
||||
PQkey kv, // key value
|
||||
PQinfo inf) // item info
|
||||
{
|
||||
if (++n > max_size) annError("Priority queue overflow.", ANNabort);
|
||||
register int r = n;
|
||||
while (r > 1) { // sift up new item
|
||||
register int p = r/2;
|
||||
ANN_FLOP(1) // increment floating ops
|
||||
if (pq[p].key <= kv) // in proper order
|
||||
break;
|
||||
pq[r] = pq[p]; // else swap with parent
|
||||
r = p;
|
||||
}
|
||||
pq[r].key = kv; // insert new item at final location
|
||||
pq[r].info = inf;
|
||||
}
|
||||
|
||||
inline void extr_min( // extract minimum (inlined for speed)
|
||||
PQkey &kv, // key (returned)
|
||||
PQinfo &inf) // item info (returned)
|
||||
{
|
||||
kv = pq[1].key; // key of min item
|
||||
inf = pq[1].info; // information of min item
|
||||
register PQkey kn = pq[n--].key;// last item in queue
|
||||
register int p = 1; // p points to item out of position
|
||||
register int r = p<<1; // left child of p
|
||||
while (r <= n) { // while r is still within the heap
|
||||
ANN_FLOP(2) // increment floating ops
|
||||
// set r to smaller child of p
|
||||
if (r < n && pq[r].key > pq[r+1].key) r++;
|
||||
if (kn <= pq[r].key) // in proper order
|
||||
break;
|
||||
pq[p] = pq[r]; // else swap with child
|
||||
p = r; // advance pointers
|
||||
r = p<<1;
|
||||
}
|
||||
pq[p] = pq[n+1]; // insert last item in proper place
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
Vendored
-118
@@ -1,118 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: pr_queue_k.h
|
||||
// Programmer: Sunil Arya and David Mount
|
||||
// Description: Include file for priority queue with k items.
|
||||
// Last modified: 01/04/05 (Version 1.0)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#ifndef PR_QUEUE_K_H
|
||||
#define PR_QUEUE_K_H
|
||||
|
||||
#include <ANN/ANNx.h> // all ANN includes
|
||||
#include <ANN/ANNperf.h> // performance evaluation
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Basic types
|
||||
//----------------------------------------------------------------------
|
||||
typedef ANNdist PQKkey; // key field is distance
|
||||
typedef int PQKinfo; // info field is int
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Constants
|
||||
// The NULL key value is used to initialize the priority queue, and
|
||||
// so it should be larger than any valid distance, so that it will
|
||||
// be replaced as legal distance values are inserted. The NULL
|
||||
// info value must be a nonvalid array index, we use ANN_NULL_IDX,
|
||||
// which is guaranteed to be negative.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
const PQKkey PQ_NULL_KEY = ANN_DIST_INF; // nonexistent key value
|
||||
const PQKinfo PQ_NULL_INFO = ANN_NULL_IDX; // nonexistent info value
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// ANNmin_k
|
||||
// An ANNmin_k structure is one which maintains the smallest
|
||||
// k values (of type PQKkey) and associated information (of type
|
||||
// PQKinfo). The special info and key values PQ_NULL_INFO and
|
||||
// PQ_NULL_KEY means that thise entry is empty.
|
||||
//
|
||||
// It is currently implemented using an array with k items.
|
||||
// Items are stored in increasing sorted order, and insertions
|
||||
// are made through standard insertion sort. (This is quite
|
||||
// inefficient, but current applications call for small values
|
||||
// of k and relatively few insertions.)
|
||||
//
|
||||
// Note that the list contains k+1 entries, but the last entry
|
||||
// is used as a simple placeholder and is otherwise ignored.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
class ANNmin_k {
|
||||
struct mk_node { // node in min_k structure
|
||||
PQKkey key; // key value
|
||||
PQKinfo info; // info field (user defined)
|
||||
};
|
||||
|
||||
int k; // max number of keys to store
|
||||
int n; // number of keys currently active
|
||||
mk_node *mk; // the list itself
|
||||
|
||||
public:
|
||||
ANNmin_k(int max) // constructor (given max size)
|
||||
{
|
||||
n = 0; // initially no items
|
||||
k = max; // maximum number of items
|
||||
mk = new mk_node[max+1]; // sorted array of keys
|
||||
}
|
||||
|
||||
~ANNmin_k() // destructor
|
||||
{ delete [] mk; }
|
||||
|
||||
PQKkey ANNmin_key() // return minimum key
|
||||
{ return (n > 0 ? mk[0].key : PQ_NULL_KEY); }
|
||||
|
||||
PQKkey max_key() // return maximum key
|
||||
{ return (n == k ? mk[k-1].key : PQ_NULL_KEY); }
|
||||
|
||||
PQKkey ith_smallest_key(int i) // ith smallest key (i in [0..n-1])
|
||||
{ return (i < n ? mk[i].key : PQ_NULL_KEY); }
|
||||
|
||||
PQKinfo ith_smallest_info(int i) // info for ith smallest (i in [0..n-1])
|
||||
{ return (i < n ? mk[i].info : PQ_NULL_INFO); }
|
||||
|
||||
inline void insert( // insert item (inlined for speed)
|
||||
PQKkey kv, // key value
|
||||
PQKinfo inf) // item info
|
||||
{
|
||||
register int i;
|
||||
// slide larger values up
|
||||
for (i = n; i > 0; i--) {
|
||||
if (mk[i-1].key > kv)
|
||||
mk[i] = mk[i-1];
|
||||
else
|
||||
break;
|
||||
}
|
||||
mk[i].key = kv; // store element here
|
||||
mk[i].info = inf;
|
||||
if (n < k) n++; // increment number of items
|
||||
ANN_FLOP(k-i+1) // increment floating ops
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
Vendored
-96
@@ -1,96 +0,0 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
# Makefile for the test and evaluation program
|
||||
#
|
||||
# ANN: Approximate Nearest Neighbors
|
||||
# Version: 1.1.1 08/04/06
|
||||
#-----------------------------------------------------------------------------
|
||||
# Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
# David Mount. All Rights Reserved.
|
||||
#
|
||||
# This software and related documentation is part of the Approximate
|
||||
# Nearest Neighbor Library (ANN). This software is provided under
|
||||
# the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
# file ../ReadMe.txt for further information.
|
||||
#
|
||||
# The University of Maryland (U.M.) and the authors make no
|
||||
# representations about the suitability or fitness of this software for
|
||||
# any purpose. It is provided "as is" without express or implied
|
||||
# warranty.
|
||||
#-----------------------------------------------------------------------------
|
||||
# Revision 0.1 03/04/98
|
||||
# Initial release
|
||||
# Revision 1.1.1 08/04/06
|
||||
# Added copyright/license
|
||||
#-----------------------------------------------------------------------------
|
||||
# Note: For full performance measurements, it is assumed that the library
|
||||
# and this program have both been compiled with the -DANN_PERF flag. See
|
||||
# the Makefile in the ANN base directory for this flag.
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Basic definitions
|
||||
# BASEDIR where include, src, lib, ... are
|
||||
# INCDIR include directory
|
||||
# LIBDIR library directory
|
||||
# BINDIR bin directory
|
||||
# LDFLAGS loader flags
|
||||
# ANNLIBS ANN library
|
||||
# OTHERLIBS other libraries
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
BASEDIR = ..
|
||||
INCDIR = $(BASEDIR)/include
|
||||
LIBDIR = $(BASEDIR)/lib
|
||||
BINDIR = $(BASEDIR)/bin
|
||||
LDFLAGS = -L$(LIBDIR)
|
||||
ANNLIBS = -lANN
|
||||
OTHERLIBS = -lm
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Some more definitions
|
||||
# ANNTEST name of test program
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
ANNTEST = ann_test
|
||||
|
||||
HEADERS = rand.h
|
||||
TESTSOURCES = ann_test.cpp rand.cpp
|
||||
TESTOBJECTS = $(TESTSOURCES:.cpp=.o)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Make the program
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
default:
|
||||
@echo "Specify a target configuration"
|
||||
|
||||
targets: $(BINDIR)/$(ANNTEST)
|
||||
|
||||
$(BINDIR)/$(ANNTEST): $(TESTOBJECTS) $(LIBDIR)/$(ANNLIB)
|
||||
$(C++) $(TESTOBJECTS) -o $(ANNTEST) $(LDFLAGS) $(ANNLIBS) $(OTHERLIBS)
|
||||
mv $(ANNTEST) $(BINDIR)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# configuration definitions
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
include ../Make-config
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Objects
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
ann_test.o: ann_test.cpp
|
||||
$(C++) -c -I$(INCDIR) $(CFLAGS) ann_test.cpp
|
||||
|
||||
rand.o: rand.cpp
|
||||
$(C++) -c -I$(INCDIR) $(CFLAGS) rand.cpp
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Cleaning
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
clean:
|
||||
-rm -f *.o *.out core
|
||||
|
||||
realclean: clean
|
||||
Vendored
-1640
File diff suppressed because it is too large
Load Diff
Vendored
-594
@@ -1,594 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: rand.cpp
|
||||
// Programmer: Sunil Arya and David Mount
|
||||
// Description: Routines for random point generation
|
||||
// Last modified: 08/04/06 (Version 1.1.1)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
// Revision 0.2 03/26/98
|
||||
// Changed random/srandom declarations for SGI's.
|
||||
// Revision 1.0 04/01/05
|
||||
// annClusGauss centers distributed over [-1,1] rather than [0,1]
|
||||
// Added annClusOrthFlats distribution
|
||||
// Changed procedure names to avoid namespace conflicts
|
||||
// Added annClusFlats distribution
|
||||
// Added rand/srand option and fixed annRan0() initialization.
|
||||
// Revision 1.1.1 08/04/06
|
||||
// Added planted distribution
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#include "rand.h" // random generator declarations
|
||||
|
||||
using namespace std; // make std:: accessible
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Globals
|
||||
//----------------------------------------------------------------------
|
||||
int annIdum = 0; // used for random number generation
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// annRan0 - (safer) uniform random number generator
|
||||
//
|
||||
// The code given here is taken from "Numerical Recipes in C" by
|
||||
// William Press, Brian Flannery, Saul Teukolsky, and William
|
||||
// Vetterling. The task of the code is to do an additional randomizing
|
||||
// shuffle on the system-supplied random number generator to make it
|
||||
// safer to use.
|
||||
//
|
||||
// Returns a uniform deviate between 0.0 and 1.0 using the
|
||||
// system-supplied routine random() or rand(). Set the global
|
||||
// annIdum to any negative value to initialise or reinitialise
|
||||
// the sequence.
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
double annRan0()
|
||||
{
|
||||
const int TAB_SIZE = 97; // table size: any large number
|
||||
int j;
|
||||
|
||||
static double y, v[TAB_SIZE];
|
||||
static int iff = 0;
|
||||
const double RAN_DIVISOR = double(ANN_RAND_MAX + 1UL);
|
||||
if (RAN_DIVISOR < 0) {
|
||||
cout << "RAN_DIVISOR " << RAN_DIVISOR << endl;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// As a precaution against misuse, we will always initialize on the
|
||||
// first call, even if "annIdum" is not set negative. Determine
|
||||
// "maxran", the next integer after the largest representable value
|
||||
// of type int. We assume this is a factor of 2 smaller than the
|
||||
// corresponding value of type unsigned int.
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
if (annIdum < 0 || iff == 0) { // initialize
|
||||
iff = 1;
|
||||
ANN_SRAND(annIdum); // (re)seed the generator
|
||||
annIdum = 1;
|
||||
|
||||
for (j = 0; j < TAB_SIZE; j++) // exercise the system routine
|
||||
ANN_RAND(); // (values intentionally ignored)
|
||||
|
||||
for (j = 0; j < TAB_SIZE; j++) // then save TAB_SIZE-1 values
|
||||
v[j] = ANN_RAND();
|
||||
y = ANN_RAND(); // generate starting value
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// This is where we start if not initializing. Use the previously
|
||||
// saved random number y to get an index j between 1 and TAB_SIZE-1.
|
||||
// Then use the corresponding v[j] for both the next j and as the
|
||||
// output number.
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
j = int(TAB_SIZE * (y / RAN_DIVISOR));
|
||||
y = v[j];
|
||||
v[j] = ANN_RAND(); // refill the table entry
|
||||
return y / RAN_DIVISOR;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// annRanInt - generate a random integer from {0,1,...,n-1}
|
||||
//
|
||||
// If n == 0, then -1 is returned.
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
static int annRanInt(
|
||||
int n)
|
||||
{
|
||||
int r = (int) (annRan0()*n);
|
||||
if (r == n) r--; // (in case annRan0() == 1 or n == 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// annRanUnif - generate a random uniform in [lo,hi]
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
static double annRanUnif(
|
||||
double lo,
|
||||
double hi)
|
||||
{
|
||||
return annRan0()*(hi-lo) + lo;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// annRanGauss - Gaussian random number generator
|
||||
// Returns a normally distributed deviate with zero mean and unit
|
||||
// variance, using annRan0() as the source of uniform deviates.
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
static double annRanGauss()
|
||||
{
|
||||
static int iset=0;
|
||||
static double gset;
|
||||
|
||||
if (iset == 0) { // we don't have a deviate handy
|
||||
double v1, v2;
|
||||
double r = 2.0;
|
||||
while (r >= 1.0) {
|
||||
//------------------------------------------------------------
|
||||
// Pick two uniform numbers in the square extending from -1 to
|
||||
// +1 in each direction, see if they are in the circle of radius
|
||||
// 1. If not, try again
|
||||
//------------------------------------------------------------
|
||||
v1 = annRanUnif(-1, 1);
|
||||
v2 = annRanUnif(-1, 1);
|
||||
r = v1 * v1 + v2 * v2;
|
||||
}
|
||||
double fac = sqrt(-2.0 * log(r) / r);
|
||||
//-----------------------------------------------------------------
|
||||
// Now make the Box-Muller transformation to get two normal
|
||||
// deviates. Return one and save the other for next time.
|
||||
//-----------------------------------------------------------------
|
||||
gset = v1 * fac;
|
||||
iset = 1; // set flag
|
||||
return v2 * fac;
|
||||
}
|
||||
else { // we have an extra deviate handy
|
||||
iset = 0; // so unset the flag
|
||||
return gset; // and return it
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// annRanLaplace - Laplacian random number generator
|
||||
// Returns a Laplacian distributed deviate with zero mean and
|
||||
// unit variance, using annRan0() as the source of uniform deviates.
|
||||
//
|
||||
// prob(x) = b/2 * exp(-b * |x|).
|
||||
//
|
||||
// b is chosen to be sqrt(2.0) so that the variance of the Laplacian
|
||||
// distribution [2/(b^2)] becomes 1.
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
static double annRanLaplace()
|
||||
{
|
||||
const double b = 1.4142136;
|
||||
|
||||
double laprand = -log(annRan0()) / b;
|
||||
double sign = annRan0();
|
||||
if (sign < 0.5) laprand = -laprand;
|
||||
return(laprand);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annUniformPts - Generate uniformly distributed points
|
||||
// A uniform distribution over [-1,1].
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void annUniformPts( // uniform distribution
|
||||
ANNpointArray pa, // point array (modified)
|
||||
int n, // number of points
|
||||
int dim) // dimension
|
||||
{
|
||||
for (int i = 0; i < n; i++) {
|
||||
for (int d = 0; d < dim; d++) {
|
||||
pa[i][d] = (ANNcoord) (annRanUnif(-1,1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annGaussPts - Generate Gaussian distributed points
|
||||
// A Gaussian distribution with zero mean and the given standard
|
||||
// deviation.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void annGaussPts( // Gaussian distribution
|
||||
ANNpointArray pa, // point array (modified)
|
||||
int n, // number of points
|
||||
int dim, // dimension
|
||||
double std_dev) // standard deviation
|
||||
{
|
||||
for (int i = 0; i < n; i++) {
|
||||
for (int d = 0; d < dim; d++) {
|
||||
pa[i][d] = (ANNcoord) (annRanGauss() * std_dev);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annLaplacePts - Generate Laplacian distributed points
|
||||
// Generates a Laplacian distribution (zero mean and unit variance).
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void annLaplacePts( // Laplacian distribution
|
||||
ANNpointArray pa, // point array (modified)
|
||||
int n, // number of points
|
||||
int dim) // dimension
|
||||
{
|
||||
for (int i = 0; i < n; i++) {
|
||||
for (int d = 0; d < dim; d++) {
|
||||
pa[i][d] = (ANNcoord) annRanLaplace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annCoGaussPts - Generate correlated Gaussian distributed points
|
||||
// Generates a Gauss-Markov distribution of zero mean and unit
|
||||
// variance.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void annCoGaussPts( // correlated-Gaussian distribution
|
||||
ANNpointArray pa, // point array (modified)
|
||||
int n, // number of points
|
||||
int dim, // dimension
|
||||
double correlation) // correlation
|
||||
{
|
||||
double std_dev_w = sqrt(1.0 - correlation * correlation);
|
||||
for (int i = 0; i < n; i++) {
|
||||
double previous = annRanGauss();
|
||||
pa[i][0] = (ANNcoord) previous;
|
||||
for (int d = 1; d < dim; d++) {
|
||||
previous = correlation*previous + std_dev_w*annRanGauss();
|
||||
pa[i][d] = (ANNcoord) previous;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annCoLaplacePts - Generate correlated Laplacian distributed points
|
||||
// Generates a Laplacian-Markov distribution of zero mean and unit
|
||||
// variance.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void annCoLaplacePts( // correlated-Laplacian distribution
|
||||
ANNpointArray pa, // point array (modified)
|
||||
int n, // number of points
|
||||
int dim, // dimension
|
||||
double correlation) // correlation
|
||||
{
|
||||
double wn;
|
||||
double corr_sq = correlation * correlation;
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
double previous = annRanLaplace();
|
||||
pa[i][0] = (ANNcoord) previous;
|
||||
for (int d = 1; d < dim; d++) {
|
||||
double temp = annRan0();
|
||||
if (temp < corr_sq)
|
||||
wn = 0.0;
|
||||
else
|
||||
wn = annRanLaplace();
|
||||
previous = correlation * previous + wn;
|
||||
pa[i][d] = (ANNcoord) previous;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annClusGaussPts - Generate clusters of Gaussian distributed points
|
||||
// Cluster centers are uniformly distributed over [-1,1], and the
|
||||
// standard deviation within each cluster is fixed.
|
||||
//
|
||||
// Note: Once cluster centers have been set, they are not changed,
|
||||
// unless new_clust = true. This is so that subsequent calls generate
|
||||
// points from the same distribution. It follows, of course, that any
|
||||
// attempt to change the dimension or number of clusters without
|
||||
// generating new clusters is asking for trouble.
|
||||
//
|
||||
// Note: Cluster centers are not generated by a call to uniformPts().
|
||||
// Although this could be done, it has been omitted for
|
||||
// compatibility with annClusGaussPts() in the colored version,
|
||||
// rand_c.cc.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void annClusGaussPts( // clustered-Gaussian distribution
|
||||
ANNpointArray pa, // point array (modified)
|
||||
int n, // number of points
|
||||
int dim, // dimension
|
||||
int n_clus, // number of colors
|
||||
ANNbool new_clust, // generate new clusters.
|
||||
double std_dev) // standard deviation within clusters
|
||||
{
|
||||
static ANNpointArray clusters = NULL;// cluster storage
|
||||
|
||||
if (clusters == NULL || new_clust) {// need new cluster centers
|
||||
if (clusters != NULL) // clusters already exist
|
||||
annDeallocPts(clusters); // get rid of them
|
||||
clusters = annAllocPts(n_clus, dim);
|
||||
// generate cluster center coords
|
||||
for (int i = 0; i < n_clus; i++) {
|
||||
for (int d = 0; d < dim; d++) {
|
||||
clusters[i][d] = (ANNcoord) annRanUnif(-1,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
int c = annRanInt(n_clus); // generate cluster index
|
||||
for (int d = 0; d < dim; d++) {
|
||||
pa[i][d] = (ANNcoord) (std_dev*annRanGauss() + clusters[c][d]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annClusOrthFlats - points clustered along orthogonal flats
|
||||
//
|
||||
// This distribution consists of a collection points clustered
|
||||
// among a collection of axis-aligned low dimensional flats in
|
||||
// the hypercube [-1,1]^d. A set of n_clus orthogonal flats are
|
||||
// generated, each whose dimension is a random number between 1
|
||||
// and max_dim. The points are evenly distributed among the clusters.
|
||||
// For each cluster, we generate points uniformly distributed along
|
||||
// the flat within the hypercube.
|
||||
//
|
||||
// This is done as follows. Each cluster is defined by a d-element
|
||||
// control vector whose components are either:
|
||||
//
|
||||
// CO_FLAG indicating that this component is to be generated
|
||||
// uniformly in [-1,1],
|
||||
// x a value other than CO_FLAG in the range [-1,1],
|
||||
// which indicates that this coordinate is to be
|
||||
// generated as x plus a Gaussian random deviation
|
||||
// with the given standard deviation.
|
||||
//
|
||||
// The number of zero components is the dimension of the flat, which
|
||||
// is a random integer in the range from 1 to max_dim. The points
|
||||
// are disributed between clusters in nearly equal sized groups.
|
||||
//
|
||||
// Note: Once cluster centers have been set, they are not changed,
|
||||
// unless new_clust = true. This is so that subsequent calls generate
|
||||
// points from the same distribution. It follows, of course, that any
|
||||
// attempt to change the dimension or number of clusters without
|
||||
// generating new clusters is asking for trouble.
|
||||
//
|
||||
// To make this a bad scenario at query time, query points should be
|
||||
// selected from a different distribution, e.g. uniform or Gaussian.
|
||||
//
|
||||
// We use a little programming trick to generate groups of roughly
|
||||
// equal size. If n is the total number of points, and n_clus is
|
||||
// the number of clusters, then the c-th cluster (0 <= c < n_clus)
|
||||
// is given floor((n+c)/n_clus) points. It can be shown that this
|
||||
// will exactly consume all n points.
|
||||
//
|
||||
// This procedure makes use of the utility procedure, genOrthFlat
|
||||
// which generates points in one orthogonal flat, according to
|
||||
// the given control vector.
|
||||
//
|
||||
//----------------------------------------------------------------------
|
||||
const double CO_FLAG = 999; // special flag value
|
||||
|
||||
static void genOrthFlat( // generate points on an orthog flat
|
||||
ANNpointArray pa, // point array
|
||||
int n, // number of points
|
||||
int dim, // dimension
|
||||
double *control, // control vector
|
||||
double std_dev) // standard deviation
|
||||
{
|
||||
for (int i = 0; i < n; i++) { // generate each point
|
||||
for (int d = 0; d < dim; d++) { // generate each coord
|
||||
if (control[d] == CO_FLAG) // dimension on flat
|
||||
pa[i][d] = (ANNcoord) annRanUnif(-1,1);
|
||||
else // dimension off flat
|
||||
pa[i][d] = (ANNcoord) (std_dev*annRanGauss() + control[d]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void annClusOrthFlats( // clustered along orthogonal flats
|
||||
ANNpointArray pa, // point array (modified)
|
||||
int n, // number of points
|
||||
int dim, // dimension
|
||||
int n_clus, // number of colors
|
||||
ANNbool new_clust, // generate new clusters.
|
||||
double std_dev, // standard deviation within clusters
|
||||
int max_dim) // maximum dimension of the flats
|
||||
{
|
||||
static ANNpointArray control = NULL; // control vectors
|
||||
|
||||
if (control == NULL || new_clust) { // need new cluster centers
|
||||
if (control != NULL) { // clusters already exist
|
||||
annDeallocPts(control); // get rid of them
|
||||
}
|
||||
control = annAllocPts(n_clus, dim);
|
||||
|
||||
for (int c = 0; c < n_clus; c++) { // generate clusters
|
||||
int n_dim = 1 + annRanInt(max_dim); // number of dimensions in flat
|
||||
for (int d = 0; d < dim; d++) { // generate side locations
|
||||
// prob. of picking next dim
|
||||
double Prob = ((double) n_dim)/((double) (dim-d));
|
||||
if (annRan0() < Prob) { // add this one to flat
|
||||
control[c][d] = CO_FLAG; // flag this entry
|
||||
n_dim--; // one fewer dim to fill
|
||||
}
|
||||
else { // don't take this one
|
||||
control[c][d] = annRanUnif(-1,1);// random value in [-1,1]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
int offset = 0; // offset in pa array
|
||||
for (int c = 0; c < n_clus; c++) { // generate clusters
|
||||
int pick = (n+c)/n_clus; // number of points to pick
|
||||
// generate the points
|
||||
genOrthFlat(pa+offset, pick, dim, control[c], std_dev);
|
||||
offset += pick; // increment offset
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annClusEllipsoids - points clustered around axis-aligned ellipsoids
|
||||
//
|
||||
// This distribution consists of a collection points clustered
|
||||
// among a collection of low dimensional ellipsoids whose axes
|
||||
// are alligned with the coordinate axes in the hypercube [-1,1]^d.
|
||||
// The objective is to model distributions in which the points are
|
||||
// distributed in lower dimensional subspaces, and within this
|
||||
// lower dimensional space the points are distributed with a
|
||||
// Gaussian distribution (with no correlation between the
|
||||
// dimensions).
|
||||
//
|
||||
// The distribution is given the number of clusters or "colors"
|
||||
// (n_clus), maximum number of dimensions (max_dim) of the lower
|
||||
// dimensional subspace, a "small" standard deviation
|
||||
// (std_dev_small), and a "large" standard deviation range
|
||||
// (std_dev_lo, std_dev_hi).
|
||||
//
|
||||
// The algorithm generates n_clus cluster centers uniformly from
|
||||
// the hypercube [-1,1]^d. For each cluster, it selects the
|
||||
// dimension of the subspace as a random number r between 1 and
|
||||
// max_dim. These are the dimensions of the ellipsoid. Then it
|
||||
// generates a d-element std dev vector whose entries are the
|
||||
// standard deviation for the coordinates of each cluster in the
|
||||
// distribution. Among the d-element control vector, r randomly
|
||||
// chosen values are chosen uniformly from the range [std_dev_lo,
|
||||
// std_dev_hi]. The remaining values are set to std_dev_small.
|
||||
//
|
||||
// Note that annClusGaussPts is a special case of this in which
|
||||
// max_dim = 0, and std_dev = std_dev_small.
|
||||
//
|
||||
// If the flag new_clust is set, then new cluster centers are
|
||||
// generated.
|
||||
//
|
||||
// This procedure makes use of the utility procedure genGauss
|
||||
// which generates points distributed according to a Gaussian
|
||||
// distribution.
|
||||
//
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
static void genGauss( // generate points on a general Gaussian
|
||||
ANNpointArray pa, // point array
|
||||
int n, // number of points
|
||||
int dim, // dimension
|
||||
double *center, // center vector
|
||||
double *std_dev) // standard deviation vector
|
||||
{
|
||||
for (int i = 0; i < n; i++) {
|
||||
for (int d = 0; d < dim; d++) {
|
||||
pa[i][d] = (ANNcoord) (std_dev[d]*annRanGauss() + center[d]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void annClusEllipsoids( // clustered around ellipsoids
|
||||
ANNpointArray pa, // point array (modified)
|
||||
int n, // number of points
|
||||
int dim, // dimension
|
||||
int n_clus, // number of colors
|
||||
ANNbool new_clust, // generate new clusters.
|
||||
double std_dev_small, // small standard deviation
|
||||
double std_dev_lo, // low standard deviation for ellipses
|
||||
double std_dev_hi, // high standard deviation for ellipses
|
||||
int max_dim) // maximum dimension of the flats
|
||||
{
|
||||
static ANNpointArray centers = NULL; // cluster centers
|
||||
static ANNpointArray std_dev = NULL; // standard deviations
|
||||
|
||||
if (centers == NULL || new_clust) { // need new cluster centers
|
||||
if (centers != NULL) // clusters already exist
|
||||
annDeallocPts(centers); // get rid of them
|
||||
if (std_dev != NULL) // std deviations already exist
|
||||
annDeallocPts(std_dev); // get rid of them
|
||||
|
||||
centers = annAllocPts(n_clus, dim); // alloc new clusters and devs
|
||||
std_dev = annAllocPts(n_clus, dim);
|
||||
|
||||
for (int i = 0; i < n_clus; i++) { // gen cluster center coords
|
||||
for (int d = 0; d < dim; d++) {
|
||||
centers[i][d] = (ANNcoord) annRanUnif(-1,1);
|
||||
}
|
||||
}
|
||||
for (int c = 0; c < n_clus; c++) { // generate cluster std dev
|
||||
int n_dim = 1 + annRanInt(max_dim); // number of dimensions in flat
|
||||
for (int d = 0; d < dim; d++) { // generate std dev's
|
||||
// prob. of picking next dim
|
||||
double Prob = ((double) n_dim)/((double) (dim-d));
|
||||
if (annRan0() < Prob) { // add this one to ellipse
|
||||
// generate random std dev
|
||||
std_dev[c][d] = annRanUnif(std_dev_lo, std_dev_hi);
|
||||
n_dim--; // one fewer dim to fill
|
||||
}
|
||||
else { // don't take this one
|
||||
std_dev[c][d] = std_dev_small;// use small std dev
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int offset = 0; // next slot to fill
|
||||
for (int c = 0; c < n_clus; c++) { // generate clusters
|
||||
int pick = (n+c)/n_clus; // number of points to pick
|
||||
// generate the points
|
||||
genGauss(pa+offset, pick, dim, centers[c], std_dev[c]);
|
||||
offset += pick; // increment offset in array
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// annPlanted - Generates points from a "planted" distribution
|
||||
// In high dimensional spaces, interpoint distances tend to be
|
||||
// highly clustered around the mean value. Approximate nearest
|
||||
// neighbor searching makes little sense in this context, unless it
|
||||
// is the case that each query point is significantly closer to its
|
||||
// nearest neighbor than to other points. Thus, the query points
|
||||
// should be planted close to the data points. Given a source data
|
||||
// set, this procedure generates a set of query points having this
|
||||
// property.
|
||||
//
|
||||
// We are given a source data array and a standard deviation. We
|
||||
// generate points as follows. We select a random point from the
|
||||
// source data set, and we generate a Gaussian point centered about
|
||||
// this random point and perturbed by a normal distributed random
|
||||
// variable with mean zero and the given standard deviation along
|
||||
// each coordinate.
|
||||
//
|
||||
// Note that this essentially the same a clustered Gaussian
|
||||
// distribution, but where the cluster centers are given by the
|
||||
// source data set.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void annPlanted( // planted nearest neighbors
|
||||
ANNpointArray pa, // point array (modified)
|
||||
int n, // number of points
|
||||
int dim, // dimension
|
||||
ANNpointArray src, // source point array
|
||||
int n_src, // source size
|
||||
double std_dev) // standard deviation about source
|
||||
{
|
||||
for (int i = 0; i < n; i++) {
|
||||
int c = annRanInt(n_src); // generate source index
|
||||
for (int d = 0; d < dim; d++) {
|
||||
pa[i][d] = (ANNcoord) (std_dev*annRanGauss() + src[c][d]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
-131
@@ -1,131 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// File: rand.h
|
||||
// Programmer: Sunil Arya and David Mount
|
||||
// Description: Basic include file for random point generators
|
||||
// Last modified: 08/04/06 (Version 1.1.1)
|
||||
//----------------------------------------------------------------------
|
||||
// Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
|
||||
// David Mount. All Rights Reserved.
|
||||
//
|
||||
// This software and related documentation is part of the Approximate
|
||||
// Nearest Neighbor Library (ANN). This software is provided under
|
||||
// the provisions of the Lesser GNU Public License (LGPL). See the
|
||||
// file ../ReadMe.txt for further information.
|
||||
//
|
||||
// The University of Maryland (U.M.) and the authors make no
|
||||
// representations about the suitability or fitness of this software for
|
||||
// any purpose. It is provided "as is" without express or implied
|
||||
// warranty.
|
||||
//----------------------------------------------------------------------
|
||||
// History:
|
||||
// Revision 0.1 03/04/98
|
||||
// Initial release
|
||||
// Revision 1.0 04/01/05
|
||||
// Added annClusOrthFlats distribution
|
||||
// Changed procedure names to avoid namespace conflicts
|
||||
// Added annClusFlats distribution
|
||||
// Revision 1.1.1 08/04/06
|
||||
// Added planted distribution
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#ifndef rand_H
|
||||
#define rand_H
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Basic includes
|
||||
//----------------------------------------------------------------------
|
||||
#include <cstdlib> // standard includes (rand/random)
|
||||
#include <cmath> // math routines
|
||||
#include <ANN/ANN.h> // basic ANN includes
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Although random/srandom is a more reliable random number generator,
|
||||
// many systems do not have it. If it is not available, set the
|
||||
// preprocessor symbol ANN_NO_RANDOM, and this will substitute the use
|
||||
// of rand/srand for them.
|
||||
//----------------------------------------------------------------------
|
||||
#ifdef ANN_NO_RANDOM // for systems not having random()
|
||||
#define ANN_RAND rand
|
||||
#define ANN_SRAND srand
|
||||
#define ANN_RAND_MAX RAND_MAX
|
||||
#else // otherwise use rand()
|
||||
#define ANN_RAND random
|
||||
#define ANN_SRAND srandom
|
||||
#define ANN_RAND_MAX 2147483647UL // 2**{31} - 1
|
||||
// #define ANN_RAND_MAX 1073741824UL // 2**{30}
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Globals
|
||||
//----------------------------------------------------------------------
|
||||
extern int annIdum; // random number seed
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// External entry points
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
void annUniformPts( // uniform distribution
|
||||
ANNpointArray pa, // point array (modified)
|
||||
int n, // number of points
|
||||
int dim); // dimension
|
||||
|
||||
void annGaussPts( // Gaussian distribution
|
||||
ANNpointArray pa, // point array (modified)
|
||||
int n, // number of points
|
||||
int dim, // dimension
|
||||
double std_dev); // standard deviation
|
||||
|
||||
void annCoGaussPts( // correlated-Gaussian distribution
|
||||
ANNpointArray pa, // point array (modified)
|
||||
int n, // number of points
|
||||
int dim, // dimension
|
||||
double correlation); // correlation
|
||||
|
||||
void annLaplacePts( // Laplacian distribution
|
||||
ANNpointArray pa, // point array (modified)
|
||||
int n, // number of points
|
||||
int dim); // dimension
|
||||
|
||||
void annCoLaplacePts( // correlated-Laplacian distribution
|
||||
ANNpointArray pa, // point array (modified)
|
||||
int n, // number of points
|
||||
int dim, // dimension
|
||||
double correlation); // correlation
|
||||
|
||||
void annClusGaussPts( // clustered-Gaussian distribution
|
||||
ANNpointArray pa, // point array (modified)
|
||||
int n, // number of points
|
||||
int dim, // dimension
|
||||
int n_clus, // number of colors (clusters)
|
||||
ANNbool new_clust, // generate new cluster centers
|
||||
double std_dev); // standard deviation within clusters
|
||||
|
||||
void annClusOrthFlats( // clustered along orthogonal flats
|
||||
ANNpointArray pa, // point array (modified)
|
||||
int n, // number of points
|
||||
int dim, // dimension
|
||||
int n_clus, // number of colors
|
||||
ANNbool new_clust, // generate new clusters.
|
||||
double std_dev, // standard deviation within clusters
|
||||
int max_dim); // maximum dimension of the flats
|
||||
|
||||
void annClusEllipsoids( // clustered around ellipsoids
|
||||
ANNpointArray pa, // point array (modified)
|
||||
int n, // number of points
|
||||
int dim, // dimension
|
||||
int n_clus, // number of colors
|
||||
ANNbool new_clust, // generate new clusters.
|
||||
double std_dev_small, // small standard deviation
|
||||
double std_dev_lo, // low standard deviation for ellipses
|
||||
double std_dev_hi, // high standard deviation for ellipses
|
||||
int max_dim); // maximum dimension of the flats
|
||||
|
||||
void annPlanted( // planted nearest neighbors
|
||||
ANNpointArray pa, // point array (modified)
|
||||
int n, // number of points
|
||||
int dim, // dimension
|
||||
ANNpointArray src, // source point array
|
||||
int n_src, // source size
|
||||
double std_dev); // standard deviation about source
|
||||
|
||||
#endif
|
||||
Vendored
-20
@@ -1,20 +0,0 @@
|
||||
-0.297462 0.176102
|
||||
0.565538 -0.361496
|
||||
0.909313 -0.182785
|
||||
0.920712 0.478408
|
||||
0.167682 0.0499836
|
||||
0.305223 -0.0805835
|
||||
0.114973 0.882453
|
||||
0.742916 0.16376
|
||||
0.0724605 -0.826775
|
||||
0.690960 -0.559284
|
||||
0.188485 -0.643934
|
||||
0.749427 -0.942415
|
||||
-0.970662 -0.223466
|
||||
0.916110 0.879597
|
||||
0.927417 -0.382593
|
||||
-0.711327 0.278713
|
||||
-0.519172 0.986146
|
||||
0.135338 0.924588
|
||||
-0.0837537 0.61687
|
||||
0.0520465 0.896306
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
0.0902484 -0.207129
|
||||
-0.419567 0.485743
|
||||
0.826225 -0.30962
|
||||
0.694758 0.987088
|
||||
-0.410807 -0.465182
|
||||
-0.836501 0.490184
|
||||
0.588289 0.656408
|
||||
0.325807 0.38721
|
||||
-0.532226 -0.727036
|
||||
-0.52506 -0.853508
|
||||
Vendored
-15
@@ -1,15 +0,0 @@
|
||||
validate on
|
||||
stats query_stats
|
||||
dim 2
|
||||
data_size 20
|
||||
query_size 10
|
||||
read_data_pts test1-data.pts
|
||||
read_query_pts test1-query.pts
|
||||
bucket_size 1
|
||||
near_neigh 3
|
||||
split_rule suggest
|
||||
shrink_rule none
|
||||
build_ann
|
||||
epsilon 0.0
|
||||
run_queries standard
|
||||
run_queries priority
|
||||
Vendored
-76
@@ -1,76 +0,0 @@
|
||||
------------------------------------------------------------
|
||||
ann_test: Version 1.0
|
||||
Copyright: David M. Mount and Sunil Arya.
|
||||
Latest Revision: Mar 1, 2005.
|
||||
------------------------------------------------------------
|
||||
|
||||
validate = on (Warning: this may slow execution time.)
|
||||
stats = query_stats
|
||||
[Read Data Points:
|
||||
data_size = 20
|
||||
file_name = test1-data.pts
|
||||
dim = 2
|
||||
]
|
||||
[Read Query Points:
|
||||
query_size = 10
|
||||
file_name = test1-query.pts
|
||||
dim = 2
|
||||
]
|
||||
[Build ann-structure:
|
||||
split_rule = suggest
|
||||
shrink_rule = none
|
||||
data_size = 20
|
||||
dim = 2
|
||||
bucket_size = 1
|
||||
process_time = 0 sec
|
||||
(Structure Statistics:
|
||||
n_nodes = 39 (opt = 40, best if < 400)
|
||||
n_leaves = 20 (0 contain no points)
|
||||
n_splits = 19
|
||||
n_shrinks = 0
|
||||
empty_leaves = 0 percent (best if < 50 percent)
|
||||
depth = 6 (opt = 4, best if < 17)
|
||||
avg_aspect_ratio = 1.48847 (best if < 20)
|
||||
)
|
||||
]
|
||||
(Computing true nearest neighbors for validation. This may take time.)
|
||||
[Run Queries:
|
||||
query_size = 10
|
||||
dim = 2
|
||||
search_method = standard
|
||||
epsilon = 0
|
||||
near_neigh = 3
|
||||
true_nn = 13
|
||||
query_time = 0 sec/query (biased by perf measurements)
|
||||
(Performance stats: [ mean : stddev ]< min , max >
|
||||
leaf_nodes = [ 6.3 : 2.751 ]< 4 , 11 >
|
||||
splitting_nodes = [ 8.8 : 3.676 ]< 5 , 15 >
|
||||
shrinking_nodes = [ 0 : 0 ]< 0 , 0 >
|
||||
total_nodes = [ 15.1 : 6.35 ]< 9 , 26 >
|
||||
points_visited = [ 6.3 : 2.751 ]< 4 , 11 >
|
||||
coord_hits/pt = [ 0.57 : 0.2201 ]< 0.35 , 0.95 >
|
||||
floating_ops_(K) = [ 0.156 : 0.0563 ]< 0.101 , 0.254 >
|
||||
average_error = [ 0 : 0 ]< 0 , 0 >
|
||||
rank_error = [ 0 : 0 ]< 0 , 0 >
|
||||
)
|
||||
]
|
||||
[Run Queries:
|
||||
query_size = 10
|
||||
dim = 2
|
||||
search_method = priority
|
||||
epsilon = 0
|
||||
near_neigh = 3
|
||||
true_nn = 13
|
||||
query_time = 0 sec/query (biased by perf measurements)
|
||||
(Performance stats: [ mean : stddev ]< min , max >
|
||||
leaf_nodes = [ 5.9 : 2.025 ]< 4 , 9 >
|
||||
splitting_nodes = [ 8.7 : 3.498 ]< 5 , 15 >
|
||||
shrinking_nodes = [ 0 : 0 ]< 0 , 0 >
|
||||
total_nodes = [ 14.6 : 5.42 ]< 9 , 24 >
|
||||
points_visited = [ 5.9 : 2.025 ]< 4 , 9 >
|
||||
coord_hits/pt = [ 0.535 : 0.1667 ]< 0.35 , 0.8 >
|
||||
floating_ops_(K) = [ 0.1719 : 0.05861 ]< 0.114 , 0.267 >
|
||||
average_error = [ 0 : 0 ]< 0 , 0 >
|
||||
rank_error = [ 0 : 0 ]< 0 , 0 >
|
||||
)
|
||||
]
|
||||
Vendored
-5000
File diff suppressed because it is too large
Load Diff
-100
@@ -1,100 +0,0 @@
|
||||
0.0902484 -0.207129 -0.419567 0.485743 0.826225 -0.30962 0.694758 0.987088
|
||||
-0.410807 -0.465182 -0.836501 0.490184 0.588289 0.656408 0.325807 0.38721
|
||||
-0.532226 -0.727036 -0.52506 -0.853508 0.28637 0.938617 -0.864754 0.622397
|
||||
-0.408646 -0.522319 0.0388774 -0.893642 0.385806 0.890013 -0.38066 -0.524536
|
||||
0.916427 -0.941696 0.219294 -0.971436 -0.706532 0.566439 -0.0591963 0.27756
|
||||
0.692452 -0.210879 0.927987 0.587037 0.610211 0.895158 -0.228196 -0.314064
|
||||
-0.13253 0.711121 0.605841 0.771335 -0.945103 0.356652 0.00215608 -0.54444
|
||||
0.0611156 0.921316 0.245255 0.92896 0.562614 0.160313 -0.457179 -0.432326
|
||||
-0.813199 -0.0630237 0.149021 0.0301869 0.669399 0.984082 -0.304983 0.480589
|
||||
0.311004 0.515906 -0.667349 -0.464028 -0.554472 0.123471 -0.932191 0.153486
|
||||
0.488214 -0.456547 0.695901 -0.693933 -0.775879 -0.940794 0.710796 -0.79388
|
||||
-0.73914 -0.733084 0.300943 0.0726274 -0.722715 -0.414562 0.463033 -0.378469
|
||||
-0.178166 -0.846243 -0.319029 0.186783 -0.364517 0.915747 -0.300208 -0.599272
|
||||
-0.544192 0.173829 -0.0957917 0.889828 0.775796 0.148865 -0.430932 0.0342097
|
||||
-0.969596 -0.545995 -0.98045 -0.57569 0.465756 -0.166752 0.622912 -0.580526
|
||||
0.0918901 0.635361 -0.934228 -0.0273098 0.65055 0.227406 -0.628807 0.213824
|
||||
0.216987 -0.653221 -0.789576 0.6252 0.124467 0.477613 -0.259097 0.913287
|
||||
0.587512 0.377176 -0.393846 0.293478 0.275818 -0.298198 0.063539 -0.592623
|
||||
0.867649 0.64842 -0.929959 0.677208 -0.302289 -0.230779 0.267189 -0.140577
|
||||
-0.360362 0.910053 -0.26718 0.167234 -0.0203549 -0.190717 -0.291433 0.756657
|
||||
0.637052 0.538531 0.200832 0.420082 0.688092 0.500134 0.78368 -0.542742
|
||||
0.00257324 0.53221 -0.899835 0.503303 -0.46265 0.13425 -0.66756 0.125758
|
||||
-0.28673 -0.255891 0.0805643 0.154396 -0.304337 0.942248 0.404729 -0.530016
|
||||
0.330364 -0.469459 0.492101 0.923757 -0.0870035 0.114578 -0.321104 0.586945
|
||||
0.104922 -0.620678 -0.27497 0.905927 0.219188 -0.495436 -0.762684 0.557364
|
||||
-0.665582 -0.75013 -0.249321 0.667873 -0.288485 -0.765806 -0.45304 0.919665
|
||||
-0.493835 0.239472 -0.917625 0.418003 0.273087 0.54198 -0.836992 -0.842215
|
||||
-0.576808 -0.958153 0.73833 0.0770337 -0.82097 0.0731924 -0.192127 -0.369044
|
||||
-0.204979 -0.564608 -0.792166 0.356056 -0.50905 -0.217096 -0.45753 -0.998959
|
||||
0.735413 0.347442 -0.644887 0.178 0.935974 -0.630639 -0.624678 0.946812
|
||||
0.72101 -0.881322 -0.0914539 0.80997 0.619855 0.299585 -0.0544264 -0.932907
|
||||
-0.454196 0.903609 0.216595 -0.515838 0.650697 0.322145 -0.0598022 0.29879
|
||||
0.56218 0.548496 0.116056 -0.109011 0.35975 0.375862 -0.473017 0.179013
|
||||
0.790441 0.202804 0.370116 -0.299956 -0.789657 0.66881 -0.429629 -0.203547
|
||||
0.870951 -0.240769 0.472253 -0.874723 -0.67061 -0.434253 0.661868 -0.515051
|
||||
-0.45736 0.0815795 0.924138 0.0979838 -0.00884649 0.0643335 0.803118 -0.542487
|
||||
-0.177146 -0.625442 -0.840198 -0.158722 -0.596283 -0.673887 -0.738309 0.439504
|
||||
0.186587 -0.465294 0.81993 0.754213 -0.929469 0.5224 -0.567962 -0.0020964
|
||||
-0.727445 0.654887 0.237451 -0.81993 0.461061 -0.330429 -0.423304 -0.11565
|
||||
-0.638766 -0.623638 0.33871 -0.295169 -0.864833 0.715051 -0.443567 0.530583
|
||||
0.81889 0.288548 -0.558678 -0.588774 -0.961246 0.46669 0.585559 0.566684
|
||||
-0.336336 0.911721 -0.353767 -0.387489 -0.0397957 -0.544424 0.388611 -0.49438
|
||||
0.389995 -0.989308 0.0531768 -0.119235 0.8707 0.190555 -0.829453 -0.0377095
|
||||
-0.754985 0.722122 -0.486071 -0.0543854 -0.00514588 -0.0407811 -0.923871 0.768664
|
||||
-0.257839 -0.963332 0.27127 0.90108 0.2946 0.295975 0.133463 -0.203565
|
||||
0.128047 -0.0221978 0.565967 0.441817 -0.885341 -0.294394 0.752 0.655274
|
||||
0.455767 -0.659883 0.40248 0.600338 -0.83844 -0.844635 -0.436961 -0.694439
|
||||
0.494475 -0.85312 -0.703241 -0.0320226 -0.0312604 -0.804464 -0.967423 0.134369
|
||||
-0.823558 0.72077 0.692424 -0.331696 0.28281 0.956438 -0.512021 0.343271
|
||||
-0.120567 0.85007 -0.634148 0.479445 0.999095 -0.362764 -0.547786 0.0405272
|
||||
-0.759062 -0.595061 0.891393 -0.772615 0.699682 0.433783 0.496053 0.989183
|
||||
-0.830714 0.673363 -0.774558 -0.428386 -0.163786 -0.576139 0.870208 -0.403316
|
||||
-0.358526 -0.816022 -0.40667 0.888208 0.0927729 0.567724 -0.993948 -0.315037
|
||||
0.173889 0.324026 0.971654 0.445513 -0.836598 -0.335657 -0.193173 0.544429
|
||||
-0.383334 0.0514736 -0.667312 -0.650427 -0.173149 -0.785155 -0.427284 -0.773588
|
||||
-0.942451 -0.429928 -0.296064 0.478439 -0.21067 -0.583727 -0.172756 -0.867286
|
||||
0.0722371 0.969577 -0.667728 -0.673244 0.975295 -0.468511 0.283715 -0.838649
|
||||
-0.135551 0.0966441 -0.899046 -0.107455 -0.233247 -0.784231 -0.273956 -0.735285
|
||||
-0.0414323 0.633082 0.756714 -0.941008 0.7334 -0.558333 0.515249 -0.0495845
|
||||
0.151553 0.897797 0.535985 -0.435869 0.276652 0.950385 -0.588415 -0.908762
|
||||
0.836871 -0.309154 0.542942 -0.555574 0.296423 -0.852823 0.0586046 0.907905
|
||||
-0.037232 -0.50382 0.828129 0.852639 -0.187631 0.110954 -0.520551 0.2231
|
||||
-0.669727 -0.670437 -0.395765 0.938759 -0.71912 -0.299401 -0.857412 0.136054
|
||||
-0.426925 -0.323029 0.847521 -0.768077 -0.737279 -0.73427 0.409976 -0.424011
|
||||
-0.485806 -0.842531 0.425504 0.928987 0.885911 0.193509 -0.786534 -0.0521742
|
||||
0.477176 0.948246 -0.81151 -0.461006 0.140611 -0.0403634 0.904953 0.527849
|
||||
0.278327 -0.960566 -0.745472 0.449632 -0.221733 -0.67303 0.0901394 -0.365342
|
||||
0.350109 0.412389 0.22772 -0.743153 0.374894 -0.674853 -0.940435 0.284267
|
||||
0.0780486 0.00241877 -0.793647 -0.801883 -0.931572 -0.906159 -0.325908 0.129096
|
||||
0.251037 -0.32573 -0.0132674 0.16178 -0.391019 0.541115 0.186404 0.804935
|
||||
-0.457725 0.0676978 -0.679403 -0.287371 -0.0475436 -0.433919 -0.777655 -0.648854
|
||||
-0.0915583 -0.911684 -0.450737 0.330562 0.51434 -0.989688 -0.394102 0.621241
|
||||
-0.475504 -0.0645391 0.836504 0.636607 -0.294769 0.747648 -0.23722 0.750184
|
||||
-0.767895 -0.446372 0.758335 -0.407514 -0.304965 0.551426 0.467747 0.962403
|
||||
-0.550376 0.261992 0.65622 -0.274081 0.87838 0.931551 -0.329732 0.0551602
|
||||
0.911471 0.324545 0.0503461 -0.796273 0.150228 0.760694 -0.428716 -0.677338
|
||||
0.320243 0.908401 -0.406211 -0.0914938 -0.0383119 0.971036 -0.996626 -0.420682
|
||||
-0.632748 0.159697 0.350173 0.188661 -0.463423 -0.79209 -0.321071 -0.849934
|
||||
-0.493952 0.59222 -0.239915 0.0675535 -0.209439 -0.896104 0.215966 -0.804748
|
||||
0.470257 -0.814033 0.0936659 -0.279521 0.631632 -0.00510561 -0.694679 -0.554847
|
||||
0.0193325 -0.515019 -0.502347 -0.0691725 0.0823693 0.218677 0.484909 0.230698
|
||||
0.411173 -0.360974 -0.0687193 0.982974 -0.62282 -0.808528 0.391168 0.509953
|
||||
-0.123533 0.573365 0.918135 -0.570049 0.0766659 0.916687 -0.189227 0.105294
|
||||
-0.436078 0.565401 0.107861 -0.321394 -0.681098 0.372357 -0.911342 -0.836162
|
||||
0.20572 0.550261 -0.578777 -0.236365 -0.582914 0.473617 -0.745445 -0.401362
|
||||
-0.268776 -0.00963149 -0.870677 -0.315329 -0.327188 0.571639 -0.922104 -0.889744
|
||||
-0.653846 0.42571 0.484338 0.786735 -0.924095 -0.777902 0.424617 -0.11099
|
||||
0.314249 -0.488492 -0.09607 -0.285476 -0.257726 -0.803911 -0.806167 0.4756
|
||||
-0.41036 -0.669857 -0.36997 0.551767 -0.906633 0.189437 -0.684472 -0.449454
|
||||
-0.813612 -0.0906479 0.286132 0.680878 0.675851 0.0646878 -0.2403 -0.310925
|
||||
-0.685114 0.0677462 -0.95481 -0.179017 0.857301 -0.87579 -0.329674 0.562246
|
||||
0.0735071 -0.575949 0.50454 -0.686882 -0.0657996 0.874931 0.927272 -0.333088
|
||||
-0.245092 -0.109308 -0.713837 -0.613438 -0.0236157 0.140357 -0.512282 -0.518118
|
||||
0.184375 -0.865972 0.707001 -0.612003 0.67617 -0.709794 -0.885369 0.826005
|
||||
-0.157901 0.836454 0.245372 0.589479 -0.930075 0.106183 0.420879 -0.510301
|
||||
-0.466877 -0.115361 -0.736242 0.493482 -0.785855 -0.55306 0.617798 -0.904856
|
||||
-0.830296 0.557992 -0.204564 -0.500123 0.153565 -0.773108 0.287265 0.823092
|
||||
0.986858 -0.323913 -0.914362 0.535652 -0.535098 -0.945814 0.974316 0.434805
|
||||
0.732686 0.221111 0.559403 0.584674 -0.447866 0.508206 0.907212 -0.782827
|
||||
-0.970814 -0.13434 -0.550199 0.523038 -0.373701 -0.359454 0.0321578 0.840907
|
||||
Vendored
-21
@@ -1,21 +0,0 @@
|
||||
validate on
|
||||
stats query_stats
|
||||
dim 8
|
||||
data_size 5000
|
||||
read_data_pts test2-data.pts
|
||||
query_size 100
|
||||
read_query_pts test2-query.pts
|
||||
bucket_size 1
|
||||
near_neigh 3
|
||||
split_rule suggest
|
||||
shrink_rule none
|
||||
build_ann
|
||||
epsilon 0.0
|
||||
run_queries standard
|
||||
run_queries priority
|
||||
epsilon 0.10
|
||||
run_queries standard
|
||||
run_queries priority
|
||||
epsilon 0.50
|
||||
run_queries standard
|
||||
run_queries priority
|
||||
Vendored
-156
@@ -1,156 +0,0 @@
|
||||
------------------------------------------------------------
|
||||
ann_test: Version 1.0
|
||||
Copyright: David M. Mount and Sunil Arya.
|
||||
Latest Revision: Mar 1, 2005.
|
||||
------------------------------------------------------------
|
||||
|
||||
validate = on (Warning: this may slow execution time.)
|
||||
stats = query_stats
|
||||
[Read Data Points:
|
||||
data_size = 5000
|
||||
file_name = test2-data.pts
|
||||
dim = 8
|
||||
]
|
||||
[Read Query Points:
|
||||
query_size = 100
|
||||
file_name = test2-query.pts
|
||||
dim = 8
|
||||
]
|
||||
[Build ann-structure:
|
||||
split_rule = suggest
|
||||
shrink_rule = none
|
||||
data_size = 5000
|
||||
dim = 8
|
||||
bucket_size = 1
|
||||
process_time = 0.18 sec
|
||||
(Structure Statistics:
|
||||
n_nodes = 9999 (opt = 10000, best if < 100000)
|
||||
n_leaves = 5000 (0 contain no points)
|
||||
n_splits = 4999
|
||||
n_shrinks = 0
|
||||
empty_leaves = 0 percent (best if < 50 percent)
|
||||
depth = 17 (opt = 12, best if < 196)
|
||||
avg_aspect_ratio = 2.03396 (best if < 20)
|
||||
)
|
||||
]
|
||||
(Computing true nearest neighbors for validation. This may take time.)
|
||||
[Run Queries:
|
||||
query_size = 100
|
||||
dim = 8
|
||||
search_method = standard
|
||||
epsilon = 0
|
||||
near_neigh = 3
|
||||
true_nn = 13
|
||||
query_time = 0.0008 sec/query (biased by perf measurements)
|
||||
(Performance stats: [ mean : stddev ]< min , max >
|
||||
leaf_nodes = [ 269.6 : 154.1 ]< 68 , 1046 >
|
||||
splitting_nodes = [ 448.2 : 259.2 ]< 100 , 1858 >
|
||||
shrinking_nodes = [ 0 : 0 ]< 0 , 0 >
|
||||
total_nodes = [ 717.8 : 412.6 ]< 168 , 2904 >
|
||||
points_visited = [ 269.6 : 154.1 ]< 68 , 1046 >
|
||||
coord_hits/pt = [ 0.1975 : 0.1075 ]< 0.0446 , 0.6974 >
|
||||
floating_ops_(K) = [ 8.492 : 4.716 ]< 1.939 , 32.61 >
|
||||
average_error = [ 0 : 0 ]< 0 , 0 >
|
||||
rank_error = [ 0 : 0 ]< 0 , 0 >
|
||||
)
|
||||
]
|
||||
[Run Queries:
|
||||
query_size = 100
|
||||
dim = 8
|
||||
search_method = priority
|
||||
epsilon = 0
|
||||
near_neigh = 3
|
||||
true_nn = 13
|
||||
query_time = 0.0011 sec/query (biased by perf measurements)
|
||||
(Performance stats: [ mean : stddev ]< min , max >
|
||||
leaf_nodes = [ 237.7 : 131.6 ]< 68 , 801 >
|
||||
splitting_nodes = [ 408.1 : 227.7 ]< 100 , 1398 >
|
||||
shrinking_nodes = [ 0 : 0 ]< 0 , 0 >
|
||||
total_nodes = [ 645.8 : 358.5 ]< 168 , 2149 >
|
||||
points_visited = [ 237.7 : 131.6 ]< 68 , 801 >
|
||||
coord_hits/pt = [ 0.1679 : 0.08993 ]< 0.0472 , 0.5492 >
|
||||
floating_ops_(K) = [ 10.83 : 6.344 ]< 2.638 , 38.3 >
|
||||
average_error = [ 0 : 0 ]< 0 , 0 >
|
||||
rank_error = [ 0 : 0 ]< 0 , 0 >
|
||||
)
|
||||
]
|
||||
[Run Queries:
|
||||
query_size = 100
|
||||
dim = 8
|
||||
search_method = standard
|
||||
epsilon = 0.1
|
||||
near_neigh = 3
|
||||
true_nn = 13
|
||||
query_time = 0.0006 sec/query (biased by perf measurements)
|
||||
(Performance stats: [ mean : stddev ]< min , max >
|
||||
leaf_nodes = [ 200.9 : 115.8 ]< 51 , 762 >
|
||||
splitting_nodes = [ 344.9 : 202.4 ]< 77 , 1407 >
|
||||
shrinking_nodes = [ 0 : 0 ]< 0 , 0 >
|
||||
total_nodes = [ 545.9 : 317.4 ]< 128 , 2169 >
|
||||
points_visited = [ 200.9 : 115.8 ]< 51 , 762 >
|
||||
coord_hits/pt = [ 0.1548 : 0.08517 ]< 0.0348 , 0.5494 >
|
||||
floating_ops_(K) = [ 6.606 : 3.703 ]< 1.513 , 25.14 >
|
||||
average_error = [ 0 : 0 ]< 0 , 0 >
|
||||
rank_error = [ 0 : 0 ]< 0 , 0 >
|
||||
)
|
||||
]
|
||||
[Run Queries:
|
||||
query_size = 100
|
||||
dim = 8
|
||||
search_method = priority
|
||||
epsilon = 0.1
|
||||
near_neigh = 3
|
||||
true_nn = 13
|
||||
query_time = 0.0007 sec/query (biased by perf measurements)
|
||||
(Performance stats: [ mean : stddev ]< min , max >
|
||||
leaf_nodes = [ 176.1 : 101.1 ]< 49 , 629 >
|
||||
splitting_nodes = [ 314.3 : 186.9 ]< 77 , 1285 >
|
||||
shrinking_nodes = [ 0 : 0 ]< 0 , 0 >
|
||||
total_nodes = [ 490.4 : 286.6 ]< 128 , 1914 >
|
||||
points_visited = [ 176.1 : 101.1 ]< 49 , 629 >
|
||||
coord_hits/pt = [ 0.1309 : 0.07112 ]< 0.0374 , 0.4332 >
|
||||
floating_ops_(K) = [ 8.205 : 4.999 ]< 2.032 , 33.27 >
|
||||
average_error = [ 0 : 0 ]< 0 , 0 >
|
||||
rank_error = [ 0 : 0 ]< 0 , 0 >
|
||||
)
|
||||
]
|
||||
[Run Queries:
|
||||
query_size = 100
|
||||
dim = 8
|
||||
search_method = standard
|
||||
epsilon = 0.5
|
||||
near_neigh = 3
|
||||
true_nn = 13
|
||||
query_time = 0.0002 sec/query (biased by perf measurements)
|
||||
(Performance stats: [ mean : stddev ]< min , max >
|
||||
leaf_nodes = [ 83.07 : 46.06 ]< 23 , 264 >
|
||||
splitting_nodes = [ 163.4 : 94.86 ]< 42 , 512 >
|
||||
shrinking_nodes = [ 0 : 0 ]< 0 , 0 >
|
||||
total_nodes = [ 246.5 : 140.2 ]< 67 , 776 >
|
||||
points_visited = [ 83.07 : 46.06 ]< 23 , 264 >
|
||||
coord_hits/pt = [ 0.0765 : 0.03992 ]< 0.0182 , 0.2192 >
|
||||
floating_ops_(K) = [ 3.224 : 1.734 ]< 0.891 , 9.572 >
|
||||
average_error = [ 0.0009039 : 0.009619 ]< 0 , 0.1516 >
|
||||
rank_error = [ 0 : 0 ]< 0 , 0 >
|
||||
)
|
||||
]
|
||||
[Run Queries:
|
||||
query_size = 100
|
||||
dim = 8
|
||||
search_method = priority
|
||||
epsilon = 0.5
|
||||
near_neigh = 3
|
||||
true_nn = 13
|
||||
query_time = 0.0004 sec/query (biased by perf measurements)
|
||||
(Performance stats: [ mean : stddev ]< min , max >
|
||||
leaf_nodes = [ 69.72 : 38.29 ]< 21 , 246 >
|
||||
splitting_nodes = [ 146.8 : 81.69 ]< 40 , 475 >
|
||||
shrinking_nodes = [ 0 : 0 ]< 0 , 0 >
|
||||
total_nodes = [ 216.5 : 118.8 ]< 65 , 721 >
|
||||
points_visited = [ 69.72 : 38.29 ]< 21 , 246 >
|
||||
coord_hits/pt = [ 0.06206 : 0.03155 ]< 0.0182 , 0.194 >
|
||||
floating_ops_(K) = [ 3.608 : 1.989 ]< 1.126 , 12.28 >
|
||||
average_error = [ 0.001425 : 0.011 ]< 0 , 0.1516 >
|
||||
rank_error = [ 0 : 0 ]< 0 , 0 >
|
||||
)
|
||||
]
|
||||
Vendored
-31
@@ -3,39 +3,8 @@ if(BUILD_CAM)
|
||||
add_subdirectory(ANN)
|
||||
endif(BUILD_CAM)
|
||||
|
||||
if(BUILD_GUI AND NOT FREECAD_USE_EXTERNAL_PIVY)
|
||||
if(FREECAD_LIBPACK_CHECKFILE6X)
|
||||
add_subdirectory(Pivy)
|
||||
elseif(FREECAD_LIBPACK_CHECKFILE7X)
|
||||
add_subdirectory(Pivy-0.5)
|
||||
#elseif(BUILD_GUI AND FREECAD_LIBPACK_CHECKCUSTOM)
|
||||
# find_path(COIN_VERSION3 Inventor/scxml/ScXML.h ${COIN3D_INCLUDE_DIR})
|
||||
# if (COIN_VERSION3)
|
||||
# add_subdirectory(Pivy-0.5)
|
||||
# else (COIN_VERSION3)
|
||||
# add_subdirectory(Pivy)
|
||||
# endif(COIN_VERSION3)
|
||||
#endif(BUILD_GUI AND FREECAD_LIBPACK_CHECKFILE6X)
|
||||
#if (MINGW)
|
||||
# add_subdirectory(Pivy)
|
||||
#endif(MINGW)
|
||||
# applies for Unix, MinGW and Windows with custom LibPack
|
||||
else(FREECAD_LIBPACK_CHECKFILE6X)
|
||||
find_path(COIN_VERSION3 Inventor/scxml/ScXML.h ${COIN3D_INCLUDE_DIR})
|
||||
if (COIN_VERSION3)
|
||||
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Pivy-0.5)
|
||||
add_subdirectory(Pivy-0.5)
|
||||
endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Pivy-0.5)
|
||||
else (COIN_VERSION3)
|
||||
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Pivy)
|
||||
add_subdirectory(Pivy)
|
||||
endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Pivy)
|
||||
endif(COIN_VERSION3)
|
||||
endif (FREECAD_LIBPACK_CHECKFILE6X)
|
||||
endif(BUILD_GUI AND NOT FREECAD_USE_EXTERNAL_PIVY)
|
||||
|
||||
# Build SalomeMesh for all Platforms since heavily patched
|
||||
if (BUILD_SMESH AND NOT FREECAD_USE_EXTERNAL_SMESH)
|
||||
add_subdirectory(salomesmesh)
|
||||
endif()
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user