Dune Core Modules (2.5.0)

function.hh
Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_FUNCTION_HH
4#define DUNE_FUNCTION_HH
5
6
7#include "typetraits.hh"
8
9namespace Dune {
10
26 template <class Domain, class Range>
28 {
29 typedef typename std::remove_cv<typename std::remove_reference< Domain >::type >::type RawDomainType;
30 typedef typename std::remove_cv<typename std::remove_reference< Range >::type >::type RawRangeType;
31
32 public:
33
35 typedef RawRangeType RangeType;
36
38 typedef RawDomainType DomainType;
39
41 struct Traits
42 {
43 typedef RawDomainType DomainType;
44 typedef RawRangeType RangeType;
45 };
46
53 void evaluate(const typename Traits::DomainType& x, typename Traits::RangeType& y) const;
54 }; // end of Function class
55
56
57
65 template <class DomainType, class RangeType>
67 public Function<const DomainType&, RangeType&>
68 {
69 public:
71
72 virtual ~VirtualFunction() {}
79 virtual void evaluate(const typename Traits::DomainType& x, typename Traits::RangeType& y) const = 0;
80 }; // end of VirtualFunction class
81
84} // end namespace
85
86#endif
Base class template for function classes.
Definition: function.hh:28
RawDomainType DomainType
Raw type of output variable with removed reference and constness.
Definition: function.hh:38
void evaluate(const typename Traits::DomainType &x, typename Traits::RangeType &y) const
Function evaluation.
RawRangeType RangeType
Raw type of input variable with removed reference and constness.
Definition: function.hh:35
Virtual base class template for function classes.
Definition: function.hh:68
virtual void evaluate(const typename Traits::DomainType &x, typename Traits::RangeType &y) const =0
Function evaluation.
Dune namespace.
Definition: alignment.hh:11
Traits class containing raw types.
Definition: function.hh:42
Traits for type conversions and type information.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)