<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
larft.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_LARFT_HH
14#define TLAPACK_LEGACY_LARFT_HH
15
17
18namespace tlapack {
19namespace legacy {
20
93 template <class direction_t, class storev_t, typename scalar_t>
94 int larft(direction_t direction,
96 idx_t n,
97 idx_t k,
98 const scalar_t* V,
99 idx_t ldV,
100 const scalar_t* tau,
101 scalar_t* T,
102 idx_t ldT)
103 {
104 using internal::create_matrix;
105 using internal::create_vector;
106
107 // check arguments
108 tlapack_check_false(direction != Direction::Forward &&
109 direction != Direction::Backward);
110 tlapack_check_false(storev != StoreV::Columnwise &&
111 storev != StoreV::Rowwise);
112 tlapack_check_false(n < 0);
114 tlapack_check_false(ldV < ((storev == StoreV::Columnwise) ? n : k));
116
117 // Quick return
118 if (n == 0 || k == 0) return 0;
119
120 // Matrix views
121 auto V_ = (storev == StoreV::Columnwise)
124 auto tau_ = create_vector((scalar_t*)tau, k);
125 auto T_ = create_matrix<scalar_t>(T, k, k, ldT);
126
127 return larft(direction, storev, V_, tau_, T_);
128 }
129
130} // namespace legacy
131} // namespace tlapack
132
133#endif // TLAPACK_LEGACY_LARFT_HH
#define tlapack_check_false(cond)
Throw an error if cond is true.
Definition exceptionHandling.hpp:113
int larft(direction_t direction, storev_t storev, idx_t n, idx_t k, const scalar_t *V, idx_t ldV, const scalar_t *tau, scalar_t *T, idx_t ldT)
Forms the triangular factor T of a block reflector H of order n, which is defined as a product of k e...
Definition larft.hpp:94
Forms the triangular factor T of a block reflector.
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