create_maptype_map: Template for the creation of a mapping function

View source: R/map_template.R

create_maptype_mapR Documentation

Template for the creation of a mapping function

Description

create_maptype_map() is a prototype function to construct a mapping skeleton. Its source code can be used as a template to create new mapping types.

Usage

create_maptype_map()

Value

Returns a named list with the following functions:

setup(params) Takes a named list with the parameters required to set up the mapping. The required fields in the list depend on the mapping, but most mappings take at least a vector with source indices and a vector with target indices.
getType() Returns a string that identifies the type of mapping.
getName() Returns a string with the name of this specific mapping instance.
getDescription() Returns a string with a more details about this specific mapping instance.
is_linear() Must return TRUE if the mapping is linear, otherwise FALSE.
get_src_idx() Returns the source indices of the mapping.
get_tar_idx() Returns the target indices of the mapping.
propagate(x, with.id=TRUE) Propagates the values in the vector x according to the mapping and returns the resulting vector. If with.id=FALSE only returns the changes caused by the mapping, otherwise it returns a vector with the changes added to x.
jacobian(x, with.id=TRUE) Returns the Jacobian matrix of the mapping evaluated at x. If with.id=FALSE, the Jacobian only reflects the change of the mapping, otherwise it is augmented by the identity matrix.

See Also

Other mappings: create_compound_map(), create_convolution_with_xtrafo_map(), create_derivative2nd_map(), create_derivative_map(), create_linearinterpol_map(), create_linearinterpol_with_xtrafo_map(), create_linearmap_map(), create_map(), create_nonlinear_map(), create_normerr_map(), create_product_map()

Examples

## Not run: 
    # create the list with essential mapping functions
    mapping <- create_maptype_map()
    # some prototype parameter list
    params <- list(mapname = "somename",
                   src_idx = 1:5, tar_idx = 6:10)
    # initialize the mapping
    mapping$setup(params)
    # call some mapping functions
    mapping$get_src_idx()
    mapping$get_tar_idx()

## End(Not run)

gschnabel/nucdataBaynet documentation built on Feb. 3, 2023, 4:13 a.m.