Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Aug 20, 2024
1 parent d696850 commit 3fe4ce5
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 14 deletions.
10 changes: 8 additions & 2 deletions src/border.jl
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,11 @@ function solve(
if solver.max_iterations == 0
Uperp = nothing
else
Uperp = commutation_fix(mult, solver.solver.ε; print_level = solver.print_level)
Uperp = commutation_fix(
mult,
solver.solver.ε;
print_level = solver.print_level,
)
end
com_fix = if isnothing(Uperp)
nothing
Expand Down Expand Up @@ -305,7 +309,9 @@ function commutation_fix(matrices, ε; print_level)
return
else
if print_level >= 1
@info("Found multiplication matrices with commutation error of `$leading_ratio` which is larger than the tolerance of ``. Adding this to the equations and continuing.")
@info(
"Found multiplication matrices with commutation error of `$leading_ratio` which is larger than the tolerance of ``. Adding this to the equations and continuing."
)
end
return leading_F.U[:, 2:end]
end
Expand Down
15 changes: 12 additions & 3 deletions src/shift.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,17 @@ function ShiftNullspace{D}(check::RankCheck; print_level = 1) where {D}
end
function ShiftNullspace{D}(solver::StaircaseSolver; print_level = 1) where {D}
check = solver.rank_check
return ShiftNullspace{D,typeof(solver),typeof(check)}(solver, check, print_level)
return ShiftNullspace{D,typeof(solver),typeof(check)}(
solver,
check,
print_level,
)
end
function ShiftNullspace{D}(; kws...) where {D}
return ShiftNullspace{D}(LeadingRelativeRankTol(Base.rtoldefault(Float64)); kws...)
return ShiftNullspace{D}(
LeadingRelativeRankTol(Base.rtoldefault(Float64));
kws...,
)
end
ShiftNullspace(args...) = ShiftNullspace{StaircaseDependence}(args...)

Expand All @@ -132,7 +139,9 @@ function _solver(
) where {T}
return StaircaseSolver{T}(;
rank_check = shift.check,
solver = SS.ReorderedSchurMultiplicationMatricesSolver(convert(T, null.accuracy)),
solver = SS.ReorderedSchurMultiplicationMatricesSolver(
convert(T, null.accuracy),
),
print_level = shift.print_level,
)
end
Expand Down
21 changes: 12 additions & 9 deletions test/extract.jl
Original file line number Diff line number Diff line change
Expand Up @@ -364,12 +364,14 @@ end

function no_com(solver, T)
Mod.@polyvar x[1:2]
Q = T[1.0000000000000002 2.9999999777389235 1.408602019734018 8.999999911981313 4.225805987406138 3.043010098670093
2.9999999777389235 8.999999911981313 4.225805987406138 26.999999824988187 12.677417999642149 9.129030026074997
1.408602019734018 4.225805987406138 3.043010098670093 12.677417999642149 9.129030026074997 9.580642414414385
8.999999911981313 26.999999824988187 12.677417999642149 80.99999955990646 38.03225428611012 27.387090350285558
4.225805987406138 12.677417999642149 9.129030026074997 38.03225428611012 27.387090350285558 28.74192618075039
3.043010098670093 9.129030026074997 9.580642414414385 27.387090350285558 28.74192618075039 35.73117167739159]
Q = T[
1.0000000000000002 2.9999999777389235 1.408602019734018 8.999999911981313 4.225805987406138 3.043010098670093
2.9999999777389235 8.999999911981313 4.225805987406138 26.999999824988187 12.677417999642149 9.129030026074997
1.408602019734018 4.225805987406138 3.043010098670093 12.677417999642149 9.129030026074997 9.580642414414385
8.999999911981313 26.999999824988187 12.677417999642149 80.99999955990646 38.03225428611012 27.387090350285558
4.225805987406138 12.677417999642149 9.129030026074997 38.03225428611012 27.387090350285558 28.74192618075039
3.043010098670093 9.129030026074997 9.580642414414385 27.387090350285558 28.74192618075039 35.73117167739159
]
ν = moment_matrix(Q, monomials(x, 0:2))
η = AtomicMeasure(
x,
Expand Down Expand Up @@ -464,9 +466,10 @@ function test_extract()
jcg14_6_1(6e-3)
jcg14_6_1(8e-4, false)
large_norm(1e-2)
@testset "No comm fix $(_short(solver)) $T" for solver in [
ShiftNullspace(),
], T in [Float64] #, BigFloat]
@testset "No comm fix $(_short(solver)) $T" for solver in
[ShiftNullspace()],
T in [Float64]
#, BigFloat]
no_com(solver, T)
end
return
Expand Down

0 comments on commit 3fe4ce5

Please sign in to comment.