<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
nrm2.hpp
Go to the documentation of this file.
1
8//
9// Copyright (c) 2017-2021, University of Tennessee. All rights reserved.
10// Copyright (c) 2021-2023, University of Colorado Denver. All rights reserved.
11//
12// This file is part of <T>LAPACK.
13// <T>LAPACK is free software: you can redistribute it and/or modify it under
14// the terms of the BSD 3-Clause license. See the accompanying LICENSE file.
15
16#ifndef TLAPACK_LEGACY_NRM2_HH
17#define TLAPACK_LEGACY_NRM2_HH
18
19#include "tlapack/blas/nrm2.hpp"
22
23namespace tlapack {
24namespace legacy {
25
43 template <typename T>
44 real_type<T> nrm2(idx_t n, T const* x, int_t incx)
45 {
47
48 // quick return
49 if (n <= 0) return 0;
50
52 return nrm2(x_));
53 }
54
55} // namespace legacy
56} // namespace tlapack
57
58#endif // #ifndef TLAPACK_LEGACY_NRM2_HH
#define tlapack_check_false(cond)
Throw an error if cond is true.
Definition exceptionHandling.hpp:113
real_type< T > nrm2(idx_t n, T const *x, int_t incx)
Definition nrm2.hpp:44
#define tlapack_expr_with_vector_positiveInc(x, TX, n, X, incx, expr)
Creates a vector object and executes an expression with it.
Definition utils.hpp:106
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