evaluate_1darray_function_on_2d_array

pyapprox.models.wrappers.evaluate_1darray_function_on_2d_array(function, samples, opts=None)[source]

Evaluate a function at a set of samples using a function that only takes one sample at a time

Parameters
functioncallable

A function with signature

function(sample) -> np.ndarray`

where sample is a 1d np.ndarray of shape (num_vars) and the output is a np.ndarray of values of shape (num_qoi). The output can also be a scalar

samplesnp.ndarray (num_vars, num_samples)

The samples at which to evaluate the model

optsdictionary

A set of options that are needed to evaluate the model

Returns
valuesnp.ndarray (num_samples, num_qoi)

The value of each requested QoI of the model for each sample