4#ifndef TETL_LINALG_BLAS1_SCALE_HPP
5#define TETL_LINALG_BLAS1_SCALE_HPP
7#include <etl/_linalg/concepts.hpp>
8#include <etl/_utility/cmp_less.hpp>
13template <
typename Scalar, inout_object InOutObj>
14constexpr auto scale(Scalar alpha, InOutObj x) ->
void
16 using size_type =
typename InOutObj::size_type;
18 if constexpr (InOutObj::rank() == 1) {
19 for (size_type i{0};
etl::cmp_less(i, x.extent(0)); ++i) {
23 static_assert(InOutObj::rank() == 2);
24 for (size_type i{0};
etl::cmp_less(i, x.extent(0)); ++i) {
25 for (size_type j{0};
etl::cmp_less(j, x.extent(1)); ++j) {
26 x(i, j) = x(i, j) * alpha;
constexpr auto scale(Scalar alpha, InOutObj x) -> void
Definition blas1_scale.hpp:14
Definition accessor_conjugate.hpp:13
Definition adjacent_find.hpp:9