[linalg.scaled.intro]

# 29 Numerics library [[numerics]](./#numerics)

## 29.9 Basic linear algebra algorithms [[linalg]](linalg#scaled.intro)

### 29.9.8 Scaled in-place transformation [[linalg.scaled]](linalg.scaled#intro)

#### 29.9.8.1 Introduction [linalg.scaled.intro]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L12572)

The scaled function
takes a value alpha and an mdspan x, and
returns a new read-only mdspan that represents
the elementwise product of alpha with each element of x[.](#1.sentence-1)

[*Example [1](#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*]
