Skip to content

Commit

Permalink
re-ordered methods
Browse files Browse the repository at this point in the history
  • Loading branch information
PGS62 committed Feb 22, 2023
1 parent fcec5ff commit 445700f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/corkendall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ end
Return a pair `(a,b)`, filtered copies of `x` and `y`, in which elements `x[i]` and `y[i]`
are filtered out if `ismissing(x[i])||ismissing(y[i])`.
"""
handlepairwise(x::AbstractVector{<:Real}, y::AbstractVector{<:Real}) = x, y

function handlepairwise(x::RoMVector{T}, y::RoMVector{U}) where {T,U}

n = length(x)
Expand All @@ -348,8 +350,6 @@ function handlepairwise(x::RoMVector{T}, y::RoMVector{U}) where {T,U}
return resize!(a, j), resize!(b, j)
end

handlepairwise(x::AbstractVector{<:Real}, y::AbstractVector{<:Real}) = x, y

"""
handlepairwise!(x::RoMVector{T}, y::RoMVector{U},
tx::AbstractVector{T}, ty::AbstractVector{U}) where {T,U}
Expand Down Expand Up @@ -410,6 +410,8 @@ end
Return a pair `(a,b)`, filtered copies of `(x,y)`, in which the rows `x[i,:]` and
`y[i,:]` are both filtered out if `any(ismissing,x[i,:])||any(ismissing,y[i,:])`.
"""
handlelistwise(x::AbstractMatrix{<:Real}, y::AbstractMatrix{<:Real}) = x, y

function handlelistwise(x::RoMMatrix{T}, y::RoMMatrix{U}) where {T,U}

nrx = size(x, 1)
Expand Down Expand Up @@ -449,4 +451,3 @@ function handlelistwise(x::RoMMatrix{T}, y::RoMMatrix{U}) where {T,U}
return view(a, 1:k, :), view(b, 1:k, :)
end

handlelistwise(x::AbstractMatrix{<:Real}, y::AbstractMatrix{<:Real}) = x, y

0 comments on commit 445700f

Please sign in to comment.