content
stringlengths 5
1.03M
| input_ids
sequencelengths 4
823k
| ratio_char_token
float64 0.4
12.5
| token_count
int64 4
823k
|
---|---|---|---|
using Pkg
Pkg.add(PackageSpec(; url="https://github.com/StructuralEquationModels/StructuralEquationModels.jl", rev = "devel")) | [
3500,
350,
10025,
198,
198,
47,
10025,
13,
2860,
7,
27813,
22882,
7,
26,
19016,
2625,
5450,
1378,
12567,
13,
785,
14,
44909,
1523,
23588,
341,
5841,
1424,
14,
44909,
1523,
23588,
341,
5841,
1424,
13,
20362,
1600,
2710,
796,
366,
2934,
626,
48774
] | 2.886364 | 44 |
"""
What element(s) is this material suitable as a standard for?
"""
struct DBStandardFor
database::SQLite.DB
element::Element
material::Material
end
function Base.write(db::SQLite.DB, ::Type{DBStandardFor}, elm::Element, mat::Union{String, Material, Integer})
if mat isa String
matkey = find(db, Material, mat)
mat = read(db, Material, matkey)
elseif mat isa Material
matkey = write(db, mat)
else
matkey = mat
mat = read(db, Material, matkey)
end
@assert haskey(mat, elm) "The material $mat does not contain the element $elm."
stmt1 = SQLite.Stmt(db, "SELECT * FROM STANDARDFOR WHERE ELEMENT=? AND MATKEY=?;")
q1 = DBInterface.execute(stmt1, ( z(elm), matkey, ) )
if SQLite.done(q1)
stmt1 = SQLite.Stmt(db, "INSERT INTO STANDARDFOR ( ELEMENT, MATKEY ) VALUES ( ?, ? );")
DBInterface.execute(stmt1, ( z(elm), matkey, ) )
end
return lastrowid(q1)
end
function Base.findall(db::SQLite.DB, ::Type{DBStandardFor}, elm::Element)::Array{DBMaterial}
stmt1 = SQLite.Stmt(db, "SELECT * FROM STANDARDFOR WHERE ELEMENT=?;")
q1 = DBInterface.execute(stmt1, ( z(elm), ) )
return [ read(db, r[:MATKEY]) for r in q1 ]
end
| [
37811,
198,
2061,
5002,
7,
82,
8,
318,
428,
2587,
11080,
355,
257,
3210,
329,
30,
198,
37811,
198,
7249,
20137,
23615,
1890,
198,
220,
220,
220,
6831,
3712,
17861,
578,
13,
11012,
198,
220,
220,
220,
5002,
3712,
20180,
198,
220,
220,
220,
2587,
3712,
17518,
198,
437,
198,
198,
8818,
7308,
13,
13564,
7,
9945,
3712,
17861,
578,
13,
11012,
11,
7904,
6030,
90,
11012,
23615,
1890,
5512,
1288,
76,
3712,
20180,
11,
2603,
3712,
38176,
90,
10100,
11,
14633,
11,
34142,
30072,
198,
220,
220,
220,
611,
2603,
318,
64,
10903,
198,
220,
220,
220,
220,
220,
220,
220,
2603,
2539,
796,
1064,
7,
9945,
11,
14633,
11,
2603,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2603,
796,
1100,
7,
9945,
11,
14633,
11,
2603,
2539,
8,
198,
220,
220,
220,
2073,
361,
2603,
318,
64,
14633,
198,
220,
220,
220,
220,
220,
220,
220,
2603,
2539,
796,
3551,
7,
9945,
11,
2603,
8,
198,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
2603,
2539,
796,
2603,
198,
220,
220,
220,
220,
220,
220,
220,
2603,
796,
1100,
7,
9945,
11,
14633,
11,
2603,
2539,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
2488,
30493,
468,
2539,
7,
6759,
11,
1288,
76,
8,
366,
464,
2587,
720,
6759,
857,
407,
3994,
262,
5002,
720,
417,
76,
526,
198,
220,
220,
220,
336,
16762,
16,
796,
16363,
578,
13,
1273,
16762,
7,
9945,
11,
366,
46506,
1635,
16034,
49053,
1503,
8068,
1581,
33411,
40342,
10979,
28,
30,
5357,
36775,
20373,
28,
30,
26,
4943,
198,
220,
220,
220,
10662,
16,
796,
20137,
39317,
13,
41049,
7,
301,
16762,
16,
11,
357,
1976,
7,
417,
76,
828,
2603,
2539,
11,
1267,
1267,
198,
220,
220,
220,
611,
16363,
578,
13,
28060,
7,
80,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
336,
16762,
16,
796,
16363,
578,
13,
1273,
16762,
7,
9945,
11,
366,
20913,
17395,
39319,
49053,
1503,
8068,
1581,
357,
40342,
10979,
11,
36775,
20373,
1267,
26173,
35409,
357,
5633,
11,
5633,
5619,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
20137,
39317,
13,
41049,
7,
301,
16762,
16,
11,
357,
1976,
7,
417,
76,
828,
2603,
2539,
11,
1267,
1267,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1441,
938,
808,
312,
7,
80,
16,
8,
198,
437,
198,
198,
8818,
7308,
13,
19796,
439,
7,
9945,
3712,
17861,
578,
13,
11012,
11,
7904,
6030,
90,
11012,
23615,
1890,
5512,
1288,
76,
3712,
20180,
2599,
25,
19182,
90,
11012,
17518,
92,
198,
220,
220,
220,
336,
16762,
16,
796,
16363,
578,
13,
1273,
16762,
7,
9945,
11,
366,
46506,
1635,
16034,
49053,
1503,
8068,
1581,
33411,
40342,
10979,
28,
30,
26,
4943,
198,
220,
220,
220,
10662,
16,
796,
20137,
39317,
13,
41049,
7,
301,
16762,
16,
11,
357,
1976,
7,
417,
76,
828,
1267,
1267,
198,
220,
220,
220,
1441,
685,
1100,
7,
9945,
11,
374,
58,
25,
41636,
20373,
12962,
329,
374,
287,
10662,
16,
2361,
198,
437,
198
] | 2.424063 | 507 |
print("Enter an upper bound: ")
lower = 0
input = readline()
upper = parse(Int, input)
if upper < 1
throw(DomainError)
end
attempts = 1
print("Think of a number, ", lower, "--", upper, ", then press ENTER.")
readline()
const maxattempts = round(Int, ceil(-log(1 / (upper - lower)) / log(2)))
println("I will need at most ", maxattempts, " attempts ",
"(⌈-log(1 / (", upper, " - ", lower, ")) / log(2)⌉ = ",
maxattempts, ").\n")
previous = -1
guess = -1
while true
previous = guess
guess = lower + round(Int, (upper - lower) / 2, RoundNearestTiesUp)
if guess == previous || attempts > maxattempts
println("\nThis is impossible; did you forget your number?")
exit()
end
print("I guess ", guess, ".\n[l]ower, [h]igher, or [c]orrect? ")
input = chomp(readline())
while input ∉ ["c", "l", "h"]
print("Please enter one of \"c\", \"l\", or \"h\". ")
input = chomp(readline())
end
if input == "l"
upper = guess
elseif input == "h"
lower = guess
else
break
end
attempts += 1
end
println("\nI win after ", attempts, attempts == 1 ? " attempt." : " attempts.")
| [
4798,
7203,
17469,
281,
6727,
5421,
25,
366,
8,
198,
21037,
796,
657,
198,
15414,
796,
1100,
1370,
3419,
198,
45828,
796,
21136,
7,
5317,
11,
5128,
8,
198,
198,
361,
6727,
1279,
352,
198,
220,
220,
220,
3714,
7,
43961,
12331,
8,
198,
437,
198,
198,
1078,
1791,
82,
796,
352,
198,
4798,
7203,
22073,
286,
257,
1271,
11,
33172,
2793,
11,
366,
438,
1600,
6727,
11,
33172,
788,
1803,
46962,
19570,
198,
961,
1370,
3419,
198,
9979,
3509,
1078,
1791,
82,
796,
2835,
7,
5317,
11,
2906,
346,
32590,
6404,
7,
16,
1220,
357,
45828,
532,
2793,
4008,
1220,
2604,
7,
17,
22305,
198,
35235,
7203,
40,
481,
761,
379,
749,
33172,
3509,
1078,
1791,
82,
11,
366,
6370,
33172,
198,
220,
220,
220,
30629,
158,
234,
230,
12,
6404,
7,
16,
1220,
357,
1600,
6727,
11,
366,
532,
33172,
2793,
11,
366,
4008,
1220,
2604,
7,
17,
8,
158,
234,
231,
796,
33172,
198,
220,
220,
220,
3509,
1078,
1791,
82,
11,
366,
737,
59,
77,
4943,
198,
3866,
1442,
796,
532,
16,
198,
5162,
408,
796,
532,
16,
198,
198,
4514,
2081,
198,
220,
220,
220,
2180,
796,
4724,
198,
220,
220,
220,
4724,
796,
2793,
1343,
2835,
7,
5317,
11,
357,
45828,
532,
2793,
8,
1220,
362,
11,
10485,
8199,
12423,
51,
444,
4933,
8,
628,
220,
220,
220,
611,
4724,
6624,
2180,
8614,
6370,
1875,
3509,
1078,
1791,
82,
198,
220,
220,
220,
220,
220,
220,
220,
44872,
7203,
59,
77,
1212,
318,
5340,
26,
750,
345,
6044,
534,
1271,
1701,
8,
198,
220,
220,
220,
220,
220,
220,
220,
8420,
3419,
198,
220,
220,
220,
886,
628,
220,
220,
220,
3601,
7203,
40,
4724,
33172,
4724,
11,
27071,
59,
77,
58,
75,
60,
789,
11,
685,
71,
60,
328,
372,
11,
393,
685,
66,
60,
47315,
30,
366,
8,
198,
220,
220,
220,
5128,
796,
442,
3361,
7,
961,
1370,
28955,
628,
220,
220,
220,
981,
5128,
18872,
231,
14631,
66,
1600,
366,
75,
1600,
366,
71,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
5492,
3802,
530,
286,
19990,
66,
34607,
19990,
75,
34607,
393,
19990,
71,
59,
1911,
366,
8,
198,
220,
220,
220,
220,
220,
220,
220,
5128,
796,
442,
3361,
7,
961,
1370,
28955,
198,
220,
220,
220,
886,
628,
220,
220,
220,
611,
5128,
6624,
366,
75,
1,
198,
220,
220,
220,
220,
220,
220,
220,
6727,
796,
4724,
198,
220,
220,
220,
2073,
361,
5128,
6624,
366,
71,
1,
198,
220,
220,
220,
220,
220,
220,
220,
2793,
796,
4724,
198,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
2270,
198,
220,
220,
220,
886,
628,
220,
220,
220,
6370,
15853,
352,
198,
437,
198,
198,
35235,
7203,
59,
77,
40,
1592,
706,
33172,
6370,
11,
6370,
6624,
352,
5633,
366,
2230,
526,
1058,
366,
6370,
19570,
198
] | 2.466527 | 478 |
function heatbath_SU2!(U,NC,temps,β,Dim=4)
temp1 = temps[1]
temp2 = temps[2]
V = temps[3]
ITERATION_MAX = 10^5
temps2 = Array{Matrix{ComplexF64},1}(undef,5)
for i=1:5
temps2[i] = zeros(ComplexF64,2,2)
end
mapfunc!(A,B) = SU2update_KP!(A,B,β,NC,temps2,ITERATION_MAX)
for μ=1:Dim
loops = loops_staple[(Dim,μ)]
iseven = true
evaluate_gaugelinks_evenodd!(V,loops,U,[temp1,temp2],iseven)
map_U!(U[μ],mapfunc!,V,iseven)
iseven = false
evaluate_gaugelinks_evenodd!(V,loops,U,[temp1,temp2],iseven)
map_U!(U[μ],mapfunc!,V,iseven)
end
end
function heatbath_SU3!(U,NC,temps,β,Dim=4)
temp1 = temps[1]
temp2 = temps[2]
V = temps[3]
ITERATION_MAX = 10^5
temps2 = Array{Matrix{ComplexF64},1}(undef,5)
temps3 = Array{Matrix{ComplexF64},1}(undef,5)
for i=1:5
temps2[i] = zeros(ComplexF64,2,2)
temps3[i] = zeros(ComplexF64,3,3)
end
mapfunc!(A,B) = SU3update_matrix!(A,B,β,NC,temps2,temps3,ITERATION_MAX)
for μ=1:Dim
loops = loops_staple[(Dim,μ)]
iseven = true
evaluate_gaugelinks_evenodd!(V,loops,U,[temp1,temp2],iseven)
map_U!(U[μ],mapfunc!,V,iseven)
iseven = false
evaluate_gaugelinks_evenodd!(V,loops,U,[temp1,temp2],iseven)
map_U!(U[μ],mapfunc!,V,iseven)
end
end
function heatbath_SUN!(U,NC,temps,β,Dim = 4)
#Dim = 4
temp1 = temps[1]
temp2 = temps[2]
V = temps[3]
ITERATION_MAX = 10^5
temps2 = Array{Matrix{ComplexF64},1}(undef,5)
temps3 = Array{Matrix{ComplexF64},1}(undef,5)
for i=1:5
temps2[i] = zeros(ComplexF64,2,2)
temps3[i] = zeros(ComplexF64,NC,NC)
end
mapfunc!(A,B) = SUNupdate_matrix!(A,B,β,NC,temps2,temps3,ITERATION_MAX)
for μ=1:Dim
loops = loops_staple[(Dim,μ)]
iseven = true
evaluate_gaugelinks_evenodd!(V,loops,U,[temp1,temp2],iseven)
map_U!(U[μ],mapfunc!,V,iseven)
iseven = false
evaluate_gaugelinks_evenodd!(V,loops,U,[temp1,temp2],iseven)
map_U!(U[μ],mapfunc!,V,iseven)
end
end
function heatbathtest_4D(NX,NY,NZ,NT,β,NC)
Dim = 4
Nwing = 1
#=
u1 = IdentityGauges(NC,Nwing,NX,NY,NZ,NT)
U = Array{typeof(u1),1}(undef,Dim)
U[1] = u1
for μ=2:Dim
U[μ] = IdentityGauges(NC,Nwing,NX,NY,NZ,NT)
end
=#
U = Initialize_Gaugefields(NC,Nwing,NX,NY,NZ,NT,condition = "cold")
h = Heatbath(U,β)
#=
gauge_action = GaugeAction(U)
plaqloop = make_loops_fromname("plaquette",Dim=Dim)
append!(plaqloop,plaqloop')
βinp = β/2
push!(gauge_action,βinp,plaqloop)
=#
temp1 = similar(U[1])
temp2 = similar(U[1])
temp3 = similar(U[1])
comb = 6
factor = 1/(comb*U[1].NV*U[1].NC)
@time plaq_t = calculate_Plaquette(U,temp1,temp2)*factor
println("plaq_t = $plaq_t")
poly = calculate_Polyakov_loop(U,temp1,temp2)
println("polyakov loop = $(real(poly)) $(imag(poly))")
#hnew = Heatbath_update(U,gauge_action)
plaq_ave = 0.0
numhb = 200
for itrj = 1:numhb
#heatbath!(U,hnew)
heatbath!(U,h)
#=
if NC == 2
heatbath_SU2!(U,NC,[temp1,temp2,temp3],β)
elseif NC == 3
heatbath_SU3!(U,NC,[temp1,temp2,temp3],β)
else
heatbath_SUN!(U,NC,[temp1,temp2,temp3],β)
end
=#
plaq_t = calculate_Plaquette(U,temp1,temp2)*factor
plaq_ave += plaq_t
if itrj % 40 == 0
#@time plaq_t = calculate_Plaquette(U,temp1,temp2)*factor
println("$itrj plaq_t = $plaq_t average: $(plaq_ave/itrj)")
#println("$itrj plaq_t = $plaq_t")
poly = calculate_Polyakov_loop(U,temp1,temp2)
println("$itrj polyakov loop = $(real(poly)) $(imag(poly))")
end
#=
if itrj % 40 == 0
@time plaq_t = calculate_Plaquette(U,temp1,temp2)*factor
println("$itrj plaq_t = $plaq_t")
poly = calculate_Polyakov_loop(U,temp1,temp2)
println("$itrj polyakov loop = $(real(poly)) $(imag(poly))")
end
=#
end
return plaq_ave/numhb
end
function heatbathtest_2D(NX,NT,β,NC)
Dim = 2
Nwing = 1
#=
u1 = RandomGauges(NC,Nwing,NX,NT)
U = Array{typeof(u1),1}(undef,Dim)
U[1] = u1
for μ=2:Dim
U[μ] = RandomGauges(NC,Nwing,NX,NT)
end
=#
U = Initialize_Gaugefields(NC,Nwing,NX,NT,condition = "hot",randomnumber="Reproducible")
temp1 = similar(U[1])
temp2 = similar(U[1])
temp3 = similar(U[1])
#comb = 6
if Dim == 4
comb = 6 #4*3/2
elseif Dim == 3
comb = 3
elseif Dim == 2
comb = 1
else
error("dimension $Dim is not supported")
end
factor = 1/(comb*U[1].NV*U[1].NC)
@time plaq_t = calculate_Plaquette(U,temp1,temp2)*factor
println("plaq_t = $plaq_t")
poly = calculate_Polyakov_loop(U,temp1,temp2)
println("polyakov loop = $(real(poly)) $(imag(poly))")
#=
gauge_action = GaugeAction(U)
plaqloop = make_loops_fromname("plaquette",Dim=Dim)
append!(plaqloop,plaqloop')
βinp = β/2
push!(gauge_action,βinp,plaqloop)
hnew = Heatbath_update(U,gauge_action)
=#
numhb = 200
plaq_ave = 0.0
for itrj = 1:numhb
#heatbath!(U,hnew)
heatbath!(U,[temp1,temp2,temp3],β)
#=
if NC == 2
heatbath_SU2!(U,NC,[temp1,temp2,temp3],β,Dim)
elseif NC == 3
heatbath_SU3!(U,NC,[temp1,temp2,temp3],β,Dim)
else
heatbath_SUN!(U,NC,[temp1,temp2,temp3],β,Dim)
end
=#
plaq_t = calculate_Plaquette(U,temp1,temp2)*factor
plaq_ave += plaq_t
if itrj % 40 == 0
#@time plaq_t = calculate_Plaquette(U,temp1,temp2)*factor
println("$itrj plaq_t = $plaq_t average: $(plaq_ave/itrj)")
#println("$itrj plaq_t = $plaq_t")
poly = calculate_Polyakov_loop(U,temp1,temp2)
println("$itrj polyakov loop = $(real(poly)) $(imag(poly))")
end
#=
if itrj % 40 == 0
@time plaq_t = calculate_Plaquette(U,temp1,temp2)*factor
println("$itrj plaq_t = $plaq_t")
poly = calculate_Polyakov_loop(U,temp1,temp2)
println("$itrj polyakov loop = $(real(poly)) $(imag(poly))")
end
=#
end
return plaq_ave/numhb
end
#eps = 1e-1
println("4D system")
@testset "4D" begin
NX = 4
NY = 4
NZ = 4
NT = 4
Nwing = 1
@testset "NC=2" begin
β = 2.3
NC = 2
println("NC = $NC")
#val =0.6414596466929057
val = 0.6042874193905048
#@time plaq_t = heatbathtest_2D(NX,NT,β,NC)
@time plaq_ave = heatbathtest_4D(NX,NY,NZ,NT,β,NC)
@test abs(plaq_ave-val)/abs(val) < eps
end
@testset "NC=3" begin
β = 5.7
NC = 3
println("NC = $NC")
#val = 0.5779454661484242
val = 0.5616169101071591
#@time plaq_t = heatbathtest_2D(NX,NT,β,NC)
@time plaq_ave = heatbathtest_4D(NX,NY,NZ,NT,β,NC)
@test abs(plaq_ave-val)/abs(val) < eps
end
@testset "NC=4" begin
β = 5.7
NC = 4
println("NC = $NC")
#val =0.19127260002797497
val = 0.1967198548214144
#@time plaq_t = heatbathtest_2D(NX,NT,β,NC)
@time plaq_ave = heatbathtest_4D(NX,NY,NZ,NT,β,NC)
@test abs(plaq_ave-val)/abs(val) < eps
end
end
println("2D system")
@testset "2D" begin
NX = 4
#NY = 4
#NZ = 4
NT = 4
Nwing = 1
@testset "NC=2" begin
β = 2.3
NC = 2
println("NC = $NC")
val = 0.47007878197368624
#@time plaq_t = heatbathtest_2D(NX,NT,β,NC)
@time plaq_ave = heatbathtest_2D(NX,NT,β,NC)
@test abs(plaq_ave-val)/abs(val) < eps
end
@testset "NC=3" begin
β = 5.7
NC = 3
println("NC = $NC")
val = 0.40073421896125794
#@time plaq_t = heatbathtest_2D(NX,NT,β,NC)
@time plaq_ave = heatbathtest_2D(NX,NT,β,NC)
@test abs(plaq_ave-val)/abs(val) < eps
end
@testset "NC=4" begin
β = 5.7
NC = 4
println("NC = $NC")
val = 0.17476796328668975
#@time plaq_t = heatbathtest_2D(NX,NT,β,NC)
@time plaq_ave = heatbathtest_2D(NX,NT,β,NC)
@test abs(plaq_ave-val)/abs(val) < eps
#@test abs(plaq_t-val)/abs(val) < eps
end
end | [
8818,
4894,
37648,
62,
12564,
17,
0,
7,
52,
11,
7792,
11,
11498,
862,
11,
26638,
11,
29271,
28,
19,
8,
628,
220,
220,
220,
20218,
16,
796,
2169,
862,
58,
16,
60,
198,
220,
220,
220,
20218,
17,
796,
2169,
862,
58,
17,
60,
198,
220,
220,
220,
569,
796,
2169,
862,
58,
18,
60,
198,
220,
220,
220,
314,
5781,
6234,
62,
22921,
796,
838,
61,
20,
628,
220,
220,
220,
2169,
862,
17,
796,
15690,
90,
46912,
90,
5377,
11141,
37,
2414,
5512,
16,
92,
7,
917,
891,
11,
20,
8,
220,
198,
220,
220,
220,
329,
1312,
28,
16,
25,
20,
198,
220,
220,
220,
220,
220,
220,
220,
2169,
862,
17,
58,
72,
60,
796,
1976,
27498,
7,
5377,
11141,
37,
2414,
11,
17,
11,
17,
8,
198,
220,
220,
220,
886,
628,
220,
220,
220,
3975,
20786,
0,
7,
32,
11,
33,
8,
796,
13558,
17,
19119,
62,
42,
47,
0,
7,
32,
11,
33,
11,
26638,
11,
7792,
11,
11498,
862,
17,
11,
2043,
1137,
6234,
62,
22921,
8,
628,
220,
220,
220,
329,
18919,
28,
16,
25,
29271,
628,
220,
220,
220,
220,
220,
220,
220,
23607,
796,
23607,
62,
301,
24052,
58,
7,
29271,
11,
34703,
15437,
198,
220,
220,
220,
220,
220,
220,
220,
318,
10197,
796,
2081,
628,
220,
220,
220,
220,
220,
220,
220,
13446,
62,
70,
7493,
417,
2973,
62,
10197,
5088,
0,
7,
53,
11,
5439,
2840,
11,
52,
17414,
29510,
16,
11,
29510,
17,
4357,
786,
574,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3975,
62,
52,
0,
7,
52,
58,
34703,
4357,
8899,
20786,
28265,
53,
11,
786,
574,
8,
220,
628,
220,
220,
220,
220,
220,
220,
220,
318,
10197,
796,
3991,
198,
220,
220,
220,
220,
220,
220,
220,
13446,
62,
70,
7493,
417,
2973,
62,
10197,
5088,
0,
7,
53,
11,
5439,
2840,
11,
52,
17414,
29510,
16,
11,
29510,
17,
4357,
786,
574,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3975,
62,
52,
0,
7,
52,
58,
34703,
4357,
8899,
20786,
28265,
53,
11,
786,
574,
8,
220,
198,
220,
220,
220,
886,
198,
220,
220,
220,
220,
198,
437,
198,
198,
8818,
4894,
37648,
62,
12564,
18,
0,
7,
52,
11,
7792,
11,
11498,
862,
11,
26638,
11,
29271,
28,
19,
8,
198,
220,
220,
220,
20218,
16,
796,
2169,
862,
58,
16,
60,
198,
220,
220,
220,
20218,
17,
796,
2169,
862,
58,
17,
60,
198,
220,
220,
220,
569,
796,
2169,
862,
58,
18,
60,
198,
220,
220,
220,
314,
5781,
6234,
62,
22921,
796,
838,
61,
20,
628,
220,
220,
220,
2169,
862,
17,
796,
15690,
90,
46912,
90,
5377,
11141,
37,
2414,
5512,
16,
92,
7,
917,
891,
11,
20,
8,
220,
198,
220,
220,
220,
2169,
862,
18,
796,
15690,
90,
46912,
90,
5377,
11141,
37,
2414,
5512,
16,
92,
7,
917,
891,
11,
20,
8,
220,
198,
220,
220,
220,
329,
1312,
28,
16,
25,
20,
198,
220,
220,
220,
220,
220,
220,
220,
2169,
862,
17,
58,
72,
60,
796,
1976,
27498,
7,
5377,
11141,
37,
2414,
11,
17,
11,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2169,
862,
18,
58,
72,
60,
796,
1976,
27498,
7,
5377,
11141,
37,
2414,
11,
18,
11,
18,
8,
198,
220,
220,
220,
886,
628,
220,
220,
220,
3975,
20786,
0,
7,
32,
11,
33,
8,
796,
13558,
18,
19119,
62,
6759,
8609,
0,
7,
32,
11,
33,
11,
26638,
11,
7792,
11,
11498,
862,
17,
11,
11498,
862,
18,
11,
2043,
1137,
6234,
62,
22921,
8,
628,
220,
220,
220,
329,
18919,
28,
16,
25,
29271,
628,
220,
220,
220,
220,
220,
220,
220,
23607,
796,
23607,
62,
301,
24052,
58,
7,
29271,
11,
34703,
15437,
198,
220,
220,
220,
220,
220,
220,
220,
318,
10197,
796,
2081,
628,
220,
220,
220,
220,
220,
220,
220,
13446,
62,
70,
7493,
417,
2973,
62,
10197,
5088,
0,
7,
53,
11,
5439,
2840,
11,
52,
17414,
29510,
16,
11,
29510,
17,
4357,
786,
574,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3975,
62,
52,
0,
7,
52,
58,
34703,
4357,
8899,
20786,
28265,
53,
11,
786,
574,
8,
220,
628,
220,
220,
220,
220,
220,
220,
220,
318,
10197,
796,
3991,
198,
220,
220,
220,
220,
220,
220,
220,
13446,
62,
70,
7493,
417,
2973,
62,
10197,
5088,
0,
7,
53,
11,
5439,
2840,
11,
52,
17414,
29510,
16,
11,
29510,
17,
4357,
786,
574,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3975,
62,
52,
0,
7,
52,
58,
34703,
4357,
8899,
20786,
28265,
53,
11,
786,
574,
8,
220,
198,
220,
220,
220,
886,
198,
220,
220,
220,
220,
198,
437,
628,
198,
8818,
4894,
37648,
62,
50,
4944,
0,
7,
52,
11,
7792,
11,
11498,
862,
11,
26638,
11,
29271,
796,
604,
8,
198,
220,
220,
220,
1303,
29271,
796,
604,
198,
220,
220,
220,
20218,
16,
796,
2169,
862,
58,
16,
60,
198,
220,
220,
220,
20218,
17,
796,
2169,
862,
58,
17,
60,
198,
220,
220,
220,
569,
796,
2169,
862,
58,
18,
60,
198,
220,
220,
220,
314,
5781,
6234,
62,
22921,
796,
838,
61,
20,
628,
220,
220,
220,
2169,
862,
17,
796,
15690,
90,
46912,
90,
5377,
11141,
37,
2414,
5512,
16,
92,
7,
917,
891,
11,
20,
8,
220,
198,
220,
220,
220,
2169,
862,
18,
796,
15690,
90,
46912,
90,
5377,
11141,
37,
2414,
5512,
16,
92,
7,
917,
891,
11,
20,
8,
220,
198,
220,
220,
220,
329,
1312,
28,
16,
25,
20,
198,
220,
220,
220,
220,
220,
220,
220,
2169,
862,
17,
58,
72,
60,
796,
1976,
27498,
7,
5377,
11141,
37,
2414,
11,
17,
11,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2169,
862,
18,
58,
72,
60,
796,
1976,
27498,
7,
5377,
11141,
37,
2414,
11,
7792,
11,
7792,
8,
198,
220,
220,
220,
886,
628,
220,
220,
220,
3975,
20786,
0,
7,
32,
11,
33,
8,
796,
35329,
19119,
62,
6759,
8609,
0,
7,
32,
11,
33,
11,
26638,
11,
7792,
11,
11498,
862,
17,
11,
11498,
862,
18,
11,
2043,
1137,
6234,
62,
22921,
8,
628,
220,
220,
220,
329,
18919,
28,
16,
25,
29271,
628,
220,
220,
220,
220,
220,
220,
220,
23607,
796,
23607,
62,
301,
24052,
58,
7,
29271,
11,
34703,
15437,
198,
220,
220,
220,
220,
220,
220,
220,
318,
10197,
796,
2081,
628,
220,
220,
220,
220,
220,
220,
220,
13446,
62,
70,
7493,
417,
2973,
62,
10197,
5088,
0,
7,
53,
11,
5439,
2840,
11,
52,
17414,
29510,
16,
11,
29510,
17,
4357,
786,
574,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3975,
62,
52,
0,
7,
52,
58,
34703,
4357,
8899,
20786,
28265,
53,
11,
786,
574,
8,
220,
628,
220,
220,
220,
220,
220,
220,
220,
318,
10197,
796,
3991,
198,
220,
220,
220,
220,
220,
220,
220,
13446,
62,
70,
7493,
417,
2973,
62,
10197,
5088,
0,
7,
53,
11,
5439,
2840,
11,
52,
17414,
29510,
16,
11,
29510,
17,
4357,
786,
574,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3975,
62,
52,
0,
7,
52,
58,
34703,
4357,
8899,
20786,
28265,
53,
11,
786,
574,
8,
220,
198,
220,
220,
220,
886,
198,
220,
220,
220,
220,
198,
437,
628,
198,
8818,
4894,
37648,
9288,
62,
19,
35,
7,
45,
55,
11,
12805,
11,
37371,
11,
11251,
11,
26638,
11,
7792,
8,
198,
220,
220,
220,
14048,
796,
604,
198,
220,
220,
220,
399,
5469,
796,
352,
628,
220,
220,
220,
1303,
28,
198,
220,
220,
220,
334,
16,
796,
27207,
38,
559,
3212,
7,
7792,
11,
45,
5469,
11,
45,
55,
11,
12805,
11,
37371,
11,
11251,
8,
198,
220,
220,
220,
471,
796,
15690,
90,
4906,
1659,
7,
84,
16,
828,
16,
92,
7,
917,
891,
11,
29271,
8,
198,
220,
220,
220,
471,
58,
16,
60,
796,
334,
16,
198,
220,
220,
220,
329,
18919,
28,
17,
25,
29271,
198,
220,
220,
220,
220,
220,
220,
220,
471,
58,
34703,
60,
796,
27207,
38,
559,
3212,
7,
7792,
11,
45,
5469,
11,
45,
55,
11,
12805,
11,
37371,
11,
11251,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
796,
2,
628,
220,
220,
220,
471,
796,
20768,
1096,
62,
38,
559,
469,
25747,
7,
7792,
11,
45,
5469,
11,
45,
55,
11,
12805,
11,
37371,
11,
11251,
11,
31448,
796,
366,
36673,
4943,
628,
220,
220,
220,
289,
796,
12308,
37648,
7,
52,
11,
26638,
8,
628,
220,
220,
220,
1303,
28,
198,
220,
220,
220,
18266,
62,
2673,
796,
35094,
469,
12502,
7,
52,
8,
198,
220,
220,
220,
458,
30188,
26268,
796,
787,
62,
5439,
2840,
62,
6738,
3672,
7203,
489,
36129,
5857,
1600,
29271,
28,
29271,
8,
198,
220,
220,
220,
24443,
0,
7,
489,
30188,
26268,
11,
489,
30188,
26268,
11537,
198,
220,
220,
220,
27169,
259,
79,
796,
27169,
14,
17,
198,
220,
220,
220,
4574,
0,
7,
70,
559,
469,
62,
2673,
11,
26638,
259,
79,
11,
489,
30188,
26268,
8,
198,
220,
220,
220,
796,
2,
628,
220,
220,
220,
220,
198,
220,
220,
220,
20218,
16,
796,
2092,
7,
52,
58,
16,
12962,
198,
220,
220,
220,
20218,
17,
796,
2092,
7,
52,
58,
16,
12962,
198,
220,
220,
220,
20218,
18,
796,
2092,
7,
52,
58,
16,
12962,
628,
220,
220,
220,
1974,
796,
718,
198,
220,
220,
220,
5766,
796,
352,
29006,
24011,
9,
52,
58,
16,
4083,
27159,
9,
52,
58,
16,
4083,
7792,
8,
198,
220,
220,
220,
2488,
2435,
458,
30188,
62,
83,
796,
15284,
62,
3646,
36129,
5857,
7,
52,
11,
29510,
16,
11,
29510,
17,
27493,
31412,
198,
220,
220,
220,
44872,
7203,
489,
30188,
62,
83,
796,
720,
489,
30188,
62,
83,
4943,
198,
220,
220,
220,
7514,
796,
15284,
62,
34220,
44715,
62,
26268,
7,
52,
11,
29510,
16,
11,
29510,
17,
8,
220,
198,
220,
220,
220,
44872,
7203,
35428,
44715,
9052,
796,
29568,
5305,
7,
35428,
4008,
29568,
48466,
7,
35428,
4008,
4943,
198,
220,
220,
220,
1303,
71,
3605,
796,
12308,
37648,
62,
19119,
7,
52,
11,
70,
559,
469,
62,
2673,
8,
628,
220,
220,
220,
458,
30188,
62,
1015,
796,
657,
13,
15,
198,
220,
220,
220,
997,
71,
65,
796,
939,
198,
220,
220,
220,
329,
340,
81,
73,
796,
352,
25,
22510,
71,
65,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
25080,
37648,
0,
7,
52,
11,
71,
3605,
8,
198,
220,
220,
220,
220,
220,
220,
220,
4894,
37648,
0,
7,
52,
11,
71,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
28,
198,
220,
220,
220,
220,
220,
220,
220,
611,
8823,
6624,
362,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4894,
37648,
62,
12564,
17,
0,
7,
52,
11,
7792,
17414,
29510,
16,
11,
29510,
17,
11,
29510,
18,
4357,
26638,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
361,
8823,
6624,
513,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4894,
37648,
62,
12564,
18,
0,
7,
52,
11,
7792,
17414,
29510,
16,
11,
29510,
17,
11,
29510,
18,
4357,
26638,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4894,
37648,
62,
50,
4944,
0,
7,
52,
11,
7792,
17414,
29510,
16,
11,
29510,
17,
11,
29510,
18,
4357,
26638,
8,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
796,
2,
198,
220,
220,
220,
220,
220,
220,
220,
458,
30188,
62,
83,
796,
15284,
62,
3646,
36129,
5857,
7,
52,
11,
29510,
16,
11,
29510,
17,
27493,
31412,
198,
220,
220,
220,
220,
220,
220,
220,
458,
30188,
62,
1015,
15853,
458,
30188,
62,
83,
628,
220,
220,
220,
220,
220,
220,
220,
611,
340,
81,
73,
4064,
2319,
6624,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
31,
2435,
458,
30188,
62,
83,
796,
15284,
62,
3646,
36129,
5857,
7,
52,
11,
29510,
16,
11,
29510,
17,
27493,
31412,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
44872,
7203,
3,
270,
81,
73,
458,
30188,
62,
83,
796,
720,
489,
30188,
62,
83,
2811,
25,
29568,
489,
30188,
62,
1015,
14,
270,
81,
73,
8,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
35235,
7203,
3,
270,
81,
73,
458,
30188,
62,
83,
796,
720,
489,
30188,
62,
83,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7514,
796,
15284,
62,
34220,
44715,
62,
26268,
7,
52,
11,
29510,
16,
11,
29510,
17,
8,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
44872,
7203,
3,
270,
81,
73,
7514,
44715,
9052,
796,
29568,
5305,
7,
35428,
4008,
29568,
48466,
7,
35428,
4008,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
28,
628,
220,
220,
220,
220,
220,
220,
220,
611,
340,
81,
73,
4064,
2319,
6624,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
2435,
458,
30188,
62,
83,
796,
15284,
62,
3646,
36129,
5857,
7,
52,
11,
29510,
16,
11,
29510,
17,
27493,
31412,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
44872,
7203,
3,
270,
81,
73,
458,
30188,
62,
83,
796,
720,
489,
30188,
62,
83,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7514,
796,
15284,
62,
34220,
44715,
62,
26268,
7,
52,
11,
29510,
16,
11,
29510,
17,
8,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
44872,
7203,
3,
270,
81,
73,
7514,
44715,
9052,
796,
29568,
5305,
7,
35428,
4008,
29568,
48466,
7,
35428,
4008,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
796,
2,
198,
220,
220,
220,
886,
198,
220,
220,
220,
220,
628,
220,
220,
220,
1441,
458,
30188,
62,
1015,
14,
22510,
71,
65,
198,
198,
437,
198,
198,
8818,
4894,
37648,
9288,
62,
17,
35,
7,
45,
55,
11,
11251,
11,
26638,
11,
7792,
8,
198,
220,
220,
220,
14048,
796,
362,
198,
220,
220,
220,
399,
5469,
796,
352,
628,
220,
220,
220,
1303,
28,
198,
220,
220,
220,
334,
16,
796,
14534,
38,
559,
3212,
7,
7792,
11,
45,
5469,
11,
45,
55,
11,
11251,
8,
198,
220,
220,
220,
471,
796,
15690,
90,
4906,
1659,
7,
84,
16,
828,
16,
92,
7,
917,
891,
11,
29271,
8,
198,
220,
220,
220,
471,
58,
16,
60,
796,
334,
16,
198,
220,
220,
220,
329,
18919,
28,
17,
25,
29271,
198,
220,
220,
220,
220,
220,
220,
220,
471,
58,
34703,
60,
796,
14534,
38,
559,
3212,
7,
7792,
11,
45,
5469,
11,
45,
55,
11,
11251,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
796,
2,
628,
220,
220,
220,
471,
796,
20768,
1096,
62,
38,
559,
469,
25747,
7,
7792,
11,
45,
5469,
11,
45,
55,
11,
11251,
11,
31448,
796,
366,
8940,
1600,
25120,
17618,
2625,
6207,
2076,
37369,
4943,
628,
220,
220,
220,
20218,
16,
796,
2092,
7,
52,
58,
16,
12962,
198,
220,
220,
220,
20218,
17,
796,
2092,
7,
52,
58,
16,
12962,
198,
220,
220,
220,
20218,
18,
796,
2092,
7,
52,
58,
16,
12962,
628,
220,
220,
220,
1303,
24011,
796,
718,
198,
220,
220,
220,
611,
14048,
6624,
604,
198,
220,
220,
220,
220,
220,
220,
220,
1974,
796,
718,
1303,
19,
9,
18,
14,
17,
198,
220,
220,
220,
2073,
361,
14048,
6624,
513,
198,
220,
220,
220,
220,
220,
220,
220,
1974,
796,
513,
198,
220,
220,
220,
2073,
361,
14048,
6624,
362,
198,
220,
220,
220,
220,
220,
220,
220,
1974,
796,
352,
198,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
7203,
46156,
720,
29271,
318,
407,
4855,
4943,
198,
220,
220,
220,
886,
628,
220,
220,
220,
5766,
796,
352,
29006,
24011,
9,
52,
58,
16,
4083,
27159,
9,
52,
58,
16,
4083,
7792,
8,
198,
220,
220,
220,
2488,
2435,
458,
30188,
62,
83,
796,
15284,
62,
3646,
36129,
5857,
7,
52,
11,
29510,
16,
11,
29510,
17,
27493,
31412,
198,
220,
220,
220,
44872,
7203,
489,
30188,
62,
83,
796,
720,
489,
30188,
62,
83,
4943,
198,
220,
220,
220,
7514,
796,
15284,
62,
34220,
44715,
62,
26268,
7,
52,
11,
29510,
16,
11,
29510,
17,
8,
220,
198,
220,
220,
220,
44872,
7203,
35428,
44715,
9052,
796,
29568,
5305,
7,
35428,
4008,
29568,
48466,
7,
35428,
4008,
4943,
628,
220,
220,
220,
1303,
28,
198,
220,
220,
220,
18266,
62,
2673,
796,
35094,
469,
12502,
7,
52,
8,
198,
220,
220,
220,
458,
30188,
26268,
796,
787,
62,
5439,
2840,
62,
6738,
3672,
7203,
489,
36129,
5857,
1600,
29271,
28,
29271,
8,
198,
220,
220,
220,
24443,
0,
7,
489,
30188,
26268,
11,
489,
30188,
26268,
11537,
198,
220,
220,
220,
27169,
259,
79,
796,
27169,
14,
17,
198,
220,
220,
220,
4574,
0,
7,
70,
559,
469,
62,
2673,
11,
26638,
259,
79,
11,
489,
30188,
26268,
8,
198,
220,
220,
220,
289,
3605,
796,
12308,
37648,
62,
19119,
7,
52,
11,
70,
559,
469,
62,
2673,
8,
628,
220,
220,
220,
796,
2,
628,
220,
220,
220,
997,
71,
65,
796,
939,
198,
220,
220,
220,
458,
30188,
62,
1015,
796,
657,
13,
15,
198,
220,
220,
220,
329,
340,
81,
73,
796,
352,
25,
22510,
71,
65,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
25080,
37648,
0,
7,
52,
11,
71,
3605,
8,
198,
220,
220,
220,
220,
220,
220,
220,
4894,
37648,
0,
7,
52,
17414,
29510,
16,
11,
29510,
17,
11,
29510,
18,
4357,
26638,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
28,
198,
220,
220,
220,
220,
220,
220,
220,
611,
8823,
6624,
362,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4894,
37648,
62,
12564,
17,
0,
7,
52,
11,
7792,
17414,
29510,
16,
11,
29510,
17,
11,
29510,
18,
4357,
26638,
11,
29271,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
361,
8823,
6624,
513,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4894,
37648,
62,
12564,
18,
0,
7,
52,
11,
7792,
17414,
29510,
16,
11,
29510,
17,
11,
29510,
18,
4357,
26638,
11,
29271,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4894,
37648,
62,
50,
4944,
0,
7,
52,
11,
7792,
17414,
29510,
16,
11,
29510,
17,
11,
29510,
18,
4357,
26638,
11,
29271,
8,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
796,
2,
198,
220,
220,
220,
220,
220,
220,
220,
458,
30188,
62,
83,
796,
15284,
62,
3646,
36129,
5857,
7,
52,
11,
29510,
16,
11,
29510,
17,
27493,
31412,
198,
220,
220,
220,
220,
220,
220,
220,
458,
30188,
62,
1015,
15853,
458,
30188,
62,
83,
628,
220,
220,
220,
220,
220,
220,
220,
611,
340,
81,
73,
4064,
2319,
6624,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
31,
2435,
458,
30188,
62,
83,
796,
15284,
62,
3646,
36129,
5857,
7,
52,
11,
29510,
16,
11,
29510,
17,
27493,
31412,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
44872,
7203,
3,
270,
81,
73,
458,
30188,
62,
83,
796,
720,
489,
30188,
62,
83,
2811,
25,
29568,
489,
30188,
62,
1015,
14,
270,
81,
73,
8,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
35235,
7203,
3,
270,
81,
73,
458,
30188,
62,
83,
796,
720,
489,
30188,
62,
83,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7514,
796,
15284,
62,
34220,
44715,
62,
26268,
7,
52,
11,
29510,
16,
11,
29510,
17,
8,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
44872,
7203,
3,
270,
81,
73,
7514,
44715,
9052,
796,
29568,
5305,
7,
35428,
4008,
29568,
48466,
7,
35428,
4008,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
886,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
28,
198,
220,
220,
220,
220,
220,
220,
220,
611,
340,
81,
73,
4064,
2319,
6624,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
2435,
458,
30188,
62,
83,
796,
15284,
62,
3646,
36129,
5857,
7,
52,
11,
29510,
16,
11,
29510,
17,
27493,
31412,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
44872,
7203,
3,
270,
81,
73,
458,
30188,
62,
83,
796,
720,
489,
30188,
62,
83,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7514,
796,
15284,
62,
34220,
44715,
62,
26268,
7,
52,
11,
29510,
16,
11,
29510,
17,
8,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
44872,
7203,
3,
270,
81,
73,
7514,
44715,
9052,
796,
29568,
5305,
7,
35428,
4008,
29568,
48466,
7,
35428,
4008,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
796,
2,
198,
220,
220,
220,
886,
198,
220,
220,
220,
220,
628,
220,
220,
220,
1441,
458,
30188,
62,
1015,
14,
22510,
71,
65,
198,
198,
437,
198,
198,
2,
25386,
796,
352,
68,
12,
16,
198,
198,
35235,
7203,
19,
35,
1080,
4943,
198,
31,
9288,
2617,
366,
19,
35,
1,
2221,
198,
220,
220,
220,
42482,
796,
604,
198,
220,
220,
220,
6645,
796,
604,
198,
220,
220,
220,
26905,
796,
604,
198,
220,
220,
220,
24563,
796,
604,
198,
220,
220,
220,
399,
5469,
796,
352,
198,
220,
220,
220,
220,
198,
220,
220,
220,
2488,
9288,
2617,
366,
7792,
28,
17,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
27169,
796,
362,
13,
18,
198,
220,
220,
220,
220,
220,
220,
220,
8823,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
44872,
7203,
7792,
796,
720,
7792,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
2100,
796,
15,
13,
2414,
1415,
3270,
2414,
36657,
1959,
43526,
198,
220,
220,
220,
220,
220,
220,
220,
1188,
796,
657,
13,
31916,
2078,
4524,
1129,
25964,
1120,
2780,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
31,
2435,
458,
30188,
62,
83,
796,
4894,
37648,
9288,
62,
17,
35,
7,
45,
55,
11,
11251,
11,
26638,
11,
7792,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
2435,
458,
30188,
62,
1015,
796,
4894,
37648,
9288,
62,
19,
35,
7,
45,
55,
11,
12805,
11,
37371,
11,
11251,
11,
26638,
11,
7792,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2352,
7,
489,
30188,
62,
1015,
12,
2100,
20679,
8937,
7,
2100,
8,
1279,
304,
862,
628,
220,
220,
220,
886,
628,
220,
220,
220,
2488,
9288,
2617,
366,
7792,
28,
18,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
27169,
796,
642,
13,
22,
198,
220,
220,
220,
220,
220,
220,
220,
8823,
796,
513,
198,
220,
220,
220,
220,
220,
220,
220,
44872,
7203,
7792,
796,
720,
7792,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
2100,
796,
657,
13,
20,
40393,
34229,
2791,
1415,
5705,
27877,
198,
220,
220,
220,
220,
220,
220,
220,
1188,
796,
657,
13,
3980,
1433,
1433,
6420,
486,
2998,
1314,
6420,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
31,
2435,
458,
30188,
62,
83,
796,
4894,
37648,
9288,
62,
17,
35,
7,
45,
55,
11,
11251,
11,
26638,
11,
7792,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
2435,
458,
30188,
62,
1015,
796,
4894,
37648,
9288,
62,
19,
35,
7,
45,
55,
11,
12805,
11,
37371,
11,
11251,
11,
26638,
11,
7792,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2352,
7,
489,
30188,
62,
1015,
12,
2100,
20679,
8937,
7,
2100,
8,
1279,
304,
862,
198,
220,
220,
220,
886,
628,
220,
220,
220,
2488,
9288,
2617,
366,
7792,
28,
19,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
27169,
796,
642,
13,
22,
198,
220,
220,
220,
220,
220,
220,
220,
8823,
796,
604,
198,
220,
220,
220,
220,
220,
220,
220,
44872,
7203,
7792,
796,
720,
7792,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
2100,
220,
796,
15,
13,
1129,
16799,
2075,
830,
1983,
5607,
38073,
198,
220,
220,
220,
220,
220,
220,
220,
1188,
796,
657,
13,
42830,
29110,
2780,
22291,
18444,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
31,
2435,
458,
30188,
62,
83,
796,
4894,
37648,
9288,
62,
17,
35,
7,
45,
55,
11,
11251,
11,
26638,
11,
7792,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
2435,
458,
30188,
62,
1015,
796,
4894,
37648,
9288,
62,
19,
35,
7,
45,
55,
11,
12805,
11,
37371,
11,
11251,
11,
26638,
11,
7792,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2352,
7,
489,
30188,
62,
1015,
12,
2100,
20679,
8937,
7,
2100,
8,
1279,
304,
862,
198,
220,
220,
220,
886,
628,
198,
198,
437,
628,
198,
35235,
7203,
17,
35,
1080,
4943,
198,
31,
9288,
2617,
366,
17,
35,
1,
2221,
198,
220,
220,
220,
42482,
796,
604,
198,
220,
220,
220,
1303,
12805,
796,
604,
198,
220,
220,
220,
1303,
37371,
796,
604,
198,
220,
220,
220,
24563,
796,
604,
198,
220,
220,
220,
399,
5469,
796,
352,
198,
220,
220,
220,
220,
198,
220,
220,
220,
2488,
9288,
2617,
366,
7792,
28,
17,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
27169,
796,
362,
13,
18,
198,
220,
220,
220,
220,
220,
220,
220,
8823,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
44872,
7203,
7792,
796,
720,
7792,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
1188,
796,
657,
13,
2857,
405,
3695,
3695,
24991,
2623,
4521,
1731,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
31,
2435,
458,
30188,
62,
83,
796,
4894,
37648,
9288,
62,
17,
35,
7,
45,
55,
11,
11251,
11,
26638,
11,
7792,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
2435,
458,
30188,
62,
1015,
796,
4894,
37648,
9288,
62,
17,
35,
7,
45,
55,
11,
11251,
11,
26638,
11,
7792,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2352,
7,
489,
30188,
62,
1015,
12,
2100,
20679,
8937,
7,
2100,
8,
1279,
304,
862,
198,
220,
220,
220,
886,
628,
220,
220,
220,
2488,
9288,
2617,
366,
7792,
28,
18,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
27169,
796,
642,
13,
22,
198,
220,
220,
220,
220,
220,
220,
220,
8823,
796,
513,
198,
220,
220,
220,
220,
220,
220,
220,
44872,
7203,
7792,
796,
720,
7792,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
1188,
796,
657,
13,
7029,
22,
2682,
28727,
4846,
1065,
3553,
5824,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
31,
2435,
458,
30188,
62,
83,
796,
4894,
37648,
9288,
62,
17,
35,
7,
45,
55,
11,
11251,
11,
26638,
11,
7792,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
2435,
458,
30188,
62,
1015,
796,
4894,
37648,
9288,
62,
17,
35,
7,
45,
55,
11,
11251,
11,
26638,
11,
7792,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2352,
7,
489,
30188,
62,
1015,
12,
2100,
20679,
8937,
7,
2100,
8,
1279,
304,
862,
198,
220,
220,
220,
886,
628,
220,
220,
220,
2488,
9288,
2617,
366,
7792,
28,
19,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
27169,
796,
642,
13,
22,
198,
220,
220,
220,
220,
220,
220,
220,
8823,
796,
604,
198,
220,
220,
220,
220,
220,
220,
220,
44872,
7203,
7792,
796,
720,
7792,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
1188,
796,
657,
13,
1558,
2857,
3134,
4846,
34256,
2791,
4531,
2425,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
31,
2435,
458,
30188,
62,
83,
796,
4894,
37648,
9288,
62,
17,
35,
7,
45,
55,
11,
11251,
11,
26638,
11,
7792,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
2435,
458,
30188,
62,
1015,
796,
4894,
37648,
9288,
62,
17,
35,
7,
45,
55,
11,
11251,
11,
26638,
11,
7792,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2352,
7,
489,
30188,
62,
1015,
12,
2100,
20679,
8937,
7,
2100,
8,
1279,
304,
862,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
31,
9288,
2352,
7,
489,
30188,
62,
83,
12,
2100,
20679,
8937,
7,
2100,
8,
1279,
304,
862,
198,
220,
220,
220,
886,
628,
198,
437
] | 1.786351 | 4,821 |
struct Angle
i :: Int64
j :: Int64
k :: Int64
ktheta :: Float64
theta0 :: Float64
kub :: Float64
s0 :: Float64
end
| [
198,
7249,
42375,
628,
220,
220,
1312,
7904,
2558,
2414,
198,
220,
220,
474,
7904,
2558,
2414,
198,
220,
220,
479,
7904,
2558,
2414,
628,
220,
220,
479,
1169,
8326,
7904,
48436,
2414,
198,
220,
220,
262,
8326,
15,
7904,
48436,
2414,
198,
220,
220,
220,
198,
220,
220,
479,
549,
7904,
48436,
2414,
198,
220,
220,
264,
15,
7904,
48436,
2414,
198,
198,
437,
628
] | 2.19697 | 66 |
using Configurations
import TOML
import Pluto
export SliderServerSettings, ExportSettings, PlutoDeploySettings, get_configuration
using TerminalLoggers: TerminalLogger
using Logging: global_logger
using FromFile
@from "./ConfigurationDocs.jl" import @extract_docs, get_kwdocs, list_options_md
@extract_docs @option struct SliderServerSettings
enabled::Bool = true
"List of notebook files to skip. Provide paths relative to `start_dir`. *If `Export.enabled` is `true` (default), then only paths in `SliderServer_exclude ∩ Export_exclude` will be skipped, paths in `setdiff(SliderServer_exclude, Export_exclude)` will be shut down after exporting.*"
exclude::Vector = String[]
"Port to run the HTTP server on."
port::Integer = 2345
"""Often set to `"0.0.0.0"` on a server."""
host::Any = "127.0.0.1"
"Watch the input directory for file changes, and update the slider server sessions automatically. Only takes effect when running the slider server. More info in the README."
watch_dir::Bool = true
"Besides handling slider server request, should we also run a static file server of the export output folder? Set to `false` if you are serving the HTML files in another way, e.g. using GitHub Pages, and, for some reason, you do not want to *also* serve the HTML files using this serve."
serve_static_export_folder::Bool = true
simulated_lag::Real = 0
end
@extract_docs @option struct ExportSettings
"Generate static HTML files? This setting can only be `false` if you are also running a slider server."
enabled::Bool = true
"Folder to write generated HTML files to (will create directories to preserve the input folder structure). The behaviour of the default value depends on whether you are running the slider server, or just exporting. If running the slider server, we use a temporary directory; otherwise, we use `start_dir` (i.e. we generate each HTML file in the same folder as the notebook file)."
output_dir::Union{Nothing,String} = nothing
"List of notebook files to skip. Provide paths relative to `start_dir`."
exclude::Vector{String} = String[]
"List of notebook files that should always re-run, skipping the `cache_dir` system. Provide paths relative to `start_dir`."
ignore_cache::Vector = String[]
"base64-encode the state object and write it inside the .html file. If `false`, a separate `.plutostate` file is generated. A separate statefile allows us to show a loading bar in pluto while the statefile is loading, but it can complicate setup in some environments."
baked_state::Bool = true
baked_notebookfile::Bool = true
"Hide all buttons and toolbars in Pluto to make it look like an article."
disable_ui::Bool = true
"""Show a "Run on Binder" button on the notebooks."""
offer_binder::Bool = true
"""If 1) you are using this setup to export HTML files for notebooks, AND 2) you are running the slider server **on another setup/computer**, then this setting should be the URL pointing to the slider server, e.g. `"https://sliderserver.mycoolproject.org/"`. For example, you need this if you use GitHub Actions and GitHub Pages to generate HTML files, with a slider server on DigitalOcean. === If you only have *one* server for both the static exports and the slider server, and people will read notebooks directly on your server, then the default value `nothing` will work: it will automatically make the HTML files use their current domain for the slider server."""
slider_server_url::Union{Nothing,String} = nothing
"If provided, use this directory to read and write cached notebook states. Caches will be indexed by the hash of the notebook file, but you need to take care to invalidate the cache when Pluto or this export script updates. Useful in combination with https://github.com/actions/cache, see https://github.com/JuliaPluto/static-export-template for an example."
cache_dir::Union{Nothing,String} = nothing
"Automatically generate an `index.html` file, listing all the exported notebooks (only if no `index.jl` or `index.html` file exists already)."
create_index::Bool = true
"""ADVANCED: URL of the binder repository to load when you click the "Run on binder" button in the top right, this will be set automatically if you leave it at the default value. This setting is quite advanced, and only makes sense if you have a fork of `https://github.com/fonsp/pluto-on-binder/` (because you want to control the binder launch, or because you are using your own fork of Pluto). If so, the setting should be of the form `"https://mybinder.org/v2/gh/fonsp/pluto-on-binder/v0.17.2"`, where `fonsp/pluto-on-binder` is the name of your repository, and `v0.17.2` is a tag or commit hash."""
binder_url::Union{Nothing,String} = nothing
pluto_cdn_root::Union{Nothing,String} = nothing
end
@option struct PlutoDeploySettings
SliderServer::SliderServerSettings = SliderServerSettings()
Export::ExportSettings = ExportSettings()
Pluto::Pluto.Configuration.Options = Pluto.Configuration.Options()
end
function get_configuration(
toml_path::Union{Nothing,String}=nothing;
kwargs...,
)::PlutoDeploySettings
# we set `Pluto_server_notebook_path_suggestion=joinpath(homedir(),"")` to because the default value for this setting changes when the pwd changes. This causes our run_git_directory to exit... Not necessary for Pluto 0.17.3 and up.
if !isnothing(toml_path) && isfile(toml_path)
Configurations.from_toml(
PlutoDeploySettings,
toml_path;
Pluto_server_notebook_path_suggestion=joinpath(homedir(), ""),
kwargs...,
)
else
Configurations.from_kwargs(
PlutoDeploySettings;
Pluto_server_notebook_path_suggestion=joinpath(homedir(), ""),
kwargs...,
)
end
end
merge_recursive(a::AbstractDict, b::AbstractDict) = mergewith(merge_recursive, a, b)
merge_recursive(a, b) = b | [
3500,
17056,
20074,
198,
11748,
41526,
43,
198,
11748,
32217,
198,
39344,
3454,
1304,
10697,
26232,
11,
36472,
26232,
11,
32217,
49322,
26232,
11,
651,
62,
11250,
3924,
198,
3500,
24523,
11187,
5355,
25,
24523,
11187,
1362,
198,
3500,
5972,
2667,
25,
3298,
62,
6404,
1362,
198,
3500,
3574,
8979,
198,
31,
6738,
366,
19571,
38149,
23579,
82,
13,
20362,
1,
1330,
2488,
2302,
974,
62,
31628,
11,
651,
62,
46265,
31628,
11,
1351,
62,
25811,
62,
9132,
628,
198,
31,
2302,
974,
62,
31628,
2488,
18076,
2878,
3454,
1304,
10697,
26232,
198,
220,
220,
220,
9343,
3712,
33,
970,
796,
2081,
198,
220,
220,
220,
366,
8053,
286,
20922,
3696,
284,
14267,
13,
44290,
13532,
3585,
284,
4600,
9688,
62,
15908,
44646,
1635,
1532,
4600,
43834,
13,
25616,
63,
318,
4600,
7942,
63,
357,
12286,
828,
788,
691,
13532,
287,
4600,
11122,
1304,
10697,
62,
1069,
9152,
18872,
102,
36472,
62,
1069,
9152,
63,
481,
307,
26684,
11,
13532,
287,
4600,
2617,
26069,
7,
11122,
1304,
10697,
62,
1069,
9152,
11,
36472,
62,
1069,
9152,
8,
63,
481,
307,
4423,
866,
706,
39133,
15885,
1,
198,
220,
220,
220,
19607,
3712,
38469,
796,
10903,
21737,
198,
220,
220,
220,
366,
13924,
284,
1057,
262,
14626,
4382,
319,
526,
198,
220,
220,
220,
2493,
3712,
46541,
796,
2242,
2231,
198,
220,
220,
220,
37227,
37288,
900,
284,
4600,
1,
15,
13,
15,
13,
15,
13,
15,
1,
63,
319,
257,
4382,
526,
15931,
198,
220,
220,
220,
2583,
3712,
7149,
796,
366,
16799,
13,
15,
13,
15,
13,
16,
1,
198,
220,
220,
220,
366,
10723,
262,
5128,
8619,
329,
2393,
2458,
11,
290,
4296,
262,
28982,
4382,
10991,
6338,
13,
5514,
2753,
1245,
618,
2491,
262,
28982,
4382,
13,
3125,
7508,
287,
262,
20832,
11682,
526,
198,
220,
220,
220,
2342,
62,
15908,
3712,
33,
970,
796,
2081,
198,
220,
220,
220,
366,
23937,
9041,
28982,
4382,
2581,
11,
815,
356,
635,
1057,
257,
9037,
2393,
4382,
286,
262,
10784,
5072,
9483,
30,
5345,
284,
4600,
9562,
63,
611,
345,
389,
7351,
262,
11532,
3696,
287,
1194,
835,
11,
304,
13,
70,
13,
1262,
21722,
28221,
11,
290,
11,
329,
617,
1738,
11,
345,
466,
407,
765,
284,
1635,
14508,
9,
4691,
262,
11532,
3696,
1262,
428,
4691,
526,
198,
220,
220,
220,
4691,
62,
12708,
62,
39344,
62,
43551,
3712,
33,
970,
796,
2081,
198,
220,
220,
220,
28590,
62,
30909,
3712,
15633,
796,
657,
198,
437,
198,
198,
31,
2302,
974,
62,
31628,
2488,
18076,
2878,
36472,
26232,
198,
220,
220,
220,
366,
8645,
378,
9037,
11532,
3696,
30,
770,
4634,
460,
691,
307,
4600,
9562,
63,
611,
345,
389,
635,
2491,
257,
28982,
4382,
526,
198,
220,
220,
220,
9343,
3712,
33,
970,
796,
2081,
198,
220,
220,
220,
366,
41092,
284,
3551,
7560,
11532,
3696,
284,
357,
10594,
2251,
29196,
284,
12201,
262,
5128,
9483,
4645,
737,
383,
9172,
286,
262,
4277,
1988,
8338,
319,
1771,
345,
389,
2491,
262,
28982,
4382,
11,
393,
655,
39133,
13,
1002,
2491,
262,
28982,
4382,
11,
356,
779,
257,
8584,
8619,
26,
4306,
11,
356,
779,
4600,
9688,
62,
15908,
63,
357,
72,
13,
68,
13,
356,
7716,
1123,
11532,
2393,
287,
262,
976,
9483,
355,
262,
20922,
2393,
21387,
198,
220,
220,
220,
5072,
62,
15908,
3712,
38176,
90,
18465,
11,
10100,
92,
796,
2147,
198,
220,
220,
220,
366,
8053,
286,
20922,
3696,
284,
14267,
13,
44290,
13532,
3585,
284,
4600,
9688,
62,
15908,
63,
526,
198,
220,
220,
220,
19607,
3712,
38469,
90,
10100,
92,
796,
10903,
21737,
198,
220,
220,
220,
366,
8053,
286,
20922,
3696,
326,
815,
1464,
302,
12,
5143,
11,
31017,
262,
4600,
23870,
62,
15908,
63,
1080,
13,
44290,
13532,
3585,
284,
4600,
9688,
62,
15908,
63,
526,
198,
220,
220,
220,
8856,
62,
23870,
3712,
38469,
796,
10903,
21737,
198,
220,
220,
220,
366,
8692,
2414,
12,
268,
8189,
262,
1181,
2134,
290,
3551,
340,
2641,
262,
764,
6494,
2393,
13,
1002,
4600,
9562,
47671,
257,
4553,
4600,
13,
489,
315,
455,
378,
63,
2393,
318,
7560,
13,
317,
4553,
1181,
7753,
3578,
514,
284,
905,
257,
11046,
2318,
287,
458,
9390,
981,
262,
1181,
7753,
318,
11046,
11,
475,
340,
460,
45058,
9058,
287,
617,
12493,
526,
198,
220,
220,
220,
22979,
62,
5219,
3712,
33,
970,
796,
2081,
198,
220,
220,
220,
22979,
62,
11295,
2070,
7753,
3712,
33,
970,
796,
2081,
198,
220,
220,
220,
366,
38518,
477,
12163,
290,
2891,
34046,
287,
32217,
284,
787,
340,
804,
588,
281,
2708,
526,
198,
220,
220,
220,
15560,
62,
9019,
3712,
33,
970,
796,
2081,
198,
220,
220,
220,
37227,
15307,
257,
366,
10987,
319,
347,
5540,
1,
4936,
319,
262,
43935,
526,
15931,
198,
220,
220,
220,
2897,
62,
65,
5540,
3712,
33,
970,
796,
2081,
198,
220,
220,
220,
37227,
1532,
352,
8,
345,
389,
1262,
428,
9058,
284,
10784,
11532,
3696,
329,
43935,
11,
5357,
362,
8,
345,
389,
2491,
262,
28982,
4382,
12429,
261,
1194,
9058,
14,
33215,
1174,
11,
788,
428,
4634,
815,
307,
262,
10289,
10609,
284,
262,
28982,
4382,
11,
304,
13,
70,
13,
4600,
1,
5450,
1378,
6649,
4157,
18497,
13,
1820,
24494,
16302,
13,
2398,
30487,
44646,
1114,
1672,
11,
345,
761,
428,
611,
345,
779,
21722,
24439,
290,
21722,
28221,
284,
7716,
11532,
3696,
11,
351,
257,
28982,
4382,
319,
10231,
46607,
13,
24844,
1002,
345,
691,
423,
1635,
505,
9,
4382,
329,
1111,
262,
9037,
15319,
290,
262,
28982,
4382,
11,
290,
661,
481,
1100,
43935,
3264,
319,
534,
4382,
11,
788,
262,
4277,
1988,
4600,
22366,
63,
481,
670,
25,
340,
481,
6338,
787,
262,
11532,
3696,
779,
511,
1459,
7386,
329,
262,
28982,
4382,
526,
15931,
198,
220,
220,
220,
28982,
62,
15388,
62,
6371,
3712,
38176,
90,
18465,
11,
10100,
92,
796,
2147,
198,
220,
220,
220,
366,
1532,
2810,
11,
779,
428,
8619,
284,
1100,
290,
3551,
39986,
20922,
2585,
13,
327,
3694,
481,
307,
41497,
416,
262,
12234,
286,
262,
20922,
2393,
11,
475,
345,
761,
284,
1011,
1337,
284,
12515,
378,
262,
12940,
618,
32217,
393,
428,
10784,
4226,
5992,
13,
49511,
287,
6087,
351,
3740,
1378,
12567,
13,
785,
14,
4658,
14,
23870,
11,
766,
3740,
1378,
12567,
13,
785,
14,
16980,
544,
3646,
9390,
14,
12708,
12,
39344,
12,
28243,
329,
281,
1672,
526,
198,
220,
220,
220,
12940,
62,
15908,
3712,
38176,
90,
18465,
11,
10100,
92,
796,
2147,
198,
220,
220,
220,
366,
38062,
4142,
7716,
281,
4600,
9630,
13,
6494,
63,
2393,
11,
13487,
477,
262,
29050,
43935,
357,
8807,
611,
645,
4600,
9630,
13,
20362,
63,
393,
4600,
9630,
13,
6494,
63,
2393,
7160,
1541,
21387,
198,
220,
220,
220,
2251,
62,
9630,
3712,
33,
970,
796,
2081,
198,
220,
220,
220,
37227,
2885,
53,
20940,
1961,
25,
10289,
286,
262,
275,
5540,
16099,
284,
3440,
618,
345,
3904,
262,
366,
10987,
319,
275,
5540,
1,
4936,
287,
262,
1353,
826,
11,
428,
481,
307,
900,
6338,
611,
345,
2666,
340,
379,
262,
4277,
1988,
13,
770,
4634,
318,
2407,
6190,
11,
290,
691,
1838,
2565,
611,
345,
423,
257,
15563,
286,
4600,
5450,
1378,
12567,
13,
785,
14,
69,
684,
79,
14,
489,
9390,
12,
261,
12,
65,
5540,
14,
63,
357,
13893,
345,
765,
284,
1630,
262,
275,
5540,
4219,
11,
393,
780,
345,
389,
1262,
534,
898,
15563,
286,
32217,
737,
1002,
523,
11,
262,
4634,
815,
307,
286,
262,
1296,
4600,
1,
5450,
1378,
1820,
65,
5540,
13,
2398,
14,
85,
17,
14,
456,
14,
69,
684,
79,
14,
489,
9390,
12,
261,
12,
65,
5540,
14,
85,
15,
13,
1558,
13,
17,
1,
47671,
810,
4600,
69,
684,
79,
14,
489,
9390,
12,
261,
12,
65,
5540,
63,
318,
262,
1438,
286,
534,
16099,
11,
290,
4600,
85,
15,
13,
1558,
13,
17,
63,
318,
257,
7621,
393,
4589,
12234,
526,
15931,
198,
220,
220,
220,
275,
5540,
62,
6371,
3712,
38176,
90,
18465,
11,
10100,
92,
796,
2147,
198,
220,
220,
220,
458,
9390,
62,
32341,
62,
15763,
3712,
38176,
90,
18465,
11,
10100,
92,
796,
2147,
198,
437,
198,
198,
31,
18076,
2878,
32217,
49322,
26232,
198,
220,
220,
220,
3454,
1304,
10697,
3712,
11122,
1304,
10697,
26232,
796,
3454,
1304,
10697,
26232,
3419,
198,
220,
220,
220,
36472,
3712,
43834,
26232,
796,
36472,
26232,
3419,
198,
220,
220,
220,
32217,
3712,
3646,
9390,
13,
38149,
13,
29046,
796,
32217,
13,
38149,
13,
29046,
3419,
198,
437,
198,
198,
8818,
651,
62,
11250,
3924,
7,
198,
220,
220,
220,
284,
4029,
62,
6978,
3712,
38176,
90,
18465,
11,
10100,
92,
28,
22366,
26,
198,
220,
220,
220,
479,
86,
22046,
986,
11,
198,
2599,
25,
3646,
9390,
49322,
26232,
198,
220,
220,
220,
1303,
356,
900,
4600,
3646,
9390,
62,
15388,
62,
11295,
2070,
62,
6978,
62,
47811,
295,
28,
22179,
6978,
7,
71,
12657,
343,
3419,
553,
4943,
63,
284,
780,
262,
4277,
1988,
329,
428,
4634,
2458,
618,
262,
279,
16993,
2458,
13,
770,
5640,
674,
1057,
62,
18300,
62,
34945,
284,
8420,
986,
1892,
3306,
329,
32217,
657,
13,
1558,
13,
18,
290,
510,
13,
198,
220,
220,
220,
611,
5145,
271,
22366,
7,
39532,
75,
62,
6978,
8,
11405,
318,
7753,
7,
39532,
75,
62,
6978,
8,
198,
220,
220,
220,
220,
220,
220,
220,
17056,
20074,
13,
6738,
62,
39532,
75,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32217,
49322,
26232,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
284,
4029,
62,
6978,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32217,
62,
15388,
62,
11295,
2070,
62,
6978,
62,
47811,
295,
28,
22179,
6978,
7,
71,
12657,
343,
22784,
366,
12340,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
479,
86,
22046,
986,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
17056,
20074,
13,
6738,
62,
46265,
22046,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32217,
49322,
26232,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32217,
62,
15388,
62,
11295,
2070,
62,
6978,
62,
47811,
295,
28,
22179,
6978,
7,
71,
12657,
343,
22784,
366,
12340,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
479,
86,
22046,
986,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
886,
198,
437,
198,
198,
647,
469,
62,
8344,
30753,
7,
64,
3712,
23839,
35,
713,
11,
275,
3712,
23839,
35,
713,
8,
796,
4017,
39909,
342,
7,
647,
469,
62,
8344,
30753,
11,
257,
11,
275,
8,
198,
647,
469,
62,
8344,
30753,
7,
64,
11,
275,
8,
796,
275
] | 3.315031 | 1,803 |
# Residual equation for linear systems
linear_residual!(R, A, x, b) = R .= A * x - b
## Fully-simultaneous Newton method
#==========================================================================================#
# Coupled aero-structural-load-factor residuals
function coupled_residuals!(R, all_horsies, Γs, U, Ω, speed, stiffness_matrix, δs, fem_loads, weight, load_factor, L)
# Get residual vector views
R_A = R.aerodynamics
R_S = R.structures
R_W = @view R[end]
# Aerodynamic residuals
@timeit "Aerodynamic Residuals" solve_nonlinear!(R_A, all_horsies, Γs / speed, U / speed, Ω / speed)
# Structural residuals
@timeit "Structural Residuals" linear_residual!(R_S, stiffness_matrix, δs, fem_loads)
# Weight residual
linear_residual!(R_W, weight, load_factor, L)
nothing
end
# Residual setup for multiple aerostructural surfaces and multiple aerodynamic surfaces
function solve_coupled_residual!(R, x, speed, β, ρ, Ω, syms :: Vector{Symbol}, chord_meshes, camber_meshes, fem_meshes, other_horsies, stiffness_matrix, weight, load_factor)
# Unpack aerodynamic and structural variables
Γs = x.aerodynamics
δs = x.structures
α = x.load_factor
# Compute velocity with new angle of attack
U = freestream_to_cartesian(-speed, α, β)
# Compute displacements
Δs = map((key, fem_mesh) -> reshape(δs[key][7:end], 6, length(fem_mesh)), valkeys(δs), fem_meshes)
# @timeit "Get Translations" dxs =
# @timeit "Get Rotations" Ts =
# New VLM variables
@timeit "New Horseshoes" new_horsies = @. new_horseshoes(mesh_translation(Δs), mesh_rotation(Δs), chord_meshes, camber_meshes, fem_meshes)
# Compute component forces for structural residual
@timeit "Get Circulations" new_Γs = getindex.(Ref(Γs), syms)
@timeit "Get Aerodynamic Centers" new_acs = map(horsies -> bound_leg_center.(horsies), new_horsies)
@timeit "All Horseshoes" all_horsies = [ mapreduce(vec, vcat, new_horsies); vec(other_horsies) ]
@timeit "New Forces" new_forces = map((Γ_comp, hs_comp) -> surface_forces(hs_comp, Γ_comp, all_horsies, Γs, U, Ω, ρ), new_Γs, new_horsies)
# Compute other forces for load factor residual
@timeit "Get Symbols" other_syms = filter(sym -> !(sym ∈ syms), keys(Γs))
@timeit "Get Other Circulations" other_Γs = mapreduce(sym -> vec(getindex(Γs, sym)), vcat, other_syms)
@timeit "Other Forces" other_forces = surface_forces(vec(other_horsies), other_Γs, all_horsies, Γs, U, Ω, ρ)
# Compute lift
@timeit "All Forces" vlm_forces = [ mapreduce(vec, vcat, new_forces); vec(other_forces) ]
@timeit "Transform Summed Forces" D, Y, L = geometry_to_wind_axes(sum(vlm_forces), α, β)
# Build force vector with constraint for structures
@timeit "FEM Loads" fem_loads = mapreduce(vec ∘ fem_load_vector, vcat, new_acs, new_forces, fem_meshes)
# Compute residuals
@timeit "Compute Residuals" coupled_residuals!(R, all_horsies, Γs, U, Ω, speed, stiffness_matrix, δs, fem_loads, weight, load_factor, L * cos(α))
return R
end
# Residual setup for single aerostructural surface
function solve_coupled_residual!(R, x, speed, β, ρ, Ω, chord_mesh, camber_mesh, fem_mesh, stiffness_matrix, weight, load_factor)
# Unpack aerodynamic and structural variables
Γ = x.aerodynamics
δ = x.structures
α = x.load_factor
# Compute velocity with new angle of attack
U = freestream_to_cartesian(-speed, α, β)
# Compute displacements
Δs = δ.displacement
dxs = mesh_translation(Δs)
Ts = mesh_rotation(Δs)
# New VLM variables
@timeit "New Horseshoes" new_horsies = new_horseshoes(dxs, Ts, chord_mesh, camber_mesh, fem_mesh)
# Compute aerodynamic forces
@timeit "Surface Forces" vlm_forces = surface_forces(new_horsies, Γ, U, Ω, ρ)
# Compute structural residual and loads
@timeit "FEM Loads" fem_loads = fem_load_vector(bound_leg_center.(new_horsies), vlm_forces, fem_mesh)
# Compute lift for load factor residual
D, Y, L = geometry_to_wind_axes(sum(vlm_forces), α, β)
# Compute residuals
coupled_residuals!(R, new_horsies, Γ, U, Ω, speed, stiffness_matrix, δ, fem_loads, weight, load_factor, L * cos(α))
return R
end
# # Residual setup for single aerostructural surface and multiple aerodynamic surfaces
# function solve_coupled_residual!(R, x, speed, β, ρ, Ω, chord_mesh, camber_mesh, other_horsies, fem_mesh, stiffness_matrix, weight, load_factor)
# # Unpack aerodynamic and structural variables
# Γ = x.aerodynamics
# δ = x.structures
# α = x.load_factor
# # Get residual vector views
# R_A = R.aerodynamics
# R_S = R.structures
# R_W = @view R[end]
# # Compute velocity with new angle of attack
# U = freestream_to_cartesian(-speed, α, β)
# # Compute displacements
# δs = @views reshape(δ[7:end], 6, length(fem_mesh))
# dxs = mesh_translation(Δs)
# Ts = mesh_rotation(Δs)
# # New VLM variables
# new_horsies = new_horseshoes(dxs, Ts, chord_mesh, camber_mesh, fem_mesh)
# @timeit "Combine Horseshoes" all_horsies = [ vec(new_horsies); other_horsies ]
# # Compute aerodynamic residual and loads
# @timeit "Surface Forces" vlm_forces = surface_forces(Γ, all_horsies, U, Ω, ρ)
# @timeit "FEM Forces" new_forces = @views reshape(vlm_forces[1:length(new_horsies)], size(new_horsies))
# # Compute structural residual and loads
# @timeit "FEM Loads" fem_loads = fem_load_vector(bound_leg_center.(new_horsies), new_forces, fem_mesh)
# # Compute lift for load factor residual
# D, Y, L = geometry_to_wind_axes(sum(vlm_forces), α, β)
# # Compute residuals
# coupled_residuals!(R, all_horsies, Γ, U, Ω, speed, stiffness_matrix, δ, fem_loads, weight, load_factor, L * cos(α))
# return R
# end
# Residual setup for multiple aerostructural surfaces (NEED TO REDUCE REDUNDANCIES)
# function solve_coupled_residual!(R, x, speed, β, ρ, Ω, syms :: Vector{Symbol}, chord_meshes, camber_meshes, fem_meshes, stiffness_matrix, weight, load_factor)
# # Unpack aerodynamic and structural variables
# Γs = x.aerodynamics
# δs = x.structures
# α = x.load_factor
# # Compute velocity with new angle of attack
# U = freestream_to_cartesian(-speed, α, β)
# # Compute displacements
# Δs = map((key, n) -> reshape(δs[key][7:end], 6, n), valkeys(δs), length.(fem_meshes))
# dxs = mesh_translation.(Δs)
# Ts = mesh_rotation.(Δs)
# # New VLM variables
# new_horsies = new_horseshoes.(dxs, Ts, chord_meshes, camber_meshes, fem_meshes)
# all_horsies = mapreduce(vec, vcat, new_horsies)
# # Compute component forces for structural residual
# new_Γs = getindex.(Ref(Γs), syms)
# new_acs = map(horsies -> bound_leg_center.(horsies), new_horsies)
# @timeit "New Forces" new_forces = surface_forces.(new_Γs, new_horsies, Ref(Γs), Ref(all_horsies), Ref(U), Ref(Ω), Ref(ρ))
# # Compute lift
# D, Y, L = geometry_to_wind_axes(sum(mapreduce(vec, vcat, new_forces)), α, β)
# # Build force vector with constraint for structures
# @timeit "FEM Loads" fem_loads = mapreduce(fem_load_vector, vcat, new_acs, new_forces, fem_meshes)
# # Compute residuals
# coupled_residuals!(R, all_horsies, Γs, U, Ω, speed, stiffness_matrix, δs, fem_loads, weight, load_factor, L * cos(α))
# return R
# end
## Nonlinear block Gauss-Seidel
#==========================================================================================#
function aerostruct_gauss_seidel(x0, speed, β, ρ, Ω, chord_mesh, camber_mesh, fem_mesh, stiffness_matrix, weight, load_factor; max_iters = 50, tol = 1e-9)
x = deepcopy(x0)
ε = 1e5
for i = 1:max_iters
xp = deepcopy(x)
@show xp
Γ = @views x.aerodynamics
δ = @views x.structures
α = @views x.load_factor
# Compute velocity with new angle of attack
U = freestream_to_cartesian(-speed, α, β)
# Compute displacements
δs = δ.displacement
dxs = mesh_translation(δs)
Ts = mesh_rotation(δs)
# New geometric variables
new_horsies = new_horseshoes(dxs, Ts, chord_mesh, camber_mesh, fem_mesh)
# Solve circulations
Γ = reshape(influence_matrix(vec(new_horsies), -U / speed) \ boundary_condition(quasi_steady_freestream(vec(new_horsies), U, Ω), horseshoe_normal.(vec(new_horsies))), size(new_horsies))
x.aerodynamics = Γ
@show x
# Compute VLM forces
vlm_forces = surface_forces(Γ, new_horsies, U, Ω, ρ)
# Compute FEM loads
fem_loads = fem_load_vector(bound_leg_center.(new_horsies), vlm_forces, fem_mesh)
# Solve displacements
δ = reshape(stiffness_matrix \ vec(fem_loads), size(fem_loads))
x.structures = δ
@show x
# Compute lift
D, Y, L = geometry_to_wind_axes(sum(vlm_forces), α, β)
# Weight residual
α = acos(abs(weight * load_factor - L) / (weight * load_factor))
x.load_factor = α
@show L
ε = LinearAlgebra.norm(x - xp)
@show (i, ε)
if ε <= tol return x end # Needs NAN checks and everything like NLsolve
end
return x
end | [
2,
1874,
312,
723,
16022,
329,
14174,
3341,
198,
29127,
62,
411,
312,
723,
0,
7,
49,
11,
317,
11,
2124,
11,
275,
8,
796,
371,
764,
28,
317,
1635,
2124,
532,
275,
198,
198,
2235,
40234,
12,
14323,
9560,
516,
17321,
2446,
198,
2,
23926,
4770,
2559,
855,
2,
198,
198,
2,
15062,
10137,
257,
3529,
12,
7249,
1523,
12,
2220,
12,
31412,
29598,
82,
198,
8818,
18064,
62,
411,
312,
723,
82,
0,
7,
49,
11,
477,
62,
71,
669,
444,
11,
7377,
241,
82,
11,
471,
11,
7377,
102,
11,
2866,
11,
49586,
62,
6759,
8609,
11,
7377,
112,
82,
11,
2796,
62,
46030,
11,
3463,
11,
3440,
62,
31412,
11,
406,
8,
198,
220,
220,
220,
1303,
3497,
29598,
15879,
5009,
198,
220,
220,
220,
371,
62,
32,
796,
371,
13,
25534,
44124,
198,
220,
220,
220,
371,
62,
50,
796,
371,
13,
7249,
942,
198,
220,
220,
220,
371,
62,
54,
796,
2488,
1177,
371,
58,
437,
60,
628,
220,
220,
220,
1303,
15781,
34743,
29598,
82,
198,
220,
220,
220,
2488,
2435,
270,
366,
32,
263,
34743,
1874,
312,
723,
82,
1,
8494,
62,
13159,
29127,
0,
7,
49,
62,
32,
11,
477,
62,
71,
669,
444,
11,
7377,
241,
82,
1220,
2866,
11,
471,
1220,
2866,
11,
7377,
102,
1220,
2866,
8,
628,
220,
220,
220,
1303,
32112,
1523,
29598,
82,
198,
220,
220,
220,
2488,
2435,
270,
366,
44909,
1523,
1874,
312,
723,
82,
1,
14174,
62,
411,
312,
723,
0,
7,
49,
62,
50,
11,
49586,
62,
6759,
8609,
11,
7377,
112,
82,
11,
2796,
62,
46030,
8,
628,
220,
220,
220,
1303,
14331,
29598,
198,
220,
220,
220,
14174,
62,
411,
312,
723,
0,
7,
49,
62,
54,
11,
3463,
11,
3440,
62,
31412,
11,
406,
8,
628,
220,
220,
220,
2147,
198,
437,
198,
198,
2,
1874,
312,
723,
9058,
329,
3294,
9551,
455,
1356,
1523,
16649,
290,
3294,
9551,
34743,
16649,
198,
8818,
8494,
62,
66,
280,
10137,
62,
411,
312,
723,
0,
7,
49,
11,
2124,
11,
2866,
11,
27169,
11,
18074,
223,
11,
7377,
102,
11,
827,
907,
7904,
20650,
90,
13940,
23650,
5512,
25594,
62,
6880,
956,
11,
269,
7789,
62,
6880,
956,
11,
2796,
62,
6880,
956,
11,
584,
62,
71,
669,
444,
11,
49586,
62,
6759,
8609,
11,
3463,
11,
3440,
62,
31412,
8,
198,
220,
220,
220,
1303,
791,
8002,
9551,
34743,
290,
13204,
9633,
198,
220,
220,
220,
7377,
241,
82,
796,
2124,
13,
25534,
44124,
198,
220,
220,
220,
7377,
112,
82,
796,
2124,
13,
7249,
942,
198,
220,
220,
220,
26367,
220,
796,
2124,
13,
2220,
62,
31412,
628,
220,
220,
220,
1303,
3082,
1133,
15432,
351,
649,
9848,
286,
1368,
198,
220,
220,
220,
471,
796,
2030,
395,
1476,
62,
1462,
62,
26674,
35610,
32590,
12287,
11,
26367,
11,
27169,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
3082,
1133,
7845,
28613,
198,
220,
220,
220,
37455,
82,
220,
220,
220,
796,
3975,
19510,
2539,
11,
2796,
62,
76,
5069,
8,
4613,
27179,
1758,
7,
138,
112,
82,
58,
2539,
7131,
22,
25,
437,
4357,
718,
11,
4129,
7,
69,
368,
62,
76,
5069,
36911,
1188,
13083,
7,
138,
112,
82,
828,
2796,
62,
6880,
956,
8,
198,
220,
220,
220,
1303,
2488,
2435,
270,
366,
3855,
3602,
49905,
1,
288,
34223,
220,
220,
796,
220,
198,
220,
220,
220,
1303,
2488,
2435,
270,
366,
3855,
18481,
602,
1,
13146,
220,
220,
220,
796,
220,
628,
220,
220,
220,
1303,
968,
569,
31288,
9633,
198,
220,
220,
220,
2488,
2435,
270,
366,
3791,
367,
669,
5069,
3028,
1,
649,
62,
71,
669,
444,
796,
2488,
13,
649,
62,
71,
669,
5069,
3028,
7,
76,
5069,
62,
41519,
7,
138,
242,
82,
828,
19609,
62,
10599,
341,
7,
138,
242,
82,
828,
25594,
62,
6880,
956,
11,
269,
7789,
62,
6880,
956,
11,
2796,
62,
6880,
956,
8,
628,
220,
220,
220,
1303,
3082,
1133,
7515,
3386,
329,
13204,
29598,
198,
220,
220,
220,
2488,
2435,
270,
366,
3855,
7672,
5768,
1,
649,
62,
138,
241,
82,
220,
220,
220,
220,
220,
220,
796,
651,
9630,
12195,
8134,
7,
138,
241,
82,
828,
827,
907,
8,
220,
198,
220,
220,
220,
2488,
2435,
270,
366,
3855,
15781,
34743,
22223,
1,
649,
62,
16436,
220,
220,
220,
220,
220,
796,
3975,
7,
71,
669,
444,
4613,
5421,
62,
1455,
62,
16159,
12195,
71,
669,
444,
828,
649,
62,
71,
669,
444,
8,
198,
220,
220,
220,
2488,
2435,
270,
366,
3237,
367,
669,
5069,
3028,
1,
477,
62,
71,
669,
444,
220,
796,
685,
3975,
445,
7234,
7,
35138,
11,
410,
9246,
11,
649,
62,
71,
669,
444,
1776,
43030,
7,
847,
62,
71,
669,
444,
8,
2361,
628,
220,
220,
220,
2488,
2435,
270,
366,
3791,
12700,
1,
649,
62,
27087,
220,
220,
796,
3975,
19510,
138,
241,
62,
5589,
11,
289,
82,
62,
5589,
8,
4613,
4417,
62,
27087,
7,
11994,
62,
5589,
11,
7377,
241,
62,
5589,
11,
477,
62,
71,
669,
444,
11,
7377,
241,
82,
11,
471,
11,
7377,
102,
11,
18074,
223,
828,
649,
62,
138,
241,
82,
11,
649,
62,
71,
669,
444,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
3082,
1133,
584,
3386,
329,
3440,
5766,
29598,
198,
220,
220,
220,
2488,
2435,
270,
366,
3855,
41327,
10220,
1,
584,
62,
1837,
907,
220,
220,
796,
8106,
7,
37047,
4613,
5145,
7,
37047,
18872,
230,
827,
907,
828,
8251,
7,
138,
241,
82,
4008,
198,
220,
220,
220,
2488,
2435,
270,
366,
3855,
3819,
7672,
5768,
1,
584,
62,
138,
241,
82,
220,
220,
220,
220,
796,
3975,
445,
7234,
7,
37047,
4613,
43030,
7,
1136,
9630,
7,
138,
241,
82,
11,
5659,
36911,
410,
9246,
11,
584,
62,
1837,
907,
8,
198,
220,
220,
220,
2488,
2435,
270,
366,
6395,
12700,
1,
584,
62,
27087,
796,
4417,
62,
27087,
7,
35138,
7,
847,
62,
71,
669,
444,
828,
584,
62,
138,
241,
82,
11,
477,
62,
71,
669,
444,
11,
7377,
241,
82,
11,
471,
11,
7377,
102,
11,
18074,
223,
8,
628,
220,
220,
220,
1303,
3082,
1133,
10303,
198,
220,
220,
220,
2488,
2435,
270,
366,
3237,
12700,
1,
410,
75,
76,
62,
27087,
796,
685,
3975,
445,
7234,
7,
35138,
11,
410,
9246,
11,
649,
62,
27087,
1776,
43030,
7,
847,
62,
27087,
8,
2361,
198,
220,
220,
220,
2488,
2435,
270,
366,
41762,
5060,
1150,
12700,
1,
360,
11,
575,
11,
406,
796,
22939,
62,
1462,
62,
7972,
62,
897,
274,
7,
16345,
7,
19279,
76,
62,
27087,
828,
26367,
11,
27169,
8,
628,
220,
220,
220,
1303,
10934,
2700,
15879,
351,
32315,
329,
8573,
198,
220,
220,
220,
2488,
2435,
270,
366,
37,
3620,
8778,
82,
1,
2796,
62,
46030,
796,
3975,
445,
7234,
7,
35138,
18872,
246,
2796,
62,
2220,
62,
31364,
11,
410,
9246,
11,
649,
62,
16436,
11,
649,
62,
27087,
11,
2796,
62,
6880,
956,
8,
628,
220,
220,
220,
1303,
3082,
1133,
29598,
82,
198,
220,
220,
220,
2488,
2435,
270,
366,
7293,
1133,
1874,
312,
723,
82,
1,
18064,
62,
411,
312,
723,
82,
0,
7,
49,
11,
477,
62,
71,
669,
444,
11,
7377,
241,
82,
11,
471,
11,
7377,
102,
11,
2866,
11,
49586,
62,
6759,
8609,
11,
7377,
112,
82,
11,
2796,
62,
46030,
11,
3463,
11,
3440,
62,
31412,
11,
406,
1635,
8615,
7,
17394,
4008,
628,
220,
220,
220,
1441,
371,
198,
437,
198,
198,
2,
1874,
312,
723,
9058,
329,
2060,
9551,
455,
1356,
1523,
4417,
198,
8818,
8494,
62,
66,
280,
10137,
62,
411,
312,
723,
0,
7,
49,
11,
2124,
11,
2866,
11,
27169,
11,
18074,
223,
11,
7377,
102,
11,
25594,
62,
76,
5069,
11,
269,
7789,
62,
76,
5069,
11,
2796,
62,
76,
5069,
11,
49586,
62,
6759,
8609,
11,
3463,
11,
3440,
62,
31412,
8,
198,
220,
220,
220,
1303,
791,
8002,
9551,
34743,
290,
13204,
9633,
198,
220,
220,
220,
7377,
241,
796,
2124,
13,
25534,
44124,
198,
220,
220,
220,
7377,
112,
796,
2124,
13,
7249,
942,
198,
220,
220,
220,
26367,
796,
2124,
13,
2220,
62,
31412,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
3082,
1133,
15432,
351,
649,
9848,
286,
1368,
198,
220,
220,
220,
471,
796,
2030,
395,
1476,
62,
1462,
62,
26674,
35610,
32590,
12287,
11,
26367,
11,
27169,
8,
628,
220,
220,
220,
1303,
3082,
1133,
7845,
28613,
198,
220,
220,
220,
37455,
82,
220,
796,
7377,
112,
13,
6381,
489,
5592,
198,
220,
220,
220,
288,
34223,
796,
19609,
62,
41519,
7,
138,
242,
82,
8,
198,
220,
220,
220,
13146,
220,
796,
19609,
62,
10599,
341,
7,
138,
242,
82,
8,
628,
220,
220,
220,
1303,
968,
569,
31288,
9633,
198,
220,
220,
220,
2488,
2435,
270,
366,
3791,
367,
669,
5069,
3028,
1,
649,
62,
71,
669,
444,
796,
649,
62,
71,
669,
5069,
3028,
7,
67,
34223,
11,
13146,
11,
25594,
62,
76,
5069,
11,
269,
7789,
62,
76,
5069,
11,
2796,
62,
76,
5069,
8,
628,
220,
220,
220,
1303,
3082,
1133,
9551,
34743,
3386,
198,
220,
220,
220,
2488,
2435,
270,
366,
14214,
2550,
12700,
1,
410,
75,
76,
62,
27087,
796,
4417,
62,
27087,
7,
3605,
62,
71,
669,
444,
11,
7377,
241,
11,
471,
11,
7377,
102,
11,
18074,
223,
8,
628,
220,
220,
220,
1303,
3082,
1133,
13204,
29598,
290,
15989,
198,
220,
220,
220,
2488,
2435,
270,
366,
37,
3620,
8778,
82,
1,
2796,
62,
46030,
796,
2796,
62,
2220,
62,
31364,
7,
7784,
62,
1455,
62,
16159,
12195,
3605,
62,
71,
669,
444,
828,
410,
75,
76,
62,
27087,
11,
2796,
62,
76,
5069,
8,
628,
220,
220,
220,
1303,
3082,
1133,
10303,
329,
3440,
5766,
29598,
198,
220,
220,
220,
360,
11,
575,
11,
406,
796,
22939,
62,
1462,
62,
7972,
62,
897,
274,
7,
16345,
7,
19279,
76,
62,
27087,
828,
26367,
11,
27169,
8,
628,
220,
220,
220,
1303,
3082,
1133,
29598,
82,
198,
220,
220,
220,
18064,
62,
411,
312,
723,
82,
0,
7,
49,
11,
649,
62,
71,
669,
444,
11,
7377,
241,
11,
471,
11,
7377,
102,
11,
2866,
11,
49586,
62,
6759,
8609,
11,
7377,
112,
11,
2796,
62,
46030,
11,
3463,
11,
3440,
62,
31412,
11,
406,
1635,
8615,
7,
17394,
4008,
628,
220,
220,
220,
1441,
371,
198,
437,
198,
198,
2,
1303,
1874,
312,
723,
9058,
329,
2060,
9551,
455,
1356,
1523,
4417,
290,
3294,
9551,
34743,
16649,
198,
2,
2163,
8494,
62,
66,
280,
10137,
62,
411,
312,
723,
0,
7,
49,
11,
2124,
11,
2866,
11,
27169,
11,
18074,
223,
11,
7377,
102,
11,
25594,
62,
76,
5069,
11,
269,
7789,
62,
76,
5069,
11,
584,
62,
71,
669,
444,
11,
2796,
62,
76,
5069,
11,
49586,
62,
6759,
8609,
11,
3463,
11,
3440,
62,
31412,
8,
198,
2,
220,
220,
220,
220,
1303,
791,
8002,
9551,
34743,
290,
13204,
9633,
198,
2,
220,
220,
220,
220,
7377,
241,
796,
2124,
13,
25534,
44124,
198,
2,
220,
220,
220,
220,
7377,
112,
796,
2124,
13,
7249,
942,
198,
2,
220,
220,
220,
220,
26367,
796,
2124,
13,
2220,
62,
31412,
198,
198,
2,
220,
220,
220,
220,
1303,
3497,
29598,
15879,
5009,
198,
2,
220,
220,
220,
220,
371,
62,
32,
796,
371,
13,
25534,
44124,
198,
2,
220,
220,
220,
220,
371,
62,
50,
796,
371,
13,
7249,
942,
198,
2,
220,
220,
220,
220,
371,
62,
54,
796,
2488,
1177,
371,
58,
437,
60,
198,
198,
2,
220,
220,
220,
220,
1303,
3082,
1133,
15432,
351,
649,
9848,
286,
1368,
198,
2,
220,
220,
220,
220,
471,
796,
2030,
395,
1476,
62,
1462,
62,
26674,
35610,
32590,
12287,
11,
26367,
11,
27169,
8,
198,
220,
220,
220,
220,
198,
2,
220,
220,
220,
220,
1303,
3082,
1133,
7845,
28613,
198,
2,
220,
220,
220,
220,
7377,
112,
82,
220,
796,
2488,
33571,
27179,
1758,
7,
138,
112,
58,
22,
25,
437,
4357,
718,
11,
4129,
7,
69,
368,
62,
76,
5069,
4008,
198,
2,
220,
220,
220,
220,
288,
34223,
796,
19609,
62,
41519,
7,
138,
242,
82,
8,
198,
2,
220,
220,
220,
220,
13146,
220,
796,
19609,
62,
10599,
341,
7,
138,
242,
82,
8,
198,
198,
2,
220,
220,
220,
220,
1303,
968,
569,
31288,
9633,
198,
2,
220,
220,
220,
220,
649,
62,
71,
669,
444,
796,
649,
62,
71,
669,
5069,
3028,
7,
67,
34223,
11,
13146,
11,
25594,
62,
76,
5069,
11,
269,
7789,
62,
76,
5069,
11,
2796,
62,
76,
5069,
8,
198,
2,
220,
220,
220,
220,
2488,
2435,
270,
366,
20575,
500,
367,
669,
5069,
3028,
1,
477,
62,
71,
669,
444,
796,
685,
43030,
7,
3605,
62,
71,
669,
444,
1776,
584,
62,
71,
669,
444,
2361,
198,
198,
2,
220,
220,
220,
220,
1303,
3082,
1133,
9551,
34743,
29598,
290,
15989,
198,
2,
220,
220,
220,
220,
2488,
2435,
270,
366,
14214,
2550,
12700,
1,
410,
75,
76,
62,
27087,
796,
4417,
62,
27087,
7,
138,
241,
11,
477,
62,
71,
669,
444,
11,
471,
11,
7377,
102,
11,
18074,
223,
8,
198,
198,
2,
220,
220,
220,
220,
2488,
2435,
270,
366,
37,
3620,
12700,
1,
649,
62,
27087,
796,
2488,
33571,
27179,
1758,
7,
19279,
76,
62,
27087,
58,
16,
25,
13664,
7,
3605,
62,
71,
669,
444,
8,
4357,
2546,
7,
3605,
62,
71,
669,
444,
4008,
198,
198,
2,
220,
220,
220,
220,
1303,
3082,
1133,
13204,
29598,
290,
15989,
198,
2,
220,
220,
220,
220,
2488,
2435,
270,
366,
37,
3620,
8778,
82,
1,
2796,
62,
46030,
796,
2796,
62,
2220,
62,
31364,
7,
7784,
62,
1455,
62,
16159,
12195,
3605,
62,
71,
669,
444,
828,
649,
62,
27087,
11,
2796,
62,
76,
5069,
8,
198,
198,
2,
220,
220,
220,
220,
1303,
3082,
1133,
10303,
329,
3440,
5766,
29598,
198,
2,
220,
220,
220,
220,
360,
11,
575,
11,
406,
796,
22939,
62,
1462,
62,
7972,
62,
897,
274,
7,
16345,
7,
19279,
76,
62,
27087,
828,
26367,
11,
27169,
8,
198,
198,
2,
220,
220,
220,
220,
1303,
3082,
1133,
29598,
82,
198,
2,
220,
220,
220,
220,
18064,
62,
411,
312,
723,
82,
0,
7,
49,
11,
477,
62,
71,
669,
444,
11,
7377,
241,
11,
471,
11,
7377,
102,
11,
2866,
11,
49586,
62,
6759,
8609,
11,
7377,
112,
11,
2796,
62,
46030,
11,
3463,
11,
3440,
62,
31412,
11,
406,
1635,
8615,
7,
17394,
4008,
198,
198,
2,
220,
220,
220,
220,
1441,
371,
198,
2,
886,
198,
198,
2,
1874,
312,
723,
9058,
329,
3294,
9551,
455,
1356,
1523,
16649,
357,
12161,
1961,
5390,
23848,
52,
5222,
23848,
4944,
35,
20940,
11015,
8,
198,
2,
2163,
8494,
62,
66,
280,
10137,
62,
411,
312,
723,
0,
7,
49,
11,
2124,
11,
2866,
11,
27169,
11,
18074,
223,
11,
7377,
102,
11,
827,
907,
7904,
20650,
90,
13940,
23650,
5512,
25594,
62,
6880,
956,
11,
269,
7789,
62,
6880,
956,
11,
2796,
62,
6880,
956,
11,
49586,
62,
6759,
8609,
11,
3463,
11,
3440,
62,
31412,
8,
198,
2,
220,
220,
220,
220,
1303,
791,
8002,
9551,
34743,
290,
13204,
9633,
198,
2,
220,
220,
220,
220,
7377,
241,
82,
796,
2124,
13,
25534,
44124,
198,
2,
220,
220,
220,
220,
7377,
112,
82,
796,
2124,
13,
7249,
942,
198,
2,
220,
220,
220,
220,
26367,
220,
796,
2124,
13,
2220,
62,
31412,
198,
198,
2,
220,
220,
220,
220,
1303,
3082,
1133,
15432,
351,
649,
9848,
286,
1368,
198,
2,
220,
220,
220,
220,
471,
796,
2030,
395,
1476,
62,
1462,
62,
26674,
35610,
32590,
12287,
11,
26367,
11,
27169,
8,
198,
220,
220,
220,
220,
198,
2,
220,
220,
220,
220,
1303,
3082,
1133,
7845,
28613,
198,
2,
220,
220,
220,
220,
37455,
82,
220,
220,
220,
796,
3975,
19510,
2539,
11,
299,
8,
4613,
27179,
1758,
7,
138,
112,
82,
58,
2539,
7131,
22,
25,
437,
4357,
718,
11,
299,
828,
1188,
13083,
7,
138,
112,
82,
828,
4129,
12195,
69,
368,
62,
6880,
956,
4008,
198,
2,
220,
220,
220,
220,
288,
34223,
220,
220,
796,
19609,
62,
41519,
12195,
138,
242,
82,
8,
198,
2,
220,
220,
220,
220,
13146,
220,
220,
220,
796,
19609,
62,
10599,
341,
12195,
138,
242,
82,
8,
198,
198,
2,
220,
220,
220,
220,
1303,
968,
569,
31288,
9633,
198,
2,
220,
220,
220,
220,
649,
62,
71,
669,
444,
220,
796,
649,
62,
71,
669,
5069,
3028,
12195,
67,
34223,
11,
13146,
11,
25594,
62,
6880,
956,
11,
269,
7789,
62,
6880,
956,
11,
2796,
62,
6880,
956,
8,
198,
2,
220,
220,
220,
220,
477,
62,
71,
669,
444,
220,
796,
3975,
445,
7234,
7,
35138,
11,
410,
9246,
11,
649,
62,
71,
669,
444,
8,
198,
198,
2,
220,
220,
220,
220,
1303,
3082,
1133,
7515,
3386,
329,
13204,
29598,
198,
2,
220,
220,
220,
220,
649,
62,
138,
241,
82,
220,
220,
220,
220,
220,
220,
796,
651,
9630,
12195,
8134,
7,
138,
241,
82,
828,
827,
907,
8,
220,
198,
2,
220,
220,
220,
220,
649,
62,
16436,
220,
220,
220,
220,
220,
796,
3975,
7,
71,
669,
444,
4613,
5421,
62,
1455,
62,
16159,
12195,
71,
669,
444,
828,
649,
62,
71,
669,
444,
8,
198,
2,
220,
220,
220,
220,
2488,
2435,
270,
366,
3791,
12700,
1,
649,
62,
27087,
796,
4417,
62,
27087,
12195,
3605,
62,
138,
241,
82,
11,
649,
62,
71,
669,
444,
11,
6524,
7,
138,
241,
82,
828,
6524,
7,
439,
62,
71,
669,
444,
828,
6524,
7,
52,
828,
6524,
7,
138,
102,
828,
6524,
7,
33643,
4008,
198,
198,
2,
220,
220,
220,
220,
1303,
3082,
1133,
10303,
198,
2,
220,
220,
220,
220,
360,
11,
575,
11,
406,
796,
22939,
62,
1462,
62,
7972,
62,
897,
274,
7,
16345,
7,
8899,
445,
7234,
7,
35138,
11,
410,
9246,
11,
649,
62,
27087,
36911,
26367,
11,
27169,
8,
198,
198,
2,
220,
220,
220,
220,
1303,
10934,
2700,
15879,
351,
32315,
329,
8573,
198,
2,
220,
220,
220,
220,
2488,
2435,
270,
366,
37,
3620,
8778,
82,
1,
2796,
62,
46030,
796,
3975,
445,
7234,
7,
69,
368,
62,
2220,
62,
31364,
11,
410,
9246,
11,
649,
62,
16436,
11,
649,
62,
27087,
11,
2796,
62,
6880,
956,
8,
198,
198,
2,
220,
220,
220,
220,
1303,
3082,
1133,
29598,
82,
198,
2,
220,
220,
220,
220,
18064,
62,
411,
312,
723,
82,
0,
7,
49,
11,
477,
62,
71,
669,
444,
11,
7377,
241,
82,
11,
471,
11,
7377,
102,
11,
2866,
11,
49586,
62,
6759,
8609,
11,
7377,
112,
82,
11,
2796,
62,
46030,
11,
3463,
11,
3440,
62,
31412,
11,
406,
1635,
8615,
7,
17394,
4008,
198,
198,
2,
220,
220,
220,
220,
1441,
371,
198,
2,
886,
628,
198,
2235,
8504,
29127,
2512,
12822,
1046,
12,
4653,
5943,
198,
2,
23926,
4770,
2559,
855,
2,
198,
198,
8818,
9551,
455,
1356,
62,
4908,
1046,
62,
325,
5943,
7,
87,
15,
11,
2866,
11,
27169,
11,
18074,
223,
11,
7377,
102,
11,
25594,
62,
76,
5069,
11,
269,
7789,
62,
76,
5069,
11,
2796,
62,
76,
5069,
11,
49586,
62,
6759,
8609,
11,
3463,
11,
3440,
62,
31412,
26,
3509,
62,
270,
364,
796,
2026,
11,
284,
75,
796,
352,
68,
12,
24,
8,
198,
220,
220,
220,
2124,
796,
2769,
30073,
7,
87,
15,
8,
198,
220,
220,
220,
7377,
113,
796,
352,
68,
20,
198,
220,
220,
220,
329,
1312,
796,
352,
25,
9806,
62,
270,
364,
198,
220,
220,
220,
220,
220,
220,
220,
36470,
796,
2769,
30073,
7,
87,
8,
628,
220,
220,
220,
220,
220,
220,
220,
2488,
12860,
36470,
628,
220,
220,
220,
220,
220,
220,
220,
7377,
241,
796,
2488,
33571,
2124,
13,
25534,
44124,
198,
220,
220,
220,
220,
220,
220,
220,
7377,
112,
796,
2488,
33571,
2124,
13,
7249,
942,
198,
220,
220,
220,
220,
220,
220,
220,
26367,
796,
2488,
33571,
2124,
13,
2220,
62,
31412,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
3082,
1133,
15432,
351,
649,
9848,
286,
1368,
198,
220,
220,
220,
220,
220,
220,
220,
471,
796,
2030,
395,
1476,
62,
1462,
62,
26674,
35610,
32590,
12287,
11,
26367,
11,
27169,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
3082,
1133,
7845,
28613,
198,
220,
220,
220,
220,
220,
220,
220,
7377,
112,
82,
220,
796,
7377,
112,
13,
6381,
489,
5592,
198,
220,
220,
220,
220,
220,
220,
220,
288,
34223,
796,
19609,
62,
41519,
7,
138,
112,
82,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13146,
220,
796,
19609,
62,
10599,
341,
7,
138,
112,
82,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
968,
38445,
9633,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
71,
669,
444,
796,
649,
62,
71,
669,
5069,
3028,
7,
67,
34223,
11,
13146,
11,
25594,
62,
76,
5069,
11,
269,
7789,
62,
76,
5069,
11,
2796,
62,
76,
5069,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
4294,
303,
2498,
5768,
198,
220,
220,
220,
220,
220,
220,
220,
7377,
241,
796,
27179,
1758,
7,
10745,
23079,
62,
6759,
8609,
7,
35138,
7,
3605,
62,
71,
669,
444,
828,
532,
52,
1220,
2866,
8,
3467,
18645,
62,
31448,
7,
421,
17053,
62,
28044,
88,
62,
19503,
395,
1476,
7,
35138,
7,
3605,
62,
71,
669,
444,
828,
471,
11,
7377,
102,
828,
45334,
5069,
2577,
62,
11265,
12195,
35138,
7,
3605,
62,
71,
669,
444,
4008,
828,
2546,
7,
3605,
62,
71,
669,
444,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
2124,
13,
25534,
44124,
796,
7377,
241,
628,
220,
220,
220,
220,
220,
220,
220,
2488,
12860,
2124,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
3082,
1133,
569,
31288,
3386,
198,
220,
220,
220,
220,
220,
220,
220,
410,
75,
76,
62,
27087,
796,
4417,
62,
27087,
7,
138,
241,
11,
649,
62,
71,
669,
444,
11,
471,
11,
7377,
102,
11,
18074,
223,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
3082,
1133,
376,
3620,
15989,
198,
220,
220,
220,
220,
220,
220,
220,
2796,
62,
46030,
796,
2796,
62,
2220,
62,
31364,
7,
7784,
62,
1455,
62,
16159,
12195,
3605,
62,
71,
669,
444,
828,
410,
75,
76,
62,
27087,
11,
2796,
62,
76,
5069,
8,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
4294,
303,
7845,
28613,
198,
220,
220,
220,
220,
220,
220,
220,
7377,
112,
796,
27179,
1758,
7,
301,
733,
1108,
62,
6759,
8609,
3467,
43030,
7,
69,
368,
62,
46030,
828,
2546,
7,
69,
368,
62,
46030,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
2124,
13,
7249,
942,
796,
7377,
112,
628,
220,
220,
220,
220,
220,
220,
220,
2488,
12860,
2124,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
3082,
1133,
10303,
198,
220,
220,
220,
220,
220,
220,
220,
360,
11,
575,
11,
406,
796,
22939,
62,
1462,
62,
7972,
62,
897,
274,
7,
16345,
7,
19279,
76,
62,
27087,
828,
26367,
11,
27169,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
14331,
29598,
198,
220,
220,
220,
220,
220,
220,
220,
26367,
796,
936,
418,
7,
8937,
7,
6551,
1635,
3440,
62,
31412,
532,
406,
8,
1220,
357,
6551,
1635,
3440,
62,
31412,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
2124,
13,
2220,
62,
31412,
796,
26367,
628,
220,
220,
220,
220,
220,
220,
220,
2488,
12860,
406,
628,
220,
220,
220,
220,
220,
220,
220,
7377,
113,
220,
220,
220,
796,
44800,
2348,
29230,
13,
27237,
7,
87,
532,
36470,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
12860,
357,
72,
11,
7377,
113,
8,
628,
220,
220,
220,
220,
220,
220,
220,
611,
7377,
113,
19841,
284,
75,
1441,
2124,
886,
1303,
36557,
399,
1565,
8794,
290,
2279,
588,
22879,
82,
6442,
628,
220,
220,
220,
886,
628,
220,
220,
220,
1441,
2124,
198,
437
] | 2.330167 | 4,001 |
#using PolyhedralOmega, LinearAlgebra, Test
using LinearAlgebra, Test, PolyhedralOmega
include("../src/SymbolicCone.jl")
@testset "Symbolic Cone Test Set" begin
@test true
end
| [
2,
3500,
12280,
21962,
46,
13731,
11,
44800,
2348,
29230,
11,
6208,
198,
3500,
44800,
2348,
29230,
11,
6208,
11,
12280,
21962,
46,
13731,
198,
198,
17256,
7203,
40720,
10677,
14,
13940,
2022,
4160,
34,
505,
13,
20362,
4943,
198,
31,
9288,
2617,
366,
13940,
2022,
4160,
327,
505,
6208,
5345,
1,
2221,
198,
220,
220,
220,
2488,
9288,
2081,
198,
437,
198
] | 2.873016 | 63 |
using Plots, VortexDistributions
@load "./examples/one_frame.jld2"
heatmap(x,y,abs2.(ψ1'))
psi = Torus(ψ1,x,y)
vortices = findvortices(psi)
# zoom window
x0,y0 = 70,200
Lx,Ly = 100,100
# simple cartesian mask
xm = x[@. abs(x-x0)<Lx/2]
ym = y[@. abs(y-y0)<Ly/2]
psim = @. ψ1[abs(x-x0)<Lx/2,abs(y-y0)<Ly/2]
heatmap(xm,ym,angle.(psim),transpose=true)
psi2 = Torus(psim,xm,ym)
vort = findvortices(psi2)
scatter!([vort[1].xv],[vort[1].yv],alpha=0.4)
scatter!([vort[2].xv],[vort[2].yv],alpha=0.4)
| [
3500,
1345,
1747,
11,
49790,
20344,
2455,
507,
198,
198,
31,
2220,
366,
19571,
1069,
12629,
14,
505,
62,
14535,
13,
73,
335,
17,
1,
198,
198,
25080,
8899,
7,
87,
11,
88,
11,
8937,
17,
12195,
139,
230,
16,
6,
4008,
198,
198,
862,
72,
796,
4022,
385,
7,
139,
230,
16,
11,
87,
11,
88,
8,
198,
85,
419,
1063,
796,
1064,
85,
419,
1063,
7,
862,
72,
8,
198,
198,
2,
19792,
4324,
198,
87,
15,
11,
88,
15,
796,
4317,
11,
2167,
198,
43,
87,
11,
31633,
796,
1802,
11,
3064,
198,
198,
2,
2829,
6383,
35610,
9335,
198,
87,
76,
796,
2124,
58,
31,
13,
2352,
7,
87,
12,
87,
15,
8,
27,
43,
87,
14,
17,
60,
198,
4948,
796,
331,
58,
31,
13,
2352,
7,
88,
12,
88,
15,
8,
27,
31633,
14,
17,
60,
198,
862,
320,
796,
2488,
13,
18074,
230,
16,
58,
8937,
7,
87,
12,
87,
15,
8,
27,
43,
87,
14,
17,
11,
8937,
7,
88,
12,
88,
15,
8,
27,
31633,
14,
17,
60,
198,
198,
25080,
8899,
7,
87,
76,
11,
4948,
11,
9248,
12195,
862,
320,
828,
7645,
3455,
28,
7942,
8,
198,
862,
72,
17,
796,
4022,
385,
7,
862,
320,
11,
87,
76,
11,
4948,
8,
198,
85,
419,
796,
1064,
85,
419,
1063,
7,
862,
72,
17,
8,
198,
198,
1416,
1436,
0,
26933,
85,
419,
58,
16,
4083,
87,
85,
38430,
85,
419,
58,
16,
4083,
88,
85,
4357,
26591,
28,
15,
13,
19,
8,
198,
1416,
1436,
0,
26933,
85,
419,
58,
17,
4083,
87,
85,
38430,
85,
419,
58,
17,
4083,
88,
85,
4357,
26591,
28,
15,
13,
19,
8,
198
] | 1.765957 | 282 |
"""
Embedding operator that randomly samples
between parent's value and the nearest parameter boundary
to get the new valid value if target's parameter is out-of-bounds.
"""
struct RandomBound{S<:RectSearchSpace} <: EmbeddingOperator
search_space::S
RandomBound(search_space::S) where {S<:RectSearchSpace} = new{S}(search_space)
end
search_space(rb::RandomBound) = rb.search_space
function apply!(eo::RandomBound, target::AbstractIndividual, ref::AbstractIndividual)
length(target) == length(ref) == numdims(eo.search_space) ||
throw(ArgumentError("Dimensions of problem/individuals do not match"))
ss = search_space(eo)
ssmins = dimmin(ss)
ssmaxs = dimmax(ss)
@inbounds for i in eachindex(target)
l, u = ssmins[i], ssmaxs[i]
if target[i] < l
target[i] = l + rand() * (ref[i]-l)
elseif target[i] > u
target[i] = u + rand() * (ref[i]-u)
else # continuous range doesn't need further checks
(ss isa MixedPrecisionRectSearchSpace) || continue
end
if (ss isa MixedPrecisionRectSearchSpace) && (dimdigits(ss, i) >= 0)
target[i] = round(target[i], digits=dimdigits(ss, i))
end
@assert l <= target[i] <= u "target[$i]=$(target[i]) is out of [$l, $u]"
end
return target
end
apply!(eo::RandomBound, target::AbstractIndividual, pop, refIndex::Int) =
apply!(eo, target, viewer(pop, refIndex))
function apply!(eo::RandomBound, target::AbstractIndividual,
pop, parentIndices::AbstractVector{Int})
@assert length(parentIndices) == 1
apply!(eo, target, pop, parentIndices[1])
end
| [
37811,
198,
31567,
6048,
278,
10088,
326,
15456,
8405,
198,
23395,
2560,
338,
1988,
290,
262,
16936,
11507,
18645,
198,
1462,
651,
262,
649,
4938,
1988,
611,
2496,
338,
11507,
318,
503,
12,
1659,
12,
65,
3733,
13,
198,
37811,
198,
7249,
14534,
49646,
90,
50,
27,
25,
45474,
18243,
14106,
92,
1279,
25,
13302,
6048,
278,
18843,
1352,
198,
220,
220,
220,
2989,
62,
13200,
3712,
50,
628,
220,
220,
220,
14534,
49646,
7,
12947,
62,
13200,
3712,
50,
8,
810,
1391,
50,
27,
25,
45474,
18243,
14106,
92,
796,
649,
90,
50,
92,
7,
12947,
62,
13200,
8,
198,
437,
198,
198,
12947,
62,
13200,
7,
26145,
3712,
29531,
49646,
8,
796,
374,
65,
13,
12947,
62,
13200,
198,
198,
8818,
4174,
0,
7,
68,
78,
3712,
29531,
49646,
11,
2496,
3712,
23839,
35392,
11,
1006,
3712,
23839,
35392,
8,
198,
220,
220,
220,
4129,
7,
16793,
8,
6624,
4129,
7,
5420,
8,
6624,
997,
67,
12078,
7,
68,
78,
13,
12947,
62,
13200,
8,
8614,
198,
220,
220,
220,
220,
220,
220,
220,
3714,
7,
28100,
1713,
12331,
7203,
29271,
5736,
286,
1917,
14,
43129,
82,
466,
407,
2872,
48774,
198,
220,
220,
220,
37786,
796,
2989,
62,
13200,
7,
68,
78,
8,
198,
220,
220,
220,
264,
5796,
1040,
796,
5391,
1084,
7,
824,
8,
198,
220,
220,
220,
264,
5796,
897,
82,
796,
5391,
9806,
7,
824,
8,
628,
220,
220,
220,
2488,
259,
65,
3733,
329,
1312,
287,
1123,
9630,
7,
16793,
8,
198,
220,
220,
220,
220,
220,
220,
220,
300,
11,
334,
796,
264,
5796,
1040,
58,
72,
4357,
264,
5796,
897,
82,
58,
72,
60,
628,
220,
220,
220,
220,
220,
220,
220,
611,
2496,
58,
72,
60,
1279,
300,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2496,
58,
72,
60,
796,
300,
1343,
43720,
3419,
1635,
357,
5420,
58,
72,
45297,
75,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
361,
2496,
58,
72,
60,
1875,
334,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2496,
58,
72,
60,
796,
334,
1343,
43720,
3419,
1635,
357,
5420,
58,
72,
45297,
84,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
1303,
12948,
2837,
1595,
470,
761,
2252,
8794,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
824,
318,
64,
35250,
6719,
16005,
45474,
18243,
14106,
8,
8614,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
611,
357,
824,
318,
64,
35250,
6719,
16005,
45474,
18243,
14106,
8,
11405,
357,
27740,
12894,
896,
7,
824,
11,
1312,
8,
18189,
657,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2496,
58,
72,
60,
796,
2835,
7,
16793,
58,
72,
4357,
19561,
28,
27740,
12894,
896,
7,
824,
11,
1312,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
30493,
300,
19841,
2496,
58,
72,
60,
19841,
334,
366,
16793,
58,
3,
72,
22241,
3,
7,
16793,
58,
72,
12962,
318,
503,
286,
685,
3,
75,
11,
720,
84,
30866,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1441,
2496,
198,
437,
198,
198,
39014,
0,
7,
68,
78,
3712,
29531,
49646,
11,
2496,
3712,
23839,
35392,
11,
1461,
11,
1006,
15732,
3712,
5317,
8,
796,
198,
220,
220,
220,
4174,
0,
7,
68,
78,
11,
2496,
11,
19091,
7,
12924,
11,
1006,
15732,
4008,
198,
198,
8818,
4174,
0,
7,
68,
78,
3712,
29531,
49646,
11,
2496,
3712,
23839,
35392,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1461,
11,
2560,
5497,
1063,
3712,
23839,
38469,
90,
5317,
30072,
198,
220,
220,
220,
2488,
30493,
4129,
7,
8000,
5497,
1063,
8,
6624,
352,
198,
220,
220,
220,
4174,
0,
7,
68,
78,
11,
2496,
11,
1461,
11,
2560,
5497,
1063,
58,
16,
12962,
198,
437,
198
] | 2.484985 | 666 |
export Image
mutable struct Image
mHandle::vk.VkImage
mType::vk.VkImageViewType
mCreateInfo::vk.VkImageCreateInfo
mUnowned::Bool
mDevice::Device
mMemory::MemoryChunk
function Image(device::Device, createInfo::vk.VkImageCreateInfo, type::vk.VkImageViewType)
this = new()
this.mDevice = device
this.mType = type
this.mCreateInfo = createInfo
this.mUnowned = false
newImage = Ref{vk.VkImage}()
infoRef = Ref(createInfo)
GC.@preserve infoRef begin
if (vk.vkCreateImage(getLogicalDevice(device), infoRef, C_NULL, newImage) != vk.VK_SUCCESS)
error("Failed to create image!")
end
end
this.mHandle = newImage[]
return this
end
# Assumes that the Image is managed somewhere else (e.g. in a swapchain)
# The ImageCreateInfo will not be used to actually create an image, but to
# derive properties of the image (format, extend, ...)
function Image(device::Device, createInfo::vk.VkImageCreateInfo, unowned::vk.VkImage, type::vk.VkImageViewType)
this = new()
this.mDevice = device
this.mType = type
this.mCreateInfo = createInfo
this.mHandle = unowned
this.mUnowned = true
return this
end
end
@class Image [:handle, :destroy]
function destroy(this::Image)
if (this.mUnowned)
return
end
vk.vkDestroyImage(getLogicalDevice(this.mDevice), this.mHandle, C_NULL)
destroy(this.mMemory)
end
function usageToFeatures(usage::vk.VkImageUsageFlags)::vk.VkFormatFeatureFlags
result::vk.VkFormatFeatureFlags = 0
if (usage & vk.VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT != 0)
result |= vk.VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT |
vk.VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT
end
if (usage & vk.VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT != 0)
result |= vk.VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
end
if (usage & vk.VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT != 0)
result |= vk.VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
end
if (usage & vk.VK_IMAGE_USAGE_SAMPLED_BIT != 0)
result |= vk.VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT
end
if (usage & vk.VK_IMAGE_USAGE_STORAGE_BIT != 0)
result |= vk.VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT
end
if (usage & vk.VK_IMAGE_USAGE_TRANSFER_DST_BIT != 0)
# not sure if I should use this, because it's hidden behind an
# extension
# result |= vk.VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR
end
if (usage & vk.VK_IMAGE_USAGE_TRANSFER_SRC_BIT != 0)
# not sure if I should use this, because it's hidden behind an
# extension
# result |= vk.VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR
end
return result;
end
function createImage(createInfo::ImageCreateInfo, device::Device)::Image
return Image(device, handleRef(createInfo)[], createInfo.mViewType)
end
function createView(this::Image, range::vk.VkImageSubresourceRange = vk.VkImageSubresourceRange(0, 0, 0, 0, 0))
return createView(this, this.mType, range)
end
function handle(this::Image)::vk.VkImage
return this.mHandle
end
function getLogicalDeviceOf(this::Image)::vk.VkDevice
return getLogicalDevice(this.mDevice)
end
function realizeAttachment(this::Image)
req = VkExt.getImageMemoryRequirements(getLogicalDevice(this.mDevice), this.mHandle)
this.mMemory = allocateDedicated(this.mDevice.mSuballocator, req, VRAM)
bindToImage(this.mMemory, this.mHandle)
end
function getWidth(this::Image)::UInt32
return this.mCreateInfo.extent.width
end
function getHeight(this::Image)::UInt32
return this.mCreateInfo.extent.height
end
# TODO
# setDataVRAM
# setDataRAM
# getData
# realizeVRAM
# realizeRAM
# copyFrom
# copyTo
# blitTo
# changeLayout
# changeOwner
# generateMipmaps
# createView
# changeOwnerImpl
# levelPixels
# levelBytes
# prepStagingBuffer
| [
39344,
7412,
198,
198,
76,
18187,
2878,
7412,
198,
220,
220,
220,
285,
37508,
3712,
85,
74,
13,
53,
74,
5159,
198,
220,
220,
220,
285,
6030,
3712,
85,
74,
13,
53,
74,
5159,
7680,
6030,
198,
220,
220,
220,
285,
16447,
12360,
3712,
85,
74,
13,
53,
74,
5159,
16447,
12360,
198,
220,
220,
220,
285,
3118,
11990,
3712,
33,
970,
198,
220,
220,
220,
285,
24728,
3712,
24728,
198,
220,
220,
220,
285,
30871,
3712,
30871,
1925,
2954,
628,
220,
220,
220,
2163,
7412,
7,
25202,
3712,
24728,
11,
2251,
12360,
3712,
85,
74,
13,
53,
74,
5159,
16447,
12360,
11,
2099,
3712,
85,
74,
13,
53,
74,
5159,
7680,
6030,
8,
198,
220,
220,
220,
220,
220,
220,
220,
428,
796,
649,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
428,
13,
76,
24728,
796,
3335,
198,
220,
220,
220,
220,
220,
220,
220,
428,
13,
76,
6030,
796,
2099,
198,
220,
220,
220,
220,
220,
220,
220,
428,
13,
76,
16447,
12360,
796,
2251,
12360,
198,
220,
220,
220,
220,
220,
220,
220,
428,
13,
76,
3118,
11990,
796,
3991,
628,
220,
220,
220,
220,
220,
220,
220,
649,
5159,
796,
6524,
90,
85,
74,
13,
53,
74,
5159,
92,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
7508,
8134,
796,
6524,
7,
17953,
12360,
8,
198,
220,
220,
220,
220,
220,
220,
220,
20145,
13,
31,
18302,
3760,
7508,
8134,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
357,
85,
74,
13,
85,
74,
16447,
5159,
7,
1136,
11187,
605,
24728,
7,
25202,
828,
7508,
8134,
11,
327,
62,
33991,
11,
649,
5159,
8,
14512,
410,
74,
13,
47191,
62,
12564,
4093,
7597,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4049,
7203,
37,
6255,
284,
2251,
2939,
2474,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
428,
13,
76,
37508,
796,
649,
5159,
21737,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
428,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1303,
2195,
8139,
326,
262,
7412,
318,
5257,
7382,
2073,
357,
68,
13,
70,
13,
287,
257,
16075,
7983,
8,
198,
220,
220,
220,
1303,
383,
7412,
16447,
12360,
481,
407,
307,
973,
284,
1682,
2251,
281,
2939,
11,
475,
284,
198,
220,
220,
220,
1303,
27099,
6608,
286,
262,
2939,
357,
18982,
11,
9117,
11,
2644,
8,
198,
220,
220,
220,
2163,
7412,
7,
25202,
3712,
24728,
11,
2251,
12360,
3712,
85,
74,
13,
53,
74,
5159,
16447,
12360,
11,
555,
11990,
3712,
85,
74,
13,
53,
74,
5159,
11,
2099,
3712,
85,
74,
13,
53,
74,
5159,
7680,
6030,
8,
198,
220,
220,
220,
220,
220,
220,
220,
428,
796,
649,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
428,
13,
76,
24728,
796,
3335,
198,
220,
220,
220,
220,
220,
220,
220,
428,
13,
76,
6030,
796,
2099,
198,
220,
220,
220,
220,
220,
220,
220,
428,
13,
76,
16447,
12360,
796,
2251,
12360,
198,
220,
220,
220,
220,
220,
220,
220,
428,
13,
76,
37508,
796,
555,
11990,
198,
220,
220,
220,
220,
220,
220,
220,
428,
13,
76,
3118,
11990,
796,
2081,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
428,
198,
220,
220,
220,
886,
198,
437,
198,
198,
31,
4871,
7412,
685,
25,
28144,
11,
1058,
41659,
60,
198,
198,
8818,
4117,
7,
5661,
3712,
5159,
8,
198,
220,
220,
220,
611,
357,
5661,
13,
76,
3118,
11990,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
198,
220,
220,
220,
886,
198,
220,
220,
220,
410,
74,
13,
85,
74,
49174,
5159,
7,
1136,
11187,
605,
24728,
7,
5661,
13,
76,
24728,
828,
428,
13,
76,
37508,
11,
327,
62,
33991,
8,
198,
220,
220,
220,
4117,
7,
5661,
13,
76,
30871,
8,
198,
437,
198,
198,
8818,
8748,
2514,
23595,
7,
26060,
3712,
85,
74,
13,
53,
74,
5159,
28350,
40053,
2599,
25,
85,
74,
13,
53,
74,
26227,
38816,
40053,
198,
220,
220,
220,
1255,
3712,
85,
74,
13,
53,
74,
26227,
38816,
40053,
796,
657,
198,
220,
220,
220,
611,
357,
26060,
1222,
410,
74,
13,
47191,
62,
3955,
11879,
62,
2937,
11879,
62,
46786,
62,
17139,
16219,
10979,
62,
26094,
14512,
657,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
930,
28,
410,
74,
13,
47191,
62,
21389,
1404,
62,
15112,
40086,
62,
46786,
62,
17139,
16219,
10979,
62,
26094,
930,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
74,
13,
47191,
62,
21389,
1404,
62,
15112,
40086,
62,
46786,
62,
17139,
16219,
10979,
62,
9148,
10619,
62,
26094,
198,
220,
220,
220,
886,
198,
220,
220,
220,
611,
357,
26060,
1222,
410,
74,
13,
47191,
62,
3955,
11879,
62,
2937,
11879,
62,
46162,
4221,
62,
2257,
24181,
4146,
62,
17139,
16219,
10979,
62,
26094,
14512,
657,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
930,
28,
410,
74,
13,
47191,
62,
21389,
1404,
62,
15112,
40086,
62,
46162,
4221,
62,
2257,
24181,
4146,
62,
17139,
16219,
10979,
62,
26094,
198,
220,
220,
220,
886,
198,
220,
220,
220,
611,
357,
26060,
1222,
410,
74,
13,
47191,
62,
3955,
11879,
62,
2937,
11879,
62,
1268,
30076,
62,
17139,
16219,
10979,
62,
26094,
14512,
657,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
930,
28,
410,
74,
13,
47191,
62,
21389,
1404,
62,
15112,
40086,
62,
46786,
62,
17139,
16219,
10979,
62,
26094,
198,
220,
220,
220,
886,
198,
220,
220,
220,
611,
357,
26060,
1222,
410,
74,
13,
47191,
62,
3955,
11879,
62,
2937,
11879,
62,
49302,
6489,
1961,
62,
26094,
14512,
657,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
930,
28,
410,
74,
13,
47191,
62,
21389,
1404,
62,
15112,
40086,
62,
49302,
6489,
1961,
62,
3955,
11879,
62,
26094,
198,
220,
220,
220,
886,
198,
220,
220,
220,
611,
357,
26060,
1222,
410,
74,
13,
47191,
62,
3955,
11879,
62,
2937,
11879,
62,
2257,
1581,
11879,
62,
26094,
14512,
657,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
930,
28,
410,
74,
13,
47191,
62,
21389,
1404,
62,
15112,
40086,
62,
2257,
1581,
11879,
62,
3955,
11879,
62,
26094,
198,
220,
220,
220,
886,
198,
220,
220,
220,
611,
357,
26060,
1222,
410,
74,
13,
47191,
62,
3955,
11879,
62,
2937,
11879,
62,
5446,
15037,
24302,
62,
35,
2257,
62,
26094,
14512,
657,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
407,
1654,
611,
314,
815,
779,
428,
11,
780,
340,
338,
7104,
2157,
281,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
7552,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
1255,
930,
28,
410,
74,
13,
47191,
62,
21389,
1404,
62,
15112,
40086,
62,
5446,
15037,
24302,
62,
35,
2257,
62,
26094,
62,
42,
17184,
198,
220,
220,
220,
886,
198,
220,
220,
220,
611,
357,
26060,
1222,
410,
74,
13,
47191,
62,
3955,
11879,
62,
2937,
11879,
62,
5446,
15037,
24302,
62,
50,
7397,
62,
26094,
14512,
657,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
407,
1654,
611,
314,
815,
779,
428,
11,
780,
340,
338,
7104,
2157,
281,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
7552,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
1255,
930,
28,
410,
74,
13,
47191,
62,
21389,
1404,
62,
15112,
40086,
62,
5446,
15037,
24302,
62,
50,
7397,
62,
26094,
62,
42,
17184,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1441,
1255,
26,
198,
437,
198,
198,
8818,
2251,
5159,
7,
17953,
12360,
3712,
5159,
16447,
12360,
11,
3335,
3712,
24728,
2599,
25,
5159,
198,
220,
220,
220,
1441,
7412,
7,
25202,
11,
5412,
8134,
7,
17953,
12360,
38381,
4357,
2251,
12360,
13,
76,
7680,
6030,
8,
198,
437,
198,
198,
8818,
2251,
7680,
7,
5661,
3712,
5159,
11,
2837,
3712,
85,
74,
13,
53,
74,
5159,
7004,
31092,
17257,
796,
410,
74,
13,
53,
74,
5159,
7004,
31092,
17257,
7,
15,
11,
657,
11,
657,
11,
657,
11,
657,
4008,
198,
220,
220,
220,
1441,
2251,
7680,
7,
5661,
11,
428,
13,
76,
6030,
11,
2837,
8,
198,
437,
198,
198,
8818,
5412,
7,
5661,
3712,
5159,
2599,
25,
85,
74,
13,
53,
74,
5159,
198,
220,
220,
220,
1441,
428,
13,
76,
37508,
198,
437,
198,
198,
8818,
651,
11187,
605,
24728,
5189,
7,
5661,
3712,
5159,
2599,
25,
85,
74,
13,
53,
74,
24728,
198,
220,
220,
220,
1441,
651,
11187,
605,
24728,
7,
5661,
13,
76,
24728,
8,
198,
437,
198,
198,
8818,
6537,
8086,
15520,
7,
5661,
3712,
5159,
8,
198,
220,
220,
220,
43089,
796,
569,
74,
11627,
13,
1136,
5159,
30871,
42249,
7,
1136,
11187,
605,
24728,
7,
5661,
13,
76,
24728,
828,
428,
13,
76,
37508,
8,
198,
220,
220,
220,
428,
13,
76,
30871,
796,
31935,
35,
276,
3474,
7,
5661,
13,
76,
24728,
13,
76,
7004,
32332,
1352,
11,
43089,
11,
6453,
2390,
8,
198,
220,
220,
220,
11007,
2514,
5159,
7,
5661,
13,
76,
30871,
11,
428,
13,
76,
37508,
8,
198,
437,
198,
198,
8818,
651,
30916,
7,
5661,
3712,
5159,
2599,
25,
52,
5317,
2624,
198,
220,
220,
220,
1441,
428,
13,
76,
16447,
12360,
13,
2302,
298,
13,
10394,
198,
437,
198,
198,
8818,
651,
23106,
7,
5661,
3712,
5159,
2599,
25,
52,
5317,
2624,
198,
220,
220,
220,
1441,
428,
13,
76,
16447,
12360,
13,
2302,
298,
13,
17015,
198,
437,
198,
198,
2,
16926,
46,
198,
2,
900,
6601,
13024,
2390,
198,
2,
900,
6601,
24115,
198,
2,
651,
6601,
198,
2,
6537,
13024,
2390,
198,
2,
6537,
24115,
198,
2,
4866,
4863,
198,
2,
4866,
2514,
198,
2,
698,
270,
2514,
198,
2,
1487,
32517,
198,
2,
1487,
42419,
198,
2,
7716,
44,
541,
31803,
198,
2,
2251,
7680,
198,
2,
1487,
42419,
29710,
198,
2,
1241,
47,
14810,
198,
2,
1241,
45992,
198,
2,
3143,
1273,
3039,
28632,
198
] | 2.346177 | 1,687 |
include("layout.jl") # layout
include(joinpath("api", "endpoint.jl")) # Endpoint
include("wasm.jl") # WASM
include("front.jl") # Front
if PROGRAM_FILE == basename(@__FILE__)
using Bukdu
import Bukdu.Actions: index, show, new, edit, create, delete, update
using .Front # WelcomeController
using .Endpoint # CustomerController
import .WASM: WasmController, hello_js, hello_wast
using Sockets
pipeline(:api) do conn::Conn
end
routes(:api) do
resources("/customers", CustomerController)
end
routes(:wasm) do
get("/wasm", WasmController, index)
get("/hello.js", WasmController, hello_js)
get("/hello.wast", WasmController, hello_wast)
plug(Plug.Static, at="/", from=normpath(@__DIR__, "public"))
end
routes(:front) do
get("/", WelcomeController, index)
end
if haskey(ENV, "ON_HEROKU")
Bukdu.start(parse(Int, ENV["PORT"]); host=Sockets.IPAddr(0,0,0,0))
else
Bukdu.start(8080)
end
Router.call(get, "/") #
# CLI.routes()
Base.JLOptions().isinteractive==0 && wait()
# Bukdu.stop()
end # if
| [
17256,
7203,
39786,
13,
20362,
4943,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
12461,
198,
17256,
7,
22179,
6978,
7203,
15042,
1600,
366,
437,
4122,
13,
20362,
48774,
1303,
5268,
4122,
198,
17256,
7203,
86,
8597,
13,
20362,
4943,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
21725,
44,
198,
17256,
7203,
8534,
13,
20362,
4943,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
8880,
628,
198,
198,
361,
46805,
62,
25664,
6624,
1615,
12453,
7,
31,
834,
25664,
834,
8,
198,
198,
3500,
36810,
646,
198,
11748,
36810,
646,
13,
32,
2733,
25,
6376,
11,
905,
11,
649,
11,
4370,
11,
2251,
11,
12233,
11,
4296,
198,
3500,
764,
25886,
1303,
19134,
22130,
198,
3500,
764,
12915,
4122,
1303,
22092,
22130,
198,
11748,
764,
54,
1921,
44,
25,
370,
8597,
22130,
11,
23748,
62,
8457,
11,
23748,
62,
86,
459,
198,
3500,
311,
11603,
198,
198,
79,
541,
4470,
7,
25,
15042,
8,
466,
48260,
3712,
37321,
198,
437,
198,
198,
81,
448,
274,
7,
25,
15042,
8,
466,
198,
220,
220,
220,
4133,
7203,
14,
23144,
364,
1600,
22092,
22130,
8,
198,
437,
198,
198,
81,
448,
274,
7,
25,
86,
8597,
8,
466,
198,
220,
220,
220,
651,
7203,
14,
86,
8597,
1600,
370,
8597,
22130,
11,
6376,
8,
198,
220,
220,
220,
651,
7203,
14,
31373,
13,
8457,
1600,
370,
8597,
22130,
11,
23748,
62,
8457,
8,
198,
220,
220,
220,
651,
7203,
14,
31373,
13,
86,
459,
1600,
370,
8597,
22130,
11,
23748,
62,
86,
459,
8,
198,
220,
220,
220,
6107,
7,
23257,
13,
45442,
11,
379,
35922,
1600,
422,
28,
27237,
6978,
7,
31,
834,
34720,
834,
11,
366,
11377,
48774,
198,
437,
198,
198,
81,
448,
274,
7,
25,
8534,
8,
466,
198,
220,
220,
220,
651,
7203,
14,
1600,
19134,
22130,
11,
6376,
8,
198,
437,
198,
198,
361,
468,
2539,
7,
1677,
53,
11,
366,
1340,
62,
16879,
11380,
52,
4943,
198,
220,
220,
220,
36810,
646,
13,
9688,
7,
29572,
7,
5317,
11,
12964,
53,
14692,
15490,
8973,
1776,
2583,
28,
50,
11603,
13,
4061,
4550,
81,
7,
15,
11,
15,
11,
15,
11,
15,
4008,
198,
17772,
198,
220,
220,
220,
36810,
646,
13,
9688,
7,
1795,
1795,
8,
198,
437,
198,
198,
49,
39605,
13,
13345,
7,
1136,
11,
12813,
4943,
1303,
198,
2,
43749,
13,
81,
448,
274,
3419,
198,
198,
14881,
13,
41,
21982,
8544,
22446,
271,
3849,
5275,
855,
15,
11405,
4043,
3419,
198,
198,
2,
36810,
646,
13,
11338,
3419,
198,
198,
437,
1303,
611,
198
] | 2.345572 | 463 |
# %% Interactive bifurcations for 1D energy balance
using DrWatson
@quickactivate "NonlinearDynamicsTextbook"
include(srcdir("colorscheme.jl"))
using DynamicalSystems, OrdinaryDiffEq, Random
using InteractiveDynamics: record_interaction
import GLMakie
D = 25
omega_vec = randn(D)
ds = Systems.kuramoto(D)
diffeq = (alg = Tsit5(), adaptive = false, dt = 0.05)
integ = integrator(ds; diffeq...)
fig = GLMakie.Figure()
display(fig)
cmap = :curl
axku = GLMakie.Axis(fig[1,1])
# Other static elements
GLMakie.hidedecorations!(axku)
axku.aspect = GLMakie.DataAspect()
GLMakie.lines!(axku, cos.(0:0.001:2π+0.002), sin.(0:0.001:2π+0.002);color = :black)
# Plot balls
phases = GLMakie.Observable(copy(integ.u))
balls = GLMakie.lift(u -> [GLMakie.Point2f0(cos(φ), sin(φ)) for φ in u], phases)
GLMakie.scatter!(axku, balls;
markersize = 12, color = 1:D, colormap = cmap, strokewidth=2, strokecolor = :black
)
# Plot arrows
arrows_end = GLMakie.lift(b -> 0.8b, balls)
arrows_start = [GLMakie.Point2f0(0,0) for i in 1:D]
GLMakie.arrows!(axku, arrows_start, arrows_end;
color = 1:D, colormap = (cmap, 0.5), arrowsize = 10, linewidth = 4,
)
# Plot mean field Vector
# add sliders and buttons
fig[2, 1] = controllayout = GLMakie.GridLayout(tellwidth = false)
run = controllayout[1, 1] = GLMakie.Button(fig; label = "run")
Ks = 0.0:0.1:10.0
kslider = GLMakie.labelslider!(fig, "K =", Ks; sliderkw = Dict(:startvalue => ds.p.K))
controllayout[1, 2] = kslider.layout
# run button functionality
isrunning = GLMakie.Observable(false)
GLMakie.on(run.clicks) do clicks; isrunning[] = !isrunning[]; end
GLMakie.on(run.clicks) do clicks
@async while isrunning[]
GLMakie.isopen(fig.scene) || break # ensures computations stop if closed window
step!(integ)
phases[] = integ.u
yield()
sleep(0.001) # or `yield()` instead
end
end
GLMakie.on(kslider.slider.value) do val
integ.p.K = val
u_modified!(integ, true)
end
# %%
record_interaction(fig, string(@__FILE__)[1:end-2]*"mp4"; total_time = 15, sleep_time = 2)
| [
2,
43313,
21365,
275,
361,
333,
66,
602,
329,
352,
35,
2568,
5236,
198,
3500,
1583,
54,
13506,
198,
31,
24209,
39022,
366,
15419,
29127,
35,
4989,
873,
8206,
2070,
1,
198,
17256,
7,
10677,
15908,
7203,
4033,
26164,
1326,
13,
20362,
48774,
198,
3500,
14970,
605,
11964,
82,
11,
14230,
3219,
28813,
36,
80,
11,
14534,
198,
3500,
21365,
35,
4989,
873,
25,
1700,
62,
3849,
2673,
198,
11748,
10188,
44,
461,
494,
198,
198,
35,
796,
1679,
198,
462,
4908,
62,
35138,
796,
43720,
77,
7,
35,
8,
198,
198,
9310,
796,
11998,
13,
74,
333,
25384,
7,
35,
8,
198,
67,
22391,
80,
796,
357,
14016,
796,
13146,
270,
20,
22784,
29605,
796,
3991,
11,
288,
83,
796,
657,
13,
2713,
8,
198,
18908,
796,
4132,
12392,
7,
9310,
26,
814,
27363,
23029,
198,
198,
5647,
796,
10188,
44,
461,
494,
13,
11337,
3419,
198,
13812,
7,
5647,
8,
198,
66,
8899,
796,
1058,
66,
6371,
198,
897,
23063,
796,
10188,
44,
461,
494,
13,
31554,
271,
7,
5647,
58,
16,
11,
16,
12962,
628,
198,
2,
3819,
9037,
4847,
198,
8763,
44,
461,
494,
13,
71,
1384,
721,
273,
602,
0,
7,
897,
23063,
8,
198,
897,
23063,
13,
292,
806,
796,
10188,
44,
461,
494,
13,
6601,
1722,
806,
3419,
198,
8763,
44,
461,
494,
13,
6615,
0,
7,
897,
23063,
11,
8615,
12195,
15,
25,
15,
13,
8298,
25,
17,
46582,
10,
15,
13,
21601,
828,
7813,
12195,
15,
25,
15,
13,
8298,
25,
17,
46582,
10,
15,
13,
21601,
1776,
8043,
796,
1058,
13424,
8,
198,
198,
2,
28114,
11333,
198,
746,
1386,
796,
10188,
44,
461,
494,
13,
31310,
712,
540,
7,
30073,
7,
18908,
13,
84,
4008,
198,
21591,
796,
10188,
44,
461,
494,
13,
26282,
7,
84,
4613,
685,
8763,
44,
461,
494,
13,
12727,
17,
69,
15,
7,
6966,
7,
139,
228,
828,
7813,
7,
139,
228,
4008,
329,
18074,
228,
287,
334,
4357,
21164,
8,
198,
8763,
44,
461,
494,
13,
1416,
1436,
0,
7,
897,
23063,
11,
11333,
26,
198,
220,
220,
220,
19736,
1096,
220,
796,
1105,
11,
3124,
796,
352,
25,
35,
11,
951,
579,
499,
796,
269,
8899,
11,
14000,
10394,
28,
17,
11,
14000,
8043,
796,
1058,
13424,
198,
8,
198,
198,
2,
28114,
20507,
198,
6018,
82,
62,
437,
796,
10188,
44,
461,
494,
13,
26282,
7,
65,
4613,
657,
13,
23,
65,
11,
11333,
8,
198,
6018,
82,
62,
9688,
796,
685,
8763,
44,
461,
494,
13,
12727,
17,
69,
15,
7,
15,
11,
15,
8,
329,
1312,
287,
352,
25,
35,
60,
198,
8763,
44,
461,
494,
13,
6018,
82,
0,
7,
897,
23063,
11,
20507,
62,
9688,
11,
20507,
62,
437,
26,
220,
198,
220,
220,
220,
3124,
796,
352,
25,
35,
11,
951,
579,
499,
796,
357,
66,
8899,
11,
657,
13,
20,
828,
15452,
7857,
796,
838,
11,
9493,
413,
5649,
796,
604,
11,
198,
8,
198,
198,
2,
28114,
1612,
2214,
20650,
198,
2,
751,
1017,
4157,
290,
12163,
198,
5647,
58,
17,
11,
352,
60,
796,
1246,
297,
323,
448,
796,
10188,
44,
461,
494,
13,
41339,
32517,
7,
33331,
10394,
796,
3991,
8,
198,
5143,
796,
1246,
297,
323,
448,
58,
16,
11,
352,
60,
796,
10188,
44,
461,
494,
13,
21864,
7,
5647,
26,
6167,
796,
366,
5143,
4943,
198,
42,
82,
796,
657,
13,
15,
25,
15,
13,
16,
25,
940,
13,
15,
198,
591,
75,
1304,
796,
10188,
44,
461,
494,
13,
23912,
1424,
75,
1304,
0,
7,
5647,
11,
366,
42,
796,
1600,
509,
82,
26,
28982,
46265,
796,
360,
713,
7,
25,
9688,
8367,
5218,
288,
82,
13,
79,
13,
42,
4008,
198,
3642,
2487,
323,
448,
58,
16,
11,
362,
60,
796,
479,
6649,
1304,
13,
39786,
628,
198,
2,
1057,
4936,
11244,
198,
271,
20270,
796,
10188,
44,
461,
494,
13,
31310,
712,
540,
7,
9562,
8,
198,
8763,
44,
461,
494,
13,
261,
7,
5143,
13,
565,
3378,
8,
466,
25785,
26,
318,
20270,
21737,
796,
5145,
271,
20270,
58,
11208,
886,
198,
8763,
44,
461,
494,
13,
261,
7,
5143,
13,
565,
3378,
8,
466,
25785,
198,
220,
220,
220,
2488,
292,
13361,
981,
318,
20270,
21737,
198,
220,
220,
220,
220,
220,
220,
220,
10188,
44,
461,
494,
13,
271,
9654,
7,
5647,
13,
29734,
8,
8614,
2270,
1303,
19047,
2653,
602,
2245,
611,
4838,
4324,
198,
220,
220,
220,
220,
220,
220,
220,
2239,
0,
7,
18908,
8,
198,
220,
220,
220,
220,
220,
220,
220,
21164,
21737,
796,
4132,
13,
84,
198,
220,
220,
220,
220,
220,
220,
220,
7800,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
3993,
7,
15,
13,
8298,
8,
1303,
393,
4600,
88,
1164,
3419,
63,
2427,
198,
220,
220,
220,
886,
198,
437,
198,
198,
8763,
44,
461,
494,
13,
261,
7,
591,
75,
1304,
13,
6649,
1304,
13,
8367,
8,
466,
1188,
198,
220,
220,
220,
4132,
13,
79,
13,
42,
796,
1188,
198,
220,
220,
220,
334,
62,
41771,
0,
7,
18908,
11,
2081,
8,
198,
437,
198,
198,
2,
43313,
198,
22105,
62,
3849,
2673,
7,
5647,
11,
4731,
7,
31,
834,
25664,
834,
38381,
16,
25,
437,
12,
17,
60,
9,
1,
3149,
19,
8172,
2472,
62,
2435,
796,
1315,
11,
3993,
62,
2435,
796,
362,
8,
198
] | 2.322435 | 887 |
# Level-2 LinearAlgebra.BLAS interface.
#
# TODO: support gbmv!, sbmv! and hbmv!.
# hpmv! and spmv! is not possible within current frame.
# Level2 BLAS size checker.
bli_check_lv2(trans::BliTrans,
m ::Integer, n ::Integer,
n_::Integer, m_::Integer) = begin
((trans.enum & BLIS_TRANS_BIT) != 0) && ((m, n) = (n, m))
(m == m_) || throw(DimensionMismatch("Target buffer size mismatch."))
(n == n_) || throw(DimensionMismatch("Contracted size mismatch."))
nothing
end
macro blis_interface_linalg_lv2_gemv(Tc1, T1, T2, Tc2, T3, targetfunc, bliname)
# Get method for the object API backend.
blifuncname = Symbol("bli_", bliname)
blifunc = getproperty(ObjectBackend, blifuncname)
return quote
$(esc(targetfunc))(tA::AbstractChar,
α::$Tc1,
A::StridedMatrix{<:$T1},
x::StridedVector{<:$T2},
β::$Tc2,
y::StridedVector{<:$T3}) = begin
bli_tA = char_to_trans[tA]
bli_check_lv2(bli_tA,
size(A)...,
length(x),
length(y))
oα = BliObj(α)
oA = BliObj(A)
ox = BliObj(x)
oβ = BliObj(β)
oy = BliObj(y)
ObjectBackend.bli_obj_set_onlytrans!(bli_tA, oA.obj)
$blifunc(oα, oA, ox, oβ, oy)
y
end
end
end
@doc """
gemv!(tA, α, A, x, β, y)
BLIS-based GEMV with strides support & mixed-precision.
""" gemv!
@blis_interface_linalg_lv2_gemv(BliCompatibleType,
BliCompatibleType,
BliCompatibleType,
BliCompatibleType,
BliCompatibleType,
gemv!, gemv!)
@blis_interface_linalg_lv2_gemv Float32 Float32 Float32 Float32 Float32 gemv! gemv!
@blis_interface_linalg_lv2_gemv Float64 Float64 Float64 Float64 Float64 gemv! gemv!
@blis_interface_linalg_lv2_gemv ComplexF32 ComplexF32 ComplexF32 ComplexF32 ComplexF32 gemv! gemv!
@blis_interface_linalg_lv2_gemv ComplexF64 ComplexF64 ComplexF64 ComplexF64 ComplexF64 gemv! gemv!
macro blis_interface_linalg_lv2_hemv(Tc1, T1, T2, Tc2, T3, targetfunc, bliname, bli_struc)
# Get method for the object API backend.
blifuncname = Symbol("bli_", bliname)
blifunc = getproperty(ObjectBackend, blifuncname)
return quote
$(esc(targetfunc))(ul::AbstractChar,
α::$Tc1,
A::StridedMatrix{<:$T1},
x::StridedVector{<:$T2},
β::$Tc2,
y::StridedVector{<:$T3}) = begin
bli_ul = char_to_uplo[ul]
bli_check_lv2(BLIS_NO_TRANSPOSE,
size(A)...,
length(x),
length(y))
oα = BliObj(α)
oA = BliObj(A)
ox = BliObj(x)
oβ = BliObj(β)
oy = BliObj(y)
ObjectBackend.bli_obj_set_uplo!(bli_ul, oA)
ObjectBackend.bli_obj_set_struc!($bli_struc, oA.obj)
$blifunc(oα, oA, ox, oβ, oy)
y
end
end
end
@doc """
hemv!(ul, α, A, x, β, y)
BLIS-based HEMV with strides support & mixed-precision.
""" hemv!
@blis_interface_linalg_lv2_hemv(BliCompatibleType,
BliCompatibleType,
BliCompatibleType,
BliCompatibleType,
BliCompatibleType,
hemv!, hemv!,
BLIS_HERMITIAN)
@blis_interface_linalg_lv2_hemv Float32 Float32 Float32 Float32 Float32 hemv! hemv! BLIS_HERMITIAN
@blis_interface_linalg_lv2_hemv Float64 Float64 Float64 Float64 Float64 hemv! hemv! BLIS_HERMITIAN
@blis_interface_linalg_lv2_hemv ComplexF32 ComplexF32 ComplexF32 ComplexF32 ComplexF32 hemv! hemv! BLIS_HERMITIAN
@blis_interface_linalg_lv2_hemv ComplexF64 ComplexF64 ComplexF64 ComplexF64 ComplexF64 hemv! hemv! BLIS_HERMITIAN
@doc """
symv!(ul, α, A, x, β, y)
BLIS-based SYMV with strides support & mixed-precision.
""" symv!
@blis_interface_linalg_lv2_hemv(BliCompatibleType,
BliCompatibleType,
BliCompatibleType,
BliCompatibleType,
BliCompatibleType,
symv!, symv!,
BLIS_SYMMETRIC)
@blis_interface_linalg_lv2_hemv Float32 Float32 Float32 Float32 Float32 symv! symv! BLIS_SYMMETRIC
@blis_interface_linalg_lv2_hemv Float64 Float64 Float64 Float64 Float64 symv! symv! BLIS_SYMMETRIC
@blis_interface_linalg_lv2_hemv ComplexF32 ComplexF32 ComplexF32 ComplexF32 ComplexF32 symv! symv! BLIS_SYMMETRIC
@blis_interface_linalg_lv2_hemv ComplexF64 ComplexF64 ComplexF64 ComplexF64 ComplexF64 symv! symv! BLIS_SYMMETRIC
macro blis_interface_linalg_lv2_trmv(T1, T2, targetfunc, bliname)
# Get method for the object API backend.
blifuncname = Symbol("bli_", bliname)
blifunc = getproperty(ObjectBackend, blifuncname)
return quote
$(esc(targetfunc))(ul::AbstractChar,
tA::AbstractChar,
dA::AbstractChar,
A::StridedMatrix{<:$T1},
b::StridedVector{<:$T2}) = begin
bli_ul = char_to_uplo[ul]
bli_dA = char_to_diag[dA]
bli_tA = char_to_trans[tA]
bli_check_lv2(bli_tA,
size(A)...,
length(b),
length(b))
oα = BliObj($T1(1.0))
oA = BliObj(A)
ob = BliObj(b)
ObjectBackend.bli_obj_set_uplo!(bli_ul, oA)
ObjectBackend.bli_obj_set_diag!(bli_dA, oA)
ObjectBackend.bli_obj_set_onlytrans!(bli_tA, oA)
$blifunc(oα, oA, ob)
b
end
end
end
@doc """
trmv!(ul, tA, dA, A, b)
BLIS-based TRMV with strides support & mixed-precision.
"""
@blis_interface_linalg_lv2_trmv(BliCompatibleType,
BliCompatibleType,
trmv!, trmv!)
@blis_interface_linalg_lv2_trmv Float32 Float32 trmv! trmv!
@blis_interface_linalg_lv2_trmv Float64 Float64 trmv! trmv!
@blis_interface_linalg_lv2_trmv ComplexF32 ComplexF32 trmv! trmv!
@blis_interface_linalg_lv2_trmv ComplexF64 ComplexF64 trmv! trmv!
@doc """
trsv!(ul, tA, dA, A, b)
BLIS-based TRSV with strides support & mixed-precision.
"""
@blis_interface_linalg_lv2_trmv(BliCompatibleType,
BliCompatibleType,
trsv!, trsv!)
@blis_interface_linalg_lv2_trmv Float32 Float32 trsv! trsv!
@blis_interface_linalg_lv2_trmv Float64 Float64 trsv! trsv!
@blis_interface_linalg_lv2_trmv ComplexF32 ComplexF32 trsv! trsv!
@blis_interface_linalg_lv2_trmv ComplexF64 ComplexF64 trsv! trsv!
macro blis_interface_linalg_lv2_ger(Tc1, T1, T2, T3, targetfunc, bliname)
# Get method for the object API backend.
blifuncname = Symbol("bli_", bliname)
blifunc = getproperty(ObjectBackend, blifuncname)
return quote
$(esc(targetfunc))(α::$Tc1,
x::StridedVector{<:$T1},
y::StridedVector{<:$T2},
A::StridedMatrix{<:$T3}) = begin
bli_check_lv2(BLIS_NO_TRANSPOSE,
size(A)...,
length(y),
length(x))
oα = BliObj(α)
ox = BliObj(x)
oy = BliObj(y)
oA = BliObj(A)
$blifunc(oα, ox, oy, oA)
A
end
end
end
@doc """
ger!(α, x, y, A)
BLIS-based GER with strides support & mixed-precision.
""" ger!
@blis_interface_linalg_lv2_ger(BliCompatibleType,
BliCompatibleType,
BliCompatibleType,
BliCompatibleType,
ger!, ger!)
@blis_interface_linalg_lv2_ger Float32 Float32 Float32 Float32 ger! ger!
@blis_interface_linalg_lv2_ger Float64 Float64 Float64 Float64 ger! ger!
@blis_interface_linalg_lv2_ger ComplexF32 ComplexF32 ComplexF32 ComplexF32 ger! ger!
@blis_interface_linalg_lv2_ger ComplexF64 ComplexF64 ComplexF64 ComplexF64 ger! ger!
macro blis_interface_linalg_lv2_her(Tc1, T1, T2, targetfunc, bliname, bli_struc)
# Get method for the object API backend.
blifuncname = Symbol("bli_", bliname)
blifunc = getproperty(ObjectBackend, blifuncname)
return quote
$(esc(targetfunc))(ul::AbstractChar,
α::$Tc1,
x::StridedVector{<:$T1},
A::StridedMatrix{<:$T2}) = begin
bli_ul = char_to_uplo[ul]
bli_check_lv2(BLIS_NO_TRANSPOSE,
size(A)...,
length(x),
length(x))
oα = BliObj(α)
ox = BliObj(x)
oA = BliObj(A)
ObjectBackend.bli_obj_set_uplo!(bli_ul, oA)
ObjectBackend.bli_obj_set_struc!($bli_struc, oA.obj)
$blifunc(oα, ox, oA)
A
end
end
end
@doc """
her!(uplo, α, x, A)
BLIS-based HER with strides support & mixed-precision.
""" her!
@blis_interface_linalg_lv2_her(BliCompatibleType,
BliCompatibleType,
BliCompatibleType,
her!, her!,
BLIS_HERMITIAN)
@blis_interface_linalg_lv2_her Float32 Float32 Float32 her! her! BLIS_HERMITIAN
@blis_interface_linalg_lv2_her Float64 Float64 Float64 her! her! BLIS_HERMITIAN
@blis_interface_linalg_lv2_her Float32 ComplexF32 ComplexF32 her! her! BLIS_HERMITIAN
@blis_interface_linalg_lv2_her Float64 ComplexF64 ComplexF64 her! her! BLIS_HERMITIAN
@doc """
syr!(uplo, α, x, A)
BLIS-based SYR with strides support & mixed-precision.
""" syr!
@blis_interface_linalg_lv2_her(BliCompatibleType,
BliCompatibleType,
BliCompatibleType,
syr!, syr!,
BLIS_SYMMETRIC)
@blis_interface_linalg_lv2_her Float32 Float32 Float32 syr! syr! BLIS_SYMMETRIC
@blis_interface_linalg_lv2_her Float64 Float64 Float64 syr! syr! BLIS_SYMMETRIC
@blis_interface_linalg_lv2_her ComplexF32 ComplexF32 ComplexF32 syr! syr! BLIS_SYMMETRIC
@blis_interface_linalg_lv2_her ComplexF64 ComplexF64 ComplexF64 syr! syr! BLIS_SYMMETRIC
| [
2,
5684,
12,
17,
44800,
2348,
29230,
13,
9148,
1921,
7071,
13,
198,
2,
198,
2,
16926,
46,
25,
1104,
308,
20475,
85,
28265,
264,
20475,
85,
0,
290,
289,
20475,
85,
43179,
198,
2,
220,
220,
220,
220,
220,
220,
289,
4426,
85,
0,
290,
599,
76,
85,
0,
318,
407,
1744,
1626,
1459,
5739,
13,
198,
198,
2,
5684,
17,
9878,
1921,
2546,
2198,
263,
13,
198,
2436,
72,
62,
9122,
62,
6780,
17,
7,
7645,
3712,
3629,
72,
8291,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
7904,
46541,
11,
299,
7904,
46541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
62,
3712,
46541,
11,
285,
62,
3712,
46541,
8,
796,
2221,
628,
220,
220,
220,
14808,
7645,
13,
44709,
1222,
9878,
1797,
62,
5446,
15037,
62,
26094,
8,
14512,
657,
8,
11405,
14808,
76,
11,
299,
8,
796,
357,
77,
11,
285,
4008,
198,
220,
220,
220,
357,
76,
6624,
285,
62,
8,
8614,
3714,
7,
29271,
3004,
44,
1042,
963,
7203,
21745,
11876,
2546,
46318,
526,
4008,
198,
220,
220,
220,
357,
77,
6624,
299,
62,
8,
8614,
3714,
7,
29271,
3004,
44,
1042,
963,
7203,
4264,
20216,
2546,
46318,
526,
4008,
628,
220,
220,
220,
2147,
198,
437,
198,
198,
20285,
305,
698,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
24090,
85,
7,
51,
66,
16,
11,
309,
16,
11,
309,
17,
11,
309,
66,
17,
11,
309,
18,
11,
2496,
20786,
11,
698,
259,
480,
8,
628,
220,
220,
220,
1303,
3497,
2446,
329,
262,
2134,
7824,
30203,
13,
198,
220,
220,
220,
698,
361,
19524,
3672,
796,
38357,
7203,
2436,
72,
62,
1600,
698,
259,
480,
8,
198,
220,
220,
220,
698,
361,
19524,
796,
651,
26745,
7,
10267,
7282,
437,
11,
698,
361,
19524,
3672,
8,
628,
220,
220,
220,
1441,
9577,
628,
220,
220,
220,
220,
220,
220,
220,
29568,
3798,
7,
16793,
20786,
4008,
7,
83,
32,
3712,
23839,
12441,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26367,
3712,
3,
51,
66,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
3712,
13290,
1384,
46912,
90,
27,
25,
3,
51,
16,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
3712,
13290,
1384,
38469,
90,
27,
25,
3,
51,
17,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27169,
3712,
3,
51,
66,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
331,
3712,
13290,
1384,
38469,
90,
27,
25,
3,
51,
18,
30072,
796,
2221,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
698,
72,
62,
83,
32,
796,
1149,
62,
1462,
62,
7645,
58,
83,
32,
60,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
698,
72,
62,
9122,
62,
6780,
17,
7,
2436,
72,
62,
83,
32,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2546,
7,
32,
26513,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4129,
7,
87,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4129,
7,
88,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
267,
17394,
796,
1086,
72,
49201,
7,
17394,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
267,
32,
796,
1086,
72,
49201,
7,
32,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12018,
796,
1086,
72,
49201,
7,
87,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
267,
26638,
796,
1086,
72,
49201,
7,
26638,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
35104,
796,
1086,
72,
49201,
7,
88,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9515,
7282,
437,
13,
2436,
72,
62,
26801,
62,
2617,
62,
8807,
7645,
0,
7,
2436,
72,
62,
83,
32,
11,
267,
32,
13,
26801,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
720,
2436,
361,
19524,
7,
78,
17394,
11,
267,
32,
11,
12018,
11,
267,
26638,
11,
35104,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
331,
628,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
437,
198,
198,
31,
15390,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
16840,
85,
0,
7,
83,
32,
11,
26367,
11,
317,
11,
2124,
11,
27169,
11,
331,
8,
198,
220,
220,
220,
9878,
1797,
12,
3106,
402,
3620,
53,
351,
35002,
1104,
1222,
7668,
12,
3866,
16005,
13,
198,
220,
220,
220,
37227,
16840,
85,
0,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
24090,
85,
7,
3629,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1086,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1086,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1086,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1086,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16840,
85,
28265,
16840,
85,
8133,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
24090,
85,
48436,
2624,
220,
220,
220,
48436,
2624,
220,
220,
220,
48436,
2624,
220,
220,
220,
48436,
2624,
220,
220,
220,
48436,
2624,
220,
220,
220,
16840,
85,
0,
16840,
85,
0,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
24090,
85,
48436,
2414,
220,
220,
220,
48436,
2414,
220,
220,
220,
48436,
2414,
220,
220,
220,
48436,
2414,
220,
220,
220,
48436,
2414,
220,
220,
220,
16840,
85,
0,
16840,
85,
0,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
24090,
85,
19157,
37,
2624,
19157,
37,
2624,
19157,
37,
2624,
19157,
37,
2624,
19157,
37,
2624,
16840,
85,
0,
16840,
85,
0,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
24090,
85,
19157,
37,
2414,
19157,
37,
2414,
19157,
37,
2414,
19157,
37,
2414,
19157,
37,
2414,
16840,
85,
0,
16840,
85,
0,
198,
198,
20285,
305,
698,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
4411,
85,
7,
51,
66,
16,
11,
309,
16,
11,
309,
17,
11,
309,
66,
17,
11,
309,
18,
11,
2496,
20786,
11,
698,
259,
480,
11,
698,
72,
62,
19554,
66,
8,
628,
220,
220,
220,
1303,
3497,
2446,
329,
262,
2134,
7824,
30203,
13,
198,
220,
220,
220,
698,
361,
19524,
3672,
796,
38357,
7203,
2436,
72,
62,
1600,
698,
259,
480,
8,
198,
220,
220,
220,
698,
361,
19524,
796,
651,
26745,
7,
10267,
7282,
437,
11,
698,
361,
19524,
3672,
8,
628,
220,
220,
220,
1441,
9577,
628,
220,
220,
220,
220,
220,
220,
220,
29568,
3798,
7,
16793,
20786,
4008,
7,
377,
3712,
23839,
12441,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26367,
3712,
3,
51,
66,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
3712,
13290,
1384,
46912,
90,
27,
25,
3,
51,
16,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
3712,
13290,
1384,
38469,
90,
27,
25,
3,
51,
17,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27169,
3712,
3,
51,
66,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
331,
3712,
13290,
1384,
38469,
90,
27,
25,
3,
51,
18,
30072,
796,
2221,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
698,
72,
62,
377,
796,
1149,
62,
1462,
62,
84,
489,
78,
58,
377,
60,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
698,
72,
62,
9122,
62,
6780,
17,
7,
9148,
1797,
62,
15285,
62,
5446,
1565,
4303,
14058,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2546,
7,
32,
26513,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4129,
7,
87,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4129,
7,
88,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
267,
17394,
796,
1086,
72,
49201,
7,
17394,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
267,
32,
796,
1086,
72,
49201,
7,
32,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12018,
796,
1086,
72,
49201,
7,
87,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
267,
26638,
796,
1086,
72,
49201,
7,
26638,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
35104,
796,
1086,
72,
49201,
7,
88,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9515,
7282,
437,
13,
2436,
72,
62,
26801,
62,
2617,
62,
84,
489,
78,
0,
7,
2436,
72,
62,
377,
11,
267,
32,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9515,
7282,
437,
13,
2436,
72,
62,
26801,
62,
2617,
62,
19554,
66,
0,
16763,
2436,
72,
62,
19554,
66,
11,
267,
32,
13,
26801,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
720,
2436,
361,
19524,
7,
78,
17394,
11,
267,
32,
11,
12018,
11,
267,
26638,
11,
35104,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
331,
628,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
437,
198,
198,
31,
15390,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
16869,
85,
0,
7,
377,
11,
26367,
11,
317,
11,
2124,
11,
27169,
11,
331,
8,
198,
220,
220,
220,
9878,
1797,
12,
3106,
367,
3620,
53,
351,
35002,
1104,
1222,
7668,
12,
3866,
16005,
13,
198,
220,
220,
220,
37227,
16869,
85,
0,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
4411,
85,
7,
3629,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1086,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1086,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1086,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1086,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16869,
85,
28265,
16869,
85,
28265,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9878,
1797,
62,
16879,
36393,
16868,
8,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
4411,
85,
48436,
2624,
220,
220,
220,
48436,
2624,
220,
220,
220,
48436,
2624,
220,
220,
220,
48436,
2624,
220,
220,
220,
48436,
2624,
220,
220,
220,
16869,
85,
0,
16869,
85,
0,
9878,
1797,
62,
16879,
36393,
16868,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
4411,
85,
48436,
2414,
220,
220,
220,
48436,
2414,
220,
220,
220,
48436,
2414,
220,
220,
220,
48436,
2414,
220,
220,
220,
48436,
2414,
220,
220,
220,
16869,
85,
0,
16869,
85,
0,
9878,
1797,
62,
16879,
36393,
16868,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
4411,
85,
19157,
37,
2624,
19157,
37,
2624,
19157,
37,
2624,
19157,
37,
2624,
19157,
37,
2624,
16869,
85,
0,
16869,
85,
0,
9878,
1797,
62,
16879,
36393,
16868,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
4411,
85,
19157,
37,
2414,
19157,
37,
2414,
19157,
37,
2414,
19157,
37,
2414,
19157,
37,
2414,
16869,
85,
0,
16869,
85,
0,
9878,
1797,
62,
16879,
36393,
16868,
198,
198,
31,
15390,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
5659,
85,
0,
7,
377,
11,
26367,
11,
317,
11,
2124,
11,
27169,
11,
331,
8,
198,
220,
220,
220,
9878,
1797,
12,
3106,
19704,
44,
53,
351,
35002,
1104,
1222,
7668,
12,
3866,
16005,
13,
198,
220,
220,
220,
37227,
5659,
85,
0,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
4411,
85,
7,
3629,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1086,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1086,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1086,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1086,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5659,
85,
28265,
5659,
85,
28265,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9878,
1797,
62,
23060,
12038,
2767,
41132,
8,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
4411,
85,
48436,
2624,
220,
220,
220,
48436,
2624,
220,
220,
220,
48436,
2624,
220,
220,
220,
48436,
2624,
220,
220,
220,
48436,
2624,
220,
220,
220,
5659,
85,
0,
5659,
85,
0,
9878,
1797,
62,
23060,
12038,
2767,
41132,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
4411,
85,
48436,
2414,
220,
220,
220,
48436,
2414,
220,
220,
220,
48436,
2414,
220,
220,
220,
48436,
2414,
220,
220,
220,
48436,
2414,
220,
220,
220,
5659,
85,
0,
5659,
85,
0,
9878,
1797,
62,
23060,
12038,
2767,
41132,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
4411,
85,
19157,
37,
2624,
19157,
37,
2624,
19157,
37,
2624,
19157,
37,
2624,
19157,
37,
2624,
5659,
85,
0,
5659,
85,
0,
9878,
1797,
62,
23060,
12038,
2767,
41132,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
4411,
85,
19157,
37,
2414,
19157,
37,
2414,
19157,
37,
2414,
19157,
37,
2414,
19157,
37,
2414,
5659,
85,
0,
5659,
85,
0,
9878,
1797,
62,
23060,
12038,
2767,
41132,
198,
198,
20285,
305,
698,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
2213,
76,
85,
7,
51,
16,
11,
309,
17,
11,
2496,
20786,
11,
698,
259,
480,
8,
628,
220,
220,
220,
1303,
3497,
2446,
329,
262,
2134,
7824,
30203,
13,
198,
220,
220,
220,
698,
361,
19524,
3672,
796,
38357,
7203,
2436,
72,
62,
1600,
698,
259,
480,
8,
198,
220,
220,
220,
698,
361,
19524,
796,
651,
26745,
7,
10267,
7282,
437,
11,
698,
361,
19524,
3672,
8,
628,
220,
220,
220,
1441,
9577,
628,
220,
220,
220,
220,
220,
220,
220,
29568,
3798,
7,
16793,
20786,
4008,
7,
377,
3712,
23839,
12441,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
32,
3712,
23839,
12441,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
288,
32,
3712,
23839,
12441,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
3712,
13290,
1384,
46912,
90,
27,
25,
3,
51,
16,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
3712,
13290,
1384,
38469,
90,
27,
25,
3,
51,
17,
30072,
796,
2221,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
698,
72,
62,
377,
796,
1149,
62,
1462,
62,
84,
489,
78,
58,
377,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
698,
72,
62,
67,
32,
796,
1149,
62,
1462,
62,
10989,
363,
58,
67,
32,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
698,
72,
62,
83,
32,
796,
1149,
62,
1462,
62,
7645,
58,
83,
32,
60,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
698,
72,
62,
9122,
62,
6780,
17,
7,
2436,
72,
62,
83,
32,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2546,
7,
32,
26513,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4129,
7,
65,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4129,
7,
65,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
267,
17394,
796,
1086,
72,
49201,
16763,
51,
16,
7,
16,
13,
15,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
267,
32,
796,
1086,
72,
49201,
7,
32,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
909,
796,
1086,
72,
49201,
7,
65,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9515,
7282,
437,
13,
2436,
72,
62,
26801,
62,
2617,
62,
84,
489,
78,
0,
7,
2436,
72,
62,
377,
11,
267,
32,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9515,
7282,
437,
13,
2436,
72,
62,
26801,
62,
2617,
62,
10989,
363,
0,
7,
2436,
72,
62,
67,
32,
11,
267,
32,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9515,
7282,
437,
13,
2436,
72,
62,
26801,
62,
2617,
62,
8807,
7645,
0,
7,
2436,
72,
62,
83,
32,
11,
267,
32,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
720,
2436,
361,
19524,
7,
78,
17394,
11,
267,
32,
11,
909,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
628,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
437,
198,
198,
31,
15390,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
491,
76,
85,
0,
7,
377,
11,
256,
32,
11,
288,
32,
11,
317,
11,
275,
8,
198,
220,
220,
220,
9878,
1797,
12,
3106,
7579,
44,
53,
351,
35002,
1104,
1222,
7668,
12,
3866,
16005,
13,
198,
220,
220,
220,
37227,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
2213,
76,
85,
7,
3629,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1086,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
491,
76,
85,
28265,
491,
76,
85,
8133,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
2213,
76,
85,
48436,
2624,
220,
220,
220,
48436,
2624,
220,
220,
220,
491,
76,
85,
0,
491,
76,
85,
0,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
2213,
76,
85,
48436,
2414,
220,
220,
220,
48436,
2414,
220,
220,
220,
491,
76,
85,
0,
491,
76,
85,
0,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
2213,
76,
85,
19157,
37,
2624,
19157,
37,
2624,
491,
76,
85,
0,
491,
76,
85,
0,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
2213,
76,
85,
19157,
37,
2414,
19157,
37,
2414,
491,
76,
85,
0,
491,
76,
85,
0,
198,
198,
31,
15390,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
491,
21370,
0,
7,
377,
11,
256,
32,
11,
288,
32,
11,
317,
11,
275,
8,
198,
220,
220,
220,
9878,
1797,
12,
3106,
309,
6998,
53,
351,
35002,
1104,
1222,
7668,
12,
3866,
16005,
13,
198,
220,
220,
220,
37227,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
2213,
76,
85,
7,
3629,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1086,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
491,
21370,
28265,
491,
21370,
8133,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
2213,
76,
85,
48436,
2624,
220,
220,
220,
48436,
2624,
220,
220,
220,
491,
21370,
0,
491,
21370,
0,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
2213,
76,
85,
48436,
2414,
220,
220,
220,
48436,
2414,
220,
220,
220,
491,
21370,
0,
491,
21370,
0,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
2213,
76,
85,
19157,
37,
2624,
19157,
37,
2624,
491,
21370,
0,
491,
21370,
0,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
2213,
76,
85,
19157,
37,
2414,
19157,
37,
2414,
491,
21370,
0,
491,
21370,
0,
198,
198,
20285,
305,
698,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
1362,
7,
51,
66,
16,
11,
309,
16,
11,
309,
17,
11,
309,
18,
11,
2496,
20786,
11,
698,
259,
480,
8,
628,
220,
220,
220,
1303,
3497,
2446,
329,
262,
2134,
7824,
30203,
13,
198,
220,
220,
220,
698,
361,
19524,
3672,
796,
38357,
7203,
2436,
72,
62,
1600,
698,
259,
480,
8,
198,
220,
220,
220,
698,
361,
19524,
796,
651,
26745,
7,
10267,
7282,
437,
11,
698,
361,
19524,
3672,
8,
628,
220,
220,
220,
1441,
9577,
628,
220,
220,
220,
220,
220,
220,
220,
29568,
3798,
7,
16793,
20786,
4008,
7,
17394,
3712,
3,
51,
66,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
3712,
13290,
1384,
38469,
90,
27,
25,
3,
51,
16,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
331,
3712,
13290,
1384,
38469,
90,
27,
25,
3,
51,
17,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
3712,
13290,
1384,
46912,
90,
27,
25,
3,
51,
18,
30072,
796,
2221,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
698,
72,
62,
9122,
62,
6780,
17,
7,
9148,
1797,
62,
15285,
62,
5446,
1565,
4303,
14058,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2546,
7,
32,
26513,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4129,
7,
88,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4129,
7,
87,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
267,
17394,
796,
1086,
72,
49201,
7,
17394,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12018,
796,
1086,
72,
49201,
7,
87,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
35104,
796,
1086,
72,
49201,
7,
88,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
267,
32,
796,
1086,
72,
49201,
7,
32,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
720,
2436,
361,
19524,
7,
78,
17394,
11,
12018,
11,
35104,
11,
267,
32,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
628,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
437,
198,
198,
31,
15390,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
27602,
0,
7,
17394,
11,
2124,
11,
331,
11,
317,
8,
198,
220,
220,
220,
9878,
1797,
12,
3106,
44186,
351,
35002,
1104,
1222,
7668,
12,
3866,
16005,
13,
198,
220,
220,
220,
37227,
27602,
0,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
1362,
7,
3629,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1086,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1086,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1086,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27602,
28265,
27602,
8133,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
1362,
48436,
2624,
220,
220,
220,
48436,
2624,
220,
220,
220,
48436,
2624,
220,
220,
220,
48436,
2624,
220,
220,
220,
27602,
0,
27602,
0,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
1362,
48436,
2414,
220,
220,
220,
48436,
2414,
220,
220,
220,
48436,
2414,
220,
220,
220,
48436,
2414,
220,
220,
220,
27602,
0,
27602,
0,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
1362,
19157,
37,
2624,
19157,
37,
2624,
19157,
37,
2624,
19157,
37,
2624,
27602,
0,
27602,
0,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
1362,
19157,
37,
2414,
19157,
37,
2414,
19157,
37,
2414,
19157,
37,
2414,
27602,
0,
27602,
0,
198,
198,
20285,
305,
698,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
372,
7,
51,
66,
16,
11,
309,
16,
11,
309,
17,
11,
2496,
20786,
11,
698,
259,
480,
11,
698,
72,
62,
19554,
66,
8,
628,
220,
220,
220,
1303,
3497,
2446,
329,
262,
2134,
7824,
30203,
13,
198,
220,
220,
220,
698,
361,
19524,
3672,
796,
38357,
7203,
2436,
72,
62,
1600,
698,
259,
480,
8,
198,
220,
220,
220,
698,
361,
19524,
796,
651,
26745,
7,
10267,
7282,
437,
11,
698,
361,
19524,
3672,
8,
628,
220,
220,
220,
1441,
9577,
628,
220,
220,
220,
220,
220,
220,
220,
29568,
3798,
7,
16793,
20786,
4008,
7,
377,
3712,
23839,
12441,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26367,
3712,
3,
51,
66,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
3712,
13290,
1384,
38469,
90,
27,
25,
3,
51,
16,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
3712,
13290,
1384,
46912,
90,
27,
25,
3,
51,
17,
30072,
796,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
698,
72,
62,
377,
796,
1149,
62,
1462,
62,
84,
489,
78,
58,
377,
60,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
698,
72,
62,
9122,
62,
6780,
17,
7,
9148,
1797,
62,
15285,
62,
5446,
1565,
4303,
14058,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2546,
7,
32,
26513,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4129,
7,
87,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4129,
7,
87,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
267,
17394,
796,
1086,
72,
49201,
7,
17394,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12018,
796,
1086,
72,
49201,
7,
87,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
267,
32,
796,
1086,
72,
49201,
7,
32,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9515,
7282,
437,
13,
2436,
72,
62,
26801,
62,
2617,
62,
84,
489,
78,
0,
7,
2436,
72,
62,
377,
11,
267,
32,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9515,
7282,
437,
13,
2436,
72,
62,
26801,
62,
2617,
62,
19554,
66,
0,
16763,
2436,
72,
62,
19554,
66,
11,
267,
32,
13,
26801,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
720,
2436,
361,
19524,
7,
78,
17394,
11,
12018,
11,
267,
32,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
628,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
437,
198,
198,
31,
15390,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
607,
0,
7,
84,
489,
78,
11,
26367,
11,
2124,
11,
317,
8,
198,
220,
220,
220,
9878,
1797,
12,
3106,
24906,
351,
35002,
1104,
1222,
7668,
12,
3866,
16005,
13,
198,
220,
220,
220,
37227,
607,
0,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
372,
7,
3629,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1086,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1086,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
607,
28265,
607,
28265,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9878,
1797,
62,
16879,
36393,
16868,
8,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
372,
48436,
2624,
220,
220,
220,
48436,
2624,
220,
220,
220,
48436,
2624,
220,
220,
220,
607,
0,
607,
0,
9878,
1797,
62,
16879,
36393,
16868,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
372,
48436,
2414,
220,
220,
220,
48436,
2414,
220,
220,
220,
48436,
2414,
220,
220,
220,
607,
0,
607,
0,
9878,
1797,
62,
16879,
36393,
16868,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
372,
48436,
2624,
220,
220,
220,
19157,
37,
2624,
19157,
37,
2624,
607,
0,
607,
0,
9878,
1797,
62,
16879,
36393,
16868,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
372,
48436,
2414,
220,
220,
220,
19157,
37,
2414,
19157,
37,
2414,
607,
0,
607,
0,
9878,
1797,
62,
16879,
36393,
16868,
198,
198,
31,
15390,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
827,
81,
0,
7,
84,
489,
78,
11,
26367,
11,
2124,
11,
317,
8,
198,
220,
220,
220,
9878,
1797,
12,
3106,
19704,
49,
351,
35002,
1104,
1222,
7668,
12,
3866,
16005,
13,
198,
220,
220,
220,
37227,
827,
81,
0,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
372,
7,
3629,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1086,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1086,
72,
7293,
16873,
6030,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
827,
81,
28265,
827,
81,
28265,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9878,
1797,
62,
23060,
12038,
2767,
41132,
8,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
372,
48436,
2624,
220,
220,
220,
48436,
2624,
220,
220,
220,
48436,
2624,
220,
220,
220,
827,
81,
0,
827,
81,
0,
9878,
1797,
62,
23060,
12038,
2767,
41132,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
372,
48436,
2414,
220,
220,
220,
48436,
2414,
220,
220,
220,
48436,
2414,
220,
220,
220,
827,
81,
0,
827,
81,
0,
9878,
1797,
62,
23060,
12038,
2767,
41132,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
372,
19157,
37,
2624,
19157,
37,
2624,
19157,
37,
2624,
827,
81,
0,
827,
81,
0,
9878,
1797,
62,
23060,
12038,
2767,
41132,
198,
31,
2436,
271,
62,
39994,
62,
75,
1292,
70,
62,
6780,
17,
62,
372,
19157,
37,
2414,
19157,
37,
2414,
19157,
37,
2414,
827,
81,
0,
827,
81,
0,
9878,
1797,
62,
23060,
12038,
2767,
41132,
628
] | 1.725754 | 6,465 |
@testset "shapes" begin
inputsize = 20
poollength = 10
datalength = 100
x = rand(Float32, inputsize, poollength, 1, datalength)
m = LSTnet(inputsize, 2, 3, poollength, 20)
@test size(m(x)) == (1, datalength)
if Flux.CUDA.functional()
@test size(gpu(m)(gpu(x))) == (1, datalength)
end
FluxArchitectures.initialize_bias!(m)
@test all(m.RecurLayer.chain.cell.b .== 1)
@test all(m.RecurSkipLayer.cell.b .== 1)
end
@testset "ReluGRU" begin
inputsize = 20
datalength = 100
x = rand(Float32, inputsize, datalength)
m = FluxArchitectures.ReluGRU(inputsize, 10)
@test size(m(x)) == (10, datalength)
if Flux.CUDA.functional()
@test size(gpu(m)(gpu(x))) == (10, datalength)
end
end
@testset "misc" begin
@test repr(LSTnet(10, 2, 3, 10, 20)) == "LSTnet(10, 2, 3, 10, 20)"
@test repr(FluxArchitectures.ReluGRU(20, 10)) == "Recur(ReluGRUCell(20, 10))"
end | [
31,
9288,
2617,
366,
1477,
7916,
1,
2221,
198,
220,
220,
220,
5128,
7857,
796,
1160,
198,
220,
220,
220,
745,
692,
3286,
796,
838,
198,
220,
220,
220,
4818,
282,
3286,
796,
1802,
198,
220,
220,
220,
2124,
796,
43720,
7,
43879,
2624,
11,
5128,
7857,
11,
745,
692,
3286,
11,
352,
11,
4818,
282,
3286,
8,
198,
220,
220,
220,
285,
796,
406,
2257,
3262,
7,
15414,
7857,
11,
362,
11,
513,
11,
745,
692,
3286,
11,
1160,
8,
198,
220,
220,
220,
2488,
9288,
2546,
7,
76,
7,
87,
4008,
6624,
357,
16,
11,
4818,
282,
3286,
8,
198,
220,
220,
220,
611,
1610,
2821,
13,
43633,
5631,
13,
45124,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2546,
7,
46999,
7,
76,
5769,
46999,
7,
87,
22305,
6624,
357,
16,
11,
4818,
282,
3286,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1610,
2821,
19895,
5712,
942,
13,
36733,
1096,
62,
65,
4448,
0,
7,
76,
8,
198,
197,
31,
9288,
477,
7,
76,
13,
6690,
333,
49925,
13,
7983,
13,
3846,
13,
65,
764,
855,
352,
8,
198,
197,
31,
9288,
477,
7,
76,
13,
6690,
333,
50232,
49925,
13,
3846,
13,
65,
764,
855,
352,
8,
198,
437,
220,
198,
198,
31,
9288,
2617,
366,
6892,
84,
10761,
52,
1,
2221,
198,
220,
220,
220,
5128,
7857,
796,
1160,
198,
220,
220,
220,
4818,
282,
3286,
796,
1802,
198,
220,
220,
220,
2124,
796,
43720,
7,
43879,
2624,
11,
5128,
7857,
11,
4818,
282,
3286,
8,
198,
220,
220,
220,
285,
796,
1610,
2821,
19895,
5712,
942,
13,
6892,
84,
10761,
52,
7,
15414,
7857,
11,
838,
8,
198,
220,
220,
220,
2488,
9288,
2546,
7,
76,
7,
87,
4008,
6624,
357,
940,
11,
4818,
282,
3286,
8,
198,
220,
220,
220,
611,
1610,
2821,
13,
43633,
5631,
13,
45124,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2546,
7,
46999,
7,
76,
5769,
46999,
7,
87,
22305,
6624,
357,
940,
11,
4818,
282,
3286,
8,
198,
220,
220,
220,
886,
198,
437,
198,
198,
31,
9288,
2617,
366,
44374,
1,
2221,
198,
220,
220,
220,
2488,
9288,
41575,
7,
43,
2257,
3262,
7,
940,
11,
362,
11,
513,
11,
838,
11,
1160,
4008,
6624,
366,
43,
2257,
3262,
7,
940,
11,
362,
11,
513,
11,
838,
11,
1160,
16725,
198,
220,
220,
220,
2488,
9288,
41575,
7,
37,
22564,
19895,
5712,
942,
13,
6892,
84,
10761,
52,
7,
1238,
11,
838,
4008,
6624,
366,
6690,
333,
7,
6892,
84,
10761,
9598,
695,
7,
1238,
11,
838,
4008,
1,
198,
437
] | 2.147126 | 435 |
using Test
using .Stubs
using DandelionWebSockets
@testset "InProcessIO" begin
@testset "Write 1-5 on endpoint 1; Can read 1-5 on endpoint 2" begin
iopair = InProcessIOPair()
readvalues = UInt8[]
@sync begin
@async begin
for i = 1:5
write(iopair.endpoint1, UInt8(i))
end
end
@async begin
for i = 1:5
x = read(iopair.endpoint2, UInt8)
push!(readvalues, x)
end
end
end
@test readvalues == UInt8[1, 2, 3, 4, 5]
end
@testset "Write 1-5 on endpoint 1, and 100-110 on endpoint 2; Values can be read independently" begin
iopair = InProcessIOPair()
readon1 = UInt8[]
readon2 = UInt8[]
@sync begin
@async begin
for i = 1:5
write(iopair.endpoint1, UInt8(i))
end
close(iopair.endpoint1)
end
@async begin
for i = 100:110
write(iopair.endpoint2, UInt8(i))
end
close(iopair.endpoint2)
end
@async begin
try
while true
x = read(iopair.endpoint1, UInt8)
push!(readon1, x)
end
catch ex
if typeof(ex) != EOFError
rethrow()
end
end
end
@async begin
try
while true
x = read(iopair.endpoint2, UInt8)
push!(readon2, x)
end
catch ex
if typeof(ex) != EOFError
rethrow()
end
end
end
end
@test readon1 == UInt8[100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110]
@test readon2 == UInt8[1, 2, 3, 4, 5]
end
@testset "Send 5 values, and then close endpoint 1; EOF is reported on endpoint 2 after 5 values" begin
iopair = InProcessIOPair()
readvalues = []
for i = 1:5
write(iopair.endpoint1, UInt8(i))
end
close(iopair.endpoint1)
for i = 1:5
x = read(iopair.endpoint2, UInt8)
push!(readvalues, x)
end
@test readvalues == UInt8[1, 2, 3, 4, 5]
@test eof(iopair.endpoint2)
end
@testset "Send 5 values, and then close endpoint 1; EOF is not reported on endpoint 2 until after 5 values have been read" begin
iopair = InProcessIOPair()
for i = 1:5
write(iopair.endpoint1, UInt8(1))
end
close(iopair.endpoint1)
for i = 1:5
@test !eof(iopair.endpoint2)
read(iopair.endpoint2, UInt8)
end
end
@testset "Send a frame on endpoint 1; Received a frame on endpoint 2" begin
iopair = InProcessIOPair()
sentframe = Stubs.createserverframe(DandelionWebSockets.OPCODE_TEXT, b"Hello")
write(iopair.endpoint1, sentframe)
receivedframe = read(iopair.endpoint2, DandelionWebSockets.Frame)
@test sentframe.payload == receivedframe.payload
end
@testset "Read from empty stream on endpoint 1 and close endpoint 2; Read throws exception" begin
eofthrown = false
iopair = InProcessIOPair()
@sync begin
@async begin
try
read(iopair.endpoint1, UInt64)
catch ex
if typeof(ex) == EOFError
eofthrown = true
else
rethrow()
end
end
end
@async begin
sleep(0.5)
close(iopair.endpoint2)
end
end
@test eofthrown
end
end | [
3500,
6208,
198,
3500,
764,
1273,
23161,
198,
3500,
360,
33134,
295,
13908,
50,
11603,
198,
198,
31,
9288,
2617,
366,
818,
18709,
9399,
1,
2221,
198,
220,
220,
220,
2488,
9288,
2617,
366,
16594,
352,
12,
20,
319,
36123,
352,
26,
1680,
1100,
352,
12,
20,
319,
36123,
362,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
404,
958,
796,
554,
18709,
40,
3185,
958,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1100,
27160,
796,
471,
5317,
23,
21737,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
27261,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
292,
13361,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
796,
352,
25,
20,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3551,
7,
14922,
958,
13,
437,
4122,
16,
11,
471,
5317,
23,
7,
72,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
292,
13361,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
796,
352,
25,
20,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
796,
1100,
7,
14922,
958,
13,
437,
4122,
17,
11,
471,
5317,
23,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4574,
0,
7,
961,
27160,
11,
2124,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
886,
628,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1100,
27160,
6624,
471,
5317,
23,
58,
16,
11,
362,
11,
513,
11,
604,
11,
642,
60,
198,
220,
220,
220,
886,
628,
220,
220,
220,
2488,
9288,
2617,
366,
16594,
352,
12,
20,
319,
36123,
352,
11,
290,
1802,
12,
11442,
319,
36123,
362,
26,
27068,
460,
307,
1100,
14799,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
404,
958,
796,
554,
18709,
40,
3185,
958,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1100,
261,
16,
796,
471,
5317,
23,
21737,
198,
220,
220,
220,
220,
220,
220,
220,
1100,
261,
17,
796,
471,
5317,
23,
21737,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
27261,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
292,
13361,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
796,
352,
25,
20,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3551,
7,
14922,
958,
13,
437,
4122,
16,
11,
471,
5317,
23,
7,
72,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1969,
7,
14922,
958,
13,
437,
4122,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
292,
13361,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
796,
1802,
25,
11442,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3551,
7,
14922,
958,
13,
437,
4122,
17,
11,
471,
5317,
23,
7,
72,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1969,
7,
14922,
958,
13,
437,
4122,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
292,
13361,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1949,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
981,
2081,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
796,
1100,
7,
14922,
958,
13,
437,
4122,
16,
11,
471,
5317,
23,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4574,
0,
7,
961,
261,
16,
11,
2124,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4929,
409,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2099,
1659,
7,
1069,
8,
14512,
412,
19238,
12331,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
302,
16939,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
292,
13361,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1949,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
981,
2081,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
796,
1100,
7,
14922,
958,
13,
437,
4122,
17,
11,
471,
5317,
23,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4574,
0,
7,
961,
261,
17,
11,
2124,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4929,
409,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2099,
1659,
7,
1069,
8,
14512,
412,
19238,
12331,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
302,
16939,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
886,
628,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1100,
261,
16,
6624,
471,
5317,
23,
58,
3064,
11,
8949,
11,
15143,
11,
15349,
11,
14436,
11,
13343,
11,
15696,
11,
16226,
11,
15495,
11,
16003,
11,
9796,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1100,
261,
17,
6624,
471,
5317,
23,
58,
16,
11,
362,
11,
513,
11,
604,
11,
642,
60,
198,
220,
220,
220,
886,
628,
220,
220,
220,
2488,
9288,
2617,
366,
25206,
642,
3815,
11,
290,
788,
1969,
36123,
352,
26,
412,
19238,
318,
2098,
319,
36123,
362,
706,
642,
3815,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
404,
958,
796,
554,
18709,
40,
3185,
958,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1100,
27160,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
796,
352,
25,
20,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3551,
7,
14922,
958,
13,
437,
4122,
16,
11,
471,
5317,
23,
7,
72,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
1969,
7,
14922,
958,
13,
437,
4122,
16,
8,
628,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
796,
352,
25,
20,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
796,
1100,
7,
14922,
958,
13,
437,
4122,
17,
11,
471,
5317,
23,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4574,
0,
7,
961,
27160,
11,
2124,
8,
198,
220,
220,
220,
220,
220,
220,
220,
886,
628,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1100,
27160,
6624,
471,
5317,
23,
58,
16,
11,
362,
11,
513,
11,
604,
11,
642,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
304,
1659,
7,
14922,
958,
13,
437,
4122,
17,
8,
198,
220,
220,
220,
886,
628,
220,
220,
220,
2488,
9288,
2617,
366,
25206,
642,
3815,
11,
290,
788,
1969,
36123,
352,
26,
412,
19238,
318,
407,
2098,
319,
36123,
362,
1566,
706,
642,
3815,
423,
587,
1100,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
404,
958,
796,
554,
18709,
40,
3185,
958,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
796,
352,
25,
20,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3551,
7,
14922,
958,
13,
437,
4122,
16,
11,
471,
5317,
23,
7,
16,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
1969,
7,
14922,
958,
13,
437,
4122,
16,
8,
628,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
796,
352,
25,
20,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
5145,
68,
1659,
7,
14922,
958,
13,
437,
4122,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1100,
7,
14922,
958,
13,
437,
4122,
17,
11,
471,
5317,
23,
8,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
628,
220,
220,
220,
2488,
9288,
2617,
366,
25206,
257,
5739,
319,
36123,
352,
26,
20557,
257,
5739,
319,
36123,
362,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
404,
958,
796,
554,
18709,
40,
3185,
958,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1908,
14535,
796,
520,
23161,
13,
20123,
274,
18497,
14535,
7,
35,
33134,
295,
13908,
50,
11603,
13,
3185,
34,
16820,
62,
32541,
11,
275,
1,
15496,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
3551,
7,
14922,
958,
13,
437,
4122,
16,
11,
1908,
14535,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2722,
14535,
796,
1100,
7,
14922,
958,
13,
437,
4122,
17,
11,
360,
33134,
295,
13908,
50,
11603,
13,
19778,
8,
628,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1908,
14535,
13,
15577,
2220,
6624,
2722,
14535,
13,
15577,
2220,
198,
220,
220,
220,
886,
628,
220,
220,
220,
2488,
9288,
2617,
366,
5569,
422,
6565,
4269,
319,
36123,
352,
290,
1969,
36123,
362,
26,
4149,
12542,
6631,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
304,
1659,
400,
2053,
796,
3991,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
404,
958,
796,
554,
18709,
40,
3185,
958,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
2488,
27261,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
292,
13361,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1949,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1100,
7,
14922,
958,
13,
437,
4122,
16,
11,
471,
5317,
2414,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4929,
409,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2099,
1659,
7,
1069,
8,
6624,
412,
19238,
12331,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
304,
1659,
400,
2053,
796,
2081,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
302,
16939,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
292,
13361,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3993,
7,
15,
13,
20,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1969,
7,
14922,
958,
13,
437,
4122,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
886,
628,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
304,
1659,
400,
2053,
198,
220,
220,
220,
886,
198,
437
] | 1.711205 | 2,365 |
#MDDatasets DataRS (Recursive Sweep) defninitions
#-------------------------------------------------------------------------------
#==Main types
===============================================================================#
#Linked-list representation of multi-dimensional datasets:
#-------------------------------------------------------------------------------
mutable struct DataRS{T} <: DataMD
sweep::PSweep
elem::Vector{T}
function DataRS{T}(sweep::PSweep, elem::Vector{T}) where {T}
if !elemallowed(DataRS, eltype(elem))
msg = "Can only create DataRS{T} for T ∈ {DataRS, DataF1, DataFloat, DataInt, DataComplex}"
throw(ArgumentError(msg))
elseif length(sweep) != length(elem)
throw(ArgumentError("sweep length does not match number of elem"))
end
return new(sweep, elem)
end
end
#Shorthand (because default (non-parameterized) constructor was overwritten):
DataRS(sweep::PSweep, elem::Vector{T}) where T = DataRS{T}(sweep, elem)
elemallowed(::Type{DataRS}, t::Type{T}) where T = elemallowed(DataMD, t) #Allow basic types
elemallowed(::Type{DataRS}, ::Type{DataRS}) = true #Also allow recursive structures
#Generate empty DataRS structure:
(::Type{DataRS{T}})(sweep::PSweep) where T = DataRS{T}(sweep, Array{T}(undef, length(sweep)))
#==Type promotions
===============================================================================#
Base.promote_rule(::Type{T1}, ::Type{T2}) where {T1<:DataRS, T2<:Number} = DataRS
#==Accessor functions
===============================================================================#
Base.eltype(d::DataRS{T}) where T = T
Base.length(d::DataRS) = length(d.elem)
#==Help with construction
===============================================================================#
#Implement "fill(DataRS, ...) do sweepval" syntax:
function Base.fill!(fn::Function, d::DataRS)
for i in 1:length(d.sweep)
d.elem[i] = fn(d.sweep.v[i])
end
return d
end
Base.fill(fn::Function, ::Type{DataRS{T}}, sweep::PSweep) where T =
fill!(fn, DataRS(sweep, Array{T}(undef, length(sweep))))
Base.fill(fn::Function, ::Type{DataRS}, sweep::PSweep) = fill(fn, DataRS{DataRS}, sweep)
#==Data generation
===============================================================================#
function _ensuresweepunique(d::DataRS, sweepid::String)
if sweepid == d.sweep.id
msg = "Sweep occurs multiple times in DataRS: $sweepid"
throw(ArgumentError(msg))
end
end
#Define "parameter".
#(Generates a DataRS object containing the value of a given swept parameter)
#-------------------------------------------------------------------------------
#Deal with non-leaf elements, once the sweep value is found:
function _parameter(d::DataRS{DataRS}, sweepid::String, sweepval::T) where T
_ensuresweepunique(d, sweepid)
elem = DataRS[_parameter(d.elem[i], sweepid, sweepval) for i in 1:length(d.sweep)]
return DataRS(d.sweep, elem)
end
#Deal with leaf elements, once the sweep value is found:
function _parameter(d::DataRS, sweepid::String, sweepval::T) where T
_ensuresweepunique(d, sweepid)
elem = T[sweepval for i in 1:length(d.sweep)]
return DataRS(d.sweep, elem)
end
#Main "parameter" algorithm (non-leaf elements):
function parameter(d::DataRS{DataRS}, sweepid::String)
if sweepid == d.sweep.id #Sweep found
elem = DataRS[_parameter(d.elem[i], sweepid, d.sweep.v[i]) for i in 1:length(d.sweep)]
else
elem = DataRS[parameter(d.elem[i], sweepid) for i in 1:length(d.sweep)]
end
return DataRS(d.sweep, elem)
end
#Main "parameter" algorithm (leaf elements):
function parameter(d::DataRS, sweepid::String)
T = eltype(d.sweep.v)
if sweepid == d.sweep.id #Sweep found
return DataRS(d.sweep, d.sweep.v)
else
msg = "Sweep not found in DataRS: $sweepid"
throw(ArgumentError(msg))
end
end
#Generate DataRS from DataHR.
#-------------------------------------------------------------------------------
function _buildDataRS(d::DataHR, firstinds::Vector{Int})
curidx = length(firstinds) + 1
sweep = d.sweeps[curidx]
if curidx < length(d.sweeps)
result = DataRS{DataRS}(sweep)
for i in 1:length(sweep.v)
result.elem[i] = _buildDataRS(d, vcat(firstinds, i))
end
else #Last index. Copy data over:
result = DataRS{eltype(d.elem)}(sweep)
for i in 1:length(sweep.v)
result.elem[i] = d.elem[firstinds..., i]
end
end
return result
end
function DataRS(d::DataHR)
return _buildDataRS(d, Int[])
end
#==User-friendly show functions
===============================================================================#
#Print leaf element:
function printDataRSelem(io::IO, ds::DataRS, idx::Int, indent::String)
if isassigned(ds.elem, idx)
println(io, ds.elem[idx])
else
println(io, indent, "UNDEFINED")
end
end
#Print next level of recursive DataRS:
function printDataRSelem(io::IO, ds::DataRS{T}, idx::Int, indent::String) where T<:DataRS
println(io)
if isassigned(ds.elem, idx)
printDataRS(io, ds.elem[idx], indent)
else
println(io, indent, "UNDEFINED")
end
end
#Print DataRS structure:
function printDataRS(io::IO, ds::DataRS, indent::String)
for i in 1:length(ds.elem)
print(io, "$indent", ds.sweep.id, "=", ds.sweep.v[i], ": ")
printDataRSelem(io, ds, i, "$indent ")
end
end
function Base.show(io::IO, ds::DataRS)
print(io, "DataRS[\n")
printDataRS(io, ds, " ")
print(io, "]\n")
end
| [
2,
12740,
27354,
292,
1039,
6060,
6998,
357,
6690,
30753,
42818,
8,
825,
35073,
1756,
198,
2,
10097,
24305,
198,
198,
2,
855,
13383,
3858,
198,
23926,
25609,
18604,
2,
198,
198,
2,
11280,
276,
12,
4868,
10552,
286,
5021,
12,
19577,
40522,
25,
198,
2,
10097,
24305,
198,
76,
18187,
2878,
6060,
6998,
90,
51,
92,
1279,
25,
6060,
12740,
198,
197,
46280,
538,
3712,
3705,
732,
538,
198,
197,
68,
10671,
3712,
38469,
90,
51,
92,
628,
197,
8818,
6060,
6998,
90,
51,
92,
7,
46280,
538,
3712,
3705,
732,
538,
11,
9766,
76,
3712,
38469,
90,
51,
30072,
810,
1391,
51,
92,
198,
197,
197,
361,
5145,
68,
10671,
40845,
7,
6601,
6998,
11,
1288,
4906,
7,
68,
10671,
4008,
198,
197,
197,
197,
19662,
796,
366,
6090,
691,
2251,
6060,
6998,
90,
51,
92,
329,
309,
18872,
230,
1391,
6601,
6998,
11,
6060,
37,
16,
11,
6060,
43879,
11,
6060,
5317,
11,
6060,
5377,
11141,
36786,
198,
197,
197,
197,
16939,
7,
28100,
1713,
12331,
7,
19662,
4008,
198,
197,
197,
17772,
361,
4129,
7,
46280,
538,
8,
14512,
4129,
7,
68,
10671,
8,
198,
197,
197,
197,
16939,
7,
28100,
1713,
12331,
7203,
46280,
538,
4129,
857,
407,
2872,
1271,
286,
9766,
76,
48774,
198,
197,
197,
437,
198,
197,
197,
7783,
649,
7,
46280,
538,
11,
9766,
76,
8,
198,
197,
437,
198,
437,
198,
198,
2,
2484,
1506,
392,
357,
13893,
4277,
357,
13159,
12,
17143,
2357,
1143,
8,
23772,
373,
6993,
9108,
2599,
198,
6601,
6998,
7,
46280,
538,
3712,
3705,
732,
538,
11,
9766,
76,
3712,
38469,
90,
51,
30072,
810,
309,
796,
6060,
6998,
90,
51,
92,
7,
46280,
538,
11,
9766,
76,
8,
198,
198,
68,
10671,
40845,
7,
3712,
6030,
90,
6601,
6998,
5512,
256,
3712,
6030,
90,
51,
30072,
810,
309,
796,
9766,
76,
40845,
7,
6601,
12740,
11,
256,
8,
1303,
35265,
4096,
3858,
198,
68,
10671,
40845,
7,
3712,
6030,
90,
6601,
6998,
5512,
7904,
6030,
90,
6601,
6998,
30072,
796,
2081,
1303,
7583,
1249,
45115,
8573,
198,
198,
2,
8645,
378,
6565,
6060,
6998,
4645,
25,
198,
7,
3712,
6030,
90,
6601,
6998,
90,
51,
11709,
5769,
46280,
538,
3712,
3705,
732,
538,
8,
810,
309,
796,
6060,
6998,
90,
51,
92,
7,
46280,
538,
11,
15690,
90,
51,
92,
7,
917,
891,
11,
4129,
7,
46280,
538,
22305,
628,
198,
2,
855,
6030,
20699,
198,
23926,
25609,
18604,
2,
198,
14881,
13,
16963,
1258,
62,
25135,
7,
3712,
6030,
90,
51,
16,
5512,
7904,
6030,
90,
51,
17,
30072,
810,
1391,
51,
16,
27,
25,
6601,
6998,
11,
309,
17,
27,
25,
15057,
92,
796,
6060,
6998,
628,
198,
2,
855,
15457,
273,
5499,
198,
23926,
25609,
18604,
2,
198,
14881,
13,
417,
4906,
7,
67,
3712,
6601,
6998,
90,
51,
30072,
810,
309,
796,
309,
198,
14881,
13,
13664,
7,
67,
3712,
6601,
6998,
8,
796,
4129,
7,
67,
13,
68,
10671,
8,
628,
198,
2,
855,
22087,
351,
5103,
198,
23926,
25609,
18604,
2,
198,
198,
2,
3546,
26908,
366,
20797,
7,
6601,
6998,
11,
2644,
8,
466,
16085,
2100,
1,
15582,
25,
198,
8818,
7308,
13,
20797,
0,
7,
22184,
3712,
22203,
11,
288,
3712,
6601,
6998,
8,
198,
197,
1640,
1312,
287,
352,
25,
13664,
7,
67,
13,
46280,
538,
8,
198,
197,
197,
67,
13,
68,
10671,
58,
72,
60,
796,
24714,
7,
67,
13,
46280,
538,
13,
85,
58,
72,
12962,
198,
197,
437,
198,
197,
7783,
288,
198,
437,
198,
14881,
13,
20797,
7,
22184,
3712,
22203,
11,
7904,
6030,
90,
6601,
6998,
90,
51,
92,
5512,
16085,
3712,
3705,
732,
538,
8,
810,
309,
796,
198,
197,
20797,
0,
7,
22184,
11,
6060,
6998,
7,
46280,
538,
11,
15690,
90,
51,
92,
7,
917,
891,
11,
4129,
7,
46280,
538,
35514,
198,
14881,
13,
20797,
7,
22184,
3712,
22203,
11,
7904,
6030,
90,
6601,
6998,
5512,
16085,
3712,
3705,
732,
538,
8,
796,
6070,
7,
22184,
11,
6060,
6998,
90,
6601,
6998,
5512,
16085,
8,
628,
198,
2,
855,
6601,
5270,
198,
23926,
25609,
18604,
2,
198,
8818,
4808,
641,
942,
732,
538,
34642,
7,
67,
3712,
6601,
6998,
11,
16085,
312,
3712,
10100,
8,
198,
197,
361,
16085,
312,
6624,
288,
13,
46280,
538,
13,
312,
198,
197,
197,
19662,
796,
366,
40783,
538,
8833,
3294,
1661,
287,
6060,
6998,
25,
720,
46280,
538,
312,
1,
198,
197,
197,
16939,
7,
28100,
1713,
12331,
7,
19662,
4008,
198,
197,
437,
198,
437,
198,
198,
2,
7469,
500,
366,
17143,
2357,
1911,
198,
2,
7,
8645,
689,
257,
6060,
6998,
2134,
7268,
262,
1988,
286,
257,
1813,
17676,
11507,
8,
198,
2,
10097,
24305,
198,
198,
2,
45776,
351,
1729,
12,
33201,
4847,
11,
1752,
262,
16085,
1988,
318,
1043,
25,
198,
8818,
4808,
17143,
2357,
7,
67,
3712,
6601,
6998,
90,
6601,
6998,
5512,
16085,
312,
3712,
10100,
11,
16085,
2100,
3712,
51,
8,
810,
309,
198,
197,
62,
641,
942,
732,
538,
34642,
7,
67,
11,
16085,
312,
8,
198,
197,
68,
10671,
796,
6060,
6998,
29795,
17143,
2357,
7,
67,
13,
68,
10671,
58,
72,
4357,
16085,
312,
11,
16085,
2100,
8,
329,
1312,
287,
352,
25,
13664,
7,
67,
13,
46280,
538,
15437,
198,
197,
7783,
6060,
6998,
7,
67,
13,
46280,
538,
11,
9766,
76,
8,
198,
437,
198,
198,
2,
45776,
351,
12835,
4847,
11,
1752,
262,
16085,
1988,
318,
1043,
25,
198,
8818,
4808,
17143,
2357,
7,
67,
3712,
6601,
6998,
11,
16085,
312,
3712,
10100,
11,
16085,
2100,
3712,
51,
8,
810,
309,
198,
197,
62,
641,
942,
732,
538,
34642,
7,
67,
11,
16085,
312,
8,
198,
197,
68,
10671,
796,
309,
58,
46280,
538,
2100,
329,
1312,
287,
352,
25,
13664,
7,
67,
13,
46280,
538,
15437,
198,
197,
7783,
6060,
6998,
7,
67,
13,
46280,
538,
11,
9766,
76,
8,
198,
437,
198,
198,
2,
13383,
366,
17143,
2357,
1,
11862,
357,
13159,
12,
33201,
4847,
2599,
198,
8818,
11507,
7,
67,
3712,
6601,
6998,
90,
6601,
6998,
5512,
16085,
312,
3712,
10100,
8,
198,
197,
361,
16085,
312,
6624,
288,
13,
46280,
538,
13,
312,
1303,
40783,
538,
1043,
198,
197,
197,
68,
10671,
796,
6060,
6998,
29795,
17143,
2357,
7,
67,
13,
68,
10671,
58,
72,
4357,
16085,
312,
11,
288,
13,
46280,
538,
13,
85,
58,
72,
12962,
329,
1312,
287,
352,
25,
13664,
7,
67,
13,
46280,
538,
15437,
198,
197,
17772,
198,
197,
197,
68,
10671,
796,
6060,
6998,
58,
17143,
2357,
7,
67,
13,
68,
10671,
58,
72,
4357,
16085,
312,
8,
329,
1312,
287,
352,
25,
13664,
7,
67,
13,
46280,
538,
15437,
198,
197,
437,
198,
197,
7783,
6060,
6998,
7,
67,
13,
46280,
538,
11,
9766,
76,
8,
198,
437,
198,
2,
13383,
366,
17143,
2357,
1,
11862,
357,
33201,
4847,
2599,
198,
8818,
11507,
7,
67,
3712,
6601,
6998,
11,
16085,
312,
3712,
10100,
8,
198,
197,
51,
796,
1288,
4906,
7,
67,
13,
46280,
538,
13,
85,
8,
198,
197,
361,
16085,
312,
6624,
288,
13,
46280,
538,
13,
312,
1303,
40783,
538,
1043,
198,
197,
197,
7783,
6060,
6998,
7,
67,
13,
46280,
538,
11,
288,
13,
46280,
538,
13,
85,
8,
198,
197,
17772,
198,
197,
197,
19662,
796,
366,
40783,
538,
407,
1043,
287,
6060,
6998,
25,
720,
46280,
538,
312,
1,
198,
197,
197,
16939,
7,
28100,
1713,
12331,
7,
19662,
4008,
198,
197,
437,
198,
437,
198,
198,
2,
8645,
378,
6060,
6998,
422,
6060,
17184,
13,
198,
2,
10097,
24305,
198,
8818,
4808,
11249,
6601,
6998,
7,
67,
3712,
6601,
17184,
11,
717,
521,
82,
3712,
38469,
90,
5317,
30072,
198,
197,
22019,
312,
87,
796,
4129,
7,
11085,
521,
82,
8,
1343,
352,
198,
197,
46280,
538,
796,
288,
13,
46280,
25386,
58,
22019,
312,
87,
60,
198,
197,
361,
1090,
312,
87,
1279,
4129,
7,
67,
13,
46280,
25386,
8,
198,
197,
197,
20274,
796,
6060,
6998,
90,
6601,
6998,
92,
7,
46280,
538,
8,
198,
197,
197,
1640,
1312,
287,
352,
25,
13664,
7,
46280,
538,
13,
85,
8,
198,
197,
197,
197,
20274,
13,
68,
10671,
58,
72,
60,
796,
4808,
11249,
6601,
6998,
7,
67,
11,
410,
9246,
7,
11085,
521,
82,
11,
1312,
4008,
198,
197,
197,
437,
198,
197,
17772,
1303,
5956,
6376,
13,
220,
17393,
1366,
625,
25,
198,
197,
197,
20274,
796,
6060,
6998,
90,
417,
4906,
7,
67,
13,
68,
10671,
38165,
7,
46280,
538,
8,
198,
197,
197,
1640,
1312,
287,
352,
25,
13664,
7,
46280,
538,
13,
85,
8,
198,
197,
197,
197,
20274,
13,
68,
10671,
58,
72,
60,
796,
288,
13,
68,
10671,
58,
11085,
521,
82,
986,
11,
1312,
60,
198,
197,
197,
437,
198,
197,
437,
198,
197,
7783,
1255,
198,
437,
198,
198,
8818,
6060,
6998,
7,
67,
3712,
6601,
17184,
8,
198,
197,
7783,
4808,
11249,
6601,
6998,
7,
67,
11,
2558,
58,
12962,
198,
437,
628,
198,
2,
855,
12982,
12,
13120,
905,
5499,
198,
23926,
25609,
18604,
2,
198,
198,
2,
18557,
12835,
5002,
25,
198,
8818,
3601,
6601,
49,
4653,
10671,
7,
952,
3712,
9399,
11,
288,
82,
3712,
6601,
6998,
11,
4686,
87,
3712,
5317,
11,
33793,
3712,
10100,
8,
198,
197,
361,
318,
562,
3916,
7,
9310,
13,
68,
10671,
11,
4686,
87,
8,
198,
197,
197,
35235,
7,
952,
11,
288,
82,
13,
68,
10671,
58,
312,
87,
12962,
198,
197,
17772,
198,
197,
197,
35235,
7,
952,
11,
33793,
11,
366,
4944,
7206,
20032,
1961,
4943,
198,
197,
437,
198,
437,
198,
2,
18557,
1306,
1241,
286,
45115,
6060,
6998,
25,
198,
8818,
3601,
6601,
49,
4653,
10671,
7,
952,
3712,
9399,
11,
288,
82,
3712,
6601,
6998,
90,
51,
5512,
4686,
87,
3712,
5317,
11,
33793,
3712,
10100,
8,
810,
309,
27,
25,
6601,
6998,
198,
197,
35235,
7,
952,
8,
198,
197,
361,
318,
562,
3916,
7,
9310,
13,
68,
10671,
11,
4686,
87,
8,
198,
197,
197,
4798,
6601,
6998,
7,
952,
11,
288,
82,
13,
68,
10671,
58,
312,
87,
4357,
33793,
8,
198,
197,
17772,
198,
197,
197,
35235,
7,
952,
11,
33793,
11,
366,
4944,
7206,
20032,
1961,
4943,
198,
197,
437,
198,
437,
198,
2,
18557,
6060,
6998,
4645,
25,
198,
8818,
3601,
6601,
6998,
7,
952,
3712,
9399,
11,
288,
82,
3712,
6601,
6998,
11,
33793,
3712,
10100,
8,
198,
197,
1640,
1312,
287,
352,
25,
13664,
7,
9310,
13,
68,
10671,
8,
198,
197,
197,
4798,
7,
952,
11,
17971,
521,
298,
1600,
288,
82,
13,
46280,
538,
13,
312,
11,
366,
28,
1600,
288,
82,
13,
46280,
538,
13,
85,
58,
72,
4357,
366,
25,
366,
8,
198,
197,
197,
4798,
6601,
49,
4653,
10671,
7,
952,
11,
288,
82,
11,
1312,
11,
17971,
521,
298,
220,
366,
8,
198,
197,
437,
198,
437,
198,
198,
8818,
7308,
13,
12860,
7,
952,
3712,
9399,
11,
288,
82,
3712,
6601,
6998,
8,
198,
197,
4798,
7,
952,
11,
366,
6601,
6998,
58,
59,
77,
4943,
198,
197,
4798,
6601,
6998,
7,
952,
11,
288,
82,
11,
366,
220,
366,
8,
198,
197,
4798,
7,
952,
11,
366,
60,
59,
77,
4943,
198,
437,
628
] | 2.843095 | 1,861 |
"""
reduce_axes(a, dims)
Returns the appropriate axes for a measure that reduces dimensions along the
dimensions `dims`.
## Example
```jldoctest
julia> reduce_axes((Index{:a}(1:4), Index{:b}(1:4)), 2)
(Index{a}(1:4 => Base.OneTo(4)), Index{b}(1:1 => Base.OneTo(1)))
julia> reduce_axes((Index{:a}(1:4), Index{:b}(1:4)), :a)
(Index{a}(1:1 => Base.OneTo(1)), Index{b}(1:4 => Base.OneTo(4)))
```
"""
reduce_axes(x::AbstractArray, dims) = reduce_axes(axes(x), dims)
reduce_axes(x::Tuple, dims) = _reduce_axes(x, to_dims(x, dims))
reduce_axes(x::Tuple, dims::Colon) = ()
_reduce_axes(x::Tuple{Vararg{Any,D}}, dims::Int) where {D} = _reduce_axes(x, (dims,))
function _reduce_axes(x::Tuple{Vararg{Any,D}}, dims::Tuple{Vararg{Int}}) where {D}
Tuple(map(i -> ifelse(in(i, dims), reduce_axis(x[i]), x[i]), 1:D))
end
"""
reduce_axis(a)
Reduces axis `a` to single value. Allows custom index types to have custom
behavior throughout reduction methods (e.g., sum, prod, etc.)
See also: [`reduce_axes`](@ref)
## Example
```jldoctest
julia> reduce_axis(Index{:a}(1:4))
Index{a}(1:1 => Base.OneTo(1))
julia> reduce_axis(1:4)
1:1
```
"""
function reduce_axis(x::AbstractIndex)
if isempty(x)
error("Cannot reduce empty index.")
else
return unsafe_reindex(x, 1:1)
end
end
reduce_axis(x::OneTo{T}) where {T} = OneTo(one(T))
reduce_axis(x::OneToSRange{T}) where {T} = OneToSRange(one(T))
reduce_axis(x::OneToMRange{T}) where {T} = OneToMRange(one(T))
reduce_axis(x::UnitRange{T}) where {T} = UnitRange{T}(one(T), one(T))
reduce_axis(x::UnitSRange{T}) where {T} = UnitSRange{T}(one(T), one(T))
reduce_axis(x::UnitMRange{T}) where {T} = UnitMRange{T}(one(T), one(T))
| [
37811,
198,
220,
220,
220,
4646,
62,
897,
274,
7,
64,
11,
5391,
82,
8,
198,
198,
35561,
262,
5035,
34197,
329,
257,
3953,
326,
12850,
15225,
1863,
262,
198,
27740,
5736,
4600,
67,
12078,
44646,
198,
198,
2235,
17934,
198,
15506,
63,
73,
335,
38441,
395,
198,
73,
43640,
29,
4646,
62,
897,
274,
19510,
15732,
90,
25,
64,
92,
7,
16,
25,
19,
828,
12901,
90,
25,
65,
92,
7,
16,
25,
19,
36911,
362,
8,
198,
7,
15732,
90,
64,
92,
7,
16,
25,
19,
5218,
7308,
13,
3198,
2514,
7,
19,
36911,
12901,
90,
65,
92,
7,
16,
25,
16,
5218,
7308,
13,
3198,
2514,
7,
16,
22305,
198,
198,
73,
43640,
29,
4646,
62,
897,
274,
19510,
15732,
90,
25,
64,
92,
7,
16,
25,
19,
828,
12901,
90,
25,
65,
92,
7,
16,
25,
19,
36911,
1058,
64,
8,
198,
7,
15732,
90,
64,
92,
7,
16,
25,
16,
5218,
7308,
13,
3198,
2514,
7,
16,
36911,
12901,
90,
65,
92,
7,
16,
25,
19,
5218,
7308,
13,
3198,
2514,
7,
19,
22305,
198,
15506,
63,
198,
37811,
198,
445,
7234,
62,
897,
274,
7,
87,
3712,
23839,
19182,
11,
5391,
82,
8,
796,
4646,
62,
897,
274,
7,
897,
274,
7,
87,
828,
5391,
82,
8,
198,
445,
7234,
62,
897,
274,
7,
87,
3712,
51,
29291,
11,
5391,
82,
8,
796,
4808,
445,
7234,
62,
897,
274,
7,
87,
11,
284,
62,
67,
12078,
7,
87,
11,
5391,
82,
4008,
198,
445,
7234,
62,
897,
274,
7,
87,
3712,
51,
29291,
11,
5391,
82,
3712,
5216,
261,
8,
796,
7499,
198,
62,
445,
7234,
62,
897,
274,
7,
87,
3712,
51,
29291,
90,
19852,
853,
90,
7149,
11,
35,
92,
5512,
5391,
82,
3712,
5317,
8,
810,
1391,
35,
92,
796,
4808,
445,
7234,
62,
897,
274,
7,
87,
11,
357,
67,
12078,
11,
4008,
198,
8818,
4808,
445,
7234,
62,
897,
274,
7,
87,
3712,
51,
29291,
90,
19852,
853,
90,
7149,
11,
35,
92,
5512,
5391,
82,
3712,
51,
29291,
90,
19852,
853,
90,
5317,
11709,
8,
810,
1391,
35,
92,
198,
220,
220,
220,
309,
29291,
7,
8899,
7,
72,
4613,
611,
17772,
7,
259,
7,
72,
11,
5391,
82,
828,
4646,
62,
22704,
7,
87,
58,
72,
46570,
2124,
58,
72,
46570,
352,
25,
35,
4008,
198,
437,
198,
198,
37811,
198,
220,
220,
220,
4646,
62,
22704,
7,
64,
8,
198,
198,
7738,
26873,
16488,
4600,
64,
63,
284,
2060,
1988,
13,
40402,
2183,
6376,
3858,
284,
423,
2183,
198,
46571,
3690,
7741,
5050,
357,
68,
13,
70,
1539,
2160,
11,
40426,
11,
3503,
2014,
198,
198,
6214,
635,
25,
685,
63,
445,
7234,
62,
897,
274,
63,
16151,
31,
5420,
8,
198,
198,
2235,
17934,
198,
15506,
63,
73,
335,
38441,
395,
198,
73,
43640,
29,
4646,
62,
22704,
7,
15732,
90,
25,
64,
92,
7,
16,
25,
19,
4008,
198,
15732,
90,
64,
92,
7,
16,
25,
16,
5218,
7308,
13,
3198,
2514,
7,
16,
4008,
198,
198,
73,
43640,
29,
4646,
62,
22704,
7,
16,
25,
19,
8,
198,
16,
25,
16,
198,
15506,
63,
198,
37811,
198,
8818,
4646,
62,
22704,
7,
87,
3712,
23839,
15732,
8,
198,
220,
220,
220,
611,
318,
28920,
7,
87,
8,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
7203,
34,
34574,
4646,
6565,
6376,
19570,
198,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
21596,
62,
260,
9630,
7,
87,
11,
352,
25,
16,
8,
198,
220,
220,
220,
886,
198,
437,
198,
445,
7234,
62,
22704,
7,
87,
3712,
3198,
2514,
90,
51,
30072,
810,
1391,
51,
92,
796,
1881,
2514,
7,
505,
7,
51,
4008,
198,
445,
7234,
62,
22704,
7,
87,
3712,
3198,
2514,
12562,
858,
90,
51,
30072,
810,
1391,
51,
92,
796,
1881,
2514,
12562,
858,
7,
505,
7,
51,
4008,
198,
445,
7234,
62,
22704,
7,
87,
3712,
3198,
2514,
13599,
858,
90,
51,
30072,
810,
1391,
51,
92,
796,
1881,
2514,
13599,
858,
7,
505,
7,
51,
4008,
198,
445,
7234,
62,
22704,
7,
87,
3712,
26453,
17257,
90,
51,
30072,
810,
1391,
51,
92,
796,
11801,
17257,
90,
51,
92,
7,
505,
7,
51,
828,
530,
7,
51,
4008,
198,
445,
7234,
62,
22704,
7,
87,
3712,
26453,
12562,
858,
90,
51,
30072,
810,
1391,
51,
92,
796,
11801,
12562,
858,
90,
51,
92,
7,
505,
7,
51,
828,
530,
7,
51,
4008,
198,
445,
7234,
62,
22704,
7,
87,
3712,
26453,
13599,
858,
90,
51,
30072,
810,
1391,
51,
92,
796,
11801,
13599,
858,
90,
51,
92,
7,
505,
7,
51,
828,
530,
7,
51,
4008,
198
] | 2.177835 | 776 |
@testset "Postprocessing" begin
@test LatexSVG._adjust_web_svg_dim("16.180339pt") == "1.618034rem"
@test begin
svg_test = """
<?xml version="1.0" encoding="utf-8"?>
<svg width="21.923673pt" height="8.966376pt" viewBox="67.695921 70.081196 21.923673 8.966376">
<defs/>
</svg>
"""
svg_adjusted = LatexSVG._adjust_web_svg_display(svg_test)
svg_adjusted == """
<?xml version="1.0" encoding="UTF-8"?>
<svg height="0.896638rem" viewBox="67.695921 70.081196 21.923673 8.966376" class="latexsvg-display" style="display: block; margin: auto; max-width: 80%">
<defs/>
</svg>
"""
end
@test begin
svg_test = """
<?xml version="1.0" encoding="utf-8"?>
<svg width="21.923673pt" height="8.966376pt" viewBox="67.695921 70.081196 21.923673 8.966376">
<defs/>
</svg>
"""
svg_adjusted = LatexSVG._adjust_web_svg_inline(svg_test)
svg_adjusted == """
<?xml version="1.0" encoding="UTF-8"?>
<svg height="0.896638rem" viewBox="67.695921 70.081196 21.923673 8.966376" class="latexsvg-inline" style="vertical-align: middle">
<defs/>
</svg>
"""
end
end
| [
31,
9288,
2617,
366,
6307,
36948,
1,
2221,
198,
220,
220,
220,
2488,
9288,
18319,
87,
50,
43490,
13557,
23032,
62,
12384,
62,
21370,
70,
62,
27740,
7203,
1433,
13,
15259,
29626,
457,
4943,
6624,
366,
16,
13,
21,
15259,
2682,
2787,
1,
628,
220,
220,
220,
2488,
9288,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
38487,
70,
62,
9288,
796,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
30,
19875,
2196,
2625,
16,
13,
15,
1,
21004,
2625,
40477,
12,
23,
13984,
29,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
21370,
70,
9647,
2625,
2481,
13,
24,
1954,
45758,
457,
1,
6001,
2625,
23,
13,
24,
2791,
32128,
457,
1,
1570,
14253,
2625,
3134,
13,
3388,
3270,
2481,
4317,
13,
2919,
16315,
21,
2310,
13,
24,
1954,
45758,
807,
13,
24,
2791,
32128,
5320,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
4299,
82,
15913,
198,
220,
220,
220,
220,
220,
220,
220,
7359,
21370,
70,
29,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
38487,
70,
62,
29117,
796,
18319,
87,
50,
43490,
13557,
23032,
62,
12384,
62,
21370,
70,
62,
13812,
7,
21370,
70,
62,
9288,
8,
198,
220,
220,
220,
220,
220,
220,
220,
38487,
70,
62,
29117,
6624,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
30,
19875,
2196,
2625,
16,
13,
15,
1,
21004,
2625,
48504,
12,
23,
13984,
29,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
21370,
70,
6001,
2625,
15,
13,
4531,
2791,
2548,
2787,
1,
1570,
14253,
2625,
3134,
13,
3388,
3270,
2481,
4317,
13,
2919,
16315,
21,
2310,
13,
24,
1954,
45758,
807,
13,
24,
2791,
32128,
1,
1398,
2625,
17660,
87,
21370,
70,
12,
13812,
1,
3918,
2625,
13812,
25,
2512,
26,
10330,
25,
8295,
26,
3509,
12,
10394,
25,
4019,
4,
5320,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
4299,
82,
15913,
198,
220,
220,
220,
220,
220,
220,
220,
7359,
21370,
70,
29,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
886,
628,
220,
220,
220,
2488,
9288,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
38487,
70,
62,
9288,
796,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
30,
19875,
2196,
2625,
16,
13,
15,
1,
21004,
2625,
40477,
12,
23,
13984,
29,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
21370,
70,
9647,
2625,
2481,
13,
24,
1954,
45758,
457,
1,
6001,
2625,
23,
13,
24,
2791,
32128,
457,
1,
1570,
14253,
2625,
3134,
13,
3388,
3270,
2481,
4317,
13,
2919,
16315,
21,
2310,
13,
24,
1954,
45758,
807,
13,
24,
2791,
32128,
5320,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
4299,
82,
15913,
198,
220,
220,
220,
220,
220,
220,
220,
7359,
21370,
70,
29,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
38487,
70,
62,
29117,
796,
18319,
87,
50,
43490,
13557,
23032,
62,
12384,
62,
21370,
70,
62,
45145,
7,
21370,
70,
62,
9288,
8,
198,
220,
220,
220,
220,
220,
220,
220,
38487,
70,
62,
29117,
6624,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
30,
19875,
2196,
2625,
16,
13,
15,
1,
21004,
2625,
48504,
12,
23,
13984,
29,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
21370,
70,
6001,
2625,
15,
13,
4531,
2791,
2548,
2787,
1,
1570,
14253,
2625,
3134,
13,
3388,
3270,
2481,
4317,
13,
2919,
16315,
21,
2310,
13,
24,
1954,
45758,
807,
13,
24,
2791,
32128,
1,
1398,
2625,
17660,
87,
21370,
70,
12,
45145,
1,
3918,
2625,
1851,
605,
12,
31494,
25,
3504,
5320,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
4299,
82,
15913,
198,
220,
220,
220,
220,
220,
220,
220,
7359,
21370,
70,
29,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
886,
198,
437,
198
] | 1.916159 | 656 |
## https://developer.spotify.com/documentation/web-api/reference/#/operations/get-information-about-the-users-current-playback
"""
player_get_state(;additional_types::String="track", market::String="US")
**Summary**: Get information about the user’s current playback state, including track or episode,
progress, and active device.
# Optional keywords
- `additional_types::String` : "track" (default) or "episode"
- `market::String` : An ISO 3166-1 alpha-2 country code. If a country code is specified,
only episodes that are available in that market will be returned.
Default is set to "US".
# Example
```julia-repl
julia> Spotify.player_get_state()[1]
[ Info: We try the request without checking if current grant includes scope user-read-playback-state.
JSON3.Object{Base.CodeUnits{UInt8, String}, Vector{UInt64}} with 10 entries:
:device => {…
:shuffle_state => false
:repeat_state => "off"
:timestamp => 1636493367689
:context => {…
:progress_ms => 66454
:item => {…
:currently_playing_type => "track"
:actions => {…
:is_playing => true
```
"""
function player_get_state(;additional_types::String="track", market::String="US")
url = "me/player?additional_types=$additional_types&market=$market"
return Spotify.spotify_request(url; scope = "user-read-playback-state")
end
## https://developer.spotify.com/documentation/web-api/reference/#/operations/get-a-users-available-devices
"""
player_get_devices()
**Summary**: Get information about a user’s available devices.
# Example
```julia-repl
julia> Spotify.player_get_devices()[1]["devices"]
2-element JSON3.Array{JSON3.Object, Base.CodeUnits{UInt8, String}, SubArray{UInt64, 1, Vector{UInt64}, Tuple{UnitRange{Int64}}, true}}:
{
"id": "your_device_id",
"is_active": false,
"is_private_session": false,
"is_restricted": false,
"name": "Web Player (Chrome)",
"type": "Computer",
"volume_percent": 100
}
```
"""
function player_get_devices()
return Spotify.spotify_request("me/player/devices"; scope = "user-read-playback-state")
end
## https://developer.spotify.com/documentation/web-api/reference/#/operations/get-the-users-currently-playing-track
"""
player_get_current_track(;additional_types::String="track", market::String="US")
**Summary**: Get the object currently being played on the user's Spotify account.
# Optional keywords
- `additional_types::String` : "track" (default) or "episode"
- `market::String` : An ISO 3166-1 alpha-2 country code. If a country code is specified,
only episodes that are available in that market will be returned.
Default is set to "US".
# Example
```julia-repl
julia> Spotify.player_get_current_track()[1]
[ Info: We try the request without checking if current grant includes scope user-read-playback-state.
JSON3.Object{Base.CodeUnits{UInt8, String}, Vector{UInt64}} with 7 entries:
:timestamp => 1636491068506
:context => {…
:progress_ms => 5265
:item => {…
:currently_playing_type => "track"
:actions => {…
:is_playing => true
```
"""
function player_get_current_track(;additional_types::String="track", market::String="US")
url = "me/player/currently-playing?additional_types=$additional_types&market=$market"
return Spotify.spotify_request(url; scope = "user-read-playback-state")
end
## https://developer.spotify.com/documentation/web-api/reference/#/operations/get-recently-played
"""
player_get_recent_tracks(;duration::Int64=1, limit::Int64=20)
**Summary**: Get current user's recently played tracks.
# Optional keywords
- `duration::Int64` : Number of days to look in the past, default is set to 1
- `limit::Int64` : Maximum number of items to return, default is set to 20
# Example
```julia-repl
julia> Spotify.player_get_recent_tracks()[1]
[ Info: We try the request without checking if current grant includes scope user-read-recently-played.
JSON3.Object{Base.CodeUnits{UInt8, String}, Vector{UInt64}} with 5 entries:
:items => JSON3.Object[{…
:next => "https://api.spotify.com/v1/me/player/recently-played?after=1636123644988&limit=20"
:cursors => {…
:limit => 20
:href => "https://api.spotify.com/v1/me/player/recently-played?after=1636410050&limit=20"
```
"""
function player_get_recent_tracks(;duration::Int64=1, limit::Int64=20)
# Subtract duration from current date and convert to Int64
starting_date = Dates.datetime2unix(Dates.now() - Dates.Day(duration))
after = round(Int64, starting_date)
url = "me/player/recently-played?after=$after&limit=$limit"
return Spotify.spotify_request(url; scope = "user-read-recently-played")
end
| [
2235,
3740,
1378,
16244,
263,
13,
20485,
1958,
13,
785,
14,
22897,
341,
14,
12384,
12,
15042,
14,
35790,
31113,
14,
3575,
602,
14,
1136,
12,
17018,
12,
10755,
12,
1169,
12,
18417,
12,
14421,
12,
1759,
1891,
198,
198,
37811,
198,
220,
220,
220,
2137,
62,
1136,
62,
5219,
7,
26,
2860,
1859,
62,
19199,
3712,
10100,
2625,
11659,
1600,
1910,
3712,
10100,
2625,
2937,
4943,
198,
198,
1174,
22093,
1174,
25,
3497,
1321,
546,
262,
2836,
447,
247,
82,
1459,
16388,
1181,
11,
1390,
2610,
393,
4471,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4371,
11,
290,
4075,
3335,
13,
198,
198,
2,
32233,
26286,
198,
12,
4600,
2860,
1859,
62,
19199,
3712,
10100,
63,
1058,
366,
11659,
1,
357,
12286,
8,
393,
366,
38668,
1,
198,
12,
4600,
10728,
3712,
10100,
63,
1058,
1052,
19694,
513,
23055,
12,
16,
17130,
12,
17,
1499,
2438,
13,
1002,
257,
1499,
2438,
318,
7368,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
691,
8640,
326,
389,
1695,
287,
326,
1910,
481,
307,
4504,
13,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15161,
318,
900,
284,
366,
2937,
1911,
198,
198,
2,
17934,
198,
15506,
63,
73,
43640,
12,
35666,
198,
73,
43640,
29,
26778,
13,
7829,
62,
1136,
62,
5219,
3419,
58,
16,
60,
198,
58,
14151,
25,
775,
1949,
262,
2581,
1231,
10627,
611,
1459,
7264,
3407,
8354,
2836,
12,
961,
12,
1759,
1891,
12,
5219,
13,
198,
40386,
18,
13,
10267,
90,
14881,
13,
10669,
3118,
896,
90,
52,
5317,
23,
11,
10903,
5512,
20650,
90,
52,
5317,
2414,
11709,
351,
838,
12784,
25,
198,
220,
1058,
25202,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5218,
1391,
1399,
198,
220,
1058,
1477,
18137,
62,
5219,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5218,
3991,
198,
220,
1058,
44754,
62,
5219,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5218,
366,
2364,
1,
198,
220,
1058,
16514,
27823,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5218,
1467,
26780,
24,
2091,
3134,
40523,
198,
220,
1058,
22866,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5218,
1391,
1399,
198,
220,
1058,
33723,
62,
907,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5218,
7930,
34229,
198,
220,
1058,
9186,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5218,
1391,
1399,
198,
220,
1058,
41745,
62,
17916,
62,
4906,
5218,
366,
11659,
1,
198,
220,
1058,
4658,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5218,
1391,
1399,
198,
220,
1058,
271,
62,
17916,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5218,
2081,
198,
15506,
63,
198,
37811,
198,
8818,
2137,
62,
1136,
62,
5219,
7,
26,
2860,
1859,
62,
19199,
3712,
10100,
2625,
11659,
1600,
1910,
3712,
10100,
2625,
2937,
4943,
628,
220,
220,
220,
19016,
796,
366,
1326,
14,
7829,
30,
2860,
1859,
62,
19199,
43641,
2860,
1859,
62,
19199,
5,
10728,
43641,
10728,
1,
628,
220,
220,
220,
1441,
26778,
13,
20485,
1958,
62,
25927,
7,
6371,
26,
8354,
796,
366,
7220,
12,
961,
12,
1759,
1891,
12,
5219,
4943,
198,
198,
437,
628,
198,
2235,
3740,
1378,
16244,
263,
13,
20485,
1958,
13,
785,
14,
22897,
341,
14,
12384,
12,
15042,
14,
35790,
31113,
14,
3575,
602,
14,
1136,
12,
64,
12,
18417,
12,
15182,
12,
42034,
198,
198,
37811,
198,
220,
220,
220,
2137,
62,
1136,
62,
42034,
3419,
198,
198,
1174,
22093,
1174,
25,
3497,
1321,
546,
257,
2836,
447,
247,
82,
1695,
4410,
13,
198,
198,
2,
17934,
198,
15506,
63,
73,
43640,
12,
35666,
198,
73,
43640,
29,
26778,
13,
7829,
62,
1136,
62,
42034,
3419,
58,
16,
7131,
1,
42034,
8973,
198,
17,
12,
30854,
19449,
18,
13,
19182,
90,
40386,
18,
13,
10267,
11,
7308,
13,
10669,
3118,
896,
90,
52,
5317,
23,
11,
10903,
5512,
3834,
19182,
90,
52,
5317,
2414,
11,
352,
11,
20650,
90,
52,
5317,
2414,
5512,
309,
29291,
90,
26453,
17257,
90,
5317,
2414,
92,
5512,
2081,
11709,
25,
198,
90,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
312,
1298,
366,
14108,
62,
25202,
62,
312,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
271,
62,
5275,
1298,
3991,
11,
198,
220,
220,
366,
271,
62,
19734,
62,
29891,
1298,
3991,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
271,
62,
49343,
1298,
3991,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1298,
366,
13908,
7853,
357,
1925,
5998,
42501,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
4906,
1298,
366,
34556,
1600,
198,
220,
220,
220,
220,
220,
220,
366,
29048,
62,
25067,
1298,
1802,
198,
92,
198,
15506,
63,
198,
37811,
198,
8818,
2137,
62,
1136,
62,
42034,
3419,
628,
220,
220,
220,
1441,
26778,
13,
20485,
1958,
62,
25927,
7203,
1326,
14,
7829,
14,
42034,
8172,
8354,
796,
366,
7220,
12,
961,
12,
1759,
1891,
12,
5219,
4943,
198,
198,
437,
628,
198,
2235,
3740,
1378,
16244,
263,
13,
20485,
1958,
13,
785,
14,
22897,
341,
14,
12384,
12,
15042,
14,
35790,
31113,
14,
3575,
602,
14,
1136,
12,
1169,
12,
18417,
12,
41745,
12,
17916,
12,
11659,
198,
198,
37811,
198,
220,
220,
220,
2137,
62,
1136,
62,
14421,
62,
11659,
7,
26,
2860,
1859,
62,
19199,
3712,
10100,
2625,
11659,
1600,
1910,
3712,
10100,
2625,
2937,
4943,
198,
198,
1174,
22093,
1174,
25,
3497,
262,
2134,
3058,
852,
2826,
319,
262,
2836,
338,
26778,
1848,
13,
198,
198,
2,
32233,
26286,
198,
12,
4600,
2860,
1859,
62,
19199,
3712,
10100,
63,
1058,
366,
11659,
1,
357,
12286,
8,
393,
366,
38668,
1,
198,
12,
4600,
10728,
3712,
10100,
63,
1058,
1052,
19694,
513,
23055,
12,
16,
17130,
12,
17,
1499,
2438,
13,
1002,
257,
1499,
2438,
318,
7368,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
691,
8640,
326,
389,
1695,
287,
326,
1910,
481,
307,
4504,
13,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15161,
318,
900,
284,
366,
2937,
1911,
198,
198,
2,
17934,
198,
15506,
63,
73,
43640,
12,
35666,
198,
73,
43640,
29,
26778,
13,
7829,
62,
1136,
62,
14421,
62,
11659,
3419,
58,
16,
60,
198,
58,
14151,
25,
775,
1949,
262,
2581,
1231,
10627,
611,
1459,
7264,
3407,
8354,
2836,
12,
961,
12,
1759,
1891,
12,
5219,
13,
198,
40386,
18,
13,
10267,
90,
14881,
13,
10669,
3118,
896,
90,
52,
5317,
23,
11,
10903,
5512,
20650,
90,
52,
5317,
2414,
11709,
351,
767,
12784,
25,
198,
220,
1058,
16514,
27823,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5218,
1467,
26780,
43234,
3104,
35638,
198,
220,
1058,
22866,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5218,
1391,
1399,
198,
220,
1058,
33723,
62,
907,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5218,
642,
22980,
198,
220,
1058,
9186,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5218,
1391,
1399,
198,
220,
1058,
41745,
62,
17916,
62,
4906,
5218,
366,
11659,
1,
198,
220,
1058,
4658,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5218,
1391,
1399,
198,
220,
1058,
271,
62,
17916,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5218,
2081,
198,
15506,
63,
198,
37811,
198,
8818,
2137,
62,
1136,
62,
14421,
62,
11659,
7,
26,
2860,
1859,
62,
19199,
3712,
10100,
2625,
11659,
1600,
1910,
3712,
10100,
2625,
2937,
4943,
628,
220,
220,
220,
19016,
796,
366,
1326,
14,
7829,
14,
41745,
12,
17916,
30,
2860,
1859,
62,
19199,
43641,
2860,
1859,
62,
19199,
5,
10728,
43641,
10728,
1,
628,
220,
220,
220,
1441,
26778,
13,
20485,
1958,
62,
25927,
7,
6371,
26,
8354,
796,
366,
7220,
12,
961,
12,
1759,
1891,
12,
5219,
4943,
198,
198,
437,
628,
198,
2235,
3740,
1378,
16244,
263,
13,
20485,
1958,
13,
785,
14,
22897,
341,
14,
12384,
12,
15042,
14,
35790,
31113,
14,
3575,
602,
14,
1136,
12,
49921,
306,
12,
21542,
198,
198,
37811,
198,
220,
220,
220,
2137,
62,
1136,
62,
49921,
62,
46074,
7,
26,
32257,
3712,
5317,
2414,
28,
16,
11,
4179,
3712,
5317,
2414,
28,
1238,
8,
198,
198,
1174,
22093,
1174,
25,
3497,
1459,
2836,
338,
2904,
2826,
8339,
13,
198,
198,
2,
32233,
26286,
198,
12,
4600,
32257,
3712,
5317,
2414,
63,
1058,
7913,
286,
1528,
284,
804,
287,
262,
1613,
11,
4277,
318,
900,
284,
352,
198,
12,
4600,
32374,
3712,
5317,
2414,
63,
1058,
22246,
1271,
286,
3709,
284,
1441,
11,
4277,
318,
900,
284,
1160,
198,
198,
2,
17934,
198,
15506,
63,
73,
43640,
12,
35666,
198,
73,
43640,
29,
26778,
13,
7829,
62,
1136,
62,
49921,
62,
46074,
3419,
58,
16,
60,
198,
58,
14151,
25,
775,
1949,
262,
2581,
1231,
10627,
611,
1459,
7264,
3407,
8354,
2836,
12,
961,
12,
49921,
306,
12,
21542,
13,
198,
40386,
18,
13,
10267,
90,
14881,
13,
10669,
3118,
896,
90,
52,
5317,
23,
11,
10903,
5512,
20650,
90,
52,
5317,
2414,
11709,
351,
642,
12784,
25,
198,
220,
1058,
23814,
220,
220,
5218,
19449,
18,
13,
10267,
58,
90,
1399,
198,
220,
1058,
19545,
220,
220,
220,
5218,
366,
5450,
1378,
15042,
13,
20485,
1958,
13,
785,
14,
85,
16,
14,
1326,
14,
7829,
14,
49921,
306,
12,
21542,
30,
8499,
28,
1433,
2623,
10163,
2414,
2920,
3459,
5,
32374,
28,
1238,
1,
198,
220,
1058,
66,
1834,
669,
5218,
1391,
1399,
198,
220,
1058,
32374,
220,
220,
5218,
1160,
198,
220,
1058,
33257,
220,
220,
220,
5218,
366,
5450,
1378,
15042,
13,
20485,
1958,
13,
785,
14,
85,
16,
14,
1326,
14,
7829,
14,
49921,
306,
12,
21542,
30,
8499,
28,
24136,
2414,
3064,
1120,
5,
32374,
28,
1238,
1,
198,
15506,
63,
198,
37811,
198,
8818,
2137,
62,
1136,
62,
49921,
62,
46074,
7,
26,
32257,
3712,
5317,
2414,
28,
16,
11,
4179,
3712,
5317,
2414,
28,
1238,
8,
628,
220,
220,
220,
1303,
3834,
83,
974,
9478,
422,
1459,
3128,
290,
10385,
284,
2558,
2414,
198,
220,
220,
220,
3599,
62,
4475,
796,
44712,
13,
19608,
8079,
17,
403,
844,
7,
35,
689,
13,
2197,
3419,
532,
44712,
13,
12393,
7,
32257,
4008,
198,
220,
220,
220,
706,
796,
2835,
7,
5317,
2414,
11,
3599,
62,
4475,
8,
628,
220,
220,
220,
19016,
796,
366,
1326,
14,
7829,
14,
49921,
306,
12,
21542,
30,
8499,
43641,
8499,
5,
32374,
43641,
32374,
1,
628,
220,
220,
220,
1441,
26778,
13,
20485,
1958,
62,
25927,
7,
6371,
26,
8354,
796,
366,
7220,
12,
961,
12,
49921,
306,
12,
21542,
4943,
198,
198,
437,
628,
628,
628,
628
] | 2.601358 | 1,914 |
using Test
using Covers
cc=Cover(4,8)
cc(1,1,true)
cc(2,2,true)
@test all(cc .^ Bool[1 1 1 1 1 1 1 1;
0 1 0 0 0 0 0 0;
0 1 0 0 0 0 0 0;
0 1 0 0 0 0 0 0])
@test all(ncovered(cc) .== [1 2 1 1 1 1 1 1; 0 1 0 0 0 0 0 0; 0 1 0 0 0 0 0 0; 0 1 0 0 0 0 0 0])
@test all(multicovered(cc) .== Bool[0 1 0 0 0 0 0 0; 0 0 0 0 0 0 0 0; 0 0 0 0 0 0 0 0; 0 0 0 0 0 0 0 0])
@test cc[9] && (!cc[10])
cc[9] =false
@test all(cc .^ Bool[0 1 0 0 0 0 0 0;
0 1 0 0 0 0 0 0;
0 1 0 0 0 0 0 0;
0 1 0 0 0 0 0 0])
cc[10] =true
@test all(cc .^ Bool[0 1 1 0 0 0 0 0;
0 1 1 0 0 0 0 0;
0 1 1 0 0 0 0 0;
0 1 1 0 0 0 0 0])
cc[9] =true
@test all(cc .^ Bool[0 1 1 0 0 0 0 0;
0 1 1 0 0 0 0 0;
0 1 1 0 0 0 0 0;
0 1 1 0 0 0 0 0])
cc[10] =false
@test all(cc .^ Bool[0 1 0 0 0 0 0 0;
0 1 0 0 0 0 0 0;
0 1 0 0 0 0 0 0;
0 1 0 0 0 0 0 0])
cc=Cover(4,8)
cc(1,1,true)
cc(2,2,true)
@test cc[1,3] && (!cc[2,3])
cc[1,3] =false
@test all(cc .^ Bool[0 1 0 0 0 0 0 0;
0 1 0 0 0 0 0 0;
0 1 0 0 0 0 0 0;
0 1 0 0 0 0 0 0])
cc[2,3] =true
@test all(cc .^ Bool[0 1 1 0 0 0 0 0;
0 1 1 0 0 0 0 0;
0 1 1 0 0 0 0 0;
0 1 1 0 0 0 0 0])
cc.=false
@test all(cc .^ Bool[0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0])
| [
3500,
6208,
198,
3500,
1766,
690,
198,
198,
535,
28,
27245,
7,
19,
11,
23,
8,
198,
535,
7,
16,
11,
16,
11,
7942,
8,
198,
535,
7,
17,
11,
17,
11,
7942,
8,
198,
198,
31,
9288,
477,
7,
535,
764,
61,
347,
970,
58,
16,
352,
352,
352,
352,
352,
352,
352,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
352,
657,
657,
657,
657,
657,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
352,
657,
657,
657,
657,
657,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
352,
657,
657,
657,
657,
657,
657,
12962,
198,
198,
31,
9288,
477,
7,
10782,
2557,
7,
535,
8,
764,
855,
685,
16,
362,
352,
352,
352,
352,
352,
352,
26,
657,
352,
657,
657,
657,
657,
657,
657,
26,
657,
352,
657,
657,
657,
657,
657,
657,
26,
657,
352,
657,
657,
657,
657,
657,
657,
12962,
198,
198,
31,
9288,
477,
7,
16680,
291,
2557,
7,
535,
8,
764,
855,
347,
970,
58,
15,
352,
657,
657,
657,
657,
657,
657,
26,
657,
657,
657,
657,
657,
657,
657,
657,
26,
657,
657,
657,
657,
657,
657,
657,
657,
26,
657,
657,
657,
657,
657,
657,
657,
657,
12962,
198,
198,
31,
9288,
36624,
58,
24,
60,
11405,
22759,
535,
58,
940,
12962,
198,
198,
535,
58,
24,
60,
796,
9562,
198,
31,
9288,
477,
7,
535,
764,
61,
347,
970,
58,
15,
352,
657,
657,
657,
657,
657,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
352,
657,
657,
657,
657,
657,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
352,
657,
657,
657,
657,
657,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
352,
657,
657,
657,
657,
657,
657,
12962,
198,
198,
535,
58,
940,
60,
796,
7942,
198,
198,
31,
9288,
477,
7,
535,
764,
61,
347,
970,
58,
15,
352,
352,
657,
657,
657,
657,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
352,
352,
657,
657,
657,
657,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
352,
352,
657,
657,
657,
657,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
352,
352,
657,
657,
657,
657,
657,
12962,
198,
535,
58,
24,
60,
796,
7942,
198,
198,
31,
9288,
477,
7,
535,
764,
61,
347,
970,
58,
15,
352,
352,
657,
657,
657,
657,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
352,
352,
657,
657,
657,
657,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
352,
352,
657,
657,
657,
657,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
352,
352,
657,
657,
657,
657,
657,
12962,
198,
198,
535,
58,
940,
60,
796,
9562,
198,
31,
9288,
477,
7,
535,
764,
61,
347,
970,
58,
15,
352,
657,
657,
657,
657,
657,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
352,
657,
657,
657,
657,
657,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
352,
657,
657,
657,
657,
657,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
352,
657,
657,
657,
657,
657,
657,
12962,
628,
198,
535,
28,
27245,
7,
19,
11,
23,
8,
198,
535,
7,
16,
11,
16,
11,
7942,
8,
198,
535,
7,
17,
11,
17,
11,
7942,
8,
198,
198,
31,
9288,
36624,
58,
16,
11,
18,
60,
11405,
22759,
535,
58,
17,
11,
18,
12962,
198,
198,
535,
58,
16,
11,
18,
60,
796,
9562,
198,
31,
9288,
477,
7,
535,
764,
61,
347,
970,
58,
15,
352,
657,
657,
657,
657,
657,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
352,
657,
657,
657,
657,
657,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
352,
657,
657,
657,
657,
657,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
352,
657,
657,
657,
657,
657,
657,
12962,
198,
198,
535,
58,
17,
11,
18,
60,
796,
7942,
198,
198,
31,
9288,
477,
7,
535,
764,
61,
347,
970,
58,
15,
352,
352,
657,
657,
657,
657,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
352,
352,
657,
657,
657,
657,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
352,
352,
657,
657,
657,
657,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
352,
352,
657,
657,
657,
657,
657,
12962,
628,
198,
535,
13,
28,
9562,
198,
198,
31,
9288,
477,
7,
535,
764,
61,
347,
970,
58,
15,
657,
657,
657,
657,
657,
657,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
657,
657,
657,
657,
657,
657,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
657,
657,
657,
657,
657,
657,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
657,
657,
657,
657,
657,
657,
657,
12962,
198
] | 1.496855 | 1,113 |
abstract type AbstractProblem end
struct CellProblemAdvecTemp{MeshType,TbfType,TypeK,TypeS,VType,BcondType,LaplacianStruct,AdvectionStruct} <: AbstractProblem
Tc::Vector{Float64}
k::TypeK
s::TypeS
ρC::Float64
u::VType
bcond::BcondType
mesh::MeshType
laplacian!::LaplacianStruct
advection!::AdvectionStruct
∇Tc::Vector{Vec2D{Float64}}
Tbf::TbfType
end
function CellProblemAdvecTemp(Tc,mesh,d)
bcond = boundary_conditions(d)
k = ConstVec{d[:conductivity]}()
s = ConstVec{d[:source]}()
ρC = d[Symbol("rho*C")]
uvec = ConstVec{d[:velocity]}()
∇Tc = zeros(Vec2D{Float64},length(Tc))
Tbf = FieldAtBoundary(Tc,mesh,bcond)
advection = get_advection_method(d)
laplacian = get_laplacian_method(Tc,bcond,k,mesh,d)
types = typeof.((mesh,Tbf,k,s,uvec,bcond,laplacian,advection))
return CellProblemAdvecTemp{types...}(Tc,k,s,ρC,uvec,bcond,mesh,laplacian,advection,∇Tc,Tbf)
end
@inline needs_gradient_calculation(p) = (typeof(p.advection!) === UpWind2ndOrder) && (typeof(p.laplacian!) === MethodB) && (typeof(p.u) <: ConstVec && p.u[1] == zero(eltype(p.u)))
function calculate_rhs!(rhs,p::CellProblemAdvecTemp)
fill!(rhs,zero(eltype(rhs)))
is_implicit(p.laplacian!) || p.laplacian!(rhs,p)
needs_gradient_calculation(p) && gradient!(p.∇Tc,FaceSimpleInterpolation(p.Tc,p.mesh),p.Tbf,p.mesh.f2cloops)
if !(typeof(p.u) <: ConstVec && p.u[1] == zero(eltype(p.u)))
p.advection!(rhs,p)
end
if !(typeof(p.s) <: ConstVec && p.s[1] == zero(eltype(p.s)))
add_source!(rhs,p)
end
is_implicit(p.laplacian!) && p.laplacian!(rhs,p)
return nothing
end
function add_source!(rhs,p)
s = p.s
@inbounds @simd for i=1:length(rhs)
rhs[i] += s[i]
end
end
struct StokesProblem{UfType,UbfType,MeshType,uBcondType,LaplacianStruct,Ma,PMa,PMap} <: AbstractProblem
u::Vec2DArray{Float64}
u_old::Vec2DArray{Float64}
uf::UfType
ubf::UbfType
δu::Vec2DArray{Float64}
ru::Vec2DArray{Float64}
p::Vector{Float64}
δp::Vector{Float64}
ν::ConstVec{Float64}
ρ::ConstVec{Float64}
bcond::uBcondType
mesh::MeshType
laplacian!::LaplacianStruct
∇u::Vector{FiniteVolumeMesh.Ten2D{Float64}}
A::Ma
pcgA::PMa
s::Vector{Float64}
Ap::PoissonP{MeshType}
pcgAp::PMap
dt::Float64
end
function StokesProblem(u,mesh,d)
u_old = similar(u)
uf = FaceSimpleInterpolation(u,mesh)
bcond = uboundary_conditions(d)
ubf = FieldAtBoundary(u,mesh,bcond)
δu = similar(u)
ru = similar(u)
ν = ConstVec(d[:viscosity])
ρ = ConstVec(d[:density])
∇u = zeros(Ten2D{Float64},length(u))
p = zeros(length(u))
δp = zeros(length(u))
laplacian = get_laplacian_method(u,bcond,ν,mesh,d)
A = aIpDbG(d,mesh)
pcgA = PCG(δu)
pcgAp = PCG(δp)
types = typeof.((uf,ubf,mesh,bcond,laplacian,A,pcgA,pcgAp))
s = zeros(length(mesh.cells))
Ap = PoissonP(d,mesh)
dt = d[:dt]
return StokesProblem{types...}(u,u_old,uf,ubf,δu,ru,p,δp,ν,ρ,bcond,mesh,laplacian,∇u,A,pcgA,s,Ap,pcgAp,dt)
end
struct NSProblem{UfType,UbfType,MeshType,uBcondType,LaplacianStruct,AdvecStruct,Ma,PMa,PMap,TBcondType,TLaplacianStruct,TAdvectionStruct,TbfType,MaT,PMaT} <: AbstractProblem
u::Vec2DArray{Float64}
uf::UfType
ubf::UbfType
δu::Vec2DArray{Float64}
ru::Vec2DArray{Float64}
p::Vector{Float64}
δp::Vector{Float64}
ν::ConstVec{Float64}
ρ::ConstVec{Float64}
bcond::uBcondType
mesh::MeshType
laplacian!::LaplacianStruct
uadvection!::AdvecStruct
∇u::Vector{FiniteVolumeMesh.Ten2D{Float64}}
A::Ma
pcgA::PMa
sp::Vector{Float64}
Ap::PoissonP{MeshType}
pcgAp::PMap
dt::Float64
Tc::Vector{Float64}
∇Tc::Vec2DArray{Float64}
rT::Vector{Float64}
δT::Vector{Float64}
k::ConstVec{Float64}
s::ConstVec{Float64}
ρC::Float64
Tbcond::TBcondType
Tlaplacian!::TLaplacianStruct
Tadvection!::TAdvectionStruct
Tbf::TbfType
AT::MaT
pcgAT::PMaT
end
function NSProblem(u,mesh,d)
uf = FaceSimpleInterpolation(u,mesh)
bcond = uboundary_conditions(d)
ubf = FieldAtBoundary(u,mesh,bcond)
δu = Vec2DArray{Float64}(length(u))
ru = Vec2DArray{Float64}(length(u))
ν = ConstVec(d[:viscosity])
ρ = ConstVec(d[:density])
∇u = zeros(Ten2D{Float64},length(u))
p = zeros(length(u))
δp = zeros(length(u))
laplacian = get_laplacian_method(u,bcond,ConstVec{Float64}(0.5*ν[1]),mesh,d)
A = aIpDbG(ConstVec(d[:density]/d[:dt]),-0.5*ν[1],d,mesh)
pcgA = PCG(δu,KrylovCtrl("vPCG.set"))
pcgAp = PCG(δp,KrylovCtrl("pPCG.set"))
uadvection = UpWindAdvection(u,ubf,u,ubf,mesh)
sp = zeros(length(mesh.cells))
Ap = PoissonP(d,mesh)
dt = d[:dt]
Tc = zeros(Float64,length(mesh.cells))
∇Tc = Vec2DArray{Float64}(length(u))
rT = zeros(Float64,length(mesh.cells))
dT = zeros(Float64,length(mesh.cells))
Tbcond = boundary_conditions(d)
k = ConstVec{Float64}(d[:conductivity])
s = ConstVec{Float64}(d[:source])
ρC = d[Symbol("rho*C")]
Tbf = FieldAtBoundary(Tc,mesh,Tbcond)
Tadvection = UpWindAdvection(Tc,Tbf,u,ubf,mesh)
Tlaplacian = get_laplacian_method(Tc,Tbcond,ConstVec{Float64}(0.5*k[1]),mesh,d)
AT = aIpDbG(ConstVec{Float64}(ρC/dt),-0.5*k[1],d,mesh)
pcgAT = PCG(dT,KrylovCtrl("tPCG.set"))
types = typeof.((uf,ubf,mesh,bcond,laplacian,uadvection,A,pcgA,pcgAp,Tbcond,Tlaplacian,Tadvection,Tbf,AT,pcgAT))
return NSProblem{types...}(u,uf,ubf,δu,ru,p,δp,ν,ρ,bcond,mesh,laplacian,uadvection,∇u,A,pcgA,sp,Ap,pcgAp,dt,Tc,∇Tc,rT,dT,k,s,ρC,Tbcond,Tlaplacian,Tadvection,Tbf,AT,pcgAT)
end | [
397,
8709,
2099,
27741,
40781,
886,
198,
198,
7249,
12440,
40781,
2782,
35138,
30782,
90,
37031,
6030,
11,
51,
19881,
6030,
11,
6030,
42,
11,
6030,
50,
11,
53,
6030,
11,
33,
17561,
6030,
11,
14772,
489,
330,
666,
44909,
11,
2782,
303,
596,
44909,
92,
1279,
25,
27741,
40781,
198,
220,
220,
220,
309,
66,
3712,
38469,
90,
43879,
2414,
92,
198,
220,
220,
220,
479,
3712,
6030,
42,
198,
220,
220,
220,
264,
3712,
6030,
50,
198,
220,
220,
220,
18074,
223,
34,
3712,
43879,
2414,
198,
220,
220,
220,
334,
3712,
53,
6030,
198,
220,
220,
220,
275,
17561,
3712,
33,
17561,
6030,
198,
220,
220,
220,
19609,
3712,
37031,
6030,
198,
220,
220,
220,
8591,
489,
330,
666,
0,
3712,
14772,
489,
330,
666,
44909,
198,
220,
220,
220,
512,
303,
596,
0,
3712,
2782,
303,
596,
44909,
198,
220,
220,
220,
18872,
229,
51,
66,
3712,
38469,
90,
53,
721,
17,
35,
90,
43879,
2414,
11709,
198,
220,
220,
220,
309,
19881,
3712,
51,
19881,
6030,
198,
437,
198,
198,
8818,
12440,
40781,
2782,
35138,
30782,
7,
51,
66,
11,
76,
5069,
11,
67,
8,
198,
220,
220,
220,
275,
17561,
796,
18645,
62,
17561,
1756,
7,
67,
8,
628,
220,
220,
220,
479,
796,
4757,
53,
721,
90,
67,
58,
25,
36495,
3458,
48999,
3419,
198,
220,
220,
220,
264,
796,
4757,
53,
721,
90,
67,
58,
25,
10459,
48999,
3419,
198,
220,
220,
220,
18074,
223,
34,
796,
288,
58,
13940,
23650,
7203,
81,
8873,
9,
34,
4943,
60,
198,
220,
220,
220,
334,
35138,
796,
4757,
53,
721,
90,
67,
58,
25,
626,
11683,
48999,
3419,
198,
220,
220,
220,
18872,
229,
51,
66,
796,
1976,
27498,
7,
53,
721,
17,
35,
90,
43879,
2414,
5512,
13664,
7,
51,
66,
4008,
198,
220,
220,
220,
309,
19881,
796,
7663,
2953,
49646,
560,
7,
51,
66,
11,
76,
5069,
11,
15630,
623,
8,
628,
220,
220,
220,
512,
303,
596,
796,
651,
62,
324,
303,
596,
62,
24396,
7,
67,
8,
198,
220,
220,
220,
8591,
489,
330,
666,
796,
651,
62,
5031,
489,
330,
666,
62,
24396,
7,
51,
66,
11,
15630,
623,
11,
74,
11,
76,
5069,
11,
67,
8,
198,
220,
220,
220,
3858,
796,
2099,
1659,
12195,
7,
76,
5069,
11,
51,
19881,
11,
74,
11,
82,
11,
84,
35138,
11,
15630,
623,
11,
5031,
489,
330,
666,
11,
324,
303,
596,
4008,
198,
220,
220,
220,
1441,
12440,
40781,
2782,
35138,
30782,
90,
19199,
986,
92,
7,
51,
66,
11,
74,
11,
82,
11,
33643,
34,
11,
84,
35138,
11,
15630,
623,
11,
76,
5069,
11,
5031,
489,
330,
666,
11,
324,
303,
596,
11,
24861,
229,
51,
66,
11,
51,
19881,
8,
198,
437,
198,
198,
31,
45145,
2476,
62,
49607,
62,
9948,
14902,
7,
79,
8,
796,
357,
4906,
1659,
7,
79,
13,
324,
303,
596,
8133,
24844,
3205,
8731,
17,
358,
18743,
8,
11405,
357,
4906,
1659,
7,
79,
13,
5031,
489,
330,
666,
8133,
24844,
11789,
33,
8,
11405,
357,
4906,
1659,
7,
79,
13,
84,
8,
1279,
25,
4757,
53,
721,
11405,
279,
13,
84,
58,
16,
60,
6624,
6632,
7,
417,
4906,
7,
79,
13,
84,
22305,
198,
198,
8818,
15284,
62,
81,
11994,
0,
7,
81,
11994,
11,
79,
3712,
28780,
40781,
2782,
35138,
30782,
8,
198,
220,
220,
220,
6070,
0,
7,
81,
11994,
11,
22570,
7,
417,
4906,
7,
81,
11994,
22305,
628,
220,
220,
220,
318,
62,
23928,
3628,
7,
79,
13,
5031,
489,
330,
666,
8133,
8614,
279,
13,
5031,
489,
330,
666,
0,
7,
81,
11994,
11,
79,
8,
628,
220,
220,
220,
2476,
62,
49607,
62,
9948,
14902,
7,
79,
8,
11405,
31312,
0,
7,
79,
13,
24861,
229,
51,
66,
11,
32388,
26437,
9492,
16104,
341,
7,
79,
13,
51,
66,
11,
79,
13,
76,
5069,
828,
79,
13,
51,
19881,
11,
79,
13,
76,
5069,
13,
69,
17,
565,
44860,
8,
628,
220,
220,
220,
611,
5145,
7,
4906,
1659,
7,
79,
13,
84,
8,
1279,
25,
4757,
53,
721,
11405,
279,
13,
84,
58,
16,
60,
6624,
6632,
7,
417,
4906,
7,
79,
13,
84,
22305,
220,
198,
220,
220,
220,
220,
220,
220,
220,
279,
13,
324,
303,
596,
0,
7,
81,
11994,
11,
79,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
611,
5145,
7,
4906,
1659,
7,
79,
13,
82,
8,
1279,
25,
4757,
53,
721,
11405,
279,
13,
82,
58,
16,
60,
6624,
6632,
7,
417,
4906,
7,
79,
13,
82,
22305,
220,
198,
220,
220,
220,
220,
220,
220,
220,
751,
62,
10459,
0,
7,
81,
11994,
11,
79,
8,
198,
220,
220,
220,
886,
628,
220,
220,
220,
318,
62,
23928,
3628,
7,
79,
13,
5031,
489,
330,
666,
8133,
11405,
279,
13,
5031,
489,
330,
666,
0,
7,
81,
11994,
11,
79,
8,
628,
220,
220,
220,
1441,
2147,
198,
437,
198,
198,
8818,
751,
62,
10459,
0,
7,
81,
11994,
11,
79,
8,
198,
220,
220,
220,
264,
796,
279,
13,
82,
198,
220,
220,
220,
2488,
259,
65,
3733,
2488,
14323,
67,
329,
1312,
28,
16,
25,
13664,
7,
81,
11994,
8,
198,
220,
220,
220,
220,
220,
220,
220,
9529,
82,
58,
72,
60,
15853,
264,
58,
72,
60,
198,
220,
220,
220,
886,
198,
437,
198,
198,
7249,
520,
3369,
40781,
90,
52,
69,
6030,
11,
52,
19881,
6030,
11,
37031,
6030,
11,
84,
33,
17561,
6030,
11,
14772,
489,
330,
666,
44909,
11,
21467,
11,
5868,
64,
11,
5868,
499,
92,
1279,
25,
27741,
40781,
198,
220,
220,
220,
334,
3712,
53,
721,
17,
35,
19182,
90,
43879,
2414,
92,
198,
220,
220,
220,
334,
62,
727,
3712,
53,
721,
17,
35,
19182,
90,
43879,
2414,
92,
198,
220,
220,
220,
334,
69,
3712,
52,
69,
6030,
198,
220,
220,
220,
334,
19881,
3712,
52,
19881,
6030,
198,
220,
220,
220,
7377,
112,
84,
3712,
53,
721,
17,
35,
19182,
90,
43879,
2414,
92,
198,
220,
220,
220,
7422,
3712,
53,
721,
17,
35,
19182,
90,
43879,
2414,
92,
198,
220,
220,
220,
279,
3712,
38469,
90,
43879,
2414,
92,
198,
220,
220,
220,
7377,
112,
79,
3712,
38469,
90,
43879,
2414,
92,
198,
220,
220,
220,
7377,
121,
3712,
34184,
53,
721,
90,
43879,
2414,
92,
198,
220,
220,
220,
18074,
223,
3712,
34184,
53,
721,
90,
43879,
2414,
92,
198,
220,
220,
220,
275,
17561,
3712,
84,
33,
17561,
6030,
198,
220,
220,
220,
19609,
3712,
37031,
6030,
198,
220,
220,
220,
8591,
489,
330,
666,
0,
3712,
14772,
489,
330,
666,
44909,
198,
220,
220,
220,
18872,
229,
84,
3712,
38469,
90,
37,
9504,
31715,
37031,
13,
24893,
17,
35,
90,
43879,
2414,
11709,
198,
220,
220,
220,
317,
3712,
21467,
198,
220,
220,
220,
40653,
70,
32,
3712,
5868,
64,
198,
220,
220,
220,
264,
3712,
38469,
90,
43879,
2414,
92,
198,
220,
220,
220,
5949,
3712,
18833,
30927,
47,
90,
37031,
6030,
92,
198,
220,
220,
220,
40653,
70,
25189,
3712,
5868,
499,
198,
220,
220,
220,
288,
83,
3712,
43879,
2414,
198,
437,
198,
198,
8818,
520,
3369,
40781,
7,
84,
11,
76,
5069,
11,
67,
8,
198,
220,
220,
220,
334,
62,
727,
796,
2092,
7,
84,
8,
198,
220,
220,
220,
334,
69,
796,
15399,
26437,
9492,
16104,
341,
7,
84,
11,
76,
5069,
8,
198,
220,
220,
220,
275,
17561,
796,
334,
7784,
560,
62,
17561,
1756,
7,
67,
8,
198,
220,
220,
220,
334,
19881,
796,
7663,
2953,
49646,
560,
7,
84,
11,
76,
5069,
11,
15630,
623,
8,
198,
220,
220,
220,
7377,
112,
84,
796,
2092,
7,
84,
8,
198,
220,
220,
220,
7422,
796,
2092,
7,
84,
8,
198,
220,
220,
220,
7377,
121,
796,
4757,
53,
721,
7,
67,
58,
25,
85,
2304,
16579,
12962,
198,
220,
220,
220,
18074,
223,
796,
4757,
53,
721,
7,
67,
58,
25,
43337,
12962,
198,
220,
220,
220,
18872,
229,
84,
796,
1976,
27498,
7,
24893,
17,
35,
90,
43879,
2414,
5512,
13664,
7,
84,
4008,
198,
220,
220,
220,
279,
796,
1976,
27498,
7,
13664,
7,
84,
4008,
198,
220,
220,
220,
7377,
112,
79,
796,
1976,
27498,
7,
13664,
7,
84,
4008,
628,
220,
220,
220,
8591,
489,
330,
666,
796,
651,
62,
5031,
489,
330,
666,
62,
24396,
7,
84,
11,
15630,
623,
11,
26180,
11,
76,
5069,
11,
67,
8,
198,
220,
220,
220,
317,
796,
257,
40,
79,
43832,
38,
7,
67,
11,
76,
5069,
8,
198,
220,
220,
220,
40653,
70,
32,
796,
4217,
38,
7,
138,
112,
84,
8,
198,
220,
220,
220,
40653,
70,
25189,
796,
4217,
38,
7,
138,
112,
79,
8,
198,
220,
220,
220,
3858,
796,
2099,
1659,
12195,
7,
3046,
11,
549,
69,
11,
76,
5069,
11,
15630,
623,
11,
5031,
489,
330,
666,
11,
32,
11,
14751,
70,
32,
11,
14751,
70,
25189,
4008,
628,
220,
220,
220,
264,
796,
1976,
27498,
7,
13664,
7,
76,
5069,
13,
46342,
4008,
198,
220,
220,
220,
5949,
796,
7695,
30927,
47,
7,
67,
11,
76,
5069,
8,
198,
220,
220,
220,
288,
83,
796,
288,
58,
25,
28664,
60,
198,
220,
220,
220,
1441,
520,
3369,
40781,
90,
19199,
986,
92,
7,
84,
11,
84,
62,
727,
11,
3046,
11,
549,
69,
11,
138,
112,
84,
11,
622,
11,
79,
11,
138,
112,
79,
11,
26180,
11,
33643,
11,
15630,
623,
11,
76,
5069,
11,
5031,
489,
330,
666,
11,
24861,
229,
84,
11,
32,
11,
14751,
70,
32,
11,
82,
11,
25189,
11,
14751,
70,
25189,
11,
28664,
8,
198,
437,
198,
198,
7249,
10896,
40781,
90,
52,
69,
6030,
11,
52,
19881,
6030,
11,
37031,
6030,
11,
84,
33,
17561,
6030,
11,
14772,
489,
330,
666,
44909,
11,
2782,
35138,
44909,
11,
21467,
11,
5868,
64,
11,
5868,
499,
11,
22737,
17561,
6030,
11,
51,
14772,
489,
330,
666,
44909,
11,
51,
2782,
303,
596,
44909,
11,
51,
19881,
6030,
11,
21467,
51,
11,
5868,
64,
51,
92,
1279,
25,
27741,
40781,
198,
220,
220,
220,
334,
3712,
53,
721,
17,
35,
19182,
90,
43879,
2414,
92,
198,
220,
220,
220,
334,
69,
3712,
52,
69,
6030,
198,
220,
220,
220,
334,
19881,
3712,
52,
19881,
6030,
198,
220,
220,
220,
7377,
112,
84,
3712,
53,
721,
17,
35,
19182,
90,
43879,
2414,
92,
198,
220,
220,
220,
7422,
3712,
53,
721,
17,
35,
19182,
90,
43879,
2414,
92,
198,
220,
220,
220,
279,
3712,
38469,
90,
43879,
2414,
92,
198,
220,
220,
220,
7377,
112,
79,
3712,
38469,
90,
43879,
2414,
92,
198,
220,
220,
220,
7377,
121,
3712,
34184,
53,
721,
90,
43879,
2414,
92,
198,
220,
220,
220,
18074,
223,
3712,
34184,
53,
721,
90,
43879,
2414,
92,
198,
220,
220,
220,
275,
17561,
3712,
84,
33,
17561,
6030,
198,
220,
220,
220,
19609,
3712,
37031,
6030,
198,
220,
220,
220,
8591,
489,
330,
666,
0,
3712,
14772,
489,
330,
666,
44909,
198,
220,
220,
220,
334,
324,
303,
596,
0,
3712,
2782,
35138,
44909,
198,
220,
220,
220,
18872,
229,
84,
3712,
38469,
90,
37,
9504,
31715,
37031,
13,
24893,
17,
35,
90,
43879,
2414,
11709,
198,
220,
220,
220,
317,
3712,
21467,
198,
220,
220,
220,
40653,
70,
32,
3712,
5868,
64,
198,
220,
220,
220,
599,
3712,
38469,
90,
43879,
2414,
92,
198,
220,
220,
220,
5949,
3712,
18833,
30927,
47,
90,
37031,
6030,
92,
198,
220,
220,
220,
40653,
70,
25189,
3712,
5868,
499,
198,
220,
220,
220,
288,
83,
3712,
43879,
2414,
198,
220,
220,
220,
309,
66,
3712,
38469,
90,
43879,
2414,
92,
198,
220,
220,
220,
18872,
229,
51,
66,
3712,
53,
721,
17,
35,
19182,
90,
43879,
2414,
92,
198,
220,
220,
220,
374,
51,
3712,
38469,
90,
43879,
2414,
92,
198,
220,
220,
220,
7377,
112,
51,
3712,
38469,
90,
43879,
2414,
92,
198,
220,
220,
220,
479,
3712,
34184,
53,
721,
90,
43879,
2414,
92,
198,
220,
220,
220,
264,
3712,
34184,
53,
721,
90,
43879,
2414,
92,
198,
220,
220,
220,
18074,
223,
34,
3712,
43879,
2414,
198,
220,
220,
220,
309,
15630,
623,
3712,
22737,
17561,
6030,
198,
220,
220,
220,
309,
5031,
489,
330,
666,
0,
3712,
51,
14772,
489,
330,
666,
44909,
198,
220,
220,
220,
50077,
303,
596,
0,
3712,
51,
2782,
303,
596,
44909,
198,
220,
220,
220,
309,
19881,
3712,
51,
19881,
6030,
198,
220,
220,
220,
5161,
3712,
21467,
51,
198,
220,
220,
220,
40653,
70,
1404,
3712,
5868,
64,
51,
198,
437,
198,
198,
8818,
10896,
40781,
7,
84,
11,
76,
5069,
11,
67,
8,
198,
220,
220,
220,
334,
69,
796,
15399,
26437,
9492,
16104,
341,
7,
84,
11,
76,
5069,
8,
198,
220,
220,
220,
275,
17561,
796,
334,
7784,
560,
62,
17561,
1756,
7,
67,
8,
198,
220,
220,
220,
334,
19881,
796,
7663,
2953,
49646,
560,
7,
84,
11,
76,
5069,
11,
15630,
623,
8,
198,
220,
220,
220,
7377,
112,
84,
796,
38692,
17,
35,
19182,
90,
43879,
2414,
92,
7,
13664,
7,
84,
4008,
198,
220,
220,
220,
7422,
796,
38692,
17,
35,
19182,
90,
43879,
2414,
92,
7,
13664,
7,
84,
4008,
198,
220,
220,
220,
7377,
121,
796,
4757,
53,
721,
7,
67,
58,
25,
85,
2304,
16579,
12962,
198,
220,
220,
220,
18074,
223,
796,
4757,
53,
721,
7,
67,
58,
25,
43337,
12962,
198,
220,
220,
220,
18872,
229,
84,
796,
1976,
27498,
7,
24893,
17,
35,
90,
43879,
2414,
5512,
13664,
7,
84,
4008,
198,
220,
220,
220,
279,
796,
1976,
27498,
7,
13664,
7,
84,
4008,
198,
220,
220,
220,
7377,
112,
79,
796,
1976,
27498,
7,
13664,
7,
84,
4008,
628,
220,
220,
220,
8591,
489,
330,
666,
796,
651,
62,
5031,
489,
330,
666,
62,
24396,
7,
84,
11,
15630,
623,
11,
34184,
53,
721,
90,
43879,
2414,
92,
7,
15,
13,
20,
9,
26180,
58,
16,
46570,
76,
5069,
11,
67,
8,
198,
220,
220,
220,
317,
796,
257,
40,
79,
43832,
38,
7,
34184,
53,
721,
7,
67,
58,
25,
43337,
60,
14,
67,
58,
25,
28664,
46570,
12,
15,
13,
20,
9,
26180,
58,
16,
4357,
67,
11,
76,
5069,
8,
198,
220,
220,
220,
40653,
70,
32,
796,
4217,
38,
7,
138,
112,
84,
11,
42,
563,
27086,
40069,
7203,
85,
5662,
38,
13,
2617,
48774,
198,
220,
220,
220,
40653,
70,
25189,
796,
4217,
38,
7,
138,
112,
79,
11,
42,
563,
27086,
40069,
7203,
79,
5662,
38,
13,
2617,
48774,
198,
220,
220,
220,
334,
324,
303,
596,
796,
3205,
8731,
2782,
303,
596,
7,
84,
11,
549,
69,
11,
84,
11,
549,
69,
11,
76,
5069,
8,
628,
220,
220,
220,
599,
796,
1976,
27498,
7,
13664,
7,
76,
5069,
13,
46342,
4008,
198,
220,
220,
220,
5949,
796,
7695,
30927,
47,
7,
67,
11,
76,
5069,
8,
198,
220,
220,
220,
288,
83,
796,
288,
58,
25,
28664,
60,
628,
220,
220,
220,
309,
66,
796,
1976,
27498,
7,
43879,
2414,
11,
13664,
7,
76,
5069,
13,
46342,
4008,
198,
220,
220,
220,
18872,
229,
51,
66,
796,
38692,
17,
35,
19182,
90,
43879,
2414,
92,
7,
13664,
7,
84,
4008,
198,
220,
220,
220,
374,
51,
796,
1976,
27498,
7,
43879,
2414,
11,
13664,
7,
76,
5069,
13,
46342,
4008,
198,
220,
220,
220,
288,
51,
796,
1976,
27498,
7,
43879,
2414,
11,
13664,
7,
76,
5069,
13,
46342,
4008,
198,
220,
220,
220,
309,
15630,
623,
796,
18645,
62,
17561,
1756,
7,
67,
8,
628,
220,
220,
220,
479,
796,
4757,
53,
721,
90,
43879,
2414,
92,
7,
67,
58,
25,
36495,
3458,
12962,
198,
220,
220,
220,
264,
796,
4757,
53,
721,
90,
43879,
2414,
92,
7,
67,
58,
25,
10459,
12962,
198,
220,
220,
220,
18074,
223,
34,
796,
288,
58,
13940,
23650,
7203,
81,
8873,
9,
34,
4943,
60,
198,
220,
220,
220,
309,
19881,
796,
7663,
2953,
49646,
560,
7,
51,
66,
11,
76,
5069,
11,
51,
15630,
623,
8,
628,
220,
220,
220,
50077,
303,
596,
796,
3205,
8731,
2782,
303,
596,
7,
51,
66,
11,
51,
19881,
11,
84,
11,
549,
69,
11,
76,
5069,
8,
198,
220,
220,
220,
309,
5031,
489,
330,
666,
796,
651,
62,
5031,
489,
330,
666,
62,
24396,
7,
51,
66,
11,
51,
15630,
623,
11,
34184,
53,
721,
90,
43879,
2414,
92,
7,
15,
13,
20,
9,
74,
58,
16,
46570,
76,
5069,
11,
67,
8,
198,
220,
220,
220,
5161,
796,
257,
40,
79,
43832,
38,
7,
34184,
53,
721,
90,
43879,
2414,
92,
7,
33643,
34,
14,
28664,
828,
12,
15,
13,
20,
9,
74,
58,
16,
4357,
67,
11,
76,
5069,
8,
198,
220,
220,
220,
40653,
70,
1404,
796,
4217,
38,
7,
67,
51,
11,
42,
563,
27086,
40069,
7203,
83,
5662,
38,
13,
2617,
48774,
628,
220,
220,
220,
3858,
796,
2099,
1659,
12195,
7,
3046,
11,
549,
69,
11,
76,
5069,
11,
15630,
623,
11,
5031,
489,
330,
666,
11,
84,
324,
303,
596,
11,
32,
11,
14751,
70,
32,
11,
14751,
70,
25189,
11,
51,
15630,
623,
11,
51,
5031,
489,
330,
666,
11,
51,
324,
303,
596,
11,
51,
19881,
11,
1404,
11,
14751,
70,
1404,
4008,
198,
220,
220,
220,
1441,
10896,
40781,
90,
19199,
986,
92,
7,
84,
11,
3046,
11,
549,
69,
11,
138,
112,
84,
11,
622,
11,
79,
11,
138,
112,
79,
11,
26180,
11,
33643,
11,
15630,
623,
11,
76,
5069,
11,
5031,
489,
330,
666,
11,
84,
324,
303,
596,
11,
24861,
229,
84,
11,
32,
11,
14751,
70,
32,
11,
2777,
11,
25189,
11,
14751,
70,
25189,
11,
28664,
11,
51,
66,
11,
24861,
229,
51,
66,
11,
81,
51,
11,
67,
51,
11,
74,
11,
82,
11,
33643,
34,
11,
51,
15630,
623,
11,
51,
5031,
489,
330,
666,
11,
51,
324,
303,
596,
11,
51,
19881,
11,
1404,
11,
14751,
70,
1404,
8,
198,
437
] | 1.912357 | 2,978 |
__precompile__()
module UnitFloat
import Base:
+,
-,
*,
bits,
convert,
exponent,
isfinite,
isinf,
isless,
one,
show,
signbit,
significand,
typemax,
typemin,
zero
export UFloat
"""
UFloat
The 64-bit type storing the *fraction* and the *exponent* of the unit-interval
floating point number.
```
|-----------------------------------------|----------------------|
| Exponent (41 bits) | Fraction (23 bits) |
|-----------------------------------------|----------------------|
bit no |63 23|22 0|
```
"""
primitive type UFloat 64 end # TODO can we extend AbstractFloat, like BigFloat?
"""
_UFloat
Construct a `UFloat` given the exponent and the fraction. The exponent must be
strictly negative and >= `-2^41`. Only the last 23 bits of the given fraction
are used.
"""
@inline function _UFloat(exponent::Int64, fraction::Float32)
bits = UInt64(reinterpret(UInt32, fraction)) & 0x00000000007fffff # ~UInt(0) >> 41
bits |= ~reinterpret(UInt64, -exponent) << 23
reinterpret(UFloat, bits)
end
@inline _is_zero(x) = x == zero(typeof(x))
@inline _is_one(x) = x == one(typeof(x))
@inline zero(::Type{UFloat}) = reinterpret(UFloat, 0x0000000000000000)
@inline one(::Type{UFloat}) = reinterpret(UFloat, 0xffffffffff800000)
zero(::UFloat) = zero(UFloat)
one(::UFloat) = one(UFloat)
typemin(::Type{UFloat}) = zero(UFloat)
typemax(::Type{UFloat}) = one(UFloat)
typemin(::UFloat) = zero(UFloat)
typemax(::UFloat) = one(UFloat)
isinf(::UFloat) = false
isfinite(::UFloat) = true
bits(u::UFloat) = bits(reinterpret(UInt64, u))
signbit(u::UFloat) = false
@inline function _exponent_unsafe(u::UFloat)
# gives incorrect results for zero(UFloat) and one(UFloat)
-reinterpret(Int64, ~reinterpret(UInt64, u) >> 23)
end
@inline function _exponent_unsafe(f::Float32)
Int64((reinterpret(UInt32, f) & 0x7f800000) >> 23) - 127
end
@inline function _exponent_unsafe(f::Float64)
Int64((reinterpret(UInt64, f) & 0x7ff0000000000000) >> 52) - 1023
end
function exponent(u::UFloat)
_is_zero(u) && throw(DomainError())
_exponent_unsafe(u)
end
@inline function _significand_unsafe(u::UFloat)
# incorrect for zero(UFloat) and one(UFloat)
bits = UInt32((reinterpret(UInt64, u) & 0x00000000007fffff)) # zero first 41 bits
bits |= 0x3f800000 # add zero exponent to Float32
reinterpret(Float32, bits)
end
@inline function _significand_unsafe(f::Float32)
reinterpret(Float32, (reinterpret(UInt32, f) & 0x007fffff) | 0x3f800000)
end
@inline function _significand_unsafe(f::Float64)
_significand_unsafe(Float32(f))
end
function significand(u::UFloat)
_is_zero(u) && return 0.0f0
_is_one(u) && return 1.0f0
_significand_unsafe(u)
end
function convert(::Type{UFloat}, f::F) where {F<:AbstractFloat}
f < zero(F) && throw(InexactError())
f == zero(F) && return zero(UFloat)
f == one(F) && return one(UFloat) # one special case because exponent==0
exp, frac = exponent(f), significand(f)
exp >= 0 && throw(InexactError())
_UFloat(exp, Float32(frac))
end
function convert(::Type{F}, u::UFloat) where {F<:AbstractFloat}
_is_zero(u) && return zero(F)
_is_one(u) && return one(F)
frac = _significand_unsafe(u)
exp = _exponent_unsafe(u)
ldexp(F(frac), exp)
end
convert(::Type{UFloat}, b::Bool) = b ? one(UFloat) : zero(UFloat)
convert(::Type{Bool}, u::UFloat) = u == one(UFloat)
###############################################################################
function _multiply(a, b)::UFloat
sa = _significand_unsafe(a)
sb = _significand_unsafe(b)
ea = _exponent_unsafe(a)
eb = _exponent_unsafe(b)
sn = sa * sb
en = ea + eb + _exponent_unsafe(sn) # cannot be <= 1<<41
en > -2199023255552 ? _UFloat(en, sn) : zero(UFloat)
end
@inline function _add(a, b)::UFloat
_is_zero(a) && return UFloat(b)
_is_zero(b) && return UFloat(a)
sa = _significand_unsafe(a)
sb = _significand_unsafe(b)
ea = _exponent_unsafe(a)
eb = _exponent_unsafe(b)
ed = ea - eb
sn = sb + ldexp(sa, ed)
en = eb + _exponent_unsafe(sn)
en >= 0 ? one(UFloat) : _UFloat(en, sn)
end
+(a::UFloat, b::UFloat) = _add(a, b)
*(a::UFloat, b::UFloat) = _multiply(a, b)
for T in [Float32, Float64], (op, fn) in [(:+, :_add), (:*, :_multiply)]
@eval begin
($op)(a::UFloat, b::$T) = ($fn)(a, b)
($op)(a::$T, b::UFloat) = ($fn)(a, b)
end
end
###############################################################################
@inline function _isless(a, b)::Bool
a == one(typeof(a)) && return false
b == one(typeof(b)) && return true # assumed a ≠ 1.0
b == zero(typeof(b)) && return false
a == zero(typeof(a)) && return true # assumed b ≠ 0.0
ea = _exponent_unsafe(a)
eb = _exponent_unsafe(b)
ea < eb && return true
ea > eb && return false
# ea == eb
sa = _significand_unsafe(a)
sb = _significand_unsafe(b)
sa < sb
end
isless(a::UFloat, b::UFloat) = _isless(a, b)
begin
local T = [UFloat, Float32, Float64]
for T1 in T, T2 in T
if T1 != T2
@eval begin
isless(a::$T1, b::$T2) = _isless(a, b)
end
end
end
end
###############################################################################
function show(io::IO, u::UFloat)
if _is_zero(u)
print(io, "0.0uf")
elseif _is_one(u)
print(io, "1.0uf")
else
# represent the number as a×10^b, with b int
e2 = exponent(u)
e10 = e2 * log10(2.0)
e10i = round(e10)
e10r = e10 - e10i
s = Float32(significand(u) * exp10(e10r))
while round(s, 5) >= 10.0f0
s /= 10.0f0; e10i += 1
end
while round(s, 5) < 1.0f0
s *= 10.0f0; e10i -= 1
end
@printf(io, "%.5fuf%d", s, e10i)
end
end
end # module
| [
834,
3866,
5589,
576,
834,
3419,
198,
198,
21412,
11801,
43879,
198,
198,
11748,
7308,
25,
198,
220,
220,
220,
1343,
11,
198,
220,
220,
220,
532,
11,
198,
220,
220,
220,
1635,
11,
198,
220,
220,
220,
10340,
11,
198,
220,
220,
220,
10385,
11,
198,
220,
220,
220,
28622,
11,
198,
220,
220,
220,
318,
69,
9504,
11,
198,
220,
220,
220,
318,
10745,
11,
198,
220,
220,
220,
318,
1203,
11,
198,
220,
220,
220,
530,
11,
198,
220,
220,
220,
905,
11,
198,
220,
220,
220,
1051,
2545,
11,
198,
220,
220,
220,
2216,
392,
11,
198,
220,
220,
220,
2170,
368,
897,
11,
198,
220,
220,
220,
2170,
14857,
11,
198,
220,
220,
220,
6632,
198,
198,
39344,
471,
43879,
198,
198,
37811,
198,
220,
220,
220,
471,
43879,
198,
198,
464,
5598,
12,
2545,
2099,
23069,
262,
1635,
69,
7861,
9,
290,
262,
1635,
11201,
3471,
9,
286,
262,
4326,
12,
3849,
2100,
198,
48679,
803,
966,
1271,
13,
198,
15506,
63,
198,
220,
220,
220,
220,
220,
220,
220,
220,
930,
3880,
982,
22831,
19351,
438,
91,
198,
220,
220,
220,
220,
220,
220,
220,
220,
930,
5518,
3471,
357,
3901,
10340,
8,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
376,
7861,
357,
1954,
10340,
8,
220,
220,
930,
198,
220,
220,
220,
220,
220,
220,
220,
220,
930,
3880,
982,
22831,
19351,
438,
91,
198,
2545,
645,
220,
220,
930,
5066,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2242,
91,
1828,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
91,
198,
15506,
63,
198,
37811,
198,
19795,
1800,
2099,
471,
43879,
5598,
886,
1303,
16926,
46,
460,
356,
9117,
27741,
43879,
11,
588,
4403,
43879,
30,
198,
198,
37811,
198,
220,
220,
220,
4808,
52,
43879,
198,
198,
42316,
257,
4600,
52,
43879,
63,
1813,
262,
28622,
290,
262,
13390,
13,
383,
28622,
1276,
307,
198,
301,
2012,
306,
4633,
290,
18189,
4600,
12,
17,
61,
3901,
44646,
5514,
262,
938,
2242,
10340,
286,
262,
1813,
13390,
198,
533,
973,
13,
198,
37811,
198,
31,
45145,
2163,
4808,
52,
43879,
7,
11201,
3471,
3712,
5317,
2414,
11,
13390,
3712,
43879,
2624,
8,
198,
220,
220,
220,
10340,
796,
471,
5317,
2414,
7,
260,
27381,
7,
52,
5317,
2624,
11,
13390,
4008,
1222,
657,
87,
8269,
25816,
12927,
69,
1303,
5299,
52,
5317,
7,
15,
8,
9609,
6073,
198,
220,
220,
220,
10340,
930,
28,
5299,
260,
27381,
7,
52,
5317,
2414,
11,
532,
11201,
3471,
8,
9959,
2242,
198,
220,
220,
220,
302,
27381,
7,
52,
43879,
11,
10340,
8,
198,
437,
198,
198,
31,
45145,
4808,
271,
62,
22570,
7,
87,
8,
220,
220,
796,
2124,
6624,
6632,
7,
4906,
1659,
7,
87,
4008,
198,
31,
45145,
4808,
271,
62,
505,
7,
87,
8,
220,
220,
220,
796,
2124,
6624,
530,
7,
4906,
1659,
7,
87,
4008,
198,
198,
31,
45145,
6632,
7,
3712,
6030,
90,
52,
43879,
30072,
796,
302,
27381,
7,
52,
43879,
11,
657,
87,
25645,
8,
198,
31,
45145,
530,
7,
3712,
6030,
90,
52,
43879,
30072,
220,
796,
302,
27381,
7,
52,
43879,
11,
657,
87,
12927,
12927,
487,
7410,
830,
8,
198,
22570,
7,
3712,
52,
43879,
8,
796,
6632,
7,
52,
43879,
8,
198,
505,
7,
3712,
52,
43879,
8,
796,
530,
7,
52,
43879,
8,
198,
28004,
14857,
7,
3712,
6030,
90,
52,
43879,
30072,
796,
6632,
7,
52,
43879,
8,
198,
28004,
368,
897,
7,
3712,
6030,
90,
52,
43879,
30072,
796,
530,
7,
52,
43879,
8,
198,
28004,
14857,
7,
3712,
52,
43879,
8,
796,
6632,
7,
52,
43879,
8,
198,
28004,
368,
897,
7,
3712,
52,
43879,
8,
796,
530,
7,
52,
43879,
8,
198,
271,
10745,
7,
3712,
52,
43879,
8,
796,
3991,
198,
4468,
9504,
7,
3712,
52,
43879,
8,
796,
2081,
198,
198,
9895,
7,
84,
3712,
52,
43879,
8,
796,
10340,
7,
260,
27381,
7,
52,
5317,
2414,
11,
334,
4008,
198,
12683,
2545,
7,
84,
3712,
52,
43879,
8,
796,
3991,
198,
198,
31,
45145,
2163,
4808,
11201,
3471,
62,
13271,
8635,
7,
84,
3712,
52,
43879,
8,
198,
220,
220,
220,
1303,
3607,
11491,
2482,
329,
6632,
7,
52,
43879,
8,
290,
530,
7,
52,
43879,
8,
198,
220,
220,
220,
532,
260,
27381,
7,
5317,
2414,
11,
5299,
260,
27381,
7,
52,
5317,
2414,
11,
334,
8,
9609,
2242,
8,
198,
437,
198,
31,
45145,
2163,
4808,
11201,
3471,
62,
13271,
8635,
7,
69,
3712,
43879,
2624,
8,
220,
198,
220,
220,
220,
2558,
2414,
19510,
260,
27381,
7,
52,
5317,
2624,
11,
277,
8,
1222,
657,
87,
22,
69,
7410,
830,
8,
9609,
2242,
8,
532,
18112,
198,
437,
198,
31,
45145,
2163,
4808,
11201,
3471,
62,
13271,
8635,
7,
69,
3712,
43879,
2414,
8,
198,
220,
220,
220,
2558,
2414,
19510,
260,
27381,
7,
52,
5317,
2414,
11,
277,
8,
1222,
657,
87,
22,
487,
8269,
20483,
8,
9609,
6740,
8,
532,
838,
1954,
198,
437,
198,
198,
8818,
28622,
7,
84,
3712,
52,
43879,
8,
198,
220,
220,
220,
4808,
271,
62,
22570,
7,
84,
8,
11405,
3714,
7,
43961,
12331,
28955,
198,
220,
220,
220,
4808,
11201,
3471,
62,
13271,
8635,
7,
84,
8,
198,
437,
198,
198,
31,
45145,
2163,
4808,
12683,
811,
392,
62,
13271,
8635,
7,
84,
3712,
52,
43879,
8,
198,
220,
220,
220,
1303,
11491,
329,
6632,
7,
52,
43879,
8,
290,
530,
7,
52,
43879,
8,
198,
220,
220,
220,
10340,
796,
471,
5317,
2624,
19510,
260,
27381,
7,
52,
5317,
2414,
11,
334,
8,
1222,
657,
87,
8269,
25816,
12927,
69,
4008,
1303,
6632,
717,
6073,
10340,
198,
220,
220,
220,
10340,
930,
28,
657,
87,
18,
69,
7410,
830,
1303,
751,
6632,
28622,
284,
48436,
2624,
198,
220,
220,
220,
302,
27381,
7,
43879,
2624,
11,
10340,
8,
198,
437,
198,
31,
45145,
2163,
4808,
12683,
811,
392,
62,
13271,
8635,
7,
69,
3712,
43879,
2624,
8,
198,
220,
220,
220,
302,
27381,
7,
43879,
2624,
11,
357,
260,
27381,
7,
52,
5317,
2624,
11,
277,
8,
1222,
657,
87,
25816,
12927,
69,
8,
930,
657,
87,
18,
69,
7410,
830,
8,
198,
437,
198,
31,
45145,
2163,
4808,
12683,
811,
392,
62,
13271,
8635,
7,
69,
3712,
43879,
2414,
8,
198,
220,
220,
220,
4808,
12683,
811,
392,
62,
13271,
8635,
7,
43879,
2624,
7,
69,
4008,
198,
437,
198,
198,
8818,
2216,
392,
7,
84,
3712,
52,
43879,
8,
198,
220,
220,
220,
4808,
271,
62,
22570,
7,
84,
8,
11405,
1441,
657,
13,
15,
69,
15,
198,
220,
220,
220,
4808,
271,
62,
505,
7,
84,
8,
11405,
1441,
352,
13,
15,
69,
15,
198,
220,
220,
220,
4808,
12683,
811,
392,
62,
13271,
8635,
7,
84,
8,
198,
437,
198,
198,
8818,
10385,
7,
3712,
6030,
90,
52,
43879,
5512,
277,
3712,
37,
8,
810,
1391,
37,
27,
25,
23839,
43879,
92,
198,
220,
220,
220,
277,
1279,
6632,
7,
37,
8,
11405,
3714,
7,
40,
12413,
529,
12331,
28955,
198,
220,
220,
220,
277,
6624,
6632,
7,
37,
8,
11405,
1441,
6632,
7,
52,
43879,
8,
198,
220,
220,
220,
277,
6624,
530,
7,
37,
8,
11405,
1441,
530,
7,
52,
43879,
8,
1303,
530,
2041,
1339,
780,
28622,
855,
15,
198,
220,
220,
220,
1033,
11,
1216,
330,
796,
28622,
7,
69,
828,
2216,
392,
7,
69,
8,
198,
220,
220,
220,
1033,
18189,
657,
11405,
3714,
7,
40,
12413,
529,
12331,
28955,
198,
220,
220,
220,
4808,
52,
43879,
7,
11201,
11,
48436,
2624,
7,
31944,
4008,
198,
437,
198,
198,
8818,
10385,
7,
3712,
6030,
90,
37,
5512,
334,
3712,
52,
43879,
8,
810,
1391,
37,
27,
25,
23839,
43879,
92,
198,
220,
220,
220,
4808,
271,
62,
22570,
7,
84,
8,
11405,
1441,
6632,
7,
37,
8,
198,
220,
220,
220,
4808,
271,
62,
505,
7,
84,
8,
11405,
1441,
530,
7,
37,
8,
198,
220,
220,
220,
1216,
330,
796,
4808,
12683,
811,
392,
62,
13271,
8635,
7,
84,
8,
198,
220,
220,
220,
1033,
796,
4808,
11201,
3471,
62,
13271,
8635,
7,
84,
8,
198,
220,
220,
220,
300,
67,
11201,
7,
37,
7,
31944,
828,
1033,
8,
198,
437,
198,
198,
1102,
1851,
7,
3712,
6030,
90,
52,
43879,
5512,
275,
3712,
33,
970,
8,
796,
275,
5633,
530,
7,
52,
43879,
8,
1058,
6632,
7,
52,
43879,
8,
198,
1102,
1851,
7,
3712,
6030,
90,
33,
970,
5512,
334,
3712,
52,
43879,
8,
796,
334,
6624,
530,
7,
52,
43879,
8,
198,
198,
29113,
29113,
7804,
4242,
21017,
628,
198,
8818,
4808,
16680,
541,
306,
7,
64,
11,
275,
2599,
25,
52,
43879,
198,
220,
220,
220,
473,
796,
4808,
12683,
811,
392,
62,
13271,
8635,
7,
64,
8,
198,
220,
220,
220,
264,
65,
796,
4808,
12683,
811,
392,
62,
13271,
8635,
7,
65,
8,
198,
220,
220,
220,
304,
64,
796,
4808,
11201,
3471,
62,
13271,
8635,
7,
64,
8,
198,
220,
220,
220,
36649,
796,
4808,
11201,
3471,
62,
13271,
8635,
7,
65,
8,
628,
220,
220,
220,
3013,
796,
473,
1635,
264,
65,
198,
220,
220,
220,
551,
796,
304,
64,
1343,
36649,
1343,
4808,
11201,
3471,
62,
13271,
8635,
7,
16184,
8,
1303,
2314,
307,
19841,
352,
16791,
3901,
628,
220,
220,
220,
551,
1875,
532,
17,
19891,
1954,
1495,
2816,
4309,
5633,
4808,
52,
43879,
7,
268,
11,
3013,
8,
1058,
6632,
7,
52,
43879,
8,
198,
437,
198,
198,
31,
45145,
2163,
4808,
2860,
7,
64,
11,
275,
2599,
25,
52,
43879,
198,
220,
220,
220,
4808,
271,
62,
22570,
7,
64,
8,
11405,
1441,
471,
43879,
7,
65,
8,
198,
220,
220,
220,
4808,
271,
62,
22570,
7,
65,
8,
11405,
1441,
471,
43879,
7,
64,
8,
628,
220,
220,
220,
473,
796,
4808,
12683,
811,
392,
62,
13271,
8635,
7,
64,
8,
198,
220,
220,
220,
264,
65,
796,
4808,
12683,
811,
392,
62,
13271,
8635,
7,
65,
8,
198,
220,
220,
220,
304,
64,
796,
4808,
11201,
3471,
62,
13271,
8635,
7,
64,
8,
198,
220,
220,
220,
36649,
796,
4808,
11201,
3471,
62,
13271,
8635,
7,
65,
8,
628,
220,
220,
220,
1225,
796,
304,
64,
532,
36649,
628,
220,
220,
220,
3013,
796,
264,
65,
1343,
300,
67,
11201,
7,
11400,
11,
1225,
8,
198,
220,
220,
220,
551,
796,
36649,
1343,
4808,
11201,
3471,
62,
13271,
8635,
7,
16184,
8,
628,
220,
220,
220,
551,
18189,
657,
5633,
530,
7,
52,
43879,
8,
1058,
4808,
52,
43879,
7,
268,
11,
3013,
8,
198,
437,
198,
198,
33747,
64,
3712,
52,
43879,
11,
275,
3712,
52,
43879,
8,
796,
4808,
2860,
7,
64,
11,
275,
8,
198,
9,
7,
64,
3712,
52,
43879,
11,
275,
3712,
52,
43879,
8,
796,
4808,
16680,
541,
306,
7,
64,
11,
275,
8,
198,
1640,
309,
287,
685,
43879,
2624,
11,
48436,
2414,
4357,
357,
404,
11,
24714,
8,
287,
47527,
25,
28200,
1058,
62,
2860,
828,
357,
25,
25666,
1058,
62,
16680,
541,
306,
15437,
198,
220,
220,
220,
2488,
18206,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
7198,
404,
5769,
64,
3712,
52,
43879,
11,
275,
3712,
3,
51,
8,
796,
7198,
22184,
5769,
64,
11,
275,
8,
198,
220,
220,
220,
220,
220,
220,
220,
7198,
404,
5769,
64,
3712,
3,
51,
11,
275,
3712,
52,
43879,
8,
796,
7198,
22184,
5769,
64,
11,
275,
8,
198,
220,
220,
220,
886,
198,
437,
628,
198,
29113,
29113,
7804,
4242,
21017,
198,
198,
31,
45145,
2163,
4808,
271,
1203,
7,
64,
11,
275,
2599,
25,
33,
970,
198,
220,
220,
220,
257,
6624,
530,
7,
4906,
1659,
7,
64,
4008,
11405,
1441,
3991,
198,
220,
220,
220,
275,
6624,
530,
7,
4906,
1659,
7,
65,
4008,
11405,
1441,
2081,
1303,
9672,
257,
15139,
254,
352,
13,
15,
198,
220,
220,
220,
275,
6624,
6632,
7,
4906,
1659,
7,
65,
4008,
11405,
1441,
3991,
198,
220,
220,
220,
257,
6624,
6632,
7,
4906,
1659,
7,
64,
4008,
11405,
1441,
2081,
1303,
9672,
275,
15139,
254,
657,
13,
15,
628,
220,
220,
220,
304,
64,
796,
4808,
11201,
3471,
62,
13271,
8635,
7,
64,
8,
198,
220,
220,
220,
36649,
796,
4808,
11201,
3471,
62,
13271,
8635,
7,
65,
8,
628,
220,
220,
220,
304,
64,
1279,
36649,
11405,
1441,
2081,
198,
220,
220,
220,
304,
64,
1875,
36649,
11405,
1441,
3991,
628,
220,
220,
220,
1303,
304,
64,
6624,
36649,
198,
220,
220,
220,
473,
796,
4808,
12683,
811,
392,
62,
13271,
8635,
7,
64,
8,
198,
220,
220,
220,
264,
65,
796,
4808,
12683,
811,
392,
62,
13271,
8635,
7,
65,
8,
628,
220,
220,
220,
473,
1279,
264,
65,
198,
437,
198,
198,
271,
1203,
7,
64,
3712,
52,
43879,
11,
275,
3712,
52,
43879,
8,
796,
4808,
271,
1203,
7,
64,
11,
275,
8,
198,
198,
27471,
198,
220,
220,
220,
1957,
309,
796,
685,
52,
43879,
11,
48436,
2624,
11,
48436,
2414,
60,
198,
220,
220,
220,
329,
309,
16,
287,
309,
11,
309,
17,
287,
309,
198,
220,
220,
220,
220,
220,
220,
220,
611,
309,
16,
14512,
309,
17,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
18206,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
1203,
7,
64,
3712,
3,
51,
16,
11,
275,
3712,
3,
51,
17,
8,
796,
4808,
271,
1203,
7,
64,
11,
275,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
437,
198,
198,
29113,
29113,
7804,
4242,
21017,
198,
198,
8818,
905,
7,
952,
3712,
9399,
11,
334,
3712,
52,
43879,
8,
198,
220,
220,
220,
611,
4808,
271,
62,
22570,
7,
84,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
952,
11,
366,
15,
13,
15,
3046,
4943,
198,
220,
220,
220,
2073,
361,
4808,
271,
62,
505,
7,
84,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
952,
11,
366,
16,
13,
15,
3046,
4943,
198,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
2380,
262,
1271,
355,
257,
12906,
940,
61,
65,
11,
351,
275,
493,
198,
220,
220,
220,
220,
220,
220,
220,
304,
17,
796,
28622,
7,
84,
8,
198,
220,
220,
220,
220,
220,
220,
220,
304,
940,
796,
304,
17,
1635,
2604,
940,
7,
17,
13,
15,
8,
198,
220,
220,
220,
220,
220,
220,
220,
304,
940,
72,
796,
2835,
7,
68,
940,
8,
198,
220,
220,
220,
220,
220,
220,
220,
304,
940,
81,
796,
304,
940,
532,
304,
940,
72,
198,
220,
220,
220,
220,
220,
220,
220,
264,
796,
48436,
2624,
7,
12683,
811,
392,
7,
84,
8,
1635,
1033,
940,
7,
68,
940,
81,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
981,
2835,
7,
82,
11,
642,
8,
18189,
838,
13,
15,
69,
15,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
264,
1220,
28,
838,
13,
15,
69,
15,
26,
304,
940,
72,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
981,
2835,
7,
82,
11,
642,
8,
1279,
352,
13,
15,
69,
15,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
264,
1635,
28,
838,
13,
15,
69,
15,
26,
304,
940,
72,
48185,
352,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
37435,
7,
952,
11,
366,
7225,
20,
69,
3046,
4,
67,
1600,
264,
11,
304,
940,
72,
8,
198,
220,
220,
220,
886,
198,
437,
198,
198,
437,
1303,
8265,
198
] | 2.241405 | 2,676 |
using Test, PlotReferenceImages
@testset "PlotReferenceImages" begin
@test !isdir(reference_path(:notabackend, v"1"))
@test isfile(reference_file(:gr, 1, v"1"))
end
| [
3500,
6208,
11,
28114,
26687,
29398,
198,
198,
31,
9288,
2617,
366,
43328,
26687,
29398,
1,
2221,
198,
220,
220,
220,
2488,
9288,
5145,
9409,
343,
7,
35790,
62,
6978,
7,
25,
1662,
397,
441,
437,
11,
410,
1,
16,
48774,
198,
220,
220,
220,
2488,
9288,
318,
7753,
7,
35790,
62,
7753,
7,
25,
2164,
11,
352,
11,
410,
1,
16,
48774,
198,
437,
198
] | 2.636364 | 66 |
struct DisjointPartitioner{Mtd, Mtd′}
mtd::Mtd
mtd′::Mtd′
end
function partition_plaid(A::SparseMatrixCSC, K, method::DisjointPartitioner; kwargs...)
Φ = partition_stripe(A, K, method.mtd; kwargs...)
Π = partition_stripe(PermutedDimsArray(A, (2, 1)), K, method.mtd′, Φ; kwargs...)
return (Π, Φ)
end
struct AlternatingPartitioner{Mtds}
mtds::Mtds
end
AlternatingPartitioner(mtds...) = AlternatingPartitioner{typeof(mtds)}(mtds)
function partition_plaid(A::SparseMatrixCSC, K, method::AlternatingPartitioner; adj_A = nothing, kwargs...)
if adj_A === nothing
adj_A = adjointpattern(A)
end
Φ = partition_stripe(A, K, method.mtds[1]; adj_A=adj_A, kwargs...)
Π = partition_stripe(adj_A, K, method.mtds[2], Φ; adj_A=A, kwargs...)
for (i, mtd) in enumerate(method.mtds[3:end])
if isodd(i)
Φ = partition_stripe(A, K, mtd, Π; adj_A=adj_A, kwargs...)
else
Π = partition_stripe(adj_A, K, mtd, Φ; adj_A=A, kwargs...)
end
end
return (Π, Φ)
end
struct AlternatingNetPartitioner{Hint, Mtds}
hint::Hint
mtds::Mtds
end
AlternatingNetPartitioner(mtds...) = AlternatingNetPartitioner{NoHint, typeof(mtds)}(NoHint(), mtds)
AlternatingNetPartitioner(hint::Hint, mtds...) where {Hint<:AbstractHint} = AlternatingNetPartitioner{Hint, typeof(mtds)}(hint, mtds)
function partition_plaid(A::SparseMatrixCSC, K, method::AlternatingNetPartitioner; adj_A = nothing, net = nothing, kwargs...)
if adj_A === nothing
adj_A = adjointpattern(A)
end
if net === nothing
net = netcount(method.hint, A; kwargs...)
end
Φ = partition_stripe(A, K, method.mtds[1]; net=net, adj_A=adj_A, kwargs...)
Π = partition_stripe(adj_A, K, method.mtds[2], Φ; adj_A=A, kwargs...)
for (i, mtd) in enumerate(method.mtds[3:end])
if isodd(i)
Φ = partition_stripe(A, K, mtd, Π; net=net, adj_A=adj_A, kwargs...)
else
Π = partition_stripe(adj_A, K, mtd, Φ; adj_A=A, adj_net = net, kwargs...)
end
end
return (Π, Φ)
end
struct SymmetricPartitioner{Mtds}
mtds::Mtds
function SymmetricPartitioner{Mtds}(mtds::Mtds) where {Mtds}
return new{Mtds}(mtds)
end
end
SymmetricPartitioner(mtd) = SymmetricPartitioner{Tuple{typeof(mtd)}}((mtd,))
SymmetricPartitioner(mtds...) = SymmetricPartitioner{typeof(mtds)}(mtds)
function partition_plaid(A::SparseMatrixCSC, K, method::SymmetricPartitioner; adj_A = nothing, kwargs...)
if length(method.mtds) > 1
if adj_A === nothing
adj_A = adjointpattern(A)
end
Π = partition_stripe(A, K, method.mtds[1]; adj_A=adj_A, kwargs...)
for (i, mtd) in enumerate(method.mtds[2:end])
if isodd(i)
Π = partition_stripe(A, K, mtd, Π; adj_A=adj_A, kwargs...)
else
Π = partition_stripe(adj_A, K, mtd, Π; adj_A=A, kwargs...)
end
end
else
Π = partition_stripe(A, K, method.mtds[1]; kwargs...)
end
return (Π, Π)
end | [
7249,
3167,
73,
1563,
7841,
653,
263,
90,
44,
8671,
11,
337,
8671,
17478,
92,
198,
220,
220,
220,
285,
8671,
3712,
44,
8671,
198,
220,
220,
220,
285,
8671,
17478,
3712,
44,
8671,
17478,
198,
437,
198,
198,
8818,
18398,
62,
489,
1698,
7,
32,
3712,
50,
29572,
46912,
34,
6173,
11,
509,
11,
2446,
3712,
7279,
73,
1563,
7841,
653,
263,
26,
479,
86,
22046,
23029,
198,
220,
220,
220,
7377,
99,
796,
18398,
62,
33565,
431,
7,
32,
11,
509,
11,
2446,
13,
76,
8671,
26,
479,
86,
22046,
23029,
198,
220,
220,
220,
7377,
254,
796,
18398,
62,
33565,
431,
7,
5990,
76,
7241,
35,
12078,
19182,
7,
32,
11,
357,
17,
11,
352,
36911,
509,
11,
2446,
13,
76,
8671,
17478,
11,
7377,
99,
26,
479,
86,
22046,
23029,
198,
220,
220,
220,
1441,
357,
138,
254,
11,
7377,
99,
8,
198,
437,
198,
198,
7249,
13243,
803,
7841,
653,
263,
90,
44,
8671,
82,
92,
198,
220,
220,
220,
285,
8671,
82,
3712,
44,
8671,
82,
198,
437,
198,
198,
23081,
803,
7841,
653,
263,
7,
76,
8671,
82,
23029,
796,
13243,
803,
7841,
653,
263,
90,
4906,
1659,
7,
76,
8671,
82,
38165,
7,
76,
8671,
82,
8,
198,
198,
8818,
18398,
62,
489,
1698,
7,
32,
3712,
50,
29572,
46912,
34,
6173,
11,
509,
11,
2446,
3712,
23081,
803,
7841,
653,
263,
26,
9224,
62,
32,
796,
2147,
11,
479,
86,
22046,
23029,
198,
220,
220,
220,
611,
9224,
62,
32,
24844,
2147,
198,
220,
220,
220,
220,
220,
220,
220,
9224,
62,
32,
796,
9224,
1563,
33279,
7,
32,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
7377,
99,
796,
18398,
62,
33565,
431,
7,
32,
11,
509,
11,
2446,
13,
76,
8671,
82,
58,
16,
11208,
9224,
62,
32,
28,
41255,
62,
32,
11,
479,
86,
22046,
23029,
198,
220,
220,
220,
7377,
254,
796,
18398,
62,
33565,
431,
7,
41255,
62,
32,
11,
509,
11,
2446,
13,
76,
8671,
82,
58,
17,
4357,
7377,
99,
26,
9224,
62,
32,
28,
32,
11,
479,
86,
22046,
23029,
198,
220,
220,
220,
329,
357,
72,
11,
285,
8671,
8,
287,
27056,
378,
7,
24396,
13,
76,
8671,
82,
58,
18,
25,
437,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
611,
318,
5088,
7,
72,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7377,
99,
796,
18398,
62,
33565,
431,
7,
32,
11,
509,
11,
285,
8671,
11,
7377,
254,
26,
9224,
62,
32,
28,
41255,
62,
32,
11,
479,
86,
22046,
23029,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7377,
254,
796,
18398,
62,
33565,
431,
7,
41255,
62,
32,
11,
509,
11,
285,
8671,
11,
7377,
99,
26,
9224,
62,
32,
28,
32,
11,
479,
86,
22046,
23029,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1441,
357,
138,
254,
11,
7377,
99,
8,
198,
437,
198,
198,
7249,
13243,
803,
7934,
7841,
653,
263,
90,
39,
600,
11,
337,
8671,
82,
92,
198,
220,
220,
220,
9254,
3712,
39,
600,
198,
220,
220,
220,
285,
8671,
82,
3712,
44,
8671,
82,
198,
437,
198,
198,
23081,
803,
7934,
7841,
653,
263,
7,
76,
8671,
82,
23029,
796,
13243,
803,
7934,
7841,
653,
263,
90,
2949,
39,
600,
11,
2099,
1659,
7,
76,
8671,
82,
38165,
7,
2949,
39,
600,
22784,
285,
8671,
82,
8,
198,
23081,
803,
7934,
7841,
653,
263,
7,
71,
600,
3712,
39,
600,
11,
285,
8671,
82,
23029,
810,
1391,
39,
600,
27,
25,
23839,
39,
600,
92,
796,
13243,
803,
7934,
7841,
653,
263,
90,
39,
600,
11,
2099,
1659,
7,
76,
8671,
82,
38165,
7,
71,
600,
11,
285,
8671,
82,
8,
198,
198,
8818,
18398,
62,
489,
1698,
7,
32,
3712,
50,
29572,
46912,
34,
6173,
11,
509,
11,
2446,
3712,
23081,
803,
7934,
7841,
653,
263,
26,
9224,
62,
32,
796,
2147,
11,
2010,
796,
2147,
11,
479,
86,
22046,
23029,
198,
220,
220,
220,
611,
9224,
62,
32,
24844,
2147,
198,
220,
220,
220,
220,
220,
220,
220,
9224,
62,
32,
796,
9224,
1563,
33279,
7,
32,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
611,
2010,
24844,
2147,
198,
220,
220,
220,
220,
220,
220,
220,
2010,
796,
2010,
9127,
7,
24396,
13,
71,
600,
11,
317,
26,
479,
86,
22046,
23029,
198,
220,
220,
220,
886,
198,
220,
220,
220,
7377,
99,
796,
18398,
62,
33565,
431,
7,
32,
11,
509,
11,
2446,
13,
76,
8671,
82,
58,
16,
11208,
2010,
28,
3262,
11,
9224,
62,
32,
28,
41255,
62,
32,
11,
479,
86,
22046,
23029,
198,
220,
220,
220,
7377,
254,
796,
18398,
62,
33565,
431,
7,
41255,
62,
32,
11,
509,
11,
2446,
13,
76,
8671,
82,
58,
17,
4357,
7377,
99,
26,
9224,
62,
32,
28,
32,
11,
479,
86,
22046,
23029,
198,
220,
220,
220,
329,
357,
72,
11,
285,
8671,
8,
287,
27056,
378,
7,
24396,
13,
76,
8671,
82,
58,
18,
25,
437,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
611,
318,
5088,
7,
72,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7377,
99,
796,
18398,
62,
33565,
431,
7,
32,
11,
509,
11,
285,
8671,
11,
7377,
254,
26,
2010,
28,
3262,
11,
9224,
62,
32,
28,
41255,
62,
32,
11,
479,
86,
22046,
23029,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7377,
254,
796,
18398,
62,
33565,
431,
7,
41255,
62,
32,
11,
509,
11,
285,
8671,
11,
7377,
99,
26,
9224,
62,
32,
28,
32,
11,
9224,
62,
3262,
796,
2010,
11,
479,
86,
22046,
23029,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1441,
357,
138,
254,
11,
7377,
99,
8,
198,
437,
198,
198,
7249,
1632,
3020,
19482,
7841,
653,
263,
90,
44,
8671,
82,
92,
198,
220,
220,
220,
285,
8671,
82,
3712,
44,
8671,
82,
198,
220,
220,
220,
2163,
1632,
3020,
19482,
7841,
653,
263,
90,
44,
8671,
82,
92,
7,
76,
8671,
82,
3712,
44,
8671,
82,
8,
810,
1391,
44,
8671,
82,
92,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
649,
90,
44,
8671,
82,
92,
7,
76,
8671,
82,
8,
198,
220,
220,
220,
886,
198,
437,
198,
198,
13940,
3020,
19482,
7841,
653,
263,
7,
76,
8671,
8,
796,
1632,
3020,
19482,
7841,
653,
263,
90,
51,
29291,
90,
4906,
1659,
7,
76,
8671,
8,
11709,
19510,
76,
8671,
11,
4008,
198,
13940,
3020,
19482,
7841,
653,
263,
7,
76,
8671,
82,
23029,
796,
1632,
3020,
19482,
7841,
653,
263,
90,
4906,
1659,
7,
76,
8671,
82,
38165,
7,
76,
8671,
82,
8,
198,
198,
8818,
18398,
62,
489,
1698,
7,
32,
3712,
50,
29572,
46912,
34,
6173,
11,
509,
11,
2446,
3712,
13940,
3020,
19482,
7841,
653,
263,
26,
9224,
62,
32,
796,
2147,
11,
479,
86,
22046,
23029,
198,
220,
220,
220,
611,
4129,
7,
24396,
13,
76,
8671,
82,
8,
1875,
352,
198,
220,
220,
220,
220,
220,
220,
220,
611,
9224,
62,
32,
24844,
2147,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9224,
62,
32,
796,
9224,
1563,
33279,
7,
32,
8,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
7377,
254,
796,
18398,
62,
33565,
431,
7,
32,
11,
509,
11,
2446,
13,
76,
8671,
82,
58,
16,
11208,
9224,
62,
32,
28,
41255,
62,
32,
11,
479,
86,
22046,
23029,
198,
220,
220,
220,
220,
220,
220,
220,
329,
357,
72,
11,
285,
8671,
8,
287,
27056,
378,
7,
24396,
13,
76,
8671,
82,
58,
17,
25,
437,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
318,
5088,
7,
72,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7377,
254,
796,
18398,
62,
33565,
431,
7,
32,
11,
509,
11,
285,
8671,
11,
7377,
254,
26,
9224,
62,
32,
28,
41255,
62,
32,
11,
479,
86,
22046,
23029,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7377,
254,
796,
18398,
62,
33565,
431,
7,
41255,
62,
32,
11,
509,
11,
285,
8671,
11,
7377,
254,
26,
9224,
62,
32,
28,
32,
11,
479,
86,
22046,
23029,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
7377,
254,
796,
18398,
62,
33565,
431,
7,
32,
11,
509,
11,
2446,
13,
76,
8671,
82,
58,
16,
11208,
479,
86,
22046,
23029,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1441,
357,
138,
254,
11,
7377,
254,
8,
198,
437
] | 2.009217 | 1,519 |
using CSV, DataFrames, Plots, StatsPlots
export plot_trade_union_membership, plot_GDP_per_capita, plot_maddison_GDP_data
export plot_GDP
export north_vs_south_countries, anglo_germanic_countries
export plot_relative_GDP
ENV["GKS_ENCODING"]="utf8" # Fix some annoying warning when plotting
# Find names of colors here: http://juliagraphics.github.io/Colors.jl/stable/namedcolors/
function plot_trade_union_membership()
path = joinpath(datadir, "trade-union-membership.csv")
unions = CSV.File(path) |> DataFrame
unions = select(unions, :Country, :Time, :Value)
country_unions = groupby(unions, :Country)
country_names = ["Norway", "Sweden", "Denmark", "Finland",
"United Kingdom", "United States", "Canada"]
colors = [:purple, :blue, :cyan, :green, :orange, :red, :brown]
plot()
for (i, cname) in enumerate(country_names)
country = country_unions[(Country=cname,)]
@df country plot!(:Time, :Value, label=cname, lw=2, seriescolor=colors[i])
end
plot!(minorgrid=true, # turn on minor grid lines
gridalpha=0.3, # Make major grid lines a bit more visible
legend=:outertopleft # Place box with legends outside of plot on top left
)
end
function plot_GDP_per_capita()
gdp = load_GDP_per_capita()
p = @df gdp plot(
:year,
[:norway, :sweden, :denmark, :finland, :uk, :usa],
lw=2,
minorgrid=true,
gridalpha=0.3,
legend=:bottomright,
label=["norway" "sweden" "denmark" "finland" "uk" "usa"],
seriescolor=[:magenta4 :mediumblue :deeppink2 :purple4 :lime :green]
# seriescolor=[:aqua :teal :dodgerblue :blue :gold :orange :orangered3]
)
# p = plot(gdp.year, # x-axis
# [gdp.norway, gdp.sweden, gdp.finland, gdp.denmark, gdp.uk, gdp.usa, gdp.canada],
# lw=2, # line width
# legend=:bottomright, # where to put legend
# label=["norway" "sweden" "finland" "denmark" "uk" "usa" "canada"] # labels in legend
# )
# savefig(p, "nordic-GDP-growth-from-60s.svg")
end
function plot_maddison_GDP_data()
gdp = load_maddison_GDP_data()
country_gdp = groupby(gdp, :Country)
plot_GDP(country_gdp)
end
# This is a smarter way of doing the plotting
function simpler_maddison_GDP_plot()
gdp = load_maddison_GDP_data()
countries = DataFrame(Country=["Norway", "Sweden", "Denmark", "Finland", "United Kingdom", "United States"])
# Like a set intersection. Match on :Country column
sample = innerjoin(gdp, countries, on=:Country)
# Filter out irrelevant years
sample = filter(row -> 1950 < row.Year < 2020, sample)
# Creates a separate series for every unique value in value provided to
# group property. Every row with that group value gets assigned to the same series
plot(sample.Year, sample.GDP, group=sample.Country)
# You can also write this as:
@df sample plot(:Year, :GDP, group=:Country)
end
const north_vs_south_countries = [
"Norway" => :purple,
"Sweden" => :cyan,
"Finland" => :blue,
"Portugal" => :goldenrod2,
"Argentina" => :orange,
"Spain" => :brown,
"Italy" => :red,
"Venezuela" => :orangered3,
]
const anglo_germanic_countries = [
"Denmark" => :purple,
"Germany" => :cyan,
"Austria" => :blue,
"United Kingdom" => :goldenrod2,
"United States" => :orange,
"Canada" => :brown,
"Italy" => :red,
"France" => :orangered3,
]
"""
plot_GDP(country_gdp::GroupedDataFrame, range)
Plots GDP data for the year `range` given.
"""
function plot_GDP(country_gdp::GroupedDataFrame, range = 1800:2020, countries = north_vs_south_countries)
plot()
for (cname, color) in countries
country = country_gdp[(Country=cname,)]
country = filter(row -> row.Year in range, country)
@df country plot!(:Year, :GDP, label=cname, lw=2, seriescolor=color)
# @df country plot!(:Year, :GDP, label=cname, lw=1)
end
plot!(minorgrid=true, # turn on minor grid lines
gridalpha=0.3, # Make major grid lines a bit more visible
# legend=:outertopleft # Place box with legends outside of plot on top left
legend=:topleft
)
end
function plot_relative_GDP(base_country::DataFrame, country_gdp::GroupedDataFrame, range = 1900:2020, countries = anglo_germanic_countries)
bcountry = base_country = filter(row -> row.Year in range, base_country)
plot(ylims = (40, 130))
for (cname, color) in countries
country = country_gdp[(Country=cname,)]
country = filter(row -> row.Year in range, country)
country.rGDP = 100*(country.GDP ./ bcountry.GDP)
@df country plot!(:Year, :rGDP, label=cname, lw=2, seriescolor=color)
# @df country plot!(:Year, :GDP, label=cname, lw=1)
end
plot!(minorgrid=true, # turn on minor grid lines
gridalpha=0.3, # Make major grid lines a bit more visible
# legend=:outertopleft # Place box with legends outside of plot on top left
legend=:topleft
)
end
function plot_cultural_diff()
path = joinpath(datadir, "geerthofstede-2015-08-16.csv")
cultural = CSV.File(path) |> DataFrame
cultures = select(cultural, :country,
:pdi => :hierarchy,
:idv => :individualism,
:mas => :masculinity,
:uai => :uncertainty,
:ltowvs => :long_term,
:ivr => :indulgence)
# Countries we want to filter on by performing an innerjoin
# countries = DataFrame(country=["Norway", "Sweden", "Denmark", "Finland", "U.S.A."])
countries = DataFrame(country=["Norway", "Sweden", "Denmark", "Japan", "China"])
# Pick cultures where the :country column matches in both DataFrame objects
sample = innerjoin(cultures, countries, on = :country)
# Stack turns column names into row values. E.g. if you got the row:
# country hierarchy individualism
# China 80 20
#
# then this becomes:
# country variable value
# China hierarchy 80
# China individualism 20
#
# So every column entry gets a separate row with the name of that column
data = stack(sample, 2:7)
# Why is this useful? Because the `group` attribute allows you to bundle values
# having identical column value such as "hierarchy" into a seprate series.
# Here each series is one country. The x-axis values for each country is the
# cultural dimensions under the `variable` column
groupedbar(data.variable, data.value, group=data.country)
# Turn into CSV viewable in Numbers
# clipboard(repr(MIME("text/csv"), sample))
end
| [
3500,
44189,
11,
6060,
35439,
11,
1345,
1747,
11,
20595,
3646,
1747,
198,
198,
39344,
7110,
62,
25351,
62,
24592,
62,
30814,
1056,
11,
7110,
62,
38,
6322,
62,
525,
62,
11128,
5350,
11,
7110,
62,
76,
2860,
1653,
62,
38,
6322,
62,
7890,
198,
39344,
7110,
62,
38,
6322,
198,
39344,
5093,
62,
14259,
62,
35782,
62,
9127,
1678,
11,
3550,
5439,
62,
1362,
805,
291,
62,
9127,
1678,
198,
39344,
7110,
62,
43762,
62,
38,
6322,
198,
198,
1677,
53,
14692,
38,
27015,
62,
24181,
3727,
2751,
8973,
2625,
40477,
23,
1,
220,
1303,
13268,
617,
15774,
6509,
618,
29353,
198,
198,
2,
9938,
3891,
286,
7577,
994,
25,
2638,
1378,
73,
32176,
6111,
873,
13,
12567,
13,
952,
14,
5216,
669,
13,
20362,
14,
31284,
14,
13190,
4033,
669,
14,
198,
198,
8818,
7110,
62,
25351,
62,
24592,
62,
30814,
1056,
3419,
198,
220,
220,
220,
3108,
796,
4654,
6978,
7,
19608,
324,
343,
11,
366,
25351,
12,
24592,
12,
30814,
1056,
13,
40664,
4943,
198,
220,
220,
220,
11936,
796,
44189,
13,
8979,
7,
6978,
8,
930,
29,
6060,
19778,
198,
220,
220,
220,
11936,
796,
2922,
7,
403,
507,
11,
1058,
33921,
11,
1058,
7575,
11,
1058,
11395,
8,
198,
220,
220,
220,
1499,
62,
403,
507,
796,
1448,
1525,
7,
403,
507,
11,
1058,
33921,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1499,
62,
14933,
796,
14631,
21991,
1014,
1600,
366,
10462,
31829,
1600,
366,
21306,
4102,
1600,
366,
18467,
1044,
1600,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
17013,
7526,
1600,
366,
17013,
1829,
1600,
366,
17940,
8973,
198,
220,
220,
220,
7577,
796,
685,
25,
14225,
1154,
11,
1058,
17585,
11,
1058,
948,
272,
11,
1058,
14809,
11,
1058,
43745,
11,
1058,
445,
11,
1058,
33282,
60,
198,
220,
220,
220,
7110,
3419,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
329,
357,
72,
11,
269,
3672,
8,
287,
27056,
378,
7,
19315,
62,
14933,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1499,
796,
1499,
62,
403,
507,
58,
7,
33921,
28,
66,
3672,
11,
15437,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
7568,
1499,
7110,
0,
7,
25,
7575,
11,
1058,
11395,
11,
6167,
28,
66,
3672,
11,
300,
86,
28,
17,
11,
2168,
8043,
28,
4033,
669,
58,
72,
12962,
198,
220,
220,
220,
886,
198,
220,
220,
220,
7110,
0,
7,
1084,
273,
25928,
28,
7942,
11,
220,
220,
220,
220,
220,
1303,
1210,
319,
4159,
10706,
3951,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10706,
26591,
28,
15,
13,
18,
11,
220,
220,
220,
220,
220,
220,
1303,
6889,
1688,
10706,
3951,
257,
1643,
517,
7424,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8177,
28,
25,
39605,
83,
643,
701,
1303,
8474,
3091,
351,
24901,
2354,
286,
7110,
319,
1353,
1364,
198,
220,
220,
220,
1267,
198,
437,
198,
198,
8818,
7110,
62,
38,
6322,
62,
525,
62,
11128,
5350,
3419,
198,
220,
220,
220,
308,
26059,
796,
3440,
62,
38,
6322,
62,
525,
62,
11128,
5350,
3419,
198,
220,
220,
220,
279,
796,
2488,
7568,
308,
26059,
7110,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1058,
1941,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
25,
13099,
1014,
11,
1058,
2032,
31829,
11,
1058,
6559,
4102,
11,
1058,
15643,
1044,
11,
1058,
2724,
11,
1058,
22064,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
86,
28,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4159,
25928,
28,
7942,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10706,
26591,
28,
15,
13,
18,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8177,
28,
25,
22487,
3506,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6167,
28,
14692,
13099,
1014,
1,
220,
366,
2032,
31829,
1,
220,
366,
6559,
4102,
1,
220,
366,
15643,
1044,
1,
220,
366,
2724,
1,
220,
366,
22064,
33116,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2168,
8043,
41888,
25,
19726,
29188,
19,
220,
1058,
24132,
17585,
220,
1058,
67,
1453,
381,
676,
17,
1058,
14225,
1154,
19,
1058,
27299,
1058,
14809,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
2168,
8043,
41888,
25,
36129,
64,
220,
1058,
660,
282,
220,
1058,
67,
375,
1362,
17585,
1058,
17585,
1058,
24267,
1058,
43745,
1058,
273,
19041,
18,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
1303,
279,
796,
7110,
7,
21287,
79,
13,
1941,
11,
220,
220,
1303,
2124,
12,
22704,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
685,
21287,
79,
13,
13099,
1014,
11,
308,
26059,
13,
2032,
31829,
11,
308,
26059,
13,
15643,
1044,
11,
308,
26059,
13,
6559,
4102,
11,
308,
26059,
13,
2724,
11,
308,
26059,
13,
22064,
11,
308,
26059,
13,
5171,
4763,
4357,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
300,
86,
28,
17,
11,
220,
220,
220,
220,
220,
220,
220,
1303,
1627,
9647,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
8177,
28,
25,
22487,
3506,
11,
1303,
810,
284,
1234,
8177,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
6167,
28,
14692,
13099,
1014,
1,
366,
2032,
31829,
1,
366,
15643,
1044,
1,
366,
6559,
4102,
1,
366,
2724,
1,
366,
22064,
1,
366,
5171,
4763,
8973,
1303,
14722,
287,
8177,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
1303,
3613,
5647,
7,
79,
11,
366,
77,
585,
291,
12,
38,
6322,
12,
27922,
12,
6738,
12,
1899,
82,
13,
21370,
70,
4943,
198,
437,
198,
198,
8818,
7110,
62,
76,
2860,
1653,
62,
38,
6322,
62,
7890,
3419,
198,
220,
220,
220,
308,
26059,
796,
3440,
62,
76,
2860,
1653,
62,
38,
6322,
62,
7890,
3419,
198,
220,
220,
220,
1499,
62,
21287,
79,
796,
1448,
1525,
7,
21287,
79,
11,
1058,
33921,
8,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
7110,
62,
38,
6322,
7,
19315,
62,
21287,
79,
8,
198,
437,
198,
198,
2,
770,
318,
257,
23714,
835,
286,
1804,
262,
29353,
198,
8818,
18599,
62,
76,
2860,
1653,
62,
38,
6322,
62,
29487,
3419,
198,
220,
220,
220,
308,
26059,
796,
3440,
62,
76,
2860,
1653,
62,
38,
6322,
62,
7890,
3419,
198,
220,
220,
220,
2678,
796,
6060,
19778,
7,
33921,
28,
14692,
21991,
1014,
1600,
366,
10462,
31829,
1600,
366,
21306,
4102,
1600,
366,
18467,
1044,
1600,
366,
17013,
7526,
1600,
366,
17013,
1829,
8973,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
4525,
257,
900,
16246,
13,
13225,
319,
1058,
33921,
5721,
198,
220,
220,
220,
6291,
796,
8434,
22179,
7,
21287,
79,
11,
2678,
11,
319,
28,
25,
33921,
8,
220,
220,
220,
220,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
25853,
503,
18046,
812,
198,
220,
220,
220,
6291,
796,
8106,
7,
808,
4613,
11445,
1279,
5752,
13,
17688,
1279,
12131,
11,
6291,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
7921,
274,
257,
4553,
2168,
329,
790,
3748,
1988,
287,
1988,
2810,
284,
198,
220,
220,
220,
1303,
1448,
3119,
13,
3887,
5752,
351,
326,
1448,
1988,
3011,
8686,
284,
262,
976,
2168,
198,
220,
220,
220,
7110,
7,
39873,
13,
17688,
11,
6291,
13,
38,
6322,
11,
1448,
28,
39873,
13,
33921,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
921,
460,
635,
3551,
428,
355,
25,
198,
220,
220,
220,
2488,
7568,
6291,
7110,
7,
25,
17688,
11,
1058,
38,
6322,
11,
1448,
28,
25,
33921,
8,
198,
437,
628,
198,
9979,
5093,
62,
14259,
62,
35782,
62,
9127,
1678,
796,
685,
198,
220,
220,
220,
220,
220,
220,
220,
366,
21991,
1014,
1,
220,
220,
220,
5218,
1058,
14225,
1154,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
10462,
31829,
1,
220,
220,
220,
5218,
1058,
948,
272,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
18467,
1044,
1,
220,
220,
5218,
1058,
17585,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
13924,
43778,
1,
220,
5218,
1058,
24267,
268,
14892,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
3163,
6783,
1437,
1,
5218,
1058,
43745,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
45355,
1,
220,
220,
220,
220,
5218,
1058,
33282,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
45001,
1,
220,
220,
220,
220,
5218,
1058,
445,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
53,
12596,
64,
1,
5218,
1058,
273,
19041,
18,
11,
198,
220,
220,
220,
220,
220,
2361,
198,
198,
9979,
3550,
5439,
62,
1362,
805,
291,
62,
9127,
1678,
796,
685,
198,
220,
220,
220,
220,
220,
366,
21306,
4102,
1,
220,
220,
220,
5218,
1058,
14225,
1154,
11,
198,
220,
220,
220,
220,
220,
366,
27079,
1,
220,
220,
220,
5218,
1058,
948,
272,
11,
198,
220,
220,
220,
220,
220,
366,
15160,
7496,
1,
220,
220,
5218,
1058,
17585,
11,
198,
220,
220,
220,
220,
220,
366,
17013,
7526,
1,
220,
5218,
1058,
24267,
268,
14892,
17,
11,
198,
220,
220,
220,
220,
220,
366,
17013,
1829,
1,
5218,
1058,
43745,
11,
198,
220,
220,
220,
220,
220,
366,
17940,
1,
220,
220,
220,
220,
5218,
1058,
33282,
11,
198,
220,
220,
220,
220,
220,
366,
45001,
1,
220,
220,
220,
220,
5218,
1058,
445,
11,
198,
220,
220,
220,
220,
220,
366,
28572,
1,
5218,
1058,
273,
19041,
18,
11,
198,
220,
220,
220,
2361,
220,
220,
220,
220,
220,
220,
220,
220,
628,
198,
37811,
198,
220,
220,
220,
7110,
62,
38,
6322,
7,
19315,
62,
21287,
79,
3712,
13247,
276,
6601,
19778,
11,
2837,
8,
198,
220,
220,
220,
220,
198,
3646,
1747,
12396,
1366,
329,
262,
614,
4600,
9521,
63,
1813,
13,
198,
37811,
198,
8818,
7110,
62,
38,
6322,
7,
19315,
62,
21287,
79,
3712,
13247,
276,
6601,
19778,
11,
2837,
796,
21431,
25,
42334,
11,
2678,
796,
5093,
62,
14259,
62,
35782,
62,
9127,
1678,
8,
198,
220,
220,
220,
7110,
3419,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
329,
357,
66,
3672,
11,
3124,
8,
287,
2678,
198,
220,
220,
220,
220,
220,
220,
220,
1499,
796,
1499,
62,
21287,
79,
58,
7,
33921,
28,
66,
3672,
11,
15437,
198,
220,
220,
220,
220,
220,
220,
220,
1499,
796,
8106,
7,
808,
4613,
5752,
13,
17688,
287,
2837,
11,
1499,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
7568,
1499,
7110,
0,
7,
25,
17688,
11,
1058,
38,
6322,
11,
6167,
28,
66,
3672,
11,
300,
86,
28,
17,
11,
2168,
8043,
28,
8043,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
2488,
7568,
1499,
7110,
0,
7,
25,
17688,
11,
1058,
38,
6322,
11,
6167,
28,
66,
3672,
11,
300,
86,
28,
16,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
7110,
0,
7,
1084,
273,
25928,
28,
7942,
11,
220,
220,
220,
220,
220,
1303,
1210,
319,
4159,
10706,
3951,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10706,
26591,
28,
15,
13,
18,
11,
220,
220,
220,
220,
220,
220,
1303,
6889,
1688,
10706,
3951,
257,
1643,
517,
7424,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
8177,
28,
25,
39605,
83,
643,
701,
1303,
8474,
3091,
351,
24901,
2354,
286,
7110,
319,
1353,
1364,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8177,
28,
25,
83,
643,
701,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
1267,
220,
220,
220,
220,
198,
437,
198,
198,
8818,
7110,
62,
43762,
62,
38,
6322,
7,
8692,
62,
19315,
3712,
6601,
19778,
11,
1499,
62,
21287,
79,
3712,
13247,
276,
6601,
19778,
11,
2837,
796,
21489,
25,
42334,
11,
2678,
796,
3550,
5439,
62,
1362,
805,
291,
62,
9127,
1678,
8,
198,
220,
220,
220,
275,
19315,
796,
2779,
62,
19315,
796,
8106,
7,
808,
4613,
5752,
13,
17688,
287,
2837,
11,
2779,
62,
19315,
8,
198,
220,
220,
220,
7110,
7,
88,
2475,
82,
796,
357,
1821,
11,
11323,
4008,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
329,
357,
66,
3672,
11,
3124,
8,
287,
2678,
198,
220,
220,
220,
220,
220,
220,
220,
1499,
796,
1499,
62,
21287,
79,
58,
7,
33921,
28,
66,
3672,
11,
15437,
198,
220,
220,
220,
220,
220,
220,
220,
1499,
796,
8106,
7,
808,
4613,
5752,
13,
17688,
287,
2837,
11,
1499,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1499,
13,
81,
38,
6322,
796,
1802,
9,
7,
19315,
13,
38,
6322,
24457,
275,
19315,
13,
38,
6322,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
7568,
1499,
7110,
0,
7,
25,
17688,
11,
1058,
81,
38,
6322,
11,
6167,
28,
66,
3672,
11,
300,
86,
28,
17,
11,
2168,
8043,
28,
8043,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
2488,
7568,
1499,
7110,
0,
7,
25,
17688,
11,
1058,
38,
6322,
11,
6167,
28,
66,
3672,
11,
300,
86,
28,
16,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
7110,
0,
7,
1084,
273,
25928,
28,
7942,
11,
220,
220,
220,
220,
220,
1303,
1210,
319,
4159,
10706,
3951,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10706,
26591,
28,
15,
13,
18,
11,
220,
220,
220,
220,
220,
220,
1303,
6889,
1688,
10706,
3951,
257,
1643,
517,
7424,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
8177,
28,
25,
39605,
83,
643,
701,
1303,
8474,
3091,
351,
24901,
2354,
286,
7110,
319,
1353,
1364,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8177,
28,
25,
83,
643,
701,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
1267,
220,
220,
220,
220,
198,
437,
198,
198,
8818,
7110,
62,
30844,
62,
26069,
3419,
198,
220,
220,
220,
3108,
796,
4654,
6978,
7,
19608,
324,
343,
11,
366,
469,
263,
400,
1659,
301,
18654,
12,
4626,
12,
2919,
12,
1433,
13,
40664,
4943,
198,
220,
220,
220,
6467,
796,
44189,
13,
8979,
7,
6978,
8,
930,
29,
6060,
19778,
198,
220,
220,
220,
13817,
796,
2922,
7,
30844,
11,
1058,
19315,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
79,
10989,
5218,
1058,
71,
959,
9282,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
312,
85,
5218,
1058,
43129,
1042,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
5356,
5218,
1058,
5356,
3129,
6269,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
84,
1872,
5218,
1058,
19524,
1425,
774,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
2528,
322,
14259,
5218,
1058,
6511,
62,
4354,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
452,
81,
5218,
1058,
521,
377,
12745,
8,
628,
220,
220,
220,
1303,
34906,
356,
765,
284,
8106,
319,
416,
9489,
281,
8434,
22179,
198,
220,
220,
220,
1303,
2678,
796,
6060,
19778,
7,
19315,
28,
14692,
21991,
1014,
1600,
366,
10462,
31829,
1600,
366,
21306,
4102,
1600,
366,
18467,
1044,
1600,
366,
52,
13,
50,
13,
32,
526,
12962,
198,
220,
220,
220,
2678,
796,
6060,
19778,
7,
19315,
28,
14692,
21991,
1014,
1600,
366,
10462,
31829,
1600,
366,
21306,
4102,
1600,
366,
16504,
1600,
366,
14581,
8973,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
12346,
13817,
810,
262,
1058,
19315,
5721,
7466,
287,
1111,
6060,
19778,
5563,
198,
220,
220,
220,
6291,
796,
8434,
22179,
7,
40820,
942,
11,
2678,
11,
319,
796,
1058,
19315,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
23881,
4962,
5721,
3891,
656,
5752,
3815,
13,
412,
13,
70,
13,
611,
345,
1392,
262,
5752,
25,
198,
220,
220,
220,
1303,
1499,
18911,
1981,
1042,
198,
220,
220,
220,
1303,
2807,
220,
220,
4019,
220,
220,
220,
220,
220,
220,
220,
1160,
198,
220,
220,
220,
1303,
198,
220,
220,
220,
1303,
788,
428,
4329,
25,
198,
220,
220,
220,
1303,
1499,
7885,
220,
220,
220,
220,
220,
220,
1988,
198,
220,
220,
220,
1303,
2807,
220,
220,
18911,
220,
220,
220,
220,
220,
4019,
198,
220,
220,
220,
1303,
2807,
220,
220,
1981,
1042,
220,
1160,
198,
220,
220,
220,
1303,
198,
220,
220,
220,
1303,
1406,
790,
5721,
5726,
3011,
257,
4553,
5752,
351,
262,
1438,
286,
326,
5721,
220,
220,
220,
220,
198,
220,
220,
220,
1366,
796,
8931,
7,
39873,
11,
362,
25,
22,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
4162,
318,
428,
4465,
30,
4362,
262,
4600,
8094,
63,
11688,
3578,
345,
284,
18537,
3815,
198,
220,
220,
220,
1303,
1719,
10411,
5721,
1988,
884,
355,
366,
71,
959,
9282,
1,
656,
257,
384,
1050,
378,
2168,
13,
198,
220,
220,
220,
1303,
3423,
1123,
2168,
318,
530,
1499,
13,
383,
2124,
12,
22704,
3815,
329,
1123,
1499,
318,
262,
198,
220,
220,
220,
1303,
6467,
15225,
739,
262,
4600,
45286,
63,
5721,
198,
220,
220,
220,
32824,
5657,
7,
7890,
13,
45286,
11,
1366,
13,
8367,
11,
1448,
28,
7890,
13,
19315,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
6756,
656,
44189,
1570,
540,
287,
27797,
198,
220,
220,
220,
1303,
47999,
7,
260,
1050,
7,
44,
12789,
7203,
5239,
14,
40664,
12340,
6291,
4008,
198,
437,
198
] | 2.328428 | 2,990 |
mutable struct Rake
stop_words::Vector{String}
min_char_length::Int
max_words_length::Int
min_keyword_frequency::Int
min_words_length_adj::Int
max_words_length_adj::Int
min_phrase_freq_adj::Int
end
struct Score
rank::Float64
frequency::Int
end
function Rake(stop_words; min_char_length=3, max_words_length=3, min_keyword_frequency=10,
min_words_length_adj=1, max_words_length_adj=1, min_phrase_freq_adj=2)
Rake(stop_words, min_char_length, max_words_length, min_keyword_frequency,
min_words_length_adj, max_words_length_adj, min_phrase_freq_adj)
end
import Base.run
function run(self::Rake, text)
# Convert all multiple whitespace to single whitespace
cleaned_text = remove_redundant_whitespace(text)
# Convert to lower case
cleaned_text = lowercase(cleaned_text)
# Split on punctuation
split_on = ['.', '?', '!', '\n', ';', ',', ':', '\u2019', '\u2013']
sentences = split(cleaned_text, split_on)
# Split on stopwords
phrases = split_at_stopwords(sentences, Rake.stop_words)
# Find all possible keywords
all_possible_keyphrases = find_all_possible_keyphrases(phrases)
# Score all possible keywords
keyphrase_with_score = calculate_keyphrase_scores(all_possible_keyphrases)
# Function to compare our (keyword, score) tuples
#tuple_compare(x,y) = x[2].rank > y[2].rank
#sorted_keywords = sort(keyword_candidates, lt=tuple_compare)
return keyphrase_with_score
end
| [
76,
18187,
2878,
371,
539,
198,
220,
220,
220,
2245,
62,
10879,
3712,
38469,
90,
10100,
92,
198,
220,
220,
220,
949,
62,
10641,
62,
13664,
3712,
5317,
198,
220,
220,
220,
3509,
62,
10879,
62,
13664,
3712,
5317,
198,
220,
220,
220,
949,
62,
2539,
4775,
62,
35324,
3712,
5317,
198,
220,
220,
220,
949,
62,
10879,
62,
13664,
62,
41255,
3712,
5317,
198,
220,
220,
220,
3509,
62,
10879,
62,
13664,
62,
41255,
3712,
5317,
198,
220,
220,
220,
949,
62,
34675,
62,
19503,
80,
62,
41255,
3712,
5317,
198,
437,
198,
198,
7249,
15178,
198,
220,
220,
220,
4279,
3712,
43879,
2414,
198,
220,
220,
220,
8373,
3712,
5317,
198,
437,
198,
198,
8818,
371,
539,
7,
11338,
62,
10879,
26,
949,
62,
10641,
62,
13664,
28,
18,
11,
3509,
62,
10879,
62,
13664,
28,
18,
11,
949,
62,
2539,
4775,
62,
35324,
28,
940,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
949,
62,
10879,
62,
13664,
62,
41255,
28,
16,
11,
3509,
62,
10879,
62,
13664,
62,
41255,
28,
16,
11,
949,
62,
34675,
62,
19503,
80,
62,
41255,
28,
17,
8,
198,
220,
220,
220,
371,
539,
7,
11338,
62,
10879,
11,
949,
62,
10641,
62,
13664,
11,
3509,
62,
10879,
62,
13664,
11,
949,
62,
2539,
4775,
62,
35324,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
949,
62,
10879,
62,
13664,
62,
41255,
11,
3509,
62,
10879,
62,
13664,
62,
41255,
11,
949,
62,
34675,
62,
19503,
80,
62,
41255,
8,
198,
437,
198,
198,
11748,
7308,
13,
5143,
198,
198,
8818,
1057,
7,
944,
3712,
49,
539,
11,
2420,
8,
628,
220,
220,
220,
1303,
38240,
477,
3294,
13216,
10223,
284,
2060,
13216,
10223,
198,
220,
220,
220,
20750,
62,
5239,
796,
4781,
62,
445,
917,
415,
62,
1929,
2737,
10223,
7,
5239,
8,
628,
220,
220,
220,
1303,
38240,
284,
2793,
1339,
198,
220,
220,
220,
20750,
62,
5239,
796,
2793,
7442,
7,
2375,
22739,
62,
5239,
8,
628,
220,
220,
220,
1303,
27758,
319,
21025,
2288,
198,
220,
220,
220,
6626,
62,
261,
796,
37250,
2637,
11,
705,
30,
3256,
705,
0,
3256,
705,
59,
77,
3256,
705,
26,
3256,
46083,
3256,
705,
25,
3256,
705,
59,
84,
23344,
3256,
705,
59,
84,
6390,
20520,
198,
220,
220,
220,
13439,
796,
6626,
7,
2375,
22739,
62,
5239,
11,
6626,
62,
261,
8,
628,
220,
220,
220,
1303,
27758,
319,
2245,
10879,
198,
220,
220,
220,
20144,
796,
6626,
62,
265,
62,
11338,
10879,
7,
34086,
3007,
11,
371,
539,
13,
11338,
62,
10879,
8,
628,
220,
220,
220,
1303,
9938,
477,
1744,
26286,
198,
220,
220,
220,
477,
62,
79,
4733,
62,
2539,
746,
81,
1386,
796,
1064,
62,
439,
62,
79,
4733,
62,
2539,
746,
81,
1386,
7,
746,
81,
1386,
8,
628,
220,
220,
220,
1303,
15178,
477,
1744,
26286,
198,
220,
220,
220,
1994,
34675,
62,
4480,
62,
26675,
796,
15284,
62,
2539,
34675,
62,
1416,
2850,
7,
439,
62,
79,
4733,
62,
2539,
746,
81,
1386,
8,
628,
220,
220,
220,
1303,
15553,
284,
8996,
674,
357,
2539,
4775,
11,
4776,
8,
12777,
2374,
198,
220,
220,
220,
1303,
83,
29291,
62,
5589,
533,
7,
87,
11,
88,
8,
796,
2124,
58,
17,
4083,
43027,
1875,
331,
58,
17,
4083,
43027,
198,
220,
220,
220,
1303,
82,
9741,
62,
2539,
10879,
796,
3297,
7,
2539,
4775,
62,
46188,
37051,
11,
300,
83,
28,
83,
29291,
62,
5589,
533,
8,
628,
220,
220,
220,
1441,
1994,
34675,
62,
4480,
62,
26675,
198,
437,
198
] | 2.519263 | 597 |
using CairoMakie, Makie.GeometryBasics
n = 20
function ngonShape(h, k, r, n)
Polygon([Point2f(h .+ r*sin.(m*2π/n),k .+ r*cos.(m*2π/n)) for m in 1:n])
end
polysCentric = [ngonShape(0, 0, 3/i^1.5, i) for i in 3:n]
polysCircular = [ngonShape(√2/2*sin(θ), √2/2*cos(θ), 0.15/√idx, idx + 2)
for (idx, θ) in enumerate(LinRange(0,2π*(1 -1/(n-2)), n-2))]
cmap = to_colormap(:linear_protanopic_deuteranopic_kbw_5_98_c40_n256)[3:end]
with_theme(theme_black()) do
fig, ax, = poly(polysCentric; color = 1:n-2, colormap = cmap,
axis = (;aspect = DataAspect()), figure = (;resolution = (600,400)))
poly!(polysCircular; color = 1:n-2, colormap = cmap)
hidedecorations!(ax; grid = false)
hidespines!(ax)
save("polygons.svg", fig)
display(fig)
end
| [
3500,
23732,
44,
461,
494,
11,
15841,
494,
13,
10082,
15748,
15522,
873,
198,
77,
796,
1160,
198,
8818,
299,
14520,
33383,
7,
71,
11,
479,
11,
374,
11,
299,
8,
198,
220,
220,
220,
12280,
14520,
26933,
12727,
17,
69,
7,
71,
764,
10,
374,
9,
31369,
12195,
76,
9,
17,
46582,
14,
77,
828,
74,
764,
10,
374,
9,
6966,
12195,
76,
9,
17,
46582,
14,
77,
4008,
329,
285,
287,
352,
25,
77,
12962,
198,
437,
198,
35428,
82,
19085,
1173,
796,
685,
782,
261,
33383,
7,
15,
11,
657,
11,
513,
14,
72,
61,
16,
13,
20,
11,
1312,
8,
329,
1312,
287,
513,
25,
77,
60,
198,
35428,
82,
31560,
934,
796,
685,
782,
261,
33383,
7,
24861,
248,
17,
14,
17,
9,
31369,
7,
138,
116,
828,
18872,
248,
17,
14,
17,
9,
6966,
7,
138,
116,
828,
657,
13,
1314,
14,
24861,
248,
312,
87,
11,
4686,
87,
1343,
362,
8,
220,
198,
220,
220,
220,
329,
357,
312,
87,
11,
7377,
116,
8,
287,
27056,
378,
7,
14993,
17257,
7,
15,
11,
17,
46582,
9,
7,
16,
532,
16,
29006,
77,
12,
17,
36911,
299,
12,
17,
4008,
60,
198,
66,
8899,
796,
284,
62,
4033,
579,
499,
7,
25,
29127,
62,
11235,
272,
16603,
62,
2934,
11894,
272,
16603,
62,
32812,
86,
62,
20,
62,
4089,
62,
66,
1821,
62,
77,
11645,
38381,
18,
25,
437,
60,
198,
198,
4480,
62,
43810,
7,
43810,
62,
13424,
28955,
466,
198,
220,
220,
220,
2336,
11,
7877,
11,
796,
7514,
7,
35428,
82,
19085,
1173,
26,
3124,
796,
352,
25,
77,
12,
17,
11,
951,
579,
499,
796,
269,
8899,
11,
198,
220,
220,
220,
220,
220,
220,
220,
16488,
796,
357,
26,
292,
806,
796,
6060,
1722,
806,
3419,
828,
3785,
796,
357,
26,
29268,
796,
357,
8054,
11,
7029,
22305,
198,
220,
220,
220,
7514,
0,
7,
35428,
82,
31560,
934,
26,
3124,
796,
352,
25,
77,
12,
17,
11,
951,
579,
499,
796,
269,
8899,
8,
198,
220,
220,
220,
289,
1384,
721,
273,
602,
0,
7,
897,
26,
10706,
796,
3991,
8,
198,
220,
220,
220,
30768,
79,
1127,
0,
7,
897,
8,
198,
220,
220,
220,
3613,
7203,
35428,
70,
684,
13,
21370,
70,
1600,
2336,
8,
198,
220,
220,
220,
3359,
7,
5647,
8,
198,
437,
198
] | 1.979487 | 390 |
import Dagger: DArray, ArrayDomain, Thunk, chunks, domainchunks
# Domain munging conveniences
struct ChunkDomain
domain::AbstractVector{Int}
chunks::Vector{<:AbstractVector{Int}}
end
ArrayDomain(d::ChunkDomain...) = ArrayDomain(map(d -> d.domain, d)...)
mapcart(f, xs) = f.(xs)
mapcart(f, xs, ys) = f.(xs, reshape(xs, 1, :))
domprod(ds...) = mapcart(tuple, ds...)
chunkinds(i::ChunkDomain...) = domprod(map(i -> i.chunks, i)...)
chunkinds(xs::DArray, dim::Integer) =
map(d -> d.indexes[dim],
domainchunks(xs)[ntuple(i -> i == dim ? (:) : 1 , ndims(xs))...])
domain(xs::DArray, i::Integer) = ChunkDomain(indices(xs, i), chunkinds(xs, i))
# Constructors
DArray{T,N}(dom::NTuple{N,ChunkDomain}, chunks::AbstractArray{<:Any,N}) where {T,N} =
DArray(T, ArrayDomain(dom...), ArrayDomain.(chunkinds(dom...)), chunks)
DArray{T,N}(f, dom::NTuple{N,ChunkDomain}) where {T,N} =
DArray{T,N}(dom, f.(chunkinds(dom...)))
# Views
using Dagger: lookup_parts
function catchunks(chs)
for i = 1:ndims(chs)
chs = mapslices(xs -> [cat(i, xs...)], chs, i)
end
return chs[1]
end
function chslice(xs::DArray, d::ArrayDomain)
subchunks, subdomains = lookup_parts(chunks(xs), domainchunks(xs), d)
chsize = size(subdomains)
subchunks
Thunk(subchunks...) do subchunks...
catchunks(reshape(collect(subchunks), chsize))
end
end
chslice(xs::DArray, i...) = chslice(xs, ArrayDomain(i))
| [
11748,
36320,
25,
360,
19182,
11,
15690,
43961,
11,
536,
2954,
11,
22716,
11,
7386,
354,
14125,
198,
198,
2,
20021,
285,
2150,
278,
7292,
10035,
198,
198,
7249,
609,
2954,
43961,
198,
220,
7386,
3712,
23839,
38469,
90,
5317,
92,
198,
220,
22716,
3712,
38469,
90,
27,
25,
23839,
38469,
90,
5317,
11709,
198,
437,
198,
198,
19182,
43961,
7,
67,
3712,
1925,
2954,
43961,
23029,
796,
15690,
43961,
7,
8899,
7,
67,
4613,
288,
13,
27830,
11,
288,
8,
23029,
198,
198,
8899,
26674,
7,
69,
11,
2124,
82,
8,
796,
277,
12195,
34223,
8,
198,
8899,
26674,
7,
69,
11,
2124,
82,
11,
331,
82,
8,
796,
277,
12195,
34223,
11,
27179,
1758,
7,
34223,
11,
352,
11,
1058,
4008,
198,
3438,
1676,
67,
7,
9310,
23029,
796,
3975,
26674,
7,
83,
29291,
11,
288,
82,
23029,
198,
198,
354,
2954,
521,
82,
7,
72,
3712,
1925,
2954,
43961,
23029,
796,
2401,
1676,
67,
7,
8899,
7,
72,
4613,
1312,
13,
354,
14125,
11,
1312,
8,
23029,
198,
198,
354,
2954,
521,
82,
7,
34223,
3712,
35,
19182,
11,
5391,
3712,
46541,
8,
796,
198,
220,
3975,
7,
67,
4613,
288,
13,
9630,
274,
58,
27740,
4357,
198,
220,
220,
220,
220,
220,
7386,
354,
14125,
7,
34223,
38381,
429,
29291,
7,
72,
4613,
1312,
6624,
5391,
5633,
357,
25,
8,
1058,
352,
837,
299,
67,
12078,
7,
34223,
4008,
986,
12962,
198,
198,
27830,
7,
34223,
3712,
35,
19182,
11,
1312,
3712,
46541,
8,
796,
609,
2954,
43961,
7,
521,
1063,
7,
34223,
11,
1312,
828,
16058,
521,
82,
7,
34223,
11,
1312,
4008,
198,
198,
2,
28407,
669,
198,
198,
35,
19182,
90,
51,
11,
45,
92,
7,
3438,
3712,
11251,
29291,
90,
45,
11,
1925,
2954,
43961,
5512,
22716,
3712,
23839,
19182,
90,
27,
25,
7149,
11,
45,
30072,
810,
1391,
51,
11,
45,
92,
796,
198,
220,
360,
19182,
7,
51,
11,
15690,
43961,
7,
3438,
986,
828,
15690,
43961,
12195,
354,
2954,
521,
82,
7,
3438,
23029,
828,
22716,
8,
198,
198,
35,
19182,
90,
51,
11,
45,
92,
7,
69,
11,
2401,
3712,
11251,
29291,
90,
45,
11,
1925,
2954,
43961,
30072,
810,
1391,
51,
11,
45,
92,
796,
198,
220,
360,
19182,
90,
51,
11,
45,
92,
7,
3438,
11,
277,
12195,
354,
2954,
521,
82,
7,
3438,
986,
22305,
198,
198,
2,
29978,
198,
198,
3500,
36320,
25,
35847,
62,
42632,
198,
198,
8818,
4929,
14125,
7,
354,
82,
8,
198,
220,
329,
1312,
796,
352,
25,
358,
12078,
7,
354,
82,
8,
198,
220,
220,
220,
442,
82,
796,
8739,
677,
274,
7,
34223,
4613,
685,
9246,
7,
72,
11,
2124,
82,
23029,
4357,
442,
82,
11,
1312,
8,
198,
220,
886,
198,
220,
1441,
442,
82,
58,
16,
60,
198,
437,
198,
198,
8818,
442,
48369,
7,
34223,
3712,
35,
19182,
11,
288,
3712,
19182,
43961,
8,
198,
220,
850,
354,
14125,
11,
850,
3438,
1299,
796,
35847,
62,
42632,
7,
354,
14125,
7,
34223,
828,
7386,
354,
14125,
7,
34223,
828,
288,
8,
198,
220,
442,
7857,
796,
2546,
7,
7266,
3438,
1299,
8,
198,
220,
850,
354,
14125,
198,
220,
536,
2954,
7,
7266,
354,
14125,
23029,
466,
850,
354,
14125,
986,
198,
220,
220,
220,
4929,
14125,
7,
3447,
1758,
7,
33327,
7,
7266,
354,
14125,
828,
442,
7857,
4008,
198,
220,
886,
198,
437,
198,
198,
354,
48369,
7,
34223,
3712,
35,
19182,
11,
1312,
23029,
796,
442,
48369,
7,
34223,
11,
15690,
43961,
7,
72,
4008,
198
] | 2.408547 | 585 |
export Catalog
"""
Catalog( data, ssm)
Data type to store analogs and succesors observations
from the Space State model
- [Example Catalog](@ref)
"""
struct Catalog
nt::Int64
nv::Int64
data::Array{Float64,2}
analogs::Array{Float64,2}
successors::Array{Float64,2}
sources::StateSpaceModel
function Catalog(data::Array{Float64,2}, ssm::StateSpaceModel)
nv, nt = size(data)
analogs = data[:, 1:end-ssm.dt_states]
successors = data[:, ssm.dt_states+1:end]
new(nt, nv, data, analogs, successors, ssm)
end
end
| [
39344,
44515,
198,
198,
37811,
198,
220,
220,
220,
44515,
7,
1366,
11,
264,
5796,
8,
198,
198,
6601,
2099,
284,
3650,
15075,
82,
290,
17458,
274,
669,
13050,
198,
6738,
262,
4687,
1812,
2746,
198,
198,
12,
685,
16281,
44515,
16151,
31,
5420,
8,
198,
37811,
198,
7249,
44515,
628,
220,
220,
220,
299,
83,
3712,
5317,
2414,
198,
220,
220,
220,
299,
85,
3712,
5317,
2414,
198,
220,
220,
220,
1366,
3712,
19182,
90,
43879,
2414,
11,
17,
92,
198,
220,
220,
220,
15075,
82,
3712,
19182,
90,
43879,
2414,
11,
17,
92,
198,
220,
220,
220,
41491,
3712,
19182,
90,
43879,
2414,
11,
17,
92,
198,
220,
220,
220,
4237,
3712,
9012,
14106,
17633,
628,
220,
220,
220,
2163,
44515,
7,
7890,
3712,
19182,
90,
43879,
2414,
11,
17,
5512,
264,
5796,
3712,
9012,
14106,
17633,
8,
628,
220,
220,
220,
220,
220,
220,
220,
299,
85,
11,
299,
83,
796,
2546,
7,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
15075,
82,
796,
1366,
58,
45299,
352,
25,
437,
12,
824,
76,
13,
28664,
62,
27219,
60,
198,
220,
220,
220,
220,
220,
220,
220,
41491,
796,
1366,
58,
45299,
264,
5796,
13,
28664,
62,
27219,
10,
16,
25,
437,
60,
628,
220,
220,
220,
220,
220,
220,
220,
649,
7,
429,
11,
299,
85,
11,
1366,
11,
15075,
82,
11,
41491,
11,
264,
5796,
8,
628,
220,
220,
220,
886,
198,
198,
437,
198
] | 2.410788 | 241 |
input = read("2020/data/day_8.txt", String)
test_input = """
nop +0
acc +1
jmp +4
acc +3
jmp -3
acc -99
acc +1
jmp -4
acc +6
"""
mutable struct State
total::Int
index::Int
used_codes::Array{Int,1}
end
function apply_rule!(state::State, rule::AbstractString)
push!(state.used_codes, state.index)
key, str_val = split(rule)
val = parse(Int, str_val)
if key == "nop"
state.index += 1
elseif key == "jmp"
state.index += val
elseif key == "acc"
state.total += val
state.index += 1
end
# @info state
end
function run_program(rules)
state = State(0, 1, [])
for unused in 1:length(rules) # theoretical max iterations
if state.index ∈ state.used_codes
return (state, "ERROR: Infinite Loop")
elseif state.index == length(rules) + 1
return state, "SUCCESS"
else
rule = rules[state.index]
apply_rule!(state, rule)
end
end
end
function part_1(input)
rules = split(strip(input), "\n")
state, exit_code = run_program(rules)
@assert exit_code == "ERROR: Infinite Loop"
state
end
@assert part_1(test_input).total == 5
@info part_1(input)
function part_2(input)
state = State(0, 1, [])
rules = split(strip(input), "\n")
for i in 1:length(rules)
if occursin("nop", rules[i]) | occursin("jmp", rules[i])
new_rules = copy(rules)
if occursin("nop", rules[i])
new_rules[i] = replace(rules[i], "nop" => "jmp")
else
new_rules[i] = replace(rules[i], "jmp" => "nop")
end
state, exit_code = run_program(new_rules)
if exit_code == "SUCCESS"
return state, i
end
end
end
end
@info part_2(input)
| [
15414,
796,
1100,
7203,
42334,
14,
7890,
14,
820,
62,
23,
13,
14116,
1600,
10903,
8,
198,
198,
9288,
62,
15414,
796,
37227,
198,
77,
404,
1343,
15,
198,
4134,
1343,
16,
198,
73,
3149,
1343,
19,
198,
4134,
1343,
18,
198,
73,
3149,
532,
18,
198,
4134,
532,
2079,
198,
4134,
1343,
16,
198,
73,
3149,
532,
19,
198,
4134,
1343,
21,
198,
37811,
198,
198,
76,
18187,
2878,
1812,
198,
220,
220,
220,
2472,
3712,
5317,
198,
220,
220,
220,
6376,
3712,
5317,
198,
220,
220,
220,
973,
62,
40148,
3712,
19182,
90,
5317,
11,
16,
92,
198,
437,
198,
198,
8818,
4174,
62,
25135,
0,
7,
5219,
3712,
9012,
11,
3896,
3712,
23839,
10100,
8,
198,
220,
220,
220,
4574,
0,
7,
5219,
13,
1484,
62,
40148,
11,
1181,
13,
9630,
8,
628,
220,
220,
220,
1994,
11,
965,
62,
2100,
796,
6626,
7,
25135,
8,
198,
220,
220,
220,
1188,
796,
21136,
7,
5317,
11,
965,
62,
2100,
8,
628,
220,
220,
220,
611,
1994,
6624,
366,
77,
404,
1,
198,
220,
220,
220,
220,
220,
220,
220,
1181,
13,
9630,
15853,
352,
198,
220,
220,
220,
2073,
361,
1994,
6624,
366,
73,
3149,
1,
198,
220,
220,
220,
220,
220,
220,
220,
1181,
13,
9630,
15853,
1188,
198,
220,
220,
220,
2073,
361,
1994,
6624,
366,
4134,
1,
198,
220,
220,
220,
220,
220,
220,
220,
1181,
13,
23350,
15853,
1188,
198,
220,
220,
220,
220,
220,
220,
220,
1181,
13,
9630,
15853,
352,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1303,
2488,
10951,
1181,
198,
437,
198,
198,
8818,
1057,
62,
23065,
7,
38785,
8,
198,
220,
220,
220,
1181,
796,
1812,
7,
15,
11,
352,
11,
685,
12962,
198,
220,
220,
220,
329,
21958,
287,
352,
25,
13664,
7,
38785,
8,
220,
1303,
16200,
3509,
34820,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1181,
13,
9630,
18872,
230,
1181,
13,
1484,
62,
40148,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
357,
5219,
11,
366,
24908,
25,
22380,
26304,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
361,
1181,
13,
9630,
6624,
4129,
7,
38785,
8,
1343,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
1181,
11,
366,
12564,
4093,
7597,
1,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3896,
796,
3173,
58,
5219,
13,
9630,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4174,
62,
25135,
0,
7,
5219,
11,
3896,
8,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
437,
198,
198,
8818,
636,
62,
16,
7,
15414,
8,
198,
220,
220,
220,
3173,
796,
6626,
7,
36311,
7,
15414,
828,
37082,
77,
4943,
628,
220,
220,
220,
1181,
11,
8420,
62,
8189,
796,
1057,
62,
23065,
7,
38785,
8,
198,
220,
220,
220,
2488,
30493,
8420,
62,
8189,
6624,
366,
24908,
25,
22380,
26304,
1,
198,
220,
220,
220,
1181,
198,
437,
198,
31,
30493,
636,
62,
16,
7,
9288,
62,
15414,
737,
23350,
6624,
642,
198,
31,
10951,
636,
62,
16,
7,
15414,
8,
198,
198,
8818,
636,
62,
17,
7,
15414,
8,
198,
220,
220,
220,
1181,
796,
1812,
7,
15,
11,
352,
11,
685,
12962,
198,
220,
220,
220,
3173,
796,
6626,
7,
36311,
7,
15414,
828,
37082,
77,
4943,
628,
220,
220,
220,
329,
1312,
287,
352,
25,
13664,
7,
38785,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
8833,
259,
7203,
77,
404,
1600,
3173,
58,
72,
12962,
930,
8833,
259,
7203,
73,
3149,
1600,
3173,
58,
72,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
38785,
796,
4866,
7,
38785,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
8833,
259,
7203,
77,
404,
1600,
3173,
58,
72,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
38785,
58,
72,
60,
796,
6330,
7,
38785,
58,
72,
4357,
366,
77,
404,
1,
5218,
366,
73,
3149,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
38785,
58,
72,
60,
796,
6330,
7,
38785,
58,
72,
4357,
366,
73,
3149,
1,
5218,
366,
77,
404,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1181,
11,
8420,
62,
8189,
796,
1057,
62,
23065,
7,
3605,
62,
38785,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
8420,
62,
8189,
6624,
366,
12564,
4093,
7597,
1,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
1181,
11,
1312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
437,
198,
31,
10951,
636,
62,
17,
7,
15414,
8,
198
] | 2.092997 | 871 |
using PerfChecker
using BenchmarkTools
using PatternFolds
target = PatternFolds
function bench() # 0.2.x
# Intervals
itv = Interval{Open,Closed}(0.0, 1.0)
i = IntervalsFold(itv, 2.0, 1000)
unfold(i)
collect(i)
reverse(collect(i))
# rand(i, 1000)
# Vectors
vf = make_vector_fold([0, 1], 2, 1000)
# @info "Checking VectorFold" vf pattern(vf) gap(vf) folds(vf) length(vf)
unfold(vf)
collect(vf)
reverse(collect(vf))
rand(vf, 1000)
return nothing
end
# function bench() # 0.1.1-0.1.5
# # Intervals
# i = IntervalsFold(Interval((0.0, true), (1.0, false)), 2.0, 1000)
# unfold(i)
# collect(i)
# reverse(collect(i))
# # rand(i, 1000)
# # Vectors
# vf = VectorFold([0, 1], 2, 1000)
# # @info "Checking VectorFold" vf pattern(vf) gap(vf) folds(vf) length(vf)
# unfold(vf)
# collect(vf)
# reverse(collect(vf))
# map(_ -> rand(vf), 1:1000)
# return nothing
# end
t = @benchmark bench() evals = 1 samples = 1000 seconds = 3600
# Actual call to PerfChecker
store_benchmark(t, target; path=@__DIR__)
| [
3500,
2448,
69,
9787,
263,
198,
3500,
25187,
4102,
33637,
198,
198,
3500,
23939,
37,
10119,
198,
198,
16793,
796,
23939,
37,
10119,
198,
198,
8818,
7624,
3419,
1303,
657,
13,
17,
13,
87,
198,
220,
220,
220,
1303,
4225,
12786,
198,
220,
220,
220,
340,
85,
796,
4225,
2100,
90,
11505,
11,
2601,
1335,
92,
7,
15,
13,
15,
11,
352,
13,
15,
8,
198,
220,
220,
220,
1312,
796,
4225,
12786,
37,
727,
7,
270,
85,
11,
362,
13,
15,
11,
8576,
8,
628,
220,
220,
220,
16631,
7,
72,
8,
198,
220,
220,
220,
2824,
7,
72,
8,
198,
220,
220,
220,
9575,
7,
33327,
7,
72,
4008,
628,
220,
220,
220,
1303,
43720,
7,
72,
11,
8576,
8,
628,
220,
220,
220,
1303,
569,
478,
669,
198,
220,
220,
220,
410,
69,
796,
787,
62,
31364,
62,
11379,
26933,
15,
11,
352,
4357,
362,
11,
8576,
8,
198,
220,
220,
220,
1303,
2488,
10951,
366,
9787,
278,
20650,
37,
727,
1,
410,
69,
3912,
7,
85,
69,
8,
7625,
7,
85,
69,
8,
38744,
7,
85,
69,
8,
4129,
7,
85,
69,
8,
628,
220,
220,
220,
16631,
7,
85,
69,
8,
198,
220,
220,
220,
2824,
7,
85,
69,
8,
198,
220,
220,
220,
9575,
7,
33327,
7,
85,
69,
4008,
628,
220,
220,
220,
43720,
7,
85,
69,
11,
8576,
8,
628,
220,
220,
220,
1441,
2147,
198,
437,
198,
198,
2,
2163,
7624,
3419,
1303,
657,
13,
16,
13,
16,
12,
15,
13,
16,
13,
20,
198,
2,
220,
220,
220,
220,
1303,
4225,
12786,
198,
2,
220,
220,
220,
220,
1312,
796,
4225,
12786,
37,
727,
7,
9492,
2100,
19510,
15,
13,
15,
11,
2081,
828,
357,
16,
13,
15,
11,
3991,
36911,
362,
13,
15,
11,
8576,
8,
198,
198,
2,
220,
220,
220,
220,
16631,
7,
72,
8,
198,
2,
220,
220,
220,
220,
2824,
7,
72,
8,
198,
2,
220,
220,
220,
220,
9575,
7,
33327,
7,
72,
4008,
198,
198,
2,
220,
220,
220,
220,
1303,
43720,
7,
72,
11,
8576,
8,
198,
198,
2,
220,
220,
220,
220,
1303,
569,
478,
669,
198,
2,
220,
220,
220,
220,
410,
69,
796,
20650,
37,
727,
26933,
15,
11,
352,
4357,
362,
11,
8576,
8,
198,
2,
220,
220,
220,
220,
1303,
2488,
10951,
366,
9787,
278,
20650,
37,
727,
1,
410,
69,
3912,
7,
85,
69,
8,
7625,
7,
85,
69,
8,
38744,
7,
85,
69,
8,
4129,
7,
85,
69,
8,
198,
198,
2,
220,
220,
220,
220,
16631,
7,
85,
69,
8,
198,
2,
220,
220,
220,
220,
2824,
7,
85,
69,
8,
198,
2,
220,
220,
220,
220,
9575,
7,
33327,
7,
85,
69,
4008,
198,
198,
2,
220,
220,
220,
220,
3975,
28264,
4613,
43720,
7,
85,
69,
828,
352,
25,
12825,
8,
198,
198,
2,
220,
220,
220,
220,
1441,
2147,
198,
2,
886,
198,
198,
83,
796,
2488,
26968,
4102,
7624,
3419,
819,
874,
796,
352,
8405,
796,
8576,
4201,
796,
4570,
405,
198,
198,
2,
33520,
869,
284,
2448,
69,
9787,
263,
198,
8095,
62,
26968,
4102,
7,
83,
11,
2496,
26,
3108,
28,
31,
834,
34720,
834,
8,
198
] | 2.117202 | 529 |
using Base.Test
import ArchGDAL; const AG = ArchGDAL
@testset "Test methods for dataset" begin
AG.registerdrivers() do
AG.read("data/utmsmall.tif") do dataset
AG.createcopy(dataset, "tmp/utmcopy.tif","GTiff") do copydataset
@test AG.ngcp(copydataset) == 0
@test AG.noverview(AG.getband(copydataset,1)) == 0
AG.buildoverviews!(copydataset, Cint[2,4,8])
@test AG.noverview(AG.getband(copydataset,1)) == 3
AG.copywholeraster(dataset, copydataset,
progressfunc=GDAL.C.GDALTermProgress)
end
AG.copyfiles("GTiff", "tmp/utmcopy2.tif", "tmp/utmcopy.tif")
AG.update("tmp/utmcopy2.tif") do copydataset
AG.copywholeraster(dataset, copydataset, ["COMPRESS=LZW"])
end
end
end
rm("tmp/utmcopy.tif")
rm("tmp/utmcopy2.tif")
end
# untested: AG.deletelayer!(copydataset, 0) | [
3500,
7308,
13,
14402,
198,
11748,
5579,
45113,
1847,
26,
1500,
13077,
796,
5579,
45113,
1847,
198,
198,
31,
9288,
2617,
366,
14402,
5050,
329,
27039,
1,
2221,
198,
220,
220,
220,
13077,
13,
30238,
36702,
3419,
466,
198,
220,
220,
220,
220,
220,
220,
220,
13077,
13,
961,
7203,
7890,
14,
315,
907,
76,
439,
13,
49929,
4943,
466,
27039,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13077,
13,
17953,
30073,
7,
19608,
292,
316,
11,
366,
22065,
14,
315,
23209,
11081,
13,
49929,
2430,
19555,
733,
4943,
466,
4866,
19608,
292,
316,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
13077,
13,
782,
13155,
7,
22163,
5173,
265,
292,
316,
8,
6624,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
13077,
13,
77,
2502,
1177,
7,
4760,
13,
1136,
3903,
7,
22163,
5173,
265,
292,
316,
11,
16,
4008,
6624,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13077,
13,
11249,
2502,
33571,
0,
7,
22163,
5173,
265,
292,
316,
11,
327,
600,
58,
17,
11,
19,
11,
23,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
13077,
13,
77,
2502,
1177,
7,
4760,
13,
1136,
3903,
7,
22163,
5173,
265,
292,
316,
11,
16,
4008,
6624,
513,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13077,
13,
30073,
1929,
13625,
1603,
7,
19608,
292,
316,
11,
4866,
19608,
292,
316,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4371,
20786,
28,
45113,
1847,
13,
34,
13,
45113,
31429,
7780,
32577,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13077,
13,
30073,
16624,
7203,
19555,
733,
1600,
366,
22065,
14,
315,
23209,
11081,
17,
13,
49929,
1600,
366,
22065,
14,
315,
23209,
11081,
13,
49929,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13077,
13,
19119,
7203,
22065,
14,
315,
23209,
11081,
17,
13,
49929,
4943,
466,
4866,
19608,
292,
316,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13077,
13,
30073,
1929,
13625,
1603,
7,
19608,
292,
316,
11,
4866,
19608,
292,
316,
11,
14631,
9858,
32761,
28,
43,
57,
54,
8973,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
220,
220,
220,
42721,
7203,
22065,
14,
315,
23209,
11081,
13,
49929,
4943,
198,
220,
220,
220,
42721,
7203,
22065,
14,
315,
23209,
11081,
17,
13,
49929,
4943,
198,
437,
198,
198,
2,
1418,
7287,
25,
13077,
13,
2934,
1616,
417,
2794,
0,
7,
22163,
5173,
265,
292,
316,
11,
657,
8
] | 1.852552 | 529 |
module PkgTemplates
using Dates
using InteractiveUtils
using LibGit2
using Mustache
using Pkg
using REPL.TerminalMenus
using URIParser
export
# Template/package generation.
Template,
generate,
interactive_template,
generate_interactive,
# Licenses.
show_license,
available_licenses,
# Plugins.
GitHubPages,
GitLabPages,
AppVeyor,
TravisCI,
GitLabCI,
CirrusCI,
Codecov,
Coveralls,
Citation
"""
A plugin to be added to a [`Template`](@ref), which adds some functionality or integration.
New plugins should almost always extend [`GenericPlugin`](@ref) or [`CustomPlugin`](@ref).
"""
abstract type Plugin end
include("licenses.jl")
include("template.jl")
include("generate.jl")
include("plugin.jl")
include(joinpath("plugins", "documenter.jl"))
include(joinpath("plugins", "coveralls.jl"))
include(joinpath("plugins", "appveyor.jl"))
include(joinpath("plugins", "codecov.jl"))
include(joinpath("plugins", "travisci.jl"))
include(joinpath("plugins", "gitlabci.jl"))
include(joinpath("plugins", "cirrusci.jl"))
include(joinpath("plugins", "githubpages.jl"))
include(joinpath("plugins", "gitlabpages.jl"))
include(joinpath("plugins", "citation.jl"))
const DEFAULTS_DIR = normpath(joinpath(@__DIR__, "..", "defaults"))
const BADGE_ORDER = [GitHubPages, GitLabPages, TravisCI, AppVeyor, GitLabCI, Codecov, Coveralls]
end
| [
21412,
350,
10025,
12966,
17041,
198,
198,
3500,
44712,
198,
3500,
21365,
18274,
4487,
198,
3500,
7980,
38,
270,
17,
198,
3500,
12039,
4891,
198,
3500,
350,
10025,
198,
3500,
45285,
13,
44798,
282,
10418,
385,
198,
3500,
471,
32618,
28198,
198,
198,
39344,
198,
220,
220,
220,
1303,
37350,
14,
26495,
5270,
13,
198,
220,
220,
220,
37350,
11,
198,
220,
220,
220,
7716,
11,
198,
220,
220,
220,
14333,
62,
28243,
11,
198,
220,
220,
220,
7716,
62,
3849,
5275,
11,
198,
220,
220,
220,
1303,
10483,
4541,
13,
198,
220,
220,
220,
905,
62,
43085,
11,
198,
220,
220,
220,
1695,
62,
677,
4541,
11,
198,
220,
220,
220,
1303,
22689,
1040,
13,
198,
220,
220,
220,
21722,
47798,
11,
198,
220,
220,
220,
15151,
17822,
47798,
11,
198,
220,
220,
220,
2034,
53,
2959,
273,
11,
198,
220,
220,
220,
19804,
25690,
11,
198,
220,
220,
220,
15151,
17822,
25690,
11,
198,
220,
220,
220,
21239,
14932,
25690,
11,
198,
220,
220,
220,
39298,
709,
11,
198,
220,
220,
220,
17546,
5691,
11,
198,
220,
220,
220,
42317,
198,
198,
37811,
198,
32,
13877,
284,
307,
2087,
284,
257,
685,
63,
30800,
63,
16151,
31,
5420,
828,
543,
6673,
617,
11244,
393,
11812,
13,
198,
3791,
20652,
815,
2048,
1464,
9117,
685,
63,
46189,
37233,
63,
16151,
31,
5420,
8,
393,
685,
63,
15022,
37233,
63,
16151,
31,
5420,
737,
198,
37811,
198,
397,
8709,
2099,
42636,
886,
198,
198,
17256,
7203,
677,
4541,
13,
20362,
4943,
198,
17256,
7203,
28243,
13,
20362,
4943,
198,
17256,
7203,
8612,
378,
13,
20362,
4943,
198,
17256,
7203,
33803,
13,
20362,
4943,
198,
17256,
7,
22179,
6978,
7203,
37390,
1600,
366,
22897,
263,
13,
20362,
48774,
198,
17256,
7,
22179,
6978,
7203,
37390,
1600,
366,
9631,
5691,
13,
20362,
48774,
198,
17256,
7,
22179,
6978,
7203,
37390,
1600,
366,
1324,
3304,
273,
13,
20362,
48774,
198,
17256,
7,
22179,
6978,
7203,
37390,
1600,
366,
19815,
721,
709,
13,
20362,
48774,
198,
17256,
7,
22179,
6978,
7203,
37390,
1600,
366,
83,
16956,
979,
13,
20362,
48774,
198,
17256,
7,
22179,
6978,
7203,
37390,
1600,
366,
18300,
23912,
979,
13,
20362,
48774,
198,
17256,
7,
22179,
6978,
7203,
37390,
1600,
366,
66,
343,
14932,
979,
13,
20362,
48774,
198,
17256,
7,
22179,
6978,
7203,
37390,
1600,
366,
12567,
31126,
13,
20362,
48774,
198,
17256,
7,
22179,
6978,
7203,
37390,
1600,
366,
18300,
23912,
31126,
13,
20362,
48774,
198,
17256,
7,
22179,
6978,
7203,
37390,
1600,
366,
66,
3780,
13,
20362,
48774,
198,
198,
9979,
5550,
7708,
35342,
62,
34720,
796,
2593,
6978,
7,
22179,
6978,
7,
31,
834,
34720,
834,
11,
366,
492,
1600,
366,
12286,
82,
48774,
198,
9979,
33934,
8264,
62,
12532,
1137,
796,
685,
38,
270,
16066,
47798,
11,
15151,
17822,
47798,
11,
19804,
25690,
11,
2034,
53,
2959,
273,
11,
15151,
17822,
25690,
11,
39298,
709,
11,
17546,
5691,
60,
198,
198,
437,
198
] | 2.854209 | 487 |
include("boundconstraint_enum.jl")
include("misc.jl")
include("abstract_bc_quadsolver_conf.jl")
include("abstract_bc_quadsolver_result.jl")
include("bc_quadsolver_interface.jl")
include("Kunisch-Rendl.jl")
| [
17256,
7203,
7784,
1102,
2536,
2913,
62,
44709,
13,
20362,
4943,
198,
17256,
7203,
44374,
13,
20362,
4943,
198,
198,
17256,
7203,
397,
8709,
62,
15630,
62,
421,
5643,
14375,
62,
10414,
13,
20362,
4943,
198,
17256,
7203,
397,
8709,
62,
15630,
62,
421,
5643,
14375,
62,
20274,
13,
20362,
4943,
198,
17256,
7203,
15630,
62,
421,
5643,
14375,
62,
39994,
13,
20362,
4943,
198,
198,
17256,
7203,
42,
403,
25308,
12,
49,
437,
75,
13,
20362,
4943,
628
] | 2.64557 | 79 |
using OCToolbox
using LinearAlgebra
using QuantumInformation
i2 = Matrix{Complex{Float64}}(I, 2, 2)
# we define our initial and final states
Ψ = [1+0.0im, 0.0]
ρ = [0+0.0im, 1.0]
N_ensemble = 10
ΔRange = 10 * 2π
H_drift = collect(range(-ΔRange, ΔRange, length = N_ensemble)) .* [sz]
H_ctrl = [π * sx, π * sy]
# we set up a functional for a robust pulse
function fn(controls)
controls = complex.(real.(controls))
err = 0
for i = 1:N_ensemble
U = pw_full_evolution(H_drift[i], H_ctrl, controls, Δt, i2)
err += C2(ρ, U * Ψ)
end
err
end
K = 2
N = 20
T = 10
Δt = T/N
control_guess = rand(K, N).*0.001
fn(control_guess)
using Zygote
Zygote.gradient(fn, control_guess)
o = GRAPE(fn, control_guess, K, N)
fn(o.minimizer)
| [
3500,
42256,
970,
3524,
198,
198,
3500,
44800,
2348,
29230,
198,
3500,
29082,
21918,
198,
198,
72,
17,
796,
24936,
90,
5377,
11141,
90,
43879,
2414,
11709,
7,
40,
11,
362,
11,
362,
8,
198,
198,
2,
356,
8160,
674,
4238,
290,
2457,
2585,
198,
138,
101,
796,
685,
16,
10,
15,
13,
15,
320,
11,
657,
13,
15,
60,
198,
33643,
796,
685,
15,
10,
15,
13,
15,
320,
11,
352,
13,
15,
60,
198,
198,
45,
62,
1072,
11306,
796,
838,
198,
138,
242,
17257,
796,
838,
220,
1635,
362,
46582,
198,
39,
62,
7109,
2135,
796,
2824,
7,
9521,
32590,
138,
242,
17257,
11,
37455,
17257,
11,
4129,
796,
399,
62,
1072,
11306,
4008,
764,
9,
685,
82,
89,
60,
198,
39,
62,
44755,
796,
685,
46582,
1635,
264,
87,
11,
18074,
222,
1635,
827,
60,
198,
198,
2,
356,
900,
510,
257,
10345,
329,
257,
12373,
19445,
198,
8818,
24714,
7,
13716,
82,
8,
198,
220,
220,
220,
6973,
796,
3716,
12195,
5305,
12195,
13716,
82,
4008,
198,
220,
220,
220,
11454,
796,
657,
198,
220,
220,
220,
329,
1312,
796,
352,
25,
45,
62,
1072,
11306,
198,
220,
220,
220,
220,
220,
220,
220,
471,
796,
279,
86,
62,
12853,
62,
1990,
2122,
7,
39,
62,
7109,
2135,
58,
72,
4357,
367,
62,
44755,
11,
6973,
11,
37455,
83,
11,
1312,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
11454,
15853,
327,
17,
7,
33643,
11,
471,
1635,
7377,
101,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
11454,
198,
437,
198,
198,
42,
796,
362,
198,
45,
796,
1160,
198,
51,
796,
838,
198,
138,
242,
83,
796,
309,
14,
45,
198,
198,
13716,
62,
5162,
408,
796,
43720,
7,
42,
11,
399,
737,
9,
15,
13,
8298,
198,
22184,
7,
13716,
62,
5162,
408,
8,
198,
198,
3500,
1168,
35641,
1258,
198,
57,
35641,
1258,
13,
49607,
7,
22184,
11,
1630,
62,
5162,
408,
8,
198,
198,
78,
796,
10863,
45721,
7,
22184,
11,
1630,
62,
5162,
408,
11,
509,
11,
399,
8,
198,
198,
22184,
7,
78,
13,
1084,
320,
7509,
8,
198
] | 2.140845 | 355 |
module CcallMacros
export @ccall, @cdef, @disable_sigint, @nonzero_systemerror
"""
`calltoccall` is an implementation detail of @ccall and @cdef
takes and expression like :(printf("%d"::Cstring, value::Cuint)::Cvoid)
returns: a tuple of (function_name, return_type, arg_types, args
The above input outputs this:
(:printf, :Cvoid, :((Cstring, Cuint)), ["%d", :value])
Note that the args are in an array, not a quote block and have to be
appended to the ccall in a separate step.
"""
function calltoccall(expr)
expr.head != :(::) &&
error("@ccall needs a function signature with a return type")
rettype = expr.args[2]
call = expr.args[1]
call.head != :call &&
error("@ccall has to be a function call")
if (f = call.args[1]) isa Expr
lib = f.args[1]
fname = f.args[2]
func = :(($fname, $lib))
else
func = QuoteNode(f)
end
argtypes = :(())
args = []
for arg in call.args[2:end]
varargs = false
if arg.head == :...
varargs = true
arg = arg.args[1]
end
arg.head != :(::) &&
error("args in @ccall must be annotated")
value = arg.args[1]
type_ = arg.args[2]
# This currently doesn't work.
if varargs
value = :($value...)
type_ = :($type_...)
end
push!(args, value)
push!(argtypes.args, type_)
end
func, rettype, argtypes, args
end
"""
convert a julia-style function definition to a ccall:
`@ccall printf("%d"::Cstring, 10::Cint)::Cvoid`
same as:
`ccall(:printf, Cvoid, (Cstring, Cint), "%d", 10)`
"""
macro ccall(expr)
func, rettype, argtypes, args = calltoccall(expr)
output = :(ccall($func, $rettype, $argtypes))
append!(output.args, args)
esc(output)
end
"""
define a _very_ thin wrapper function on a ccall. Mostly for wrapping
libraries quickly as a foundation for a higher-level interface.
@cdef mkfifo(path::Cstring, mode::Cuint)::Cint
becomes:
mkfifo(path, mode) = ccall(:mkfifo, Cint, (Cstring, Cuint), path, mode)
"""
macro cdef(expr)
func, rettype, argtypes, args = calltoccall(expr)
call = :(ccall($func, $rettype, $argtypes))
append!(call.args, args)
name = func isa QuoteNode ? func.value : func.args[1].value
definition = :($name())
append!(definition.args, args)
esc(:($definition = $call))
end
"""
disable SIGINT while expr is being executed. Mostly useful for calling
C functions that call back into Julia in a concurrent context because
memory corruption can occur and crash the whole program.
"""
macro disable_sigint(expr)
out = quote
disable_sigint() do
$expr
end
end
esc(out)
end
const comment = r"#=.*?=# "
"""
throw a system error if the expression returns a non-zero exit status.
"""
macro nonzero_systemerror(expr)
str = replace(string(expr), comment => "")
out = quote
err = $expr
systemerror($str, err != 0)
err
end
esc(out)
end
end # module
| [
21412,
327,
13345,
14155,
4951,
198,
39344,
2488,
535,
439,
11,
2488,
66,
4299,
11,
2488,
40223,
62,
82,
328,
600,
11,
2488,
13159,
22570,
62,
10057,
18224,
198,
198,
37811,
198,
63,
13345,
40301,
13345,
63,
318,
281,
7822,
3703,
286,
2488,
535,
439,
290,
2488,
66,
4299,
198,
198,
83,
1124,
290,
5408,
588,
36147,
37435,
7203,
4,
67,
1298,
25,
34,
8841,
11,
1988,
3712,
34,
28611,
2599,
25,
34,
19382,
8,
198,
7783,
82,
25,
257,
46545,
286,
357,
8818,
62,
3672,
11,
1441,
62,
4906,
11,
1822,
62,
19199,
11,
26498,
198,
198,
464,
2029,
5128,
23862,
428,
25,
198,
7,
25,
37435,
11,
1058,
34,
19382,
11,
1058,
19510,
34,
8841,
11,
14496,
600,
36911,
14631,
4,
67,
1600,
1058,
8367,
12962,
198,
198,
6425,
326,
262,
26498,
389,
287,
281,
7177,
11,
407,
257,
9577,
2512,
290,
423,
284,
307,
198,
1324,
1631,
284,
262,
269,
13345,
287,
257,
4553,
2239,
13,
198,
37811,
198,
8818,
869,
40301,
13345,
7,
31937,
8,
198,
220,
220,
220,
44052,
13,
2256,
14512,
36147,
3712,
8,
11405,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
7203,
31,
535,
439,
2476,
257,
2163,
9877,
351,
257,
1441,
2099,
4943,
198,
220,
220,
220,
1005,
4906,
796,
44052,
13,
22046,
58,
17,
60,
628,
220,
220,
220,
869,
796,
44052,
13,
22046,
58,
16,
60,
198,
220,
220,
220,
869,
13,
2256,
14512,
1058,
13345,
11405,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
7203,
31,
535,
439,
468,
284,
307,
257,
2163,
869,
4943,
628,
220,
220,
220,
611,
357,
69,
796,
869,
13,
22046,
58,
16,
12962,
318,
64,
1475,
1050,
198,
220,
220,
220,
220,
220,
220,
220,
9195,
796,
277,
13,
22046,
58,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
277,
3672,
796,
277,
13,
22046,
58,
17,
60,
198,
220,
220,
220,
220,
220,
220,
220,
25439,
796,
36147,
16763,
69,
3672,
11,
720,
8019,
4008,
198,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
25439,
796,
19879,
19667,
7,
69,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1822,
19199,
796,
36147,
28955,
198,
220,
220,
220,
26498,
796,
17635,
198,
220,
220,
220,
329,
1822,
287,
869,
13,
22046,
58,
17,
25,
437,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1401,
22046,
796,
3991,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1822,
13,
2256,
6624,
1058,
986,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1401,
22046,
796,
2081,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1822,
796,
1822,
13,
22046,
58,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
886,
628,
220,
220,
220,
220,
220,
220,
220,
1822,
13,
2256,
14512,
36147,
3712,
8,
11405,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4049,
7203,
22046,
287,
2488,
535,
439,
1276,
307,
24708,
515,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
796,
1822,
13,
22046,
58,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
796,
1822,
13,
22046,
58,
17,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
770,
3058,
1595,
470,
670,
13,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1401,
22046,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1988,
796,
1058,
16763,
8367,
23029,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
796,
1058,
16763,
4906,
62,
23029,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
4574,
0,
7,
22046,
11,
1988,
8,
198,
220,
220,
220,
220,
220,
220,
220,
4574,
0,
7,
853,
19199,
13,
22046,
11,
2099,
62,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
25439,
11,
1005,
4906,
11,
1822,
19199,
11,
26498,
198,
437,
198,
198,
37811,
198,
1102,
1851,
257,
474,
43640,
12,
7635,
2163,
6770,
284,
257,
269,
13345,
25,
198,
198,
63,
31,
535,
439,
30812,
7203,
4,
67,
1298,
25,
34,
8841,
11,
838,
3712,
34,
600,
2599,
25,
34,
19382,
63,
198,
198,
31642,
355,
25,
198,
198,
63,
535,
439,
7,
25,
37435,
11,
327,
19382,
11,
357,
34,
8841,
11,
327,
600,
828,
36521,
67,
1600,
838,
8,
63,
198,
37811,
198,
20285,
305,
269,
13345,
7,
31937,
8,
198,
220,
220,
220,
25439,
11,
1005,
4906,
11,
1822,
19199,
11,
26498,
796,
869,
40301,
13345,
7,
31937,
8,
198,
220,
220,
220,
5072,
796,
36147,
535,
439,
16763,
20786,
11,
720,
1186,
4906,
11,
720,
853,
19199,
4008,
198,
220,
220,
220,
24443,
0,
7,
22915,
13,
22046,
11,
26498,
8,
198,
220,
220,
220,
3671,
7,
22915,
8,
198,
437,
198,
198,
37811,
198,
13086,
257,
4808,
548,
62,
7888,
29908,
2163,
319,
257,
269,
13345,
13,
33495,
329,
27074,
198,
75,
11127,
2952,
355,
257,
8489,
329,
257,
2440,
12,
5715,
7071,
13,
198,
198,
31,
66,
4299,
33480,
32041,
78,
7,
6978,
3712,
34,
8841,
11,
4235,
3712,
34,
28611,
2599,
25,
34,
600,
198,
198,
9423,
2586,
25,
198,
198,
28015,
32041,
78,
7,
6978,
11,
4235,
8,
796,
269,
13345,
7,
25,
28015,
32041,
78,
11,
327,
600,
11,
357,
34,
8841,
11,
14496,
600,
828,
3108,
11,
4235,
8,
198,
37811,
198,
20285,
305,
269,
4299,
7,
31937,
8,
198,
220,
220,
220,
25439,
11,
1005,
4906,
11,
1822,
19199,
11,
26498,
796,
869,
40301,
13345,
7,
31937,
8,
198,
220,
220,
220,
869,
796,
36147,
535,
439,
16763,
20786,
11,
720,
1186,
4906,
11,
720,
853,
19199,
4008,
198,
220,
220,
220,
24443,
0,
7,
13345,
13,
22046,
11,
26498,
8,
198,
220,
220,
220,
1438,
796,
25439,
318,
64,
19879,
19667,
5633,
25439,
13,
8367,
1058,
25439,
13,
22046,
58,
16,
4083,
8367,
198,
220,
220,
220,
6770,
796,
1058,
16763,
3672,
28955,
198,
220,
220,
220,
24443,
0,
7,
46758,
13,
22046,
11,
26498,
8,
198,
220,
220,
220,
3671,
7,
25,
16763,
46758,
796,
720,
13345,
4008,
198,
437,
198,
198,
37811,
198,
40223,
33993,
12394,
981,
44052,
318,
852,
10945,
13,
33495,
4465,
329,
4585,
198,
34,
5499,
326,
869,
736,
656,
22300,
287,
257,
24580,
4732,
780,
198,
31673,
9253,
460,
3051,
290,
7014,
262,
2187,
1430,
13,
198,
37811,
198,
20285,
305,
15560,
62,
82,
328,
600,
7,
31937,
8,
198,
220,
220,
220,
503,
796,
9577,
198,
220,
220,
220,
220,
220,
220,
220,
15560,
62,
82,
328,
600,
3419,
466,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
720,
31937,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
220,
220,
220,
3671,
7,
448,
8,
198,
437,
198,
198,
9979,
2912,
796,
374,
1,
2,
28,
15885,
30,
46249,
366,
198,
198,
37811,
198,
16939,
257,
1080,
4049,
611,
262,
5408,
5860,
257,
1729,
12,
22570,
8420,
3722,
13,
198,
37811,
198,
20285,
305,
1729,
22570,
62,
10057,
18224,
7,
31937,
8,
198,
220,
220,
220,
965,
796,
6330,
7,
8841,
7,
31937,
828,
2912,
5218,
366,
4943,
198,
220,
220,
220,
503,
796,
9577,
198,
220,
220,
220,
220,
220,
220,
220,
11454,
796,
720,
31937,
198,
220,
220,
220,
220,
220,
220,
220,
1080,
18224,
16763,
2536,
11,
11454,
14512,
657,
8,
198,
220,
220,
220,
220,
220,
220,
220,
11454,
198,
220,
220,
220,
886,
198,
220,
220,
220,
3671,
7,
448,
8,
198,
437,
198,
198,
437,
1303,
8265,
198
] | 2.420635 | 1,260 |
__precompile__(false)
module Buildkite
import HTTP
import JSON
export BuildkiteAPI
abstract type AbstractBuildkiteAPI end
Base.@kwdef struct BuildkiteAPI <: AbstractBuildkiteAPI
base_url::HTTP.URI = HTTP.URI("https://api.buildkite.com/v2/")
access_token::String = ""
end
function buildkite_api_uri(api::BuildkiteAPI, path)
HTTP.URIs.merge(api.base_url, path = api.base_url.path * path)
end
function buildkite_request(api::BuildkiteAPI, request_method, endpoint;
handle_error = true,
headers = Dict(),
params = Dict(),
allowredirects::Bool = true,
idle_timeout = 20,
status_exception = false)
api_endpoint = buildkite_api_uri(api, endpoint)
request_headers = convert(Dict{String, String}, headers)
if !haskey(request_headers, "Authorization")
request_headers["Authorization"] = "Bearer $(api.access_token)"
end
if !haskey(request_headers, "User-Agent")
request_headers["User-Agent"] = "Buildkite-jl"
end
if request_method == HTTP.get
api_uri = HTTP.URIs.merge(api_endpoint, query = params)
println("DEBUG: ", api_uri)
r = request_method(api_uri, request_headers,
redirect = allowredirects, status_exception = false, idle_timeout=idle_timeout)
else
api_uri = string(api_uri)
r = request_method(api_uri, request_headers, JSON.json(params),
redirect=allowredirects,
status_exception=status_exception,
idle_timeout=idle_timeout)
end
if handle_error
#handle_response_error(r)
end
return r
end
# REST primitives
function buildkite_get(api::BuildkiteAPI, endpoint = ""; options...)
buildkite_request(api, HTTP.get, endpoint; options...)
end
function buildkite_post(api::BuildkiteAPI, endpoint = ""; options...)
buildkite_request(api, HTTP.post, endpoint; options...)
end
function buildkite_put(api::BuildkiteAPI, endpoint = ""; options...)
buildkite_request(api, HTTP.put, endpoint; options...)
end
function buildkite_delete(api::BuildkiteAPI, endpoint = ""; options...)
buildkite_request(api, HTTP.delete, endpoint; options...)
end
function buildkite_patch(api::BuildkiteAPI, endpoint = ""; options...)
buildkite_request(api, HTTP.patch, endpoint; options...)
end
function buildkite_get_json(api::BuildkiteAPI, endpoint = ""; options...)
JSON.parse(HTTP.payload(buildkite_get(api, endpoint; options...), String))
end
function buildkite_post_json(api::BuildkiteAPI, endpoint = ""; options...)
JSON.parse(HTTP.payload(buildkite_post(api, endpoint; options...), String))
end
function buildkite_put_json(api::BuildkiteAPI, endpoint = ""; options...)
JSON.parse(HTTP.payload(buildkite_put(api, endpoint; options...), String))
end
function buildkite_delete_json(api::BuildkiteAPI, endpoint = ""; options...)
JSON.parse(HTTP.payload(buildkite_delete(api, endpoint; options...), String))
end
function buildkite_patch_json(api::BuildkiteAPI, endpoint = ""; options...)
JSON.parse(HTTP.payload(buildkite_patch(api, endpoint; options...), String))
end
function hello_world()
base_url = HTTP.URI("https://api.buildkite.com")
r = buildkite_get_json(BuildkiteAPI(base_url=base_url), "")
return r["response"]
end
# organization api
struct Organization
api::BuildkiteAPI
data::Dict
end
function organization(api::BuildkiteAPI, name)
return Organization(api, buildkite_get_json(api, "organizations/$(lowercase(name))"))
end
# pipelines api
struct Pipeline
api::BuildkiteAPI
data::Dict
end
function pipelines(api::BuildkiteAPI, organization; page=0, pagination=false)
query_params = Dict("page" => page)
endpoint = "organizations/$(lowercase(organization))/pipelines"
return [Pipeline(api, p) for p in buildkite_get_json(api, endpoint; params = query_params)]
end
function pipelines(org::Buildkite.Organization)
return pipelines(org.api, org.data["name"])
end
# build api
struct Build
api::BuildkiteAPI
data::Dict
end
function builds(api::BuildkiteAPI; state=nothing)
query_params = Dict("state" => state)
endpoint = "builds"
return [Build(api, b) for b in buildkite_get_json(api, endpoint; params = query_params)]
end
build_state(b::Build) = b.data["state"]
end
| [
834,
3866,
5589,
576,
834,
7,
9562,
8,
198,
198,
21412,
10934,
74,
578,
198,
198,
11748,
14626,
198,
11748,
19449,
198,
198,
39344,
10934,
74,
578,
17614,
198,
198,
397,
8709,
2099,
27741,
15580,
74,
578,
17614,
886,
198,
198,
14881,
13,
31,
46265,
4299,
2878,
10934,
74,
578,
17614,
1279,
25,
27741,
15580,
74,
578,
17614,
198,
220,
220,
220,
2779,
62,
6371,
3712,
40717,
13,
47269,
796,
14626,
13,
47269,
7203,
5450,
1378,
15042,
13,
11249,
74,
578,
13,
785,
14,
85,
17,
14,
4943,
198,
220,
220,
220,
1895,
62,
30001,
3712,
10100,
796,
13538,
198,
437,
198,
198,
8818,
1382,
74,
578,
62,
15042,
62,
9900,
7,
15042,
3712,
15580,
74,
578,
17614,
11,
3108,
8,
198,
220,
220,
220,
14626,
13,
4261,
3792,
13,
647,
469,
7,
15042,
13,
8692,
62,
6371,
11,
3108,
796,
40391,
13,
8692,
62,
6371,
13,
6978,
1635,
3108,
8,
220,
198,
437,
198,
198,
8818,
1382,
74,
578,
62,
25927,
7,
15042,
3712,
15580,
74,
578,
17614,
11,
2581,
62,
24396,
11,
36123,
26,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5412,
62,
18224,
796,
2081,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24697,
796,
360,
713,
22784,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42287,
796,
360,
713,
22784,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1249,
445,
1060,
82,
3712,
33,
970,
796,
2081,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21696,
62,
48678,
796,
1160,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3722,
62,
1069,
4516,
796,
3991,
8,
198,
220,
220,
220,
40391,
62,
437,
4122,
796,
1382,
74,
578,
62,
15042,
62,
9900,
7,
15042,
11,
36123,
8,
198,
220,
220,
220,
2581,
62,
50145,
796,
10385,
7,
35,
713,
90,
10100,
11,
10903,
5512,
24697,
8,
198,
220,
220,
220,
611,
5145,
10134,
2539,
7,
25927,
62,
50145,
11,
366,
13838,
1634,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
2581,
62,
50145,
14692,
13838,
1634,
8973,
796,
366,
3856,
11258,
29568,
15042,
13,
15526,
62,
30001,
16725,
198,
220,
220,
220,
886,
198,
220,
220,
220,
611,
5145,
10134,
2539,
7,
25927,
62,
50145,
11,
366,
12982,
12,
36772,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
2581,
62,
50145,
14692,
12982,
12,
36772,
8973,
796,
366,
15580,
74,
578,
12,
20362,
1,
198,
220,
220,
220,
886,
198,
220,
220,
220,
611,
2581,
62,
24396,
6624,
14626,
13,
1136,
198,
220,
220,
220,
220,
220,
220,
220,
40391,
62,
9900,
796,
14626,
13,
4261,
3792,
13,
647,
469,
7,
15042,
62,
437,
4122,
11,
12405,
796,
42287,
8,
198,
220,
220,
220,
220,
220,
220,
220,
44872,
7203,
30531,
25,
33172,
40391,
62,
9900,
8,
198,
220,
220,
220,
220,
220,
220,
220,
374,
796,
2581,
62,
24396,
7,
15042,
62,
9900,
11,
2581,
62,
50145,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18941,
796,
1249,
445,
1060,
82,
11,
3722,
62,
1069,
4516,
796,
3991,
11,
21696,
62,
48678,
28,
312,
293,
62,
48678,
8,
198,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
40391,
62,
9900,
796,
4731,
7,
15042,
62,
9900,
8,
198,
220,
220,
220,
220,
220,
220,
220,
374,
796,
2581,
62,
24396,
7,
15042,
62,
9900,
11,
2581,
62,
50145,
11,
19449,
13,
17752,
7,
37266,
828,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18941,
28,
12154,
445,
1060,
82,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3722,
62,
1069,
4516,
28,
13376,
62,
1069,
4516,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21696,
62,
48678,
28,
312,
293,
62,
48678,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
611,
5412,
62,
18224,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
28144,
62,
26209,
62,
18224,
7,
81,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1441,
374,
198,
437,
198,
198,
2,
30617,
2684,
20288,
198,
198,
8818,
1382,
74,
578,
62,
1136,
7,
15042,
3712,
15580,
74,
578,
17614,
11,
36123,
796,
366,
8172,
3689,
23029,
198,
220,
220,
220,
1382,
74,
578,
62,
25927,
7,
15042,
11,
14626,
13,
1136,
11,
36123,
26,
3689,
23029,
198,
437,
198,
198,
8818,
1382,
74,
578,
62,
7353,
7,
15042,
3712,
15580,
74,
578,
17614,
11,
36123,
796,
366,
8172,
3689,
23029,
198,
220,
220,
220,
1382,
74,
578,
62,
25927,
7,
15042,
11,
14626,
13,
7353,
11,
36123,
26,
3689,
23029,
198,
437,
198,
198,
8818,
1382,
74,
578,
62,
1996,
7,
15042,
3712,
15580,
74,
578,
17614,
11,
36123,
796,
366,
8172,
3689,
23029,
198,
220,
220,
220,
1382,
74,
578,
62,
25927,
7,
15042,
11,
14626,
13,
1996,
11,
36123,
26,
3689,
23029,
198,
437,
198,
198,
8818,
1382,
74,
578,
62,
33678,
7,
15042,
3712,
15580,
74,
578,
17614,
11,
36123,
796,
366,
8172,
3689,
23029,
198,
220,
220,
220,
1382,
74,
578,
62,
25927,
7,
15042,
11,
14626,
13,
33678,
11,
36123,
26,
3689,
23029,
198,
437,
198,
198,
8818,
1382,
74,
578,
62,
17147,
7,
15042,
3712,
15580,
74,
578,
17614,
11,
36123,
796,
366,
8172,
3689,
23029,
198,
220,
220,
220,
1382,
74,
578,
62,
25927,
7,
15042,
11,
14626,
13,
17147,
11,
36123,
26,
3689,
23029,
198,
437,
198,
198,
8818,
1382,
74,
578,
62,
1136,
62,
17752,
7,
15042,
3712,
15580,
74,
578,
17614,
11,
36123,
796,
366,
8172,
3689,
23029,
220,
198,
220,
220,
220,
19449,
13,
29572,
7,
40717,
13,
15577,
2220,
7,
11249,
74,
578,
62,
1136,
7,
15042,
11,
36123,
26,
3689,
986,
828,
10903,
4008,
198,
437,
198,
198,
8818,
1382,
74,
578,
62,
7353,
62,
17752,
7,
15042,
3712,
15580,
74,
578,
17614,
11,
36123,
796,
366,
8172,
3689,
23029,
198,
220,
220,
220,
19449,
13,
29572,
7,
40717,
13,
15577,
2220,
7,
11249,
74,
578,
62,
7353,
7,
15042,
11,
36123,
26,
3689,
986,
828,
10903,
4008,
198,
437,
198,
198,
8818,
1382,
74,
578,
62,
1996,
62,
17752,
7,
15042,
3712,
15580,
74,
578,
17614,
11,
36123,
796,
366,
8172,
3689,
23029,
198,
220,
220,
220,
19449,
13,
29572,
7,
40717,
13,
15577,
2220,
7,
11249,
74,
578,
62,
1996,
7,
15042,
11,
36123,
26,
3689,
986,
828,
10903,
4008,
198,
437,
198,
198,
8818,
1382,
74,
578,
62,
33678,
62,
17752,
7,
15042,
3712,
15580,
74,
578,
17614,
11,
36123,
796,
366,
8172,
3689,
23029,
198,
220,
220,
220,
19449,
13,
29572,
7,
40717,
13,
15577,
2220,
7,
11249,
74,
578,
62,
33678,
7,
15042,
11,
36123,
26,
3689,
986,
828,
10903,
4008,
198,
437,
198,
198,
8818,
1382,
74,
578,
62,
17147,
62,
17752,
7,
15042,
3712,
15580,
74,
578,
17614,
11,
36123,
796,
366,
8172,
3689,
23029,
198,
220,
220,
220,
19449,
13,
29572,
7,
40717,
13,
15577,
2220,
7,
11249,
74,
578,
62,
17147,
7,
15042,
11,
36123,
26,
3689,
986,
828,
10903,
4008,
198,
437,
198,
198,
8818,
23748,
62,
6894,
3419,
198,
220,
220,
220,
2779,
62,
6371,
796,
14626,
13,
47269,
7203,
5450,
1378,
15042,
13,
11249,
74,
578,
13,
785,
4943,
198,
220,
220,
220,
374,
796,
1382,
74,
578,
62,
1136,
62,
17752,
7,
15580,
74,
578,
17614,
7,
8692,
62,
6371,
28,
8692,
62,
6371,
828,
366,
4943,
198,
220,
220,
220,
1441,
374,
14692,
26209,
8973,
198,
437,
198,
198,
2,
4009,
40391,
198,
198,
7249,
12275,
198,
220,
220,
220,
40391,
3712,
15580,
74,
578,
17614,
198,
220,
220,
220,
1366,
3712,
35,
713,
198,
437,
198,
198,
8818,
4009,
7,
15042,
3712,
15580,
74,
578,
17614,
11,
1438,
8,
198,
220,
220,
220,
1441,
12275,
7,
15042,
11,
1382,
74,
578,
62,
1136,
62,
17752,
7,
15042,
11,
366,
9971,
4582,
32624,
7,
21037,
7442,
7,
3672,
4008,
48774,
198,
437,
198,
198,
2,
31108,
40391,
198,
198,
7249,
37709,
198,
220,
220,
220,
40391,
3712,
15580,
74,
578,
17614,
198,
220,
220,
220,
1366,
3712,
35,
713,
198,
437,
198,
198,
8818,
31108,
7,
15042,
3712,
15580,
74,
578,
17614,
11,
4009,
26,
2443,
28,
15,
11,
42208,
1883,
28,
9562,
8,
198,
220,
220,
220,
12405,
62,
37266,
796,
360,
713,
7203,
7700,
1,
5218,
2443,
8,
198,
220,
220,
220,
36123,
796,
366,
9971,
4582,
32624,
7,
21037,
7442,
7,
9971,
1634,
4008,
14,
79,
541,
20655,
1,
198,
220,
220,
220,
1441,
685,
47,
541,
4470,
7,
15042,
11,
279,
8,
329,
279,
287,
1382,
74,
578,
62,
1136,
62,
17752,
7,
15042,
11,
36123,
26,
42287,
796,
12405,
62,
37266,
15437,
198,
437,
198,
198,
8818,
31108,
7,
2398,
3712,
15580,
74,
578,
13,
26121,
1634,
8,
198,
220,
220,
220,
1441,
31108,
7,
2398,
13,
15042,
11,
8745,
13,
7890,
14692,
3672,
8973,
8,
198,
437,
198,
198,
2,
1382,
40391,
198,
198,
7249,
10934,
198,
220,
220,
220,
40391,
3712,
15580,
74,
578,
17614,
198,
220,
220,
220,
1366,
3712,
35,
713,
198,
437,
198,
198,
8818,
12188,
7,
15042,
3712,
15580,
74,
578,
17614,
26,
1181,
28,
22366,
8,
198,
220,
220,
220,
12405,
62,
37266,
796,
360,
713,
7203,
5219,
1,
5218,
1181,
8,
198,
220,
220,
220,
36123,
796,
366,
11249,
82,
1,
198,
220,
220,
220,
1441,
685,
15580,
7,
15042,
11,
275,
8,
329,
275,
287,
1382,
74,
578,
62,
1136,
62,
17752,
7,
15042,
11,
36123,
26,
42287,
796,
12405,
62,
37266,
15437,
198,
437,
198,
198,
11249,
62,
5219,
7,
65,
3712,
15580,
8,
796,
275,
13,
7890,
14692,
5219,
8973,
198,
198,
437,
198
] | 2.518269 | 1,779 |
function count_nucleotides(strand::AbstractString)
a = 0
c = 0
g = 0
t = 0
for i in strand
if i == 'A'
a += 1
elseif i == 'C'
c += 1
elseif i == 'G'
g += 1
elseif i == 'T'
t += 1
else
return throw(DomainError())
end
end
return Dict( 'A' => a, 'C' => c, 'G' => g, 'T' => t)
end
count_nucleotides("GAGAGACGTT")
| [
8818,
954,
62,
77,
14913,
313,
1460,
7,
2536,
392,
3712,
23839,
10100,
8,
628,
220,
220,
220,
257,
796,
657,
198,
220,
220,
220,
269,
796,
657,
198,
220,
220,
220,
308,
796,
657,
198,
220,
220,
220,
256,
796,
657,
628,
220,
220,
220,
329,
1312,
287,
37923,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1312,
6624,
705,
32,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
257,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
361,
1312,
6624,
705,
34,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
361,
1312,
6624,
705,
38,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
308,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
361,
1312,
6624,
705,
51,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
3714,
7,
43961,
12331,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1441,
360,
713,
7,
705,
32,
6,
5218,
257,
11,
705,
34,
6,
5218,
269,
11,
705,
38,
6,
5218,
308,
11,
705,
51,
6,
5218,
256,
8,
198,
437,
198,
198,
9127,
62,
77,
14913,
313,
1460,
7203,
38,
4760,
4760,
2246,
38,
15751,
4943,
198
] | 1.716475 | 261 |
using AutonomousMerging
using Random
using AutomotiveDrivingModels
using POMDPs
using POMDPPolicies
using POMDPSimulators
using Test
function test_state(mdp::GenerativeMergingMDP, s,v=0.0, acc=0.0)
ego = Vehicle(vehicle_state(35.0, merge_lane(mdp.env), 5.0, mdp.env.roadway), VehicleDef(), EGO_ID)
veh1 = Vehicle(vehicle_state(s, main_lane(mdp.env), 4.9, mdp.env.roadway), VehicleDef(), EGO_ID + 1)
scene = Scene()
push!(scene, ego)
push!(scene, veh1)
return AugScene(scene, (acc=acc,))
end
@testset "Environment" begin
env = MergingEnvironment(main_lane_angle = 0.0, merge_lane_angle = pi/12)
main = main_lane(env)
merge = merge_lane(env)
@test main == env.roadway[LaneTag(MAIN_LANE_ID, 1)]
@test main.curve[end].s == env.main_lane_length + env.after_merge_length
@test merge.curve[end].s == env.merge_lane_length
end
@testset "GenerativeMDP" begin
rng = MersenneTwister(1)
mdp = GenerativeMergingMDP(max_cars=12,
min_cars=10,
driver_type = :random,
observe_cooperation = true,
initial_ego_velocity=0.0)
s0 = initialstate(mdp, rng)
policy = RandomPolicy(mdp, rng=rng)
hr = HistoryRecorder(rng = rng, max_steps=100)
hist = POMDPSimulators.simulate(hr, mdp, policy, s0)
s = s0
svec = convert_s(Vector{Float64}, s, mdp)
srec = convert_s(AugScene, svec, mdp)
@test get_by_id(srec.scene, EGO_ID).state.posG ≈ get_by_id(s.scene, EGO_ID).state.posG
s = state_hist(hist)[end]
svec = convert_s(Vector{Float64}, s, mdp)
srec = convert_s(AugScene, svec, mdp)
@test get_by_id(srec.scene, EGO_ID).state.posG ≈ get_by_id(s.scene, EGO_ID).state.posG
end
@testset "CooperativeIDM" begin
rng = MersenneTwister(1)
mdp = GenerativeMergingMDP(random_n_cars=true, dt=0.5)
mdp.driver_models[2] = CooperativeIDM(c=1.0)
set_desired_speed!(mdp.driver_models[2], 5.0)
s0 = test_state(mdp, 85.0)
policy = FunctionPolicy(s->7)
hr = HistoryRecorder(rng = rng, max_steps=40)
hist = POMDPSimulators.simulate(hr, mdp, policy, s0)
end
| [
3500,
5231,
38175,
13102,
2667,
220,
198,
3500,
14534,
198,
3500,
17406,
19138,
20564,
1075,
5841,
1424,
198,
3500,
350,
2662,
6322,
82,
198,
3500,
350,
2662,
6322,
47,
4160,
444,
198,
3500,
350,
2662,
35,
3705,
320,
24325,
198,
3500,
6208,
220,
198,
198,
8818,
1332,
62,
5219,
7,
9132,
79,
3712,
8645,
876,
13102,
2667,
44,
6322,
11,
264,
11,
85,
28,
15,
13,
15,
11,
697,
28,
15,
13,
15,
8,
198,
220,
220,
220,
19225,
796,
21501,
7,
33892,
1548,
62,
5219,
7,
2327,
13,
15,
11,
20121,
62,
33533,
7,
9132,
79,
13,
24330,
828,
642,
13,
15,
11,
285,
26059,
13,
24330,
13,
6344,
1014,
828,
21501,
7469,
22784,
412,
11230,
62,
2389,
8,
198,
220,
220,
220,
2844,
16,
796,
21501,
7,
33892,
1548,
62,
5219,
7,
82,
11,
1388,
62,
33533,
7,
9132,
79,
13,
24330,
828,
604,
13,
24,
11,
285,
26059,
13,
24330,
13,
6344,
1014,
828,
21501,
7469,
22784,
412,
11230,
62,
2389,
1343,
352,
8,
198,
220,
220,
220,
3715,
796,
28315,
3419,
198,
220,
220,
220,
4574,
0,
7,
29734,
11,
19225,
8,
198,
220,
220,
220,
4574,
0,
7,
29734,
11,
2844,
16,
8,
198,
220,
220,
220,
1441,
2447,
36542,
7,
29734,
11,
357,
4134,
28,
4134,
11,
4008,
198,
437,
198,
198,
31,
9288,
2617,
366,
31441,
1,
2221,
220,
198,
220,
220,
220,
17365,
796,
4638,
2667,
31441,
7,
12417,
62,
33533,
62,
9248,
796,
657,
13,
15,
11,
20121,
62,
33533,
62,
9248,
796,
31028,
14,
1065,
8,
198,
220,
220,
220,
1388,
796,
1388,
62,
33533,
7,
24330,
8,
198,
220,
220,
220,
20121,
796,
20121,
62,
33533,
7,
24330,
8,
198,
220,
220,
220,
2488,
9288,
1388,
6624,
17365,
13,
6344,
1014,
58,
43,
1531,
24835,
7,
5673,
1268,
62,
25697,
36,
62,
2389,
11,
352,
15437,
198,
220,
220,
220,
2488,
9288,
1388,
13,
22019,
303,
58,
437,
4083,
82,
6624,
17365,
13,
12417,
62,
33533,
62,
13664,
1343,
17365,
13,
8499,
62,
647,
469,
62,
13664,
198,
220,
220,
220,
2488,
9288,
20121,
13,
22019,
303,
58,
437,
4083,
82,
6624,
17365,
13,
647,
469,
62,
33533,
62,
13664,
198,
437,
198,
198,
31,
9288,
2617,
366,
8645,
876,
44,
6322,
1,
2221,
220,
628,
220,
220,
220,
374,
782,
796,
337,
364,
29727,
5080,
1694,
7,
16,
8,
198,
220,
220,
220,
285,
26059,
796,
2980,
876,
13102,
2667,
44,
6322,
7,
9806,
62,
37993,
28,
1065,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
949,
62,
37993,
28,
940,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4639,
62,
4906,
796,
1058,
25120,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12414,
62,
1073,
27184,
796,
2081,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4238,
62,
1533,
78,
62,
626,
11683,
28,
15,
13,
15,
8,
198,
220,
220,
220,
264,
15,
796,
4238,
5219,
7,
9132,
79,
11,
374,
782,
8,
198,
220,
220,
220,
2450,
796,
14534,
36727,
7,
9132,
79,
11,
374,
782,
28,
81,
782,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
39436,
796,
7443,
6690,
2875,
7,
81,
782,
796,
374,
782,
11,
3509,
62,
20214,
28,
3064,
8,
198,
220,
220,
220,
1554,
796,
350,
2662,
35,
3705,
320,
24325,
13,
14323,
5039,
7,
11840,
11,
285,
26059,
11,
2450,
11,
264,
15,
8,
628,
220,
220,
220,
264,
796,
264,
15,
198,
220,
220,
220,
264,
35138,
796,
10385,
62,
82,
7,
38469,
90,
43879,
2414,
5512,
264,
11,
285,
26059,
8,
198,
220,
220,
220,
264,
8344,
796,
10385,
62,
82,
7,
12512,
36542,
11,
264,
35138,
11,
285,
26059,
8,
198,
220,
220,
220,
2488,
9288,
651,
62,
1525,
62,
312,
7,
82,
8344,
13,
29734,
11,
412,
11230,
62,
2389,
737,
5219,
13,
1930,
38,
15139,
230,
651,
62,
1525,
62,
312,
7,
82,
13,
29734,
11,
412,
11230,
62,
2389,
737,
5219,
13,
1930,
38,
198,
220,
220,
220,
220,
198,
220,
220,
220,
264,
796,
1181,
62,
10034,
7,
10034,
38381,
437,
60,
198,
220,
220,
220,
264,
35138,
796,
10385,
62,
82,
7,
38469,
90,
43879,
2414,
5512,
264,
11,
285,
26059,
8,
198,
220,
220,
220,
264,
8344,
796,
10385,
62,
82,
7,
12512,
36542,
11,
264,
35138,
11,
285,
26059,
8,
198,
220,
220,
220,
2488,
9288,
651,
62,
1525,
62,
312,
7,
82,
8344,
13,
29734,
11,
412,
11230,
62,
2389,
737,
5219,
13,
1930,
38,
15139,
230,
651,
62,
1525,
62,
312,
7,
82,
13,
29734,
11,
412,
11230,
62,
2389,
737,
5219,
13,
1930,
38,
198,
437,
198,
198,
31,
9288,
2617,
366,
7222,
27173,
2389,
44,
1,
2221,
220,
198,
220,
220,
220,
374,
782,
796,
337,
364,
29727,
5080,
1694,
7,
16,
8,
628,
220,
220,
220,
285,
26059,
796,
2980,
876,
13102,
2667,
44,
6322,
7,
25120,
62,
77,
62,
37993,
28,
7942,
11,
288,
83,
28,
15,
13,
20,
8,
628,
220,
220,
220,
285,
26059,
13,
26230,
62,
27530,
58,
17,
60,
796,
43457,
2389,
44,
7,
66,
28,
16,
13,
15,
8,
198,
220,
220,
220,
900,
62,
8906,
1202,
62,
12287,
0,
7,
9132,
79,
13,
26230,
62,
27530,
58,
17,
4357,
642,
13,
15,
8,
198,
220,
220,
220,
220,
628,
220,
220,
220,
264,
15,
796,
1332,
62,
5219,
7,
9132,
79,
11,
7600,
13,
15,
8,
198,
220,
220,
220,
2450,
796,
15553,
36727,
7,
82,
3784,
22,
8,
198,
220,
220,
220,
39436,
796,
7443,
6690,
2875,
7,
81,
782,
796,
374,
782,
11,
3509,
62,
20214,
28,
1821,
8,
198,
220,
220,
220,
1554,
796,
350,
2662,
35,
3705,
320,
24325,
13,
14323,
5039,
7,
11840,
11,
285,
26059,
11,
2450,
11,
264,
15,
8,
198,
198,
437,
198
] | 2.079545 | 1,056 |
# this should exist?
"""
filename(path)
Sring -> String
Extract core name of the file from path
E.g. filename("/some/path/to/file_name.ext") -> "file_name"
"""
filename(path) = splitext(basename(path))[1]
# this should be in PropDicts?
"""
propdict(json_file)
AbstractString -> PropDict
Construct a PropDict based on given <json_file>.
1) Why can't I name it function PropDict()?
2) Why doesn't this already exist in PropDicts?
I find the PropDicts.read(PropDict, String) format kinda cumbersome
"""
function propdict(json_file::AbstractString)
PropDicts.read(PropDict, json_file)
end
"""
remove_negative(value)
Real -> Real
Replace negative values by zeros.
Used to remove a glitch in SSD pulses as a quick fix
while the glitch is being debugged.
"""
function remove_negative(value::Real)
value < 0 ? 0 : value
end
"""
preamp_gain(preamp, noise_model)
GenericPreAmp, NoiseFromData -> Real
Calculate gain of <preamp> based on its max energy and
the offset observed in data baselines contained in <noise_model>
In principle we should not do this in this simulation, and user has to provide
the precise parameters of the electronics chain used in producing data
the baselines from which are contained in <noise_model>.
"""
function preamp_gain(preamp::PreAmp, noise_model::NoiseFromData)
# average offset in baselines
offset = mean(mean.(noise_model.baseline_catalog.waveform.value))
# calculate gain based on offset in data baselines
(typemax(UInt16) - offset) * germanium_ionization_energy / uconvert(u"eV", preamp.max_e)
end
"""
preamp_gain(preamp, ::NoiseFromSim)
GenericPreAmp -> Float64
Do nothing and return original value of gain parameter in <preamp>,
since when NoiseFromSim model is used, gain is provided by the user
(or calculated based on user given max energy)
"""
function preamp_gain(preamp::GenericPreAmp, ::NoiseFromSim)
preamp.gain
end
# """
# trigger_threshold(trigger, noise_model, preamp)
# Trigger, NoiseFromSim, GenericPreAmp -> Real
# Calculate trigger threshold based on whether
# the user provided it in the simulation settings
# """
# function trigger_threshold(trigger::Trigger, noise_model::NoiseFromSim, preamp::PreAmp)
# # if trigger threshold not given, take noise level as reference
# threshold = trigger.threshold_keV == 0u"keV" ? noise_model.noise_σ * 3 : trigger.threshold_keV
# uconvert(u"eV", threshold) / germanium_ionization_energy * preamp.gain
# end
"""
trigger_threshold(trigger, preamp, ::NoiseFromSim)
Trigger, GenericPreAmp -> Real
In NoiseFromSim setting, non-zero trigger threshold in keV MUST be given by the user.
Calculate final threshold based the value contained in <trigger>, and <preamp> gain.
"""
function trigger_threshold(trigger::Trigger, preamp::GenericPreAmp, ::NoiseFromSim)
uconvert(u"eV", trigger.threshold_keV) / germanium_ionization_energy * preamp.gain
# threshold = trigger.threshold_keV == 0u"keV" ? noise_model.noise_σ * 3 : trigger.threshold_keV
# uconvert(u"eV", threshold) / germanium_ionization_energy * preamp.gain
end
"""
trigger_threshold(trigger, preamp, noise_model)
Trigger, GenericPreAmp, NoiseFromData -> Real
In NoiseFromData setting, if trigger threshold in keV is not provided,
it is calculated based on noise levels in the baselines contained in
<noise_model>.
Otherwise the final threshold is calculated based on <preamp> gain.
"""
function trigger_threshold(trigger::Trigger, preamp::GenericPreAmp, noise_model::NoiseFromData)
trigger.threshold_keV == 0u"keV" ? std(noise_model.baseline_catalog.waveform[1].value) * 3 : uconvert(u"eV", trigger.threshold_keV) / germanium_ionization_energy * preamp.gain
end | [
2,
428,
815,
2152,
30,
198,
37811,
198,
220,
220,
220,
29472,
7,
6978,
8,
198,
198,
50,
1806,
4613,
10903,
198,
198,
11627,
974,
4755,
1438,
286,
262,
2393,
422,
3108,
220,
198,
198,
36,
13,
70,
13,
29472,
7203,
14,
11246,
14,
6978,
14,
1462,
14,
7753,
62,
3672,
13,
2302,
4943,
4613,
366,
7753,
62,
3672,
1,
198,
37811,
198,
34345,
7,
6978,
8,
796,
4328,
578,
742,
7,
12093,
12453,
7,
6978,
4008,
58,
16,
60,
628,
198,
2,
428,
815,
307,
287,
8772,
35,
14137,
30,
198,
37811,
198,
220,
220,
220,
2632,
11600,
7,
17752,
62,
7753,
8,
198,
198,
23839,
10100,
4613,
8772,
35,
713,
220,
198,
198,
42316,
257,
8772,
35,
713,
1912,
319,
1813,
1279,
17752,
62,
7753,
28401,
198,
198,
16,
8,
4162,
460,
470,
314,
1438,
340,
2163,
8772,
35,
713,
3419,
30,
198,
17,
8,
4162,
1595,
470,
428,
1541,
2152,
287,
8772,
35,
14137,
30,
198,
40,
1064,
262,
8772,
35,
14137,
13,
961,
7,
24331,
35,
713,
11,
10903,
8,
5794,
17855,
44491,
198,
37811,
198,
8818,
2632,
11600,
7,
17752,
62,
7753,
3712,
23839,
10100,
8,
198,
220,
220,
220,
8772,
35,
14137,
13,
961,
7,
24331,
35,
713,
11,
33918,
62,
7753,
8,
198,
437,
628,
198,
37811,
198,
220,
220,
220,
4781,
62,
31591,
7,
8367,
8,
198,
198,
15633,
4613,
6416,
220,
198,
198,
3041,
5372,
4633,
3815,
416,
1976,
27498,
13,
198,
198,
38052,
284,
4781,
257,
29204,
287,
21252,
37783,
355,
257,
2068,
4259,
198,
220,
220,
220,
981,
262,
29204,
318,
852,
14257,
2004,
13,
198,
37811,
198,
8818,
4781,
62,
31591,
7,
8367,
3712,
15633,
8,
198,
220,
220,
220,
1988,
1279,
657,
5633,
657,
1058,
1988,
198,
437,
628,
198,
37811,
198,
220,
220,
220,
662,
696,
62,
48544,
7,
3866,
696,
11,
7838,
62,
19849,
8,
198,
198,
46189,
6719,
32,
3149,
11,
30964,
4863,
6601,
4613,
6416,
198,
198,
9771,
3129,
378,
4461,
286,
1279,
3866,
696,
29,
1912,
319,
663,
3509,
2568,
290,
220,
198,
220,
220,
220,
262,
11677,
6515,
287,
1366,
1615,
20655,
7763,
287,
1279,
3919,
786,
62,
19849,
29,
198,
198,
818,
7989,
356,
815,
407,
466,
428,
287,
428,
18640,
11,
290,
2836,
468,
284,
2148,
220,
198,
220,
220,
220,
262,
7141,
10007,
286,
262,
17075,
6333,
973,
287,
9194,
1366,
220,
198,
220,
220,
220,
262,
1615,
20655,
422,
543,
389,
7763,
287,
1279,
3919,
786,
62,
19849,
28401,
198,
37811,
198,
8818,
662,
696,
62,
48544,
7,
3866,
696,
3712,
6719,
32,
3149,
11,
7838,
62,
19849,
3712,
2949,
786,
4863,
6601,
8,
198,
220,
220,
220,
1303,
2811,
11677,
287,
1615,
20655,
220,
198,
220,
220,
220,
11677,
796,
1612,
7,
32604,
12195,
3919,
786,
62,
19849,
13,
12093,
4470,
62,
9246,
11794,
13,
19204,
687,
13,
8367,
4008,
198,
220,
220,
220,
1303,
15284,
4461,
1912,
319,
11677,
287,
1366,
1615,
20655,
220,
198,
220,
220,
220,
357,
28004,
368,
897,
7,
52,
5317,
1433,
8,
532,
11677,
8,
1635,
308,
2224,
1505,
62,
295,
1634,
62,
22554,
1220,
334,
1102,
1851,
7,
84,
1,
68,
53,
1600,
662,
696,
13,
9806,
62,
68,
8,
198,
437,
628,
198,
37811,
198,
220,
220,
220,
662,
696,
62,
48544,
7,
3866,
696,
11,
7904,
2949,
786,
4863,
8890,
8,
198,
198,
46189,
6719,
32,
3149,
4613,
48436,
2414,
198,
198,
5211,
2147,
290,
1441,
2656,
1988,
286,
4461,
11507,
287,
1279,
3866,
696,
22330,
198,
220,
220,
220,
1201,
618,
30964,
4863,
8890,
2746,
318,
973,
11,
4461,
318,
2810,
416,
262,
2836,
198,
220,
220,
220,
357,
273,
10488,
1912,
319,
2836,
1813,
3509,
2568,
8,
220,
220,
220,
220,
198,
37811,
198,
8818,
662,
696,
62,
48544,
7,
3866,
696,
3712,
46189,
6719,
32,
3149,
11,
7904,
2949,
786,
4863,
8890,
8,
198,
220,
220,
220,
662,
696,
13,
48544,
198,
437,
628,
198,
2,
37227,
198,
2,
220,
220,
220,
220,
7616,
62,
400,
10126,
7,
46284,
11,
7838,
62,
19849,
11,
662,
696,
8,
198,
198,
2,
24593,
11,
30964,
4863,
8890,
11,
42044,
6719,
32,
3149,
4613,
6416,
220,
198,
198,
2,
27131,
378,
7616,
11387,
1912,
319,
1771,
198,
2,
220,
220,
220,
220,
262,
2836,
2810,
340,
287,
262,
18640,
6460,
198,
2,
37227,
198,
2,
2163,
7616,
62,
400,
10126,
7,
46284,
3712,
48344,
11,
7838,
62,
19849,
3712,
2949,
786,
4863,
8890,
11,
662,
696,
3712,
6719,
32,
3149,
8,
198,
2,
220,
220,
220,
220,
1303,
611,
7616,
11387,
407,
1813,
11,
1011,
7838,
1241,
355,
4941,
220,
198,
2,
220,
220,
220,
220,
11387,
796,
7616,
13,
400,
10126,
62,
365,
53,
6624,
657,
84,
1,
365,
53,
1,
5633,
7838,
62,
19849,
13,
3919,
786,
62,
38392,
1635,
513,
1058,
7616,
13,
400,
10126,
62,
365,
53,
198,
2,
220,
220,
220,
220,
334,
1102,
1851,
7,
84,
1,
68,
53,
1600,
11387,
8,
1220,
308,
2224,
1505,
62,
295,
1634,
62,
22554,
1635,
662,
696,
13,
48544,
198,
2,
886,
220,
628,
198,
37811,
198,
220,
220,
220,
7616,
62,
400,
10126,
7,
46284,
11,
662,
696,
11,
7904,
2949,
786,
4863,
8890,
8,
198,
198,
48344,
11,
42044,
6719,
32,
3149,
4613,
6416,
220,
198,
198,
818,
30964,
4863,
8890,
4634,
11,
1729,
12,
22570,
7616,
11387,
287,
885,
53,
17191,
307,
1813,
416,
262,
2836,
13,
198,
9771,
3129,
378,
2457,
11387,
1912,
262,
1988,
7763,
287,
1279,
46284,
22330,
290,
1279,
3866,
696,
29,
4461,
13,
198,
198,
37811,
198,
8818,
7616,
62,
400,
10126,
7,
46284,
3712,
48344,
11,
662,
696,
3712,
46189,
6719,
32,
3149,
11,
7904,
2949,
786,
4863,
8890,
8,
198,
220,
220,
220,
334,
1102,
1851,
7,
84,
1,
68,
53,
1600,
7616,
13,
400,
10126,
62,
365,
53,
8,
1220,
308,
2224,
1505,
62,
295,
1634,
62,
22554,
1635,
662,
696,
13,
48544,
198,
220,
220,
220,
1303,
11387,
796,
7616,
13,
400,
10126,
62,
365,
53,
6624,
657,
84,
1,
365,
53,
1,
5633,
7838,
62,
19849,
13,
3919,
786,
62,
38392,
1635,
513,
1058,
7616,
13,
400,
10126,
62,
365,
53,
198,
220,
220,
220,
1303,
334,
1102,
1851,
7,
84,
1,
68,
53,
1600,
11387,
8,
1220,
308,
2224,
1505,
62,
295,
1634,
62,
22554,
1635,
662,
696,
13,
48544,
198,
437,
220,
628,
198,
37811,
198,
220,
220,
220,
7616,
62,
400,
10126,
7,
46284,
11,
662,
696,
11,
7838,
62,
19849,
8,
198,
198,
48344,
11,
42044,
6719,
32,
3149,
11,
30964,
4863,
6601,
4613,
6416,
220,
198,
198,
818,
30964,
4863,
6601,
4634,
11,
611,
7616,
11387,
287,
885,
53,
318,
407,
2810,
11,
198,
220,
220,
220,
340,
318,
10488,
1912,
319,
7838,
2974,
287,
262,
1615,
20655,
7763,
287,
198,
220,
220,
220,
1279,
3919,
786,
62,
19849,
28401,
198,
48059,
262,
2457,
11387,
318,
10488,
1912,
319,
1279,
3866,
696,
29,
4461,
13,
198,
37811,
198,
8818,
7616,
62,
400,
10126,
7,
46284,
3712,
48344,
11,
662,
696,
3712,
46189,
6719,
32,
3149,
11,
7838,
62,
19849,
3712,
2949,
786,
4863,
6601,
8,
198,
220,
220,
220,
7616,
13,
400,
10126,
62,
365,
53,
6624,
657,
84,
1,
365,
53,
1,
5633,
14367,
7,
3919,
786,
62,
19849,
13,
12093,
4470,
62,
9246,
11794,
13,
19204,
687,
58,
16,
4083,
8367,
8,
1635,
513,
1058,
334,
1102,
1851,
7,
84,
1,
68,
53,
1600,
7616,
13,
400,
10126,
62,
365,
53,
8,
1220,
308,
2224,
1505,
62,
295,
1634,
62,
22554,
1635,
662,
696,
13,
48544,
198,
437
] | 3.007177 | 1,254 |
"""
abstract type AbstractHyperRectangle{N,T} <: AbstractElement{ReferenceHyperCube{N},SVector{N,T}}
Axis-aligned hyperrectangle in `N` dimensions with coordinates of type
`SVector{N,T}`.
"""
abstract type AbstractHyperRectangle{N,T} <: AbstractElement{ReferenceHyperCube{N},SVector{N,T}} end
Base.eltype(::AbstractHyperRectangle{N,T}) where {N,T} = T
ambient_dimension(::AbstractHyperRectangle{N}) where {N} = N
geometric_dimension(::AbstractHyperRectangle{N}) where {N} = N
low_corner(r::AbstractHyperRectangle) = abstractmethod(r)
high_corner(r::AbstractHyperRectangle) = abstractmethod(r)
diameter(r::AbstractHyperRectangle) = abstractmethod(r)
center(r::AbstractHyperRectangle) = abstractmethod(r)
radius(r::AbstractHyperRectangle) = abstractmethod(r)
vertices(r::AbstractHyperRectangle) = abstractmethod(r)
Base.in(point,h::AbstractHyperRectangle) = all(low_corner(h) .<= point .<= high_corner(h))
function vertices(rec::AbstractHyperRectangle{2})
lc = low_corner(rec)
hc = high_corner(rec)
return SVector(
SVector(lc[1],lc[2]),
SVector(hc[1],lc[2]),
SVector(hc[1],hc[2]),
SVector(lc[1],hc[2])
)
end
function vertices(rec::AbstractHyperRectangle{3})
lc = low_corner(rec)
hc = high_corner(rec)
return SVector(
# lower face
SVector(lc[1],lc[2],lc[3]),
SVector(hc[1],lc[2],lc[3]),
SVector(hc[1],hc[2],lc[3]),
SVector(lc[1],hc[2],lc[3]),
# upper face
SVector(lc[1],lc[2],hc[3]),
SVector(hc[1],lc[2],hc[3]),
SVector(hc[1],hc[2],hc[3]),
SVector(lc[1],hc[2],hc[3])
)
end
## implement the AbstractElement interface for convenience
function (el::AbstractHyperRectangle)(u)
@assert u in domain(el)
lc = low_corner(el)
hc = high_corner(el)
# map from reference domain to
v = @. lc + (hc - lc)*u
return v
end
function jacobian(el::AbstractHyperRectangle,u)
@assert u in domain(el)
lc = low_corner(el)
hc = high_corner(el)
return SDiagonal(hc - lc)
end
"""
distance(r1::AbstractHyperRectangle,r2::AbstractHyperRectangle)
The (minimal) Euclidean distance between a point `x ∈ r1` and `y ∈ r2`.
"""
function distance(rec1::AbstractHyperRectangle{N},rec2::AbstractHyperRectangle{N}) where {N}
d2 = 0
rec1_low_corner = low_corner(rec1)
rec1_high_corner = high_corner(rec1)
rec2_low_corner = low_corner(rec2)
rec2_high_corner = high_corner(rec2)
for i=1:N
d2 += max(0,rec1_low_corner[i] - rec2_high_corner[i])^2 +
max(0,rec2_low_corner[i] - rec1_high_corner[i])^2
end
return sqrt(d2)
end
"""
distance(x::SVector,r::HyperRectangle)
The (minimal) Euclidean distance between the point `x` and any point `y ∈ r`.
"""
function distance(pt::SVector{N},rec::AbstractHyperRectangle{N}) where {N}
d2 = 0
rec_low_corner = low_corner(rec)
rec_high_corner = high_corner(rec)
for i=1:N
d2 += max(0,pt[i] - rec_high_corner[i])^2 +
max(0,rec_low_corner[i] - pt[i])^2
end
return sqrt(d2)
end
distance(rec::AbstractHyperRectangle{N},pt::SVector{N}) where {N} = distance(pt,rec)
######
# HyperRectangle
######
"""
struct HyperRectangle{N,T}
Axis-aligned hyperrectangle in `N` dimensions given by `low_corner::SVector{N,T}` and
`high_corner::SVector{N,T}`.
"""
struct HyperRectangle{N,T} <: AbstractHyperRectangle{N,T}
low_corner::SVector{N,T}
high_corner::SVector{N,T}
end
HyperRectangle(l::Tuple,h::Tuple) = HyperRectangle(SVector(l),SVector(h))
HyperRectangle(l::SVector,h::SVector) = HyperRectangle(promote(l,h)...)
# 1d case
HyperRectangle(a::Number,b::Number) = HyperRectangle(SVector(a),SVector(b))
low_corner(r::HyperRectangle) = r.low_corner
high_corner(r::HyperRectangle) = r.high_corner
center(r::HyperRectangle) = (low_corner(r) + high_corner(r)) / 2
diameter(r::HyperRectangle) = norm(high_corner(r) .- low_corner(r),2)
radius(r::HyperRectangle) = diameter(r) / 2
Base.isapprox(h1::HyperRectangle,h2::HyperRectangle;kwargs...) = isapprox(h1.low_corner,h2.low_corner;kwargs...) && isapprox(h1.high_corner,h2.high_corner;kwargs...)
######
# HyperCube
######
"""
struct HyperCube{N,T}
Axis-aligned hypercube in `N` dimensions given by `low_corner::SVector{N,T}` and
`side::T`.
"""
struct HyperCube{N,T} <: AbstractHyperRectangle{N,T}
low_corner::SVector{N,T}
side::T
end
# 1d case
HyperCube(low_corner::Number,side::Number) = HyperCube(SVector(low_corner),side)
side(r::HyperCube) = r.side
low_corner(r::HyperCube) = r.low_corner
high_corner(r::HyperCube) = low_corner(r) .+ side(r)
center(r::HyperCube) = low_corner(r) .+ side(r)/2
diameter(r::HyperCube{N}) where N = side(r)*sqrt(N)
radius(r::HyperCube) = diameter(r) / 2
Base.isapprox(h1::HyperCube,h2::HyperCube;kwargs...) = isapprox(h1.low_corner,h2.low_corner;kwargs...) && isapprox(h1.side,h2.side;kwargs...)
######
# Utils
######
function HyperRectangle(els,cube=false)
isempty(els) && (error("data cannot be empty") )
lb = first(els) |> coords
ub = first(els) |> coords
for el in els
pt = coords(el)
lb = min.(lb,pt)
ub = max.(ub,pt)
end
if cube # fit a square/cube instead
w = maximum(ub-lb)
xc = (ub + lb) / 2
lb = xc .- w/2
ub = xc .+ w/2
# TODO: return HyperCube instead
end
return HyperRectangle(lb,ub)
end
"""
split(rec::AbstractHyperRectangle,[axis]::Int,[place])
Split a hyperrectangle in two along the `axis` direction at the position
`place`. Returns a tuple with the two resulting hyperrectangles.
When no `place` is given, defaults to splitting in the middle of the axis.
When no axis and no place is given, defaults to splitting along the largest axis.
"""
function Base.split(rec::AbstractHyperRectangle,axis,place)
rec_low_corner = low_corner(rec)
rec_high_corner = high_corner(rec)
N = ambient_dimension(rec)
high_corner1 = svector(n-> n==axis ? place : rec_high_corner[n], N)
low_corner2 = svector(n-> n==axis ? place : rec_low_corner[n], N)
rec1 = HyperRectangle(rec_low_corner, high_corner1)
rec2 = HyperRectangle(low_corner2,rec_high_corner)
return (rec1, rec2)
end
function Base.split(rec::AbstractHyperRectangle,axis)
place = (high_corner(rec)[axis] + low_corner(rec)[axis])/2
return split(rec,axis,place)
end
function Base.split(rec::AbstractHyperRectangle)
axis = argmax(high_corner(rec) .- low_corner(rec))
return split(rec,axis)
end
| [
198,
37811,
198,
220,
220,
220,
12531,
2099,
27741,
38197,
45474,
9248,
90,
45,
11,
51,
92,
1279,
25,
27741,
20180,
90,
26687,
38197,
29071,
90,
45,
5512,
50,
38469,
90,
45,
11,
51,
11709,
198,
198,
31554,
271,
12,
41634,
8718,
2554,
9248,
287,
4600,
45,
63,
15225,
351,
22715,
286,
2099,
198,
63,
50,
38469,
90,
45,
11,
51,
92,
44646,
198,
37811,
198,
397,
8709,
2099,
27741,
38197,
45474,
9248,
90,
45,
11,
51,
92,
1279,
25,
27741,
20180,
90,
26687,
38197,
29071,
90,
45,
5512,
50,
38469,
90,
45,
11,
51,
11709,
886,
198,
198,
14881,
13,
417,
4906,
7,
3712,
23839,
38197,
45474,
9248,
90,
45,
11,
51,
30072,
810,
1391,
45,
11,
51,
92,
220,
220,
220,
220,
796,
309,
198,
4131,
1153,
62,
46156,
7,
3712,
23839,
38197,
45474,
9248,
90,
45,
30072,
810,
1391,
45,
92,
220,
220,
796,
399,
198,
469,
16996,
62,
46156,
7,
3712,
23839,
38197,
45474,
9248,
90,
45,
30072,
810,
1391,
45,
92,
796,
399,
198,
9319,
62,
10215,
1008,
7,
81,
3712,
23839,
38197,
45474,
9248,
8,
220,
796,
12531,
24396,
7,
81,
8,
198,
8929,
62,
10215,
1008,
7,
81,
3712,
23839,
38197,
45474,
9248,
8,
796,
12531,
24396,
7,
81,
8,
198,
67,
13173,
7,
81,
3712,
23839,
38197,
45474,
9248,
8,
220,
220,
220,
796,
12531,
24396,
7,
81,
8,
198,
16159,
7,
81,
3712,
23839,
38197,
45474,
9248,
8,
220,
220,
220,
220,
220,
796,
12531,
24396,
7,
81,
8,
198,
42172,
7,
81,
3712,
23839,
38197,
45474,
9248,
8,
220,
220,
220,
220,
220,
796,
12531,
24396,
7,
81,
8,
198,
1851,
1063,
7,
81,
3712,
23839,
38197,
45474,
9248,
8,
220,
220,
220,
796,
12531,
24396,
7,
81,
8,
198,
198,
14881,
13,
259,
7,
4122,
11,
71,
3712,
23839,
38197,
45474,
9248,
8,
796,
477,
7,
9319,
62,
10215,
1008,
7,
71,
8,
764,
27,
28,
966,
764,
27,
28,
1029,
62,
10215,
1008,
7,
71,
4008,
198,
198,
8818,
9421,
1063,
7,
8344,
3712,
23839,
38197,
45474,
9248,
90,
17,
30072,
198,
220,
220,
220,
300,
66,
796,
1877,
62,
10215,
1008,
7,
8344,
8,
198,
220,
220,
220,
289,
66,
796,
1029,
62,
10215,
1008,
7,
8344,
8,
198,
220,
220,
220,
1441,
20546,
9250,
7,
198,
220,
220,
220,
220,
220,
220,
220,
20546,
9250,
7,
44601,
58,
16,
4357,
44601,
58,
17,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
20546,
9250,
7,
71,
66,
58,
16,
4357,
44601,
58,
17,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
20546,
9250,
7,
71,
66,
58,
16,
4357,
71,
66,
58,
17,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
20546,
9250,
7,
44601,
58,
16,
4357,
71,
66,
58,
17,
12962,
198,
220,
220,
220,
1267,
198,
437,
198,
8818,
9421,
1063,
7,
8344,
3712,
23839,
38197,
45474,
9248,
90,
18,
30072,
198,
220,
220,
220,
300,
66,
796,
1877,
62,
10215,
1008,
7,
8344,
8,
198,
220,
220,
220,
289,
66,
796,
1029,
62,
10215,
1008,
7,
8344,
8,
198,
220,
220,
220,
1441,
20546,
9250,
7,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
2793,
1986,
198,
220,
220,
220,
220,
220,
220,
220,
20546,
9250,
7,
44601,
58,
16,
4357,
44601,
58,
17,
4357,
44601,
58,
18,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
20546,
9250,
7,
71,
66,
58,
16,
4357,
44601,
58,
17,
4357,
44601,
58,
18,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
20546,
9250,
7,
71,
66,
58,
16,
4357,
71,
66,
58,
17,
4357,
44601,
58,
18,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
20546,
9250,
7,
44601,
58,
16,
4357,
71,
66,
58,
17,
4357,
44601,
58,
18,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
6727,
1986,
198,
220,
220,
220,
220,
220,
220,
220,
20546,
9250,
7,
44601,
58,
16,
4357,
44601,
58,
17,
4357,
71,
66,
58,
18,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
20546,
9250,
7,
71,
66,
58,
16,
4357,
44601,
58,
17,
4357,
71,
66,
58,
18,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
20546,
9250,
7,
71,
66,
58,
16,
4357,
71,
66,
58,
17,
4357,
71,
66,
58,
18,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
20546,
9250,
7,
44601,
58,
16,
4357,
71,
66,
58,
17,
4357,
71,
66,
58,
18,
12962,
198,
220,
220,
220,
1267,
198,
437,
198,
198,
2235,
3494,
262,
27741,
20180,
7071,
329,
15607,
198,
8818,
357,
417,
3712,
23839,
38197,
45474,
9248,
5769,
84,
8,
198,
220,
220,
220,
2488,
30493,
334,
287,
7386,
7,
417,
8,
198,
220,
220,
220,
300,
66,
220,
796,
1877,
62,
10215,
1008,
7,
417,
8,
198,
220,
220,
220,
289,
66,
220,
796,
1029,
62,
10215,
1008,
7,
417,
8,
198,
220,
220,
220,
1303,
3975,
422,
4941,
7386,
284,
198,
220,
220,
220,
410,
796,
2488,
13,
300,
66,
1343,
357,
71,
66,
532,
300,
66,
27493,
84,
198,
220,
220,
220,
1441,
410,
198,
437,
198,
198,
8818,
474,
330,
672,
666,
7,
417,
3712,
23839,
38197,
45474,
9248,
11,
84,
8,
198,
220,
220,
220,
2488,
30493,
334,
287,
7386,
7,
417,
8,
198,
220,
220,
220,
300,
66,
220,
796,
1877,
62,
10215,
1008,
7,
417,
8,
198,
220,
220,
220,
289,
66,
220,
796,
1029,
62,
10215,
1008,
7,
417,
8,
198,
220,
220,
220,
1441,
9834,
72,
27923,
7,
71,
66,
532,
300,
66,
8,
198,
437,
198,
198,
37811,
198,
220,
220,
220,
5253,
7,
81,
16,
3712,
23839,
38197,
45474,
9248,
11,
81,
17,
3712,
23839,
38197,
45474,
9248,
8,
198,
198,
464,
357,
1084,
4402,
8,
48862,
485,
272,
5253,
1022,
257,
966,
4600,
87,
18872,
230,
374,
16,
63,
290,
4600,
88,
18872,
230,
374,
17,
44646,
198,
37811,
198,
8818,
5253,
7,
8344,
16,
3712,
23839,
38197,
45474,
9248,
90,
45,
5512,
8344,
17,
3712,
23839,
38197,
45474,
9248,
90,
45,
30072,
810,
1391,
45,
92,
198,
220,
220,
220,
288,
17,
796,
657,
198,
220,
220,
220,
664,
16,
62,
9319,
62,
10215,
1008,
220,
796,
1877,
62,
10215,
1008,
7,
8344,
16,
8,
198,
220,
220,
220,
664,
16,
62,
8929,
62,
10215,
1008,
796,
1029,
62,
10215,
1008,
7,
8344,
16,
8,
198,
220,
220,
220,
664,
17,
62,
9319,
62,
10215,
1008,
220,
796,
1877,
62,
10215,
1008,
7,
8344,
17,
8,
198,
220,
220,
220,
664,
17,
62,
8929,
62,
10215,
1008,
796,
1029,
62,
10215,
1008,
7,
8344,
17,
8,
198,
220,
220,
220,
329,
1312,
28,
16,
25,
45,
198,
220,
220,
220,
220,
220,
220,
220,
288,
17,
15853,
3509,
7,
15,
11,
8344,
16,
62,
9319,
62,
10215,
1008,
58,
72,
60,
532,
664,
17,
62,
8929,
62,
10215,
1008,
58,
72,
12962,
61,
17,
1343,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3509,
7,
15,
11,
8344,
17,
62,
9319,
62,
10215,
1008,
58,
72,
60,
532,
664,
16,
62,
8929,
62,
10215,
1008,
58,
72,
12962,
61,
17,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1441,
19862,
17034,
7,
67,
17,
8,
198,
437,
198,
198,
37811,
198,
220,
220,
220,
5253,
7,
87,
3712,
50,
38469,
11,
81,
3712,
38197,
45474,
9248,
8,
198,
198,
464,
357,
1084,
4402,
8,
48862,
485,
272,
5253,
1022,
262,
966,
4600,
87,
63,
290,
597,
966,
4600,
88,
18872,
230,
374,
44646,
198,
37811,
198,
8818,
5253,
7,
457,
3712,
50,
38469,
90,
45,
5512,
8344,
3712,
23839,
38197,
45474,
9248,
90,
45,
30072,
810,
1391,
45,
92,
198,
220,
220,
220,
288,
17,
796,
657,
198,
220,
220,
220,
664,
62,
9319,
62,
10215,
1008,
220,
796,
1877,
62,
10215,
1008,
7,
8344,
8,
198,
220,
220,
220,
664,
62,
8929,
62,
10215,
1008,
796,
1029,
62,
10215,
1008,
7,
8344,
8,
198,
220,
220,
220,
329,
1312,
28,
16,
25,
45,
198,
220,
220,
220,
220,
220,
220,
220,
288,
17,
15853,
3509,
7,
15,
11,
457,
58,
72,
60,
532,
664,
62,
8929,
62,
10215,
1008,
58,
72,
12962,
61,
17,
1343,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3509,
7,
15,
11,
8344,
62,
9319,
62,
10215,
1008,
58,
72,
60,
532,
42975,
58,
72,
12962,
61,
17,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1441,
19862,
17034,
7,
67,
17,
8,
198,
437,
198,
30246,
7,
8344,
3712,
23839,
38197,
45474,
9248,
90,
45,
5512,
457,
3712,
50,
38469,
90,
45,
30072,
810,
1391,
45,
92,
796,
5253,
7,
457,
11,
8344,
8,
198,
198,
4242,
2235,
198,
2,
15079,
45474,
9248,
198,
4242,
2235,
198,
198,
37811,
198,
220,
220,
220,
2878,
15079,
45474,
9248,
90,
45,
11,
51,
92,
198,
198,
31554,
271,
12,
41634,
8718,
2554,
9248,
287,
4600,
45,
63,
15225,
1813,
416,
4600,
9319,
62,
10215,
1008,
3712,
50,
38469,
90,
45,
11,
51,
92,
63,
290,
198,
63,
8929,
62,
10215,
1008,
3712,
50,
38469,
90,
45,
11,
51,
92,
44646,
198,
37811,
198,
7249,
15079,
45474,
9248,
90,
45,
11,
51,
92,
1279,
25,
27741,
38197,
45474,
9248,
90,
45,
11,
51,
92,
198,
220,
220,
220,
1877,
62,
10215,
1008,
3712,
50,
38469,
90,
45,
11,
51,
92,
198,
220,
220,
220,
1029,
62,
10215,
1008,
3712,
50,
38469,
90,
45,
11,
51,
92,
198,
437,
198,
38197,
45474,
9248,
7,
75,
3712,
51,
29291,
11,
71,
3712,
51,
29291,
8,
220,
220,
220,
220,
796,
15079,
45474,
9248,
7,
50,
38469,
7,
75,
828,
50,
38469,
7,
71,
4008,
198,
38197,
45474,
9248,
7,
75,
3712,
50,
38469,
11,
71,
3712,
50,
38469,
8,
796,
15079,
45474,
9248,
7,
16963,
1258,
7,
75,
11,
71,
8,
23029,
198,
2,
352,
67,
1339,
198,
38197,
45474,
9248,
7,
64,
3712,
15057,
11,
65,
3712,
15057,
8,
796,
15079,
45474,
9248,
7,
50,
38469,
7,
64,
828,
50,
38469,
7,
65,
4008,
198,
198,
9319,
62,
10215,
1008,
7,
81,
3712,
38197,
45474,
9248,
8,
220,
796,
374,
13,
9319,
62,
10215,
1008,
198,
8929,
62,
10215,
1008,
7,
81,
3712,
38197,
45474,
9248,
8,
796,
374,
13,
8929,
62,
10215,
1008,
198,
16159,
7,
81,
3712,
38197,
45474,
9248,
8,
220,
220,
796,
357,
9319,
62,
10215,
1008,
7,
81,
8,
1343,
1029,
62,
10215,
1008,
7,
81,
4008,
1220,
362,
198,
67,
13173,
7,
81,
3712,
38197,
45474,
9248,
8,
796,
2593,
7,
8929,
62,
10215,
1008,
7,
81,
8,
764,
12,
1877,
62,
10215,
1008,
7,
81,
828,
17,
8,
198,
42172,
7,
81,
3712,
38197,
45474,
9248,
8,
220,
220,
796,
14753,
7,
81,
8,
1220,
362,
198,
14881,
13,
271,
1324,
13907,
7,
71,
16,
3712,
38197,
45474,
9248,
11,
71,
17,
3712,
38197,
45474,
9248,
26,
46265,
22046,
23029,
796,
318,
1324,
13907,
7,
71,
16,
13,
9319,
62,
10215,
1008,
11,
71,
17,
13,
9319,
62,
10215,
1008,
26,
46265,
22046,
23029,
11405,
318,
1324,
13907,
7,
71,
16,
13,
8929,
62,
10215,
1008,
11,
71,
17,
13,
8929,
62,
10215,
1008,
26,
46265,
22046,
23029,
198,
198,
4242,
2235,
198,
2,
15079,
29071,
198,
4242,
2235,
198,
198,
37811,
198,
220,
220,
220,
2878,
15079,
29071,
90,
45,
11,
51,
92,
198,
198,
31554,
271,
12,
41634,
8718,
40296,
287,
4600,
45,
63,
15225,
1813,
416,
4600,
9319,
62,
10215,
1008,
3712,
50,
38469,
90,
45,
11,
51,
92,
63,
290,
198,
63,
1589,
3712,
51,
44646,
198,
37811,
198,
7249,
15079,
29071,
90,
45,
11,
51,
92,
1279,
25,
27741,
38197,
45474,
9248,
90,
45,
11,
51,
92,
198,
220,
220,
220,
1877,
62,
10215,
1008,
3712,
50,
38469,
90,
45,
11,
51,
92,
198,
220,
220,
220,
1735,
3712,
51,
198,
437,
198,
2,
352,
67,
1339,
198,
38197,
29071,
7,
9319,
62,
10215,
1008,
3712,
15057,
11,
1589,
3712,
15057,
8,
796,
15079,
29071,
7,
50,
38469,
7,
9319,
62,
10215,
1008,
828,
1589,
8,
198,
198,
1589,
7,
81,
3712,
38197,
29071,
8,
796,
374,
13,
1589,
198,
9319,
62,
10215,
1008,
7,
81,
3712,
38197,
29071,
8,
220,
796,
374,
13,
9319,
62,
10215,
1008,
198,
8929,
62,
10215,
1008,
7,
81,
3712,
38197,
29071,
8,
796,
1877,
62,
10215,
1008,
7,
81,
8,
764,
10,
1735,
7,
81,
8,
198,
16159,
7,
81,
3712,
38197,
29071,
8,
796,
1877,
62,
10215,
1008,
7,
81,
8,
764,
10,
1735,
7,
81,
20679,
17,
198,
67,
13173,
7,
81,
3712,
38197,
29071,
90,
45,
30072,
810,
399,
796,
1735,
7,
81,
27493,
31166,
17034,
7,
45,
8,
198,
42172,
7,
81,
3712,
38197,
29071,
8,
796,
14753,
7,
81,
8,
1220,
362,
198,
14881,
13,
271,
1324,
13907,
7,
71,
16,
3712,
38197,
29071,
11,
71,
17,
3712,
38197,
29071,
26,
46265,
22046,
23029,
796,
318,
1324,
13907,
7,
71,
16,
13,
9319,
62,
10215,
1008,
11,
71,
17,
13,
9319,
62,
10215,
1008,
26,
46265,
22046,
23029,
11405,
318,
1324,
13907,
7,
71,
16,
13,
1589,
11,
71,
17,
13,
1589,
26,
46265,
22046,
23029,
198,
198,
4242,
2235,
198,
2,
7273,
4487,
198,
4242,
2235,
198,
198,
8818,
15079,
45474,
9248,
7,
1424,
11,
40296,
28,
9562,
8,
198,
220,
220,
220,
318,
28920,
7,
1424,
8,
220,
11405,
357,
18224,
7203,
7890,
2314,
307,
6565,
4943,
1267,
198,
220,
220,
220,
18360,
220,
796,
717,
7,
1424,
8,
930,
29,
763,
3669,
198,
220,
220,
220,
20967,
220,
796,
717,
7,
1424,
8,
930,
29,
763,
3669,
198,
220,
220,
220,
329,
1288,
287,
1288,
82,
198,
220,
220,
220,
220,
220,
220,
220,
42975,
796,
763,
3669,
7,
417,
8,
198,
220,
220,
220,
220,
220,
220,
220,
18360,
220,
796,
949,
12195,
23160,
11,
457,
8,
198,
220,
220,
220,
220,
220,
220,
220,
20967,
220,
796,
3509,
12195,
549,
11,
457,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
611,
23441,
1303,
4197,
257,
6616,
14,
40296,
2427,
198,
220,
220,
220,
220,
220,
220,
220,
266,
220,
796,
5415,
7,
549,
12,
23160,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
66,
796,
357,
549,
1343,
18360,
8,
1220,
362,
198,
220,
220,
220,
220,
220,
220,
220,
18360,
796,
2124,
66,
764,
12,
266,
14,
17,
198,
220,
220,
220,
220,
220,
220,
220,
20967,
796,
2124,
66,
764,
10,
266,
14,
17,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
16926,
46,
25,
1441,
15079,
29071,
2427,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1441,
15079,
45474,
9248,
7,
23160,
11,
549,
8,
198,
437,
198,
198,
37811,
198,
220,
220,
220,
6626,
7,
8344,
3712,
23839,
38197,
45474,
9248,
17414,
22704,
60,
3712,
5317,
17414,
5372,
12962,
198,
198,
41205,
257,
8718,
2554,
9248,
287,
734,
1863,
262,
4600,
22704,
63,
4571,
379,
262,
220,
2292,
198,
63,
5372,
44646,
16409,
257,
46545,
351,
262,
734,
7186,
8718,
2554,
27787,
13,
198,
198,
2215,
645,
4600,
5372,
63,
318,
1813,
11,
26235,
284,
26021,
287,
262,
3504,
286,
262,
16488,
13,
198,
198,
2215,
645,
16488,
290,
645,
1295,
318,
1813,
11,
26235,
284,
26021,
1863,
262,
4387,
16488,
13,
198,
37811,
198,
8818,
7308,
13,
35312,
7,
8344,
3712,
23839,
38197,
45474,
9248,
11,
22704,
11,
5372,
8,
198,
220,
220,
220,
664,
62,
9319,
62,
10215,
1008,
220,
796,
1877,
62,
10215,
1008,
7,
8344,
8,
198,
220,
220,
220,
664,
62,
8929,
62,
10215,
1008,
796,
1029,
62,
10215,
1008,
7,
8344,
8,
198,
220,
220,
220,
399,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
25237,
62,
46156,
7,
8344,
8,
198,
220,
220,
220,
1029,
62,
10215,
1008,
16,
796,
264,
31364,
7,
77,
3784,
299,
855,
22704,
5633,
1295,
1058,
664,
62,
8929,
62,
10215,
1008,
58,
77,
4357,
399,
8,
198,
220,
220,
220,
1877,
62,
10215,
1008,
17,
220,
796,
264,
31364,
7,
77,
3784,
299,
855,
22704,
5633,
1295,
1058,
664,
62,
9319,
62,
10215,
1008,
58,
77,
4357,
399,
8,
198,
220,
220,
220,
664,
16,
220,
220,
220,
220,
220,
220,
220,
220,
796,
15079,
45474,
9248,
7,
8344,
62,
9319,
62,
10215,
1008,
11,
1029,
62,
10215,
1008,
16,
8,
198,
220,
220,
220,
664,
17,
220,
220,
220,
220,
220,
220,
220,
220,
796,
15079,
45474,
9248,
7,
9319,
62,
10215,
1008,
17,
11,
8344,
62,
8929,
62,
10215,
1008,
8,
198,
220,
220,
220,
1441,
357,
8344,
16,
11,
664,
17,
8,
198,
437,
198,
8818,
7308,
13,
35312,
7,
8344,
3712,
23839,
38197,
45474,
9248,
11,
22704,
8,
198,
220,
220,
220,
1295,
796,
357,
8929,
62,
10215,
1008,
7,
8344,
38381,
22704,
60,
1343,
1877,
62,
10215,
1008,
7,
8344,
38381,
22704,
12962,
14,
17,
198,
220,
220,
220,
1441,
6626,
7,
8344,
11,
22704,
11,
5372,
8,
198,
437,
198,
8818,
7308,
13,
35312,
7,
8344,
3712,
23839,
38197,
45474,
9248,
8,
198,
220,
220,
220,
16488,
796,
1822,
9806,
7,
8929,
62,
10215,
1008,
7,
8344,
8,
764,
12,
1877,
62,
10215,
1008,
7,
8344,
4008,
198,
220,
220,
220,
1441,
6626,
7,
8344,
11,
22704,
8,
198,
437,
198
] | 2.290998 | 2,866 |
function _add_forces!(
f::Tuple,
p,
idx::Integer,
jdx::Integer,
fp::AbstractFloat,
rp::AbstractFloat,
)
@inbounds for (k, c) in zip(p, f)
c[idx] += (fp * k) / rp
c[jdx] -= (fp * k) / rp
end
end
function _compute_distance(
x::SubArray,
y::SubArray,
z::SubArray,
i::Integer,
j::Integer,
boxl::Real,
)
xij = x[i] - x[j]
yij = y[i] - y[j]
zij = z[i] - z[j]
xij -= boxl * round(xij / boxl)
yij -= boxl * round(yij / boxl)
zij -= boxl * round(zij / boxl)
rij2 = xij * xij + yij * yij + zij * zij
st_positions = @SVector [xij, yij, zij]
return st_positions, rij2
end
function _compressibilityz(
pos::StaticVector,
fp::AbstractFloat,
rij::AbstractFloat,
zfactor::ZFactor,
)
tmp_sum = @. (pos^2.0 * -fp) / rij
zfactor.zval += sum(tmp_sum)
end
function _compute_energy!(
positions::AbstractArray,
forces::AbstractArray,
params::NamedTuple,
pot::PairwisePotential;
rdfobj = nothing,
zfactor = nothing,
)
# Initialize necessary variables
energy = zero(params.rc2)
x = view(positions, :, 1)
y = view(positions, :, 2)
z = view(positions, :, 3)
fx = view(forces, :, 1)
fy = view(forces, :, 2)
fz = view(forces, :, 3)
for i = 1:params.N-1
@inbounds @fastmath for j = (i+1):params.N
(static_positions, rij2) = _compute_distance(x, y, z, i, j, params.boxl)
if rij2 < params.rc2
rij2 = √rij2
u_pair, f_pair = apply!(pot, rij2)
_add_forces!((fx, fy, fz), static_positions, i, j, f_pair, rij2)
energy += u_pair
if !isnothing(rdfobj)
simple_rdf!(rdfobj, rij2)
end
if !isnothing(zfactor)
_compressibilityz(static_positions, f_pair, rij2, zfactor)
end
end
end
end
return energy / params.N
end
function energy_force!(
positions::AbstractArray,
forces::AbstractArray,
params::NamedTuple,
pot::PairwisePotential;
gofr = nothing,
zfactor = nothing,
)
# Retrieve data from the system
fill!(forces, zero(params.boxl))
energy =
_compute_energy!(positions, forces, params, pot; rdfobj = gofr, zfactor = zfactor)
end
| [
8818,
4808,
2860,
62,
27087,
0,
7,
198,
220,
220,
220,
277,
3712,
51,
29291,
11,
198,
220,
220,
220,
279,
11,
198,
220,
220,
220,
4686,
87,
3712,
46541,
11,
198,
220,
220,
220,
474,
34350,
3712,
46541,
11,
198,
220,
220,
220,
277,
79,
3712,
23839,
43879,
11,
198,
220,
220,
220,
374,
79,
3712,
23839,
43879,
11,
198,
8,
198,
220,
220,
220,
2488,
259,
65,
3733,
329,
357,
74,
11,
269,
8,
287,
19974,
7,
79,
11,
277,
8,
198,
220,
220,
220,
220,
220,
220,
220,
269,
58,
312,
87,
60,
15853,
357,
46428,
1635,
479,
8,
1220,
374,
79,
198,
220,
220,
220,
220,
220,
220,
220,
269,
58,
73,
34350,
60,
48185,
357,
46428,
1635,
479,
8,
1220,
374,
79,
198,
220,
220,
220,
886,
198,
437,
198,
198,
8818,
4808,
5589,
1133,
62,
30246,
7,
198,
220,
220,
220,
2124,
3712,
7004,
19182,
11,
198,
220,
220,
220,
331,
3712,
7004,
19182,
11,
198,
220,
220,
220,
1976,
3712,
7004,
19182,
11,
198,
220,
220,
220,
1312,
3712,
46541,
11,
198,
220,
220,
220,
474,
3712,
46541,
11,
198,
220,
220,
220,
3091,
75,
3712,
15633,
11,
198,
8,
198,
220,
220,
220,
2124,
2926,
796,
2124,
58,
72,
60,
532,
2124,
58,
73,
60,
198,
220,
220,
220,
331,
2926,
796,
331,
58,
72,
60,
532,
331,
58,
73,
60,
198,
220,
220,
220,
1976,
2926,
796,
1976,
58,
72,
60,
532,
1976,
58,
73,
60,
628,
220,
220,
220,
2124,
2926,
48185,
3091,
75,
1635,
2835,
7,
87,
2926,
1220,
3091,
75,
8,
198,
220,
220,
220,
331,
2926,
48185,
3091,
75,
1635,
2835,
7,
88,
2926,
1220,
3091,
75,
8,
198,
220,
220,
220,
1976,
2926,
48185,
3091,
75,
1635,
2835,
7,
89,
2926,
1220,
3091,
75,
8,
628,
220,
220,
220,
374,
2926,
17,
796,
2124,
2926,
1635,
2124,
2926,
1343,
331,
2926,
1635,
331,
2926,
1343,
1976,
2926,
1635,
1976,
2926,
628,
220,
220,
220,
336,
62,
1930,
1756,
796,
2488,
50,
38469,
685,
87,
2926,
11,
331,
2926,
11,
1976,
2926,
60,
628,
220,
220,
220,
1441,
336,
62,
1930,
1756,
11,
374,
2926,
17,
198,
437,
198,
198,
8818,
4808,
5589,
601,
2247,
89,
7,
198,
220,
220,
220,
1426,
3712,
45442,
38469,
11,
198,
220,
220,
220,
277,
79,
3712,
23839,
43879,
11,
198,
220,
220,
220,
374,
2926,
3712,
23839,
43879,
11,
198,
220,
220,
220,
1976,
31412,
3712,
57,
41384,
11,
198,
8,
198,
220,
220,
220,
45218,
62,
16345,
796,
2488,
13,
357,
1930,
61,
17,
13,
15,
1635,
532,
46428,
8,
1220,
374,
2926,
198,
220,
220,
220,
1976,
31412,
13,
89,
2100,
15853,
2160,
7,
22065,
62,
16345,
8,
198,
437,
198,
198,
8818,
4808,
5589,
1133,
62,
22554,
0,
7,
198,
220,
220,
220,
6116,
3712,
23839,
19182,
11,
198,
220,
220,
220,
3386,
3712,
23839,
19182,
11,
198,
220,
220,
220,
42287,
3712,
45,
2434,
51,
29291,
11,
198,
220,
220,
220,
1787,
3712,
47,
958,
3083,
25396,
1843,
26,
198,
220,
220,
220,
374,
7568,
26801,
796,
2147,
11,
198,
220,
220,
220,
1976,
31412,
796,
2147,
11,
198,
8,
198,
220,
220,
220,
1303,
20768,
1096,
3306,
9633,
198,
220,
220,
220,
2568,
796,
6632,
7,
37266,
13,
6015,
17,
8,
628,
220,
220,
220,
2124,
796,
1570,
7,
1930,
1756,
11,
1058,
11,
352,
8,
198,
220,
220,
220,
331,
796,
1570,
7,
1930,
1756,
11,
1058,
11,
362,
8,
198,
220,
220,
220,
1976,
796,
1570,
7,
1930,
1756,
11,
1058,
11,
513,
8,
198,
220,
220,
220,
277,
87,
796,
1570,
7,
27087,
11,
1058,
11,
352,
8,
198,
220,
220,
220,
277,
88,
796,
1570,
7,
27087,
11,
1058,
11,
362,
8,
198,
220,
220,
220,
277,
89,
796,
1570,
7,
27087,
11,
1058,
11,
513,
8,
628,
220,
220,
220,
329,
1312,
796,
352,
25,
37266,
13,
45,
12,
16,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
259,
65,
3733,
2488,
7217,
11018,
329,
474,
796,
357,
72,
10,
16,
2599,
37266,
13,
45,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
12708,
62,
1930,
1756,
11,
374,
2926,
17,
8,
796,
4808,
5589,
1133,
62,
30246,
7,
87,
11,
331,
11,
1976,
11,
1312,
11,
474,
11,
42287,
13,
3524,
75,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
374,
2926,
17,
1279,
42287,
13,
6015,
17,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
2926,
17,
796,
18872,
248,
380,
73,
17,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
62,
24874,
11,
277,
62,
24874,
796,
4174,
0,
7,
13059,
11,
374,
2926,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
2860,
62,
27087,
0,
19510,
21373,
11,
277,
88,
11,
277,
89,
828,
9037,
62,
1930,
1756,
11,
1312,
11,
474,
11,
277,
62,
24874,
11,
374,
2926,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2568,
15853,
334,
62,
24874,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
5145,
271,
22366,
7,
4372,
69,
26801,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2829,
62,
4372,
69,
0,
7,
4372,
69,
26801,
11,
374,
2926,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
5145,
271,
22366,
7,
89,
31412,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
5589,
601,
2247,
89,
7,
12708,
62,
1930,
1756,
11,
277,
62,
24874,
11,
374,
2926,
17,
11,
1976,
31412,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1441,
2568,
1220,
42287,
13,
45,
198,
437,
198,
198,
8818,
2568,
62,
3174,
0,
7,
198,
220,
220,
220,
6116,
3712,
23839,
19182,
11,
198,
220,
220,
220,
3386,
3712,
23839,
19182,
11,
198,
220,
220,
220,
42287,
3712,
45,
2434,
51,
29291,
11,
198,
220,
220,
220,
1787,
3712,
47,
958,
3083,
25396,
1843,
26,
198,
220,
220,
220,
467,
8310,
796,
2147,
11,
198,
220,
220,
220,
1976,
31412,
796,
2147,
11,
198,
8,
198,
220,
220,
220,
1303,
4990,
30227,
1366,
422,
262,
1080,
198,
220,
220,
220,
6070,
0,
7,
27087,
11,
6632,
7,
37266,
13,
3524,
75,
4008,
198,
220,
220,
220,
2568,
796,
198,
220,
220,
220,
220,
220,
220,
220,
4808,
5589,
1133,
62,
22554,
0,
7,
1930,
1756,
11,
3386,
11,
42287,
11,
1787,
26,
374,
7568,
26801,
796,
467,
8310,
11,
1976,
31412,
796,
1976,
31412,
8,
198,
437,
198
] | 1.954432 | 1,207 |
module TestDocumentation
using Base.Test
using DataFrames
using TimeData
println("\n Running documentation tests\n")
using WorldBankDataTd
## single indicator, single country
gnp = WorldBankDataTd.wdi("NY.GNP.PCAP.CD", "BR")
## single indicator, multiple countries
gnp = WorldBankDataTd.wdi("NY.GNP.PCAP.CD", ["BR", "US", "DE"])
## multiple indicators, single country
data = WorldBankDataTd.wdi(["NY.GNP.PCAP.CD", "SP.DYN.LE00.IN"],
"BR")
## multiple indicators, multiple countries
data = WorldBankDataTd.wdi(["NY.GNP.PCAP.CD", "SP.DYN.LE00.IN"],
["BR", "US", "DE"])
## same, but as DataFrame
data = WorldBankDataTd.wdi(["NY.GNP.PCAP.CD", "SP.DYN.LE00.IN"],
["BR", "US", "DE"],
format = DataFrame)
## multiple indicators, multiple countries, additional information
data = WorldBankDataTd.wdi(["NY.GNP.PCAP.CD", "SP.DYN.LE00.IN"],
["BR", "US", "DE"], extra = true)
data[1:5, :]
countryData = getWBMeta("countries")
countryData[1:5, :]
names(countryData)
size(countryData)
indicatorData = getWBMeta("indicators")
indicatorData[1:5, :]
names(indicatorData)
size(indicatorData)
WorldBankDataTd.country_cache[1:5, :]
WorldBankDataTd.indicator_cache[1:5, :]
res = search_wdi("countries", :name, r"united"i)
res
res = search_wdi("indicators", :description, r"gross national expenditure"i)
res[:name]
search_wdi("countries", :iso2c, r"TZ"i)
search_wdi("countries", :income, r"upper middle"i)
search_wdi("countries", :region, r"Latin America"i)
search_wdi("countries", :capital, r"^Ka"i)
search_wdi("countries", :lending, r"IBRD"i)
search_wdi("indicators", :name, r"gross national expenditure"i)
search_wdi("indicators", :description, r"gross national expenditure"i)
search_wdi("indicators", :source_database, r"Sustainable"i)
search_wdi("indicators", :source_organization,
r"Global Partnership"i)[1:5, :]
data = wdi("NY.GNP.PCAP.CD", ["US","BR"], 1980, 2012, extra = true)
usData = chkDates(x-> x[:iso2c] .== "US", eachdate(data)) |>
x -> asArr(x, Bool, false) |>
x -> data[x[:], :]
usData
dfAS = wdi("EN.ATM.CO2E.KT", "AS")
end
| [
198,
21412,
6208,
24941,
341,
198,
198,
3500,
7308,
13,
14402,
198,
3500,
6060,
35439,
198,
3500,
3862,
6601,
198,
198,
35235,
7203,
59,
77,
18162,
10314,
5254,
59,
77,
4943,
198,
198,
3500,
2159,
28650,
6601,
51,
67,
198,
220,
220,
220,
198,
2235,
2060,
16916,
11,
2060,
1499,
198,
4593,
79,
796,
2159,
28650,
6601,
51,
67,
13,
86,
10989,
7203,
12805,
13,
16630,
47,
13,
5662,
2969,
13,
8610,
1600,
366,
11473,
4943,
198,
198,
2235,
2060,
16916,
11,
3294,
2678,
198,
4593,
79,
796,
2159,
28650,
6601,
51,
67,
13,
86,
10989,
7203,
12805,
13,
16630,
47,
13,
5662,
2969,
13,
8610,
1600,
14631,
11473,
1600,
366,
2937,
1600,
366,
7206,
8973,
8,
198,
198,
2235,
3294,
21337,
11,
2060,
1499,
198,
7890,
796,
2159,
28650,
6601,
51,
67,
13,
86,
10989,
7,
14692,
12805,
13,
16630,
47,
13,
5662,
2969,
13,
8610,
1600,
366,
4303,
13,
35,
40760,
13,
2538,
405,
13,
1268,
33116,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
11473,
4943,
198,
198,
2235,
3294,
21337,
11,
3294,
2678,
198,
7890,
796,
2159,
28650,
6601,
51,
67,
13,
86,
10989,
7,
14692,
12805,
13,
16630,
47,
13,
5662,
2969,
13,
8610,
1600,
366,
4303,
13,
35,
40760,
13,
2538,
405,
13,
1268,
33116,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14631,
11473,
1600,
366,
2937,
1600,
366,
7206,
8973,
8,
198,
198,
2235,
976,
11,
475,
355,
6060,
19778,
198,
7890,
796,
2159,
28650,
6601,
51,
67,
13,
86,
10989,
7,
14692,
12805,
13,
16630,
47,
13,
5662,
2969,
13,
8610,
1600,
366,
4303,
13,
35,
40760,
13,
2538,
405,
13,
1268,
33116,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14631,
11473,
1600,
366,
2937,
1600,
366,
7206,
33116,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5794,
796,
6060,
19778,
8,
198,
198,
2235,
3294,
21337,
11,
3294,
2678,
11,
3224,
1321,
198,
7890,
796,
2159,
28650,
6601,
51,
67,
13,
86,
10989,
7,
14692,
12805,
13,
16630,
47,
13,
5662,
2969,
13,
8610,
1600,
366,
4303,
13,
35,
40760,
13,
2538,
405,
13,
1268,
33116,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14631,
11473,
1600,
366,
2937,
1600,
366,
7206,
33116,
3131,
796,
2081,
8,
198,
198,
7890,
58,
16,
25,
20,
11,
1058,
60,
198,
198,
19315,
6601,
796,
651,
45607,
48526,
7203,
9127,
1678,
4943,
198,
19315,
6601,
58,
16,
25,
20,
11,
1058,
60,
198,
198,
14933,
7,
19315,
6601,
8,
198,
198,
7857,
7,
19315,
6601,
8,
198,
198,
521,
26407,
6601,
796,
651,
45607,
48526,
7203,
521,
44549,
4943,
198,
521,
26407,
6601,
58,
16,
25,
20,
11,
1058,
60,
198,
198,
14933,
7,
521,
26407,
6601,
8,
198,
198,
7857,
7,
521,
26407,
6601,
8,
198,
198,
10603,
28650,
6601,
51,
67,
13,
19315,
62,
23870,
58,
16,
25,
20,
11,
1058,
60,
198,
198,
10603,
28650,
6601,
51,
67,
13,
521,
26407,
62,
23870,
58,
16,
25,
20,
11,
1058,
60,
198,
198,
411,
796,
2989,
62,
86,
10989,
7203,
9127,
1678,
1600,
1058,
3672,
11,
374,
1,
41187,
1,
72,
8,
198,
411,
198,
198,
411,
796,
2989,
62,
86,
10989,
7203,
521,
44549,
1600,
1058,
11213,
11,
374,
1,
47181,
2260,
20705,
1,
72,
8,
198,
411,
58,
25,
3672,
60,
198,
198,
12947,
62,
86,
10989,
7203,
9127,
1678,
1600,
1058,
26786,
17,
66,
11,
374,
1,
51,
57,
1,
72,
8,
198,
12947,
62,
86,
10989,
7203,
9127,
1678,
1600,
1058,
12519,
11,
374,
1,
45828,
3504,
1,
72,
8,
198,
12947,
62,
86,
10989,
7203,
9127,
1678,
1600,
1058,
36996,
11,
374,
1,
49022,
2253,
1,
72,
8,
198,
12947,
62,
86,
10989,
7203,
9127,
1678,
1600,
1058,
27544,
11,
374,
1,
61,
37281,
1,
72,
8,
198,
12947,
62,
86,
10989,
7203,
9127,
1678,
1600,
1058,
75,
1571,
11,
374,
1,
9865,
35257,
1,
72,
8,
198,
12947,
62,
86,
10989,
7203,
521,
44549,
1600,
1058,
3672,
11,
374,
1,
47181,
2260,
20705,
1,
72,
8,
198,
12947,
62,
86,
10989,
7203,
521,
44549,
1600,
1058,
11213,
11,
374,
1,
47181,
2260,
20705,
1,
72,
8,
198,
12947,
62,
86,
10989,
7203,
521,
44549,
1600,
1058,
10459,
62,
48806,
11,
374,
1,
50,
24196,
1,
72,
8,
198,
12947,
62,
86,
10989,
7203,
521,
44549,
1600,
1058,
10459,
62,
9971,
1634,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
1,
22289,
23270,
1,
72,
38381,
16,
25,
20,
11,
1058,
60,
198,
198,
7890,
796,
266,
10989,
7203,
12805,
13,
16630,
47,
13,
5662,
2969,
13,
8610,
1600,
14631,
2937,
2430,
11473,
33116,
7169,
11,
2321,
11,
3131,
796,
2081,
8,
198,
385,
6601,
796,
442,
74,
35,
689,
7,
87,
3784,
2124,
58,
25,
26786,
17,
66,
60,
764,
855,
366,
2937,
1600,
1123,
4475,
7,
7890,
4008,
930,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
4613,
355,
3163,
81,
7,
87,
11,
347,
970,
11,
3991,
8,
930,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
4613,
1366,
58,
87,
58,
25,
4357,
1058,
60,
198,
385,
6601,
198,
198,
7568,
1921,
796,
266,
10989,
7203,
1677,
13,
1404,
44,
13,
8220,
17,
36,
13,
42176,
1600,
366,
1921,
4943,
198,
198,
437,
198
] | 2.294792 | 960 |
module TexAssistant
import ArgParse
import TOML
include("utils.jl")
include("regexs.jl")
include("split_comment.jl")
include("expand_input.jl")
include("extract_sections_to_files.jl")
include("settings.jl")
include("extractors.jl")
include("tex_match.jl")
function __init__()
_fill_regexs!()
end
end | [
21412,
3567,
48902,
628,
220,
220,
220,
1330,
20559,
10044,
325,
198,
220,
220,
220,
1330,
41526,
43,
628,
220,
220,
220,
2291,
7203,
26791,
13,
20362,
4943,
198,
220,
220,
220,
2291,
7203,
260,
25636,
82,
13,
20362,
4943,
198,
220,
220,
220,
2291,
7203,
35312,
62,
23893,
13,
20362,
4943,
198,
220,
220,
220,
2291,
7203,
11201,
392,
62,
15414,
13,
20362,
4943,
198,
220,
220,
220,
2291,
7203,
2302,
974,
62,
23946,
62,
1462,
62,
16624,
13,
20362,
4943,
198,
220,
220,
220,
2291,
7203,
33692,
13,
20362,
4943,
198,
220,
220,
220,
2291,
7203,
2302,
974,
669,
13,
20362,
4943,
198,
220,
220,
220,
2291,
7203,
16886,
62,
15699,
13,
20362,
4943,
628,
220,
220,
220,
2163,
11593,
15003,
834,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
4808,
20797,
62,
260,
25636,
82,
0,
3419,
198,
220,
220,
220,
886,
198,
198,
437
] | 2.409396 | 149 |
# Julia program to Left Rotate a number by a specific bits.
# Left Rotate 'cnt' number of bits of the given number 'n'
function left_rotate_bits(n, cnt)
cnt = cnt % 31
while(cnt > 0)
# Store the current MSB in a temporary variable
msb = (n >> 31) & 1;
# Left rotate the given number by one bit
n = (n<<1);
# Set the dropped MSB as the new LSB
n = n | msb;
# Decrement cnt
cnt = cnt - 1
end
return n
end
print("Enter the number? ")
num = readline()
num = parse(Int, num)
print("How many bits do you want to rotate? ")
cnt = readline()
cnt = parse(Int, cnt)
left = left_rotate_bits(num, cnt)
print("The Left-rotated number is: $left")
"""
Time Complexity: O(n)
Space Complexity: O(1)
SAMPLE INPUT AND OUTPUT
Enter the number? 39
How many bits do you want to rotate? 17
The Left-rotated number is: 5111808
"""
| [
2,
22300,
1430,
284,
9578,
18481,
378,
257,
1271,
416,
257,
2176,
10340,
13,
628,
198,
2,
9578,
18481,
378,
705,
66,
429,
6,
1271,
286,
10340,
286,
262,
1813,
1271,
705,
77,
6,
198,
8818,
1364,
62,
10599,
378,
62,
9895,
7,
77,
11,
269,
429,
8,
198,
220,
220,
220,
269,
429,
796,
269,
429,
4064,
3261,
198,
220,
220,
220,
981,
7,
66,
429,
1875,
657,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
9363,
262,
1459,
6579,
33,
287,
257,
8584,
7885,
198,
220,
220,
220,
220,
220,
220,
220,
13845,
65,
796,
357,
77,
9609,
3261,
8,
1222,
352,
26,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
9578,
23064,
262,
1813,
1271,
416,
530,
1643,
198,
220,
220,
220,
220,
220,
220,
220,
299,
796,
357,
77,
16791,
16,
1776,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
5345,
262,
5710,
6579,
33,
355,
262,
649,
406,
16811,
198,
220,
220,
220,
220,
220,
220,
220,
299,
796,
299,
930,
13845,
65,
26,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
36400,
434,
269,
429,
198,
220,
220,
220,
220,
220,
220,
220,
269,
429,
796,
269,
429,
532,
352,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1441,
299,
198,
437,
198,
198,
4798,
7203,
17469,
262,
1271,
30,
366,
8,
198,
22510,
796,
1100,
1370,
3419,
198,
22510,
796,
21136,
7,
5317,
11,
997,
8,
198,
4798,
7203,
2437,
867,
10340,
466,
345,
765,
284,
23064,
30,
366,
8,
198,
66,
429,
796,
1100,
1370,
3419,
198,
66,
429,
796,
21136,
7,
5317,
11,
269,
429,
8,
198,
9464,
796,
1364,
62,
10599,
378,
62,
9895,
7,
22510,
11,
269,
429,
8,
198,
4798,
7203,
464,
9578,
12,
10599,
515,
1271,
318,
25,
720,
9464,
4943,
628,
198,
37811,
198,
7575,
19157,
414,
25,
440,
7,
77,
8,
198,
14106,
19157,
414,
25,
440,
7,
16,
8,
198,
198,
49302,
16437,
3268,
30076,
5357,
16289,
30076,
198,
198,
17469,
262,
1271,
30,
5014,
198,
2437,
867,
10340,
466,
345,
765,
284,
23064,
30,
1596,
198,
464,
9578,
12,
10599,
515,
1271,
318,
25,
642,
1157,
1507,
2919,
220,
198,
37811,
198
] | 2.452055 | 365 |
include("differencial.jl")
include("RungeKutta.jl")
"""
`dynamics(q::SatelliteToolbox.Quaternion,ω::Vector,T::Vector,I::Matrix,dt)`
トルク`T`を与えられた剛体の回転を刻み時間`dt`秒ぶん計算する関数
## Arguments
- `q::SatelliteToolbox.Quaternion` :`t`秒時点の姿勢を表す単位クォータニオン 衛星軌道面座標系の基底をボディ座標系の基底に変換する
- `ω::Vector` :`t`秒時点の角速度ベクトル ボディ座標系基準
- `T::Vector` :剛体に与えられるトルク ボディ座標系基準
- `I::Matrix` :慣性テンソル
- `dt::Number` :刻み時間
## Returns
- `(qk/norm(qk), ωk)::Tuple{SatelliteToolbox.Quaternion,Vector}` :`(t+dt)`秒時点の姿勢を表す単位クォータニオンと角速度ベクトルの組
## Example
`qk,ωk=dynamics(q,ω,T,I,dt)`
"""
function dynamics(q::SatelliteToolbox.Quaternion,ω::Vector,T::Vector,I::Matrix,dt::Number)
qk,ωk=RK4((q,ω),(T,I),dt)
return qk/norm(qk),ωk
end
| [
17256,
7203,
26069,
14226,
2413,
13,
20362,
4943,
201,
198,
17256,
7203,
10987,
469,
42,
315,
8326,
13,
20362,
4943,
201,
198,
37811,
201,
198,
63,
67,
4989,
873,
7,
80,
3712,
50,
26493,
25391,
3524,
13,
4507,
9205,
295,
11,
49535,
3712,
38469,
11,
51,
3712,
38469,
11,
40,
3712,
46912,
11,
28664,
8,
63,
220,
220,
201,
198,
13298,
9202,
14099,
63,
51,
63,
31758,
10310,
236,
2515,
230,
36853,
39258,
25224,
30298,
249,
19526,
241,
15474,
249,
252,
43102,
95,
31758,
26344,
119,
2515,
123,
162,
25081,
38461,
241,
63,
28664,
63,
163,
100,
240,
2515,
114,
22174,
164,
101,
230,
163,
106,
245,
33623,
25748,
38461,
95,
46763,
108,
201,
198,
2235,
20559,
2886,
201,
198,
12,
4600,
80,
3712,
50,
26493,
25391,
3524,
13,
4507,
9205,
295,
63,
1058,
63,
83,
63,
163,
100,
240,
162,
25081,
163,
224,
117,
15474,
100,
123,
47947,
95,
31758,
26193,
101,
33623,
39355,
246,
19526,
235,
14099,
37662,
6312,
23376,
30165,
20513,
6527,
5525,
94,
249,
23626,
253,
43102,
234,
34402,
241,
165,
251,
95,
41753,
100,
162,
101,
247,
163,
111,
119,
15474,
253,
118,
41753,
243,
31758,
1209,
250,
40629,
41753,
100,
162,
101,
247,
163,
111,
119,
15474,
253,
118,
41753,
243,
28618,
13783,
231,
162,
237,
249,
33623,
25748,
201,
198,
12,
4600,
49535,
3712,
38469,
63,
220,
220,
220,
220,
1058,
63,
83,
63,
163,
100,
240,
162,
25081,
163,
224,
117,
5641,
164,
100,
240,
34460,
253,
41753,
99,
35604,
14099,
13298,
9202,
5099,
222,
1209,
250,
40629,
41753,
100,
162,
101,
247,
163,
111,
119,
161,
253,
118,
162,
118,
244,
201,
198,
12,
4600,
51,
3712,
38469,
63,
220,
220,
220,
220,
1058,
30298,
249,
19526,
241,
28618,
10310,
236,
2515,
230,
36853,
39258,
25748,
13298,
9202,
14099,
5099,
222,
1209,
250,
40629,
41753,
100,
162,
101,
247,
163,
111,
119,
161,
253,
118,
162,
118,
244,
201,
198,
12,
4600,
40,
3712,
46912,
63,
220,
220,
220,
220,
1058,
162,
227,
96,
45250,
100,
24336,
6527,
47559,
9202,
201,
198,
12,
4600,
28664,
3712,
15057,
63,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1058,
26344,
119,
2515,
123,
162,
25081,
38461,
241,
201,
198,
201,
198,
2235,
16409,
201,
198,
12,
4600,
7,
80,
74,
14,
27237,
7,
80,
74,
828,
18074,
231,
74,
2599,
25,
51,
29291,
90,
50,
26493,
25391,
3524,
13,
4507,
9205,
295,
11,
38469,
92,
63,
1058,
63,
7,
83,
10,
28664,
8,
63,
163,
100,
240,
162,
25081,
163,
224,
117,
15474,
100,
123,
47947,
95,
31758,
26193,
101,
33623,
39355,
246,
19526,
235,
14099,
37662,
6312,
23376,
30165,
20513,
6527,
30201,
164,
100,
240,
34460,
253,
41753,
99,
35604,
14099,
13298,
9202,
17683,
113,
226,
201,
198,
201,
198,
2235,
17934,
201,
198,
63,
80,
74,
11,
49535,
74,
28,
67,
4989,
873,
7,
80,
11,
49535,
11,
51,
11,
40,
11,
28664,
8,
63,
201,
198,
37811,
201,
198,
8818,
17262,
7,
80,
3712,
50,
26493,
25391,
3524,
13,
4507,
9205,
295,
11,
49535,
3712,
38469,
11,
51,
3712,
38469,
11,
40,
3712,
46912,
11,
28664,
3712,
15057,
8,
201,
198,
220,
220,
220,
10662,
74,
11,
49535,
74,
28,
49,
42,
19,
19510,
80,
11,
49535,
828,
7,
51,
11,
40,
828,
28664,
8,
220,
201,
198,
220,
220,
220,
1441,
10662,
74,
14,
27237,
7,
80,
74,
828,
49535,
74,
201,
198,
437,
201,
198
] | 1.304577 | 568 |
Dict{Float32,String}(
19=>"North Europe",
8=>"Central Europe",
15=>"South Europe",
33=>"West South America",
2=>"Amazon",
18=>"Northeast Brazil",
26=>"Southeastern South America",
5=>"Central America/Mexico",
1=>"Alaska/N.W. Canada",
13=>"East North America",
32=>"West North America",
10=>"Central North America",
9=>"Canada/Greenland/Iceland" ,
11=>"East Africa",
30=>"West Asia" ,
29=>"West Africa" ,
22=>"Sahara",
21=>"Southern Africa",
7=>"Central Asia",
12=>"East Asia",
28=>"Tibetan Plateau",
16=>"North Asia",
25=>"Southeast Asia",
23=>"South Asia",
17=>"Northern Australia",
24=>"Southern Australia")
| [
35,
713,
90,
43879,
2624,
11,
10100,
92,
7,
198,
1129,
14804,
1,
14157,
2031,
1600,
198,
23,
14804,
1,
30645,
2031,
1600,
198,
1314,
14804,
1,
14942,
2031,
1600,
198,
2091,
14804,
1,
15045,
2520,
2253,
1600,
198,
17,
14804,
1,
24888,
1600,
198,
1507,
14804,
1,
45,
419,
9522,
7595,
1600,
198,
2075,
14804,
1,
50,
27873,
2520,
2253,
1600,
198,
20,
14804,
1,
30645,
2253,
14,
33006,
1600,
198,
16,
14804,
1,
2348,
8480,
14,
45,
13,
54,
13,
3340,
1600,
198,
1485,
14804,
1,
25234,
2258,
2253,
1600,
198,
2624,
14804,
1,
15045,
2258,
2253,
1600,
198,
940,
14804,
1,
30645,
2258,
2253,
1600,
198,
24,
14804,
1,
17940,
14,
13719,
1044,
14,
23709,
1044,
1,
837,
198,
1157,
14804,
1,
25234,
5478,
1600,
198,
1270,
14804,
1,
15045,
7229,
1,
837,
198,
1959,
14804,
1,
15045,
5478,
1,
837,
198,
1828,
14804,
1,
32194,
3301,
1600,
198,
2481,
14804,
1,
44993,
5478,
1600,
198,
22,
14804,
1,
30645,
7229,
1600,
198,
1065,
14804,
1,
25234,
7229,
1600,
198,
2078,
14804,
1,
51,
571,
316,
272,
23648,
559,
1600,
198,
1433,
14804,
1,
14157,
7229,
1600,
198,
1495,
14804,
1,
50,
14474,
7229,
1600,
198,
1954,
14804,
1,
14942,
7229,
1600,
198,
1558,
14804,
1,
40495,
4505,
1600,
198,
1731,
14804,
1,
44993,
4505,
4943,
198
] | 2.772727 | 220 |
using Metal
@show devices()
dev = MtlDevice(1)
#lib = MTL.LibraryWithFile(d, "default.metallib")
src = read(dirname(pathof(Metal))*"/Metal/kernels/add.metal", String)
bufferSize = 128
bufferA = MtlArray{Float32,1}(undef, tuple(bufferSize), storage=Shared)
bufferB = MtlArray{Float32,1}(undef, tuple(bufferSize), storage=Shared)
bufferC = MtlArray{Float32,1}(undef, tuple(bufferSize), storage=Shared)
vecA = unsafe_wrap(Vector{Float32}, bufferA.buffer, tuple(bufferSize))
vecB = unsafe_wrap(Vector{Float32}, bufferB.buffer, tuple(bufferSize))
vecC = unsafe_wrap(Vector{Float32}, bufferC.buffer, tuple(bufferSize))
using Random
rand!.([vecA, vecB])
## Setup
opts = MtlCompileOptions()
lib = MtlLibrary(dev, src, opts)
fun = MtlFunction(lib, "add_arrays")
pip_addfun = MtlComputePipelineState(dev, fun)
queue = global_queue(dev) #MtlCommandQueue(dev)
##
vecA .= 0.0; vecB .= 0.0; vecC .= 0.0;
cmd = MTL.commit!(queue) do cmdbuf
MtlComputeCommandEncoder(cmdbuf) do enc
MTL.set_function!(enc, pip_addfun)
MTL.set_buffer!(enc, bufferA.buffer, 0, 1)
MTL.set_buffer!(enc, bufferB.buffer, 0, 2)
MTL.set_buffer!(enc, bufferC.buffer, 0, 3)
#MTL.set_buffers!(enc,
# [bufferA.buffer, bufferB.buffer, bufferC.buffer],
# [0,0,0], 1:3)
gridSize = MtSize(length(vecA), 1, 1)
threadGroupSize = min(length(vecA), pip_addfun.maxTotalThreadsPerThreadgroup)
threadGroupSize = MTL.MtSize(threadGroupSize, 1, 1)
@info threadGroupSize
MTL.append_current_function!(enc, gridSize, threadGroupSize)
end
end
# Execute
wait(cmd)
@show vecC
| [
3500,
12136,
198,
198,
31,
12860,
4410,
3419,
198,
7959,
796,
18632,
75,
24728,
7,
16,
8,
628,
198,
2,
8019,
796,
337,
14990,
13,
23377,
3152,
8979,
7,
67,
11,
366,
12286,
13,
4164,
439,
571,
4943,
198,
10677,
796,
1100,
7,
15908,
3672,
7,
6978,
1659,
7,
36790,
4008,
9,
1,
14,
36790,
14,
74,
44930,
14,
2860,
13,
28469,
1600,
10903,
8,
198,
198,
22252,
10699,
796,
13108,
198,
22252,
32,
796,
18632,
75,
19182,
90,
43879,
2624,
11,
16,
92,
7,
917,
891,
11,
46545,
7,
22252,
10699,
828,
6143,
28,
2484,
1144,
8,
198,
22252,
33,
796,
18632,
75,
19182,
90,
43879,
2624,
11,
16,
92,
7,
917,
891,
11,
46545,
7,
22252,
10699,
828,
6143,
28,
2484,
1144,
8,
198,
22252,
34,
796,
18632,
75,
19182,
90,
43879,
2624,
11,
16,
92,
7,
917,
891,
11,
46545,
7,
22252,
10699,
828,
6143,
28,
2484,
1144,
8,
198,
198,
35138,
32,
796,
21596,
62,
37150,
7,
38469,
90,
43879,
2624,
5512,
11876,
32,
13,
22252,
11,
46545,
7,
22252,
10699,
4008,
198,
35138,
33,
796,
21596,
62,
37150,
7,
38469,
90,
43879,
2624,
5512,
11876,
33,
13,
22252,
11,
46545,
7,
22252,
10699,
4008,
198,
35138,
34,
796,
21596,
62,
37150,
7,
38469,
90,
43879,
2624,
5512,
11876,
34,
13,
22252,
11,
46545,
7,
22252,
10699,
4008,
198,
198,
3500,
14534,
198,
25192,
0,
12195,
58,
35138,
32,
11,
43030,
33,
12962,
198,
198,
2235,
31122,
198,
404,
912,
796,
18632,
75,
7293,
576,
29046,
3419,
198,
8019,
796,
18632,
75,
23377,
7,
7959,
11,
12351,
11,
2172,
82,
8,
198,
198,
12543,
796,
18632,
75,
22203,
7,
8019,
11,
366,
2860,
62,
3258,
592,
4943,
198,
79,
541,
62,
2860,
12543,
796,
18632,
75,
7293,
1133,
47,
541,
4470,
9012,
7,
7959,
11,
1257,
8,
198,
36560,
796,
3298,
62,
36560,
7,
7959,
8,
1303,
44,
28781,
21575,
34991,
7,
7959,
8,
198,
198,
2235,
198,
35138,
32,
764,
28,
657,
13,
15,
26,
43030,
33,
764,
28,
657,
13,
15,
26,
43030,
34,
764,
28,
657,
13,
15,
26,
198,
28758,
796,
337,
14990,
13,
41509,
0,
7,
36560,
8,
466,
23991,
29325,
198,
220,
220,
220,
18632,
75,
7293,
1133,
21575,
27195,
12342,
7,
28758,
29325,
8,
466,
2207,
198,
220,
220,
220,
220,
220,
220,
220,
337,
14990,
13,
2617,
62,
8818,
0,
7,
12685,
11,
7347,
62,
2860,
12543,
8,
198,
220,
220,
220,
220,
220,
220,
220,
337,
14990,
13,
2617,
62,
22252,
0,
7,
12685,
11,
11876,
32,
13,
22252,
11,
657,
11,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
337,
14990,
13,
2617,
62,
22252,
0,
7,
12685,
11,
11876,
33,
13,
22252,
11,
657,
11,
362,
8,
198,
220,
220,
220,
220,
220,
220,
220,
337,
14990,
13,
2617,
62,
22252,
0,
7,
12685,
11,
11876,
34,
13,
22252,
11,
657,
11,
513,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
13752,
43,
13,
2617,
62,
36873,
364,
0,
7,
12685,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
22252,
32,
13,
22252,
11,
11876,
33,
13,
22252,
11,
11876,
34,
13,
22252,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
15,
11,
15,
11,
15,
4357,
352,
25,
18,
8,
198,
220,
220,
220,
220,
220,
220,
220,
10706,
10699,
796,
18632,
10699,
7,
13664,
7,
35138,
32,
828,
352,
11,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
4704,
13247,
10699,
796,
949,
7,
13664,
7,
35138,
32,
828,
7347,
62,
2860,
12543,
13,
9806,
14957,
16818,
82,
5990,
16818,
8094,
8,
198,
220,
220,
220,
220,
220,
220,
220,
4704,
13247,
10699,
796,
337,
14990,
13,
44,
83,
10699,
7,
16663,
13247,
10699,
11,
352,
11,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
10951,
4704,
13247,
10699,
198,
220,
220,
220,
220,
220,
220,
220,
337,
14990,
13,
33295,
62,
14421,
62,
8818,
0,
7,
12685,
11,
10706,
10699,
11,
4704,
13247,
10699,
8,
198,
220,
220,
220,
886,
198,
437,
198,
198,
2,
8393,
1133,
198,
17077,
7,
28758,
8,
198,
198,
31,
12860,
43030,
34,
198
] | 2.264228 | 738 |
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Description
# ==============================================================================
#
# Structures related to the orbit propagators.
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
export OrbitPropagator
"""
OrbitPropagator{T}
Abstract type of the orbit propagator. Every propagator structure must be a
subtype of this type and must implement the following API functions:
propagate!(orbp, t::Number)
propagate!(orbp, t::AbstractVector)
propagate_to_epoch!(orbp, JD::Number)
propagate_to_epoch!(orbp, JD::AbstractVector)
step!(orbp, Δt::Number)
"""
abstract type OrbitPropagator{T} end
# Two Body Orbit Propagator
# ==============================================================================
export TwoBody_Structure, OrbitPropagatorTwoBody
"""
TwoBody_Structure{T}
Low level Two Body orbit propagator structure.
"""
@with_kw mutable struct TwoBody_Structure{T}
# Initial mean orbital elements
# ==========================================================================
epoch::T # ......................... Epoch of the initial mean elements [JD]
a_0::T # ..................... Initial mean normalized semi-major axis [m]
n_0::T # ..................................... Initial mean motion [rad/s]
e_0::T # .................................. Initial mean eccentricity [ ]
i_0::T # .................................. Initial mean inclination [rad]
Ω_0::T # ......................................... Initial mean RAAN [rad]
ω_0::T # .......................... Initial mean argument of perigee [rad]
f_0::T # ................................. Initial mean true anomaly [rad]
M_0::T # ................................. Initial mean mean anomaly [rad]
μ::T # .. Standard gravitational parameter of the central body [m^3/s^2]
# Current mean orbital elements
# ==========================================================================
Δt::T # .............. Timespan from the epoch of the initial elements [s]
f_k::T # .................................. Current mean true anomaly [rad]
M_k::T # .................................. Current mean mean anomaly [rad]
end
"""
OrbitPropagatorTwoBody{T} <: OrbitPropagator{T}
Structure that holds the information related to the Two Body orbit propagator.
# Fields
* `orb`: Mean orbital elements (see `Orbit`).
* `tbd`: Structure that stores the Two Body orbit propagator data (see
`TwoBody_Structure`).
"""
struct OrbitPropagatorTwoBody{T} <: OrbitPropagator{T}
tbd::TwoBody_Structure{T}
end
# J2 Orbit Propagator
# ==============================================================================
export J2_GravCte, J2_Structure, OrbitPropagatorJ2
"""
J2_GravCte{T}
Gravitational constants for J2 orbit propagator.
# Fields
* `R0`: Earth equatorial radius [m].
* `μm`: √GM [er/s]^(3/2).
* `J2`: The second gravitational zonal harmonic of the Earth.
"""
@with_kw struct J2_GravCte{T}
R0::T
μm::T
J2::T
end
"""
J2_Structure{T}
Low level J2 orbit propagator structure.
"""
@with_kw mutable struct J2_Structure{T}
# Initial mean orbital elements
# ==========================================================================
epoch::T # ............ Epoch of the initial mean elements [JD]
al_0::T # ....... Initial mean normalized semi-major axis [er]
n_0::T # ........................ Initial mean motion [rad/s]
e_0::T # ..................... Initial mean eccentricity [ ]
i_0::T # ..................... Initial mean inclination [rad]
Ω_0::T # ............................ Initial mean RAAN [rad]
ω_0::T # ............. Initial mean argument of perigee [rad]
f_0::T # .................... Initial mean true anomaly [rad]
M_0::T # .................... Initial mean mean anomaly [rad]
dn_o2::T # ...... First time derivative of mean motion [rad/s²]
ddn_o6::T # ..... Second time derivative of mean motion [rad/s³]
j2_gc::J2_GravCte{T} # ........ J2 orbit propagator gravitational constants
# Current mean orbital elements
# ==========================================================================
Δt::T # .............. Timespan from the epoch of the initial elements [s]
al_k::T # ..................... Current mean normalized semi-major axis [er]
e_k::T # ................................... Current mean eccentricity [ ]
i_k::T # ................................... Current mean inclination [rad]
Ω_k::T # .......................................... Current mean RAAN [rad]
ω_k::T # ........................... Current mean argument of perigee [rad]
f_k::T # .................................. Current mean true anomaly [rad]
M_k::T # .................................. Current mean mean anomaly [rad]
# Auxiliary variables
# ==========================================================================
δa::T # ........................... Semi-major axis time derivative [er/s]
δe::T # ............................... Eccentricity time derivative [1/s]
δΩ::T # ..................................... RAAN time derivative [rad/s]
δω::T # ...................... Argument of perigee time derivative [rad/s]
δM_0::T # ............................. Mean anomaly time derivative [rad/s]
end
"""
OrbitPropagatorJ2{T} <: OrbitPropagator{T}
Structure that holds the information related to the J2 orbit propagator.
# Fields
* `j2d`: Structure that stores the J2 orbit propagator data (see
`J2_Structure`).
"""
struct OrbitPropagatorJ2{T} <: OrbitPropagator{T}
j2d::J2_Structure{T}
end
# J2 osculating orbit propagator
# ==============================================================================
export J2osc_Strutcture, OrbitPropagatorJ2osc
"""
J2osc_Structure{T}
Low level J2 osculating orbit propagator structure.
"""
@with_kw mutable struct J2osc_Structure{T}
# J2 orbit propagator to propagate the mean elements.
j2d::J2_Structure{T}
# Propagation time from epoch.
Δt::T
# Current osculating Keplerian elements
# ==========================================================================
a_k::T # ................................... Osculating semi-major axis [er]
e_k::T # ....................................... Osculating eccentricity [ ]
i_k::T # ...................................... Osculating inclination [rad]
Ω_k::T # ............................................. Osculating RAAN [rad]
ω_k::T # .............................. Osculating argument of perigee [rad]
f_k::T # ..................................... Osculating true anomaly [rad]
M_k::T # ..................................... Osculating mean anomaly [rad]
end
"""
OrbitPropagatorJ2osc{T} <: OrbitPropagator{T}
Structure that holds the information related to the J2 osculating orbit
propagator.
# Fields
* `j2oscd`: Structure that stores the J2 osculating orbit propagator data (see
`J2osc_Structure`).
"""
struct OrbitPropagatorJ2osc{T} <: OrbitPropagator{T}
j2oscd::J2osc_Structure{T}
end
# J4 orbit propagator
# ==============================================================================
export J4_GravCte, J4_Structure, OrbitPropagatorJ4
"""
J4_GravCte{T}
Gravitational constants for J4 orbit propagator.
# Fields
* `R0`: Earth equatorial radius [m].
* `μm`: √GM [er/s]^(3/2).
* `J2`: The second gravitational zonal harmonic of the Earth.
* `J4`: The fourth gravitational zonal harmonic of the Earth.
"""
@with_kw struct J4_GravCte{T}
R0::T
μm::T
J2::T
J4::T
end
"""
J4_Structure{T}
Low level J4 orbit propagator structure.
"""
@with_kw mutable struct J4_Structure{T}
# Initial mean orbital elements
# ==========================================================================
epoch::T # ............ Epoch of the initial mean elements [JD]
al_0::T # ....... Initial mean normalized semi-major axis [er]
n_0::T # ........................ Initial mean motion [rad/s]
e_0::T # ..................... Initial mean eccentricity [ ]
i_0::T # ..................... Initial mean inclination [rad]
Ω_0::T # ............................ Initial mean RAAN [rad]
ω_0::T # ............. Initial mean argument of perigee [rad]
f_0::T # .................... Initial mean true anomaly [rad]
M_0::T # .................... Initial mean mean anomaly [rad]
dn_o2::T # ...... First time derivative of mean motion [rad/s²]
ddn_o6::T # ..... Second time derivative of mean motion [rad/s³]
j4_gc::J4_GravCte{T} # ........ J4 orbit propagator gravitational constants
# Current mean orbital elements
# ==========================================================================
Δt::T # .............. Timespan from the epoch of the initial elements [s]
al_k::T # ..................... Current mean normalized semi-major axis [er]
e_k::T # ................................... Current mean eccentricity [ ]
i_k::T # ................................... Current mean inclination [rad]
Ω_k::T # .......................................... Current mean RAAN [rad]
ω_k::T # ........................... Current mean argument of perigee [rad]
f_k::T # .................................. Current mean true anomaly [rad]
M_k::T # .................................. Current mean mean anomaly [rad]
# Auxiliary variables
# ==========================================================================
δa::T # ........................... Semi-major axis time derivative [er/s]
δe::T # ............................... Eccentricity time derivative [1/s]
δΩ::T # ..................................... RAAN time derivative [rad/s]
δω::T # ...................... Argument of perigee time derivative [rad/s]
δM_0::T # ............................. Mean anomaly time derivative [rad/s]
end
"""
OrbitPropagatorJ4{T} <: OrbitPropagator{T}
Structure that holds the information related to the J4 orbit propagator.
# Fields
* `j4d`: Structure that stores the J4 orbit propagator data (see
`J4_Structure`).
"""
struct OrbitPropagatorJ4{T} <: OrbitPropagator{T}
j4d::J4_Structure{T}
end
# SGP4
# ==============================================================================
export OrbitPropagatorSGP4
"""
OrbitPropagatorSGP4{T} <: OrbitPropagator{T}
Structure that holds the information related to the SGP4 propagator.
# Fields
* `sgp4d`: Structure that stores the SGP4 data (see `SGP4_Structure`).
"""
struct OrbitPropagatorSGP4{T} <: OrbitPropagator{T}
sgp4d::SGP4_Structure{T}
end
| [
2,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
198,
2,
198,
2,
12489,
198,
2,
38093,
25609,
28,
198,
2,
198,
2,
220,
220,
32112,
942,
3519,
284,
262,
13066,
8928,
2024,
13,
198,
2,
198,
2,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
198,
198,
39344,
38161,
24331,
363,
1352,
198,
198,
37811,
198,
220,
220,
220,
38161,
24331,
363,
1352,
90,
51,
92,
198,
198,
23839,
2099,
286,
262,
13066,
8928,
1352,
13,
3887,
8928,
1352,
4645,
1276,
307,
257,
198,
7266,
4906,
286,
428,
2099,
290,
1276,
3494,
262,
1708,
7824,
5499,
25,
628,
220,
220,
220,
47933,
0,
7,
27688,
79,
11,
256,
3712,
15057,
8,
198,
220,
220,
220,
47933,
0,
7,
27688,
79,
11,
256,
3712,
23839,
38469,
8,
198,
220,
220,
220,
47933,
62,
1462,
62,
538,
5374,
0,
7,
27688,
79,
11,
28591,
3712,
15057,
8,
198,
220,
220,
220,
47933,
62,
1462,
62,
538,
5374,
0,
7,
27688,
79,
11,
28591,
3712,
23839,
38469,
8,
198,
220,
220,
220,
2239,
0,
7,
27688,
79,
11,
37455,
83,
3712,
15057,
8,
198,
198,
37811,
198,
397,
8709,
2099,
38161,
24331,
363,
1352,
90,
51,
92,
886,
198,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4930,
12290,
38161,
8772,
363,
1352,
198,
2,
38093,
25609,
28,
198,
198,
39344,
4930,
25842,
62,
1273,
5620,
11,
38161,
24331,
363,
1352,
7571,
25842,
198,
198,
37811,
198,
220,
220,
220,
4930,
25842,
62,
1273,
5620,
90,
51,
92,
198,
198,
20535,
1241,
4930,
12290,
13066,
8928,
1352,
4645,
13,
198,
198,
37811,
198,
31,
4480,
62,
46265,
4517,
540,
2878,
4930,
25842,
62,
1273,
5620,
90,
51,
92,
198,
220,
220,
220,
1303,
20768,
1612,
32362,
4847,
198,
220,
220,
220,
1303,
38093,
2559,
28,
198,
220,
220,
220,
36835,
3712,
51,
1303,
44713,
34617,
4551,
5374,
286,
262,
4238,
1612,
4847,
685,
37882,
60,
198,
220,
220,
220,
257,
62,
15,
3712,
51,
220,
220,
1303,
44713,
12359,
20768,
1612,
39279,
10663,
12,
22478,
16488,
685,
76,
60,
198,
220,
220,
220,
299,
62,
15,
3712,
51,
220,
220,
1303,
220,
8864,
12359,
20768,
1612,
6268,
685,
6335,
14,
82,
60,
198,
220,
220,
220,
304,
62,
15,
3712,
51,
220,
220,
1303,
220,
8864,
492,
20768,
1612,
29303,
414,
685,
220,
2361,
198,
220,
220,
220,
1312,
62,
15,
3712,
51,
220,
220,
1303,
220,
8864,
492,
20768,
1612,
36793,
685,
6335,
60,
198,
220,
220,
220,
7377,
102,
62,
15,
3712,
51,
220,
220,
1303,
220,
8864,
34617,
20768,
1612,
17926,
1565,
685,
6335,
60,
198,
220,
220,
220,
18074,
231,
62,
15,
3712,
51,
220,
220,
1303,
220,
27754,
492,
20768,
1612,
4578,
286,
583,
328,
1453,
685,
6335,
60,
198,
220,
220,
220,
277,
62,
15,
3712,
51,
220,
220,
1303,
220,
27754,
34617,
20768,
1612,
2081,
32172,
685,
6335,
60,
198,
220,
220,
220,
337,
62,
15,
3712,
51,
220,
220,
1303,
220,
27754,
34617,
20768,
1612,
1612,
32172,
685,
6335,
60,
198,
220,
220,
220,
18919,
3712,
51,
220,
220,
220,
220,
1303,
11485,
8997,
29973,
11507,
286,
262,
4318,
1767,
685,
76,
61,
18,
14,
82,
61,
17,
60,
628,
220,
220,
220,
1303,
9236,
1612,
32362,
4847,
198,
220,
220,
220,
1303,
38093,
2559,
28,
198,
220,
220,
220,
37455,
83,
3712,
51,
220,
220,
1303,
44912,
3782,
6839,
422,
262,
36835,
286,
262,
4238,
4847,
685,
82,
60,
198,
220,
220,
220,
277,
62,
74,
3712,
51,
220,
1303,
220,
8864,
492,
9236,
1612,
2081,
32172,
685,
6335,
60,
198,
220,
220,
220,
337,
62,
74,
3712,
51,
220,
1303,
220,
8864,
492,
9236,
1612,
1612,
32172,
685,
6335,
60,
198,
437,
198,
198,
37811,
198,
220,
220,
220,
38161,
24331,
363,
1352,
7571,
25842,
90,
51,
92,
1279,
25,
38161,
24331,
363,
1352,
90,
51,
92,
198,
198,
1273,
5620,
326,
6622,
262,
1321,
3519,
284,
262,
4930,
12290,
13066,
8928,
1352,
13,
198,
198,
2,
23948,
198,
198,
9,
4600,
27688,
63,
25,
22728,
32362,
4847,
357,
3826,
4600,
5574,
2545,
63,
737,
198,
9,
4600,
83,
17457,
63,
25,
32522,
326,
7000,
262,
4930,
12290,
13066,
8928,
1352,
1366,
357,
3826,
198,
220,
220,
220,
220,
220,
220,
220,
4600,
7571,
25842,
62,
1273,
5620,
63,
737,
198,
198,
37811,
198,
7249,
38161,
24331,
363,
1352,
7571,
25842,
90,
51,
92,
1279,
25,
38161,
24331,
363,
1352,
90,
51,
92,
198,
220,
220,
220,
256,
17457,
3712,
7571,
25842,
62,
1273,
5620,
90,
51,
92,
198,
437,
198,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
449,
17,
38161,
8772,
363,
1352,
198,
2,
38093,
25609,
28,
198,
198,
39344,
449,
17,
62,
38,
4108,
34,
660,
11,
449,
17,
62,
1273,
5620,
11,
38161,
24331,
363,
1352,
41,
17,
198,
198,
37811,
198,
220,
220,
220,
449,
17,
62,
38,
4108,
34,
660,
90,
51,
92,
198,
198,
38,
4108,
22181,
38491,
329,
449,
17,
13066,
8928,
1352,
13,
198,
198,
2,
23948,
198,
198,
9,
4600,
49,
15,
63,
25,
3668,
1602,
21592,
16874,
685,
76,
4083,
198,
9,
4600,
34703,
76,
63,
25,
18872,
248,
15548,
685,
263,
14,
82,
60,
61,
7,
18,
14,
17,
737,
198,
9,
4600,
41,
17,
63,
25,
383,
1218,
29973,
1976,
20996,
49239,
286,
262,
3668,
13,
198,
198,
37811,
198,
31,
4480,
62,
46265,
2878,
449,
17,
62,
38,
4108,
34,
660,
90,
51,
92,
198,
220,
220,
220,
371,
15,
3712,
51,
198,
220,
220,
220,
18919,
76,
3712,
51,
198,
220,
220,
220,
449,
17,
3712,
51,
198,
437,
198,
198,
37811,
198,
220,
220,
220,
449,
17,
62,
1273,
5620,
90,
51,
92,
198,
198,
20535,
1241,
449,
17,
13066,
8928,
1352,
4645,
13,
198,
198,
37811,
198,
31,
4480,
62,
46265,
4517,
540,
2878,
449,
17,
62,
1273,
5620,
90,
51,
92,
198,
220,
220,
220,
1303,
20768,
1612,
32362,
4847,
198,
220,
220,
220,
1303,
38093,
2559,
28,
198,
220,
220,
220,
36835,
3712,
51,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
20004,
1106,
4551,
5374,
286,
262,
4238,
1612,
4847,
685,
37882,
60,
198,
220,
220,
220,
435,
62,
15,
3712,
51,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
19424,
986,
20768,
1612,
39279,
10663,
12,
22478,
16488,
685,
263,
60,
198,
220,
220,
220,
299,
62,
15,
3712,
51,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
27754,
20768,
1612,
6268,
685,
6335,
14,
82,
60,
198,
220,
220,
220,
304,
62,
15,
3712,
51,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
44713,
12359,
20768,
1612,
29303,
414,
685,
220,
2361,
198,
220,
220,
220,
1312,
62,
15,
3712,
51,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
44713,
12359,
20768,
1612,
36793,
685,
6335,
60,
198,
220,
220,
220,
7377,
102,
62,
15,
3712,
51,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
27754,
1106,
20768,
1612,
17926,
1565,
685,
6335,
60,
198,
220,
220,
220,
18074,
231,
62,
15,
3712,
51,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
20004,
12359,
20768,
1612,
4578,
286,
583,
328,
1453,
685,
6335,
60,
198,
220,
220,
220,
277,
62,
15,
3712,
51,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
44713,
1106,
20768,
1612,
2081,
32172,
685,
6335,
60,
198,
220,
220,
220,
337,
62,
15,
3712,
51,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
44713,
1106,
20768,
1612,
1612,
32172,
685,
6335,
60,
198,
220,
220,
220,
288,
77,
62,
78,
17,
3712,
51,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
47082,
3274,
640,
27255,
286,
1612,
6268,
685,
6335,
14,
82,
31185,
60,
198,
220,
220,
220,
288,
32656,
62,
78,
21,
3712,
51,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
11485,
986,
5498,
640,
27255,
286,
1612,
6268,
685,
6335,
14,
82,
126,
111,
60,
198,
220,
220,
220,
474,
17,
62,
36484,
3712,
41,
17,
62,
38,
4108,
34,
660,
90,
51,
92,
220,
1303,
20004,
449,
17,
13066,
8928,
1352,
29973,
38491,
628,
220,
220,
220,
1303,
9236,
1612,
32362,
4847,
198,
220,
220,
220,
1303,
38093,
2559,
28,
198,
220,
220,
220,
37455,
83,
3712,
51,
220,
220,
1303,
44912,
3782,
6839,
422,
262,
36835,
286,
262,
4238,
4847,
685,
82,
60,
198,
220,
220,
220,
435,
62,
74,
3712,
51,
1303,
44713,
12359,
9236,
1612,
39279,
10663,
12,
22478,
16488,
685,
263,
60,
198,
220,
220,
220,
304,
62,
74,
3712,
51,
220,
1303,
220,
8864,
986,
9236,
1612,
29303,
414,
685,
220,
2361,
198,
220,
220,
220,
1312,
62,
74,
3712,
51,
220,
1303,
220,
8864,
986,
9236,
1612,
36793,
685,
6335,
60,
198,
220,
220,
220,
7377,
102,
62,
74,
3712,
51,
220,
1303,
220,
8864,
2109,
492,
9236,
1612,
17926,
1565,
685,
6335,
60,
198,
220,
220,
220,
18074,
231,
62,
74,
3712,
51,
220,
1303,
220,
27754,
986,
9236,
1612,
4578,
286,
583,
328,
1453,
685,
6335,
60,
198,
220,
220,
220,
277,
62,
74,
3712,
51,
220,
1303,
220,
8864,
492,
9236,
1612,
2081,
32172,
685,
6335,
60,
198,
220,
220,
220,
337,
62,
74,
3712,
51,
220,
1303,
220,
8864,
492,
9236,
1612,
1612,
32172,
685,
6335,
60,
628,
220,
220,
220,
1303,
47105,
28129,
9633,
198,
220,
220,
220,
1303,
38093,
2559,
28,
198,
220,
220,
220,
7377,
112,
64,
3712,
51,
220,
220,
1303,
220,
27754,
986,
35525,
12,
22478,
16488,
640,
27255,
685,
263,
14,
82,
60,
198,
220,
220,
220,
7377,
112,
68,
3712,
51,
220,
220,
1303,
220,
27754,
25780,
38308,
22317,
414,
640,
27255,
685,
16,
14,
82,
60,
198,
220,
220,
220,
7377,
112,
138,
102,
3712,
51,
220,
220,
1303,
220,
8864,
12359,
17926,
1565,
640,
27255,
685,
6335,
14,
82,
60,
198,
220,
220,
220,
7377,
112,
49535,
3712,
51,
220,
220,
1303,
44713,
16317,
45751,
286,
583,
328,
1453,
640,
27255,
685,
6335,
14,
82,
60,
198,
220,
220,
220,
7377,
112,
44,
62,
15,
3712,
51,
1303,
220,
27754,
12359,
22728,
32172,
640,
27255,
685,
6335,
14,
82,
60,
198,
437,
198,
198,
37811,
198,
220,
220,
220,
38161,
24331,
363,
1352,
41,
17,
90,
51,
92,
1279,
25,
38161,
24331,
363,
1352,
90,
51,
92,
198,
198,
1273,
5620,
326,
6622,
262,
1321,
3519,
284,
262,
449,
17,
13066,
8928,
1352,
13,
198,
198,
2,
23948,
198,
198,
9,
4600,
73,
17,
67,
63,
25,
32522,
326,
7000,
262,
449,
17,
13066,
8928,
1352,
1366,
357,
3826,
198,
220,
220,
220,
220,
220,
220,
220,
220,
4600,
41,
17,
62,
1273,
5620,
63,
737,
198,
198,
37811,
198,
7249,
38161,
24331,
363,
1352,
41,
17,
90,
51,
92,
1279,
25,
38161,
24331,
363,
1352,
90,
51,
92,
198,
220,
220,
220,
474,
17,
67,
3712,
41,
17,
62,
1273,
5620,
90,
51,
92,
198,
437,
198,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
449,
17,
267,
1416,
8306,
13066,
8928,
1352,
198,
2,
38093,
25609,
28,
198,
198,
39344,
449,
17,
17500,
62,
13290,
315,
48715,
11,
38161,
24331,
363,
1352,
41,
17,
17500,
198,
198,
37811,
198,
220,
220,
220,
449,
17,
17500,
62,
1273,
5620,
90,
51,
92,
198,
198,
20535,
1241,
449,
17,
267,
1416,
8306,
13066,
8928,
1352,
4645,
13,
198,
198,
37811,
198,
31,
4480,
62,
46265,
4517,
540,
2878,
449,
17,
17500,
62,
1273,
5620,
90,
51,
92,
198,
220,
220,
220,
1303,
449,
17,
13066,
8928,
1352,
284,
47933,
262,
1612,
4847,
13,
198,
220,
220,
220,
474,
17,
67,
3712,
41,
17,
62,
1273,
5620,
90,
51,
92,
628,
220,
220,
220,
1303,
8772,
363,
341,
640,
422,
36835,
13,
198,
220,
220,
220,
37455,
83,
3712,
51,
628,
220,
220,
220,
1303,
9236,
267,
1416,
8306,
40294,
666,
4847,
198,
220,
220,
220,
1303,
38093,
2559,
28,
198,
220,
220,
220,
257,
62,
74,
3712,
51,
1303,
220,
8864,
986,
40203,
8306,
10663,
12,
22478,
16488,
685,
263,
60,
198,
220,
220,
220,
304,
62,
74,
3712,
51,
1303,
220,
8864,
25780,
40203,
8306,
29303,
414,
685,
2361,
198,
220,
220,
220,
1312,
62,
74,
3712,
51,
1303,
220,
8864,
16317,
40203,
8306,
36793,
685,
6335,
60,
198,
220,
220,
220,
7377,
102,
62,
74,
3712,
51,
1303,
220,
8864,
44274,
40203,
8306,
17926,
1565,
685,
6335,
60,
198,
220,
220,
220,
18074,
231,
62,
74,
3712,
51,
1303,
220,
27754,
16317,
40203,
8306,
4578,
286,
583,
328,
1453,
685,
6335,
60,
198,
220,
220,
220,
277,
62,
74,
3712,
51,
1303,
220,
8864,
12359,
40203,
8306,
2081,
32172,
685,
6335,
60,
198,
220,
220,
220,
337,
62,
74,
3712,
51,
1303,
220,
8864,
12359,
40203,
8306,
1612,
32172,
685,
6335,
60,
198,
437,
198,
198,
37811,
198,
220,
220,
220,
38161,
24331,
363,
1352,
41,
17,
17500,
90,
51,
92,
1279,
25,
38161,
24331,
363,
1352,
90,
51,
92,
198,
198,
1273,
5620,
326,
6622,
262,
1321,
3519,
284,
262,
449,
17,
267,
1416,
8306,
13066,
198,
22930,
363,
1352,
13,
198,
198,
2,
23948,
198,
198,
9,
4600,
73,
17,
418,
10210,
63,
25,
32522,
326,
7000,
262,
449,
17,
267,
1416,
8306,
13066,
8928,
1352,
1366,
357,
3826,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4600,
41,
17,
17500,
62,
1273,
5620,
63,
737,
198,
198,
37811,
198,
7249,
38161,
24331,
363,
1352,
41,
17,
17500,
90,
51,
92,
1279,
25,
38161,
24331,
363,
1352,
90,
51,
92,
198,
220,
220,
220,
474,
17,
418,
10210,
3712,
41,
17,
17500,
62,
1273,
5620,
90,
51,
92,
198,
437,
198,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
449,
19,
13066,
8928,
1352,
198,
2,
38093,
25609,
28,
198,
198,
39344,
449,
19,
62,
38,
4108,
34,
660,
11,
449,
19,
62,
1273,
5620,
11,
38161,
24331,
363,
1352,
41,
19,
198,
198,
37811,
198,
220,
220,
220,
449,
19,
62,
38,
4108,
34,
660,
90,
51,
92,
198,
198,
38,
4108,
22181,
38491,
329,
449,
19,
13066,
8928,
1352,
13,
198,
198,
2,
23948,
198,
198,
9,
4600,
49,
15,
63,
25,
3668,
1602,
21592,
16874,
685,
76,
4083,
198,
9,
4600,
34703,
76,
63,
25,
18872,
248,
15548,
685,
263,
14,
82,
60,
61,
7,
18,
14,
17,
737,
198,
9,
4600,
41,
17,
63,
25,
383,
1218,
29973,
1976,
20996,
49239,
286,
262,
3668,
13,
198,
9,
4600,
41,
19,
63,
25,
383,
5544,
29973,
1976,
20996,
49239,
286,
262,
3668,
13,
198,
198,
37811,
198,
31,
4480,
62,
46265,
2878,
449,
19,
62,
38,
4108,
34,
660,
90,
51,
92,
198,
220,
220,
220,
371,
15,
3712,
51,
198,
220,
220,
220,
18919,
76,
3712,
51,
198,
220,
220,
220,
449,
17,
3712,
51,
198,
220,
220,
220,
449,
19,
3712,
51,
198,
437,
198,
198,
37811,
198,
220,
220,
220,
449,
19,
62,
1273,
5620,
90,
51,
92,
198,
198,
20535,
1241,
449,
19,
13066,
8928,
1352,
4645,
13,
198,
198,
37811,
198,
31,
4480,
62,
46265,
4517,
540,
2878,
449,
19,
62,
1273,
5620,
90,
51,
92,
198,
220,
220,
220,
1303,
20768,
1612,
32362,
4847,
198,
220,
220,
220,
1303,
38093,
2559,
28,
198,
220,
220,
220,
36835,
3712,
51,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
20004,
1106,
4551,
5374,
286,
262,
4238,
1612,
4847,
685,
37882,
60,
198,
220,
220,
220,
435,
62,
15,
3712,
51,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
19424,
986,
20768,
1612,
39279,
10663,
12,
22478,
16488,
685,
263,
60,
198,
220,
220,
220,
299,
62,
15,
3712,
51,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
27754,
20768,
1612,
6268,
685,
6335,
14,
82,
60,
198,
220,
220,
220,
304,
62,
15,
3712,
51,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
44713,
12359,
20768,
1612,
29303,
414,
685,
220,
2361,
198,
220,
220,
220,
1312,
62,
15,
3712,
51,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
44713,
12359,
20768,
1612,
36793,
685,
6335,
60,
198,
220,
220,
220,
7377,
102,
62,
15,
3712,
51,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
27754,
1106,
20768,
1612,
17926,
1565,
685,
6335,
60,
198,
220,
220,
220,
18074,
231,
62,
15,
3712,
51,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
20004,
12359,
20768,
1612,
4578,
286,
583,
328,
1453,
685,
6335,
60,
198,
220,
220,
220,
277,
62,
15,
3712,
51,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
44713,
1106,
20768,
1612,
2081,
32172,
685,
6335,
60,
198,
220,
220,
220,
337,
62,
15,
3712,
51,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
44713,
1106,
20768,
1612,
1612,
32172,
685,
6335,
60,
198,
220,
220,
220,
288,
77,
62,
78,
17,
3712,
51,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
47082,
3274,
640,
27255,
286,
1612,
6268,
685,
6335,
14,
82,
31185,
60,
198,
220,
220,
220,
288,
32656,
62,
78,
21,
3712,
51,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
11485,
986,
5498,
640,
27255,
286,
1612,
6268,
685,
6335,
14,
82,
126,
111,
60,
198,
220,
220,
220,
474,
19,
62,
36484,
3712,
41,
19,
62,
38,
4108,
34,
660,
90,
51,
92,
220,
1303,
20004,
449,
19,
13066,
8928,
1352,
29973,
38491,
628,
220,
220,
220,
1303,
9236,
1612,
32362,
4847,
198,
220,
220,
220,
1303,
38093,
2559,
28,
198,
220,
220,
220,
37455,
83,
3712,
51,
220,
220,
1303,
44912,
3782,
6839,
422,
262,
36835,
286,
262,
4238,
4847,
685,
82,
60,
198,
220,
220,
220,
435,
62,
74,
3712,
51,
1303,
44713,
12359,
9236,
1612,
39279,
10663,
12,
22478,
16488,
685,
263,
60,
198,
220,
220,
220,
304,
62,
74,
3712,
51,
220,
1303,
220,
8864,
986,
9236,
1612,
29303,
414,
685,
220,
2361,
198,
220,
220,
220,
1312,
62,
74,
3712,
51,
220,
1303,
220,
8864,
986,
9236,
1612,
36793,
685,
6335,
60,
198,
220,
220,
220,
7377,
102,
62,
74,
3712,
51,
220,
1303,
220,
8864,
2109,
492,
9236,
1612,
17926,
1565,
685,
6335,
60,
198,
220,
220,
220,
18074,
231,
62,
74,
3712,
51,
220,
1303,
220,
27754,
986,
9236,
1612,
4578,
286,
583,
328,
1453,
685,
6335,
60,
198,
220,
220,
220,
277,
62,
74,
3712,
51,
220,
1303,
220,
8864,
492,
9236,
1612,
2081,
32172,
685,
6335,
60,
198,
220,
220,
220,
337,
62,
74,
3712,
51,
220,
1303,
220,
8864,
492,
9236,
1612,
1612,
32172,
685,
6335,
60,
628,
220,
220,
220,
1303,
47105,
28129,
9633,
198,
220,
220,
220,
1303,
38093,
2559,
28,
198,
220,
220,
220,
7377,
112,
64,
3712,
51,
220,
220,
1303,
220,
27754,
986,
35525,
12,
22478,
16488,
640,
27255,
685,
263,
14,
82,
60,
198,
220,
220,
220,
7377,
112,
68,
3712,
51,
220,
220,
1303,
220,
27754,
25780,
38308,
22317,
414,
640,
27255,
685,
16,
14,
82,
60,
198,
220,
220,
220,
7377,
112,
138,
102,
3712,
51,
220,
220,
1303,
220,
8864,
12359,
17926,
1565,
640,
27255,
685,
6335,
14,
82,
60,
198,
220,
220,
220,
7377,
112,
49535,
3712,
51,
220,
220,
1303,
44713,
16317,
45751,
286,
583,
328,
1453,
640,
27255,
685,
6335,
14,
82,
60,
198,
220,
220,
220,
7377,
112,
44,
62,
15,
3712,
51,
1303,
220,
27754,
12359,
22728,
32172,
640,
27255,
685,
6335,
14,
82,
60,
198,
437,
198,
198,
37811,
198,
220,
220,
220,
38161,
24331,
363,
1352,
41,
19,
90,
51,
92,
1279,
25,
38161,
24331,
363,
1352,
90,
51,
92,
198,
198,
1273,
5620,
326,
6622,
262,
1321,
3519,
284,
262,
449,
19,
13066,
8928,
1352,
13,
198,
198,
2,
23948,
198,
198,
9,
4600,
73,
19,
67,
63,
25,
32522,
326,
7000,
262,
449,
19,
13066,
8928,
1352,
1366,
357,
3826,
198,
220,
220,
220,
220,
220,
220,
220,
220,
4600,
41,
19,
62,
1273,
5620,
63,
737,
198,
198,
37811,
198,
7249,
38161,
24331,
363,
1352,
41,
19,
90,
51,
92,
1279,
25,
38161,
24331,
363,
1352,
90,
51,
92,
198,
220,
220,
220,
474,
19,
67,
3712,
41,
19,
62,
1273,
5620,
90,
51,
92,
198,
437,
198,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
311,
16960,
19,
198,
2,
38093,
25609,
28,
198,
198,
39344,
38161,
24331,
363,
1352,
50,
16960,
19,
198,
198,
37811,
198,
220,
220,
220,
38161,
24331,
363,
1352,
50,
16960,
19,
90,
51,
92,
1279,
25,
38161,
24331,
363,
1352,
90,
51,
92,
198,
198,
1273,
5620,
326,
6622,
262,
1321,
3519,
284,
262,
311,
16960,
19,
8928,
1352,
13,
198,
198,
2,
23948,
198,
198,
9,
4600,
82,
31197,
19,
67,
63,
25,
32522,
326,
7000,
262,
311,
16960,
19,
1366,
357,
3826,
4600,
50,
16960,
19,
62,
1273,
5620,
63,
737,
198,
198,
37811,
198,
7249,
38161,
24331,
363,
1352,
50,
16960,
19,
90,
51,
92,
1279,
25,
38161,
24331,
363,
1352,
90,
51,
92,
198,
220,
220,
220,
264,
31197,
19,
67,
3712,
50,
16960,
19,
62,
1273,
5620,
90,
51,
92,
198,
437,
198
] | 2.980428 | 3,781 |
function clean(phone_number)
end
| [
8818,
3424,
7,
4862,
62,
17618,
8,
198,
220,
220,
220,
220,
198,
437,
198
] | 2.533333 | 15 |
@testset "Ensembles" begin
d = PointSet(rand(2,100))
r = (z=[1:100 for i in 1:10],)
s = Ensemble(d, r)
@test domain(s) == d
@test s[:z] == r[:z]
for i in 1:10
@test s[i] == georef((z=1:100,), d)
end
s1 = Ensemble(d, r)
s2 = Ensemble(d, r)
@test s1 == s2
@test sprint(show, s) == "2D Ensemble"
@test sprint(show, MIME"text/plain"(), s) == "2D Ensemble\n domain: 100 PointSet{2,Float64}\n variables: z\n N° reals: 10"
d = CartesianGrid(10,10)
r = (z=[1:100 for i in 1:10],)
s = Ensemble(d, r)
@test domain(s) == d
@test s[:z] == r[:z]
for i in 1:10
@test s[i] == georef((z=1:100,), d)
end
@test sprint(show, s) == "2D Ensemble"
@test sprint(show, MIME"text/plain"(), s) == "2D Ensemble\n domain: 10×10 CartesianGrid{2,Float64}\n variables: z\n N° reals: 10"
if visualtests
@test_reference "data/ensemble.png" plot(s,size=(800,300))
end
grid = CartesianGrid(3,3)
reals = (z=[i*ones(nelements(grid)) for i in 1:3],)
ensemble = Ensemble(grid, reals)
# mean
mean2D = mean(ensemble)
@test mean2D.z == 2.0*ones(nelements(mean2D))
@test domain(mean2D) == ensemble.domain
# variance
var2D = var(ensemble)
@test var2D.z == 1.0*ones(nelements(var2D))
@test domain(var2D) == ensemble.domain
# quantile (scalar)
p = 0.5
quant2D = quantile(ensemble, p)
@test quant2D.z == 2.0*ones(nelements(quant2D))
@test domain(quant2D) == ensemble.domain
# quantile (vector)
ps = [0.0, 0.5, 1.0]
quants2D = quantile(ensemble, ps)
@test quants2D[2].z == quant2D.z
end
| [
31,
9288,
2617,
366,
4834,
4428,
829,
1,
2221,
198,
220,
288,
796,
6252,
7248,
7,
25192,
7,
17,
11,
3064,
4008,
198,
220,
374,
796,
357,
89,
41888,
16,
25,
3064,
329,
1312,
287,
352,
25,
940,
4357,
8,
198,
220,
264,
796,
2039,
15140,
7,
67,
11,
374,
8,
198,
220,
2488,
9288,
7386,
7,
82,
8,
6624,
288,
198,
220,
2488,
9288,
264,
58,
25,
89,
60,
6624,
374,
58,
25,
89,
60,
198,
220,
329,
1312,
287,
352,
25,
940,
198,
220,
220,
220,
2488,
9288,
264,
58,
72,
60,
6624,
4903,
382,
69,
19510,
89,
28,
16,
25,
3064,
11,
828,
288,
8,
198,
220,
886,
628,
220,
264,
16,
796,
2039,
15140,
7,
67,
11,
374,
8,
198,
220,
264,
17,
796,
2039,
15140,
7,
67,
11,
374,
8,
198,
220,
2488,
9288,
264,
16,
6624,
264,
17,
628,
220,
2488,
9288,
18553,
7,
12860,
11,
264,
8,
6624,
366,
17,
35,
2039,
15140,
1,
198,
220,
2488,
9288,
18553,
7,
12860,
11,
337,
12789,
1,
5239,
14,
25638,
18109,
828,
264,
8,
6624,
366,
17,
35,
2039,
15140,
59,
77,
220,
7386,
25,
1802,
6252,
7248,
90,
17,
11,
43879,
2414,
32239,
77,
220,
9633,
25,
1976,
59,
77,
220,
399,
7200,
302,
874,
25,
220,
838,
1,
628,
220,
288,
796,
13690,
35610,
41339,
7,
940,
11,
940,
8,
198,
220,
374,
796,
357,
89,
41888,
16,
25,
3064,
329,
1312,
287,
352,
25,
940,
4357,
8,
198,
220,
264,
796,
2039,
15140,
7,
67,
11,
374,
8,
198,
220,
2488,
9288,
7386,
7,
82,
8,
6624,
288,
198,
220,
2488,
9288,
264,
58,
25,
89,
60,
6624,
374,
58,
25,
89,
60,
198,
220,
329,
1312,
287,
352,
25,
940,
198,
220,
220,
220,
2488,
9288,
264,
58,
72,
60,
6624,
4903,
382,
69,
19510,
89,
28,
16,
25,
3064,
11,
828,
288,
8,
198,
220,
886,
628,
220,
2488,
9288,
18553,
7,
12860,
11,
264,
8,
6624,
366,
17,
35,
2039,
15140,
1,
198,
220,
2488,
9288,
18553,
7,
12860,
11,
337,
12789,
1,
5239,
14,
25638,
18109,
828,
264,
8,
6624,
366,
17,
35,
2039,
15140,
59,
77,
220,
7386,
25,
838,
12906,
940,
13690,
35610,
41339,
90,
17,
11,
43879,
2414,
32239,
77,
220,
9633,
25,
1976,
59,
77,
220,
399,
7200,
302,
874,
25,
220,
838,
1,
628,
220,
611,
5874,
41989,
198,
220,
220,
220,
2488,
9288,
62,
35790,
366,
7890,
14,
1072,
11306,
13,
11134,
1,
7110,
7,
82,
11,
7857,
16193,
7410,
11,
6200,
4008,
198,
220,
886,
628,
220,
10706,
796,
13690,
35610,
41339,
7,
18,
11,
18,
8,
198,
220,
302,
874,
796,
357,
89,
41888,
72,
9,
1952,
7,
710,
3639,
7,
25928,
4008,
329,
1312,
287,
352,
25,
18,
4357,
8,
198,
220,
34549,
796,
2039,
15140,
7,
25928,
11,
302,
874,
8,
628,
220,
1303,
1612,
198,
220,
1612,
17,
35,
796,
1612,
7,
1072,
11306,
8,
198,
220,
2488,
9288,
1612,
17,
35,
13,
89,
6624,
362,
13,
15,
9,
1952,
7,
710,
3639,
7,
32604,
17,
35,
4008,
198,
220,
2488,
9288,
7386,
7,
32604,
17,
35,
8,
6624,
34549,
13,
27830,
628,
220,
1303,
24198,
198,
220,
1401,
17,
35,
796,
1401,
7,
1072,
11306,
8,
198,
220,
2488,
9288,
1401,
17,
35,
13,
89,
6624,
352,
13,
15,
9,
1952,
7,
710,
3639,
7,
7785,
17,
35,
4008,
198,
220,
2488,
9288,
7386,
7,
7785,
17,
35,
8,
6624,
34549,
13,
27830,
628,
220,
1303,
5554,
576,
357,
1416,
282,
283,
8,
198,
220,
279,
796,
657,
13,
20,
198,
220,
5554,
17,
35,
796,
5554,
576,
7,
1072,
11306,
11,
279,
8,
198,
220,
2488,
9288,
5554,
17,
35,
13,
89,
6624,
362,
13,
15,
9,
1952,
7,
710,
3639,
7,
40972,
17,
35,
4008,
198,
220,
2488,
9288,
7386,
7,
40972,
17,
35,
8,
6624,
34549,
13,
27830,
628,
220,
1303,
5554,
576,
357,
31364,
8,
198,
220,
26692,
796,
685,
15,
13,
15,
11,
657,
13,
20,
11,
352,
13,
15,
60,
198,
220,
627,
1187,
17,
35,
796,
5554,
576,
7,
1072,
11306,
11,
26692,
8,
198,
220,
2488,
9288,
627,
1187,
17,
35,
58,
17,
4083,
89,
6624,
5554,
17,
35,
13,
89,
198,
437,
198
] | 2.20255 | 706 |
""
function get_solution_tf(pm::GenericPowerModel, sol::Dict{String,Any})
PowerModels.add_bus_voltage_setpoint(sol, pm)
PowerModels.add_generator_power_setpoint(sol, pm)
PowerModels.add_branch_flow_setpoint(sol, pm)
PowerModels.add_dcline_flow_setpoint(sol, pm)
add_risk(sol, pm)
add_branch_shift_setpoint(sol, pm)
add_branch_tap_setpoint(sol, pm)
add_load_power_setpoint(sol, pm)
add_nodal_power_setpoint(sol, pm)
add_pdelta(sol, pm)
add_qdelta(sol, pm)
return sol
end
""
function add_branch_shift_setpoint(sol, pm::GenericPowerModel)
PowerModels.add_setpoint(sol, pm, "branch", "shiftf", :va_shift; extract_var = (var,idx,item) -> var[(idx, item["f_bus"], item["t_bus"])], default_value = (item) -> 0)
PowerModels.add_setpoint(sol, pm, "branch", "shiftt", :va_shift; extract_var = (var,idx,item) -> var[(idx, item["t_bus"], item["f_bus"])], default_value = (item) -> 0)
end
""
function add_branch_tap_setpoint(sol, pm::GenericPowerModel)
dict_name = "branch"
index_name = "index"
if pm.data["multinetwork"] == false
sol_dict = get(sol, dict_name, Dict{String,Any}())
if length(pm.data[dict_name]) > 0
sol[dict_name] = sol_dict
end
for (i,item) in pm.data[dict_name]
idx = Int(item[index_name])
fbus = Int(item["f_bus"])
tbus = Int(item["t_bus"])
sol_item = sol_dict[i] = get(sol_dict, i, Dict{String,Any}())
sol_item["tapf"] = 1
sol_item["tapt"] = 1
try
extract_vtap_fr = (var,idx,item) -> var[(idx, item["f_bus"], item["t_bus"])]
extract_vtap_to = (var,idx,item) -> var[(idx, item["t_bus"], item["f_bus"])]
vtap_fr = getvalue(extract_vtap_fr(PowerModels.var(pm, :vm_tap), idx, item))
vtap_to = getvalue(extract_vtap_to(PowerModels.var(pm, :vm_tap), idx, item))
vf = getvalue(PowerModels.var(pm,:vm))[fbus]
vt = getvalue(PowerModels.var(pm,:vm))[tbus]
sol_item["tapf"] = vf / vtap_fr
sol_item["tapt"] = vt / vtap_to
catch
end
end
else
for (n,nw_data) in pm.data["nw"]
sol_dict = get(sol, dict_name, Dict{String,Any}())
if length(pm.data["nw"][n][dict_name]) > 0
sol[dict_name] = sol_dict
end
for (i,item) in pm.data["nw"][n][dict_name]
idx = Int(item[index_name])
fbus = Int(item["f_bus"])
tbus = Int(item["t_bus"])
sol_item = sol_dict[i] = get(sol_dict, i, Dict{String,Any}())
sol_item["tapf"] = 1
sol_item["tapt"] = 1
try
extract_vtap_fr = (var,idx,item) -> var[(idx, item["f_bus"], item["t_bus"])]
extract_vtap_to = (var,idx,item) -> var[(idx, item["t_bus"], item["f_bus"])]
vtap_fr = getvalue(extract_vtap_fr(PowerModels.var(pm, :vm_tap), idx, item))
vtap_to = getvalue(extract_vtap_to(PowerModels.var(pm, :vm_tap), idx, item))
vf = getvalue(PowerModels.var(pm,:vm))[fbus]
vt = getvalue(PowerModels.var(pm,:vm))[tbus]
sol_item["tapf"] = vf / vtap_fr
sol_item["tapt"] = vt / vtap_to
catch
end
end
end
end
end
""
function add_load_power_setpoint(sol, pm::GenericPowerModel)
mva_base = pm.data["baseMVA"]
PowerModels.add_setpoint(sol, pm, "load", "pl", :pl)
PowerModels.add_setpoint(sol, pm, "load", "ql", :ql)
end
""
function add_nodal_power_setpoint(sol, pm::GenericPowerModel)
mva_base = pm.data["baseMVA"]
PowerModels.add_setpoint(sol, pm, "bus", "pnode", :pnode)
PowerModels.add_setpoint(sol, pm, "bus", "qnode", :qnode)
end
""
function add_pdelta(sol, pm::GenericPowerModel)
mva_base = pm.data["baseMVA"]
PowerModels.add_setpoint(sol, pm, "load", "pdelta", :pl_delta)
PowerModels.add_setpoint(sol, pm, "gen", "pdelta", :pg_delta)
end
""
function add_qdelta(sol, pm::GenericPowerModel)
mva_base = pm.data["baseMVA"]
PowerModels.add_setpoint(sol, pm, "load", "qdelta", :ql_delta)
PowerModels.add_setpoint(sol, pm, "gen", "qdelta", :qg_delta)
end
""
function add_risk(sol, pm::GenericPowerModel)
add_case_level_setpoint(sol, pm, "first_stage_cost", :first_stage_cost)
add_case_level_setpoint(sol, pm, "second_stage_risk", :second_stage_risk)
PowerModels.add_setpoint(sol, pm, "contingencies", "dispatch_cost", :dispatch_cost)
PowerModels.add_setpoint(sol, pm, "contingencies", "redispatch_cost", :redispatch_cost)
PowerModels.add_setpoint(sol, pm, "contingencies", "loadshedding_cost", :loadshedding_cost)
# add_cont_level_setpoint(sol, pm, "contingencies", "dispatch_cost", :dispatch_cost)
# add_cont_level_setpoint(sol, pm, "contingencies", "redispatch_cost", :redispatch_cost)
# add_cont_level_setpoint(sol, pm, "contingencies", "loadshedding_cost", :loadshedding_cost)
end
""
function add_case_level_setpoint(sol, pm::GenericPowerModel, param_name, variable_symbol; scale = (x) -> x, extract_var = var -> var)
if !haskey(sol, param_name)
sol[param_name] = Dict()
end
# print(pm.var[:nw][1][:cnd][pm.ccnd][variable_symbol])
# print(sol)
variable = extract_var(pm.var[:nw][1][:cnd][pm.ccnd][variable_symbol])
sol[param_name] = scale(getvalue(variable))
# catch
# end
end
""
function add_cont_level_setpoint(sol, pm::GenericPowerModel, dict_name, param_name, variable_symbol; scale = (x) -> x, extract_var = var -> var)
if !haskey(sol, dict_name)
sol[dict_name] = Dict()
end
sol[dict_name][param_name] = Dict()
sol[dict_name][param_name] = getvalue(extract_var(pm.var[:nw][1][:cnd][pm.ccnd][variable_symbol]))
end
| [
15931,
198,
8818,
651,
62,
82,
2122,
62,
27110,
7,
4426,
3712,
46189,
13434,
17633,
11,
1540,
3712,
35,
713,
90,
10100,
11,
7149,
30072,
198,
220,
220,
220,
4333,
5841,
1424,
13,
2860,
62,
10885,
62,
37764,
496,
62,
2617,
4122,
7,
34453,
11,
9114,
8,
198,
220,
220,
220,
4333,
5841,
1424,
13,
2860,
62,
8612,
1352,
62,
6477,
62,
2617,
4122,
7,
34453,
11,
9114,
8,
198,
220,
220,
220,
4333,
5841,
1424,
13,
2860,
62,
1671,
3702,
62,
11125,
62,
2617,
4122,
7,
34453,
11,
9114,
8,
198,
220,
220,
220,
4333,
5841,
1424,
13,
2860,
62,
67,
565,
500,
62,
11125,
62,
2617,
4122,
7,
34453,
11,
9114,
8,
198,
220,
220,
220,
751,
62,
19121,
7,
34453,
11,
9114,
8,
198,
220,
220,
220,
751,
62,
1671,
3702,
62,
30846,
62,
2617,
4122,
7,
34453,
11,
9114,
8,
198,
220,
220,
220,
751,
62,
1671,
3702,
62,
44335,
62,
2617,
4122,
7,
34453,
11,
9114,
8,
198,
220,
220,
220,
751,
62,
2220,
62,
6477,
62,
2617,
4122,
7,
34453,
11,
9114,
8,
198,
220,
220,
220,
751,
62,
77,
375,
282,
62,
6477,
62,
2617,
4122,
7,
34453,
11,
9114,
8,
198,
220,
220,
220,
751,
62,
30094,
12514,
7,
34453,
11,
9114,
8,
198,
220,
220,
220,
751,
62,
80,
67,
12514,
7,
34453,
11,
9114,
8,
198,
220,
220,
220,
1441,
1540,
198,
437,
198,
198,
15931,
198,
8818,
751,
62,
1671,
3702,
62,
30846,
62,
2617,
4122,
7,
34453,
11,
9114,
3712,
46189,
13434,
17633,
8,
198,
220,
4333,
5841,
1424,
13,
2860,
62,
2617,
4122,
7,
34453,
11,
9114,
11,
366,
1671,
3702,
1600,
366,
30846,
69,
1600,
1058,
6862,
62,
30846,
26,
7925,
62,
7785,
796,
357,
7785,
11,
312,
87,
11,
9186,
8,
4613,
1401,
58,
7,
312,
87,
11,
2378,
14692,
69,
62,
10885,
33116,
2378,
14692,
83,
62,
10885,
8973,
8,
4357,
4277,
62,
8367,
796,
357,
9186,
8,
4613,
657,
8,
198,
220,
4333,
5841,
1424,
13,
2860,
62,
2617,
4122,
7,
34453,
11,
9114,
11,
366,
1671,
3702,
1600,
366,
1477,
361,
926,
1600,
1058,
6862,
62,
30846,
26,
7925,
62,
7785,
796,
357,
7785,
11,
312,
87,
11,
9186,
8,
4613,
1401,
58,
7,
312,
87,
11,
2378,
14692,
83,
62,
10885,
33116,
2378,
14692,
69,
62,
10885,
8973,
8,
4357,
4277,
62,
8367,
796,
357,
9186,
8,
4613,
657,
8,
198,
437,
198,
198,
15931,
198,
8818,
751,
62,
1671,
3702,
62,
44335,
62,
2617,
4122,
7,
34453,
11,
9114,
3712,
46189,
13434,
17633,
8,
198,
220,
220,
220,
8633,
62,
3672,
796,
366,
1671,
3702,
1,
198,
220,
220,
220,
6376,
62,
3672,
796,
366,
9630,
1,
198,
220,
220,
220,
611,
9114,
13,
7890,
14692,
16680,
42504,
1818,
8973,
6624,
3991,
198,
220,
220,
220,
220,
220,
220,
220,
1540,
62,
11600,
796,
651,
7,
34453,
11,
8633,
62,
3672,
11,
360,
713,
90,
10100,
11,
7149,
92,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
611,
4129,
7,
4426,
13,
7890,
58,
11600,
62,
3672,
12962,
1875,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1540,
58,
11600,
62,
3672,
60,
796,
1540,
62,
11600,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
329,
357,
72,
11,
9186,
8,
287,
9114,
13,
7890,
58,
11600,
62,
3672,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4686,
87,
796,
2558,
7,
9186,
58,
9630,
62,
3672,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
10885,
796,
2558,
7,
9186,
14692,
69,
62,
10885,
8973,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
10885,
796,
2558,
7,
9186,
14692,
83,
62,
10885,
8973,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1540,
62,
9186,
796,
1540,
62,
11600,
58,
72,
60,
796,
651,
7,
34453,
62,
11600,
11,
1312,
11,
360,
713,
90,
10100,
11,
7149,
92,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1540,
62,
9186,
14692,
44335,
69,
8973,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1540,
62,
9186,
14692,
83,
2373,
8973,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1949,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7925,
62,
36540,
499,
62,
8310,
796,
357,
7785,
11,
312,
87,
11,
9186,
8,
4613,
1401,
58,
7,
312,
87,
11,
2378,
14692,
69,
62,
10885,
33116,
2378,
14692,
83,
62,
10885,
8973,
15437,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7925,
62,
36540,
499,
62,
1462,
796,
357,
7785,
11,
312,
87,
11,
9186,
8,
4613,
1401,
58,
7,
312,
87,
11,
2378,
14692,
83,
62,
10885,
33116,
2378,
14692,
69,
62,
10885,
8973,
15437,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
44335,
62,
8310,
796,
651,
8367,
7,
2302,
974,
62,
36540,
499,
62,
8310,
7,
13434,
5841,
1424,
13,
7785,
7,
4426,
11,
1058,
14761,
62,
44335,
828,
4686,
87,
11,
2378,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
44335,
62,
1462,
796,
651,
8367,
7,
2302,
974,
62,
36540,
499,
62,
1462,
7,
13434,
5841,
1424,
13,
7785,
7,
4426,
11,
1058,
14761,
62,
44335,
828,
4686,
87,
11,
2378,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
69,
796,
651,
8367,
7,
13434,
5841,
1424,
13,
7785,
7,
4426,
11,
25,
14761,
4008,
58,
69,
10885,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
83,
796,
651,
8367,
7,
13434,
5841,
1424,
13,
7785,
7,
4426,
11,
25,
14761,
4008,
58,
83,
10885,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1540,
62,
9186,
14692,
44335,
69,
8973,
796,
410,
69,
1220,
410,
44335,
62,
8310,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1540,
62,
9186,
14692,
83,
2373,
8973,
796,
410,
83,
1220,
410,
44335,
62,
1462,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4929,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
329,
357,
77,
11,
47516,
62,
7890,
8,
287,
9114,
13,
7890,
14692,
47516,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1540,
62,
11600,
796,
651,
7,
34453,
11,
8633,
62,
3672,
11,
360,
713,
90,
10100,
11,
7149,
92,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
4129,
7,
4426,
13,
7890,
14692,
47516,
1,
7131,
77,
7131,
11600,
62,
3672,
12962,
1875,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1540,
58,
11600,
62,
3672,
60,
796,
1540,
62,
11600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
357,
72,
11,
9186,
8,
287,
9114,
13,
7890,
14692,
47516,
1,
7131,
77,
7131,
11600,
62,
3672,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4686,
87,
796,
2558,
7,
9186,
58,
9630,
62,
3672,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
10885,
796,
2558,
7,
9186,
14692,
69,
62,
10885,
8973,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
10885,
796,
2558,
7,
9186,
14692,
83,
62,
10885,
8973,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1540,
62,
9186,
796,
1540,
62,
11600,
58,
72,
60,
796,
651,
7,
34453,
62,
11600,
11,
1312,
11,
360,
713,
90,
10100,
11,
7149,
92,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1540,
62,
9186,
14692,
44335,
69,
8973,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1540,
62,
9186,
14692,
83,
2373,
8973,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1949,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7925,
62,
36540,
499,
62,
8310,
796,
357,
7785,
11,
312,
87,
11,
9186,
8,
4613,
1401,
58,
7,
312,
87,
11,
2378,
14692,
69,
62,
10885,
33116,
2378,
14692,
83,
62,
10885,
8973,
15437,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7925,
62,
36540,
499,
62,
1462,
796,
357,
7785,
11,
312,
87,
11,
9186,
8,
4613,
1401,
58,
7,
312,
87,
11,
2378,
14692,
83,
62,
10885,
33116,
2378,
14692,
69,
62,
10885,
8973,
15437,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
44335,
62,
8310,
796,
651,
8367,
7,
2302,
974,
62,
36540,
499,
62,
8310,
7,
13434,
5841,
1424,
13,
7785,
7,
4426,
11,
1058,
14761,
62,
44335,
828,
4686,
87,
11,
2378,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
44335,
62,
1462,
796,
651,
8367,
7,
2302,
974,
62,
36540,
499,
62,
1462,
7,
13434,
5841,
1424,
13,
7785,
7,
4426,
11,
1058,
14761,
62,
44335,
828,
4686,
87,
11,
2378,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
69,
796,
651,
8367,
7,
13434,
5841,
1424,
13,
7785,
7,
4426,
11,
25,
14761,
4008,
58,
69,
10885,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
83,
796,
651,
8367,
7,
13434,
5841,
1424,
13,
7785,
7,
4426,
11,
25,
14761,
4008,
58,
83,
10885,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1540,
62,
9186,
14692,
44335,
69,
8973,
796,
410,
69,
1220,
410,
44335,
62,
8310,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1540,
62,
9186,
14692,
83,
2373,
8973,
796,
410,
83,
1220,
410,
44335,
62,
1462,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4929,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
437,
198,
15931,
198,
8818,
751,
62,
2220,
62,
6477,
62,
2617,
4122,
7,
34453,
11,
9114,
3712,
46189,
13434,
17633,
8,
198,
220,
220,
220,
285,
6862,
62,
8692,
796,
9114,
13,
7890,
14692,
8692,
44,
11731,
8973,
198,
220,
220,
220,
4333,
5841,
1424,
13,
2860,
62,
2617,
4122,
7,
34453,
11,
9114,
11,
366,
2220,
1600,
366,
489,
1600,
1058,
489,
8,
198,
220,
220,
220,
4333,
5841,
1424,
13,
2860,
62,
2617,
4122,
7,
34453,
11,
9114,
11,
366,
2220,
1600,
366,
13976,
1600,
1058,
13976,
8,
198,
437,
198,
15931,
198,
8818,
751,
62,
77,
375,
282,
62,
6477,
62,
2617,
4122,
7,
34453,
11,
9114,
3712,
46189,
13434,
17633,
8,
198,
220,
220,
220,
285,
6862,
62,
8692,
796,
9114,
13,
7890,
14692,
8692,
44,
11731,
8973,
198,
220,
220,
220,
4333,
5841,
1424,
13,
2860,
62,
2617,
4122,
7,
34453,
11,
9114,
11,
366,
10885,
1600,
366,
79,
17440,
1600,
1058,
79,
17440,
8,
198,
220,
220,
220,
4333,
5841,
1424,
13,
2860,
62,
2617,
4122,
7,
34453,
11,
9114,
11,
366,
10885,
1600,
366,
80,
17440,
1600,
1058,
80,
17440,
8,
198,
437,
198,
15931,
198,
8818,
751,
62,
30094,
12514,
7,
34453,
11,
9114,
3712,
46189,
13434,
17633,
8,
198,
220,
220,
220,
285,
6862,
62,
8692,
796,
9114,
13,
7890,
14692,
8692,
44,
11731,
8973,
198,
220,
220,
220,
4333,
5841,
1424,
13,
2860,
62,
2617,
4122,
7,
34453,
11,
9114,
11,
366,
2220,
1600,
366,
30094,
12514,
1600,
1058,
489,
62,
67,
12514,
8,
198,
220,
220,
220,
4333,
5841,
1424,
13,
2860,
62,
2617,
4122,
7,
34453,
11,
9114,
11,
366,
5235,
1600,
366,
30094,
12514,
1600,
1058,
6024,
62,
67,
12514,
8,
198,
437,
198,
15931,
198,
8818,
751,
62,
80,
67,
12514,
7,
34453,
11,
9114,
3712,
46189,
13434,
17633,
8,
198,
220,
220,
220,
285,
6862,
62,
8692,
796,
9114,
13,
7890,
14692,
8692,
44,
11731,
8973,
198,
220,
220,
220,
4333,
5841,
1424,
13,
2860,
62,
2617,
4122,
7,
34453,
11,
9114,
11,
366,
2220,
1600,
366,
80,
67,
12514,
1600,
1058,
13976,
62,
67,
12514,
8,
198,
220,
220,
220,
4333,
5841,
1424,
13,
2860,
62,
2617,
4122,
7,
34453,
11,
9114,
11,
366,
5235,
1600,
366,
80,
67,
12514,
1600,
1058,
80,
70,
62,
67,
12514,
8,
198,
437,
198,
15931,
198,
8818,
751,
62,
19121,
7,
34453,
11,
9114,
3712,
46189,
13434,
17633,
8,
198,
220,
751,
62,
7442,
62,
5715,
62,
2617,
4122,
7,
34453,
11,
9114,
11,
366,
11085,
62,
14247,
62,
15805,
1600,
1058,
11085,
62,
14247,
62,
15805,
8,
198,
220,
751,
62,
7442,
62,
5715,
62,
2617,
4122,
7,
34453,
11,
9114,
11,
366,
12227,
62,
14247,
62,
19121,
1600,
1058,
12227,
62,
14247,
62,
19121,
8,
198,
220,
4333,
5841,
1424,
13,
2860,
62,
2617,
4122,
7,
34453,
11,
9114,
11,
366,
3642,
278,
3976,
1600,
366,
6381,
17147,
62,
15805,
1600,
1058,
6381,
17147,
62,
15805,
8,
198,
220,
4333,
5841,
1424,
13,
2860,
62,
2617,
4122,
7,
34453,
11,
9114,
11,
366,
3642,
278,
3976,
1600,
366,
445,
8802,
963,
62,
15805,
1600,
1058,
445,
8802,
963,
62,
15805,
8,
198,
220,
4333,
5841,
1424,
13,
2860,
62,
2617,
4122,
7,
34453,
11,
9114,
11,
366,
3642,
278,
3976,
1600,
366,
2220,
35762,
12083,
62,
15805,
1600,
1058,
2220,
35762,
12083,
62,
15805,
8,
198,
220,
1303,
751,
62,
3642,
62,
5715,
62,
2617,
4122,
7,
34453,
11,
9114,
11,
366,
3642,
278,
3976,
1600,
366,
6381,
17147,
62,
15805,
1600,
1058,
6381,
17147,
62,
15805,
8,
198,
220,
1303,
751,
62,
3642,
62,
5715,
62,
2617,
4122,
7,
34453,
11,
9114,
11,
366,
3642,
278,
3976,
1600,
366,
445,
8802,
963,
62,
15805,
1600,
1058,
445,
8802,
963,
62,
15805,
8,
198,
220,
1303,
751,
62,
3642,
62,
5715,
62,
2617,
4122,
7,
34453,
11,
9114,
11,
366,
3642,
278,
3976,
1600,
366,
2220,
35762,
12083,
62,
15805,
1600,
1058,
2220,
35762,
12083,
62,
15805,
8,
198,
437,
198,
15931,
198,
8818,
751,
62,
7442,
62,
5715,
62,
2617,
4122,
7,
34453,
11,
9114,
3712,
46189,
13434,
17633,
11,
5772,
62,
3672,
11,
7885,
62,
1837,
23650,
26,
5046,
796,
357,
87,
8,
4613,
2124,
11,
7925,
62,
7785,
796,
1401,
4613,
1401,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
5145,
10134,
2539,
7,
34453,
11,
5772,
62,
3672,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1540,
58,
17143,
62,
3672,
60,
796,
360,
713,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
3601,
7,
4426,
13,
7785,
58,
25,
47516,
7131,
16,
7131,
25,
66,
358,
7131,
4426,
13,
535,
358,
7131,
45286,
62,
1837,
23650,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
3601,
7,
34453,
8,
198,
220,
220,
220,
220,
220,
220,
220,
7885,
796,
7925,
62,
7785,
7,
4426,
13,
7785,
58,
25,
47516,
7131,
16,
7131,
25,
66,
358,
7131,
4426,
13,
535,
358,
7131,
45286,
62,
1837,
23650,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
1540,
58,
17143,
62,
3672,
60,
796,
5046,
7,
1136,
8367,
7,
45286,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
4929,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
886,
198,
437,
198,
15931,
198,
8818,
751,
62,
3642,
62,
5715,
62,
2617,
4122,
7,
34453,
11,
9114,
3712,
46189,
13434,
17633,
11,
8633,
62,
3672,
11,
5772,
62,
3672,
11,
7885,
62,
1837,
23650,
26,
5046,
796,
357,
87,
8,
4613,
2124,
11,
7925,
62,
7785,
796,
1401,
4613,
1401,
8,
198,
220,
220,
220,
611,
5145,
10134,
2539,
7,
34453,
11,
8633,
62,
3672,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1540,
58,
11600,
62,
3672,
60,
796,
360,
713,
3419,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1540,
58,
11600,
62,
3672,
7131,
17143,
62,
3672,
60,
796,
360,
713,
3419,
198,
220,
220,
220,
1540,
58,
11600,
62,
3672,
7131,
17143,
62,
3672,
60,
796,
651,
8367,
7,
2302,
974,
62,
7785,
7,
4426,
13,
7785,
58,
25,
47516,
7131,
16,
7131,
25,
66,
358,
7131,
4426,
13,
535,
358,
7131,
45286,
62,
1837,
23650,
60,
4008,
198,
437,
198
] | 2.024872 | 2,935 |
using Random
using LightGraphs
mutable struct Agent
id::Int32
values::AbstractArray
vote::Int8
energy::Float32
end
function initNetwork(N)
#Initialize agents
global nodes = []
for i in 1:N
push!(nodes,Agent(i,rand(0:10,(5)),rand(1:10),0))
end
#=
#Generate graph with N
A = bitrand((N,N)) #Adjacency matrix #TODO:Make sparse
for i in 1:N
A[i,i] = 0 #Make sure nodes are not be connected to themselves
end
global Network = DiGraph(A) #Generate graph
A = nothing #Clear A
#We are now implementing a Barabasi-Albert graph, instead of a random one
=#
#Generate Barabasi graph with N nodes, 3 conntections each, 10 initial nodes
global Network = barabasi_albert(N, 10, 3, seed=1, is_directed=true)
#global Network = erdos_renyi(N, 4, is_directed=true)
#Initialize energy
for i in 1:N
dE(i)
end
computeEnergy()
#Count initial preferences
trackPreference()
end
| [
3500,
14534,
198,
3500,
4401,
37065,
82,
220,
198,
198,
76,
18187,
2878,
15906,
198,
220,
220,
220,
4686,
3712,
5317,
2624,
198,
220,
220,
220,
3815,
3712,
23839,
19182,
198,
220,
220,
220,
3015,
3712,
5317,
23,
198,
220,
220,
220,
2568,
3712,
43879,
2624,
198,
437,
198,
198,
8818,
2315,
26245,
7,
45,
8,
198,
220,
220,
220,
1303,
24243,
1096,
6554,
198,
220,
220,
220,
3298,
13760,
796,
17635,
198,
220,
220,
220,
329,
1312,
287,
352,
25,
45,
198,
220,
220,
220,
220,
220,
220,
220,
4574,
0,
7,
77,
4147,
11,
36772,
7,
72,
11,
25192,
7,
15,
25,
940,
11,
7,
20,
36911,
25192,
7,
16,
25,
940,
828,
15,
4008,
198,
220,
220,
220,
886,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
28,
198,
220,
220,
220,
1303,
8645,
378,
4823,
351,
399,
198,
220,
220,
220,
317,
796,
1643,
25192,
19510,
45,
11,
45,
4008,
1303,
2782,
30482,
1387,
17593,
1303,
51,
3727,
46,
25,
12050,
29877,
198,
220,
220,
220,
329,
1312,
287,
352,
25,
45,
198,
220,
220,
220,
220,
220,
220,
220,
317,
58,
72,
11,
72,
60,
796,
657,
1303,
12050,
1654,
13760,
389,
407,
307,
5884,
284,
2405,
198,
220,
220,
220,
886,
198,
220,
220,
220,
3298,
7311,
796,
6031,
37065,
7,
32,
8,
1303,
8645,
378,
4823,
198,
220,
220,
220,
317,
796,
2147,
1303,
19856,
317,
628,
220,
220,
220,
1303,
1135,
389,
783,
15427,
257,
2409,
397,
17053,
12,
42590,
4823,
11,
2427,
286,
257,
4738,
530,
198,
220,
220,
220,
796,
2,
628,
220,
220,
220,
1303,
8645,
378,
2409,
397,
17053,
4823,
351,
399,
13760,
11,
513,
369,
429,
478,
507,
1123,
11,
838,
4238,
13760,
198,
220,
220,
220,
3298,
7311,
796,
2318,
397,
17053,
62,
282,
4835,
7,
45,
11,
838,
11,
513,
11,
9403,
28,
16,
11,
318,
62,
34762,
28,
7942,
8,
198,
220,
220,
220,
1303,
20541,
7311,
796,
1931,
37427,
62,
918,
48111,
7,
45,
11,
604,
11,
318,
62,
34762,
28,
7942,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
24243,
1096,
2568,
198,
220,
220,
220,
329,
1312,
287,
352,
25,
45,
198,
220,
220,
220,
220,
220,
220,
220,
288,
36,
7,
72,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
24061,
28925,
3419,
628,
220,
220,
220,
1303,
12332,
4238,
15387,
198,
220,
220,
220,
2610,
6719,
4288,
3419,
198,
437,
198
] | 2.437653 | 409 |
using Plots
using Random
Random.seed!(123)
# Solver options
tf = 5.0
N = 101
integration = :rk4
opts = SolverOptions()
opts.verbose = true
opts.cost_tolerance = 1e-8
opts.cost_tolerance_intermediate = 1e-8
opts.constraint_tolerance = 1e-8
opts.constraint_tolerance_intermediate = 1e-8
opts.gradient_norm_tolerance = 1e-12
opts.gradient_norm_tolerance_intermediate = 1e-12
opts.use_gradient_aula = true
opts.active_constraint_tolerance = 0.0
opts.penalty_scaling = 10.0
opts.penalty_initial = 1e-3
opts.penalty_update_frequency = 1
opts.constraint_decrease_ratio = .25
opts.iterations = 1000
opts.iterations_outerloop = 50
opts.iterations_innerloop = 300
opts.outer_loop_update_type = :individual
# Set up model, objective, solver
model, = TrajectoryOptimization.Dynamics.quadrotor
n = model.n
m = model.m
# -initial state
x0 = zeros(n)
x0[1:3] = [0.; 0.; 0.]
q0 = [1.;0.;0.;0.]
x0[4:7] = q0
# -final state
xf = copy(x0)
xf[1:3] = [0.;40.;0.] # xyz position
xf[4:7] = q0
# -control limits
u_min = 0.0
u_max = 10.0
# Q = (1e-1)*Matrix(I,n,n)
# Q[4,4] = 1.0
# Q[5,5] = 1.0
# Q[6,6] = 1.0
# Q[7,7] = 1.0
# R = (1e-1)*Matrix(I,m,m)
Q = (1e-1)*Matrix(I,n,n)
R = (1e-1)*Matrix(I,m,m)
Qf = (1000.0)*Matrix(I,n,n)
# obstacles constraint
r_quad = 3.0
r_sphere = 3.0
spheres = ((0.,10.,0.,r_sphere),(0.,20.,0.,r_sphere),(0.,30.,0.,r_sphere))
n_spheres = 3
function cI(c,x,u)
for i = 1:n_spheres
c[i] = sphere_constraint(x,spheres[i][1],spheres[i][2],spheres[i][3],spheres[i][4]+r_quad)
end
c
end
# unit quaternion constraint
function cE(c,x,u)
c = sqrt(x[4]^2 + x[5]^2 + x[6]^2 + x[7]^2) - 1.0
end
obj_uncon = LQRObjective(Q, R, Qf, tf, x0, xf)
obj_con = TrajectoryOptimization.ConstrainedObjective(obj_uncon,u_min=u_min,u_max=u_max,cI=cI,cE=cE)
solver_uncon = Solver(model,obj_uncon,integration=integration,N=N,opts=opts)
solver_con = Solver(model,obj_con,integration=integration,N=N,opts=opts)
U0 = zeros(solver_uncon.model.m, solver_uncon.N-1)
@time results_uncon, stats_uncon = solve(solver_uncon,U0)
plot(to_array(results_uncon.X)[1:3,:]')
solver_con = Solver(model,obj_con,integration=integration,N=N,opts=opts)
results_con.μ
@time results_con, stats_con = solve(solver_con,U0)
plot(to_array(results_con.U)[:,1:solver_con.N-1]')
plot(to_array(results_con.X)[1:3,:]')
plot(to_array(results_con.λ[1:N-1])')
max_violation(results_con)
total_time(solver_con,results_con)
plot!(log.(stats_con["max_condition_number"]))
plot(log.(stats_con["c_max"]).+15.5)
plot(log.(stats_con["cost"]))
| [
3500,
1345,
1747,
198,
3500,
14534,
198,
198,
29531,
13,
28826,
0,
7,
10163,
8,
198,
198,
2,
4294,
332,
3689,
198,
27110,
796,
642,
13,
15,
198,
45,
796,
8949,
198,
18908,
1358,
796,
1058,
81,
74,
19,
198,
404,
912,
796,
4294,
332,
29046,
3419,
198,
404,
912,
13,
19011,
577,
796,
2081,
198,
404,
912,
13,
15805,
62,
83,
37668,
796,
352,
68,
12,
23,
198,
404,
912,
13,
15805,
62,
83,
37668,
62,
3849,
13857,
796,
352,
68,
12,
23,
198,
404,
912,
13,
1102,
2536,
2913,
62,
83,
37668,
796,
352,
68,
12,
23,
198,
404,
912,
13,
1102,
2536,
2913,
62,
83,
37668,
62,
3849,
13857,
796,
352,
68,
12,
23,
198,
404,
912,
13,
49607,
62,
27237,
62,
83,
37668,
796,
352,
68,
12,
1065,
198,
404,
912,
13,
49607,
62,
27237,
62,
83,
37668,
62,
3849,
13857,
796,
352,
68,
12,
1065,
198,
404,
912,
13,
1904,
62,
49607,
62,
2518,
64,
796,
2081,
198,
404,
912,
13,
5275,
62,
1102,
2536,
2913,
62,
83,
37668,
796,
657,
13,
15,
198,
404,
912,
13,
3617,
6017,
62,
1416,
4272,
796,
838,
13,
15,
198,
404,
912,
13,
3617,
6017,
62,
36733,
796,
352,
68,
12,
18,
198,
404,
912,
13,
3617,
6017,
62,
19119,
62,
35324,
796,
352,
198,
404,
912,
13,
1102,
2536,
2913,
62,
12501,
260,
589,
62,
10366,
952,
796,
764,
1495,
198,
404,
912,
13,
2676,
602,
796,
8576,
198,
404,
912,
13,
2676,
602,
62,
39605,
26268,
796,
2026,
198,
404,
912,
13,
2676,
602,
62,
5083,
26268,
796,
5867,
198,
404,
912,
13,
39605,
62,
26268,
62,
19119,
62,
4906,
796,
1058,
43129,
198,
198,
2,
5345,
510,
2746,
11,
9432,
11,
1540,
332,
198,
19849,
11,
796,
4759,
752,
652,
27871,
320,
1634,
13,
35,
4989,
873,
13,
47003,
10599,
273,
198,
77,
796,
2746,
13,
77,
198,
76,
796,
2746,
13,
76,
198,
198,
2,
532,
36733,
1181,
198,
87,
15,
796,
1976,
27498,
7,
77,
8,
198,
87,
15,
58,
16,
25,
18,
60,
796,
685,
15,
15089,
657,
15089,
657,
8183,
198,
80,
15,
796,
685,
16,
15089,
15,
15089,
15,
15089,
15,
8183,
198,
87,
15,
58,
19,
25,
22,
60,
796,
10662,
15,
198,
198,
2,
532,
20311,
1181,
198,
26152,
796,
4866,
7,
87,
15,
8,
198,
26152,
58,
16,
25,
18,
60,
796,
685,
15,
15089,
1821,
15089,
15,
8183,
1303,
2124,
45579,
2292,
198,
26152,
58,
19,
25,
22,
60,
796,
10662,
15,
198,
198,
2,
532,
13716,
7095,
198,
84,
62,
1084,
796,
657,
13,
15,
198,
84,
62,
9806,
796,
838,
13,
15,
198,
198,
2,
1195,
796,
357,
16,
68,
12,
16,
27493,
46912,
7,
40,
11,
77,
11,
77,
8,
198,
2,
1195,
58,
19,
11,
19,
60,
796,
352,
13,
15,
198,
2,
1195,
58,
20,
11,
20,
60,
796,
352,
13,
15,
198,
2,
1195,
58,
21,
11,
21,
60,
796,
352,
13,
15,
198,
2,
1195,
58,
22,
11,
22,
60,
796,
352,
13,
15,
198,
2,
371,
796,
357,
16,
68,
12,
16,
27493,
46912,
7,
40,
11,
76,
11,
76,
8,
198,
48,
796,
357,
16,
68,
12,
16,
27493,
46912,
7,
40,
11,
77,
11,
77,
8,
198,
49,
796,
357,
16,
68,
12,
16,
27493,
46912,
7,
40,
11,
76,
11,
76,
8,
198,
48,
69,
796,
357,
12825,
13,
15,
27493,
46912,
7,
40,
11,
77,
11,
77,
8,
198,
198,
2,
17648,
32315,
198,
81,
62,
47003,
796,
513,
13,
15,
198,
81,
62,
2777,
1456,
796,
513,
13,
15,
198,
2777,
19079,
796,
14808,
15,
1539,
940,
1539,
15,
1539,
81,
62,
2777,
1456,
828,
7,
15,
1539,
1238,
1539,
15,
1539,
81,
62,
2777,
1456,
828,
7,
15,
1539,
1270,
1539,
15,
1539,
81,
62,
2777,
1456,
4008,
198,
77,
62,
2777,
19079,
796,
513,
198,
198,
8818,
269,
40,
7,
66,
11,
87,
11,
84,
8,
198,
220,
220,
220,
329,
1312,
796,
352,
25,
77,
62,
2777,
19079,
198,
220,
220,
220,
220,
220,
220,
220,
269,
58,
72,
60,
796,
16558,
62,
1102,
2536,
2913,
7,
87,
11,
2777,
19079,
58,
72,
7131,
16,
4357,
2777,
19079,
58,
72,
7131,
17,
4357,
2777,
19079,
58,
72,
7131,
18,
4357,
2777,
19079,
58,
72,
7131,
19,
48688,
81,
62,
47003,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
269,
198,
437,
198,
198,
2,
4326,
627,
9205,
295,
32315,
198,
8818,
269,
36,
7,
66,
11,
87,
11,
84,
8,
198,
220,
220,
220,
269,
796,
19862,
17034,
7,
87,
58,
19,
60,
61,
17,
1343,
2124,
58,
20,
60,
61,
17,
1343,
2124,
58,
21,
60,
61,
17,
1343,
2124,
58,
22,
60,
61,
17,
8,
532,
352,
13,
15,
198,
437,
198,
198,
26801,
62,
403,
1102,
796,
406,
48,
49,
10267,
425,
7,
48,
11,
371,
11,
1195,
69,
11,
48700,
11,
2124,
15,
11,
2124,
69,
8,
198,
26801,
62,
1102,
796,
4759,
752,
652,
27871,
320,
1634,
13,
3103,
2536,
1328,
10267,
425,
7,
26801,
62,
403,
1102,
11,
84,
62,
1084,
28,
84,
62,
1084,
11,
84,
62,
9806,
28,
84,
62,
9806,
11,
66,
40,
28,
66,
40,
11,
66,
36,
28,
66,
36,
8,
198,
198,
82,
14375,
62,
403,
1102,
796,
4294,
332,
7,
19849,
11,
26801,
62,
403,
1102,
11,
18908,
1358,
28,
18908,
1358,
11,
45,
28,
45,
11,
404,
912,
28,
404,
912,
8,
198,
82,
14375,
62,
1102,
796,
4294,
332,
7,
19849,
11,
26801,
62,
1102,
11,
18908,
1358,
28,
18908,
1358,
11,
45,
28,
45,
11,
404,
912,
28,
404,
912,
8,
198,
198,
52,
15,
796,
1976,
27498,
7,
82,
14375,
62,
403,
1102,
13,
19849,
13,
76,
11,
1540,
332,
62,
403,
1102,
13,
45,
12,
16,
8,
198,
31,
2435,
2482,
62,
403,
1102,
11,
9756,
62,
403,
1102,
796,
8494,
7,
82,
14375,
62,
403,
1102,
11,
52,
15,
8,
198,
198,
29487,
7,
1462,
62,
18747,
7,
43420,
62,
403,
1102,
13,
55,
38381,
16,
25,
18,
11,
47715,
11537,
198,
198,
82,
14375,
62,
1102,
796,
4294,
332,
7,
19849,
11,
26801,
62,
1102,
11,
18908,
1358,
28,
18908,
1358,
11,
45,
28,
45,
11,
404,
912,
28,
404,
912,
8,
198,
198,
43420,
62,
1102,
13,
34703,
198,
198,
31,
2435,
2482,
62,
1102,
11,
9756,
62,
1102,
796,
8494,
7,
82,
14375,
62,
1102,
11,
52,
15,
8,
198,
198,
29487,
7,
1462,
62,
18747,
7,
43420,
62,
1102,
13,
52,
38381,
45299,
16,
25,
82,
14375,
62,
1102,
13,
45,
12,
16,
60,
11537,
198,
29487,
7,
1462,
62,
18747,
7,
43420,
62,
1102,
13,
55,
38381,
16,
25,
18,
11,
47715,
11537,
198,
29487,
7,
1462,
62,
18747,
7,
43420,
62,
1102,
13,
39377,
58,
16,
25,
45,
12,
16,
12962,
11537,
198,
198,
9806,
62,
17069,
341,
7,
43420,
62,
1102,
8,
198,
23350,
62,
2435,
7,
82,
14375,
62,
1102,
11,
43420,
62,
1102,
8,
198,
198,
29487,
0,
7,
6404,
12195,
34242,
62,
1102,
14692,
9806,
62,
31448,
62,
17618,
8973,
4008,
198,
29487,
7,
6404,
12195,
34242,
62,
1102,
14692,
66,
62,
9806,
8973,
737,
10,
1314,
13,
20,
8,
198,
29487,
7,
6404,
12195,
34242,
62,
1102,
14692,
15805,
8973,
4008,
198
] | 2.075783 | 1,214 |
<html>
<head>
<style type="text/css">
body {
margin: 2em;
}
h1 {
text-align: center;
}
table {
border-spacing: 0;
box-shadow: 0 0 0.25em #888;
margin: auto;
}
table,
tr,
th,
td {
border-collapse: collapse;
}
th {
color: white;
background-color: rgb(43, 53, 59);
}
th,
td {
padding: 0.5em;
}
table tr:nth-child(even) td {
background-color: rgba(218, 224, 229, 0.850);
}
</style>
</head>
<body>
<h1>csv2html Example</h1>
<table>
<tr>
<th>Character</th>
<th>Speech</th>
</tr>
<tr>
<td>The multitude</td>
<td>The messiah! Show us the messiah!</td>
</tr>
<tr>
<td>Brians mother</td>
<td>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</td>
</tr>
<tr>
<td>The multitude</td>
<td>Who are you?</td>
</tr>
<tr>
<td>Brians mother</td>
<td>I'm his mother; that's who!</td>
</tr>
<tr>
<td>The multitude</td>
<td>Behold his mother! Behold his mother!</td>
</tr>
</table>
</body>
</html>
| [
27,
6494,
29,
198,
198,
27,
2256,
29,
198,
220,
220,
220,
1279,
7635,
2099,
2625,
5239,
14,
25471,
5320,
198,
220,
220,
220,
220,
220,
220,
220,
1767,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10330,
25,
362,
368,
26,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
289,
16,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2420,
12,
31494,
25,
3641,
26,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
3084,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4865,
12,
2777,
4092,
25,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3091,
12,
19106,
25,
657,
657,
657,
13,
1495,
368,
1303,
28011,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10330,
25,
8295,
26,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
3084,
11,
198,
220,
220,
220,
220,
220,
220,
220,
491,
11,
198,
220,
220,
220,
220,
220,
220,
220,
294,
11,
198,
220,
220,
220,
220,
220,
220,
220,
41560,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4865,
12,
26000,
7512,
25,
9807,
26,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
294,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3124,
25,
2330,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4469,
12,
8043,
25,
46140,
7,
3559,
11,
7192,
11,
7863,
1776,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
294,
11,
198,
220,
220,
220,
220,
220,
220,
220,
41560,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24511,
25,
657,
13,
20,
368,
26,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
3084,
491,
25,
77,
400,
12,
9410,
7,
10197,
8,
41560,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4469,
12,
8043,
25,
48670,
7012,
7,
28727,
11,
26063,
11,
31064,
11,
657,
13,
25764,
1776,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
7359,
7635,
29,
198,
3556,
2256,
29,
198,
198,
27,
2618,
29,
198,
220,
220,
220,
1279,
71,
16,
29,
40664,
17,
6494,
17934,
3556,
71,
16,
29,
198,
220,
220,
220,
1279,
11487,
29,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
2213,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
400,
29,
27275,
3556,
400,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
400,
29,
5248,
3055,
3556,
400,
29,
198,
220,
220,
220,
220,
220,
220,
220,
7359,
2213,
29,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
2213,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
8671,
29,
464,
24124,
3556,
8671,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
8671,
29,
464,
2085,
9520,
0,
5438,
514,
262,
2085,
9520,
0,
3556,
8671,
29,
198,
220,
220,
220,
220,
220,
220,
220,
7359,
2213,
29,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
2213,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
8671,
29,
33,
19151,
2802,
3556,
8671,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
8671,
29,
3844,
345,
6004,
994,
0,
679,
338,
407,
262,
2085,
9520,
26,
339,
338,
257,
845,
45128,
2933,
0,
2735,
467,
1497,
0,
3556,
8671,
29,
198,
220,
220,
220,
220,
220,
220,
220,
7359,
2213,
29,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
2213,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
8671,
29,
464,
24124,
3556,
8671,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
8671,
29,
8241,
389,
345,
30,
3556,
8671,
29,
198,
220,
220,
220,
220,
220,
220,
220,
7359,
2213,
29,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
2213,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
8671,
29,
33,
19151,
2802,
3556,
8671,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
8671,
29,
40,
1101,
465,
2802,
26,
326,
338,
508,
0,
3556,
8671,
29,
198,
220,
220,
220,
220,
220,
220,
220,
7359,
2213,
29,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
2213,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
8671,
29,
464,
24124,
3556,
8671,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
8671,
29,
3856,
2946,
465,
2802,
0,
1355,
2946,
465,
2802,
0,
3556,
8671,
29,
198,
220,
220,
220,
220,
220,
220,
220,
7359,
2213,
29,
198,
220,
220,
220,
7359,
11487,
29,
198,
3556,
2618,
29,
198,
3556,
6494,
29,
198
] | 1.628409 | 880 |
# length(pdp::VkPhysicalDeviceProperties) = 1
# iterate(pdp::VkPhysicalDeviceProperties) = (pdp, nothing) | [
2,
4129,
7,
79,
26059,
3712,
53,
74,
31611,
24728,
2964,
18200,
8,
796,
352,
198,
2,
11629,
378,
7,
79,
26059,
3712,
53,
74,
31611,
24728,
2964,
18200,
8,
796,
357,
79,
26059,
11,
2147,
8
] | 2.837838 | 37 |
# Test Linear System Optimizaiton
using SwitchTimeOpt
using MathOptInterface
using LinearAlgebra
const MOI = MathOptInterface
using Ipopt
# Define test options
objtol = 1e-04
primaltol = 1e-03
# Define Solver options
maxiter = 50
maxtime = 100.0
verbose = 0
tolerance = 1e-06
#Define solver
solver = Ipopt.Optimizer()
MOI.set(solver, MOI.RawOptimizerAttribute("tol"), tolerance)
MOI.set(solver, MOI.RawOptimizerAttribute("print_level"), verbose)
MOI.set(solver, MOI.RawOptimizerAttribute("max_cpu_time"), maxtime)
MOI.set(solver, MOI.RawOptimizerAttribute("max_iter"), maxiter)
# Size of the state space
nx = 2;
# Cost function Matrix
Q = 1.0 * Matrix(I, nx, nx)
# Initial State
x0 = [1.0; 1.0]
# Define initial and final time
t0 = 0.0
tf = 1.0
### Define System Dynamics
A = zeros(nx, nx, 2)
A[:, :, 1] = [-1 0;
1 2]
A[:, :, 2] = [1 1;
1 -2]
m = stoproblem(x0, A, solver=solver)
solve!(m)
@testset "Test optimal switching time" begin
@test isapprox(gettau(m)[1], 0.26486646235103123, atol=primaltol)
end
@testset "Test status and optimal objective value" begin
@test isapprox(getobjval(m), 5.2545429449272145, atol=objtol)
@test string(getstat(m)) == "LOCALLY_SOLVED"
end
| [
2,
6208,
44800,
4482,
30011,
528,
4548,
261,
198,
3500,
14645,
7575,
27871,
198,
3500,
16320,
27871,
39317,
198,
3500,
44800,
2348,
29230,
198,
9979,
13070,
40,
796,
16320,
27871,
39317,
198,
3500,
314,
79,
8738,
198,
198,
2,
2896,
500,
1332,
3689,
198,
26801,
83,
349,
796,
352,
68,
12,
3023,
198,
19795,
2501,
349,
796,
352,
68,
12,
3070,
198,
198,
2,
2896,
500,
4294,
332,
3689,
198,
9806,
2676,
796,
2026,
198,
2611,
742,
524,
796,
1802,
13,
15,
198,
19011,
577,
796,
657,
198,
83,
37668,
796,
352,
68,
12,
3312,
198,
198,
2,
7469,
500,
1540,
332,
198,
82,
14375,
796,
314,
79,
8738,
13,
27871,
320,
7509,
3419,
198,
11770,
40,
13,
2617,
7,
82,
14375,
11,
13070,
40,
13,
27369,
27871,
320,
7509,
33682,
7203,
83,
349,
12340,
15621,
8,
198,
11770,
40,
13,
2617,
7,
82,
14375,
11,
13070,
40,
13,
27369,
27871,
320,
7509,
33682,
7203,
4798,
62,
5715,
12340,
15942,
577,
8,
198,
11770,
40,
13,
2617,
7,
82,
14375,
11,
13070,
40,
13,
27369,
27871,
320,
7509,
33682,
7203,
9806,
62,
36166,
62,
2435,
12340,
17266,
742,
524,
8,
198,
11770,
40,
13,
2617,
7,
82,
14375,
11,
13070,
40,
13,
27369,
27871,
320,
7509,
33682,
7203,
9806,
62,
2676,
12340,
3509,
2676,
8,
628,
198,
198,
2,
12849,
286,
262,
1181,
2272,
198,
77,
87,
796,
362,
26,
198,
198,
2,
6446,
2163,
24936,
198,
48,
796,
352,
13,
15,
1635,
24936,
7,
40,
11,
299,
87,
11,
299,
87,
8,
198,
198,
2,
20768,
1812,
198,
87,
15,
796,
685,
16,
13,
15,
26,
352,
13,
15,
60,
628,
198,
2,
2896,
500,
4238,
290,
2457,
640,
198,
83,
15,
796,
657,
13,
15,
198,
27110,
796,
352,
13,
15,
198,
198,
21017,
2896,
500,
4482,
33806,
198,
32,
796,
1976,
27498,
7,
77,
87,
11,
299,
87,
11,
362,
8,
198,
32,
58,
45299,
1058,
11,
352,
60,
796,
25915,
16,
657,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
352,
220,
362,
60,
198,
32,
58,
45299,
1058,
11,
362,
60,
796,
685,
16,
352,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
352,
532,
17,
60,
198,
198,
76,
796,
2245,
305,
11253,
7,
87,
15,
11,
317,
11,
1540,
332,
28,
82,
14375,
8,
198,
82,
6442,
0,
7,
76,
8,
198,
198,
31,
9288,
2617,
366,
14402,
16586,
15430,
640,
1,
2221,
220,
198,
220,
2488,
9288,
318,
1324,
13907,
7,
1136,
83,
559,
7,
76,
38381,
16,
4357,
657,
13,
2075,
34251,
27720,
22370,
15197,
10163,
11,
379,
349,
28,
19795,
2501,
349,
8,
198,
437,
198,
198,
31,
9288,
2617,
366,
14402,
3722,
290,
16586,
9432,
1988,
1,
2221,
220,
198,
220,
2488,
9288,
318,
1324,
13907,
7,
1136,
26801,
2100,
7,
76,
828,
642,
13,
1495,
2231,
11785,
31911,
29807,
18781,
11,
379,
349,
28,
26801,
83,
349,
8,
198,
220,
2488,
9288,
4731,
7,
1136,
14269,
7,
76,
4008,
6624,
366,
29701,
19807,
62,
50,
3535,
53,
1961,
1,
198,
437,
198
] | 2.362934 | 518 |
## ScalarAffineFunction-in-Set
## ScalarQuadraticFunction-in-Set
function _build_constraint(
model::Optimizer,
f::F,
s::MOI.GreaterThan{T},
) where {
T <: Real,
F <: Union{MOI.ScalarAffineFunction{T}, MOI.ScalarQuadraticFunction{T}},
}
return cpo_java_ge(model.inner, _parse(model, f), s.lower)
end
function _build_constraint(
model::Optimizer,
f::F,
s::MOI.LessThan{T},
) where {
T <: Real,
F <: Union{MOI.ScalarAffineFunction{T}, MOI.ScalarQuadraticFunction{T}},
}
return cpo_java_le(model.inner, _parse(model, f), s.upper)
end
function _build_constraint(
model::Optimizer,
f::F,
s::MOI.EqualTo{T},
) where {
T <: Real,
F <: Union{MOI.ScalarAffineFunction{T}, MOI.ScalarQuadraticFunction{T}},
}
return cpo_java_eq(model.inner, _parse(model, f), s.value)
end
function _build_constraint(
model::Optimizer,
f::F,
s::MOI.EqualTo{T},
) where {
T <: Integer,
F <: Union{MOI.ScalarAffineFunction{T}, MOI.ScalarQuadraticFunction{T}},
}
return cpo_java_eq(model.inner, _parse(model, f), Int32(s.value))
end
function _build_constraint(
model::Optimizer,
f::F,
s::MOI.Interval{T},
) where {
T <: Real,
F <: Union{MOI.ScalarAffineFunction{T}, MOI.ScalarQuadraticFunction{T}},
}
if s.lower == Inf
return _build_constraint(model, f, MOI.LessThan(s.upper))
elseif s.upper == Inf
return _build_constraint(model, f, MOI.GreaterThan(s.lower))
elseif s.lower == s.upper
return _build_constraint(model, f, MOI.EqualTo(s.lower))
end
return cpo_java_range(model.inner, s.lower, _parse(model, f), s.upper)
end
# No vector of constraints, there is no more efficient way to do it.
function MOI.delete(
model::Optimizer,
c::MOI.ConstraintIndex{F, S},
) where {
T <: Real,
F <: Union{MOI.ScalarAffineFunction{T}, MOI.ScalarQuadraticFunction{T}},
S <:
Union{MOI.GreaterThan{T}, MOI.LessThan{T}, MOI.EqualTo{T}, MOI.Interval{T}},
}
cpo_java_remove(model.inner, _info(model, c).constraint)
delete!(model.constraint_info, c)
return
end
# TODO: function MOI.set(model::Optimizer, ::MOI.ConstraintSet, c::MOI.ConstraintIndex{MOI.ScalarAffineFunction{Float64}, S}, s::S) where {S}
## VectorOfVariables-in-SOS{I|II}
# Not available. Bridge it?
## VectorOfVariables-in-SecondOrderCone
function _build_constraint(
model::Optimizer,
f::MOI.VectorOfVariables,
s::MOI.SecondOrderCone,
)
if length(f.variables) != s.dimension
error("Dimension of $(s) does not match number of terms in $(f)")
end
# First, check the lower bound on t.
t_info = _info(model, f.variables[1])
if !_has_lb(model, t_info.index) || _get_lb(model, t_info.index) < 0.0
if _get_lb(model, t_info.index) < 0.0
t_info.old_lb = _get_lb(model, t_info.index)
end
t_info.n_socs += 1
_set_lb(model, t_info.index, 0.0)
end
# Then, add the quadratic constraint.
expr = _parse(model, f, s)
return cpo_java_gt(model, expr, 0)
end
function MOI.delete(
model::Optimizer,
c::MOI.ConstraintIndex{MOI.VectorOfVariables, MOI.SecondOrderCone},
)
# Remove the constraint.
cpo_java_remove(model, _info(model, c).constraint)
# Maybe restore the old bound on t.
t_info = _info(model, f.variables[1])
t_info.n_socs -= 1
if t_info.n_socs == 0
_set_lb(model, t_info.index, t_info.old_lb, typeof(t_info.old_lb))
t_info.old_lb = nothing
end
return
end
| [
2235,
34529,
283,
35191,
500,
22203,
12,
259,
12,
7248,
198,
2235,
34529,
283,
4507,
41909,
1512,
22203,
12,
259,
12,
7248,
198,
198,
8818,
4808,
11249,
62,
1102,
2536,
2913,
7,
198,
220,
220,
220,
2746,
3712,
27871,
320,
7509,
11,
198,
220,
220,
220,
277,
3712,
37,
11,
198,
220,
220,
220,
264,
3712,
11770,
40,
13,
13681,
263,
817,
272,
90,
51,
5512,
198,
8,
810,
1391,
198,
220,
220,
220,
309,
1279,
25,
6416,
11,
198,
220,
220,
220,
376,
1279,
25,
4479,
90,
11770,
40,
13,
3351,
282,
283,
35191,
500,
22203,
90,
51,
5512,
13070,
40,
13,
3351,
282,
283,
4507,
41909,
1512,
22203,
90,
51,
92,
5512,
198,
92,
198,
220,
220,
220,
1441,
269,
7501,
62,
12355,
62,
469,
7,
19849,
13,
5083,
11,
4808,
29572,
7,
19849,
11,
277,
828,
264,
13,
21037,
8,
198,
437,
198,
198,
8818,
4808,
11249,
62,
1102,
2536,
2913,
7,
198,
220,
220,
220,
2746,
3712,
27871,
320,
7509,
11,
198,
220,
220,
220,
277,
3712,
37,
11,
198,
220,
220,
220,
264,
3712,
11770,
40,
13,
22058,
817,
272,
90,
51,
5512,
198,
8,
810,
1391,
198,
220,
220,
220,
309,
1279,
25,
6416,
11,
198,
220,
220,
220,
376,
1279,
25,
4479,
90,
11770,
40,
13,
3351,
282,
283,
35191,
500,
22203,
90,
51,
5512,
13070,
40,
13,
3351,
282,
283,
4507,
41909,
1512,
22203,
90,
51,
92,
5512,
198,
92,
198,
220,
220,
220,
1441,
269,
7501,
62,
12355,
62,
293,
7,
19849,
13,
5083,
11,
4808,
29572,
7,
19849,
11,
277,
828,
264,
13,
45828,
8,
198,
437,
198,
198,
8818,
4808,
11249,
62,
1102,
2536,
2913,
7,
198,
220,
220,
220,
2746,
3712,
27871,
320,
7509,
11,
198,
220,
220,
220,
277,
3712,
37,
11,
198,
220,
220,
220,
264,
3712,
11770,
40,
13,
36,
13255,
2514,
90,
51,
5512,
198,
8,
810,
1391,
198,
220,
220,
220,
309,
1279,
25,
6416,
11,
198,
220,
220,
220,
376,
1279,
25,
4479,
90,
11770,
40,
13,
3351,
282,
283,
35191,
500,
22203,
90,
51,
5512,
13070,
40,
13,
3351,
282,
283,
4507,
41909,
1512,
22203,
90,
51,
92,
5512,
198,
92,
198,
220,
220,
220,
1441,
269,
7501,
62,
12355,
62,
27363,
7,
19849,
13,
5083,
11,
4808,
29572,
7,
19849,
11,
277,
828,
264,
13,
8367,
8,
198,
437,
198,
198,
8818,
4808,
11249,
62,
1102,
2536,
2913,
7,
198,
220,
220,
220,
2746,
3712,
27871,
320,
7509,
11,
198,
220,
220,
220,
277,
3712,
37,
11,
198,
220,
220,
220,
264,
3712,
11770,
40,
13,
36,
13255,
2514,
90,
51,
5512,
198,
8,
810,
1391,
198,
220,
220,
220,
309,
1279,
25,
34142,
11,
198,
220,
220,
220,
376,
1279,
25,
4479,
90,
11770,
40,
13,
3351,
282,
283,
35191,
500,
22203,
90,
51,
5512,
13070,
40,
13,
3351,
282,
283,
4507,
41909,
1512,
22203,
90,
51,
92,
5512,
198,
92,
198,
220,
220,
220,
1441,
269,
7501,
62,
12355,
62,
27363,
7,
19849,
13,
5083,
11,
4808,
29572,
7,
19849,
11,
277,
828,
2558,
2624,
7,
82,
13,
8367,
4008,
198,
437,
198,
198,
8818,
4808,
11249,
62,
1102,
2536,
2913,
7,
198,
220,
220,
220,
2746,
3712,
27871,
320,
7509,
11,
198,
220,
220,
220,
277,
3712,
37,
11,
198,
220,
220,
220,
264,
3712,
11770,
40,
13,
9492,
2100,
90,
51,
5512,
198,
8,
810,
1391,
198,
220,
220,
220,
309,
1279,
25,
6416,
11,
198,
220,
220,
220,
376,
1279,
25,
4479,
90,
11770,
40,
13,
3351,
282,
283,
35191,
500,
22203,
90,
51,
5512,
13070,
40,
13,
3351,
282,
283,
4507,
41909,
1512,
22203,
90,
51,
92,
5512,
198,
92,
198,
220,
220,
220,
611,
264,
13,
21037,
6624,
4806,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
4808,
11249,
62,
1102,
2536,
2913,
7,
19849,
11,
277,
11,
13070,
40,
13,
22058,
817,
272,
7,
82,
13,
45828,
4008,
198,
220,
220,
220,
2073,
361,
264,
13,
45828,
6624,
4806,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
4808,
11249,
62,
1102,
2536,
2913,
7,
19849,
11,
277,
11,
13070,
40,
13,
13681,
263,
817,
272,
7,
82,
13,
21037,
4008,
198,
220,
220,
220,
2073,
361,
264,
13,
21037,
6624,
264,
13,
45828,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
4808,
11249,
62,
1102,
2536,
2913,
7,
19849,
11,
277,
11,
13070,
40,
13,
36,
13255,
2514,
7,
82,
13,
21037,
4008,
198,
220,
220,
220,
886,
628,
220,
220,
220,
1441,
269,
7501,
62,
12355,
62,
9521,
7,
19849,
13,
5083,
11,
264,
13,
21037,
11,
4808,
29572,
7,
19849,
11,
277,
828,
264,
13,
45828,
8,
198,
437,
198,
198,
2,
1400,
15879,
286,
17778,
11,
612,
318,
645,
517,
6942,
835,
284,
466,
340,
13,
198,
198,
8818,
13070,
40,
13,
33678,
7,
198,
220,
220,
220,
2746,
3712,
27871,
320,
7509,
11,
198,
220,
220,
220,
269,
3712,
11770,
40,
13,
3103,
2536,
2913,
15732,
90,
37,
11,
311,
5512,
198,
8,
810,
1391,
198,
220,
220,
220,
309,
1279,
25,
6416,
11,
198,
220,
220,
220,
376,
1279,
25,
4479,
90,
11770,
40,
13,
3351,
282,
283,
35191,
500,
22203,
90,
51,
5512,
13070,
40,
13,
3351,
282,
283,
4507,
41909,
1512,
22203,
90,
51,
92,
5512,
198,
220,
220,
220,
311,
1279,
25,
198,
220,
220,
220,
4479,
90,
11770,
40,
13,
13681,
263,
817,
272,
90,
51,
5512,
13070,
40,
13,
22058,
817,
272,
90,
51,
5512,
13070,
40,
13,
36,
13255,
2514,
90,
51,
5512,
13070,
40,
13,
9492,
2100,
90,
51,
92,
5512,
198,
92,
198,
220,
220,
220,
269,
7501,
62,
12355,
62,
28956,
7,
19849,
13,
5083,
11,
4808,
10951,
7,
19849,
11,
269,
737,
1102,
2536,
2913,
8,
198,
220,
220,
220,
12233,
0,
7,
19849,
13,
1102,
2536,
2913,
62,
10951,
11,
269,
8,
198,
220,
220,
220,
1441,
198,
437,
198,
198,
2,
16926,
46,
25,
2163,
13070,
40,
13,
2617,
7,
19849,
3712,
27871,
320,
7509,
11,
7904,
11770,
40,
13,
3103,
2536,
2913,
7248,
11,
269,
3712,
11770,
40,
13,
3103,
2536,
2913,
15732,
90,
11770,
40,
13,
3351,
282,
283,
35191,
500,
22203,
90,
43879,
2414,
5512,
311,
5512,
264,
3712,
50,
8,
810,
1391,
50,
92,
198,
198,
2235,
20650,
5189,
23907,
2977,
12,
259,
12,
50,
2640,
90,
40,
91,
3978,
92,
198,
2,
1892,
1695,
13,
10290,
340,
30,
198,
198,
2235,
20650,
5189,
23907,
2977,
12,
259,
12,
12211,
18743,
34,
505,
198,
198,
8818,
4808,
11249,
62,
1102,
2536,
2913,
7,
198,
220,
220,
220,
2746,
3712,
27871,
320,
7509,
11,
198,
220,
220,
220,
277,
3712,
11770,
40,
13,
38469,
5189,
23907,
2977,
11,
198,
220,
220,
220,
264,
3712,
11770,
40,
13,
12211,
18743,
34,
505,
11,
198,
8,
198,
220,
220,
220,
611,
4129,
7,
69,
13,
25641,
2977,
8,
14512,
264,
13,
46156,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
7203,
29271,
3004,
286,
29568,
82,
8,
857,
407,
2872,
1271,
286,
2846,
287,
29568,
69,
8,
4943,
198,
220,
220,
220,
886,
628,
220,
220,
220,
1303,
3274,
11,
2198,
262,
2793,
5421,
319,
256,
13,
198,
220,
220,
220,
256,
62,
10951,
796,
4808,
10951,
7,
19849,
11,
277,
13,
25641,
2977,
58,
16,
12962,
198,
220,
220,
220,
611,
5145,
62,
10134,
62,
23160,
7,
19849,
11,
256,
62,
10951,
13,
9630,
8,
8614,
4808,
1136,
62,
23160,
7,
19849,
11,
256,
62,
10951,
13,
9630,
8,
1279,
657,
13,
15,
198,
220,
220,
220,
220,
220,
220,
220,
611,
4808,
1136,
62,
23160,
7,
19849,
11,
256,
62,
10951,
13,
9630,
8,
1279,
657,
13,
15,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
62,
10951,
13,
727,
62,
23160,
796,
4808,
1136,
62,
23160,
7,
19849,
11,
256,
62,
10951,
13,
9630,
8,
198,
220,
220,
220,
220,
220,
220,
220,
886,
628,
220,
220,
220,
220,
220,
220,
220,
256,
62,
10951,
13,
77,
62,
35634,
82,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
4808,
2617,
62,
23160,
7,
19849,
11,
256,
62,
10951,
13,
9630,
11,
657,
13,
15,
8,
198,
220,
220,
220,
886,
628,
220,
220,
220,
1303,
3244,
11,
751,
262,
15094,
81,
1512,
32315,
13,
198,
220,
220,
220,
44052,
796,
4808,
29572,
7,
19849,
11,
277,
11,
264,
8,
198,
220,
220,
220,
1441,
269,
7501,
62,
12355,
62,
13655,
7,
19849,
11,
44052,
11,
657,
8,
198,
437,
198,
198,
8818,
13070,
40,
13,
33678,
7,
198,
220,
220,
220,
2746,
3712,
27871,
320,
7509,
11,
198,
220,
220,
220,
269,
3712,
11770,
40,
13,
3103,
2536,
2913,
15732,
90,
11770,
40,
13,
38469,
5189,
23907,
2977,
11,
13070,
40,
13,
12211,
18743,
34,
505,
5512,
198,
8,
198,
220,
220,
220,
1303,
17220,
262,
32315,
13,
198,
220,
220,
220,
269,
7501,
62,
12355,
62,
28956,
7,
19849,
11,
4808,
10951,
7,
19849,
11,
269,
737,
1102,
2536,
2913,
8,
628,
220,
220,
220,
1303,
6674,
11169,
262,
1468,
5421,
319,
256,
13,
198,
220,
220,
220,
256,
62,
10951,
796,
4808,
10951,
7,
19849,
11,
277,
13,
25641,
2977,
58,
16,
12962,
198,
220,
220,
220,
256,
62,
10951,
13,
77,
62,
35634,
82,
48185,
352,
628,
220,
220,
220,
611,
256,
62,
10951,
13,
77,
62,
35634,
82,
6624,
657,
198,
220,
220,
220,
220,
220,
220,
220,
4808,
2617,
62,
23160,
7,
19849,
11,
256,
62,
10951,
13,
9630,
11,
256,
62,
10951,
13,
727,
62,
23160,
11,
2099,
1659,
7,
83,
62,
10951,
13,
727,
62,
23160,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
256,
62,
10951,
13,
727,
62,
23160,
796,
2147,
198,
220,
220,
220,
886,
628,
220,
220,
220,
1441,
198,
437,
198
] | 2.172414 | 1,624 |
module InterfaceTesting
using Base.Test
export partial_method_exists,
test_iterator_interface,
test_index_interface,
test_abstractarray_interface
"""
Checks if a method exist.
The first parameter is the function.
The second parameter is a list of types, or wild cards.
THe `:` is used as a wildcard.
Wild cards match any type (Not just `Any`)
"""
function partial_method_exists(f, types)
meths = methods(f)
for mm in meths
@show mm
sig_types = mm.sig.types[2:end]
length(types) != length(sig_types) && continue
for (spec, sig) in zip(types, sig_types)
spec==(:) && continue
spec <: sig || @goto next_meth
end
return true
@label next_meth
end
return false
end
"""
Checks that all the method expected of an Interator are defined.
This is the most formal and common of informal interfaced.
It is practically useless to not implement it properly.
"""
function test_iterator_interface(itertype; testset_type=Test.DefaultTestSet)
@testset testset_type "$(itertype)" begin
#Basic Methods
@test method_exists(start, (itertype,))
@test partial_method_exists(next, (itertype,:))
@test partial_method_exists(done, (itertype,:))
#Iterators size
@test which(Base.iteratorsize, (itertype,)) == which(Base.iteratorsize, (Any,))#Method for Instance of type should always be the fall back -- never set directly
if Base.iteratorsize(itertype)==Base.HasShape()
@test method_exists(size, (itertype,))
@test method_exists(length, (itertype,))
elseif Base.iteratorsize(itertype)==Base.HasLength()
@test method_exists(length, (itertype,))
else
@test Base.iteratorsize(itertype) in (Base.SizeUnknown(), Base.IsInfinite())
end
#Iterator Eltype
if Base.iteratoreltype(itertype) == Base.HasEltype()
@test method_exists(eltype, (itertype,))
end
end
end
"""
Checks Indexing Interface implemented.
This is the least formal of informal interfaces.
There a plenty of useful partial implementatons of it.
Eg a read-only things
"""
function test_index_interface(kind; testset_type=Test.DefaultTestSet)
@testset testset_type "$(kind)" begin
if method_exists(getindex, (kind, Vararg))
@test partial_method_exists(size, (kind, :)) #otherwise `end` won't work in multidimentional index expressions
else #Assume 1D indexing only has been defined
@test partial_method_exists(getindex, (kind,:))
end
@test partial_method_exists(setindex!, (kind,:,:)) #Got to have something. 1D will do. Might have more, kinda complex
@test method_exists(endof, (kind,)) #If not defined then `end` won't work
end
end
"""
Checks AbstractArray Interface implemented.
This is required for all subtypes of AbstractArray.
Filling this will mean automatically furfilling `test_index_interface`
"""
function test_abstractarray_interface(kind; testset_type=Test.DefaultTestSet)
@testset testset_type "$(kind)" begin
@test method_exists(size, (kind,))
@test method_exists(getindex, (kind, Vararg{Int}))
@test partial_method_exists(setindex!, (kind, :, :))
end
end
end # module
| [
21412,
26491,
44154,
198,
3500,
7308,
13,
14402,
198,
198,
39344,
13027,
62,
24396,
62,
1069,
1023,
11,
198,
220,
220,
220,
1332,
62,
48727,
62,
39994,
11,
198,
220,
220,
220,
1332,
62,
9630,
62,
39994,
11,
198,
220,
220,
220,
1332,
62,
397,
8709,
18747,
62,
39994,
198,
198,
37811,
198,
7376,
4657,
611,
257,
2446,
2152,
13,
198,
464,
717,
11507,
318,
262,
2163,
13,
198,
464,
1218,
11507,
318,
257,
1351,
286,
3858,
11,
393,
4295,
4116,
13,
198,
51,
1544,
4600,
25,
63,
318,
973,
355,
257,
4295,
9517,
13,
198,
25946,
4116,
2872,
597,
2099,
357,
3673,
655,
4600,
7149,
63,
8,
198,
198,
37811,
198,
8818,
13027,
62,
24396,
62,
1069,
1023,
7,
69,
11,
3858,
8,
198,
220,
220,
220,
11248,
82,
796,
5050,
7,
69,
8,
198,
220,
220,
220,
329,
8085,
287,
11248,
82,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
12860,
8085,
198,
220,
220,
220,
220,
220,
220,
220,
43237,
62,
19199,
796,
220,
8085,
13,
82,
328,
13,
19199,
58,
17,
25,
437,
60,
198,
220,
220,
220,
220,
220,
220,
220,
4129,
7,
19199,
8,
14512,
4129,
7,
82,
328,
62,
19199,
8,
220,
11405,
2555,
628,
220,
220,
220,
220,
220,
220,
220,
329,
357,
16684,
11,
43237,
8,
287,
19974,
7,
19199,
11,
43237,
62,
19199,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1020,
855,
7,
25,
8,
11405,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1020,
1279,
25,
43237,
8614,
2488,
70,
2069,
1306,
62,
76,
2788,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2081,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
18242,
1306,
62,
76,
2788,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1441,
3991,
198,
437,
198,
198,
37811,
198,
7376,
4657,
326,
477,
262,
2446,
2938,
286,
281,
4225,
1352,
389,
5447,
13,
198,
1212,
318,
262,
749,
8766,
290,
2219,
286,
22176,
9556,
2286,
13,
198,
1026,
318,
14547,
13894,
284,
407,
3494,
340,
6105,
13,
198,
37811,
198,
8818,
1332,
62,
48727,
62,
39994,
7,
2676,
4906,
26,
1332,
2617,
62,
4906,
28,
14402,
13,
19463,
14402,
7248,
8,
198,
220,
220,
220,
2488,
9288,
2617,
1332,
2617,
62,
4906,
17971,
7,
2676,
4906,
16725,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
26416,
25458,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2446,
62,
1069,
1023,
7,
9688,
11,
357,
2676,
4906,
11,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
13027,
62,
24396,
62,
1069,
1023,
7,
19545,
11,
357,
2676,
4906,
11,
25,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
13027,
62,
24396,
62,
1069,
1023,
7,
28060,
11,
357,
2676,
4906,
11,
25,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
29993,
2024,
2546,
628,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
543,
7,
14881,
13,
2676,
2024,
1096,
11,
357,
2676,
4906,
11,
4008,
6624,
543,
7,
14881,
13,
2676,
2024,
1096,
11,
357,
7149,
11,
4008,
2,
17410,
329,
2262,
590,
286,
2099,
815,
1464,
307,
262,
2121,
736,
1377,
1239,
900,
3264,
628,
220,
220,
220,
220,
220,
220,
220,
611,
7308,
13,
2676,
2024,
1096,
7,
2676,
4906,
8,
855,
14881,
13,
19242,
33383,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2446,
62,
1069,
1023,
7,
7857,
11,
357,
2676,
4906,
11,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2446,
62,
1069,
1023,
7,
13664,
11,
357,
2676,
4906,
11,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
361,
7308,
13,
2676,
2024,
1096,
7,
2676,
4906,
8,
855,
14881,
13,
19242,
24539,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2446,
62,
1069,
1023,
7,
13664,
11,
357,
2676,
4906,
11,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
7308,
13,
2676,
2024,
1096,
7,
2676,
4906,
8,
287,
357,
14881,
13,
10699,
20035,
22784,
7308,
13,
3792,
18943,
9504,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
886,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
37787,
2574,
4906,
198,
220,
220,
220,
220,
220,
220,
220,
611,
7308,
13,
2676,
265,
382,
75,
4906,
7,
2676,
4906,
8,
6624,
7308,
13,
19242,
9527,
4906,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2446,
62,
1069,
1023,
7,
417,
4906,
11,
357,
2676,
4906,
11,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
886,
628,
220,
220,
220,
886,
198,
437,
198,
198,
37811,
198,
7376,
4657,
12901,
278,
26491,
9177,
13,
198,
1212,
318,
262,
1551,
8766,
286,
22176,
20314,
13,
198,
1858,
257,
6088,
286,
4465,
13027,
3494,
265,
684,
286,
340,
13,
198,
36,
70,
257,
1100,
12,
8807,
1243,
198,
37811,
198,
8818,
1332,
62,
9630,
62,
39994,
7,
11031,
26,
1332,
2617,
62,
4906,
28,
14402,
13,
19463,
14402,
7248,
8,
198,
220,
220,
220,
2488,
9288,
2617,
1332,
2617,
62,
4906,
17971,
7,
11031,
16725,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2446,
62,
1069,
1023,
7,
1136,
9630,
11,
357,
11031,
11,
12372,
853,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
13027,
62,
24396,
62,
1069,
1023,
7,
7857,
11,
357,
11031,
11,
1058,
4008,
1303,
847,
3083,
4600,
437,
63,
1839,
470,
670,
287,
1963,
312,
320,
1463,
282,
6376,
14700,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
1303,
8021,
2454,
352,
35,
6376,
278,
691,
468,
587,
5447,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
13027,
62,
24396,
62,
1069,
1023,
7,
1136,
9630,
11,
357,
11031,
11,
25,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
13027,
62,
24396,
62,
1069,
1023,
7,
2617,
9630,
28265,
357,
11031,
11,
45299,
25,
4008,
1303,
30074,
284,
423,
1223,
13,
352,
35,
481,
466,
13,
24213,
423,
517,
11,
17855,
3716,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2446,
62,
1069,
1023,
7,
437,
1659,
11,
357,
11031,
11,
4008,
1303,
1532,
407,
5447,
788,
4600,
437,
63,
1839,
470,
670,
628,
220,
220,
220,
886,
198,
437,
628,
198,
37811,
198,
7376,
4657,
27741,
19182,
26491,
9177,
13,
198,
1212,
318,
2672,
329,
477,
850,
19199,
286,
27741,
19182,
13,
198,
37,
4509,
428,
481,
1612,
6338,
9230,
69,
4509,
4600,
9288,
62,
9630,
62,
39994,
63,
198,
37811,
198,
8818,
1332,
62,
397,
8709,
18747,
62,
39994,
7,
11031,
26,
1332,
2617,
62,
4906,
28,
14402,
13,
19463,
14402,
7248,
8,
198,
220,
220,
220,
2488,
9288,
2617,
1332,
2617,
62,
4906,
17971,
7,
11031,
16725,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2446,
62,
1069,
1023,
7,
7857,
11,
357,
11031,
11,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2446,
62,
1069,
1023,
7,
1136,
9630,
11,
357,
11031,
11,
12372,
853,
90,
5317,
92,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
13027,
62,
24396,
62,
1069,
1023,
7,
2617,
9630,
28265,
357,
11031,
11,
1058,
11,
1058,
4008,
198,
220,
220,
220,
886,
198,
437,
198,
198,
437,
1303,
8265,
198
] | 2.61326 | 1,267 |
######################################################################
# Suite of macros to automatically generate getters and setters for
# object properties along with the accompanying `hasproperty` and
# `propertynames` specializations.
# -----
# Licensed under MIT License
module GenerateProperties
const Optional{T} = Union{T, Nothing}
const GetterSetterBody = Tuple{Optional{LineNumberNode}, Expr}
struct StructProp{S, F} end
struct StructField{S, F} end
assign(inst, field::Symbol, value) = assign(StructProp{typeof(inst), field}, inst, value)
assign( ::Type{StructProp{ S, F}}, inst::S, value) where {S, F} = assign(StructField{S, F}, inst, value)
assign(T::Type{StructField{S, F}}, inst::S, value) where {S, F} = assign(getfieldtype(T), inst, F, value)
assign(::Type{T}, inst, field::Symbol, value) where {T} = setfield!(inst, field, convert(T, value))
assign(::Type{T1}, inst, field::Symbol, value::T2) where {T1, T2<:T1} = setfield!(inst, field, value)
assign(::Type{T1}, inst, field::Symbol, value::T2) where {T1<:Number, T2<:Number} = setfield!(inst, field, T1(value))
retrieve(inst, field::Symbol) = retrieve(StructProp{typeof(inst), field}, inst)
retrieve(::Type{StructProp{ S, F}}, inst::S) where {S, F} = retrieve(StructField{S, F}, inst)
retrieve(::Type{StructField{S, F}}, inst::S) where {S, F} = getfield(inst, F)
getparambody(x) = x
getparambody(unionall::UnionAll) = getparambody(unionall.body)
getfieldtype(S::Type, F::Symbol) = getfieldtype(StructField{S, F})
@generated function getfieldtype(::Type{StructField{S, F}}) where {S, F}
@assert !isa(S, UnionAll) "Cannot reliably use getfieldtype with UnionAll"
idx = findfirst(field->field==F, fieldnames(S))
@assert idx !== nothing "Field $F not found in type $S"
T = S.types[idx]
:($T)
end
export @generate_properties
macro generate_properties(T, block)
if !isa(block, Expr) || block.head != :block
throw(ArgumentError("Second argument to @generate_properties must be a block"))
end
result = Expr(:block)
props = Set{Symbol}()
symget = Symbol("@get")
symset = Symbol("@set")
symeq = Symbol("=")
lastlinenumber = nothing
for expr ∈ block.args
if isa(expr, LineNumberNode)
lastlinenumber = expr
else
if expr.head != :macrocall || expr.args[1] ∉ (symget, symset)
throw(ArgumentError("Every line must be a call to either @get or @set"))
end
args = filterlinenumbers(expr.args)
if args[2].head != symeq throw(ArgumentError("Getter/Setter not an assignment")) end
prop, body = filterlinenumbers(args[2].args)
body = replace_self(T, body)
push!(props, prop)
if expr.args[1] == symget
push!(result.args, generate_getter(T, prop, lastlinenumber, body))
elseif expr.args[1] == symset
push!(result.args, generate_setter(T, prop, lastlinenumber, body))
end
lastlinenumber = nothing
end
end
# Generate propertynames
push!(result.args, quote
@generated function Base.propertynames(::$T)
res = tuple(union($props, fieldnames($T))...)
:($res)
end
end)
push!(result.args, :(Base.getproperty(self::$T, prop::Symbol) = GenerateProperties.retrieve(self, prop)))
push!(result.args, :(Base.setproperty!(self::$T, prop::Symbol, value) = GenerateProperties.assign(self, prop, value)))
esc(result)
end
export @get, @set
macro get(args...) end
macro set(args...) end
filterlinenumbers(exprs) = filter(expr->!isa(expr, LineNumberNode), exprs)
replace_self(_, expr) = expr
function replace_self(T::Union{Symbol, Expr}, expr::Expr)
@assert isa(T, Symbol) || T.head == :curly
if expr.head == :(=)
lhs, rhs = expr.args
if isa(lhs, Expr) && lhs.head == :. && lhs.args[1] == :self
prop = lhs.args[2]::QuoteNode
expr = :(GenerateProperties.assign(self, $rhs))
insert!(expr.args, 2, structfieldexpr(prop))
end
elseif expr.head == :.
if expr.args[1] == :self
prop = expr.args[2]::QuoteNode
expr = :(GenerateProperties.retrieve(self))
insert!(expr.args, 2, structfieldexpr(prop))
end
end
expr.args = map(sub->replace_self(T, sub), expr.args)
expr
end
function generate_getter(T, prop::Symbol, linenumber::Optional{LineNumberNode}, body)
block = Expr(:block)
if linenumber !== nothing push!(block.args, linenumber) end
push!(block.args, body)
fnexpr = :(GenerateProperties.retrieve(self::$T) = $block)
insert!(fnexpr.args[1].args, 2, argsubtypeexpr(structpropexpr(T, prop)))
fnexpr
end
function generate_setter(T, prop::Symbol, linenumber::Optional{LineNumberNode}, body)
block = Expr(:block)
if linenumber !== nothing push!(block.args, linenumber) end
push!(block.args, body)
fnexpr = :(GenerateProperties.assign(self::$T, value) = $block)
insert!(fnexpr.args[1].args, 2, argsubtypeexpr(structpropexpr(T, prop)))
fnexpr
end
structpropexpr(T, prop::QuoteNode) = Expr(:curly, :(GenerateProperties.StructProp), :(<:$T), prop)
structpropexpr(T, prop::Symbol) = structpropexpr(T, QuoteNode(prop))
structfieldexpr(prop::QuoteNode) = Expr(:curly, :(GenerateProperties.StructField), :(typeof(self)), prop)
structfieldexpr(prop::Symbol) = structfieldexpr(QuoteNode(prop))
function argtypeexpr(type::Expr)
Expr(:(::), Expr(:curly, :Type, type))
end
function argsubtypeexpr(type::Expr)
Expr(:(::), Expr(:curly, :Type, Expr(:<:, type)))
end
end # module GenerateProperties
| [
29113,
29113,
4242,
2235,
198,
2,
26264,
286,
34749,
284,
6338,
7716,
651,
1010,
290,
900,
1010,
329,
198,
2,
2134,
6608,
1863,
351,
262,
19249,
4600,
10134,
26745,
63,
290,
198,
2,
4600,
26745,
14933,
63,
2041,
4582,
13,
198,
2,
37404,
198,
2,
49962,
739,
17168,
13789,
198,
21412,
2980,
378,
2964,
18200,
198,
198,
9979,
32233,
90,
51,
92,
796,
4479,
90,
51,
11,
10528,
92,
198,
9979,
3497,
353,
7248,
353,
25842,
796,
309,
29291,
90,
30719,
90,
13949,
15057,
19667,
5512,
1475,
1050,
92,
198,
198,
7249,
32112,
24331,
90,
50,
11,
376,
92,
886,
198,
7249,
32112,
15878,
90,
50,
11,
376,
92,
886,
198,
198,
562,
570,
7,
8625,
11,
2214,
3712,
13940,
23650,
11,
1988,
8,
796,
8333,
7,
44909,
24331,
90,
4906,
1659,
7,
8625,
828,
2214,
5512,
916,
11,
1988,
8,
198,
562,
570,
7,
7904,
6030,
90,
44909,
24331,
90,
311,
11,
376,
92,
5512,
916,
3712,
50,
11,
1988,
8,
810,
1391,
50,
11,
376,
92,
796,
8333,
7,
44909,
15878,
90,
50,
11,
376,
5512,
916,
11,
1988,
8,
198,
562,
570,
7,
51,
3712,
6030,
90,
44909,
15878,
90,
50,
11,
376,
92,
5512,
916,
3712,
50,
11,
1988,
8,
810,
1391,
50,
11,
376,
92,
796,
8333,
7,
1136,
3245,
4906,
7,
51,
828,
916,
11,
376,
11,
1988,
8,
198,
562,
570,
7,
3712,
6030,
90,
51,
5512,
220,
916,
11,
2214,
3712,
13940,
23650,
11,
1988,
8,
220,
220,
220,
220,
810,
1391,
51,
92,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
900,
3245,
0,
7,
8625,
11,
2214,
11,
10385,
7,
51,
11,
1988,
4008,
198,
562,
570,
7,
3712,
6030,
90,
51,
16,
5512,
916,
11,
2214,
3712,
13940,
23650,
11,
1988,
3712,
51,
17,
8,
810,
1391,
51,
16,
11,
309,
17,
27,
25,
51,
16,
92,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
900,
3245,
0,
7,
8625,
11,
2214,
11,
1988,
8,
198,
562,
570,
7,
3712,
6030,
90,
51,
16,
5512,
916,
11,
2214,
3712,
13940,
23650,
11,
1988,
3712,
51,
17,
8,
810,
1391,
51,
16,
27,
25,
15057,
11,
309,
17,
27,
25,
15057,
92,
796,
900,
3245,
0,
7,
8625,
11,
2214,
11,
309,
16,
7,
8367,
4008,
198,
198,
1186,
30227,
7,
8625,
11,
2214,
3712,
13940,
23650,
8,
796,
19818,
7,
44909,
24331,
90,
4906,
1659,
7,
8625,
828,
2214,
5512,
916,
8,
198,
1186,
30227,
7,
3712,
6030,
90,
44909,
24331,
90,
311,
11,
376,
92,
5512,
916,
3712,
50,
8,
810,
1391,
50,
11,
376,
92,
796,
19818,
7,
44909,
15878,
90,
50,
11,
376,
5512,
916,
8,
198,
1186,
30227,
7,
3712,
6030,
90,
44909,
15878,
90,
50,
11,
376,
92,
5512,
916,
3712,
50,
8,
810,
1391,
50,
11,
376,
92,
796,
651,
3245,
7,
8625,
11,
376,
8,
198,
198,
1136,
17143,
2618,
7,
87,
8,
796,
2124,
198,
1136,
17143,
2618,
7,
24592,
439,
3712,
38176,
3237,
8,
796,
651,
17143,
2618,
7,
24592,
439,
13,
2618,
8,
198,
198,
1136,
3245,
4906,
7,
50,
3712,
6030,
11,
376,
3712,
13940,
23650,
8,
796,
651,
3245,
4906,
7,
44909,
15878,
90,
50,
11,
376,
30072,
198,
31,
27568,
2163,
651,
3245,
4906,
7,
3712,
6030,
90,
44909,
15878,
90,
50,
11,
376,
11709,
8,
810,
1391,
50,
11,
376,
92,
198,
220,
220,
220,
2488,
30493,
5145,
9160,
7,
50,
11,
4479,
3237,
8,
366,
34,
34574,
26995,
779,
651,
3245,
4906,
351,
4479,
3237,
1,
198,
220,
220,
220,
220,
198,
220,
220,
220,
4686,
87,
796,
1064,
11085,
7,
3245,
3784,
3245,
855,
37,
11,
2214,
14933,
7,
50,
4008,
198,
220,
220,
220,
2488,
30493,
4686,
87,
5145,
855,
2147,
366,
15878,
720,
37,
407,
1043,
287,
2099,
720,
50,
1,
198,
220,
220,
220,
220,
198,
220,
220,
220,
309,
796,
311,
13,
19199,
58,
312,
87,
60,
198,
220,
220,
220,
1058,
16763,
51,
8,
198,
437,
198,
198,
39344,
2488,
8612,
378,
62,
48310,
198,
20285,
305,
7716,
62,
48310,
7,
51,
11,
2512,
8,
198,
220,
220,
220,
611,
5145,
9160,
7,
9967,
11,
1475,
1050,
8,
8614,
2512,
13,
2256,
14512,
1058,
9967,
198,
220,
220,
220,
220,
220,
220,
220,
3714,
7,
28100,
1713,
12331,
7203,
12211,
4578,
284,
2488,
8612,
378,
62,
48310,
1276,
307,
257,
2512,
48774,
198,
220,
220,
220,
886,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1255,
796,
1475,
1050,
7,
25,
9967,
8,
198,
220,
220,
220,
25744,
220,
796,
5345,
90,
13940,
23650,
92,
3419,
198,
220,
220,
220,
5659,
1136,
796,
38357,
7203,
31,
1136,
4943,
198,
220,
220,
220,
827,
907,
316,
796,
38357,
7203,
31,
2617,
4943,
198,
220,
220,
220,
827,
1326,
80,
220,
796,
38357,
7203,
2625,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
938,
2815,
268,
4494,
796,
2147,
198,
220,
220,
220,
329,
44052,
18872,
230,
2512,
13,
22046,
198,
220,
220,
220,
220,
220,
220,
220,
611,
318,
64,
7,
31937,
11,
6910,
15057,
19667,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
938,
2815,
268,
4494,
796,
44052,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
44052,
13,
2256,
14512,
1058,
20285,
12204,
439,
8614,
44052,
13,
22046,
58,
16,
60,
18872,
231,
357,
37047,
1136,
11,
827,
907,
316,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3714,
7,
28100,
1713,
12331,
7203,
6109,
1627,
1276,
307,
257,
869,
284,
2035,
2488,
1136,
393,
2488,
2617,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26498,
796,
8106,
2815,
268,
17024,
7,
31937,
13,
22046,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
26498,
58,
17,
4083,
2256,
14512,
827,
1326,
80,
3714,
7,
28100,
1713,
12331,
7203,
3855,
353,
14,
7248,
353,
407,
281,
16237,
48774,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2632,
11,
1767,
796,
8106,
2815,
268,
17024,
7,
22046,
58,
17,
4083,
22046,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1767,
796,
6330,
62,
944,
7,
51,
11,
1767,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4574,
0,
7,
1676,
862,
11,
2632,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
44052,
13,
22046,
58,
16,
60,
6624,
5659,
1136,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4574,
0,
7,
20274,
13,
22046,
11,
7716,
62,
1136,
353,
7,
51,
11,
2632,
11,
938,
2815,
268,
4494,
11,
1767,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
361,
44052,
13,
22046,
58,
16,
60,
6624,
827,
907,
316,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4574,
0,
7,
20274,
13,
22046,
11,
7716,
62,
2617,
353,
7,
51,
11,
2632,
11,
938,
2815,
268,
4494,
11,
1767,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
938,
2815,
268,
4494,
796,
2147,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
2980,
378,
3119,
14933,
198,
220,
220,
220,
4574,
0,
7,
20274,
13,
22046,
11,
9577,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
27568,
2163,
7308,
13,
26745,
14933,
7,
3712,
3,
51,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
581,
796,
46545,
7,
24592,
16763,
1676,
862,
11,
2214,
14933,
16763,
51,
4008,
23029,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1058,
16763,
411,
8,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
4574,
0,
7,
20274,
13,
22046,
11,
36147,
14881,
13,
1136,
26745,
7,
944,
3712,
3,
51,
11,
2632,
3712,
13940,
23650,
8,
796,
2980,
378,
2964,
18200,
13,
1186,
30227,
7,
944,
11,
2632,
22305,
198,
220,
220,
220,
4574,
0,
7,
20274,
13,
22046,
11,
36147,
14881,
13,
2617,
26745,
0,
7,
944,
3712,
3,
51,
11,
2632,
3712,
13940,
23650,
11,
1988,
8,
796,
2980,
378,
2964,
18200,
13,
562,
570,
7,
944,
11,
2632,
11,
1988,
22305,
198,
220,
220,
220,
220,
198,
220,
220,
220,
3671,
7,
20274,
8,
198,
437,
198,
198,
39344,
2488,
1136,
11,
2488,
2617,
198,
20285,
305,
651,
7,
22046,
23029,
886,
198,
20285,
305,
900,
7,
22046,
23029,
886,
198,
198,
24455,
2815,
268,
17024,
7,
31937,
82,
8,
796,
8106,
7,
31937,
3784,
0,
9160,
7,
31937,
11,
6910,
15057,
19667,
828,
1033,
3808,
8,
198,
198,
33491,
62,
944,
28264,
11,
44052,
8,
796,
44052,
198,
8818,
6330,
62,
944,
7,
51,
3712,
38176,
90,
13940,
23650,
11,
1475,
1050,
5512,
44052,
3712,
3109,
1050,
8,
198,
220,
220,
220,
2488,
30493,
318,
64,
7,
51,
11,
38357,
8,
8614,
309,
13,
2256,
6624,
1058,
22019,
306,
198,
220,
220,
220,
611,
44052,
13,
2256,
6624,
36147,
28,
8,
198,
220,
220,
220,
220,
220,
220,
220,
300,
11994,
11,
9529,
82,
796,
44052,
13,
22046,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
611,
318,
64,
7,
75,
11994,
11,
1475,
1050,
8,
11405,
300,
11994,
13,
2256,
6624,
1058,
13,
11405,
300,
11994,
13,
22046,
58,
16,
60,
6624,
1058,
944,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2632,
796,
300,
11994,
13,
22046,
58,
17,
60,
3712,
25178,
19667,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
44052,
796,
36147,
8645,
378,
2964,
18200,
13,
562,
570,
7,
944,
11,
720,
81,
11994,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7550,
0,
7,
31937,
13,
22046,
11,
362,
11,
2878,
3245,
31937,
7,
22930,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
2073,
361,
44052,
13,
2256,
6624,
1058,
13,
198,
220,
220,
220,
220,
220,
220,
220,
611,
44052,
13,
22046,
58,
16,
60,
6624,
1058,
944,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2632,
796,
44052,
13,
22046,
58,
17,
60,
3712,
25178,
19667,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
44052,
796,
36147,
8645,
378,
2964,
18200,
13,
1186,
30227,
7,
944,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7550,
0,
7,
31937,
13,
22046,
11,
362,
11,
2878,
3245,
31937,
7,
22930,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
220,
220,
220,
44052,
13,
22046,
796,
3975,
7,
7266,
3784,
33491,
62,
944,
7,
51,
11,
850,
828,
44052,
13,
22046,
8,
198,
220,
220,
220,
44052,
198,
437,
198,
198,
8818,
7716,
62,
1136,
353,
7,
51,
11,
2632,
3712,
13940,
23650,
11,
41822,
4494,
3712,
30719,
90,
13949,
15057,
19667,
5512,
1767,
8,
198,
220,
220,
220,
2512,
796,
1475,
1050,
7,
25,
9967,
8,
198,
220,
220,
220,
611,
41822,
4494,
5145,
855,
2147,
4574,
0,
7,
9967,
13,
22046,
11,
41822,
4494,
8,
886,
198,
220,
220,
220,
4574,
0,
7,
9967,
13,
22046,
11,
1767,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
277,
12413,
1050,
796,
36147,
8645,
378,
2964,
18200,
13,
1186,
30227,
7,
944,
3712,
3,
51,
8,
796,
720,
9967,
8,
198,
220,
220,
220,
7550,
0,
7,
69,
12413,
1050,
13,
22046,
58,
16,
4083,
22046,
11,
362,
11,
1822,
7266,
4906,
31937,
7,
7249,
1676,
24900,
1050,
7,
51,
11,
2632,
22305,
198,
220,
220,
220,
277,
12413,
1050,
198,
437,
198,
198,
8818,
7716,
62,
2617,
353,
7,
51,
11,
2632,
3712,
13940,
23650,
11,
41822,
4494,
3712,
30719,
90,
13949,
15057,
19667,
5512,
1767,
8,
198,
220,
220,
220,
2512,
796,
1475,
1050,
7,
25,
9967,
8,
198,
220,
220,
220,
611,
41822,
4494,
5145,
855,
2147,
4574,
0,
7,
9967,
13,
22046,
11,
41822,
4494,
8,
886,
198,
220,
220,
220,
4574,
0,
7,
9967,
13,
22046,
11,
1767,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
277,
12413,
1050,
796,
36147,
8645,
378,
2964,
18200,
13,
562,
570,
7,
944,
3712,
3,
51,
11,
1988,
8,
796,
720,
9967,
8,
198,
220,
220,
220,
7550,
0,
7,
69,
12413,
1050,
13,
22046,
58,
16,
4083,
22046,
11,
362,
11,
1822,
7266,
4906,
31937,
7,
7249,
1676,
24900,
1050,
7,
51,
11,
2632,
22305,
198,
220,
220,
220,
277,
12413,
1050,
198,
437,
198,
198,
7249,
1676,
24900,
1050,
7,
51,
11,
2632,
3712,
25178,
19667,
8,
796,
1475,
1050,
7,
25,
22019,
306,
11,
36147,
8645,
378,
2964,
18200,
13,
44909,
24331,
828,
36147,
27,
25,
3,
51,
828,
2632,
8,
198,
7249,
1676,
24900,
1050,
7,
51,
11,
2632,
3712,
13940,
23650,
8,
220,
220,
220,
796,
2878,
1676,
24900,
1050,
7,
51,
11,
19879,
19667,
7,
22930,
4008,
198,
7249,
3245,
31937,
7,
22930,
3712,
25178,
19667,
8,
796,
1475,
1050,
7,
25,
22019,
306,
11,
36147,
8645,
378,
2964,
18200,
13,
44909,
15878,
828,
36147,
4906,
1659,
7,
944,
36911,
2632,
8,
198,
7249,
3245,
31937,
7,
22930,
3712,
13940,
23650,
8,
220,
220,
220,
796,
2878,
3245,
31937,
7,
25178,
19667,
7,
22930,
4008,
198,
198,
8818,
1822,
4906,
31937,
7,
4906,
3712,
3109,
1050,
8,
198,
220,
220,
220,
1475,
1050,
7,
37498,
3712,
828,
1475,
1050,
7,
25,
22019,
306,
11,
1058,
6030,
11,
2099,
4008,
198,
437,
198,
198,
8818,
1822,
7266,
4906,
31937,
7,
4906,
3712,
3109,
1050,
8,
198,
220,
220,
220,
1475,
1050,
7,
37498,
3712,
828,
1475,
1050,
7,
25,
22019,
306,
11,
1058,
6030,
11,
1475,
1050,
7,
25,
27,
45299,
2099,
22305,
198,
437,
198,
198,
437,
1303,
8265,
2980,
378,
2964,
18200,
198
] | 2.367948 | 2,446 |
import Base: +, -, *, /, length, iterate, zero, convert, Vector, Array
"""
This correspond to coordinate of atom.
This contain 3 fields like below.
- x <: Real
- y <: Real
- z <: Real
Some operators and functions were overloaded to make Coordinate objects broadcastable.
"""
mutable struct Coordinate{RealT <: Real}
# This class is for make vector operation broadcastable.
x::RealT
y::RealT
z::RealT
function Coordinate(vector::VectorT
) where VectorT <: AbstractArray{RealT} where RealT <: Real
if length(vector) != 3
ArgumentError("Argument for Coordinate constructor must be array of length 3")
end
new{RealT}(vector[1], vector[2], vector[3])
end
function Coordinate(x::RealT, y::RealT, z::RealT) where RealT <: Real
new{RealT}(x, y, z)
end
end
function +(arg1::Coordinate{T}, arg2::Coordinate{U}) where T <: Real where U <: Real
Coordinate(arg1.x + arg2.x, arg1.y + arg2.y, arg1.z + arg2.z)
end
function -(arg1::Coordinate{T}, arg2::Coordinate{U}) where T <: Real where U <: Real
Coordinate(arg1.x - arg2.x, arg1.y - arg2.y, arg1.z - arg2.z)
end
function *(arg1::Coordinate{T}, arg2::U) where T <: Real where U <: Real
Coordinate(arg1.x * arg2, arg1.y * arg2, arg1.z * arg2)
end
function *(arg1::U, arg2::Coordinate{T}) where T <: Real where U <: Real
Coordinate(arg1 * arg2.x, arg1 * arg2.y, arg1 * arg2.z)
end
function *(arg1::Coordinate{T}, arg2::Coordinate{U}) where T <: Real where U <: Real
arg1.x * arg2.x + arg1.y * arg2.y + arg1.z * arg2.z
end
function /(arg1::Coordinate{T}, arg2::U) where T <: Real where U <: Real
Coordinate(arg1.x / arg2, arg1.y / arg2, arg1.z / arg2)
end
# for operator broadcast
function length(arg::Coordinate{T}) where T <: Real
1
end
function iterate(arg::Coordinate{T}) where T <: Real
(arg, nothing)
end
function iterate(arg::Coordinate{T}, nothing) where T <: Real
nothing
end
function zero(arg::Coordinate{T}) where T <: Real
Coordinate(T(0.0), T(0.0), T(0.0))
end
function convert(::Type{Coordinate{RealT}}, coord::Coordinate{<:Real}) where RealT <: Real
return Coordinate(RealT(coord.x), RealT(coord.y), RealT(coord.z))
end
function Vector(arg::Coordinate{RealT}) where RealT <: Real
[arg.x, arg.y, arg.z]
end
function Array(arg::Coordinate{RealT}) where RealT <: Real
[arg.x, arg.y, arg.z]
end
function norm(arg::Coordinate{T}) where T <: Real
sqrt(abs2(arg.x) + abs2(arg.y) + abs2(arg.z))
end
function distance(first_coord::Coordinate{T}, second_coord::Coordinate{T}) where T <: Real
norm(first_coord - second_coord)
end
| [
11748,
7308,
25,
1343,
11,
532,
11,
1635,
11,
1220,
11,
4129,
11,
11629,
378,
11,
6632,
11,
10385,
11,
20650,
11,
15690,
198,
37811,
198,
1212,
6053,
284,
20435,
286,
22037,
13,
198,
1212,
3994,
513,
7032,
588,
2174,
13,
198,
198,
12,
2124,
1279,
25,
6416,
198,
12,
331,
1279,
25,
6416,
198,
12,
1976,
1279,
25,
6416,
198,
198,
4366,
12879,
290,
5499,
547,
50068,
284,
787,
22819,
4559,
5563,
7025,
540,
13,
198,
37811,
198,
76,
18187,
2878,
22819,
4559,
90,
15633,
51,
1279,
25,
6416,
92,
198,
220,
220,
220,
1303,
770,
1398,
318,
329,
787,
15879,
4905,
7025,
540,
13,
198,
220,
220,
220,
2124,
3712,
15633,
51,
198,
220,
220,
220,
331,
3712,
15633,
51,
198,
220,
220,
220,
1976,
3712,
15633,
51,
628,
220,
220,
220,
2163,
22819,
4559,
7,
31364,
3712,
38469,
51,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
810,
20650,
51,
1279,
25,
27741,
19182,
90,
15633,
51,
92,
810,
6416,
51,
1279,
25,
6416,
628,
220,
220,
220,
220,
220,
220,
220,
611,
4129,
7,
31364,
8,
14512,
513,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45751,
12331,
7203,
28100,
1713,
329,
22819,
4559,
23772,
1276,
307,
7177,
286,
4129,
513,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
649,
90,
15633,
51,
92,
7,
31364,
58,
16,
4357,
15879,
58,
17,
4357,
15879,
58,
18,
12962,
198,
220,
220,
220,
886,
628,
220,
220,
220,
2163,
22819,
4559,
7,
87,
3712,
15633,
51,
11,
331,
3712,
15633,
51,
11,
1976,
3712,
15633,
51,
8,
810,
6416,
51,
1279,
25,
6416,
198,
220,
220,
220,
220,
220,
220,
220,
649,
90,
15633,
51,
92,
7,
87,
11,
331,
11,
1976,
8,
198,
220,
220,
220,
886,
198,
437,
198,
198,
8818,
1343,
7,
853,
16,
3712,
7222,
45480,
90,
51,
5512,
1822,
17,
3712,
7222,
45480,
90,
52,
30072,
810,
309,
1279,
25,
6416,
810,
471,
1279,
25,
6416,
198,
220,
220,
220,
22819,
4559,
7,
853,
16,
13,
87,
1343,
1822,
17,
13,
87,
11,
1822,
16,
13,
88,
1343,
1822,
17,
13,
88,
11,
1822,
16,
13,
89,
1343,
1822,
17,
13,
89,
8,
198,
437,
198,
198,
8818,
532,
7,
853,
16,
3712,
7222,
45480,
90,
51,
5512,
1822,
17,
3712,
7222,
45480,
90,
52,
30072,
810,
309,
1279,
25,
6416,
810,
471,
1279,
25,
6416,
198,
220,
220,
220,
22819,
4559,
7,
853,
16,
13,
87,
532,
1822,
17,
13,
87,
11,
1822,
16,
13,
88,
532,
1822,
17,
13,
88,
11,
1822,
16,
13,
89,
532,
1822,
17,
13,
89,
8,
198,
437,
198,
198,
8818,
1635,
7,
853,
16,
3712,
7222,
45480,
90,
51,
5512,
1822,
17,
3712,
52,
8,
810,
309,
1279,
25,
6416,
810,
471,
1279,
25,
6416,
198,
220,
220,
220,
22819,
4559,
7,
853,
16,
13,
87,
1635,
1822,
17,
11,
1822,
16,
13,
88,
1635,
1822,
17,
11,
1822,
16,
13,
89,
1635,
1822,
17,
8,
198,
437,
198,
198,
8818,
1635,
7,
853,
16,
3712,
52,
11,
1822,
17,
3712,
7222,
45480,
90,
51,
30072,
810,
309,
1279,
25,
6416,
810,
471,
1279,
25,
6416,
198,
220,
220,
220,
22819,
4559,
7,
853,
16,
1635,
1822,
17,
13,
87,
11,
1822,
16,
1635,
1822,
17,
13,
88,
11,
1822,
16,
1635,
1822,
17,
13,
89,
8,
198,
437,
198,
198,
8818,
1635,
7,
853,
16,
3712,
7222,
45480,
90,
51,
5512,
1822,
17,
3712,
7222,
45480,
90,
52,
30072,
810,
309,
1279,
25,
6416,
810,
471,
1279,
25,
6416,
198,
220,
220,
220,
1822,
16,
13,
87,
1635,
1822,
17,
13,
87,
1343,
1822,
16,
13,
88,
1635,
1822,
17,
13,
88,
1343,
1822,
16,
13,
89,
1635,
1822,
17,
13,
89,
198,
437,
198,
198,
8818,
1220,
7,
853,
16,
3712,
7222,
45480,
90,
51,
5512,
1822,
17,
3712,
52,
8,
810,
309,
1279,
25,
6416,
810,
471,
1279,
25,
6416,
198,
220,
220,
220,
22819,
4559,
7,
853,
16,
13,
87,
1220,
1822,
17,
11,
1822,
16,
13,
88,
1220,
1822,
17,
11,
1822,
16,
13,
89,
1220,
1822,
17,
8,
198,
437,
198,
198,
2,
329,
10088,
7025,
198,
8818,
4129,
7,
853,
3712,
7222,
45480,
90,
51,
30072,
810,
309,
1279,
25,
6416,
198,
220,
220,
220,
352,
198,
437,
198,
198,
8818,
11629,
378,
7,
853,
3712,
7222,
45480,
90,
51,
30072,
810,
309,
1279,
25,
6416,
198,
220,
220,
220,
357,
853,
11,
2147,
8,
198,
437,
198,
198,
8818,
11629,
378,
7,
853,
3712,
7222,
45480,
90,
51,
5512,
2147,
8,
810,
309,
1279,
25,
6416,
198,
220,
220,
220,
2147,
198,
437,
198,
198,
8818,
6632,
7,
853,
3712,
7222,
45480,
90,
51,
30072,
810,
309,
1279,
25,
6416,
198,
220,
220,
220,
22819,
4559,
7,
51,
7,
15,
13,
15,
828,
309,
7,
15,
13,
15,
828,
309,
7,
15,
13,
15,
4008,
198,
437,
198,
198,
8818,
10385,
7,
3712,
6030,
90,
7222,
45480,
90,
15633,
51,
92,
5512,
6349,
3712,
7222,
45480,
90,
27,
25,
15633,
30072,
810,
6416,
51,
1279,
25,
6416,
198,
220,
220,
220,
1441,
22819,
4559,
7,
15633,
51,
7,
37652,
13,
87,
828,
6416,
51,
7,
37652,
13,
88,
828,
6416,
51,
7,
37652,
13,
89,
4008,
198,
437,
198,
198,
8818,
20650,
7,
853,
3712,
7222,
45480,
90,
15633,
51,
30072,
810,
6416,
51,
1279,
25,
6416,
198,
220,
220,
220,
685,
853,
13,
87,
11,
1822,
13,
88,
11,
1822,
13,
89,
60,
198,
437,
198,
198,
8818,
15690,
7,
853,
3712,
7222,
45480,
90,
15633,
51,
30072,
810,
6416,
51,
1279,
25,
6416,
198,
220,
220,
220,
685,
853,
13,
87,
11,
1822,
13,
88,
11,
1822,
13,
89,
60,
198,
437,
198,
198,
8818,
2593,
7,
853,
3712,
7222,
45480,
90,
51,
30072,
810,
309,
1279,
25,
6416,
198,
220,
220,
220,
19862,
17034,
7,
8937,
17,
7,
853,
13,
87,
8,
1343,
2352,
17,
7,
853,
13,
88,
8,
1343,
2352,
17,
7,
853,
13,
89,
4008,
198,
437,
198,
198,
8818,
5253,
7,
11085,
62,
37652,
3712,
7222,
45480,
90,
51,
5512,
1218,
62,
37652,
3712,
7222,
45480,
90,
51,
30072,
810,
309,
1279,
25,
6416,
198,
220,
220,
220,
2593,
7,
11085,
62,
37652,
532,
1218,
62,
37652,
8,
198,
437,
198
] | 2.492424 | 1,056 |
const Orbits = [(1,0), (2,0), (0,1), (1,1), (0,2)]
"""
flatten(pdm::Dict{Int, <:PersistenceDiagram}) -> PersistenceDiagram
Flatten a multi-dimensional pd into a barcode.
"""
flatten(pdm::Dict{Int, PD}) where {T<:Real, PD<:PersistenceDiagram{T}} =
(collect∘Iterators.flatten∘values)(pdm)
"""
maxsize(pds) -> Int
Return the number of bars in the largest barcode from the collection of barcodes `pds`
"""
maxsize(pds::AbstractVector{PD}) where {T<:Real, PD<:PersistenceDiagram{T}} =
maximum(map(length, pds))
tropicdim(n) = n+(div(n*(n+1),2)) # codomain dimension
function tropicstats(pds::AbstractVector{PD}) where {T<:Real, PD<:PersistenceDiagram{T}}
n = ComputationalHomology.maxsize(pds)
d = ComputationalHomology.tropicdim(n)
maxval = filter!(!isinf, map(i->max(birth(i),death(i)), Iterators.flatten(pds))) |> maximum
m = map(i->birth(i)/-ComputationalHomology.birthx(i), Iterators.flatten(pds)) |> maximum
(d, n, ceil(Int, m), maxval)
end
"""
Caluclate 2-symmetric tropical rational polynomial for the persistence diagram
"""
function tropicp(pd::PersistenceDiagram{T},m,l,p; maxval=T(Inf)) where {T<:Real}
B = Tuple{T,T}[]
for i in pd
d = min(maxval, death(i))
b = birth(i)
push!(B, (min(m*(d-b), b), d-b))
end
# pad zeros
while length(B) < l+p
push!(B, (zero(T), zero(T)))
end
n = length(B)
if l == 0 && p == 0
0
elseif l == 0
sort!(map(sum, B), rev=true)[1:p] |> sum
elseif p == 0
sort!(map(last,B), rev=true)[1:l] |> sum
else
res = 0
L = hcat(combinations(1:n,l)...)'
for i in 1:length(L)
ii = L[i,:]
e0 = sum(last, B[ii])
K = hcat(combinations(setdiff(1:n, ii),p)...)'
for j = 1:length(K)
jj = K[j,:]
e1 = sum(map(first, B[jj]) .+ map(last, B[jj]))
res = max(res, e0 + e1)
end
end
res
end
end
"""
tropic(pd)
Calculate a tropical coordinates for a persistent diagram `pd`
Paper: "Tropical Sufficient Statistics for Persistent Homology" by A.Monod et al.
Ref: https://arxiv.org/abs/1709.02647
"""
function tropic(pds::AbstractVector{PD}) where {T<:Real, PD<:PersistenceDiagram{T}}
d,n,m,mv = ComputationalHomology.tropicstats(pds)
[tropicp(pd,m,i,j,maxval=mv) for (i,j) in ComputationalHomology.Orbits, pd in pds ]
end
tropic(pd::PersistenceDiagram{T}) where {T<:Real} = tropic([pd]) |> vec
tropic(pdd::Dict{Int, PD}) where {T<:Real, PD<:PersistenceDiagram{T}} = tropic(flatten(pdd))
| [
9979,
1471,
9895,
796,
47527,
16,
11,
15,
828,
357,
17,
11,
15,
828,
357,
15,
11,
16,
828,
357,
16,
11,
16,
828,
357,
15,
11,
17,
15437,
198,
198,
37811,
198,
220,
220,
220,
27172,
268,
7,
30094,
76,
3712,
35,
713,
90,
5317,
11,
1279,
25,
30946,
13274,
18683,
6713,
30072,
4613,
9467,
13274,
18683,
6713,
198,
198,
7414,
41769,
257,
5021,
12,
19577,
279,
67,
656,
257,
2318,
8189,
13,
198,
37811,
198,
2704,
41769,
7,
30094,
76,
3712,
35,
713,
90,
5317,
11,
14340,
30072,
810,
1391,
51,
27,
25,
15633,
11,
14340,
27,
25,
30946,
13274,
18683,
6713,
90,
51,
11709,
796,
198,
220,
220,
220,
357,
33327,
24861,
246,
29993,
2024,
13,
2704,
41769,
24861,
246,
27160,
5769,
30094,
76,
8,
198,
198,
37811,
198,
220,
220,
220,
3509,
7857,
7,
79,
9310,
8,
4613,
2558,
198,
198,
13615,
262,
1271,
286,
9210,
287,
262,
4387,
2318,
8189,
422,
262,
4947,
286,
2318,
40148,
4600,
79,
9310,
63,
198,
37811,
198,
9806,
7857,
7,
79,
9310,
3712,
23839,
38469,
90,
5760,
30072,
810,
1391,
51,
27,
25,
15633,
11,
14340,
27,
25,
30946,
13274,
18683,
6713,
90,
51,
11709,
796,
198,
220,
220,
220,
5415,
7,
8899,
7,
13664,
11,
279,
9310,
4008,
198,
198,
48385,
291,
27740,
7,
77,
8,
796,
299,
33747,
7146,
7,
77,
9,
7,
77,
10,
16,
828,
17,
4008,
1303,
14873,
296,
391,
15793,
198,
198,
8818,
14673,
291,
34242,
7,
79,
9310,
3712,
23839,
38469,
90,
5760,
30072,
810,
1391,
51,
27,
25,
15633,
11,
14340,
27,
25,
30946,
13274,
18683,
6713,
90,
51,
11709,
198,
220,
220,
220,
299,
796,
22476,
864,
28718,
1435,
13,
9806,
7857,
7,
79,
9310,
8,
198,
220,
220,
220,
288,
796,
22476,
864,
28718,
1435,
13,
48385,
291,
27740,
7,
77,
8,
198,
220,
220,
220,
3509,
2100,
796,
8106,
0,
7,
0,
271,
10745,
11,
3975,
7,
72,
3784,
9806,
7,
24280,
7,
72,
828,
22595,
7,
72,
36911,
40806,
2024,
13,
2704,
41769,
7,
79,
9310,
22305,
930,
29,
5415,
198,
220,
220,
220,
285,
796,
220,
3975,
7,
72,
3784,
24280,
7,
72,
8,
16327,
5377,
1996,
864,
28718,
1435,
13,
24280,
87,
7,
72,
828,
40806,
2024,
13,
2704,
41769,
7,
79,
9310,
4008,
930,
29,
5415,
198,
220,
220,
220,
357,
67,
11,
299,
11,
2906,
346,
7,
5317,
11,
285,
828,
3509,
2100,
8,
198,
437,
198,
198,
37811,
198,
9771,
36616,
378,
362,
12,
1837,
3020,
19482,
19690,
9377,
745,
6213,
49070,
329,
262,
30802,
16362,
198,
37811,
198,
8818,
14673,
291,
79,
7,
30094,
3712,
30946,
13274,
18683,
6713,
90,
51,
5512,
76,
11,
75,
11,
79,
26,
3509,
2100,
28,
51,
7,
18943,
4008,
810,
1391,
51,
27,
25,
15633,
92,
198,
220,
220,
220,
347,
796,
309,
29291,
90,
51,
11,
51,
92,
21737,
198,
220,
220,
220,
329,
1312,
287,
279,
67,
198,
220,
220,
220,
220,
220,
220,
220,
288,
796,
949,
7,
9806,
2100,
11,
1918,
7,
72,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
275,
796,
4082,
7,
72,
8,
198,
220,
220,
220,
220,
220,
220,
220,
4574,
0,
7,
33,
11,
357,
1084,
7,
76,
9,
7,
67,
12,
65,
828,
275,
828,
288,
12,
65,
4008,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1303,
14841,
1976,
27498,
198,
220,
220,
220,
981,
4129,
7,
33,
8,
1279,
300,
10,
79,
198,
220,
220,
220,
220,
220,
220,
220,
4574,
0,
7,
33,
11,
357,
22570,
7,
51,
828,
6632,
7,
51,
22305,
198,
220,
220,
220,
886,
198,
220,
220,
220,
299,
796,
4129,
7,
33,
8,
628,
220,
220,
220,
611,
300,
6624,
657,
11405,
279,
6624,
657,
198,
220,
220,
220,
220,
220,
220,
220,
657,
198,
220,
220,
220,
2073,
361,
300,
6624,
657,
198,
220,
220,
220,
220,
220,
220,
220,
3297,
0,
7,
8899,
7,
16345,
11,
347,
828,
2710,
28,
7942,
38381,
16,
25,
79,
60,
930,
29,
2160,
198,
220,
220,
220,
2073,
361,
279,
6624,
657,
198,
220,
220,
220,
220,
220,
220,
220,
3297,
0,
7,
8899,
7,
12957,
11,
33,
828,
2710,
28,
7942,
38381,
16,
25,
75,
60,
930,
29,
2160,
198,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
581,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
406,
796,
289,
9246,
7,
24011,
7352,
7,
16,
25,
77,
11,
75,
8,
23029,
6,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
352,
25,
13664,
7,
43,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21065,
796,
406,
58,
72,
11,
47715,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
304,
15,
796,
2160,
7,
12957,
11,
347,
58,
4178,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
509,
796,
289,
9246,
7,
24011,
7352,
7,
2617,
26069,
7,
16,
25,
77,
11,
21065,
828,
79,
8,
23029,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
474,
796,
352,
25,
13664,
7,
42,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
474,
73,
796,
509,
58,
73,
11,
47715,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
304,
16,
796,
2160,
7,
8899,
7,
11085,
11,
347,
58,
41098,
12962,
764,
10,
3975,
7,
12957,
11,
347,
58,
41098,
60,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
581,
796,
3509,
7,
411,
11,
304,
15,
1343,
304,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
581,
198,
220,
220,
220,
886,
198,
437,
198,
198,
37811,
198,
220,
220,
220,
14673,
291,
7,
30094,
8,
198,
198,
9771,
3129,
378,
257,
19690,
22715,
329,
257,
16218,
16362,
4600,
30094,
63,
198,
198,
42950,
25,
366,
51,
1773,
605,
311,
15267,
14370,
329,
9467,
7609,
8074,
1435,
1,
416,
317,
13,
9069,
375,
2123,
435,
13,
198,
8134,
25,
3740,
1378,
283,
87,
452,
13,
2398,
14,
8937,
14,
1558,
2931,
13,
45987,
2857,
198,
37811,
198,
8818,
14673,
291,
7,
79,
9310,
3712,
23839,
38469,
90,
5760,
30072,
810,
1391,
51,
27,
25,
15633,
11,
14340,
27,
25,
30946,
13274,
18683,
6713,
90,
51,
11709,
198,
220,
220,
220,
288,
11,
77,
11,
76,
11,
76,
85,
796,
22476,
864,
28718,
1435,
13,
48385,
291,
34242,
7,
79,
9310,
8,
198,
220,
220,
220,
685,
48385,
291,
79,
7,
30094,
11,
76,
11,
72,
11,
73,
11,
9806,
2100,
28,
76,
85,
8,
329,
357,
72,
11,
73,
8,
287,
22476,
864,
28718,
1435,
13,
5574,
9895,
11,
279,
67,
287,
279,
9310,
2361,
198,
437,
198,
48385,
291,
7,
30094,
3712,
30946,
13274,
18683,
6713,
90,
51,
30072,
810,
1391,
51,
27,
25,
15633,
92,
796,
14673,
291,
26933,
30094,
12962,
930,
29,
43030,
198,
48385,
291,
7,
79,
1860,
3712,
35,
713,
90,
5317,
11,
14340,
30072,
810,
1391,
51,
27,
25,
15633,
11,
14340,
27,
25,
30946,
13274,
18683,
6713,
90,
51,
11709,
796,
14673,
291,
7,
2704,
41769,
7,
79,
1860,
4008,
198
] | 2.113729 | 1,231 |
using ImageFiltering
using Statistics
using StatsBase
function badpixremoval_clump(frame::AbstractMatrix{T}; max_niter=15, kwargs...) where T
# create bad pixel map by sigma clipping outliers
bad_pixels = badpixel_clip(frame; kwargs...)
bad_pixels_cumul = copy(bad_pixels)
total = sum(bad_pixels)
# iterate replacing bad pixels with sigma clipping
out = copy(frame)
it = 0
while total > 0 && it < max_niter
it += 1
out = sigma_filter!(out, bad_pixels)
bad_pixels = badpixel_clip(out)
bad_pixels_cumul .|= bad_pixels
total = sum(bad_pixels)
end
return out, bad_pixels_cumul
end
function badpixel_clip(frame; sigma=4, box_size=9)
med = mapwindow(median, frame, (box_size, box_size); border="reflect")
std = mapwindow(mad, frame, (box_size, box_size); border="reflect")
return @. abs(frame - med) > sigma * std
end
function sigma_filter!(frame, bad_pixels; box_size=9)
bpm = copy(bad_pixels)
min_neigh = sum(3:2:box_size)
half_box = box_size ÷ 2
while sum(bpm) > 0
pad_bpm = BorderArray(bpm, Pad(:reflect, half_box, half_box))
pad_im = BorderArray(frame, Pad(:reflect, half_box, half_box))
for idx in findall(bpm)
ax1 = idx.I[1] - half_box:idx.I[1] + half_box
ax2 = idx.I[2] - half_box:idx.I[2] + half_box
block_bpm = @view pad_bpm[ax1, ax2]
# ensure enough "good" neighbors for imputation
if sum(block_bpm) < min_neigh
block_im = @view pad_im[ax1, ax2]
frame[idx] = median(block_im)
bpm[idx] = false
end
end
end
return frame
end | [
3500,
7412,
11928,
20212,
198,
3500,
14370,
198,
3500,
20595,
14881,
198,
198,
8818,
2089,
79,
844,
2787,
8325,
62,
565,
931,
7,
14535,
3712,
23839,
46912,
90,
51,
19629,
3509,
62,
77,
2676,
28,
1314,
11,
479,
86,
22046,
23029,
810,
309,
198,
220,
220,
220,
1303,
2251,
2089,
17465,
3975,
416,
264,
13495,
45013,
41528,
3183,
198,
220,
220,
220,
2089,
62,
79,
14810,
796,
2089,
32515,
62,
15036,
7,
14535,
26,
479,
86,
22046,
23029,
198,
220,
220,
220,
2089,
62,
79,
14810,
62,
36340,
377,
796,
4866,
7,
14774,
62,
79,
14810,
8,
198,
220,
220,
220,
2472,
796,
2160,
7,
14774,
62,
79,
14810,
8,
628,
220,
220,
220,
1303,
11629,
378,
13586,
2089,
17848,
351,
264,
13495,
45013,
198,
220,
220,
220,
503,
796,
4866,
7,
14535,
8,
198,
220,
220,
220,
340,
796,
657,
198,
220,
220,
220,
981,
2472,
1875,
657,
11405,
340,
1279,
3509,
62,
77,
2676,
198,
220,
220,
220,
220,
220,
220,
220,
340,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
503,
796,
264,
13495,
62,
24455,
0,
7,
448,
11,
2089,
62,
79,
14810,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2089,
62,
79,
14810,
796,
2089,
32515,
62,
15036,
7,
448,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2089,
62,
79,
14810,
62,
36340,
377,
764,
91,
28,
2089,
62,
79,
14810,
198,
220,
220,
220,
220,
220,
220,
220,
2472,
796,
2160,
7,
14774,
62,
79,
14810,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1441,
503,
11,
2089,
62,
79,
14810,
62,
36340,
377,
198,
437,
198,
198,
8818,
2089,
32515,
62,
15036,
7,
14535,
26,
264,
13495,
28,
19,
11,
3091,
62,
7857,
28,
24,
8,
198,
220,
220,
220,
1117,
796,
3975,
17497,
7,
1150,
666,
11,
5739,
11,
357,
3524,
62,
7857,
11,
3091,
62,
7857,
1776,
4865,
2625,
35051,
4943,
198,
220,
220,
220,
14367,
796,
3975,
17497,
7,
9937,
11,
5739,
11,
357,
3524,
62,
7857,
11,
3091,
62,
7857,
1776,
4865,
2625,
35051,
4943,
628,
220,
220,
220,
1441,
2488,
13,
2352,
7,
14535,
532,
1117,
8,
1875,
264,
13495,
1635,
14367,
198,
437,
198,
198,
8818,
264,
13495,
62,
24455,
0,
7,
14535,
11,
2089,
62,
79,
14810,
26,
3091,
62,
7857,
28,
24,
8,
198,
220,
220,
220,
275,
4426,
796,
4866,
7,
14774,
62,
79,
14810,
8,
628,
220,
220,
220,
949,
62,
710,
394,
796,
2160,
7,
18,
25,
17,
25,
3524,
62,
7857,
8,
198,
220,
220,
220,
2063,
62,
3524,
796,
3091,
62,
7857,
6184,
115,
362,
198,
220,
220,
220,
981,
2160,
7,
65,
4426,
8,
1875,
657,
198,
220,
220,
220,
220,
220,
220,
220,
14841,
62,
65,
4426,
796,
15443,
19182,
7,
65,
4426,
11,
15744,
7,
25,
35051,
11,
2063,
62,
3524,
11,
2063,
62,
3524,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
14841,
62,
320,
796,
15443,
19182,
7,
14535,
11,
15744,
7,
25,
35051,
11,
2063,
62,
3524,
11,
2063,
62,
3524,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
329,
4686,
87,
287,
1064,
439,
7,
65,
4426,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7877,
16,
796,
4686,
87,
13,
40,
58,
16,
60,
532,
2063,
62,
3524,
25,
312,
87,
13,
40,
58,
16,
60,
1343,
2063,
62,
3524,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7877,
17,
796,
4686,
87,
13,
40,
58,
17,
60,
532,
2063,
62,
3524,
25,
312,
87,
13,
40,
58,
17,
60,
1343,
2063,
62,
3524,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2512,
62,
65,
4426,
796,
2488,
1177,
14841,
62,
65,
4426,
58,
897,
16,
11,
7877,
17,
60,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
4155,
1576,
366,
11274,
1,
12020,
329,
848,
7094,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2160,
7,
9967,
62,
65,
4426,
8,
1279,
949,
62,
710,
394,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2512,
62,
320,
796,
2488,
1177,
14841,
62,
320,
58,
897,
16,
11,
7877,
17,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5739,
58,
312,
87,
60,
796,
14288,
7,
9967,
62,
320,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
4426,
58,
312,
87,
60,
796,
3991,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1441,
5739,
198,
437
] | 2.134253 | 797 |
using Dates
function hfun_datetext(date=locvar("rss_pubdate"))
datetext = "$(monthname(date)) $(day(date)), $(year(date))"
return datetext
end
# Based on https://github.com/JuliaLang/www.julialang.org/blob/master/utils.jl
function hfun_blogposts()
curyear = year(Dates.today())
io = IOBuffer()
for year in curyear:-1:2020
ys = "$year"
for month in 12:-1:1
ms = "0"^(month < 10) * "$month"
base = joinpath("blog", ys, ms)
isdir(base) || continue
posts = filter!(p -> endswith(p, ".md"), readdir(base))
days = zeros(Int, length(posts))
lines = Vector{String}(undef, length(posts))
for (i, post) in enumerate(posts)
ps = splitext(post)[1]
url = "/blog/$ys/$ms/$ps/"
surl = strip(url, '/')
title = pagevar(surl, :title)
rss = pagevar(surl, :rss)
date = pagevar(surl, :rss_pubdate)
datetext = hfun_datetext(date)
days[i] = day(date)
lines[i] =
"""
~~~
<div class="card border-dark mb-4">
<div class="card-body">
<h3 class="card-title">
<a class="text-dark" href="$url">$title</a>
</h3>
<p class="card-text">$rss</p>
<p class="card-text text-muted">$datetext</p>
</div>
</div>
~~~
"""
end
# Sort by day
foreach(line -> write(io, line), lines[sortperm(days, rev=true)])
end
end
# markdown conversion adds `<p>` beginning and end but
# we want to avoid this to avoid an empty separator
r = Franklin.fd2html(String(take!(io)), internal=true)
return r
end
| [
3500,
44712,
198,
198,
8818,
289,
12543,
62,
19608,
316,
2302,
7,
4475,
28,
17946,
7785,
7203,
42216,
62,
12984,
4475,
48774,
198,
220,
220,
220,
4818,
316,
2302,
796,
17971,
7,
8424,
3672,
7,
4475,
4008,
29568,
820,
7,
4475,
36911,
29568,
1941,
7,
4475,
4008,
1,
198,
220,
220,
220,
1441,
4818,
316,
2302,
198,
437,
198,
198,
2,
13403,
319,
3740,
1378,
12567,
13,
785,
14,
16980,
544,
43,
648,
14,
2503,
13,
73,
377,
498,
648,
13,
2398,
14,
2436,
672,
14,
9866,
14,
26791,
13,
20362,
198,
8818,
289,
12543,
62,
14036,
24875,
3419,
198,
220,
220,
220,
1090,
1941,
796,
614,
7,
35,
689,
13,
40838,
28955,
198,
220,
220,
220,
33245,
796,
314,
9864,
13712,
3419,
198,
220,
220,
220,
329,
614,
287,
1090,
1941,
21912,
16,
25,
42334,
198,
220,
220,
220,
220,
220,
220,
220,
331,
82,
796,
17971,
1941,
1,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1227,
287,
1105,
21912,
16,
25,
16,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13845,
796,
366,
15,
1,
61,
7,
8424,
1279,
838,
8,
1635,
17971,
8424,
1,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2779,
796,
4654,
6978,
7203,
14036,
1600,
331,
82,
11,
13845,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
15908,
7,
8692,
8,
8614,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6851,
796,
8106,
0,
7,
79,
4613,
886,
2032,
342,
7,
79,
11,
27071,
9132,
12340,
1100,
15908,
7,
8692,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1528,
796,
1976,
27498,
7,
5317,
11,
4129,
7,
24875,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3951,
796,
20650,
90,
10100,
92,
7,
917,
891,
11,
4129,
7,
24875,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
357,
72,
11,
1281,
8,
287,
27056,
378,
7,
24875,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26692,
796,
4328,
578,
742,
7,
7353,
38381,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19016,
796,
12813,
14036,
32624,
893,
32624,
907,
32624,
862,
30487,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
969,
75,
796,
10283,
7,
6371,
11,
31051,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3670,
796,
2443,
7785,
7,
82,
6371,
11,
1058,
7839,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
824,
796,
2443,
7785,
7,
82,
6371,
11,
1058,
42216,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3128,
796,
2443,
7785,
7,
82,
6371,
11,
1058,
42216,
62,
12984,
4475,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4818,
316,
2302,
796,
289,
12543,
62,
19608,
316,
2302,
7,
4475,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1528,
58,
72,
60,
796,
1110,
7,
4475,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3951,
58,
72,
60,
796,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4907,
93,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
7146,
1398,
2625,
9517,
4865,
12,
21953,
285,
65,
12,
19,
5320,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
7146,
1398,
2625,
9517,
12,
2618,
5320,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
71,
18,
1398,
2625,
9517,
12,
7839,
5320,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
64,
1398,
2625,
5239,
12,
21953,
1,
13291,
2625,
3,
6371,
5320,
3,
7839,
3556,
64,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7359,
71,
18,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
79,
1398,
2625,
9517,
12,
5239,
5320,
3,
42216,
3556,
79,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
79,
1398,
2625,
9517,
12,
5239,
2420,
12,
76,
7241,
5320,
3,
19608,
316,
2302,
3556,
79,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7359,
7146,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7359,
7146,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4907,
93,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
33947,
416,
1110,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1674,
620,
7,
1370,
4613,
3551,
7,
952,
11,
1627,
828,
3951,
58,
30619,
16321,
7,
12545,
11,
2710,
28,
7942,
8,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1303,
1317,
2902,
11315,
6673,
4600,
27,
79,
29,
63,
3726,
290,
886,
475,
198,
220,
220,
220,
1303,
356,
765,
284,
3368,
428,
284,
3368,
281,
6565,
2880,
1352,
198,
220,
220,
220,
374,
796,
14021,
13,
16344,
17,
6494,
7,
10100,
7,
20657,
0,
7,
952,
36911,
5387,
28,
7942,
8,
198,
220,
220,
220,
1441,
374,
198,
437,
198
] | 1.769369 | 1,110 |
"""
`PrincipalAxes` is an abstract type to be used
as the argument of a function.
"""
abstract PrincipalAxes | [
37811,
198,
63,
42904,
8521,
31554,
274,
63,
318,
281,
12531,
2099,
284,
307,
973,
198,
292,
262,
4578,
286,
257,
2163,
13,
198,
37811,
198,
397,
8709,
32641,
31554,
274
] | 3.483871 | 31 |
using BenchmarkTools
import ParticleSwarmOptimizer
pso = ParticleSwarmOptimizer
pso.get_localbest([0.5, 0.5, 0.5, 0.4, 0.5], [2, 4, 5], <)
@benchmark pso.get_localbest([0.5, 0.5, 0.5, 0.4, 0.5], [2, 4, 5], <)
@benchmark pso.get_localbest([0.5, 0.5, 0.5, 0.4, 0.5], [2], <)
| [
3500,
25187,
4102,
33637,
198,
11748,
2142,
1548,
10462,
1670,
27871,
320,
7509,
198,
79,
568,
796,
2142,
1548,
10462,
1670,
27871,
320,
7509,
198,
198,
79,
568,
13,
1136,
62,
12001,
13466,
26933,
15,
13,
20,
11,
657,
13,
20,
11,
657,
13,
20,
11,
657,
13,
19,
11,
657,
13,
20,
4357,
685,
17,
11,
604,
11,
642,
4357,
1279,
8,
198,
198,
31,
26968,
4102,
279,
568,
13,
1136,
62,
12001,
13466,
26933,
15,
13,
20,
11,
657,
13,
20,
11,
657,
13,
20,
11,
657,
13,
19,
11,
657,
13,
20,
4357,
685,
17,
11,
604,
11,
642,
4357,
1279,
8,
198,
31,
26968,
4102,
279,
568,
13,
1136,
62,
12001,
13466,
26933,
15,
13,
20,
11,
657,
13,
20,
11,
657,
13,
20,
11,
657,
13,
19,
11,
657,
13,
20,
4357,
685,
17,
4357,
1279,
8,
198
] | 1.923077 | 143 |
"""
loglike_beta(nij, A, cij)
Profile likelihood for the frequency response vectors.
*Reference*: Based on Equation (9) of Stompor et al., MNRAS, 392, 216 (2009)
# Arguments
- `nij::Array{<:AbstractFloat,2}`: symmetric noise covariance matrix with the dimention of `(nν, nν)` where `nν` is the number of frequency bands.
- `A::Array{<:AbstractFloat,2}`: `nν`-by-`nc` matrix of the frequency response, for `nc` components in sky.
- E.g., ``A = [a B]`` where `a = ones(nν)` for CMB and `B` is a `nν`-by-`nc-1` matrix for the frequency response of foreground components.
- `cij::Array{<:AbstractFloat,2}`: symmetric covariance matrix with the dimention of `(nν, nν)`.
"""
function loglike_beta(
nij::Array{T,2},
A::Array{T,2},
cij::Array{T,2},
) where {T<:AbstractFloat}
if size(nij)[1] ≠ size(nij)[2] || size(cij)[1] ≠ size(cij)[2]
throw(DimensionMismatch("covariance matrix must be a square matrix"))
elseif size(nij)[1] ≠ size(A)[1] || size(nij)[1] ≠ size(cij)[1]
throw(DimensionMismatch("dimensions of input matrices do not match"))
else
N = Symmetric(nij)
M = Symmetric(cij)
end
Ninv = inv(N)
lnlike = 0.5 * tr(Ninv * A * inv(A' * Ninv * A) * A' * Ninv * M)
end
"""
loglike_beta(nij, A, d)
Profile likelihood for the frequency response vectors.
*Reference*: Equation (9) of Stompor et al., MNRAS, 392, 216 (2009)
# Arguments
- `nij::Array{<:AbstractFloat,2}`: symmetric noise covariance matrix with the dimention of `(nν, nν)` where `nν` is the number of frequency bands.
- `A::Array{<:AbstractFloat,2}`: `nν`-by-`nc` matrix of the frequency response, for `nc` components in sky.
- E.g., ``A = [a B]`` where `a = ones(nν)` for CMB and `B` is a `nν`-by-`nc-1` matrix for the frequency response of foreground components.
- `d::Array{<:AbstractFloat,1}`: data vector for a given pixel (or any other appropriate domain). The number of elements is `nν`.
"""
function loglike_beta(
nij::Array{T,2},
A::Array{T,2},
d::Array{T,1},
) where {T<:AbstractFloat}
if size(nij)[1] ≠ size(nij)[2]
throw(DimensionMismatch("covariance matrix must be a square matrix"))
elseif size(nij)[1] ≠ size(A)[1] || size(nij)[1] ≠ length(d)
throw(DimensionMismatch("dimensions of matrices/vector do not match"))
else
M = Symmetric(nij)
end
x = M \ d
s = inv(A' * inv(M) * A) * A'x
lnlike = 0.5 * x'A * s
end
"""
loglike_beta_grad(nij, A, dAdβ, d)
Derivative of the profile likelihood for the frequency response vectors with respect to a foreground parameter
*Reference*: Equation (A1) of Errard et al., PRD, 84, 063005 (2011)
# Arguments
- `nij::Array{<:AbstractFloat,2}`: symmetric noise covariance matrix with the dimention of `(nν, nν)` where `nν` is the number of frequency bands.
- `A::Array{<:AbstractFloat,2}`: `nν`-by-`nc` matrix of the frequency response, for `nc` components in sky.
- E.g., ``A = [a B]`` where `a = ones(nν)` for CMB and `B` is a `nν`-by-`nc-1` matrix for the frequency response of foreground components.
- `dAdβ::Array{<:AbstractFloat,2}`: `nν`-by-`nc` matrix of the derivative of the frequency response with respect to a foreground parameter.
- E.g., ``dAdβ = [zeros(nν) dsynch/dβs zeros(nν)]`` where `zeros(nν)` for CMB and dust because they do not depend on the synchrotron index `βs`.
- `d::Array{<:AbstractFloat,1}`: data vector for a given pixel (or any other appropriate domain). The number of elements is `nν`.
"""
function loglike_beta_grad(
nij::Array{T,2},
A::Array{T,2},
dAdβ::Array{T,2},
d::Array{T,1},
) where {T<:AbstractFloat}
if size(nij)[1] ≠ size(nij)[2]
throw(DimensionMismatch("covariance matrix must be a square matrix"))
elseif size(nij)[1] ≠ size(A)[1] ||
size(nij)[1] ≠ length(d) ||
size(A)[1] ≠ size(dAdβ)[1] ||
size(A)[2] ≠ size(dAdβ)[2]
throw(DimensionMismatch("dimensions of matrices/vector do not match"))
else
M = Symmetric(nij)
end
x = M \ d
s = inv(A' * inv(M) * A) * A'x
lnlike_grad = s' * dAdβ' * (x - M \ (A * s))
end
"""
loglike_beta_hess(nij, A, dAdβI, dAdβJ, d)
Hessian of the profile likelihood for the frequency response vectors with respect to foreground parameters
*Reference*: Equation (5) of Errard et al., PRD, 84, 063005 (2011)
# Arguments
- `nij::Array{<:AbstractFloat,2}`: symmetric noise covariance matrix with the dimention of `(nν, nν)` where `nν` is the number of frequency bands.
- `A::Array{<:AbstractFloat,2}`: `nν`-by-`nc` matrix of the frequency response, for `nc` components in sky.
- E.g., ``A = [a B]`` where `a = ones(nν)` for CMB and `B` is a `nν`-by-`nc-1` matrix for the frequency response of foreground components.
- `dAdβI::Array{<:AbstractFloat,2}` and `dAdβJ::Array{<:AbstractFloat,2}`: `nν`-by-`nc` matrix of the derivative of the frequency response with respect to a foreground parameter.
- E.g., ``dAdβI = [zeros(nν) dsynch/dβs zeros(nν)]`` where `zeros(nν)` for CMB and dust because they do not depend on the synchrotron index `βs`.
- `d::Array{<:AbstractFloat,1}`: data vector for a given pixel (or any other appropriate domain). The number of elements is `nν`.
"""
function loglike_beta_hess(
nij::Array{T,2},
A::Array{T,2},
dAdβI::Array{T,2},
dAdβJ::Array{T,2},
d::Array{T,1},
) where {T<:AbstractFloat}
if size(nij)[1] ≠ size(nij)[2]
throw(DimensionMismatch("covariance matrix must be a square matrix"))
elseif size(nij)[1] ≠ size(A)[1] ||
size(nij)[1] ≠ length(d) ||
size(A)[1] ≠ size(dAdβI)[1] ||
size(A)[2] ≠ size(dAdβI)[2] ||
size(A)[1] ≠ size(dAdβJ)[1] ||
size(A)[2] ≠ size(dAdβJ)[2]
throw(DimensionMismatch("dimensions of matrices/vector do not match"))
else
M = Symmetric(nij)
end
x = M \ d
AtMinvAinv = inv(A' * inv(M) * A)
s = AtMinvAinv * A'x
u = M \ (dAdβJ * s)
v = M \ (A * AtMinvAinv * A'u)
lnlike_hess = tr(dAdβI' * (v - u) * s')
end
| [
37811,
198,
220,
220,
220,
2604,
2339,
62,
31361,
7,
77,
2926,
11,
317,
11,
269,
2926,
8,
198,
198,
37046,
14955,
329,
262,
8373,
2882,
30104,
13,
198,
198,
9,
26687,
47026,
13403,
319,
7889,
341,
357,
24,
8,
286,
520,
296,
1819,
2123,
435,
1539,
337,
24723,
1921,
11,
48207,
11,
26881,
357,
10531,
8,
198,
198,
2,
20559,
2886,
198,
12,
4600,
77,
2926,
3712,
19182,
90,
27,
25,
23839,
43879,
11,
17,
92,
63,
25,
23606,
19482,
7838,
44829,
590,
17593,
351,
262,
5391,
1463,
286,
4600,
7,
77,
26180,
11,
299,
26180,
8,
63,
810,
4600,
77,
26180,
63,
318,
262,
1271,
286,
8373,
11760,
13,
198,
12,
4600,
32,
3712,
19182,
90,
27,
25,
23839,
43879,
11,
17,
92,
63,
25,
4600,
77,
26180,
63,
12,
1525,
12,
63,
10782,
63,
17593,
286,
262,
8373,
2882,
11,
329,
4600,
10782,
63,
6805,
287,
6766,
13,
198,
220,
220,
220,
532,
412,
13,
70,
1539,
7559,
32,
796,
685,
64,
347,
60,
15506,
810,
4600,
64,
796,
3392,
7,
77,
26180,
8,
63,
329,
327,
10744,
290,
4600,
33,
63,
318,
257,
4600,
77,
26180,
63,
12,
1525,
12,
63,
10782,
12,
16,
63,
17593,
329,
262,
8373,
2882,
286,
36282,
6805,
13,
198,
12,
4600,
979,
73,
3712,
19182,
90,
27,
25,
23839,
43879,
11,
17,
92,
63,
25,
23606,
19482,
44829,
590,
17593,
351,
262,
5391,
1463,
286,
4600,
7,
77,
26180,
11,
299,
26180,
8,
44646,
198,
37811,
198,
8818,
2604,
2339,
62,
31361,
7,
198,
220,
220,
220,
299,
2926,
3712,
19182,
90,
51,
11,
17,
5512,
198,
220,
220,
220,
317,
3712,
19182,
90,
51,
11,
17,
5512,
198,
220,
220,
220,
269,
2926,
3712,
19182,
90,
51,
11,
17,
5512,
198,
8,
810,
1391,
51,
27,
25,
23839,
43879,
92,
198,
220,
220,
220,
611,
2546,
7,
77,
2926,
38381,
16,
60,
15139,
254,
2546,
7,
77,
2926,
38381,
17,
60,
8614,
2546,
7,
979,
73,
38381,
16,
60,
15139,
254,
2546,
7,
979,
73,
38381,
17,
60,
198,
220,
220,
220,
220,
220,
220,
220,
3714,
7,
29271,
3004,
44,
1042,
963,
7203,
66,
709,
2743,
590,
17593,
1276,
307,
257,
6616,
17593,
48774,
198,
220,
220,
220,
2073,
361,
2546,
7,
77,
2926,
38381,
16,
60,
15139,
254,
2546,
7,
32,
38381,
16,
60,
8614,
2546,
7,
77,
2926,
38381,
16,
60,
15139,
254,
2546,
7,
979,
73,
38381,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
3714,
7,
29271,
3004,
44,
1042,
963,
7203,
27740,
5736,
286,
5128,
2603,
45977,
466,
407,
2872,
48774,
198,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
399,
796,
1632,
3020,
19482,
7,
77,
2926,
8,
198,
220,
220,
220,
220,
220,
220,
220,
337,
796,
1632,
3020,
19482,
7,
979,
73,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
10516,
85,
796,
800,
7,
45,
8,
198,
220,
220,
220,
300,
77,
2339,
796,
657,
13,
20,
1635,
491,
7,
45,
16340,
1635,
317,
1635,
800,
7,
32,
6,
1635,
10516,
85,
1635,
317,
8,
1635,
317,
6,
1635,
10516,
85,
1635,
337,
8,
198,
437,
198,
198,
37811,
198,
220,
220,
220,
2604,
2339,
62,
31361,
7,
77,
2926,
11,
317,
11,
288,
8,
198,
198,
37046,
14955,
329,
262,
8373,
2882,
30104,
13,
198,
198,
9,
26687,
47026,
7889,
341,
357,
24,
8,
286,
520,
296,
1819,
2123,
435,
1539,
337,
24723,
1921,
11,
48207,
11,
26881,
357,
10531,
8,
198,
198,
2,
20559,
2886,
198,
12,
4600,
77,
2926,
3712,
19182,
90,
27,
25,
23839,
43879,
11,
17,
92,
63,
25,
23606,
19482,
7838,
44829,
590,
17593,
351,
262,
5391,
1463,
286,
4600,
7,
77,
26180,
11,
299,
26180,
8,
63,
810,
4600,
77,
26180,
63,
318,
262,
1271,
286,
8373,
11760,
13,
198,
12,
4600,
32,
3712,
19182,
90,
27,
25,
23839,
43879,
11,
17,
92,
63,
25,
4600,
77,
26180,
63,
12,
1525,
12,
63,
10782,
63,
17593,
286,
262,
8373,
2882,
11,
329,
4600,
10782,
63,
6805,
287,
6766,
13,
198,
220,
220,
220,
532,
412,
13,
70,
1539,
7559,
32,
796,
685,
64,
347,
60,
15506,
810,
4600,
64,
796,
3392,
7,
77,
26180,
8,
63,
329,
327,
10744,
290,
4600,
33,
63,
318,
257,
4600,
77,
26180,
63,
12,
1525,
12,
63,
10782,
12,
16,
63,
17593,
329,
262,
8373,
2882,
286,
36282,
6805,
13,
198,
12,
4600,
67,
3712,
19182,
90,
27,
25,
23839,
43879,
11,
16,
92,
63,
25,
1366,
15879,
329,
257,
1813,
17465,
357,
273,
597,
584,
5035,
7386,
737,
383,
1271,
286,
4847,
318,
4600,
77,
26180,
44646,
198,
37811,
198,
8818,
2604,
2339,
62,
31361,
7,
198,
220,
220,
220,
299,
2926,
3712,
19182,
90,
51,
11,
17,
5512,
198,
220,
220,
220,
317,
3712,
19182,
90,
51,
11,
17,
5512,
198,
220,
220,
220,
288,
3712,
19182,
90,
51,
11,
16,
5512,
198,
8,
810,
1391,
51,
27,
25,
23839,
43879,
92,
198,
220,
220,
220,
611,
2546,
7,
77,
2926,
38381,
16,
60,
15139,
254,
2546,
7,
77,
2926,
38381,
17,
60,
198,
220,
220,
220,
220,
220,
220,
220,
3714,
7,
29271,
3004,
44,
1042,
963,
7203,
66,
709,
2743,
590,
17593,
1276,
307,
257,
6616,
17593,
48774,
198,
220,
220,
220,
2073,
361,
2546,
7,
77,
2926,
38381,
16,
60,
15139,
254,
2546,
7,
32,
38381,
16,
60,
8614,
2546,
7,
77,
2926,
38381,
16,
60,
15139,
254,
4129,
7,
67,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3714,
7,
29271,
3004,
44,
1042,
963,
7203,
27740,
5736,
286,
2603,
45977,
14,
31364,
466,
407,
2872,
48774,
198,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
337,
796,
1632,
3020,
19482,
7,
77,
2926,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
2124,
796,
337,
3467,
288,
198,
220,
220,
220,
264,
796,
800,
7,
32,
6,
1635,
800,
7,
44,
8,
1635,
317,
8,
1635,
317,
6,
87,
198,
220,
220,
220,
300,
77,
2339,
796,
657,
13,
20,
1635,
2124,
6,
32,
1635,
264,
198,
437,
198,
198,
37811,
198,
220,
220,
220,
2604,
2339,
62,
31361,
62,
9744,
7,
77,
2926,
11,
317,
11,
288,
2782,
26638,
11,
288,
8,
198,
198,
28532,
452,
876,
286,
262,
7034,
14955,
329,
262,
8373,
2882,
30104,
351,
2461,
284,
257,
36282,
11507,
198,
198,
9,
26687,
47026,
7889,
341,
357,
32,
16,
8,
286,
41512,
446,
2123,
435,
1539,
4810,
35,
11,
9508,
11,
657,
5066,
22544,
357,
9804,
8,
198,
198,
2,
20559,
2886,
198,
12,
4600,
77,
2926,
3712,
19182,
90,
27,
25,
23839,
43879,
11,
17,
92,
63,
25,
23606,
19482,
7838,
44829,
590,
17593,
351,
262,
5391,
1463,
286,
4600,
7,
77,
26180,
11,
299,
26180,
8,
63,
810,
4600,
77,
26180,
63,
318,
262,
1271,
286,
8373,
11760,
13,
198,
12,
4600,
32,
3712,
19182,
90,
27,
25,
23839,
43879,
11,
17,
92,
63,
25,
4600,
77,
26180,
63,
12,
1525,
12,
63,
10782,
63,
17593,
286,
262,
8373,
2882,
11,
329,
4600,
10782,
63,
6805,
287,
6766,
13,
198,
220,
220,
220,
532,
412,
13,
70,
1539,
7559,
32,
796,
685,
64,
347,
60,
15506,
810,
4600,
64,
796,
3392,
7,
77,
26180,
8,
63,
329,
327,
10744,
290,
4600,
33,
63,
318,
257,
4600,
77,
26180,
63,
12,
1525,
12,
63,
10782,
12,
16,
63,
17593,
329,
262,
8373,
2882,
286,
36282,
6805,
13,
198,
12,
4600,
67,
2782,
26638,
3712,
19182,
90,
27,
25,
23839,
43879,
11,
17,
92,
63,
25,
4600,
77,
26180,
63,
12,
1525,
12,
63,
10782,
63,
17593,
286,
262,
27255,
286,
262,
8373,
2882,
351,
2461,
284,
257,
36282,
11507,
13,
198,
220,
220,
220,
532,
412,
13,
70,
1539,
7559,
67,
2782,
26638,
796,
685,
9107,
418,
7,
77,
26180,
8,
288,
28869,
354,
14,
67,
26638,
82,
1976,
27498,
7,
77,
26180,
15437,
15506,
810,
4600,
9107,
418,
7,
77,
26180,
8,
63,
329,
327,
10744,
290,
8977,
780,
484,
466,
407,
4745,
319,
262,
6171,
354,
10599,
1313,
6376,
4600,
26638,
82,
44646,
198,
12,
4600,
67,
3712,
19182,
90,
27,
25,
23839,
43879,
11,
16,
92,
63,
25,
1366,
15879,
329,
257,
1813,
17465,
357,
273,
597,
584,
5035,
7386,
737,
383,
1271,
286,
4847,
318,
4600,
77,
26180,
44646,
198,
37811,
198,
8818,
2604,
2339,
62,
31361,
62,
9744,
7,
198,
220,
220,
220,
299,
2926,
3712,
19182,
90,
51,
11,
17,
5512,
198,
220,
220,
220,
317,
3712,
19182,
90,
51,
11,
17,
5512,
198,
220,
220,
220,
288,
2782,
26638,
3712,
19182,
90,
51,
11,
17,
5512,
198,
220,
220,
220,
288,
3712,
19182,
90,
51,
11,
16,
5512,
198,
8,
810,
1391,
51,
27,
25,
23839,
43879,
92,
198,
220,
220,
220,
611,
2546,
7,
77,
2926,
38381,
16,
60,
15139,
254,
2546,
7,
77,
2926,
38381,
17,
60,
198,
220,
220,
220,
220,
220,
220,
220,
3714,
7,
29271,
3004,
44,
1042,
963,
7203,
66,
709,
2743,
590,
17593,
1276,
307,
257,
6616,
17593,
48774,
198,
220,
220,
220,
2073,
361,
2546,
7,
77,
2926,
38381,
16,
60,
15139,
254,
2546,
7,
32,
38381,
16,
60,
8614,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2546,
7,
77,
2926,
38381,
16,
60,
15139,
254,
4129,
7,
67,
8,
8614,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2546,
7,
32,
38381,
16,
60,
15139,
254,
2546,
7,
67,
2782,
26638,
38381,
16,
60,
8614,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2546,
7,
32,
38381,
17,
60,
15139,
254,
2546,
7,
67,
2782,
26638,
38381,
17,
60,
198,
220,
220,
220,
220,
220,
220,
220,
3714,
7,
29271,
3004,
44,
1042,
963,
7203,
27740,
5736,
286,
2603,
45977,
14,
31364,
466,
407,
2872,
48774,
198,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
337,
796,
1632,
3020,
19482,
7,
77,
2926,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
2124,
796,
337,
3467,
288,
198,
220,
220,
220,
264,
796,
800,
7,
32,
6,
1635,
800,
7,
44,
8,
1635,
317,
8,
1635,
317,
6,
87,
198,
220,
220,
220,
300,
77,
2339,
62,
9744,
796,
264,
6,
1635,
288,
2782,
26638,
6,
1635,
357,
87,
532,
337,
3467,
357,
32,
1635,
264,
4008,
198,
437,
198,
198,
37811,
198,
220,
220,
220,
2604,
2339,
62,
31361,
62,
33979,
7,
77,
2926,
11,
317,
11,
288,
2782,
26638,
40,
11,
288,
2782,
26638,
41,
11,
288,
8,
198,
198,
39,
408,
666,
286,
262,
7034,
14955,
329,
262,
8373,
2882,
30104,
351,
2461,
284,
36282,
10007,
198,
198,
9,
26687,
47026,
7889,
341,
357,
20,
8,
286,
41512,
446,
2123,
435,
1539,
4810,
35,
11,
9508,
11,
657,
5066,
22544,
357,
9804,
8,
198,
198,
2,
20559,
2886,
198,
12,
4600,
77,
2926,
3712,
19182,
90,
27,
25,
23839,
43879,
11,
17,
92,
63,
25,
23606,
19482,
7838,
44829,
590,
17593,
351,
262,
5391,
1463,
286,
4600,
7,
77,
26180,
11,
299,
26180,
8,
63,
810,
4600,
77,
26180,
63,
318,
262,
1271,
286,
8373,
11760,
13,
198,
12,
4600,
32,
3712,
19182,
90,
27,
25,
23839,
43879,
11,
17,
92,
63,
25,
4600,
77,
26180,
63,
12,
1525,
12,
63,
10782,
63,
17593,
286,
262,
8373,
2882,
11,
329,
4600,
10782,
63,
6805,
287,
6766,
13,
198,
220,
220,
220,
532,
412,
13,
70,
1539,
7559,
32,
796,
685,
64,
347,
60,
15506,
810,
4600,
64,
796,
3392,
7,
77,
26180,
8,
63,
329,
327,
10744,
290,
4600,
33,
63,
318,
257,
4600,
77,
26180,
63,
12,
1525,
12,
63,
10782,
12,
16,
63,
17593,
329,
262,
8373,
2882,
286,
36282,
6805,
13,
198,
12,
4600,
67,
2782,
26638,
40,
3712,
19182,
90,
27,
25,
23839,
43879,
11,
17,
92,
63,
290,
4600,
67,
2782,
26638,
41,
3712,
19182,
90,
27,
25,
23839,
43879,
11,
17,
92,
63,
25,
4600,
77,
26180,
63,
12,
1525,
12,
63,
10782,
63,
17593,
286,
262,
27255,
286,
262,
8373,
2882,
351,
2461,
284,
257,
36282,
11507,
13,
198,
220,
220,
220,
532,
412,
13,
70,
1539,
7559,
67,
2782,
26638,
40,
796,
685,
9107,
418,
7,
77,
26180,
8,
288,
28869,
354,
14,
67,
26638,
82,
1976,
27498,
7,
77,
26180,
15437,
15506,
810,
4600,
9107,
418,
7,
77,
26180,
8,
63,
329,
327,
10744,
290,
8977,
780,
484,
466,
407,
4745,
319,
262,
6171,
354,
10599,
1313,
6376,
4600,
26638,
82,
44646,
198,
12,
4600,
67,
3712,
19182,
90,
27,
25,
23839,
43879,
11,
16,
92,
63,
25,
1366,
15879,
329,
257,
1813,
17465,
357,
273,
597,
584,
5035,
7386,
737,
383,
1271,
286,
4847,
318,
4600,
77,
26180,
44646,
198,
37811,
198,
8818,
2604,
2339,
62,
31361,
62,
33979,
7,
198,
220,
220,
220,
299,
2926,
3712,
19182,
90,
51,
11,
17,
5512,
198,
220,
220,
220,
317,
3712,
19182,
90,
51,
11,
17,
5512,
198,
220,
220,
220,
288,
2782,
26638,
40,
3712,
19182,
90,
51,
11,
17,
5512,
198,
220,
220,
220,
288,
2782,
26638,
41,
3712,
19182,
90,
51,
11,
17,
5512,
198,
220,
220,
220,
288,
3712,
19182,
90,
51,
11,
16,
5512,
198,
8,
810,
1391,
51,
27,
25,
23839,
43879,
92,
198,
220,
220,
220,
611,
2546,
7,
77,
2926,
38381,
16,
60,
15139,
254,
2546,
7,
77,
2926,
38381,
17,
60,
198,
220,
220,
220,
220,
220,
220,
220,
3714,
7,
29271,
3004,
44,
1042,
963,
7203,
66,
709,
2743,
590,
17593,
1276,
307,
257,
6616,
17593,
48774,
198,
220,
220,
220,
2073,
361,
2546,
7,
77,
2926,
38381,
16,
60,
15139,
254,
2546,
7,
32,
38381,
16,
60,
8614,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2546,
7,
77,
2926,
38381,
16,
60,
15139,
254,
4129,
7,
67,
8,
8614,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2546,
7,
32,
38381,
16,
60,
15139,
254,
2546,
7,
67,
2782,
26638,
40,
38381,
16,
60,
8614,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2546,
7,
32,
38381,
17,
60,
15139,
254,
2546,
7,
67,
2782,
26638,
40,
38381,
17,
60,
8614,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2546,
7,
32,
38381,
16,
60,
15139,
254,
2546,
7,
67,
2782,
26638,
41,
38381,
16,
60,
8614,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2546,
7,
32,
38381,
17,
60,
15139,
254,
2546,
7,
67,
2782,
26638,
41,
38381,
17,
60,
198,
220,
220,
220,
220,
220,
220,
220,
3714,
7,
29271,
3004,
44,
1042,
963,
7203,
27740,
5736,
286,
2603,
45977,
14,
31364,
466,
407,
2872,
48774,
198,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
337,
796,
1632,
3020,
19482,
7,
77,
2926,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
2124,
796,
337,
3467,
288,
198,
220,
220,
220,
1629,
9452,
85,
32,
16340,
796,
800,
7,
32,
6,
1635,
800,
7,
44,
8,
1635,
317,
8,
198,
220,
220,
220,
264,
796,
1629,
9452,
85,
32,
16340,
1635,
317,
6,
87,
198,
220,
220,
220,
334,
796,
337,
3467,
357,
67,
2782,
26638,
41,
1635,
264,
8,
198,
220,
220,
220,
410,
796,
337,
3467,
357,
32,
1635,
1629,
9452,
85,
32,
16340,
1635,
317,
6,
84,
8,
198,
220,
220,
220,
300,
77,
2339,
62,
33979,
796,
491,
7,
67,
2782,
26638,
40,
6,
1635,
357,
85,
532,
334,
8,
1635,
264,
11537,
198,
437,
198
] | 2.348855 | 2,577 |
{"score": 7.42, "score_count": 48775, "timestamp": 1573578230.0}
{"score": 7.43, "score_count": 45911, "timestamp": 1562142618.0}
{"score": 7.44, "score_count": 35854, "timestamp": 1523189633.0}
| [
4895,
26675,
1298,
767,
13,
3682,
11,
366,
26675,
62,
9127,
1298,
4764,
34483,
11,
366,
16514,
27823,
1298,
23313,
2327,
3695,
19214,
13,
15,
92,
198,
4895,
26675,
1298,
767,
13,
3559,
11,
366,
26675,
62,
9127,
1298,
604,
3270,
1157,
11,
366,
16514,
27823,
1298,
1315,
5237,
1415,
2075,
1507,
13,
15,
92,
198,
4895,
26675,
1298,
767,
13,
2598,
11,
366,
26675,
62,
9127,
1298,
41761,
4051,
11,
366,
16514,
27823,
1298,
1315,
1954,
1507,
4846,
2091,
13,
15,
92,
198
] | 2.321429 | 84 |
# Main file for solving the J-SAA and J+-SAA problems
using Distributions, StatsFuns, StatsBase, JuMP, Gurobi, GLMNet
const gurobi_env = Gurobi.Env()
# read these as inputs from the corresponding "instance file"
modRepNum = parse(ARGS[1])
degNum = parse(ARGS[2])
dataRepNum = parse(ARGS[3])
sampSizeNum = parse(ARGS[4])
#*========= MODEL INFORMATION ==========
const caseNum = 2
const paramsFile = "params_case" * string(caseNum) * "_jsaa.jl"
#*======================================
#*========= INCLUDE FILES ====================
include("maxParameters.jl")
include("randomSeeds.jl")
include(paramsFile)
# the next two data files are defined in paramsFile
include(modelFile)
include(dataFile)
include("regressionMethods.jl")
include("genJSAAScenarios.jl")
include("solveModel.jl")
include("estimateSolnCost.jl")
include("evaluateSoln.jl")
#*======================================
# set seed for reproducibility
srand(startingSeed)
# directory name for storing results
const baseDirName = "case" * string(caseNum) * "_jsaa/" * "mod_" * string(modRepNum) * "/" * "deg_" * string(degNum) * "/"
const subDirName = baseDirName * "rep_" * string(dataRepNum) * "/"
const subDirName2 = subDirName * regressionMethod * "/" * "samp_" * string(sampSizeNum) * "/"
mkpath(subDirName2)
#*========= PRINT OPTIONS ====================
const storeResults = true
const infoFile = "ddsp.txt"
const modelDataFile = "model_data.txt"
const numSampFile = "num_samples_" * regressionMethod * ".txt"
const jsaaObjFile = "jsaa_obj.txt"
const jsaaDDObjFile = "jsaa_ddobj.txt"
const jpsaaObjFile = "jpsaa_obj.txt"
const jpsaaDDObjFile = "jpsaa_ddobj.txt"
const jsaaTimeFile = "jsaa_time.txt"
const covRealFile = "covariate_obs.txt"
#*======================================
#*========= GENERATE MODEL PARAMETERS ====================
srand(randomSeeds_models[modRepNum])
covariate_mean, covariate_covMat, coeff_true = generateBaseDemandModel(numCovariates)
#*========= STORE RESULTS ====================
if(storeResults)
# write details to text file, including some key details about the test instance
details_file = baseDirName * infoFile
open(details_file, "w") do f
write(f,"case number: $caseNum \n")
write(f,"numResources: $numResources \n")
write(f,"numCustomers: $numCustomers \n")
write(f,"model replicate number: $modRepNum \n")
write(f,"degree: $(degree[degNum]) \n")
write(f,"sample sizes: $numDataSamples \n")
write(f,"demand_errors_scaling: $demand_errors_scaling \n")
write(f,"regressionMethod: $regressionMethod \n\n")
write(f,"randomSeeds_MC: $randomSeeds_MC \n")
write(f,"randomSeeds_models: $randomSeeds_models \n")
write(f,"randomSeeds_data: $randomSeeds_data \n")
end
mod_data_file = baseDirName * modelDataFile
open(mod_data_file, "w") do f
write(f,"covariate_mean = $covariate_mean \n")
write(f,"covariate_covMat = $covariate_covMat \n")
write(f,"coeff_true = $coeff_true \n")
end
samp_size_file = baseDirName * numSampFile
open(samp_size_file, "w") do f
for i = 1:length(numDataSamples)
write(f,"$(numDataSamples[i]) \n")
end
end
end
#*============================================
#*========= GENERATE DATA REPLICATE ====================
srand(randomSeeds_data[dataRepNum])
covariate_obs = generateCovariateReal(numCovariates,covariate_mean,covariate_covMat)
demand_data, covariate_data = generateDemandData(numCovariates,numDataSamples[sampSizeNum],degree[degNum],covariate_mean,covariate_covMat,coeff_true)
#*========= STORE RESULTS ====================
if(storeResults)
cov_real_file = subDirName * covRealFile
open(cov_real_file, "w") do f
write(f,"covariate_obs = $covariate_obs")
end
end
#*============================================
#*========= SOLVE THE J-SAA and J+-SAA MODELS ====================
tic()
demand_scen_jsaa, demand_scen_jpsaa = generateJSAAScenarios(demand_data,covariate_data,covariate_obs,regressionMethod)
z_soln_jsaa, objDDJSAA = solveSAAModel(demand_scen_jsaa)
jsaaObjEstimates = estimateSolnQuality(z_soln_jsaa,covariate_obs,degree[degNum],numMCScenarios,numMCReplicates,coeff_true)
z_soln_jpsaa, objDDJpSAA = solveSAAModel(demand_scen_jpsaa)
jpsaaObjEstimates = estimateSolnQuality(z_soln_jpsaa,covariate_obs,degree[degNum],numMCScenarios,numMCReplicates,coeff_true)
jsaaTime = toq()
#*========= STORE RESULTS ====================
if(storeResults)
# write data to text file
obj_est_file1 = subDirName2 * jsaaObjFile
open(obj_est_file1, "w") do f
for i = 1:length(jsaaObjEstimates)
write(f,"$(jsaaObjEstimates[i]) \n")
end
end
obj_est_file2 = subDirName2 * jpsaaObjFile
open(obj_est_file2, "w") do f
for i = 1:length(jpsaaObjEstimates)
write(f,"$(jpsaaObjEstimates[i]) \n")
end
end
ddobj_est_file1 = subDirName2 * jsaaDDObjFile
open(ddobj_est_file1, "w") do f
write(f,"$objDDJSAA")
end
ddobj_est_file2 = subDirName2 * jpsaaDDObjFile
open(ddobj_est_file2, "w") do f
write(f,"$objDDJpSAA")
end
time_obj_file = subDirName2 * jsaaTimeFile
open(time_obj_file, "w") do f
write(f,"$jsaaTime")
end
end
#*============================================
| [
2,
8774,
2393,
329,
18120,
262,
449,
12,
50,
3838,
290,
449,
10,
12,
50,
3838,
2761,
201,
198,
201,
198,
201,
198,
3500,
46567,
507,
11,
20595,
37,
13271,
11,
20595,
14881,
11,
12585,
7378,
11,
402,
1434,
8482,
11,
10188,
44,
7934,
201,
198,
201,
198,
201,
198,
9979,
915,
305,
8482,
62,
24330,
796,
402,
1434,
8482,
13,
4834,
85,
3419,
201,
198,
201,
198,
201,
198,
201,
198,
2,
1100,
777,
355,
17311,
422,
262,
11188,
366,
39098,
2393,
1,
201,
198,
4666,
6207,
33111,
796,
21136,
7,
1503,
14313,
58,
16,
12962,
201,
198,
13500,
33111,
796,
21136,
7,
1503,
14313,
58,
17,
12962,
201,
198,
7890,
6207,
33111,
796,
21136,
7,
1503,
14313,
58,
18,
12962,
201,
198,
82,
696,
10699,
33111,
796,
21136,
7,
1503,
14313,
58,
19,
12962,
201,
198,
201,
198,
201,
198,
201,
198,
2,
9,
2559,
28,
19164,
3698,
38044,
796,
2559,
28,
201,
198,
9979,
1339,
33111,
796,
362,
201,
198,
9979,
42287,
8979,
796,
366,
37266,
62,
7442,
1,
1635,
4731,
7,
7442,
33111,
8,
1635,
45434,
8457,
7252,
13,
20362,
1,
201,
198,
2,
9,
10052,
50155,
201,
198,
201,
198,
201,
198,
201,
198,
2,
9,
2559,
28,
3268,
5097,
52,
7206,
34020,
1546,
36658,
18604,
201,
198,
17256,
7203,
9806,
48944,
13,
20362,
4943,
201,
198,
17256,
7203,
25120,
50,
39642,
13,
20362,
4943,
201,
198,
201,
198,
17256,
7,
37266,
8979,
8,
201,
198,
2,
262,
1306,
734,
1366,
3696,
389,
5447,
287,
42287,
8979,
201,
198,
17256,
7,
19849,
8979,
8,
201,
198,
17256,
7,
7890,
8979,
8,
201,
198,
201,
198,
17256,
7203,
2301,
2234,
46202,
13,
20362,
4943,
201,
198,
17256,
7203,
5235,
41,
4090,
1921,
66,
268,
13010,
13,
20362,
4943,
201,
198,
17256,
7203,
82,
6442,
17633,
13,
20362,
4943,
201,
198,
17256,
7203,
395,
1920,
50,
10875,
13729,
13,
20362,
4943,
201,
198,
17256,
7203,
49786,
50,
10875,
13,
20362,
4943,
201,
198,
2,
9,
10052,
50155,
201,
198,
201,
198,
201,
198,
201,
198,
2,
900,
9403,
329,
8186,
66,
2247,
201,
198,
82,
25192,
7,
38690,
50,
2308,
8,
201,
198,
201,
198,
201,
198,
201,
198,
2,
8619,
1438,
329,
23069,
2482,
201,
198,
9979,
2779,
35277,
5376,
796,
366,
7442,
1,
1635,
4731,
7,
7442,
33111,
8,
1635,
45434,
8457,
7252,
30487,
1635,
366,
4666,
62,
1,
1635,
4731,
7,
4666,
6207,
33111,
8,
1635,
12813,
1,
1635,
366,
13500,
62,
1,
1635,
4731,
7,
13500,
33111,
8,
1635,
12813,
1,
201,
198,
9979,
850,
35277,
5376,
796,
2779,
35277,
5376,
1635,
366,
7856,
62,
1,
1635,
4731,
7,
7890,
6207,
33111,
8,
1635,
12813,
1,
201,
198,
9979,
850,
35277,
5376,
17,
796,
850,
35277,
5376,
1635,
20683,
17410,
1635,
12813,
1,
1635,
366,
82,
696,
62,
1,
1635,
4731,
7,
82,
696,
10699,
33111,
8,
1635,
12813,
1,
201,
198,
28015,
6978,
7,
7266,
35277,
5376,
17,
8,
201,
198,
201,
198,
201,
198,
201,
198,
2,
9,
2559,
28,
4810,
12394,
39852,
11053,
36658,
18604,
201,
198,
9979,
3650,
25468,
796,
2081,
201,
198,
201,
198,
9979,
7508,
8979,
796,
366,
1860,
2777,
13,
14116,
1,
201,
198,
9979,
2746,
6601,
8979,
796,
366,
19849,
62,
7890,
13,
14116,
1,
201,
198,
9979,
997,
50,
696,
8979,
796,
366,
22510,
62,
82,
12629,
62,
1,
1635,
20683,
17410,
1635,
27071,
14116,
1,
201,
198,
201,
198,
9979,
44804,
7252,
49201,
8979,
796,
366,
8457,
7252,
62,
26801,
13,
14116,
1,
201,
198,
9979,
44804,
7252,
16458,
49201,
8979,
796,
366,
8457,
7252,
62,
1860,
26801,
13,
14116,
1,
201,
198,
9979,
474,
862,
7252,
49201,
8979,
796,
366,
73,
862,
7252,
62,
26801,
13,
14116,
1,
201,
198,
9979,
474,
862,
7252,
16458,
49201,
8979,
796,
366,
73,
862,
7252,
62,
1860,
26801,
13,
14116,
1,
201,
198,
9979,
44804,
7252,
7575,
8979,
796,
366,
8457,
7252,
62,
2435,
13,
14116,
1,
201,
198,
201,
198,
9979,
39849,
15633,
8979,
796,
366,
66,
709,
2743,
378,
62,
8158,
13,
14116,
1,
201,
198,
2,
9,
10052,
50155,
201,
198,
197,
201,
198,
201,
198,
201,
198,
2,
9,
2559,
28,
24700,
1137,
6158,
19164,
3698,
29463,
2390,
2767,
4877,
36658,
18604,
201,
198,
197,
201,
198,
82,
25192,
7,
25120,
50,
39642,
62,
27530,
58,
4666,
6207,
33111,
12962,
201,
198,
201,
198,
66,
709,
2743,
378,
62,
32604,
11,
44829,
378,
62,
66,
709,
19044,
11,
763,
14822,
62,
7942,
796,
7716,
14881,
42782,
17633,
7,
22510,
34,
709,
2743,
689,
8,
201,
198,
201,
198,
201,
198,
2,
9,
2559,
28,
3563,
6965,
15731,
35342,
36658,
18604,
201,
198,
361,
7,
8095,
25468,
8,
201,
198,
197,
201,
198,
197,
2,
3551,
3307,
284,
2420,
2393,
11,
1390,
617,
1994,
3307,
546,
262,
1332,
4554,
201,
198,
197,
36604,
62,
7753,
796,
2779,
35277,
5376,
1635,
7508,
8979,
201,
198,
197,
9654,
7,
36604,
62,
7753,
11,
366,
86,
4943,
466,
277,
201,
198,
197,
197,
13564,
7,
69,
553,
7442,
1271,
25,
720,
7442,
33111,
3467,
77,
4943,
201,
198,
197,
197,
13564,
7,
69,
553,
22510,
33236,
25,
720,
22510,
33236,
3467,
77,
4943,
201,
198,
197,
197,
13564,
7,
69,
553,
22510,
15022,
364,
25,
720,
22510,
15022,
364,
3467,
77,
4943,
201,
198,
197,
197,
13564,
7,
69,
553,
19849,
24340,
1271,
25,
720,
4666,
6207,
33111,
3467,
77,
4943,
201,
198,
197,
197,
13564,
7,
69,
553,
16863,
25,
29568,
16863,
58,
13500,
33111,
12962,
3467,
77,
4943,
201,
198,
197,
197,
13564,
7,
69,
553,
39873,
10620,
25,
720,
22510,
6601,
50,
12629,
3467,
77,
4943,
201,
198,
197,
197,
13564,
7,
69,
553,
28550,
62,
48277,
62,
1416,
4272,
25,
720,
28550,
62,
48277,
62,
1416,
4272,
3467,
77,
4943,
201,
198,
197,
197,
13564,
7,
69,
553,
2301,
2234,
17410,
25,
720,
2301,
2234,
17410,
3467,
77,
59,
77,
4943,
201,
198,
197,
197,
201,
198,
197,
197,
13564,
7,
69,
553,
25120,
50,
39642,
62,
9655,
25,
720,
25120,
50,
39642,
62,
9655,
3467,
77,
4943,
201,
198,
197,
197,
13564,
7,
69,
553,
25120,
50,
39642,
62,
27530,
25,
720,
25120,
50,
39642,
62,
27530,
3467,
77,
4943,
201,
198,
197,
197,
13564,
7,
69,
553,
25120,
50,
39642,
62,
7890,
25,
720,
25120,
50,
39642,
62,
7890,
3467,
77,
4943,
201,
198,
197,
437,
197,
201,
198,
197,
201,
198,
197,
4666,
62,
7890,
62,
7753,
796,
2779,
35277,
5376,
1635,
2746,
6601,
8979,
201,
198,
197,
9654,
7,
4666,
62,
7890,
62,
7753,
11,
366,
86,
4943,
466,
277,
201,
198,
197,
197,
13564,
7,
69,
553,
66,
709,
2743,
378,
62,
32604,
796,
720,
66,
709,
2743,
378,
62,
32604,
3467,
77,
4943,
201,
198,
197,
197,
13564,
7,
69,
553,
66,
709,
2743,
378,
62,
66,
709,
19044,
796,
720,
66,
709,
2743,
378,
62,
66,
709,
19044,
3467,
77,
4943,
201,
198,
197,
197,
13564,
7,
69,
553,
1073,
14822,
62,
7942,
796,
720,
1073,
14822,
62,
7942,
3467,
77,
4943,
201,
198,
197,
437,
201,
198,
197,
201,
198,
197,
82,
696,
62,
7857,
62,
7753,
796,
2779,
35277,
5376,
1635,
997,
50,
696,
8979,
201,
198,
197,
9654,
7,
82,
696,
62,
7857,
62,
7753,
11,
366,
86,
4943,
466,
277,
201,
198,
197,
197,
1640,
1312,
796,
352,
25,
13664,
7,
22510,
6601,
50,
12629,
8,
201,
198,
197,
197,
197,
13564,
7,
69,
553,
3,
7,
22510,
6601,
50,
12629,
58,
72,
12962,
3467,
77,
4943,
201,
198,
197,
197,
437,
201,
198,
197,
437,
201,
198,
197,
201,
198,
437,
201,
198,
2,
9,
10052,
25609,
201,
198,
201,
198,
201,
198,
201,
198,
2,
9,
2559,
28,
24700,
1137,
6158,
42865,
4526,
31484,
6158,
36658,
18604,
201,
198,
201,
198,
82,
25192,
7,
25120,
50,
39642,
62,
7890,
58,
7890,
6207,
33111,
12962,
201,
198,
201,
198,
66,
709,
2743,
378,
62,
8158,
796,
7716,
34,
709,
2743,
378,
15633,
7,
22510,
34,
709,
2743,
689,
11,
66,
709,
2743,
378,
62,
32604,
11,
66,
709,
2743,
378,
62,
66,
709,
19044,
8,
201,
198,
201,
198,
28550,
62,
7890,
11,
44829,
378,
62,
7890,
796,
7716,
42782,
6601,
7,
22510,
34,
709,
2743,
689,
11,
22510,
6601,
50,
12629,
58,
82,
696,
10699,
33111,
4357,
16863,
58,
13500,
33111,
4357,
66,
709,
2743,
378,
62,
32604,
11,
66,
709,
2743,
378,
62,
66,
709,
19044,
11,
1073,
14822,
62,
7942,
8,
201,
198,
201,
198,
201,
198,
2,
9,
2559,
28,
3563,
6965,
15731,
35342,
36658,
18604,
201,
198,
361,
7,
8095,
25468,
8,
201,
198,
197,
201,
198,
197,
66,
709,
62,
5305,
62,
7753,
796,
850,
35277,
5376,
1635,
39849,
15633,
8979,
201,
198,
197,
9654,
7,
66,
709,
62,
5305,
62,
7753,
11,
366,
86,
4943,
466,
277,
201,
198,
197,
197,
13564,
7,
69,
553,
66,
709,
2743,
378,
62,
8158,
796,
720,
66,
709,
2743,
378,
62,
8158,
4943,
201,
198,
197,
437,
197,
201,
198,
197,
201,
198,
437,
201,
198,
2,
9,
10052,
25609,
201,
198,
201,
198,
201,
198,
201,
198,
2,
9,
2559,
28,
36817,
6089,
3336,
449,
12,
50,
3838,
290,
449,
10,
12,
50,
3838,
19164,
37142,
36658,
18604,
201,
198,
201,
198,
13370,
3419,
201,
198,
201,
198,
201,
198,
28550,
62,
1416,
268,
62,
8457,
7252,
11,
3512,
62,
1416,
268,
62,
73,
862,
7252,
796,
7716,
41,
4090,
1921,
66,
268,
13010,
7,
28550,
62,
7890,
11,
66,
709,
2743,
378,
62,
7890,
11,
66,
709,
2743,
378,
62,
8158,
11,
2301,
2234,
17410,
8,
201,
198,
201,
198,
89,
62,
82,
10875,
62,
8457,
7252,
11,
26181,
16458,
20120,
3838,
796,
8494,
4090,
2390,
375,
417,
7,
28550,
62,
1416,
268,
62,
8457,
7252,
8,
201,
198,
201,
198,
8457,
7252,
49201,
22362,
26748,
796,
8636,
50,
10875,
35013,
7,
89,
62,
82,
10875,
62,
8457,
7252,
11,
66,
709,
2743,
378,
62,
8158,
11,
16863,
58,
13500,
33111,
4357,
22510,
9655,
3351,
268,
13010,
11,
22510,
9655,
39232,
16856,
11,
1073,
14822,
62,
7942,
8,
201,
198,
201,
198,
201,
198,
89,
62,
82,
10875,
62,
73,
862,
7252,
11,
26181,
16458,
41,
79,
50,
3838,
796,
8494,
4090,
2390,
375,
417,
7,
28550,
62,
1416,
268,
62,
73,
862,
7252,
8,
201,
198,
201,
198,
73,
862,
7252,
49201,
22362,
26748,
796,
8636,
50,
10875,
35013,
7,
89,
62,
82,
10875,
62,
73,
862,
7252,
11,
66,
709,
2743,
378,
62,
8158,
11,
16863,
58,
13500,
33111,
4357,
22510,
9655,
3351,
268,
13010,
11,
22510,
9655,
39232,
16856,
11,
1073,
14822,
62,
7942,
8,
201,
198,
201,
198,
201,
198,
8457,
7252,
7575,
796,
284,
80,
3419,
201,
198,
201,
198,
201,
198,
2,
9,
2559,
28,
3563,
6965,
15731,
35342,
36658,
18604,
201,
198,
361,
7,
8095,
25468,
8,
201,
198,
197,
201,
198,
197,
2,
3551,
1366,
284,
2420,
2393,
201,
198,
197,
26801,
62,
395,
62,
7753,
16,
796,
850,
35277,
5376,
17,
1635,
44804,
7252,
49201,
8979,
201,
198,
197,
9654,
7,
26801,
62,
395,
62,
7753,
16,
11,
366,
86,
4943,
466,
277,
201,
198,
197,
197,
1640,
1312,
796,
352,
25,
13664,
7,
8457,
7252,
49201,
22362,
26748,
8,
201,
198,
197,
197,
197,
13564,
7,
69,
553,
3,
7,
8457,
7252,
49201,
22362,
26748,
58,
72,
12962,
3467,
77,
4943,
201,
198,
197,
197,
437,
201,
198,
197,
437,
197,
201,
198,
197,
201,
198,
197,
26801,
62,
395,
62,
7753,
17,
796,
850,
35277,
5376,
17,
1635,
474,
862,
7252,
49201,
8979,
201,
198,
197,
9654,
7,
26801,
62,
395,
62,
7753,
17,
11,
366,
86,
4943,
466,
277,
201,
198,
197,
197,
1640,
1312,
796,
352,
25,
13664,
7,
73,
862,
7252,
49201,
22362,
26748,
8,
201,
198,
197,
197,
197,
13564,
7,
69,
553,
3,
7,
73,
862,
7252,
49201,
22362,
26748,
58,
72,
12962,
3467,
77,
4943,
201,
198,
197,
197,
437,
201,
198,
197,
437,
197,
201,
198,
197,
201,
198,
197,
1860,
26801,
62,
395,
62,
7753,
16,
796,
850,
35277,
5376,
17,
1635,
44804,
7252,
16458,
49201,
8979,
201,
198,
197,
9654,
7,
1860,
26801,
62,
395,
62,
7753,
16,
11,
366,
86,
4943,
466,
277,
201,
198,
197,
197,
13564,
7,
69,
553,
3,
26801,
16458,
20120,
3838,
4943,
201,
198,
197,
437,
197,
201,
198,
197,
201,
198,
197,
1860,
26801,
62,
395,
62,
7753,
17,
796,
850,
35277,
5376,
17,
1635,
474,
862,
7252,
16458,
49201,
8979,
201,
198,
197,
9654,
7,
1860,
26801,
62,
395,
62,
7753,
17,
11,
366,
86,
4943,
466,
277,
201,
198,
197,
197,
13564,
7,
69,
553,
3,
26801,
16458,
41,
79,
50,
3838,
4943,
201,
198,
197,
437,
197,
201,
198,
197,
201,
198,
197,
2435,
62,
26801,
62,
7753,
796,
850,
35277,
5376,
17,
1635,
44804,
7252,
7575,
8979,
201,
198,
197,
9654,
7,
2435,
62,
26801,
62,
7753,
11,
366,
86,
4943,
466,
277,
201,
198,
197,
197,
13564,
7,
69,
553,
3,
8457,
7252,
7575,
4943,
201,
198,
197,
437,
197,
201,
198,
197,
201,
198,
437,
201,
198,
2,
9,
10052,
25609,
201,
198
] | 2.446633 | 2,183 |
function py2ju_obj(py_obj)
py_attr = keys(py_obj)
n_attr = length(py_attr)
ju_obj = Dict()
for i = 1:n_attr
# skip base class attributes
if !contains(String(py_attr[i]), "__")
if py_obj[py_attr[i]] != nothing
error("Cannot convert Python object with non-None attribute value $(prop[i]).")
end
attr_name = String(py_attr[i])
ju_obj[attr_name] = nothing
end
end
return ju_obj
end
| [
8818,
12972,
17,
14396,
62,
26801,
7,
9078,
62,
26801,
8,
198,
220,
220,
220,
12972,
62,
35226,
796,
8251,
7,
9078,
62,
26801,
8,
198,
220,
220,
220,
299,
62,
35226,
796,
4129,
7,
9078,
62,
35226,
8,
198,
220,
220,
220,
7544,
62,
26801,
796,
360,
713,
3419,
198,
220,
220,
220,
329,
1312,
796,
352,
25,
77,
62,
35226,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
14267,
2779,
1398,
12608,
198,
220,
220,
220,
220,
220,
220,
220,
611,
5145,
3642,
1299,
7,
10100,
7,
9078,
62,
35226,
58,
72,
46570,
366,
834,
4943,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
12972,
62,
26801,
58,
9078,
62,
35226,
58,
72,
11907,
14512,
2147,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4049,
7203,
34,
34574,
10385,
11361,
2134,
351,
1729,
12,
14202,
11688,
1988,
29568,
22930,
58,
72,
12962,
19570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
708,
81,
62,
3672,
796,
10903,
7,
9078,
62,
35226,
58,
72,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7544,
62,
26801,
58,
35226,
62,
3672,
60,
796,
2147,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1441,
7544,
62,
26801,
198,
437,
198
] | 2.004082 | 245 |
"""
"""
struct ConditionalGaussian <: SciMLBase.AbstractLinearAlgorithm end
struct LinearGaussian <: SciMLBase.AbstractLinearAlgorithm end
| [
37811,
198,
37811,
198,
7249,
9724,
1859,
35389,
31562,
1279,
25,
10286,
5805,
14881,
13,
23839,
14993,
451,
2348,
42289,
886,
198,
7249,
44800,
35389,
31562,
1279,
25,
10286,
5805,
14881,
13,
23839,
14993,
451,
2348,
42289,
886,
198
] | 3.564103 | 39 |
export MtlArgumentEncoder, set_buffer!, set_buffers!, set_constant!
const MTLArgumentEncoder = Ptr{MtArgumentEncoder}
mutable struct MtlArgumentEncoder
handle::MTLArgumentEncoder
end
function MtlArgumentEncoder(fun::MtlFunction, entry::Integer)
handle = mtNewArgumentEncoderWithBufferIndexFromFunction(fun, entry-1)
obj = MtlArgumentEncoder(handle)
finalizer(unsafe_destroy!, obj)
return obj
end
function unsafe_destroy!(enc::MtlArgumentEncoder)
mtRelease(enc.handle)
end
Base.unsafe_convert(::Type{MTLArgumentEncoder}, enc::MtlArgumentEncoder) = enc.handle
Base.:(==)(a::MtlArgumentEncoder, b::MtlArgumentEncoder) = a.handle == b.handle
Base.hash(fun::MtlArgumentEncoder, h::UInt) = hash(mod.handle, h)
## properties
Base.propertynames(o::MtlArgumentEncoder) = (
# identification
#=:device, :label,=#
# creation
:encodedLength,
# alignment
:alignment,
)
function Base.getproperty(o::MtlArgumentEncoder, f::Symbol)
if f === :encodedLength
mtArgumentEncoderLength(o)
elseif f === :alignment
mtArgumentEncoderAlignment(o)
else
getfield(o, f)
end
end
Base.sizeof(a::MtlArgumentEncoder) = Int(mtArgumentEncoderLength(a))
## operations
# NOTE: indices aren't 1-based here, because they map onto exact IDs in the metadata
function assign_argument_buffer!(enc::MtlArgumentEncoder, buf::MtlBuffer, offset::Integer=0)
mtArgumentEncoderSetArgumentBufferWithOffset(enc, buf, offset)
end
function assign_argument_buffer!(enc::MtlArgumentEncoder, buf::MtlBuffer, offset::Integer, element::Integer)
mtArgumentEncoderSetArgumentBufferWithOffsetForElement(enc, buf, offset, element)
end
set_buffer!(enc::MtlArgumentEncoder, buf::MtlBuffer, offset::Integer, index::Integer) =
mtArgumentEncoderSetBufferOffsetAtIndex(enc, buf, offset, index)
set_buffers!(enc::MtlArgumentEncoder, bufs::Vector{<:MtlBuffer},
offsets::Vector{Int}, indices::UnitRange{Int}) =
mtArgumentEncoderSetBuffersOffsetsWithRange(enc, handle_array(bufs), offsets, indices)
function set_constant!(enc::MtlArgumentEncoder, val, index::Integer)
dst = Base.bitcast(Ptr{typeof(val)}, mtArgumentEncoderConstantDataAtIndex(enc, index))
Base.unsafe_store!(dst, val, 1)
return
end
| [
39344,
18632,
75,
28100,
1713,
27195,
12342,
11,
900,
62,
22252,
28265,
900,
62,
36873,
364,
28265,
900,
62,
9979,
415,
0,
198,
198,
9979,
337,
14990,
28100,
1713,
27195,
12342,
796,
350,
2213,
90,
44,
83,
28100,
1713,
27195,
12342,
92,
198,
198,
76,
18187,
2878,
18632,
75,
28100,
1713,
27195,
12342,
198,
220,
220,
220,
5412,
3712,
13752,
43,
28100,
1713,
27195,
12342,
198,
437,
198,
198,
8818,
18632,
75,
28100,
1713,
27195,
12342,
7,
12543,
3712,
44,
28781,
22203,
11,
5726,
3712,
46541,
8,
198,
220,
220,
220,
5412,
796,
45079,
3791,
28100,
1713,
27195,
12342,
3152,
28632,
15732,
4863,
22203,
7,
12543,
11,
5726,
12,
16,
8,
198,
220,
220,
220,
26181,
796,
18632,
75,
28100,
1713,
27195,
12342,
7,
28144,
8,
198,
220,
220,
220,
2457,
7509,
7,
13271,
8635,
62,
41659,
28265,
26181,
8,
198,
220,
220,
220,
1441,
26181,
198,
437,
198,
198,
8818,
21596,
62,
41659,
0,
7,
12685,
3712,
44,
28781,
28100,
1713,
27195,
12342,
8,
198,
220,
220,
220,
45079,
26362,
7,
12685,
13,
28144,
8,
198,
437,
198,
198,
14881,
13,
13271,
8635,
62,
1102,
1851,
7,
3712,
6030,
90,
13752,
43,
28100,
1713,
27195,
12342,
5512,
2207,
3712,
44,
28781,
28100,
1713,
27195,
12342,
8,
796,
2207,
13,
28144,
198,
198,
14881,
11207,
7,
855,
5769,
64,
3712,
44,
28781,
28100,
1713,
27195,
12342,
11,
275,
3712,
44,
28781,
28100,
1713,
27195,
12342,
8,
796,
257,
13,
28144,
6624,
275,
13,
28144,
198,
14881,
13,
17831,
7,
12543,
3712,
44,
28781,
28100,
1713,
27195,
12342,
11,
289,
3712,
52,
5317,
8,
796,
12234,
7,
4666,
13,
28144,
11,
289,
8,
628,
198,
2235,
6608,
198,
198,
14881,
13,
26745,
14933,
7,
78,
3712,
44,
28781,
28100,
1713,
27195,
12342,
8,
796,
357,
198,
220,
220,
220,
1303,
11795,
198,
220,
220,
220,
1303,
28,
25,
25202,
11,
1058,
18242,
11,
46249,
198,
220,
220,
220,
1303,
6282,
198,
220,
220,
220,
1058,
12685,
9043,
24539,
11,
198,
220,
220,
220,
1303,
19114,
198,
220,
220,
220,
1058,
282,
16747,
11,
198,
8,
198,
198,
8818,
7308,
13,
1136,
26745,
7,
78,
3712,
44,
28781,
28100,
1713,
27195,
12342,
11,
277,
3712,
13940,
23650,
8,
198,
220,
220,
220,
611,
277,
24844,
1058,
12685,
9043,
24539,
198,
220,
220,
220,
220,
220,
220,
220,
45079,
28100,
1713,
27195,
12342,
24539,
7,
78,
8,
198,
220,
220,
220,
2073,
361,
277,
24844,
1058,
282,
16747,
198,
220,
220,
220,
220,
220,
220,
220,
45079,
28100,
1713,
27195,
12342,
2348,
16747,
7,
78,
8,
198,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
651,
3245,
7,
78,
11,
277,
8,
198,
220,
220,
220,
886,
198,
437,
198,
198,
14881,
13,
7857,
1659,
7,
64,
3712,
44,
28781,
28100,
1713,
27195,
12342,
8,
796,
2558,
7,
16762,
28100,
1713,
27195,
12342,
24539,
7,
64,
4008,
628,
198,
2235,
4560,
198,
198,
2,
24550,
25,
36525,
3588,
470,
352,
12,
3106,
994,
11,
780,
484,
3975,
4291,
2748,
32373,
287,
262,
20150,
198,
198,
8818,
8333,
62,
49140,
62,
22252,
0,
7,
12685,
3712,
44,
28781,
28100,
1713,
27195,
12342,
11,
42684,
3712,
44,
28781,
28632,
11,
11677,
3712,
46541,
28,
15,
8,
198,
220,
220,
220,
45079,
28100,
1713,
27195,
12342,
7248,
28100,
1713,
28632,
3152,
34519,
7,
12685,
11,
42684,
11,
11677,
8,
198,
437,
198,
198,
8818,
8333,
62,
49140,
62,
22252,
0,
7,
12685,
3712,
44,
28781,
28100,
1713,
27195,
12342,
11,
42684,
3712,
44,
28781,
28632,
11,
11677,
3712,
46541,
11,
5002,
3712,
46541,
8,
198,
220,
220,
220,
45079,
28100,
1713,
27195,
12342,
7248,
28100,
1713,
28632,
3152,
34519,
1890,
20180,
7,
12685,
11,
42684,
11,
11677,
11,
5002,
8,
198,
437,
198,
198,
2617,
62,
22252,
0,
7,
12685,
3712,
44,
28781,
28100,
1713,
27195,
12342,
11,
42684,
3712,
44,
28781,
28632,
11,
11677,
3712,
46541,
11,
6376,
3712,
46541,
8,
796,
198,
220,
220,
220,
45079,
28100,
1713,
27195,
12342,
7248,
28632,
34519,
2953,
15732,
7,
12685,
11,
42684,
11,
11677,
11,
6376,
8,
198,
2617,
62,
36873,
364,
0,
7,
12685,
3712,
44,
28781,
28100,
1713,
27195,
12342,
11,
809,
9501,
3712,
38469,
90,
27,
25,
44,
28781,
28632,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49005,
3712,
38469,
90,
5317,
5512,
36525,
3712,
26453,
17257,
90,
5317,
30072,
796,
198,
220,
220,
220,
45079,
28100,
1713,
27195,
12342,
7248,
36474,
364,
9362,
28709,
3152,
17257,
7,
12685,
11,
5412,
62,
18747,
7,
29325,
82,
828,
49005,
11,
36525,
8,
198,
198,
8818,
900,
62,
9979,
415,
0,
7,
12685,
3712,
44,
28781,
28100,
1713,
27195,
12342,
11,
1188,
11,
6376,
3712,
46541,
8,
198,
220,
220,
220,
29636,
796,
7308,
13,
2545,
2701,
7,
46745,
90,
4906,
1659,
7,
2100,
8,
5512,
45079,
28100,
1713,
27195,
12342,
3103,
18797,
6601,
2953,
15732,
7,
12685,
11,
6376,
4008,
198,
220,
220,
220,
7308,
13,
13271,
8635,
62,
8095,
0,
7,
67,
301,
11,
1188,
11,
352,
8,
198,
220,
220,
220,
1441,
198,
437,
198
] | 2.69395 | 843 |
# Thanks @tlienart
using Franklin, JSON
using Markdown, Dates
include("youtube_videos.jl")
const DATEFMT = dateformat"yyyy-mm-dd HH:MMp"
const TZ = "America/New_York"
function hfun_doc(params)
fname = join(params[1:max(1, length(params)-2)], " ")
head = params[end-1]
type = params[end]
doc = eval(Meta.parse("@doc $fname"))
txt = Markdown.plain(doc)
# possibly further processing here
body = Franklin.fd2html(txt, internal=true)
return """
<div class="docstring">
<h2 class="doc-header" id="$head">
<a href="#$head">$head</a>
<div class="doc-type">$type</div></h2>
<div class="doc-content">$body</div>
</div>
"""
end
function hfun_youtube(params)
id = params[1]
return """
<iframe id="$id" width="100%" height="360"
src="https://www.youtube.com/embed/$(get(videos, id, id))"
frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen></iframe>
"""
end
function hfun_showtime(params)
id = params[1]
str = locvar(id)
if isnothing(str)
@warn "Unknown datetime variable $str"
return ""
end
try
DateTime(str, DATEFMT)
catch err
@warn "There was an error parsing date $str, the format is yyyy-mm-dd HH:MMp (see ?DateFormat)"
rethrow(err)
end
end
function parse_duration(str)
str = replace(str, r"^PT"=>"")
hrex, mrex, srex = Regex.(string.("^([0-9]+)", ["H","M","S"]))
t = 0
hmatch = match(hrex, str)
if !isnothing(hmatch)
h = parse(Int, hmatch[1])
t += 60*60*h
str = replace(str, hrex=>"")
end
mmatch = match(mrex, str)
if !isnothing(mmatch)
m = parse(Int, mmatch[1])
t += 60*m
str = replace(str, mrex=>"")
end
smatch = match(srex, str)
if !isnothing(smatch)
s = parse(Int, smatch[1])
t += s
str = replace(str, srex=>"")
end
t
end
function hfun_go_live()
seq = locvar("sequence")
airtime = locvar("airtime")
if isnothing(seq)
@warn "airtime set, but no `sequence` variable not defined." *
"sequence is an array of video IDs to play in order on this page"
end
vid_ids = [get(videos, s, s) for s in seq]
f = tempname()
# Get the duration of each video
download("https://www.googleapis.com/youtube/v3/videos?id=$(join(vid_ids, ","))&part=contentDetails&key=AIzaSyDZhbWHc2PTEFTx173MaTgddnWCGPqdbB8", f)
dict = JSON.parse(String(read(f)))
durations = [parse_duration(video["contentDetails"]["duration"])
for video in dict["items"]]
jrepr(x) = sprint(io->JSON.print(io, x))
"""
<script src="/assets/moment.min.js"></script>
<script src="/assets/moment-timezone.js"></script>
<script src="/assets/live-player.js"></script>
<script>
play_live($(jrepr(string(DateTime(airtime, DATEFMT)))), $(jrepr(TZ)), $(jrepr(seq)), $(jrepr(durations)))
</script>
"""
end
| [
2,
6930,
2488,
28781,
2013,
433,
198,
198,
3500,
14021,
11,
19449,
198,
198,
3500,
2940,
2902,
11,
44712,
198,
198,
17256,
7203,
11604,
62,
32861,
13,
20362,
4943,
198,
198,
9979,
360,
6158,
37,
13752,
796,
3128,
18982,
1,
22556,
22556,
12,
3020,
12,
1860,
47138,
25,
12038,
79,
1,
198,
9979,
309,
57,
796,
366,
18165,
14,
3791,
62,
49278,
1,
198,
198,
8818,
289,
12543,
62,
15390,
7,
37266,
8,
198,
220,
220,
220,
277,
3672,
796,
4654,
7,
37266,
58,
16,
25,
9806,
7,
16,
11,
4129,
7,
37266,
13219,
17,
8,
4357,
366,
366,
8,
198,
220,
220,
220,
1182,
796,
42287,
58,
437,
12,
16,
60,
198,
220,
220,
220,
2099,
796,
42287,
58,
437,
60,
198,
220,
220,
220,
2205,
796,
5418,
7,
48526,
13,
29572,
7203,
31,
15390,
720,
69,
3672,
48774,
198,
220,
220,
220,
256,
742,
796,
2940,
2902,
13,
25638,
7,
15390,
8,
198,
220,
220,
220,
1303,
5457,
2252,
7587,
994,
198,
220,
220,
220,
1767,
796,
14021,
13,
16344,
17,
6494,
7,
14116,
11,
5387,
28,
7942,
8,
198,
220,
220,
220,
1441,
37227,
198,
220,
220,
220,
220,
220,
1279,
7146,
1398,
2625,
15390,
8841,
5320,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
71,
17,
1398,
2625,
15390,
12,
25677,
1,
4686,
2625,
3,
2256,
5320,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
64,
13291,
25698,
3,
2256,
5320,
3,
2256,
3556,
64,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
7146,
1398,
2625,
15390,
12,
4906,
5320,
3,
4906,
3556,
7146,
12240,
71,
17,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
7146,
1398,
2625,
15390,
12,
11299,
5320,
3,
2618,
3556,
7146,
29,
198,
220,
220,
220,
220,
220,
7359,
7146,
29,
198,
220,
220,
220,
37227,
198,
437,
198,
198,
8818,
289,
12543,
62,
11604,
7,
37266,
8,
198,
220,
220,
220,
4686,
796,
42287,
58,
16,
60,
198,
220,
220,
220,
1441,
37227,
198,
220,
220,
220,
1279,
39621,
4686,
2625,
3,
312,
1,
9647,
2625,
3064,
39658,
6001,
2625,
15277,
1,
198,
220,
220,
220,
12351,
2625,
5450,
1378,
2503,
13,
11604,
13,
785,
14,
20521,
32624,
7,
1136,
7,
32861,
11,
4686,
11,
4686,
4008,
1,
198,
220,
220,
220,
5739,
20192,
2625,
15,
1,
198,
220,
220,
220,
1249,
2625,
330,
7015,
15635,
26,
22320,
10724,
26,
19365,
12,
11431,
26,
21486,
305,
29982,
26,
4286,
12,
259,
12,
34053,
1,
198,
220,
220,
220,
1249,
12853,
9612,
12240,
39621,
29,
198,
220,
220,
220,
37227,
198,
437,
198,
198,
8818,
289,
12543,
62,
12860,
2435,
7,
37266,
8,
198,
220,
220,
220,
4686,
796,
42287,
58,
16,
60,
198,
220,
220,
220,
965,
796,
1179,
7785,
7,
312,
8,
198,
220,
220,
220,
611,
318,
22366,
7,
2536,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
40539,
366,
20035,
4818,
8079,
7885,
720,
2536,
1,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
13538,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1949,
198,
220,
220,
220,
220,
220,
220,
220,
7536,
7575,
7,
2536,
11,
360,
6158,
37,
13752,
8,
198,
220,
220,
220,
4929,
11454,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
40539,
366,
1858,
373,
281,
4049,
32096,
3128,
720,
2536,
11,
262,
5794,
318,
331,
22556,
88,
12,
3020,
12,
1860,
47138,
25,
12038,
79,
357,
3826,
5633,
10430,
26227,
16725,
198,
220,
220,
220,
220,
220,
220,
220,
302,
16939,
7,
8056,
8,
198,
220,
220,
220,
886,
198,
437,
628,
198,
8818,
21136,
62,
32257,
7,
2536,
8,
198,
220,
220,
220,
965,
796,
6330,
7,
2536,
11,
374,
1,
61,
11571,
1,
14804,
1,
4943,
198,
220,
220,
220,
289,
21510,
11,
285,
21510,
11,
264,
21510,
796,
797,
25636,
12195,
8841,
13,
7203,
61,
26933,
15,
12,
24,
60,
28988,
1600,
14631,
39,
2430,
44,
2430,
50,
8973,
4008,
628,
220,
220,
220,
256,
796,
657,
198,
220,
220,
220,
289,
15699,
796,
2872,
7,
71,
21510,
11,
965,
8,
198,
220,
220,
220,
611,
5145,
271,
22366,
7,
71,
15699,
8,
198,
220,
220,
220,
220,
220,
220,
220,
289,
796,
21136,
7,
5317,
11,
289,
15699,
58,
16,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
256,
15853,
3126,
9,
1899,
9,
71,
198,
220,
220,
220,
220,
220,
220,
220,
965,
796,
6330,
7,
2536,
11,
289,
21510,
14804,
1,
4943,
198,
220,
220,
220,
886,
628,
220,
220,
220,
8085,
963,
796,
2872,
7,
76,
21510,
11,
965,
8,
198,
220,
220,
220,
611,
5145,
271,
22366,
7,
3020,
963,
8,
198,
220,
220,
220,
220,
220,
220,
220,
285,
796,
21136,
7,
5317,
11,
8085,
963,
58,
16,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
256,
15853,
3126,
9,
76,
198,
220,
220,
220,
220,
220,
220,
220,
965,
796,
6330,
7,
2536,
11,
285,
21510,
14804,
1,
4943,
198,
220,
220,
220,
886,
628,
220,
220,
220,
895,
963,
796,
2872,
7,
82,
21510,
11,
965,
8,
198,
220,
220,
220,
611,
5145,
271,
22366,
7,
5796,
963,
8,
198,
220,
220,
220,
220,
220,
220,
220,
264,
796,
21136,
7,
5317,
11,
895,
963,
58,
16,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
256,
15853,
264,
198,
220,
220,
220,
220,
220,
220,
220,
965,
796,
6330,
7,
2536,
11,
264,
21510,
14804,
1,
4943,
198,
220,
220,
220,
886,
628,
220,
220,
220,
256,
198,
437,
198,
198,
8818,
289,
12543,
62,
2188,
62,
12583,
3419,
198,
220,
220,
220,
33756,
796,
1179,
7785,
7203,
43167,
4943,
198,
220,
220,
220,
1633,
2435,
796,
1179,
7785,
7203,
958,
2435,
4943,
628,
220,
220,
220,
611,
318,
22366,
7,
41068,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
40539,
366,
958,
2435,
900,
11,
475,
645,
4600,
43167,
63,
7885,
407,
5447,
526,
1635,
198,
220,
220,
220,
220,
220,
220,
220,
366,
43167,
318,
281,
7177,
286,
2008,
32373,
284,
711,
287,
1502,
319,
428,
2443,
1,
198,
220,
220,
220,
886,
628,
220,
220,
220,
410,
312,
62,
2340,
796,
685,
1136,
7,
32861,
11,
264,
11,
264,
8,
329,
264,
287,
33756,
60,
628,
220,
220,
220,
277,
796,
20218,
3672,
3419,
198,
220,
220,
220,
1303,
3497,
262,
9478,
286,
1123,
2008,
198,
220,
220,
220,
4321,
7203,
5450,
1378,
2503,
13,
13297,
499,
271,
13,
785,
14,
11604,
14,
85,
18,
14,
32861,
30,
312,
43641,
7,
22179,
7,
16921,
62,
2340,
11,
366,
553,
4008,
5,
3911,
28,
11299,
24259,
5,
2539,
28,
20185,
4496,
13940,
35,
57,
71,
65,
12418,
66,
17,
47,
9328,
9792,
87,
25399,
21467,
51,
70,
1860,
77,
27353,
16960,
80,
9945,
33,
23,
1600,
277,
8,
198,
220,
220,
220,
8633,
796,
19449,
13,
29572,
7,
10100,
7,
961,
7,
69,
22305,
628,
220,
220,
220,
288,
20074,
796,
685,
29572,
62,
32257,
7,
15588,
14692,
11299,
24259,
1,
7131,
1,
32257,
8973,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
2008,
287,
8633,
14692,
23814,
8973,
60,
628,
198,
220,
220,
220,
474,
260,
1050,
7,
87,
8,
796,
18553,
7,
952,
3784,
40386,
13,
4798,
7,
952,
11,
2124,
4008,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1279,
12048,
12351,
35922,
19668,
14,
32542,
298,
13,
1084,
13,
8457,
23984,
12048,
29,
198,
220,
220,
220,
1279,
12048,
12351,
35922,
19668,
14,
32542,
298,
12,
2435,
11340,
13,
8457,
23984,
12048,
29,
198,
220,
220,
220,
1279,
12048,
12351,
35922,
19668,
14,
12583,
12,
7829,
13,
8457,
23984,
12048,
29,
198,
220,
220,
220,
1279,
12048,
29,
198,
220,
220,
220,
711,
62,
12583,
16763,
7,
73,
260,
1050,
7,
8841,
7,
10430,
7575,
7,
958,
2435,
11,
360,
6158,
37,
13752,
22305,
828,
29568,
73,
260,
1050,
7,
51,
57,
36911,
29568,
73,
260,
1050,
7,
41068,
36911,
29568,
73,
260,
1050,
7,
67,
20074,
22305,
198,
220,
220,
220,
7359,
12048,
29,
198,
220,
220,
220,
37227,
198,
437,
198
] | 2.239146 | 1,359 |
struct BitsIntChar
a::Int
b::Char
end
struct BitsCharBitsIntChar
a::Char
b::BitsIntChar
end
@testset "Bits types with custom fields" begin
@test begin
b = JlrsReflect.reflect([BitsCharBitsIntChar])
sb = JlrsReflect.StringWrappers(b)
sb[BitsIntChar] === """#[repr(C)]
#[derive(Clone, Debug, Unbox, ValidLayout, Typecheck, IntoJulia)]
#[jlrs(julia_type = "Main.BitsIntChar")]
pub struct BitsIntChar {
pub a: i64,
pub b: ::jlrs::wrappers::inline::char::Char,
}"""
sb[BitsCharBitsIntChar] === """#[repr(C)]
#[derive(Clone, Debug, Unbox, ValidLayout, Typecheck, IntoJulia)]
#[jlrs(julia_type = "Main.BitsCharBitsIntChar")]
pub struct BitsCharBitsIntChar {
pub a: ::jlrs::wrappers::inline::char::Char,
pub b: BitsIntChar,
}"""
end
end
| [
7249,
44733,
5317,
12441,
198,
220,
220,
220,
257,
3712,
5317,
198,
220,
220,
220,
275,
3712,
12441,
198,
437,
198,
198,
7249,
44733,
12441,
33,
896,
5317,
12441,
198,
220,
220,
220,
257,
3712,
12441,
198,
220,
220,
220,
275,
3712,
33,
896,
5317,
12441,
198,
437,
198,
198,
31,
9288,
2617,
366,
33,
896,
3858,
351,
2183,
7032,
1,
2221,
198,
220,
220,
220,
2488,
9288,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
275,
796,
449,
75,
3808,
8134,
801,
13,
35051,
26933,
33,
896,
12441,
33,
896,
5317,
12441,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
264,
65,
796,
449,
75,
3808,
8134,
801,
13,
10100,
36918,
11799,
7,
65,
8,
628,
220,
220,
220,
220,
220,
220,
220,
264,
65,
58,
33,
896,
5317,
12441,
60,
24844,
37227,
2,
58,
260,
1050,
7,
34,
15437,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
58,
1082,
425,
7,
2601,
505,
11,
31687,
11,
791,
3524,
11,
48951,
32517,
11,
5994,
9122,
11,
20008,
16980,
544,
15437,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
58,
20362,
3808,
7,
73,
43640,
62,
4906,
796,
366,
13383,
13,
33,
896,
5317,
12441,
4943,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2240,
2878,
44733,
5317,
12441,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2240,
257,
25,
1312,
2414,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2240,
275,
25,
7904,
20362,
3808,
3712,
29988,
11799,
3712,
45145,
3712,
10641,
3712,
12441,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
37811,
628,
220,
220,
220,
220,
220,
220,
220,
264,
65,
58,
33,
896,
12441,
33,
896,
5317,
12441,
60,
24844,
37227,
2,
58,
260,
1050,
7,
34,
15437,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
58,
1082,
425,
7,
2601,
505,
11,
31687,
11,
791,
3524,
11,
48951,
32517,
11,
5994,
9122,
11,
20008,
16980,
544,
15437,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
58,
20362,
3808,
7,
73,
43640,
62,
4906,
796,
366,
13383,
13,
33,
896,
12441,
33,
896,
5317,
12441,
4943,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2240,
2878,
44733,
12441,
33,
896,
5317,
12441,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2240,
257,
25,
7904,
20362,
3808,
3712,
29988,
11799,
3712,
45145,
3712,
10641,
3712,
12441,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2240,
275,
25,
44733,
5317,
12441,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
37811,
198,
220,
220,
220,
886,
198,
437,
198
] | 2.038462 | 442 |
using MatrixFactorizations, LinearAlgebra, Random, ArrayLayouts, Test
using LinearAlgebra: BlasComplex, BlasFloat, BlasReal, rmul!, lmul!, require_one_based_indexing, checksquare
n = 10
# Split n into 2 parts for tests needing two matrices
n1 = div(n, 2)
n2 = 2*n1
Random.seed!(1234321)
areal = randn(n,n)/2
aimg = randn(n,n)/2
a2real = randn(n,n)/2
a2img = randn(n,n)/2
breal = randn(n,2)/2
bimg = randn(n,2)/2
using MatrixFactorizations: RQPackedQ
using MatrixFactorizations: rq, rq!
const Our=MatrixFactorizations
@testset "RQ" begin
@testset "LAPACK $elty" for elty in (Float32,Float64,ComplexF32,ComplexF64)
@testset "Compare with LAPACK (square $elty)" begin
n = 10
A = randn(n,n)
R, Q = @inferred rq(A)
Ṟ, Q̄ = Our._rqfactUnblocked!(copy(A))
fla,τla = LinearAlgebra.LAPACK.gerqf!(copy(A))
@test Q.factors ≈ fla
@test Q.τ ≈ τla
@test Q.factors ≈ Q̄.factors
@test Q.τ ≈ Q̄.τ
@test R ≈ Ṟ
@test Q ≈ Q̄
end
@testset "Compare with LAPACK (rectangular $elty)" begin
n = 10
A = randn(n,n+2)
R, Q = rq(A)
Ṟ, Q̄ = Our._rqfactUnblocked!(copy(A))
fla,τla = LinearAlgebra.LAPACK.gerqf!(copy(A))
@test Q.factors ≈ fla
@test Q.τ ≈ τla
@test Q.factors ≈ Q̄.factors
@test Q.τ ≈ Q̄.τ
@test R ≈ Ṟ
@test Q ≈ Q̄
A = randn(n+2,n)
R, Q = rq(A)
Ṟ, Q̄ = Our._rqfactUnblocked!(copy(A))
fla,τla = LinearAlgebra.LAPACK.gerqf!(copy(A))
@test Q.factors ≈ fla
@test Q.τ ≈ τla
@test Q.factors ≈ Q̄.factors
@test Q.τ ≈ Q̄.τ
@test R ≈ Ṟ
@test Q ≈ Q̄
end
end
@testset for eltya in (Float32, Float64, ComplexF32, ComplexF64, BigFloat, Complex{BigFloat}, Int)
# @testset for eltya in (Float32,ComplexF32)
raw_a = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(areal, aimg) : areal)
raw_a2 = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(a2real, a2img) : a2real)
asym = raw_a' + raw_a # symmetric indefinite
apd = raw_a' * raw_a # symmetric positive-definite
ε = εa = eps(abs(float(one(eltya))))
@testset for eltyb in (Float32, Float64, ComplexF32, ComplexF64, Int)
# @info "stubbed eltyb loop"
# @testset for eltyb in (eltya, )
raw_b = eltyb == Int ? rand(1:5, n, 2) : convert(Matrix{eltyb}, eltyb <: Complex ? complex.(breal, bimg) : breal)
εb = eps(abs(float(one(eltyb))))
ε = max(εa, εb)
tab = promote_type(eltya, eltyb)
@testset "RQ decomposition of a Number" begin
α = rand(eltyb)
aα = fill(α, 1, 1)
@test rq(α).R * rq(α).Q ≈ rq(aα).R * rq(aα).Q
@test abs(rq(α).Q[1,1]) ≈ one(eltyb)
end
for (a, b) in ((raw_a, raw_b),
(view(raw_a, 1:n-1, 1:n-1), view(raw_b, 1:n-1, 1)))
a_1 = size(a, 1)
@testset "RQ decomposition" begin
rqa = @inferred rq(a)
@inferred rq(a)
q, r = rqa.Q, rqa.R
@test_throws ErrorException rqa.Z
@test q'*q ≈ Matrix(I, a_1, a_1)
@test q*q' ≈ Matrix(I, a_1, a_1)
@test q'*Matrix(1.0I, a_1, a_1)' ≈ q'
@test q'q ≈ Matrix(I, a_1, a_1)
@test Matrix(1.0I, a_1, a_1)'q' ≈ q'
@test r*q ≈ a
@test a*(rqa\b) ≈ b atol=5000ε
@test Array(rqa) ≈ a
sq = size(q.factors, 2)
@test *(Matrix{eltyb}(I, sq, sq), adjoint(q)) * q ≈ Matrix(I, sq, sq) atol=5000ε
if eltya != Int
@test Matrix{eltyb}(I, a_1, a_1)*q ≈ convert(AbstractMatrix{tab}, q)
ac = copy(a)
# would need rectangular ldiv! method
@test_throws DimensionMismatch rq!(a[:, 1:5])\b == rq!(view(ac, :, 1:5))\b
end
rqstring = sprint((t, s) -> show(t, "text/plain", s), rqa)
rstring = sprint((t, s) -> show(t, "text/plain", s), r)
qstring = sprint((t, s) -> show(t, "text/plain", s), q)
@test rqstring == "$(summary(rqa))\nR factor:\n$rstring\nQ factor:\n$qstring"
end
end
if eltya != Int
@testset "Matmul with RQ factorizations" begin
a = raw_a
rqa = rq(a[:,1:n1])
q, r = rqa.Q, rqa.R
@test rmul!(copy(q'), q) ≈ Matrix(I, n1, n1)
@test_throws DimensionMismatch rmul!(Matrix{eltya}(I, n1+1, n1+1),q)
@test rmul!(copy(q), adjoint(q)) ≈ Matrix(I, n1, n1)
@test_throws DimensionMismatch rmul!(Matrix{eltya}(I, n1+1, n1+1),adjoint(q))
@test_throws ErrorException size(q,-1)
@test_throws DimensionMismatch q * Matrix{Int8}(I, n+4, n+4)
end
end
end
@testset "Wide RQ" begin
m = n-2
A = raw_a[1:m,1:n]
R,Q = rq(A)
@test Q'*Q ≈ Matrix(I, n, n)
@test istriu(R)
@test hcat(zeros(m,n-m),R)*Q ≈ A
# test the perverse padded product
@test R*Q ≈ A
Qm = Matrix(Q)
@test Qm' * Qm ≈ Matrix(I, n, n)
@test hcat(zeros(m,n-m),R)*Qm ≈ A
end
@testset "Tall RQ" begin
p = n-2
A = raw_a[1:n,1:p]
R,Q = rq(A)
@test Q'*Q ≈ Matrix(I, p, p)
@test istriu(R,p-n)
@test R*Q ≈ A
Qm = Matrix(Q)
@test Qm' * Qm ≈ Matrix(I, p, p)
@test R*Qm ≈ A
end
end
@testset "transpose errors" begin
@test_throws MethodError transpose(rq(randn(3,3)))
@test_throws MethodError adjoint(rq(randn(3,3)))
@test_throws MethodError transpose(rq(big.(randn(3,3))))
@test_throws MethodError adjoint(rq(big.(randn(3,3))))
end
@testset "Issue 7304" begin
A = [-√.5 -√.5; -√.5 √.5]
Q = rq(A).Q
@test norm(A+Q) < eps()
end
@testset "rq on AbstractVector" begin
vl = [3.0, 4.0]
for Tl in (Float32, Float64)
for T in (Tl, Complex{Tl})
v = convert(Vector{T}, vl)
nv, nm = rq(v)
@test nv*nm ≈ v
end
end
end
@testset "Issue 24589. Promotion of rational matrices" begin
A = rand(1//1:5//5, 4,3)
@test first(rq(A)) == first(rq(float(A)))
end
# omit "Issue Test Factorization fallbacks for rectangular problems"
@testset "lmul!/rmul! $elty" for elty in (:real, :cplx)
s = elty == :real ? 0.0 : 0.25im
A = randn(100,100) .+ s
R,Q = rq(A)
x = randn(100) .+ s
b = randn(100,2) .+ s
@test lmul!(Q, copy(x)) ≈ Matrix(Q)*x
@test lmul!(Q, copy(b)) ≈ Matrix(Q)*b
@test lmul!(Q', copy(x)) ≈ Matrix(Q)'*x
@test lmul!(Q', copy(b)) ≈ Matrix(Q)'*b
c = randn(2,100) .+ s
@test rmul!(copy(c), Q) ≈ c*Matrix(Q)
@test rmul!(copy(c), Q') ≈ c*Matrix(Q')
A = randn(103,100) .+ s
R,Q = rq(A)
x = randn(100) .+ s
b = randn(100,2) .+ s
@test lmul!(Q, copy(x)) ≈ Matrix(Q)*x
@test lmul!(Q, copy(b)) ≈ Matrix(Q)*b
@test lmul!(Q', copy(x)) ≈ Matrix(Q)'*x
@test lmul!(Q', copy(b)) ≈ Matrix(Q)'*b
c = randn(2,100) .+ s
@test rmul!(copy(c), Q) ≈ c*Matrix(Q)
@test rmul!(copy(c), Q') ≈ c*Matrix(Q')
end
end
| [
3500,
24936,
41384,
4582,
11,
44800,
2348,
29230,
11,
14534,
11,
15690,
23763,
5269,
11,
6208,
198,
3500,
44800,
2348,
29230,
25,
1086,
292,
5377,
11141,
11,
1086,
292,
43879,
11,
1086,
292,
15633,
11,
42721,
377,
28265,
300,
76,
377,
28265,
2421,
62,
505,
62,
3106,
62,
9630,
278,
11,
8794,
421,
533,
198,
198,
77,
796,
838,
198,
198,
2,
27758,
299,
656,
362,
3354,
329,
5254,
18139,
734,
2603,
45977,
198,
77,
16,
796,
2659,
7,
77,
11,
362,
8,
198,
77,
17,
796,
362,
9,
77,
16,
198,
198,
29531,
13,
28826,
0,
7,
1065,
32118,
2481,
8,
198,
198,
533,
282,
796,
43720,
77,
7,
77,
11,
77,
20679,
17,
198,
1385,
70,
220,
796,
43720,
77,
7,
77,
11,
77,
20679,
17,
198,
64,
17,
5305,
796,
43720,
77,
7,
77,
11,
77,
20679,
17,
198,
64,
17,
9600,
220,
796,
43720,
77,
7,
77,
11,
77,
20679,
17,
198,
4679,
282,
796,
43720,
77,
7,
77,
11,
17,
20679,
17,
198,
65,
9600,
220,
796,
43720,
77,
7,
77,
11,
17,
20679,
17,
198,
198,
3500,
24936,
41384,
4582,
25,
371,
48,
47,
6021,
48,
198,
198,
3500,
24936,
41384,
4582,
25,
374,
80,
11,
374,
80,
0,
198,
9979,
3954,
28,
46912,
41384,
4582,
198,
198,
31,
9288,
2617,
366,
49,
48,
1,
2221,
198,
220,
220,
220,
2488,
9288,
2617,
366,
43,
2969,
8120,
720,
417,
774,
1,
329,
1288,
774,
287,
357,
43879,
2624,
11,
43879,
2414,
11,
5377,
11141,
37,
2624,
11,
5377,
11141,
37,
2414,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2617,
366,
41488,
351,
406,
2969,
8120,
357,
23415,
720,
417,
774,
16725,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
796,
838,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
796,
43720,
77,
7,
77,
11,
77,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
371,
11,
1195,
796,
2488,
259,
18186,
374,
80,
7,
32,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26292,
252,
11,
1195,
136,
226,
796,
3954,
13557,
81,
80,
22584,
3118,
2436,
3543,
0,
7,
30073,
7,
32,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
781,
64,
11,
32830,
5031,
796,
44800,
2348,
29230,
13,
43,
2969,
8120,
13,
1362,
80,
69,
0,
7,
30073,
7,
32,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1195,
13,
22584,
669,
15139,
230,
781,
64,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1195,
13,
32830,
15139,
230,
46651,
5031,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1195,
13,
22584,
669,
15139,
230,
1195,
136,
226,
13,
22584,
669,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1195,
13,
32830,
15139,
230,
1195,
136,
226,
13,
32830,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
371,
15139,
230,
220,
26292,
252,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1195,
15139,
230,
1195,
136,
226,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2617,
366,
41488,
351,
406,
2969,
8120,
357,
2554,
21413,
720,
417,
774,
16725,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
796,
838,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
796,
43720,
77,
7,
77,
11,
77,
10,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
371,
11,
1195,
796,
374,
80,
7,
32,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26292,
252,
11,
1195,
136,
226,
796,
3954,
13557,
81,
80,
22584,
3118,
2436,
3543,
0,
7,
30073,
7,
32,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
781,
64,
11,
32830,
5031,
796,
44800,
2348,
29230,
13,
43,
2969,
8120,
13,
1362,
80,
69,
0,
7,
30073,
7,
32,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1195,
13,
22584,
669,
15139,
230,
781,
64,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1195,
13,
32830,
15139,
230,
46651,
5031,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1195,
13,
22584,
669,
15139,
230,
1195,
136,
226,
13,
22584,
669,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1195,
13,
32830,
15139,
230,
1195,
136,
226,
13,
32830,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
371,
15139,
230,
220,
26292,
252,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1195,
15139,
230,
1195,
136,
226,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
796,
43720,
77,
7,
77,
10,
17,
11,
77,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
371,
11,
1195,
796,
374,
80,
7,
32,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26292,
252,
11,
1195,
136,
226,
796,
3954,
13557,
81,
80,
22584,
3118,
2436,
3543,
0,
7,
30073,
7,
32,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
781,
64,
11,
32830,
5031,
796,
44800,
2348,
29230,
13,
43,
2969,
8120,
13,
1362,
80,
69,
0,
7,
30073,
7,
32,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1195,
13,
22584,
669,
15139,
230,
781,
64,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1195,
13,
32830,
15139,
230,
46651,
5031,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1195,
13,
22584,
669,
15139,
230,
1195,
136,
226,
13,
22584,
669,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1195,
13,
32830,
15139,
230,
1195,
136,
226,
13,
32830,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
371,
15139,
230,
220,
26292,
252,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1195,
15139,
230,
1195,
136,
226,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
220,
220,
220,
2488,
9288,
2617,
329,
1288,
774,
64,
287,
357,
43879,
2624,
11,
48436,
2414,
11,
19157,
37,
2624,
11,
19157,
37,
2414,
11,
4403,
43879,
11,
19157,
90,
12804,
43879,
5512,
2558,
8,
198,
220,
220,
220,
1303,
2488,
9288,
2617,
329,
1288,
774,
64,
287,
357,
43879,
2624,
11,
5377,
11141,
37,
2624,
8,
198,
220,
220,
220,
220,
220,
220,
220,
8246,
62,
64,
796,
1288,
774,
64,
6624,
2558,
5633,
43720,
7,
16,
25,
22,
11,
299,
11,
299,
8,
1058,
10385,
7,
46912,
90,
417,
774,
64,
5512,
1288,
774,
64,
1279,
25,
19157,
5633,
3716,
12195,
533,
282,
11,
4031,
70,
8,
1058,
389,
282,
8,
198,
220,
220,
220,
220,
220,
220,
220,
8246,
62,
64,
17,
796,
1288,
774,
64,
6624,
2558,
5633,
43720,
7,
16,
25,
22,
11,
299,
11,
299,
8,
1058,
10385,
7,
46912,
90,
417,
774,
64,
5512,
1288,
774,
64,
1279,
25,
19157,
5633,
3716,
12195,
64,
17,
5305,
11,
257,
17,
9600,
8,
1058,
257,
17,
5305,
8,
198,
220,
220,
220,
220,
220,
220,
220,
355,
4948,
796,
8246,
62,
64,
6,
1343,
8246,
62,
64,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
23606,
19482,
35639,
198,
220,
220,
220,
220,
220,
220,
220,
2471,
67,
220,
796,
8246,
62,
64,
6,
1635,
8246,
62,
64,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
23606,
19482,
3967,
12,
4299,
9504,
198,
220,
220,
220,
220,
220,
220,
220,
7377,
113,
796,
7377,
113,
64,
796,
304,
862,
7,
8937,
7,
22468,
7,
505,
7,
417,
774,
64,
35514,
628,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2617,
329,
1288,
774,
65,
287,
357,
43879,
2624,
11,
48436,
2414,
11,
19157,
37,
2624,
11,
19157,
37,
2414,
11,
2558,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
2488,
10951,
366,
301,
549,
3077,
1288,
774,
65,
9052,
1,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
2488,
9288,
2617,
329,
1288,
774,
65,
287,
357,
417,
774,
64,
11,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8246,
62,
65,
796,
1288,
774,
65,
6624,
2558,
5633,
43720,
7,
16,
25,
20,
11,
299,
11,
362,
8,
1058,
10385,
7,
46912,
90,
417,
774,
65,
5512,
1288,
774,
65,
1279,
25,
19157,
5633,
3716,
12195,
4679,
282,
11,
275,
9600,
8,
1058,
1449,
282,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7377,
113,
65,
796,
304,
862,
7,
8937,
7,
22468,
7,
505,
7,
417,
774,
65,
35514,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7377,
113,
796,
3509,
7,
30950,
64,
11,
7377,
113,
65,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7400,
796,
7719,
62,
4906,
7,
417,
774,
64,
11,
1288,
774,
65,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2617,
366,
49,
48,
26969,
9150,
286,
257,
7913,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26367,
796,
43720,
7,
417,
774,
65,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
257,
17394,
796,
6070,
7,
17394,
11,
352,
11,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
374,
80,
7,
17394,
737,
49,
1635,
374,
80,
7,
17394,
737,
48,
15139,
230,
374,
80,
7,
64,
17394,
737,
49,
1635,
374,
80,
7,
64,
17394,
737,
48,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2352,
7,
81,
80,
7,
17394,
737,
48,
58,
16,
11,
16,
12962,
15139,
230,
530,
7,
417,
774,
65,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
357,
64,
11,
275,
8,
287,
14808,
1831,
62,
64,
11,
8246,
62,
65,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
1177,
7,
1831,
62,
64,
11,
352,
25,
77,
12,
16,
11,
352,
25,
77,
12,
16,
828,
1570,
7,
1831,
62,
65,
11,
352,
25,
77,
12,
16,
11,
352,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
257,
62,
16,
796,
2546,
7,
64,
11,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2617,
366,
49,
48,
26969,
9150,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
20402,
220,
220,
796,
2488,
259,
18186,
374,
80,
7,
64,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
259,
18186,
374,
80,
7,
64,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10662,
11,
374,
220,
796,
374,
20402,
13,
48,
11,
374,
20402,
13,
49,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
62,
400,
8516,
13047,
16922,
374,
20402,
13,
57,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
10662,
6,
9,
80,
15139,
230,
24936,
7,
40,
11,
257,
62,
16,
11,
257,
62,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
10662,
9,
80,
6,
15139,
230,
24936,
7,
40,
11,
257,
62,
16,
11,
257,
62,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
10662,
6,
9,
46912,
7,
16,
13,
15,
40,
11,
257,
62,
16,
11,
257,
62,
16,
33047,
15139,
230,
10662,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
10662,
6,
80,
15139,
230,
24936,
7,
40,
11,
257,
62,
16,
11,
257,
62,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
24936,
7,
16,
13,
15,
40,
11,
257,
62,
16,
11,
257,
62,
16,
33047,
80,
6,
15139,
230,
10662,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
374,
9,
80,
15139,
230,
257,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
257,
9,
7,
81,
20402,
59,
65,
8,
15139,
230,
275,
379,
349,
28,
27641,
30950,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
15690,
7,
81,
20402,
8,
15139,
230,
257,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19862,
796,
2546,
7,
80,
13,
22584,
669,
11,
362,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1635,
7,
46912,
90,
417,
774,
65,
92,
7,
40,
11,
19862,
11,
19862,
828,
9224,
1563,
7,
80,
4008,
1635,
10662,
15139,
230,
24936,
7,
40,
11,
19862,
11,
19862,
8,
379,
349,
28,
27641,
30950,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1288,
774,
64,
14512,
2558,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
24936,
90,
417,
774,
65,
92,
7,
40,
11,
257,
62,
16,
11,
257,
62,
16,
27493,
80,
15139,
230,
10385,
7,
23839,
46912,
90,
8658,
5512,
10662,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
936,
796,
4866,
7,
64,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
561,
761,
36954,
300,
7146,
0,
2446,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
62,
400,
8516,
34024,
44,
1042,
963,
374,
80,
0,
7,
64,
58,
45299,
352,
25,
20,
12962,
59,
65,
6624,
374,
80,
0,
7,
1177,
7,
330,
11,
1058,
11,
352,
25,
20,
4008,
59,
65,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
80,
8841,
796,
18553,
19510,
83,
11,
264,
8,
4613,
905,
7,
83,
11,
366,
5239,
14,
25638,
1600,
264,
828,
374,
20402,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
8841,
220,
796,
18553,
19510,
83,
11,
264,
8,
4613,
905,
7,
83,
11,
366,
5239,
14,
25638,
1600,
264,
828,
374,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10662,
8841,
220,
796,
18553,
19510,
83,
11,
264,
8,
4613,
905,
7,
83,
11,
366,
5239,
14,
25638,
1600,
264,
828,
10662,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
374,
80,
8841,
6624,
17971,
7,
49736,
7,
81,
20402,
4008,
59,
77,
49,
5766,
7479,
77,
3,
81,
8841,
59,
77,
48,
5766,
7479,
77,
3,
80,
8841,
1,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1288,
774,
64,
14512,
2558,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2617,
366,
19044,
76,
377,
351,
371,
48,
5766,
4582,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
257,
796,
8246,
62,
64,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
20402,
796,
374,
80,
7,
64,
58,
45299,
16,
25,
77,
16,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10662,
11,
374,
796,
374,
20402,
13,
48,
11,
374,
20402,
13,
49,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
42721,
377,
0,
7,
30073,
7,
80,
33809,
10662,
8,
15139,
230,
24936,
7,
40,
11,
299,
16,
11,
299,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
62,
400,
8516,
34024,
44,
1042,
963,
42721,
377,
0,
7,
46912,
90,
417,
774,
64,
92,
7,
40,
11,
299,
16,
10,
16,
11,
299,
16,
10,
16,
828,
80,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
42721,
377,
0,
7,
30073,
7,
80,
828,
9224,
1563,
7,
80,
4008,
15139,
230,
24936,
7,
40,
11,
299,
16,
11,
299,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
62,
400,
8516,
34024,
44,
1042,
963,
42721,
377,
0,
7,
46912,
90,
417,
774,
64,
92,
7,
40,
11,
299,
16,
10,
16,
11,
299,
16,
10,
16,
828,
41255,
1563,
7,
80,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
62,
400,
8516,
13047,
16922,
2546,
7,
80,
12095,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
62,
400,
8516,
34024,
44,
1042,
963,
10662,
1635,
24936,
90,
5317,
23,
92,
7,
40,
11,
299,
10,
19,
11,
299,
10,
19,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2617,
366,
42559,
371,
48,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
796,
299,
12,
17,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
796,
8246,
62,
64,
58,
16,
25,
76,
11,
16,
25,
77,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
371,
11,
48,
796,
374,
80,
7,
32,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1195,
6,
9,
48,
15139,
230,
24936,
7,
40,
11,
299,
11,
299,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
318,
28461,
84,
7,
49,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
289,
9246,
7,
9107,
418,
7,
76,
11,
77,
12,
76,
828,
49,
27493,
48,
15139,
230,
317,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
1332,
262,
43060,
44582,
1720,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
371,
9,
48,
15139,
230,
317,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1195,
76,
796,
24936,
7,
48,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1195,
76,
6,
1635,
1195,
76,
15139,
230,
24936,
7,
40,
11,
299,
11,
299,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
289,
9246,
7,
9107,
418,
7,
76,
11,
77,
12,
76,
828,
49,
27493,
48,
76,
15139,
230,
317,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2617,
366,
51,
439,
371,
48,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
279,
796,
299,
12,
17,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
796,
8246,
62,
64,
58,
16,
25,
77,
11,
16,
25,
79,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
371,
11,
48,
796,
374,
80,
7,
32,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1195,
6,
9,
48,
15139,
230,
24936,
7,
40,
11,
279,
11,
279,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
318,
28461,
84,
7,
49,
11,
79,
12,
77,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
371,
9,
48,
15139,
230,
317,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1195,
76,
796,
24936,
7,
48,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1195,
76,
6,
1635,
1195,
76,
15139,
230,
24936,
7,
40,
11,
279,
11,
279,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
371,
9,
48,
76,
15139,
230,
317,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
628,
220,
220,
220,
2488,
9288,
2617,
366,
7645,
3455,
8563,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
62,
400,
8516,
11789,
12331,
1007,
3455,
7,
81,
80,
7,
25192,
77,
7,
18,
11,
18,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
62,
400,
8516,
11789,
12331,
9224,
1563,
7,
81,
80,
7,
25192,
77,
7,
18,
11,
18,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
62,
400,
8516,
11789,
12331,
1007,
3455,
7,
81,
80,
7,
14261,
12195,
25192,
77,
7,
18,
11,
18,
35514,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
62,
400,
8516,
11789,
12331,
9224,
1563,
7,
81,
80,
7,
14261,
12195,
25192,
77,
7,
18,
11,
18,
35514,
198,
220,
220,
220,
886,
628,
220,
220,
220,
2488,
9288,
2617,
366,
45147,
767,
21288,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
317,
796,
25915,
24861,
248,
13,
20,
532,
24861,
248,
13,
20,
26,
532,
24861,
248,
13,
20,
18872,
248,
13,
20,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1195,
796,
374,
80,
7,
32,
737,
48,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2593,
7,
32,
10,
48,
8,
1279,
304,
862,
3419,
198,
220,
220,
220,
886,
628,
220,
220,
220,
2488,
9288,
2617,
366,
81,
80,
319,
27741,
38469,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
410,
75,
796,
685,
18,
13,
15,
11,
604,
13,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
329,
309,
75,
287,
357,
43879,
2624,
11,
48436,
2414,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
309,
287,
357,
51,
75,
11,
19157,
90,
51,
75,
30072,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
796,
10385,
7,
38469,
90,
51,
5512,
410,
75,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
85,
11,
28642,
796,
374,
80,
7,
85,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
299,
85,
9,
21533,
15139,
230,
410,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
628,
220,
220,
220,
2488,
9288,
2617,
366,
45147,
1987,
44169,
13,
42868,
286,
9377,
2603,
45977,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
317,
796,
43720,
7,
16,
1003,
16,
25,
20,
1003,
20,
11,
604,
11,
18,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
717,
7,
81,
80,
7,
32,
4008,
6624,
717,
7,
81,
80,
7,
22468,
7,
32,
22305,
198,
220,
220,
220,
886,
628,
220,
220,
220,
1303,
42848,
366,
45147,
6208,
27929,
1634,
2121,
10146,
329,
36954,
2761,
1,
628,
220,
220,
220,
2488,
9288,
2617,
366,
75,
76,
377,
48443,
26224,
377,
0,
720,
417,
774,
1,
329,
1288,
774,
287,
357,
25,
5305,
11,
1058,
66,
489,
87,
8,
198,
220,
220,
220,
220,
220,
220,
220,
264,
796,
1288,
774,
6624,
1058,
5305,
5633,
657,
13,
15,
1058,
657,
13,
1495,
320,
198,
220,
220,
220,
220,
220,
220,
220,
317,
796,
43720,
77,
7,
3064,
11,
3064,
8,
764,
10,
264,
198,
220,
220,
220,
220,
220,
220,
220,
371,
11,
48,
796,
374,
80,
7,
32,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
796,
43720,
77,
7,
3064,
8,
764,
10,
264,
198,
220,
220,
220,
220,
220,
220,
220,
275,
796,
43720,
77,
7,
3064,
11,
17,
8,
764,
10,
264,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
300,
76,
377,
0,
7,
48,
11,
4866,
7,
87,
4008,
15139,
230,
24936,
7,
48,
27493,
87,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
300,
76,
377,
0,
7,
48,
11,
4866,
7,
65,
4008,
15139,
230,
24936,
7,
48,
27493,
65,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
300,
76,
377,
0,
7,
48,
3256,
4866,
7,
87,
4008,
15139,
230,
24936,
7,
48,
33047,
9,
87,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
300,
76,
377,
0,
7,
48,
3256,
4866,
7,
65,
4008,
15139,
230,
24936,
7,
48,
33047,
9,
65,
198,
220,
220,
220,
220,
220,
220,
220,
269,
796,
43720,
77,
7,
17,
11,
3064,
8,
764,
10,
264,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
42721,
377,
0,
7,
30073,
7,
66,
828,
1195,
8,
15139,
230,
269,
9,
46912,
7,
48,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
42721,
377,
0,
7,
30073,
7,
66,
828,
1195,
11537,
15139,
230,
269,
9,
46912,
7,
48,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
317,
796,
43720,
77,
7,
15197,
11,
3064,
8,
764,
10,
264,
198,
220,
220,
220,
220,
220,
220,
220,
371,
11,
48,
796,
374,
80,
7,
32,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
796,
43720,
77,
7,
3064,
8,
764,
10,
264,
198,
220,
220,
220,
220,
220,
220,
220,
275,
796,
43720,
77,
7,
3064,
11,
17,
8,
764,
10,
264,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
300,
76,
377,
0,
7,
48,
11,
4866,
7,
87,
4008,
15139,
230,
24936,
7,
48,
27493,
87,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
300,
76,
377,
0,
7,
48,
11,
4866,
7,
65,
4008,
15139,
230,
24936,
7,
48,
27493,
65,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
300,
76,
377,
0,
7,
48,
3256,
4866,
7,
87,
4008,
15139,
230,
24936,
7,
48,
33047,
9,
87,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
300,
76,
377,
0,
7,
48,
3256,
4866,
7,
65,
4008,
15139,
230,
24936,
7,
48,
33047,
9,
65,
198,
220,
220,
220,
220,
220,
220,
220,
269,
796,
43720,
77,
7,
17,
11,
3064,
8,
764,
10,
264,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
42721,
377,
0,
7,
30073,
7,
66,
828,
1195,
8,
15139,
230,
269,
9,
46912,
7,
48,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
42721,
377,
0,
7,
30073,
7,
66,
828,
1195,
11537,
15139,
230,
269,
9,
46912,
7,
48,
11537,
198,
220,
220,
220,
886,
198,
437,
198
] | 1.640429 | 4,942 |
#-------------------------------------------------------------------
#* EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC.
#*
#* This LIBRARY is free software; you can distribute it and/or modify
#* it under the therms of the ALSOC FREE LICENSE as available at
#* http://www.enq.ufrgs.br/alsoc.
#*
#* EMSO Copyright (C) 2004 - 2007 ALSOC, original code
#* from http://www.rps.eng.br Copyright (C) 2002-2004.
#* All rights reserved.
#*
#* EMSO is distributed under the therms of the ALSOC LICENSE as
#* available at http://www.enq.ufrgs.br/alsoc.
#*
#*----------------------------------------------------------------------
#* Authors: Rafael de Pelegrini Soares
#* Andrey Copat, Estefane S. Horn, Marcos L. Alencastro
#* $Id$
#*--------------------------------------------------------------------
#Needs to be reformulated
type HidraulicTurbine
HidraulicTurbine()=begin
NComp=outers.NComp
PP=outers.PP
new(
DanaInteger(Dict{Symbol,Any}(
:Brief=>"Number of chemical components",
:Lower=>1
)),
DanaPlugin(Dict{Symbol,Any}(
:Brief=>"External Physical Properties",
:Type=>"PP"
)),
fill(molweight(Dict{Symbol,Any}(
:Brief=>"Molar Weight"
)),(NComp)),
efficiency(Dict{Symbol,Any}(
:Brief=>"Turbine efficiency"
)),
efficiency(Dict{Symbol,Any}(
:Brief=>"Brake efficiency"
)),
positive(Dict{Symbol,Any}(
:Brief=>"Volumetric expansivity",
:Unit=>"1/K"
)),
head(Dict{Symbol,Any}(
:Brief=>"Head Developed"
)),
power(Dict{Symbol,Any}(
:Brief=>"Fluid Power"
)),
power(Dict{Symbol,Any}(
:Brief=>"Brake Power"
)),
positive(Dict{Symbol,Any}(
:Brief=>"Pressure Ratio"
)),
press_delta(Dict{Symbol,Any}(
:Brief=>"Pressure Drop",
:DisplayUnit=>"kPa",
:Symbol=>"\\Delta P"
)),
molweight(Dict{Symbol,Any}(
:Brief=>"Mixture Molar Weight"
)),
dens_mass(Dict{Symbol,Any}(
:Brief=>"Specific Mass"
)),
cp_mol(Dict{Symbol,Any}(
:Brief=>"Heat Capacity"
)),
stream(Dict{Symbol,Any}(
:Brief=>"Inlet stream",
:PosX=>0.05,
:PosY=>0.0,
:Symbol=>"_{in}"
)),
stream(Dict{Symbol,Any}(
:Brief=>"Outlet stream",
:PosX=>0.65,
:PosY=>1,
:Symbol=>"_{out}"
)),
power(Dict{Symbol,Any}(
:Brief=>"Work Outlet",
:PosX=>1,
:PosY=>0.46
)),
[
:(Mwm = sum(Mw*Inlet.z)),
:(rho = PP.LiquidDensity(Inlet.T,Inlet.P,Inlet.z)),
:(Outlet.v = PP.VapourFraction(Outlet.T, Outlet.P, Outlet.z)),
:(Cp = PP.LiquidCp(Inlet.T,Inlet.P,Inlet.z)),
:(Outlet.P = Inlet.P * Pratio),
:(Outlet.P = Inlet.P - Pdrop),
:(FPower * rho = -Pdrop * Inlet.F * Mwm),
:(BPower = FPower * Eff),
:(BPower = WorkOut),
:((Outlet.T - Inlet.T) * rho * Cp = (Outlet.h - Inlet.h) * rho + Pdrop * Mwm * (1-Beta*Inlet.T)),
:((Outlet.h - Inlet.h) * rho = -Pdrop * Mwm),
:(Outlet.F = Inlet.F),
:(Outlet.z = Inlet.z),
:(Head = Outlet.h - Inlet.h),
],
[
"Calculate Mwm for Inlet Mixture","Calculate rho using a External Physical Properties Routine","Calculate Outlet Vapour Fraction","Calculate Cp Using a External Physical Properties Routine","Pressure Ratio","Pressure Drop","Calculate Fluid Power","Calculate Brake Power","","Calculate Outlet Temperature","Calculate Outlet Enthalpy","Molar Balance","Calculate Outlet Composition","Calculate Head",
],
[:NComp,:PP,:Mw,],
[:Eff,:Meff,:Beta,:Head,:FPower,:BPower,:Pratio,:Pdrop,:Mwm,:rho,:Cp,:Inlet,:Outlet,:WorkOut,]
)
end
NComp::DanaInteger
PP::DanaPlugin
Mw::Array{molweight}
Eff::efficiency
Meff::efficiency
Beta::positive
Head::head
FPower::power
BPower::power
Pratio::positive
Pdrop::press_delta
Mwm::molweight
rho::dens_mass
Cp::cp_mol
Inlet::stream
Outlet::stream
WorkOut::power
equations::Array{Expr,1}
equationNames::Array{String,1}
parameters::Array{Symbol,1}
variables::Array{Symbol,1}
attributes::Dict{Symbol,Any}
end
export HidraulicTurbine
function set(in::HidraulicTurbine)
Mw = PP.MolecularWeight()
end
function setEquationFlow(in::HidraulicTurbine)
#Mixtures Properties
addEquation(1)
addEquation(2)
addEquation(3)
addEquation(4)
addEquation(5)
addEquation(6)
addEquation(7)
addEquation(8)
addEquation(9)
addEquation(10)
addEquation(11)
addEquation(12)
addEquation(13)
addEquation(14)
end
function atributes(in::HidraulicTurbine,_::Dict{Symbol,Any})
fields::Dict{Symbol,Any}=Dict{Symbol,Any}()
fields[:Pallete]=true
fields[:Icon]="icon/HidraulicTurbine"
fields[:Brief]="Testing Model of a Hidraulic Turbine."
drive!(fields,_)
return fields
end
HidraulicTurbine(_::Dict{Symbol,Any})=begin
newModel=HidraulicTurbine()
newModel.attributes=atributes(newModel,_)
newModel
end
| [
2,
10097,
6329,
198,
2,
9,
41363,
46,
9104,
10074,
357,
3620,
43,
8,
15069,
357,
34,
8,
5472,
532,
4343,
27249,
4503,
13,
198,
2,
9,
198,
2,
9,
770,
45651,
49,
13153,
318,
1479,
3788,
26,
345,
460,
14983,
340,
290,
14,
273,
13096,
198,
2,
9,
340,
739,
262,
10811,
907,
286,
262,
27249,
4503,
17189,
38559,
24290,
355,
1695,
379,
198,
2,
9,
2638,
1378,
2503,
13,
268,
80,
13,
3046,
81,
14542,
13,
1671,
14,
874,
420,
13,
198,
2,
9,
198,
2,
9,
41363,
46,
15069,
357,
34,
8,
5472,
532,
4343,
27249,
4503,
11,
2656,
2438,
198,
2,
9,
422,
2638,
1378,
2503,
13,
81,
862,
13,
1516,
13,
1671,
15069,
357,
34,
8,
6244,
12,
15724,
13,
198,
2,
9,
1439,
2489,
10395,
13,
198,
2,
9,
198,
2,
9,
41363,
46,
318,
9387,
739,
262,
10811,
907,
286,
262,
27249,
4503,
38559,
24290,
355,
198,
2,
9,
1695,
379,
2638,
1378,
2503,
13,
268,
80,
13,
3046,
81,
14542,
13,
1671,
14,
874,
420,
13,
198,
2,
9,
198,
2,
9,
10097,
23031,
198,
2,
9,
46665,
25,
31918,
390,
2631,
1455,
81,
5362,
1406,
3565,
198,
2,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
843,
4364,
6955,
265,
11,
10062,
891,
1531,
311,
13,
13549,
11,
37033,
406,
13,
978,
268,
2701,
305,
198,
2,
9,
720,
7390,
3,
198,
2,
9,
10097,
650,
198,
2,
23037,
82,
284,
307,
4975,
4817,
198,
4906,
367,
312,
430,
28575,
51,
5945,
500,
198,
197,
39,
312,
430,
28575,
51,
5945,
500,
3419,
28,
27471,
198,
197,
197,
45,
7293,
28,
280,
1010,
13,
45,
7293,
198,
197,
197,
10246,
28,
280,
1010,
13,
10246,
198,
197,
197,
3605,
7,
198,
197,
197,
197,
35,
2271,
46541,
7,
35,
713,
90,
13940,
23650,
11,
7149,
92,
7,
198,
197,
197,
197,
197,
25,
33,
3796,
14804,
1,
15057,
286,
5931,
6805,
1600,
198,
197,
197,
197,
197,
25,
31426,
14804,
16,
198,
197,
197,
197,
36911,
198,
197,
197,
197,
35,
2271,
37233,
7,
35,
713,
90,
13940,
23650,
11,
7149,
92,
7,
198,
197,
197,
197,
197,
25,
33,
3796,
14804,
1,
41506,
16331,
24946,
1600,
198,
197,
197,
197,
197,
25,
6030,
14804,
1,
10246,
1,
198,
197,
197,
197,
36911,
198,
197,
197,
197,
20797,
7,
43132,
6551,
7,
35,
713,
90,
13940,
23650,
11,
7149,
92,
7,
198,
197,
197,
197,
197,
25,
33,
3796,
14804,
1,
44,
6192,
14331,
1,
198,
197,
197,
197,
36911,
7,
45,
7293,
36911,
198,
197,
197,
197,
45888,
7,
35,
713,
90,
13940,
23650,
11,
7149,
92,
7,
198,
197,
197,
197,
197,
25,
33,
3796,
14804,
1,
51,
5945,
500,
9332,
1,
198,
197,
197,
197,
36911,
198,
197,
197,
197,
45888,
7,
35,
713,
90,
13940,
23650,
11,
7149,
92,
7,
198,
197,
197,
197,
197,
25,
33,
3796,
14804,
1,
33,
33788,
9332,
1,
198,
197,
197,
197,
36911,
198,
197,
197,
197,
24561,
7,
35,
713,
90,
13940,
23650,
11,
7149,
92,
7,
198,
197,
197,
197,
197,
25,
33,
3796,
14804,
1,
16598,
388,
19482,
20628,
3458,
1600,
198,
197,
197,
197,
197,
25,
26453,
14804,
1,
16,
14,
42,
1,
198,
197,
197,
197,
36911,
198,
197,
197,
197,
2256,
7,
35,
713,
90,
13940,
23650,
11,
7149,
92,
7,
198,
197,
197,
197,
197,
25,
33,
3796,
14804,
1,
13847,
6013,
276,
1,
198,
197,
197,
197,
36911,
198,
197,
197,
197,
6477,
7,
35,
713,
90,
13940,
23650,
11,
7149,
92,
7,
198,
197,
197,
197,
197,
25,
33,
3796,
14804,
1,
37,
2290,
312,
4333,
1,
198,
197,
197,
197,
36911,
198,
197,
197,
197,
6477,
7,
35,
713,
90,
13940,
23650,
11,
7149,
92,
7,
198,
197,
197,
197,
197,
25,
33,
3796,
14804,
1,
33,
33788,
4333,
1,
198,
197,
197,
197,
36911,
198,
197,
197,
197,
24561,
7,
35,
713,
90,
13940,
23650,
11,
7149,
92,
7,
198,
197,
197,
197,
197,
25,
33,
3796,
14804,
1,
13800,
495,
33956,
1,
198,
197,
197,
197,
36911,
198,
197,
197,
197,
8439,
62,
67,
12514,
7,
35,
713,
90,
13940,
23650,
11,
7149,
92,
7,
198,
197,
197,
197,
197,
25,
33,
3796,
14804,
1,
13800,
495,
14258,
1600,
198,
197,
197,
197,
197,
25,
23114,
26453,
14804,
1,
74,
28875,
1600,
198,
197,
197,
197,
197,
25,
13940,
23650,
14804,
1,
6852,
42430,
350,
1,
198,
197,
197,
197,
36911,
198,
197,
197,
197,
43132,
6551,
7,
35,
713,
90,
13940,
23650,
11,
7149,
92,
7,
198,
197,
197,
197,
197,
25,
33,
3796,
14804,
1,
44,
9602,
337,
6192,
14331,
1,
198,
197,
197,
197,
36911,
198,
197,
197,
197,
67,
641,
62,
22208,
7,
35,
713,
90,
13940,
23650,
11,
7149,
92,
7,
198,
197,
197,
197,
197,
25,
33,
3796,
14804,
1,
32419,
5674,
1,
198,
197,
197,
197,
36911,
198,
197,
197,
197,
13155,
62,
43132,
7,
35,
713,
90,
13940,
23650,
11,
7149,
92,
7,
198,
197,
197,
197,
197,
25,
33,
3796,
14804,
1,
39596,
29765,
1,
198,
197,
197,
197,
36911,
198,
197,
197,
197,
5532,
7,
35,
713,
90,
13940,
23650,
11,
7149,
92,
7,
198,
197,
197,
197,
197,
25,
33,
3796,
14804,
1,
818,
1616,
4269,
1600,
198,
197,
197,
197,
197,
25,
21604,
55,
14804,
15,
13,
2713,
11,
198,
197,
197,
197,
197,
25,
21604,
56,
14804,
15,
13,
15,
11,
198,
197,
197,
197,
197,
25,
13940,
23650,
14804,
1,
23330,
259,
36786,
198,
197,
197,
197,
36911,
198,
197,
197,
197,
5532,
7,
35,
713,
90,
13940,
23650,
11,
7149,
92,
7,
198,
197,
197,
197,
197,
25,
33,
3796,
14804,
1,
7975,
1616,
4269,
1600,
198,
197,
197,
197,
197,
25,
21604,
55,
14804,
15,
13,
2996,
11,
198,
197,
197,
197,
197,
25,
21604,
56,
14804,
16,
11,
198,
197,
197,
197,
197,
25,
13940,
23650,
14804,
1,
23330,
448,
36786,
198,
197,
197,
197,
36911,
198,
197,
197,
197,
6477,
7,
35,
713,
90,
13940,
23650,
11,
7149,
92,
7,
198,
197,
197,
197,
197,
25,
33,
3796,
14804,
1,
12468,
3806,
1616,
1600,
198,
197,
197,
197,
197,
25,
21604,
55,
14804,
16,
11,
198,
197,
197,
197,
197,
25,
21604,
56,
14804,
15,
13,
3510,
198,
197,
197,
197,
36911,
198,
197,
197,
197,
58,
198,
197,
197,
197,
197,
37498,
44,
26377,
796,
2160,
7,
44,
86,
9,
818,
1616,
13,
89,
36911,
198,
197,
197,
197,
197,
37498,
81,
8873,
796,
21082,
13,
41966,
35,
6377,
7,
818,
1616,
13,
51,
11,
818,
1616,
13,
47,
11,
818,
1616,
13,
89,
36911,
198,
197,
197,
197,
197,
37498,
7975,
1616,
13,
85,
796,
21082,
13,
53,
499,
454,
37,
7861,
7,
7975,
1616,
13,
51,
11,
3806,
1616,
13,
47,
11,
3806,
1616,
13,
89,
36911,
198,
197,
197,
197,
197,
37498,
34,
79,
796,
21082,
13,
41966,
34,
79,
7,
818,
1616,
13,
51,
11,
818,
1616,
13,
47,
11,
818,
1616,
13,
89,
36911,
198,
197,
197,
197,
197,
37498,
7975,
1616,
13,
47,
796,
554,
1616,
13,
47,
1635,
1736,
39485,
828,
198,
197,
197,
197,
197,
37498,
7975,
1616,
13,
47,
796,
554,
1616,
13,
47,
532,
350,
14781,
828,
198,
197,
197,
197,
197,
37498,
5837,
789,
1635,
374,
8873,
796,
532,
47,
14781,
1635,
554,
1616,
13,
37,
1635,
337,
26377,
828,
198,
197,
197,
197,
197,
37498,
33,
13434,
796,
376,
13434,
1635,
27848,
828,
198,
197,
197,
197,
197,
37498,
33,
13434,
796,
5521,
7975,
828,
198,
197,
197,
197,
197,
25,
19510,
7975,
1616,
13,
51,
532,
554,
1616,
13,
51,
8,
1635,
374,
8873,
1635,
327,
79,
796,
357,
7975,
1616,
13,
71,
532,
554,
1616,
13,
71,
8,
1635,
374,
8873,
1343,
350,
14781,
1635,
337,
26377,
1635,
357,
16,
12,
43303,
9,
818,
1616,
13,
51,
36911,
198,
197,
197,
197,
197,
25,
19510,
7975,
1616,
13,
71,
532,
554,
1616,
13,
71,
8,
1635,
374,
8873,
796,
532,
47,
14781,
1635,
337,
26377,
828,
198,
197,
197,
197,
197,
37498,
7975,
1616,
13,
37,
796,
554,
1616,
13,
37,
828,
198,
197,
197,
197,
197,
37498,
7975,
1616,
13,
89,
796,
554,
1616,
13,
89,
828,
198,
197,
197,
197,
197,
37498,
13847,
796,
3806,
1616,
13,
71,
532,
554,
1616,
13,
71,
828,
198,
197,
197,
197,
4357,
198,
197,
197,
197,
58,
198,
197,
197,
197,
197,
1,
9771,
3129,
378,
337,
26377,
329,
554,
1616,
337,
9602,
2430,
9771,
3129,
378,
374,
8873,
1262,
257,
34579,
16331,
24946,
371,
28399,
2430,
9771,
3129,
378,
3806,
1616,
569,
499,
454,
376,
7861,
2430,
9771,
3129,
378,
327,
79,
8554,
257,
34579,
16331,
24946,
371,
28399,
2430,
13800,
495,
33956,
2430,
13800,
495,
14258,
2430,
9771,
3129,
378,
1610,
27112,
4333,
2430,
9771,
3129,
378,
9718,
365,
4333,
2430,
2430,
9771,
3129,
378,
3806,
1616,
34467,
2430,
9771,
3129,
378,
3806,
1616,
2039,
11669,
9078,
2430,
44,
6192,
22924,
2430,
9771,
3129,
378,
3806,
1616,
955,
9150,
2430,
9771,
3129,
378,
7123,
1600,
198,
197,
197,
197,
4357,
198,
197,
197,
197,
58,
25,
45,
7293,
11,
25,
10246,
11,
25,
44,
86,
11,
4357,
198,
197,
197,
197,
58,
25,
36,
487,
11,
25,
5308,
487,
11,
25,
43303,
11,
25,
13847,
11,
25,
5837,
789,
11,
25,
33,
13434,
11,
25,
6836,
39485,
11,
25,
47,
14781,
11,
25,
44,
26377,
11,
25,
81,
8873,
11,
25,
34,
79,
11,
25,
818,
1616,
11,
25,
7975,
1616,
11,
25,
12468,
7975,
11,
60,
198,
197,
197,
8,
198,
197,
437,
198,
197,
45,
7293,
3712,
35,
2271,
46541,
198,
197,
10246,
3712,
35,
2271,
37233,
198,
197,
44,
86,
3712,
19182,
90,
43132,
6551,
92,
198,
197,
36,
487,
3712,
45888,
198,
197,
5308,
487,
3712,
45888,
198,
197,
43303,
3712,
24561,
198,
197,
13847,
3712,
2256,
198,
197,
5837,
789,
3712,
6477,
198,
197,
33,
13434,
3712,
6477,
198,
197,
6836,
39485,
3712,
24561,
198,
197,
47,
14781,
3712,
8439,
62,
67,
12514,
198,
197,
44,
26377,
3712,
43132,
6551,
198,
197,
81,
8873,
3712,
67,
641,
62,
22208,
198,
197,
34,
79,
3712,
13155,
62,
43132,
198,
197,
818,
1616,
3712,
5532,
198,
197,
7975,
1616,
3712,
5532,
198,
197,
12468,
7975,
3712,
6477,
198,
197,
4853,
602,
3712,
19182,
90,
3109,
1050,
11,
16,
92,
198,
197,
4853,
341,
36690,
3712,
19182,
90,
10100,
11,
16,
92,
198,
197,
17143,
7307,
3712,
19182,
90,
13940,
23650,
11,
16,
92,
198,
197,
25641,
2977,
3712,
19182,
90,
13940,
23650,
11,
16,
92,
198,
197,
1078,
7657,
3712,
35,
713,
90,
13940,
23650,
11,
7149,
92,
198,
437,
198,
39344,
367,
312,
430,
28575,
51,
5945,
500,
198,
8818,
900,
7,
259,
3712,
39,
312,
430,
28575,
51,
5945,
500,
8,
198,
197,
44,
86,
796,
21082,
13,
44,
2305,
10440,
25844,
3419,
198,
197,
220,
198,
437,
198,
8818,
900,
23588,
341,
37535,
7,
259,
3712,
39,
312,
430,
28575,
51,
5945,
500,
8,
198,
197,
2,
44,
25506,
24946,
198,
197,
2860,
23588,
341,
7,
16,
8,
198,
197,
2860,
23588,
341,
7,
17,
8,
198,
197,
2860,
23588,
341,
7,
18,
8,
198,
197,
2860,
23588,
341,
7,
19,
8,
198,
197,
2860,
23588,
341,
7,
20,
8,
198,
197,
2860,
23588,
341,
7,
21,
8,
198,
197,
2860,
23588,
341,
7,
22,
8,
198,
197,
2860,
23588,
341,
7,
23,
8,
198,
197,
2860,
23588,
341,
7,
24,
8,
198,
197,
2860,
23588,
341,
7,
940,
8,
198,
197,
2860,
23588,
341,
7,
1157,
8,
198,
197,
2860,
23588,
341,
7,
1065,
8,
198,
197,
2860,
23588,
341,
7,
1485,
8,
198,
197,
2860,
23588,
341,
7,
1415,
8,
198,
437,
198,
8818,
379,
7657,
7,
259,
3712,
39,
312,
430,
28575,
51,
5945,
500,
11,
62,
3712,
35,
713,
90,
13940,
23650,
11,
7149,
30072,
198,
197,
25747,
3712,
35,
713,
90,
13940,
23650,
11,
7149,
92,
28,
35,
713,
90,
13940,
23650,
11,
7149,
92,
3419,
198,
197,
25747,
58,
25,
11531,
5807,
22241,
7942,
198,
197,
25747,
58,
25,
19578,
60,
2625,
4749,
14,
39,
312,
430,
28575,
51,
5945,
500,
1,
198,
197,
25747,
58,
25,
33,
3796,
60,
2625,
44154,
9104,
286,
257,
367,
312,
430,
28575,
3831,
65,
500,
526,
198,
197,
19472,
0,
7,
25747,
11,
62,
8,
198,
197,
7783,
7032,
198,
437,
198,
39,
312,
430,
28575,
51,
5945,
500,
28264,
3712,
35,
713,
90,
13940,
23650,
11,
7149,
30072,
28,
27471,
198,
197,
3605,
17633,
28,
39,
312,
430,
28575,
51,
5945,
500,
3419,
198,
197,
3605,
17633,
13,
1078,
7657,
28,
265,
7657,
7,
3605,
17633,
11,
62,
8,
198,
197,
3605,
17633,
198,
437,
198
] | 2.221856 | 2,123 |
module TestExpressionsTVL
import Test: @testset, @test
import Volcanito: tvl, @tvl
@testset "TVL || truth table" begin
@test @tvl(true || true) === true
@test @tvl(true || false) === true
@test @tvl(true || missing) === true
@test @tvl(false || true) === true
@test @tvl(false || false) === false
@test @tvl(false || missing) === missing
@test @tvl(missing || true) === true
@test @tvl(missing || false) === missing
@test @tvl(missing || missing) === missing
end
@testset "TVL && truth table" begin
@test @tvl(true && true) === true
@test @tvl(true && false) === false
@test @tvl(true && missing) === missing
@test @tvl(false && true) === false
@test @tvl(false && false) === false
@test @tvl(false && missing) === false
@test @tvl(missing && true) === missing
@test @tvl(missing && false) === false
@test @tvl(missing && missing) === missing
end
# We define a function that prints out a unique ID for each argument
# to a Boolean operator. By wrapping all Boolean values in calls to this
# function, we're able to check that the order of evaluation and
# side-effects of the short-circuiting operators are retained by our
# macro rewrites.
function f(io, i, x)
print(io, i)
x
end
@testset "Order of evaluation for tvl" begin
for x in (true, false)
for y in (true, false)
for z in (true, false)
io = IOBuffer()
a = f(io, 1, x) && f(io, 2, y) || f(io, 3, z)
order_a = String(take!(io))
b = @tvl f(io, 1, x) && f(io, 2, y) || f(io, 3, z)
order_b = String(take!(io))
@test a === b
@test order_a === order_b
a = f(io, 1, x) || f(io, 2, y) && f(io, 3, z)
order_a = String(take!(io))
b = @tvl f(io, 1, x) || f(io, 2, y) && f(io, 3, z)
order_b = String(take!(io))
@test a === b
@test order_a === order_b
end
end
end
end
@testset "@tvl with local variables" begin
let x = 1, y = 2
@test (@tvl x > 1 || y < 2) === false
end
end
end
| [
21412,
6208,
38839,
507,
6849,
43,
198,
198,
11748,
6208,
25,
2488,
9288,
2617,
11,
2488,
9288,
198,
11748,
4709,
5171,
10094,
25,
256,
19279,
11,
2488,
14981,
75,
198,
198,
31,
9288,
2617,
366,
6849,
43,
8614,
3872,
3084,
1,
2221,
198,
220,
220,
220,
2488,
9288,
2488,
14981,
75,
7,
7942,
8614,
2081,
8,
24844,
2081,
198,
220,
220,
220,
2488,
9288,
2488,
14981,
75,
7,
7942,
8614,
3991,
8,
24844,
2081,
198,
220,
220,
220,
2488,
9288,
2488,
14981,
75,
7,
7942,
8614,
4814,
8,
24844,
2081,
198,
220,
220,
220,
2488,
9288,
2488,
14981,
75,
7,
9562,
8614,
2081,
8,
24844,
2081,
198,
220,
220,
220,
2488,
9288,
2488,
14981,
75,
7,
9562,
8614,
3991,
8,
24844,
3991,
198,
220,
220,
220,
2488,
9288,
2488,
14981,
75,
7,
9562,
8614,
4814,
8,
24844,
4814,
198,
220,
220,
220,
2488,
9288,
2488,
14981,
75,
7,
45688,
8614,
2081,
8,
24844,
2081,
198,
220,
220,
220,
2488,
9288,
2488,
14981,
75,
7,
45688,
8614,
3991,
8,
24844,
4814,
198,
220,
220,
220,
2488,
9288,
2488,
14981,
75,
7,
45688,
8614,
4814,
8,
24844,
4814,
198,
437,
198,
198,
31,
9288,
2617,
366,
6849,
43,
11405,
3872,
3084,
1,
2221,
198,
220,
220,
220,
2488,
9288,
2488,
14981,
75,
7,
7942,
11405,
2081,
8,
24844,
2081,
198,
220,
220,
220,
2488,
9288,
2488,
14981,
75,
7,
7942,
11405,
3991,
8,
24844,
3991,
198,
220,
220,
220,
2488,
9288,
2488,
14981,
75,
7,
7942,
11405,
4814,
8,
24844,
4814,
198,
220,
220,
220,
2488,
9288,
2488,
14981,
75,
7,
9562,
11405,
2081,
8,
24844,
3991,
198,
220,
220,
220,
2488,
9288,
2488,
14981,
75,
7,
9562,
11405,
3991,
8,
24844,
3991,
198,
220,
220,
220,
2488,
9288,
2488,
14981,
75,
7,
9562,
11405,
4814,
8,
24844,
3991,
198,
220,
220,
220,
2488,
9288,
2488,
14981,
75,
7,
45688,
11405,
2081,
8,
24844,
4814,
198,
220,
220,
220,
2488,
9288,
2488,
14981,
75,
7,
45688,
11405,
3991,
8,
24844,
3991,
198,
220,
220,
220,
2488,
9288,
2488,
14981,
75,
7,
45688,
11405,
4814,
8,
24844,
4814,
198,
437,
198,
198,
2,
775,
8160,
257,
2163,
326,
20842,
503,
257,
3748,
4522,
329,
1123,
4578,
198,
2,
284,
257,
41146,
10088,
13,
2750,
27074,
477,
41146,
3815,
287,
3848,
284,
428,
198,
2,
2163,
11,
356,
821,
1498,
284,
2198,
326,
262,
1502,
286,
12660,
290,
198,
2,
1735,
12,
34435,
286,
262,
1790,
12,
21170,
84,
1780,
12879,
389,
17383,
416,
674,
198,
2,
15021,
302,
8933,
274,
13,
198,
198,
8818,
277,
7,
952,
11,
1312,
11,
2124,
8,
198,
220,
220,
220,
3601,
7,
952,
11,
1312,
8,
198,
220,
220,
220,
2124,
198,
437,
198,
198,
31,
9288,
2617,
366,
18743,
286,
12660,
329,
256,
19279,
1,
2221,
198,
220,
220,
220,
329,
2124,
287,
357,
7942,
11,
3991,
8,
198,
220,
220,
220,
220,
220,
220,
220,
329,
331,
287,
357,
7942,
11,
3991,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1976,
287,
357,
7942,
11,
3991,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
796,
314,
9864,
13712,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
257,
796,
277,
7,
952,
11,
352,
11,
2124,
8,
11405,
277,
7,
952,
11,
362,
11,
331,
8,
8614,
277,
7,
952,
11,
513,
11,
1976,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1502,
62,
64,
796,
10903,
7,
20657,
0,
7,
952,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
796,
2488,
14981,
75,
277,
7,
952,
11,
352,
11,
2124,
8,
11405,
277,
7,
952,
11,
362,
11,
331,
8,
8614,
277,
7,
952,
11,
513,
11,
1976,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1502,
62,
65,
796,
10903,
7,
20657,
0,
7,
952,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
257,
24844,
275,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1502,
62,
64,
24844,
1502,
62,
65,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
257,
796,
277,
7,
952,
11,
352,
11,
2124,
8,
8614,
277,
7,
952,
11,
362,
11,
331,
8,
11405,
277,
7,
952,
11,
513,
11,
1976,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1502,
62,
64,
796,
10903,
7,
20657,
0,
7,
952,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
796,
2488,
14981,
75,
277,
7,
952,
11,
352,
11,
2124,
8,
8614,
277,
7,
952,
11,
362,
11,
331,
8,
11405,
277,
7,
952,
11,
513,
11,
1976,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1502,
62,
65,
796,
10903,
7,
20657,
0,
7,
952,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
257,
24844,
275,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1502,
62,
64,
24844,
1502,
62,
65,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
437,
198,
198,
31,
9288,
2617,
44212,
14981,
75,
351,
1957,
9633,
1,
2221,
198,
220,
220,
220,
1309,
2124,
796,
352,
11,
331,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
4275,
14981,
75,
2124,
1875,
352,
8614,
331,
1279,
362,
8,
24844,
3991,
198,
220,
220,
220,
886,
198,
437,
198,
198,
437,
198
] | 2.187 | 1,000 |
module DoublyPeriodicTaylorGreen
using Printf
using Oceananigans, Oceananigans.OutputWriters
# Advected vortex: ψ(x, y, t) = exp(-2t) * cos(x - U*t) * cos(y)
u(x, y, t, U=1) = U + exp(-2t) * cos(x - U*t) * sin(y)
v(x, y, t, U=1) = - exp(-2t) * sin(x - U*t) * cos(y)
#####
##### x, y
#####
function setup_simulation(; Nx, Δt, stop_iteration, U=1, architecture=CPU(), dir="data")
grid = RegularCartesianGrid(size=(Nx, Nx, 1), x=(0, 2π), y=(0, 2π), z=(0, 1),
topology=(Periodic, Periodic, Bounded))
model = IncompressibleModel(architecture = architecture,
grid = grid,
coriolis = nothing,
buoyancy = nothing,
tracers = nothing,
closure = ConstantIsotropicDiffusivity(ν=1))
set!(model, u = (x, y, z) -> u(x, y, 0, U),
v = (x, y, z) -> v(x, y, 0, U))
simulation = Simulation(model, Δt=Δt, stop_iteration=stop_iteration, progress_frequency=stop_iteration)
simulation.output_writers[:fields] = JLD2OutputWriter(model, FieldOutputs(model.velocities);
dir = dir, force = true,
prefix = @sprintf("taylor_green_Nx%d_Δt%.1e", Nx, Δt),
interval = stop_iteration * Δt / 10)
return simulation
end
function setup_and_run(; setup...)
simulation = setup_simulation(; setup...)
println("""
Running decaying Taylor-Green vortex simulation in x, y with
Nx = $(setup[:Nx])
Δt = $(setup[:Δt])
""")
@time run!(simulation)
return nothing
end
end # module
| [
21412,
5728,
36874,
5990,
2101,
291,
29907,
13719,
198,
198,
3500,
12578,
69,
198,
198,
3500,
10692,
272,
34090,
11,
10692,
272,
34090,
13,
26410,
20257,
364,
198,
198,
2,
1215,
303,
310,
276,
42726,
25,
18074,
230,
7,
87,
11,
331,
11,
256,
8,
796,
1033,
32590,
17,
83,
8,
1635,
8615,
7,
87,
532,
471,
9,
83,
8,
1635,
8615,
7,
88,
8,
198,
84,
7,
87,
11,
331,
11,
256,
11,
471,
28,
16,
8,
796,
471,
1343,
1033,
32590,
17,
83,
8,
1635,
8615,
7,
87,
532,
471,
9,
83,
8,
1635,
7813,
7,
88,
8,
198,
85,
7,
87,
11,
331,
11,
256,
11,
471,
28,
16,
8,
796,
220,
220,
532,
1033,
32590,
17,
83,
8,
1635,
7813,
7,
87,
532,
471,
9,
83,
8,
1635,
8615,
7,
88,
8,
198,
198,
4242,
2,
198,
4242,
2,
2124,
11,
331,
198,
4242,
2,
198,
198,
8818,
9058,
62,
14323,
1741,
7,
26,
399,
87,
11,
37455,
83,
11,
2245,
62,
2676,
341,
11,
471,
28,
16,
11,
10959,
28,
36037,
22784,
26672,
2625,
7890,
4943,
628,
220,
220,
220,
10706,
796,
23603,
43476,
35610,
41339,
7,
7857,
16193,
45,
87,
11,
399,
87,
11,
352,
828,
2124,
16193,
15,
11,
362,
46582,
828,
331,
16193,
15,
11,
362,
46582,
828,
1976,
16193,
15,
11,
352,
828,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1353,
1435,
16193,
5990,
2101,
291,
11,
18581,
291,
11,
347,
6302,
4008,
628,
220,
220,
220,
2746,
796,
554,
5589,
601,
856,
17633,
7,
998,
5712,
495,
796,
10959,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10706,
796,
10706,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1162,
1669,
271,
796,
2147,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
36675,
3883,
796,
2147,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
491,
49908,
796,
2147,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16512,
796,
20217,
3792,
46084,
28813,
385,
3458,
7,
26180,
28,
16,
4008,
628,
220,
220,
220,
900,
0,
7,
19849,
11,
334,
796,
357,
87,
11,
331,
11,
1976,
8,
4613,
334,
7,
87,
11,
331,
11,
657,
11,
471,
828,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
796,
357,
87,
11,
331,
11,
1976,
8,
4613,
410,
7,
87,
11,
331,
11,
657,
11,
471,
4008,
628,
220,
220,
220,
18640,
796,
41798,
7,
19849,
11,
37455,
83,
28,
138,
242,
83,
11,
2245,
62,
2676,
341,
28,
11338,
62,
2676,
341,
11,
4371,
62,
35324,
28,
11338,
62,
2676,
341,
8,
628,
220,
220,
220,
18640,
13,
22915,
62,
34422,
58,
25,
25747,
60,
796,
449,
11163,
17,
26410,
34379,
7,
19849,
11,
7663,
26410,
82,
7,
19849,
13,
626,
420,
871,
1776,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26672,
796,
26672,
11,
2700,
796,
2081,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21231,
796,
2488,
82,
37435,
7203,
83,
7167,
62,
14809,
62,
45,
87,
4,
67,
62,
138,
242,
83,
7225,
16,
68,
1600,
399,
87,
11,
37455,
83,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16654,
796,
2245,
62,
2676,
341,
1635,
37455,
83,
1220,
838,
8,
628,
220,
220,
220,
1441,
18640,
198,
437,
198,
198,
8818,
9058,
62,
392,
62,
5143,
7,
26,
9058,
23029,
628,
220,
220,
220,
18640,
796,
9058,
62,
14323,
1741,
7,
26,
9058,
23029,
628,
220,
220,
220,
44872,
7203,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18162,
49240,
8121,
12,
13719,
42726,
18640,
287,
2124,
11,
331,
351,
220,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
399,
87,
796,
29568,
40406,
58,
25,
45,
87,
12962,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37455,
83,
796,
29568,
40406,
58,
25,
138,
242,
83,
12962,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13538,
4943,
628,
220,
220,
220,
2488,
2435,
1057,
0,
7,
14323,
1741,
8,
198,
220,
220,
220,
1441,
2147,
198,
437,
198,
198,
437,
1303,
8265,
198
] | 1.817204 | 1,023 |
#=
Log-likelihood for ODEs, integrating along the tree
using flow algorithm
Ignacio Quintero Mächler
t(-_-t)
Created 23 10 2019
=#
"""
make_Et(Et::Function,
p0::Array{Float64,1},
u0::Array{Float64,1},
ts::Array{Float64,1},
ti::Float64,
Make Extinction through time, `E(t)`.
"""
function make_Et(Et::Function,
p0::Array{Float64,1},
u0::Array{Float64,1},
ts::Array{Float64,1},
ti::Float64,
tf::Float64)
prob = ODEProblem(Et, u0, (ti,tf), p0)
int = init(prob,
Tsit5(),
saveat = ts,
save_everystep = false,
calck = false,
force_dtmin = true,
save_start = true,
initialize_save = false,
maxiters = 100_000_000,
verbose = false)
function f(p::Array{Float64,1})
int.p = p
reinit!(int)
solve!(int).u::Array{Array{Float64,1},1}
end
return f
end
"""
make_Gt(At::Function,
p0::Array{Array{Float64,1},1},
u0::Array{Float64,2},
ts::Array{Float64,1},
ti::Float64,
tf::Float64)
Make flow equation for likelihoods through time, `G(t)`.
"""
function make_Gt(At::Function,
p0::Array{Array{Float64,1},1},
u0::Array{Float64,2},
ts::Array{Float64,1},
ti::Float64,
tf::Float64)
prob = ODEProblem(At, u0, (ti,tf), p0)
int = init(prob,
Tsit5(),
saveat = ts,
save_everystep = false,
calck = false,
force_dtmin = true,
save_start = true,
initialize_save = false,
maxiters = 100_000_000,
verbose = false)
function f(p::Array{Array{Float64,1},1})
int.p = p
reinit!(int)
solve!(int).u::Array{Array{Float64,2},1}
end
return f
end
"""
make_loglik(Gt ::Function,
Et ::Function,
X ::Array{Array{Float64,1},1},
triads ::Array{Array{Int64,1},1},
lbts ::Array{Int64,2},
bts ::Array{Float64,1},
ns ::Int64,
ned ::Int64,
nets ::Int64,
ntip ::Int64,
λevent!::Function,
rootll ::Function)
Make log-likelihood function using the flow algorithm.
"""
function make_loglik(Gt ::Function,
Et ::Function,
X ::Array{Array{Float64,1},1},
triads ::Array{Array{Int64,1},1},
lbts ::Array{Int64,2},
bts ::Array{Float64,1},
ns ::Int64,
ned ::Int64,
nets ::Int64,
λevent!::Function,
rootll ::Function)
# preallocate arrays
X0 = Array{Float64,1}(undef,ns)
Xp1 = Array{Float64,1}(undef,ns)
Xp2 = Array{Float64,1}(undef,ns)
Xr = Array{Float64,1}(undef,ns)
wg = Array{Float64,1}(undef,ns)
Er = Array{Float64,1}(undef,ns)
rtime = bts[end]
netsm1 = nets - 1
nbts = length(bts)
# start ll function for parameters
function f(p::Array{Float64,1})
@inbounds begin
Ets = Et(p)
# push parameters as the last vector in Ets
push!(Ets, p)
# estimate `Gts` according to `Ets` and `p`
Gts = Gt(Ets)
ll = 0.0
if rank(Gts[nbts]) == ns
for i in Base.OneTo(nbts)
if rank(Gts[i]) != ns
@show Gts[nbts]
@show Gts[i]
end
end
for trio in triads
pr, d1, d2 = trio
## first daughter
X0 = Gts[lbts[d1,2]]\X[d1]
mul!(Xp1, Gts[lbts[d1,1]], X0)
check_negs(Xp1, ns) && return -Inf
## second daughter
X0 = Gts[lbts[d2,2]]\X[d2]
mul!(Xp2, Gts[lbts[d2,1]], X0)
check_negs(Xp2, ns) && return -Inf
λtime = bts[lbts[d1,1]]
λevent!(λtime, X, Xp1, Xp2, p, pr)
if pr != ned
mdlus = sum(X[pr])
X[pr] /= mdlus
ll += log(mdlus)
end
end
else
for trio in triads
pr, d1, d2 = trio
## first daughter
ldiv!(X0, qr!(Gts[lbts[d1,2]], Val(true)), X[d1])
mul!(Xp1, Gts[lbts[d1,1]], X0)
check_negs(Xp1, ns) && return -Inf
## second daughter
ldiv!(X0, qr!(Gts[lbts[d2,2]], Val(true)), X[d2])
mul!(Xp2, Gts[lbts[d2,1]], X0)
check_negs(Xp2, ns) && return -Inf
λtime = bts[lbts[d1,1]]
λevent!(λtime, X, Xp1, Xp2, p, pr)
if pr != ned
mdlus = sum(X[pr])
X[pr] /= mdlus
ll += log(mdlus)
end
end
end
# assign root likelihoods
@simd for i in Base.OneTo(ns)
Xr[i] = X[ned][i]
end
# assign root extinction
@simd for i in Base.OneTo(ns)
Er[i] = Ets[netsm1][i]
end
# estimate weights
normbysum!(Xr, wg, ns)
ll += log(rootll(rtime, Xr, Er, wg, p)::Float64)
end
return ll
end
return f
end
| [
2,
28,
198,
198,
11187,
12,
2339,
11935,
329,
440,
7206,
82,
11,
32029,
1863,
262,
5509,
198,
3500,
5202,
11862,
198,
198,
32916,
48711,
2264,
3849,
78,
337,
11033,
354,
1754,
198,
198,
83,
32590,
22955,
83,
8,
198,
198,
41972,
2242,
838,
13130,
198,
198,
46249,
628,
628,
198,
198,
37811,
198,
220,
220,
220,
787,
62,
36,
83,
7,
36,
83,
3712,
22203,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
279,
15,
3712,
19182,
90,
43879,
2414,
11,
16,
5512,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
15,
3712,
19182,
90,
43879,
2414,
11,
16,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
40379,
3712,
19182,
90,
43879,
2414,
11,
16,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
46668,
3712,
43879,
2414,
11,
198,
198,
12050,
5683,
9438,
832,
640,
11,
4600,
36,
7,
83,
8,
44646,
198,
37811,
198,
8818,
787,
62,
36,
83,
7,
36,
83,
3712,
22203,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
279,
15,
3712,
19182,
90,
43879,
2414,
11,
16,
5512,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
15,
3712,
19182,
90,
43879,
2414,
11,
16,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
40379,
3712,
19182,
90,
43879,
2414,
11,
16,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
46668,
3712,
43879,
2414,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
48700,
3712,
43879,
2414,
8,
628,
220,
1861,
796,
440,
7206,
40781,
7,
36,
83,
11,
334,
15,
11,
357,
20259,
11,
27110,
828,
279,
15,
8,
628,
220,
493,
796,
2315,
7,
1676,
65,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13146,
270,
20,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3613,
265,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
40379,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3613,
62,
16833,
9662,
220,
796,
3991,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2386,
694,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
3991,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2700,
62,
28664,
1084,
220,
220,
220,
220,
796,
2081,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3613,
62,
9688,
220,
220,
220,
220,
220,
796,
2081,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41216,
62,
21928,
796,
3991,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3509,
270,
364,
220,
220,
220,
220,
220,
220,
220,
796,
1802,
62,
830,
62,
830,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15942,
577,
220,
220,
220,
220,
220,
220,
220,
220,
796,
3991,
8,
628,
220,
2163,
277,
7,
79,
3712,
19182,
90,
43879,
2414,
11,
16,
30072,
198,
220,
220,
220,
493,
13,
79,
796,
279,
198,
220,
220,
220,
6865,
270,
0,
7,
600,
8,
198,
220,
220,
220,
8494,
0,
7,
600,
737,
84,
3712,
19182,
90,
19182,
90,
43879,
2414,
11,
16,
5512,
16,
92,
198,
220,
886,
628,
220,
1441,
277,
198,
437,
628,
628,
198,
198,
37811,
198,
220,
220,
220,
787,
62,
38,
83,
7,
2953,
3712,
22203,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
279,
15,
3712,
19182,
90,
19182,
90,
43879,
2414,
11,
16,
5512,
16,
5512,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
15,
3712,
19182,
90,
43879,
2414,
11,
17,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
40379,
3712,
19182,
90,
43879,
2414,
11,
16,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
46668,
3712,
43879,
2414,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
48700,
3712,
43879,
2414,
8,
198,
198,
12050,
5202,
16022,
329,
14955,
82,
832,
640,
11,
4600,
38,
7,
83,
8,
44646,
198,
37811,
198,
8818,
787,
62,
38,
83,
7,
2953,
3712,
22203,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
279,
15,
3712,
19182,
90,
19182,
90,
43879,
2414,
11,
16,
5512,
16,
5512,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
15,
3712,
19182,
90,
43879,
2414,
11,
17,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
40379,
3712,
19182,
90,
43879,
2414,
11,
16,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
46668,
3712,
43879,
2414,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
48700,
3712,
43879,
2414,
8,
628,
220,
1861,
796,
440,
7206,
40781,
7,
2953,
11,
334,
15,
11,
357,
20259,
11,
27110,
828,
279,
15,
8,
628,
220,
493,
796,
2315,
7,
1676,
65,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13146,
270,
20,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3613,
265,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
40379,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3613,
62,
16833,
9662,
220,
796,
3991,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2386,
694,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
3991,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2700,
62,
28664,
1084,
220,
220,
220,
220,
796,
2081,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3613,
62,
9688,
220,
220,
220,
220,
220,
796,
2081,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41216,
62,
21928,
796,
3991,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3509,
270,
364,
220,
220,
220,
220,
220,
220,
220,
796,
1802,
62,
830,
62,
830,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15942,
577,
220,
220,
220,
220,
220,
220,
220,
220,
796,
3991,
8,
628,
220,
2163,
277,
7,
79,
3712,
19182,
90,
19182,
90,
43879,
2414,
11,
16,
5512,
16,
30072,
198,
220,
220,
220,
493,
13,
79,
796,
279,
198,
220,
220,
220,
6865,
270,
0,
7,
600,
8,
198,
220,
220,
220,
8494,
0,
7,
600,
737,
84,
3712,
19182,
90,
19182,
90,
43879,
2414,
11,
17,
5512,
16,
92,
198,
220,
886,
628,
220,
1441,
277,
198,
437,
628,
628,
198,
198,
37811,
198,
220,
220,
220,
787,
62,
6404,
46965,
7,
38,
83,
220,
220,
220,
220,
7904,
22203,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17906,
220,
220,
220,
220,
7904,
22203,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1395,
220,
220,
220,
220,
220,
7904,
19182,
90,
19182,
90,
43879,
2414,
11,
16,
5512,
16,
5512,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1333,
5643,
7904,
19182,
90,
19182,
90,
5317,
2414,
11,
16,
5512,
16,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18360,
912,
220,
220,
7904,
19182,
90,
5317,
2414,
11,
17,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
912,
220,
220,
220,
7904,
19182,
90,
43879,
2414,
11,
16,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
36545,
220,
220,
220,
220,
7904,
5317,
2414,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
276,
220,
220,
220,
7904,
5317,
2414,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31720,
220,
220,
7904,
5317,
2414,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
22504,
220,
220,
7904,
5317,
2414,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7377,
119,
15596,
0,
3712,
22203,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6808,
297,
7904,
22203,
8,
628,
198,
12050,
2604,
12,
2339,
11935,
2163,
1262,
262,
5202,
11862,
13,
198,
37811,
198,
8818,
787,
62,
6404,
46965,
7,
38,
83,
220,
220,
220,
220,
7904,
22203,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17906,
220,
220,
220,
220,
7904,
22203,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1395,
220,
220,
220,
220,
220,
7904,
19182,
90,
19182,
90,
43879,
2414,
11,
16,
5512,
16,
5512,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1333,
5643,
7904,
19182,
90,
19182,
90,
5317,
2414,
11,
16,
5512,
16,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18360,
912,
220,
220,
7904,
19182,
90,
5317,
2414,
11,
17,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
912,
220,
220,
220,
7904,
19182,
90,
43879,
2414,
11,
16,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
36545,
220,
220,
220,
220,
7904,
5317,
2414,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
276,
220,
220,
220,
7904,
5317,
2414,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31720,
220,
220,
7904,
5317,
2414,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7377,
119,
15596,
0,
3712,
22203,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6808,
297,
7904,
22203,
8,
628,
220,
1303,
662,
439,
13369,
26515,
198,
220,
1395,
15,
220,
796,
15690,
90,
43879,
2414,
11,
16,
92,
7,
917,
891,
11,
5907,
8,
198,
220,
1395,
79,
16,
796,
15690,
90,
43879,
2414,
11,
16,
92,
7,
917,
891,
11,
5907,
8,
198,
220,
1395,
79,
17,
796,
15690,
90,
43879,
2414,
11,
16,
92,
7,
917,
891,
11,
5907,
8,
198,
220,
1395,
81,
220,
796,
15690,
90,
43879,
2414,
11,
16,
92,
7,
917,
891,
11,
5907,
8,
198,
220,
266,
70,
220,
796,
15690,
90,
43879,
2414,
11,
16,
92,
7,
917,
891,
11,
5907,
8,
198,
220,
5256,
220,
796,
15690,
90,
43879,
2414,
11,
16,
92,
7,
917,
891,
11,
5907,
8,
628,
220,
374,
2435,
220,
796,
275,
912,
58,
437,
60,
198,
220,
31720,
76,
16,
796,
31720,
532,
352,
198,
220,
299,
65,
912,
220,
220,
796,
4129,
7,
65,
912,
8,
628,
220,
1303,
923,
32660,
2163,
329,
10007,
198,
220,
2163,
277,
7,
79,
3712,
19182,
90,
43879,
2414,
11,
16,
30072,
628,
220,
220,
220,
2488,
259,
65,
3733,
2221,
628,
220,
220,
220,
220,
220,
412,
912,
796,
17906,
7,
79,
8,
628,
220,
220,
220,
220,
220,
1303,
4574,
10007,
355,
262,
938,
15879,
287,
412,
912,
198,
220,
220,
220,
220,
220,
4574,
0,
7,
36,
912,
11,
279,
8,
628,
220,
220,
220,
220,
220,
1303,
8636,
4600,
38,
912,
63,
1864,
284,
4600,
36,
912,
63,
290,
4600,
79,
63,
198,
220,
220,
220,
220,
220,
402,
912,
796,
402,
83,
7,
36,
912,
8,
628,
220,
220,
220,
220,
220,
32660,
796,
657,
13,
15,
628,
220,
220,
220,
220,
220,
611,
4279,
7,
38,
912,
58,
46803,
912,
12962,
6624,
36545,
628,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
7308,
13,
3198,
2514,
7,
46803,
912,
8,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
4279,
7,
38,
912,
58,
72,
12962,
14512,
36545,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
12860,
402,
912,
58,
46803,
912,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
12860,
402,
912,
58,
72,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
628,
220,
220,
220,
220,
220,
220,
220,
886,
628,
220,
220,
220,
220,
220,
220,
220,
329,
19886,
287,
1333,
5643,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
778,
11,
288,
16,
11,
288,
17,
796,
19886,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22492,
717,
4957,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1395,
15,
796,
402,
912,
58,
23160,
912,
58,
67,
16,
11,
17,
11907,
59,
55,
58,
67,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
35971,
0,
7,
55,
79,
16,
11,
402,
912,
58,
23160,
912,
58,
67,
16,
11,
16,
60,
4357,
1395,
15,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2198,
62,
12480,
82,
7,
55,
79,
16,
11,
36545,
8,
11405,
1441,
532,
18943,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22492,
1218,
4957,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1395,
15,
796,
402,
912,
58,
23160,
912,
58,
67,
17,
11,
17,
11907,
59,
55,
58,
67,
17,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
35971,
0,
7,
55,
79,
17,
11,
402,
912,
58,
23160,
912,
58,
67,
17,
11,
16,
60,
4357,
1395,
15,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2198,
62,
12480,
82,
7,
55,
79,
17,
11,
36545,
8,
11405,
1441,
532,
18943,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7377,
119,
2435,
796,
275,
912,
58,
23160,
912,
58,
67,
16,
11,
16,
11907,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7377,
119,
15596,
0,
7,
39377,
2435,
11,
1395,
11,
1395,
79,
16,
11,
1395,
79,
17,
11,
279,
11,
778,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
778,
14512,
299,
276,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
25404,
385,
220,
796,
2160,
7,
55,
58,
1050,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1395,
58,
1050,
60,
1220,
28,
285,
25404,
385,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32660,
15853,
2604,
7,
9132,
41790,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
2073,
628,
220,
220,
220,
220,
220,
220,
220,
329,
19886,
287,
1333,
5643,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
778,
11,
288,
16,
11,
288,
17,
796,
19886,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22492,
717,
4957,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
7146,
0,
7,
55,
15,
11,
10662,
81,
0,
7,
38,
912,
58,
23160,
912,
58,
67,
16,
11,
17,
60,
4357,
3254,
7,
7942,
36911,
1395,
58,
67,
16,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
35971,
0,
7,
55,
79,
16,
11,
402,
912,
58,
23160,
912,
58,
67,
16,
11,
16,
60,
4357,
1395,
15,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2198,
62,
12480,
82,
7,
55,
79,
16,
11,
36545,
8,
11405,
1441,
532,
18943,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22492,
1218,
4957,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
7146,
0,
7,
55,
15,
11,
10662,
81,
0,
7,
38,
912,
58,
23160,
912,
58,
67,
17,
11,
17,
60,
4357,
3254,
7,
7942,
36911,
1395,
58,
67,
17,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
35971,
0,
7,
55,
79,
17,
11,
402,
912,
58,
23160,
912,
58,
67,
17,
11,
16,
60,
4357,
1395,
15,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2198,
62,
12480,
82,
7,
55,
79,
17,
11,
36545,
8,
11405,
1441,
532,
18943,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7377,
119,
2435,
796,
275,
912,
58,
23160,
912,
58,
67,
16,
11,
16,
11907,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7377,
119,
15596,
0,
7,
39377,
2435,
11,
1395,
11,
1395,
79,
16,
11,
1395,
79,
17,
11,
279,
11,
778,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
778,
14512,
299,
276,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
25404,
385,
220,
796,
2160,
7,
55,
58,
1050,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1395,
58,
1050,
60,
1220,
28,
285,
25404,
385,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32660,
15853,
2604,
7,
9132,
41790,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
886,
628,
220,
220,
220,
220,
220,
886,
628,
220,
220,
220,
220,
220,
1303,
8333,
6808,
14955,
82,
198,
220,
220,
220,
220,
220,
2488,
14323,
67,
329,
1312,
287,
7308,
13,
3198,
2514,
7,
5907,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1395,
81,
58,
72,
60,
796,
1395,
58,
2817,
7131,
72,
60,
198,
220,
220,
220,
220,
220,
886,
628,
220,
220,
220,
220,
220,
1303,
8333,
6808,
21935,
198,
220,
220,
220,
220,
220,
2488,
14323,
67,
329,
1312,
287,
7308,
13,
3198,
2514,
7,
5907,
8,
198,
220,
220,
220,
220,
220,
220,
220,
5256,
58,
72,
60,
796,
412,
912,
58,
45938,
76,
16,
7131,
72,
60,
198,
220,
220,
220,
220,
220,
886,
628,
220,
220,
220,
220,
220,
1303,
8636,
19590,
198,
220,
220,
220,
220,
220,
2593,
48209,
388,
0,
7,
55,
81,
11,
266,
70,
11,
36545,
8,
628,
220,
220,
220,
220,
220,
32660,
15853,
2604,
7,
15763,
297,
7,
81,
2435,
11,
1395,
81,
11,
5256,
11,
266,
70,
11,
279,
2599,
25,
43879,
2414,
8,
198,
220,
220,
220,
886,
628,
220,
220,
220,
1441,
32660,
198,
220,
886,
628,
220,
1441,
277,
198,
437,
628,
628,
628,
198
] | 1.66575 | 3,273 |
type BitsContainer <: RoaringContainer
card::UInt
data::Vector{UInt64}
end
function BitsContainer()
Vector{UInt64}()
return BitsContainer()
end
bitset_container_t *bitset_container_create(void) {
bitset_container_t *bitset =
(bitset_container_t *)calloc(1, sizeof(bitset_container_t));
if (!bitset) {
return NULL;
}
// sizeof(__m256i) == 32
bitset->array = (uint64_t *) aligned_malloc(32, sizeof(uint64_t) * BITSET_CONTAINER_SIZE_IN_WORDS);
if (! bitset->array) {
free(bitset);
return NULL;
}
bitset_container_clear(bitset);
return bitset;
}
| [
198,
4906,
44733,
29869,
1279,
25,
5564,
1723,
29869,
198,
220,
220,
220,
2657,
3712,
52,
5317,
198,
220,
220,
220,
1366,
3712,
38469,
90,
52,
5317,
2414,
92,
198,
437,
198,
198,
8818,
44733,
29869,
3419,
198,
220,
220,
220,
20650,
90,
52,
5317,
2414,
92,
3419,
198,
220,
220,
220,
1441,
44733,
29869,
3419,
198,
437,
628,
628,
198,
9895,
316,
62,
34924,
62,
83,
1635,
9895,
316,
62,
34924,
62,
17953,
7,
19382,
8,
1391,
198,
220,
220,
220,
10340,
316,
62,
34924,
62,
83,
1635,
9895,
316,
796,
198,
220,
220,
220,
220,
220,
220,
220,
357,
9895,
316,
62,
34924,
62,
83,
31936,
13345,
420,
7,
16,
11,
39364,
7,
9895,
316,
62,
34924,
62,
83,
18125,
628,
220,
220,
220,
611,
22759,
9895,
316,
8,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
15697,
26,
198,
220,
220,
220,
1782,
198,
220,
220,
220,
3373,
39364,
7,
834,
76,
11645,
72,
8,
6624,
3933,
198,
220,
220,
220,
10340,
316,
3784,
18747,
796,
357,
28611,
2414,
62,
83,
31936,
19874,
62,
76,
32332,
7,
2624,
11,
39364,
7,
28611,
2414,
62,
83,
8,
1635,
36992,
28480,
62,
10943,
30339,
1137,
62,
33489,
62,
1268,
62,
45359,
5258,
1776,
198,
220,
220,
220,
611,
22759,
10340,
316,
3784,
18747,
8,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
1479,
7,
9895,
316,
1776,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
15697,
26,
198,
220,
220,
220,
1782,
198,
220,
220,
220,
10340,
316,
62,
34924,
62,
20063,
7,
9895,
316,
1776,
198,
220,
220,
220,
1441,
10340,
316,
26,
198,
92,
198
] | 2.327206 | 272 |
@diffusion_process SIRAux begin
:parameters
(α, β, σ1, σ2, t, T) --> Float64
(u, v) --> ℝ{2}
:additional
linear --> true
constdiff --> true
statespace -->BoundedStateSpace(((1,2), (0.0,0.0)), ((1,2), (1.0,1.0)))
end
function B(t, P::SIRAux)
@SMatrix[
(P.α*(1 - P.v[1] - P.v[2]) - P.β) 0.0;
P.β 0.0
]
end
β(t, P::SIRAux) = ℝ{2}(0.0, 0.0)
function σ(t, P::SIRAux)
@SMatrix Float64[
(-P.σ1*(1 - v[1] - v[2])*v[1]) -P.σ2*v[1];
0.0 P.σ2*v[1]
]
end
| [
31,
26069,
4241,
62,
14681,
25861,
3861,
2821,
2221,
198,
220,
220,
220,
1058,
17143,
7307,
198,
220,
220,
220,
357,
17394,
11,
27169,
11,
18074,
225,
16,
11,
18074,
225,
17,
11,
256,
11,
309,
8,
14610,
48436,
2414,
198,
220,
220,
220,
357,
84,
11,
410,
8,
14610,
2343,
226,
251,
90,
17,
92,
628,
220,
220,
220,
1058,
2860,
1859,
198,
220,
220,
220,
14174,
14610,
2081,
198,
220,
220,
220,
1500,
26069,
14610,
2081,
198,
220,
220,
220,
2585,
10223,
14610,
33,
6302,
9012,
14106,
19510,
7,
16,
11,
17,
828,
357,
15,
13,
15,
11,
15,
13,
15,
36911,
14808,
16,
11,
17,
828,
357,
16,
13,
15,
11,
16,
13,
15,
22305,
198,
437,
198,
198,
8818,
347,
7,
83,
11,
350,
3712,
11584,
3861,
2821,
8,
198,
220,
220,
220,
2488,
12310,
265,
8609,
58,
198,
220,
220,
220,
220,
220,
220,
220,
357,
47,
13,
17394,
9,
7,
16,
532,
350,
13,
85,
58,
16,
60,
532,
350,
13,
85,
58,
17,
12962,
532,
350,
13,
26638,
8,
220,
657,
13,
15,
26,
198,
220,
220,
220,
220,
220,
220,
220,
350,
13,
26638,
220,
220,
657,
13,
15,
198,
220,
220,
220,
2361,
198,
437,
198,
198,
26638,
7,
83,
11,
350,
3712,
11584,
3861,
2821,
8,
796,
2343,
226,
251,
90,
17,
92,
7,
15,
13,
15,
11,
657,
13,
15,
8,
628,
198,
8818,
18074,
225,
7,
83,
11,
350,
3712,
11584,
3861,
2821,
8,
198,
220,
220,
220,
2488,
12310,
265,
8609,
48436,
2414,
58,
198,
220,
220,
220,
220,
220,
220,
220,
13841,
47,
13,
38392,
16,
9,
7,
16,
532,
410,
58,
16,
60,
532,
410,
58,
17,
12962,
9,
85,
58,
16,
12962,
220,
532,
47,
13,
38392,
17,
9,
85,
58,
16,
11208,
198,
220,
220,
220,
220,
220,
220,
220,
657,
13,
15,
220,
220,
350,
13,
38392,
17,
9,
85,
58,
16,
60,
198,
220,
220,
220,
2361,
198,
437,
198
] | 1.610942 | 329 |
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: jl:light,ipynb
# text_representation:
# extension: .jl
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.4.2
# kernelspec:
# display_name: Julia 1.4.0
# language: julia
# name: julia-1.4
# ---
# +
using Gen
using Statistics
include("DistributionsBacked.jl")
using AdvancedHMC
const my_normal = DistributionsBacked{Float64}((mu, sigma) ->
Distributions.Normal(mu, sigma), [true, true], true)
const my_unif = DistributionsBacked{Float64}((lo, hi) ->
Distributions.Uniform(lo, hi), [true, true], true)
;
# +
@gen function corbiv_model() #correlated bivariate normal
ρ ~ my_unif(-1., 1.)
x ~ my_normal(0., 1.)
y ~ my_normal(ρ*x, sqrt(1. - ρ^2))
end
@gen function cormiv_model() #correlated bivariate normal
ρ ~ my_unif(0., 1.) #correlation between x and y
ρ2 ~ my_unif(0., ρ) #correlation between z and (x or y)
zy_cond_zx = (1-ρ2^2)*ρ2
x ~ my_normal(0., 1.)
y ~ my_normal(ρ*x, sqrt(1. - ρ^2))
z ~ my_normal(ρ2*x + zy_cond_zx*y, sqrt(1. - ρ2^2 - zy_cond_zx^2))
end
;
# +
function constrainρ(ρ::Float64)
constraints = Gen.choicemap()
constraints[:ρ] = ρ
constraints
end
function constrainρ2(ρ::Float64, ρ2, z)
constraints = Gen.choicemap()
constraints[:ρ] = ρ
constraints[:ρ2] = ρ2
constraints[:z] = z
constraints
end
function mcmc_inference(ρ, num_iters, update, selection)
observation = constrainρ(ρ)
(trace, _) = generate(corbiv_model, (), observation)
samples = Array{Float64}(undef,num_iters,2)
for i=1:num_iters
trace = update(trace, selection)
ch = get_choices(trace)
samples[i,1] = ch[:x]
samples[i,2] = ch[:y]
end
samples
end
function mcmc_m_inference(ρ, ρ2, z, num_iters, update)
observation = constrainρ2(ρ, ρ2, z)
(trace, _) = generate(cormiv_model, (), observation)
samples = Array{Float64}(undef,num_iters,2)
for i=1:num_iters
trace = update(trace)
ch = get_choices(trace)
samples[i,1] = ch[:x]
samples[i,2] = ch[:y]
end
samples
end
function block_mh(tr, selection)
(tr, _) = mh(tr, select(:x, :y))
tr
end
function simple_hmc(tr, selection)
(tr, _) = hmc(tr, select(:x, :y))
tr
end
;
# -
iters = 10_000
show = 5
ρ = -.5
samps = mcmc_inference(ρ, iters, block_mh, select(:x,:y))
samps[(iters-show+1):iters,:]
iters = 100
show = 5
ρ = .8
samps = mcmc_inference(ρ, iters, simple_hmc)
samps[(iters-show+1):iters,:]
println(mean(samps))
println(cor(samps[:,1],samps[:,2]))
# Disable AdvancedHMC's NUTS logging
# +
using Logging
using LoggingExtras
function ignore_sampling_filter(log_args)
!(occursin("sampling steps",log_args.message) || occursin("adapation steps",log_args.message))
end
logger = ActiveFilteredLogger(ignore_sampling_filter, global_logger())
if !(@isdefined old_logger) #do this only once
old_logger = global_logger(logger)
end
# -
function my_nuts(trace, selection,
n_postadapt_steps = 2,
n_adapts = 1,
initial_ϵ_reduce_fac = 10)
n_NUTS_steps = n_postadapt_steps + n_adapts
filtered_choices = get_selected(get_choices(trace), selection)
cur_xy = to_array(filtered_choices, Float64)
dimension = length(cur_xy)
metric = DiagEuclideanMetric(dimension)
retval_grad = nothing #accepts_output_grad(get_gen_fn(trace)) ? zero(get_retval(trace)) : nothing
function update_xy(val)
extra_constraints = from_array(filtered_choices, val)
update(trace, (), (NoChange(),), extra_constraints)
end
function val_to_lp_plus_c(val)
(new_trace, weight, discard, retdiff) = update_xy(val)
weight
end
function val_to_grad(val)
(new_trace, weight, discard, retdiff) = update_xy(val)
(retval_grad_out, values_trie, gradient_trie) = choice_gradients(new_trace, selection, retval_grad)
grad = [gradient_trie[:x], gradient_trie[:y]]
(weight, grad)
end
# Define a Hamiltonian system, using metric defined globally above
hamiltonian = Hamiltonian(metric, val_to_lp_plus_c, val_to_grad)
# Define a leapfrog solver, with initial step size chosen heuristically
initial_ϵ = find_good_stepsize(hamiltonian, cur_xy) ./ initial_ϵ_reduce_fac
integrator = Leapfrog(initial_ϵ)
# Define an HMC sampler, with the following components
# - multinomial sampling scheme,
# - generalised No-U-Turn criteria, and
# - windowed adaption for step-size and diagonal mass matrix
proposal = NUTS{MultinomialTS, GeneralisedNoUTurn}(integrator)
adaptor = StanHMCAdaptor(MassMatrixAdaptor(metric), StepSizeAdaptor(0.8, integrator))
# Run the sampler to draw samples from the specified Gaussian, where
# - `samples` will store the samples
# - `stats` will store diagnostic statistics for each sample
samples, stats = sample(hamiltonian, proposal, cur_xy, n_NUTS_steps, adaptor, n_adapts; progress=false)
#println(samples[3])
(new_trace, weight, discard, retdiff) = update_xy(samples[n_NUTS_steps])
new_trace
end
# +
iters = 200
show = 5
ρ = .99
samps = mcmc_inference(ρ, iters, my_nuts, select(:x,:y))
samps[(iters-show+1):iters,:]
# -
println(cor(samps[1:iters-1,1],samps[2:iters,1])) #serial correlation; lower is better
println(ρ^4) #for comparison, gibbs would be ρ² for each step; ρ⁴ for two steps
positive
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
11420,
198,
2,
474,
929,
88,
353,
25,
198,
2,
220,
220,
474,
929,
88,
5239,
25,
198,
2,
220,
220,
220,
220,
17519,
25,
474,
75,
25,
2971,
11,
541,
2047,
65,
198,
2,
220,
220,
220,
220,
2420,
62,
15603,
341,
25,
198,
2,
220,
220,
220,
220,
220,
220,
7552,
25,
764,
20362,
198,
2,
220,
220,
220,
220,
220,
220,
5794,
62,
3672,
25,
1657,
198,
2,
220,
220,
220,
220,
220,
220,
5794,
62,
9641,
25,
705,
16,
13,
20,
6,
198,
2,
220,
220,
220,
220,
220,
220,
474,
929,
88,
5239,
62,
9641,
25,
352,
13,
19,
13,
17,
198,
2,
220,
220,
50207,
43106,
25,
198,
2,
220,
220,
220,
220,
3359,
62,
3672,
25,
22300,
352,
13,
19,
13,
15,
198,
2,
220,
220,
220,
220,
3303,
25,
474,
43640,
198,
2,
220,
220,
220,
220,
1438,
25,
474,
43640,
12,
16,
13,
19,
198,
2,
11420,
198,
198,
2,
1343,
198,
3500,
5215,
198,
3500,
14370,
198,
17256,
7203,
20344,
2455,
507,
33,
6021,
13,
20362,
4943,
198,
3500,
13435,
39,
9655,
198,
198,
9979,
616,
62,
11265,
796,
46567,
507,
33,
6021,
90,
43879,
2414,
92,
19510,
30300,
11,
264,
13495,
8,
4613,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
46567,
507,
13,
26447,
7,
30300,
11,
264,
13495,
828,
685,
7942,
11,
2081,
4357,
2081,
8,
198,
9979,
616,
62,
403,
361,
796,
46567,
507,
33,
6021,
90,
43879,
2414,
92,
19510,
5439,
11,
23105,
8,
4613,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
46567,
507,
13,
3118,
6933,
7,
5439,
11,
23105,
828,
685,
7942,
11,
2081,
4357,
2081,
8,
198,
26,
198,
198,
2,
1343,
198,
31,
5235,
2163,
1162,
65,
452,
62,
19849,
3419,
1303,
10215,
5363,
275,
42524,
3487,
198,
220,
220,
220,
18074,
223,
5299,
616,
62,
403,
361,
32590,
16,
1539,
352,
2014,
198,
220,
220,
220,
2124,
5299,
616,
62,
11265,
7,
15,
1539,
352,
2014,
198,
220,
220,
220,
331,
5299,
616,
62,
11265,
7,
33643,
9,
87,
11,
19862,
17034,
7,
16,
13,
532,
18074,
223,
61,
17,
4008,
198,
437,
198,
198,
31,
5235,
2163,
269,
579,
452,
62,
19849,
3419,
1303,
10215,
5363,
275,
42524,
3487,
198,
220,
220,
220,
18074,
223,
5299,
616,
62,
403,
361,
7,
15,
1539,
352,
2014,
1303,
10215,
49501,
1022,
2124,
290,
331,
198,
220,
220,
220,
18074,
223,
17,
5299,
616,
62,
403,
361,
7,
15,
1539,
18074,
223,
8,
1303,
10215,
49501,
1022,
1976,
290,
357,
87,
393,
331,
8,
220,
198,
220,
220,
220,
1976,
88,
62,
17561,
62,
42592,
796,
357,
16,
12,
33643,
17,
61,
17,
27493,
33643,
17,
198,
220,
220,
220,
2124,
5299,
616,
62,
11265,
7,
15,
1539,
352,
2014,
198,
220,
220,
220,
331,
5299,
616,
62,
11265,
7,
33643,
9,
87,
11,
19862,
17034,
7,
16,
13,
532,
18074,
223,
61,
17,
4008,
198,
220,
220,
220,
1976,
5299,
616,
62,
11265,
7,
33643,
17,
9,
87,
1343,
1976,
88,
62,
17561,
62,
42592,
9,
88,
11,
19862,
17034,
7,
16,
13,
532,
18074,
223,
17,
61,
17,
532,
1976,
88,
62,
17561,
62,
42592,
61,
17,
4008,
198,
437,
198,
26,
198,
198,
2,
1343,
198,
8818,
1500,
3201,
33643,
7,
33643,
3712,
43879,
2414,
8,
198,
220,
220,
220,
17778,
796,
5215,
13,
6679,
291,
368,
499,
3419,
198,
220,
220,
220,
17778,
58,
25,
33643,
60,
796,
18074,
223,
198,
220,
220,
220,
17778,
198,
437,
198,
198,
8818,
1500,
3201,
33643,
17,
7,
33643,
3712,
43879,
2414,
11,
18074,
223,
17,
11,
1976,
8,
198,
220,
220,
220,
17778,
796,
5215,
13,
6679,
291,
368,
499,
3419,
198,
220,
220,
220,
17778,
58,
25,
33643,
60,
796,
18074,
223,
198,
220,
220,
220,
17778,
58,
25,
33643,
17,
60,
796,
18074,
223,
17,
198,
220,
220,
220,
17778,
58,
25,
89,
60,
796,
1976,
198,
220,
220,
220,
220,
198,
220,
220,
220,
220,
198,
220,
220,
220,
17778,
198,
437,
198,
198,
8818,
285,
11215,
66,
62,
259,
4288,
7,
33643,
11,
997,
62,
270,
364,
11,
4296,
11,
6356,
8,
198,
220,
220,
220,
13432,
796,
1500,
3201,
33643,
7,
33643,
8,
198,
220,
220,
220,
357,
40546,
11,
4808,
8,
796,
7716,
7,
10215,
65,
452,
62,
19849,
11,
29994,
13432,
8,
198,
220,
220,
220,
8405,
796,
15690,
90,
43879,
2414,
92,
7,
917,
891,
11,
22510,
62,
270,
364,
11,
17,
8,
198,
220,
220,
220,
329,
1312,
28,
16,
25,
22510,
62,
270,
364,
198,
220,
220,
220,
220,
220,
220,
220,
12854,
796,
4296,
7,
40546,
11,
6356,
8,
198,
220,
220,
220,
220,
220,
220,
220,
442,
796,
651,
62,
6679,
1063,
7,
40546,
8,
198,
220,
220,
220,
220,
220,
220,
220,
8405,
58,
72,
11,
16,
60,
796,
442,
58,
25,
87,
60,
198,
220,
220,
220,
220,
220,
220,
220,
8405,
58,
72,
11,
17,
60,
796,
442,
58,
25,
88,
60,
198,
220,
220,
220,
886,
198,
220,
220,
220,
8405,
198,
437,
198,
198,
8818,
285,
11215,
66,
62,
76,
62,
259,
4288,
7,
33643,
11,
18074,
223,
17,
11,
1976,
11,
997,
62,
270,
364,
11,
4296,
8,
198,
220,
220,
220,
13432,
796,
1500,
3201,
33643,
17,
7,
33643,
11,
18074,
223,
17,
11,
1976,
8,
198,
220,
220,
220,
357,
40546,
11,
4808,
8,
796,
7716,
7,
66,
579,
452,
62,
19849,
11,
29994,
13432,
8,
198,
220,
220,
220,
8405,
796,
15690,
90,
43879,
2414,
92,
7,
917,
891,
11,
22510,
62,
270,
364,
11,
17,
8,
198,
220,
220,
220,
329,
1312,
28,
16,
25,
22510,
62,
270,
364,
198,
220,
220,
220,
220,
220,
220,
220,
12854,
796,
4296,
7,
40546,
8,
198,
220,
220,
220,
220,
220,
220,
220,
442,
796,
651,
62,
6679,
1063,
7,
40546,
8,
198,
220,
220,
220,
220,
220,
220,
220,
8405,
58,
72,
11,
16,
60,
796,
442,
58,
25,
87,
60,
198,
220,
220,
220,
220,
220,
220,
220,
8405,
58,
72,
11,
17,
60,
796,
442,
58,
25,
88,
60,
198,
220,
220,
220,
886,
198,
220,
220,
220,
8405,
198,
437,
198,
198,
8818,
2512,
62,
76,
71,
7,
2213,
11,
6356,
8,
198,
220,
220,
220,
357,
2213,
11,
4808,
8,
796,
285,
71,
7,
2213,
11,
2922,
7,
25,
87,
11,
1058,
88,
4008,
198,
220,
220,
220,
491,
198,
437,
628,
198,
8818,
2829,
62,
71,
23209,
7,
2213,
11,
6356,
8,
198,
220,
220,
220,
357,
2213,
11,
4808,
8,
796,
289,
23209,
7,
2213,
11,
2922,
7,
25,
87,
11,
1058,
88,
4008,
198,
220,
220,
220,
491,
198,
437,
628,
198,
26,
198,
2,
532,
198,
198,
270,
364,
796,
838,
62,
830,
198,
12860,
796,
642,
198,
33643,
796,
532,
13,
20,
198,
82,
9430,
796,
285,
11215,
66,
62,
259,
4288,
7,
33643,
11,
340,
364,
11,
2512,
62,
76,
71,
11,
2922,
7,
25,
87,
11,
25,
88,
4008,
198,
82,
9430,
58,
7,
270,
364,
12,
12860,
10,
16,
2599,
270,
364,
11,
47715,
628,
198,
198,
270,
364,
796,
1802,
198,
12860,
796,
642,
198,
33643,
796,
764,
23,
198,
82,
9430,
796,
285,
11215,
66,
62,
259,
4288,
7,
33643,
11,
340,
364,
11,
2829,
62,
71,
23209,
8,
198,
82,
9430,
58,
7,
270,
364,
12,
12860,
10,
16,
2599,
270,
364,
11,
47715,
198,
198,
35235,
7,
32604,
7,
82,
9430,
4008,
198,
35235,
7,
10215,
7,
82,
9430,
58,
45299,
16,
4357,
82,
9430,
58,
45299,
17,
60,
4008,
628,
198,
2,
31529,
13435,
39,
9655,
338,
399,
3843,
50,
18931,
198,
198,
2,
1343,
198,
3500,
5972,
2667,
198,
3500,
5972,
2667,
11627,
8847,
198,
198,
8818,
8856,
62,
37687,
11347,
62,
24455,
7,
6404,
62,
22046,
8,
198,
220,
220,
220,
5145,
7,
13966,
1834,
259,
7203,
37687,
11347,
4831,
1600,
6404,
62,
22046,
13,
20500,
8,
8614,
8833,
259,
7203,
324,
499,
341,
4831,
1600,
6404,
62,
22046,
13,
20500,
4008,
198,
437,
198,
6404,
1362,
796,
14199,
11928,
4400,
11187,
1362,
7,
46430,
62,
37687,
11347,
62,
24455,
11,
3298,
62,
6404,
1362,
28955,
628,
198,
361,
5145,
7,
31,
271,
23211,
1468,
62,
6404,
1362,
8,
1303,
4598,
428,
691,
1752,
198,
220,
220,
220,
1468,
62,
6404,
1362,
796,
3298,
62,
6404,
1362,
7,
6404,
1362,
8,
198,
437,
198,
2,
532,
198,
198,
8818,
616,
62,
31381,
7,
40546,
11,
6356,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
299,
62,
7353,
42552,
62,
20214,
796,
362,
11,
198,
220,
220,
220,
220,
220,
220,
220,
299,
62,
42552,
82,
796,
352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4238,
62,
139,
113,
62,
445,
7234,
62,
38942,
796,
838,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
299,
62,
45,
3843,
50,
62,
20214,
796,
299,
62,
7353,
42552,
62,
20214,
1343,
299,
62,
42552,
82,
198,
220,
220,
220,
220,
198,
220,
220,
220,
29083,
62,
6679,
1063,
796,
651,
62,
34213,
7,
1136,
62,
6679,
1063,
7,
40546,
828,
6356,
8,
198,
220,
220,
220,
1090,
62,
5431,
796,
284,
62,
18747,
7,
10379,
4400,
62,
6679,
1063,
11,
48436,
2414,
8,
198,
220,
220,
220,
15793,
796,
4129,
7,
22019,
62,
5431,
8,
198,
220,
220,
220,
18663,
796,
6031,
363,
36,
36616,
485,
272,
9171,
1173,
7,
46156,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1005,
2100,
62,
9744,
796,
2147,
1303,
13635,
82,
62,
22915,
62,
9744,
7,
1136,
62,
5235,
62,
22184,
7,
40546,
4008,
5633,
6632,
7,
1136,
62,
1186,
2100,
7,
40546,
4008,
1058,
2147,
198,
220,
220,
220,
220,
198,
220,
220,
220,
2163,
4296,
62,
5431,
7,
2100,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3131,
62,
1102,
2536,
6003,
796,
422,
62,
18747,
7,
10379,
4400,
62,
6679,
1063,
11,
1188,
8,
198,
220,
220,
220,
220,
220,
220,
220,
4296,
7,
40546,
11,
29994,
357,
2949,
19400,
22784,
828,
3131,
62,
1102,
2536,
6003,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
220,
198,
220,
220,
220,
2163,
1188,
62,
1462,
62,
34431,
62,
9541,
62,
66,
7,
2100,
8,
198,
220,
220,
220,
220,
220,
220,
220,
357,
3605,
62,
40546,
11,
3463,
11,
27537,
11,
1005,
26069,
8,
796,
4296,
62,
5431,
7,
2100,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3463,
198,
220,
220,
220,
886,
198,
220,
220,
220,
220,
198,
220,
220,
220,
2163,
1188,
62,
1462,
62,
9744,
7,
2100,
8,
198,
220,
220,
220,
220,
220,
220,
220,
357,
3605,
62,
40546,
11,
3463,
11,
27537,
11,
1005,
26069,
8,
796,
4296,
62,
5431,
7,
2100,
8,
198,
220,
220,
220,
220,
220,
220,
220,
357,
1186,
2100,
62,
9744,
62,
448,
11,
3815,
62,
83,
5034,
11,
31312,
62,
83,
5034,
8,
796,
3572,
62,
9744,
2334,
7,
3605,
62,
40546,
11,
6356,
11,
1005,
2100,
62,
9744,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3915,
796,
685,
49607,
62,
83,
5034,
58,
25,
87,
4357,
31312,
62,
83,
5034,
58,
25,
88,
11907,
198,
220,
220,
220,
220,
220,
220,
220,
357,
6551,
11,
3915,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
2896,
500,
257,
11582,
666,
1080,
11,
1262,
18663,
5447,
18309,
2029,
198,
220,
220,
220,
8891,
9044,
666,
796,
11582,
666,
7,
4164,
1173,
11,
1188,
62,
1462,
62,
34431,
62,
9541,
62,
66,
11,
1188,
62,
1462,
62,
9744,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
2896,
500,
257,
16470,
49956,
1540,
332,
11,
351,
4238,
2239,
2546,
7147,
339,
333,
16772,
198,
220,
220,
220,
4238,
62,
139,
113,
796,
1064,
62,
11274,
62,
9662,
7857,
7,
2763,
9044,
666,
11,
1090,
62,
5431,
8,
24457,
4238,
62,
139,
113,
62,
445,
7234,
62,
38942,
198,
220,
220,
220,
4132,
12392,
796,
33927,
49956,
7,
36733,
62,
139,
113,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
2896,
500,
281,
367,
9655,
6072,
20053,
11,
351,
262,
1708,
6805,
198,
220,
220,
220,
1303,
220,
220,
532,
1963,
259,
49070,
19232,
7791,
11,
198,
220,
220,
220,
1303,
220,
220,
532,
2276,
1417,
1400,
12,
52,
12,
17278,
9987,
11,
290,
198,
220,
220,
220,
1303,
220,
220,
532,
4324,
276,
512,
64,
1159,
329,
2239,
12,
7857,
290,
40039,
2347,
17593,
198,
220,
220,
220,
6961,
796,
399,
3843,
50,
90,
15205,
259,
49070,
4694,
11,
3611,
1417,
2949,
3843,
700,
92,
7,
18908,
12392,
8,
198,
220,
220,
220,
6068,
273,
796,
7299,
39,
9655,
48003,
273,
7,
20273,
46912,
48003,
273,
7,
4164,
1173,
828,
5012,
10699,
48003,
273,
7,
15,
13,
23,
11,
4132,
12392,
4008,
628,
220,
220,
220,
1303,
5660,
262,
6072,
20053,
284,
3197,
8405,
422,
262,
7368,
12822,
31562,
11,
810,
198,
220,
220,
220,
1303,
220,
220,
532,
4600,
82,
12629,
63,
481,
3650,
262,
8405,
198,
220,
220,
220,
1303,
220,
220,
532,
4600,
34242,
63,
481,
3650,
23584,
7869,
329,
1123,
6291,
198,
220,
220,
220,
220,
198,
220,
220,
220,
8405,
11,
9756,
796,
6291,
7,
2763,
9044,
666,
11,
6961,
11,
1090,
62,
5431,
11,
299,
62,
45,
3843,
50,
62,
20214,
11,
6068,
273,
11,
299,
62,
42552,
82,
26,
4371,
28,
9562,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
35235,
7,
82,
12629,
58,
18,
12962,
198,
220,
220,
220,
220,
198,
220,
220,
220,
220,
198,
220,
220,
220,
357,
3605,
62,
40546,
11,
3463,
11,
27537,
11,
1005,
26069,
8,
796,
4296,
62,
5431,
7,
82,
12629,
58,
77,
62,
45,
3843,
50,
62,
20214,
12962,
198,
220,
220,
220,
649,
62,
40546,
198,
437,
628,
198,
2,
1343,
198,
270,
364,
796,
939,
198,
12860,
796,
642,
198,
33643,
796,
764,
2079,
628,
198,
82,
9430,
796,
285,
11215,
66,
62,
259,
4288,
7,
33643,
11,
340,
364,
11,
616,
62,
31381,
11,
2922,
7,
25,
87,
11,
25,
88,
4008,
198,
82,
9430,
58,
7,
270,
364,
12,
12860,
10,
16,
2599,
270,
364,
11,
47715,
198,
2,
532,
198,
198,
35235,
7,
10215,
7,
82,
9430,
58,
16,
25,
270,
364,
12,
16,
11,
16,
4357,
82,
9430,
58,
17,
25,
270,
364,
11,
16,
60,
4008,
1303,
46911,
16096,
26,
2793,
318,
1365,
198,
35235,
7,
33643,
61,
19,
8,
1303,
1640,
7208,
11,
46795,
1443,
561,
307,
18074,
223,
31185,
329,
1123,
2239,
26,
18074,
223,
46256,
112,
329,
734,
4831,
198,
198,
24561,
628,
198
] | 2.243287 | 2,495 |
export rule
@rule BIFMHelper(:out, Marginalisation) (q_in::Any, ) = ProdFinal(q_in) | [
39344,
3896,
198,
198,
31,
25135,
347,
5064,
44,
47429,
7,
25,
448,
11,
11899,
1292,
5612,
8,
357,
80,
62,
259,
3712,
7149,
11,
1267,
796,
1041,
67,
19006,
7,
80,
62,
259,
8
] | 2.4 | 35 |
"A macro to make calling KNITRO's KN_* C API a little cleaner"
macro kn_ccall(func, args...)
f = Base.Meta.quot(Symbol("KN_$(func)"))
args = [esc(a) for a in args]
quote
ccall(($f, libknitro), $(args...))
end
end
macro kn_get_values(function_name, type)
name_singular = "KN_" * string(function_name)
name_plural = "KN_" * string(function_name) * "s"
fname = Symbol(name_plural)
fnameshort = Symbol(name_singular)
# Names of C function in knitro.h
c_fname = Symbol(name_singular)
c_fnames = Symbol(name_plural)
c_fnames_all = Symbol(name_plural * "_all")
n = if occursin("var", name_singular)
:(KN_get_number_vars(kc))
elseif occursin("con", name_singular)
:(KN_get_number_cons(kc))
end
quote
function $(esc(fname))(kc::Model)
result = zeros($type, $n)
$c_fnames_all(kc, result)
return result
end
function $(esc(fname))(kc::Model, index::Vector{Cint})
result = zeros($type, length(index))
$c_fnames(kc, length(index), index, result)
return result
end
function $(esc(fname))(kc::Model, index::Integer)
result = zeros($type, 1)
$c_fname(kc, index, result)
return result[1]
end
$(esc(fnameshort))(kc::Model, index::Integer) = $(esc(fname))(kc, index)
end
end
macro kn_get_attribute(function_name, type)
fname = Symbol("KN_" * string(function_name))
quote
function $(esc(fname))(m::Model)
val = zeros($type, 1)
ret = $fname(m, val)
return val[1]
end
end
end
"Format output returned by KNITRO as proper Julia string."
function _format_output(output::AbstractString)
# remove trailing whitespace
res = strip(output)
# remove special characters
return res = strip(res, '\0')
end
"Return the current KNITRO version."
function get_release()
len = 15
out = zeros(Cchar, len)
KN_get_release(len, out)
return String(strip(String(convert(Vector{UInt8}, out)), '\0'))
end
"Wrapper for KNITRO KN_context."
mutable struct Env
ptr_env::Ptr{Cvoid}
function Env()
ptrptr_env = Ref{Ptr{Cvoid}}()
res = KN_new(ptrptr_env)
if res != 0
error("Fail to retrieve a valid KNITRO KN_context. Error $res")
end
return new(ptrptr_env[])
end
Env(ptr::Ptr{Cvoid}) = new(ptr)
end
Base.unsafe_convert(ptr::Type{Ptr{Cvoid}}, env::Env) = env.ptr_env::Ptr{Cvoid}
is_valid(env::Env) = env.ptr_env != C_NULL
"""
Free all memory and release any Knitro license acquired by calling KN_new.
"""
function free_env(env::Env)
if env.ptr_env != C_NULL
ptrptr_env = Ref{Ptr{Cvoid}}(env.ptr_env)
KN_free(ptrptr_env)
env.ptr_env = C_NULL
end
return
end
"""
Structure specifying the callback context.
Each evaluation callbacks (for objective, gradient or hessian)
is attached to a unique callback context.
"""
mutable struct CallbackContext
context::Ptr{Cvoid}
n::Int
m::Int
# Add a dictionnary to store user params.
userparams::Any
# Oracle's callbacks are context dependent, so store
# them inside dedicated CallbackContext.
eval_f::Function
eval_g::Function
eval_h::Function
eval_rsd::Function
eval_jac_rsd::Function
function CallbackContext(ptr_cb::Ptr{Cvoid})
return new(ptr_cb, 0, 0, nothing)
end
end
Base.unsafe_convert(ptr::Type{Ptr{Cvoid}}, cb::CallbackContext) = cb.context::Ptr{Cvoid}
mutable struct Model
# KNITRO context environment.
env::Env
# Keep reference to callbacks for garbage collector.
callbacks::Vector{CallbackContext}
# Some structures for userParams
puts_user::Any
multistart_user::Any
mip_user::Any
newpoint_user::Any
# Solution values.
# Optimization status. Equal to 1 if problem is unsolved.
status::Cint
obj_val::Cdouble
x::Vector{Cdouble}
mult::Vector{Cdouble}
# Special callbacks (undefined by default).
# (this functions do not depend on callback environments)
ms_process::Function
newpt_callback::Function
mip_callback::Function
user_callback::Function
ms_initpt_callback::Function
puts_callback::Function
# Constructor.
function Model()
model = new(
Env(),
CallbackContext[],
nothing,
nothing,
nothing,
nothing,
1,
Inf,
Cdouble[],
Cdouble[],
)
# Add a destructor to properly delete model.
finalizer(KN_free, model)
return model
end
# Instantiate a new Knitro instance in current environment `env`.
function Model(env::Env)
return new(
env,
CallbackContext[],
nothing,
nothing,
nothing,
nothing,
1,
Inf,
Cdouble[],
Cdouble[],
)
end
end
Base.unsafe_convert(ptr::Type{Ptr{Cvoid}}, kn::Model) = kn.env.ptr_env::Ptr{Cvoid}
"Free solver object."
KN_free(m::Model) = free_env(m.env)
"Create solver object."
KN_new() = Model()
is_valid(m::Model) = is_valid(m.env)
has_callbacks(m::Model) = !isempty(m.callbacks)
register_callback(model::Model, cb::CallbackContext) = push!(model.callbacks, cb)
function Base.show(io::IO, m::Model)
if is_valid(m)
println(io, "$(get_release())")
println(io, "-----------------------")
println(io, "Problem Characteristics")
println(io, "-----------------------")
println(io, "Objective goal: Minimize")
println(io, "Objective type: $(KN_get_obj_type(m))")
println(
io,
"Number of variables: $(KN_get_number_vars(m))",
)
println(
io,
"Number of constraints: $(KN_get_number_cons(m))",
)
println(
io,
"Number of nonzeros in Jacobian: $(KN_get_jacobian_nnz(m))",
)
println(
io,
"Number of nonzeros in Hessian: $(KN_get_hessian_nnz(m))",
)
else
println(io, "KNITRO Problem: NULL")
end
end
#=
LM license manager
=#
"""
Type declaration for the Artelys License Manager context object.
Applications must not modify any part of the context.
"""
mutable struct LMcontext
ptr_lmcontext::Ptr{Cvoid}
# Keep a pointer to instantiated models in order to free
# memory properly.
linked_models::Vector{Model}
function LMcontext()
ptrref = Ref{Ptr{Cvoid}}()
res = KN_checkout_license(ptrref)
if res != 0
error("KNITRO: Error checkout license")
end
lm = new(ptrref[], Model[])
finalizer(KN_release_license, lm)
return lm
end
end
Base.unsafe_convert(ptr::Type{Ptr{Cvoid}}, lm::LMcontext) = lm.ptr_lmcontext::Ptr{Cvoid}
function Env(lm::LMcontext)
ptrptr_env = Ref{Ptr{Cvoid}}()
res = KN_new_lm(lm, ptrptr_env)
if res != 0
error("Fail to retrieve a valid KNITRO KN_context. Error $res")
end
return Env(ptrptr_env[])
end
function attach!(lm::LMcontext, model::Model)
push!(lm.linked_models, model)
return
end
# create Model with license manager
function Model(lm::LMcontext)
model = Model(Env(lm))
attach!(lm, model)
return model
end
KN_new_lm(lm::LMcontext) = Model(lm)
function KN_release_license(lm::LMcontext)
# First, ensure that all linked models are properly freed
# before releasing license manager!
KN_free.(lm.linked_models)
if lm.ptr_lmcontext != C_NULL
refptr = Ref{Ptr{Cvoid}}(lm.ptr_lmcontext)
KN_release_license(refptr)
lm.ptr_lmcontext = C_NULL
end
end
#=
VARIABLES
=#
function KN_add_var(m::Model)
index = Cint[0]
KN_add_var(m, index)
return index[1]
end
function KN_add_vars(m::Model, nvars::Int)
indexes = zeros(Cint, nvars)
KN_add_vars(m, nvars, indexes)
return indexes
end
@kn_get_values get_var_lobnd Cdouble
@kn_get_values get_var_upbnd Cdouble
@kn_get_values get_var_eqbnd Cdouble
@kn_get_values get_var_fxbnd Cdouble
@kn_get_values get_var_primal_value Cdouble
@kn_get_values get_var_dual_value Cdouble
@kn_get_values get_var_type Cint
#=
OBJECTIVE
=#
function KN_add_obj_linear_struct(
m::Model,
objIndices::Vector{Cint},
objCoefs::Vector{Cdouble},
)
nnz = length(objIndices)
@assert nnz == length(objCoefs)
return KN_add_obj_linear_struct(m, nnz, objIndices, objCoefs)
end
function KN_add_obj_linear_struct(m::Model, objindex::Int, objCoefs::Cdouble)
return KN_add_obj_linear_struct(m, Cint[objindex], [objCoefs])
end
function KN_add_obj_quadratic_struct(
m::Model,
indexVars1::Vector{Cint},
indexVars2::Vector{Cint},
coefs::Vector{Cdouble},
)
nnz = length(indexVars1)
@assert nnz == length(indexVars2) == length(coefs)
return KN_add_obj_quadratic_struct(m, nnz, indexVars1, indexVars2, coefs)
end
#=
CONSTRAINTS
=#
function KN_add_cons(m::Model, ncons::Integer)
indexes = zeros(Cint, ncons)
KN_add_cons(m, ncons, indexes)
return indexes
end
function KN_add_con(m::Model)
index = Cint[0]
KN_add_con(m, index)
return index[1]
end
@kn_get_values get_con_lobnd Cdouble
@kn_get_values get_con_upbnd Cdouble
@kn_get_values get_con_eqbnd Cdouble
@kn_get_values get_con_dual_value Cdouble
@kn_get_values get_con_value Cdouble
function KN_add_con_linear_struct(
m::Model,
index_cons::Vector{Cint},
index_vars::Vector{Cint},
coefs::Vector{Cdouble},
)
@assert length(index_cons) == length(index_vars) == length(coefs)
nnz = length(index_cons)
return KN_add_con_linear_struct(m, nnz, index_cons, index_vars, coefs)
end
function KN_add_con_linear_struct(
m::Model,
index_con::Integer,
index_vars::Vector{Cint},
coefs::Vector{Cdouble},
)
@assert length(index_vars) == length(coefs)
nnz = length(index_vars)
return KN_add_con_linear_struct_one(m, nnz, index_con, index_vars, coefs)
end
function KN_add_con_linear_struct(
m::Model,
index_con::Integer,
index_var::Integer,
coef::Cdouble,
)
nnz = 1
return KN_add_con_linear_struct_one(m, nnz, index_con, [index_var], [coef])
end
function KN_add_con_quadratic_struct(
m::Model,
index_cons::Vector{Cint},
index_vars1::Vector{Cint},
index_vars2::Vector{Cint},
coefs::Vector{Cdouble},
)
@assert length(index_cons) ==
length(index_vars1) ==
length(index_vars2) ==
length(coefs)
nnz = length(index_cons)
return KN_add_con_quadratic_struct(m, nnz, index_cons, index_vars1, index_vars2, coefs)
end
function KN_add_con_quadratic_struct(
m::Model,
index_con::Integer,
index_vars1::Vector{Cint},
index_vars2::Vector{Cint},
coefs::Vector{Cdouble},
)
@assert length(index_vars1) == length(index_vars2) == length(coefs)
nnz = length(index_vars1)
return KN_add_con_quadratic_struct_one(
m,
nnz,
index_con,
index_vars1,
index_vars2,
coefs,
)
end
function KN_add_con_quadratic_struct(
m::Model,
index_con::Integer,
index_var1::Integer,
index_var2::Integer,
coef::Cdouble,
)
nnz = 1
return KN_add_con_quadratic_struct_one(
m,
nnz,
index_con,
Cint[index_var1],
Cint[index_var2],
[coef],
)
end
function KN_set_compcons(
m::Model,
ccTypes::Vector{Cint},
indexComps1::Vector{Cint},
indexComps2::Vector{Cint},
)
# get number of constraints
nnc = length(ccTypes)
@assert nnc == length(indexComps1) == length(indexComps2)
return KN_set_compcons(m, nnc, ccTypes, indexComps1, indexComps2)
end
#=
RESIDUALS
=#
function KN_add_rsds(m::Model, ncons::Integer)
indexes = zeros(Cint, ncons)
KN_add_rsds(m, ncons, indexes)
return indexes
end
function KN_add_rsd(m::Model)
index = Cint[0]
KN_add_rsd(m, index)
return index
end
function KN_add_rsd_linear_struct(
m::Model,
indexRsds::Vector{Cint},
indexVars::Vector{Cint},
coefs::Vector{Cdouble},
)
nnz = length(indexRsds)
@assert nnz == length(indexVars) == length(coefs)
return KN_add_rsd_linear_struct(m, nnz, indexRsds, indexVars, coefs)
end
function KN_add_rsd_linear_struct(
m::Model,
indexRsd::Integer,
indexVar::Vector{Cint},
coefs::Vector{Cdouble},
)
nnz = length(indexVar)
@assert nnz == length(coefs)
return KN_add_rsd_linear_struct_one(m, nnz, indexRsd, indexVar, coefs)
end
#=
SOLVE
=#
function KN_solve(m::Model)
# Check sanity. If model has Julia callbacks, we need to ensure
# that Knitro is not multithreaded. Otherwise, the code will segfault
# as we have trouble calling Julia code from multithreaded C
# code. See issue #93 on https://github.com/jump-dev/KNITRO.jl.
if has_callbacks(m)
if KNITRO_VERSION >= v"13.0"
KN_set_param(m, KN_PARAM_MS_NUMTHREADS, 1)
KN_set_param(m, KN_PARAM_NUMTHREADS, 1)
KN_set_param(m, KN_PARAM_MIP_NUMTHREADS, 1)
else
KN_set_param(m, "par_numthreads", 1)
KN_set_param(m, "par_msnumthreads", 1)
end
end
# For KN_solve, we do not return an error if ret is different of 0.
m.status = KN_solve(m.env)
return m.status
end
#=
GETTERS
=#
function KN_get_solution(m::Model)
# we first check that the model is well defined to avoid segfault
@assert m.env != C_NULL
nx = KN_get_number_vars(m)
nc = KN_get_number_cons(m)
x = zeros(Cdouble, nx)
lambda = zeros(Cdouble, nx + nc)
status = Cint[0]
obj = Cdouble[0.0]
KN_get_solution(m, status, obj, x, lambda)
# Keep solution in cache.
m.status = status[1]
m.x = x
m.mult = lambda
m.obj_val = obj[1]
return status[1], obj[1], x, lambda
end
# some wrapper functions for MOI
function get_status(m::Model)
@assert m.env != C_NULL
if m.status != 1
return m.status
end
status = Cint[0]
obj = Cdouble[0.0]
KN_get_solution(m, status, obj, C_NULL, C_NULL)
# Keep status in cache.
m.status = status[1]
return status[1]
end
function get_objective(m::Model)
@assert m.env != C_NULL
if isfinite(m.obj_val)
return m.obj_val
end
status = Cint[0]
obj = Cdouble[0.0]
KN_get_solution(m, status, obj, C_NULL, C_NULL)
# Keep objective value in cache.
m.obj_val = obj[1]
return obj[1]
end
function get_solution(m::Model)
# We first check that the model is well defined to avoid segfault.
@assert m.env != C_NULL
if !isempty(m.x)
return m.x
end
nx = KN_get_number_vars(m)
x = zeros(Cdouble, nx)
status = Cint[0]
obj = Cdouble[0.0]
KN_get_solution(m, status, obj, x, C_NULL)
# Keep solution in cache.
m.x = x
return x
end
get_solution(m::Model, ix::Int) = isempty(m.x) ? get_solution(m)[ix] : m.x[ix]
function get_dual(m::Model)
# we first check that the model is well defined to avoid segfault
@assert m.env != C_NULL
if !isempty(m.mult)
return m.mult
end
nx = KN_get_number_vars(m)
nc = KN_get_number_cons(m)
lambda = zeros(Cdouble, nx + nc)
status = Cint[0]
obj = Cdouble[0.0]
KN_get_solution(m, status, obj, C_NULL, lambda)
# Keep multipliers in cache.
m.mult = lambda
return lambda
end
get_dual(m::Model, ix::Int) = isempty(m.mult) ? get_dual(m)[ix] : m.mult[ix]
function KN_get_objgrad_values(m::Model)
nnz = KN_get_objgrad_nnz(m)
indexVars = zeros(Cint, nnz)
objGrad = zeros(Cdouble, nnz)
KN_get_objgrad_values(m, indexVars, objGrad)
return indexVars, objGrad
end
function KN_get_jacobian_values(m::Model)
nnz = KN_get_jacobian_nnz(m)
jacvars = zeros(Cint, nnz)
jaccons = zeros(Cint, nnz)
jaccoef = zeros(Cdouble, nnz)
KN_get_jacobian_values(m, jacvars, jaccons, jaccoef)
return jacvars, jaccons, jaccoef
end
function KN_get_rsd_jacobian_values(m::Model)
nnz = KN_get_rsd_jacobian_nnz(m)
jacvars = zeros(Cint, nnz)
jaccons = zeros(Cint, nnz)
jaccoef = zeros(Cdouble, nnz)
KN_get_rsd_jacobian_values(m, jacvars, jaccons, jaccoef)
return jacvars, jaccons, jaccoef
end
function KN_get_hessian_values(m::Model)
nnz = KN_get_hessian_nnz(m)
indexVars1 = zeros(Cint, nnz)
indexVars2 = zeros(Cint, nnz)
hess = zeros(Cdouble, nnz)
KN_get_hessian_values(m, indexVars1, indexVars2, hess)
return indexVars1, indexVars2, hess
end
function KN_get_var_viols(kc::Model, index::Vector{Cint})
bndInfeas = zeros(Cint, length(index))
intInfeas = zeros(Cint, length(index))
viols = zeros(Cdouble, length(index))
KN_get_var_viols(kc, length(index), index, bndInfeas, intInfeas, viols)
return bndInfeas, intInfeas, viols
end
function KN_get_con_viols(kc::Model, index::Vector{Cint})
infeas = zeros(Cint, length(index))
viols = zeros(Cdouble, length(index))
KN_get_con_viols(kc, length(index), index, infeas, viols)
return infeas, viols
end
function KN_get_presolve_error(m::Model)
@assert m.env != C_NULL
component, index, error = Cint[0], Cint[0], Cint[0]
viol = Cdouble[0.0]
KN_get_presolve_error(m, component, index, error, viol)
return convert(Bool, component[1]),
convert(Int64, index[1]),
convert(Int64, error[1]),
convert(Float64, viol[1])
end
@kn_get_attribute get_number_vars Cint
@kn_get_attribute get_number_cons Cint
@kn_get_attribute get_obj_value Cdouble
@kn_get_attribute get_obj_type Cint
@kn_get_attribute get_number_iters Cint
@kn_get_attribute get_number_cg_iters Cint
@kn_get_attribute get_abs_feas_error Cdouble
@kn_get_attribute get_rel_feas_error Cdouble
@kn_get_attribute get_abs_opt_error Cdouble
@kn_get_attribute get_rel_opt_error Cdouble
@kn_get_attribute get_objgrad_nnz Cint
@kn_get_attribute get_jacobian_nnz KNLONG
@kn_get_attribute get_rsd_jacobian_nnz KNLONG
@kn_get_attribute get_hessian_nnz KNLONG
@kn_get_attribute get_solve_time_cpu Cdouble
@kn_get_attribute get_solve_time_real Cdouble
@kn_get_attribute get_mip_number_nodes Cint
@kn_get_attribute get_mip_number_solves Cint
@kn_get_attribute get_mip_abs_gap Cdouble
@kn_get_attribute get_mip_rel_gap Cdouble
@kn_get_attribute get_mip_incumbent_obj Cdouble
@kn_get_attribute get_mip_relaxation_bnd Cdouble
@kn_get_attribute get_mip_lastnode_obj Cdouble
#=
PARAMS
=#
function KN_set_param(m::Model, id::Integer, value::Integer)
return KN_set_int_param(m, id, value)
end
function KN_set_param(m::Model, param::AbstractString, value::Integer)
return KN_set_int_param_by_name(m, param, value)
end
function KN_set_param(m::Model, id::Integer, value::Cdouble)
return KN_set_double_param(m, id, value)
end
function KN_set_param(m::Model, param::AbstractString, value::Cdouble)
return KN_set_double_param_by_name(m, param, value)
end
function KN_set_param(m::Model, id::Integer, value::AbstractString)
return KN_set_char_param(m, id, value)
end
function KN_set_param(m::Model, param::AbstractString, value::AbstractString)
return KN_set_char_param_by_name(m, param, value)
end
function KN_get_int_param(m::Model, id::Integer)
res = Cint[0]
KN_get_int_param(m, id, res)
return res[1]
end
function KN_get_int_param(m::Model, param::AbstractString)
res = Cint[0]
KN_get_int_param_by_name(m, param, res)
return res[1]
end
function KN_get_double_param(m::Model, id::Integer)
res = Cdouble[0.0]
KN_get_double_param(m, id, res)
return res[1]
end
function KN_get_double_param(m::Model, param::AbstractString)
res = Cdouble[0.0]
KN_get_double_param_by_name(m, param, res)
return res[1]
end
function KN_get_param_name(m::Model, id::Integer)
output_size = 128
res = " "^output_size
KN_get_param_name(m, id, res, output_size)
return _format_output(res)
end
function KN_get_param_doc(m::Model, id::Integer)
output_size = 128
res = " "^output_size
KN_get_param_doc(m, id, res, output_size)
return _format_output(res)
end
function KN_get_param_type(m::Model, id::Integer)
res = Cint[0]
KN_get_param_type(m, id, res)
return res[1]
end
function KN_get_num_param_values(m::Model, id::Integer)
res = Cint[0]
KN_get_num_param_values(m, id, res)
return res[1]
end
function KN_get_param_value_doc(m::Model, id::Integer, value_id::Integer)
output_size = 128
res = " "^output_size
KN_get_param_value_doc(m, id, value_id, res, output_size)
return _format_output(res)
end
function KN_get_param_id(m::Model, name::AbstractString)
res = Cint[0]
KN_get_param_id(m, name, res)
return res[1]
end
#=
NAMES
=#
function KN_get_var_names(m::Model, max_length=1024)
return String[
KN_get_var_names(m, Cint(id - 1), max_length) for id in 1:KN_get_number_vars(m)
]
end
function KN_get_var_names(m::Model, index::Vector{Cint}, max_length=1024)
return String[KN_get_var_names(m, id, max_length) for id in index]
end
function KN_get_var_names(m::Model, index::Cint, max_length=1024)
rawname = zeros(Cchar, max_length)
ret = KN_get_var_name(m, index, max_length, rawname)
return String(strip(String(convert(Vector{UInt8}, rawname)), '\0'))
end
function KN_get_con_names(m::Model, max_length=1024)
return String[
KN_get_con_names(m, Cint(id - 1), max_length) for id in 1:KN_get_number_cons(m)
]
end
function KN_get_con_names(m::Model, index::Vector{Cint}, max_length=1024)
return String[KN_get_con_names(m, id, max_length) for id in index]
end
function KN_get_con_names(m::Model, index::Cint, max_length=1024)
rawname = zeros(Cchar, max_length)
ret = KN_get_con_name(m, index, max_length, rawname)
return String(strip(String(convert(Vector{UInt8}, rawname)), '\0'))
end
| [
198,
1,
32,
15021,
284,
787,
4585,
22466,
2043,
13252,
338,
22466,
62,
9,
327,
7824,
257,
1310,
21723,
1,
198,
20285,
305,
638,
62,
535,
439,
7,
20786,
11,
26498,
23029,
198,
220,
220,
220,
277,
796,
7308,
13,
48526,
13,
421,
313,
7,
13940,
23650,
7203,
29132,
62,
3,
7,
20786,
16725,
4008,
198,
220,
220,
220,
26498,
796,
685,
3798,
7,
64,
8,
329,
257,
287,
26498,
60,
198,
220,
220,
220,
9577,
198,
220,
220,
220,
220,
220,
220,
220,
269,
13345,
7,
16763,
69,
11,
9195,
47095,
305,
828,
29568,
22046,
986,
4008,
198,
220,
220,
220,
886,
198,
437,
198,
198,
20285,
305,
638,
62,
1136,
62,
27160,
7,
8818,
62,
3672,
11,
2099,
8,
198,
220,
220,
220,
1438,
62,
12215,
934,
796,
366,
29132,
62,
1,
1635,
4731,
7,
8818,
62,
3672,
8,
198,
220,
220,
220,
1438,
62,
489,
1523,
796,
366,
29132,
62,
1,
1635,
4731,
7,
8818,
62,
3672,
8,
1635,
366,
82,
1,
198,
220,
220,
220,
277,
3672,
796,
38357,
7,
3672,
62,
489,
1523,
8,
198,
220,
220,
220,
277,
14933,
71,
419,
796,
38357,
7,
3672,
62,
12215,
934,
8,
198,
220,
220,
220,
1303,
28531,
286,
327,
2163,
287,
30495,
305,
13,
71,
198,
220,
220,
220,
269,
62,
69,
3672,
796,
38357,
7,
3672,
62,
12215,
934,
8,
198,
220,
220,
220,
269,
62,
69,
14933,
796,
38357,
7,
3672,
62,
489,
1523,
8,
198,
220,
220,
220,
269,
62,
69,
14933,
62,
439,
796,
38357,
7,
3672,
62,
489,
1523,
1635,
45434,
439,
4943,
628,
220,
220,
220,
299,
796,
611,
8833,
259,
7203,
7785,
1600,
1438,
62,
12215,
934,
8,
198,
220,
220,
220,
220,
220,
220,
220,
36147,
29132,
62,
1136,
62,
17618,
62,
85,
945,
7,
74,
66,
4008,
198,
220,
220,
220,
2073,
361,
8833,
259,
7203,
1102,
1600,
1438,
62,
12215,
934,
8,
198,
220,
220,
220,
220,
220,
220,
220,
36147,
29132,
62,
1136,
62,
17618,
62,
5936,
7,
74,
66,
4008,
198,
220,
220,
220,
886,
628,
220,
220,
220,
9577,
198,
220,
220,
220,
220,
220,
220,
220,
2163,
29568,
3798,
7,
69,
3672,
4008,
7,
74,
66,
3712,
17633,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
1976,
27498,
16763,
4906,
11,
720,
77,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
720,
66,
62,
69,
14933,
62,
439,
7,
74,
66,
11,
1255,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
1255,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
2163,
29568,
3798,
7,
69,
3672,
4008,
7,
74,
66,
3712,
17633,
11,
6376,
3712,
38469,
90,
34,
600,
30072,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
1976,
27498,
16763,
4906,
11,
4129,
7,
9630,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
720,
66,
62,
69,
14933,
7,
74,
66,
11,
4129,
7,
9630,
828,
6376,
11,
1255,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
1255,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
2163,
29568,
3798,
7,
69,
3672,
4008,
7,
74,
66,
3712,
17633,
11,
6376,
3712,
46541,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
1976,
27498,
16763,
4906,
11,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
720,
66,
62,
69,
3672,
7,
74,
66,
11,
6376,
11,
1255,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
1255,
58,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
29568,
3798,
7,
69,
14933,
71,
419,
4008,
7,
74,
66,
3712,
17633,
11,
6376,
3712,
46541,
8,
796,
29568,
3798,
7,
69,
3672,
4008,
7,
74,
66,
11,
6376,
8,
198,
220,
220,
220,
886,
198,
437,
198,
198,
20285,
305,
638,
62,
1136,
62,
42348,
7,
8818,
62,
3672,
11,
2099,
8,
198,
220,
220,
220,
277,
3672,
796,
38357,
7203,
29132,
62,
1,
1635,
4731,
7,
8818,
62,
3672,
4008,
198,
220,
220,
220,
9577,
198,
220,
220,
220,
220,
220,
220,
220,
2163,
29568,
3798,
7,
69,
3672,
4008,
7,
76,
3712,
17633,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1188,
796,
1976,
27498,
16763,
4906,
11,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1005,
796,
720,
69,
3672,
7,
76,
11,
1188,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
1188,
58,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
437,
198,
198,
1,
26227,
5072,
4504,
416,
22466,
2043,
13252,
355,
1774,
22300,
4731,
526,
198,
8818,
4808,
18982,
62,
22915,
7,
22915,
3712,
23839,
10100,
8,
198,
220,
220,
220,
1303,
4781,
25462,
13216,
10223,
198,
220,
220,
220,
581,
796,
10283,
7,
22915,
8,
198,
220,
220,
220,
1303,
4781,
2041,
3435,
198,
220,
220,
220,
1441,
581,
796,
10283,
7,
411,
11,
705,
59,
15,
11537,
198,
437,
198,
198,
1,
13615,
262,
1459,
22466,
2043,
13252,
2196,
526,
198,
8818,
651,
62,
20979,
3419,
198,
220,
220,
220,
18896,
796,
1315,
198,
220,
220,
220,
503,
796,
1976,
27498,
7,
34,
10641,
11,
18896,
8,
198,
220,
220,
220,
22466,
62,
1136,
62,
20979,
7,
11925,
11,
503,
8,
198,
220,
220,
220,
1441,
10903,
7,
36311,
7,
10100,
7,
1102,
1851,
7,
38469,
90,
52,
5317,
23,
5512,
503,
36911,
705,
59,
15,
6,
4008,
198,
437,
198,
198,
1,
36918,
2848,
329,
22466,
2043,
13252,
22466,
62,
22866,
526,
198,
76,
18187,
2878,
2039,
85,
198,
220,
220,
220,
50116,
62,
24330,
3712,
46745,
90,
34,
19382,
92,
628,
220,
220,
220,
2163,
2039,
85,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
50116,
20692,
62,
24330,
796,
6524,
90,
46745,
90,
34,
19382,
11709,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
581,
796,
22466,
62,
3605,
7,
20692,
20692,
62,
24330,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
581,
14512,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4049,
7203,
39044,
284,
19818,
257,
4938,
22466,
2043,
13252,
22466,
62,
22866,
13,
13047,
720,
411,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
649,
7,
20692,
20692,
62,
24330,
58,
12962,
198,
220,
220,
220,
886,
628,
220,
220,
220,
2039,
85,
7,
20692,
3712,
46745,
90,
34,
19382,
30072,
796,
649,
7,
20692,
8,
198,
437,
198,
198,
14881,
13,
13271,
8635,
62,
1102,
1851,
7,
20692,
3712,
6030,
90,
46745,
90,
34,
19382,
92,
5512,
17365,
3712,
4834,
85,
8,
796,
17365,
13,
20692,
62,
24330,
3712,
46745,
90,
34,
19382,
92,
198,
271,
62,
12102,
7,
24330,
3712,
4834,
85,
8,
796,
17365,
13,
20692,
62,
24330,
14512,
327,
62,
33991,
198,
198,
37811,
198,
11146,
477,
4088,
290,
2650,
597,
6102,
270,
305,
5964,
9477,
416,
4585,
22466,
62,
3605,
13,
198,
37811,
198,
8818,
1479,
62,
24330,
7,
24330,
3712,
4834,
85,
8,
198,
220,
220,
220,
611,
17365,
13,
20692,
62,
24330,
14512,
327,
62,
33991,
198,
220,
220,
220,
220,
220,
220,
220,
50116,
20692,
62,
24330,
796,
6524,
90,
46745,
90,
34,
19382,
11709,
7,
24330,
13,
20692,
62,
24330,
8,
198,
220,
220,
220,
220,
220,
220,
220,
22466,
62,
5787,
7,
20692,
20692,
62,
24330,
8,
198,
220,
220,
220,
220,
220,
220,
220,
17365,
13,
20692,
62,
24330,
796,
327,
62,
33991,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1441,
198,
437,
198,
198,
37811,
198,
1273,
5620,
31577,
262,
23838,
4732,
13,
198,
198,
10871,
12660,
869,
10146,
357,
1640,
9432,
11,
31312,
393,
339,
824,
666,
8,
198,
271,
7223,
284,
257,
3748,
23838,
4732,
13,
198,
198,
37811,
198,
76,
18187,
2878,
4889,
1891,
21947,
198,
220,
220,
220,
4732,
3712,
46745,
90,
34,
19382,
92,
198,
220,
220,
220,
299,
3712,
5317,
198,
220,
220,
220,
285,
3712,
5317,
198,
220,
220,
220,
1303,
3060,
257,
48589,
77,
560,
284,
3650,
2836,
42287,
13,
198,
220,
220,
220,
2836,
37266,
3712,
7149,
628,
220,
220,
220,
1303,
18650,
338,
869,
10146,
389,
4732,
10795,
11,
523,
3650,
198,
220,
220,
220,
1303,
606,
2641,
7256,
4889,
1891,
21947,
13,
198,
220,
220,
220,
5418,
62,
69,
3712,
22203,
198,
220,
220,
220,
5418,
62,
70,
3712,
22203,
198,
220,
220,
220,
5418,
62,
71,
3712,
22203,
198,
220,
220,
220,
5418,
62,
3808,
67,
3712,
22203,
198,
220,
220,
220,
5418,
62,
30482,
62,
3808,
67,
3712,
22203,
628,
220,
220,
220,
2163,
4889,
1891,
21947,
7,
20692,
62,
21101,
3712,
46745,
90,
34,
19382,
30072,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
649,
7,
20692,
62,
21101,
11,
657,
11,
657,
11,
2147,
8,
198,
220,
220,
220,
886,
198,
437,
198,
198,
14881,
13,
13271,
8635,
62,
1102,
1851,
7,
20692,
3712,
6030,
90,
46745,
90,
34,
19382,
92,
5512,
269,
65,
3712,
47258,
21947,
8,
796,
269,
65,
13,
22866,
3712,
46745,
90,
34,
19382,
92,
198,
198,
76,
18187,
2878,
9104,
198,
220,
220,
220,
1303,
22466,
2043,
13252,
4732,
2858,
13,
198,
220,
220,
220,
17365,
3712,
4834,
85,
198,
220,
220,
220,
1303,
9175,
4941,
284,
869,
10146,
329,
15413,
22967,
13,
198,
220,
220,
220,
869,
10146,
3712,
38469,
90,
47258,
21947,
92,
198,
220,
220,
220,
1303,
2773,
8573,
329,
2836,
10044,
4105,
198,
220,
220,
220,
7584,
62,
7220,
3712,
7149,
198,
220,
220,
220,
1963,
396,
433,
62,
7220,
3712,
7149,
198,
220,
220,
220,
285,
541,
62,
7220,
3712,
7149,
198,
220,
220,
220,
649,
4122,
62,
7220,
3712,
7149,
628,
220,
220,
220,
1303,
28186,
3815,
13,
198,
220,
220,
220,
1303,
30011,
1634,
3722,
13,
28701,
284,
352,
611,
1917,
318,
48180,
13,
198,
220,
220,
220,
3722,
3712,
34,
600,
198,
220,
220,
220,
26181,
62,
2100,
3712,
34,
23352,
198,
220,
220,
220,
2124,
3712,
38469,
90,
34,
23352,
92,
198,
220,
220,
220,
1963,
3712,
38469,
90,
34,
23352,
92,
628,
220,
220,
220,
1303,
6093,
869,
10146,
357,
917,
18156,
416,
4277,
737,
198,
220,
220,
220,
1303,
357,
5661,
5499,
466,
407,
4745,
319,
23838,
12493,
8,
198,
220,
220,
220,
13845,
62,
14681,
3712,
22203,
198,
220,
220,
220,
649,
457,
62,
47423,
3712,
22203,
198,
220,
220,
220,
285,
541,
62,
47423,
3712,
22203,
198,
220,
220,
220,
2836,
62,
47423,
3712,
22203,
198,
220,
220,
220,
13845,
62,
15003,
457,
62,
47423,
3712,
22203,
198,
220,
220,
220,
7584,
62,
47423,
3712,
22203,
628,
220,
220,
220,
1303,
28407,
273,
13,
198,
220,
220,
220,
2163,
9104,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2746,
796,
649,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2039,
85,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4889,
1891,
21947,
58,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2147,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2147,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2147,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2147,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4806,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
327,
23352,
58,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
327,
23352,
58,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
3060,
257,
15256,
273,
284,
6105,
12233,
2746,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2457,
7509,
7,
29132,
62,
5787,
11,
2746,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2746,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1303,
24470,
9386,
257,
649,
6102,
270,
305,
4554,
287,
1459,
2858,
4600,
24330,
44646,
198,
220,
220,
220,
2163,
9104,
7,
24330,
3712,
4834,
85,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
649,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17365,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4889,
1891,
21947,
58,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2147,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2147,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2147,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2147,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4806,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
327,
23352,
58,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
327,
23352,
58,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
886,
198,
437,
198,
198,
14881,
13,
13271,
8635,
62,
1102,
1851,
7,
20692,
3712,
6030,
90,
46745,
90,
34,
19382,
92,
5512,
638,
3712,
17633,
8,
796,
638,
13,
24330,
13,
20692,
62,
24330,
3712,
46745,
90,
34,
19382,
92,
198,
198,
1,
11146,
1540,
332,
2134,
526,
198,
29132,
62,
5787,
7,
76,
3712,
17633,
8,
796,
1479,
62,
24330,
7,
76,
13,
24330,
8,
198,
198,
1,
16447,
1540,
332,
2134,
526,
198,
29132,
62,
3605,
3419,
796,
9104,
3419,
198,
198,
271,
62,
12102,
7,
76,
3712,
17633,
8,
796,
318,
62,
12102,
7,
76,
13,
24330,
8,
198,
10134,
62,
13345,
10146,
7,
76,
3712,
17633,
8,
796,
5145,
271,
28920,
7,
76,
13,
13345,
10146,
8,
198,
30238,
62,
47423,
7,
19849,
3712,
17633,
11,
269,
65,
3712,
47258,
21947,
8,
796,
4574,
0,
7,
19849,
13,
13345,
10146,
11,
269,
65,
8,
198,
198,
8818,
7308,
13,
12860,
7,
952,
3712,
9399,
11,
285,
3712,
17633,
8,
198,
220,
220,
220,
611,
318,
62,
12102,
7,
76,
8,
198,
220,
220,
220,
220,
220,
220,
220,
44872,
7,
952,
11,
17971,
7,
1136,
62,
20979,
28955,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
44872,
7,
952,
11,
366,
19351,
6329,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
44872,
7,
952,
11,
366,
40781,
15684,
3969,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
44872,
7,
952,
11,
366,
19351,
6329,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
44872,
7,
952,
11,
366,
10267,
425,
3061,
25,
220,
1855,
48439,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
44872,
7,
952,
11,
366,
10267,
425,
2099,
25,
220,
29568,
29132,
62,
1136,
62,
26801,
62,
4906,
7,
76,
4008,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
44872,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
15057,
286,
9633,
25,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
29568,
29132,
62,
1136,
62,
17618,
62,
85,
945,
7,
76,
4008,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
44872,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
15057,
286,
17778,
25,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
29568,
29132,
62,
1136,
62,
17618,
62,
5936,
7,
76,
4008,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
44872,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
15057,
286,
1729,
9107,
418,
287,
12806,
666,
25,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
29568,
29132,
62,
1136,
62,
30482,
672,
666,
62,
20471,
89,
7,
76,
4008,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
44872,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
15057,
286,
1729,
9107,
418,
287,
46305,
666,
25,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
29568,
29132,
62,
1136,
62,
33979,
666,
62,
20471,
89,
7,
76,
4008,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
44872,
7,
952,
11,
366,
29132,
2043,
13252,
20647,
25,
15697,
4943,
198,
220,
220,
220,
886,
198,
437,
198,
198,
2,
28,
198,
220,
220,
220,
37125,
5964,
4706,
198,
46249,
198,
37811,
198,
6030,
14305,
329,
262,
943,
660,
27385,
13789,
9142,
4732,
2134,
13,
198,
41995,
1276,
407,
13096,
597,
636,
286,
262,
4732,
13,
198,
37811,
198,
76,
18187,
2878,
37125,
22866,
198,
220,
220,
220,
50116,
62,
75,
76,
22866,
3712,
46745,
90,
34,
19382,
92,
198,
220,
220,
220,
1303,
9175,
257,
17562,
284,
9113,
12931,
4981,
287,
1502,
284,
1479,
198,
220,
220,
220,
1303,
4088,
6105,
13,
198,
220,
220,
220,
6692,
62,
27530,
3712,
38469,
90,
17633,
92,
628,
220,
220,
220,
2163,
37125,
22866,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
50116,
5420,
796,
6524,
90,
46745,
90,
34,
19382,
11709,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
581,
796,
22466,
62,
9122,
448,
62,
43085,
7,
20692,
5420,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
581,
14512,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4049,
7203,
29132,
2043,
13252,
25,
13047,
28006,
5964,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
300,
76,
796,
649,
7,
20692,
5420,
58,
4357,
9104,
58,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2457,
7509,
7,
29132,
62,
20979,
62,
43085,
11,
300,
76,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
300,
76,
198,
220,
220,
220,
886,
198,
437,
198,
14881,
13,
13271,
8635,
62,
1102,
1851,
7,
20692,
3712,
6030,
90,
46745,
90,
34,
19382,
92,
5512,
300,
76,
3712,
31288,
22866,
8,
796,
300,
76,
13,
20692,
62,
75,
76,
22866,
3712,
46745,
90,
34,
19382,
92,
198,
198,
8818,
2039,
85,
7,
75,
76,
3712,
31288,
22866,
8,
198,
220,
220,
220,
50116,
20692,
62,
24330,
796,
6524,
90,
46745,
90,
34,
19382,
11709,
3419,
198,
220,
220,
220,
581,
796,
22466,
62,
3605,
62,
75,
76,
7,
75,
76,
11,
50116,
20692,
62,
24330,
8,
198,
220,
220,
220,
611,
581,
14512,
657,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
7203,
39044,
284,
19818,
257,
4938,
22466,
2043,
13252,
22466,
62,
22866,
13,
13047,
720,
411,
4943,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1441,
2039,
85,
7,
20692,
20692,
62,
24330,
58,
12962,
198,
437,
198,
198,
8818,
10199,
0,
7,
75,
76,
3712,
31288,
22866,
11,
2746,
3712,
17633,
8,
198,
220,
220,
220,
4574,
0,
7,
75,
76,
13,
25614,
62,
27530,
11,
2746,
8,
198,
220,
220,
220,
1441,
198,
437,
198,
198,
2,
2251,
9104,
351,
5964,
4706,
198,
8818,
9104,
7,
75,
76,
3712,
31288,
22866,
8,
198,
220,
220,
220,
2746,
796,
9104,
7,
4834,
85,
7,
75,
76,
4008,
198,
220,
220,
220,
10199,
0,
7,
75,
76,
11,
2746,
8,
198,
220,
220,
220,
1441,
2746,
198,
437,
198,
29132,
62,
3605,
62,
75,
76,
7,
75,
76,
3712,
31288,
22866,
8,
796,
9104,
7,
75,
76,
8,
198,
198,
8818,
22466,
62,
20979,
62,
43085,
7,
75,
76,
3712,
31288,
22866,
8,
198,
220,
220,
220,
1303,
3274,
11,
4155,
326,
477,
6692,
4981,
389,
6105,
13459,
198,
220,
220,
220,
1303,
878,
13011,
5964,
4706,
0,
198,
220,
220,
220,
22466,
62,
5787,
12195,
75,
76,
13,
25614,
62,
27530,
8,
628,
220,
220,
220,
611,
300,
76,
13,
20692,
62,
75,
76,
22866,
14512,
327,
62,
33991,
198,
220,
220,
220,
220,
220,
220,
220,
1006,
20692,
796,
6524,
90,
46745,
90,
34,
19382,
11709,
7,
75,
76,
13,
20692,
62,
75,
76,
22866,
8,
198,
220,
220,
220,
220,
220,
220,
220,
22466,
62,
20979,
62,
43085,
7,
5420,
20692,
8,
198,
220,
220,
220,
220,
220,
220,
220,
300,
76,
13,
20692,
62,
75,
76,
22866,
796,
327,
62,
33991,
198,
220,
220,
220,
886,
198,
437,
198,
198,
2,
28,
198,
220,
220,
220,
569,
1503,
3539,
9148,
1546,
198,
46249,
198,
8818,
22466,
62,
2860,
62,
7785,
7,
76,
3712,
17633,
8,
198,
220,
220,
220,
6376,
796,
327,
600,
58,
15,
60,
198,
220,
220,
220,
22466,
62,
2860,
62,
7785,
7,
76,
11,
6376,
8,
198,
220,
220,
220,
1441,
6376,
58,
16,
60,
198,
437,
198,
8818,
22466,
62,
2860,
62,
85,
945,
7,
76,
3712,
17633,
11,
299,
85,
945,
3712,
5317,
8,
198,
220,
220,
220,
39199,
796,
1976,
27498,
7,
34,
600,
11,
299,
85,
945,
8,
198,
220,
220,
220,
22466,
62,
2860,
62,
85,
945,
7,
76,
11,
299,
85,
945,
11,
39199,
8,
198,
220,
220,
220,
1441,
39199,
198,
437,
198,
198,
31,
15418,
62,
1136,
62,
27160,
651,
62,
7785,
62,
75,
672,
358,
327,
23352,
198,
31,
15418,
62,
1136,
62,
27160,
651,
62,
7785,
62,
929,
65,
358,
327,
23352,
198,
31,
15418,
62,
1136,
62,
27160,
651,
62,
7785,
62,
27363,
65,
358,
327,
23352,
198,
31,
15418,
62,
1136,
62,
27160,
651,
62,
7785,
62,
21373,
65,
358,
327,
23352,
198,
31,
15418,
62,
1136,
62,
27160,
651,
62,
7785,
62,
1050,
4402,
62,
8367,
327,
23352,
198,
31,
15418,
62,
1136,
62,
27160,
651,
62,
7785,
62,
646,
282,
62,
8367,
327,
23352,
198,
31,
15418,
62,
1136,
62,
27160,
651,
62,
7785,
62,
4906,
327,
600,
198,
198,
2,
28,
198,
220,
220,
220,
25334,
23680,
9306,
198,
46249,
198,
8818,
22466,
62,
2860,
62,
26801,
62,
29127,
62,
7249,
7,
198,
220,
220,
220,
285,
3712,
17633,
11,
198,
220,
220,
220,
26181,
5497,
1063,
3712,
38469,
90,
34,
600,
5512,
198,
220,
220,
220,
26181,
7222,
891,
82,
3712,
38469,
90,
34,
23352,
5512,
198,
8,
198,
220,
220,
220,
299,
27305,
796,
4129,
7,
26801,
5497,
1063,
8,
198,
220,
220,
220,
2488,
30493,
299,
27305,
6624,
4129,
7,
26801,
7222,
891,
82,
8,
198,
220,
220,
220,
1441,
22466,
62,
2860,
62,
26801,
62,
29127,
62,
7249,
7,
76,
11,
299,
27305,
11,
26181,
5497,
1063,
11,
26181,
7222,
891,
82,
8,
198,
437,
198,
8818,
22466,
62,
2860,
62,
26801,
62,
29127,
62,
7249,
7,
76,
3712,
17633,
11,
26181,
9630,
3712,
5317,
11,
26181,
7222,
891,
82,
3712,
34,
23352,
8,
198,
220,
220,
220,
1441,
22466,
62,
2860,
62,
26801,
62,
29127,
62,
7249,
7,
76,
11,
327,
600,
58,
26801,
9630,
4357,
685,
26801,
7222,
891,
82,
12962,
198,
437,
198,
198,
8818,
22466,
62,
2860,
62,
26801,
62,
421,
41909,
1512,
62,
7249,
7,
198,
220,
220,
220,
285,
3712,
17633,
11,
198,
220,
220,
220,
6376,
53,
945,
16,
3712,
38469,
90,
34,
600,
5512,
198,
220,
220,
220,
6376,
53,
945,
17,
3712,
38469,
90,
34,
600,
5512,
198,
220,
220,
220,
763,
891,
82,
3712,
38469,
90,
34,
23352,
5512,
198,
8,
198,
220,
220,
220,
299,
27305,
796,
4129,
7,
9630,
53,
945,
16,
8,
198,
220,
220,
220,
2488,
30493,
299,
27305,
6624,
4129,
7,
9630,
53,
945,
17,
8,
6624,
4129,
7,
1073,
891,
82,
8,
198,
220,
220,
220,
1441,
22466,
62,
2860,
62,
26801,
62,
421,
41909,
1512,
62,
7249,
7,
76,
11,
299,
27305,
11,
6376,
53,
945,
16,
11,
6376,
53,
945,
17,
11,
763,
891,
82,
8,
198,
437,
198,
198,
2,
28,
198,
220,
220,
220,
7102,
2257,
3861,
1268,
4694,
198,
46249,
198,
8818,
22466,
62,
2860,
62,
5936,
7,
76,
3712,
17633,
11,
299,
5936,
3712,
46541,
8,
198,
220,
220,
220,
39199,
796,
1976,
27498,
7,
34,
600,
11,
299,
5936,
8,
198,
220,
220,
220,
22466,
62,
2860,
62,
5936,
7,
76,
11,
299,
5936,
11,
39199,
8,
198,
220,
220,
220,
1441,
39199,
198,
437,
198,
8818,
22466,
62,
2860,
62,
1102,
7,
76,
3712,
17633,
8,
198,
220,
220,
220,
6376,
796,
327,
600,
58,
15,
60,
198,
220,
220,
220,
22466,
62,
2860,
62,
1102,
7,
76,
11,
6376,
8,
198,
220,
220,
220,
1441,
6376,
58,
16,
60,
198,
437,
198,
198,
31,
15418,
62,
1136,
62,
27160,
651,
62,
1102,
62,
75,
672,
358,
327,
23352,
198,
31,
15418,
62,
1136,
62,
27160,
651,
62,
1102,
62,
929,
65,
358,
327,
23352,
198,
31,
15418,
62,
1136,
62,
27160,
651,
62,
1102,
62,
27363,
65,
358,
327,
23352,
198,
31,
15418,
62,
1136,
62,
27160,
651,
62,
1102,
62,
646,
282,
62,
8367,
327,
23352,
198,
31,
15418,
62,
1136,
62,
27160,
651,
62,
1102,
62,
8367,
327,
23352,
198,
198,
8818,
22466,
62,
2860,
62,
1102,
62,
29127,
62,
7249,
7,
198,
220,
220,
220,
285,
3712,
17633,
11,
198,
220,
220,
220,
6376,
62,
5936,
3712,
38469,
90,
34,
600,
5512,
198,
220,
220,
220,
6376,
62,
85,
945,
3712,
38469,
90,
34,
600,
5512,
198,
220,
220,
220,
763,
891,
82,
3712,
38469,
90,
34,
23352,
5512,
198,
8,
198,
220,
220,
220,
2488,
30493,
4129,
7,
9630,
62,
5936,
8,
6624,
4129,
7,
9630,
62,
85,
945,
8,
6624,
4129,
7,
1073,
891,
82,
8,
198,
220,
220,
220,
299,
27305,
796,
4129,
7,
9630,
62,
5936,
8,
198,
220,
220,
220,
1441,
22466,
62,
2860,
62,
1102,
62,
29127,
62,
7249,
7,
76,
11,
299,
27305,
11,
6376,
62,
5936,
11,
6376,
62,
85,
945,
11,
763,
891,
82,
8,
198,
437,
198,
8818,
22466,
62,
2860,
62,
1102,
62,
29127,
62,
7249,
7,
198,
220,
220,
220,
285,
3712,
17633,
11,
198,
220,
220,
220,
6376,
62,
1102,
3712,
46541,
11,
198,
220,
220,
220,
6376,
62,
85,
945,
3712,
38469,
90,
34,
600,
5512,
198,
220,
220,
220,
763,
891,
82,
3712,
38469,
90,
34,
23352,
5512,
198,
8,
198,
220,
220,
220,
2488,
30493,
4129,
7,
9630,
62,
85,
945,
8,
6624,
4129,
7,
1073,
891,
82,
8,
198,
220,
220,
220,
299,
27305,
796,
4129,
7,
9630,
62,
85,
945,
8,
198,
220,
220,
220,
1441,
22466,
62,
2860,
62,
1102,
62,
29127,
62,
7249,
62,
505,
7,
76,
11,
299,
27305,
11,
6376,
62,
1102,
11,
6376,
62,
85,
945,
11,
763,
891,
82,
8,
198,
437,
198,
8818,
22466,
62,
2860,
62,
1102,
62,
29127,
62,
7249,
7,
198,
220,
220,
220,
285,
3712,
17633,
11,
198,
220,
220,
220,
6376,
62,
1102,
3712,
46541,
11,
198,
220,
220,
220,
6376,
62,
7785,
3712,
46541,
11,
198,
220,
220,
220,
763,
891,
3712,
34,
23352,
11,
198,
8,
198,
220,
220,
220,
299,
27305,
796,
352,
198,
220,
220,
220,
1441,
22466,
62,
2860,
62,
1102,
62,
29127,
62,
7249,
62,
505,
7,
76,
11,
299,
27305,
11,
6376,
62,
1102,
11,
685,
9630,
62,
7785,
4357,
685,
1073,
891,
12962,
198,
437,
198,
198,
8818,
22466,
62,
2860,
62,
1102,
62,
421,
41909,
1512,
62,
7249,
7,
198,
220,
220,
220,
285,
3712,
17633,
11,
198,
220,
220,
220,
6376,
62,
5936,
3712,
38469,
90,
34,
600,
5512,
198,
220,
220,
220,
6376,
62,
85,
945,
16,
3712,
38469,
90,
34,
600,
5512,
198,
220,
220,
220,
6376,
62,
85,
945,
17,
3712,
38469,
90,
34,
600,
5512,
198,
220,
220,
220,
763,
891,
82,
3712,
38469,
90,
34,
23352,
5512,
198,
8,
198,
220,
220,
220,
2488,
30493,
4129,
7,
9630,
62,
5936,
8,
6624,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4129,
7,
9630,
62,
85,
945,
16,
8,
6624,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4129,
7,
9630,
62,
85,
945,
17,
8,
6624,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4129,
7,
1073,
891,
82,
8,
198,
220,
220,
220,
299,
27305,
796,
4129,
7,
9630,
62,
5936,
8,
198,
220,
220,
220,
1441,
22466,
62,
2860,
62,
1102,
62,
421,
41909,
1512,
62,
7249,
7,
76,
11,
299,
27305,
11,
6376,
62,
5936,
11,
6376,
62,
85,
945,
16,
11,
6376,
62,
85,
945,
17,
11,
763,
891,
82,
8,
198,
437,
198,
8818,
22466,
62,
2860,
62,
1102,
62,
421,
41909,
1512,
62,
7249,
7,
198,
220,
220,
220,
285,
3712,
17633,
11,
198,
220,
220,
220,
6376,
62,
1102,
3712,
46541,
11,
198,
220,
220,
220,
6376,
62,
85,
945,
16,
3712,
38469,
90,
34,
600,
5512,
198,
220,
220,
220,
6376,
62,
85,
945,
17,
3712,
38469,
90,
34,
600,
5512,
198,
220,
220,
220,
763,
891,
82,
3712,
38469,
90,
34,
23352,
5512,
198,
8,
198,
220,
220,
220,
2488,
30493,
4129,
7,
9630,
62,
85,
945,
16,
8,
6624,
4129,
7,
9630,
62,
85,
945,
17,
8,
6624,
4129,
7,
1073,
891,
82,
8,
198,
220,
220,
220,
299,
27305,
796,
4129,
7,
9630,
62,
85,
945,
16,
8,
198,
220,
220,
220,
1441,
22466,
62,
2860,
62,
1102,
62,
421,
41909,
1512,
62,
7249,
62,
505,
7,
198,
220,
220,
220,
220,
220,
220,
220,
285,
11,
198,
220,
220,
220,
220,
220,
220,
220,
299,
27305,
11,
198,
220,
220,
220,
220,
220,
220,
220,
6376,
62,
1102,
11,
198,
220,
220,
220,
220,
220,
220,
220,
6376,
62,
85,
945,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
6376,
62,
85,
945,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
763,
891,
82,
11,
198,
220,
220,
220,
1267,
198,
437,
198,
8818,
22466,
62,
2860,
62,
1102,
62,
421,
41909,
1512,
62,
7249,
7,
198,
220,
220,
220,
285,
3712,
17633,
11,
198,
220,
220,
220,
6376,
62,
1102,
3712,
46541,
11,
198,
220,
220,
220,
6376,
62,
7785,
16,
3712,
46541,
11,
198,
220,
220,
220,
6376,
62,
7785,
17,
3712,
46541,
11,
198,
220,
220,
220,
763,
891,
3712,
34,
23352,
11,
198,
8,
198,
220,
220,
220,
299,
27305,
796,
352,
198,
220,
220,
220,
1441,
22466,
62,
2860,
62,
1102,
62,
421,
41909,
1512,
62,
7249,
62,
505,
7,
198,
220,
220,
220,
220,
220,
220,
220,
285,
11,
198,
220,
220,
220,
220,
220,
220,
220,
299,
27305,
11,
198,
220,
220,
220,
220,
220,
220,
220,
6376,
62,
1102,
11,
198,
220,
220,
220,
220,
220,
220,
220,
327,
600,
58,
9630,
62,
7785,
16,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
327,
600,
58,
9630,
62,
7785,
17,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
685,
1073,
891,
4357,
198,
220,
220,
220,
1267,
198,
437,
198,
198,
8818,
22466,
62,
2617,
62,
5589,
5936,
7,
198,
220,
220,
220,
285,
3712,
17633,
11,
198,
220,
220,
220,
36624,
31431,
3712,
38469,
90,
34,
600,
5512,
198,
220,
220,
220,
6376,
5377,
862,
16,
3712,
38469,
90,
34,
600,
5512,
198,
220,
220,
220,
6376,
5377,
862,
17,
3712,
38469,
90,
34,
600,
5512,
198,
8,
198,
220,
220,
220,
1303,
651,
1271,
286,
17778,
198,
220,
220,
220,
299,
10782,
796,
4129,
7,
535,
31431,
8,
198,
220,
220,
220,
2488,
30493,
299,
10782,
6624,
4129,
7,
9630,
5377,
862,
16,
8,
6624,
4129,
7,
9630,
5377,
862,
17,
8,
198,
220,
220,
220,
1441,
22466,
62,
2617,
62,
5589,
5936,
7,
76,
11,
299,
10782,
11,
36624,
31431,
11,
6376,
5377,
862,
16,
11,
6376,
5377,
862,
17,
8,
198,
437,
198,
198,
2,
28,
198,
220,
220,
220,
15731,
2389,
52,
23333,
198,
46249,
198,
8818,
22466,
62,
2860,
62,
3808,
9310,
7,
76,
3712,
17633,
11,
299,
5936,
3712,
46541,
8,
198,
220,
220,
220,
39199,
796,
1976,
27498,
7,
34,
600,
11,
299,
5936,
8,
198,
220,
220,
220,
22466,
62,
2860,
62,
3808,
9310,
7,
76,
11,
299,
5936,
11,
39199,
8,
198,
220,
220,
220,
1441,
39199,
198,
437,
198,
8818,
22466,
62,
2860,
62,
3808,
67,
7,
76,
3712,
17633,
8,
198,
220,
220,
220,
6376,
796,
327,
600,
58,
15,
60,
198,
220,
220,
220,
22466,
62,
2860,
62,
3808,
67,
7,
76,
11,
6376,
8,
198,
220,
220,
220,
1441,
6376,
198,
437,
198,
198,
8818,
22466,
62,
2860,
62,
3808,
67,
62,
29127,
62,
7249,
7,
198,
220,
220,
220,
285,
3712,
17633,
11,
198,
220,
220,
220,
6376,
31273,
9310,
3712,
38469,
90,
34,
600,
5512,
198,
220,
220,
220,
6376,
53,
945,
3712,
38469,
90,
34,
600,
5512,
198,
220,
220,
220,
763,
891,
82,
3712,
38469,
90,
34,
23352,
5512,
198,
8,
198,
220,
220,
220,
299,
27305,
796,
4129,
7,
9630,
31273,
9310,
8,
198,
220,
220,
220,
2488,
30493,
299,
27305,
6624,
4129,
7,
9630,
53,
945,
8,
6624,
4129,
7,
1073,
891,
82,
8,
198,
220,
220,
220,
1441,
22466,
62,
2860,
62,
3808,
67,
62,
29127,
62,
7249,
7,
76,
11,
299,
27305,
11,
6376,
31273,
9310,
11,
6376,
53,
945,
11,
763,
891,
82,
8,
198,
437,
198,
8818,
22466,
62,
2860,
62,
3808,
67,
62,
29127,
62,
7249,
7,
198,
220,
220,
220,
285,
3712,
17633,
11,
198,
220,
220,
220,
6376,
49,
21282,
3712,
46541,
11,
198,
220,
220,
220,
6376,
19852,
3712,
38469,
90,
34,
600,
5512,
198,
220,
220,
220,
763,
891,
82,
3712,
38469,
90,
34,
23352,
5512,
198,
8,
198,
220,
220,
220,
299,
27305,
796,
4129,
7,
9630,
19852,
8,
198,
220,
220,
220,
2488,
30493,
299,
27305,
6624,
4129,
7,
1073,
891,
82,
8,
198,
220,
220,
220,
1441,
22466,
62,
2860,
62,
3808,
67,
62,
29127,
62,
7249,
62,
505,
7,
76,
11,
299,
27305,
11,
6376,
49,
21282,
11,
6376,
19852,
11,
763,
891,
82,
8,
198,
437,
198,
198,
2,
28,
198,
220,
220,
220,
36817,
6089,
198,
46249,
198,
8818,
22466,
62,
82,
6442,
7,
76,
3712,
17633,
8,
198,
220,
220,
220,
1303,
6822,
34182,
13,
1002,
2746,
468,
22300,
869,
10146,
11,
356,
761,
284,
4155,
198,
220,
220,
220,
1303,
326,
6102,
270,
305,
318,
407,
1963,
342,
961,
276,
13,
15323,
11,
262,
2438,
481,
384,
70,
69,
1721,
198,
220,
220,
220,
1303,
355,
356,
423,
5876,
4585,
22300,
2438,
422,
1963,
342,
961,
276,
327,
198,
220,
220,
220,
1303,
2438,
13,
4091,
2071,
1303,
6052,
319,
3740,
1378,
12567,
13,
785,
14,
43327,
12,
7959,
14,
29132,
2043,
13252,
13,
20362,
13,
198,
220,
220,
220,
611,
468,
62,
13345,
10146,
7,
76,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
22466,
2043,
13252,
62,
43717,
18189,
410,
1,
1485,
13,
15,
1,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22466,
62,
2617,
62,
17143,
7,
76,
11,
22466,
62,
27082,
2390,
62,
5653,
62,
41359,
4221,
15675,
50,
11,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22466,
62,
2617,
62,
17143,
7,
76,
11,
22466,
62,
27082,
2390,
62,
41359,
4221,
15675,
50,
11,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22466,
62,
2617,
62,
17143,
7,
76,
11,
22466,
62,
27082,
2390,
62,
44,
4061,
62,
41359,
4221,
15675,
50,
11,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22466,
62,
2617,
62,
17143,
7,
76,
11,
366,
1845,
62,
22510,
16663,
82,
1600,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22466,
62,
2617,
62,
17143,
7,
76,
11,
366,
1845,
62,
907,
22510,
16663,
82,
1600,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1303,
1114,
22466,
62,
82,
6442,
11,
356,
466,
407,
1441,
281,
4049,
611,
1005,
318,
1180,
286,
657,
13,
198,
220,
220,
220,
285,
13,
13376,
796,
22466,
62,
82,
6442,
7,
76,
13,
24330,
8,
198,
220,
220,
220,
1441,
285,
13,
13376,
198,
437,
198,
198,
2,
28,
198,
220,
220,
220,
17151,
51,
4877,
198,
46249,
198,
8818,
22466,
62,
1136,
62,
82,
2122,
7,
76,
3712,
17633,
8,
198,
220,
220,
220,
1303,
356,
717,
2198,
326,
262,
2746,
318,
880,
5447,
284,
3368,
384,
70,
69,
1721,
198,
220,
220,
220,
2488,
30493,
285,
13,
24330,
14512,
327,
62,
33991,
198,
220,
220,
220,
299,
87,
796,
22466,
62,
1136,
62,
17618,
62,
85,
945,
7,
76,
8,
198,
220,
220,
220,
299,
66,
796,
22466,
62,
1136,
62,
17618,
62,
5936,
7,
76,
8,
628,
220,
220,
220,
2124,
796,
1976,
27498,
7,
34,
23352,
11,
299,
87,
8,
198,
220,
220,
220,
37456,
796,
1976,
27498,
7,
34,
23352,
11,
299,
87,
1343,
299,
66,
8,
198,
220,
220,
220,
3722,
796,
327,
600,
58,
15,
60,
198,
220,
220,
220,
26181,
796,
327,
23352,
58,
15,
13,
15,
60,
628,
220,
220,
220,
22466,
62,
1136,
62,
82,
2122,
7,
76,
11,
3722,
11,
26181,
11,
2124,
11,
37456,
8,
628,
220,
220,
220,
1303,
9175,
4610,
287,
12940,
13,
198,
220,
220,
220,
285,
13,
13376,
796,
3722,
58,
16,
60,
198,
220,
220,
220,
285,
13,
87,
796,
2124,
198,
220,
220,
220,
285,
13,
16680,
796,
37456,
198,
220,
220,
220,
285,
13,
26801,
62,
2100,
796,
26181,
58,
16,
60,
198,
220,
220,
220,
1441,
3722,
58,
16,
4357,
26181,
58,
16,
4357,
2124,
11,
37456,
198,
437,
198,
198,
2,
617,
29908,
5499,
329,
13070,
40,
198,
8818,
651,
62,
13376,
7,
76,
3712,
17633,
8,
198,
220,
220,
220,
2488,
30493,
285,
13,
24330,
14512,
327,
62,
33991,
198,
220,
220,
220,
611,
285,
13,
13376,
14512,
352,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
285,
13,
13376,
198,
220,
220,
220,
886,
198,
220,
220,
220,
3722,
796,
327,
600,
58,
15,
60,
198,
220,
220,
220,
26181,
796,
327,
23352,
58,
15,
13,
15,
60,
198,
220,
220,
220,
22466,
62,
1136,
62,
82,
2122,
7,
76,
11,
3722,
11,
26181,
11,
327,
62,
33991,
11,
327,
62,
33991,
8,
198,
220,
220,
220,
1303,
9175,
3722,
287,
12940,
13,
198,
220,
220,
220,
285,
13,
13376,
796,
3722,
58,
16,
60,
198,
220,
220,
220,
1441,
3722,
58,
16,
60,
198,
437,
198,
198,
8818,
651,
62,
15252,
425,
7,
76,
3712,
17633,
8,
198,
220,
220,
220,
2488,
30493,
285,
13,
24330,
14512,
327,
62,
33991,
198,
220,
220,
220,
611,
318,
69,
9504,
7,
76,
13,
26801,
62,
2100,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
285,
13,
26801,
62,
2100,
198,
220,
220,
220,
886,
198,
220,
220,
220,
3722,
796,
327,
600,
58,
15,
60,
198,
220,
220,
220,
26181,
796,
327,
23352,
58,
15,
13,
15,
60,
198,
220,
220,
220,
22466,
62,
1136,
62,
82,
2122,
7,
76,
11,
3722,
11,
26181,
11,
327,
62,
33991,
11,
327,
62,
33991,
8,
198,
220,
220,
220,
1303,
9175,
9432,
1988,
287,
12940,
13,
198,
220,
220,
220,
285,
13,
26801,
62,
2100,
796,
26181,
58,
16,
60,
198,
220,
220,
220,
1441,
26181,
58,
16,
60,
198,
437,
198,
198,
8818,
651,
62,
82,
2122,
7,
76,
3712,
17633,
8,
198,
220,
220,
220,
1303,
775,
717,
2198,
326,
262,
2746,
318,
880,
5447,
284,
3368,
384,
70,
69,
1721,
13,
198,
220,
220,
220,
2488,
30493,
285,
13,
24330,
14512,
327,
62,
33991,
198,
220,
220,
220,
611,
5145,
271,
28920,
7,
76,
13,
87,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
285,
13,
87,
198,
220,
220,
220,
886,
198,
220,
220,
220,
299,
87,
796,
22466,
62,
1136,
62,
17618,
62,
85,
945,
7,
76,
8,
198,
220,
220,
220,
2124,
796,
1976,
27498,
7,
34,
23352,
11,
299,
87,
8,
198,
220,
220,
220,
3722,
796,
327,
600,
58,
15,
60,
198,
220,
220,
220,
26181,
796,
327,
23352,
58,
15,
13,
15,
60,
198,
220,
220,
220,
22466,
62,
1136,
62,
82,
2122,
7,
76,
11,
3722,
11,
26181,
11,
2124,
11,
327,
62,
33991,
8,
198,
220,
220,
220,
1303,
9175,
4610,
287,
12940,
13,
198,
220,
220,
220,
285,
13,
87,
796,
2124,
198,
220,
220,
220,
1441,
2124,
198,
437,
198,
1136,
62,
82,
2122,
7,
76,
3712,
17633,
11,
220,
844,
3712,
5317,
8,
796,
318,
28920,
7,
76,
13,
87,
8,
5633,
651,
62,
82,
2122,
7,
76,
38381,
844,
60,
1058,
285,
13,
87,
58,
844,
60,
198,
198,
8818,
651,
62,
646,
282,
7,
76,
3712,
17633,
8,
198,
220,
220,
220,
1303,
356,
717,
2198,
326,
262,
2746,
318,
880,
5447,
284,
3368,
384,
70,
69,
1721,
198,
220,
220,
220,
2488,
30493,
285,
13,
24330,
14512,
327,
62,
33991,
198,
220,
220,
220,
611,
5145,
271,
28920,
7,
76,
13,
16680,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
285,
13,
16680,
198,
220,
220,
220,
886,
198,
220,
220,
220,
299,
87,
796,
22466,
62,
1136,
62,
17618,
62,
85,
945,
7,
76,
8,
198,
220,
220,
220,
299,
66,
796,
22466,
62,
1136,
62,
17618,
62,
5936,
7,
76,
8,
198,
220,
220,
220,
37456,
796,
1976,
27498,
7,
34,
23352,
11,
299,
87,
1343,
299,
66,
8,
198,
220,
220,
220,
3722,
796,
327,
600,
58,
15,
60,
198,
220,
220,
220,
26181,
796,
327,
23352,
58,
15,
13,
15,
60,
198,
220,
220,
220,
22466,
62,
1136,
62,
82,
2122,
7,
76,
11,
3722,
11,
26181,
11,
327,
62,
33991,
11,
37456,
8,
198,
220,
220,
220,
1303,
9175,
15082,
3183,
287,
12940,
13,
198,
220,
220,
220,
285,
13,
16680,
796,
37456,
198,
220,
220,
220,
1441,
37456,
198,
437,
198,
1136,
62,
646,
282,
7,
76,
3712,
17633,
11,
220,
844,
3712,
5317,
8,
796,
318,
28920,
7,
76,
13,
16680,
8,
5633,
651,
62,
646,
282,
7,
76,
38381,
844,
60,
1058,
285,
13,
16680,
58,
844,
60,
198,
198,
8818,
22466,
62,
1136,
62,
26801,
9744,
62,
27160,
7,
76,
3712,
17633,
8,
198,
220,
220,
220,
299,
27305,
796,
22466,
62,
1136,
62,
26801,
9744,
62,
20471,
89,
7,
76,
8,
198,
220,
220,
220,
6376,
53,
945,
796,
1976,
27498,
7,
34,
600,
11,
299,
27305,
8,
198,
220,
220,
220,
26181,
42731,
796,
1976,
27498,
7,
34,
23352,
11,
299,
27305,
8,
198,
220,
220,
220,
22466,
62,
1136,
62,
26801,
9744,
62,
27160,
7,
76,
11,
6376,
53,
945,
11,
26181,
42731,
8,
198,
220,
220,
220,
1441,
6376,
53,
945,
11,
26181,
42731,
198,
437,
198,
198,
8818,
22466,
62,
1136,
62,
30482,
672,
666,
62,
27160,
7,
76,
3712,
17633,
8,
198,
220,
220,
220,
299,
27305,
796,
22466,
62,
1136,
62,
30482,
672,
666,
62,
20471,
89,
7,
76,
8,
198,
220,
220,
220,
474,
330,
85,
945,
796,
1976,
27498,
7,
34,
600,
11,
299,
27305,
8,
198,
220,
220,
220,
474,
4134,
684,
796,
1976,
27498,
7,
34,
600,
11,
299,
27305,
8,
198,
220,
220,
220,
474,
8679,
891,
796,
1976,
27498,
7,
34,
23352,
11,
299,
27305,
8,
198,
220,
220,
220,
22466,
62,
1136,
62,
30482,
672,
666,
62,
27160,
7,
76,
11,
474,
330,
85,
945,
11,
474,
4134,
684,
11,
474,
8679,
891,
8,
198,
220,
220,
220,
1441,
474,
330,
85,
945,
11,
474,
4134,
684,
11,
474,
8679,
891,
198,
437,
198,
198,
8818,
22466,
62,
1136,
62,
3808,
67,
62,
30482,
672,
666,
62,
27160,
7,
76,
3712,
17633,
8,
198,
220,
220,
220,
299,
27305,
796,
22466,
62,
1136,
62,
3808,
67,
62,
30482,
672,
666,
62,
20471,
89,
7,
76,
8,
198,
220,
220,
220,
474,
330,
85,
945,
796,
1976,
27498,
7,
34,
600,
11,
299,
27305,
8,
198,
220,
220,
220,
474,
4134,
684,
796,
1976,
27498,
7,
34,
600,
11,
299,
27305,
8,
198,
220,
220,
220,
474,
8679,
891,
796,
1976,
27498,
7,
34,
23352,
11,
299,
27305,
8,
198,
220,
220,
220,
22466,
62,
1136,
62,
3808,
67,
62,
30482,
672,
666,
62,
27160,
7,
76,
11,
474,
330,
85,
945,
11,
474,
4134,
684,
11,
474,
8679,
891,
8,
198,
220,
220,
220,
1441,
474,
330,
85,
945,
11,
474,
4134,
684,
11,
474,
8679,
891,
198,
437,
198,
198,
8818,
22466,
62,
1136,
62,
33979,
666,
62,
27160,
7,
76,
3712,
17633,
8,
198,
220,
220,
220,
299,
27305,
796,
22466,
62,
1136,
62,
33979,
666,
62,
20471,
89,
7,
76,
8,
198,
220,
220,
220,
6376,
53,
945,
16,
796,
1976,
27498,
7,
34,
600,
11,
299,
27305,
8,
198,
220,
220,
220,
6376,
53,
945,
17,
796,
1976,
27498,
7,
34,
600,
11,
299,
27305,
8,
198,
220,
220,
220,
339,
824,
796,
1976,
27498,
7,
34,
23352,
11,
299,
27305,
8,
198,
220,
220,
220,
22466,
62,
1136,
62,
33979,
666,
62,
27160,
7,
76,
11,
6376,
53,
945,
16,
11,
6376,
53,
945,
17,
11,
339,
824,
8,
198,
220,
220,
220,
1441,
6376,
53,
945,
16,
11,
6376,
53,
945,
17,
11,
339,
824,
198,
437,
198,
198,
8818,
22466,
62,
1136,
62,
7785,
62,
17069,
82,
7,
74,
66,
3712,
17633,
11,
6376,
3712,
38469,
90,
34,
600,
30072,
198,
220,
220,
220,
275,
358,
818,
5036,
292,
796,
1976,
27498,
7,
34,
600,
11,
4129,
7,
9630,
4008,
198,
220,
220,
220,
493,
818,
5036,
292,
796,
1976,
27498,
7,
34,
600,
11,
4129,
7,
9630,
4008,
198,
220,
220,
220,
1935,
82,
796,
1976,
27498,
7,
34,
23352,
11,
4129,
7,
9630,
4008,
198,
220,
220,
220,
22466,
62,
1136,
62,
7785,
62,
17069,
82,
7,
74,
66,
11,
4129,
7,
9630,
828,
6376,
11,
275,
358,
818,
5036,
292,
11,
493,
818,
5036,
292,
11,
1935,
82,
8,
198,
220,
220,
220,
1441,
275,
358,
818,
5036,
292,
11,
493,
818,
5036,
292,
11,
1935,
82,
198,
437,
198,
198,
8818,
22466,
62,
1136,
62,
1102,
62,
17069,
82,
7,
74,
66,
3712,
17633,
11,
6376,
3712,
38469,
90,
34,
600,
30072,
198,
220,
220,
220,
1167,
30412,
796,
1976,
27498,
7,
34,
600,
11,
4129,
7,
9630,
4008,
198,
220,
220,
220,
1935,
82,
796,
1976,
27498,
7,
34,
23352,
11,
4129,
7,
9630,
4008,
198,
220,
220,
220,
22466,
62,
1136,
62,
1102,
62,
17069,
82,
7,
74,
66,
11,
4129,
7,
9630,
828,
6376,
11,
1167,
30412,
11,
1935,
82,
8,
198,
220,
220,
220,
1441,
1167,
30412,
11,
1935,
82,
198,
437,
198,
198,
8818,
22466,
62,
1136,
62,
18302,
6442,
62,
18224,
7,
76,
3712,
17633,
8,
198,
220,
220,
220,
2488,
30493,
285,
13,
24330,
14512,
327,
62,
33991,
198,
220,
220,
220,
7515,
11,
6376,
11,
4049,
796,
327,
600,
58,
15,
4357,
327,
600,
58,
15,
4357,
327,
600,
58,
15,
60,
198,
220,
220,
220,
1935,
796,
327,
23352,
58,
15,
13,
15,
60,
198,
220,
220,
220,
22466,
62,
1136,
62,
18302,
6442,
62,
18224,
7,
76,
11,
7515,
11,
6376,
11,
4049,
11,
1935,
8,
198,
220,
220,
220,
1441,
10385,
7,
33,
970,
11,
7515,
58,
16,
46570,
198,
220,
220,
220,
10385,
7,
5317,
2414,
11,
6376,
58,
16,
46570,
198,
220,
220,
220,
10385,
7,
5317,
2414,
11,
4049,
58,
16,
46570,
198,
220,
220,
220,
10385,
7,
43879,
2414,
11,
1935,
58,
16,
12962,
198,
437,
198,
198,
31,
15418,
62,
1136,
62,
42348,
651,
62,
17618,
62,
85,
945,
327,
600,
198,
31,
15418,
62,
1136,
62,
42348,
651,
62,
17618,
62,
5936,
327,
600,
198,
31,
15418,
62,
1136,
62,
42348,
651,
62,
26801,
62,
8367,
327,
23352,
198,
31,
15418,
62,
1136,
62,
42348,
651,
62,
26801,
62,
4906,
327,
600,
198,
198,
31,
15418,
62,
1136,
62,
42348,
651,
62,
17618,
62,
270,
364,
327,
600,
198,
31,
15418,
62,
1136,
62,
42348,
651,
62,
17618,
62,
66,
70,
62,
270,
364,
327,
600,
198,
31,
15418,
62,
1136,
62,
42348,
651,
62,
8937,
62,
5036,
292,
62,
18224,
327,
23352,
198,
31,
15418,
62,
1136,
62,
42348,
651,
62,
2411,
62,
5036,
292,
62,
18224,
327,
23352,
198,
31,
15418,
62,
1136,
62,
42348,
651,
62,
8937,
62,
8738,
62,
18224,
327,
23352,
198,
31,
15418,
62,
1136,
62,
42348,
651,
62,
2411,
62,
8738,
62,
18224,
327,
23352,
198,
31,
15418,
62,
1136,
62,
42348,
651,
62,
26801,
9744,
62,
20471,
89,
327,
600,
198,
31,
15418,
62,
1136,
62,
42348,
651,
62,
30482,
672,
666,
62,
20471,
89,
22466,
43,
18494,
198,
31,
15418,
62,
1136,
62,
42348,
651,
62,
3808,
67,
62,
30482,
672,
666,
62,
20471,
89,
22466,
43,
18494,
198,
31,
15418,
62,
1136,
62,
42348,
651,
62,
33979,
666,
62,
20471,
89,
22466,
43,
18494,
198,
31,
15418,
62,
1136,
62,
42348,
651,
62,
82,
6442,
62,
2435,
62,
36166,
327,
23352,
198,
31,
15418,
62,
1136,
62,
42348,
651,
62,
82,
6442,
62,
2435,
62,
5305,
327,
23352,
198,
198,
31,
15418,
62,
1136,
62,
42348,
651,
62,
76,
541,
62,
17618,
62,
77,
4147,
327,
600,
198,
31,
15418,
62,
1136,
62,
42348,
651,
62,
76,
541,
62,
17618,
62,
82,
9010,
327,
600,
198,
31,
15418,
62,
1136,
62,
42348,
651,
62,
76,
541,
62,
8937,
62,
43554,
327,
23352,
198,
31,
15418,
62,
1136,
62,
42348,
651,
62,
76,
541,
62,
2411,
62,
43554,
327,
23352,
198,
31,
15418,
62,
1136,
62,
42348,
651,
62,
76,
541,
62,
1939,
2178,
298,
62,
26801,
327,
23352,
198,
31,
15418,
62,
1136,
62,
42348,
651,
62,
76,
541,
62,
2411,
897,
341,
62,
65,
358,
327,
23352,
198,
31,
15418,
62,
1136,
62,
42348,
651,
62,
76,
541,
62,
12957,
17440,
62,
26801,
327,
23352,
198,
198,
2,
28,
198,
27082,
40834,
198,
46249,
198,
8818,
22466,
62,
2617,
62,
17143,
7,
76,
3712,
17633,
11,
4686,
3712,
46541,
11,
1988,
3712,
46541,
8,
198,
220,
220,
220,
1441,
22466,
62,
2617,
62,
600,
62,
17143,
7,
76,
11,
4686,
11,
1988,
8,
198,
437,
198,
8818,
22466,
62,
2617,
62,
17143,
7,
76,
3712,
17633,
11,
5772,
3712,
23839,
10100,
11,
1988,
3712,
46541,
8,
198,
220,
220,
220,
1441,
22466,
62,
2617,
62,
600,
62,
17143,
62,
1525,
62,
3672,
7,
76,
11,
5772,
11,
1988,
8,
198,
437,
198,
8818,
22466,
62,
2617,
62,
17143,
7,
76,
3712,
17633,
11,
4686,
3712,
46541,
11,
1988,
3712,
34,
23352,
8,
198,
220,
220,
220,
1441,
22466,
62,
2617,
62,
23352,
62,
17143,
7,
76,
11,
4686,
11,
1988,
8,
198,
437,
198,
8818,
22466,
62,
2617,
62,
17143,
7,
76,
3712,
17633,
11,
5772,
3712,
23839,
10100,
11,
1988,
3712,
34,
23352,
8,
198,
220,
220,
220,
1441,
22466,
62,
2617,
62,
23352,
62,
17143,
62,
1525,
62,
3672,
7,
76,
11,
5772,
11,
1988,
8,
198,
437,
198,
8818,
22466,
62,
2617,
62,
17143,
7,
76,
3712,
17633,
11,
4686,
3712,
46541,
11,
1988,
3712,
23839,
10100,
8,
198,
220,
220,
220,
1441,
22466,
62,
2617,
62,
10641,
62,
17143,
7,
76,
11,
4686,
11,
1988,
8,
198,
437,
198,
8818,
22466,
62,
2617,
62,
17143,
7,
76,
3712,
17633,
11,
5772,
3712,
23839,
10100,
11,
1988,
3712,
23839,
10100,
8,
198,
220,
220,
220,
1441,
22466,
62,
2617,
62,
10641,
62,
17143,
62,
1525,
62,
3672,
7,
76,
11,
5772,
11,
1988,
8,
198,
437,
198,
198,
8818,
22466,
62,
1136,
62,
600,
62,
17143,
7,
76,
3712,
17633,
11,
4686,
3712,
46541,
8,
198,
220,
220,
220,
581,
796,
327,
600,
58,
15,
60,
198,
220,
220,
220,
22466,
62,
1136,
62,
600,
62,
17143,
7,
76,
11,
4686,
11,
581,
8,
198,
220,
220,
220,
1441,
581,
58,
16,
60,
198,
437,
198,
8818,
22466,
62,
1136,
62,
600,
62,
17143,
7,
76,
3712,
17633,
11,
5772,
3712,
23839,
10100,
8,
198,
220,
220,
220,
581,
796,
327,
600,
58,
15,
60,
198,
220,
220,
220,
22466,
62,
1136,
62,
600,
62,
17143,
62,
1525,
62,
3672,
7,
76,
11,
5772,
11,
581,
8,
198,
220,
220,
220,
1441,
581,
58,
16,
60,
198,
437,
198,
198,
8818,
22466,
62,
1136,
62,
23352,
62,
17143,
7,
76,
3712,
17633,
11,
4686,
3712,
46541,
8,
198,
220,
220,
220,
581,
796,
327,
23352,
58,
15,
13,
15,
60,
198,
220,
220,
220,
22466,
62,
1136,
62,
23352,
62,
17143,
7,
76,
11,
4686,
11,
581,
8,
198,
220,
220,
220,
1441,
581,
58,
16,
60,
198,
437,
198,
8818,
22466,
62,
1136,
62,
23352,
62,
17143,
7,
76,
3712,
17633,
11,
5772,
3712,
23839,
10100,
8,
198,
220,
220,
220,
581,
796,
327,
23352,
58,
15,
13,
15,
60,
198,
220,
220,
220,
22466,
62,
1136,
62,
23352,
62,
17143,
62,
1525,
62,
3672,
7,
76,
11,
5772,
11,
581,
8,
198,
220,
220,
220,
1441,
581,
58,
16,
60,
198,
437,
198,
198,
8818,
22466,
62,
1136,
62,
17143,
62,
3672,
7,
76,
3712,
17633,
11,
4686,
3712,
46541,
8,
198,
220,
220,
220,
5072,
62,
7857,
796,
13108,
198,
220,
220,
220,
581,
796,
366,
366,
61,
22915,
62,
7857,
198,
220,
220,
220,
22466,
62,
1136,
62,
17143,
62,
3672,
7,
76,
11,
4686,
11,
581,
11,
5072,
62,
7857,
8,
198,
220,
220,
220,
1441,
4808,
18982,
62,
22915,
7,
411,
8,
198,
437,
198,
198,
8818,
22466,
62,
1136,
62,
17143,
62,
15390,
7,
76,
3712,
17633,
11,
4686,
3712,
46541,
8,
198,
220,
220,
220,
5072,
62,
7857,
796,
13108,
198,
220,
220,
220,
581,
796,
366,
366,
61,
22915,
62,
7857,
198,
220,
220,
220,
22466,
62,
1136,
62,
17143,
62,
15390,
7,
76,
11,
4686,
11,
581,
11,
5072,
62,
7857,
8,
198,
220,
220,
220,
1441,
4808,
18982,
62,
22915,
7,
411,
8,
198,
437,
198,
198,
8818,
22466,
62,
1136,
62,
17143,
62,
4906,
7,
76,
3712,
17633,
11,
4686,
3712,
46541,
8,
198,
220,
220,
220,
581,
796,
327,
600,
58,
15,
60,
198,
220,
220,
220,
22466,
62,
1136,
62,
17143,
62,
4906,
7,
76,
11,
4686,
11,
581,
8,
198,
220,
220,
220,
1441,
581,
58,
16,
60,
198,
437,
198,
198,
8818,
22466,
62,
1136,
62,
22510,
62,
17143,
62,
27160,
7,
76,
3712,
17633,
11,
4686,
3712,
46541,
8,
198,
220,
220,
220,
581,
796,
327,
600,
58,
15,
60,
198,
220,
220,
220,
22466,
62,
1136,
62,
22510,
62,
17143,
62,
27160,
7,
76,
11,
4686,
11,
581,
8,
198,
220,
220,
220,
1441,
581,
58,
16,
60,
198,
437,
198,
198,
8818,
22466,
62,
1136,
62,
17143,
62,
8367,
62,
15390,
7,
76,
3712,
17633,
11,
4686,
3712,
46541,
11,
1988,
62,
312,
3712,
46541,
8,
198,
220,
220,
220,
5072,
62,
7857,
796,
13108,
198,
220,
220,
220,
581,
796,
366,
366,
61,
22915,
62,
7857,
198,
220,
220,
220,
22466,
62,
1136,
62,
17143,
62,
8367,
62,
15390,
7,
76,
11,
4686,
11,
1988,
62,
312,
11,
581,
11,
5072,
62,
7857,
8,
198,
220,
220,
220,
1441,
4808,
18982,
62,
22915,
7,
411,
8,
198,
437,
198,
198,
8818,
22466,
62,
1136,
62,
17143,
62,
312,
7,
76,
3712,
17633,
11,
1438,
3712,
23839,
10100,
8,
198,
220,
220,
220,
581,
796,
327,
600,
58,
15,
60,
198,
220,
220,
220,
22466,
62,
1136,
62,
17143,
62,
312,
7,
76,
11,
1438,
11,
581,
8,
198,
220,
220,
220,
1441,
581,
58,
16,
60,
198,
437,
198,
198,
2,
28,
198,
220,
220,
220,
399,
29559,
198,
46249,
198,
8818,
22466,
62,
1136,
62,
7785,
62,
14933,
7,
76,
3712,
17633,
11,
3509,
62,
13664,
28,
35500,
8,
198,
220,
220,
220,
1441,
10903,
58,
198,
220,
220,
220,
220,
220,
220,
220,
22466,
62,
1136,
62,
7785,
62,
14933,
7,
76,
11,
327,
600,
7,
312,
532,
352,
828,
3509,
62,
13664,
8,
329,
4686,
287,
352,
25,
29132,
62,
1136,
62,
17618,
62,
85,
945,
7,
76,
8,
198,
220,
220,
220,
2361,
198,
437,
198,
8818,
22466,
62,
1136,
62,
7785,
62,
14933,
7,
76,
3712,
17633,
11,
6376,
3712,
38469,
90,
34,
600,
5512,
3509,
62,
13664,
28,
35500,
8,
198,
220,
220,
220,
1441,
10903,
58,
29132,
62,
1136,
62,
7785,
62,
14933,
7,
76,
11,
4686,
11,
3509,
62,
13664,
8,
329,
4686,
287,
6376,
60,
198,
437,
198,
8818,
22466,
62,
1136,
62,
7785,
62,
14933,
7,
76,
3712,
17633,
11,
6376,
3712,
34,
600,
11,
3509,
62,
13664,
28,
35500,
8,
198,
220,
220,
220,
2179,
675,
480,
796,
1976,
27498,
7,
34,
10641,
11,
3509,
62,
13664,
8,
198,
220,
220,
220,
1005,
796,
22466,
62,
1136,
62,
7785,
62,
3672,
7,
76,
11,
6376,
11,
3509,
62,
13664,
11,
2179,
675,
480,
8,
198,
220,
220,
220,
1441,
10903,
7,
36311,
7,
10100,
7,
1102,
1851,
7,
38469,
90,
52,
5317,
23,
5512,
2179,
675,
480,
36911,
705,
59,
15,
6,
4008,
198,
437,
198,
198,
8818,
22466,
62,
1136,
62,
1102,
62,
14933,
7,
76,
3712,
17633,
11,
3509,
62,
13664,
28,
35500,
8,
198,
220,
220,
220,
1441,
10903,
58,
198,
220,
220,
220,
220,
220,
220,
220,
22466,
62,
1136,
62,
1102,
62,
14933,
7,
76,
11,
327,
600,
7,
312,
532,
352,
828,
3509,
62,
13664,
8,
329,
4686,
287,
352,
25,
29132,
62,
1136,
62,
17618,
62,
5936,
7,
76,
8,
198,
220,
220,
220,
2361,
198,
437,
198,
8818,
22466,
62,
1136,
62,
1102,
62,
14933,
7,
76,
3712,
17633,
11,
6376,
3712,
38469,
90,
34,
600,
5512,
3509,
62,
13664,
28,
35500,
8,
198,
220,
220,
220,
1441,
10903,
58,
29132,
62,
1136,
62,
1102,
62,
14933,
7,
76,
11,
4686,
11,
3509,
62,
13664,
8,
329,
4686,
287,
6376,
60,
198,
437,
198,
8818,
22466,
62,
1136,
62,
1102,
62,
14933,
7,
76,
3712,
17633,
11,
6376,
3712,
34,
600,
11,
3509,
62,
13664,
28,
35500,
8,
198,
220,
220,
220,
2179,
675,
480,
796,
1976,
27498,
7,
34,
10641,
11,
3509,
62,
13664,
8,
198,
220,
220,
220,
1005,
796,
22466,
62,
1136,
62,
1102,
62,
3672,
7,
76,
11,
6376,
11,
3509,
62,
13664,
11,
2179,
675,
480,
8,
198,
220,
220,
220,
1441,
10903,
7,
36311,
7,
10100,
7,
1102,
1851,
7,
38469,
90,
52,
5317,
23,
5512,
2179,
675,
480,
36911,
705,
59,
15,
6,
4008,
198,
437,
198
] | 2.219527 | 9,935 |
using CartesianFDM
using Test
@testset "1D identities" begin
n = (5,)
top = (periodic(),)
ctx = cartesianfdmcontext(top, n)
# assumes 1D
((δ⁻,), (δ⁺,)) = getproperty(ctx, :δ)
((σ⁻,), (σ⁺,)) = getproperty(ctx, :σ)
((τ⁻,), (τ⁺,)) = getproperty(ctx, :τ)
Ψ, Φ = scalar(:Ψ, n), scalar(:Φ, n)
@testset "2x identity 53" begin
id = (σ⁺ * (δ⁻ * Φ)) .- (δ⁺ * (σ⁻ * Φ))
@test all(iszero, Symbolics.expand.(id))
id = (σ⁻ * (δ⁺ * Φ)) .- (δ⁻ * (σ⁺ * Φ))
@test all(iszero, Symbolics.expand.(id))
end
@testset "2x identity 56" begin
id = (σ⁺ * (Ψ .* (δ⁻ * Φ))) .+ (2Φ .* (δ⁺ * Ψ)) .- (δ⁺ * (Ψ .* (σ⁻ * Φ)))
@test all(iszero, expand.(id))
id = (σ⁻ * (Ψ .* (δ⁺ * Φ))) .+ (2Φ .* (δ⁻ * Ψ)) .- (δ⁻ * (Ψ .* (σ⁺ * Φ)))
@test all(iszero, expand.(id))
end
@testset "2x identity 57" begin
id = (Φ .* ((δ⁺ * (Ψ .* (σ⁻ * Φ))) .+ (σ⁺ * (Ψ .* (δ⁻ * Φ))))) .-
(δ⁺ * (Ψ .* ((Φ .* (τ⁻ * Φ)) .+ ((τ⁻ * Φ) .* Φ))))
@test all(iszero, expand.(id))
id = (Φ .* ((δ⁻ * (Ψ .* (σ⁺ * Φ))) .+ (σ⁻ * (Ψ .* (δ⁺ * Φ))))) .-
(δ⁻ * (Ψ .* ((Φ .* (τ⁺ * Φ)) .+ ((τ⁺ * Φ) .* Φ))))
@test all(iszero, expand.(id))
end
@testset "2x identity 59" begin
id = (((σ⁺ * Ψ) .* (δ⁺ * Φ)) .+ ((σ⁺ * Φ) .* (δ⁺ * Ψ))) - (2δ⁺ * (Ψ .* Φ))
@test all(iszero, expand.(id))
id = (((σ⁻ * Ψ) .* (δ⁻ * Φ)) .+ ((σ⁻ * Φ) .* (δ⁻ * Ψ))) - (2δ⁻ * (Ψ .* Φ))
@test all(iszero, expand.(id))
end
end
@testset "star stencil" begin
using SparseArrays
n = (3, 4, 5)
top = (periodic(), nonperiodic(), periodic())
ctx = cartesianfdmcontext(top, n)
(τ⁻, τ⁺) = getproperty(ctx, :τ)
X = scalar(:X, n)
###
F = rand(prod(n)) .* X
for i in eachindex(top)
F .+= τ⁻[i] * (rand(prod(n)) .* X)
end
for i in eachindex(top)
F .+= τ⁺[i] * (rand(prod(n)) .* X)
end
###
sym = linearize(star, ctx, F, X)
num = Dict{Int,Vector{Float64}}()
for (key, val) in sym
num[key] = eval(first(build_function(val)))()
end
A = spdiagm(num...)
###
@test all(iszero, F .- A * X)
end
| [
3500,
13690,
35610,
37,
23127,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
16,
35,
18413,
1,
2221,
198,
220,
220,
220,
299,
796,
357,
20,
35751,
198,
220,
220,
220,
1353,
796,
357,
41007,
291,
22784,
8,
628,
220,
220,
220,
269,
17602,
796,
6383,
35610,
16344,
76,
22866,
7,
4852,
11,
299,
8,
628,
220,
220,
220,
1303,
18533,
352,
35,
198,
220,
220,
220,
14808,
138,
112,
46256,
119,
11,
828,
357,
138,
112,
46256,
118,
11,
4008,
796,
651,
26745,
7,
49464,
11,
1058,
138,
112,
8,
198,
220,
220,
220,
14808,
38392,
46256,
119,
11,
828,
357,
38392,
46256,
118,
11,
4008,
796,
651,
26745,
7,
49464,
11,
1058,
38392,
8,
198,
220,
220,
220,
14808,
32830,
46256,
119,
11,
828,
357,
32830,
46256,
118,
11,
4008,
796,
651,
26745,
7,
49464,
11,
1058,
32830,
8,
628,
220,
220,
220,
7377,
101,
11,
7377,
99,
796,
16578,
283,
7,
25,
138,
101,
11,
299,
828,
16578,
283,
7,
25,
138,
99,
11,
299,
8,
628,
220,
220,
220,
2488,
9288,
2617,
366,
17,
87,
5369,
7192,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
4686,
796,
357,
38392,
46256,
118,
1635,
357,
138,
112,
46256,
119,
1635,
7377,
99,
4008,
764,
12,
357,
138,
112,
46256,
118,
1635,
357,
38392,
46256,
119,
1635,
7377,
99,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
477,
7,
271,
22570,
11,
41327,
19615,
13,
11201,
392,
12195,
312,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
4686,
796,
357,
38392,
46256,
119,
1635,
357,
138,
112,
46256,
118,
1635,
7377,
99,
4008,
764,
12,
357,
138,
112,
46256,
119,
1635,
357,
38392,
46256,
118,
1635,
7377,
99,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
477,
7,
271,
22570,
11,
41327,
19615,
13,
11201,
392,
12195,
312,
4008,
198,
220,
220,
220,
886,
628,
220,
220,
220,
2488,
9288,
2617,
366,
17,
87,
5369,
7265,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
4686,
796,
357,
38392,
46256,
118,
1635,
357,
138,
101,
764,
9,
357,
138,
112,
46256,
119,
1635,
7377,
99,
22305,
764,
10,
357,
17,
138,
99,
764,
9,
357,
138,
112,
46256,
118,
1635,
7377,
101,
4008,
764,
12,
357,
138,
112,
46256,
118,
1635,
357,
138,
101,
764,
9,
357,
38392,
46256,
119,
1635,
7377,
99,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
477,
7,
271,
22570,
11,
4292,
12195,
312,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
4686,
796,
357,
38392,
46256,
119,
1635,
357,
138,
101,
764,
9,
357,
138,
112,
46256,
118,
1635,
7377,
99,
22305,
764,
10,
357,
17,
138,
99,
764,
9,
357,
138,
112,
46256,
119,
1635,
7377,
101,
4008,
764,
12,
357,
138,
112,
46256,
119,
1635,
357,
138,
101,
764,
9,
357,
38392,
46256,
118,
1635,
7377,
99,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
477,
7,
271,
22570,
11,
4292,
12195,
312,
4008,
198,
220,
220,
220,
886,
628,
220,
220,
220,
2488,
9288,
2617,
366,
17,
87,
5369,
7632,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
4686,
796,
357,
138,
99,
764,
9,
14808,
138,
112,
46256,
118,
1635,
357,
138,
101,
764,
9,
357,
38392,
46256,
119,
1635,
7377,
99,
22305,
764,
10,
357,
38392,
46256,
118,
1635,
357,
138,
101,
764,
9,
357,
138,
112,
46256,
119,
1635,
7377,
99,
4008,
22305,
764,
12,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
138,
112,
46256,
118,
1635,
357,
138,
101,
764,
9,
14808,
138,
99,
764,
9,
357,
32830,
46256,
119,
1635,
7377,
99,
4008,
764,
10,
14808,
32830,
46256,
119,
1635,
7377,
99,
8,
764,
9,
7377,
99,
35514,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
477,
7,
271,
22570,
11,
4292,
12195,
312,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
4686,
796,
357,
138,
99,
764,
9,
14808,
138,
112,
46256,
119,
1635,
357,
138,
101,
764,
9,
357,
38392,
46256,
118,
1635,
7377,
99,
22305,
764,
10,
357,
38392,
46256,
119,
1635,
357,
138,
101,
764,
9,
357,
138,
112,
46256,
118,
1635,
7377,
99,
4008,
22305,
764,
12,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
138,
112,
46256,
119,
1635,
357,
138,
101,
764,
9,
14808,
138,
99,
764,
9,
357,
32830,
46256,
118,
1635,
7377,
99,
4008,
764,
10,
14808,
32830,
46256,
118,
1635,
7377,
99,
8,
764,
9,
7377,
99,
35514,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
477,
7,
271,
22570,
11,
4292,
12195,
312,
4008,
198,
220,
220,
220,
886,
628,
220,
220,
220,
2488,
9288,
2617,
366,
17,
87,
5369,
7863,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
4686,
796,
14808,
7,
38392,
46256,
118,
1635,
7377,
101,
8,
764,
9,
357,
138,
112,
46256,
118,
1635,
7377,
99,
4008,
764,
10,
14808,
38392,
46256,
118,
1635,
7377,
99,
8,
764,
9,
357,
138,
112,
46256,
118,
1635,
7377,
101,
22305,
532,
357,
17,
138,
112,
46256,
118,
1635,
357,
138,
101,
764,
9,
7377,
99,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
477,
7,
271,
22570,
11,
4292,
12195,
312,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
4686,
796,
14808,
7,
38392,
46256,
119,
1635,
7377,
101,
8,
764,
9,
357,
138,
112,
46256,
119,
1635,
7377,
99,
4008,
764,
10,
14808,
38392,
46256,
119,
1635,
7377,
99,
8,
764,
9,
357,
138,
112,
46256,
119,
1635,
7377,
101,
22305,
532,
357,
17,
138,
112,
46256,
119,
1635,
357,
138,
101,
764,
9,
7377,
99,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
477,
7,
271,
22570,
11,
4292,
12195,
312,
4008,
198,
220,
220,
220,
886,
198,
437,
198,
198,
31,
9288,
2617,
366,
7364,
45219,
2856,
1,
2221,
198,
220,
220,
220,
1262,
1338,
17208,
3163,
20477,
628,
220,
220,
220,
299,
796,
357,
18,
11,
604,
11,
642,
8,
198,
220,
220,
220,
1353,
796,
357,
41007,
291,
22784,
1729,
41007,
291,
22784,
27458,
28955,
628,
220,
220,
220,
269,
17602,
796,
6383,
35610,
16344,
76,
22866,
7,
4852,
11,
299,
8,
198,
220,
220,
220,
357,
32830,
46256,
119,
11,
46651,
46256,
118,
8,
796,
651,
26745,
7,
49464,
11,
1058,
32830,
8,
628,
220,
220,
220,
1395,
796,
16578,
283,
7,
25,
55,
11,
299,
8,
628,
220,
220,
220,
44386,
198,
220,
220,
220,
376,
796,
43720,
7,
1676,
67,
7,
77,
4008,
764,
9,
1395,
198,
220,
220,
220,
329,
1312,
287,
1123,
9630,
7,
4852,
8,
198,
220,
220,
220,
220,
220,
220,
220,
376,
764,
47932,
46651,
46256,
119,
58,
72,
60,
1635,
357,
25192,
7,
1676,
67,
7,
77,
4008,
764,
9,
1395,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
329,
1312,
287,
1123,
9630,
7,
4852,
8,
198,
220,
220,
220,
220,
220,
220,
220,
376,
764,
47932,
46651,
46256,
118,
58,
72,
60,
1635,
357,
25192,
7,
1676,
67,
7,
77,
4008,
764,
9,
1395,
8,
198,
220,
220,
220,
886,
628,
220,
220,
220,
44386,
198,
220,
220,
220,
5659,
796,
14174,
1096,
7,
7364,
11,
269,
17602,
11,
376,
11,
1395,
8,
628,
220,
220,
220,
997,
796,
360,
713,
90,
5317,
11,
38469,
90,
43879,
2414,
11709,
3419,
198,
220,
220,
220,
329,
357,
2539,
11,
1188,
8,
287,
5659,
198,
220,
220,
220,
220,
220,
220,
220,
997,
58,
2539,
60,
796,
5418,
7,
11085,
7,
11249,
62,
8818,
7,
2100,
22305,
3419,
198,
220,
220,
220,
886,
628,
220,
220,
220,
317,
796,
599,
10989,
363,
76,
7,
22510,
23029,
628,
220,
220,
220,
44386,
198,
220,
220,
220,
2488,
9288,
477,
7,
271,
22570,
11,
376,
764,
12,
317,
1635,
1395,
8,
198,
437,
628
] | 1.681159 | 1,311 |
# This file was generated by the Julia Swagger Code Generator
# Do not modify this file directly. Modify the swagger specification instead.
module PolicyAssignmentsClient
using Random
using Dates
using Swagger
import Swagger: field_name, property_type, hasproperty, validate_property, SwaggerApi, SwaggerModel
import Base: convert, propertynames
include("modelincludes.jl")
include("api_PolicyAssignmentsApi.jl")
# export models
export convert, CloudError
export convert, ErrorAdditionalInfo
export convert, ErrorResponse
export convert, Identity
export convert, ParameterValues
export convert, ParameterValuesValue
export convert, PolicyAssignment
export convert, PolicyAssignmentListResult
export convert, PolicyAssignmentProperties
export convert, PolicySku
# export operations
export convert, PolicyAssignmentsApi
export check_required, field_name, property_type, hasproperty, propertynames, validate_property, convert
end
| [
2,
770,
2393,
373,
7560,
416,
262,
22300,
2451,
7928,
6127,
35986,
198,
2,
2141,
407,
13096,
428,
2393,
3264,
13,
3401,
1958,
262,
1509,
7928,
20855,
2427,
13,
198,
198,
21412,
7820,
8021,
570,
902,
11792,
198,
198,
3500,
14534,
198,
3500,
44712,
198,
3500,
2451,
7928,
198,
11748,
2451,
7928,
25,
2214,
62,
3672,
11,
3119,
62,
4906,
11,
468,
26745,
11,
26571,
62,
26745,
11,
2451,
7928,
32,
14415,
11,
2451,
7928,
17633,
198,
11748,
7308,
25,
10385,
11,
3119,
14933,
198,
198,
17256,
7203,
19849,
42813,
13,
20362,
4943,
198,
198,
17256,
7203,
15042,
62,
36727,
8021,
570,
902,
32,
14415,
13,
20362,
4943,
198,
198,
2,
10784,
4981,
198,
39344,
10385,
11,
10130,
12331,
198,
39344,
10385,
11,
13047,
17699,
12360,
198,
39344,
10385,
11,
13047,
31077,
198,
39344,
10385,
11,
27207,
198,
39344,
10385,
11,
25139,
2357,
40161,
198,
39344,
10385,
11,
25139,
2357,
40161,
11395,
198,
39344,
10385,
11,
7820,
8021,
16747,
198,
39344,
10385,
11,
7820,
8021,
16747,
8053,
23004,
198,
39344,
10385,
11,
7820,
8021,
16747,
2964,
18200,
198,
39344,
10385,
11,
7820,
15739,
84,
198,
198,
2,
10784,
4560,
198,
39344,
10385,
11,
7820,
8021,
570,
902,
32,
14415,
198,
198,
39344,
2198,
62,
35827,
11,
2214,
62,
3672,
11,
3119,
62,
4906,
11,
468,
26745,
11,
3119,
14933,
11,
26571,
62,
26745,
11,
10385,
198,
198,
437,
198
] | 4.082969 | 229 |
###Cargar datos
using TopicModelsVB
import Distributions.sample
#Arreglar direccion
corp = readcorp(:mac)
corp.docs = vcat([sample(filter(doc -> round(doc.stamp / 100) == y, corp.docs), 400, replace=false) for y in 1984:2005]...)
fixcorp!(corp, abr=100, len=10) # Remove words which appear < 100 times and documents of length < 10.
basemodel = LDA(corp, 9)
train!(basemodel, iter=150, chkelbo=151)
# training...
model = DTM(corp, 9, 200, basemodel)
train!(model, iter=10) # This will likely take about an hour on a personal computer.
# Convergence for all other models is worst-case quadratic,
# while DTM convergence is linear or at best super-linear.
# training...
| [
21017,
34,
853,
283,
4818,
418,
198,
3500,
47373,
5841,
1424,
44526,
198,
11748,
46567,
507,
13,
39873,
198,
2,
3163,
2301,
21681,
19958,
535,
295,
198,
10215,
79,
796,
1100,
10215,
79,
7,
25,
20285,
8,
198,
198,
10215,
79,
13,
31628,
796,
410,
9246,
26933,
39873,
7,
24455,
7,
15390,
4613,
2835,
7,
15390,
13,
301,
696,
1220,
1802,
8,
6624,
331,
11,
24614,
13,
31628,
828,
7337,
11,
6330,
28,
9562,
8,
329,
331,
287,
12844,
25,
14315,
60,
23029,
198,
198,
13049,
10215,
79,
0,
7,
10215,
79,
11,
450,
81,
28,
3064,
11,
18896,
28,
940,
8,
1303,
17220,
2456,
543,
1656,
1279,
1802,
1661,
290,
4963,
286,
4129,
1279,
838,
13,
198,
198,
12093,
368,
375,
417,
796,
406,
5631,
7,
10215,
79,
11,
860,
8,
198,
27432,
0,
7,
12093,
368,
375,
417,
11,
11629,
28,
8628,
11,
442,
7750,
2127,
28,
24309,
8,
198,
198,
2,
3047,
986,
198,
198,
19849,
796,
360,
15972,
7,
10215,
79,
11,
860,
11,
939,
11,
1615,
368,
375,
417,
8,
198,
27432,
0,
7,
19849,
11,
11629,
28,
940,
8,
1303,
770,
481,
1884,
1011,
546,
281,
1711,
319,
257,
2614,
3644,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
35602,
12745,
329,
477,
584,
4981,
318,
5290,
12,
7442,
15094,
81,
1512,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
981,
360,
15972,
40826,
318,
14174,
393,
379,
1266,
2208,
12,
29127,
13,
198,
2,
3047,
986,
198
] | 2.582734 | 278 |
using GNSSTools
using FFTW
using AllanDeviations
using Statistics
# using LsqFit
# using NNLS
using PyPlot
pygui(true)
# function psd_at_f(h_parms, f, v_0)
# h₋₂, h₋₁, h₀, h₁, h₂ = h_parms
# return v_0^2 * (h₋₂*f^(-4) + h₋₁*f^(-3) + h₀*f^(-2) + h₁*f^(-1) + h₂*f^0)
# end
# function fit_h_parms_to_signal_PSD(psd_dBc, f_c=10e6,
# freqs=[1,10,100,1e3,1e4,1e5])
# N = length(freqs)
# @assert N == length(psd_dBc)
# b = zeros(N-1)
# A = zeros(N-1)
# for i in 1:N-1
# j = N - i
# A[i] = (psd_dBc[j] + psd_dBc[j+1])/2 + 10*log10(freqs[j+1] - freqs[j])
# if i == 1
# b[i] = 2*10^(A[i]/10) / (freqs[j+1] - freqs[j]) # b₀
# elseif i == 2
# b[i] = 2*10^(A[i]/10) / log(freqs[j+1] - freqs[j]) # b₋₁
# else
# b[i] = 2*10^(A[i]/10) / ((2-i)*(freqs[j+1]^(2-i) - freqs[j]^(2-i)))
# end
# end
# # order is h2, h1, h0, h-1, h-2
# h = b ./ f_c.^2
# # reverse order to h-2, h-1, h₀, h₁, h₂
# return reverse(h)
# end
function calc_Sy(x, f_s)
N = length(x)
X = fft(x)[1:floor(Int, N/2)+1]
X = (1/(f_s*N)) .* abs2.(X)
X[2:end-1] .= 2 .* X[2:end-1]
X_log10 = 10 .* log10.(X)
frequencies = Array(range(0, f_s/2, length=length(X)))
return (X, X_log10, frequencies)
end
# f_s = 36e6
f_carrier1 = 16.3676e6
f_carrier2 = 10e6
f_s = 1*f_carrier1
t_length = 1
N = floor(Int, t_length*f_s)
N_over_2 = floor(Int, N/2)
t = Array(range(0, t_length, length=N))
frequencies = Array(range(0, f_s/2, length=N_over_2+1))
# carrier1 = cis.(2π.*f_carrier1.*t)
# carrier2 = cis.(2π.*f_carrier2.*t)
phase_noise = zeros(Complex{Float64}, N)
# signal = zeros(Complex{Float64}, N)
dBc_freq = [1., 1e1, 1e2, 1e3, 1e4]
X = zeros(Complex{Float64}, N_over_2+1)
x = zeros(Complex{Float64}, N)
rakon_it5300B = Dict("h_parms"=>[1.9e-6, 2e-6, 9.7e-8, 9.1e-11, 9.9e-15],
"dBc"=>[-57, -88, -112, -130, -140],
"dBc_freq"=>[1., 1e1, 1e2, 1e3, 1e4],
"name"=>"TCXO, Rakon IT5300B",
"f_0"=>f_carrier1)
agilent_e4424b = Dict("h_parms"=>[2.8e-9, 1.8e-11, 1.2e-10, 1e-11, 1.8e-15],
"dBc"=>[-88, -118, -128, -135, -147],
"dBc_freq"=>[1., 1e1, 1e2, 1e3, 1e4],
"name"=>"OCXO, Agilent E4424B",
"f_0"=>10e6)
isotemp_91_1 = Dict("h_parms"=>[2.2e-9, 1.6e-10, 1.6e-10, 7.1e-13, 7.2e-16],
"dBc"=>[-89, -120, -140, -151, -154],
"dBc_freq"=>[1., 1e1, 1e2, 1e3, 1e4],
"name"=>"OCXO, ISOTEMP 91-1",
"f_0"=>f_carrier2)
oscilloquartz_8607 = Dict("h_parms"=>[3.9e-14, 8.7e-13, 2.2e-14, 3.2e-13, 6.4e-15],
"dBc"=>[-122, -137, -143, -145, -145],
"dBc_freq"=>[1., 1e1, 1e2, 1e3, 1e4],
"name"=>"OCXO, Oscilloquartz 8607",
"f_0"=>f_carrier2)
srs_prs10 = Dict("h_parms"=>[5.3e-11, 4.7e-11, 1.6e-15, 9.6e-14, 9.9e-16],
"dBc"=>[-103, -135, -150, -152, -153],
"dBc_freq"=>[1., 1e1, 1e2, 1e3, 1e4],
"name"=>"Rubidum, SRS PRS10",
"f_0"=>f_carrier2)
cesium = Dict("h_parms"=>[1.5e-12, 6.2e-11, 7.6e-23, 1.4e-14, 6.2e-19],
"dBc"=>[-105, -135, -160, -170, -190],
"dBc_freq"=>[1., 1e1, 1e2, 1e3, 1e4],
"name"=>"Cesium, Typical Values",
"f_0"=>f_carrier2)
mti_250l = Dict("h_parms"=>[1.7e-9, 1e-10, 1.6e-10, 3.5e-13, 1.8e-16],
"dBc"=>[-90, -120, -140, -155, -160],
"dBc_freq"=>[1., 1e1, 1e2, 1e3, 1e4],
"name"=>"OCXO, MTI 250L",#, Low g-sensitivity",
"f_0"=>f_carrier2)
oscillators = [rakon_it5300B, agilent_e4424b, isotemp_91_1, oscilloquartz_8607,
srs_prs10, cesium, mti_250l]
# figsize = (6.5, 4)
colorz = ["k", "b", "g", "r", "y", "m", "c", "gray"]
fig = figure(figsize=(6.5,4))
ax1 = fig.add_subplot(1,1,1)
legend_markers = []
marker_names = []
for i in 1:length(oscillators)
# for i in 1:1
color = colorz[i]
oscillator = oscillators[i]
if oscillator["name"] == "TCXO, Rakon IT5300B"
# carrier = carrier1
f_carrier = f_carrier1
else
# carrier = carrier2
f_carrier = f_carrier2
end
h_parms = oscillator["h_parms"] ./ oscillator["f_0"]^2
generate_phase_noise!(phase_noise, t_length, f_carrier, h_parms)
# ϕ = real.(phase_noise)
# signal = carrier .* cis.(ϕ)
# signal .= carrier .* cis.(real.(phase_noise))
# x = signal
x .= real.(phase_noise) .+ 0im
# X, X_log, freqs = calc_Sy(x, f_s)
fft!(x);
X .= abs2.(x[1:N_over_2+1]) / (f_s*N);
X[2:end-1] .= 2 .* X[2:end-1];
X .= 10 .* log10.(X);
# X_max = maximum(real.(X));
# X = X .- X_max;
# ax1.plot(frequencies[2:end] .- f_carrier, X[2:end], color,
# label=string(oscillator["name"], " from h Parms"))
ax1.plot(frequencies[2:end], real.(X[2:end]), color)#),
# label=oscillator["name"])
# ax1.plot(frequencies[2:end], real.(X[2:end]), color,
# label=string(oscillator["name"], " from h Parms"))
ax1.scatter(dBc_freq, oscillator["dBc"].+(10*log10(2)),
c=color)#, label=string(oscillator["name"], " Truth"))
legend_marker = plt.Line2D((0,1),(0,0), color=color, marker="o", linestyle="-")
push!(legend_markers, legend_marker)
push!(marker_names, oscillator["name"])
end
xscale("log")
xlim([1, 1e6])
xlabel("Frequency (Hz)")
ylabel("dBc/Hz")
subplots_adjust(top=0.96, left=0.12, right=0.88, bottom=0.13)
ax1.legend(legend_markers, marker_names)
# savefig("figures/ch2_oscillator_psds.pdf", dpi=300) | [
3500,
402,
8035,
2257,
10141,
198,
3500,
376,
9792,
54,
198,
3500,
31908,
13603,
40356,
198,
3500,
14370,
198,
2,
1262,
406,
31166,
31805,
198,
2,
1262,
399,
45,
6561,
198,
3500,
9485,
43328,
198,
9078,
48317,
7,
7942,
8,
198,
198,
2,
2163,
279,
21282,
62,
265,
62,
69,
7,
71,
62,
1845,
907,
11,
277,
11,
410,
62,
15,
8,
198,
2,
220,
220,
220,
220,
289,
158,
224,
233,
158,
224,
224,
11,
289,
158,
224,
233,
158,
224,
223,
11,
289,
158,
224,
222,
11,
289,
158,
224,
223,
11,
289,
158,
224,
224,
796,
289,
62,
1845,
907,
198,
2,
220,
220,
220,
220,
1441,
410,
62,
15,
61,
17,
1635,
357,
71,
158,
224,
233,
158,
224,
224,
9,
69,
61,
32590,
19,
8,
1343,
289,
158,
224,
233,
158,
224,
223,
9,
69,
61,
32590,
18,
8,
1343,
289,
158,
224,
222,
9,
69,
61,
32590,
17,
8,
1343,
289,
158,
224,
223,
9,
69,
61,
32590,
16,
8,
1343,
289,
158,
224,
224,
9,
69,
61,
15,
8,
198,
2,
886,
198,
198,
2,
2163,
4197,
62,
71,
62,
1845,
907,
62,
1462,
62,
12683,
282,
62,
3705,
35,
7,
862,
67,
62,
36077,
66,
11,
277,
62,
66,
28,
940,
68,
21,
11,
220,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2030,
48382,
41888,
16,
11,
940,
11,
3064,
11,
16,
68,
18,
11,
16,
68,
19,
11,
16,
68,
20,
12962,
198,
2,
220,
220,
220,
220,
399,
796,
4129,
7,
19503,
48382,
8,
198,
2,
220,
220,
220,
220,
2488,
30493,
399,
6624,
4129,
7,
862,
67,
62,
36077,
66,
8,
198,
2,
220,
220,
220,
220,
275,
796,
1976,
27498,
7,
45,
12,
16,
8,
198,
2,
220,
220,
220,
220,
317,
796,
1976,
27498,
7,
45,
12,
16,
8,
198,
2,
220,
220,
220,
220,
329,
1312,
287,
352,
25,
45,
12,
16,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
474,
796,
399,
532,
1312,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
317,
58,
72,
60,
796,
357,
862,
67,
62,
36077,
66,
58,
73,
60,
1343,
279,
21282,
62,
36077,
66,
58,
73,
10,
16,
12962,
14,
17,
1343,
838,
9,
6404,
940,
7,
19503,
48382,
58,
73,
10,
16,
60,
532,
2030,
48382,
58,
73,
12962,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1312,
6624,
352,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
58,
72,
60,
796,
362,
9,
940,
61,
7,
32,
58,
72,
60,
14,
940,
8,
1220,
357,
19503,
48382,
58,
73,
10,
16,
60,
532,
2030,
48382,
58,
73,
12962,
220,
1303,
275,
158,
224,
222,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
361,
1312,
6624,
362,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
58,
72,
60,
796,
362,
9,
940,
61,
7,
32,
58,
72,
60,
14,
940,
8,
1220,
2604,
7,
19503,
48382,
58,
73,
10,
16,
60,
532,
2030,
48382,
58,
73,
12962,
220,
1303,
275,
158,
224,
233,
158,
224,
223,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
58,
72,
60,
796,
362,
9,
940,
61,
7,
32,
58,
72,
60,
14,
940,
8,
1220,
14808,
17,
12,
72,
27493,
7,
19503,
48382,
58,
73,
10,
16,
60,
61,
7,
17,
12,
72,
8,
532,
2030,
48382,
58,
73,
60,
61,
7,
17,
12,
72,
22305,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
2,
220,
220,
220,
220,
886,
198,
2,
220,
220,
220,
220,
1303,
1502,
318,
289,
17,
11,
289,
16,
11,
289,
15,
11,
289,
12,
16,
11,
289,
12,
17,
198,
2,
220,
220,
220,
220,
289,
796,
275,
24457,
277,
62,
66,
13,
61,
17,
198,
2,
220,
220,
220,
220,
1303,
9575,
1502,
284,
289,
12,
17,
11,
289,
12,
16,
11,
289,
158,
224,
222,
11,
289,
158,
224,
223,
11,
289,
158,
224,
224,
198,
2,
220,
220,
220,
220,
1441,
9575,
7,
71,
8,
198,
2,
886,
198,
198,
8818,
42302,
62,
13940,
7,
87,
11,
277,
62,
82,
8,
198,
220,
220,
220,
399,
796,
4129,
7,
87,
8,
198,
220,
220,
220,
1395,
796,
277,
701,
7,
87,
38381,
16,
25,
28300,
7,
5317,
11,
399,
14,
17,
47762,
16,
60,
198,
220,
220,
220,
1395,
796,
357,
16,
29006,
69,
62,
82,
9,
45,
4008,
764,
9,
2352,
17,
12195,
55,
8,
198,
220,
220,
220,
1395,
58,
17,
25,
437,
12,
16,
60,
764,
28,
362,
764,
9,
1395,
58,
17,
25,
437,
12,
16,
60,
198,
220,
220,
220,
1395,
62,
6404,
940,
796,
838,
764,
9,
2604,
940,
12195,
55,
8,
198,
220,
220,
220,
19998,
796,
15690,
7,
9521,
7,
15,
11,
277,
62,
82,
14,
17,
11,
4129,
28,
13664,
7,
55,
22305,
198,
220,
220,
220,
1441,
357,
55,
11,
1395,
62,
6404,
940,
11,
19998,
8,
198,
437,
198,
198,
2,
277,
62,
82,
796,
4570,
68,
21,
198,
69,
62,
7718,
5277,
16,
796,
1467,
13,
2623,
4304,
68,
21,
198,
69,
62,
7718,
5277,
17,
796,
838,
68,
21,
198,
69,
62,
82,
796,
352,
9,
69,
62,
7718,
5277,
16,
198,
83,
62,
13664,
796,
352,
198,
45,
796,
4314,
7,
5317,
11,
256,
62,
13664,
9,
69,
62,
82,
8,
198,
45,
62,
2502,
62,
17,
796,
4314,
7,
5317,
11,
399,
14,
17,
8,
198,
83,
796,
15690,
7,
9521,
7,
15,
11,
256,
62,
13664,
11,
4129,
28,
45,
4008,
198,
69,
8897,
3976,
796,
15690,
7,
9521,
7,
15,
11,
277,
62,
82,
14,
17,
11,
4129,
28,
45,
62,
2502,
62,
17,
10,
16,
4008,
198,
2,
11920,
16,
796,
33325,
12195,
17,
46582,
15885,
69,
62,
7718,
5277,
16,
15885,
83,
8,
198,
2,
11920,
17,
796,
33325,
12195,
17,
46582,
15885,
69,
62,
7718,
5277,
17,
15885,
83,
8,
198,
40715,
62,
3919,
786,
796,
1976,
27498,
7,
5377,
11141,
90,
43879,
2414,
5512,
399,
8,
198,
2,
6737,
796,
1976,
27498,
7,
5377,
11141,
90,
43879,
2414,
5512,
399,
8,
198,
36077,
66,
62,
19503,
80,
796,
685,
16,
1539,
352,
68,
16,
11,
352,
68,
17,
11,
352,
68,
18,
11,
352,
68,
19,
60,
198,
55,
796,
1976,
27498,
7,
5377,
11141,
90,
43879,
2414,
5512,
399,
62,
2502,
62,
17,
10,
16,
8,
198,
87,
796,
1976,
27498,
7,
5377,
11141,
90,
43879,
2414,
5512,
399,
8,
198,
17716,
261,
62,
270,
4310,
405,
33,
796,
360,
713,
7203,
71,
62,
1845,
907,
1,
14804,
58,
16,
13,
24,
68,
12,
21,
11,
362,
68,
12,
21,
11,
860,
13,
22,
68,
12,
23,
11,
860,
13,
16,
68,
12,
1157,
11,
860,
13,
24,
68,
12,
1314,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
36077,
66,
1,
14804,
58,
12,
3553,
11,
532,
3459,
11,
532,
14686,
11,
532,
12952,
11,
532,
15187,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
36077,
66,
62,
19503,
80,
1,
14804,
58,
16,
1539,
352,
68,
16,
11,
352,
68,
17,
11,
352,
68,
18,
11,
352,
68,
19,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1,
14804,
1,
4825,
55,
46,
11,
34299,
261,
7283,
4310,
405,
33,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
69,
62,
15,
1,
14804,
69,
62,
7718,
5277,
16,
8,
198,
363,
346,
298,
62,
68,
2598,
1731,
65,
796,
360,
713,
7203,
71,
62,
1845,
907,
1,
14804,
58,
17,
13,
23,
68,
12,
24,
11,
352,
13,
23,
68,
12,
1157,
11,
352,
13,
17,
68,
12,
940,
11,
352,
68,
12,
1157,
11,
352,
13,
23,
68,
12,
1314,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
36077,
66,
1,
14804,
58,
12,
3459,
11,
532,
16817,
11,
532,
12762,
11,
532,
17059,
11,
532,
20198,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
36077,
66,
62,
19503,
80,
1,
14804,
58,
16,
1539,
352,
68,
16,
11,
352,
68,
17,
11,
352,
68,
18,
11,
352,
68,
19,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1,
14804,
1,
4503,
55,
46,
11,
2449,
346,
298,
412,
2598,
1731,
33,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
69,
62,
15,
1,
14804,
940,
68,
21,
8,
198,
271,
313,
45787,
62,
6420,
62,
16,
796,
360,
713,
7203,
71,
62,
1845,
907,
1,
14804,
58,
17,
13,
17,
68,
12,
24,
11,
352,
13,
21,
68,
12,
940,
11,
352,
13,
21,
68,
12,
940,
11,
767,
13,
16,
68,
12,
1485,
11,
767,
13,
17,
68,
12,
1433,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
36077,
66,
1,
14804,
58,
12,
4531,
11,
532,
10232,
11,
532,
15187,
11,
532,
24309,
11,
532,
21526,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
36077,
66,
62,
19503,
80,
1,
14804,
58,
16,
1539,
352,
68,
16,
11,
352,
68,
17,
11,
352,
68,
18,
11,
352,
68,
19,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1,
14804,
1,
4503,
55,
46,
11,
3180,
2394,
39494,
10495,
12,
16,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
69,
62,
15,
1,
14804,
69,
62,
7718,
5277,
17,
8,
198,
17500,
16111,
421,
13636,
62,
23,
31980,
796,
360,
713,
7203,
71,
62,
1845,
907,
1,
14804,
58,
18,
13,
24,
68,
12,
1415,
11,
807,
13,
22,
68,
12,
1485,
11,
362,
13,
17,
68,
12,
1415,
11,
513,
13,
17,
68,
12,
1485,
11,
718,
13,
19,
68,
12,
1314,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
36077,
66,
1,
14804,
58,
12,
18376,
11,
532,
19708,
11,
532,
21139,
11,
532,
18781,
11,
532,
18781,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
36077,
66,
62,
19503,
80,
1,
14804,
58,
16,
1539,
352,
68,
16,
11,
352,
68,
17,
11,
352,
68,
18,
11,
352,
68,
19,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1,
14804,
1,
4503,
55,
46,
11,
40203,
16111,
421,
13636,
807,
31980,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
69,
62,
15,
1,
14804,
69,
62,
7718,
5277,
17,
8,
198,
82,
3808,
62,
1050,
82,
940,
796,
360,
713,
7203,
71,
62,
1845,
907,
1,
14804,
58,
20,
13,
18,
68,
12,
1157,
11,
604,
13,
22,
68,
12,
1157,
11,
352,
13,
21,
68,
12,
1314,
11,
860,
13,
21,
68,
12,
1415,
11,
860,
13,
24,
68,
12,
1433,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
36077,
66,
1,
14804,
58,
12,
15197,
11,
532,
17059,
11,
532,
8628,
11,
532,
17827,
11,
532,
21395,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
36077,
66,
62,
19503,
80,
1,
14804,
58,
16,
1539,
352,
68,
16,
11,
352,
68,
17,
11,
352,
68,
18,
11,
352,
68,
19,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1,
14804,
1,
21312,
312,
388,
11,
311,
6998,
4810,
50,
940,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
69,
62,
15,
1,
14804,
69,
62,
7718,
5277,
17,
8,
198,
728,
1505,
796,
360,
713,
7203,
71,
62,
1845,
907,
1,
14804,
58,
16,
13,
20,
68,
12,
1065,
11,
718,
13,
17,
68,
12,
1157,
11,
767,
13,
21,
68,
12,
1954,
11,
352,
13,
19,
68,
12,
1415,
11,
718,
13,
17,
68,
12,
1129,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
36077,
66,
1,
14804,
58,
12,
13348,
11,
532,
17059,
11,
532,
14198,
11,
532,
17279,
11,
532,
19782,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
36077,
66,
62,
19503,
80,
1,
14804,
58,
16,
1539,
352,
68,
16,
11,
352,
68,
17,
11,
352,
68,
18,
11,
352,
68,
19,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1,
14804,
1,
34,
274,
1505,
11,
48752,
27068,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
69,
62,
15,
1,
14804,
69,
62,
7718,
5277,
17,
8,
198,
16762,
72,
62,
9031,
75,
796,
360,
713,
7203,
71,
62,
1845,
907,
1,
14804,
58,
16,
13,
22,
68,
12,
24,
11,
352,
68,
12,
940,
11,
352,
13,
21,
68,
12,
940,
11,
513,
13,
20,
68,
12,
1485,
11,
352,
13,
23,
68,
12,
1433,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
36077,
66,
1,
14804,
58,
12,
3829,
11,
532,
10232,
11,
532,
15187,
11,
532,
18742,
11,
532,
14198,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
36077,
66,
62,
19503,
80,
1,
14804,
58,
16,
1539,
352,
68,
16,
11,
352,
68,
17,
11,
352,
68,
18,
11,
352,
68,
19,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1,
14804,
1,
4503,
55,
46,
11,
19308,
40,
8646,
43,
1600,
2,
11,
7754,
308,
12,
82,
40545,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
69,
62,
15,
1,
14804,
69,
62,
7718,
5277,
17,
8,
198,
198,
17500,
359,
2024,
796,
685,
17716,
261,
62,
270,
4310,
405,
33,
11,
556,
346,
298,
62,
68,
2598,
1731,
65,
11,
31624,
45787,
62,
6420,
62,
16,
11,
267,
1416,
16111,
421,
13636,
62,
23,
31980,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
264,
3808,
62,
1050,
82,
940,
11,
269,
274,
1505,
11,
285,
20259,
62,
9031,
75,
60,
198,
2,
2336,
7857,
796,
357,
21,
13,
20,
11,
604,
8,
198,
8043,
89,
796,
14631,
74,
1600,
366,
65,
1600,
366,
70,
1600,
366,
81,
1600,
366,
88,
1600,
366,
76,
1600,
366,
66,
1600,
366,
44605,
8973,
198,
5647,
796,
3785,
7,
5647,
7857,
16193,
21,
13,
20,
11,
19,
4008,
198,
897,
16,
796,
2336,
13,
2860,
62,
7266,
29487,
7,
16,
11,
16,
11,
16,
8,
198,
1455,
437,
62,
4102,
364,
796,
17635,
198,
4102,
263,
62,
14933,
796,
17635,
198,
1640,
1312,
287,
352,
25,
13664,
7,
17500,
359,
2024,
8,
198,
2,
329,
1312,
287,
352,
25,
16,
198,
220,
220,
220,
3124,
796,
3124,
89,
58,
72,
60,
198,
220,
220,
220,
24969,
1352,
796,
24969,
2024,
58,
72,
60,
198,
220,
220,
220,
611,
24969,
1352,
14692,
3672,
8973,
6624,
366,
4825,
55,
46,
11,
34299,
261,
7283,
4310,
405,
33,
1,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
11920,
796,
11920,
16,
198,
220,
220,
220,
220,
220,
220,
220,
277,
62,
7718,
5277,
796,
277,
62,
7718,
5277,
16,
198,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
11920,
796,
11920,
17,
198,
220,
220,
220,
220,
220,
220,
220,
277,
62,
7718,
5277,
796,
277,
62,
7718,
5277,
17,
198,
220,
220,
220,
886,
198,
220,
220,
220,
289,
62,
1845,
907,
796,
24969,
1352,
14692,
71,
62,
1845,
907,
8973,
24457,
24969,
1352,
14692,
69,
62,
15,
8973,
61,
17,
198,
220,
220,
220,
7716,
62,
40715,
62,
3919,
786,
0,
7,
40715,
62,
3919,
786,
11,
256,
62,
13664,
11,
277,
62,
7718,
5277,
11,
289,
62,
1845,
907,
8,
198,
220,
220,
220,
1303,
18074,
243,
796,
1103,
12195,
40715,
62,
3919,
786,
8,
198,
220,
220,
220,
1303,
6737,
796,
11920,
764,
9,
33325,
12195,
139,
243,
8,
198,
220,
220,
220,
1303,
6737,
764,
28,
11920,
764,
9,
33325,
12195,
5305,
12195,
40715,
62,
3919,
786,
4008,
198,
220,
220,
220,
1303,
2124,
796,
6737,
198,
220,
220,
220,
2124,
764,
28,
1103,
12195,
40715,
62,
3919,
786,
8,
764,
10,
657,
320,
198,
220,
220,
220,
1303,
1395,
11,
1395,
62,
6404,
11,
2030,
48382,
796,
42302,
62,
13940,
7,
87,
11,
277,
62,
82,
8,
198,
220,
220,
220,
277,
701,
0,
7,
87,
1776,
198,
220,
220,
220,
1395,
764,
28,
2352,
17,
12195,
87,
58,
16,
25,
45,
62,
2502,
62,
17,
10,
16,
12962,
1220,
357,
69,
62,
82,
9,
45,
1776,
198,
220,
220,
220,
1395,
58,
17,
25,
437,
12,
16,
60,
764,
28,
362,
764,
9,
1395,
58,
17,
25,
437,
12,
16,
11208,
198,
220,
220,
220,
1395,
764,
28,
838,
764,
9,
2604,
940,
12195,
55,
1776,
198,
220,
220,
220,
1303,
1395,
62,
9806,
796,
5415,
7,
5305,
12195,
55,
18125,
198,
220,
220,
220,
1303,
1395,
796,
1395,
764,
12,
1395,
62,
9806,
26,
198,
220,
220,
220,
1303,
7877,
16,
13,
29487,
7,
69,
8897,
3976,
58,
17,
25,
437,
60,
764,
12,
277,
62,
7718,
5277,
11,
1395,
58,
17,
25,
437,
4357,
3124,
11,
220,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6167,
28,
8841,
7,
17500,
359,
1352,
14692,
3672,
33116,
366,
422,
289,
2547,
907,
48774,
198,
220,
220,
220,
7877,
16,
13,
29487,
7,
69,
8897,
3976,
58,
17,
25,
437,
4357,
1103,
12195,
55,
58,
17,
25,
437,
46570,
3124,
8,
2,
828,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
6167,
28,
17500,
359,
1352,
14692,
3672,
8973,
8,
198,
220,
220,
220,
1303,
7877,
16,
13,
29487,
7,
69,
8897,
3976,
58,
17,
25,
437,
4357,
1103,
12195,
55,
58,
17,
25,
437,
46570,
3124,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
6167,
28,
8841,
7,
17500,
359,
1352,
14692,
3672,
33116,
366,
422,
289,
2547,
907,
48774,
198,
220,
220,
220,
7877,
16,
13,
1416,
1436,
7,
36077,
66,
62,
19503,
80,
11,
24969,
1352,
14692,
36077,
66,
1,
4083,
33747,
940,
9,
6404,
940,
7,
17,
36911,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
28,
8043,
8,
2,
11,
6167,
28,
8841,
7,
17500,
359,
1352,
14692,
3672,
33116,
366,
14056,
48774,
198,
220,
220,
220,
8177,
62,
4102,
263,
796,
458,
83,
13,
13949,
17,
35,
19510,
15,
11,
16,
828,
7,
15,
11,
15,
828,
3124,
28,
8043,
11,
18364,
2625,
78,
1600,
9493,
10992,
2625,
12,
4943,
198,
220,
220,
220,
4574,
0,
7,
1455,
437,
62,
4102,
364,
11,
8177,
62,
4102,
263,
8,
198,
220,
220,
220,
4574,
0,
7,
4102,
263,
62,
14933,
11,
24969,
1352,
14692,
3672,
8973,
8,
198,
437,
198,
87,
9888,
7203,
6404,
4943,
198,
87,
2475,
26933,
16,
11,
352,
68,
21,
12962,
198,
87,
18242,
7203,
37,
28707,
357,
7399,
8,
4943,
198,
2645,
9608,
7203,
36077,
66,
14,
7399,
4943,
198,
7266,
489,
1747,
62,
23032,
7,
4852,
28,
15,
13,
4846,
11,
1364,
28,
15,
13,
1065,
11,
826,
28,
15,
13,
3459,
11,
4220,
28,
15,
13,
1485,
8,
198,
897,
16,
13,
1455,
437,
7,
1455,
437,
62,
4102,
364,
11,
18364,
62,
14933,
8,
198,
198,
2,
3613,
5647,
7203,
5647,
942,
14,
354,
17,
62,
17500,
359,
1352,
62,
862,
9310,
13,
12315,
1600,
288,
14415,
28,
6200,
8
] | 1.627456 | 3,562 |
"""
```
measurement(m::PoolModel{T}) where {T<:AbstractFloat}
```
Assign measurement equation for Dynamic Pools
```
p(y_t) = λ_t * p_1 + (1 - λ_t) * p_2
```
where
```
λ_t = weight assigned to model 1
p_1 = predictive density according to model 1
p_2 = predictive density according to model 2
```
Equal weights fixes λ = 1/2, and static weights computes the likelihood
as if λ is time-invariant. For Bayesian Model Averaging,
we compute the average according to weights computed according to BMA.
The outputs are a function that computes the average of
passed predictive densities and a degenerate measurement error Distribution.
"""
function measurement(m::PoolModel{T}) where {T<:AbstractFloat}
obs = m.observables
weight_type = get_setting(m, :weight_type)
# Assumes λ to be weight on the first model
F_u = DiscreteUniform(0,0)
if weight_type == :dynamic
Ψ_dynamic_pm(x::Vector{Float64}, data::Vector{Float64}) = dot(data, x)
return Ψ_dynamic_pm, F_u
elseif weight_type == :equal
equal_wt = m[:λ].value
Ψ_equal_pm(x::Vector{Float64}, data::Vector{Float64}) = dot(data, equal_wt .* ones(2))
return Ψ_equal_pm, F_u
elseif weight_type == :static
Ψ_static_pm(x::Vector{Float64}, data::Vector{Float64}) = dot(data, x)
return Ψ_static_pm, F_u
elseif weight_type == :bma
Ψ_bma_pm(x::Vector{Float64}, data::Vector{Float64}) = dot(data, x)
return Ψ_bma_pm, F_u
end
end
| [
37811,
198,
15506,
63,
198,
1326,
5015,
434,
7,
76,
3712,
27201,
17633,
90,
51,
30072,
810,
1391,
51,
27,
25,
23839,
43879,
92,
198,
15506,
63,
198,
198,
8021,
570,
15558,
16022,
329,
26977,
350,
10141,
198,
198,
15506,
63,
198,
79,
7,
88,
62,
83,
8,
796,
7377,
119,
62,
83,
1635,
279,
62,
16,
1343,
357,
16,
532,
7377,
119,
62,
83,
8,
1635,
279,
62,
17,
198,
15506,
63,
198,
198,
3003,
198,
198,
15506,
63,
198,
39377,
62,
83,
796,
3463,
8686,
284,
2746,
352,
198,
79,
62,
16,
796,
33344,
12109,
1864,
284,
2746,
352,
198,
79,
62,
17,
796,
33344,
12109,
1864,
284,
2746,
362,
198,
15506,
63,
198,
198,
36,
13255,
19590,
13040,
7377,
119,
796,
352,
14,
17,
11,
290,
9037,
19590,
552,
1769,
262,
14955,
198,
292,
611,
7377,
119,
318,
640,
12,
16340,
2743,
415,
13,
1114,
4696,
35610,
9104,
317,
332,
3039,
11,
198,
732,
24061,
262,
2811,
1864,
284,
19590,
29231,
1864,
284,
347,
5673,
13,
198,
198,
464,
23862,
389,
257,
2163,
326,
552,
1769,
262,
2811,
286,
198,
6603,
276,
33344,
29509,
871,
290,
257,
25419,
378,
15558,
4049,
27484,
13,
198,
37811,
198,
8818,
15558,
7,
76,
3712,
27201,
17633,
90,
51,
30072,
810,
1391,
51,
27,
25,
23839,
43879,
92,
198,
220,
220,
220,
10201,
796,
285,
13,
672,
3168,
2977,
198,
220,
220,
220,
3463,
62,
4906,
796,
651,
62,
33990,
7,
76,
11,
1058,
6551,
62,
4906,
8,
628,
220,
220,
220,
1303,
2195,
8139,
7377,
119,
284,
307,
3463,
319,
262,
717,
2746,
198,
220,
220,
220,
376,
62,
84,
796,
8444,
8374,
3118,
6933,
7,
15,
11,
15,
8,
198,
220,
220,
220,
611,
3463,
62,
4906,
6624,
1058,
67,
28995,
198,
220,
220,
220,
220,
220,
220,
220,
7377,
101,
62,
67,
28995,
62,
4426,
7,
87,
3712,
38469,
90,
43879,
2414,
5512,
1366,
3712,
38469,
90,
43879,
2414,
30072,
796,
16605,
7,
7890,
11,
2124,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
7377,
101,
62,
67,
28995,
62,
4426,
11,
376,
62,
84,
198,
220,
220,
220,
2073,
361,
3463,
62,
4906,
6624,
1058,
40496,
198,
220,
220,
220,
220,
220,
220,
220,
4961,
62,
46569,
796,
285,
58,
25,
39377,
4083,
8367,
198,
220,
220,
220,
220,
220,
220,
220,
7377,
101,
62,
40496,
62,
4426,
7,
87,
3712,
38469,
90,
43879,
2414,
5512,
1366,
3712,
38469,
90,
43879,
2414,
30072,
796,
16605,
7,
7890,
11,
4961,
62,
46569,
764,
9,
3392,
7,
17,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
7377,
101,
62,
40496,
62,
4426,
11,
376,
62,
84,
198,
220,
220,
220,
2073,
361,
3463,
62,
4906,
6624,
1058,
12708,
198,
220,
220,
220,
220,
220,
220,
220,
7377,
101,
62,
12708,
62,
4426,
7,
87,
3712,
38469,
90,
43879,
2414,
5512,
1366,
3712,
38469,
90,
43879,
2414,
30072,
796,
16605,
7,
7890,
11,
2124,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
7377,
101,
62,
12708,
62,
4426,
11,
376,
62,
84,
198,
220,
220,
220,
2073,
361,
3463,
62,
4906,
6624,
1058,
65,
2611,
198,
220,
220,
220,
220,
220,
220,
220,
7377,
101,
62,
65,
2611,
62,
4426,
7,
87,
3712,
38469,
90,
43879,
2414,
5512,
1366,
3712,
38469,
90,
43879,
2414,
30072,
796,
16605,
7,
7890,
11,
2124,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
7377,
101,
62,
65,
2611,
62,
4426,
11,
376,
62,
84,
198,
220,
220,
220,
886,
198,
437,
198
] | 2.520478 | 586 |
using ExecutableSpecifications: @given, @when, @then, @expect
@given "some precondition which does nothing" begin
end
@when "we perform a no-op step" begin
end
@then "the scenario as a whole succeeds" begin
end
@when "a step has more than one matching step definition" begin
end
@when "a step has more than one matching step definition" begin
end
@when "foo is set to value 42" begin
context[:foo] = 42
end
@when "foo is set to value -17" begin
context[:foo] = -17
end
@then "foo is greater than zero" begin
@expect context[:foo] > 0
end
@then "foo is less than zero" begin
@expect context[:foo] < 0
end | [
3500,
8393,
18187,
22882,
6637,
25,
2488,
35569,
11,
2488,
12518,
11,
2488,
8524,
11,
2488,
1069,
806,
198,
198,
31,
35569,
366,
11246,
3718,
623,
653,
543,
857,
2147,
1,
2221,
198,
198,
437,
198,
198,
31,
12518,
366,
732,
1620,
257,
645,
12,
404,
2239,
1,
2221,
198,
198,
437,
198,
198,
31,
8524,
366,
1169,
8883,
355,
257,
2187,
31137,
1,
2221,
198,
198,
437,
198,
198,
31,
12518,
366,
64,
2239,
468,
517,
621,
530,
12336,
2239,
6770,
1,
2221,
198,
198,
437,
198,
198,
31,
12518,
366,
64,
2239,
468,
517,
621,
530,
12336,
2239,
6770,
1,
2221,
198,
198,
437,
198,
198,
31,
12518,
366,
21943,
318,
900,
284,
1988,
5433,
1,
2221,
198,
220,
220,
220,
4732,
58,
25,
21943,
60,
796,
5433,
198,
437,
198,
198,
31,
12518,
366,
21943,
318,
900,
284,
1988,
532,
1558,
1,
2221,
198,
220,
220,
220,
4732,
58,
25,
21943,
60,
796,
532,
1558,
198,
437,
198,
198,
31,
8524,
366,
21943,
318,
3744,
621,
6632,
1,
2221,
198,
220,
220,
220,
2488,
1069,
806,
4732,
58,
25,
21943,
60,
1875,
657,
198,
437,
198,
198,
31,
8524,
366,
21943,
318,
1342,
621,
6632,
1,
2221,
198,
220,
220,
220,
2488,
1069,
806,
4732,
58,
25,
21943,
60,
1279,
657,
198,
437
] | 2.930556 | 216 |
using MakieLayout
using Makie
begin
scene = Scene(resolution = (1000, 1000));
screen = display(scene)
campixel!(scene);
maingl = GridLayout(scene, 1, 3;
addedcolgaps = Fixed(0),
alignmode = Outside(30)
)
maingl[1, 2] = LAxis(scene)
maingl[1, 3] = LAxis(scene)
guigl = maingl[1, 1] = GridLayout(1, 3; height=Auto(false))
# guigl[1, 1] = LButton(scene, 100, 30, "button")
guigl[1, 1] = LText(scene, text="HelloWorld", halign=:left)
guigl[1, 2] = LText(scene, text="Blablo", halign=:left)
guigl[1, 3] = LButton(scene, width = 120, height = 30, label = "Bliblu")
guigl[2, 1] = LText(scene, text="Mamama", halign=:left)
guigl[2, 2] = LText(scene, text="Mimimi", halign=:left)
guigl[2, 3] = LButton(scene, width = 120, height = 30, label = "Momomo")
guigl[3, 1] = LText(scene, text="VeerrryLoong", halign=:left)
guigl[3, 2] = LText(scene, text="Blablo", halign=:left)
guigl[3, 3] = LButton(scene, width = 120, height = 30, label = "Short")
end
| [
3500,
15841,
494,
32517,
198,
3500,
15841,
494,
198,
198,
27471,
198,
220,
220,
220,
3715,
796,
28315,
7,
29268,
796,
357,
12825,
11,
8576,
18125,
198,
220,
220,
220,
3159,
796,
3359,
7,
29734,
8,
198,
220,
220,
220,
1413,
7168,
0,
7,
29734,
1776,
628,
220,
220,
220,
17266,
278,
75,
796,
24846,
32517,
7,
29734,
11,
352,
11,
513,
26,
198,
220,
220,
220,
220,
220,
220,
220,
2087,
4033,
70,
1686,
796,
10832,
7,
15,
828,
198,
220,
220,
220,
220,
220,
220,
220,
10548,
14171,
796,
22151,
7,
1270,
8,
198,
220,
220,
220,
1267,
628,
220,
220,
220,
17266,
278,
75,
58,
16,
11,
362,
60,
796,
9131,
87,
271,
7,
29734,
8,
198,
220,
220,
220,
17266,
278,
75,
58,
16,
11,
513,
60,
796,
9131,
87,
271,
7,
29734,
8,
628,
220,
220,
220,
915,
38686,
796,
17266,
278,
75,
58,
16,
11,
352,
60,
796,
24846,
32517,
7,
16,
11,
513,
26,
6001,
28,
27722,
7,
9562,
4008,
628,
220,
220,
220,
1303,
915,
38686,
58,
16,
11,
352,
60,
796,
406,
21864,
7,
29734,
11,
1802,
11,
1542,
11,
366,
16539,
4943,
198,
220,
220,
220,
915,
38686,
58,
16,
11,
352,
60,
796,
406,
8206,
7,
29734,
11,
2420,
2625,
15496,
10603,
1600,
10284,
570,
28,
25,
9464,
8,
198,
220,
220,
220,
915,
38686,
58,
16,
11,
362,
60,
796,
406,
8206,
7,
29734,
11,
2420,
2625,
3629,
18817,
1600,
10284,
570,
28,
25,
9464,
8,
198,
220,
220,
220,
915,
38686,
58,
16,
11,
513,
60,
796,
406,
21864,
7,
29734,
11,
9647,
796,
7982,
11,
6001,
796,
1542,
11,
6167,
796,
366,
3629,
571,
2290,
4943,
628,
220,
220,
220,
915,
38686,
58,
17,
11,
352,
60,
796,
406,
8206,
7,
29734,
11,
2420,
2625,
44,
321,
1689,
1600,
10284,
570,
28,
25,
9464,
8,
198,
220,
220,
220,
915,
38686,
58,
17,
11,
362,
60,
796,
406,
8206,
7,
29734,
11,
2420,
2625,
44,
320,
25236,
1600,
10284,
570,
28,
25,
9464,
8,
198,
220,
220,
220,
915,
38686,
58,
17,
11,
513,
60,
796,
406,
21864,
7,
29734,
11,
9647,
796,
7982,
11,
6001,
796,
1542,
11,
6167,
796,
366,
29252,
17902,
4943,
628,
220,
220,
220,
915,
38686,
58,
18,
11,
352,
60,
796,
406,
8206,
7,
29734,
11,
2420,
2625,
26979,
8056,
563,
27654,
506,
1600,
10284,
570,
28,
25,
9464,
8,
198,
220,
220,
220,
915,
38686,
58,
18,
11,
362,
60,
796,
406,
8206,
7,
29734,
11,
2420,
2625,
3629,
18817,
1600,
10284,
570,
28,
25,
9464,
8,
198,
220,
220,
220,
915,
38686,
58,
18,
11,
513,
60,
796,
406,
21864,
7,
29734,
11,
9647,
796,
7982,
11,
6001,
796,
1542,
11,
6167,
796,
366,
16438,
4943,
198,
198,
437,
198
] | 2.238095 | 462 |
module day11
import ..aoc19: run_program!
using DelimitedFiles, UnicodePlots, REPL
readInput() = parse.(Int, split(readline(joinpath(@__DIR__,"input.txt")), ','))
const UP = (1, 0)
const RIGHT = (0, 1)
const DOWN = (-1, 0)
const LEFT = (0, -1)
turnLeft(d) = d == UP ? LEFT : (d == RIGHT ? UP : (d == DOWN ? RIGHT : DOWN))
turnRight(d) = d == UP ? RIGHT : (d == RIGHT ? DOWN : (d == DOWN ? LEFT : UP))
function part1(data)
pos = (0, 0)
dir = UP
painted = Dict{Tuple{Int, Int}, Int}()
input = Channel{Int}(Inf)
output = Channel{Int}(Inf)
task = @async run_program!(data, input, output)
while !istaskdone(task)
put!(input, get(painted, pos, 0))
color = take!(output)
turn = take!(output)
painted[pos] = color # paint
dir = turn == 0 ? turnLeft(dir) : turnRight(dir) # turn
pos = pos .+ dir # move forward
end
length(painted)
end
function part2(data)
pos = (0, 0)
dir = UP
painted = Dict((0, 0) => 1)
input = Channel{Int}(Inf)
output = Channel{Int}(Inf)
task = @async run_program!(data, input, output)
while !istaskdone(task)
put!(input, get(painted, pos, 0))
color = take!(output)
turn = take!(output)
painted[pos] = color # paint
dir = turn == 0 ? turnLeft(dir) : turnRight(dir) # turn
pos = pos .+ dir # move forward
end
white = filter(p -> p.second == 1, painted)
scatterplot(last.(keys(white)), first.(keys(white)), xlim=extrema(last.(keys(painted))),
ylim=extrema(first.(keys(painted))), height = 5, width = 70, color = :blue, canvas = BlockCanvas)
end
end | [
21412,
1110,
1157,
198,
198,
11748,
11485,
64,
420,
1129,
25,
1057,
62,
23065,
0,
198,
3500,
4216,
320,
863,
25876,
11,
34371,
3646,
1747,
11,
45285,
198,
198,
961,
20560,
3419,
796,
21136,
12195,
5317,
11,
6626,
7,
961,
1370,
7,
22179,
6978,
7,
31,
834,
34720,
834,
553,
15414,
13,
14116,
4943,
828,
705,
4032,
4008,
198,
198,
9979,
15958,
796,
357,
16,
11,
657,
8,
198,
9979,
33621,
796,
357,
15,
11,
352,
8,
198,
9979,
30320,
796,
13841,
16,
11,
657,
8,
198,
9979,
12509,
9792,
796,
357,
15,
11,
532,
16,
8,
198,
15344,
18819,
7,
67,
8,
796,
288,
6624,
15958,
5633,
12509,
9792,
1058,
357,
67,
6624,
33621,
5633,
15958,
1058,
357,
67,
6624,
30320,
5633,
33621,
1058,
30320,
4008,
198,
15344,
11028,
7,
67,
8,
796,
288,
6624,
15958,
5633,
33621,
1058,
357,
67,
6624,
33621,
5633,
30320,
1058,
357,
67,
6624,
30320,
5633,
12509,
9792,
1058,
15958,
4008,
198,
198,
8818,
636,
16,
7,
7890,
8,
198,
220,
220,
220,
1426,
796,
357,
15,
11,
657,
8,
198,
220,
220,
220,
26672,
796,
15958,
198,
220,
220,
220,
13055,
796,
360,
713,
90,
51,
29291,
90,
5317,
11,
2558,
5512,
2558,
92,
3419,
628,
220,
220,
220,
5128,
796,
11102,
90,
5317,
92,
7,
18943,
8,
198,
220,
220,
220,
5072,
796,
11102,
90,
5317,
92,
7,
18943,
8,
198,
220,
220,
220,
4876,
796,
2488,
292,
13361,
1057,
62,
23065,
0,
7,
7890,
11,
5128,
11,
5072,
8,
628,
220,
220,
220,
981,
5145,
396,
2093,
28060,
7,
35943,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1234,
0,
7,
15414,
11,
651,
7,
47351,
11,
1426,
11,
657,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
3124,
796,
1011,
0,
7,
22915,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1210,
796,
1011,
0,
7,
22915,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13055,
58,
1930,
60,
796,
3124,
1303,
7521,
198,
220,
220,
220,
220,
220,
220,
220,
26672,
796,
1210,
6624,
657,
5633,
1210,
18819,
7,
15908,
8,
1058,
1210,
11028,
7,
15908,
8,
1303,
1210,
198,
220,
220,
220,
220,
220,
220,
220,
1426,
796,
1426,
764,
10,
26672,
1303,
1445,
2651,
198,
220,
220,
220,
886,
628,
220,
220,
220,
4129,
7,
47351,
8,
198,
437,
198,
198,
8818,
636,
17,
7,
7890,
8,
198,
220,
220,
220,
1426,
796,
357,
15,
11,
657,
8,
198,
220,
220,
220,
26672,
796,
15958,
198,
220,
220,
220,
13055,
796,
360,
713,
19510,
15,
11,
657,
8,
5218,
352,
8,
628,
220,
220,
220,
5128,
796,
11102,
90,
5317,
92,
7,
18943,
8,
198,
220,
220,
220,
5072,
796,
11102,
90,
5317,
92,
7,
18943,
8,
198,
220,
220,
220,
4876,
796,
2488,
292,
13361,
1057,
62,
23065,
0,
7,
7890,
11,
5128,
11,
5072,
8,
628,
220,
220,
220,
981,
5145,
396,
2093,
28060,
7,
35943,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1234,
0,
7,
15414,
11,
651,
7,
47351,
11,
1426,
11,
657,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
3124,
796,
1011,
0,
7,
22915,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1210,
796,
1011,
0,
7,
22915,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13055,
58,
1930,
60,
796,
3124,
1303,
7521,
198,
220,
220,
220,
220,
220,
220,
220,
26672,
796,
1210,
6624,
657,
5633,
1210,
18819,
7,
15908,
8,
1058,
1210,
11028,
7,
15908,
8,
1303,
1210,
198,
220,
220,
220,
220,
220,
220,
220,
1426,
796,
1426,
764,
10,
26672,
1303,
1445,
2651,
198,
220,
220,
220,
886,
628,
220,
220,
220,
2330,
796,
8106,
7,
79,
4613,
279,
13,
12227,
6624,
352,
11,
13055,
8,
628,
220,
220,
220,
41058,
29487,
7,
12957,
12195,
13083,
7,
11186,
36911,
717,
12195,
13083,
7,
11186,
36911,
2124,
2475,
28,
2302,
260,
2611,
7,
12957,
12195,
13083,
7,
47351,
4008,
828,
198,
220,
220,
220,
220,
220,
220,
220,
331,
2475,
28,
2302,
260,
2611,
7,
11085,
12195,
13083,
7,
47351,
4008,
828,
6001,
796,
642,
11,
9647,
796,
4317,
11,
3124,
796,
1058,
17585,
11,
21978,
796,
9726,
6090,
11017,
8,
198,
198,
437,
198,
198,
437
] | 2.36 | 700 |
using Documenter, GMT
makedocs(
modules = [GMT],
format = :html,
sitename = "GMT",
pages = [
"Home" => "index.md",
"Some examples" => "examples.md",
"Draw rectangles examples" => "rectangles.md",
"Draw frames examples" => "frames.md",
"Manual" => [
"usage.md",
"monolitic.md",
"modules.md",
],
"The GMT types" => "types.md"
],
html_prettyurls = true,
)
deploydocs(
repo = "github.com/GenericMappingTools/GMT.jl.git",
target = "build",
julia = "0.7",
deps = nothing,
make = nothing
) | [
3500,
16854,
263,
11,
16987,
198,
198,
76,
4335,
420,
82,
7,
198,
220,
220,
220,
13103,
796,
685,
49424,
4357,
198,
220,
220,
220,
5794,
796,
1058,
6494,
11,
198,
220,
220,
220,
1650,
12453,
796,
366,
49424,
1600,
198,
220,
220,
220,
5468,
796,
685,
198,
220,
220,
220,
220,
220,
220,
220,
366,
16060,
1,
5218,
366,
9630,
13,
9132,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
366,
4366,
6096,
1,
5218,
366,
1069,
12629,
13,
9132,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
366,
25302,
13621,
27787,
6096,
1,
5218,
366,
2554,
27787,
13,
9132,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
366,
25302,
13431,
6096,
1,
5218,
366,
37805,
13,
9132,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
366,
5124,
723,
1,
5218,
685,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
26060,
13,
9132,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
2144,
6212,
291,
13,
9132,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
18170,
13,
9132,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
16589,
198,
220,
220,
220,
220,
220,
220,
220,
366,
464,
16987,
3858,
1,
5218,
366,
19199,
13,
9132,
1,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
27711,
62,
37784,
6371,
82,
796,
2081,
11,
198,
8,
198,
198,
2934,
1420,
31628,
7,
198,
220,
220,
220,
29924,
220,
220,
796,
366,
12567,
13,
785,
14,
46189,
44,
5912,
33637,
14,
49424,
13,
20362,
13,
18300,
1600,
198,
220,
220,
220,
2496,
796,
366,
11249,
1600,
198,
220,
220,
220,
474,
43640,
796,
366,
15,
13,
22,
1600,
198,
220,
220,
220,
390,
862,
220,
220,
796,
2147,
11,
198,
220,
220,
220,
787,
220,
220,
796,
2147,
198,
8
] | 2.019355 | 310 |
using Plots
anim = @animate for i in 1:10
plot(t->sinpi(t+i/5), range(0, 2, length=100))
end
gif(anim, "test_animation.gif", fps=40) | [
3500,
1345,
1747,
198,
198,
11227,
796,
2488,
45685,
329,
1312,
287,
352,
25,
940,
198,
220,
220,
220,
7110,
7,
83,
3784,
31369,
14415,
7,
83,
10,
72,
14,
20,
828,
2837,
7,
15,
11,
362,
11,
4129,
28,
3064,
4008,
198,
437,
198,
198,
27908,
7,
11227,
11,
366,
9288,
62,
11227,
341,
13,
27908,
1600,
32977,
28,
1821,
8
] | 2.225806 | 62 |
mutable struct TrackedReal{T<:Real}
data::T
grad::Union{Nothing,T}
children::Dict
# this field is only need for printing the graph. you can safely remove it.
name::String
end
track(x::Real,name="") = TrackedReal(x,nothing,Dict(),name)
function Base.show(io::IO, x::TrackedReal)
t = isempty(x.name) ? "(tracked)" : "(tracked $(x.name))"
print(io, "$(x.data) $t")
end
function accum!(x::TrackedReal)
if isnothing(x.grad)
x.grad = sum(accum!(v)*w for (v,w) in x.children)
end
x.grad
end
function gradient(f, args::Real...)
ts = track.(args)
y = f(ts...)
y.grad = 1.0
accum!.(ts)
end
########## RULES #############################################################
function Base.:*(a::TrackedReal, b::TrackedReal)
z = track(a.data * b.data, "*")
a.children[z] = b.data # dz/da=b
b.children[z] = a.data # dz/db=a
z
end
function Base.:+(a::TrackedReal{T}, b::TrackedReal{T}) where T
z = track(a.data + b.data, "+")
a.children[z] = one(T)
b.children[z] = one(T)
z
end
function Base.sin(x::TrackedReal)
z = track(sin(x.data), "sin")
x.children[z] = cos(x.data)
z
end
########## Optimizion 2D function ############################################
using Plots
g(x,y) = y*y + sin(x)
cscheme = cgrad(:RdYlBu_5, rev=true)
p1 = contour(-4:0.1:4, -2:0.1:2, g, fill=true, c=cscheme, xlabel="x", ylabel="y")
display(p1)
function descend(f::Function, λ::Real, args::Real...)
Δargs = gradient(f, args...)
args .- λ .* Δargs
end
function minimize(f::Function, args::T...; niters=20, λ=0.01) where T<:Real
paths = ntuple(_->Vector{T}(undef,niters), length(args))
for i in 1:niters
args = descend(f, λ, args...)
@info f(args...)
for j in 1:length(args)
paths[j][i] = args[j]
end
end
paths
end
xs1, ys1 = minimize(g, 1.5, -2.4, λ=0.2, niters=34)
xs2, ys2 = minimize(g, 1.8, -2.4, λ=0.2, niters=16)
scatter!(p1, [xs1[1]], [ys1[1]], markercolor=:black, marker=:star, ms=7, label="Minimum")
scatter!(p1, [xs2[1]], [ys2[1]], markercolor=:black, marker=:star, ms=7, label=false)
scatter!(p1, [-π/2], [0], markercolor=:red, marker=:star, ms=7, label="Initial Point")
scatter!(p1, xs1[1:1], ys1[1:1], markercolor=:black, label="GD Path", xlims=(-4,4), ylims=(-2,2))
anim = @animate for i in 1:max(length(xs1), length(xs2))
if i <= length(xs1)
scatter!(p1, xs1[1:i], ys1[1:i], mc=:black, lw=3, xlims=(-4,4), ylims=(-2,2), label=false)
end
if i <= length(xs2)
scatter!(p1, xs2[1:i], ys2[1:i], mc=:black, lw=3, label=false)
end
p1
end
gif(anim, "gd-path.gif", fps=15)
| [
76,
18187,
2878,
833,
6021,
15633,
90,
51,
27,
25,
15633,
92,
198,
220,
220,
220,
1366,
3712,
51,
198,
220,
220,
220,
3915,
3712,
38176,
90,
18465,
11,
51,
92,
198,
220,
220,
220,
1751,
3712,
35,
713,
198,
220,
220,
220,
1303,
428,
2214,
318,
691,
761,
329,
13570,
262,
4823,
13,
345,
460,
11512,
4781,
340,
13,
198,
220,
220,
220,
1438,
3712,
10100,
198,
437,
198,
198,
11659,
7,
87,
3712,
15633,
11,
3672,
2625,
4943,
796,
833,
6021,
15633,
7,
87,
11,
22366,
11,
35,
713,
22784,
3672,
8,
198,
198,
8818,
7308,
13,
12860,
7,
952,
3712,
9399,
11,
2124,
3712,
2898,
6021,
15633,
8,
198,
220,
220,
220,
256,
796,
318,
28920,
7,
87,
13,
3672,
8,
5633,
30629,
2213,
6021,
16725,
1058,
30629,
2213,
6021,
29568,
87,
13,
3672,
4008,
1,
198,
220,
220,
220,
3601,
7,
952,
11,
17971,
7,
87,
13,
7890,
8,
720,
83,
4943,
198,
437,
198,
198,
8818,
10507,
0,
7,
87,
3712,
2898,
6021,
15633,
8,
198,
220,
220,
220,
611,
318,
22366,
7,
87,
13,
9744,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
13,
9744,
796,
2160,
7,
4134,
388,
0,
7,
85,
27493,
86,
329,
357,
85,
11,
86,
8,
287,
2124,
13,
17197,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
2124,
13,
9744,
198,
437,
198,
198,
8818,
31312,
7,
69,
11,
26498,
3712,
15633,
23029,
198,
220,
220,
220,
40379,
796,
2610,
12195,
22046,
8,
198,
220,
220,
220,
331,
220,
796,
277,
7,
912,
23029,
198,
220,
220,
220,
331,
13,
9744,
796,
352,
13,
15,
198,
220,
220,
220,
10507,
0,
12195,
912,
8,
198,
437,
628,
198,
7804,
2235,
220,
371,
6239,
1546,
220,
1303,
29113,
14468,
7804,
4242,
198,
198,
8818,
7308,
11207,
9,
7,
64,
3712,
2898,
6021,
15633,
11,
275,
3712,
2898,
6021,
15633,
8,
198,
220,
220,
220,
1976,
796,
2610,
7,
64,
13,
7890,
1635,
275,
13,
7890,
11,
366,
9,
4943,
198,
220,
220,
220,
257,
13,
17197,
58,
89,
60,
796,
275,
13,
7890,
220,
1303,
288,
89,
14,
6814,
28,
65,
198,
220,
220,
220,
275,
13,
17197,
58,
89,
60,
796,
257,
13,
7890,
220,
1303,
288,
89,
14,
9945,
28,
64,
198,
220,
220,
220,
1976,
198,
437,
198,
8818,
7308,
11207,
33747,
64,
3712,
2898,
6021,
15633,
90,
51,
5512,
275,
3712,
2898,
6021,
15633,
90,
51,
30072,
810,
309,
198,
220,
220,
220,
1976,
796,
2610,
7,
64,
13,
7890,
1343,
275,
13,
7890,
11,
43825,
4943,
198,
220,
220,
220,
257,
13,
17197,
58,
89,
60,
796,
530,
7,
51,
8,
198,
220,
220,
220,
275,
13,
17197,
58,
89,
60,
796,
530,
7,
51,
8,
198,
220,
220,
220,
1976,
198,
437,
198,
8818,
7308,
13,
31369,
7,
87,
3712,
2898,
6021,
15633,
8,
198,
220,
220,
220,
1976,
796,
2610,
7,
31369,
7,
87,
13,
7890,
828,
366,
31369,
4943,
198,
220,
220,
220,
2124,
13,
17197,
58,
89,
60,
796,
8615,
7,
87,
13,
7890,
8,
198,
220,
220,
220,
1976,
198,
437,
628,
198,
7804,
2235,
220,
30011,
528,
295,
362,
35,
2163,
220,
1303,
29113,
7804,
21017,
198,
198,
3500,
1345,
1747,
198,
70,
7,
87,
11,
88,
8,
796,
331,
9,
88,
1343,
7813,
7,
87,
8,
198,
66,
15952,
1326,
796,
269,
9744,
7,
25,
49,
67,
56,
75,
38374,
62,
20,
11,
2710,
28,
7942,
8,
198,
79,
16,
796,
542,
454,
32590,
19,
25,
15,
13,
16,
25,
19,
11,
532,
17,
25,
15,
13,
16,
25,
17,
11,
308,
11,
6070,
28,
7942,
11,
269,
28,
66,
15952,
1326,
11,
2124,
18242,
2625,
87,
1600,
331,
18242,
2625,
88,
4943,
198,
13812,
7,
79,
16,
8,
628,
198,
8818,
15350,
7,
69,
3712,
22203,
11,
7377,
119,
3712,
15633,
11,
26498,
3712,
15633,
23029,
198,
220,
220,
220,
37455,
22046,
796,
31312,
7,
69,
11,
26498,
23029,
198,
220,
220,
220,
26498,
764,
12,
7377,
119,
764,
9,
37455,
22046,
198,
437,
198,
198,
8818,
17775,
7,
69,
3712,
22203,
11,
26498,
3712,
51,
986,
26,
13759,
364,
28,
1238,
11,
7377,
119,
28,
15,
13,
486,
8,
810,
309,
27,
25,
15633,
198,
220,
220,
220,
13532,
796,
299,
83,
29291,
28264,
3784,
38469,
90,
51,
92,
7,
917,
891,
11,
48825,
364,
828,
4129,
7,
22046,
4008,
198,
220,
220,
220,
329,
1312,
287,
352,
25,
48825,
364,
198,
220,
220,
220,
220,
220,
220,
220,
26498,
796,
15350,
7,
69,
11,
7377,
119,
11,
26498,
23029,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
10951,
277,
7,
22046,
23029,
198,
220,
220,
220,
220,
220,
220,
220,
329,
474,
287,
352,
25,
13664,
7,
22046,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13532,
58,
73,
7131,
72,
60,
796,
26498,
58,
73,
60,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
220,
220,
220,
13532,
198,
437,
198,
198,
34223,
16,
11,
331,
82,
16,
796,
17775,
7,
70,
11,
352,
13,
20,
11,
532,
17,
13,
19,
11,
7377,
119,
28,
15,
13,
17,
11,
13759,
364,
28,
2682,
8,
198,
34223,
17,
11,
331,
82,
17,
796,
17775,
7,
70,
11,
352,
13,
23,
11,
532,
17,
13,
19,
11,
7377,
119,
28,
15,
13,
17,
11,
13759,
364,
28,
1433,
8,
198,
198,
1416,
1436,
0,
7,
79,
16,
11,
685,
34223,
16,
58,
16,
60,
4357,
685,
893,
16,
58,
16,
60,
4357,
1317,
2798,
45621,
28,
25,
13424,
11,
18364,
28,
25,
7364,
11,
13845,
28,
22,
11,
6167,
2625,
44046,
4943,
198,
1416,
1436,
0,
7,
79,
16,
11,
685,
34223,
17,
58,
16,
60,
4357,
685,
893,
17,
58,
16,
60,
4357,
1317,
2798,
45621,
28,
25,
13424,
11,
18364,
28,
25,
7364,
11,
13845,
28,
22,
11,
6167,
28,
9562,
8,
198,
1416,
1436,
0,
7,
79,
16,
11,
25915,
46582,
14,
17,
4357,
685,
15,
4357,
1317,
2798,
45621,
28,
25,
445,
11,
18364,
28,
25,
7364,
11,
13845,
28,
22,
11,
6167,
2625,
24243,
6252,
4943,
198,
1416,
1436,
0,
7,
79,
16,
11,
2124,
82,
16,
58,
16,
25,
16,
4357,
331,
82,
16,
58,
16,
25,
16,
4357,
1317,
2798,
45621,
28,
25,
13424,
11,
6167,
2625,
45113,
10644,
1600,
2124,
2475,
82,
16193,
12,
19,
11,
19,
828,
331,
2475,
82,
16193,
12,
17,
11,
17,
4008,
198,
198,
11227,
796,
2488,
45685,
329,
1312,
287,
352,
25,
9806,
7,
13664,
7,
34223,
16,
828,
4129,
7,
34223,
17,
4008,
198,
220,
220,
220,
611,
1312,
19841,
4129,
7,
34223,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
41058,
0,
7,
79,
16,
11,
2124,
82,
16,
58,
16,
25,
72,
4357,
331,
82,
16,
58,
16,
25,
72,
4357,
36650,
28,
25,
13424,
11,
300,
86,
28,
18,
11,
2124,
2475,
82,
16193,
12,
19,
11,
19,
828,
331,
2475,
82,
16193,
12,
17,
11,
17,
828,
6167,
28,
9562,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
611,
1312,
19841,
4129,
7,
34223,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
41058,
0,
7,
79,
16,
11,
2124,
82,
17,
58,
16,
25,
72,
4357,
331,
82,
17,
58,
16,
25,
72,
4357,
36650,
28,
25,
13424,
11,
300,
86,
28,
18,
11,
6167,
28,
9562,
8,
198,
220,
220,
220,
886,
198,
220,
220,
220,
279,
16,
198,
437,
198,
198,
27908,
7,
11227,
11,
366,
21287,
12,
6978,
13,
27908,
1600,
32977,
28,
1314,
8,
198
] | 2.108215 | 1,266 |
struct ConfusionMatrix
tp::Int
fp::Int
fn::Int
tn::Int
end
function getConfusionMatrix(Δ::AbstractMatrix{T}, hΔ::AbstractMatrix{T}, thr=1e-4) where T
p = size(Δ, 1)
tp = fp = fn = tn = 0
for c=1:p
for r=c:p
if Δ[r, c] != zero(T)
if abs(hΔ[r, c]) > thr
# not zero estimated as not zero
tp += 1
else
# not zero estimated as zero
fn += 1
end
else
if abs(hΔ[r, c]) > thr
# zero estimated as not zero
fp += 1
else
# zero estimated as zero
tn += 1
end
end
end
end
ConfusionMatrix(tp, fp, fn, tn)
end
function getConfusionMatrix(Δ::AbstractMatrix{T}, hΔ::SparseIterate{T}, thr=1e-4) where T
p = size(Δ, 1)
tp = fp = fn = tn = 0
for c=1:p
for r=c:p
if Δ[r, c] != zero(T)
if abs(hΔ[sub2indLowerTriangular(p, r, c)]) > thr
# not zero estimated as not zero
tp += 1
else
# not zero estimated as zero
fn += 1
end
else
if abs(hΔ[sub2indLowerTriangular(p, r, c)]) > thr
# zero estimated as not zero
fp += 1
else
# zero estimated as zero
tn += 1
end
end
end
end
ConfusionMatrix(tp, fp, fn, tn)
end
function tpr(t::ConfusionMatrix)
dn = t.tp + t.fn
dn > 0 ? t.tp / dn : 0.
end
function fpr(t::ConfusionMatrix)
dn = t.fp + t.tn
dn > 0 ? t.fp / dn : 0.
end
function precision(t::ConfusionMatrix)
dn = t.tp + t.fp
dn > 0 ? t.tp / dn : 1.
end
recall(t::ConfusionMatrix) = tpr(t)
| [
7249,
7326,
4241,
46912,
198,
220,
256,
79,
3712,
5317,
198,
220,
277,
79,
3712,
5317,
198,
220,
24714,
3712,
5317,
198,
220,
256,
77,
3712,
5317,
198,
437,
198,
198,
8818,
651,
18546,
4241,
46912,
7,
138,
242,
3712,
23839,
46912,
90,
51,
5512,
289,
138,
242,
3712,
23839,
46912,
90,
51,
5512,
5636,
28,
16,
68,
12,
19,
8,
810,
309,
198,
220,
279,
796,
2546,
7,
138,
242,
11,
352,
8,
628,
220,
256,
79,
796,
277,
79,
796,
24714,
796,
256,
77,
796,
657,
198,
220,
329,
269,
28,
16,
25,
79,
198,
220,
220,
220,
329,
374,
28,
66,
25,
79,
198,
220,
220,
220,
220,
220,
611,
37455,
58,
81,
11,
269,
60,
14512,
6632,
7,
51,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2352,
7,
71,
138,
242,
58,
81,
11,
269,
12962,
1875,
5636,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
407,
6632,
6108,
355,
407,
6632,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
79,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
407,
6632,
6108,
355,
6632,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24714,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2352,
7,
71,
138,
242,
58,
81,
11,
269,
12962,
1875,
5636,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
6632,
6108,
355,
407,
6632,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
79,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
6632,
6108,
355,
6632,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
77,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
220,
886,
198,
220,
7326,
4241,
46912,
7,
34788,
11,
277,
79,
11,
24714,
11,
256,
77,
8,
198,
437,
198,
198,
8818,
651,
18546,
4241,
46912,
7,
138,
242,
3712,
23839,
46912,
90,
51,
5512,
289,
138,
242,
3712,
50,
29572,
29993,
378,
90,
51,
5512,
5636,
28,
16,
68,
12,
19,
8,
810,
309,
198,
220,
279,
796,
2546,
7,
138,
242,
11,
352,
8,
628,
220,
256,
79,
796,
277,
79,
796,
24714,
796,
256,
77,
796,
657,
198,
220,
329,
269,
28,
16,
25,
79,
198,
220,
220,
220,
329,
374,
28,
66,
25,
79,
198,
220,
220,
220,
220,
220,
611,
37455,
58,
81,
11,
269,
60,
14512,
6632,
7,
51,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2352,
7,
71,
138,
242,
58,
7266,
17,
521,
31426,
14824,
21413,
7,
79,
11,
374,
11,
269,
8,
12962,
1875,
5636,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
407,
6632,
6108,
355,
407,
6632,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
79,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
407,
6632,
6108,
355,
6632,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24714,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2352,
7,
71,
138,
242,
58,
7266,
17,
521,
31426,
14824,
21413,
7,
79,
11,
374,
11,
269,
8,
12962,
1875,
5636,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
6632,
6108,
355,
407,
6632,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
79,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
6632,
6108,
355,
6632,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
77,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
220,
886,
198,
220,
7326,
4241,
46912,
7,
34788,
11,
277,
79,
11,
24714,
11,
256,
77,
8,
198,
437,
198,
198,
8818,
256,
1050,
7,
83,
3712,
18546,
4241,
46912,
8,
198,
220,
288,
77,
796,
256,
13,
34788,
1343,
256,
13,
22184,
198,
220,
288,
77,
1875,
657,
5633,
256,
13,
34788,
1220,
288,
77,
1058,
657,
13,
198,
437,
198,
8818,
277,
1050,
7,
83,
3712,
18546,
4241,
46912,
8,
198,
220,
288,
77,
796,
256,
13,
46428,
1343,
256,
13,
34106,
198,
220,
288,
77,
1875,
657,
5633,
256,
13,
46428,
1220,
288,
77,
1058,
657,
13,
198,
437,
198,
8818,
15440,
7,
83,
3712,
18546,
4241,
46912,
8,
198,
220,
288,
77,
796,
256,
13,
34788,
1343,
256,
13,
46428,
198,
220,
288,
77,
1875,
657,
5633,
256,
13,
34788,
1220,
288,
77,
1058,
352,
13,
198,
437,
198,
8344,
439,
7,
83,
3712,
18546,
4241,
46912,
8,
796,
256,
1050,
7,
83,
8,
198
] | 1.884211 | 855 |
using Clang
using Clang.Generators
cd(@__DIR__)
# current version checked in is v2.2.9
include_dir = normpath(joinpath(@__DIR__, "RadeonProRenderSDK", "RadeonProRender", "inc"))
# LIBCLANG_HEADERS are those headers to be wrapped.
headers = joinpath.(include_dir, [
"RadeonProRender_v2.h",
# "RadeonProRender_GL.h",
# "RadeonProRender_VK.h"
])
# wrapper generator options
options = load_options(joinpath(@__DIR__, "rpr.toml"))
# add compiler flags, e.g. "-DXXXXXXXXX"
args = get_default_args()
push!(args, "-I$include_dir")
ctx = create_context(headers, args, options)
# run generator
build!(ctx, BUILDSTAGE_NO_PRINTING)
function rewrite!(e::Expr)
if Meta.isexpr(e, :function)
func_args = e.args[1].args
last_arg = func_args[end]
body = e.args[2]
ccall_expr = body.args[end]
type_tuple = ccall_expr.args[4]
new_body = if startswith(string(last_arg), "out_")
last_type_ptr = type_tuple.args[end]
@assert Meta.isexpr(last_type_ptr, :curly)
@assert last_type_ptr.args[1] == :Ptr
last_type = last_type_ptr.args[2]
pop!(func_args) # remove from input args
:($(last_arg) = Ref{$(last_type)}(); check_error($(ccall_expr)); return $(last_arg)[])
elseif ccall_expr.args[3] == :rpr_status
:(check_error($(ccall_expr)))
else
ccall_expr
end
e.args[2] = new_body
end
return e
end
function rewrite!(dag::ExprDAG)
for node in get_nodes(dag)
for expr in get_exprs(node)
rewrite!(expr)
end
end
end
rewrite!(ctx.dag)
quote
function check_error(error_code)
error_code == RPR_SUCCESS && return
return error("Error code returned: $(error_code)")
end
end
cd(@__DIR__)
build!(ctx, BUILDSTAGE_PRINTING_ONLY)
| [
3500,
1012,
648,
198,
3500,
1012,
648,
13,
8645,
2024,
198,
198,
10210,
7,
31,
834,
34720,
834,
8,
198,
2,
1459,
2196,
10667,
287,
318,
410,
17,
13,
17,
13,
24,
198,
17256,
62,
15908,
796,
2593,
6978,
7,
22179,
6978,
7,
31,
834,
34720,
834,
11,
366,
49,
12424,
2964,
45819,
10305,
42,
1600,
366,
49,
12424,
2964,
45819,
1600,
366,
1939,
48774,
198,
2,
24653,
2749,
43,
15567,
62,
37682,
4877,
389,
883,
24697,
284,
307,
12908,
13,
198,
50145,
796,
4654,
6978,
12195,
17256,
62,
15908,
11,
685,
198,
220,
220,
220,
366,
49,
12424,
2964,
45819,
62,
85,
17,
13,
71,
1600,
198,
220,
220,
220,
1303,
366,
49,
12424,
2964,
45819,
62,
8763,
13,
71,
1600,
198,
220,
220,
220,
1303,
366,
49,
12424,
2964,
45819,
62,
47191,
13,
71,
1,
198,
12962,
198,
198,
2,
29908,
17301,
3689,
198,
25811,
796,
3440,
62,
25811,
7,
22179,
6978,
7,
31,
834,
34720,
834,
11,
366,
81,
1050,
13,
39532,
75,
48774,
198,
198,
2,
751,
17050,
9701,
11,
304,
13,
70,
13,
27444,
35,
24376,
24376,
55,
1,
198,
22046,
796,
651,
62,
12286,
62,
22046,
3419,
198,
14689,
0,
7,
22046,
11,
27444,
40,
3,
17256,
62,
15908,
4943,
198,
198,
49464,
796,
2251,
62,
22866,
7,
50145,
11,
26498,
11,
3689,
8,
198,
198,
2,
1057,
17301,
198,
11249,
0,
7,
49464,
11,
20571,
26761,
2257,
11879,
62,
15285,
62,
4805,
12394,
2751,
8,
198,
198,
8818,
28183,
0,
7,
68,
3712,
3109,
1050,
8,
198,
220,
220,
220,
611,
30277,
13,
786,
87,
1050,
7,
68,
11,
1058,
8818,
8,
198,
220,
220,
220,
220,
220,
220,
220,
25439,
62,
22046,
796,
304,
13,
22046,
58,
16,
4083,
22046,
198,
220,
220,
220,
220,
220,
220,
220,
938,
62,
853,
796,
25439,
62,
22046,
58,
437,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1767,
796,
304,
13,
22046,
58,
17,
60,
198,
220,
220,
220,
220,
220,
220,
220,
269,
13345,
62,
31937,
796,
1767,
13,
22046,
58,
437,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
83,
29291,
796,
269,
13345,
62,
31937,
13,
22046,
58,
19,
60,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
2618,
796,
611,
923,
2032,
342,
7,
8841,
7,
12957,
62,
853,
828,
366,
448,
62,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
938,
62,
4906,
62,
20692,
796,
2099,
62,
83,
29291,
13,
22046,
58,
437,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
30493,
30277,
13,
786,
87,
1050,
7,
12957,
62,
4906,
62,
20692,
11,
1058,
22019,
306,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2488,
30493,
938,
62,
4906,
62,
20692,
13,
22046,
58,
16,
60,
6624,
1058,
46745,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
938,
62,
4906,
796,
938,
62,
4906,
62,
20692,
13,
22046,
58,
17,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1461,
0,
7,
20786,
62,
22046,
8,
1303,
4781,
422,
5128,
26498,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1058,
16763,
7,
12957,
62,
853,
8,
796,
6524,
90,
3,
7,
12957,
62,
4906,
38165,
9783,
2198,
62,
18224,
16763,
7,
535,
439,
62,
31937,
18125,
1441,
29568,
12957,
62,
853,
38381,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
361,
269,
13345,
62,
31937,
13,
22046,
58,
18,
60,
6624,
1058,
81,
1050,
62,
13376,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
36147,
9122,
62,
18224,
16763,
7,
535,
439,
62,
31937,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
13345,
62,
31937,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
220,
220,
304,
13,
22046,
58,
17,
60,
796,
649,
62,
2618,
198,
220,
220,
220,
886,
198,
220,
220,
220,
1441,
304,
198,
437,
198,
198,
8818,
28183,
0,
7,
67,
363,
3712,
3109,
1050,
35,
4760,
8,
198,
220,
220,
220,
329,
10139,
287,
651,
62,
77,
4147,
7,
67,
363,
8,
198,
220,
220,
220,
220,
220,
220,
220,
329,
44052,
287,
651,
62,
31937,
82,
7,
17440,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
28183,
0,
7,
31937,
8,
198,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
198,
437,
198,
198,
1809,
6525,
0,
7,
49464,
13,
67,
363,
8,
198,
198,
22708,
198,
220,
220,
220,
2163,
2198,
62,
18224,
7,
18224,
62,
8189,
8,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
62,
8189,
6624,
371,
4805,
62,
12564,
4093,
7597,
11405,
1441,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
4049,
7203,
12331,
2438,
4504,
25,
29568,
18224,
62,
8189,
8,
4943,
198,
220,
220,
220,
886,
198,
437,
198,
198,
10210,
7,
31,
834,
34720,
834,
8,
198,
11249,
0,
7,
49464,
11,
20571,
26761,
2257,
11879,
62,
4805,
12394,
2751,
62,
1340,
11319,
8,
198
] | 2.139723 | 866 |
using MathProgBase
########################################################
## this code is based on ModelReader in NLPModels
## and KNITRO.jl
########################################################
export OnePhaseSolver #, OnePhaseMathProgModel, NonlinearModel
mutable struct OnePhaseSolver <: MathProgBase.AbstractMathProgSolver
options
end
OnePhaseSolver(;kwargs...) = OnePhaseSolver(kwargs)
type OnePhaseProblem
status::Symbol # Final status
# For MathProgBase
x::Vector{Float64} # Starting and final solution
lambda::Vector{Float64}
g::Vector{Float64} # Final constraint values
obj_val::Float64 # (length 1) Final objective
solve_time::Float64
# Custom attributes of the OnePhaseSolver
iter::Class_iterate
hist::Array{alg_history2,1}
pars::Class_parameters
function OnePhaseProblem()
return new()
end
end
########################################################
## BEGIN ModelReader CODE (with minor edits)
########################################################
mutable struct OnePhaseMathProgModel <: MathProgBase.AbstractMathProgModel
options
inner::OnePhaseProblem
eval :: Union{MathProgBase.AbstractNLPEvaluator, Void}
numVar :: Int
numConstr :: Int
x :: Vector{Float64}
y :: Vector{Float64}
lvar :: Vector{Float64}
uvar :: Vector{Float64}
lcon :: Vector{Float64}
ucon :: Vector{Float64}
sense :: Symbol
status :: Symbol
end
MathProgBase.NonlinearModel(solver :: OnePhaseSolver) = OnePhaseMathProgModel(solver.options,OnePhaseProblem(),nothing,
0,
0,
Float64[],
Float64[],
Float64[],
Float64[],
Float64[],
Float64[],
:Min,
:Uninitialized)
function MathProgBase.loadproblem!(m :: OnePhaseMathProgModel,
numVar, numConstr,
l, u, lb, ub,
sense,
eval :: MathProgBase.AbstractNLPEvaluator)
# TODO: :JacVec is not yet available.
# [:Grad, :Jac, :JacVec, :Hess, :HessVec, :ExprGraph]
MathProgBase.initialize(eval, [:Grad, :Jac, :Hess, :HessVec, :ExprGraph])
m.numVar = numVar
m.numConstr = numConstr
m.x = zeros(numVar)
m.y = zeros(numConstr)
m.eval = eval
m.lvar = l
m.uvar = u
m.lcon = lb
m.ucon = ub
m.sense = sense
end
MathProgBase.setwarmstart!(m :: OnePhaseMathProgModel, x) = (m.x = x)
MathProgBase.status(m :: OnePhaseMathProgModel) = m.inner.status
MathProgBase.getsolution(m :: OnePhaseMathProgModel) = m.inner.x
MathProgBase.getobjval(m :: OnePhaseMathProgModel) = m.inner.iter.cache.fval
#MathProgBase.eval_f(m.eval, m.x)
mutable struct MathProgNLPModel <: AbstractNLPModel
meta :: NLPModelMeta
mpmodel :: OnePhaseMathProgModel
counters :: Counters # Evaluation counters.
jrows :: Vector{Int} # Jacobian sparsity pattern.
jcols :: Vector{Int}
jvals :: Vector{Float64} # Room for the constraints Jacobian.
hrows :: Vector{Int} # Hessian sparsity pattern.
hcols :: Vector{Int}
hvals :: Vector{Float64} # Room for the Lagrangian Hessian.
end
"Construct a `MathProgNLPModel` from a `OnePhaseMathProgModel`."
function MathProgNLPModel(mpmodel :: OnePhaseMathProgModel; name :: String="Generic")
nvar = mpmodel.numVar
lvar = mpmodel.lvar
uvar = mpmodel.uvar
nlin = length(mpmodel.eval.m.linconstr) # Number of linear constraints.
nquad = length(mpmodel.eval.m.quadconstr) # Number of quadratic constraints.
nnln = length(mpmodel.eval.m.nlpdata.nlconstr) # Number of nonlinear constraints.
ncon = mpmodel.numConstr # Total number of constraints.
lcon = mpmodel.lcon
ucon = mpmodel.ucon
jrows, jcols = MathProgBase.jac_structure(mpmodel.eval)
hrows, hcols = MathProgBase.hesslag_structure(mpmodel.eval)
nnzj = length(jrows)
nnzh = length(hrows)
meta = NLPModelMeta(nvar,
x0=mpmodel.x,
lvar=lvar,
uvar=uvar,
ncon=ncon,
y0=zeros(ncon),
lcon=lcon,
ucon=ucon,
nnzj=nnzj,
nnzh=nnzh,
lin=collect(1:nlin), # linear constraints appear first in MPB
nln=collect(nlin+1:ncon),
minimize=(mpmodel.sense == :Min),
islp=MathProgBase.isobjlinear(mpmodel.eval) & (nlin == ncon),
name=name,
)
return MathProgNLPModel(meta,
mpmodel,
Counters(),
jrows,
jcols,
zeros(nnzj), # jvals
hrows,
hcols,
zeros(nnzh), # hvals
)
end
##
import Base.show
show(nlp :: MathProgNLPModel) = show(nlp.mpmodel)
function obj(nlp :: MathProgNLPModel, x :: Array{Float64})
NLPModels.increment!(nlp, :neval_obj)
return MathProgBase.eval_f(nlp.mpmodel.eval, x)
end
function grad(nlp :: MathProgNLPModel, x :: Array{Float64})
g = zeros(nlp.meta.nvar)
return grad!(nlp, x, g)
end
function grad!(nlp :: MathProgNLPModel, x :: Array{Float64}, g :: Array{Float64})
NLPModels.increment!(nlp, :neval_grad)
MathProgBase.eval_grad_f(nlp.mpmodel.eval, g, x)
return g
end
function cons(nlp :: MathProgNLPModel, x :: Array{Float64})
c = zeros(nlp.meta.ncon)
return cons!(nlp, x, c)
end
function cons!(nlp :: MathProgNLPModel, x :: Array{Float64}, c :: Array{Float64})
NLPModels.increment!(nlp, :neval_cons)
MathProgBase.eval_g(nlp.mpmodel.eval, c, x)
return c
end
function jac_coord(nlp :: MathProgNLPModel, x :: Array{Float64})
NLPModels.increment!(nlp, :neval_jac)
MathProgBase.eval_jac_g(nlp.mpmodel.eval, nlp.jvals, x)
return (nlp.jrows, nlp.jcols, nlp.jvals)
end
function jac(nlp :: MathProgNLPModel, x :: Array{Float64})
return sparse(jac_coord(nlp, x)..., nlp.meta.ncon, nlp.meta.nvar)
end
function jprod(nlp :: MathProgNLPModel, x :: Array{Float64}, v :: Array{Float64})
Jv = zeros(nlp.meta.ncon)
return jprod!(nlp, x, v, Jv)
end
function jprod!(nlp :: MathProgNLPModel,
x :: Array{Float64},
v :: Array{Float64},
Jv :: Array{Float64})
nlp.counters.neval_jac -= 1
NLPModels.increment!(nlp, :neval_jprod)
Jv[:] = jac(nlp, x) * v
return Jv
end
function jtprod(nlp :: MathProgNLPModel, x :: Array{Float64}, v :: Array{Float64})
Jtv = zeros(nlp.meta.nvar)
return jtprod!(nlp, x, v, Jtv)
end
function jtprod!(nlp :: MathProgNLPModel,
x :: Array{Float64},
v :: Array{Float64},
Jtv :: Array{Float64})
nlp.counters.neval_jac -= 1
NLPModels.increment!(nlp, :neval_jtprod)
Jtv[1:nlp.meta.nvar] = jac(nlp, x)' * v
return Jtv
end
# Uncomment if/when :JacVec becomes available in MPB.
# "Evaluate the Jacobian-vector product at `x`."
# function jprod(nlp :: MathProgNLPModel, x :: Array{Float64}, v :: Array{Float64})
# jv = zeros(nlp.meta.ncon)
# return jprod!(nlp, x, v, jv)
# end
#
# "Evaluate the Jacobian-vector product at `x` in place."
# function jprod!(nlp :: MathProgNLPModel, x :: Array{Float64}, v :: Array{Float64}, jv :: Array{Float64})
# NLPModels.increment!(nlp, :neval_jprod)
# MathProgBase.eval_jac_prod(nlp.mpmodel.eval, jv, x, v)
# return jv
# end
#
# "Evaluate the transposed-Jacobian-vector product at `x`."
# function jtprod(nlp :: MathProgNLPModel, x :: Array{Float64}, v :: Array{Float64})
# jtv = zeros(nlp.meta.nvar)
# return jtprod!(nlp, x, v, jtv)
# end
#
# "Evaluate the transposed-Jacobian-vector product at `x` in place."
# function jtprod!(nlp :: MathProgNLPModel, x :: Array{Float64}, v :: Array{Float64}, jtv :: Array{Float64})
# NLPModels.increment!(nlp, :neval_jtprod)
# MathProgBase.eval_jac_prod_t(nlp.mpmodel.eval, jtv, x, v)
# return jtv
# end
function hess_coord(nlp :: MathProgNLPModel, x :: Array{Float64};
obj_weight :: Float64=1.0, y :: Array{Float64}=zeros(nlp.meta.ncon))
NLPModels.increment!(nlp, :neval_hess)
MathProgBase.eval_hesslag(nlp.mpmodel.eval, nlp.hvals, x, obj_weight, y)
return (nlp.hrows, nlp.hcols, nlp.hvals)
end
function hess(nlp :: MathProgNLPModel, x :: Array{Float64};
obj_weight :: Float64=1.0, y :: Array{Float64}=zeros(nlp.meta.ncon))
return sparse(hess_coord(nlp, x, y=y, obj_weight=obj_weight)..., nlp.meta.nvar, nlp.meta.nvar)
end
function hprod(nlp :: MathProgNLPModel, x :: Array{Float64}, v :: Array{Float64};
obj_weight :: Float64=1.0, y :: Array{Float64}=zeros(nlp.meta.ncon))
hv = zeros(nlp.meta.nvar)
return hprod!(nlp, x, v, hv, obj_weight=obj_weight, y=y)
end
function hprod!(nlp :: MathProgNLPModel, x :: Array{Float64}, v :: Array{Float64},
hv :: Array{Float64};
obj_weight :: Float64=1.0, y :: Array{Float64}=zeros(nlp.meta.ncon))
NLPModels.increment!(nlp, :neval_hprod)
MathProgBase.eval_hesslag_prod(nlp.mpmodel.eval, hv, x, v, obj_weight, y)
return hv
end
############################
## END ModelReader CODE
############################
function status_One_Phase_To_JuMP(status::Symbol)
# since our status are not equal to JuMPs we need to do a conversion
if status == :Optimal
return :Optimal
elseif status == :primal_infeasible
return :Infeasible
elseif status == :dual_infeasible
return :Unbounded
elseif status == :MAX_IT || status === :MAX_TIME
return :UserLimit
else
return :Error
end
end
function create_pars_JuMP(options )
pars = Class_parameters()
for (param,value) in options
what = split(String(param),"!") # we represent a parameter such as init.mu_scale as init!mu_scale because we cannot pass init.mu_scale as a parameter
node = pars # root
for i in 1:length(what)
field = what[i]
if i < length(what)
node = getfield(node,Symbol(field))
else # at the leaf
setfield!(node,Symbol(field),value)
end
end
end
return pars
end
function MathProgBase.optimize!(m :: OnePhaseMathProgModel)
t = time()
nlp = MathProgNLPModel(m)
pars = create_pars_JuMP(m.options)
iter, status, hist, t, err, timer = one_phase_solve(nlp,pars)
m.inner.status = status_One_Phase_To_JuMP(status)
m.inner.x = get_original_x(iter)
m.inner.obj_val = iter.cache.fval
m.inner.lambda = get_y(iter)
m.inner.solve_time = time() - t
# custom one phase features
m.inner.pars = pars
m.inner.iter = iter
m.inner.hist = hist
end
MathProgBase.getconstrsolution(m::OnePhaseMathProgModel) = m.inner.g
MathProgBase.getrawsolver(m::OnePhaseMathProgModel) = m.inner
MathProgBase.getsolvetime(m::OnePhaseMathProgModel) = m.inner.solve_time
function MathProgBase.getreducedcosts(m::OnePhaseMathProgModel)
return get_reducedcosts(m.inner.iter)
end
function MathProgBase.getconstrduals(m::OnePhaseMathProgModel)
return get_constrduals(m.inner.iter)
end
#setvartype!(m::OnePhaseMathProgModel, typ::Vector{Symbol}) =
# (m.varType = map(t->rev_var_type_map[t], typ))
function MathProgBase.freemodel!(m::OnePhaseMathProgModel)
# TO DO
end
| [
3500,
16320,
2964,
70,
14881,
198,
198,
29113,
14468,
7804,
198,
2235,
428,
2438,
318,
1912,
319,
9104,
33634,
287,
399,
19930,
5841,
1424,
198,
2235,
290,
22466,
2043,
13252,
13,
20362,
198,
29113,
14468,
7804,
198,
198,
39344,
1881,
35645,
50,
14375,
1303,
11,
1881,
35645,
37372,
2964,
70,
17633,
11,
8504,
29127,
17633,
198,
198,
76,
18187,
2878,
1881,
35645,
50,
14375,
1279,
25,
16320,
2964,
70,
14881,
13,
23839,
37372,
2964,
70,
50,
14375,
198,
220,
220,
220,
3689,
198,
437,
198,
3198,
35645,
50,
14375,
7,
26,
46265,
22046,
23029,
796,
1881,
35645,
50,
14375,
7,
46265,
22046,
8,
628,
198,
4906,
1881,
35645,
40781,
198,
220,
220,
220,
3722,
3712,
13940,
23650,
220,
1303,
8125,
3722,
628,
220,
220,
220,
1303,
1114,
16320,
2964,
70,
14881,
198,
220,
220,
220,
2124,
3712,
38469,
90,
43879,
2414,
92,
220,
1303,
17962,
290,
2457,
4610,
198,
220,
220,
220,
37456,
3712,
38469,
90,
43879,
2414,
92,
198,
220,
220,
220,
308,
3712,
38469,
90,
43879,
2414,
92,
220,
1303,
8125,
32315,
3815,
198,
220,
220,
220,
26181,
62,
2100,
3712,
43879,
2414,
220,
1303,
357,
13664,
352,
8,
8125,
9432,
198,
220,
220,
220,
8494,
62,
2435,
3712,
43879,
2414,
628,
220,
220,
220,
1303,
8562,
12608,
286,
262,
1881,
35645,
50,
14375,
198,
220,
220,
220,
11629,
3712,
9487,
62,
2676,
378,
198,
220,
220,
220,
1554,
3712,
19182,
90,
14016,
62,
23569,
17,
11,
16,
92,
198,
220,
220,
220,
13544,
3712,
9487,
62,
17143,
7307,
628,
220,
220,
220,
2163,
1881,
35645,
40781,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
649,
3419,
198,
220,
220,
220,
886,
198,
437,
198,
198,
29113,
14468,
7804,
198,
2235,
347,
43312,
9104,
33634,
42714,
357,
4480,
4159,
31671,
8,
198,
29113,
14468,
7804,
198,
198,
76,
18187,
2878,
1881,
35645,
37372,
2964,
70,
17633,
1279,
25,
16320,
2964,
70,
14881,
13,
23839,
37372,
2964,
70,
17633,
198,
220,
3689,
198,
220,
8434,
3712,
3198,
35645,
40781,
628,
220,
5418,
7904,
4479,
90,
37372,
2964,
70,
14881,
13,
23839,
32572,
11401,
2100,
84,
1352,
11,
18331,
92,
198,
220,
997,
19852,
7904,
2558,
198,
220,
997,
3103,
2536,
7904,
2558,
198,
220,
2124,
7904,
20650,
90,
43879,
2414,
92,
198,
220,
331,
7904,
20650,
90,
43879,
2414,
92,
198,
220,
300,
7785,
7904,
20650,
90,
43879,
2414,
92,
198,
220,
334,
7785,
7904,
20650,
90,
43879,
2414,
92,
198,
220,
300,
1102,
7904,
20650,
90,
43879,
2414,
92,
198,
220,
334,
1102,
7904,
20650,
90,
43879,
2414,
92,
198,
220,
2565,
7904,
38357,
198,
220,
3722,
7904,
38357,
198,
437,
628,
198,
198,
37372,
2964,
70,
14881,
13,
15419,
29127,
17633,
7,
82,
14375,
7904,
1881,
35645,
50,
14375,
8,
796,
1881,
35645,
37372,
2964,
70,
17633,
7,
82,
14375,
13,
25811,
11,
3198,
35645,
40781,
22784,
22366,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
48436,
2414,
58,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
48436,
2414,
58,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
48436,
2414,
58,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
48436,
2414,
58,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
48436,
2414,
58,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
48436,
2414,
58,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1058,
9452,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1058,
3118,
17532,
8,
198,
198,
8818,
16320,
2964,
70,
14881,
13,
2220,
45573,
0,
7,
76,
7904,
1881,
35645,
37372,
2964,
70,
17633,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
997,
19852,
11,
997,
3103,
2536,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
11,
334,
11,
18360,
11,
20967,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2565,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5418,
7904,
16320,
2964,
70,
14881,
13,
23839,
32572,
11401,
2100,
84,
1352,
8,
628,
220,
1303,
16926,
46,
25,
1058,
28821,
53,
721,
318,
407,
1865,
1695,
13,
198,
220,
1303,
685,
25,
42731,
11,
1058,
28821,
11,
1058,
28821,
53,
721,
11,
1058,
39,
408,
11,
1058,
39,
408,
53,
721,
11,
1058,
3109,
1050,
37065,
60,
198,
220,
16320,
2964,
70,
14881,
13,
36733,
1096,
7,
18206,
11,
685,
25,
42731,
11,
1058,
28821,
11,
1058,
39,
408,
11,
1058,
39,
408,
53,
721,
11,
1058,
3109,
1050,
37065,
12962,
198,
220,
285,
13,
22510,
19852,
796,
997,
19852,
198,
220,
285,
13,
22510,
3103,
2536,
796,
997,
3103,
2536,
198,
220,
285,
13,
87,
796,
1976,
27498,
7,
22510,
19852,
8,
198,
220,
285,
13,
88,
796,
1976,
27498,
7,
22510,
3103,
2536,
8,
198,
220,
285,
13,
18206,
796,
5418,
198,
220,
285,
13,
6780,
283,
796,
300,
198,
220,
285,
13,
84,
7785,
796,
334,
198,
220,
285,
13,
75,
1102,
796,
18360,
198,
220,
285,
13,
84,
1102,
796,
20967,
198,
220,
285,
13,
33819,
796,
2565,
198,
437,
198,
198,
37372,
2964,
70,
14881,
13,
2617,
31975,
9688,
0,
7,
76,
7904,
1881,
35645,
37372,
2964,
70,
17633,
11,
2124,
8,
796,
357,
76,
13,
87,
796,
2124,
8,
198,
37372,
2964,
70,
14881,
13,
13376,
7,
76,
7904,
1881,
35645,
37372,
2964,
70,
17633,
8,
796,
285,
13,
5083,
13,
13376,
198,
37372,
2964,
70,
14881,
13,
11407,
2122,
7,
76,
7904,
1881,
35645,
37372,
2964,
70,
17633,
8,
796,
285,
13,
5083,
13,
87,
198,
37372,
2964,
70,
14881,
13,
1136,
26801,
2100,
7,
76,
7904,
1881,
35645,
37372,
2964,
70,
17633,
8,
796,
285,
13,
5083,
13,
2676,
13,
23870,
13,
69,
2100,
198,
2,
37372,
2964,
70,
14881,
13,
18206,
62,
69,
7,
76,
13,
18206,
11,
285,
13,
87,
8,
198,
198,
76,
18187,
2878,
16320,
2964,
70,
45,
19930,
17633,
1279,
25,
27741,
45,
19930,
17633,
198,
220,
13634,
7904,
399,
19930,
17633,
48526,
198,
220,
285,
4426,
375,
417,
7904,
1881,
35645,
37372,
2964,
70,
17633,
198,
220,
21154,
7904,
3545,
1010,
220,
220,
220,
220,
220,
1303,
34959,
21154,
13,
628,
220,
474,
8516,
7904,
20650,
90,
5317,
92,
220,
220,
220,
220,
220,
1303,
12806,
666,
599,
45826,
3912,
13,
198,
220,
474,
4033,
82,
7904,
20650,
90,
5317,
92,
198,
220,
474,
12786,
7904,
20650,
90,
43879,
2414,
92,
220,
1303,
10096,
329,
262,
17778,
12806,
666,
13,
628,
220,
289,
8516,
7904,
20650,
90,
5317,
92,
220,
220,
220,
220,
220,
1303,
46305,
666,
599,
45826,
3912,
13,
198,
220,
289,
4033,
82,
7904,
20650,
90,
5317,
92,
198,
220,
289,
12786,
7904,
20650,
90,
43879,
2414,
92,
220,
1303,
10096,
329,
262,
21003,
36985,
666,
46305,
666,
13,
198,
437,
198,
198,
1,
42316,
257,
4600,
37372,
2964,
70,
45,
19930,
17633,
63,
422,
257,
4600,
3198,
35645,
37372,
2964,
70,
17633,
63,
526,
198,
8818,
16320,
2964,
70,
45,
19930,
17633,
7,
3149,
19849,
7904,
1881,
35645,
37372,
2964,
70,
17633,
26,
1438,
7904,
10903,
2625,
46189,
4943,
628,
220,
299,
7785,
796,
285,
4426,
375,
417,
13,
22510,
19852,
198,
220,
300,
7785,
796,
285,
4426,
375,
417,
13,
6780,
283,
198,
220,
334,
7785,
796,
285,
4426,
375,
417,
13,
84,
7785,
628,
220,
299,
2815,
796,
4129,
7,
3149,
19849,
13,
18206,
13,
76,
13,
2815,
1102,
2536,
8,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
7913,
286,
14174,
17778,
13,
198,
220,
299,
47003,
796,
4129,
7,
3149,
19849,
13,
18206,
13,
76,
13,
47003,
1102,
2536,
8,
220,
220,
220,
220,
220,
220,
1303,
7913,
286,
15094,
81,
1512,
17778,
13,
198,
220,
299,
77,
18755,
796,
4129,
7,
3149,
19849,
13,
18206,
13,
76,
13,
21283,
79,
7890,
13,
21283,
1102,
2536,
8,
220,
1303,
7913,
286,
1729,
29127,
17778,
13,
198,
220,
299,
1102,
796,
285,
4426,
375,
417,
13,
22510,
3103,
2536,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
7472,
1271,
286,
17778,
13,
198,
220,
300,
1102,
796,
285,
4426,
375,
417,
13,
75,
1102,
198,
220,
334,
1102,
796,
285,
4426,
375,
417,
13,
84,
1102,
628,
220,
474,
8516,
11,
474,
4033,
82,
796,
16320,
2964,
70,
14881,
13,
30482,
62,
301,
5620,
7,
3149,
19849,
13,
18206,
8,
198,
220,
289,
8516,
11,
289,
4033,
82,
796,
16320,
2964,
70,
14881,
13,
33979,
30909,
62,
301,
5620,
7,
3149,
19849,
13,
18206,
8,
198,
220,
299,
27305,
73,
796,
4129,
7,
73,
8516,
8,
198,
220,
299,
77,
23548,
796,
4129,
7,
71,
8516,
8,
628,
220,
13634,
796,
399,
19930,
17633,
48526,
7,
77,
7785,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
15,
28,
3149,
19849,
13,
87,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
7785,
28,
6780,
283,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
7785,
28,
84,
7785,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
1102,
28,
77,
1102,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
331,
15,
28,
9107,
418,
7,
77,
1102,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
1102,
28,
75,
1102,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
1102,
28,
84,
1102,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
27305,
73,
28,
20471,
89,
73,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
77,
23548,
28,
20471,
23548,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9493,
28,
33327,
7,
16,
25,
77,
2815,
828,
220,
1303,
14174,
17778,
1656,
717,
287,
4904,
33,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
18755,
28,
33327,
7,
77,
2815,
10,
16,
25,
77,
1102,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17775,
16193,
3149,
19849,
13,
33819,
6624,
1058,
9452,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
34431,
28,
37372,
2964,
70,
14881,
13,
271,
26801,
29127,
7,
3149,
19849,
13,
18206,
8,
1222,
357,
77,
2815,
6624,
299,
1102,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
28,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
1441,
16320,
2964,
70,
45,
19930,
17633,
7,
28961,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
4426,
375,
417,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3545,
1010,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
474,
8516,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
474,
4033,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1976,
27498,
7,
20471,
89,
73,
828,
220,
1303,
474,
12786,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
289,
8516,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
289,
4033,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1976,
27498,
7,
20471,
23548,
828,
220,
1303,
289,
12786,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
437,
198,
198,
2235,
198,
11748,
7308,
13,
12860,
198,
12860,
7,
21283,
79,
7904,
16320,
2964,
70,
45,
19930,
17633,
8,
796,
905,
7,
21283,
79,
13,
3149,
19849,
8,
198,
198,
8818,
26181,
7,
21283,
79,
7904,
16320,
2964,
70,
45,
19930,
17633,
11,
2124,
7904,
15690,
90,
43879,
2414,
30072,
198,
220,
399,
19930,
5841,
1424,
13,
24988,
434,
0,
7,
21283,
79,
11,
1058,
710,
2100,
62,
26801,
8,
198,
220,
1441,
16320,
2964,
70,
14881,
13,
18206,
62,
69,
7,
21283,
79,
13,
3149,
19849,
13,
18206,
11,
2124,
8,
198,
437,
198,
198,
8818,
3915,
7,
21283,
79,
7904,
16320,
2964,
70,
45,
19930,
17633,
11,
2124,
7904,
15690,
90,
43879,
2414,
30072,
198,
220,
308,
796,
1976,
27498,
7,
21283,
79,
13,
28961,
13,
77,
7785,
8,
198,
220,
1441,
3915,
0,
7,
21283,
79,
11,
2124,
11,
308,
8,
198,
437,
198,
198,
8818,
3915,
0,
7,
21283,
79,
7904,
16320,
2964,
70,
45,
19930,
17633,
11,
2124,
7904,
15690,
90,
43879,
2414,
5512,
308,
7904,
15690,
90,
43879,
2414,
30072,
198,
220,
399,
19930,
5841,
1424,
13,
24988,
434,
0,
7,
21283,
79,
11,
1058,
710,
2100,
62,
9744,
8,
198,
220,
16320,
2964,
70,
14881,
13,
18206,
62,
9744,
62,
69,
7,
21283,
79,
13,
3149,
19849,
13,
18206,
11,
308,
11,
2124,
8,
198,
220,
1441,
308,
198,
437,
198,
198,
8818,
762,
7,
21283,
79,
7904,
16320,
2964,
70,
45,
19930,
17633,
11,
2124,
7904,
15690,
90,
43879,
2414,
30072,
198,
220,
269,
796,
1976,
27498,
7,
21283,
79,
13,
28961,
13,
77,
1102,
8,
198,
220,
1441,
762,
0,
7,
21283,
79,
11,
2124,
11,
269,
8,
198,
437,
198,
198,
8818,
762,
0,
7,
21283,
79,
7904,
16320,
2964,
70,
45,
19930,
17633,
11,
2124,
7904,
15690,
90,
43879,
2414,
5512,
269,
7904,
15690,
90,
43879,
2414,
30072,
198,
220,
399,
19930,
5841,
1424,
13,
24988,
434,
0,
7,
21283,
79,
11,
1058,
710,
2100,
62,
5936,
8,
198,
220,
16320,
2964,
70,
14881,
13,
18206,
62,
70,
7,
21283,
79,
13,
3149,
19849,
13,
18206,
11,
269,
11,
2124,
8,
198,
220,
1441,
269,
198,
437,
198,
198,
8818,
474,
330,
62,
37652,
7,
21283,
79,
7904,
16320,
2964,
70,
45,
19930,
17633,
11,
2124,
7904,
15690,
90,
43879,
2414,
30072,
198,
220,
399,
19930,
5841,
1424,
13,
24988,
434,
0,
7,
21283,
79,
11,
1058,
710,
2100,
62,
30482,
8,
198,
220,
16320,
2964,
70,
14881,
13,
18206,
62,
30482,
62,
70,
7,
21283,
79,
13,
3149,
19849,
13,
18206,
11,
299,
34431,
13,
73,
12786,
11,
2124,
8,
198,
220,
1441,
357,
21283,
79,
13,
73,
8516,
11,
299,
34431,
13,
73,
4033,
82,
11,
299,
34431,
13,
73,
12786,
8,
198,
437,
198,
198,
8818,
474,
330,
7,
21283,
79,
7904,
16320,
2964,
70,
45,
19930,
17633,
11,
2124,
7904,
15690,
90,
43879,
2414,
30072,
198,
220,
1441,
29877,
7,
30482,
62,
37652,
7,
21283,
79,
11,
2124,
26513,
11,
299,
34431,
13,
28961,
13,
77,
1102,
11,
299,
34431,
13,
28961,
13,
77,
7785,
8,
198,
437,
198,
198,
8818,
474,
1676,
67,
7,
21283,
79,
7904,
16320,
2964,
70,
45,
19930,
17633,
11,
2124,
7904,
15690,
90,
43879,
2414,
5512,
410,
7904,
15690,
90,
43879,
2414,
30072,
198,
220,
449,
85,
796,
1976,
27498,
7,
21283,
79,
13,
28961,
13,
77,
1102,
8,
198,
220,
1441,
474,
1676,
67,
0,
7,
21283,
79,
11,
2124,
11,
410,
11,
449,
85,
8,
198,
437,
198,
198,
8818,
474,
1676,
67,
0,
7,
21283,
79,
7904,
16320,
2964,
70,
45,
19930,
17633,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
7904,
15690,
90,
43879,
2414,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
7904,
15690,
90,
43879,
2414,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
449,
85,
7904,
15690,
90,
43879,
2414,
30072,
198,
220,
299,
34431,
13,
66,
15044,
13,
710,
2100,
62,
30482,
48185,
352,
198,
220,
399,
19930,
5841,
1424,
13,
24988,
434,
0,
7,
21283,
79,
11,
1058,
710,
2100,
62,
73,
1676,
67,
8,
198,
220,
449,
85,
58,
47715,
796,
474,
330,
7,
21283,
79,
11,
2124,
8,
1635,
410,
198,
220,
1441,
449,
85,
198,
437,
198,
198,
8818,
474,
83,
1676,
67,
7,
21283,
79,
7904,
16320,
2964,
70,
45,
19930,
17633,
11,
2124,
7904,
15690,
90,
43879,
2414,
5512,
410,
7904,
15690,
90,
43879,
2414,
30072,
198,
220,
449,
14981,
796,
1976,
27498,
7,
21283,
79,
13,
28961,
13,
77,
7785,
8,
198,
220,
1441,
474,
83,
1676,
67,
0,
7,
21283,
79,
11,
2124,
11,
410,
11,
449,
14981,
8,
198,
437,
198,
198,
8818,
474,
83,
1676,
67,
0,
7,
21283,
79,
7904,
16320,
2964,
70,
45,
19930,
17633,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
7904,
15690,
90,
43879,
2414,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
7904,
15690,
90,
43879,
2414,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
449,
14981,
7904,
15690,
90,
43879,
2414,
30072,
198,
220,
299,
34431,
13,
66,
15044,
13,
710,
2100,
62,
30482,
48185,
352,
198,
220,
399,
19930,
5841,
1424,
13,
24988,
434,
0,
7,
21283,
79,
11,
1058,
710,
2100,
62,
73,
83,
1676,
67,
8,
198,
220,
449,
14981,
58,
16,
25,
21283,
79,
13,
28961,
13,
77,
7785,
60,
796,
474,
330,
7,
21283,
79,
11,
2124,
33047,
1635,
410,
198,
220,
1441,
449,
14981,
198,
437,
198,
198,
2,
791,
23893,
611,
14,
12518,
1058,
28821,
53,
721,
4329,
1695,
287,
4904,
33,
13,
198,
2,
366,
36,
2100,
4985,
262,
12806,
666,
12,
31364,
1720,
379,
4600,
87,
63,
526,
198,
2,
2163,
474,
1676,
67,
7,
21283,
79,
7904,
16320,
2964,
70,
45,
19930,
17633,
11,
2124,
7904,
15690,
90,
43879,
2414,
5512,
410,
7904,
15690,
90,
43879,
2414,
30072,
198,
2,
220,
220,
474,
85,
796,
1976,
27498,
7,
21283,
79,
13,
28961,
13,
77,
1102,
8,
198,
2,
220,
220,
1441,
474,
1676,
67,
0,
7,
21283,
79,
11,
2124,
11,
410,
11,
474,
85,
8,
198,
2,
886,
198,
2,
198,
2,
366,
36,
2100,
4985,
262,
12806,
666,
12,
31364,
1720,
379,
4600,
87,
63,
287,
1295,
526,
198,
2,
2163,
474,
1676,
67,
0,
7,
21283,
79,
7904,
16320,
2964,
70,
45,
19930,
17633,
11,
2124,
7904,
15690,
90,
43879,
2414,
5512,
410,
7904,
15690,
90,
43879,
2414,
5512,
474,
85,
7904,
15690,
90,
43879,
2414,
30072,
198,
2,
220,
220,
399,
19930,
5841,
1424,
13,
24988,
434,
0,
7,
21283,
79,
11,
1058,
710,
2100,
62,
73,
1676,
67,
8,
198,
2,
220,
220,
16320,
2964,
70,
14881,
13,
18206,
62,
30482,
62,
1676,
67,
7,
21283,
79,
13,
3149,
19849,
13,
18206,
11,
474,
85,
11,
2124,
11,
410,
8,
198,
2,
220,
220,
1441,
474,
85,
198,
2,
886,
198,
2,
198,
2,
366,
36,
2100,
4985,
262,
1007,
29813,
12,
46751,
666,
12,
31364,
1720,
379,
4600,
87,
63,
526,
198,
2,
2163,
474,
83,
1676,
67,
7,
21283,
79,
7904,
16320,
2964,
70,
45,
19930,
17633,
11,
2124,
7904,
15690,
90,
43879,
2414,
5512,
410,
7904,
15690,
90,
43879,
2414,
30072,
198,
2,
220,
220,
474,
14981,
796,
1976,
27498,
7,
21283,
79,
13,
28961,
13,
77,
7785,
8,
198,
2,
220,
220,
1441,
474,
83,
1676,
67,
0,
7,
21283,
79,
11,
2124,
11,
410,
11,
474,
14981,
8,
198,
2,
886,
198,
2,
198,
2,
366,
36,
2100,
4985,
262,
1007,
29813,
12,
46751,
666,
12,
31364,
1720,
379,
4600,
87,
63,
287,
1295,
526,
198,
2,
2163,
474,
83,
1676,
67,
0,
7,
21283,
79,
7904,
16320,
2964,
70,
45,
19930,
17633,
11,
2124,
7904,
15690,
90,
43879,
2414,
5512,
410,
7904,
15690,
90,
43879,
2414,
5512,
474,
14981,
7904,
15690,
90,
43879,
2414,
30072,
198,
2,
220,
220,
399,
19930,
5841,
1424,
13,
24988,
434,
0,
7,
21283,
79,
11,
1058,
710,
2100,
62,
73,
83,
1676,
67,
8,
198,
2,
220,
220,
16320,
2964,
70,
14881,
13,
18206,
62,
30482,
62,
1676,
67,
62,
83,
7,
21283,
79,
13,
3149,
19849,
13,
18206,
11,
474,
14981,
11,
2124,
11,
410,
8,
198,
2,
220,
220,
1441,
474,
14981,
198,
2,
886,
198,
198,
8818,
339,
824,
62,
37652,
7,
21283,
79,
7904,
16320,
2964,
70,
45,
19930,
17633,
11,
2124,
7904,
15690,
90,
43879,
2414,
19629,
198,
220,
220,
220,
26181,
62,
6551,
7904,
48436,
2414,
28,
16,
13,
15,
11,
331,
7904,
15690,
90,
43879,
2414,
92,
28,
9107,
418,
7,
21283,
79,
13,
28961,
13,
77,
1102,
4008,
198,
220,
399,
19930,
5841,
1424,
13,
24988,
434,
0,
7,
21283,
79,
11,
1058,
710,
2100,
62,
33979,
8,
198,
220,
16320,
2964,
70,
14881,
13,
18206,
62,
33979,
30909,
7,
21283,
79,
13,
3149,
19849,
13,
18206,
11,
299,
34431,
13,
71,
12786,
11,
2124,
11,
26181,
62,
6551,
11,
331,
8,
198,
220,
1441,
357,
21283,
79,
13,
71,
8516,
11,
299,
34431,
13,
71,
4033,
82,
11,
299,
34431,
13,
71,
12786,
8,
198,
437,
198,
198,
8818,
339,
824,
7,
21283,
79,
7904,
16320,
2964,
70,
45,
19930,
17633,
11,
2124,
7904,
15690,
90,
43879,
2414,
19629,
198,
220,
220,
220,
26181,
62,
6551,
7904,
48436,
2414,
28,
16,
13,
15,
11,
331,
7904,
15690,
90,
43879,
2414,
92,
28,
9107,
418,
7,
21283,
79,
13,
28961,
13,
77,
1102,
4008,
198,
220,
1441,
29877,
7,
33979,
62,
37652,
7,
21283,
79,
11,
2124,
11,
331,
28,
88,
11,
26181,
62,
6551,
28,
26801,
62,
6551,
26513,
11,
299,
34431,
13,
28961,
13,
77,
7785,
11,
299,
34431,
13,
28961,
13,
77,
7785,
8,
198,
437,
198,
198,
8818,
289,
1676,
67,
7,
21283,
79,
7904,
16320,
2964,
70,
45,
19930,
17633,
11,
2124,
7904,
15690,
90,
43879,
2414,
5512,
410,
7904,
15690,
90,
43879,
2414,
19629,
198,
220,
220,
220,
26181,
62,
6551,
7904,
48436,
2414,
28,
16,
13,
15,
11,
331,
7904,
15690,
90,
43879,
2414,
92,
28,
9107,
418,
7,
21283,
79,
13,
28961,
13,
77,
1102,
4008,
198,
220,
289,
85,
796,
1976,
27498,
7,
21283,
79,
13,
28961,
13,
77,
7785,
8,
198,
220,
1441,
289,
1676,
67,
0,
7,
21283,
79,
11,
2124,
11,
410,
11,
289,
85,
11,
26181,
62,
6551,
28,
26801,
62,
6551,
11,
331,
28,
88,
8,
198,
437,
198,
198,
8818,
289,
1676,
67,
0,
7,
21283,
79,
7904,
16320,
2964,
70,
45,
19930,
17633,
11,
2124,
7904,
15690,
90,
43879,
2414,
5512,
410,
7904,
15690,
90,
43879,
2414,
5512,
198,
220,
220,
220,
289,
85,
7904,
15690,
90,
43879,
2414,
19629,
198,
220,
220,
220,
26181,
62,
6551,
7904,
48436,
2414,
28,
16,
13,
15,
11,
331,
7904,
15690,
90,
43879,
2414,
92,
28,
9107,
418,
7,
21283,
79,
13,
28961,
13,
77,
1102,
4008,
198,
220,
399,
19930,
5841,
1424,
13,
24988,
434,
0,
7,
21283,
79,
11,
1058,
710,
2100,
62,
71,
1676,
67,
8,
198,
220,
16320,
2964,
70,
14881,
13,
18206,
62,
33979,
30909,
62,
1676,
67,
7,
21283,
79,
13,
3149,
19849,
13,
18206,
11,
289,
85,
11,
2124,
11,
410,
11,
26181,
62,
6551,
11,
331,
8,
198,
220,
1441,
289,
85,
198,
437,
198,
198,
14468,
7804,
4242,
198,
2235,
23578,
9104,
33634,
42714,
198,
14468,
7804,
4242,
198,
198,
8818,
3722,
62,
3198,
62,
35645,
62,
2514,
62,
33018,
7378,
7,
13376,
3712,
13940,
23650,
8,
198,
220,
220,
220,
1303,
1201,
674,
3722,
389,
407,
4961,
284,
12585,
7378,
82,
356,
761,
284,
466,
257,
11315,
198,
220,
220,
220,
611,
3722,
6624,
1058,
27871,
4402,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1058,
27871,
4402,
198,
220,
220,
220,
2073,
361,
3722,
6624,
1058,
1050,
4402,
62,
259,
5036,
292,
856,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1058,
818,
5036,
292,
856,
198,
220,
220,
220,
2073,
361,
3722,
6624,
1058,
646,
282,
62,
259,
5036,
292,
856,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1058,
3118,
65,
6302,
198,
220,
220,
220,
2073,
361,
3722,
6624,
1058,
22921,
62,
2043,
8614,
3722,
24844,
1058,
22921,
62,
34694,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1058,
12982,
39184,
198,
220,
220,
220,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1058,
12331,
198,
220,
220,
220,
886,
198,
437,
198,
198,
8818,
2251,
62,
79,
945,
62,
33018,
7378,
7,
25811,
1267,
198,
220,
220,
220,
13544,
796,
5016,
62,
17143,
7307,
3419,
198,
220,
220,
220,
329,
357,
17143,
11,
8367,
8,
287,
3689,
198,
220,
220,
220,
220,
220,
644,
796,
6626,
7,
10100,
7,
17143,
27267,
2474,
8,
1303,
356,
2380,
257,
11507,
884,
355,
2315,
13,
30300,
62,
9888,
355,
2315,
0,
30300,
62,
9888,
780,
356,
2314,
1208,
2315,
13,
30300,
62,
9888,
355,
257,
11507,
198,
220,
220,
220,
220,
220,
10139,
796,
13544,
1303,
6808,
198,
220,
220,
220,
220,
220,
329,
1312,
287,
352,
25,
13664,
7,
10919,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2214,
796,
644,
58,
72,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1312,
1279,
4129,
7,
10919,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10139,
796,
651,
3245,
7,
17440,
11,
13940,
23650,
7,
3245,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
1303,
379,
262,
12835,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
900,
3245,
0,
7,
17440,
11,
13940,
23650,
7,
3245,
828,
8367,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
220,
220,
886,
198,
220,
220,
220,
886,
628,
220,
220,
220,
1441,
13544,
198,
437,
198,
198,
8818,
16320,
2964,
70,
14881,
13,
40085,
1096,
0,
7,
76,
7904,
1881,
35645,
37372,
2964,
70,
17633,
8,
198,
220,
220,
220,
256,
796,
640,
3419,
198,
220,
220,
220,
299,
34431,
796,
16320,
2964,
70,
45,
19930,
17633,
7,
76,
8,
628,
220,
220,
220,
13544,
796,
2251,
62,
79,
945,
62,
33018,
7378,
7,
76,
13,
25811,
8,
628,
220,
220,
220,
11629,
11,
3722,
11,
1554,
11,
256,
11,
11454,
11,
19781,
796,
530,
62,
40715,
62,
82,
6442,
7,
21283,
79,
11,
79,
945,
8,
628,
220,
220,
220,
285,
13,
5083,
13,
13376,
796,
3722,
62,
3198,
62,
35645,
62,
2514,
62,
33018,
7378,
7,
13376,
8,
198,
220,
220,
220,
285,
13,
5083,
13,
87,
796,
651,
62,
14986,
62,
87,
7,
2676,
8,
198,
220,
220,
220,
285,
13,
5083,
13,
26801,
62,
2100,
796,
11629,
13,
23870,
13,
69,
2100,
198,
220,
220,
220,
285,
13,
5083,
13,
50033,
796,
651,
62,
88,
7,
2676,
8,
198,
220,
220,
220,
285,
13,
5083,
13,
82,
6442,
62,
2435,
796,
640,
3419,
532,
256,
628,
220,
220,
220,
1303,
2183,
530,
7108,
3033,
198,
220,
220,
220,
285,
13,
5083,
13,
79,
945,
796,
13544,
198,
220,
220,
220,
285,
13,
5083,
13,
2676,
796,
11629,
198,
220,
220,
220,
285,
13,
5083,
13,
10034,
796,
1554,
198,
437,
198,
198,
37372,
2964,
70,
14881,
13,
1136,
1102,
2536,
82,
2122,
7,
76,
3712,
3198,
35645,
37372,
2964,
70,
17633,
8,
796,
285,
13,
5083,
13,
70,
198,
37372,
2964,
70,
14881,
13,
1136,
1831,
82,
14375,
7,
76,
3712,
3198,
35645,
37372,
2964,
70,
17633,
8,
796,
285,
13,
5083,
198,
37372,
2964,
70,
14881,
13,
11407,
6442,
2435,
7,
76,
3712,
3198,
35645,
37372,
2964,
70,
17633,
8,
796,
285,
13,
5083,
13,
82,
6442,
62,
2435,
198,
198,
8818,
16320,
2964,
70,
14881,
13,
1136,
445,
19513,
15805,
82,
7,
76,
3712,
3198,
35645,
37372,
2964,
70,
17633,
8,
198,
220,
220,
220,
1441,
651,
62,
445,
19513,
15805,
82,
7,
76,
13,
5083,
13,
2676,
8,
198,
437,
198,
198,
8818,
16320,
2964,
70,
14881,
13,
1136,
1102,
2536,
646,
874,
7,
76,
3712,
3198,
35645,
37372,
2964,
70,
17633,
8,
198,
220,
220,
220,
1441,
651,
62,
1102,
2536,
646,
874,
7,
76,
13,
5083,
13,
2676,
8,
198,
437,
198,
198,
2,
2617,
85,
433,
2981,
0,
7,
76,
3712,
3198,
35645,
37372,
2964,
70,
17633,
11,
2170,
3712,
38469,
90,
13940,
23650,
30072,
796,
198,
2,
220,
220,
220,
357,
76,
13,
7785,
6030,
796,
3975,
7,
83,
3784,
18218,
62,
7785,
62,
4906,
62,
8899,
58,
83,
4357,
2170,
4008,
198,
198,
8818,
16320,
2964,
70,
14881,
13,
19503,
368,
375,
417,
0,
7,
76,
3712,
3198,
35645,
37372,
2964,
70,
17633,
8,
198,
220,
220,
220,
1303,
5390,
8410,
198,
437,
198
] | 2.087689 | 5,702 |
using Test
using Provenance
| [
3500,
6208,
198,
3500,
1041,
574,
590,
198
] | 3.5 | 8 |
Subsets and Splits