|
54 | 54 |
|
55 | 55 | @testitem "NewtonRaphson" setup=[CoreRootfindTesting] tags=[:core] begin
|
56 | 56 | @testset "LineSearch: $(_nameof(lsmethod)) LineSearch AD: $(_nameof(ad))" for lsmethod in (
|
57 |
| - Static(), StrongWolfe(), BackTracking(), HagerZhang(), MoreThuente()), |
| 57 | + Static(), StrongWolfe(), BackTracking(), |
| 58 | + LineSearch.BackTracking, HagerZhang(), MoreThuente()), |
58 | 59 | ad in (AutoForwardDiff(), AutoZygote(), AutoFiniteDiff())
|
59 | 60 |
|
| 61 | + linesearch = if !(lsmethod isa LineSearch.AbstractLineSearchAlgorithm) |
| 62 | + LineSearchesJL(; method = lsmethod, autodiff = ad) |
| 63 | + elseif lsmethod <: LineSearch.AbstractLineSearchAlgorithm |
| 64 | + lsmethod(; autodiff = ad) |
| 65 | + else |
| 66 | + lsmethod |
| 67 | + end |
| 68 | + |
60 | 69 | linesearch = LineSearchesJL(; method = lsmethod, autodiff = ad)
|
61 | 70 | u0s = ([1.0, 1.0], @SVector[1.0, 1.0], 1.0)
|
62 | 71 |
|
@@ -464,13 +473,19 @@ end
|
464 | 473 |
|
465 | 474 | @testitem "Broyden" setup=[CoreRootfindTesting] tags=[:core] begin
|
466 | 475 | @testset "LineSearch: $(_nameof(lsmethod)) LineSearch AD: $(_nameof(ad)) Init Jacobian: $(init_jacobian) Update Rule: $(update_rule)" for lsmethod in (
|
467 |
| - Static(), StrongWolfe(), BackTracking(), |
| 476 | + Static(), StrongWolfe(), BackTracking(), LineSearch.BackTracking, |
468 | 477 | HagerZhang(), MoreThuente(), LiFukushimaLineSearch()),
|
469 | 478 | ad in (AutoForwardDiff(), AutoZygote(), AutoFiniteDiff()),
|
470 | 479 | init_jacobian in (Val(:identity), Val(:true_jacobian)),
|
471 | 480 | update_rule in (Val(:good_broyden), Val(:bad_broyden), Val(:diagonal))
|
472 | 481 |
|
473 |
| - linesearch = LineSearchesJL(; method = lsmethod, autodiff = ad) |
| 482 | + linesearch = if !(lsmethod isa LineSearch.AbstractLineSearchAlgorithm) |
| 483 | + LineSearchesJL(; method = lsmethod, autodiff = ad) |
| 484 | + elseif lsmethod <: LineSearch.AbstractLineSearchAlgorithm |
| 485 | + lsmethod(; autodiff = ad) |
| 486 | + else |
| 487 | + lsmethod |
| 488 | + end |
474 | 489 | u0s = ([1.0, 1.0], @SVector[1.0, 1.0], 1.0)
|
475 | 490 |
|
476 | 491 | @testset "[OOP] u0: $(typeof(u0))" for u0 in u0s
|
@@ -514,11 +529,18 @@ end
|
514 | 529 |
|
515 | 530 | @testitem "Klement" setup=[CoreRootfindTesting] tags=[:core] begin
|
516 | 531 | @testset "LineSearch: $(_nameof(lsmethod)) LineSearch AD: $(_nameof(ad)) Init Jacobian: $(init_jacobian)" for lsmethod in (
|
517 |
| - Static(), StrongWolfe(), BackTracking(), HagerZhang(), MoreThuente()), |
| 532 | + Static(), StrongWolfe(), BackTracking(), |
| 533 | + LineSearch.BackTracking, HagerZhang(), MoreThuente()), |
518 | 534 | ad in (AutoForwardDiff(), AutoZygote(), AutoFiniteDiff()),
|
519 | 535 | init_jacobian in (Val(:identity), Val(:true_jacobian), Val(:true_jacobian_diagonal))
|
520 | 536 |
|
521 |
| - linesearch = LineSearchesJL(; method = lsmethod, autodiff = ad) |
| 537 | + linesearch = if !(lsmethod isa LineSearch.AbstractLineSearchAlgorithm) |
| 538 | + LineSearchesJL(; method = lsmethod, autodiff = ad) |
| 539 | + elseif lsmethod <: LineSearch.AbstractLineSearchAlgorithm |
| 540 | + lsmethod(; autodiff = ad) |
| 541 | + else |
| 542 | + lsmethod |
| 543 | + end |
522 | 544 | u0s = ([1.0, 1.0], @SVector[1.0, 1.0], 1.0)
|
523 | 545 |
|
524 | 546 | @testset "[OOP] u0: $(typeof(u0))" for u0 in u0s
|
@@ -563,11 +585,17 @@ end
|
563 | 585 |
|
564 | 586 | @testitem "LimitedMemoryBroyden" setup=[CoreRootfindTesting] tags=[:core] begin
|
565 | 587 | @testset "LineSearch: $(_nameof(lsmethod)) LineSearch AD: $(_nameof(ad))" for lsmethod in (
|
566 |
| - Static(), StrongWolfe(), BackTracking(), |
| 588 | + Static(), StrongWolfe(), BackTracking(), LineSearch.BackTracking, |
567 | 589 | HagerZhang(), MoreThuente(), LiFukushimaLineSearch()),
|
568 | 590 | ad in (AutoForwardDiff(), AutoZygote(), AutoFiniteDiff())
|
569 | 591 |
|
570 |
| - linesearch = LineSearchesJL(; method = lsmethod, autodiff = ad) |
| 592 | + linesearch = if !(lsmethod isa LineSearch.AbstractLineSearchAlgorithm) |
| 593 | + LineSearchesJL(; method = lsmethod, autodiff = ad) |
| 594 | + elseif lsmethod <: LineSearch.AbstractLineSearchAlgorithm |
| 595 | + lsmethod(; autodiff = ad) |
| 596 | + else |
| 597 | + lsmethod |
| 598 | + end |
571 | 599 | u0s = ([1.0, 1.0], @SVector[1.0, 1.0], 1.0)
|
572 | 600 |
|
573 | 601 | @testset "[OOP] u0: $(typeof(u0))" for u0 in u0s
|
|
0 commit comments