File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,9 @@ function _floatingzone(
80
80
)
81
81
err = vec (abs .(exactdata .- prediction))
82
82
pivot[ipos] = argmax (err)
83
- maxerror = maximum (err)
83
+ # In RHS, we compare the maximum of the error vector with the current maxerror
84
+ # to make sure that the error does not decrease even if maxerror is close to machine precision.
85
+ maxerror = max (maximum (err), maxerror)
84
86
end
85
87
86
88
if maxerror == prev_maxerror || maxerror > earlystoptol # early stop
Original file line number Diff line number Diff line change @@ -32,6 +32,6 @@ import QuanticsGrids as QD
32
32
pivoterrors = TCI. estimatetrueerror (TCI. TensorTrain (tci), f)
33
33
34
34
errors = [e for (_, e) in pivoterrors]
35
- @test all ( [abs (f (p) - tci (p)) for (p, _) in pivoterrors] .== errors)
35
+ @test [abs (f (p) - tci (p)) for (p, _) in pivoterrors] ≈ errors
36
36
@test all (errors[1 : end - 1 ] .>= errors[2 : end ]) # check if errors are sorted in descending order
37
37
end
You can’t perform that action at this time.
0 commit comments