| dswap | R Documentation |
Exchange the elements of two double precision vectors in place.
For I = 0 to N-1, swap DX(LX + I * INCX) with DY(LY + I * INCY) where LX and
LY depend on the increment signs. When an optimized BLAS is available the
implementation dispatches to DSWAP; otherwise a portable C loop
performs the exchange.
dswap(N = NULL, X, INCX = 1L, Y, INCY = 1L)
N |
Number of elements in the input vectors. Defaults to the full
length of |
X |
Double precision vector or matrix providing the first data block. |
INCX |
Storage spacing between elements of |
Y |
Double precision vector or matrix providing the second data block. |
INCY |
Storage spacing between elements of |
When an optimized BLAS is available the implementation delegates to the
Fortran DSWAP routine. Otherwise a portable C fallback performs the
exchange directly while respecting the supplied vector increments.
Invisibly returns NULL; both X and Y are
modified in place.
[dcopy()], [daxpy()] and [dscal()].
set.seed(4670)
X <- matrix(runif(6), 3, 2)
Y <- matrix(runif(6), 3, 2)
X_original <- X
Y_original <- Y
dswap(X = X, Y = Y)
all.equal(X, Y_original)
all.equal(Y, X_original)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.