<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
potrf.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_POTRF_HH
12#define TLAPACK_POTRF_HH
13
19
20namespace tlapack {
21
23enum class PotrfVariant : char {
24 Blocked = 'B',
25 Recursive = 'R',
26 Level2 = '2',
27 RightLooking
28};
29
32 constexpr PotrfOpts(const EcOpts& opts = {}) : BlockedCholeskyOpts(opts){};
33
34 PotrfVariant variant = PotrfVariant::Blocked;
35};
36
77template <TLAPACK_UPLO uplo_t, TLAPACK_MATRIX matrix_t>
79{
80 // check arguments
81 tlapack_check(uplo == Uplo::Lower || uplo == Uplo::Upper);
82 tlapack_check(nrows(A) == ncols(A));
83 tlapack_check(opts.variant == PotrfVariant::Blocked ||
84 opts.variant == PotrfVariant::Recursive ||
85 opts.variant == PotrfVariant::Level2 ||
86 opts.variant == PotrfVariant::RightLooking);
87
88 // Call variant
89 if (opts.variant == PotrfVariant::Blocked)
90 return potrf_blocked(uplo, A, opts);
91 else if (opts.variant == PotrfVariant::Recursive)
92 return potrf2(uplo, A, opts);
93 else if (opts.variant == PotrfVariant::Level2)
94 return potf2(uplo, A);
95 else
96 return potrf_rl(uplo, A, opts);
97}
98
99} // namespace tlapack
100
101#endif // TLAPACK_POTRF_HH
int potrf2(uplo_t uplo, matrix_t &A, const EcOpts &opts={})
Computes the Cholesky factorization of a Hermitian positive definite matrix A using the recursive alg...
Definition potrf2.hpp:73
int potrf_rl(uplo_t uplo, matrix_t &A, const BlockedCholeskyOpts &opts={})
Computes the Cholesky factorization of a Hermitian positive definite matrix A using a blocked algorit...
Definition potrf_blocked_right_looking.hpp:62
int potrf_blocked(uplo_t uplo, matrix_t &A, const BlockedCholeskyOpts &opts)
Computes the Cholesky factorization of a Hermitian positive definite matrix A using a blocked algorit...
Definition potrf_blocked.hpp:66
int potf2(uplo_t uplo, matrix_t &A)
Computes the Cholesky factorization of a Hermitian positive definite matrix A using a level-2 algorit...
Definition potf2.hpp:58
#define tlapack_check(cond)
Throw an error if cond is false.
Definition exceptionHandling.hpp:98
int potrf(uplo_t uplo, matrix_t &A, const PotrfOpts &opts={})
Computes the Cholesky factorization of a Hermitian positive definite matrix A.
Definition potrf.hpp:78
Computes the Cholesky factorization of a Hermitian positive definite matrix A using a level-2 algorit...
PotrfVariant
Variants of the algorithm to compute the Cholesky factorization.
Definition potrf.hpp:23
Computes the Cholesky factorization of a Hermitian positive definite matrix A using the recursive alg...
Computes the Cholesky factorization of a Hermitian positive definite matrix A using a blocked algorit...
Computes the Cholesky factorization of a Hermitian positive definite matrix A using the right-looking...
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
Definition potrf_blocked.hpp:22
Options for error checking.
Definition exceptionHandling.hpp:76
Options struct for potrf()
Definition potrf.hpp:31