-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
This is a follow up to EconForge/Dolo.jl#26
Suppose we have a vector of symbols like states=[:a,:b,:c] and the the equation a+b +c + c(1). Imagine, we have an equation type whose signature is: g(states(-1), states, states(1))
By default (in dolo.jl and dolo.py), we would compile a function g(x, y, z) where x,y,z are all vectors of the same size (of length 3). But this could lead to suboptimal computation since:
- no variable appear with date t-1
- some variables don't appear with date t+1 (only
cneeds to be known)
I see two way of adressing the problem:
- change dolo.py and dolo.jl, so that another version of
gis computed which involve only the variables that are actually used. Concretely, x would be expectd to be of size 0, y of size 3 and z of size 1. This fixes all drawbacks, but algorithms would seem a bit less natural. It would also probably require several versions of the same function. - introduce dummy arguments for the variables that are not going to be used:
1/ in the case of a whole vector being ommited we could allowg(nothing, y,z)(respg(None,y,z)) to work as expected.
2/ introduce a new class of vectors with non contiguous indexing (for use in our functions). For instance,zzcould be stored in memory as(v_a), butzz[3]would interpreted in the generated function aszz[1].
I don't know whether this is completely crazy. It would seem natural to me to write, g(nothing, y, z) or g(x,y,Packed(zz,(3,))) if zz is a one element vector. The Packed object would only be intended to change the behaviour in g().
@spencerlyon2 : any thought ?
Metadata
Metadata
Assignees
Labels
No labels