From d5f937043dbfbf675f730298531becfb9f01b8ab Mon Sep 17 00:00:00 2001 From: Sheehan Olver Date: Sat, 15 Feb 2025 13:07:07 +0000 Subject: [PATCH] Use checkpoints instead of first to pick an arbitrary value of a function --- Project.toml | 2 +- src/bases/bases.jl | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 7402cad..0696f73 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "ContinuumArrays" uuid = "7ae1f121-cc2c-504b-ac30-9b923412ae5c" -version = "0.19.1" +version = "0.19.2" [deps] AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c" diff --git a/src/bases/bases.jl b/src/bases/bases.jl index 6079bc6..f188fae 100644 --- a/src/bases/bases.jl +++ b/src/bases/bases.jl @@ -311,8 +311,11 @@ function _factorize(::MappedBasisLayout, L, dims...; kws...) MappedFactorization(factorize(view(P,:,jr), dims...; kws...), invmap(parentindices(L)[1])) end +# Axiom of Choice: choose a point in the set +pointchoice(x::AbstractVector) = first(x) +pointchoice(x) = first(checkpoints(x)) -_any_eltype(B::AbstractQuasiArray{Any}) = typeof(first(B)) # assume types are same +_any_eltype(B::AbstractQuasiArray{Any}) = typeof(B[pointchoice.(axes(B))...]) # assume types are same _any_eltype(B) = eltype(B) plan_ldiv(A, B::AbstractQuasiVector) = factorize(convert(AbstractQuasiMatrix{promote_type(eltype(A), _any_eltype(B))}, A))