@@ -8,13 +8,13 @@ function derivative(f::Function, ftype::Symbol, dtype::Symbol)
88 end
99 return g
1010end
11- Compat. @compat 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, AbstractVector {T}} , dtype:: Symbol = :central ) = finite_difference (f, float (x), dtype)
1212derivative (f:: Function , dtype:: Symbol = :central ) = derivative (f, :scalar , dtype)
1313
14- Compat. @compat 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, AbstractVector {T}} , dtype:: Symbol = :central ) = finite_difference (f, float (x), dtype)
1515gradient (f:: Function , dtype:: Symbol = :central ) = derivative (f, :vector , dtype)
1616
17- Compat. @compat function Base. gradient {T <: Number} (f:: Function , x:: Union{T, Vector {T}} , dtype:: Symbol = :central )
17+ Compat. @compat function Base. gradient {T <: Number} (f:: Function , x:: Union{T, AbstractVector {T}} , dtype:: Symbol = :central )
1818 Base. warn_once (" The finite difference methods from Calculus.jl no longer extend Base.gradient and should be called as Calculus.gradient instead. This usage is deprecated." )
1919 Calculus. gradient (f,x,dtype)
2020end
2626
2727ctranspose (f:: Function ) = derivative (f)
2828
29- function jacobian {T <: Number} (f:: Function , x:: Vector {T} , dtype:: Symbol )
29+ function jacobian {T <: Number} (f:: Function , x:: AbstractVector {T} , dtype:: Symbol )
3030 finite_difference_jacobian (f, x, dtype)
3131end
3232function jacobian (f:: Function , dtype:: Symbol )
33- g (x:: Vector ) = finite_difference_jacobian (f, x, dtype)
33+ g (x:: AbstractVector ) = finite_difference_jacobian (f, x, dtype)
3434 return g
3535end
3636jacobian (f:: Function ) = jacobian (f, :central )
@@ -45,16 +45,16 @@ function second_derivative(f::Function, g::Function, ftype::Symbol, dtype::Symbo
4545 end
4646 return h
4747end
48- Compat. @compat function second_derivative {T <: Number} (f:: Function , g:: Function , x:: Union{T, Vector {T}} , dtype:: Symbol )
48+ Compat. @compat function second_derivative {T <: Number} (f:: Function , g:: Function , x:: Union{T, AbstractVector {T}} , dtype:: Symbol )
4949 finite_difference_hessian (f, g, x, dtype)
5050end
51- Compat. @compat function hessian {T <: Number} (f:: Function , g:: Function , x:: Union{T, Vector {T}} , dtype:: Symbol )
51+ Compat. @compat function hessian {T <: Number} (f:: Function , g:: Function , x:: Union{T, AbstractVector {T}} , dtype:: Symbol )
5252 finite_difference_hessian (f, g, x, dtype)
5353end
54- Compat. @compat function second_derivative {T <: Number} (f:: Function , g:: Function , x:: Union{T, Vector {T}} )
54+ Compat. @compat function second_derivative {T <: Number} (f:: Function , g:: Function , x:: Union{T, AbstractVector {T}} )
5555 finite_difference_hessian (f, g, x, :central )
5656end
57- Compat. @compat function hessian {T <: Number} (f:: Function , g:: Function , x:: Union{T, Vector {T}} )
57+ Compat. @compat function hessian {T <: Number} (f:: Function , g:: Function , x:: Union{T, AbstractVector {T}} )
5858 finite_difference_hessian (f, g, x, :central )
5959end
6060function second_derivative (f:: Function , x:: Number , dtype:: Symbol )
6363function hessian (f:: Function , x:: Number , dtype:: Symbol )
6464 finite_difference_hessian (f, derivative (f), x, dtype)
6565end
66- function second_derivative {T <: Number} (f:: Function , x:: Vector {T} , dtype:: Symbol )
66+ function second_derivative {T <: Number} (f:: Function , x:: AbstractVector {T} , dtype:: Symbol )
6767 finite_difference_hessian (f, gradient (f), x, dtype)
6868end
69- function hessian {T <: Number} (f:: Function , x:: Vector {T} , dtype:: Symbol )
69+ function hessian {T <: Number} (f:: Function , x:: AbstractVector {T} , dtype:: Symbol )
7070 finite_difference_hessian (f, gradient (f), x, dtype)
7171end
7272function second_derivative (f:: Function , x:: Number )
7575function hessian (f:: Function , x:: Number )
7676 finite_difference_hessian (f, derivative (f), x, :central )
7777end
78- function second_derivative {T <: Number} (f:: Function , x:: Vector {T} )
78+ function second_derivative {T <: Number} (f:: Function , x:: AbstractVector {T} )
7979 finite_difference_hessian (f, gradient (f), x, :central )
8080end
81- function hessian {T <: Number} (f:: Function , x:: Vector {T} )
81+ function hessian {T <: Number} (f:: Function , x:: AbstractVector {T} )
8282 finite_difference_hessian (f, gradient (f), x, :central )
8383end
8484second_derivative (f:: Function , g:: Function , dtype:: Symbol ) = second_derivative (f, g, :scalar , dtype)
0 commit comments