eval_over_grid_with_batch: Evaluate function over grid of points

Description Usage Arguments Value Examples

View source: R/eval_over_grid_with_batch.R

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

1
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

1
2
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)

CollinErickson/contour documentation built on Aug. 12, 2019, 1:30 p.m.