<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
geru.hpp
Go to the documentation of this file.
1
3//
4// Copyright (c) 2017-2021, University of Tennessee. All rights reserved.
5// Copyright (c) 2021-2023, University of Colorado Denver. All rights reserved.
6//
7// This file is part of <T>LAPACK.
8// <T>LAPACK is free software: you can redistribute it and/or modify it under
9// the terms of the BSD 3-Clause license. See the accompanying LICENSE file.
10
11#ifndef TLAPACK_LEGACY_GERU_HH
12#define TLAPACK_LEGACY_GERU_HH
13
14#include "tlapack/blas/geru.hpp"
17
18namespace tlapack {
19namespace legacy {
20
67 template <typename TA, typename TX, typename TY>
68 void geru(Layout layout,
69 idx_t m,
70 idx_t n,
72 TX const* x,
73 int_t incx,
74 TY const* y,
75 int_t incy,
76 TA* A,
77 idx_t lda)
78 {
79 using internal::create_matrix;
81
82 // check arguments
83 tlapack_check_false(layout != Layout::ColMajor &&
84 layout != Layout::RowMajor);
89 tlapack_check_false(lda < ((layout == Layout::ColMajor) ? m : n));
90
91 // quick return
92 if (m == 0 || n == 0 || alpha == scalar_t(0)) return;
93
94 if (layout == Layout::ColMajor) {
95 // Matrix views
96 auto A_ = create_matrix<TA>(A, m, n, lda);
97
99 return geru(alpha, x_, y_, A_));
100 }
101 else {
102 // Matrix views
103 auto A_ = create_matrix<TA>(A, n, m, lda);
104
106 return geru(alpha, y_, x_, A_));
107 }
108 }
109
110} // namespace legacy
111} // namespace tlapack
112
113#endif // #ifndef TLAPACK_LEGACY_GER_HH
constexpr Layout layout
Layout of a matrix or vector.
Definition arrayTraits.hpp:232
Layout
Definition types.hpp:24
#define tlapack_check_false(cond)
Throw an error if cond is true.
Definition exceptionHandling.hpp:113
void geru(Layout layout, idx_t m, idx_t n, scalar_type< TA, TX, TY > alpha, TX const *x, int_t incx, TY const *y, int_t incy, TA *A, idx_t lda)
General matrix rank-1 update:
Definition geru.hpp:68
#define tlapack_expr_with_2vectors(x, TX, n, X, incx, y, TY, m, Y, incy, expr)
Creates two vector objects and executes an expression with them.
Definition utils.hpp:33
typename traits::real_type_traits< Types..., int >::type real_type
The common real type of the list of types.
Definition scalar_type_traits.hpp:113