Skip to content

Commit

Permalink
fixed jacobian(f::Fun)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dstahlke committed Jun 12, 2023
1 parent fe4a3ed commit 0eb07ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Extras/autodifferentiation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ last(d::DualFun) = DualFun(last(d.f),Evaluation(rangespace(d.J),rightendpoint)*d

jacobian(d::DualFun) = d.J
jacobian(a::Number) = zero(a)
jacobian(f::Fun) = Operator(I,space(f))
jacobian(f::Fun) = zero(f)

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

0 comments on commit 0eb07ac

Please sign in to comment.