Skip to content

Commit 0eb07ac

Browse files
committed
fixed jacobian(f::Fun)
Test case (requires also JuliaApproximation/ApproxFunBase.jl#479): using ApproxFun xdom = Chebyshev(-1..1) ydom = Chebyshev(-1..1) domain = xdom * ydom x,y = Fun(identity, domain) Dx = Derivative(Chebyshev()^2, [1,0]) Dy = Derivative(Chebyshev()^2, [0,1]) N(u, v) = [ 2*u - x; 3*v + y ] u0 = one(x) * one(y) v0 = one(x) * one(y) u, v = newton(N, [u0, v0]) Bug report: JuliaApproximation#887
1 parent fe4a3ed commit 0eb07ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Extras/autodifferentiation.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ last(d::DualFun) = DualFun(last(d.f),Evaluation(rangespace(d.J),rightendpoint)*d
6161

6262
jacobian(d::DualFun) = d.J
6363
jacobian(a::Number) = zero(a)
64-
jacobian(f::Fun) = Operator(I,space(f))
64+
jacobian(f::Fun) = zero(f)
6565

6666
promote_rule(::Type{DF},::Type{T}) where {DF<:DualFun,T<:Number}=DualFun
6767
convert(::Type{DualFun},b::Number) = DualFun(b,0)

0 commit comments

Comments
 (0)