<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
gen_householder_q.hpp
Go to the documentation of this file.
1
3//
4// Copyright (c) 2021-2023, University of Colorado Denver. All rights reserved.
5//
6// This file is part of <T>LAPACK.
7// <T>LAPACK is free software: you can redistribute it and/or modify it under
8// the terms of the BSD 3-Clause license. See the accompanying LICENSE file.
9
10#ifndef TLAPACK_GEN_HOUSEHOLDER_Q_HH
11#define TLAPACK_GEN_HOUSEHOLDER_Q_HH
12
16
17namespace tlapack {
18
21enum class GenHouseholderQVariant : char { Level2 = '2', Blocked = 'B' };
22
25 GenHouseholderQVariant variant = GenHouseholderQVariant::Blocked;
26};
27
45template <class T,
51 direction_t direction,
53 const matrix_t& A,
54 const vector_t& tau,
55 const GenHouseholderQOpts& opts = {})
56{
57 if (opts.variant == GenHouseholderQVariant::Level2)
58 return ungq_level2_worksize<T>(direction, storeMode, A, tau);
59 else
60 return ungq_worksize<T>(direction, storeMode, A, tau, opts);
61}
62
72template <TLAPACK_SMATRIX matrix_t,
73 TLAPACK_VECTOR vector_t,
74 TLAPACK_DIRECTION direction_t,
75 TLAPACK_STOREV storage_t,
76 TLAPACK_WORKSPACE work_t>
79 matrix_t& A,
80 const vector_t& tau,
81 work_t& work,
82 const GenHouseholderQOpts& opts = {})
83{
84 if (opts.variant == GenHouseholderQVariant::Level2)
85 return ungq_level2_work(direction, storeMode, A, tau, work);
86 else
87 return ungq_work(direction, storeMode, A, tau, work, opts);
88}
89
153template <TLAPACK_SMATRIX matrix_t,
154 TLAPACK_VECTOR vector_t,
155 TLAPACK_DIRECTION direction_t,
156 TLAPACK_STOREV storage_t>
159 matrix_t& A,
160 const vector_t& tau,
161 const GenHouseholderQOpts& opts = {})
162{
163 if (opts.variant == GenHouseholderQVariant::Level2)
164 return ungq_level2(direction, storeMode, A, tau);
165 else
166 return ungq(direction, storeMode, A, tau, opts);
167}
168
169} // namespace tlapack
170
171#endif
#define TLAPACK_STOREV
Macro for tlapack::concepts::StoreV compatible with C++17.
Definition concepts.hpp:936
#define TLAPACK_SMATRIX
Macro for tlapack::concepts::SliceableMatrix compatible with C++17.
Definition concepts.hpp:899
#define TLAPACK_DIRECTION
Macro for tlapack::concepts::Direction compatible with C++17.
Definition concepts.hpp:930
#define TLAPACK_WORKSPACE
Macro for tlapack::concepts::Workspace compatible with C++17.
Definition concepts.hpp:912
#define TLAPACK_VECTOR
Macro for tlapack::concepts::Vector compatible with C++17.
Definition concepts.hpp:906
GenHouseholderQVariant
Variants of the algorithm to generate the unitary matrix Q from a set of Householder reflectors.
Definition gen_householder_q.hpp:21
int ungq(direction_t direction, storage_t storeMode, matrix_t &A, const vector_t &tau, const UngqOpts &opts={})
Generates a matrix Q that is the product of elementary reflectors.
Definition ungq.hpp:352
int ungq_level2(direction_t direction, storage_t storeMode, matrix_t &A, const vector_t &tau)
Generates a matrix Q that is the product of elementary reflectors.
Definition ungq_level2.hpp:289
int ungq_work(direction_t direction, storage_t storeMode, matrix_t &A, const vector_t &tau, work_t &work, const UngqOpts &opts={})
Generates a matrix Q that is the product of elementary reflectors. Workspace is provided as an argu...
Definition ungq.hpp:138
int ungq_level2_work(direction_t direction, storage_t storeMode, matrix_t &A, const vector_t &tau, work_t &work)
Generates a matrix Q that is the product of elementary reflectors. Workspace is provided as an argu...
Definition ungq_level2.hpp:90
int gen_householder_q_work(direction_t direction, storage_t storeMode, matrix_t &A, const vector_t &tau, work_t &work, const GenHouseholderQOpts &opts={})
Generates a matrix Q that is the product of elementary reflectors. Workspace is provided as an argu...
Definition gen_householder_q.hpp:77
int gen_householder_q(direction_t direction, storage_t storeMode, matrix_t &A, const vector_t &tau, const GenHouseholderQOpts &opts={})
Generates a matrix Q that is the product of elementary reflectors.
Definition gen_householder_q.hpp:157
constexpr WorkInfo gen_householder_q_worksize(direction_t direction, storage_t storeMode, const matrix_t &A, const vector_t &tau, const GenHouseholderQOpts &opts={})
Worspace query of gen_householder_q()
Definition gen_householder_q.hpp:50
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
Options struct for gen_householder_q()
Definition gen_householder_q.hpp:24
Options struct for ungq.
Definition ungq.hpp:26
Output information in the workspace query.
Definition workspace.hpp:16