Skip to content

Commit 0460d1d

Browse files
committed
Minor enhancements
1 parent 2e84bf2 commit 0460d1d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/check_derivative.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
function check_derivative(f::Function, g::Function, x::Number)
22
auto_g = derivative(f)
3-
return max(abs(g(x) - auto_g(x)))
3+
return maximum(abs(g(x) - auto_g(x)))
44
end
55

66
function check_gradient{T <: Number}(f::Function, g::Function, x::Vector{T})
77
auto_g = gradient(f)
8-
return max(abs(g(x) - auto_g(x)))
8+
return maximum(abs(g(x) - auto_g(x)))
99
end
1010

1111
function check_second_derivative(f::Function, h::Function, x::Number)
1212
auto_h = second_derivative(f)
13-
return max(abs(h(x) - auto_h(x)))
13+
return maximum(abs(h(x) - auto_h(x)))
1414
end
1515

1616
function check_hessian{T <: Number}(f::Function, h::Function, x::Vector{T})
1717
auto_h = hessian(f)
18-
return max(abs(h(x) - auto_h(x)))
18+
return maximum(abs(h(x) - auto_h(x)))
1919
end

src/deparse.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function deparse(ex::Expr)
1111
op = ex.args[1]
1212
args = ex.args[2:end]
1313
if !(op in infix_ops)
14-
return string(op, "(", join(map(x -> deparse(x), args), ", "), ")")
14+
return string(op, "(", join(map(deparse, args), ", "), ")")
1515
end
1616
if length(args) == 1
1717
return string(op, deparse(args[1]))

0 commit comments

Comments
 (0)