Skip to content

Commit c449978

Browse files
authored
refactor MooncakeExt imports (#126)
1 parent cca087d commit c449978

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

ext/MooncakeExt.jl

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
11
module MooncakeExt
22

3-
import Mooncake: @from_rrule, DefaultCtx
4-
import MacroModelling: mul_reverse_AD!, sparse_preallocated!, calculate_second_order_stochastic_steady_state, calculate_third_order_stochastic_steady_state, calculate_jacobian, calculate_hessian, calculate_third_order_derivatives, get_NSSS_and_parameters, calculate_first_order_solution, calculate_second_order_solution, solve_lyapunov_equation, solve_sylvester_equation, find_shocks, calculate_inversion_filter_loglikelihood, ℳ, second_order_auxilliary_matrices, third_order_auxilliary_matrices, caches, timings
5-
import SparseArrays: SparseMatrixCSC, SparseVector, AbstractSparseArray, AbstractSparseMatrix
3+
import Mooncake
4+
import MacroModelling
5+
import SparseArrays
66
import LinearAlgebra as ℒ
77

8-
@from_rrule DefaultCtx Tuple{typeof(mul_reverse_AD!), Matrix{S}, AbstractMatrix{M}, AbstractMatrix{N}} where {S <: Real, M <: Real, N <: Real}
8+
Mooncake.@from_rrule Mooncake.DefaultCtx Tuple{typeof(MacroModelling.mul_reverse_AD!), Matrix{S}, AbstractMatrix{M}, AbstractMatrix{N}} where {S <: Real, M <: Real, N <: Real}
99

10-
@from_rrule DefaultCtx Tuple{typeof(sparse_preallocated!), Matrix{T}} where {T <: Real} true
10+
Mooncake.@from_rrule Mooncake.DefaultCtx Tuple{typeof(MacroModelling.sparse_preallocated!), Matrix{T}} where {T <: Real} true
1111

12-
@from_rrule DefaultCtx Tuple{typeof(calculate_second_order_stochastic_steady_state), Val{:newton}, Matrix{Float64}, AbstractSparseMatrix{Float64}, Vector{Float64}, ℳ} true
12+
Mooncake.@from_rrule Mooncake.DefaultCtx Tuple{typeof(MacroModelling.calculate_second_order_stochastic_steady_state), Val{:newton}, Matrix{Float64}, SparseArrays.AbstractSparseMatrix{Float64}, Vector{Float64}, MacroModelling.ℳ} true
1313

14-
@from_rrule DefaultCtx Tuple{typeof(calculate_third_order_stochastic_steady_state), Val{:newton}, Matrix{Float64}, AbstractSparseMatrix{Float64}, AbstractSparseMatrix{Float64}, Vector{Float64}, ℳ} true
14+
Mooncake.@from_rrule Mooncake.DefaultCtx Tuple{typeof(MacroModelling.calculate_third_order_stochastic_steady_state), Val{:newton}, Matrix{Float64}, SparseArrays.AbstractSparseMatrix{Float64}, SparseArrays.AbstractSparseMatrix{Float64}, Vector{Float64}, MacroModelling.ℳ} true
1515

16-
@from_rrule DefaultCtx Tuple{typeof(calculate_jacobian), Vector{M}, Vector{N}, ℳ} where {M <: AbstractFloat, N <: AbstractFloat}
16+
Mooncake.@from_rrule Mooncake.DefaultCtx Tuple{typeof(MacroModelling.calculate_jacobian), Vector{M}, Vector{N}, MacroModelling.ℳ} where {M <: AbstractFloat, N <: AbstractFloat}
1717

18-
@from_rrule DefaultCtx Tuple{typeof(calculate_hessian), Vector{M}, Vector{N}, ℳ} where {M <: AbstractFloat, N <: AbstractFloat}
18+
Mooncake.@from_rrule Mooncake.DefaultCtx Tuple{typeof(MacroModelling.calculate_hessian), Vector{M}, Vector{N}, MacroModelling.ℳ} where {M <: AbstractFloat, N <: AbstractFloat}
1919

20-
@from_rrule DefaultCtx Tuple{typeof(calculate_third_order_derivatives), Vector{M}, Vector{N}, ℳ} where {M <: AbstractFloat, N <: AbstractFloat}
20+
Mooncake.@from_rrule Mooncake.DefaultCtx Tuple{typeof(MacroModelling.calculate_third_order_derivatives), Vector{M}, Vector{N}, MacroModelling.ℳ} where {M <: AbstractFloat, N <: AbstractFloat}
2121

22-
@from_rrule DefaultCtx Tuple{typeof(get_NSSS_and_parameters), ℳ, Vector{S} where S <: AbstractFloat} true
22+
Mooncake.@from_rrule Mooncake.DefaultCtx Tuple{typeof(MacroModelling.get_NSSS_and_parameters), MacroModelling.ℳ, Vector{S} where S <: AbstractFloat} true
2323

24-
@from_rrule DefaultCtx Tuple{typeof(calculate_first_order_solution), Matrix{R}} where R <: AbstractFloat true
24+
Mooncake.@from_rrule Mooncake.DefaultCtx Tuple{typeof(MacroModelling.calculate_first_order_solution), Matrix{R}} where R <: AbstractFloat true
2525

26-
@from_rrule DefaultCtx Tuple{typeof(calculate_second_order_solution), AbstractMatrix{R}, SparseMatrixCSC{R}, AbstractMatrix{R}, second_order_auxilliary_matrices, caches} where R <: AbstractFloat true
26+
Mooncake.@from_rrule Mooncake.DefaultCtx Tuple{typeof(MacroModelling.calculate_second_order_solution), AbstractMatrix{R}, SparseArrays.SparseMatrixCSC{R}, AbstractMatrix{R}, MacroModelling.second_order_auxilliary_matrices, MacroModelling.caches} where R <: AbstractFloat true
2727

28-
@from_rrule DefaultCtx Tuple{typeof(calculate_second_order_solution), AbstractMatrix{R}, SparseMatrixCSC{R}, SparseMatrixCSC{R}, AbstractMatrix{R}, SparseMatrixCSC{R}, second_order_auxilliary_matrices, third_order_auxilliary_matrices, caches} where R <: AbstractFloat true
28+
Mooncake.@from_rrule Mooncake.DefaultCtx Tuple{typeof(MacroModelling.calculate_second_order_solution), AbstractMatrix{R}, SparseArrays.SparseMatrixCSC{R}, SparseArrays.SparseMatrixCSC{R}, AbstractMatrix{R}, SparseArrays.SparseMatrixCSC{R}, MacroModelling.second_order_auxilliary_matrices, MacroModelling.third_order_auxilliary_matrices, MacroModelling.caches} where R <: AbstractFloat true
2929

30-
@from_rrule DefaultCtx Tuple{typeof(solve_lyapunov_equation), AbstractMatrix{R}, AbstractMatrix{R}} where R <: AbstractFloat true
30+
Mooncake.@from_rrule Mooncake.DefaultCtx Tuple{typeof(MacroModelling.solve_lyapunov_equation), AbstractMatrix{R}, AbstractMatrix{R}} where R <: AbstractFloat true
3131

32-
@from_rrule DefaultCtx Tuple{typeof(solve_sylvester_equation), AbstractMatrix{R}, AbstractMatrix{R}, AbstractMatrix{R}} where R <: AbstractFloat true
32+
Mooncake.@from_rrule Mooncake.DefaultCtx Tuple{typeof(MacroModelling.solve_sylvester_equation), AbstractMatrix{R}, AbstractMatrix{R}, AbstractMatrix{R}} where R <: AbstractFloat true
3333

34-
@from_rrule DefaultCtx Tuple{typeof(find_shocks), Val{:LagrangeNewton}, Vector{Float64}, Vector{Float64}, AbstractMatrix{Float64}, ℒ.Diagonal{Bool, Vector{Bool}}, AbstractMatrix{Float64}, AbstractMatrix{Float64}, Vector{Float64}} true
34+
Mooncake.@from_rrule Mooncake.DefaultCtx Tuple{typeof(MacroModelling.find_shocks), Val{:LagrangeNewton}, Vector{Float64}, Vector{Float64}, AbstractMatrix{Float64}, ℒ.Diagonal{Bool, Vector{Bool}}, AbstractMatrix{Float64}, AbstractMatrix{Float64}, Vector{Float64}} true
3535

36-
@from_rrule DefaultCtx Tuple{typeof(find_shocks), Val{:LagrangeNewton}, Vector{Float64}, Vector{Float64}, Vector{Float64}, AbstractMatrix{Float64}, AbstractMatrix{Float64}, AbstractMatrix{Float64},
36+
Mooncake.@from_rrule Mooncake.DefaultCtx Tuple{typeof(MacroModelling.find_shocks), Val{:LagrangeNewton}, Vector{Float64}, Vector{Float64}, Vector{Float64}, AbstractMatrix{Float64}, AbstractMatrix{Float64}, AbstractMatrix{Float64},
3737
.Diagonal{Bool, Vector{Bool}}, AbstractMatrix{Float64}, AbstractMatrix{Float64}, AbstractMatrix{Float64}, Vector{Float64}} true
3838

39-
@from_rrule DefaultCtx Tuple{typeof(calculate_inversion_filter_loglikelihood), Val{:first_order}, Vector{Vector{Float64}}, Matrix{Float64}, Matrix{Float64}, Union{Vector{String}, Vector{Symbol}}, timings} true
39+
Mooncake.@from_rrule Mooncake.DefaultCtx Tuple{typeof(MacroModelling.calculate_inversion_filter_loglikelihood), Val{:first_order}, Vector{Vector{Float64}}, Matrix{Float64}, Matrix{Float64}, Union{Vector{String}, Vector{Symbol}}, MacroModelling.timings} true
4040

41-
@from_rrule DefaultCtx Tuple{typeof(calculate_inversion_filter_loglikelihood), Val{:pruned_second_order},Vector{Vector{Float64}}, Vector{AbstractMatrix{Float64}}, Matrix{Float64}, Union{Vector{String}, Vector{Symbol}}, timings} true
41+
Mooncake.@from_rrule Mooncake.DefaultCtx Tuple{typeof(MacroModelling.calculate_inversion_filter_loglikelihood), Val{:pruned_second_order},Vector{Vector{Float64}}, Vector{AbstractMatrix{Float64}}, Matrix{Float64}, Union{Vector{String}, Vector{Symbol}}, MacroModelling.timings} true
4242

43-
@from_rrule DefaultCtx Tuple{typeof(calculate_inversion_filter_loglikelihood), Val{:second_order},Vector{Float64}, Vector{AbstractMatrix{Float64}}, Matrix{Float64}, Union{Vector{String}, Vector{Symbol}}, timings} true
43+
Mooncake.@from_rrule Mooncake.DefaultCtx Tuple{typeof(MacroModelling.calculate_inversion_filter_loglikelihood), Val{:second_order},Vector{Float64}, Vector{AbstractMatrix{Float64}}, Matrix{Float64}, Union{Vector{String}, Vector{Symbol}}, MacroModelling.timings} true
4444

45-
@from_rrule DefaultCtx Tuple{typeof(calculate_inversion_filter_loglikelihood), Val{:pruned_third_order},Vector{Vector{Float64}}, Vector{AbstractMatrix{Float64}}, Matrix{Float64}, Union{Vector{String}, Vector{Symbol}}, timings} true
45+
Mooncake.@from_rrule Mooncake.DefaultCtx Tuple{typeof(MacroModelling.calculate_inversion_filter_loglikelihood), Val{:pruned_third_order},Vector{Vector{Float64}}, Vector{AbstractMatrix{Float64}}, Matrix{Float64}, Union{Vector{String}, Vector{Symbol}}, MacroModelling.timings} true
4646

47-
@from_rrule DefaultCtx Tuple{typeof(calculate_inversion_filter_loglikelihood), Val{:third_order},Vector{Float64}, Vector{AbstractMatrix{Float64}}, Matrix{Float64}, Union{Vector{String}, Vector{Symbol}}, timings} true
47+
Mooncake.@from_rrule Mooncake.DefaultCtx Tuple{typeof(MacroModelling.calculate_inversion_filter_loglikelihood), Val{:third_order},Vector{Float64}, Vector{AbstractMatrix{Float64}}, Matrix{Float64}, Union{Vector{String}, Vector{Symbol}}, MacroModelling.timings} true
4848

49-
end # module
49+
end # module

0 commit comments

Comments
 (0)