# \donttest{
tmp <- tempfile(fileext = ".h5")
M <- hdf5_create_matrix(tmp, "data/M", data = matrix(rnorm(10000), 100, 100))
d <- hdf5_create_matrix(tmp, "data/d", data = matrix(rnorm(10000), 100, 100))
R1 <- diag_op(M, d, "*") # scale each column
R2 <- M * d # same via operator auto-dispatch
hdf5_close_all()
unlink(tmp)
# }
Run the code above in your browser using DataLab