openpgp4fpr:AC2D25E7E59D5740936F48A9407DA3D98F93442B
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Expérimentation avec les vecteurs `raw` ## | |
| v1 <- 1:3 | |
| as.raw(v1) | |
| #> [1] 01 02 03 | |
| v2 <- c(10, 20, 30) | |
| as.raw(v2) | |
| #> [1] 0a 14 1e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(Rmpi) | |
| ## Crée les workers. | |
| nworkers <- 5 | |
| mpi.spawn.Rslaves(nslaves = nworkers) | |
| ## Demande à chaque worker de retourner son rang. | |
| mpi.remote.exec(mpi.comm.rank()) | |
| ## On termine! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Constructeur | |
| point <- function(v){ | |
| v <- as.numeric(v) | |
| stopifnot(identical(length(v), 2L)) | |
| structure(v, class = c("point", class(v))) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Debug | |
| fact <- function(x) { | |
| x < 0 && return(x) | |
| x * fact(x - 1.0) | |
| } | |
| ## Profile | |
| cutVector <- function(vec, m) { | |
| n <- length(vec) / m |