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

More general indexing [4] #16203

Merged
merged 1 commit into from
May 7, 2016
Merged

Conversation

dfdx
Copy link
Contributor

@dfdx dfdx commented May 4, 2016

Another portion of improvements for more efficient iteration over different types of arrays. This PR covers lines from

broadcast.jl, cartesian.jl (tricky?) 

to

hashing2.jl, interactiveutil.jl, intfuncs.jl, intset.jl 

from this list except for cartesian.jl, which may need more careful treatment (especially in macros).

@@ -222,17 +222,17 @@ format(dt::TimeType,f::AbstractString;locale::AbstractString="english") = format
# vectorized
DateTime{T<:AbstractString}(y::AbstractArray{T},format::AbstractString;locale::AbstractString="english") = DateTime(y,DateFormat(format,locale))
function DateTime{T<:AbstractString}(y::AbstractArray{T},df::DateFormat=ISODateTimeFormat)
return reshape(DateTime[DateTime(parse(y[i],df)...) for i in 1:length(y)], size(y))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These could be even nicer (no bounds-checking) with

function foo(Y::AbstractArray)
    [y for y in Y]
end

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Thanks!

@dfdx dfdx force-pushed the more-general-indexing-4 branch from 8386d11 to ba52671 Compare May 6, 2016 23:10
@timholy timholy merged commit 97b4987 into JuliaLang:master May 7, 2016
@timholy
Copy link
Member

timholy commented May 7, 2016

Thanks again!

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

Successfully merging this pull request may close these issues.

2 participants