ibm_is_linear: Check if a mapper is linear/affine

View source: R/mappers.R

ibm_is_linearR Documentation

Check if a mapper is linear/affine

Description

Implementations must return TRUE or FALSE. If TRUE (returned by the default method unless the mapper contains an is_linear variable), users of the mapper may assume the mapper is linear/affine.

Usage

ibm_is_linear(mapper, ...)

## Default S3 method:
ibm_is_linear(mapper, ...)

## S3 method for class 'bm_multi'
ibm_is_linear(mapper, multi = FALSE, ...)

## S3 method for class 'bm_collect'
ibm_is_linear(mapper, inla_f = FALSE, multi = FALSE, ...)

## S3 method for class 'bm_expr'
ibm_is_linear(mapper, ...)

## S3 method for class 'bm_sum'
ibm_is_linear(mapper, multi = FALSE, ...)

Arguments

mapper

A mapper S3 object, inheriting from bru_mapper.

...

Arguments passed on to other methods

multi

logical; If TRUE (or positive), recurse one level into sub-mappers

inla_f

logical; when TRUE for ibm_n() and ibm_values(), the result must be compatible with the INLA::f(...) and corresponding INLA::inla.stack(...) constructions. For ⁠ibm_{eval,jacobian,linear}⁠, the input interpretation may be different. Implementations do not normally need to do anything different, except for mappers of the type needed for hidden multicomponent models such as "bym2", which can be handled by bm_collect.

Value

logical; TRUE if the mapper is linear/affine, FALSE otherwise.

Methods (by class)

  • ibm_is_linear(default): Returns logical is_linear from the mapper object if it exists, and otherwise TRUE.

See Also

Other mapper methods: bru_mapper_generics, ibm_as_taylor(), ibm_eval(), ibm_eval2(), ibm_inla_subset(), ibm_invalid_output(), ibm_is_rowwise(), ibm_jacobian(), ibm_n(), ibm_n_output(), ibm_names(), ibm_simplify(), ibm_values()

Examples

m <- bm_linear()
ibm_is_linear(m)


inlabru documentation built on July 28, 2026, 9:07 a.m.