-
Notifications
You must be signed in to change notification settings - Fork 13
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
Bug parsing with intermediate variables #289
Comments
Another example of this, is an intermediate variable that is supposed to be a vector (array) source_id <- user()
target_id <- user()
Total[] <- S[i] + I[i]
output(source_prevalence) <- I[as.integer(source_id)] / Total[as.integer(source_id)]
output(target_prevalence) <- I[as.integer(target_id)] / Total[as.integer(target_id)] This works, but if I remove the The logic here is I have many S and I compartments, and I only want to pickout the designated "source" and "target" cells, and their compartments. Full error message:
(this is when Total has
|
A minimal version of this bug: odin::odin({
a <- x[i]
dim(x) <- 5
x[] <- 0
deriv(y) <- a
initial(y) <- 0
}) This should be an error before it generates C code (and I am surprised we don't catch this already) as you cannot use In your specific case you should write: delta_transmission[i] <- transmission_rate * S[i] * I[i]
dim(delta_transmission) <- N |
That totally makes sense. Do you want me to close this? Or should I update the name? |
Please leave it open, it's a bug and the example is good |
While working on this example, I experienced this error:
This occurs when running this:
Backtrace:
Details
The text was updated successfully, but these errors were encountered: