diff --git a/src/algorithms/quadratic_matrix_equation.jl b/src/algorithms/quadratic_matrix_equation.jl index 3ed25dbe..4e38f5e3 100644 --- a/src/algorithms/quadratic_matrix_equation.jl +++ b/src/algorithms/quadratic_matrix_equation.jl @@ -45,16 +45,28 @@ function solve_quadratic_matrix_equation(A::AbstractMatrix{R}, if verbose println("Quadratic matrix equation solver: $quadratic_matrix_equation_solver - converged: $solved in $iterations iterations to tolerance: $reached_tol") end - if !solved && quadratic_matrix_equation_solver ≠ :schur # try schur if previous one didn't solve it - sol, solved, iterations, reached_tol = solve_quadratic_matrix_equation(A, B, C, - Val(:schur), - T; - initial_guess = initial_guess, - tol = tol, - timer = timer, - verbose = verbose) - - if verbose println("Quadratic matrix equation solver: schur - converged: $solved in $iterations iterations to tolerance: $reached_tol") end + if !solved + if quadratic_matrix_equation_solver ≠ :schur # try schur if previous one didn't solve it + sol, solved, iterations, reached_tol = solve_quadratic_matrix_equation(A, B, C, + Val(:schur), + T; + initial_guess = initial_guess, + tol = tol, + timer = timer, + verbose = verbose) + + if verbose println("Quadratic matrix equation solver: schur - converged: $solved in $iterations iterations to tolerance: $reached_tol") end + else quadratic_matrix_equation_solver ≠ :doubling + sol, solved, iterations, reached_tol = solve_quadratic_matrix_equation(A, B, C, + Val(:doubling), + T; + initial_guess = initial_guess, + tol = tol, + timer = timer, + verbose = verbose) + + if verbose println("Quadratic matrix equation solver: doubling - converged: $solved in $iterations iterations to tolerance: $reached_tol") end + end end return sol, solved