Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unreachable code #46

Closed
schillic opened this issue Jul 29, 2023 · 0 comments · Fixed by #62
Closed

Unreachable code #46

schillic opened this issue Jul 29, 2023 · 0 comments · Fixed by #62
Assignees

Comments

@schillic
Copy link
Member

schillic commented Jul 29, 2023

The current implementation (see below) contains code that should be unreachable: If Re_λ₁ = 0, then R = Inf and the check case should have triggered before reaching the case iszero(Re_λ₁). The only way to reach there is by deactivating check, but then the result is not valid anyway as far as I understand.

function error_bound_specabs(x₀, F₁, F₂; N, check=true)
(R, Re_λ₁) = _error_bound_specabs_R(x₀, F₁, F₂; check=check)
if check
@assert R < 1 "expected R < 1, got R = $R; try scaling the ODE"
end
nx₀ = norm(x₀, 2)
if iszero(Re_λ₁)
nF₂ = opnorm(F₂, 2)
ε = t -> nx₀ * (nx₀ * nF₂ * t)^N
else
ε = t -> nx₀ * R^N * (1 - exp(Re_λ₁ * t))^N
end
return ε
end

@schillic schillic changed the title Use new error bound with spectral abscissa Unreachable code Jul 29, 2023
@schillic schillic added the discussion 🗣️ Requires human input label Jul 29, 2023
@schillic schillic self-assigned this Mar 1, 2024
@schillic schillic removed the discussion 🗣️ Requires human input label Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant