DFT-EFE
 
Loading...
Searching...
No Matches
PointImpl.h
Go to the documentation of this file.
1#ifndef dftefePointImpl_h
2#define dftefePointImpl_h
3#include "TypeConfig.h"
4#include <iostream>
5#include <vector>
6
7namespace dftefe
8{
9 namespace utils
10 {
11 template <typename T>
13 {
14 typedef T value_type;
15 typedef T * pointer;
16 typedef T & reference;
17 typedef const T &const_reference;
18 typedef int difference_type;
19 typedef T * iterator;
20 typedef const T *const_iterator;
21
22 public:
29 PointImpl(const std::vector<T> &x);
30
37 PointImpl(const T *x, size_type N);
38
46
55
60 PointImpl(const PointImpl &p);
61
65 ~PointImpl();
66
67
73 size() const;
74
82 begin();
83
92 begin() const;
93
100 end();
101
109 end() const;
110
115 T *
116 data() noexcept;
117
122 const T *
123 data() const noexcept;
124
131 PointImpl &
132 operator=(const PointImpl &p);
133
141 operator[](size_type i);
142
150 operator[](size_type i) const;
151
152
153 private:
156 };
157
158 //
159 // A list of helper functions to operate on PointImpl
160 //
161
170 template <typename T>
171 PointImpl<T> &
172 operator*=(PointImpl<T> &p, T a);
173
182 template <typename T>
183 PointImpl<T>
184 operator*(const PointImpl<T> &p, T a);
185
195 template <typename T>
196 PointImpl<T>
197 operator*(T a, const PointImpl<T> &p);
198
209 template <typename T>
210 PointImpl<T> &
211 operator+=(PointImpl<T> &p, const PointImpl<T> &q);
212
223 template <typename T>
224 PointImpl<T>
225 operator+(const PointImpl<T> &v, const PointImpl<T> &u);
226
237 template <typename T>
238 PointImpl<T> &
239 operator-=(PointImpl<T> &p, const PointImpl<T> &q);
240
251 template <typename T>
252 PointImpl<T>
253 operator-(const PointImpl<T> &p, const PointImpl<T> &q);
254
255
265 template <typename T>
266 std::ostream &
267 operator<<(std::ostream &outputStream, const PointImpl<T> &p);
268
273 template <typename T>
274 std::vector<T>
275 flatten(const std::vector<PointImpl<T>> &pts);
276
277 } // end of namespace utils
278} // end of namespace dftefe
279
280#include "PointImpl.t.cpp"
281
282#endif // dftefePointImpl_h
Definition: PointImpl.h:13
~PointImpl()
Destructor.
Definition: PointImpl.t.cpp:75
T * iterator
Definition: PointImpl.h:19
const T * const_iterator
Definition: PointImpl.h:20
T & reference
Definition: PointImpl.h:16
size_type d_size
Definition: PointImpl.h:155
size_type size() const
Returns the dimension of the point.
Definition: PointImpl.t.cpp:124
iterator end()
Return iterator pointing to the end of PointImpl data.
Definition: PointImpl.t.cpp:107
iterator begin()
Return iterator pointing to the begining of point data.
Definition: PointImpl.t.cpp:86
T value_type
Definition: PointImpl.h:14
pointer d_data
Definition: PointImpl.h:154
T * data() noexcept
Return the raw pointer to the Vector.
Definition: PointImpl.t.cpp:131
int difference_type
Definition: PointImpl.h:18
T * pointer
Definition: PointImpl.h:15
const T & const_reference
Definition: PointImpl.h:17
std::vector< T > flatten(const std::vector< PointImpl< T > > &pts)
Flatten a vector of points into a contiguous coordinate array. Output layout: [x0,...
Definition: PointImpl.t.cpp:242
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
std::uint64_t size_type
Definition: TypeConfig.h:9