diff --git a/data/tetra.jl b/data/tetra.jl index 07fdea72..7b205284 100644 --- a/data/tetra.jl +++ b/data/tetra.jl @@ -1,4 +1,4 @@ -xe_tetra = [ +const _xe_tetra = [ 0 0 0 1 0 0 0 1 0 @@ -6,13 +6,13 @@ xe_tetra = [ 5//10 2//10 1//10 ]; -Tets_tetra = [ +const _Tets_tetra = [ 1 2 3 5 5 4 3 1 5 4 1 2 5 2 3 4 ]; -Tets_tetra = vec(reshape(Tets_tetra, 16, 1)); -xe_tetra = vec(reshape(xe_tetra, 15, 1)); -Constants_tetra = [1, 2, 3, 4]; +const Tets_tetra = vec(reshape(_Tets_tetra, 16, 1)); +const xe_tetra = vec(reshape(_xe_tetra, 15, 1)); +const Constants_tetra = [1, 2, 3, 4]; diff --git a/data/tetra_duct12.jl b/data/tetra_duct12.jl index 4c9101e0..990e1491 100644 --- a/data/tetra_duct12.jl +++ b/data/tetra_duct12.jl @@ -1,4 +1,4 @@ -xe_duct12 = [ +const _xe_duct12 = [ 1 -3.81000000000000e+01 -3.81000000000000e+01 2.19100000000000e+02 2 3.81000000000000e+01 -3.81000000000000e+01 2.19100000000000e+02 3 3.81000000000000e+01 3.81000000000000e+01 2.19100000000000e+02 @@ -4200,7 +4200,7 @@ xe_duct12 = [ 4199 1.90500000000000e+02 -9.84500000000000e+01 -3.39700000000000e+02 ] -TETS_duct12 = [ +const _TETS_duct12 = [ 1 1 9 7 8 2 2 15 17 16 3 3 26 29 28 @@ -23425,7 +23425,7 @@ TETS_duct12 = [ 19222 4198 4197 4196 4199 ] -Const_duct12 = [ +const Const_duct12 = [ 1, 2, 3, @@ -25325,5 +25325,5 @@ Const_duct12 = [ 4199, ] -TETS_duct12 = vec(reshape(TETS_duct12[:, 2:5], 19222 * 4, 1)) -xe_duct12 = vec(reshape(xe_duct12[:, 2:4], 4199 * 3, 1)) +const TETS_duct12 = vec(reshape(_TETS_duct12[:, 2:5], 19222 * 4, 1)) +const xe_duct12 = vec(reshape(_xe_duct12[:, 2:4], 4199 * 3, 1)) diff --git a/data/tetra_duct15.jl b/data/tetra_duct15.jl index a3f4aa0b..8e4392f8 100644 --- a/data/tetra_duct15.jl +++ b/data/tetra_duct15.jl @@ -1,4 +1,4 @@ -xe_duct15 = [ +const _xe_duct15 = [ 1 -3.81000000000000e+01 -3.81000000000000e+01 2.19100000000000e+02 2 3.81000000000000e+01 -3.81000000000000e+01 2.19100000000000e+02 3 -3.81000000000000e+01 3.81000000000000e+01 2.19100000000000e+02 @@ -2140,7 +2140,7 @@ xe_duct15 = [ 2139 1.90500000000000e+02 -9.84500000000000e+01 -3.39700000000000e+02 ] -TETS_duct15 = [ +const _TETS_duct15 = [ 1 1 11 10 4 2 9 2 33 23 3 35 8 6 3 @@ -11143,7 +11143,7 @@ TETS_duct15 = [ 9000 2139 2138 2137 2136 ] -Const_duct15 = [ +const Const_duct15 = [ 1, 2, 3, @@ -12320,5 +12320,5 @@ Const_duct15 = [ 2139, ] -TETS_duct15 = vec(reshape(TETS_duct15[:, 2:5], 9000 * 4, 1)) -xe_duct15 = vec(reshape(xe_duct15[:, 2:4], 2139 * 3, 1)) +const TETS_duct15 = vec(reshape(_TETS_duct15[:, 2:5], 9000 * 4, 1)) +const xe_duct15 = vec(reshape(_xe_duct15[:, 2:4], 2139 * 3, 1)) diff --git a/data/tetra_duct20.jl b/data/tetra_duct20.jl index 5c97f303..2476a8cb 100644 --- a/data/tetra_duct20.jl +++ b/data/tetra_duct20.jl @@ -1,4 +1,4 @@ -xe_duct20 = [ +const _xe_duct20 = [ 1 3.81000000000000e+01 -3.81000000000000e+01 2.19100000000000e+02 2 -3.81000000000000e+01 -3.81000000000000e+01 2.19100000000000e+02 3 1.20600600000000e+01 -2.03064000000000e+01 2.19100000000000e+02 @@ -1068,7 +1068,7 @@ xe_duct20 = [ 1067 1.90500000000000e+02 -9.84500000000000e+01 -3.39700000000000e+02 ] -TETS_duct20 = [ +const _TETS_duct20 = [ 1 26 1 5 25 2 26 5 1 15 3 26 25 15 1 @@ -5175,7 +5175,7 @@ TETS_duct20 = [ 4104 1067 1066 1065 1064 ] -Const_duct20 = [ +const Const_duct20 = [ 1, 2, 3, @@ -5863,5 +5863,5 @@ Const_duct20 = [ 1067, ] -TETS_duct20 = vec(reshape(TETS_duct20[:, 2:5], 4104 * 4, 1)) -xe_duct20 = vec(reshape(xe_duct20[:, 2:4], 1067 * 3, 1)) +const TETS_duct20 = vec(reshape(_TETS_duct20[:, 2:5], 4104 * 4, 1)) +const xe_duct20 = vec(reshape(_xe_duct20[:, 2:4], 1067 * 3, 1)) diff --git a/data/tetra_foam5.jl b/data/tetra_foam5.jl index e000433d..105d737c 100644 --- a/data/tetra_foam5.jl +++ b/data/tetra_foam5.jl @@ -1,4 +1,4 @@ -xe_foam5 = [ +const _xe_foam5 = [ 1 -5.40174000000000e+00 6.39390000000000e+01 2.35429500000000e+00 2 -5.40174000000000e+00 6.63841800000000e+01 2.35429500000000e+00 3 -5.40174000000000e+00 6.69957000000000e+01 2.35429500000000e+00 @@ -1338,7 +1338,7 @@ xe_foam5 = [ 1337 4.19420000000000e+00 6.94415000000000e+01 4.13886200000000e+00 ] -TETS_foam5 = [ +const _TETS_foam5 = [ 1 18 1 21 20 2 19 20 1 18 3 22 2 33 28 @@ -6188,7 +6188,7 @@ TETS_foam5 = [ 4847 1336 1337 1335 1334 ] -Const_foam5 = [ +const Const_foam5 = [ 1, 2, 3, @@ -7239,5 +7239,5 @@ Const_foam5 = [ 1337, ] -TETS_foam5 = vec(reshape(TETS_foam5[:, 2:5], 4847 * 4, 1)) -xe_foam5 = vec(reshape(xe_foam5[:, 2:4], 1337 * 3, 1)) +const TETS_foam5 = vec(reshape(_TETS_foam5[:, 2:5], 4847 * 4, 1)) +const xe_foam5 = vec(reshape(_xe_foam5[:, 2:4], 1337 * 3, 1)) diff --git a/data/tetra_gear.jl b/data/tetra_gear.jl index 49867762..95ad0072 100644 --- a/data/tetra_gear.jl +++ b/data/tetra_gear.jl @@ -1,4 +1,4 @@ -xe_gear = [ +const _xe_gear = [ 1 -1.29203000000000e+00 -1.27247000000000e+00 -2.94400000000000e-01 2 -1.66616000000000e+00 -1.10629000000000e+00 5.00000000000000e-05 3 -1.53883000000000e+00 -1.27748000000000e+00 1.15390000000000e-01 @@ -867,7 +867,7 @@ xe_gear = [ 866 1.31719000000000e+00 1.50499000000000e+00 5.00000000000000e-01 ] -TETS_gear = [ +const _TETS_gear = [ 1 13 30 1 32 2 10 27 11 1 3 27 10 30 1 @@ -3986,7 +3986,7 @@ TETS_gear = [ 3116 865 866 864 863 ] -Const_gear = [ +const Const_gear = [ 2, 3, 4, @@ -4595,5 +4595,5 @@ Const_gear = [ 866, ] -TETS_gear = vec(reshape(TETS_gear[:, 2:5], 3116 * 4, 1)) -xe_gear = vec(reshape(xe_gear[:, 2:4], 866 * 3, 1)) +const TETS_gear = vec(reshape(_TETS_gear[:, 2:5], 3116 * 4, 1)) +const xe_gear = vec(reshape(_xe_gear[:, 2:4], 866 * 3, 1)) diff --git a/data/tetra_hook.jl b/data/tetra_hook.jl index a87b3b17..00e76569 100644 --- a/data/tetra_hook.jl +++ b/data/tetra_hook.jl @@ -1,4 +1,4 @@ -xe_hook = [ +const _xe_hook = [ 1 0.00000000000000e+00 -3.00000000000000e+01 -1.37500000000000e+01 2 0.00000000000000e+00 -3.00000000000000e+01 -1.75000000000000e+01 3 0.00000000000000e+00 -3.50000000000000e+01 -1.75000000000000e+01 @@ -1191,7 +1191,7 @@ xe_hook = [ 1190 -5.20141000000000e+01 -1.45099000000000e+01 7.28584000000000e+01 ] -TETS_hook = [ +const _TETS_hook = [ 1 19 20 1 39 2 3 1 2 39 3 19 1 3 39 @@ -5869,7 +5869,7 @@ TETS_hook = [ 4675 1189 1188 1190 1187 ] -Const_hook = [ +const Const_hook = [ 1, 2, 3, @@ -6662,5 +6662,5 @@ Const_hook = [ 1190, ] -TETS_hook = vec(reshape(TETS_hook[:, 2:5], 4675 * 4, 1)) -xe_hook = vec(reshape(xe_hook[:, 2:4], 1190 * 3, 1)) +const TETS_hook = vec(reshape(_TETS_hook[:, 2:5], 4675 * 4, 1)) +const xe_hook = vec(reshape(_xe_hook[:, 2:4], 1190 * 3, 1)) diff --git a/data/triangle.jl b/data/triangle.jl index 923fa65f..a058d8d2 100644 --- a/data/triangle.jl +++ b/data/triangle.jl @@ -1,16 +1,16 @@ -xe = [ +const _xe = [ 0 0 1 0 0 1 64//100 25//100 ]; -Tr = [ +const _Tr = [ 1 2 4 4 2 3 4 3 1 ]; -Tr = vec(reshape(Tr, 9, 1)); -xe = vec(reshape(xe, 8, 1)); -Constants = [1, 2, 3]; +const Tr = vec(reshape(_Tr, 9, 1)); +const xe = vec(reshape(_xe, 8, 1)); +const Constants = [1, 2, 3]; diff --git a/data/triangle_deer.jl b/data/triangle_deer.jl index 0eeff496..8cf418e7 100644 --- a/data/triangle_deer.jl +++ b/data/triangle_deer.jl @@ -1,4 +1,4 @@ -xe_deer = [ +const _xe_deer = [ 1 2.90000000000000e+00 1.20000000000000e+00 2 3.60000000000000e+00 1.20000000000000e+00 3 3.35000000000000e+00 1.20000000000000e+00 @@ -1123,7 +1123,7 @@ xe_deer = [ 1122 1.82000000000000e+01 2.06000000000000e+01 ]; -TRIS_deer = [ +const _TRIS_deer = [ 1 1 3 4 2 1 4 5 3 3 2 7 @@ -3022,10 +3022,10 @@ TRIS_deer = [ 1896 1121 1120 1122 ]; -TRIS_deer = vec(reshape(TRIS_deer[:, 2:4], 1896 * 3, 1)); -xe_deer = vec(reshape(xe_deer[:, 2:3], 2 * 1122, 1)); +const TRIS_deer = vec(reshape(_TRIS_deer[:, 2:4], 1896 * 3, 1)); +const xe_deer = vec(reshape(_xe_deer[:, 2:3], 2 * 1122, 1)); -Const_deer = [ +const Const_deer = [ 1, 2, 3, diff --git a/data/triangle_pacman.jl b/data/triangle_pacman.jl index a454a0e7..9c9b03a2 100644 --- a/data/triangle_pacman.jl +++ b/data/triangle_pacman.jl @@ -1,4 +1,4 @@ -xe_pacman = [ +const _xe_pacman = [ 1 0.00000000000000e+00 1.00000000000000e+00 2 8.97600000000000e-01 2.18200000000000e-01 3 1.34640000000000e+00 2.51000000000000e-02 @@ -684,7 +684,7 @@ xe_pacman = [ 683 1.52592000000000e+01 1.28943000000000e+01 ]; -TRIS_pacman = [ +const _TRIS_pacman = [ 1 2 8 6 2 3 8 2 3 12 3 9 @@ -1869,10 +1869,10 @@ TRIS_pacman = [ 1182 683 682 681 ]; -xe_pacman = vec(reshape(xe_pacman[:, 2:3], 2 * 683, 1)) -TRIS_pacman = vec(reshape(TRIS_pacman[:, 2:4], 1182 * 3, 1)) +const xe_pacman = vec(reshape(_xe_pacman[:, 2:3], 2 * 683, 1)) +const TRIS_pacman = vec(reshape(_TRIS_pacman[:, 2:4], 1182 * 3, 1)) -Const_pacman = [ +const Const_pacman = [ 1, 2, 3, diff --git a/data/triangle_turtle.jl b/data/triangle_turtle.jl index ad7435a6..a0f3bae0 100644 --- a/data/triangle_turtle.jl +++ b/data/triangle_turtle.jl @@ -1,4 +1,4 @@ -xe_turtle = [ +const _xe_turtle = [ 1 1.50000000000000e-01 4.12500000000000e+00 2 2.00000000000000e-01 4.00000000000000e+00 3 0.00000000000000e+00 4.50000000000000e+00 @@ -2223,7 +2223,7 @@ xe_turtle = [ 2222 1.46000000000000e+01 1.14000000000000e+01 ]; -TRIS_turtle = [ +const _TRIS_turtle = [ 1 2 7 1 2 7 4 1 3 5 7 2 @@ -6251,9 +6251,9 @@ TRIS_turtle = [ 4025 2221 2222 2220 ]; -TRIS_turtle = vec(reshape(TRIS_turtle[:, 2:4], 4025 * 3, 1)); -xe_turtle = vec(reshape(xe_turtle[:, 2:3], 2222 * 2, 1)); -Const_turtle = [ +const TRIS_turtle = vec(reshape(_TRIS_turtle[:, 2:4], 4025 * 3, 1)); +const xe_turtle = vec(reshape(_xe_turtle[:, 2:3], 2222 * 2, 1)); +const Const_turtle = [ 1, 2, 3, diff --git a/src/ADNLPProblems/ADNLPProblems.jl b/src/ADNLPProblems/ADNLPProblems.jl index 37c37232..824468a1 100644 --- a/src/ADNLPProblems/ADNLPProblems.jl +++ b/src/ADNLPProblems/ADNLPProblems.jl @@ -2,16 +2,31 @@ module ADNLPProblems using Requires -default_nvar = 100 +const default_nvar = 100 +const data_path = joinpath(@__DIR__, "..", "..", "data") reshape_array(a, dims) = invoke(Base._reshape, Tuple{AbstractArray, typeof(dims)}, a, dims) +const _data_loaded = Dict{Symbol, Ref{Bool}}() +const _data_locks = Dict{Symbol, ReentrantLock}() + +function _ensure_data!(key::Symbol, relpath::AbstractString) + flag = get!(_data_loaded, key, Ref(false)) + flag[] && return + lck = get!(_data_locks, key, ReentrantLock()) + lock(lck) do + flag[] && return + Base.include(@__MODULE__, joinpath(@__DIR__, "..", "..", "data", relpath)) + flag[] = true + end + return +end + @init begin @require ADNLPModels = "54578032-b7ea-4c30-94aa-7cbd1cce6c9a" begin using JLD2, LinearAlgebra, SparseArrays, SpecialFunctions path = dirname(@__FILE__) - data_path = joinpath(@__DIR__, "..", "..", "data") files = filter(x -> x[(end - 2):end] == ".jl", readdir(path)) for file in files if file ≠ "ADNLPProblems.jl" diff --git a/src/ADNLPProblems/tetra.jl b/src/ADNLPProblems/tetra.jl index c2199970..b00dec60 100644 --- a/src/ADNLPProblems/tetra.jl +++ b/src/ADNLPProblems/tetra.jl @@ -71,30 +71,38 @@ function tetra( return ADNLPModels.ADNLPModel!(f, x0, lvar, uvar, c!, lcon, ucon, name = "tetra"; kwargs...) end -include("../../data/tetra_duct12.jl") export tetra_duct12 -tetra_duct12(; kwargs...) = +function tetra_duct12(; kwargs...) + _ensure_data!(:tetra_duct12, "tetra_duct12.jl") tetra(xe_duct12, TETS_duct12, Const_duct12; name = "tetra_duct12", kwargs...) +end -include("../../data/tetra_duct15.jl") export tetra_duct15 -tetra_duct15(; kwargs...) = +function tetra_duct15(; kwargs...) + _ensure_data!(:tetra_duct15, "tetra_duct15.jl") tetra(xe_duct15, TETS_duct15, Const_duct15; name = "tetra_duct15", kwargs...) +end -include("../../data/tetra_duct20.jl") export tetra_duct20 -tetra_duct20(; kwargs...) = +function tetra_duct20(; kwargs...) + _ensure_data!(:tetra_duct20, "tetra_duct20.jl") tetra(xe_duct20, TETS_duct20, Const_duct20; name = "tetra_duct20", kwargs...) +end -include("../../data/tetra_hook.jl") export tetra_hook -tetra_hook(; kwargs...) = tetra(xe_hook, TETS_hook, Const_hook; name = "tetra_hook", kwargs...) +function tetra_hook(; kwargs...) + _ensure_data!(:tetra_hook, "tetra_hook.jl") + tetra(xe_hook, TETS_hook, Const_hook; name = "tetra_hook", kwargs...) +end -include("../../data/tetra_foam5.jl") export tetra_foam5 -tetra_foam5(; kwargs...) = tetra(xe_foam5, TETS_foam5, Const_foam5; name = "tetra_foam5", kwargs...) +function tetra_foam5(; kwargs...) + _ensure_data!(:tetra_foam5, "tetra_foam5.jl") + tetra(xe_foam5, TETS_foam5, Const_foam5; name = "tetra_foam5", kwargs...) +end -include("../../data/tetra_gear.jl") export tetra_gear -tetra_gear(; kwargs...) = tetra(xe_gear, TETS_gear, Const_gear; name = "tetra_gear", kwargs...) -# TRUC +function tetra_gear(; kwargs...) + _ensure_data!(:tetra_gear, "tetra_gear.jl") + tetra(xe_gear, TETS_gear, Const_gear; name = "tetra_gear", kwargs...) +end diff --git a/src/ADNLPProblems/triangle.jl b/src/ADNLPProblems/triangle.jl index 873c18fa..e4c6f12a 100644 --- a/src/ADNLPProblems/triangle.jl +++ b/src/ADNLPProblems/triangle.jl @@ -60,17 +60,20 @@ function triangle( return ADNLPModels.ADNLPModel!(f, x0, lvar, uvar, c!, lcon, ucon, name = "triangle"; kwargs...) end -include("../../data/triangle_deer.jl") export triangle_deer -triangle_deer(; kwargs...) = +function triangle_deer(; kwargs...) + _ensure_data!(:triangle_deer, "triangle_deer.jl") triangle(xe_deer, TRIS_deer, Const_deer; name = "triangle_deer", kwargs...) +end -include("../../data/triangle_pacman.jl") export triangle_pacman -triangle_pacman(; kwargs...) = +function triangle_pacman(; kwargs...) + _ensure_data!(:triangle_pacman, "triangle_pacman.jl") triangle(xe_pacman, TRIS_pacman, Const_pacman; name = "triangle_pacman", kwargs...) +end -include("../../data/triangle_turtle.jl") export triangle_turtle -triangle_turtle(; kwargs...) = +function triangle_turtle(; kwargs...) + _ensure_data!(:triangle_turtle, "triangle_turtle.jl") triangle(xe_turtle, TRIS_turtle, Const_turtle; name = "triangle_turtle", kwargs...) +end diff --git a/src/PureJuMP/PureJuMP.jl b/src/PureJuMP/PureJuMP.jl index d11e8722..a855ee25 100644 --- a/src/PureJuMP/PureJuMP.jl +++ b/src/PureJuMP/PureJuMP.jl @@ -1,6 +1,22 @@ module PureJuMP const default_nvar = 100 +const data_path = joinpath(@__DIR__, "..", "..", "data") + +const _data_loaded = Dict{Symbol, Ref{Bool}}() +const _data_locks = Dict{Symbol, ReentrantLock}() + +function _ensure_data!(key::Symbol, relpath::AbstractString) + flag = get!(_data_loaded, key, Ref(false)) + flag[] && return + lck = get!(_data_locks, key, ReentrantLock()) + lock(lck) do + flag[] && return + Base.include(@__MODULE__, joinpath(@__DIR__, "..", "..", "data", relpath)) + flag[] = true + end + return +end using JuMP, LinearAlgebra, SpecialFunctions diff --git a/src/PureJuMP/tetra.jl b/src/PureJuMP/tetra.jl index 712437d8..81f7cb7f 100644 --- a/src/PureJuMP/tetra.jl +++ b/src/PureJuMP/tetra.jl @@ -80,26 +80,38 @@ function tetra( return nlp end -include("../../data/tetra_duct12.jl") export tetra_duct12 -tetra_duct12(; kwargs...) = tetra(xe_duct12, TETS_duct12, Const_duct12; kwargs...) +function tetra_duct12(; kwargs...) + _ensure_data!(:tetra_duct12, "tetra_duct12.jl") + tetra(xe_duct12, TETS_duct12, Const_duct12; name = "tetra_duct12", kwargs...) +end -include("../../data/tetra_duct15.jl") export tetra_duct15 -tetra_duct15(; kwargs...) = tetra(xe_duct15, TETS_duct15, Const_duct15; kwargs...) +function tetra_duct15(; kwargs...) + _ensure_data!(:tetra_duct15, "tetra_duct15.jl") + tetra(xe_duct15, TETS_duct15, Const_duct15; name = "tetra_duct15", kwargs...) +end -include("../../data/tetra_duct20.jl") export tetra_duct20 -tetra_duct20(; kwargs...) = tetra(xe_duct20, TETS_duct20, Const_duct20; kwargs...) +function tetra_duct20(; kwargs...) + _ensure_data!(:tetra_duct20, "tetra_duct20.jl") + tetra(xe_duct20, TETS_duct20, Const_duct20; name = "tetra_duct20", kwargs...) +end -include("../../data/tetra_hook.jl") export tetra_hook -tetra_hook(; kwargs...) = tetra(xe_hook, TETS_hook, Const_hook; kwargs...) +function tetra_hook(; kwargs...) + _ensure_data!(:tetra_hook, "tetra_hook.jl") + tetra(xe_hook, TETS_hook, Const_hook; name = "tetra_hook", kwargs...) +end -include("../../data/tetra_foam5.jl") export tetra_foam5 -tetra_foam5(; kwargs...) = tetra(xe_foam5, TETS_foam5, Const_foam5; kwargs...) +function tetra_foam5(; kwargs...) + _ensure_data!(:tetra_foam5, "tetra_foam5.jl") + tetra(xe_foam5, TETS_foam5, Const_foam5; name = "tetra_foam5", kwargs...) +end -include("../../data/tetra_gear.jl") export tetra_gear -tetra_gear(; kwargs...) = tetra(xe_gear, TETS_gear, Const_gear; kwargs...) +function tetra_gear(; kwargs...) + _ensure_data!(:tetra_gear, "tetra_gear.jl") + tetra(xe_gear, TETS_gear, Const_gear; name = "tetra_gear", kwargs...) +end diff --git a/src/PureJuMP/triangle.jl b/src/PureJuMP/triangle.jl index 7356d2fc..91456c49 100644 --- a/src/PureJuMP/triangle.jl +++ b/src/PureJuMP/triangle.jl @@ -58,14 +58,20 @@ function triangle(x0 = xe, TRIS::Vector{Int64} = Tr, Const::Vector{Int64} = Cons return nlp end -include("../../data/triangle_deer.jl") export triangle_deer -triangle_deer(; kwargs...) = triangle(xe_deer, TRIS_deer, Const_deer; kwargs...) +function triangle_deer(; kwargs...) + _ensure_data!(:triangle_deer, "triangle_deer.jl") + triangle(xe_deer, TRIS_deer, Const_deer; name = "triangle_deer", kwargs...) +end -include("../../data/triangle_pacman.jl") export triangle_pacman -triangle_pacman(; kwargs...) = triangle(xe_pacman, TRIS_pacman, Const_pacman; kwargs...) +function triangle_pacman(; kwargs...) + _ensure_data!(:triangle_pacman, "triangle_pacman.jl") + triangle(xe_pacman, TRIS_pacman, Const_pacman; name = "triangle_pacman", kwargs...) +end -include("../../data/triangle_turtle.jl") export triangle_turtle -triangle_turtle(; kwargs...) = triangle(xe_turtle, TRIS_turtle, Const_turtle; kwargs...) +function triangle_turtle(; kwargs...) + _ensure_data!(:triangle_turtle, "triangle_turtle.jl") + triangle(xe_turtle, TRIS_turtle, Const_turtle; name = "triangle_turtle", kwargs...) +end