<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
ung2l.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_UNG2L_HH
13#define TLAPACK_UNG2L_HH
14
17
18namespace tlapack {
19
32template <class T, TLAPACK_SMATRIX matrix_t, TLAPACK_VECTOR vector_t>
33constexpr WorkInfo ung2l_worksize(const matrix_t& A, const vector_t& tau)
34{
35 using idx_t = size_type<matrix_t>;
37
38 // constants
39 const idx_t n = ncols(A);
40
41 if (n > 1) {
42 auto&& C = cols(A, range{1, n});
44 col(A, 0), tau[0], C);
45 }
46 return WorkInfo(0);
47}
48
73template <TLAPACK_SMATRIX matrix_t,
74 TLAPACK_VECTOR vector_t,
75 TLAPACK_WORKSPACE work_t>
80
103template <TLAPACK_SMATRIX matrix_t, TLAPACK_VECTOR vector_t>
105{
106 using T = type_t<matrix_t>;
107 using idx_t = size_type<matrix_t>;
108
109 // functor
111
112 // constants
113 const idx_t n = ncols(A);
114
115 // quick return
116 if (n <= 0) return 0;
117
118 // Allocates workspace
120 std::vector<T> work_;
121 auto work = new_matrix(work_, workinfo.m, workinfo.n);
122
123 return ung2l_work(A, tau, work);
124}
125
126} // namespace tlapack
127
128#endif // TLAPACK_UNG2L_HH
constexpr internal::Backward BACKWARD
Backward direction.
Definition types.hpp:378
constexpr internal::ColumnwiseStorage COLUMNWISE_STORAGE
Columnwise storage.
Definition types.hpp:409
constexpr internal::LeftSide LEFT_SIDE
left side
Definition types.hpp:289
#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
#define TLAPACK_VECTOR
Macro for tlapack::concepts::Vector compatible with C++17.
Definition concepts.hpp:906
int ung2l(matrix_t &A, const vector_t &tau)
Generates an m-by-n matrix Q with orthonormal columns, which is defined as the last n columns of a pr...
Definition ung2l.hpp:104
int ung2l_work(matrix_t &A, const vector_t &tau, work_t &work)
Generates an m-by-n matrix Q with orthonormal columns, which is defined as the last n columns of a pr...
Definition ung2l.hpp:76
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
constexpr WorkInfo ung2l_worksize(const matrix_t &A, const vector_t &tau)
Worspace query of ung2l()
Definition ung2l.hpp:33
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