<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
householder_q_mul.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_HOUSEHOLDER_Q_MUL_HH
11#define TLAPACK_HOUSEHOLDER_Q_MUL_HH
12
16
17namespace tlapack {
18
21enum class HouseholderQMulVariant : char { Level2 = '2', Blocked = 'B' };
22
25 HouseholderQMulVariant variant = HouseholderQMulVariant::Blocked;
26};
27
72template <class T,
83 direction_t direction,
85 const matrixV_t& V,
86 const vector_t& tau,
87 const matrixC_t& C,
88 const HouseholderQMulOpts& opts = {})
89{
90 if (opts.variant == HouseholderQMulVariant::Level2)
91 return unmq_level2_worksize<T>(side, trans, direction, storeMode, V,
92 tau, C);
93 else
94 return unmq_worksize<T>(side, trans, direction, storeMode, V, tau, C,
95 opts);
96}
97
106template <TLAPACK_SMATRIX matrixV_t,
107 TLAPACK_SMATRIX matrixC_t,
108 TLAPACK_SVECTOR vector_t,
109 TLAPACK_SIDE side_t,
110 TLAPACK_OP trans_t,
111 TLAPACK_DIRECTION direction_t,
112 TLAPACK_STOREV storage_t,
113 TLAPACK_WORKSPACE work_t>
116 direction_t direction,
118 const matrixV_t& V,
119 const vector_t& tau,
120 matrixC_t& C,
121 work_t& work,
122 const HouseholderQMulOpts& opts = {})
123{
124 if (opts.variant == HouseholderQMulVariant::Level2)
125 return unmq_level2_work(side, trans, direction, storeMode, V, tau, C,
126 work);
127 else
128 return unmq_work(side, trans, direction, storeMode, V, tau, C, work,
129 opts);
130}
131
226template <TLAPACK_SMATRIX matrixV_t,
227 TLAPACK_SMATRIX matrixC_t,
228 TLAPACK_SVECTOR vector_t,
229 TLAPACK_SIDE side_t,
230 TLAPACK_OP trans_t,
231 TLAPACK_DIRECTION direction_t,
232 TLAPACK_STOREV storage_t>
235 direction_t direction,
237 const matrixV_t& V,
238 const vector_t& tau,
239 matrixC_t& C,
240 const HouseholderQMulOpts& opts = {})
241{
242 if (opts.variant == HouseholderQMulVariant::Level2)
243 return unmq_level2(side, trans, direction, storeMode, V, tau, C);
244 else
245 return unmq(side, trans, direction, storeMode, V, tau, C, opts);
246}
247
248} // namespace tlapack
249
250#endif
#define TLAPACK_SVECTOR
Macro for tlapack::concepts::SliceableVector compatible with C++17.
Definition concepts.hpp:909
#define TLAPACK_STOREV
Macro for tlapack::concepts::StoreV compatible with C++17.
Definition concepts.hpp:936
#define TLAPACK_SIDE
Macro for tlapack::concepts::Side compatible with C++17.
Definition concepts.hpp:927
#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_OP
Macro for tlapack::concepts::Op compatible with C++17.
Definition concepts.hpp:933
#define TLAPACK_WORKSPACE
Macro for tlapack::concepts::Workspace compatible with C++17.
Definition concepts.hpp:912
int unmq_level2(side_t side, trans_t trans, direction_t direction, storage_t storeMode, const matrixV_t &V, const vector_t &tau, matrixC_t &C)
Applies unitary matrix Q to a matrix C.
Definition unmq_level2.hpp:308
int unmq(side_t side, trans_t trans, direction_t direction, storage_t storeMode, const matrixV_t &V, const vector_t &tau, matrixC_t &C, const UnmqOpts &opts={})
Applies unitary matrix Q to a matrix C.
Definition unmq.hpp:282
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 unmq_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, const UnmqOpts &opts={})
Applies unitary matrix Q to a matrix C. Workspace is provided as an argument.
Definition unmq.hpp:131
int householder_q_mul_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, const HouseholderQMulOpts &opts={})
Applies unitary matrix Q to a matrix C. Workspace is provided as an argument.
Definition householder_q_mul.hpp:114
int householder_q_mul(side_t side, trans_t trans, direction_t direction, storage_t storeMode, const matrixV_t &V, const vector_t &tau, matrixC_t &C, const HouseholderQMulOpts &opts={})
Applies unitary matrix Q to a matrix C.
Definition householder_q_mul.hpp:233
constexpr WorkInfo householder_q_mul_worksize(side_t side, trans_t trans, direction_t direction, storage_t storeMode, const matrixV_t &V, const vector_t &tau, const matrixC_t &C, const HouseholderQMulOpts &opts={})
Workspace query of householder_q_mul()
Definition householder_q_mul.hpp:80
HouseholderQMulVariant
Variants of the algorithm to multiply by the unitary matrix Q, defined by a set of Householder reflec...
Definition householder_q_mul.hpp:21
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 householder_q_mul()
Definition householder_q_mul.hpp:24
Options struct for unmq.
Definition unmq.hpp:25
Output information in the workspace query.
Definition workspace.hpp:16