<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
her.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_HER_HH
12#define TLAPACK_LEGACY_HER_HH
13
14#include "tlapack/blas/her.hpp"
17
18namespace tlapack {
19namespace legacy {
20
63 template <typename TA, typename TX>
64 void her(Layout layout,
65 Uplo uplo,
66 idx_t n,
67 real_type<TA, TX> alpha, // zher takes double alpha; use real
68 TX const* x,
69 int_t incx,
70 TA* A,
71 idx_t lda)
72 {
73 using internal::create_matrix;
75
76 // check arguments
77 tlapack_check_false(layout != Layout::ColMajor &&
78 layout != Layout::RowMajor);
79 tlapack_check_false(uplo != Uplo::Lower && uplo != Uplo::Upper);
83
84 // quick return
85 if (n == 0 || alpha == real_t(0)) return;
86
87 // for row major, swap lower <=> upper
88 if (layout == Layout::RowMajor) {
89 uplo = (uplo == Uplo::Lower ? Uplo::Upper : Uplo::Lower);
90 }
91
92 // Matrix views
93 auto A_ = create_matrix<TA>(A, n, n, lda);
94
96 }
97
98} // namespace legacy
99} // namespace tlapack
100
101#endif // #ifndef TLAPACK_LEGACY_HER_HH
constexpr Layout layout
Layout of a matrix or vector.
Definition arrayTraits.hpp:232
Uplo
Definition types.hpp:45
Layout
Definition types.hpp:24
#define tlapack_check_false(cond)
Throw an error if cond is true.
Definition exceptionHandling.hpp:113
void her(Layout layout, Uplo uplo, idx_t n, real_type< TA, TX > alpha, TX const *x, int_t incx, TA *A, idx_t lda)
Hermitian matrix rank-1 update:
Definition her.hpp:64
#define tlapack_expr_with_vector(x, TX, n, X, incx, expr)
Creates a vector object and executes an expression with it.
Definition utils.hpp:68
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