@@ -34,14 +34,6 @@ mutable struct MArray{S <: Tuple, T, N, L} <: StaticArray{S, T, N}
34
34
check_array_parameters (S, T, Val{N}, Val{L})
35
35
new {S,T,N,L} ()
36
36
end
37
-
38
- @static if VERSION < v " 1.0"
39
- # deprecated empty constructor
40
- function MArray {S,T,N,L} () where {S,T,N,L}
41
- Base. depwarn (" `MArray{S,T,N,L}()` is deprecated, use `MArray{S,T,N,L}(undef)` instead" , :MArray )
42
- return MArray {S,T,N,L} (undef)
43
- end
44
- end
45
37
end
46
38
47
39
@generated function (:: Type{MArray{S,T,N}} )(x:: Tuple ) where {S,T,N}
65
57
end
66
58
end
67
59
68
- @static if VERSION < v " 1.0"
69
- function (:: Type{MArray{S,T,N}} )() where {S,T,N}
70
- Base. depwarn (" `MArray{S,T,N}()` is deprecated, use `MArray{S,T,N}(undef)` instead" , :MArray )
71
- return MArray {S,T,N} (undef)
72
- end
73
- end
74
60
@generated function (:: Type{MArray{S,T,N}} )(:: UndefInitializer ) where {S,T,N}
75
61
return quote
76
62
$ (Expr (:meta , :inline ))
77
63
MArray {S, T, N, $(tuple_prod(S))} (undef)
78
64
end
79
65
end
80
66
81
- @static if VERSION < v " 1.0"
82
- function (:: Type{MArray{S,T}} )() where {S,T}
83
- Base. depwarn (" `MArray{S,T}()` is deprecated, use `MArray{S,T}(undef)` instead" , :MArray )
84
- return MArray {S,T} (undef)
85
- end
86
- end
87
67
@generated function (:: Type{MArray{S,T}} )(:: UndefInitializer ) where {S,T}
88
68
return quote
89
69
$ (Expr (:meta , :inline ))
102
82
103
83
# MArray(I::UniformScaling) methods to replace eye
104
84
(:: Type{MA} )(I:: UniformScaling ) where {MA<: MArray } = _eye (Size (MA), MA, I)
105
- # deprecate eye, keep around for as long as LinearAlgebra.eye exists
106
- @static if isdefined (LinearAlgebra, :eye )
107
- @deprecate eye (:: Type{MArray{S}} ) where {S} MArray {S} (1.0 I)
108
- @deprecate eye (:: Type{MArray{S,T}} ) where {S,T} MArray {S,T} (I)
109
- end
110
85
111
86
# ###################
112
87
# # MArray methods ##
@@ -294,31 +269,6 @@ macro MArray(ex)
294
269
$ (esc (ex. args[1 ]))($ (esc (ex. args[2 ])), MArray{$ (esc (Expr (:curly , Tuple, ex. args[3 : end ]. .. )))})
295
270
end
296
271
end
297
- elseif ex. args[1 ] == :eye # deprecated
298
- if length (ex. args) == 2
299
- return quote
300
- Base. depwarn (" `@MArray eye(m)` is deprecated, use `MArray{m,m}(1.0I)` instead" , :eye )
301
- MArray {Tuple{$(esc(ex.args[2])), $(esc(ex.args[2]))},Float64} (I)
302
- end
303
- elseif length (ex. args) == 3
304
- # We need a branch, depending if the first argument is a type or a size.
305
- return quote
306
- if isa ($ (esc (ex. args[2 ])), DataType)
307
- Base. depwarn (" `@MArray eye(T, m)` is deprecated, use `MArray{m,m,T}(I)` instead" , :eye )
308
- MArray {Tuple{$(esc(ex.args[3])), $(esc(ex.args[3]))}, $(esc(ex.args[2]))} (I)
309
- else
310
- Base. depwarn (" `@MArray eye(m, n)` is deprecated, use `MArray{m,n}(1.0I)` instead" , :eye )
311
- MArray {Tuple{$(esc(ex.args[2])), $(esc(ex.args[3]))}, Float64} (I)
312
- end
313
- end
314
- elseif length (ex. args) == 4
315
- return quote
316
- Base. depwarn (" `@MArray eye(T, m, n)` is deprecated, use `MArray{m,n,T}(I)` instead" , :eye )
317
- MArray {Tuple{$(esc(ex.args[3])), $(esc(ex.args[4]))}, $(esc(ex.args[2]))} (I)
318
- end
319
- else
320
- error (" Bad eye() expression for @MArray" )
321
- end
322
272
else
323
273
error (" @MArray only supports the zeros(), ones(), rand(), randn(), and randexp() functions." )
324
274
end
0 commit comments