Skip to content

Commit

Permalink
fix conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
Thore Kockerols committed Jul 29, 2024
1 parent f0a96c5 commit aaad8a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
8 changes: 2 additions & 6 deletions src/lyapunov.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@ function solve_lyapunov_equation(A::AbstractMatrix{Float64},
if A isa AbstractSparseMatrix
if length(A.nzval) / length(A) > .1 || lyapunov_algorithm == :lyapunov
A = collect(A)
end

if VERSION >= v"1.9"
elseif VERSION >= v"1.9"
A = ThreadedSparseArrays.ThreadedSparseMatrixCSC(A)
end
end

if C isa AbstractSparseMatrix
if length(C.nzval) / length(C) > .1 || lyapunov_algorithm == :lyapunov
C = collect(C)
end

if VERSION >= v"1.9"
elseif VERSION >= v"1.9"
C = ThreadedSparseArrays.ThreadedSparseMatrixCSC(C)
end
end
Expand Down
12 changes: 3 additions & 9 deletions src/sylvester.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,23 @@ function solve_sylvester_equation(A::AbstractMatrix{Float64},
if A isa AbstractSparseMatrix
if length(A.nzval) / length(A) > .1 || sylvester_algorithm == :sylvester
A = collect(A)
end

if VERSION >= v"1.9"
elseif VERSION >= v"1.9"
A = ThreadedSparseArrays.ThreadedSparseMatrixCSC(A)
end
end

if B isa AbstractSparseMatrix
if length(B.nzval) / length(B) > .1 || sylvester_algorithm == :sylvester
B = collect(B)
end

if VERSION >= v"1.9"
elseif VERSION >= v"1.9"
B = ThreadedSparseArrays.ThreadedSparseMatrixCSC(B)
end
end

if C isa AbstractSparseMatrix
if length(C.nzval) / length(C) > .1 || sylvester_algorithm == :sylvester
C = collect(C)
end

if VERSION >= v"1.9"
elseif VERSION >= v"1.9"
C = ThreadedSparseArrays.ThreadedSparseMatrixCSC(C)
end
end
Expand Down

0 comments on commit aaad8a6

Please sign in to comment.