<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
lansy.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_LANSY_HH
11#define TLAPACK_LEGACY_LANSY_HH
12
15
16namespace tlapack {
17namespace legacy {
18
42 template <class norm_t, typename TA>
44 norm_t normType, Uplo uplo, idx_t n, const TA* A, idx_t lda)
45 {
46 using internal::create_matrix;
47
48 // check arguments
49 tlapack_check_false(normType != Norm::Fro && normType != Norm::Inf &&
50 normType != Norm::Max && normType != Norm::One);
51 tlapack_check_false(uplo != Uplo::Lower && uplo != Uplo::Upper);
52
53 // quick return
54 if (n == 0) return 0;
55
56 // Matrix views
57 auto A_ = create_matrix<TA>((TA*)A, n, n, lda);
58
59 return lansy(normType, uplo, A_);
60 }
61
62} // namespace legacy
63} // namespace tlapack
64
65#endif // TLAPACK_LEGACY_LANSY_HH
Uplo
Definition types.hpp:45
#define tlapack_check_false(cond)
Throw an error if cond is true.
Definition exceptionHandling.hpp:113
real_type< TA > lansy(norm_t normType, Uplo uplo, 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 lansy.hpp:43
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