Logo  0.95.0-final
Finite Element Embedded Library and Language in C++
Feel++ Feel++ on Github Feel++ community
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
norm.hpp
Go to the documentation of this file.
1 /* -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2 
3  This file is part of the Feel library
4 
5  Author(s): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
6  Date: 2010-04-17
7 
8  Copyright (C) 2010 Universite Joseph Fourier (Grenoble I)
9 
10  This library is free software; you can redistribute it and/or
11  modify it under the terms of the GNU Lesser General Public
12  License as published by the Free Software Foundation; either
13  version 3.0 of the License, or (at your option) any later version.
14 
15  This library is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public
21  License along with this library; if not, write to the Free Software
22  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 */
29 #ifndef __norm_H
30 #define __norm_H 1
31 
32 namespace Feel
33 {
34 namespace vf
35 {
43 template<typename ExprL, typename ExprR>
44 inline
45 auto
46 outer_prod( ExprL l, ExprR r ) -> decltype( l * trans( r ) )
47 {
48  return l * trans( r );
49 }
50 
58 template<typename ExprL, typename ExprR>
59 inline
60 auto
61 inner_prod( ExprL l, ExprR r ) -> decltype( trace( trans( l ) * r ) )
62 {
63  return trace( trans( l ) * r );
64 }
65 #if 0
66 
73 template<typename ExprL, typename ExprR>
74 inline
75 auto
76 dot( ExprL l, ExprR r ) -> decltype( trans( l ) * r )
77 {
78  return trans( l ) * r;
79 }
80 #endif
81 
88 template<typename ExprL, typename ExprR>
89 inline
90 auto
91 ddot( ExprL l, ExprR r ) -> decltype( trace( trans( l ) * r ) )
92 {
93  return trace( trans( l ) * r );
94 }
95 
103 template<typename ExprT>
104 inline
105 auto
106 norm2( ExprT v ) -> decltype( sqrt( inner_prod( v, v ) ) )
107 {
108  return sqrt( inner_prod( v, v ) );
109 }
110 
111 } // vf
112 
113 
114 } // feel
115 #endif /* __norm_H */

Generated on Sun Dec 22 2013 13:11:09 for Feel++ by doxygen 1.8.5