Skip to content

Commit 35eb6eb

Browse files
authored
update deprecated Array constructor for Julia v0.6 (drops v0.3 support) (#98)
* update deprecated Array constructor for Julia v0.6 * drop Julia v0.3 support
1 parent 97fe2d8 commit 35eb6eb

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ os:
33
- linux
44
- osx
55
julia:
6-
- 0.3
76
- 0.4
87
- 0.5
98
- nightly

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
julia 0.3.7
1+
julia 0.4
22
Compat 0.4.0

src/differentiate.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ end
7979
# d/dx (f * g * h) = (d/dx f) * g * h + f * (d/dx g) * h + ...
8080
function differentiate(::SymbolParameter{:*}, args, wrt)
8181
n = length(args)
82-
res_args = Array(Any, n)
82+
res_args = Vector{Any}(n)
8383
for i in 1:n
84-
new_args = Array(Any, n)
84+
new_args = Vector{Any}(n)
8585
for j in 1:n
8686
if j == i
8787
new_args[j] = differentiate(args[j], wrt)
@@ -203,7 +203,7 @@ export symbolic_derivatives_1arg
203203

204204
# deprecated: for backward compatibility with packages that used
205205
# this unexported interface.
206-
derivative_rules = Array(@Compat.compat(Tuple{Symbol,Expr}),0)
206+
derivative_rules = Vector{Compat.@compat(Tuple{Symbol,Expr})}(0)
207207
for (s,ex) in symbolic_derivative_1arg_list
208208
push!(derivative_rules, (s, :(xp*$ex)))
209209
end
@@ -270,7 +270,7 @@ end
270270

271271
function differentiate(ex::Expr, targets::Vector{Symbol})
272272
n = length(targets)
273-
exprs = Array(Any, n)
273+
exprs = Vector{Any}(n)
274274
for i in 1:n
275275
exprs[i] = differentiate(ex, targets[i])
276276
end

src/finite_difference.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ function finite_difference{T <: Number}(f::Function,
139139
x::Vector{T},
140140
dtype::Symbol = :central)
141141
# Allocate memory for gradient
142-
g = Array(Float64, length(x))
142+
g = Vector{Float64}(length(x))
143143

144144
# Mutate allocated gradient
145145
finite_difference!(f, float(x), g, dtype)
@@ -270,7 +270,7 @@ function finite_difference_hessian{T <: Number}(f::Function,
270270
n = length(x)
271271

272272
# Allocate an empty Hessian
273-
H = Array(Float64, n, n)
273+
H = Matrix{Float64}(n, n)
274274

275275
# Mutate the allocated Hessian
276276
finite_difference_hessian!(f, x, H)

0 commit comments

Comments
 (0)