<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
unm2r.hpp
Go to the documentation of this file.
1
5//
6// Copyright (c) 2021-2023, University of Colorado Denver. All rights reserved.
7//
8// This file is part of <T>LAPACK.
9// <T>LAPACK is free software: you can redistribute it and/or modify it under
10// the terms of the BSD 3-Clause license. See the accompanying LICENSE file.
11
12#ifndef TLAPACK_LEGACY_UNM2R_HH
13#define TLAPACK_LEGACY_UNM2R_HH
14
16
17namespace tlapack {
18namespace legacy {
19
51 template <class side_t, class trans_t, typename TA, typename TC>
54 idx_t m,
55 idx_t n,
56 idx_t k,
57 TA* A,
58 idx_t lda,
60 TC* C,
61 idx_t ldc)
62 {
63 using internal::create_matrix;
64 using internal::create_vector;
65
66 // check arguments
67 tlapack_check_false(side != Side::Left && side != Side::Right);
68 tlapack_check_false(trans != Op::NoTrans && trans != Op::Trans &&
69 trans != Op::ConjTrans);
72 const idx_t q = (side == Side::Left) ? m : n;
76
77 // quick return
78 if ((m == 0) || (n == 0) || (k == 0)) return 0;
79
80 // Matrix views
81 const auto A_ = create_matrix<TA>((TA*)A, q, k, lda);
82 const auto tau_ = create_vector((TA*)tau, k);
83 auto C_ = create_matrix<TC>(C, m, n, ldc);
84
85 return unm2r(side, trans, A, tau_, C_);
86 }
87
88} // namespace legacy
89} // namespace tlapack
90
91#endif // TLAPACK_LEGACY_UNM2R_HH
#define tlapack_check_false(cond)
Throw an error if cond is true.
Definition exceptionHandling.hpp:113
int unm2r(side_t side, trans_t trans, idx_t m, idx_t n, idx_t k, TA *A, idx_t lda, const real_type< TA, TC > *tau, TC *C, idx_t ldc)
Applies unitary matrix Q to a matrix C.
Definition unm2r.hpp:52
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