diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-04-15 08:42:28 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-04-15 08:42:28 +0000 |
commit | c0bff602db910fbda4449299e48df469c0457fb9 (patch) | |
tree | 9056c8d35caa83265389f24cbf7575850ddb0b71 | |
parent | 384d6f7cda318804997555cb441b5baf4d8f6a42 (diff) | |
parent | 7e71749f8aa73236a244394eedd5f662ec3a1889 (diff) |
Merge of periodic_alpha_complex_3d_persistence feature
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@1119 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 2a77050d737aa008a1bd0c71a4e4c8eb21c7fef6
-rw-r--r-- | data/points/grid_10_10_10_in_0_1.off | 1002 | ||||
-rw-r--r-- | data/points/tore3D_300.off | 302 | ||||
-rw-r--r-- | src/Persistent_cohomology/example/CMakeLists.txt | 13 | ||||
-rw-r--r-- | src/Persistent_cohomology/example/README | 98 | ||||
-rw-r--r-- | src/Persistent_cohomology/example/alpha_complex_3d_persistence.cpp | 24 | ||||
-rw-r--r-- | src/Persistent_cohomology/example/alpha_complex_persistence.cpp | 2 | ||||
-rw-r--r-- | src/Persistent_cohomology/example/periodic_alpha_complex_3d_persistence.cpp | 303 | ||||
-rw-r--r-- | src/common/example/CGAL_3D_points_off_reader.cpp | 41 | ||||
-rw-r--r-- | src/common/example/CGAL_points_off_reader.cpp | 18 | ||||
-rw-r--r-- | src/common/example/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/common/include/gudhi/Points_3D_off_io.h | 204 | ||||
-rw-r--r-- | src/common/include/gudhi/Points_off_io.h | 15 |
12 files changed, 1992 insertions, 34 deletions
diff --git a/data/points/grid_10_10_10_in_0_1.off b/data/points/grid_10_10_10_in_0_1.off new file mode 100644 index 00000000..f90eb9df --- /dev/null +++ b/data/points/grid_10_10_10_in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.8 0.8
+0.9 0.8 0.9
+0.9 0.9 0
+0.9 0.9 0.1
+0.9 0.9 0.2
+0.9 0.9 0.3
+0.9 0.9 0.4
+0.9 0.9 0.5
+0.9 0.9 0.6
+0.9 0.9 0.7
+0.9 0.9 0.8
+0.9 0.9 0.9
diff --git a/data/points/tore3D_300.off b/data/points/tore3D_300.off new file mode 100644 index 00000000..00eecbc2 --- /dev/null +++ b/data/points/tore3D_300.off @@ -0,0 +1,302 @@ +OFF +300 0 0 +0.959534781242014 -0.418347167310406 0.302236706360499 +2.16795051781987 1.8534755312793 -0.523120176939808 +-2.38752605996323 -1.50911089699331 -0.565888742230855 +-2.70428287516913 -1.25687539753238 0.188394161758062 +-1.2293192351549 -1.6433666240448 -0.998632128417844 +-0.541060581221073 0.874317877271137 -0.235772670127843 +-0.680895633395962 -1.18447800621889 0.773528325120879 +0.307818039582861 1.45003941576708 0.855593436948771 +0.168334095447179 -1.04004287990976 0.322931047726699 +-0.693132044992659 2.91846761160023 -0.0265488214271136 +2.21829768934691 -1.80825620958286 0.507029717781912 +1.39353197432761 -1.00232018065434 -0.95898987509937 +1.25103367489055 0.670258962753535 -0.814097483693208 +0.256075322268679 0.980760885647654 -0.164603689388124 +-1.03049290335496 -0.548251215382241 -0.553663669101879 +-1.4770698664818 1.55244993730008 -0.989743336676147 +2.81127276382533 -0.973240065906209 -0.222333302099467 +1.92081177957661 0.371630788782385 0.999050476863813 +0.940122029559839 0.781599816466946 0.628994896033071 +0.306997277631142 -2.63033061729372 0.761482466789273 +0.612817640625854 2.28021124717378 -0.932517620554714 +-0.749699607389099 1.24801965739463 -0.839010966831176 +-0.154361066579755 1.04815680087852 0.339688867662217 +-0.262639970818703 1.12445753696261 0.534327877655949 +0.36717667006869 -1.01676645451003 0.394334855760279 +0.424035547682691 -0.917168809434391 -0.144175092700111 +2.08261296666578 -2.05785707858966 -0.373061099708758 +0.651279530942164 -0.91244335335117 0.476884993705875 +-2.93865473739998 0.176739480659163 0.330046256428844 +0.0752592625269588 -2.86104297523846 0.506852758144546 +2.42108789315239 -1.57246048079025 -0.46192589897907 +-1.61942559663475 -1.10542050497529 0.999228952936353 +0.692389459564839 0.770549419741852 0.265645889867695 +1.51841358234726 -1.00021735880109 -0.98334383059774 +2.85075282389761 0.814388843476368 -0.262995967489467 +-0.784392975900731 -0.623934865952297 -0.0675029801783761 +2.95477190325865 -0.01545374755798 0.297209425434383 +-2.01178925877753 0.819250335239531 0.98506143304802 +-1.06049119415128 -0.640702917987696 0.64876172557636 +0.424777646365108 -0.912213211492002 0.111760882407564 +1.62717960754164 -2.51706084785163 0.0745558427305672 +0.991179499609619 -0.137272754245949 0.0357741533639773 +0.586676853840703 -0.981514568432931 0.516124042728287 +0.996296801968011 0.163993329632496 -0.138970552607153 +0.999735468785909 2.8102215879738 -0.18492224634737 +1.80656679908849 -0.264164139672896 0.984706448083062 +-1.41495369339859 2.29441949474757 -0.718394190427821 +-0.608066058828841 -1.94541607390611 -0.999268905344167 +2.15894083249888 1.6976186891867 -0.66545230252024 +-0.0920339025393292 -1.14740764785059 -0.52854186528706 +-0.0803524956678571 -2.82987037713862 0.556256089759466 +1.73755451382877 -1.38298334066552 -0.975330014733214 +1.339576888853 -1.69568142514835 0.986958907306434 +0.941158226372244 1.33453565427992 -0.930230027566694 +-1.64738843362436 2.11800058817634 -0.730187211545338 +-2.09522315192051 2.14264431725583 -0.0797808501517505 +-2.70163529798441 -0.512752030638191 -0.661592848269346 +0.0012406381564526 -2.43305836022187 -0.90136573192226 +1.26857330331965 -0.754387632740404 0.851677186577399 +0.555984630753723 -0.853190194061578 -0.190731240639216 +-0.376652419334438 0.953098196145437 -0.221429003703334 +0.575823956072062 -1.52858842228987 0.930397979228448 +-0.917665722737145 0.426001305594148 -0.152684444024179 +-2.2612659986582 1.45631970411773 0.724147482366059 +-2.4975593505263 0.336020143137794 -0.854128541403725 +-1.21733135240706 -0.635660112064281 -0.779262523564629 +-0.869857012314377 2.58076078125195 -0.690415729999257 +-1.40500337086406 -0.601791852462944 -0.881844312277268 +2.31904992184587 -1.05819185575653 -0.835775763770501 +1.19729717177012 -1.57894012102566 -0.999829933326901 +1.49128833410868 -0.646133202611446 0.927124838238863 +-0.646639588616155 1.64689880969244 0.973024656841064 +-1.07933947117704 0.185618755846084 -0.425802800488271 +-2.25890103703752 0.840567429045019 -0.911984072088236 +1.02056337401279 -0.444785727078535 -0.46229962045738 +-2.01362172913345 1.77850332507576 0.727048210112551 +-1.7152404634659 -1.95129617448897 0.801495726550204 +0.24904814258364 -1.73684228270244 0.969423708704471 +-0.97192898217864 0.340274559305984 -0.242197940224517 +0.335252717095645 1.05330582776341 0.446812017005886 +0.0757351764289982 -1.003454918955 0.112151625141631 +-2.12620574772059 -1.59311887240156 0.754033287759111 +-0.325964621805956 -0.967660697886875 -0.204281119631407 +0.847444429135404 -2.75134349865297 0.477009941828313 +-2.52939644202034 1.59075929357512 0.154220894882662 +-1.51910975922194 2.47536837366441 -0.426830229587188 +-1.23951192974026 -2.45646514226776 -0.659762364526391 +0.00537063209046765 -2.98895632800773 -0.148175024086866 +0.578604147500042 -1.40605218842367 -0.877514074075442 +1.32814619313677 0.993211756161157 0.939862017190046 +2.21921387799351 1.69625165174388 0.608911392663736 +2.11087050271442 -1.62983612347069 0.745183392373354 +1.20744870574619 0.759485725637224 -0.819168429715268 +-1.85454257923694 0.27227622276858 -0.992083907655554 +1.12410933384486 -0.192246452457068 0.511017950537958 +0.508634803443603 -0.874107029353032 -0.150053592184677 +1.8703001619597 0.692655600076433 0.999984548045959 +1.64361625376311 -1.21013144565734 0.999157018995579 +0.840118117818047 -2.50035600571423 0.770266412736703 +2.3287036316336 -1.17791884555773 0.79265889315273 +-2.54280253777906 0.888179845147398 -0.720498448371396 +-2.06783509487145 -1.09828285186568 -0.939917075668418 +0.200760576094878 0.999051233659456 0.194124743559801 +1.57705178275634 -1.36916375652601 0.9960789528748 +1.27101041453082 -0.844959876278814 -0.880656839462615 +2.26878096107158 -1.9325250189773 0.197654241802863 +1.00297464475457 2.79196340984832 -0.256097547101918 +-1.40380898461312 2.64725539056151 0.0843284379977918 +-0.0517392801851798 1.58464174765503 0.910043016348823 +-0.301340591032907 1.33506850520998 -0.775501362836281 +-0.916802035602795 2.82057847024232 -0.259150467395372 +-2.3956686819712 1.05176302652714 -0.787450409390176 +0.260687064694077 -0.989291907955316 0.21352399518671 +1.12792686627226 2.77426524629341 0.101946125819402 +-0.0684132204807785 -2.16283457272975 0.986474250179203 +2.93446835470829 0.29913341943434 0.313235563230203 +0.032755222852554 1.65788790402753 0.939776880892029 +-0.909983475613723 2.25856131650061 -0.900435993208869 +-0.654785891138605 -2.77631341957818 -0.522754517843354 +-0.637731499509436 0.816845593255333 -0.267023168326767 +-2.09200542287803 -0.48535592606264 -0.98905160843396 +2.47346067782732 0.00404347414316116 -0.880813179367053 +-1.07226402798667 -1.22257426020764 0.92749836802861 +1.39068341588794 -0.68753111885771 -0.893709581266259 +2.49123495155807 -0.780792651284873 0.791842221382225 +1.52017311675094 -0.606521706417438 0.931673164101109 +-1.41022678618765 0.805159290147271 -0.926575312433509 +-2.43386589806161 -0.47159898411599 -0.877741390593103 +-0.48020605858504 1.36831644955489 -0.835252691435911 +0.87912613023492 0.619156516496662 0.380637258865281 +0.253085874295989 1.43445725355682 -0.839482019455938 +0.517703192423887 2.78341770290716 0.556042888577917 +-1.00656408919327 -2.07658747018639 0.951489907279078 +-1.40077608835454 0.925515316363222 0.947050044378871 +2.07634345953723 -1.10323384918967 0.936285655309915 +-1.57233200628071 -0.286150759083885 0.915709183775737 +-1.15178699195696 -0.454341172294152 0.647764766715205 +0.760883532100737 2.73972227857741 -0.537259031193132 +2.40478710552954 0.399947334915386 0.899063394403055 +-1.37636264245145 2.1239854039931 0.847405598008672 +0.620060205826966 -0.788865441879053 -0.0822217432568619 +-1.31255288285741 0.709433414132035 -0.861362373356423 +2.87811168494233 0.586136824835297 -0.348820144844317 +1.46215508160988 -2.61812761438328 0.050023918341349 +1.59775483991913 2.14438930309337 0.738569238086525 +2.16166999311135 0.234499849009414 -0.984683361538415 +-2.627348149981 -1.44784295277905 0.0162526714459874 +1.55466115277639 -2.06080606798315 -0.813580914672985 +1.4768627986643 0.291640310070862 -0.86911101944411 +0.36020381665219 -0.932877801044002 -0.00278947687261815 +1.02111844342504 -0.846230498172804 0.738907750969927 +0.0753375442562172 -2.00343644006518 0.999988226833092 +-0.13730950236629 0.991363204668133 -0.0406636790006198 +-2.36318789164257 -1.83848352727692 -0.108400279147113 +-0.80461379190523 -1.6474745725615 -0.986034710893435 +1.7756647596058 -2.38360544396859 -0.233741336935155 +1.69896254446626 -0.343351559842879 0.963782400468442 +0.0494913193213498 -2.46795356936345 -0.883490137791417 +1.35772824903814 0.589658412058176 -0.854314907317433 +-1.96435893659605 -2.22155414885828 -0.260516416434745 +1.35473240963385 0.346732354142229 0.798797675885133 +0.400966681880103 2.47568026636498 0.861391979701686 +-1.62104506824445 -0.572439707452304 0.959751471457789 +-0.867237113132388 0.754407264547685 0.525890831738318 +1.08774066807182 0.58266518858005 -0.642803142528264 +-1.62210891849555 -2.48905492938415 0.239222440583498 +1.29180344928963 0.216732874635193 -0.723674450462894 +-2.23977014077204 1.04128789846265 0.8826717211881 +-2.15042174348158 -1.07255921184869 -0.915173594366247 +1.20646041838032 2.20670800057226 -0.857204278269845 +-1.59665966804813 2.12974640237861 -0.749686641314759 +-0.00507896505098647 1.00004934186706 0.0111568054264668 +1.08896774211599 -0.54893426659595 -0.625155433738454 +-2.08838518173774 1.31789005319132 0.882958674731457 +-2.67026050322772 0.777218712412565 0.624441286594906 +0.134410054836508 1.03453453869622 -0.290843938402197 +-1.15657597782331 0.21336107716996 0.566722675765672 +-1.12091291528735 -0.197701697854327 -0.507272467213624 +2.20360569490773 2.03438086720851 -0.0424844996967955 +-0.190560364964061 -1.95805452687492 0.999465390706348 +-1.69646814346356 -0.625828205037699 0.981438239882928 +-0.304352636706423 -2.83100688552149 -0.531082871783868 +0.14563390066437 -2.1691590077372 0.984738172749555 +-2.34365544864258 -0.143838445921824 0.937470314360672 +1.02710725533131 -0.411656637698526 0.449124549869131 +-1.61565579085794 -1.08738989914736 -0.998620980457037 +-0.717364891783532 1.50452842131031 0.942855738747352 +-0.578567558143299 0.853096156802936 0.246207825092783 +1.11793653693318 0.455945552854421 0.609663175028121 +2.39251443993049 0.176334486690512 0.916949275349228 +2.9155642712549 -0.62746034690765 0.18721929843073 +-1.14806683434513 2.59996359591672 0.539229179127317 +-0.177857300266215 1.90119125961188 0.995895769538786 +0.35914818712455 2.31920052987544 -0.937922693979931 +1.2743666522523 -0.690075814269372 0.834645084284416 +2.9302841310705 -0.642986734356231 0.000995094268308586 +-1.26975451435037 1.91229429559509 -0.955354478719998 +0.0738366615932967 1.2694977539948 -0.685198041292763 +-1.69716232712318 1.22850232281973 0.995464670669604 +0.84570997159476 2.13803629884409 -0.954183333932217 +0.352468648163491 -2.9344545563609 -0.294839028922669 +1.60389935177392 1.74998587824519 0.927507865916284 +-2.11217212504527 0.760269273860796 0.969564968832133 +1.74217621467257 2.29099479959881 0.47835741399359 +2.92346903414395 0.330804589449986 -0.33526021272958 +-2.35952494893432 0.250879618289894 -0.927901668132089 +-1.41032225684219 -0.170788763321419 0.815061677973598 +-1.01611744261575 -2.68326939535803 -0.494423710160221 +-1.59344928656495 2.26723050382079 -0.636622362537764 +-0.39580260135079 -2.90869384965014 0.35332697871175 +-1.2619469130673 -1.96838196535269 -0.941085144982828 +-1.30548566796483 1.57897857482689 0.998809944306817 +-1.35584805950535 -0.237100218600359 0.781761994033332 +2.52115787439036 1.0589742629827 0.678574394474946 +-1.95614957999606 1.84500176798258 0.724791088391566 +1.4979623349839 1.58854216289188 0.983033167483811 +-0.981146595813074 -0.312003286041912 0.241344264758116 +1.8959899672511 0.736814649744932 -0.999417494784511 +-0.757097460644456 -0.653318267664153 0.00461774302265985 +1.10316023266325 -2.54112393275506 -0.637744617153837 +-1.72022005250621 2.23190220939628 0.575364412789703 +2.94799384971966 0.358547670782175 -0.244227908472639 +-1.00994005619833 -0.0359408889344281 0.14507521649066 +1.00132300605616 0.624998791048906 0.572891974870137 +2.3085624824673 1.91312252759207 0.0591476364274699 +-1.6659611493105 -1.84465800051153 0.874183099883255 +1.04218128888347 -0.0688739697225331 0.294844086473301 +-0.601696551108497 -2.17864473742223 0.965553097225366 +1.08052048270212 2.3454565036691 0.812916093418994 +-1.79474335184654 -0.705336370592575 -0.997431127830519 +1.12310671921089 0.346525230427012 0.565643836449263 +0.696749595851333 -1.32918567757458 -0.86644723350324 +2.13602598032304 -0.51308315076563 -0.980446803768366 +-1.93196921945397 1.69157833829893 -0.823120136150302 +-2.01941018956472 0.0465497013536062 0.999801046182706 +-2.59423705179264 1.10327839008222 -0.573659802885399 +-0.585219166556388 1.2580168195987 -0.790451471385005 +-0.0576402469775295 1.41565353591293 0.812347628291534 +2.3891312946018 1.26300791722059 0.711751109733218 +2.30156990743563 0.405909870828655 0.941472642528813 +0.275589260456702 -1.00168998250037 -0.276232537275217 +-1.29248016136238 -0.876528620996052 0.898813208471374 +2.35322045727023 1.36303382650264 -0.694525299956941 +1.54876331953525 -1.90130806390003 -0.891879829401408 +0.16593187575783 1.69907888603775 0.956162102627631 +-1.52945389781439 1.36994725318236 0.998579274948504 +0.947255866427042 0.321393560626499 -0.0242347842318913 +-0.849266801325161 -1.69619250008471 -0.994673549743623 +1.17007223184327 -1.45748256057479 0.991388144859652 +-1.02065656396392 -0.234068996172272 -0.303449207922113 +-1.79030334572357 -0.338548456021292 0.984036300930214 +-0.202580788439636 -2.9098032393728 -0.399239754145888 +0.556542406671504 0.835949987061395 0.0922790328770012 +-0.192048894344178 2.82750618177242 0.551732977447003 +-2.4383233660105 1.32432593198794 -0.632262737666956 +1.00457987324054 2.2017998675896 0.907456835650233 +0.258230866817704 1.01719292156891 0.310599733745205 +-0.667635905646098 -0.747459126240117 -0.0665059738190087 +-0.925217466789865 -0.458919419892981 -0.253939651272238 +0.593031990252279 0.895690762363157 -0.37806299536721 +2.41891123803036 1.29269511281484 -0.669666978131638 +2.86198580293885 0.898401929715067 0.0252390801762425 +0.577555242801644 2.9381443296706 -0.105947290476281 +-1.08511464203043 -1.17367759499812 -0.915830310368355 +-0.00823512252879893 -2.34071693036362 0.940160678630731 +0.723355997258736 0.693575864721822 -0.0654384491946278 +-2.45564096089468 -0.108134097337387 0.888941553150783 +1.0554937129765 2.48105527060468 0.717810492633049 +0.0900114873059034 -1.35462061558498 0.766376101065206 +1.07215905411075 0.711684540080838 -0.701026091958739 +1.7642570870584 -1.10328014310579 -0.996728357140097 +-2.42237083502851 -1.22877182282345 0.69789165141999 +-2.29573991343012 1.39431631359088 -0.727611414530717 +-0.80608542331762 -0.591802110438813 -0.00185677113225586 +0.584373976640234 -1.2455966078976 -0.781316331338531 +-0.117129848865082 1.30318973566841 -0.722321820498621 +-0.427012578549237 -2.23637426000762 0.960934425748682 +1.84229944864514 -1.55651807400289 -0.911270828095356 +0.203997692272774 1.21919989241584 -0.645392194686482 +0.446215983259144 -1.74060177047245 -0.979155323351272 +-2.26029729565112 -1.9493984229134 -0.173628460146742 +-1.25890926878714 2.70615042882704 0.174571595362577 +1.56639306015901 0.363207544125242 -0.919944405133645 +-1.34865311186347 0.197323883232669 -0.77087378354129 +2.34234493513434 -1.5350786183092 0.599274108730333 +-0.128003282153838 2.84277775092986 0.533724957778819 +2.67959573383432 0.576255466056955 -0.671661470652464 +-1.22133840956565 1.75573360172354 -0.9903269014343 +-2.65079844065683 0.801278641234516 -0.638940464730991 +1.77058917671795 -1.05700903893028 -0.998069966649505 +-0.0617876530073753 2.73595305745592 -0.676273466837526 +-1.02613271221592 -0.32948466837676 0.386553542254037 +0.289216189984019 2.86987925980331 0.46670029349679 +0.0221376688554938 -1.6367078071517 0.931733618120448 +0.9880285207657 1.3702732104138 -0.95051910813202 +-2.35149763797368 -1.28585604226228 -0.733114009304653 +-0.984949657118942 -2.15300005263466 -0.929983557964422 +0.815196720196319 0.609995430318387 -0.189686296979061 +-1.36318181784209 0.682494702259896 -0.879709239261867 +-0.562439533917299 2.60180320419631 -0.749591065583496 diff --git a/src/Persistent_cohomology/example/CMakeLists.txt b/src/Persistent_cohomology/example/CMakeLists.txt index 2f94ed15..ba4c518b 100644 --- a/src/Persistent_cohomology/example/CMakeLists.txt +++ b/src/Persistent_cohomology/example/CMakeLists.txt @@ -53,10 +53,12 @@ if(GMPXX_FOUND AND GMP_FOUND) if(CGAL_FOUND) add_executable(alpha_complex_3d_persistence alpha_complex_3d_persistence.cpp) target_link_libraries(alpha_complex_3d_persistence ${Boost_SYSTEM_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES} ${CGAL_LIBRARY}) + if (TBB_FOUND) target_link_libraries(alpha_complex_3d_persistence ${TBB_RELEASE_LIBRARY}) endif() - add_test(alpha_complex_3d_persistence_2_0_5 ${CMAKE_CURRENT_BINARY_DIR}/alpha_complex_3d_persistence ${CMAKE_SOURCE_DIR}/data/points/bunny_5000 2 0.5) + add_test(alpha_complex_3d_persistence_2_0_5 ${CMAKE_CURRENT_BINARY_DIR}/alpha_complex_3d_persistence ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off 2 0.45) + if (NOT CGAL_VERSION VERSION_LESS 4.7.0) message(STATUS "CGAL version: ${CGAL_VERSION}.") @@ -65,12 +67,19 @@ if(GMPXX_FOUND AND GMP_FOUND) if (EIGEN3_FOUND) message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.") include( ${EIGEN3_USE_FILE} ) - + add_executable (alpha_complex_persistence alpha_complex_persistence.cpp) target_link_libraries(alpha_complex_persistence ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}) + + add_executable(periodic_alpha_complex_3d_persistence periodic_alpha_complex_3d_persistence.cpp) + target_link_libraries(periodic_alpha_complex_3d_persistence ${Boost_SYSTEM_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES} ${CGAL_LIBRARY}) + if (TBB_FOUND) target_link_libraries(alpha_complex_persistence ${TBB_RELEASE_LIBRARY}) + target_link_libraries(periodic_alpha_complex_3d_persistence ${TBB_RELEASE_LIBRARY}) endif() + add_test(alpha_complex_persistence_2_0_45 ${CMAKE_CURRENT_BINARY_DIR}/alpha_complex_persistence ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off -m 0.45 -p 2) + add_test(periodic_alpha_complex_3d_persistence_2_0 ${CMAKE_CURRENT_BINARY_DIR}/periodic_alpha_complex_3d_persistence ${CMAKE_SOURCE_DIR}/data/points/grid_10_10_10_in_0_1.off 2 0) else() message(WARNING "Eigen3 not found. Version 3.1.0 is required for Alpha shapes feature.") diff --git a/src/Persistent_cohomology/example/README b/src/Persistent_cohomology/example/README index 8c71ccf5..92b80c76 100644 --- a/src/Persistent_cohomology/example/README +++ b/src/Persistent_cohomology/example/README @@ -4,13 +4,13 @@ cd /path-to-example/ cmake . make - -Example of use : +*********************************************************************************************************************** +Example of use of RIPS: Computation of the persistent homology with Z/2Z coefficients of the Rips complex on points sampling a Klein bottle: -./rips_persistence ../../../data/points/Kl.txt -r 0.25 -d 3 -p 2 -m 100 +./rips_persistence ../../data/points/Kl.txt -r 0.25 -d 3 -p 2 -m 100 output: 210 0 0 inf @@ -29,7 +29,7 @@ where with Z/3Z coefficients: -./rips_persistence ../../../data/points/Kl.txt -r 0.25 -d 3 -p 3 -m 100 +./rips_persistence ../../data/points/Kl.txt -r 0.25 -d 3 -p 3 -m 100 output: 3 0 0 inf @@ -37,7 +37,7 @@ output: and the computation with Z/2Z and Z/3Z coefficients simultaneously: -./rips_multifield_persistence ../../../data/points/Kl.txt -r 0.25 -d 3 -p 2 -q 3 -m 100 +./rips_multifield_persistence ../../data/points/Kl.txt -r 0.25 -d 3 -p 2 -q 3 -m 100 output: 6 0 0 inf @@ -47,10 +47,96 @@ output: and finally the computation with all Z/pZ for 2 <= p <= 71 (20 first prime numbers): - ./rips_multifield_persistence ../../../data/points/Kl.txt -r 0.25 -d 3 -p 2 -q 71 -m 100 + ./rips_multifield_persistence ../../data/points/Kl.txt -r 0.25 -d 3 -p 2 -q 71 -m 100 output: 557940830126698960967415390 0 0 inf 557940830126698960967415390 1 0.0702103 inf 2 1 0.0702103 inf 2 2 0.159992 inf + +*********************************************************************************************************************** +Example of use of ALPHA: + +For a more verbose mode, please run cmake with option "DEBUG_TRACES=TRUE" and recompile the programs. + +1) 3D special case +------------------ +Computation of the persistent homology with Z/2Z coefficients of the alpha complex on points +sampling a torus 3D: + +./alpha_complex_3d_persistence ../../data/points/tore3D_300.off 2 0.45 + +output: +Simplex_tree dim: 3 +2 0 0 inf +2 1 0.0682162 1.0001 +2 1 0.0934117 1.00003 +2 2 0.56444 1.03938 + +Here we retrieve expected Betti numbers on a tore 3D: +Betti numbers[0] = 1 +Betti numbers[1] = 2 +Betti numbers[2] = 1 + +N.B.: alpha_complex_3d_persistence accepts only OFF files in 3D dimension. + +2) d-Dimension case +------------------- +Computation of the persistent homology with Z/2Z coefficients of the alpha complex on points +sampling a torus 3D: + +./alpha_complex_persistence -r 32 -p 2 -m 0.45 ../../data/points/tore3D_300.off + +output: +Alpha complex is of dimension 3 - 9273 simplices - 300 vertices. +Simplex_tree dim: 3 +2 0 0 inf +2 1 0.0682162 1.0001 +2 1 0.0934117 1.00003 +2 2 0.56444 1.03938 + +Here we retrieve expected Betti numbers on a tore 3D: +Betti numbers[0] = 1 +Betti numbers[1] = 2 +Betti numbers[2] = 1 + +N.B.: alpha_complex_persistence accepts OFF files in d-Dimension. + +3) 3D periodic special case +--------------------------- +./periodic_alpha_complex_3d_persistence ../../data/points/grid_10_10_10_in_0_1.off 2 0.0 + +output: +Periodic Delaunay computed. +Simplex_tree dim: 3 +2 0 0.0866025 inf +2 1 0.0866025 inf +2 1 0.0866025 inf +2 1 0.0866025 inf +2 2 0.0866025 inf +2 2 0.0866025 inf +2 2 0.0866025 inf + +N.B.: periodic_alpha_complex_3d_persistence accepts only OFF files in 3D dimension. In this example, the periodic cube +is hard coded to { x = [0,1]; y = [0,1]; z = [0,1] } + +*********************************************************************************************************************** +Example of use of PLAIN HOMOLOGY: + +This example computes the plain homology of the following simplicial complex without filtration values: + /* Complex to build. */ + /* 1 3 */ + /* o---o */ + /* /X\ / */ + /* o---o o */ + /* 2 0 4 */ + +./plain_homology + +output: +2 0 0 inf +2 0 0 inf +2 1 0 inf + +Here we retrieve the 2 entities {0,1,2,3} and {4} (Betti numbers[0] = 2) and the hole in {0,1,3} (Betti numbers[1] = 1)
\ No newline at end of file diff --git a/src/Persistent_cohomology/example/alpha_complex_3d_persistence.cpp b/src/Persistent_cohomology/example/alpha_complex_3d_persistence.cpp index 01497c7c..48fbb91a 100644 --- a/src/Persistent_cohomology/example/alpha_complex_3d_persistence.cpp +++ b/src/Persistent_cohomology/example/alpha_complex_3d_persistence.cpp @@ -20,9 +20,9 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include <gudhi/graph_simplicial_complex.h> #include <gudhi/Simplex_tree.h> #include <gudhi/Persistent_cohomology.h> +#include <gudhi/Points_3D_off_io.h> #include <boost/variant.hpp> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h> @@ -139,20 +139,18 @@ int main(int argc, char * const argv[]) { } // Read points from file - std::string filegraph = argv[1]; - std::list<Point_3> lp; - std::ifstream is(filegraph.c_str()); - int n; - is >> n; -#ifdef DEBUG_TRACES - std::cout << "Reading " << n << " points " << std::endl; -#endif // DEBUG_TRACES - Point_3 p; - for (; n > 0; n--) { - is >> p; - lp.push_back(p); + std::string offInputFile(argv[1]); + // Read the OFF file (input file name given as parameter) and triangulate points + Gudhi::Points_3D_off_reader<Point_3> off_reader(offInputFile); + // Check the read operation was correct + if (!off_reader.is_valid()) { + std::cerr << "Unable to read file " << offInputFile << std::endl; + usage(argv[0]); } + // Retrieve the triangulation + std::vector<Point_3> lp = off_reader.get_point_cloud(); + // alpha shape construction from points. CGAL has a strange behavior in REGULARIZED mode. Alpha_shape_3 as(lp.begin(), lp.end(), 0, Alpha_shape_3::GENERAL); #ifdef DEBUG_TRACES diff --git a/src/Persistent_cohomology/example/alpha_complex_persistence.cpp b/src/Persistent_cohomology/example/alpha_complex_persistence.cpp index 8f9f077c..17fb84d2 100644 --- a/src/Persistent_cohomology/example/alpha_complex_persistence.cpp +++ b/src/Persistent_cohomology/example/alpha_complex_persistence.cpp @@ -29,7 +29,7 @@ int main(int argc, char **argv) { // ---------------------------------------------------------------------------- // Init of an alpha complex from an OFF file // ---------------------------------------------------------------------------- - typedef CGAL::Epick_d< CGAL::Dynamic_dimension_tag > Kernel; + using Kernel = CGAL::Epick_d< CGAL::Dynamic_dimension_tag >; Gudhi::alphacomplex::Alpha_complex<Kernel> alpha_complex_from_file(off_file_points, alpha_square_max_value); // ---------------------------------------------------------------------------- diff --git a/src/Persistent_cohomology/example/periodic_alpha_complex_3d_persistence.cpp b/src/Persistent_cohomology/example/periodic_alpha_complex_3d_persistence.cpp new file mode 100644 index 00000000..e9425066 --- /dev/null +++ b/src/Persistent_cohomology/example/periodic_alpha_complex_3d_persistence.cpp @@ -0,0 +1,303 @@ +/* This file is part of the Gudhi Library. The Gudhi library + * (Geometric Understanding in Higher Dimensions) is a generic C++ + * library for computational topology. + * + * Author(s): Vincent Rouvreau + * + * Copyright (C) 2014 INRIA Saclay (France) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include <gudhi/Simplex_tree.h> +#include <gudhi/Persistent_cohomology.h> +#include <gudhi/Points_3D_off_io.h> +#include <boost/variant.hpp> + +#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> +#include <CGAL/Periodic_3_Delaunay_triangulation_traits_3.h> +#include <CGAL/Periodic_3_Delaunay_triangulation_3.h> +#include <CGAL/Alpha_shape_3.h> +#include <CGAL/iterator.h> + +#include <fstream> +#include <cmath> +#include <string> +#include <tuple> +#include <map> +#include <utility> +#include <list> +#include <vector> + +// Traits +using K = CGAL::Exact_predicates_inexact_constructions_kernel; +using PK = CGAL::Periodic_3_Delaunay_triangulation_traits_3<K>; +// Vertex type +using DsVb = CGAL::Periodic_3_triangulation_ds_vertex_base_3<>; +using Vb = CGAL::Triangulation_vertex_base_3<PK,DsVb>; +using AsVb = CGAL::Alpha_shape_vertex_base_3<PK,Vb>; +// Cell type +using DsCb = CGAL::Periodic_3_triangulation_ds_cell_base_3<>; +using Cb = CGAL::Triangulation_cell_base_3<PK,DsCb>; +using AsCb = CGAL::Alpha_shape_cell_base_3<PK,Cb>; +using Tds = CGAL::Triangulation_data_structure_3<AsVb,AsCb>; +using P3DT3 = CGAL::Periodic_3_Delaunay_triangulation_3<PK,Tds>; +using Alpha_shape_3 = CGAL::Alpha_shape_3<P3DT3>; +using Point_3 = PK::Point_3; + +// filtration with alpha values needed type definition +using Alpha_value_type = Alpha_shape_3::FT; +using Object = CGAL::Object; +using Dispatch = CGAL::Dispatch_output_iterator< + CGAL::cpp11::tuple<Object, Alpha_value_type>, + CGAL::cpp11::tuple<std::back_insert_iterator< std::vector<Object> >, + std::back_insert_iterator< std::vector<Alpha_value_type> > > >; +using Cell_handle = Alpha_shape_3::Cell_handle; +using Facet = Alpha_shape_3::Facet; +using Edge_3 = Alpha_shape_3::Edge; +using Vertex_list = std::list<Alpha_shape_3::Vertex_handle>; + +// gudhi type definition +using ST = Gudhi::Simplex_tree<Gudhi::Simplex_tree_options_fast_persistence>; +using Simplex_tree_vertex = ST::Vertex_handle; +using Alpha_shape_simplex_tree_map = std::map<Alpha_shape_3::Vertex_handle, Simplex_tree_vertex >; +using Alpha_shape_simplex_tree_pair = std::pair<Alpha_shape_3::Vertex_handle, Simplex_tree_vertex>; +using Simplex_tree_vector_vertex = std::vector< Simplex_tree_vertex >; +using Persistent_cohomology = Gudhi::persistent_cohomology::Persistent_cohomology< + ST, Gudhi::persistent_cohomology::Field_Zp >; + +Vertex_list from(const Cell_handle& ch) { + Vertex_list the_list; + for (auto i = 0; i < 4; i++) { +#ifdef DEBUG_TRACES + std::cout << "from cell[" << i << "]=" << ch->vertex(i)->point() << std::endl; +#endif // DEBUG_TRACES + the_list.push_back(ch->vertex(i)); + } + return the_list; +} + +Vertex_list from(const Facet& fct) { + Vertex_list the_list; + for (auto i = 0; i < 4; i++) { + if (fct.second != i) { +#ifdef DEBUG_TRACES + std::cout << "from facet=[" << i << "]" << fct.first->vertex(i)->point() << std::endl; +#endif // DEBUG_TRACES + the_list.push_back(fct.first->vertex(i)); + } + } + return the_list; +} + +Vertex_list from(const Edge_3& edg) { + Vertex_list the_list; + for (auto i = 0; i < 4; i++) { + if ((edg.second == i) || (edg.third == i)) { +#ifdef DEBUG_TRACES + std::cout << "from edge[" << i << "]=" << edg.first->vertex(i)->point() << std::endl; +#endif // DEBUG_TRACES + the_list.push_back(edg.first->vertex(i)); + } + } + return the_list; +} + +Vertex_list from(const Alpha_shape_3::Vertex_handle& vh) { + Vertex_list the_list; +#ifdef DEBUG_TRACES + std::cout << "from vertex=" << vh->point() << std::endl; +#endif // DEBUG_TRACES + the_list.push_back(vh); + return the_list; +} + +void usage(char * const progName) { + std::cerr << "Usage: " << progName << + " path_to_file_graph coeff_field_characteristic[integer > 0] min_persistence[float >= -1.0]\n"; + exit(-1); +} + +int main(int argc, char * const argv[]) { + // program args management + if (argc != 4) { + std::cerr << "Error: Number of arguments (" << argc << ") is not correct\n"; + usage(argv[0]); + } + + int coeff_field_characteristic = 0; + int returnedScanValue = sscanf(argv[2], "%d", &coeff_field_characteristic); + if ((returnedScanValue == EOF) || (coeff_field_characteristic <= 0)) { + std::cerr << "Error: " << argv[2] << " is not correct\n"; + usage(argv[0]); + } + + Filtration_value min_persistence = 0.0; + returnedScanValue = sscanf(argv[3], "%lf", &min_persistence); + if ((returnedScanValue == EOF) || (min_persistence < -1.0)) { + std::cerr << "Error: " << argv[3] << " is not correct\n"; + usage(argv[0]); + } + + // Read points from file + std::string offInputFile(argv[1]); + // Read the OFF file (input file name given as parameter) and triangulate points + Gudhi::Points_3D_off_reader<Point_3> off_reader(offInputFile); + // Check the read operation was correct + if (!off_reader.is_valid()) { + std::cerr << "Unable to read file " << offInputFile << std::endl; + usage(argv[0]); + } + + // Retrieve the triangulation + std::vector<Point_3> lp = off_reader.get_point_cloud(); + + // Define the periodic cube + P3DT3 pdt(PK::Iso_cuboid_3(0,0,0,1,1,1)); + // Heuristic for inserting large point sets (if pts is reasonably large) + pdt.insert(lp.begin(), lp.end(), true); + // As pdt won't be modified anymore switch to 1-sheeted cover if possible + if (pdt.is_triangulation_in_1_sheet()) pdt.convert_to_1_sheeted_covering(); + std::cout << "Periodic Delaunay computed." << std::endl; + + // alpha shape construction from points. CGAL has a strange behavior in REGULARIZED mode. This is the default mode + // Maybe need to set it to GENERAL mode + Alpha_shape_3 as(pdt, Alpha_shape_3::GENERAL); + + // filtration with alpha values from alpha shape + std::vector<Object> the_objects; + std::vector<Alpha_value_type> the_alpha_values; + + Dispatch disp = CGAL::dispatch_output<Object, Alpha_value_type>(std::back_inserter(the_objects), + std::back_inserter(the_alpha_values)); + + as.filtration_with_alpha_values(disp); +#ifdef DEBUG_TRACES + std::cout << "filtration_with_alpha_values returns : " << the_objects.size() << " objects" << std::endl; +#endif // DEBUG_TRACES + + Alpha_shape_3::size_type count_vertices = 0; + Alpha_shape_3::size_type count_edges = 0; + Alpha_shape_3::size_type count_facets = 0; + Alpha_shape_3::size_type count_cells = 0; + + // Loop on objects vector + Vertex_list vertex_list; + ST simplex_tree; + Alpha_shape_simplex_tree_map map_cgal_simplex_tree; + std::vector<Alpha_value_type>::iterator the_alpha_value_iterator = the_alpha_values.begin(); + int dim_max = 0; + Filtration_value filtration_max = 0.0; + for (auto object_iterator : the_objects) { + // Retrieve Alpha shape vertex list from object + if (const Cell_handle * cell = CGAL::object_cast<Cell_handle>(&object_iterator)) { + vertex_list = from(*cell); + count_cells++; + if (dim_max < 3) { + // Cell is of dim 3 + dim_max = 3; + } + } else if (const Facet * facet = CGAL::object_cast<Facet>(&object_iterator)) { + vertex_list = from(*facet); + count_facets++; + if (dim_max < 2) { + // Facet is of dim 2 + dim_max = 2; + } + } else if (const Edge_3 * edge = CGAL::object_cast<Edge_3>(&object_iterator)) { + vertex_list = from(*edge); + count_edges++; + if (dim_max < 1) { + // Edge_3 is of dim 1 + dim_max = 1; + } + } else if (const Alpha_shape_3::Vertex_handle * vertex = + CGAL::object_cast<Alpha_shape_3::Vertex_handle>(&object_iterator)) { + count_vertices++; + vertex_list = from(*vertex); + } + // Construction of the vector of simplex_tree vertex from list of alpha_shapes vertex + Simplex_tree_vector_vertex the_simplex_tree; + for (auto the_alpha_shape_vertex : vertex_list) { + Alpha_shape_simplex_tree_map::iterator the_map_iterator = map_cgal_simplex_tree.find(the_alpha_shape_vertex); + if (the_map_iterator == map_cgal_simplex_tree.end()) { + // alpha shape not found + Simplex_tree_vertex vertex = map_cgal_simplex_tree.size(); +#ifdef DEBUG_TRACES + std::cout << "vertex [" << the_alpha_shape_vertex->point() << "] not found - insert " << vertex << std::endl; +#endif // DEBUG_TRACES + the_simplex_tree.push_back(vertex); + map_cgal_simplex_tree.insert(Alpha_shape_simplex_tree_pair(the_alpha_shape_vertex, vertex)); + } else { + // alpha shape found + Simplex_tree_vertex vertex = the_map_iterator->second; +#ifdef DEBUG_TRACES + std::cout << "vertex [" << the_alpha_shape_vertex->point() << "] found in " << vertex << std::endl; +#endif // DEBUG_TRACES + the_simplex_tree.push_back(vertex); + } + } + // Construction of the simplex_tree + Filtration_value filtr = std::sqrt(*the_alpha_value_iterator); +#ifdef DEBUG_TRACES + std::cout << "filtration = " << filtr << std::endl; +#endif // DEBUG_TRACES + if (filtr > filtration_max) { + filtration_max = filtr; + } + simplex_tree.insert_simplex(the_simplex_tree, filtr); + if (the_alpha_value_iterator != the_alpha_values.end()) + ++the_alpha_value_iterator; + else + std::cout << "This shall not happen" << std::endl; + } + simplex_tree.set_filtration(filtration_max); + simplex_tree.set_dimension(dim_max); + +#ifdef DEBUG_TRACES + std::cout << "vertices \t\t" << count_vertices << std::endl; + std::cout << "edges \t\t" << count_edges << std::endl; + std::cout << "facets \t\t" << count_facets << std::endl; + std::cout << "cells \t\t" << count_cells << std::endl; + + + std::cout << "Information of the Simplex Tree: " << std::endl; + std::cout << " Number of vertices = " << simplex_tree.num_vertices() << " "; + std::cout << " Number of simplices = " << simplex_tree.num_simplices() << std::endl << std::endl; + std::cout << " Dimension = " << simplex_tree.dimension() << " "; + std::cout << " filtration = " << simplex_tree.filtration() << std::endl << std::endl; +#endif // DEBUG_TRACES + +#ifdef DEBUG_TRACES + std::cout << "Iterator on vertices: " << std::endl; + for (auto vertex : simplex_tree.complex_vertex_range()) { + std::cout << vertex << " "; + } +#endif // DEBUG_TRACES + + // Sort the simplices in the order of the filtration + simplex_tree.initialize_filtration(); + + std::cout << "Simplex_tree dim: " << simplex_tree.dimension() << std::endl; + // Compute the persistence diagram of the complex + Persistent_cohomology pcoh(simplex_tree); + // initializes the coefficient field for homology + pcoh.init_coefficients(coeff_field_characteristic); + + pcoh.compute_persistent_cohomology(min_persistence); + + pcoh.output_diagram(); + + return 0; +} diff --git a/src/common/example/CGAL_3D_points_off_reader.cpp b/src/common/example/CGAL_3D_points_off_reader.cpp new file mode 100644 index 00000000..d48bb17d --- /dev/null +++ b/src/common/example/CGAL_3D_points_off_reader.cpp @@ -0,0 +1,41 @@ +#include <gudhi/Points_3D_off_io.h> + +#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> + +#include <iostream> +#include <string> +#include <vector> + +using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel; +using Point_3 = Kernel::Point_3; + +void usage(char * const progName) { + std::cerr << "Usage: " << progName << " inputFile.off" << std::endl; + exit(-1); +} + +int main(int argc, char **argv) { + if (argc != 2) { + std::cerr << "Error: Number of arguments (" << argc << ") is not correct" << std::endl; + usage(argv[0]); + } + + std::string offInputFile(argv[1]); + // Read the OFF file (input file name given as parameter) and triangulate points + Gudhi::Points_3D_off_reader<Point_3> off_reader(offInputFile); + // Check the read operation was correct + if (!off_reader.is_valid()) { + std::cerr << "Unable to read file " << offInputFile << std::endl; + usage(argv[0]); + } + + // Retrieve the triangulation + std::vector<Point_3> point_cloud = off_reader.get_point_cloud(); + + int n {0}; + for (auto point : point_cloud) { + ++n; + std::cout << "Point[" << n << "] = (" << point[0] << ", " << point[1] << ", " << point[2] << ")\n"; + } + return 0; +} diff --git a/src/common/example/CGAL_points_off_reader.cpp b/src/common/example/CGAL_points_off_reader.cpp index 45e9f1e6..997b47c1 100644 --- a/src/common/example/CGAL_points_off_reader.cpp +++ b/src/common/example/CGAL_points_off_reader.cpp @@ -8,17 +8,19 @@ #include <string> #include <vector> -typedef CGAL::Epick_d< CGAL::Dynamic_dimension_tag > Kernel; -typedef typename Kernel::Point_d Point_d; +using Kernel = CGAL::Epick_d< CGAL::Dynamic_dimension_tag >; +using Point_d = typename Kernel::Point_d; -void usage(int argc, char * const progName) { - std::cerr << "Error: Number of arguments (" << argc << ") is not correct" << std::endl; +void usage(char * const progName) { std::cerr << "Usage: " << progName << " inputFile.off" << std::endl; exit(-1); } int main(int argc, char **argv) { - if (argc != 2) usage(argc, (argv[0] - 1)); + if (argc != 2) { + std::cerr << "Error: Number of arguments (" << argc << ") is not correct" << std::endl; + usage(argv[0]); + } std::string offInputFile(argv[1]); // Read the OFF file (input file name given as parameter) and triangulate points @@ -26,16 +28,16 @@ int main(int argc, char **argv) { // Check the read operation was correct if (!off_reader.is_valid()) { std::cerr << "Unable to read file " << offInputFile << std::endl; - exit(-1); + usage(argv[0]); } // Retrieve the triangulation std::vector<Point_d> point_cloud = off_reader.get_point_cloud(); - int n = 0; + int n {0}; for (auto point : point_cloud) { std::cout << "Point[" << n << "] = "; - for (int i = 0; i < point.dimension(); i++) + for (int i {0}; i < point.dimension(); i++) std::cout << point[i] << " "; std::cout << "\n"; ++n; diff --git a/src/common/example/CMakeLists.txt b/src/common/example/CMakeLists.txt index 5aeaa8c6..83f874e1 100644 --- a/src/common/example/CMakeLists.txt +++ b/src/common/example/CMakeLists.txt @@ -3,6 +3,10 @@ project(GUDHIDelaunayTriangulationOffFileReadWrite) # need CGAL 4.7 if(CGAL_FOUND) + add_executable ( cgal3Doffreader CGAL_3D_points_off_reader.cpp ) + target_link_libraries(cgal3Doffreader ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) + add_test(cgal3Doffreader ${CMAKE_CURRENT_BINARY_DIR}/cgal3Doffreader ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off) + if (NOT CGAL_VERSION VERSION_LESS 4.7.0) find_package(Eigen3 3.1.0) if (EIGEN3_FOUND) diff --git a/src/common/include/gudhi/Points_3D_off_io.h b/src/common/include/gudhi/Points_3D_off_io.h new file mode 100644 index 00000000..1d3b35c7 --- /dev/null +++ b/src/common/include/gudhi/Points_3D_off_io.h @@ -0,0 +1,204 @@ +/* This file is part of the Gudhi Library. The Gudhi library + * (Geometric Understanding in Higher Dimensions) is a generic C++ + * library for computational topology. + * + * Author(s): Vincent Rouvreau + * + * Copyright (C) 2015 INRIA Saclay (France) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#ifndef POINTS_3D_OFF_IO_H_ +#define POINTS_3D_OFF_IO_H_ + +#include <gudhi/Off_reader.h> + +#include <string> +#include <vector> +#include <fstream> +#include <map> + +namespace Gudhi { + +/** + * @brief OFF file visitor implementation according to Off_reader in order to read points from an OFF file. + */ +template<typename Point_3> +class Points_3D_off_visitor_reader { + private: + std::vector<Point_3> point_cloud_; + bool valid_; + + public: + + /** @brief Off_reader visitor init implementation. + * + * The init parameters are set from OFF file header. + * Dimension value is required and the value must be 3. + * + * @param[in] dim space dimension of vertices. + * @param[in] num_vertices number of vertices in the OFF file (not used). + * @param[in] num_faces number of faces in the OFF file (not used). + * @param[in] num_edges number of edges in the OFF file (not used). + */ + void init(int dim, int num_vertices, int num_faces, int num_edges) { +#ifdef DEBUG_TRACES + std::cout << "Points_3D_off_visitor_reader::init - dim=" << dim << " - num_vertices=" << + num_vertices << " - num_faces=" << num_faces << " - num_edges=" << num_edges << std::endl; +#endif // DEBUG_TRACES + if (dim == 3) { + valid_ = true; + } else { + valid_ = false; + std::cerr << "Points_3D_off_reader::Points_3D_off_reader cannot read OFF files in dimension " << dim << "\n"; + } + + if (num_faces > 0) { + std::cerr << "Points_3D_off_visitor_reader::init faces are not taken into account from OFF file for Points.\n"; + } + if (num_edges > 0) { + std::cerr << "Points_3D_off_visitor_reader::init edges are not taken into account from OFF file for Points.\n"; + } + } + + /** @brief Off_reader visitor point implementation. + * + * The point function is called on each vertex line from OFF file. + * This function inserts the vertex in the vector of points. + * + * @param[in] point vector of vertex coordinates. + * + * @details + * Point_3 must have a constructor with the following form: + * + * @code template<class InputIterator > Point_3::Point_3(double x, double y, double z) @endcode + */ + void point(const std::vector<double>& point) { + if (valid_) { +#ifdef DEBUG_TRACES + std::cout << "Points_3D_off_visitor_reader::point "; + for (auto coordinate : point) { + std::cout << coordinate << " | "; + } + std::cout << std::endl; +#endif // DEBUG_TRACES + // Fill the point cloud + point_cloud_.push_back(Point_3(point[0], point[1], point[2])); + } + } + + // Off_reader visitor maximal_face implementation - Only points are read + + void maximal_face(const std::vector<int>& face) { } + + // Off_reader visitor done implementation - Only points are read + + void done() { } + + /** @brief Point cloud getter. + * + * @return The point cloud. + */ + const std::vector<Point_3>& get_point_cloud() const { + return point_cloud_; + } + + /** @brief Returns if the OFF file read operation was successful or not. + * + * @return OFF file read status. + */ + bool is_valid() const { + return valid_; + } +}; + +/** + * \@brief OFF file reader implementation in order to read dimension 3 points from an OFF file. + * + * @details + * This class is using the Points_3D_off_visitor_reader to visit the OFF file according to Off_reader. + * + * Point_3 must have a constructor with the following form: + * + * @code template<class InputIterator > Point_3::Point_3(double x, double y, double z) @endcode + * + * @section Example + * + * This example loads points from an OFF file and builds a vector of CGAL points in dimension 3. + * Then, it is asked to display the points. + * + * @include common/CGAL_Points_3D_off_reader.cpp + * + * When launching: + * + * @code $> ./cgal3Doffreader ../../data/points/alphacomplexdoc.off + * @endcode + * + * the program output is: + * + * @include common/cgal3Doffreader_result.txt + */ +template<typename Point_3> +class Points_3D_off_reader { + public: + + /** @brief Reads the OFF file and constructs a vector of points from the points + * that are in the OFF file. + * + * @param[in] name_file OFF file to read. + * + * @post Check with is_valid() function to see if read operation was successful. + */ + Points_3D_off_reader(const std::string& name_file) + : valid_(false) { + std::ifstream stream(name_file); + if (stream.is_open()) { + Off_reader off_reader(stream); + Points_3D_off_visitor_reader<Point_3> off_visitor; + valid_ = off_reader.read(off_visitor); + valid_ = valid_ && off_visitor.is_valid(); + if (valid_) { + point_cloud = off_visitor.get_point_cloud(); + } + } else { + std::cerr << "Points_3D_off_reader::Points_3D_off_reader could not open file " << name_file << "\n"; + } + } + + /** @brief Returns if the OFF file read operation was successful or not. + * + * @return OFF file read status. + */ + bool is_valid() const { + return valid_; + } + + /** @brief Point cloud getter. + * + * @return point_cloud. + */ + const std::vector<Point_3>& get_point_cloud() const { + return point_cloud; + } + + private: + /** @brief point_cloud.*/ + std::vector<Point_3> point_cloud; + /** @brief OFF file read status.*/ + bool valid_; +}; + +} // namespace Gudhi + +#endif // POINTS_3D_OFF_IO_H_ diff --git a/src/common/include/gudhi/Points_off_io.h b/src/common/include/gudhi/Points_off_io.h index 77f36be2..74b49386 100644 --- a/src/common/include/gudhi/Points_off_io.h +++ b/src/common/include/gudhi/Points_off_io.h @@ -43,7 +43,7 @@ class Points_off_visitor_reader { /** \brief Off_reader visitor init implementation. * * The init parameters are set from OFF file header. - * Dimension value is required in order to construct Alpha complex. + * Dimension value is required in order to construct a vector of points. * * @param[in] dim space dimension of vertices. * @param[in] num_vertices number of vertices in the OFF file (not used). @@ -63,12 +63,19 @@ class Points_off_visitor_reader { } } - /** \brief Off_reader visitor point implementation. + /** @brief Off_reader visitor point implementation. * * The point function is called on each vertex line from OFF file. - * This function inserts the vertex in the Alpha complex. + * This function inserts the vertex in the vector of points. * * @param[in] point vector of vertex coordinates. + * + * @details + * Point_d must have a constructor with the following form: + * + * @code template<class InputIterator > Point_d::Point_d(int d, InputIterator first, InputIterator last) @endcode + * + * where d is the point dimension. */ void point(const std::vector<double>& point) { #ifdef DEBUG_TRACES @@ -127,7 +134,7 @@ class Points_off_visitor_reader { template<typename Point_d> class Points_off_reader { public: - /** \brief Reads the OFF file and constructs the Alpha complex from the points + /** \brief Reads the OFF file and constructs a vector of points from the points * that are in the OFF file. * * @param[in] name_file OFF file to read. |