Skip to contents

Constructs a row-wise Kronecker product mapping of linear/affine mappers. Any offset in sub-mappers is added into a combined offset. Only linear/affine sub-mappers are allowed.

Usage

bm_multi(mappers, simplify = FALSE)

bru_mapper_multi(...)

# S3 method for class 'bm_multi'
x[i, drop = TRUE]

# S3 method for class 'bru_mapper_multi'
x[i, drop = TRUE]

Arguments

mappers

A list of bru_mapper objects

simplify

logical; If TRUE, removes trivial submappers. Currently only sub-mappers of class bm_index() with ibm_n() == 1L are removed, and only if the mappers are named (to avoid ordering mismatches). Default: FALSE

...

Arguments passed on to bm_multi()

x

object from which to extract element(s)

i

indices specifying element(s) to extract

drop

logical; For [.bm_multi, whether to extract an individual mapper when i identifies a single element. If FALSE, a list of sub-mappers is returned (suitable e.g. for creating a new bm_multi object). Default: TRUE

Value

  • [-indexing a bm_multi extracts a subset bm_multi object (for drop FALSE) or an individual sub-mapper (for drop TRUE, and i identifies a single element)

Examples

(m <- bm_multi(list(a = bm_index(2), b = bm_index(3))))
#> multi(a = index, b = index)
ibm_eval2(m, list(a = c(1, 2, 1), b = c(1, 3, 2)), 1:6)
#> $offset
#> [1] 1 6 3
#> 
#> $jacobian
#> 3 x 6 sparse Matrix of class "dgCMatrix"
#>                 
#> [1,] 1 . . . . .
#> [2,] . . . . . 1
#> [3,] . . 1 . . .
#>