This repository has been archived by the owner on May 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from ScottPJones/spj/fixv05
Fix issue #100, make work again with v0.5
- Loading branch information
Showing
6 changed files
with
74 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
julia 0.4- | ||
Compat | ||
Reexport |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,35 @@ | ||
module NullableArrays | ||
|
||
using Reexport | ||
@reexport using Base.Cartesian | ||
using Compat | ||
using Reexport | ||
@reexport using Base.Cartesian | ||
|
||
export NullableArray, | ||
NullableVector, | ||
NullableMatrix, | ||
export NullableArray, | ||
NullableVector, | ||
NullableMatrix, | ||
|
||
# Macros | ||
# Macros | ||
|
||
# Methods | ||
dropnull, | ||
anynull, | ||
allnull, | ||
head, | ||
nullify!, | ||
padnull!, | ||
padnull, | ||
tail | ||
# Methods | ||
dropnull, | ||
anynull, | ||
allnull, | ||
head, | ||
nullify!, | ||
padnull!, | ||
padnull, | ||
tail | ||
|
||
include("typedefs.jl") | ||
include("constructors.jl") | ||
include("primitives.jl") | ||
include("indexing.jl") | ||
include("map.jl") | ||
include("nullablevector.jl") | ||
include("operators.jl") | ||
include("broadcast.jl") | ||
include("reduce.jl") | ||
include("show.jl") | ||
include("subarray.jl") | ||
|
||
include("typedefs.jl") | ||
include("constructors.jl") | ||
include("primitives.jl") | ||
include("indexing.jl") | ||
include("map.jl") | ||
include("nullablevector.jl") | ||
include("operators.jl") | ||
include("broadcast.jl") | ||
include("reduce.jl") | ||
include("show.jl") | ||
include("subarray.jl") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
typealias NullableSubArray{T,N,P<:NullableArray,IV,LD} SubArray{T,N,P,IV,LD} | ||
|
||
@inline function Base.isnull(V::NullableSubArray, I::Int...) | ||
@boundscheck checkbounds(V, I...) | ||
@inbounds return V.parent.isnull[Base.reindex(V, V.indexes, I)...] | ||
end | ||
|
||
@inline function Base.values(V::NullableSubArray, I::Int...) | ||
@boundscheck checkbounds(V, I...) | ||
@inbounds return V.parent.values[Base.reindex(V, V.indexes, I)...] | ||
end | ||
|
||
typealias FastNullableSubArray{T,N,P<:NullableArray,IV} SubArray{T,N,P,IV,true} | ||
|
||
@inline function Base.isnull(V::FastNullableSubArray, i::Int) | ||
@boundscheck checkbounds(V, i) | ||
@inbounds return V.parent.isnull[V.first_index + V.stride1*i-1] | ||
end | ||
|
||
@inline function Base.values(V::FastNullableSubArray, i::Int) | ||
@boundscheck checkbounds(V, i) | ||
@inbounds return V.parent.values[V.first_index + V.stride1*i-1] | ||
end | ||
|
||
# We can avoid a multiplication if the first parent index is a Colon or UnitRange | ||
typealias FastNullableContiguousSubArray{T,N,P<:NullableArray,I<:Tuple{Union{Colon, UnitRange}, Vararg{Any}}} SubArray{T,N,P,I,true} | ||
|
||
@inline function Base.isnull(V::FastNullableContiguousSubArray, i::Int) | ||
@boundscheck checkbounds(V, i) | ||
@inbounds return V.parent.isnull[V.first_index + i - 1] | ||
end | ||
|
||
@inline function Base.values(V::FastNullableContiguousSubArray, i::Int) | ||
@boundscheck checkbounds(V, i) | ||
@inbounds return V.parent.values[V.first_index + i - 1] | ||
end |