-
Notifications
You must be signed in to change notification settings - Fork 24
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
Efficient reducing functions (maximum, sum, etc.) #115
Comments
We'd be happy to merge a PR that fixes this |
|
I don’t think mapreduce is really possible: consider mapreduce(identity, max, A) vs mapreduce(identity, +,A). I don’t think there’s a way to optimise both for toeplitz |
Technically it's partially possible once #86 is merged: for commutative operations and Anyway, |
Example: for op in (:+, :max)
@eval mapreduce(f, ::typeof($op), A::AbstractToeplitz) = mapreduce(identity, $op, [mapreduce(f, $op, diag(A, k)) for k in -size(A,1)+1:size(A,2)-1])
end Note that there is an allocation which might be avoided by using a generator/lazy array. This only works after #86 and JuliaArrays/FillArrays.jl#301 |
It seems that currently the package iterates over the full matrix rather than exploiting the Toeplitz structure.
The text was updated successfully, but these errors were encountered: