<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
lange.hpp
Go to the documentation of this file.
1
5//
6// Copyright (c) 2021-2023, University of Colorado Denver. All rights reserved.
7//
8// This file is part of <T>LAPACK.
9// <T>LAPACK is free software: you can redistribute it and/or modify it under
10// the terms of the BSD 3-Clause license. See the accompanying LICENSE file.
11
12#ifndef TLAPACK_LEGACY_LANGE_HH
13#define TLAPACK_LEGACY_LANGE_HH
14
16
17namespace tlapack {
18namespace legacy {
19
41 template <class norm_t, typename TA>
43 norm_t normType, idx_t m, idx_t n, const TA* A, idx_t lda)
44 {
45 using internal::create_matrix;
46
47 // check arguments
48 tlapack_check_false(normType != Norm::Fro && normType != Norm::Inf &&
49 normType != Norm::Max && normType != Norm::One);
50
51 // quick return
52 if (m == 0 || n == 0) return 0;
53
54 // Views
55 auto A_ = create_matrix<TA>((TA*)A, m, n, lda);
56
57 return lange(normType, A_);
58 }
59
60} // namespace legacy
61} // namespace tlapack
62
63#endif // TLAPACK_LEGACY_LANGE_HH
#define tlapack_check_false(cond)
Throw an error if cond is true.
Definition exceptionHandling.hpp:113
real_type< TA > lange(norm_t normType, 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 lange.hpp:42
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