Skip to content

Commit 45ee8fc

Browse files
authored
Merge pull request #19791 from Sacha0/monodevec
Deprecate manually vectorized methods in favor of dot syntax, monolithic edition
2 parents 26c8d85 + 14d27ed commit 45ee8fc

35 files changed

+345
-367
lines changed

base/arraymath.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ promote_array_type{S<:Integer}(::typeof(/), ::Type{S}, ::Type{Bool}, T::Type) =
2828
promote_array_type{S<:Integer}(::typeof(\), ::Type{S}, ::Type{Bool}, T::Type) = T
2929
promote_array_type{S<:Integer}(F, ::Type{S}, ::Type{Bool}, T::Type) = T
3030

31-
for f in (:+, :-, :div, :mod, :&, :|)
31+
for f in (:+, :-)
3232
@eval function ($f)(A::AbstractArray, B::AbstractArray)
3333
promote_shape(A, B) # check size compatibility
3434
broadcast($f, A, B)
3535
end
3636
end
3737

38-
for f in (:div, :mod, :rem, :&, :|, :/, :\, :*, :+, :-)
38+
for f in (:/, :\, :*, :+, :-)
3939
if f != :/
4040
@eval ($f){T}(A::Number, B::AbstractArray{T}) = broadcast($f, A, B)
4141
end

base/bitarray.jl

Lines changed: 12 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,73 +1237,16 @@ end
12371237
(/)(B::BitArray, x::Number) = (/)(Array(B), x)
12381238
(/)(x::Number, B::BitArray) = (/)(x, Array(B))
12391239

1240-
function div(A::BitArray, B::BitArray)
1241-
shp = promote_shape(size(A), size(B))
1242-
all(B) || throw(DivideError())
1243-
return reshape(copy(A), shp)
1244-
end
1245-
div(A::BitArray, B::Array{Bool}) = div(A, BitArray(B))
1246-
div(A::Array{Bool}, B::BitArray) = div(BitArray(A), B)
1247-
function div(B::BitArray, x::Bool)
1248-
return x ? copy(B) : throw(DivideError())
1249-
end
1250-
function div(x::Bool, B::BitArray)
1251-
all(B) || throw(DivideError())
1252-
return x ? trues(size(B)) : falses(size(B))
1253-
end
1254-
function div(x::Number, B::BitArray)
1255-
all(B) || throw(DivideError())
1256-
y = div(x, true)
1257-
return fill(y, size(B))
1258-
end
1259-
1260-
function mod(A::BitArray, B::BitArray)
1261-
shp = promote_shape(size(A), size(B))
1262-
all(B) || throw(DivideError())
1263-
return falses(shp)
1264-
end
1265-
mod(A::BitArray, B::Array{Bool}) = mod(A, BitArray(B))
1266-
mod(A::Array{Bool}, B::BitArray) = mod(BitArray(A), B)
1267-
function mod(B::BitArray, x::Bool)
1268-
return x ? falses(size(B)) : throw(DivideError())
1269-
end
1270-
function mod(x::Bool, B::BitArray)
1271-
all(B) || throw(DivideError())
1272-
return falses(size(B))
1273-
end
1274-
function mod(x::Number, B::BitArray)
1275-
all(B) || throw(DivideError())
1276-
y = mod(x, true)
1277-
return fill(y, size(B))
1278-
end
1279-
1280-
for f in (:div, :mod)
1281-
@eval begin
1282-
function ($f)(B::BitArray, x::Number)
1283-
T = promote_op($f, Bool, typeof(x))
1284-
T === Any && return [($f)(b, x) for b in B]
1285-
F = Array{T}(size(B))
1286-
for i = 1:length(F)
1287-
F[i] = ($f)(B[i], x)
1288-
end
1289-
return F
1290-
end
1291-
end
1292-
end
1293-
1294-
function (&)(B::BitArray, x::Bool)
1295-
x ? copy(B) : falses(size(B))
1296-
end
1297-
(&)(x::Bool, B::BitArray) = B & x
1298-
1299-
function (|)(B::BitArray, x::Bool)
1300-
x ? trues(size(B)) : copy(B)
1301-
end
1302-
(|)(x::Bool, B::BitArray) = B | x
1303-
1304-
for f in (:&, :|)
1240+
# broadcast specializations for &, |, and xor/⊻
1241+
broadcast(::typeof(&), B::BitArray, x::Bool) = x ? copy(B) : falses(size(B))
1242+
broadcast(::typeof(&), x::Bool, B::BitArray) = broadcast(&, B, x)
1243+
broadcast(::typeof(|), B::BitArray, x::Bool) = x ? trues(size(B)) : copy(B)
1244+
broadcast(::typeof(|), x::Bool, B::BitArray) = broadcast(|, B, x)
1245+
broadcast(::typeof(xor), B::BitArray, x::Bool) = x ? ~B : copy(B)
1246+
broadcast(::typeof(xor), x::Bool, B::BitArray) = broadcast(xor, B, x)
1247+
for f in (:&, :|, :xor)
13051248
@eval begin
1306-
function ($f)(A::BitArray, B::BitArray)
1249+
function broadcast(::typeof($f), A::BitArray, B::BitArray)
13071250
F = BitArray(promote_shape(size(A),size(B))...)
13081251
Fc = F.chunks
13091252
Ac = A.chunks
@@ -1315,13 +1258,12 @@ for f in (:&, :|)
13151258
Fc[end] &= _msk_end(F)
13161259
return F
13171260
end
1318-
($f)(A::DenseArray{Bool}, B::BitArray) = ($f)(BitArray(A), B)
1319-
($f)(B::BitArray, A::DenseArray{Bool}) = ($f)(B, BitArray(A))
1320-
($f)(x::Number, B::BitArray) = ($f)(x, Array(B))
1321-
($f)(B::BitArray, x::Number) = ($f)(Array(B), x)
1261+
broadcast(::typeof($f), A::DenseArray{Bool}, B::BitArray) = broadcast($f, BitArray(A), B)
1262+
broadcast(::typeof($f), B::BitArray, A::DenseArray{Bool}) = broadcast($f, B, BitArray(A))
13221263
end
13231264
end
13241265

1266+
13251267
## promotion to complex ##
13261268

13271269
# TODO?

base/complex.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -864,9 +864,6 @@ function complex{T}(A::AbstractArray{T})
864864
convert(AbstractArray{typeof(complex(zero(T)))}, A)
865865
end
866866

867-
big{T<:Integer,N}(A::AbstractArray{Complex{T},N}) = convert(AbstractArray{Complex{BigInt},N}, A)
868-
big{T<:AbstractFloat,N}(A::AbstractArray{Complex{T},N}) = convert(AbstractArray{Complex{BigFloat},N}, A)
869-
870867
## promotion to complex ##
871868

872869
_default_type(T::Type{Complex}) = Complex{Int}

base/deprecated.jl

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,4 +1350,93 @@ export quadgk
13501350
@deprecate map!{F}(f::F, A::AbstractArray) map!(f, A, A)
13511351
@deprecate asyncmap!(f, c; ntasks=0, batch_size=nothing) asyncmap!(f, c, c; ntasks=ntasks, batch_size=batch_size)
13521352

1353+
# Deprecate manually vectorized abs2 methods in favor of compact broadcast syntax
1354+
@deprecate abs2(x::AbstractSparseVector) abs2.(x)
1355+
1356+
# Deprecate manually vectorized trigonometric and hyperbolic functions in favor of compact broadcast syntax
1357+
for f in (:sec, :sech, :secd, :asec, :asech,
1358+
:csc, :csch, :cscd, :acsc, :acsch,
1359+
:cot, :coth, :cotd, :acot, :acoth)
1360+
@eval @deprecate $f{T<:Number}(A::AbstractArray{T}) $f.(A)
1361+
end
1362+
1363+
# Deprecate manually vectorized clamp methods in favor of compact broadcast syntax
1364+
@deprecate clamp(A::AbstractArray, lo, hi) clamp.(A, lo, hi)
1365+
1366+
# Deprecate manually vectorized round methods in favor of compact broadcast syntax
1367+
@deprecate round(M::Bidiagonal) round.(M)
1368+
@deprecate round(M::Tridiagonal) round.(M)
1369+
@deprecate round(M::SymTridiagonal) round.(M)
1370+
@deprecate round{T<:Integer}(::Type{T}, x::AbstractArray) round.(T, x)
1371+
@deprecate round{T<:Integer}(::Type{T}, x::AbstractArray, r::RoundingMode) round.(x, r)
1372+
@deprecate round(x::AbstractArray, r::RoundingMode) round.(x, r)
1373+
@deprecate round(x::AbstractArray, digits::Integer, base::Integer = 10) round.(x, digits, base)
1374+
1375+
# Deprecate manually vectorized trunc methods in favor of compact broadcast syntax
1376+
@deprecate trunc(M::Bidiagonal) trunc.(M)
1377+
@deprecate trunc(M::Tridiagonal) trunc.(M)
1378+
@deprecate trunc(M::SymTridiagonal) trunc.(M)
1379+
@deprecate trunc{T<:Integer}(::Type{T}, x::AbstractArray) trunc.(T, x)
1380+
@deprecate trunc(x::AbstractArray, digits::Integer, base::Integer = 10) trunc.(x, digits, base)
1381+
1382+
# Deprecate manually vectorized floor methods in favor of compact broadcast syntax
1383+
@deprecate floor(M::Bidiagonal) floor.(M)
1384+
@deprecate floor(M::Tridiagonal) floor.(M)
1385+
@deprecate floor(M::SymTridiagonal) floor.(M)
1386+
@deprecate floor{T<:Integer}(::Type{T}, A::AbstractArray) floor.(T, A)
1387+
@deprecate floor(A::AbstractArray, digits::Integer, base::Integer = 10) floor.(A, digits, base)
1388+
1389+
# Deprecate manually vectorized ceil methods in favor of compact broadcast syntax
1390+
@deprecate ceil(M::Bidiagonal) ceil.(M)
1391+
@deprecate ceil(M::Tridiagonal) ceil.(M)
1392+
@deprecate ceil(M::SymTridiagonal) ceil.(M)
1393+
@deprecate ceil{T<:Integer}(::Type{T}, x::AbstractArray) ceil.(T, x)
1394+
@deprecate ceil(x::AbstractArray, digits::Integer, base::Integer = 10) ceil.(x, digits, base)
1395+
1396+
# Deprecate manually vectorized `big` methods in favor of compact broadcast syntax
1397+
@deprecate big(r::UnitRange) big.(r)
1398+
@deprecate big(r::StepRange) big.(r)
1399+
@deprecate big(r::FloatRange) big.(r)
1400+
@deprecate big(r::LinSpace) big.(r)
1401+
@deprecate big{T<:Integer,N}(x::AbstractArray{T,N}) big.(x)
1402+
@deprecate big{T<:AbstractFloat,N}(x::AbstractArray{T,N}) big.(x)
1403+
@deprecate big(A::LowerTriangular) big.(A)
1404+
@deprecate big(A::UpperTriangular) big.(A)
1405+
@deprecate big(A::Base.LinAlg.UnitLowerTriangular) big.(A)
1406+
@deprecate big(A::Base.LinAlg.UnitUpperTriangular) big.(A)
1407+
@deprecate big(B::Bidiagonal) big.(B)
1408+
@deprecate big{T<:Integer,N}(A::AbstractArray{Complex{T},N}) big.(A)
1409+
@deprecate big{T<:AbstractFloat,N}(A::AbstractArray{Complex{T},N}) big.(A)
1410+
@deprecate big{T<:Integer,N}(x::AbstractArray{Complex{Rational{T}},N}) big.(A)
1411+
1412+
# Deprecate manually vectorized div methods in favor of compact broadcast syntax
1413+
@deprecate div(A::Number, B::AbstractArray) div.(A, B)
1414+
@deprecate div(A::AbstractArray, B::Number) div.(A, B)
1415+
@deprecate div(A::AbstractArray, B::AbstractArray) div.(A, B)
1416+
1417+
# Deprecate manually vectorized rem methods in favor of compact broadcast syntax
1418+
@deprecate rem(A::Number, B::AbstractArray) rem.(A, B)
1419+
@deprecate rem(A::AbstractArray, B::Number) rem.(A, B)
1420+
1421+
# Deprecate manually vectorized mod methods in favor of compact broadcast syntax
1422+
@deprecate mod(B::BitArray, x::Bool) mod.(B, x)
1423+
@deprecate mod(x::Bool, B::BitArray) mod.(x, B)
1424+
@deprecate mod(A::AbstractArray, B::AbstractArray) mod.(A, B)
1425+
@deprecate mod{T}(x::Number, A::AbstractArray{T}) mod.(x, A)
1426+
@deprecate mod{T}(A::AbstractArray{T}, x::Number) mod.(A, x)
1427+
1428+
# Deprecate vectorized & in favor of dot syntax
1429+
@deprecate (&)(a::Bool, B::BitArray) a .& B
1430+
@deprecate (&)(A::BitArray, b::Bool) A .& b
1431+
@deprecate (&)(a::Number, B::AbstractArray) a .& B
1432+
@deprecate (&)(A::AbstractArray, b::Number) A .& b
1433+
@deprecate (&)(A::AbstractArray, B::AbstractArray) A .& B
1434+
1435+
# Deprecate vectorized | in favor of compact broadcast syntax
1436+
@deprecate (|)(a::Bool, B::BitArray) a .| B
1437+
@deprecate (|)(A::BitArray, b::Bool) A .| b
1438+
@deprecate (|)(a::Number, B::AbstractArray) a .| B
1439+
@deprecate (|)(A::AbstractArray, b::Number) A .| b
1440+
@deprecate (|)(A::AbstractArray, B::AbstractArray) A .| B
1441+
13531442
# End deprecations scheduled for 0.6

base/dft.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ plan_irfft
354354

355355
export fftshift, ifftshift
356356

357-
fftshift(x) = circshift(x, div([size(x)...],2))
357+
fftshift(x) = circshift(x, div.([size(x)...],2))
358358

359359
"""
360360
fftshift(x)
@@ -376,7 +376,7 @@ Swap the first and second halves of the given dimension of array `x`.
376376
"""
377377
fftshift(x,dim)
378378

379-
ifftshift(x) = circshift(x, div([size(x)...],-2))
379+
ifftshift(x) = circshift(x, div.([size(x)...],-2))
380380

381381
"""
382382
ifftshift(x, [dim])

base/dsp.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ function conv{T<:Base.LinAlg.BlasFloat}(u::StridedVector{T}, v::StridedVector{T}
141141
end
142142
return y[1:n]
143143
end
144-
conv{T<:Integer}(u::StridedVector{T}, v::StridedVector{T}) = round(Int,conv(float(u), float(v)))
144+
conv{T<:Integer}(u::StridedVector{T}, v::StridedVector{T}) = round.(Int,conv(float(u), float(v)))
145145
conv{T<:Integer, S<:Base.LinAlg.BlasFloat}(u::StridedVector{T}, v::StridedVector{S}) = conv(float(u), v)
146146
conv{T<:Integer, S<:Base.LinAlg.BlasFloat}(u::StridedVector{S}, v::StridedVector{T}) = conv(u, float(v))
147147

@@ -184,8 +184,8 @@ function conv2{T}(A::StridedMatrix{T}, B::StridedMatrix{T})
184184
end
185185
return C
186186
end
187-
conv2{T<:Integer}(A::StridedMatrix{T}, B::StridedMatrix{T}) = round(Int,conv2(float(A), float(B)))
188-
conv2{T<:Integer}(u::StridedVector{T}, v::StridedVector{T}, A::StridedMatrix{T}) = round(Int,conv2(float(u), float(v), float(A)))
187+
conv2{T<:Integer}(A::StridedMatrix{T}, B::StridedMatrix{T}) = round.(Int,conv2(float(A), float(B)))
188+
conv2{T<:Integer}(u::StridedVector{T}, v::StridedVector{T}, A::StridedMatrix{T}) = round.(Int,conv2(float(u), float(v), float(A)))
189189

190190
"""
191191
xcorr(u,v)

base/float.jl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ function float{T}(A::AbstractArray{T})
735735
convert(AbstractArray{typeof(float(zero(T)))}, A)
736736
end
737737

738-
for fn in (:float,:big)
738+
for fn in (:float,)
739739
@eval begin
740740
$fn(r::StepRange) = $fn(r.start):$fn(r.step):$fn(last(r))
741741
$fn(r::UnitRange) = $fn(r.start):$fn(last(r))
@@ -748,5 +748,13 @@ for fn in (:float,:big)
748748
end
749749
end
750750

751-
big{T<:AbstractFloat,N}(x::AbstractArray{T,N}) = convert(AbstractArray{BigFloat,N}, x)
752-
big{T<:Integer,N}(x::AbstractArray{T,N}) = convert(AbstractArray{BigInt,N}, x)
751+
# big, broadcast over arrays
752+
# TODO: do the definitions below primarily pertaining to integers belong in float.jl?
753+
function big end # no prior definitions of big in sysimg.jl, necessitating this
754+
broadcast(::typeof(big), r::UnitRange) = big(r.start):big(last(r))
755+
broadcast(::typeof(big), r::StepRange) = big(r.start):big(r.step):big(last(r))
756+
broadcast(::typeof(big), r::FloatRange) = FloatRange(big(r.start), big(r.step), r.len, big(r.divisor))
757+
function broadcast(::typeof(big), r::LinSpace)
758+
big(r.len) == r.len || throw(ArgumentError(string(r, ": too long for ", big)))
759+
LinSpace(big(r.start), big(r.stop), big(r.len), big(r.divisor))
760+
end

base/floatfuncs.jl

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -112,49 +112,6 @@ function round(x::AbstractFloat, ::RoundingMode{:NearestTiesUp})
112112
end
113113
round{T<:Integer}(::Type{T}, x::AbstractFloat, r::RoundingMode) = trunc(T,round(x,r))
114114

115-
for f in (:trunc,:floor,:ceil,:round)
116-
@eval begin
117-
function ($f){T,R}(::Type{T}, x::AbstractArray{R,1})
118-
[ ($f)(T, y)::T for y in x ]
119-
end
120-
function ($f){T,R}(::Type{T}, x::AbstractArray{R,2})
121-
[ ($f)(T, x[i,j])::T for i = 1:size(x,1), j = 1:size(x,2) ]
122-
end
123-
function ($f){T}(::Type{T}, x::AbstractArray)
124-
reshape([ ($f)(T, y)::T for y in x ], size(x))
125-
end
126-
function ($f){R}(x::AbstractArray{R,1}, digits::Integer, base::Integer=10)
127-
[ ($f)(y, digits, base) for y in x ]
128-
end
129-
function ($f){R}(x::AbstractArray{R,2}, digits::Integer, base::Integer=10)
130-
[ ($f)(x[i,j], digits, base) for i = 1:size(x,1), j = 1:size(x,2) ]
131-
end
132-
function ($f)(x::AbstractArray, digits::Integer, base::Integer=10)
133-
reshape([ ($f)(y, digits, base) for y in x ], size(x))
134-
end
135-
end
136-
end
137-
138-
function round{R}(x::AbstractArray{R,1}, r::RoundingMode)
139-
[ round(y, r) for y in x ]
140-
end
141-
function round{R}(x::AbstractArray{R,2}, r::RoundingMode)
142-
[ round(x[i,j], r) for i = 1:size(x,1), j = 1:size(x,2) ]
143-
end
144-
function round(x::AbstractArray, r::RoundingMode)
145-
reshape([ round(y, r) for y in x ], size(x))
146-
end
147-
148-
function round{T,R}(::Type{T}, x::AbstractArray{R,1}, r::RoundingMode)
149-
[ round(T, y, r)::T for y in x ]
150-
end
151-
function round{T,R}(::Type{T}, x::AbstractArray{R,2}, r::RoundingMode)
152-
[ round(T, x[i,j], r)::T for i = 1:size(x,1), j = 1:size(x,2) ]
153-
end
154-
function round{T}(::Type{T}, x::AbstractArray, r::RoundingMode)
155-
reshape([ round(T, y, r)::T for y in x ], size(x))
156-
end
157-
158115
# adapted from Matlab File Exchange roundsd: http://www.mathworks.com/matlabcentral/fileexchange/26212
159116
# for round, og is the power of 10 relative to the decimal point
160117
# for signif, og is the absolute power of 10

base/linalg/bidiag.jl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ convert{Tnew,Told}(::Type{Bidiagonal{Tnew}}, A::Bidiagonal{Told}) = Bidiagonal(c
211211
# When asked to convert Bidiagonal{Told} to AbstractMatrix{Tnew}, preserve structure by converting to Bidiagonal{Tnew} <: AbstractMatrix{Tnew}
212212
convert{Tnew,Told}(::Type{AbstractMatrix{Tnew}}, A::Bidiagonal{Told}) = convert(Bidiagonal{Tnew}, A)
213213

214-
big(B::Bidiagonal) = Bidiagonal(big(B.dv), big(B.ev), B.isupper)
214+
broadcast(::typeof(big), B::Bidiagonal) = Bidiagonal(big.(B.dv), big.(B.ev), B.isupper)
215215

216216
similar{T}(B::Bidiagonal, ::Type{T}) = Bidiagonal{T}(similar(B.dv, T), similar(B.ev, T), B.isupper)
217217

@@ -253,12 +253,17 @@ end
253253

254254
#Elementary operations
255255
broadcast(::typeof(abs), M::Bidiagonal) = Bidiagonal(abs.(M.dv), abs.(M.ev), abs.(M.isupper))
256-
for func in (:conj, :copy, :round, :trunc, :floor, :ceil, :real, :imag)
256+
broadcast(::typeof(round), M::Bidiagonal) = Bidiagonal(round.(M.dv), round.(M.ev), M.isupper)
257+
broadcast(::typeof(trunc), M::Bidiagonal) = Bidiagonal(trunc.(M.dv), trunc.(M.ev), M.isupper)
258+
broadcast(::typeof(floor), M::Bidiagonal) = Bidiagonal(floor.(M.dv), floor.(M.ev), M.isupper)
259+
broadcast(::typeof(ceil), M::Bidiagonal) = Bidiagonal(ceil.(M.dv), ceil.(M.ev), M.isupper)
260+
for func in (:conj, :copy, :real, :imag)
257261
@eval ($func)(M::Bidiagonal) = Bidiagonal(($func)(M.dv), ($func)(M.ev), M.isupper)
258262
end
259-
for func in (:round, :trunc, :floor, :ceil)
260-
@eval ($func){T<:Integer}(::Type{T}, M::Bidiagonal) = Bidiagonal(($func)(T,M.dv), ($func)(T,M.ev), M.isupper)
261-
end
263+
broadcast{T<:Integer}(::typeof(round), ::Type{T}, M::Bidiagonal) = Bidiagonal(round.(T, M.dv), round.(T, M.ev), M.isupper)
264+
broadcast{T<:Integer}(::typeof(trunc), ::Type{T}, M::Bidiagonal) = Bidiagonal(trunc.(T, M.dv), trunc.(T, M.ev), M.isupper)
265+
broadcast{T<:Integer}(::typeof(floor), ::Type{T}, M::Bidiagonal) = Bidiagonal(floor.(T, M.dv), floor.(T, M.ev), M.isupper)
266+
broadcast{T<:Integer}(::typeof(ceil), ::Type{T}, M::Bidiagonal) = Bidiagonal(ceil.(T, M.dv), ceil.(T, M.ev), M.isupper)
262267

263268
transpose(M::Bidiagonal) = Bidiagonal(M.dv, M.ev, !M.isupper)
264269
ctranspose(M::Bidiagonal) = Bidiagonal(conj(M.dv), conj(M.ev), !M.isupper)

base/linalg/triangular.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ for t in (:LowerTriangular, :UnitLowerTriangular, :UpperTriangular,
3636

3737
copy(A::$t) = $t(copy(A.data))
3838

39-
big(A::$t) = $t(big(A.data))
39+
broadcast(::typeof(big), A::$t) = $t(big.(A.data))
4040

4141
real{T<:Real}(A::$t{T}) = A
4242
real{T<:Complex}(A::$t{T}) = (B = real(A.data); $t(B))

0 commit comments

Comments
 (0)