To achieve numerical accuracy, I explicitly promote FixedPoint types to floats, but this causes some significant memory allocations
intermediatetype(::Type{T}) where T<:Number = T
intermediatetype(::Type{T}) where T<:FixedPoint = FixedPointNumbers.floattype(T)
intermediatetype(::Type{T}) where T<:Bool = Float64
evaluate(dist::UnionMetrics, a::Gray2dImage{T1}, b::Gray2dImage{T2}) where {T1<:FixedPoint, T2<:FixedPoint} =
evaluate(dist, intermediatetype(T1).(a), intermediatetype(T2).(b))
Is there any way to make optimizations, or is this memory allocation inevitable?
To achieve numerical accuracy, I explicitly promote FixedPoint types to floats, but this causes some significant memory allocations
Is there any way to make optimizations, or is this memory allocation inevitable?