<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
potrs.hpp
Go to the documentation of this file.
1
3//
4// Copyright (c) 2021-2023, University of Colorado Denver. All rights reserved.
5//
6// This file is part of <T>LAPACK.
7// <T>LAPACK is free software: you can redistribute it and/or modify it under
8// the terms of the BSD 3-Clause license. See the accompanying LICENSE file.
9
10#ifndef TLAPACK_POTRS_HH
11#define TLAPACK_POTRS_HH
12
14#include "tlapack/blas/trsm.hpp"
15
16namespace tlapack {
17
53template <TLAPACK_UPLO uplo_t,
54 TLAPACK_MATRIX matrixA_t,
55 TLAPACK_MATRIX matrixB_t>
57{
58 using T = type_t<matrixB_t>;
59 using real_t = real_type<T>;
60
61 // Constants
62 const real_t one(1);
63
64 // Check arguments
65 tlapack_check_false(uplo != Uplo::Lower && uplo != Uplo::Upper);
66 tlapack_check_false(nrows(A) != ncols(A));
67 tlapack_check_false(nrows(B) != ncols(A));
68
69 if (uplo == Uplo::Upper) {
70 // Solve A*X = B where A = U**H *U.
73 }
74 else {
75 // Solve A*X = B where A = L*L**H.
78 }
79 return 0;
80}
81
82} // namespace tlapack
83
84#endif // TLAPACK_POTRS_HH
constexpr internal::LowerTriangle LOWER_TRIANGLE
Lower Triangle access.
Definition types.hpp:183
constexpr internal::UpperTriangle UPPER_TRIANGLE
Upper Triangle access.
Definition types.hpp:181
constexpr internal::NonUnitDiagonal NON_UNIT_DIAG
The main diagonal is not assumed to consist of 1's.
Definition types.hpp:215
constexpr internal::ConjTranspose CONJ_TRANS
conjugate transpose
Definition types.hpp:259
constexpr internal::NoTranspose NO_TRANS
no transpose
Definition types.hpp:255
constexpr internal::LeftSide LEFT_SIDE
left side
Definition types.hpp:289
#define TLAPACK_UPLO
Macro for tlapack::concepts::Uplo compatible with C++17.
Definition concepts.hpp:942
#define TLAPACK_MATRIX
Macro for tlapack::concepts::Matrix compatible with C++17.
Definition concepts.hpp:896
void trsm(Side side, Uplo uplo, Op trans, Diag diag, const alpha_t &alpha, const matrixA_t &A, matrixB_t &B)
Solve the triangular matrix-vector equation.
Definition trsm.hpp:76
int potrs(uplo_t uplo, const matrixA_t &A, matrixB_t &B)
Apply the Cholesky factorization to solve a linear system.
Definition potrs.hpp:56
#define tlapack_check_false(cond)
Throw an error if cond is true.
Definition exceptionHandling.hpp:113
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