-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Reorganize some hvcat functions #16741
Conversation
Thanks. However I think this might cause the definitions in sparse/sparsematrix.jl to be called, since they are more specific. I think that's why these were added. |
Yes, I was thinking about this. I'll see what I can do about it. |
d19994a
to
72c5219
Compare
Yes they were added specifically because the specialized methods would have been called. Maybe I used too specific types? Would it have sufficed with |
I don't think the building should give an ambiguous definition error. Is it a bug in inference or I am missing something obvious? |
fa17dcf
to
d1843c7
Compare
Ok. @JeffBezanson I think this is ready and addresses the issue with |
hvcat(rows::Tuple{Vararg{Int}}, xs::AbstractMatrix...) = typed_hvcat(promote_eltype(xs...), rows, xs...) | ||
hvcat{T}(rows::Tuple{Vararg{Int}}, xs::AbstractMatrix{T}...) = typed_hvcat(T, rows, xs...) | ||
|
||
function typed_hvcat{T}(TT::Type{T}, rows::Tuple{Vararg{Int}}, as::AbstractMatrix{T}...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This requires all the argument matrices to have the output type T
as their element type already.
Also could you keep the code in place above to get a smaller diff?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. There was an apparently unrelated AV error.
Thank you! |
This PR reorganize some
hvcat
functions andremoves some duplicates of somefixes some problems that were introduced in commit e280a27. These cause some cat function to fallback to a generic (slow) version.cat
operations that exist in bothabstractarray.jl
andarray.jl
This should help with at least the
rand_mat_mul
in #16128.