<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
lantr.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_LEGACY_LANTR_HH
11#define TLAPACK_LEGACY_LANTR_HH
12
15
16namespace tlapack {
17namespace legacy {
18
48 template <typename TA>
50 Uplo uplo,
51 Diag diag,
52 idx_t m,
53 idx_t n,
54 const TA* A,
55 idx_t lda)
56 {
57 using internal::create_matrix;
58
59 // check arguments
60 tlapack_check_false(normType != Norm::Fro && normType != Norm::Inf &&
61 normType != Norm::Max && normType != Norm::One);
62 tlapack_check_false(uplo != Uplo::Lower && uplo != Uplo::Upper);
63 tlapack_check_false(diag != Diag::NonUnit && diag != Diag::Unit);
64
65 // quick return
66 if (m == 0 || n == 0) return 0;
67
68 // Matrix views
69 auto A_ = create_matrix<TA>((TA*)A, m, n, lda);
70
71 return lantr(normType, uplo, diag, A_);
72 }
73
74} // namespace legacy
75} // namespace tlapack
76
77#endif // TLAPACK_LEGACY_LANTR_HH
Diag
Definition types.hpp:192
Uplo
Definition types.hpp:45
Norm
Definition types.hpp:296
constexpr auto diag(T &A, int diagIdx=0) noexcept
Get the Diagonal of an Eigen Matrix.
Definition eigen.hpp:576
#define tlapack_check_false(cond)
Throw an error if cond is true.
Definition exceptionHandling.hpp:113
real_type< TA > lantr(Norm normType, Uplo uplo, Diag diag, idx_t m, idx_t n, const TA *A, idx_t lda)
Calculates the value of the one norm, Frobenius norm, infinity norm, or element of largest absolute v...
Definition lantr.hpp:49
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