Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a simple SIIVector structure #78

Open
TorkelE opened this issue May 20, 2024 · 1 comment
Open

Create a simple SIIVector structure #78

TorkelE opened this issue May 20, 2024 · 1 comment

Comments

@TorkelE
Copy link
Member

TorkelE commented May 20, 2024

Would it be possible to have something like:

@parameters p1 p2 p3
ssi_vec = SSIVector([1.0, 2.0, 3.0], [p1, p2, p3])

and then have all of SII's functionality work on that?

There are a couple of cases where I have vectors and it would be nice to have a easy-to-use way of augmenting them with SII stuff without creating this thing myself for each case.

@AayushSabharwal
Copy link
Member

Does ProblemState and SymbolCache combined solve your problem? I could make it so that ProblemCache can store an index provider, so you don't need to maintain both objects. Basically,

Current:

temp_sys = SymbolCache(nothing, [p1, p2, p3])
ssi_vec = ProblemCache(; p = [1.0, 2.0, 3.0])
getp(temp_sys, sym)(ssi_vec)

With the suggestion above:

ssi_vec = ProblemState(; p = [1.0, 2.0, 3.0], index_provider = SymbolCache(nothing, [p1, p2, p3]))
getp(ssi_vec, sym)(ssi_vec)

This will handle all SII functionality except observed (because SII only does that for Symbol/Expr, and doesn't have a hook for it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants