Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions data/tetra.jl
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
xe_tetra = [
const _xe_tetra = [
0 0 0
1 0 0
0 1 0
0 0 1
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];
10 changes: 5 additions & 5 deletions data/tetra_duct12.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -23425,7 +23425,7 @@ TETS_duct12 = [
19222 4198 4197 4196 4199
]

Const_duct12 = [
const Const_duct12 = [
1,
2,
3,
Expand Down Expand Up @@ -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))
10 changes: 5 additions & 5 deletions data/tetra_duct15.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -11143,7 +11143,7 @@ TETS_duct15 = [
9000 2139 2138 2137 2136
]

Const_duct15 = [
const Const_duct15 = [
1,
2,
3,
Expand Down Expand Up @@ -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))
10 changes: 5 additions & 5 deletions data/tetra_duct20.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -5175,7 +5175,7 @@ TETS_duct20 = [
4104 1067 1066 1065 1064
]

Const_duct20 = [
const Const_duct20 = [
1,
2,
3,
Expand Down Expand Up @@ -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))
10 changes: 5 additions & 5 deletions data/tetra_foam5.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -6188,7 +6188,7 @@ TETS_foam5 = [
4847 1336 1337 1335 1334
]

Const_foam5 = [
const Const_foam5 = [
1,
2,
3,
Expand Down Expand Up @@ -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))
10 changes: 5 additions & 5 deletions data/tetra_gear.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -3986,7 +3986,7 @@ TETS_gear = [
3116 865 866 864 863
]

Const_gear = [
const Const_gear = [
2,
3,
4,
Expand Down Expand Up @@ -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))
10 changes: 5 additions & 5 deletions data/tetra_hook.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -5869,7 +5869,7 @@ TETS_hook = [
4675 1189 1188 1190 1187
]

Const_hook = [
const Const_hook = [
1,
2,
3,
Expand Down Expand Up @@ -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))
10 changes: 5 additions & 5 deletions data/triangle.jl
Original file line number Diff line number Diff line change
@@ -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];
10 changes: 5 additions & 5 deletions data/triangle_deer.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions data/triangle_pacman.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions data/triangle_turtle.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
19 changes: 17 additions & 2 deletions src/ADNLPProblems/ADNLPProblems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading
Loading