Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszbaran committed Jan 15, 2024
1 parent 0cc7148 commit d32dbc3
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions test/plans/test_stepsize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,52 @@ using Manopt, Manifolds, Test
@test s(test_ϕdϕ_2, 1.0, 2.0, 0.0)[1] == 0.0
# the test below tests failure to get to a finite value
@test s(test_ϕdϕ_2, 1.0, 2.0, -1.0)[1] == 0.0

seq_A = Dict(
5.0 => (2.204235476457027, 0.3939091703282501),
1.0003004969933067 => (0.11139471010319403, 0.46673400040724694),
1.000000000000001 => (-0.7609266443457385, -0.23870772915953856),
1.0000000003108975 => (0.8710828953352873, 0.1894839768058072),
1.0000000000000073 => (1.45925511098195, -1.287709475949499),
1.3451609118081171 => (-0.8706167493146322, 2.214001105111046),
1.0057036996096567 => (1.1272458746417433, 0.668899021557659),
1.0000000216932503 => (-0.06369954282901213, -0.30871724503177106),
1.0000000006217953 => (0.07061459767374156, -0.2922164989842865),
1.0 => (-1.4369441931092128, -0.03720055660982347),
1.0000000000000013 => (-0.15390779207560273, -0.6599826177249115),
1.0000000108466252 => (-0.14188658979183247, 0.6117274750177726),
1.0000000000510205 => (0.6070941124405822, 0.39989230406034443),
1.0000000000000018 => (0.8038319181589618, -0.5949965880344299),
1.0000000867730008 => (-0.42550361109987567, -0.7365359017567995),
1.0000000000000009 => (-2.254336280197326, -0.6675630365783874),
1.0000000000000036 => (0.13396618577410138, -1.1637857690940683),
1.0000110913761073 => (0.5722836955879423, 1.3569659714442532),
1.0000000000043423 => (0.6203171094108477, 0.708795491068729),
1.0000221827522144 => (0.104097146457823, -0.003530491853577571),
1.0000000000002165 => (-0.12166874725079804, 0.03417553984851831),
1.0000002959512773 => (0.05307818374176109, 0.08967706826239678),
1.0000000433865004 => (-0.34693123718302615, -0.034497535027746384),
)
function test_ϕdϕ_3(α)
return seq_A[α]
end
@test s(test_ϕdϕ_3, 1.0, test_ϕdϕ_3(1.0)...)[1] 1.0

# for i in 1:1000
# dct = Dict{Float64,Tuple{Float64,Float64}}()
# function test_ϕdϕ_k(α)
# if !haskey(dct, α)
# dct[α] = randn(), randn()
# end
# return dct[α]
# end
# try
# s(test_ϕdϕ_k, 1.0, test_ϕdϕ_k(1.0)...)
# catch e
# if e isa ArgumentError
# # println(repr(dct))
# end
# end
# end
end
end

0 comments on commit d32dbc3

Please sign in to comment.