<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
unmhr.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_UNMHR_HH
13#define TLAPACK_UNMHR_HH
14
18
19namespace tlapack {
20
50template <class T, TLAPACK_SMATRIX matrix_t, TLAPACK_SVECTOR vector_t>
52 Op trans,
55 const matrix_t& A,
56 const vector_t& tau,
57 const matrix_t& C)
58{
59 using idx_t = size_type<matrix_t>;
61
62 auto&& A_s = slice(A, range{ilo + 1, ihi}, range{ilo, ihi - 1});
63 auto&& tau_s = slice(tau, range{ilo, ihi - 1});
64 auto&& C_s = (side == Side::Left)
65 ? slice(C, range{ilo + 1, ihi}, range{0, ncols(C)})
66 : slice(C, range{0, nrows(C)}, range{ilo + 1, ihi});
67
69 A_s, tau_s, C_s);
70}
71
80template <TLAPACK_SMATRIX matrix_t,
81 TLAPACK_SVECTOR vector_t,
82 TLAPACK_WORKSPACE work_t>
84 Op trans,
87 const matrix_t& A,
88 const vector_t& tau,
89 matrix_t& C,
90 work_t& work)
91{
92 using idx_t = size_type<matrix_t>;
94
95 auto A_s = slice(A, range{ilo + 1, ihi}, range{ilo, ihi - 1});
96 auto tau_s = slice(tau, range{ilo, ihi - 1});
97 auto C_s = (side == Side::Left)
98 ? slice(C, range{ilo + 1, ihi}, range{0, ncols(C)})
99 : slice(C, range{0, nrows(C)}, range{ilo + 1, ihi});
100
102 tau_s, C_s, work);
103}
104
137template <TLAPACK_SMATRIX matrix_t, TLAPACK_SVECTOR vector_t>
139 Op trans,
142 const matrix_t& A,
143 const vector_t& tau,
144 matrix_t& C)
145{
146 using T = type_t<matrix_t>;
147
148 // functor
150
151 // Allocates workspace
153 std::vector<T> work_;
154 auto work = new_matrix(work_, workinfo.m, workinfo.n);
155
156 return unmhr_work(side, trans, ilo, ihi, A, tau, C, work);
157}
158} // namespace tlapack
159
160#endif // TLAPACK_UNMHR_HH
Side
Definition types.hpp:266
constexpr internal::Forward FORWARD
Forward direction.
Definition types.hpp:376
Op
Definition types.hpp:222
constexpr internal::ColumnwiseStorage COLUMNWISE_STORAGE
Columnwise storage.
Definition types.hpp:409
#define TLAPACK_SVECTOR
Macro for tlapack::concepts::SliceableVector compatible with C++17.
Definition concepts.hpp:909
#define TLAPACK_SMATRIX
Macro for tlapack::concepts::SliceableMatrix compatible with C++17.
Definition concepts.hpp:899
#define TLAPACK_WORKSPACE
Macro for tlapack::concepts::Workspace compatible with C++17.
Definition concepts.hpp:912
int unmhr(Side side, Op trans, size_type< matrix_t > ilo, size_type< matrix_t > ihi, const matrix_t &A, const vector_t &tau, matrix_t &C)
Applies unitary matrix Q to a matrix C.
Definition unmhr.hpp:138
int unmq_level2_work(side_t side, trans_t trans, direction_t direction, storage_t storeMode, const matrixV_t &V, const vector_t &tau, matrixC_t &C, work_t &work)
Applies unitary matrix Q to a matrix C. Workspace is provided as an argument.
Definition unmq_level2.hpp:109
int unmhr_work(Side side, Op trans, size_type< matrix_t > ilo, size_type< matrix_t > ihi, const matrix_t &A, const vector_t &tau, matrix_t &C, work_t &work)
Applies unitary matrix Q to a matrix C. Workspace is provided as an argument.
Definition unmhr.hpp:83
constexpr WorkInfo unmhr_worksize(Side side, Op trans, size_type< matrix_t > ilo, size_type< matrix_t > ihi, const matrix_t &A, const vector_t &tau, const matrix_t &C)
Worspace query of unmhr()
Definition unmhr.hpp:51
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
Output information in the workspace query.
Definition workspace.hpp:16