<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
unml2.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_UNML2_HH
13#define TLAPACK_UNML2_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 idx_t = size_type<matrixA_t>;
121 using T = type_t<work_t>;
122
123 // Functor
125
126 // constants
127 const idx_t m = nrows(C);
128 const idx_t n = ncols(C);
129 const idx_t k = size(tau);
130
131 // quick return
132 if ((m == 0) || (n == 0) || (k == 0)) return 0;
133
134 // Allocates workspace
136 std::vector<T> work_;
137 auto work = new_matrix(work_, workinfo.m, workinfo.n);
138
140 work);
141}
142
143} // namespace tlapack
144
145#endif // TLAPACK_UNML2_HH
constexpr internal::RowwiseStorage ROWWISE_STORAGE
Rowwise storage.
Definition types.hpp:411
constexpr internal::Forward FORWARD
Forward direction.
Definition types.hpp:376
#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 unml2(side_t side, trans_t trans, const matrixA_t &A, const tau_t &tau, matrixC_t &C)
Applies unitary matrix Q from an LQ factorization to a matrix C.
Definition unml2.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 unml2_worksize(side_t side, trans_t trans, const matrixA_t &A, const tau_t &tau, const matrixC_t &C)
Worspace query of unml2()
Definition unml2.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