<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
larfb.hpp
Go to the documentation of this file.
1
6//
7// Copyright (c) 2021-2023, University of Colorado Denver. All rights reserved.
8//
9// This file is part of <T>LAPACK.
10// <T>LAPACK is free software: you can redistribute it and/or modify it under
11// the terms of the BSD 3-Clause license. See the accompanying LICENSE file.
12
13#ifndef TLAPACK_LEGACY_LARFB_HH
14#define TLAPACK_LEGACY_LARFB_HH
15
17
18namespace tlapack {
19namespace legacy {
20
122 template <class side_t,
123 class trans_t,
124 class direction_t,
125 class storev_t,
126 typename TV,
127 typename TC>
130 direction_t direction,
132 idx_t m,
133 idx_t n,
134 idx_t k,
135 TV const* V,
136 idx_t ldv,
137 TV const* T,
138 idx_t ldt,
139 TC* C,
140 idx_t ldc)
141 {
142 using internal::create_matrix;
143
144 // check arguments
145 tlapack_check_false(side != Side::Left && side != Side::Right);
146 tlapack_check_false(trans != Op::NoTrans && trans != Op::ConjTrans &&
147 ((trans != Op::Trans) || is_complex<TV>));
148 tlapack_check_false(direction != Direction::Backward &&
149 direction != Direction::Forward);
150 tlapack_check_false(storev != StoreV::Columnwise &&
151 storev != StoreV::Rowwise);
152
153 // Quick return
154 if (m <= 0 || n <= 0) return 0;
155
156 // Views
157 const auto V_ = (storev == StoreV::Columnwise)
159 (TV*)V, (side == Side::Left) ? m : n, k, ldv)
161 (TV*)V, k, (side == Side::Left) ? m : n, ldv);
162 const auto T_ = create_matrix<TV>((TV*)T, k, k, ldt);
163 auto C_ = create_matrix<TC>(C, m, n, ldc);
164
165 return larfb(side, trans, direction, storev, V_, T_, C_);
166 }
167
168} // namespace legacy
169} // namespace tlapack
170
171#endif // TLAPACK_LEGACY_LARFB_HH
#define tlapack_check_false(cond)
Throw an error if cond is true.
Definition exceptionHandling.hpp:113
int larfb(side_t side, trans_t trans, direction_t direction, storev_t storev, idx_t m, idx_t n, idx_t k, TV const *V, idx_t ldv, TV const *T, idx_t ldt, TC *C, idx_t ldc)
Applies a block reflector or its conjugate transpose to a m-by-n matrix C, from either the left or ...
Definition larfb.hpp:128
Applies a Householder block reflector to a matrix.
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