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

cumsum_kbn signature is too restrictive #4

Closed
stevengj opened this issue Dec 2, 2017 · 3 comments
Closed

cumsum_kbn signature is too restrictive #4

stevengj opened this issue Dec 2, 2017 · 3 comments

Comments

@stevengj
Copy link
Member

stevengj commented Dec 2, 2017

The signature cumsum_kbn(v::AbstractVector{T}) where T<:AbstractFloat seems too restrictive. What about summing Complex{Float64} or SVector{Float64,3}, for example?

sum_kbn accepts any type, which seems more reasonable. (If you pass something like an array of integers, it will still work, just wasting some computations.)

@ararslan
Copy link
Member

It also seems to assume 1-based indexing. Generalizing that to allow OffsetArrays would be nice as well.

@JeffreySarnoff
Copy link
Member

OK -- revisiting.
What signature is recommended?

cumsum_kbn(v::AbstractVector)
cumsum_kbn(v::AbstractVector{T}) where {T<:Number}
etc

@JeffreySarnoff
Copy link
Member

fixed in master

JeffreySarnoff added a commit that referenced this issue Jun 7, 2022
Update Project.toml
test Julia v"1.6" and nightly
generalize signatures
Update KahanSummation.jl
cleanup type param conflict with var
change Vector to Array
modernize kwarg use
provide generalized sigs
better coverage
Update Project.toml
make generalized more specific to avoid recalling same function
fix Generator spelling
fix copypaste error
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

No branches or pull requests

3 participants