pub unsafe extern "C" fn scale(
n: c_int,
alpha: c_float,
x: *mut c_float,
inc_x: c_int,
)Expand description
Multiplies each element of a vector by a constant.
This function performs the operation x[i] = alpha * x[i] for each element in the vector x.
§Precision
This function operates on single-precision (f32) numbers.
§Parameters
n: The number of elements in the vectorx.alpha: The constant to multiply each element ofxby.x: A pointer to the vectorx. The result is stored in-place.inc_x: Stride withinx. For example, ifinc_xis 7, every 7th element is scaled byalpha.
§Safety
This is an unsafe C function. The caller must ensure that the pointer passed to x is valid and that accessing x up to n * inc_x is safe.