<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
ungl2.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_UNGL2_HH
13#define TLAPACK_UNGL2_HH
14
17
18namespace tlapack {
19
32template <class T, TLAPACK_SMATRIX matrix_t, TLAPACK_VECTOR vector_t>
33constexpr WorkInfo ungl2_worksize(const matrix_t& Q, const vector_t& tauw)
34{
35 using idx_t = size_type<matrix_t>;
37
38 // constants
39 const idx_t k = nrows(Q);
40
41 if (k > 1) {
42 auto&& C = rows(Q, range{1, k});
44 tauw[0], C);
45 }
46 return WorkInfo(0);
47}
48
76template <TLAPACK_SMATRIX matrix_t,
77 TLAPACK_VECTOR vector_t,
78 TLAPACK_WORKSPACE work_t>
83
109template <TLAPACK_SMATRIX matrix_t, TLAPACK_VECTOR vector_t>
111{
112 using T = type_t<matrix_t>;
113
114 // functor
116
117 // Allocates workspace
119 std::vector<T> work_;
120 auto work = new_matrix(work_, workinfo.m, workinfo.n);
121
122 return ungl2_work(Q, tauw, work);
123}
124} // namespace tlapack
125#endif // TLAPACK_UNGL2_HH
constexpr internal::RightSide RIGHT_SIDE
right side
Definition types.hpp:291
constexpr internal::RowwiseStorage ROWWISE_STORAGE
Rowwise storage.
Definition types.hpp:411
constexpr internal::Forward FORWARD
Forward direction.
Definition types.hpp:376
#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 ungl2(matrix_t &Q, const vector_t &tauw)
Generates all or part of the unitary matrix Q from an LQ factorization determined by gelq2 (unblocked...
Definition ungl2.hpp:110
int ungl2_work(matrix_t &Q, const vector_t &tauw, work_t &work)
Generates all or part of the unitary matrix Q from an LQ factorization determined by gelq2 (unblocked...
Definition ungl2.hpp:79
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 ungl2_worksize(const matrix_t &Q, const vector_t &tauw)
Worspace query of ungl2()
Definition ungl2.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