Learn R Programming

bigalgebra (version 3.0.0)

dadd: Add two double-precision vectors.

Description

Compute double precision DY := DX + DY for N elements, applying the specified storage increments. This routine mirrors the BLAS DAXPY operation with a unit scaling factor.

Usage

dadd(N = NULL, X, INCX = 1L, Y, INCY = 1L)

Value

The modified object Y containing the element-wise sums.

Arguments

N

number of elements in the input vectors. Defaults to the length of X if NULL.

X

double precision vector or matrix providing the addend.

INCX

storage spacing between elements of X.

Y

double precision vector or matrix that is updated in place.

INCY

storage spacing between elements of Y.

Details

The implementation delegates to the BLAS DAXPY routine with a unit scaling factor, making it equivalent to daxpy(1.0, X, Y) while exposing an interface consistent with other low-level wrappers such as dcopy and dscal.

Examples

Run this code
set.seed(4669)
X <- matrix(runif(6), 3, 2)
Y <- matrix(runif(6), 3, 2)
dadd(X = X, Y = Y)
all.equal(Y, X + Y)

Run the code above in your browser using DataLab