diff --git a/Project.toml b/Project.toml index e64efa3..e3a65ab 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "NaturalNeighbours" uuid = "f16ad982-4edb-46b1-8125-78e5a8b5a9e6" authors = ["Daniel VandenHeuvel "] -version = "1.3.0" +version = "1.3.1" [deps] ChunkSplitters = "ae650224-84b6-46f8-82ea-d812ca08434e" @@ -13,7 +13,7 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" [compat] ChunkSplitters = "1.0, 2.0" -DelaunayTriangulation = "0.7, 0.8" +DelaunayTriangulation = "1.0" ElasticArrays = "1.2" PrecompileTools = "1.2" julia = "1.9" diff --git a/docs/Manifest.toml b/docs/Manifest.toml index 26e179f..7cbae11 100644 --- a/docs/Manifest.toml +++ b/docs/Manifest.toml @@ -1,6 +1,6 @@ # This file is machine-generated - editing it directly is not advised -julia_version = "1.10.0-rc2" +julia_version = "1.10.3" manifest_format = "2.0" project_hash = "28d4e6c4beb94e8828d4c619db8508ca28134d66" @@ -9,21 +9,16 @@ git-tree-sha1 = "574baf8110975760d391c710b6341da1afa48d8c" uuid = "a4c015fc-c6ff-483c-b24f-f7ea428134e9" version = "0.0.1" -[[deps.AbstractLattices]] -git-tree-sha1 = "222ee9e50b98f51b5d78feb93dd928880df35f06" -uuid = "398f06c4-4d28-53ec-89ca-5b2656b7603d" -version = "0.3.0" - [[deps.AbstractTrees]] -git-tree-sha1 = "faa260e4cb5aba097a73fab382dd4b5819d8ec8c" +git-tree-sha1 = "2d9c9a55f9c93e8887ad391fbae72f8ef55e1177" uuid = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" -version = "0.4.4" +version = "0.4.5" [[deps.Adapt]] deps = ["LinearAlgebra", "Requires"] -git-tree-sha1 = "02f731463748db57cc2ebfbd9fbc9ce8280d3433" +git-tree-sha1 = "6a55b747d1812e699320963ffde36f1ebdda4099" uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" -version = "3.7.1" +version = "4.0.4" weakdeps = ["StaticArrays"] [deps.Adapt.extensions] @@ -33,28 +28,6 @@ weakdeps = ["StaticArrays"] uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" version = "1.1.1" -[[deps.ArrayInterface]] -deps = ["Adapt", "LinearAlgebra", "Requires", "SparseArrays", "SuiteSparse"] -git-tree-sha1 = "247efbccf92448be332d154d6ca56b9fcdd93c31" -uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" -version = "7.6.1" - - [deps.ArrayInterface.extensions] - ArrayInterfaceBandedMatricesExt = "BandedMatrices" - ArrayInterfaceBlockBandedMatricesExt = "BlockBandedMatrices" - ArrayInterfaceCUDAExt = "CUDA" - ArrayInterfaceGPUArraysCoreExt = "GPUArraysCore" - ArrayInterfaceStaticArraysCoreExt = "StaticArraysCore" - ArrayInterfaceTrackerExt = "Tracker" - - [deps.ArrayInterface.weakdeps] - BandedMatrices = "aae01518-5342-5314-be14-df237901396f" - BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0" - CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" - GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527" - StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" - Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" - [[deps.Artifacts]] uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" @@ -66,52 +39,29 @@ git-tree-sha1 = "2dc09997850d68179b69dafb58ae806167a32b1b" uuid = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35" version = "0.1.8" -[[deps.CRlibm]] -deps = ["CRlibm_jll"] -git-tree-sha1 = "32abd86e3c2025db5172aa182b982debed519834" -uuid = "96374032-68de-5a5b-8d9e-752f78720389" -version = "1.0.1" - [[deps.CRlibm_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] git-tree-sha1 = "e329286945d0cfc04456972ea732551869af1cfc" uuid = "4e9b3aee-d8a1-5a3d-ad8b-7d824db253f0" version = "1.0.1+0" -[[deps.Calculus]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "f641eb0a4f00c343bbc32346e1217b86f3ce9dad" -uuid = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9" -version = "0.5.1" - [[deps.ChunkSplitters]] -deps = ["TestItems"] -git-tree-sha1 = "a0d0d0372dbc00735bce1976928094acedfdbf8e" +deps = ["Compat", "TestItems"] +git-tree-sha1 = "c7962ce1b964bde2867808235d1c521781df191e" uuid = "ae650224-84b6-46f8-82ea-d812ca08434e" -version = "2.0.3" +version = "2.4.2" [[deps.CodecZlib]] deps = ["TranscodingStreams", "Zlib_jll"] -git-tree-sha1 = "cd67fc487743b2f0fd4380d4cbd3a24660d0eec8" +git-tree-sha1 = "59939d8a997469ee05c4b4944560a820f9ba0d73" uuid = "944b1d66-785c-5afd-91f1-9de20f533193" -version = "0.7.3" - -[[deps.Combinatorics]] -git-tree-sha1 = "08c8b6831dc00bfea825826be0bc8336fc369860" -uuid = "861a8166-3701-5b0c-9a16-15d98fcdc6aa" -version = "1.0.2" - -[[deps.CommonSubexpressions]] -deps = ["MacroTools", "Test"] -git-tree-sha1 = "7b8a93dba8af7e3b42fecabf646260105ac373f7" -uuid = "bbf7d656-a473-5ed7-a52c-81e309532950" -version = "0.3.0" +version = "0.7.4" [[deps.Compat]] -deps = ["UUIDs"] -git-tree-sha1 = "886826d76ea9e72b35fcd000e535588f7b60f21d" +deps = ["TOML", "UUIDs"] +git-tree-sha1 = "b1c55339b7c6c350ee89f2c1604299660525b248" uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "4.10.1" +version = "4.15.0" weakdeps = ["Dates", "LinearAlgebra"] [deps.Compat.extensions] @@ -120,80 +70,23 @@ weakdeps = ["Dates", "LinearAlgebra"] [[deps.CompilerSupportLibraries_jll]] deps = ["Artifacts", "Libdl"] uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" -version = "1.0.5+1" +version = "1.1.1+0" [[deps.ConcurrentUtilities]] deps = ["Serialization", "Sockets"] -git-tree-sha1 = "8cfa272e8bdedfa88b6aefbbca7c19f1befac519" +git-tree-sha1 = "6cbbd4d241d7e6579ab354737f4dd95ca43946e1" uuid = "f0e56b4a-5159-44fe-b623-3e5288b988bb" -version = "2.3.0" - -[[deps.ConstructionBase]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "c53fc348ca4d40d7b371e71fd52251839080cbc9" -uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9" -version = "1.5.4" - - [deps.ConstructionBase.extensions] - ConstructionBaseIntervalSetsExt = "IntervalSets" - ConstructionBaseStaticArraysExt = "StaticArrays" - - [deps.ConstructionBase.weakdeps] - IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953" - StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" - -[[deps.DataAPI]] -git-tree-sha1 = "8da84edb865b0b5b0100c0666a9bc9a0b71c553c" -uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" -version = "1.15.0" - -[[deps.DataStructures]] -deps = ["Compat", "InteractiveUtils", "OrderedCollections"] -git-tree-sha1 = "3dbd312d370723b6bb43ba9d02fc36abade4518d" -uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" -version = "0.18.15" +version = "2.4.1" [[deps.Dates]] deps = ["Printf"] uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" [[deps.DelaunayTriangulation]] -deps = ["DataStructures", "EnumX", "ExactPredicates", "Random", "SimpleGraphs"] -git-tree-sha1 = "26eb8e2331b55735c3d305d949aabd7363f07ba7" +deps = ["EnumX", "ExactPredicates", "Random"] +git-tree-sha1 = "3be245211e1a8d12d4579d4b79f51208a594fc93" uuid = "927a84f5-c5f4-47a5-9785-b46e178433df" -version = "0.8.11" - -[[deps.DiffResults]] -deps = ["StaticArraysCore"] -git-tree-sha1 = "782dd5f4561f5d267313f23853baaaa4c52ea621" -uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5" -version = "1.1.0" - -[[deps.DiffRules]] -deps = ["IrrationalConstants", "LogExpFunctions", "NaNMath", "Random", "SpecialFunctions"] -git-tree-sha1 = "23163d55f885173722d1e4cf0f6110cdbaf7e272" -uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" -version = "1.15.1" - -[[deps.Distributed]] -deps = ["Random", "Serialization", "Sockets"] -uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" - -[[deps.Distributions]] -deps = ["FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SpecialFunctions", "Statistics", "StatsAPI", "StatsBase", "StatsFuns"] -git-tree-sha1 = "a6c00f894f24460379cb7136633cef54ac9f6f4a" -uuid = "31c24e10-a181-5473-b8eb-7969acd0382f" -version = "0.25.103" - - [deps.Distributions.extensions] - DistributionsChainRulesCoreExt = "ChainRulesCore" - DistributionsDensityInterfaceExt = "DensityInterface" - DistributionsTestExt = "Test" - - [deps.Distributions.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - DensityInterface = "b429d917-457f-4dbc-8f4c-0cc954292b1d" - Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" +version = "1.0.2" [[deps.DocStringExtensions]] deps = ["LibGit2"] @@ -202,113 +95,54 @@ uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" version = "0.9.3" [[deps.Documenter]] -deps = ["ANSIColoredPrinters", "AbstractTrees", "Base64", "Dates", "DocStringExtensions", "Downloads", "Git", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "MarkdownAST", "Pkg", "PrecompileTools", "REPL", "RegistryInstances", "SHA", "Test", "Unicode"] -git-tree-sha1 = "2613dbec8f4748273bbe30ba71fd5cb369966bac" +deps = ["ANSIColoredPrinters", "AbstractTrees", "Base64", "CodecZlib", "Dates", "DocStringExtensions", "Downloads", "Git", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "MarkdownAST", "Pkg", "PrecompileTools", "REPL", "RegistryInstances", "SHA", "TOML", "Test", "Unicode"] +git-tree-sha1 = "5461b2a67beb9089980e2f8f25145186b6d34f91" uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4" -version = "1.2.1" +version = "1.4.1" [[deps.DocumenterTools]] deps = ["AbstractTrees", "Base64", "DocStringExtensions", "Documenter", "FileWatching", "Gumbo", "LibGit2", "OpenSSH_jll", "Sass"] -git-tree-sha1 = "37402c74604d89c94593bc74b3e1ca597494a804" +git-tree-sha1 = "7605a88f75625836ce47102b8915041fae231ff5" uuid = "35a29f4d-8980-5a13-9543-d66fff28ecb8" -version = "0.1.18" +version = "0.1.19" [[deps.Downloads]] deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" version = "1.6.0" -[[deps.DualNumbers]] -deps = ["Calculus", "NaNMath", "SpecialFunctions"] -git-tree-sha1 = "5837a837389fccf076445fce071c8ddaea35a566" -uuid = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74" -version = "0.6.8" - [[deps.ElasticArrays]] deps = ["Adapt"] -git-tree-sha1 = "e1c40d78de68e9a2be565f0202693a158ec9ad85" +git-tree-sha1 = "75e5697f521c9ab89816d3abeea806dfc5afb967" uuid = "fdbdab4c-e67f-52f5-8c3f-e7b388dad3d4" -version = "1.2.11" +version = "1.2.12" [[deps.EnumX]] git-tree-sha1 = "bdb1942cd4c45e3c678fd11569d5cccd80976237" uuid = "4e289a0a-7415-4d19-859d-a7e5c4648b56" version = "1.0.4" -[[deps.ErrorfreeArithmetic]] -git-tree-sha1 = "d6863c556f1142a061532e79f611aa46be201686" -uuid = "90fa49ef-747e-5e6f-a989-263ba693cf1a" -version = "0.5.2" - [[deps.ExactPredicates]] -deps = ["IntervalArithmetic", "Random", "StaticArraysCore"] -git-tree-sha1 = "499b1ca78f6180c8f8bdf1cabde2d39120229e5c" +deps = ["IntervalArithmetic", "Random", "StaticArrays"] +git-tree-sha1 = "b3f2ff58735b5f024c392fde763f29b057e4b025" uuid = "429591f6-91af-11e9-00e2-59fbe8cec110" -version = "2.2.6" +version = "2.2.8" [[deps.ExceptionUnwrapping]] deps = ["Test"] -git-tree-sha1 = "e90caa41f5a86296e014e148ee061bd6c3edec96" +git-tree-sha1 = "dcb08a0d93ec0b1cdc4af184b26b591e9695423a" uuid = "460bff9d-24e4-43bc-9d9f-a8973cb893f4" -version = "0.1.9" +version = "0.1.10" [[deps.Expat_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "4558ab818dcceaab612d1bb8c19cee87eda2b83c" +git-tree-sha1 = "1c6317308b9dc757616f0b5cb379db10494443a7" uuid = "2e619515-83b5-522b-bb60-26c02a35a201" -version = "2.5.0+0" - -[[deps.FastRounding]] -deps = ["ErrorfreeArithmetic", "LinearAlgebra"] -git-tree-sha1 = "6344aa18f654196be82e62816935225b3b9abe44" -uuid = "fa42c844-2597-5d31-933b-ebd51ab2693f" -version = "0.3.1" +version = "2.6.2+0" [[deps.FileWatching]] uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" -[[deps.FillArrays]] -deps = ["LinearAlgebra", "Random"] -git-tree-sha1 = "01dba5dbad6b2766e2ddd7b9d64af0e6d68d95cd" -uuid = "1a297f60-69ca-5386-bcde-b61e274b549b" -version = "1.9.1" -weakdeps = ["PDMats", "SparseArrays", "Statistics"] - - [deps.FillArrays.extensions] - FillArraysPDMatsExt = "PDMats" - FillArraysSparseArraysExt = "SparseArrays" - FillArraysStatisticsExt = "Statistics" - -[[deps.FiniteDiff]] -deps = ["ArrayInterface", "LinearAlgebra", "Requires", "Setfield", "SparseArrays"] -git-tree-sha1 = "c6e4a1fbe73b31a3dea94b1da449503b8830c306" -uuid = "6a86dc24-6348-571c-b903-95158fe2bd41" -version = "2.21.1" - - [deps.FiniteDiff.extensions] - FiniteDiffBandedMatricesExt = "BandedMatrices" - FiniteDiffBlockBandedMatricesExt = "BlockBandedMatrices" - FiniteDiffStaticArraysExt = "StaticArrays" - - [deps.FiniteDiff.weakdeps] - BandedMatrices = "aae01518-5342-5314-be14-df237901396f" - BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0" - StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" - -[[deps.ForwardDiff]] -deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "LinearAlgebra", "LogExpFunctions", "NaNMath", "Preferences", "Printf", "Random", "SpecialFunctions"] -git-tree-sha1 = "cf0fe81336da9fb90944683b8c41984b08793dad" -uuid = "f6369f11-7733-5829-9624-2563aa707210" -version = "0.10.36" -weakdeps = ["StaticArrays"] - - [deps.ForwardDiff.extensions] - ForwardDiffStaticArraysExt = "StaticArrays" - -[[deps.Future]] -deps = ["Random"] -uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820" - [[deps.Git]] deps = ["Git_jll"] git-tree-sha1 = "51764e6c2e84c37055e846c516e9015b4a291c7d" @@ -335,46 +169,35 @@ version = "0.10.2+0" [[deps.HTTP]] deps = ["Base64", "CodecZlib", "ConcurrentUtilities", "Dates", "ExceptionUnwrapping", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"] -git-tree-sha1 = "abbbb9ec3afd783a7cbd82ef01dcd088ea051398" +git-tree-sha1 = "2c3ec1f90bb4a8f7beafb0cffea8a4c3f4e636ab" uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" -version = "1.10.1" - -[[deps.HypergeometricFunctions]] -deps = ["DualNumbers", "LinearAlgebra", "OpenLibm_jll", "SpecialFunctions"] -git-tree-sha1 = "f218fe3736ddf977e0e772bc9a586b2383da2685" -uuid = "34004b35-14d8-5ef3-9330-4cdb6864b03a" -version = "0.3.23" +version = "1.10.6" [[deps.IOCapture]] deps = ["Logging", "Random"] -git-tree-sha1 = "d75853a0bdbfb1ac815478bacd89cd27b550ace6" +git-tree-sha1 = "8b72179abc660bfab5e28472e019392b97d0985c" uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89" -version = "0.2.3" - -[[deps.IntegerMathUtils]] -git-tree-sha1 = "b8ffb903da9f7b8cf695a8bead8e01814aa24b30" -uuid = "18e54dd8-cb9d-406c-a71d-865a43cbb235" -version = "0.1.2" +version = "0.2.4" [[deps.InteractiveUtils]] deps = ["Markdown"] uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" [[deps.IntervalArithmetic]] -deps = ["CRlibm", "EnumX", "FastRounding", "LinearAlgebra", "Markdown", "Random", "RecipesBase", "RoundingEmulator", "SetRounding", "StaticArrays"] -git-tree-sha1 = "f59e639916283c1d2e106d2b00910b50f4dab76c" +deps = ["CRlibm_jll", "MacroTools", "RoundingEmulator"] +git-tree-sha1 = "23ddd329f4a2a65c7a55b91553b60849bd038575" uuid = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253" -version = "0.21.2" +version = "0.22.11" -[[deps.IrrationalConstants]] -git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2" -uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" -version = "0.2.2" + [deps.IntervalArithmetic.extensions] + IntervalArithmeticDiffRulesExt = "DiffRules" + IntervalArithmeticForwardDiffExt = "ForwardDiff" + IntervalArithmeticRecipesBaseExt = "RecipesBase" -[[deps.IterTools]] -git-tree-sha1 = "4ced6667f9974fc5c5943fa5e2ef1ca43ea9e450" -uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e" -version = "1.8.0" + [deps.IntervalArithmetic.weakdeps] + DiffRules = "b552c78f-8df3-52c6-915a-8e097449b14b" + ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" + RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" [[deps.JLLWrappers]] deps = ["Artifacts", "Preferences"] @@ -426,49 +249,15 @@ git-tree-sha1 = "f9557a255370125b405568f9767d6d195822a175" uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531" version = "1.17.0+0" -[[deps.LightXML]] -deps = ["Libdl", "XML2_jll"] -git-tree-sha1 = "3a994404d3f6709610701c7dabfc03fed87a81f8" -uuid = "9c8b4983-aa76-5018-a973-4c85ecc9e179" -version = "0.9.1" - -[[deps.LineSearches]] -deps = ["LinearAlgebra", "NLSolversBase", "NaNMath", "Parameters", "Printf"] -git-tree-sha1 = "7bbea35cec17305fc70a0e5b4641477dc0789d9d" -uuid = "d3d80556-e9d4-5f37-9878-2ab0fcc64255" -version = "7.2.0" - [[deps.LinearAlgebra]] deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" -[[deps.LinearAlgebraX]] -deps = ["LinearAlgebra", "Mods", "Permutations", "Primes", "SimplePolynomials"] -git-tree-sha1 = "89ed93300377e0742ae8a7423f7543c8f5eb73a4" -uuid = "9b3f67b0-2d00-526e-9884-9e4938f8fb88" -version = "0.2.5" - [[deps.LiveServer]] deps = ["HTTP", "LoggingExtras", "MIMEs", "Pkg", "Sockets", "Test"] -git-tree-sha1 = "24d05efe53436b22a42bf2ae459f47c48b0c2603" +git-tree-sha1 = "1e46b873b8ef176e23ee43f96e72cd45c20bafb4" uuid = "16fef848-5104-11e9-1b77-fb7a48bbb589" -version = "1.2.7" - -[[deps.LogExpFunctions]] -deps = ["DocStringExtensions", "IrrationalConstants", "LinearAlgebra"] -git-tree-sha1 = "7d6dd4e9212aebaeed356de34ccf262a3cd415aa" -uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" -version = "0.3.26" - - [deps.LogExpFunctions.extensions] - LogExpFunctionsChainRulesCoreExt = "ChainRulesCore" - LogExpFunctionsChangesOfVariablesExt = "ChangesOfVariables" - LogExpFunctionsInverseFunctionsExt = "InverseFunctions" - - [deps.LogExpFunctions.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - ChangesOfVariables = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0" - InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112" +version = "1.3.1" [[deps.Logging]] uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" @@ -486,9 +275,9 @@ version = "0.1.4" [[deps.MacroTools]] deps = ["Markdown", "Random"] -git-tree-sha1 = "9ee1618cbf5240e6d4e0371d6f24065083f60c48" +git-tree-sha1 = "2fa9ee3e63fd3a4f7a9a4f4744a52f4856de82df" uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" -version = "0.5.11" +version = "0.5.13" [[deps.Markdown]] deps = ["Base64"] @@ -511,41 +300,13 @@ deps = ["Artifacts", "Libdl"] uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" version = "2.28.2+1" -[[deps.Missings]] -deps = ["DataAPI"] -git-tree-sha1 = "f66bdc5de519e8f8ae43bdc598782d35a25b1272" -uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28" -version = "1.1.0" - [[deps.Mmap]] uuid = "a63ad114-7e13-5084-954f-fe012c677804" -[[deps.Mods]] -git-tree-sha1 = "c703557e9194fce2417b6afc3e1f0318213c401a" -uuid = "7475f97c-0381-53b1-977b-4c60186c8d62" -version = "2.1.0" - [[deps.MozillaCACerts_jll]] uuid = "14a3606d-f60d-562e-9121-12d972cd8159" version = "2023.1.10" -[[deps.Multisets]] -git-tree-sha1 = "8d852646862c96e226367ad10c8af56099b4047e" -uuid = "3b2b4ff1-bcff-5658-a3ee-dbcf1ce5ac09" -version = "0.4.4" - -[[deps.NLSolversBase]] -deps = ["DiffResults", "Distributed", "FiniteDiff", "ForwardDiff"] -git-tree-sha1 = "a0b464d183da839699f4c79e7606d9d186ec172c" -uuid = "d41bc354-129a-5804-8e4c-c37616107c6c" -version = "7.8.3" - -[[deps.NaNMath]] -deps = ["OpenLibm_jll"] -git-tree-sha1 = "0877504529a3e5c3343c6f8b4c0381e57e4387e4" -uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" -version = "1.0.2" - [[deps.NaturalNeighbours]] deps = ["ChunkSplitters", "DelaunayTriangulation", "ElasticArrays", "LinearAlgebra", "PrecompileTools", "Random"] path = ".." @@ -559,12 +320,7 @@ version = "1.2.0" [[deps.OpenBLAS_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" -version = "0.3.23+2" - -[[deps.OpenLibm_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "05823500-19ac-5b8b-9628-191a04bc5112" -version = "0.8.1+2" +version = "0.3.23+4" [[deps.OpenSSH_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "OpenSSL_jll", "Pkg", "Zlib_jll"] @@ -574,9 +330,9 @@ version = "8.9.0+1" [[deps.OpenSSL]] deps = ["BitFlags", "Dates", "MozillaCACerts_jll", "OpenSSL_jll", "Sockets"] -git-tree-sha1 = "51901a49222b09e3743c65b8847687ae5fc78eb2" +git-tree-sha1 = "38cb508d080d21dc1128f7fb04f20387ed4c0af4" uuid = "4d8831e6-92b7-49fb-bdf8-b643e874388c" -version = "1.4.1" +version = "1.4.3" [[deps.OpenSSL_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -584,109 +340,38 @@ git-tree-sha1 = "a12e56c72edee3ce6b96667745e6cbbe5498f200" uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" version = "1.1.23+0" -[[deps.OpenSpecFun_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1" -uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" -version = "0.5.5+0" - -[[deps.Optim]] -deps = ["Compat", "FillArrays", "ForwardDiff", "LineSearches", "LinearAlgebra", "NLSolversBase", "NaNMath", "Parameters", "PositiveFactorizations", "Printf", "SparseArrays", "StatsBase"] -git-tree-sha1 = "01f85d9269b13fedc61e63cc72ee2213565f7a72" -uuid = "429524aa-4258-5aef-a3af-852621145aeb" -version = "1.7.8" - -[[deps.OrderedCollections]] -git-tree-sha1 = "dfdf5519f235516220579f949664f1bf44e741c5" -uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" -version = "1.6.3" - [[deps.PCRE2_jll]] deps = ["Artifacts", "Libdl"] uuid = "efcefdf7-47ab-520b-bdef-62a2eaa19f15" version = "10.42.0+1" -[[deps.PDMats]] -deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse"] -git-tree-sha1 = "4e5be6bb265d33669f98eb55d2a57addd1eeb72c" -uuid = "90014a1f-27ba-587c-ab20-58faa44d9150" -version = "0.11.30" - -[[deps.Parameters]] -deps = ["OrderedCollections", "UnPack"] -git-tree-sha1 = "34c0e9ad262e5f7fc75b10a9952ca7692cfc5fbe" -uuid = "d96e819e-fc66-5662-9728-84c9c7592b0a" -version = "0.12.3" - [[deps.Parsers]] deps = ["Dates", "PrecompileTools", "UUIDs"] -git-tree-sha1 = "a935806434c9d4c506ba941871b327b96d41f2bf" +git-tree-sha1 = "8489905bcdbcfac64d1daa51ca07c0d8f0283821" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "2.8.0" - -[[deps.Permutations]] -deps = ["Combinatorics", "LinearAlgebra", "Random"] -git-tree-sha1 = "c7745750b8a829bc6039b7f1f0981bcda526a946" -uuid = "2ae35dd2-176d-5d53-8349-f30d82d94d4f" -version = "0.4.19" +version = "2.8.1" [[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" version = "1.10.0" -[[deps.Polynomials]] -deps = ["LinearAlgebra", "RecipesBase", "Setfield", "SparseArrays"] -git-tree-sha1 = "a9c7a523d5ed375be3983db190f6a5874ae9286d" -uuid = "f27b6e38-b328-58d1-80ce-0feddd5e7a45" -version = "4.0.6" - - [deps.Polynomials.extensions] - PolynomialsChainRulesCoreExt = "ChainRulesCore" - PolynomialsFFTWExt = "FFTW" - PolynomialsMakieCoreExt = "MakieCore" - PolynomialsMutableArithmeticsExt = "MutableArithmetics" - - [deps.Polynomials.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341" - MakieCore = "20f20a25-4f0e-4fdf-b5d1-57303727442b" - MutableArithmetics = "d8a4904e-b15c-11e9-3269-09a3773c0cb0" - -[[deps.PositiveFactorizations]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "17275485f373e6673f7e7f97051f703ed5b15b20" -uuid = "85a6dd25-e78a-55b7-8502-1745935b8125" -version = "0.2.4" - [[deps.PrecompileTools]] deps = ["Preferences"] -git-tree-sha1 = "03b4c25b43cb84cee5c90aa9b5ea0a78fd848d2f" +git-tree-sha1 = "5aa36f7049a63a1528fe8f7c3f2113413ffd4e1f" uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" -version = "1.2.0" +version = "1.2.1" [[deps.Preferences]] deps = ["TOML"] -git-tree-sha1 = "00805cd429dcb4870060ff49ef443486c262e38e" +git-tree-sha1 = "9306f6085165d270f7e3db02af26a400d580f5c6" uuid = "21216c6a-2e73-6563-6e65-726566657250" -version = "1.4.1" - -[[deps.Primes]] -deps = ["IntegerMathUtils"] -git-tree-sha1 = "1d05623b5952aed1307bf8b43bec8b8d1ef94b6e" -uuid = "27ebfcd6-29c5-5fa9-bf4b-fb8fc14df3ae" -version = "0.5.5" +version = "1.4.3" [[deps.Printf]] deps = ["Unicode"] uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" -[[deps.QuadGK]] -deps = ["DataStructures", "LinearAlgebra"] -git-tree-sha1 = "9ebcd48c498668c7fa0e97a9cae873fbee7bfee1" -uuid = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" -version = "2.9.1" - [[deps.REPL]] deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" @@ -695,17 +380,6 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" deps = ["SHA"] uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" -[[deps.RecipesBase]] -deps = ["PrecompileTools"] -git-tree-sha1 = "5c3d09cc4f31f5fc6af001c250bf1278733100ff" -uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" -version = "1.3.4" - -[[deps.Reexport]] -git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b" -uuid = "189a3867-3050-52da-a836-e630ba90ab69" -version = "1.2.2" - [[deps.RegistryInstances]] deps = ["LazilyInitializedFields", "Pkg", "TOML", "Tar"] git-tree-sha1 = "ffd19052caf598b8653b99404058fce14828be51" @@ -718,24 +392,6 @@ git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7" uuid = "ae029012-a4dd-5104-9daa-d747884805df" version = "1.3.0" -[[deps.RingLists]] -deps = ["Random"] -git-tree-sha1 = "f39da63aa6d2d88e0c1bd20ed6a3ff9ea7171ada" -uuid = "286e9d63-9694-5540-9e3c-4e6708fa07b2" -version = "0.2.8" - -[[deps.Rmath]] -deps = ["Random", "Rmath_jll"] -git-tree-sha1 = "f65dcb5fa46aee0cf9ed6274ccbd597adc49aa7b" -uuid = "79098fc4-a85e-5d69-aa6a-4863f24498fa" -version = "0.7.1" - -[[deps.Rmath_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "6ed52fdd3382cf21947b15e8870ac0ddbff736da" -uuid = "f50d1b31-88e8-58de-be2c-1cc44531875f" -version = "0.4.0+0" - [[deps.RoundingEmulator]] git-tree-sha1 = "40b9edad2e5287e05bd413a38f61a8ff55b9557b" uuid = "5eaf0fd0-dfba-4ccb-bf02-d820a40db705" @@ -754,127 +410,33 @@ version = "0.2.0" [[deps.Serialization]] uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" -[[deps.SetRounding]] -git-tree-sha1 = "d7a25e439d07a17b7cdf97eecee504c50fedf5f6" -uuid = "3cc68bcd-71a2-5612-b932-767ffbe40ab0" -version = "0.2.1" - -[[deps.Setfield]] -deps = ["ConstructionBase", "Future", "MacroTools", "StaticArraysCore"] -git-tree-sha1 = "e2cc6d8c88613c05e1defb55170bf5ff211fbeac" -uuid = "efcf1570-3423-57d1-acb7-fd33fddbac46" -version = "1.1.1" - [[deps.SimpleBufferStream]] git-tree-sha1 = "874e8867b33a00e784c8a7e4b60afe9e037b74e1" uuid = "777ac1f9-54b0-4bf8-805c-2214025038e7" version = "1.1.0" -[[deps.SimpleGraphs]] -deps = ["AbstractLattices", "Combinatorics", "DataStructures", "IterTools", "LightXML", "LinearAlgebra", "LinearAlgebraX", "Optim", "Primes", "Random", "RingLists", "SimplePartitions", "SimplePolynomials", "SimpleRandom", "SparseArrays", "Statistics"] -git-tree-sha1 = "f65caa24a622f985cc341de81d3f9744435d0d0f" -uuid = "55797a34-41de-5266-9ec1-32ac4eb504d3" -version = "0.8.6" - -[[deps.SimplePartitions]] -deps = ["AbstractLattices", "DataStructures", "Permutations"] -git-tree-sha1 = "e9330391d04241eafdc358713b48396619c83bcb" -uuid = "ec83eff0-a5b5-5643-ae32-5cbf6eedec9d" -version = "0.3.1" - -[[deps.SimplePolynomials]] -deps = ["Mods", "Multisets", "Polynomials", "Primes"] -git-tree-sha1 = "7063828369cafa93f3187b3d0159f05582011405" -uuid = "cc47b68c-3164-5771-a705-2bc0097375a0" -version = "0.2.17" - -[[deps.SimpleRandom]] -deps = ["Distributions", "LinearAlgebra", "Random"] -git-tree-sha1 = "3a6fb395e37afab81aeea85bae48a4db5cd7244a" -uuid = "a6525b86-64cd-54fa-8f65-62fc48bdc0e8" -version = "0.3.1" - [[deps.Sockets]] uuid = "6462fe0b-24de-5631-8697-dd941f90decc" -[[deps.SortingAlgorithms]] -deps = ["DataStructures"] -git-tree-sha1 = "5165dfb9fd131cf0c6957a3a7605dede376e7b63" -uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c" -version = "1.2.0" - -[[deps.SparseArrays]] -deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] -uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" -version = "1.10.0" - -[[deps.SpecialFunctions]] -deps = ["IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] -git-tree-sha1 = "e2cfc4012a19088254b3950b85c3c1d8882d864d" -uuid = "276daf66-3868-5448-9aa4-cd146d93841b" -version = "2.3.1" - - [deps.SpecialFunctions.extensions] - SpecialFunctionsChainRulesCoreExt = "ChainRulesCore" - - [deps.SpecialFunctions.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - [[deps.StaticArrays]] deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore"] -git-tree-sha1 = "5ef59aea6f18c25168842bded46b16662141ab87" +git-tree-sha1 = "bf074c045d3d5ffd956fa0a461da38a44685d6b2" uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.7.0" -weakdeps = ["Statistics"] +version = "1.9.3" [deps.StaticArrays.extensions] + StaticArraysChainRulesCoreExt = "ChainRulesCore" StaticArraysStatisticsExt = "Statistics" + [deps.StaticArrays.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" + [[deps.StaticArraysCore]] git-tree-sha1 = "36b3d696ce6366023a0ea192b4cd442268995a0d" uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" version = "1.4.2" -[[deps.Statistics]] -deps = ["LinearAlgebra", "SparseArrays"] -uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" -version = "1.10.0" - -[[deps.StatsAPI]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "1ff449ad350c9c4cbc756624d6f8a8c3ef56d3ed" -uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0" -version = "1.7.0" - -[[deps.StatsBase]] -deps = ["DataAPI", "DataStructures", "LinearAlgebra", "LogExpFunctions", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"] -git-tree-sha1 = "1d77abd07f617c4868c33d4f5b9e1dbb2643c9cf" -uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" -version = "0.34.2" - -[[deps.StatsFuns]] -deps = ["HypergeometricFunctions", "IrrationalConstants", "LogExpFunctions", "Reexport", "Rmath", "SpecialFunctions"] -git-tree-sha1 = "f625d686d5a88bcd2b15cd81f18f98186fdc0c9a" -uuid = "4c63d2b9-4356-54db-8cca-17b64c39e42c" -version = "1.3.0" - - [deps.StatsFuns.extensions] - StatsFunsChainRulesCoreExt = "ChainRulesCore" - StatsFunsInverseFunctionsExt = "InverseFunctions" - - [deps.StatsFuns.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112" - -[[deps.SuiteSparse]] -deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"] -uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" - -[[deps.SuiteSparse_jll]] -deps = ["Artifacts", "Libdl", "Pkg", "libblastrampoline_jll"] -uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" -version = "7.2.1+1" - [[deps.TOML]] deps = ["Dates"] uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" @@ -895,9 +457,9 @@ uuid = "1c621080-faea-4a02-84b6-bbd5e436b8fe" version = "0.1.1" [[deps.TranscodingStreams]] -git-tree-sha1 = "1fbeaaca45801b4ba17c251dd8603ef24801dd84" +git-tree-sha1 = "5d54d076465da49d6746c647022f3b3674e64156" uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" -version = "0.10.2" +version = "0.10.8" weakdeps = ["Random", "Test"] [deps.TranscodingStreams.extensions] @@ -912,20 +474,9 @@ version = "1.5.1" deps = ["Random", "SHA"] uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" -[[deps.UnPack]] -git-tree-sha1 = "387c1f73762231e86e0c9c5443ce3b4a0a9a0c2b" -uuid = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" -version = "1.0.2" - [[deps.Unicode]] uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" -[[deps.XML2_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Zlib_jll"] -git-tree-sha1 = "da69178aacc095066bad1f69d2f59a60a1dd8ad1" -uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a" -version = "2.12.0+0" - [[deps.Zlib_jll]] deps = ["Libdl"] uuid = "83775a58-1f1d-513f-b197-d71354ab007a" diff --git a/docs/src/compare.md b/docs/src/compare.md index b6b6974..10e4e54 100644 --- a/docs/src/compare.md +++ b/docs/src/compare.md @@ -69,7 +69,7 @@ yq = vec([y for _ in xg2, y in yg2]) tol = 1e-2 tri = triangulate([x'; y']; rng=rng) triq = triangulate([xq'; yq']; rng=rng) -exterior_idx = identify_exterior_points(xq, yq, get_points(tri), get_convex_hull_indices(tri); tol=tol) +exterior_idx = identify_exterior_points(xq, yq, get_points(tri), get_convex_hull_vertices(tri); tol=tol) interior_idx = filter(∉(exterior_idx), eachindex(xq, yq)) ``` @@ -585,7 +585,7 @@ function random_analysis_function(nsamples, triq, xq, yq, tol, rng) [refine!(tri; max_points=npoints) for tri in tris] xs = [first.(get_points(tri)) for tri in tris] ys = [last.(get_points(tri)) for tri in tris] - exterior_idxs = [identify_exterior_points(xq, yq, get_points(tri), get_convex_hull_indices(tri); tol=tol) for tri in tris] + exterior_idxs = [identify_exterior_points(xq, yq, get_points(tri), get_convex_hull_vertices(tri); tol=tol) for tri in tris] interior_idxs = [filter(∉(exterior_idx), eachindex(xq, yq)) for exterior_idx in exterior_idxs] median_lengths = [median_edge_length(tri) for tri in tris] sortidx = sortperm(median_lengths) @@ -720,7 +720,7 @@ function running_time_analysis(itp_method, m_range, g) running_times = zeros(length(m_range)) for (i, m) in enumerate(m_range) tri = circular_example(m) - z = [g(x, y) for (x, y) in each_point(tri)] + z = [g(x, y) for (x, y) in DelaunayTriangulation.each_point(tri)] itp = interpolate(tri, z; derivatives=true) b = @benchmark $itp($0.0, $0.0; method=$itp_method) running_times[i] = minimum(b.times) / 1e6 # ms @@ -777,7 +777,7 @@ x = LinRange(0, 1, 25) y = LinRange(0, 1, 25) pts = vec([(x, y) for x in x, y in y]) tri = triangulate(pts) -z = [g(x, y) for (x, y) in each_point(tri)] +z = [g(x, y) for (x, y) in DelaunayTriangulation.each_point(tri)] itp = interpolate(tri, z; derivatives = true) n = 10_000_000 xq = rand(n) diff --git a/docs/src/differentiation.md b/docs/src/differentiation.md index 2809fde..06e9d60 100644 --- a/docs/src/differentiation.md +++ b/docs/src/differentiation.md @@ -451,7 +451,7 @@ function rrmserr(z, ẑ, tri, x, y) num = 0.0 den = 0.0 points = get_point(tri) - ch = get_convex_hull_indices(tri) + ch = get_convex_hull_vertices(tri) for (zᵢ, ẑᵢ, xᵢ, yᵢ) in zip(z, ẑ, x, y) q = (xᵢ, yᵢ) δ = DelaunayTriangulation.distance_to_polygon(q, points, ch) diff --git a/docs/src/interpolation.md b/docs/src/interpolation.md index c578b69..90174ed 100644 --- a/docs/src/interpolation.md +++ b/docs/src/interpolation.md @@ -154,7 +154,7 @@ function plot_itp(fig, x, y, vals, title, i, show_data_sites, itp, xd=nothing, y c = contourf!(ax, x, y, vals, color=vals, colormap=:viridis, levels=levels, extendhigh=:auto) show_data_sites && scatter!(ax, xd, yd, color=:red, markersize=9) tri = itp.triangulation - ch_idx = get_convex_hull_indices(tri) + ch_idx = get_convex_hull_vertices(tri) lines!(ax, [get_point(tri, i) for i in ch_idx], color=:white, linewidth=4) if show_3d ax = Axis3(fig[2, i], xlabel="x", ylabel="y", zlabel=L"z", width=600, height=600, title=" ", titlealign=:left, azimuth=0.49) diff --git a/docs/src/swiss.md b/docs/src/swiss.md index e03d86a..7853ccc 100644 --- a/docs/src/swiss.md +++ b/docs/src/swiss.md @@ -194,7 +194,7 @@ function plot_results!(fig, i1, j1, i2, j2, x, y, xg, yg, vals, title1, title2, zlims!(ax, e, f) ax = Axis(fig[i2, j2], xlabel="Longitude", ylabel="Latitude", width=600, height=400, title=title2, titlealign=:left) contourf!(ax, xg, yg, reshape(vals, (nx, ny)), color=vals, levels=levels) - lines!(ax, [get_point(query_tri, i) for i in get_convex_hull_indices(query_tri)], color=:red, linewidth=4, linestyle=:dash) + lines!(ax, [get_point(query_tri, i) for i in get_convex_hull_vertices(query_tri)], color=:red, linewidth=4, linestyle=:dash) lines!(ax, ds_boundary_points, color=:white, linewidth=4) xlims!(ax, a, b) ylims!(ax, c, d) diff --git a/src/NaturalNeighbours.jl b/src/NaturalNeighbours.jl index cd8563d..a065b23 100644 --- a/src/NaturalNeighbours.jl +++ b/src/NaturalNeighbours.jl @@ -7,11 +7,9 @@ import DelaunayTriangulation: DelaunayTriangulation, InsertionEventHistory, add_point!, each_added_triangle, - indices, - initialise_event_history, Triangulation, triangulate, - is_boundary_index, + is_ghost_vertex, get_neighbours, construct_triangle, Adjacent, @@ -36,7 +34,6 @@ import DelaunayTriangulation: DelaunayTriangulation, is_collinear, has_boundary_nodes, get_triangulation, - rotate_ghost_triangle_to_standard_form, is_on, is_degenerate, point_position_relative_to_triangle, @@ -54,10 +51,14 @@ import DelaunayTriangulation: DelaunayTriangulation, jump_and_march, jump_to_voronoi_polygon, iterated_neighbourhood, + sort_triangle, + each_point, iterated_neighbourhood!, triangle_area, - get_convex_hull_indices, - get_boundary_nodes + get_convex_hull_vertices, + get_boundary_nodes, + triangle_vertices + import ChunkSplitters: chunks using ElasticArrays using LinearAlgebra @@ -97,6 +98,7 @@ include("differentiation/utils.jl") include("utils.jl") +#= using PrecompileTools @setup_workload begin @compile_workload begin @@ -121,5 +123,6 @@ using PrecompileTools end end end +=# end # module NaturalNeighbours \ No newline at end of file diff --git a/src/data_structures/derivative_cache.jl b/src/data_structures/derivative_cache.jl index d7e5162..6727de1 100644 --- a/src/data_structures/derivative_cache.jl +++ b/src/data_structures/derivative_cache.jl @@ -12,7 +12,8 @@ get_linear_matrix(cache::DerivativeCache) = cache.linear_matrix get_quadratic_matrix(cache::DerivativeCache) = cache.quadratic_matrix get_quadratic_matrix_no_cubic(cache::DerivativeCache) = cache.quadratic_matrix_no_cubic get_rhs_vector(cache::DerivativeCache) = cache.rhs_vector -function DerivativeCache(tri::Triangulation{P,Ts,I,E,Es,BN,BNM,B,BIR,BPL}) where {P,Ts,I,E,Es,BN,BNM,B,BIR,BPL} +function DerivativeCache(tri::Triangulation) + I = integer_type(tri) iterated_neighbourhood = Set{I}() second_iterated_neighbourhood = Set{I}() F = number_type(tri) diff --git a/src/data_structures/interpolant.jl b/src/data_structures/interpolant.jl index 7df035e..0e36d52 100644 --- a/src/data_structures/interpolant.jl +++ b/src/data_structures/interpolant.jl @@ -13,7 +13,7 @@ struct NaturalNeighboursInterpolant{T<:Triangulation,F,G,H,N,D} derivatives=false, kwargs... ) where {T,F} - @assert num_solid_vertices(tri) == length(z) "The number of points in the triangulation must equal the length of the data vector." + @assert num_points(tri) == length(z) "The number of points in the triangulation must equal the length of the data vector." !has_ghost_triangles(tri) && add_ghost_triangles!(tri) if has_boundary_nodes(tri) @warn "Natural neighbour interpolation is only defined over unconstrained triangulations.\nYou may find unexpected results when interpolating near the boundaries or constrained edges, and especially near non-convex boundaries or outside of the triangulation.\nIn your later evaluations of this interpolant, consider using project=false." maxlog=1 diff --git a/src/data_structures/neighbour_cache.jl b/src/data_structures/neighbour_cache.jl index e5241f9..4375728 100644 --- a/src/data_structures/neighbour_cache.jl +++ b/src/data_structures/neighbour_cache.jl @@ -12,12 +12,14 @@ get_insertion_event_history(cache::NaturalNeighboursCache) = cache.insertion_eve get_poly_points(cache::NaturalNeighboursCache) = cache.poly_points get_temp_adjacent(cache::NaturalNeighboursCache) = cache.temp_adjacent get_last_triangle(cache::NaturalNeighboursCache) = cache.last_triangle -function NaturalNeighboursCache(tri::Triangulation{P,Ts,I,E,Es,BN,BNM,B,BIR,BPL}) where {P,Ts,I,E,Es,BN,BNM,B,BIR,BPL} +function NaturalNeighboursCache(tri::Triangulation) coordinates = number_type(tri)[] + I = integer_type(tri) + E = edge_type(tri) envelope = I[] - insertion_event_history = initialise_event_history(tri) + insertion_event_history = InsertionEventHistory(tri) poly_points = NTuple{2,number_type(tri)}[] temp_adjacent = Adjacent{I,E}() - last_triangle = (Ref ∘ indices ∘ first ∘ each_solid_triangle)(tri) + last_triangle = (Ref ∘ triangle_vertices ∘ first ∘ each_solid_triangle)(tri) return NaturalNeighboursCache(coordinates, envelope, insertion_event_history, poly_points, temp_adjacent, last_triangle) end \ No newline at end of file diff --git a/src/differentiation/utils.jl b/src/differentiation/utils.jl index 12410ee..ddb60a6 100644 --- a/src/differentiation/utils.jl +++ b/src/differentiation/utils.jl @@ -22,7 +22,7 @@ function get_taylor_neighbourhood!(S, S′, tri, d, nc::NaturalCoordinates) empty!(S′) for i in envelope for j in get_neighbours(tri, i) - if !is_boundary_index(j) && j ∉ envelope + if !is_ghost_vertex(j) && j ∉ envelope push!(S′, j) end end @@ -34,7 +34,7 @@ function get_taylor_neighbourhood!(S, S′, tri, d, nc::NaturalCoordinates) empty!(S′) for i in envelope for j in get_neighbours(tri, i) - if !is_boundary_index(j) && j ∉ envelope + if !is_ghost_vertex(j) && j ∉ envelope push!(S′, j) end end @@ -42,7 +42,7 @@ function get_taylor_neighbourhood!(S, S′, tri, d, nc::NaturalCoordinates) empty!(S) for s in S′ for j in get_neighbours(tri, s) - if !is_boundary_index(j) && j ∉ envelope && j ∉ S′ + if !is_ghost_vertex(j) && j ∉ envelope && j ∉ S′ push!(S, j) end end diff --git a/src/interpolation/coordinates/laplace.jl b/src/interpolation/coordinates/laplace.jl index af95921..1d22578 100644 --- a/src/interpolation/coordinates/laplace.jl +++ b/src/interpolation/coordinates/laplace.jl @@ -1,10 +1,10 @@ function _compute_laplace_coordinates( - tri::Triangulation{P,Ts,I,E,Es,BN,BNM,B,BIR,BPL}, + tri::Triangulation, interpolation_point, - cache::NaturalNeighboursCache{F}=NaturalNeighboursCache(tri); + cache::NaturalNeighboursCache=NaturalNeighboursCache(tri); project=true, kwargs... -) where {P,Ts,I,E,Es,BN,BNM,B,BIR,BPL,F} +) coordinates = get_coordinates(cache) envelope = get_envelope(cache) insertion_event_history = get_insertion_event_history(cache) diff --git a/src/interpolation/coordinates/nearest.jl b/src/interpolation/coordinates/nearest.jl index b57c894..15ebf79 100644 --- a/src/interpolation/coordinates/nearest.jl +++ b/src/interpolation/coordinates/nearest.jl @@ -1,16 +1,16 @@ function _compute_nearest_coordinates( - tri::Triangulation{P,Ts,I,E,Es,BN,BNM,B,BIR,BPL}, + tri::Triangulation, interpolation_point, - cache::NaturalNeighboursCache{F}=NaturalNeighboursCache(tri); + cache::NaturalNeighboursCache=NaturalNeighboursCache(tri); kwargs... -) where {P,Ts,I,E,Es,BN,BNM,B,BIR,BPL,F} +) coordinates = get_coordinates(cache) envelope = get_envelope(cache) last_triangle = get_last_triangle(cache) i = jump_to_voronoi_polygon(tri, interpolation_point; try_points=last_triangle[]) resize!(coordinates, 1) resize!(envelope, 1) - coordinates[1] = one(F) + coordinates[1] = one(number_type(tri)) envelope[1] = i return NaturalCoordinates(coordinates, envelope, interpolation_point, tri) end diff --git a/src/interpolation/coordinates/sibson.jl b/src/interpolation/coordinates/sibson.jl index c51f5d6..6227792 100644 --- a/src/interpolation/coordinates/sibson.jl +++ b/src/interpolation/coordinates/sibson.jl @@ -1,11 +1,11 @@ # Our implementation of these coordinates follows https://gwlucastrig.github.io/TinfourDocs/NaturalNeighborTinfourAlgorithm/index.html with some simple modifications. function _compute_sibson_coordinates( - tri::Triangulation{P,Ts,I,E,Es,BN,BNM,B,BIR,BPL}, + tri::Triangulation, interpolation_point, - cache::NaturalNeighboursCache{F}=NaturalNeighboursCache(tri); + cache::NaturalNeighboursCache=NaturalNeighboursCache(tri); project = true, kwargs... -) where {P,Ts,I,E,Es,BN,BNM,B,BIR,BPL,F} +) coordinates = get_coordinates(cache) envelope = get_envelope(cache) insertion_event_history = get_insertion_event_history(cache) diff --git a/src/interpolation/coordinates/triangle.jl b/src/interpolation/coordinates/triangle.jl index e252fae..986347f 100644 --- a/src/interpolation/coordinates/triangle.jl +++ b/src/interpolation/coordinates/triangle.jl @@ -1,17 +1,17 @@ function _compute_triangle_coordinates( - tri::Triangulation{P,Ts,I,E,Es,BN,BNM,B,BIR,BPL}, + tri::Triangulation, interpolation_point, - cache::NaturalNeighboursCache{F}=NaturalNeighboursCache(tri); + cache::NaturalNeighboursCache=NaturalNeighboursCache(tri); project=true, kwargs... -) where {P,Ts,I,E,Es,BN,BNM,B,BIR,BPL,F} +) coordinates = get_coordinates(cache) envelope = get_envelope(cache) last_triangle = get_last_triangle(cache) V = jump_and_march(tri, interpolation_point; try_points=last_triangle[], kwargs...) i, j, return_flag = check_for_extrapolation(tri, V, interpolation_point, last_triangle) return_flag && return two_point_interpolate!(coordinates, envelope, tri, i, j, interpolation_point, project) - i, j, k = indices(V) + i, j, k = triangle_vertices(V) resize!(coordinates, 3) resize!(envelope, 3) λ₁, λ₂, λ₃ = _compute_triangle_barycentric_coordinates(tri, interpolation_point, i, j, k) diff --git a/src/interpolation/extrapolation.jl b/src/interpolation/extrapolation.jl index 4c1a469..bd6ddfe 100644 --- a/src/interpolation/extrapolation.jl +++ b/src/interpolation/extrapolation.jl @@ -32,16 +32,16 @@ end function check_for_extrapolation(tri, V, interpolation_point, last_triangle) if is_ghost_triangle(V) - V = rotate_ghost_triangle_to_standard_form(V) - i, j, _ = indices(V) + V = sort_triangle(V) + i, j, _ = sort_triangle(V) last_triangle[] = (i, j, get_adjacent(tri, j, i)) else - last_triangle[] = indices(V) + last_triangle[] = triangle_vertices(V) end F = number_type(tri) if is_boundary_triangle(tri, V) _V = replace_boundary_triangle_with_ghost_triangle(tri, V) - _u, _w, _ = indices(_V) + _u, _w, _ = triangle_vertices(_V) cert = point_position_relative_to_line(tri, _u, _w, interpolation_point) if is_collinear(cert) cert = point_position_on_line_segment(tri, _u, _w, interpolation_point) @@ -61,10 +61,10 @@ function check_for_extrapolation(tri, V, interpolation_point, last_triangle) end end if is_ghost_triangle(V) - V = rotate_ghost_triangle_to_standard_form(V) - i, j, _ = indices(V) + V = sort_triangle(V) + i, j, _ = triangle_vertices(V) return i, j, true end - i, j, _ = indices(V) + i, j, _ = triangle_vertices(V) return i, j, false end diff --git a/src/interpolation/utils.jl b/src/interpolation/utils.jl index 1c580fb..30892d0 100644 --- a/src/interpolation/utils.jl +++ b/src/interpolation/utils.jl @@ -13,7 +13,7 @@ function compute_bowyer_envelope!(envelope, tri::Triangulation, history::Inserti add_triangle!(temp_adjacent, T) end T = first(all_triangles) - i, j, _ = indices(T) + i, j, _ = triangle_vertices(T) v = i == I(n + 1) ? j : i # get a vertex on the envelope push!(envelope, v) for i in 2:num_triangles(all_triangles) @@ -27,7 +27,7 @@ function compute_bowyer_envelope!(envelope, tri::Triangulation, point; kwargs... I = integer_type(tri) E = edge_type(tri) A = Adjacent{I,E}() - return compute_bowyer_envelope!(envelope, tri, initialise_event_history(tri), A, point; kwargs...) + return compute_bowyer_envelope!(envelope, tri, InsertionEventHistory(tri), A, point; kwargs...) end function compute_bowyer_envelope(tri::Triangulation, point; kwargs...) I = integer_type(tri) @@ -35,20 +35,20 @@ function compute_bowyer_envelope(tri::Triangulation, point; kwargs...) return compute_bowyer_envelope!(envelope, tri, point; kwargs...) end -_num_points(points::Tuple) = length(points) -_num_points(points) = num_points(points) -_get_point(points::Tuple, i...) = ntuple(j->points[i[j]], length(i)) -_get_point(points, i...) = get_point(points, i...) +#_num_points(points::Tuple) = length(points) +#_num_points(points) = num_points(points) +#_get_point(points::Tuple, i...) = ntuple(j->points[i[j]], length(i)) +#_get_point(points, i...) = get_point(points, i...) function polygon_area(points) - n = _num_points(points) - p, q, r, s = _get_point(points, 1, 2, n, n - 1) + n = num_points(points) + p, q, r, s = get_point(points, 1, 2, n, n - 1) px, py = getxy(p) _, qy = getxy(q) rx, ry = getxy(r) _, sy = getxy(s) area = px * (qy - ry) + rx * (py - sy) for i in 2:(n-1) - p, q, r = _get_point(points, i, i + 1, i - 1) + p, q, r = get_point(points, i, i + 1, i - 1) px, py = getxy(p) _, qy = getxy(q) rx, ry = getxy(r) diff --git a/src/utils.jl b/src/utils.jl index 5dda2f5..b49793e 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -2,7 +2,7 @@ identify_exterior_points(x, y, points, boundary_nodes; tol = 0.0) Given a polygon described by `(points, boundary_nodes)`, matching the -specification of polygons in DelaunayTriangulation.jl (see [here](https://danielvandh.github.io/DelaunayTriangulation.jl/dev/boundary_handling/)), +specification of polygons in DelaunayTriangulation.jl, returns a vector of indices of the points defined by `(x, y)` that are outside of the polygon. Use `tol` to specify a tolerance for the distance to the polygon. @@ -35,7 +35,7 @@ function identify_exterior_points(x, y, itp::NaturalNeighboursInterpolant; tol=0 tri = get_triangulation(itp) points = get_points(tri) if !has_boundary_nodes(tri) - bn = get_convex_hull_indices(tri) + bn = get_convex_hull_vertices(tri) else bn = get_boundary_nodes(tri) end diff --git a/test/differentiation/basic_tests.jl b/test/differentiation/basic_tests.jl index 3986c52..8480344 100644 --- a/test/differentiation/basic_tests.jl +++ b/test/differentiation/basic_tests.jl @@ -20,12 +20,12 @@ include(normpath(@__DIR__, "../.", "helper_functions", "test_functions.jl")) f′ = (x, y) -> [cos(x - y) - sin(x + y), -cos(x - y) - sin(x + y)] f′′ = (x, y) -> [-sin(x - y)-cos(x + y) sin(x - y)-cos(x + y) sin(x - y)-cos(x + y) -sin(x - y)-cos(x + y)] - z = [f(x, y) for (x, y) in each_point(tri)] + z = [f(x, y) for (x, y) in DelaunayTriangulation.each_point(tri)] @testset "Direct" begin @testset "At data sites" begin flag = 0 for _ in 1:100 - i = rand(1:num_points(tri)) + i = rand(1:DelaunayTriangulation.num_points(tri)) p = get_point(tri, i) # Gradient @@ -145,7 +145,7 @@ include(normpath(@__DIR__, "../.", "helper_functions", "test_functions.jl")) f′ = (x, y) -> [cos(x - y) - sin(x + y), -cos(x - y) - sin(x + y)] f′′ = (x, y) -> [-sin(x - y)-cos(x + y) sin(x - y)-cos(x + y) sin(x - y)-cos(x + y) -sin(x - y)-cos(x + y)] - z = [f(x, y) for (x, y) in each_point(tri)] + z = [f(x, y) for (x, y) in DelaunayTriangulation.each_point(tri)] nt = Base.Threads.nthreads() derivative_caches = [NNI.DerivativeCache(tri) for _ in 1:nt] @@ -212,7 +212,7 @@ end f = (x, y) -> x^2 + y^2 + x^3 * y f′ = (x, y) -> [2x + 3x^2 * y; 2y + x^3] f′′ = (x, y) -> [2+6x*y 3x^2; 3x^2 2] - z = [f(x, y) for (x, y) in each_point(tri)] + z = [f(x, y) for (x, y) in DelaunayTriangulation.each_point(tri)] itp = interpolate(tri, z) ∂ = differentiate(itp, 2) @test_throws ArgumentError ∂(0.0, 0.0; method=Iterative()) @@ -280,7 +280,7 @@ end f = (x, y) -> x^2 + y^2 + x^3 * y f′ = (x, y) -> [2x + 3x^2 * y; 2y + x^3] f′′ = (x, y) -> [2+6x*y 3x^2; 3x^2 2] - z = [f(x, y) for (x, y) in each_point(tri)] + z = [f(x, y) for (x, y) in DelaunayTriangulation.each_point(tri)] itp = interpolate(tri, z; derivatives=true) ∂1 = differentiate(itp, 1) ∂2 = differentiate(itp, 2) @@ -301,7 +301,7 @@ end f = (x, y) -> x^2 + y^2 + x^3 * y f′ = (x, y) -> [2x + 3x^2 * y; 2y + x^3] f′′ = (x, y) -> [2+6x*y 3x^2; 3x^2 2] - z = [f(x, y) for (x, y) in each_point(tri)] + z = [f(x, y) for (x, y) in DelaunayTriangulation.each_point(tri)] itp = interpolate(tri, z; derivatives=false) ∂2 = differentiate(itp, 2) @test_throws ArgumentError("initial_gradients must be provided for iterative derivative estimation. Consider using e.g. interpolate(tri, z; derivatives = true).") ∂2(0.5, 0.5; method=Iterative()) @@ -409,7 +409,7 @@ end Herr = [norm(h1 .- h2) for (h1, h2) in zip(last.(vals1), last.(vals2))] points = get_points(tri1) - ch = get_convex_hull_indices(tri1) + ch = get_convex_hull_vertices(tri1) bad_idx = identify_exterior_points(_itp_xs, _itp_ys, points, ch; tol=1e-2) # boundary effects _really_ matter... deleteat!(∇err, bad_idx) deleteat!(Herr, bad_idx) @@ -426,7 +426,7 @@ end ∇err = [norm(g1 .- g2) for (g1, g2) in zip(first.(vals1), first.(vals2))] points = get_points(tri1) - ch = get_convex_hull_indices(tri1) + ch = get_convex_hull_vertices(tri1) bad_idx = identify_exterior_points(_itp_xs, _itp_ys, points, ch; tol=1e-2) # boundary effects _really_ matter... deleteat!(∇err, bad_idx) @@ -438,7 +438,7 @@ end pts = [(cos(θ) + 1e-6randn(), sin(θ) + 1e-6randn()) for θ = LinRange(0, 2π, (m + 1))][1:end-1] tri = triangulate(pts) f = (x, y) -> sin(x) * cos(y) - z = [f(x, y) for (x, y) in each_point(tri)] + z = [f(x, y) for (x, y) in DelaunayTriangulation.each_point(tri)] itp = interpolate(tri, z; derivatives=true) test_interpolant(itp, first.(pts), last.(pts), f) end \ No newline at end of file diff --git a/test/differentiation/structs.jl b/test/differentiation/structs.jl index 22eb86f..1955138 100644 --- a/test/differentiation/structs.jl +++ b/test/differentiation/structs.jl @@ -25,8 +25,8 @@ end end @testset "show" begin - tri = triangulate_rectangle(0, 1, 0, 1, 2, 5, add_ghost_triangles=false) - tri = Triangulation(tri.points, tri.triangles, tri.convex_hull.indices) + tri = triangulate_rectangle(0, 1, 0, 1, 2, 5) + tri = Triangulation(tri.points, tri.triangles, tri.convex_hull.vertices) f = (x, y) -> sin(x) + cos(x - y) unlock_convex_hull!(tri) x = getx.(tri.points) diff --git a/test/differentiation/utils.jl b/test/differentiation/utils.jl index 078aec3..f3b7a2f 100644 --- a/test/differentiation/utils.jl +++ b/test/differentiation/utils.jl @@ -55,7 +55,7 @@ include(normpath(@__DIR__, "../.", "helper_functions", "point_generator.jl")) _S = [get_neighbours(tri, i) for i in nc.indices] _S1 = copy(nc.indices) push!(_S1, reduce(union, _S)...) - filter!(!DT.is_boundary_index, _S1) + filter!(!DT.is_ghost_vertex, _S1) unique!(_S1) @test sort(E) == sort(_S1) for i in eachindex(E) @@ -82,11 +82,11 @@ include(normpath(@__DIR__, "../.", "helper_functions", "point_generator.jl")) _S = [get_neighbours(tri, i) for i in nc.indices] _S1 = copy(nc.indices) push!(_S1, reduce(union, _S)...) - filter!(!DT.is_boundary_index, _S1) + filter!(!DT.is_ghost_vertex, _S1) unique!(_S1) _S2 = [get_neighbours(tri, i) for i in _S1] push!(_S1, reduce(union, _S2)...) - filter!(!DT.is_boundary_index, _S1) + filter!(!DT.is_ghost_vertex, _S1) unique!(_S1) @test sort(E) == sort(_S1) for i in eachindex(E) diff --git a/test/doc_examples/differentiation.jl b/test/doc_examples/differentiation.jl index 0793b00..6c4a7c6 100644 --- a/test/doc_examples/differentiation.jl +++ b/test/doc_examples/differentiation.jl @@ -244,7 +244,7 @@ function rrmserr(z, ẑ, ∂, x, y) num = 0.0 den = 0.0 points = get_points(tri) - ch = get_convex_hull_indices(tri) + ch = get_convex_hull_vertices(tri) for (zᵢ, ẑᵢ, xᵢ, yᵢ) in zip(z, ẑ, x, y) q = (xᵢ, yᵢ) δ = DelaunayTriangulation.distance_to_polygon(q, points, ch) diff --git a/test/doc_examples/interpolant_comparisons.jl b/test/doc_examples/interpolant_comparisons.jl index 9d9b181..8f77561 100644 --- a/test/doc_examples/interpolant_comparisons.jl +++ b/test/doc_examples/interpolant_comparisons.jl @@ -54,7 +54,7 @@ yq = vec([y for _ in xg2, y in yg2]) tol = 1e-2 tri = triangulate([x'; y']; rng=rng) triq = triangulate([xq'; yq']; rng=rng) -exterior_idx = identify_exterior_points(xq, yq, get_points(tri), get_convex_hull_indices(tri); tol=tol) +exterior_idx = identify_exterior_points(xq, yq, get_points(tri), get_convex_hull_vertices(tri); tol=tol) interior_idx = filter(∉(exterior_idx), eachindex(xq, yq)) ## The test functions @@ -438,7 +438,7 @@ if get(ENV, "CI", "false") == "false" [refine!(tri; max_points=npoints) for tri in tris] xs = [first.(get_points(tri)) for tri in tris] ys = [last.(get_points(tri)) for tri in tris] - exterior_idxs = [identify_exterior_points(xq, yq, get_points(tri), get_convex_hull_indices(tri); tol=tol) for tri in tris] + exterior_idxs = [identify_exterior_points(xq, yq, get_points(tri), get_convex_hull_vertices(tri); tol=tol) for tri in tris] interior_idxs = [filter(∉(exterior_idx), eachindex(xq, yq)) for exterior_idx in exterior_idxs] median_lengths = [median_edge_length(tri) for tri in tris] sortidx = sortperm(median_lengths) @@ -549,7 +549,7 @@ if get(ENV, "CI", "false") == "false" running_times = zeros(length(m_range)) for (i, m) in enumerate(m_range) tri = circular_example(m) - z = [g(x, y) for (x, y) in each_point(tri)] + z = [g(x, y) for (x, y) in DelaunayTriangulation.each_point(tri)] itp = interpolate(tri, z; derivatives=true) b = @benchmark $itp($0.0, $0.0; method=$itp_method) running_times[i] = minimum(b.times) / 1e6 # ms diff --git a/test/doc_examples/interpolation.jl b/test/doc_examples/interpolation.jl index cb1e001..ab92bd2 100644 --- a/test/doc_examples/interpolation.jl +++ b/test/doc_examples/interpolation.jl @@ -26,7 +26,7 @@ function plot_itp(fig, x, y, vals, title, i, show_data_sites, itp, xd=nothing, y c = contourf!(ax, x, y, vals, color=vals, colormap=:viridis, levels=levels, extendhigh=:auto) show_data_sites && scatter!(ax, xd, yd, color=:red, markersize=9) tri = itp.triangulation - ch_idx = get_convex_hull_indices(tri) + ch_idx = get_convex_hull_vertices(tri) lines!(ax, [get_point(tri, i) for i in ch_idx], color=:white, linewidth=4) if show_3d ax = Axis3(fig[2, i], xlabel="x", ylabel="y", zlabel=L"z", width=600, height=600, title=" ", titlealign=:left, azimuth=0.49) diff --git a/test/doc_examples/interpolation_math.jl b/test/doc_examples/interpolation_math.jl index 2c68126..6a34812 100644 --- a/test/doc_examples/interpolation_math.jl +++ b/test/doc_examples/interpolation_math.jl @@ -54,13 +54,13 @@ pts = [(0.0, 8.0), (0.0, 0.0), (14.0, 0.0), (0.5, 2.0), (2.5, 2.0), (2.5, 2.5), (9.0, 2.0), (8.5, 6.0), (4.0, 2.0)] tri = triangulate(pts, randomise=false, delete_ghosts=false, rng=rng) -vorn = voronoi(tri, false) +vorn = voronoi(tri) q = (5.0, 4.0) tri2 = deepcopy(tri) add_point!(tri2, q, rng=rng) -vorn2 = voronoi(tri2, false) -V = get_polygon(vorn2, num_points(tri2)) -AX2 = get_area(vorn2, num_points(tri2)) +vorn2 = voronoi(tri2) +V = get_polygon(vorn2, DelaunayTriangulation.num_points(tri2)) +AX2 = get_area(vorn2, DelaunayTriangulation.num_points(tri2)) fig, ax, sc = voronoiplot(vorn, axis=(width=400, height=400), generator_color=:red, markersize=7, color=:white) xlims!(ax, 3, 9) diff --git a/test/doc_examples/swiss.jl b/test/doc_examples/swiss.jl index d84bb18..898958f 100644 --- a/test/doc_examples/swiss.jl +++ b/test/doc_examples/swiss.jl @@ -109,7 +109,7 @@ function plot_results!(fig, i1, j1, i2, j2, x, y, xg, yg, vals, title1, title2, zlims!(ax, e, f) ax = Axis(fig[i2, j2], xlabel="Longitude", ylabel="Latitude", width=600, height=400, title=title2, titlealign=:left) contourf!(ax, xg, yg, reshape(vals, (nx, ny)), color=vals, levels=levels) - lines!(ax, [get_point(query_tri, i) for i in get_convex_hull_indices(query_tri)], color=:red, linewidth=4, linestyle=:dash) + lines!(ax, [get_point(query_tri, i) for i in get_convex_hull_vertices(query_tri)], color=:red, linewidth=4, linestyle=:dash) lines!(ax, ds_boundary_points, color=:white, linewidth=4) xlims!(ax, a, b) ylims!(ax, c, d) diff --git a/test/helper_functions/point_generator.jl b/test/helper_functions/point_generator.jl index c8b83a8..fadddb7 100644 --- a/test/helper_functions/point_generator.jl +++ b/test/helper_functions/point_generator.jl @@ -1,5 +1,5 @@ function random_points_in_convex_hull(tri::Triangulation, n; rng=Random.default_rng()) # bit slow. oh well - boundary_nodes = get_convex_hull_indices(tri) + boundary_nodes = get_convex_hull_vertices(tri) points = get_points(tri) bbox = DT.polygon_bounds(points, boundary_nodes) F = DT.number_type(tri) diff --git a/test/helper_functions/slow_derivative_tests.jl b/test/helper_functions/slow_derivative_tests.jl index df30585..2efc7f8 100644 --- a/test/helper_functions/slow_derivative_tests.jl +++ b/test/helper_functions/slow_derivative_tests.jl @@ -90,11 +90,11 @@ function estimate_gradient_hessian_cubic_direct(tri, r, z; rng=Random.default_rn _S = [get_neighbours(tri, i) for i in nc.indices] _S1 = copy(nc.indices) push!(_S1, reduce(union, _S)...) - filter!(!DT.is_boundary_index, _S1) + filter!(!DT.is_ghost_vertex, _S1) unique!(_S1) _S2 = [get_neighbours(tri, i) for i in _S1] push!(_S1, reduce(union, _S2)...) - filter!(!DT.is_boundary_index, _S1) + filter!(!DT.is_ghost_vertex, _S1) unique!(_S1) S = _S1 end @@ -154,7 +154,7 @@ function estimate_gradient_hessian_quadratic_direct(tri, r, z; rng=Random.defaul _S = [get_neighbours(tri, i) for i in nc.indices] _S1 = copy(nc.indices) push!(_S1, reduce(union, _S)...) - filter!(!DT.is_boundary_index, _S1) + filter!(!DT.is_ghost_vertex, _S1) unique!(_S1) S = _S1 end diff --git a/test/interpolation/basic_tests.jl b/test/interpolation/basic_tests.jl index 6d85c86..e0bf324 100644 --- a/test/interpolation/basic_tests.jl +++ b/test/interpolation/basic_tests.jl @@ -51,8 +51,8 @@ include(normpath(@__DIR__, "../.", "helper_functions", "test_functions.jl")) test_interpolant(itp, x, y, f) test_interpolant(itp, x, y, z) - tri = triangulate_rectangle(0.0, 1.0, 0.0, 1.0, 30, 30, add_ghost_triangles=true) - z = [f(x, y) for (x, y) in each_point(tri)] + tri = triangulate_rectangle(0.0, 1.0, 0.0, 1.0, 30, 30) + z = [f(x, y) for (x, y) in DelaunayTriangulation.each_point(tri)] itp = interpolate(get_points(tri), z; derivatives=true) xx = LinRange(0, 1, 50) yy = LinRange(0, 1, 50) @@ -71,7 +71,7 @@ end f = (x, y) -> x^2 + y^2 + x^3 * y f′ = (x, y) -> [2x + 3x^2 * y; 2y + x^3] f′′ = (x, y) -> [2+6x*y 3x^2; 3x^2 2] - z = [f(x, y) for (x, y) in each_point(tri)] + z = [f(x, y) for (x, y) in DelaunayTriangulation.each_point(tri)] itp = interpolate(tri, z; derivatives=false) @test_throws ArgumentError("Gradients must be provided for Sibson-1, Farin, or Hiyoshi-2 interpolation. Consider using e.g. interpolate(tri, z; derivatives = true).") itp(0.5, 0.5; method=Sibson(1)) end @@ -82,7 +82,7 @@ end f = (x, y) -> x^2 + y^2 + x^3 * y f′ = (x, y) -> [2x + 3x^2 * y; 2y + x^3] f′′ = (x, y) -> [2+6x*y 3x^2; 3x^2 2] - z = [f(x, y) for (x, y) in each_point(tri)] + z = [f(x, y) for (x, y) in DelaunayTriangulation.each_point(tri)] itp = interpolate(tri, z; derivatives=false) @test_throws ArgumentError("Gradients and Hessians must be provided for Hiyoshi-2 interpolation. Consider using e.g. interpolate(tri, z; derivatives = true).") itp(0.5, 0.5; method=Hiyoshi(2)) end @@ -133,7 +133,7 @@ end vals2 = itp2(_itp_xs, _itp_ys; method=Sibson(1)) err = abs.(vals1 .- vals2) points = get_points(tri1) - ch = get_convex_hull_indices(tri1) + ch = get_convex_hull_vertices(tri1) bad_idx = identify_exterior_points(_itp_xs, _itp_ys, points, ch; tol=1e-3) # boundary effects _really_ matter... deleteat!(err, bad_idx) @test norm(err) ≈ 0 atol = 1e-2 diff --git a/test/interpolation/constrained.jl b/test/interpolation/constrained.jl index cbd32eb..d200e87 100644 --- a/test/interpolation/constrained.jl +++ b/test/interpolation/constrained.jl @@ -20,7 +20,7 @@ end nx, ny = 10, 10 tri = triangulate_rectangle(a, b, c, d, nx, ny) f = (x, y) -> sin(x * y) - cos(x - y) * exp(-(x - y)^2) - z = [f(x, y) for (x, y) in each_point(tri)] + z = [f(x, y) for (x, y) in DelaunayTriangulation.each_point(tri)] itp = interpolate(tri, z; derivatives=true) xg = LinRange(0, 1, 100) yg = LinRange(0, 1, 100) @@ -38,7 +38,7 @@ end titles = ("(a): Sibson", "(b): Triangle", "(c): Laplace", "(d): Sibson-1", "(e): Nearest", "(f): Farin", "(g): Hiyoshi", "(h): Exact") fig = Figure(fontsize=55) for (i, (vals, title)) in enumerate(zip(all_vals, titles)) - plot_2d(fig, 1, i, title, vals, xg, yg, first.(each_point(tri)), last.(each_point(tri)), !(vals == exact)) + plot_2d(fig, 1, i, title, vals, xg, yg, first.(DelaunayTriangulation.each_point(tri)), last.(DelaunayTriangulation.each_point(tri)), !(vals == exact)) plot_3d(fig, 2, i, " ", vals, xg, yg) end resize_to_layout!(fig) @@ -60,8 +60,7 @@ end ] boundary_nodes, points = convert_boundary_points_to_indices(x, y) tri = triangulate(points; boundary_nodes) - A = get_total_area(tri) - refine!(tri; max_area=1e-4A) + A = get_area(tri) D = 6.25e-4 Tf = (x, y) -> let r = sqrt(x^2 + y^2) (R₂^2 - r^2) / (4D) + R₁^2 * log(r / R₂) / (2D) @@ -70,9 +69,9 @@ end !(R₁ ≤ r ≤ R₂) && return Inf return Tf(x, y) end - z = [Tf(x, y) for (x, y) in each_point(tri)] - x = first.(each_point(tri)) - y = last.(each_point(tri)) + z = [Tf(x, y) for (x, y) in DelaunayTriangulation.each_point(tri)] + x = first.(DelaunayTriangulation.each_point(tri)) + y = last.(DelaunayTriangulation.each_point(tri)) triangles = [T[j] for T in each_solid_triangle(tri), j in 1:3] itp = interpolate(tri, z; derivatives=true) xg = LinRange(-R₂, R₂, 250) diff --git a/test/interpolation/coordinates/natural_coordinates.jl b/test/interpolation/coordinates/natural_coordinates.jl index c1acad9..7a3ab86 100644 --- a/test/interpolation/coordinates/natural_coordinates.jl +++ b/test/interpolation/coordinates/natural_coordinates.jl @@ -16,7 +16,7 @@ to_mat(H) = [H[1] H[3]; H[3] H[2]] tri = triangulate(pts, randomise=false, delete_ghosts=false) n = 2500 pts = random_points_in_convex_hull(tri, n) - for p in Iterators.flatten((pts, each_point(tri))) + for p in Iterators.flatten((pts, DelaunayTriangulation.each_point(tri))) natural_coordinates = NNI.compute_natural_coordinates(method, tri, p) @test sum(NNI.get_coordinates(natural_coordinates)) ≈ 1 δ = NNI.get_barycentric_deviation(natural_coordinates) @@ -32,7 +32,7 @@ to_mat(H) = [H[1] H[3]; H[3] H[2]] tri = triangulate(pts, delete_ghosts=false) n = 5000 random_points = random_points_in_convex_hull(tri, n) - for p in Iterators.flatten((random_points, each_point(tri))) + for p in Iterators.flatten((random_points, DT.each_point(tri))) natural_coordinates = NNI.compute_natural_coordinates(method, tri, p) @test sum(NNI.get_coordinates(natural_coordinates)) ≈ 1 δ = NNI.get_barycentric_deviation(natural_coordinates) @@ -46,6 +46,22 @@ to_mat(H) = [H[1] H[3]; H[3] H[2]] end end +function _circular_equality(A, B, by=isequal; kwargs...) # slightly tweaked version of circular_equality from DelaunayTriangulation.jl + if DT.is_circular(A) + _A = @views A[begin:(end-1)] + else + _A = A + end + if DT.is_circular(B) + _B = @views B[begin:(end-1)] + else + _B = B + end + same_idx = findmin(abs.(_A[begin] .- _B))[2] + _mapped_B = circshift(_B, -same_idx + 1) + return by(_A, _mapped_B; kwargs...) +end + @testset "Test coefficient values for each method" begin # used GeoGebra for _ in 1:10 # make sure rng is getting passed consistently # Setup @@ -59,13 +75,13 @@ end (0.5, 2.0), (2.5, 2.0), (2.5, 2.5), (9.0, 2.0), (8.5, 6.0), (4.0, 2.0)] tri = triangulate(pts, randomise=false, delete_ghosts=false, rng=rng) - vorn = voronoi(tri, false) + vorn = voronoi(tri, clip=false) q = (5.0, 4.0) tri2 = deepcopy(tri) add_point!(tri2, q, rng=rng) - vorn2 = voronoi(tri2, false) - V = get_polygon(vorn2, num_points(tri2)) - AX2 = get_area(vorn2, num_points(tri2)) + vorn2 = voronoi(tri2, clip=false) + V = get_polygon(vorn2, DelaunayTriangulation.num_points(tri2)) + AX2 = get_area(vorn2, DelaunayTriangulation.num_points(tri2)) # Sibson nc = NNI.compute_natural_coordinates(NNI.Sibson(), tri, q; rng=rng) @@ -77,14 +93,14 @@ end K1I1J1 = 0.003313286868 # W = 23 AX = AF1G1D1B1A1 + A1B1C1 + B1D1E1C1 + H1I1E1D1G1 + F1G1J1K1 + K1I1J1 @test AX ≈ AX2 rtol = 1e-3 - @test nc.indices == [23, 12, 5, 24, 7, 11] - @test nc.coordinates ≈ [K1I1J1, F1G1J1K1, AF1G1D1B1A1, A1B1C1, B1D1E1C1, H1I1E1D1G1] ./ AX rtol = 1e-2 + @test _circular_equality(nc.indices, [23, 12, 5, 24, 7, 11]) + @test _circular_equality(nc.coordinates, [K1I1J1, F1G1J1K1, AF1G1D1B1A1, A1B1C1, B1D1E1C1, H1I1E1D1G1] ./ AX, ≈, rtol = 1e-2) # Triangle nc = NNI.compute_natural_coordinates(NNI.Triangle(), tri, q; rng=rng) V = jump_and_march(tri, q; rng) - @test nc.indices == [5, 11, 12] - @test nc.coordinates ≈ [0.52, 0.3, 0.18] rtol = 1e-2 + @test _circular_equality(nc.indices, [5, 11, 12]) + @test _circular_equality(nc.coordinates, [0.52, 0.3, 0.18], ≈, rtol = 1e-2) # Laplace nc = NNI.compute_natural_coordinates(NNI.Laplace(), tri, q; rng=rng) @@ -113,8 +129,8 @@ end e /= tot z /= tot g /= tot - @test nc.indices == [23, 12, 5, 24, 7, 11] - @test nc.coordinates ≈ [w, ℓ, e, z, g, k] rtol = 1e-2 + @test _circular_equality(nc.indices, [23, 12, 5, 24, 7, 11]) + @test _circular_equality(nc.coordinates, [w, ℓ, e, z, g, k], ≈, rtol = 1e-2) # Nearest nc = NNI.compute_natural_coordinates(NNI.Nearest(), tri, q; rng=rng) @@ -125,7 +141,7 @@ end tri = triangulate_rectangle(0, 10, 0, 10, 101, 101) tri = triangulate(get_points(tri), randomise=false) f = (x, y) -> sin(x - y) + cos(x + y) - z = [f(x, y) for (x, y) in each_point(tri)] + z = [f(x, y) for (x, y) in DT.each_point(tri)] itp = interpolate(tri, z; derivatives=true) q = (5.0, 5.0) # a data site nc = NNI.compute_natural_coordinates(NNI.Sibson(), tri, q; rng=rng) @@ -152,7 +168,7 @@ end tri = triangulate_rectangle(0, 10, 0, 10, 101, 101) tri = triangulate(get_points(tri), randomise=false) f = (x, y) -> sin(x - y) + cos(x + y) - z = [f(x, y) for (x, y) in each_point(tri)] + z = [f(x, y) for (x, y) in DT.each_point(tri)] itp = interpolate(tri, z; derivatives=true) q = (5.37841, 1.3881) nc = NNI.compute_natural_coordinates(NNI.Sibson(), tri, q) @@ -198,8 +214,8 @@ end @test itp(5.0, 5.0, method=Farin(1)) ≈ f(5.0, 5.0) @test itp(5.0632, 5.0632, method=Farin(1)) ≈ f(5.0632, 5.0632) rtol = 1e-3 - tri = triangulate_rectangle(0.0, 1.0, 0.0, 1.0, 300, 300, add_ghost_triangles=true) - z = [f(x, y) for (x, y) in each_point(tri)] + tri = triangulate_rectangle(0.0, 1.0, 0.0, 1.0, 300, 300) + z = [f(x, y) for (x, y) in DT.each_point(tri)] xx = LinRange(0, 1, 50) yy = LinRange(0, 1, 50) x = vec([x for x in xx, _ in yy]) @@ -225,7 +241,7 @@ end tri = triangulate_rectangle(0, 10, 0, 10, 101, 101) tri = triangulate(get_points(tri), randomise=false) f = (x, y) -> sin(x - y) + cos(x + y) - z = [f(x, y) for (x, y) in each_point(tri)] + z = [f(x, y) for (x, y) in DT.each_point(tri)] itp = interpolate(tri, z; derivatives=true) q = (5.37841, 1.3881) nc = NNI.compute_natural_coordinates(NNI.Sibson(), tri, q) diff --git a/test/interpolation/coordinates/utils.jl b/test/interpolation/coordinates/utils.jl index 61486f2..9b67aa3 100644 --- a/test/interpolation/coordinates/utils.jl +++ b/test/interpolation/coordinates/utils.jl @@ -11,7 +11,7 @@ using LinearAlgebra pts = [(0.0, 8.0), (0.0, 0.0), (14.0, 0.0), (14.0, 8.0), (4.0, 4.0), (10.0, 6.0), (6.0, 2.0), (12.0, 4.0), (0.0, 4.0)] tri = triangulate(pts, randomise=false, delete_ghosts=false) envelope = Int64[] - history = DT.initialise_event_history(tri) + history = DT.InsertionEventHistory(tri) A = DT.Adjacent{Int64,NTuple{2,Int64}}() envelope, A, history, V = NNI.compute_bowyer_envelope!(envelope, tri, (6.0, 4.0)) @test !DT.is_outside(DT.point_position_relative_to_triangle(tri, V, (6.0, 4.0))) @@ -21,42 +21,42 @@ using LinearAlgebra @test DT.circular_equality(envelope, [2, 3, 8, 7, 5, 2]) envelope, A, history, V = NNI.compute_bowyer_envelope!(envelope, tri, (7.0, -1.0)) @test !DT.is_outside(DT.point_position_relative_to_triangle(tri, V, (7.0, -1.0))) - @test DT.circular_equality(envelope, [2, DT.BoundaryIndex, 3, 8, 7, 2]) + @test DT.circular_equality(envelope, [2, DT.GhostVertex, 3, 8, 7, 2]) envelope, A, history, V = NNI.compute_bowyer_envelope(tri, (7.0, -1.0)) @test !DT.is_outside(DT.point_position_relative_to_triangle(tri, V, (7.0, -1.0))) - @test DT.circular_equality(envelope, [2, DT.BoundaryIndex, 3, 8, 7, 2]) + @test DT.circular_equality(envelope, [2, DT.GhostVertex, 3, 8, 7, 2]) envelope, A, history, V = NNI.compute_bowyer_envelope!(envelope, tri, (0.0, 3.0)) @test DT.is_on(DT.point_position_relative_to_triangle(tri, V, (0.0, 3.0))) envelope, A, history, V = NNI.compute_bowyer_envelope!(envelope, tri, history, A, (6.0, 4.0)) @test !DT.is_outside(DT.point_position_relative_to_triangle(tri, V, (6.0, 4.0))) for T in DT.each_added_triangle(history) - i, j, k = indices(T) + i, j, k = triangle_vertices(T) @test DT.get_adjacent(A, i, j) == k @test DT.get_adjacent(A, j, k) == i @test DT.get_adjacent(A, k, i) == j end - @test length(A) == 3length(DT.each_added_triangle(history)) + @test length(A.adjacent) == 3length(DT.each_added_triangle(history)) envelope, A, history, V = NNI.compute_bowyer_envelope!(envelope, tri, history, A, (6.0, 1.0)) @test !DT.is_outside(DT.point_position_relative_to_triangle(tri, V, (6.0, 1.0))) @test DT.circular_equality(envelope, [2, 3, 8, 7, 5, 2]) for T in DT.each_added_triangle(history) - i, j, k = indices(T) + i, j, k = triangle_vertices(T) @test DT.get_adjacent(A, i, j) == k @test DT.get_adjacent(A, j, k) == i @test DT.get_adjacent(A, k, i) == j end - @test length(A) == 3length(DT.each_added_triangle(history)) + @test length(A.adjacent) == 3length(DT.each_added_triangle(history)) @test DT.circular_equality(envelope, [2, 3, 8, 7, 5, 2]) envelope, A, history, V = NNI.compute_bowyer_envelope!(envelope, tri, history, A, (7.0, -1.0)) @test !DT.is_outside(DT.point_position_relative_to_triangle(tri, V, (7.0, -1.0))) for T in DT.each_added_triangle(history) - i, j, k = indices(T) + i, j, k = triangle_vertices(T) @test DT.get_adjacent(A, i, j) == k @test DT.get_adjacent(A, j, k) == i @test DT.get_adjacent(A, k, i) == j end - @test length(A) == 3length(DT.each_added_triangle(history)) - @test DT.circular_equality(envelope, [2, DT.BoundaryIndex, 3, 8, 7, 2]) + @test length(A.adjacent) == 3length(DT.each_added_triangle(history)) + @test DT.circular_equality(envelope, [2, DT.GhostVertex, 3, 8, 7, 2]) end @testset "polygon_area" begin @@ -70,9 +70,9 @@ end pts = rand(2, 50) tri = triangulate(pts) - boundary_nodes = get_convex_hull_indices(tri) + boundary_nodes = get_convex_hull_vertices(tri) A = NNI.polygon_area(pts[:, boundary_nodes]) - _A = DT.get_total_area(tri) + _A = DT.get_area(tri) @test A ≈ _A end diff --git a/test/interpolation/example_constrained.png b/test/interpolation/example_constrained.png index 293e706..0e5f56b 100644 Binary files a/test/interpolation/example_constrained.png and b/test/interpolation/example_constrained.png differ diff --git a/test/interpolation/extrapolation.jl b/test/interpolation/extrapolation.jl index 55bcb53..dd42691 100644 --- a/test/interpolation/extrapolation.jl +++ b/test/interpolation/extrapolation.jl @@ -10,8 +10,8 @@ using LinearAlgebra coordinates = zeros(5) envelope = zeros(Int, 5) for _ in 1:100 - e = (rand ∘ get_edges)(tri) - i, j = DT.edge_indices(e) + e = (rand ∘ each_edge)(tri) + i, j = DT.edge_vertices(e) t = rand() p = (1 - t) .* get_point(tri, i) .+ t .* get_point(tri, j) nc = NNI.two_point_interpolate!(coordinates, envelope, tri, i, j, p) @@ -28,16 +28,16 @@ using LinearAlgebra end @testset "Basic extrapolation" begin - tri = triangulate_rectangle(0.0, 1.0, 0.0, 1.0, 5, 10, add_ghost_triangles=true) + tri = triangulate_rectangle(0.0, 1.0, 0.0, 1.0, 5, 10) f = (x, y) -> sin(x * y) - cos(x - y) * exp(-(x - y)^2) pts = get_points(tri) - z = [f(x, y) for (x, y) in each_point(tri)] + z = [f(x, y) for (x, y) in DelaunayTriangulation.each_point(tri)] itp = interpolate(pts, z, derivatives=true) p = (1.5, 0.7) V = jump_and_march(tri, p) - _V = DT.rotate_ghost_triangle_to_standard_form(V) - i, j = indices(_V) + _V = DT.sort_triangle(V) + i, j = triangle_vertices(_V) a, b = get_point(tri, i, j) dab = norm(b .- a) dbp = norm((1.0, 0.7) .- b) diff --git a/test/interpolation/precision.jl b/test/interpolation/precision.jl index 9b94625..fb27490 100644 --- a/test/interpolation/precision.jl +++ b/test/interpolation/precision.jl @@ -26,7 +26,7 @@ include(normpath(@__DIR__, "../.", "helper_functions", "test_functions.jl")) vals = itp(_x, _y; method=Sibson(0)) for i in eachindex(vals) ξ, η = _x[i], _y[i] - if DT.distance_to_polygon((ξ, η), get_points(itp.triangulation), get_convex_hull_indices(itp.triangulation)) > 1e-7 + if DT.distance_to_polygon((ξ, η), get_points(itp.triangulation), get_convex_hull_vertices(itp.triangulation)) > 1e-7 @test vals[i] ≈ f(_x[i], _y[i]) atol = 1e-12 end end @@ -51,7 +51,7 @@ end vals = itp(_x, _y; method=Laplace()) for i in eachindex(vals) ξ, η = _x[i], _y[i] - if DT.distance_to_polygon((ξ, η), get_points(itp.triangulation), get_convex_hull_indices(itp.triangulation)) > 1e-7 + if DT.distance_to_polygon((ξ, η), get_points(itp.triangulation), get_convex_hull_vertices(itp.triangulation)) > 1e-7 @test vals[i] ≈ f(_x[i], _y[i]) atol = 1e-12 end end @@ -77,7 +77,7 @@ end vals = itp(_x, _y; method=Sibson(1)) for i in eachindex(vals) ξ, η = _x[i], _y[i] - if DT.distance_to_polygon((ξ, η), get_points(itp.triangulation), get_convex_hull_indices(itp.triangulation)) > 1e-7 + if DT.distance_to_polygon((ξ, η), get_points(itp.triangulation), get_convex_hull_vertices(itp.triangulation)) > 1e-7 @test vals[i] ≈ f(_x[i], _y[i]) atol = 1e-14 end end @@ -102,7 +102,7 @@ end vals = itp(_x, _y; method=Farin(1)) for i in eachindex(vals) ξ, η = _x[i], _y[i] - if DT.distance_to_polygon((ξ, η), get_points(itp.triangulation), get_convex_hull_indices(itp.triangulation)) > 1e-7 + if DT.distance_to_polygon((ξ, η), get_points(itp.triangulation), get_convex_hull_vertices(itp.triangulation)) > 1e-7 @test vals[i] ≈ f(_x[i], _y[i]) atol = 1e-12 end end @@ -136,7 +136,7 @@ end vals = itp(_x, _y; method=Hiyoshi(2)) for i in eachindex(vals) ξ, η = _x[i], _y[i] - if DT.distance_to_polygon((ξ, η), get_points(itp.triangulation), get_convex_hull_indices(itp.triangulation)) > 1e-7 + if DT.distance_to_polygon((ξ, η), get_points(itp.triangulation), get_convex_hull_vertices(itp.triangulation)) > 1e-7 @test vals[i] ≈ f(_x[i], _y[i]) atol=1e-6 end end diff --git a/test/interpolation/structs.jl b/test/interpolation/structs.jl index 7c7dbee..919d8e0 100644 --- a/test/interpolation/structs.jl +++ b/test/interpolation/structs.jl @@ -26,8 +26,8 @@ const NNI = NaturalNeighbours end @testset "show" begin - tri = triangulate_rectangle(0, 1, 0, 1, 2, 5, add_ghost_triangles=false) - tri = Triangulation(tri.points, tri.triangles, tri.convex_hull.indices) + tri = triangulate_rectangle(0, 1, 0, 1, 2, 5) + tri = Triangulation(tri.points, tri.triangles, tri.convex_hull.vertices) f = (x, y) -> sin(x) + cos(x - y) unlock_convex_hull!(tri) x = getx.(tri.points)