create_linearinterpol_map: Create a linear interpolation mapping

View source: R/map_linearinterpol.R

create_linearinterpol_mapR Documentation

Create a linear interpolation mapping

Description

Creates a map to linearly interpolate the values at the source indices given on a one-dimensional mesh to the one-dimensional mesh associated with the variables at the target indices.

Usage

create_linearinterpol_map()

Details

The following fields are required in the parameter list to initialize the mapping:

mapname Name of the mapping
maptype Must be "linearinterpol_map"
src_idx Vector of source indices
tar_idx Vector of target indices
src_x Vector with the mesh associated with the source indices
tar_x Vector with the mesh associated with the target indices
zero_outside Default is FALSE. If TRUE, y-values of target x-values outside the limits of the source mesh will be zero, otherwise this situation is not allowed.
scalefact A scalar that is multiplied with the resulting numbers from linear interpolation to obtain the final result of the mapping. Default is 1.

Value

Returns a list of functions to operate with the mapping, see create_maptype_map.

See Also

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

Examples

params <- list(
  mapname = "mylinearintmap",
  maptype = "linearinterpol_map",
  src_idx = 1:3,
  tar_idx = 4:6,
  src_x = c(1,5,10),
  tar_x = c(4,5,6)
)
mymap <- create_linearinterpol_map()
mymap$setup(params)
x <- c(1,2,3,0,0,0)
mymap$propagate(x)
mymap$jacobian(x)


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