For algorithms, we'll need to work out how to set up instruction lists in Cpublic methods, presumably either passing in an R list of uncompiled (or compiled?) instr_nClass objects or an uncompiled nList(instr_nClass).
Something like the following is working in modelBase_nClass but not in a stand-alone nClass:
myclass = nClass(
Cpublic = list(
run = nFunction(
fun=function( input = 'SEXP') {
ans <- nList("nimbleModel:::instr_nClass")$new() # or `nList(instr_nClass)$new()
cppLiteral("ans->set_all_values(input);")
return(0)
}, returnType = 'numericScalar'
)
),
## This makes no difference.
compileInfo = list(
Hincludes = '"instr_nClass_c_.h"',
needed_units=list("instr_nClass", "nList(instr_nClass)")
)
)
cstuff <- nCompile(myclass)
An error occurred in compiler stage normalizeCalls:
In resolveSym method for symbolTBD (, :::), could not resolve an nClass generator.
Error in self$resolveSym(project_env, ...) :
In resolveSym method for symbolTBD (, :::), could not resolve an nClass generator.
For algorithms, we'll need to work out how to set up instruction lists in Cpublic methods, presumably either passing in an R list of uncompiled (or compiled?) instr_nClass objects or an uncompiled nList(instr_nClass).
Something like the following is working in
modelBase_nClassbut not in a stand-alone nClass: