Skip to content

Commit

Permalink
add sylvester solver
Browse files Browse the repository at this point in the history
  • Loading branch information
thorek1 committed Oct 3, 2023
1 parent 2ffda18 commit 8b0256d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/MacroModelling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4475,9 +4475,12 @@ function solve_matrix_equation_forward(ABC::Vector{Float64};
iter += 1
end
solved = change < eps(Float32)
elseif solver == :sylvester
𝐂 = sylvd(collect(-A),collect(B),-C)
solved = isapprox(𝐂, A * 𝐂 * B - C, rtol = eps(Float32))
elseif solver == :lyapunov
𝐂 = MatrixEquations.lyapd(A,-C)
solved = isapprox(𝐂, A * (-C) * A' + -C, rtol = eps(Float32))
solved = isapprox(𝐂, A * 𝐂 * A' - C, rtol = eps(Float32))
elseif solver == :speedmapping
soll = speedmapping(collect(-C); m! = (X, x) -> X .= A * x * B - C, stabilize = true)

Expand Down

0 comments on commit 8b0256d

Please sign in to comment.