View source: R/graph_simulate.R
| simulate_parallel | R Documentation |
Calls simulate.metric_graph() with parallel = TRUE. The edge loop is
distributed over a doParallel/foreach cluster.
simulate_parallel(graph, ..., n_cores = NULL, cluster = NULL)
graph |
A |
... |
Further arguments passed to |
n_cores |
Number of parallel workers. |
cluster |
An already-registered |
Numeric vector (nsim = 1) or matrix with nsim columns.
sample_spde()
V <- rbind(c(0,0), c(1,0), c(1,1), c(0,1))
E <- rbind(c(1,2), c(2,3), c(3,4), c(4,1))
g <- metric_graph$new(V = V, E = E)
t_norm <- seq(0.1, 0.9, by = 0.2)
PtE <- do.call(rbind, lapply(1:4, function(e) cbind(e, t_norm)))
u <- simulate_parallel(g, alpha = 1, method = "kriging",
kappa = 1, tau = 1, PtE = PtE, n_cores = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.