<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
unm2r.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_UNM2R_HH
13#define TLAPACK_UNM2R_HH
14
17
18namespace tlapack {
19
45template <class T,
46 TLAPACK_SMATRIX matrixA_t,
47 TLAPACK_SMATRIX matrixC_t,
48 TLAPACK_VECTOR tau_t,
49 TLAPACK_SIDE side_t,
50 TLAPACK_OP trans_t>
53 const matrixA_t& A,
54 const tau_t& tau,
55 const matrixC_t& C)
56{
57 using idx_t = size_type<matrixA_t>;
59
60 // constants
61 const idx_t m = nrows(C);
62 const idx_t n = ncols(C);
63 const idx_t nA = (side == Side::Left) ? m : n;
64
65 auto&& v = slice(A, range{0, nA}, 0);
67}
68
120template <TLAPACK_SMATRIX matrixA_t,
121 TLAPACK_SMATRIX matrixC_t,
122 TLAPACK_VECTOR tau_t,
123 TLAPACK_SIDE side_t,
124 TLAPACK_OP trans_t>
127 const matrixA_t& A,
128 const tau_t& tau,
129 matrixC_t& C)
130{
131 using idx_t = size_type<matrixA_t>;
133 using T = type_t<work_t>;
134
135 // Functor
137
138 // constants
139 const idx_t m = nrows(C);
140 const idx_t n = ncols(C);
141 const idx_t k = size(tau);
142
143 // quick return
144 if ((m == 0) || (n == 0) || (k == 0)) return 0;
145
146 // Allocates workspace
148 std::vector<T> work_;
149 auto work = new_matrix(work_, workinfo.m, workinfo.n);
150
152 work);
153}
154
155} // namespace tlapack
156
157#endif // TLAPACK_UNM2R_HH
constexpr internal::Forward FORWARD
Forward direction.
Definition types.hpp:376
constexpr internal::ColumnwiseStorage COLUMNWISE_STORAGE
Columnwise storage.
Definition types.hpp:409
#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_OP
Macro for tlapack::concepts::Op compatible with C++17.
Definition concepts.hpp:933
#define TLAPACK_VECTOR
Macro for tlapack::concepts::Vector compatible with C++17.
Definition concepts.hpp:906
int unm2r(side_t side, trans_t trans, const matrixA_t &A, const tau_t &tau, matrixC_t &C)
Applies unitary matrix Q to a matrix C.
Definition unm2r.hpp:125
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
constexpr WorkInfo unm2r_worksize(side_t side, trans_t trans, const matrixA_t &A, const tau_t &tau, const matrixC_t &C)
Worspace query of unm2r()
Definition unm2r.hpp:51
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