From 71b7dd956f64c415204a5505c2e5573ed7d4f4fe Mon Sep 17 00:00:00 2001 From: Pablo Winant Date: Thu, 2 Jun 2022 17:09:06 +0200 Subject: [PATCH 1/2] Fixes tabulate when dr is Empty x Cartesian --- src/numeric/decision_rules/csplines.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/numeric/decision_rules/csplines.jl b/src/numeric/decision_rules/csplines.jl index d82d3a7..7b5f4e1 100644 --- a/src/numeric/decision_rules/csplines.jl +++ b/src/numeric/decision_rules/csplines.jl @@ -52,6 +52,8 @@ function evaluate(dr::CubicDR{EmptyGrid{d1},UCGrid{d}}, y::Vector{Float64}) wher return [p...] end +evaluate(dr::CubicDR{EmptyGrid{d1},UCGrid{d}}, i, y) where d where d1 = evaluate(dr, y) + #### #### 2 CartesianGrid continous arguments d.r. #### From e5e7e6280605f8ac2d6c59cf0f246d93145bcde9 Mon Sep 17 00:00:00 2001 From: Pablo Winant Date: Thu, 2 Jun 2022 17:19:17 +0200 Subject: [PATCH 2/2] FIX: redundant definition for dr(i,s) --- src/numeric/decision_rules/compat.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/numeric/decision_rules/compat.jl b/src/numeric/decision_rules/compat.jl index 0725afe..cea4099 100644 --- a/src/numeric/decision_rules/compat.jl +++ b/src/numeric/decision_rules/compat.jl @@ -49,9 +49,9 @@ end # evaluate(dr::AbstractDecisionRule{<:UCGrid, <:UCGrid}, x::Vector{Float64}, y::Matrix{Float64}) = evaluate(dr, repeat(x', size(y,1)), y) evaluate(dr::AbstractDecisionRule{<:UCGrid, <:UCGrid}, x::Vector{Float64}, y::Vector{Float64}) = evaluate(dr, vector_to_matrix(x), vector_to_matrix(y)) -evaluate(dr::AbstractDecisionRule{UCGrid{d1}, UCGrid{d2}}, z::AbstractMatrix) where d1 where d2 = evaluate(dr, [z[:,1:d1] z[:,1:(d1+1:end)]]) +# # evaluate(dr::AbstractDecisionRule{UCGrid{d1}, UCGrid{d2}}, z::AbstractMatrix) where d1 where d2 = evaluate(dr, [z[:,1:d1] z[:,1:(d1+1:end)]]) evaluate(dr::AbstractDecisionRule{<:UCGrid, <:UCGrid}, z::Vector{Float64}) = vec(evaluate(dr,vector_to_matrix(z))) -evaluate(dr::AbstractDecisionRule{UCGrid{d1}, UCGrid{d2}}, i::Int, y::Union{Vector{Float64},AbstractMatrix{Float64}}) where d1 where d2 = evaluate(dr,node(dr.grid_exo,i), y) +# evaluate(dr::AbstractDecisionRule{UCGrid{d1}, UCGrid{d2}}, i::Int, y::Union{Vector{Float64},AbstractMatrix{Float64}}) where d1 where d2 = evaluate(dr,node(dr.grid_exo,i), y) function set_values!(dr::AbstractDecisionRule{<:UCGrid, <:UCGrid, n_x}, vals::Vector{Matrix{Float64}}) where n_x