<T>LAPACK 0.1.2
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
hetrf.hpp
Go to the documentation of this file.
1
4//
5// Copyright (c) 2021-2023, University of Colorado Denver. All rights reserved.
6//
7// This file is part of <T>LAPACK.
8// <T>LAPACK is free software: you can redistribute it and/or modify it under
9// the terms of the BSD 3-Clause license. See the accompanying LICENSE file.
10
11#ifndef TLAPACK_HETRF_HH
12#define TLAPACK_HETRF_HH
13
16
17namespace tlapack {
18
20enum class HetrfVariant : char {
21 Blocked = 'B' // blocked Bunch-Kaufman with diagonal pivoting
22};
23
25struct HetrfOpts : public BlockedLDLOpts {
26 constexpr HetrfOpts(const EcOpts& opts = {}) : BlockedLDLOpts(opts){};
27
28 HetrfVariant variant = HetrfVariant::Blocked;
29};
30
40template <TLAPACK_UPLO uplo_t,
45 matrix_t& A,
46 ipiv_t& ipiv,
47 work_t& work,
48 const HetrfOpts& opts = {})
49{
50 // check arguments
52 tlapack_check(nrows(A) == ncols(A));
53 tlapack_check(opts.invariant == Op::Trans ||
54 opts.invariant == Op::ConjTrans);
55 tlapack_check(opts.variant == HetrfVariant::Blocked);
56 // Call variant
57 if (opts.variant == HetrfVariant::Blocked)
59 else
60 return 0;
61}
62
130template <TLAPACK_UPLO uplo_t, TLAPACK_MATRIX matrix_t, TLAPACK_VECTOR ipiv_t>
132{
133 // check arguments
135 tlapack_check(nrows(A) == ncols(A));
136 tlapack_check(opts.invariant == Op::Trans ||
137 opts.invariant == Op::ConjTrans);
138 tlapack_check(opts.variant == HetrfVariant::Blocked);
139 // Call variant
140 if (opts.variant == HetrfVariant::Blocked)
141 return hetrf_blocked(uplo, A, ipiv, opts);
142 else
143 return 0;
144}
145
146} // namespace tlapack
147
148#endif // TLAPACK_HETRF_HH
#define TLAPACK_UPLO
Macro for tlapack::concepts::Uplo compatible with C++17.
Definition concepts.hpp:942
#define TLAPACK_WORKSPACE
Macro for tlapack::concepts::Workspace compatible with C++17.
Definition concepts.hpp:912
#define TLAPACK_VECTOR
Macro for tlapack::concepts::Vector compatible with C++17.
Definition concepts.hpp:906
#define TLAPACK_MATRIX
Macro for tlapack::concepts::Matrix compatible with C++17.
Definition concepts.hpp:896
int hetrf_blocked(uplo_t uplo, matrix_t &A, ipiv_t &ipiv, const BlockedLDLOpts &opts)
Computes the Bunch-Kaufman factorization of a symmetric or Hermitian matrix A.
Definition hetrf_blocked.hpp:124
int hetrf_blocked_work(uplo_t uplo, matrix_t &A, ipiv_t &ipiv, work_t &work, const BlockedLDLOpts &opts)
Computes the Bunch-Kaufman factorization of a symmetric or Hermitian matrix A. Workspace is provide...
Definition hetrf_blocked.hpp:51
#define tlapack_check(cond)
Throw an error if cond is false.
Definition exceptionHandling.hpp:98
int hetrf(uplo_t uplo, matrix_t &A, ipiv_t &ipiv, const HetrfOpts &opts={})
Computes the Bunch-Kaufman factorization of a symmetric or Hermitian matrix A.
Definition hetrf.hpp:131
int hetrf_work(uplo_t uplo, matrix_t &A, ipiv_t &ipiv, work_t &work, const HetrfOpts &opts={})
Computes the Bunch-Kaufman factorization of a symmetric or Hermitian matrix A. Workspace is provide...
Definition hetrf.hpp:44
Computes the Bunch-Kaufman factorization of a symmetric or Hermitian matrix A using a blocked algorit...
Sort the numbers in D in increasing order (if ID = 'I') or in decreasing order (if ID = 'D' ).
Definition arrayTraits.hpp:15
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
@ Trans
transpose
@ ConjTrans
conjugate transpose
HetrfVariant
Variants of the algorithm to compute the Bunch-Kaufman factorization.
Definition hetrf.hpp:20
@ Upper
0 <= i <= j, 0 <= j <= n.
@ Lower
0 <= i <= m, 0 <= j <= i.
Options struct for hetrf_blocked()
Definition hetf3.hpp:27
Options for error checking.
Definition exceptionHandling.hpp:76
Options struct for hetrf()
Definition hetrf.hpp:25