Rheolef  7.1
an efficient C++ finite element environment
functional_sgi_ext.h
Go to the documentation of this file.
1 #ifndef _RHEOLEF_FUNCTIONAL_SGI_EXT_H
2 #define _RHEOLEF_FUNCTIONAL_SGI_EXT_H
3 namespace rheolef {
24  template <class _Operation1, class _Operation2>
26  : public std::unary_function<typename _Operation2::argument_type,
27  typename _Operation1::result_type>
28  {
29  protected:
30  _Operation1 _M_fn1;
31  _Operation2 _M_fn2;
32 
33  public:
34  unary_compose(const _Operation1& __x, const _Operation2& __y)
35  : _M_fn1(__x), _M_fn2(__y) {}
36 
37  typename _Operation1::result_type
38  operator()(const typename _Operation2::argument_type& __x) const
39  { return _M_fn1(_M_fn2(__x)); }
40  };
41 
42  template <class _Operation1, class _Operation2>
43  inline unary_compose<_Operation1, _Operation2>
44  compose1(const _Operation1& __fn1, const _Operation2& __fn2)
45  { return unary_compose<_Operation1,_Operation2>(__fn1, __fn2); }
46 
47  template <class _Operation1, class _Operation2, class _Operation3>
49  : public std::unary_function<typename _Operation2::argument_type,
50  typename _Operation1::result_type>
51  {
52  protected:
53  _Operation1 _M_fn1;
54  _Operation2 _M_fn2;
55  _Operation3 _M_fn3;
56 
57  public:
58  binary_compose(const _Operation1& __x, const _Operation2& __y,
59  const _Operation3& __z)
60  : _M_fn1(__x), _M_fn2(__y), _M_fn3(__z) { }
61 
62  typename _Operation1::result_type
63  operator()(const typename _Operation2::argument_type& __x) const
64  { return _M_fn1(_M_fn2(__x), _M_fn3(__x)); }
65  };
66 
67  template <class _Operation1, class _Operation2, class _Operation3>
68  inline binary_compose<_Operation1, _Operation2, _Operation3>
69  compose2(const _Operation1& __fn1, const _Operation2& __fn2,
70  const _Operation3& __fn3)
72  (__fn1, __fn2, __fn3); }
73 
74 } // namespace rheolef
75 #endif // _RHEOLEF_FUNCTIONAL_SGI_EXT_H
rheolef::binary_compose::_M_fn1
_Operation1 _M_fn1
Definition: functional_sgi_ext.h:53
rheolef::unary_compose
Definition: functional_sgi_ext.h:28
rheolef::binary_compose::_M_fn3
_Operation3 _M_fn3
Definition: functional_sgi_ext.h:55
rheolef::compose2
binary_compose< _Operation1, _Operation2, _Operation3 > compose2(const _Operation1 &__fn1, const _Operation2 &__fn2, const _Operation3 &__fn3)
Definition: functional_sgi_ext.h:69
rheolef::binary_compose::operator()
_Operation1::result_type operator()(const typename _Operation2::argument_type &__x) const
Definition: functional_sgi_ext.h:63
rheolef::unary_compose::_M_fn1
_Operation1 _M_fn1
Definition: functional_sgi_ext.h:30
rheolef::binary_compose::binary_compose
binary_compose(const _Operation1 &__x, const _Operation2 &__y, const _Operation3 &__z)
Definition: functional_sgi_ext.h:58
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
rheolef::unary_compose::unary_compose
unary_compose(const _Operation1 &__x, const _Operation2 &__y)
Definition: functional_sgi_ext.h:34
rheolef::unary_compose::_M_fn2
_Operation2 _M_fn2
Definition: functional_sgi_ext.h:31
rheolef::binary_compose
Definition: functional_sgi_ext.h:51
rheolef::compose1
unary_compose< _Operation1, _Operation2 > compose1(const _Operation1 &__fn1, const _Operation2 &__fn2)
Definition: functional_sgi_ext.h:44
rheolef::unary_compose::operator()
_Operation1::result_type operator()(const typename _Operation2::argument_type &__x) const
Definition: functional_sgi_ext.h:38
rheolef::binary_compose::_M_fn2
_Operation2 _M_fn2
Definition: functional_sgi_ext.h:54