Skip to content
This repository has been archived by the owner on Oct 12, 2019. It is now read-only.

Commit

Permalink
avoid ntuple deprecation on 0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
sjkelly committed Aug 23, 2015
1 parent 97d254b commit 0fbc44f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/generate_arrays.jl
Expand Up @@ -283,8 +283,14 @@ function generate_arrays(maxSz::Integer)
@eval $TypT(a::T) = $Typ($ColTyp(a))

# construct or convert from other matrix types
@eval $Typ(a::AbstractMatrix) = $Typ(ntuple($cSz, c->
$ColTyp(ntuple($rSz, r-> a[r,c])...))...)
# accomidate ntuple syntax change on 0.4
if VERSION < v"0.4-"
@eval $Typ(a::AbstractMatrix) = $Typ(ntuple($cSz, c->
$ColTyp(ntuple($rSz, r-> a[r,c])...))...)
else
@eval $Typ(a::AbstractMatrix) = $Typ(ntuple(c->
$ColTyp(ntuple(r-> a[r,c], $rSz)...), $cSz)...)
end
@eval convert{T}(::Type{$TypT}, x::AbstractMatrix) = $Typ(x)

# convert to Array
Expand Down

0 comments on commit 0fbc44f

Please sign in to comment.