Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/settings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ Specify that linear systems `Ax = b` should be solved with a direct method.
struct DirectLinearSolver <: AbstractSolver end

function (solver::DirectLinearSolver)(
A::Union{AbstractMatrix,Factorization}, _Aᵀ, b::AbstractVector, x0::AbstractVector
A::Union{AbstractMatrix,Factorization,Number},
_Aᵀ,
b::AbstractVector,
x0::AbstractVector,
)
return A \ b
end
Expand Down
17 changes: 17 additions & 0 deletions test/systematic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@ using TestItems
test_implicit(scen)
test_implicit(scen2)
end

# Test for output vector of length 1
for (linear_solver, backends) in Iterators.product(
[DirectLinearSolver(), IterativeLinearSolver()],
[nothing, (; x=AutoForwardDiff(), y=AutoZygote())],
)
yield()
scen = Scenario(;
solver=x -> (sqrt.(x), nothing),
conditions=(x, y, z) -> y .^ 2 .- x,
x=[1.0],
implicit_kwargs=(; representation, linear_solver, backends),
)
scen2 = add_arg_mult(scen)
test_implicit(scen)
test_implicit(scen2)
end
end;

@testitem "Operator" setup = [TestUtils] begin
Expand Down