Function rustml::ops_inplace::s_axpy
[−]
[src]
pub fn s_axpy(alpha: f32, x: &[f32], y: &mut [f32])
Computes alpha * x + y
and stores the result in y
. (optimized via BLAS)
Panics if the dimensions of the vectors do not match.
use rustml::ops_inplace::*; let x = [1.0f32, 2.0, 3.0]; let mut y = [4.0f32, 2.0, 9.0]; s_axpy(3.0f32, &x, &mut y); assert_eq!(y, [7.0f32, 8.0, 18.0]);