Free Electron
evaluate.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __evaluate_h__
8 #define __evaluate_h__
9 
10 #include "fe/plugin.h"
11 #include "fe/data.h"
12 #include "math/math.h"
13 
14 namespace fe
15 {
16 namespace ext
17 {
18 
19 // these abstractions of std are probably unnecessary going forward?
20 template <typename T>
21 class t_stdvector : public std::vector<T>
22 {
23  public:
24  t_stdvector() {}
25  t_stdvector(size_t a_size) : std::vector<T>(a_size) {}
26  void sort(void)
27  {
28  std::sort((*this).begin(), (*this).end());
29  }
30  template <class Compare>
31  void sort(Compare compare)
32  {
33  std::sort((*this).begin(), (*this).end(), compare);
34  }
35  bool includes(t_stdvector &a_other)
36  {
37  return std::includes<
38  typename std::vector<T>::iterator,
39  typename std::vector<T>::iterator >
40  ( (*this).begin(), (*this).end(),
41  a_other.begin(), a_other.end());
42  }
43 
44 };
45 
46 class t_stdstring : public std::string
47 {
48  public:
49  t_stdstring(void) {}
50  t_stdstring(const char * a_string) : std::string(a_string) {}
51  t_stdstring(const char * a_string, int a_i) : std::string(a_string, a_i) {}
52  t_stdstring(size_t a_size, char a_c) : std::string(a_size, a_c) {}
53  t_stdstring(const t_stdstring &a_other) : std::string(a_other) {}
54  t_stdstring(const std::string &a_other) : std::string(a_other) {}
55  t_stdstring &operator = (const t_stdstring &a_other)
56  {
57  std::string::operator=(a_other);
58  return *this;
59  }
60 };
61 
62 template <typename T>
63 class t_stdlist : public std::list<T>
64 {
65  public:
66  t_stdlist(void) {}
67  t_stdlist(const t_stdlist<T> &a_other) : std::list<T>(a_other) {}
68  t_stdlist(const std::list<T> &a_other) : std::list<T>(a_other) {}
69  t_stdlist<T> &operator = (const t_stdlist<T> &a_other)
70  {
71  std::list<T>::operator=(a_other);
72  return *this;
73  }
74 };
75 
76 template <typename K, typename V>
77 class t_stdmap : public std::map<K,V>
78 {
79  public:
80  t_stdmap(void) {}
81  t_stdmap(const t_stdmap<K,V> &a_other) : std::map<K,V>(a_other) {}
82  t_stdmap(const std::map<K,V> &a_other) : std::map<K,V>(a_other) {}
83  t_stdmap<K,V> &operator = (const t_stdmap<K,V> &a_other)
84  {
85  std::map<K,V>::operator=(a_other);
86  return *this;
87  }
88 };
89 
90 
91 class t_stdostringstream : public std::ostringstream
92 {
93  public:
94  t_stdostringstream(void) {}
95 };
96 
97 class t_stdistringstream : public std::istringstream
98 {
99  public:
100  t_stdistringstream(void) {}
101  t_stdistringstream(const t_stdstring &a_string) : std::istringstream(a_string) {}
102 };
103 
104 
105 typedef double t_eval_real;
106 
107 } /* namespace ext */
108 } /* namespace fe */
109 
110 
111 #include "evaluate/FunctionI.h"
112 #include "evaluate/EvaluatorI.h"
113 
114 
115 #endif /* __evaluate_h__ */
116 
kernel
Definition: namespace.dox:3
Definition: gtest-internal.h:1322