Runs the solver executable and extracts the quantity of interest (QOI) and its Jacobian matrix (if available).

run(solver, x, ...)

# S3 method for solver
run(solver, x, ...)

# S3 method for r_solver
run(solver, x, ...)

# S3 method for shell_solver
run(solver, x, ignore.stdout = NULL, ignore.stderr = NULL, silent = FALSE, ...)

Arguments

solver

solver object.

x

numeric, the point (parameter set) at which QOI is evaluated.

...

additional arguments passed to other functions, note that particular solvers can have some required_args() and they must be provided.

ignore.stdout

logical, if not NULL overrides default setting in shell_solver object

ignore.stderr

logical, if not NULL overrides default setting in shell_solver object

silent

logical, suppress diagnostic messages (not warnings), TRUE forces ignore.stdout = TRUE and ignore.stderr = TRUE

Value

List with components:

qoi

QOI value at x, default implementation returns NA;

jacobian

QOI Jacobian matrix at x, default implementation returns NA, NA is also returned if the solver does not provide Jacobian info.

Methods (by class)

  • solver: Checks if number of solver parameters (unless NULL) equals length of given point and delegates to default method.

  • r_solver: Computes output using provided functions.

  • shell_solver: Runs solver executable and reads values from output file(s). If solver process exits with non-zero status code, a warning is issued and list of NA's is returned.

Examples

run(x = 10)
#> $qoi #> [1] NA #> #> $jacobian #> [1] NA #>
run(NULL, c(2, 4))
#> $qoi #> [1] NA #> #> $jacobian #> [1] NA #>