The scaled function
takes a value alpha and an mdspanx, and
returns a new read-only mdspan
that represents
the elementwise product of alpha with each element of x.
[Example 1: using Vec = mdspan<double, dextents<size_t, 1>>;
// z = alpha * x + yvoid z_equals_alpha_times_x_plus_y(double alpha, Vec x, Vec y, Vec z){
add(scaled(alpha, x), y, z);
}// z = alpha * x + beta * yvoid z_equals_alpha_times_x_plus_beta_times_y(double alpha, Vec x, double beta, Vec y, Vec z){
add(scaled(alpha, x), scaled(beta, y), z);
} — end example]