diff --git a/src/MacroModelling.jl b/src/MacroModelling.jl index cb90041d..d759197c 100644 --- a/src/MacroModelling.jl +++ b/src/MacroModelling.jl @@ -4086,7 +4086,7 @@ function calculate_second_order_stochastic_steady_state(parameters::Vector{M}, tol::AbstractFloat = 1e-12)::Tuple{Vector{M}, Bool, Vector{M}, M, AbstractMatrix{M}, SparseMatrixCSC{M}, AbstractMatrix{M}, SparseMatrixCSC{M}} where M # @timeit_debug timer "Calculate NSSS" begin - SS_and_pars, (solution_error, iters) = get_NSSS_and_parameters(𝓂, parameters, verbose = verbose, timer = timer) + SS_and_pars, (solution_error, iters) = get_NSSS_and_parameters(𝓂, parameters, verbose = verbose) # , timer = timer) # end # timeit_debug @@ -4133,8 +4133,8 @@ function calculate_second_order_stochastic_steady_state(parameters::Vector{M}, initial_guess = 𝓂.solution.perturbation.second_order_solution, # sylvester_algorithm = sylvester_algorithm, sylvester_algorithm = :doubling, # hard code doubling - verbose = verbose, - timer = timer) + # timer = timer, + verbose = verbose) if eltype(𝐒₂) == Float64 && solved2 𝓂.solution.perturbation.second_order_solution = 𝐒₂ end @@ -4179,7 +4179,7 @@ function calculate_second_order_stochastic_steady_state(parameters::Vector{M}, A = 𝐒₁[:,1:𝓂.timings.nPast_not_future_and_mixed] BΜ‚ = 𝐒₂[:,kron_s⁺_s⁺] - SSSstates, converged = calculate_second_order_stochastic_steady_state(Val(:Newton), 𝐒₁, 𝐒₂, SSSstates, 𝓂, timer = timer) + SSSstates, converged = calculate_second_order_stochastic_steady_state(Val(:Newton), 𝐒₁, 𝐒₂, SSSstates, 𝓂) # , timer = timer) if !converged if verbose println("SSS not found") end @@ -4419,7 +4419,7 @@ function calculate_third_order_stochastic_steady_state( parameters::Vector{M}, sylvester_algorithm::Symbol = :bicgstab, # timer::TimerOutput = TimerOutput(), tol::AbstractFloat = 1e-12)::Tuple{Vector{M}, Bool, Vector{M}, M, AbstractMatrix{M}, SparseMatrixCSC{M}, SparseMatrixCSC{M}, AbstractMatrix{M}, SparseMatrixCSC{M}, SparseMatrixCSC{M}} where M - SS_and_pars, (solution_error, iters) = get_NSSS_and_parameters(𝓂, parameters, verbose = verbose, timer = timer) + SS_and_pars, (solution_error, iters) = get_NSSS_and_parameters(𝓂, parameters, verbose = verbose) # , timer = timer) if solution_error > tol || isnan(solution_error) if verbose println("NSSS not found") end @@ -4450,9 +4450,9 @@ function calculate_third_order_stochastic_steady_state( parameters::Vector{M}, T = 𝓂.timings, tol = tol, initial_guess = 𝓂.solution.perturbation.second_order_solution, # sylvester_algorithm = sylvester_algorithm, - sylvester_algorithm = :doubling, # doubling will always be faster here - verbose= verbose, - timer = timer) + sylvester_algorithm = :doubling, # doubling will always be faster here + # timer = timer, + verbose= verbose) if !solved2 if verbose println("2nd order solution not found") end @@ -4465,7 +4465,7 @@ function calculate_third_order_stochastic_steady_state( parameters::Vector{M}, 𝐒₂ = sparse(𝐒₂) - βˆ‡β‚ƒ = calculate_third_order_derivatives(parameters, SS_and_pars, 𝓂, timer = timer)# * 𝓂.solution.perturbation.third_order_auxilliary_matrices.π”βˆ‡β‚ƒ + βˆ‡β‚ƒ = calculate_third_order_derivatives(parameters, SS_and_pars, 𝓂) #, timer = timer)# * 𝓂.solution.perturbation.third_order_auxilliary_matrices.π”βˆ‡β‚ƒ 𝐒₃, solved3 = calculate_third_order_solution(βˆ‡β‚, βˆ‡β‚‚, βˆ‡β‚ƒ, 𝐒₁, 𝐒₂, 𝓂.solution.perturbation.second_order_auxilliary_matrices, @@ -4474,8 +4474,8 @@ function calculate_third_order_stochastic_steady_state( parameters::Vector{M}, initial_guess = 𝓂.solution.perturbation.third_order_solution, sylvester_algorithm = sylvester_algorithm, tol = tol, - verbose = verbose, - timer = timer) + # timer = timer, + verbose = verbose) if !solved3 if verbose println("3rd order solution not found") end @@ -4853,7 +4853,7 @@ function solve!(𝓂::β„³; ((:third_order == algorithm) && ((:third_order ∈ 𝓂.solution.outdated_algorithms) || (obc && obc_not_solved))) - stochastic_steady_state, converged, SS_and_pars, solution_error, βˆ‡β‚, βˆ‡β‚‚, 𝐒₁, 𝐒₂ = calculate_second_order_stochastic_steady_state(𝓂.parameter_values, 𝓂, verbose = verbose, timer = timer) + stochastic_steady_state, converged, SS_and_pars, solution_error, βˆ‡β‚, βˆ‡β‚‚, 𝐒₁, 𝐒₂ = calculate_second_order_stochastic_steady_state(𝓂.parameter_values, 𝓂, verbose = verbose) # , timer = timer) if !converged @warn "Solution does not have a stochastic steady state. Try reducing shock sizes by multiplying them with a number < 1." end @@ -4886,7 +4886,7 @@ function solve!(𝓂::β„³; if ((:pruned_second_order == algorithm) && ((:pruned_second_order ∈ 𝓂.solution.outdated_algorithms) || (obc && obc_not_solved))) || ((:pruned_third_order == algorithm) && ((:pruned_third_order ∈ 𝓂.solution.outdated_algorithms) || (obc && obc_not_solved))) - stochastic_steady_state, converged, SS_and_pars, solution_error, βˆ‡β‚, βˆ‡β‚‚, 𝐒₁, 𝐒₂ = calculate_second_order_stochastic_steady_state(𝓂.parameter_values, 𝓂, verbose = verbose, pruning = true, timer = timer) + stochastic_steady_state, converged, SS_and_pars, solution_error, βˆ‡β‚, βˆ‡β‚‚, 𝐒₁, 𝐒₂ = calculate_second_order_stochastic_steady_state(𝓂.parameter_values, 𝓂, verbose = verbose, pruning = true) # , timer = timer) if !converged @warn "Solution does not have a stochastic steady state. Try reducing shock sizes by multiplying them with a number < 1." end @@ -6377,7 +6377,7 @@ end function rrule(::typeof(calculate_third_order_derivatives), parameters, SS_and_pars, 𝓂) # ; # timer::TimerOutput = TimerOutput()) # @timeit_debug timer "3rd order derivatives - forward" begin - third_order_derivatives = calculate_third_order_derivatives(parameters, SS_and_pars, 𝓂, timer = timer) + third_order_derivatives = calculate_third_order_derivatives(parameters, SS_and_pars, 𝓂) #, timer = timer) # end # timeit_debug function calculate_third_order_derivatives_pullback(βˆ‚βˆ‡β‚) @@ -7289,7 +7289,7 @@ function get_relevant_steady_state_and_state_update(::Val{:second_order}, verbose::Bool = false) where S <: Real sss, converged, SS_and_pars, solution_error, βˆ‡β‚, βˆ‡β‚‚, 𝐒₁, 𝐒₂ = calculate_second_order_stochastic_steady_state(parameter_values, 𝓂, - timer = timer, + # timer = timer, quadratic_matrix_equation_solver = quadratic_matrix_equation_solver, sylvester_algorithm = sylvester_algorithm, verbose = verbose) @@ -7321,7 +7321,7 @@ function get_relevant_steady_state_and_state_update(::Val{:pruned_second_order}, sss, converged, SS_and_pars, solution_error, βˆ‡β‚, βˆ‡β‚‚, 𝐒₁, 𝐒₂ = calculate_second_order_stochastic_steady_state(parameter_values, 𝓂, pruning = true, - timer = timer, + # timer = timer, quadratic_matrix_equation_solver = quadratic_matrix_equation_solver, sylvester_algorithm = sylvester_algorithm, verbose = verbose) @@ -7353,7 +7353,7 @@ function get_relevant_steady_state_and_state_update(::Val{:third_order}, verbose::Bool = false) where S <: Real sss, converged, SS_and_pars, solution_error, βˆ‡β‚, βˆ‡β‚‚, βˆ‡β‚ƒ, 𝐒₁, 𝐒₂, 𝐒₃ = calculate_third_order_stochastic_steady_state(parameter_values, 𝓂, - timer = timer, + # timer = timer, quadratic_matrix_equation_solver = quadratic_matrix_equation_solver, sylvester_algorithm = sylvester_algorithm, verbose = verbose) @@ -7385,7 +7385,7 @@ function get_relevant_steady_state_and_state_update(::Val{:pruned_third_order}, sss, converged, SS_and_pars, solution_error, βˆ‡β‚, βˆ‡β‚‚, βˆ‡β‚ƒ, 𝐒₁, 𝐒₂, 𝐒₃ = calculate_third_order_stochastic_steady_state(parameter_values, 𝓂, pruning = true, - timer = timer, + # timer = timer, quadratic_matrix_equation_solver = quadratic_matrix_equation_solver, sylvester_algorithm= sylvester_algorithm, verbose = verbose) @@ -7424,12 +7424,12 @@ function get_relevant_steady_state_and_state_update(::Val{:first_order}, return TT, SS_and_pars, zeros(S, 0, 0), [state], solution_error < tol end - βˆ‡β‚ = calculate_jacobian(parameter_values, SS_and_pars, 𝓂, timer = timer)# |> Matrix + βˆ‡β‚ = calculate_jacobian(parameter_values, SS_and_pars, 𝓂) # , timer = timer)# |> Matrix 𝐒₁, qme_sol, solved = calculate_first_order_solution(βˆ‡β‚; T = TT, quadratic_matrix_equation_solver = quadratic_matrix_equation_solver, - timer = timer, + # timer = timer, initial_guess = 𝓂.solution.perturbation.qme_solution, verbose = verbose) diff --git a/src/algorithms/lyapunov.jl b/src/algorithms/lyapunov.jl index 6d88e60c..960a916f 100644 --- a/src/algorithms/lyapunov.jl +++ b/src/algorithms/lyapunov.jl @@ -29,9 +29,9 @@ function solve_lyapunov_equation(A::AbstractMatrix{Float64}, # @timeit_debug timer "Solve" begin X, i, reached_tol = solve_lyapunov_equation(A, C, - Val(lyapunov_algorithm), + Val(lyapunov_algorithm))#, # tol = tol, - timer = timer) + # timer = timer) if verbose println("Lyapunov equation - converged to tol $tol: $(reached_tol < tol); iterations: $i; reached tol: $reached_tol; algorithm: $lyapunov_algorithm") @@ -42,9 +42,9 @@ function solve_lyapunov_equation(A::AbstractMatrix{Float64}, C = collect(C) X, i, reached_tol = solve_lyapunov_equation(A, C, - Val(:bicgstab), + Val(:bicgstab))#, # tol = tol, - timer = timer) + # timer = timer) if verbose println("Lyapunov equation - converged to tol $tol: $(reached_tol < tol); iterations: $i; reached tol: $reached_tol; algorithm: gmres") @@ -55,9 +55,9 @@ function solve_lyapunov_equation(A::AbstractMatrix{Float64}, C = collect(C) X, i, reached_tol = solve_lyapunov_equation(A, C, - Val(:bartels_stewart), + Val(:bartels_stewart))#, # tol = tol, - timer = timer) + # timer = timer) if verbose println("Lyapunov equation - converged to tol $tol: $(reached_tol < tol); iterations: $i; reached tol: $reached_tol; algorithm: lyapunov") diff --git a/src/algorithms/quadratic_matrix_equation.jl b/src/algorithms/quadratic_matrix_equation.jl index 4d3fd580..9b198f5a 100644 --- a/src/algorithms/quadratic_matrix_equation.jl +++ b/src/algorithms/quadratic_matrix_equation.jl @@ -40,7 +40,7 @@ function solve_quadratic_matrix_equation(A::AbstractMatrix{R}, T; initial_guess = initial_guess, # tol = tol, - timer = timer, + # timer = timer, verbose = verbose) if verbose println("Quadratic matrix equation solver: $quadratic_matrix_equation_solver - converged: $(reached_tol < tol) in $iterations iterations to tolerance: $reached_tol") end @@ -52,7 +52,7 @@ function solve_quadratic_matrix_equation(A::AbstractMatrix{R}, T; initial_guess = initial_guess, # tol = tol, - timer = timer, + # timer = timer, verbose = verbose) if verbose println("Quadratic matrix equation solver: schur - converged: $(reached_tol < tol) in $iterations iterations to tolerance: $reached_tol") end @@ -62,7 +62,7 @@ function solve_quadratic_matrix_equation(A::AbstractMatrix{R}, T; initial_guess = initial_guess, # tol = tol, - timer = timer, + # timer = timer, verbose = verbose) if verbose println("Quadratic matrix equation solver: doubling - converged: $(reached_tol < tol) in $iterations iterations to tolerance: $reached_tol") end @@ -522,7 +522,7 @@ function solve_quadratic_matrix_equation(A::AbstractMatrix{β„±.Dual{Z,S,N}}, T; tol = tol, initial_guess = initial_guess, - timer = timer, + # timer = timer, verbose = verbose) AXB = AΜ‚ * X + BΜ‚ diff --git a/src/algorithms/sylvester.jl b/src/algorithms/sylvester.jl index 9280b21c..a1e5d8e2 100644 --- a/src/algorithms/sylvester.jl +++ b/src/algorithms/sylvester.jl @@ -59,9 +59,9 @@ function solve_sylvester_equation(A::M, x, i, reached_tol = solve_sylvester_equation(a, b, c, Val(sylvester_algorithm), initial_guess = initial_guess, - # tol = tol, - verbose = verbose, - timer = timer) + # tol = tol, + # timer = timer, + verbose = verbose) if verbose && i != 0 println("Sylvester equation - converged to tol $tol: $(reached_tol < tol); iterations: $i; reached tol: $reached_tol; algorithm: $sylvester_algorithm") @@ -78,8 +78,8 @@ function solve_sylvester_equation(A::M, Val(:bartels_stewart), initial_guess = zeros(0,0), # tol = tol, - verbose = verbose, - timer = timer) + # timer = timer, + verbose = verbose) if verbose && i != 0 println("Sylvester equation - converged to tol $tol: $(reached_tol < tol); iterations: $i; reached tol: $reached_tol; algorithm: sylvester") @@ -95,8 +95,8 @@ function solve_sylvester_equation(A::M, Val(:dqgmres), initial_guess = x, # tol = tol, - verbose = verbose, - timer = timer) + # timer = timer, + verbose = verbose) if Reached_tol < reached_tol x = X reached_tol = Reached_tol @@ -116,8 +116,8 @@ function solve_sylvester_equation(A::M, Val(:gmres), initial_guess = zeros(0,0), # tol = tol, - verbose = verbose, - timer = timer) + # timer = timer, + verbose = verbose) if verbose# && i != 0 println("Sylvester equation - converged to tol $tol: $(reached_tol < tol); iterations: $i; reached tol: $reached_tol; algorithm: gmres") @@ -133,8 +133,8 @@ function solve_sylvester_equation(A::M, Val(:dqgmres), initial_guess = x, # tol = tol, - verbose = verbose, - timer = timer) + # timer = timer, + verbose = verbose) if Reached_tol < reached_tol x = X reached_tol = Reached_tol diff --git a/src/filter/inversion.jl b/src/filter/inversion.jl index 61e3e830..76365e07 100644 --- a/src/filter/inversion.jl +++ b/src/filter/inversion.jl @@ -20,8 +20,8 @@ function calculate_loglikelihood(::Val{:inversion}, warmup_iterations = warmup_iterations, presample_periods = presample_periods, filter_algorithm = filter_algorithm, - verbose = verbose, - timer = timer) + # timer = timer, + verbose = verbose) end diff --git a/src/filter/kalman.jl b/src/filter/kalman.jl index c0b3fafc..e6be997e 100644 --- a/src/filter/kalman.jl +++ b/src/filter/kalman.jl @@ -18,8 +18,8 @@ function calculate_loglikelihood(::Val{:kalman}, TT, presample_periods = presample_periods, initial_covariance = initial_covariance, - verbose = verbose, - timer = timer) + # timer = timer, + verbose = verbose) end function calculate_kalman_filter_loglikelihood(observables::Vector{Symbol}, @@ -32,7 +32,9 @@ function calculate_kalman_filter_loglikelihood(observables::Vector{Symbol}, verbose::Bool = false)::S where S <: Real obs_idx = @ignore_derivatives convert(Vector{Int},indexin(observables,sort(union(T.aux,T.var,T.exo_present)))) - calculate_kalman_filter_loglikelihood(obs_idx, 𝐒, data_in_deviations, T, presample_periods = presample_periods, initial_covariance = initial_covariance, verbose = verbose, timer = timer) + calculate_kalman_filter_loglikelihood(obs_idx, 𝐒, data_in_deviations, T, presample_periods = presample_periods, initial_covariance = initial_covariance, + # timer = timer, + verbose = verbose) end function calculate_kalman_filter_loglikelihood(observables::Vector{String}, @@ -45,7 +47,9 @@ function calculate_kalman_filter_loglikelihood(observables::Vector{String}, verbose::Bool = false)::S where S <: Real obs_idx = @ignore_derivatives convert(Vector{Int},indexin(observables,sort(union(T.aux,T.var,T.exo_present)))) - calculate_kalman_filter_loglikelihood(obs_idx, 𝐒, data_in_deviations, T, presample_periods = presample_periods, initial_covariance = initial_covariance, verbose = verbose, timer = timer) + calculate_kalman_filter_loglikelihood(obs_idx, 𝐒, data_in_deviations, T, presample_periods = presample_periods, initial_covariance = initial_covariance, + # timer = timer, + verbose = verbose) end function calculate_kalman_filter_loglikelihood(observables_index::Vector{Int}, @@ -67,9 +71,13 @@ function calculate_kalman_filter_loglikelihood(observables_index::Vector{Int}, 𝐁 = B * B' # Gaussian Prior - P = get_initial_covariance(Val(initial_covariance), A, 𝐁, lyapunov_algorithm = lyapunov_algorithm, verbose = verbose, timer = timer) + P = get_initial_covariance(Val(initial_covariance), A, 𝐁, lyapunov_algorithm = lyapunov_algorithm, + # timer = timer, + verbose = verbose) - return run_kalman_iterations(A, 𝐁, C, P, data_in_deviations, presample_periods = presample_periods, timer = timer, verbose = verbose) + return run_kalman_iterations(A, 𝐁, C, P, data_in_deviations, presample_periods = presample_periods, + # timer = timer, + verbose = verbose) end # TODO: use higher level wrapper, like for lyapunov/sylvester @@ -80,7 +88,9 @@ function get_initial_covariance(::Val{:theoretical}, lyapunov_algorithm::Symbol = :doubling, # timer::TimerOutput = TimerOutput(), verbose::Bool = false)::Matrix{S} where S <: Real - P, _ = solve_lyapunov_equation(A, B, lyapunov_algorithm = lyapunov_algorithm, verbose = verbose, timer = timer) + P, _ = solve_lyapunov_equation(A, B, lyapunov_algorithm = lyapunov_algorithm, + # timer = timer, + verbose = verbose) return P end diff --git a/src/get_functions.jl b/src/get_functions.jl index 7d126fba..325e11e5 100644 --- a/src/get_functions.jl +++ b/src/get_functions.jl @@ -1055,8 +1055,8 @@ function get_irf(𝓂::β„³; verbose = verbose, dynamics = true, algorithm = algorithm, - obc = occasionally_binding_constraints || obc_shocks_included, - timer = timer) + # timer = timer, + obc = occasionally_binding_constraints || obc_shocks_included) # end # timeit_debug @@ -3038,7 +3038,7 @@ function get_loglikelihood(𝓂::β„³, quadratic_matrix_equation_solver::Symbol = :schur, sylvester_algorithm::Symbol = :bicgstab, tol::AbstractFloat = 1e-12, - timer::TimerOutput = TimerOutput(), + # timer::TimerOutput = TimerOutput(), verbose::Bool = false)::S where S <: Real # if algorithm ∈ [:third_order,:pruned_third_order] @@ -3060,7 +3060,10 @@ function get_loglikelihood(𝓂::β„³, observables = @ignore_derivatives get_and_check_observables(𝓂, data) - @ignore_derivatives solve!(𝓂, verbose = verbose, algorithm = algorithm, timer = timer) + @ignore_derivatives solve!(𝓂, + verbose = verbose, + # timer = timer, + algorithm = algorithm) bounds_violated = @ignore_derivatives check_bounds(parameter_values, 𝓂) @@ -3079,7 +3082,7 @@ function get_loglikelihood(𝓂::β„³, parameter_values, 𝓂, tol, - timer = timer, + # timer = timer, quadratic_matrix_equation_solver = quadratic_matrix_equation_solver, sylvester_algorithm = sylvester_algorithm, verbose = verbose) @@ -3102,7 +3105,7 @@ function get_loglikelihood(𝓂::β„³, # @timeit_debug timer "Filter" begin - llh = calculate_loglikelihood(Val(filter), algorithm, observables, 𝐒, data_in_deviations, TT, presample_periods, initial_covariance, state, warmup_iterations, filter_algorithm, verbose, timer = timer) + llh = calculate_loglikelihood(Val(filter), algorithm, observables, 𝐒, data_in_deviations, TT, presample_periods, initial_covariance, state, warmup_iterations, filter_algorithm, verbose) # timer = timer # end # timeit_debug diff --git a/src/perturbation.jl b/src/perturbation.jl index a48ed91f..4f1b9955 100644 --- a/src/perturbation.jl +++ b/src/perturbation.jl @@ -46,7 +46,7 @@ function calculate_first_order_solution(βˆ‡β‚::Matrix{Float64}; sol, solved = solve_quadratic_matrix_equation(AΜƒβ‚Š, AΜƒβ‚€, AΜƒβ‚‹, T, quadratic_matrix_equation_solver = quadratic_matrix_equation_solver, - timer = timer, + # timer = timer, initial_guess = initial_guess, verbose = verbose) @@ -166,7 +166,7 @@ function rrule(::typeof(calculate_first_order_solution), sol, solved = solve_quadratic_matrix_equation(AΜƒβ‚Š, AΜƒβ‚€, AΜƒβ‚‹, T, quadratic_matrix_equation_solver = quadratic_matrix_equation_solver, - timer = timer, + # timer = timer, initial_guess = initial_guess, verbose = verbose) @@ -289,8 +289,8 @@ function calculate_first_order_solution(βˆ‡β‚::Matrix{β„±.Dual{Z,S,N}}; T = T, verbose = verbose, initial_guess = initial_guess, - quadratic_matrix_equation_solver = quadratic_matrix_equation_solver, - timer = timer) + # timer = timer, + quadratic_matrix_equation_solver = quadratic_matrix_equation_solver) if !solved return βˆ‡β‚, qme_sol, false @@ -461,9 +461,9 @@ function calculate_second_order_solution(βˆ‡β‚::AbstractMatrix{S}, #first order 𝐒₂, solved = solve_sylvester_equation(A, B, C, sylvester_algorithm = sylvester_algorithm, initial_guess = initial_guess, - verbose = verbose, + verbose = verbose)#, # tol = tol, - timer = timer) + # timer = timer) # end # timeit_debug # # @timeit_debug timer "Refine sylvester equation" begin @@ -585,9 +585,9 @@ function rrule(::typeof(calculate_second_order_solution), 𝐒₂, solved = solve_sylvester_equation(A, B, C, sylvester_algorithm = sylvester_algorithm, initial_guess = initial_guess, - verbose = verbose, + verbose = verbose) #, # tol = tol, - timer = timer) + # timer = timer) # end # timeit_debug # @timeit_debug timer "Post-process" begin @@ -635,8 +635,8 @@ function rrule(::typeof(calculate_second_order_solution), βˆ‚C, solved = solve_sylvester_equation(A', B', βˆ‚π’β‚‚, sylvester_algorithm = sylvester_algorithm, # tol = tol, - verbose = verbose, - timer = timer) + verbose = verbose) # , + # timer = timer) if !solved return (𝐒₂, solved), x -> NoTangent(), NoTangent(), NoTangent(), NoTangent(), NoTangent(), NoTangent(), NoTangent(), NoTangent(), NoTangent() @@ -853,7 +853,7 @@ function calculate_third_order_solution(βˆ‡β‚::AbstractMatrix{<: Real}, #first # end # timeit_debug # @timeit_debug timer "3rd Kronecker power" begin # B += mat_mult_kron(M₃.𝐔₃, collect(π’β‚β‚‹β•±πŸβ‚‘), collect(β„’.kron(π’β‚β‚‹β•±πŸβ‚‘, π’β‚β‚‹β•±πŸβ‚‘)), M₃.𝐂₃) # slower than direct compression - B += compressed_kronΒ³(π’β‚β‚‹β•±πŸβ‚‘, timer = timer) + B += compressed_kronΒ³(π’β‚β‚‹β•±πŸβ‚‘)#, timer = timer) # end # timeit_debug # end # timeit_debug @@ -932,7 +932,7 @@ function calculate_third_order_solution(βˆ‡β‚::AbstractMatrix{<: Real}, #first # @timeit_debug timer "3rd Kronecker power" begin # 𝐗₃ += mat_mult_kron(βˆ‡β‚ƒ, collect(aux), collect(β„’.kron(aux, aux)), M₃.𝐂₃) # slower than direct compression - 𝐗₃ += βˆ‡β‚ƒ * compressed_kronΒ³(aux, rowmask = unique(findnz(βˆ‡β‚ƒ)[2]), timer = timer) + 𝐗₃ += βˆ‡β‚ƒ * compressed_kronΒ³(aux, rowmask = unique(findnz(βˆ‡β‚ƒ)[2])) #, timer = timer) # end # timeit_debug # @timeit_debug timer "Mult 2" begin @@ -946,9 +946,9 @@ function calculate_third_order_solution(βˆ‡β‚::AbstractMatrix{<: Real}, #first 𝐒₃, solved = solve_sylvester_equation(A, B, C, sylvester_algorithm = sylvester_algorithm, initial_guess = initial_guess, - verbose = verbose, + verbose = verbose) # , # tol = tol, - timer = timer) + # timer = timer) # end # timeit_debug # # @timeit_debug timer "Refine sylvester equation" begin @@ -1075,7 +1075,7 @@ function rrule(::typeof(calculate_third_order_solution), # end # timeit_debug # @timeit_debug timer "3rd Kronecker power" begin - B += compressed_kronΒ³(π’β‚β‚‹β•±πŸβ‚‘, timer = timer) + B += compressed_kronΒ³(π’β‚β‚‹β•±πŸβ‚‘) # , timer = timer) # end # timeit_debug # end # timeit_debug @@ -1157,7 +1157,7 @@ function rrule(::typeof(calculate_third_order_solution), # end # timeit_debug # @timeit_debug timer "3rd Kronecker power aux" begin - 𝐗₃ += βˆ‡β‚ƒ * compressed_kronΒ³(aux, rowmask = unique(findnz(βˆ‡β‚ƒ)[2]), timer = timer) + 𝐗₃ += βˆ‡β‚ƒ * compressed_kronΒ³(aux, rowmask = unique(findnz(βˆ‡β‚ƒ)[2])) # , timer = timer) 𝐗₃ = choose_matrix_format(𝐗₃, density_threshold = 1.0, min_length = 10) # end # timeit_debug @@ -1172,9 +1172,9 @@ function rrule(::typeof(calculate_third_order_solution), 𝐒₃, solved = solve_sylvester_equation(A, B, C, sylvester_algorithm = sylvester_algorithm, initial_guess = initial_guess, - verbose = verbose, + verbose = verbose) # , # tol = tol, - timer = timer) + # timer = timer) # end # timeit_debug # # @timeit_debug timer "Refine sylvester equation" begin @@ -1283,7 +1283,7 @@ function rrule(::typeof(calculate_third_order_solution), βˆ‚C, solved = solve_sylvester_equation(A', B', βˆ‚π’β‚ƒ, sylvester_algorithm = sylvester_algorithm, # tol = tol, - timer = timer, + # timer = timer, verbose = verbose) if !solved @@ -1406,7 +1406,7 @@ function rrule(::typeof(calculate_third_order_solution), # @timeit_debug timer "Step 5" begin # this is very slow - βˆ‚βˆ‡β‚ƒ += βˆ‚π—β‚ƒ * compressed_kronΒ³(aux', rowmask = unique(findnz(βˆ‚π—β‚ƒ)[2]), timer = timer) + βˆ‚βˆ‡β‚ƒ += βˆ‚π—β‚ƒ * compressed_kronΒ³(aux', rowmask = unique(findnz(βˆ‚π—β‚ƒ)[2])) # , timer = timer) # βˆ‚βˆ‡β‚ƒ += βˆ‚π—β‚ƒ * β„’.kron(aux', aux', aux') # end # timeit_debug