<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
householder_rq.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_RQ_HH
11#define TLAPACK_HOUSEHOLDER_RQ_HH
12
16
17namespace tlapack {
18
20enum class HouseholderRQVariant : char { Level2 = '2', Blocked = 'B' };
21
24 HouseholderRQVariant variant = HouseholderRQVariant::Blocked;
25};
26
40template <class T, TLAPACK_MATRIX matrix_t, TLAPACK_VECTOR vector_t>
42 const vector_t& tau,
43 const HouseholderRQOpts& opts = {})
44{
45 // Call variant
46 if (opts.variant == HouseholderRQVariant::Level2)
47 return gerq2_worksize<T>(A, tau);
48 else
49 return gerqf_worksize<T>(A, tau, opts);
50}
51
60template <TLAPACK_MATRIX matrix_t,
61 TLAPACK_VECTOR vector_t,
62 TLAPACK_WORKSPACE workspace_t>
66 const HouseholderRQOpts& opts = {})
67{
68 // Call variant
69 if (opts.variant == HouseholderRQVariant::Level2)
70 return gerq2_work(A, tau, work);
71 else
72 return gerqf_work(A, tau, work, opts);
73}
74
109template <TLAPACK_MATRIX matrix_t, TLAPACK_VECTOR vector_t>
111 vector_t& tau,
112 const HouseholderRQOpts& opts = {})
113{
114 // Call variant
115 if (opts.variant == HouseholderRQVariant::Level2)
116 return gerq2(A, tau);
117 else
118 return gerqf(A, tau, opts);
119}
120
121} // namespace tlapack
122
123#endif // TLAPACK_HOUSEHOLDER_RQ_HH
#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
#define TLAPACK_MATRIX
Macro for tlapack::concepts::Matrix compatible with C++17.
Definition concepts.hpp:896
int gerq2(matrix_t &A, vector_t &tau)
Computes an RQ factorization of a matrix A.
Definition gerq2.hpp:130
int gerqf(A_t &A, tau_t &tau, const GerqfOpts &opts={})
Computes an RQ factorization of an m-by-n matrix A using a blocked algorithm.
Definition gerqf.hpp:160
int gerq2_work(matrix_t &A, vector_t &tau, work_t &work)
Computes an RQ factorization of a matrix A. Workspace is provided as an argument.
Definition gerq2.hpp:60
int gerqf_work(A_t &A, tau_t &tau, work_t &work, const GerqfOpts &opts={})
Computes an RQ factorization of an m-by-n matrix A using a blocked algorithm. Workspace is provided...
Definition gerqf.hpp:80
int householder_rq_work(matrix_t &A, vector_t &tau, workspace_t &work, const HouseholderRQOpts &opts={})
Computes a RQ factorization of an m-by-n matrix A. Workspace is provided as an argument.
Definition householder_rq.hpp:63
int householder_rq(matrix_t &A, vector_t &tau, const HouseholderRQOpts &opts={})
Computes a RQ factorization of an m-by-n matrix A.
Definition householder_rq.hpp:110
constexpr WorkInfo householder_rq_worksize(const matrix_t &A, const vector_t &tau, const HouseholderRQOpts &opts={})
Worspace query of householder_rq()
Definition householder_rq.hpp:41
HouseholderRQVariant
Variants of the algorithm to compute the RQ factorization.
Definition householder_rq.hpp:20
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 gerqf.
Definition gerqf.hpp:24
Options struct for householder_rq()
Definition householder_rq.hpp:23
Output information in the workspace query.
Definition workspace.hpp:16