ContourFunctions (version 0.1.1)

eval_over_grid_with_batch: Evaluate function over grid of points

Description

`batchmax` gives how many can be evaluated at a time. If more than 1, then the input is given to the function as rows of a matrix.

Usage

eval_over_grid_with_batch(x, y, fn, batchmax)

Arguments

x

Vector of x values to evaluate

y

Vector of y values to evaluate

fn

Function that takes in a length two vector if `batchmax` is 1 or a matrix with two columns if greater than 1.

batchmax

Number of points that can evaluated simultaneously. If 1, points are passed to `fn` as a vector of length two. If greater than 1, points are passed to `fn` as rows of a matrix.

Value

Matrix of size `length(x)` by `length(y)`

Examples

Run this code
# NOT RUN {
eval_over_grid_with_batch(c(0,.5,1), c(10,20,30), function(a)a[1]+a[2], batchmax=1)
eval_over_grid_with_batch(c(0,.5,1), c(10,20,30), function(a)a[,1]+a[,2], batchmax=Inf)
# }

Run the code above in your browser using DataLab