@@ -1424,17 +1424,19 @@ end
1424
1424
1425
1425
function _solve_adjoint (prob, sensealg, u0, p, originator, args... ; merge_callbacks = true ,
1426
1426
kwargs... )
1427
- _prob = if haskey (kwargs, :alg ) && (isempty (args) || args[1 ] === nothing )
1427
+ alg, _prob = if haskey (kwargs, :alg ) && (isempty (args) || args[1 ] === nothing )
1428
1428
alg = kwargs[:alg ]
1429
- get_concrete_problem (prob, isadaptive (alg); u0 = u0, p = p, kwargs... )
1429
+ alg, get_concrete_problem (prob, isadaptive (alg); u0 = u0, p = p, kwargs... )
1430
1430
elseif ! isempty (args) && typeof (args[1 ]) <: DEAlgorithm
1431
1431
alg = args[1 ]
1432
- get_concrete_problem (prob, isadaptive (alg); u0 = u0, p = p, kwargs... )
1432
+ alg, get_concrete_problem (prob, isadaptive (alg); u0 = u0, p = p, kwargs... )
1433
1433
elseif isempty (args) # Default algorithm handling
1434
- get_concrete_problem (prob, ! (typeof (prob) <: DiscreteProblem ); u0 = u0, p = p,
1434
+ alg = ! (typeof (prob) <: DiscreteProblem )
1435
+ alg, get_concrete_problem (prob, alg; u0 = u0, p = p,
1435
1436
kwargs... )
1436
1437
else
1437
- get_concrete_problem (prob, ! (typeof (prob) <: DiscreteProblem ); u0 = u0, p = p,
1438
+ alg = ! (typeof (prob) <: DiscreteProblem )
1439
+ alg, get_concrete_problem (prob, alg; u0 = u0, p = p,
1438
1440
kwargs... )
1439
1441
end
1440
1442
@@ -1460,17 +1462,19 @@ end
1460
1462
1461
1463
function _solve_forward (prob, sensealg, u0, p, originator, args... ; merge_callbacks = true ,
1462
1464
kwargs... )
1463
- _prob = if haskey (kwargs, :alg ) && (isempty (args) || args[1 ] === nothing )
1465
+ alg, _prob = if haskey (kwargs, :alg ) && (isempty (args) || args[1 ] === nothing )
1464
1466
alg = kwargs[:alg ]
1465
- get_concrete_problem (prob, isadaptive (alg); u0 = u0, p = p, kwargs... )
1467
+ alg, get_concrete_problem (prob, isadaptive (alg); u0 = u0, p = p, kwargs... )
1466
1468
elseif ! isempty (args) && typeof (args[1 ]) <: DEAlgorithm
1467
1469
alg = args[1 ]
1468
- get_concrete_problem (prob, isadaptive (alg); u0 = u0, p = p, kwargs... )
1470
+ alg, get_concrete_problem (prob, isadaptive (alg); u0 = u0, p = p, kwargs... )
1469
1471
elseif isempty (args) # Default algorithm handling
1470
- get_concrete_problem (prob, ! (typeof (prob) <: DiscreteProblem ); u0 = u0, p = p,
1472
+ alg = ! (typeof (prob) <: DiscreteProblem )
1473
+ alg, get_concrete_problem (prob, alg; u0 = u0, p = p,
1471
1474
kwargs... )
1472
1475
else
1473
- get_concrete_problem (prob, ! (typeof (prob) <: DiscreteProblem ); u0 = u0, p = p,
1476
+ alg = ! (typeof (prob) <: DiscreteProblem )
1477
+ alg, get_concrete_problem (prob, alg; u0 = u0, p = p,
1474
1478
kwargs... )
1475
1479
end
1476
1480
@@ -1487,10 +1491,10 @@ function _solve_forward(prob, sensealg, u0, p, originator, args...; merge_callba
1487
1491
end
1488
1492
1489
1493
if isempty (args)
1490
- _concrete_solve_forward (prob, nothing , sensealg, u0, p; kwargs... )
1494
+ _concrete_solve_forward (_prob, alg , sensealg, u0, p, originator ; kwargs... )
1491
1495
else
1492
- _concrete_solve_forward (prob, args[ 1 ] , sensealg, u0, p, Base . tail (args) ... ;
1493
- kwargs... )
1496
+ _concrete_solve_forward (_prob, alg , sensealg, u0, p, originator,
1497
+ Base . tail (args) ... ; kwargs... )
1494
1498
end
1495
1499
end
1496
1500
0 commit comments