<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
unmr2.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_UNMR2_HH
13#define TLAPACK_UNMR2_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, 0, range{0, nA});
67}
68
108template <TLAPACK_SMATRIX matrixA_t,
109 TLAPACK_SMATRIX matrixC_t,
110 TLAPACK_VECTOR tau_t,
111 TLAPACK_SIDE side_t,
112 TLAPACK_OP trans_t>
115 const matrixA_t& A,
116 const tau_t& tau,
117 matrixC_t& C)
118{
119 using TA = type_t<matrixA_t>;
120 using idx_t = size_type<matrixA_t>;
121
122 // Functor
124
125 // constants
126 const idx_t m = nrows(C);
127 const idx_t n = ncols(C);
128 const idx_t k = size(tau);
129
130 // quick return
131 if ((m == 0) || (n == 0) || (k == 0)) return 0;
132
133 // Allocates workspace
135 std::vector<TA> work_;
136 auto work = new_matrix(work_, workinfo.m, workinfo.n);
137
139 work);
140}
141
142} // namespace tlapack
143
144#endif // TLAPACK_UNMR2_HH
constexpr internal::Backward BACKWARD
Backward direction.
Definition types.hpp:378
constexpr internal::RowwiseStorage ROWWISE_STORAGE
Rowwise storage.
Definition types.hpp:411
#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 unmr2(side_t side, trans_t trans, const matrixA_t &A, const tau_t &tau, matrixC_t &C)
Applies unitary matrix Q from an RQ factorization to a matrix C.
Definition unmr2.hpp:113
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 unmr2_worksize(side_t side, trans_t trans, const matrixA_t &A, const tau_t &tau, const matrixC_t &C)
Worspace query of unmr2()
Definition unmr2.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