Skip to content

problem using compiled nList(instr_nClass) in nClass #16

@paciorek

Description

@paciorek

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions