@@ -8,10 +8,10 @@ function derivative(f::Function, ftype::Symbol, dtype::Symbol)
88 end
99 return g
1010end
11- derivative {T <: Number} (f:: Function , x:: Union( T, Vector{T}) , dtype:: Symbol = :central ) = finite_difference (f, float (x), dtype)
11+ Compat . @compat derivative {T <: Number} (f:: Function , x:: Union{ T, Vector{T}} , dtype:: Symbol = :central ) = finite_difference (f, float (x), dtype)
1212derivative (f:: Function , dtype:: Symbol = :central ) = derivative (f, :scalar , dtype)
1313
14- gradient {T <: Number} (f:: Function , x:: Union( T, Vector{T}) , dtype:: Symbol = :central ) = finite_difference (f, float (x), dtype)
14+ Compat . @compat gradient {T <: Number} (f:: Function , x:: Union{ T, Vector{T}} , dtype:: Symbol = :central ) = finite_difference (f, float (x), dtype)
1515gradient (f:: Function , dtype:: Symbol = :central ) = derivative (f, :vector , dtype)
1616
1717ctranspose (f:: Function ) = derivative (f)
@@ -35,16 +35,16 @@ function second_derivative(f::Function, g::Function, ftype::Symbol, dtype::Symbo
3535 end
3636 return h
3737end
38- function second_derivative {T <: Number} (f:: Function , g:: Function , x:: Union( T, Vector{T}) , dtype:: Symbol )
38+ Compat . @compat function second_derivative {T <: Number} (f:: Function , g:: Function , x:: Union{ T, Vector{T}} , dtype:: Symbol )
3939 finite_difference_hessian (f, g, x, dtype)
4040end
41- function hessian {T <: Number} (f:: Function , g:: Function , x:: Union( T, Vector{T}) , dtype:: Symbol )
41+ Compat . @compat function hessian {T <: Number} (f:: Function , g:: Function , x:: Union{ T, Vector{T}} , dtype:: Symbol )
4242 finite_difference_hessian (f, g, x, dtype)
4343end
44- function second_derivative {T <: Number} (f:: Function , g:: Function , x:: Union( T, Vector{T}) )
44+ Compat . @compat function second_derivative {T <: Number} (f:: Function , g:: Function , x:: Union{ T, Vector{T}} )
4545 finite_difference_hessian (f, g, x, :central )
4646end
47- function hessian {T <: Number} (f:: Function , g:: Function , x:: Union( T, Vector{T}) )
47+ Compat . @compat function hessian {T <: Number} (f:: Function , g:: Function , x:: Union{ T, Vector{T}} )
4848 finite_difference_hessian (f, g, x, :central )
4949end
5050function second_derivative (f:: Function , x:: Number , dtype:: Symbol )
0 commit comments