odin::odin()
(#225)rewrite_constants
(via odin::odin_options
) which attempts to rewrite all constants in the model code before generation. This can considerably reduce the number of variable lookups (mrc-2252)substitutions
(via odin::odin_options
) which can substitute in scalar user
values at compile time (#220)rewrite_dims
(via odin::odin_options
) which will attempt to simplify common dimensions. This can reduce the number of variables carried around in the model as these are typically very redundant and also known at compile time (mrc-2093)# ignore.unused
to locally suppress messages about unused variables (mrc-2122)int
) are used in equations (reported by @rhysinward, @katietiley and @cwhittaker1000)config(include)
has been expanded, working for R models and designed to be extensible for other targets (mrc-2016)pkgbuild
for the compilation which should ease debugging, and odin code compiled into packages will no longer issue a slew of warnings (and cooperate with automatic routine registration). This refactor has caused a few minor breaking changes:
$initial()
always requires time, even if it is ignored$set_user()
and construction no longer work with positional argument matching - all arguments must be named$ir
field has become a method; add parentheses after itcompiler_warnings
option has been removedas.integer()
to cast to integer for use within array expressions (#200)rmhyper()
- there is no analogue for this in base R. Like rmultinom
this returns a vector and the interface is subject to possible change (mrc-1621
)functions
, which briefly describes all supported odin functions (mrc-1623
)round(1.23, 1)
is 1.2), and enforce the same 0.5 rounding behaviour as R when used from C (mrc-511
, #116, #179)mrc-327
, #176)odin_package
now works with R staged installation as introduced in 3.6.0 (#170, mrc-257
)A complete rewrite of the odin engine, designed to increase future maintainability but have few user-visible effects. In brief, this does add
target = "r"
to use this.This does introduce a few user-visible breaking changes: - use of array indices outside of an array subset (e.g., x[] <- i
) produces output that is off-by-one compared with the previous version (see #136) - The “safe” mode has been removed, at least for now. This failed to compile for complex models and was not well used. A better static check mechanism will be introduced (#148) - Arguments to odin()
have been modified slightly - odin_package()
no longer supports multi-file mode (I don’t think this was ever used). - Argument order in generated functions, as well as variable/output order, is likely to change but this should not generally be relied upon. - The methods for a model object have been extensively rationalised. I don’t think that anything has been removed that anyone is using in their code. - The parameters passed as a list user
are validated and providing additional parameters is a warning (by default; this can be configured to be more or less strict as desired).
Fixes many outstanding issues: #139, #136, #132, #130, #129, #127, #123, #122, #121, #120, #117, #115, #112, #106, #99, #98, #84, #72, #64, #57, #52, #12, #4
@thibautjombart
#102