Skip to content

Commit b3a4d59

Browse files
yuyichaojrevels
authored andcommitted
Fix depwarn on 0.6 (#101)
Also change windows line end with unix ones and change tab indent to space.
1 parent 35eb6eb commit b3a4d59

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

REQUIRE

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

src/check_derivative.jl

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
function check_derivative(f::Function, g::Function, x::Number)
2-
auto_g = derivative(f)
3-
return maximum(abs(g(x) - auto_g(x)))
4-
end
5-
6-
function check_gradient{T <: Number}(f::Function, g::Function, x::Vector{T})
7-
auto_g = gradient(f)
8-
return maximum(abs(g(x) - auto_g(x)))
9-
end
10-
11-
function check_second_derivative(f::Function, h::Function, x::Number)
12-
auto_h = second_derivative(f)
13-
return maximum(abs(h(x) - auto_h(x)))
14-
end
15-
16-
function check_hessian{T <: Number}(f::Function, h::Function, x::Vector{T})
17-
auto_h = hessian(f)
18-
return maximum(abs(h(x) - auto_h(x)))
19-
end
1+
Compat.@compat function check_derivative(f::Function, g::Function, x::Number)
2+
auto_g = derivative(f)
3+
return maximum(abs.(g(x) - auto_g(x)))
4+
end
5+
6+
Compat.@compat function check_gradient{T <: Number}(f::Function, g::Function, x::Vector{T})
7+
auto_g = gradient(f)
8+
return maximum(abs.(g(x) - auto_g(x)))
9+
end
10+
11+
Compat.@compat function check_second_derivative(f::Function, h::Function, x::Number)
12+
auto_h = second_derivative(f)
13+
return maximum(abs.(h(x) - auto_h(x)))
14+
end
15+
16+
Compat.@compat function check_hessian{T <: Number}(f::Function, h::Function, x::Vector{T})
17+
auto_h = hessian(f)
18+
return maximum(abs.(h(x) - auto_h(x)))
19+
end

0 commit comments

Comments
 (0)