<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
householder_ql.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_QL_HH
11#define TLAPACK_HOUSEHOLDER_QL_HH
12
16
17namespace tlapack {
18
20enum class HouseholderQLVariant : char { Level2 = '2', Blocked = 'B' };
21
24 HouseholderQLVariant variant = HouseholderQLVariant::Blocked;
25};
26
40template <class T, TLAPACK_MATRIX matrix_t, TLAPACK_VECTOR vector_t>
42 const vector_t& tau,
43 const HouseholderQLOpts& opts = {})
44{
45 // Call variant
46 if (opts.variant == HouseholderQLVariant::Level2)
47 return geql2_worksize<T>(A, tau);
48 else
49 return geqlf_worksize<T>(A, tau, opts);
50}
51
60template <TLAPACK_MATRIX matrix_t,
61 TLAPACK_VECTOR vector_t,
62 TLAPACK_WORKSPACE work_t>
65 work_t& work,
66 const HouseholderQLOpts& opts = {})
67{
68 // Call variant
69 if (opts.variant == HouseholderQLVariant::Level2)
70 return geql2_work(A, tau, work);
71 else
72 return geqlf_work(A, tau, work, opts);
73}
74
109template <TLAPACK_MATRIX matrix_t, TLAPACK_VECTOR vector_t>
111 vector_t& tau,
112 const HouseholderQLOpts& opts = {})
113{
114 // Call variant
115 if (opts.variant == HouseholderQLVariant::Level2)
116 return geql2(A, tau);
117 else
118 return geqlf(A, tau, opts);
119}
120
121} // namespace tlapack
122
123#endif // TLAPACK_HOUSEHOLDER_QL_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 geqlf(A_t &A, tau_t &tau, const GeqlfOpts &opts={})
Computes an RQ factorization of an m-by-n matrix A using a blocked algorithm.
Definition geqlf.hpp:157
int geql2(matrix_t &A, vector_t &tau)
Computes a QL factorization of a matrix A.
Definition geql2.hpp:130
int geql2_work(matrix_t &A, vector_t &tau, work_t &work)
Computes a QL factorization of a matrix A. Workspace is provided as an argument.
Definition geql2.hpp:60
int geqlf_work(A_t &A, tau_t &tau, work_t &work, const GeqlfOpts &opts={})
Computes an RQ factorization of an m-by-n matrix A using a blocked algorithm. Workspace is provided...
Definition geqlf.hpp:80
int householder_ql_work(matrix_t &A, vector_t &tau, work_t &work, const HouseholderQLOpts &opts={})
Computes a QL factorization of an m-by-n matrix A. Workspace is provided as an argument.
Definition householder_ql.hpp:63
int householder_ql(matrix_t &A, vector_t &tau, const HouseholderQLOpts &opts={})
Computes a QL factorization of an m-by-n matrix A.
Definition householder_ql.hpp:110
constexpr WorkInfo householder_ql_worksize(const matrix_t &A, const vector_t &tau, const HouseholderQLOpts &opts={})
Worspace query of householder_ql()
Definition householder_ql.hpp:41
HouseholderQLVariant
Variants of the algorithm to compute the QL factorization.
Definition householder_ql.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 gelqf.
Definition geqlf.hpp:24
Options struct for householder_ql()
Definition householder_ql.hpp:23
Output information in the workspace query.
Definition workspace.hpp:16