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
unaryfunctor.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: 2005-07-17
7 
8  Copyright (C) 2005,2006 EPFL
9  Copyright (C) 2007 Universite Joseph Fourier (Grenoble I)
10 
11  This library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU Lesser General Public
13  License as published by the Free Software Foundation; either
14  version 3.0 of the License, or (at your option) any later version.
15 
16  This library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  Lesser General Public License for more details.
20 
21  You should have received a copy of the GNU Lesser General Public
22  License along with this library; if not, write to the Free Software
23  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 */
30 #ifndef __UnaryFunctor_H
31 #define __UnaryFunctor_H 1
32 
34 
35 namespace Feel
36 {
37 namespace vf
38 {
40 
47 template<typename T = double>
48 class UnaryFunctor
49 {
50 public:
51 
52  typedef T value_type;
53  typedef FunctorDomain<value_type> functordomain_type;
54  typedef boost::shared_ptr<functordomain_type> functordomain_ptrtype;
58 
59  UnaryFunctor( std::string const& name,
60  functordomain_ptrtype const& domain = functordomain_ptrtype( new UnboundedDomain<value_type>() ) )
61  :
62  M_name( name ),
63  M_domain( domain )
64  {}
65 
66  UnaryFunctor( UnaryFunctor const & uf )
67  :
68  M_name( uf.M_name ),
69  M_domain( uf.M_domain )
70  {}
71 
72  virtual ~UnaryFunctor()
73  {}
74 
76 
80 
84  std::string const& name() const
85  {
86  return M_name;
87  }
88 
89 
93  functordomain_ptrtype const& domain() const
94  {
95  return M_domain;
96  }
97 
99 
103 
112  virtual void eval( int nx, value_type const* x, value_type* f ) const = 0;
113 
114 
116 
117 
118 
119 protected:
120 
121 private:
122  std::string M_name;
123 
124  functordomain_ptrtype M_domain;
125 
126 };
128 }
129 }
130 #endif /* __UnaryFunctor_H */

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