BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
fn_norm.hpp
Go to the documentation of this file.
1/*
2 * BELFEM -- The Berkeley Lab Finite Element Framework
3 * Copyright (c) 2026, The Regents of the University of California,
4 * through Lawrence Berkeley National Laboratory (subject to receipt of any required
5 * approvals from the U.S. Dept. of Energy). All rights reserved.
6 *
7 * Developers: Christian Messe, Gregory Giard
8 *
9 * See the top-level LICENSE file for the complete license and disclaimer.
10 */
11
17
25
26#ifndef BELFEM_FN_NORM_HPP
27#define BELFEM_FN_NORM_HPP
28
29#include "cl_Vector.hpp"
30
31namespace belfem
32{
33//------------------------------------------------------------------------------
34
35#ifdef BELFEM_ARMADILLO
36 template< typename ET >
37 auto
38 norm( ET & aA )
39 ->decltype( arma::norm( aA, 2 ) )
40 {
41 return arma::norm( aA, 2 );
42 }
43#elif BELFEM_BLAZE
44 template< typename ET >
45 auto
46 norm( ET & aA )
47 ->decltype( blaze::norm( aA ) )
48 {
49 return blaze::norm( aA );
50 }
51#endif
52// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
53
54 template< typename T >
55 auto
56 norm( const Vector< T > & aA )
57 -> decltype( norm( aA.vector_data() ) )
58 {
59 return norm( aA.vector_data() );
60 }
61
62//------------------------------------------------------------------------------
63
64}
65#endif //BELFEM_FN_NORM_HPP
Column vector.
Definition cl_BZ_Vector.hpp:41
auto norm(const Vector< T > &aA) -> decltype(norm(aA.vector_data()))
Euclidean (L2) norm of a vector.
Definition fn_norm.hpp:56
USER GUIDES:
Definition cl_Capacitor.cpp:16