We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
cumsum
Ones
For example using FillArrays v1.9.3:
FillArrays v1.9.3
julia> using FillArrays julia> cumsum(Ones{Int64}(4)) Base.OneTo(4) julia> cumsum(Ones{Int32}(4)) 4-element Vector{Int32}: 1 2 3 4
I believe the issue is this line: https://github.com/JuliaArrays/FillArrays.jl/blob/v1.9.3/src/FillArrays.jl#L578.
It may in fact be an issue with convert of Base.OneTo:
convert
Base.OneTo
julia> convert(AbstractVector{Int64}, Base.OneTo(4)) Base.OneTo(4) julia> convert(AbstractVector{Int32}, Base.OneTo(4)) 4-element Vector{Int32}: 1 2 3 4
i.e. it seems like it should preserve that it is Base.OneTo and just change the element type. A workaround could be to use:
cumsum(x::AbstractOnesVector{II}) where II<:Integer = convert(AbstractVector{II}, oneto(II(length(x))))
The text was updated successfully, but these errors were encountered:
I raised an issue here: JuliaLang/julia#53806
Sorry, something went wrong.
Using this might be a work around: https://github.com/putianyi889/EltypeExtensions.jl
cf #352
On a longer term, I think JuliaLang/julia#48894 should fix many of these issues. I'll try to push that.
No branches or pull requests
For example using
FillArrays v1.9.3
:I believe the issue is this line: https://github.com/JuliaArrays/FillArrays.jl/blob/v1.9.3/src/FillArrays.jl#L578.
It may in fact be an issue with
convert
ofBase.OneTo
:i.e. it seems like it should preserve that it is
Base.OneTo
and just change the element type. A workaround could be to use:The text was updated successfully, but these errors were encountered: