Skip to content

Commit 615ad03

Browse files
Set jacobian of Fun to ZeroOperator (#909)
* jacobian of Fun is ZeroOperator * Decrease maxiterations for independent variable newton test
1 parent 74b6fe0 commit 615ad03

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
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(Operator(I,space(f)))
6565

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

test/ExtrasTest.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ include(joinpath(@__DIR__, "testutils.jl"))
123123
u2' - u2*u2;
124124
]
125125

126-
# note takes a few more iterations to converge to accuracy
127-
u1,u2 = newton(N_ind, [u1,u2], maxiterations=25)
126+
u1,u2 = newton(N_ind, [u1,u2])
128127

129128
u1_exact = -1 / (x - 2)
130129
u2_exact = -1 / (x + 2)

0 commit comments

Comments
 (0)